Explorar o código

清空添加列表

zhulizhen1111 %!s(int64=4) %!d(string=hai) anos
pai
achega
7499916ce5
Modificáronse 2 ficheiros con 17 adicións e 4 borrados
  1. 4 3
      src/views/legendLibrary/addForm.vue
  2. 13 1
      src/views/legendLibrary/addLegend.vue

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

@@ -18,7 +18,7 @@
             </div>
             <div class='input-right' v-if='ruleForm.Type=="Zone" || ruleForm.Type=="Icon" || ruleForm.Type =="Line"'>
                 <div v-if=' ruleForm.Type=="Icon" ' class='input-right'>
-                    <img :src='`/serve/Picture/query/${imgSrc}`' alt />
+                    <img :src='`/serve/Picture/query/${ruleForm.Url}`' alt />
                 </div>
                 <div
                     v-else-if='ruleForm.Type=="Zone" '
@@ -155,7 +155,7 @@ export default {
                 }
             ],
             fileList: [],
-            imgSrc: '', //图标的key,/serve/Picture/query/${imgSrc}
+            // this.ruleForm.Url 图标的key,/serve/Picture/query/${this.ruleForm.Url}
             value: '',
             linepxObject: {},
             borderLineOptionObject: {}
@@ -170,8 +170,9 @@ export default {
             let postParams = formData
             uploadImg({ postParams }).then(res => {
                 if (res.Result == 'success') {
-                    this.imgSrc = res.EntityList[0]
+                    this.$set(this.ruleForm, 'Url', res.EntityList[0])
                     this.$message.success('图标上传成功!')
+                    this.fileList = []
                 }
             })
         },

+ 13 - 1
src/views/legendLibrary/addLegend.vue

@@ -22,7 +22,8 @@ export default {
                 Name: '',
                 Type: 'None',
                 Unit: '',
-                FillColor: ''
+                FillColor: '',
+                Url: ''
             },
             title: '',
             GraphCategoryId: ''
@@ -48,14 +49,25 @@ export default {
                 this.$refs.searchList.queryAll()
             }
         },
+        cancal() {
+            this.info = {
+                Name: '',
+                Type: 'None',
+                Unit: '',
+                FillColor: '',
+                Url: ''
+            }
+        },
         mesg() {
             this.$emit('mesg')
         },
         updateSuccess() {
             this.$emit('updateSuccess')
+            this.cancal()
         },
         addSuccess() {
             this.$emit('addSuccess')
+            this.cancal()
         },
         save() {
             this.dialogVisible = false