|
@@ -42,7 +42,7 @@
|
|
|
<div v-show='ruleForm.Type=="Zone" || ruleForm.Type=="Image" || ruleForm.Type =="Line"'>
|
|
|
<div style='color:#646C73'>展示预览</div>
|
|
|
<div class='input-right' ref='graph'>
|
|
|
- <canvas id='canvas' :width='canvasWidth' :height='canvasHeight' v-show='!ruleForm.Url'></canvas>
|
|
|
+ <canvas id='canvas' :width='canvasWidth' :height='canvasHeight'></canvas>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -243,7 +243,6 @@ export default {
|
|
|
var reader = new FileReader()
|
|
|
reader.readAsDataURL(this.file)
|
|
|
reader.onload = e => {
|
|
|
- console.log(this.view)
|
|
|
this.view.url = e.target.result
|
|
|
}
|
|
|
},
|
|
@@ -304,9 +303,11 @@ export default {
|
|
|
this.view.strokecolor = this.ruleForm.Color
|
|
|
this.view.lineType = this.ruleForm.LineDash
|
|
|
this.view.lineWidth = this.ruleForm.LineWidth
|
|
|
- if (this.ruleForm.Url) {
|
|
|
+ if (this.ruleForm.Url && type == 2) {
|
|
|
let url = `/serve/topology-wanda/Picture/query/${this.ruleForm.Url}`
|
|
|
this.view.url = url
|
|
|
+ } else {
|
|
|
+ this.view.url = ''
|
|
|
}
|
|
|
},
|
|
|
initGraph() {
|
|
@@ -458,16 +459,15 @@ export default {
|
|
|
if (res.Result == 'success') {
|
|
|
this.$set(vm.ruleForm, 'Url', res.EntityList[0])
|
|
|
this.$message.success('图标上传成功!')
|
|
|
- // if (this.title == '添加图例库') {
|
|
|
- // this.create()
|
|
|
- // this.$emit('addSuccess')
|
|
|
- // this.view.canvas.clearRect(0, 0, this.width, this.height)
|
|
|
- // } else if (this.title == '修改图例库') {
|
|
|
- // this.update()
|
|
|
- // this.$emit('updateSuccess')
|
|
|
- // this.view.canvas.clearRect(0, 0, this.width, this.height)
|
|
|
- // } else {
|
|
|
- // }
|
|
|
+ if (this.title == '添加图例库') {
|
|
|
+ this.create()
|
|
|
+ this.$emit('addSuccess')
|
|
|
+ this.view.canvas.clearRect(0, 0, this.width, this.height)
|
|
|
+ } else if (this.title == '修改图例库') {
|
|
|
+ this.update()
|
|
|
+ this.$emit('updateSuccess')
|
|
|
+ this.view.canvas.clearRect(0, 0, this.width, this.height)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -544,16 +544,22 @@ export default {
|
|
|
this.changeLineType(this.ruleForm.LineDash)
|
|
|
this.initGraph()
|
|
|
}
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ 'ruleForm.Id':{
|
|
|
+ handler(){
|
|
|
+ this.initQueryDeviceAndPOsition()
|
|
|
+ this.visualization()
|
|
|
+ if (this.title == '修改图例库') {
|
|
|
+ if (this.ruleForm.Type != 'Image') {
|
|
|
+ this.changeLineWidth(this.ruleForm.LineWidth)
|
|
|
+ this.changeLineType(this.ruleForm.LineDash)
|
|
|
+ }
|
|
|
+ this.initGraph()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- // updated() {
|
|
|
- // this.initQueryDeviceAndPOsition()
|
|
|
- // this.visualization()
|
|
|
- // if (this.title == '修改图例库') {
|
|
|
- // this.changeLineWidth(this.ruleForm.LineWidth)
|
|
|
- // this.changeLineType(this.ruleForm.LineDash)
|
|
|
- // this.initGraph()
|
|
|
- // }
|
|
|
- // }
|
|
|
}
|
|
|
</script>
|
|
|
|