Przeglądaj źródła

update libranry

zhulizhen1111 4 lat temu
rodzic
commit
fb6c7eb2e3
1 zmienionych plików z 9 dodań i 3 usunięć
  1. 9 3
      src/views/legendLibrary/addForm.vue

+ 9 - 3
src/views/legendLibrary/addForm.vue

@@ -277,7 +277,6 @@ export default {
             let postParams = {
                 Content: [this.ruleForm]
             }
-
             updateLegend({ postParams }).then(res => {
                 if (res.Result == 'success') {
                     this.$message.success('图例修改成功!')
@@ -391,8 +390,14 @@ export default {
         },
         // 把canvas图保存到图片服务器
         saveImg() {
-            let vm = this
-            if (this.view) {
+            let vm = this 
+            if(!this.file){
+                 //修改图片的时候没有重新上传图片
+                this.update()
+                this.$emit('updateSuccess')
+                this.view.canvas.clearRect(0, 0, this.width, this.height)
+            }else{
+                 if (this.view) {
                 let data = this.view.canvasView.toDataURL('image/png')
                 var formData = new FormData()
                 if (this.ruleForm.Type == 'Zone' || this.ruleForm.Type == 'Line') {
@@ -417,6 +422,7 @@ export default {
                     }
                 })
             }
+            }
         },
         // 铺位可视化
         treeConfirm(data) {