|
@@ -17,7 +17,7 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class='input-right' ref='graph' v-show='ruleForm.Type=="Zone" || ruleForm.Type=="Image" || ruleForm.Type =="Line"'>
|
|
|
- <div v-if=' ruleForm.Type=="Image" ' class='input-right'>
|
|
|
+ <div v-if=' ruleForm.Type=="Image" && ruleForm.Url' class='input-right'>
|
|
|
<img :src='`/serve/Picture/query/${ruleForm.Url}`' alt />
|
|
|
</div>
|
|
|
<canvas id='canvas' :width='canvasWidth' :height='canvasHeight' v-else></canvas>
|
|
@@ -156,8 +156,12 @@ export default {
|
|
|
fileList: [],
|
|
|
// this.ruleForm.Url 图标的key,/serve/Picture/query/${this.ruleForm.Url}
|
|
|
value: '',
|
|
|
- linepxObject: {},
|
|
|
- borderLineOptionObject: {},
|
|
|
+ linepxObject: {
|
|
|
+ src: ''
|
|
|
+ },
|
|
|
+ borderLineOptionObject: {
|
|
|
+ src: ''
|
|
|
+ },
|
|
|
canvasWidth: 200,
|
|
|
canvasHeight: 114,
|
|
|
view: null,
|
|
@@ -165,11 +169,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
props: ['ruleForm', 'title'],
|
|
|
- updated() {
|
|
|
- this.changeLineWidth(this.ruleForm.LineWidth)
|
|
|
- this.changeLineType(this.ruleForm.LineDash)
|
|
|
- this.initGraph()
|
|
|
- },
|
|
|
methods: {
|
|
|
getFile(file) {
|
|
|
var formData = new FormData()
|
|
@@ -264,7 +263,7 @@ export default {
|
|
|
changeLineType(val) {
|
|
|
this.$set(this.ruleForm, 'LineDash', val)
|
|
|
this.borderLineOptionObject = val && this.borderLineOption.find(item => item.id == val)
|
|
|
- if (this.$refs.select1) {
|
|
|
+ if (this.$refs.select1 && this.$refs.select1.$el) {
|
|
|
this.$refs.select1.$el.children[0].children[0].setAttribute(
|
|
|
'style',
|
|
|
'background:url(' + this.borderLineOptionObject.src + ') center center no-repeat;color:transparent;'
|
|
@@ -278,7 +277,7 @@ export default {
|
|
|
changeLineWidth(val) {
|
|
|
this.$set(this.ruleForm, 'LineWidth', val)
|
|
|
this.linepxObject = val && this.linepxOption.find(item => item.id == val)
|
|
|
- if (this.$refs.select) {
|
|
|
+ if (this.$refs.select && this.$refs.select.$el) {
|
|
|
this.$refs.select.$el.children[0].children[0].setAttribute(
|
|
|
'style',
|
|
|
'background:url(' + this.linepxObject.src + ') center center no-repeat;color:transparent;'
|
|
@@ -329,9 +328,18 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.changeLineWidth(this.ruleForm.LineWidth)
|
|
|
- this.changeLineType(this.ruleForm.LineDash)
|
|
|
- this.initGraph()
|
|
|
+ if (this.title == '修改图例库') {
|
|
|
+ this.changeLineWidth(this.ruleForm.LineWidth)
|
|
|
+ this.changeLineType(this.ruleForm.LineDash)
|
|
|
+ this.initGraph()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ updated() {
|
|
|
+ if (this.title == '修改图例库') {
|
|
|
+ this.changeLineWidth(this.ruleForm.LineWidth)
|
|
|
+ this.changeLineType(this.ruleForm.LineDash)
|
|
|
+ this.initGraph()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|