Browse Source

Merge branch 'prod' into develop

scorpio 2 years ago
parent
commit
0ad5f128fa
2 changed files with 12 additions and 6 deletions
  1. 3 2
      src/views/task/component/task.vue
  2. 9 4
      src/views/task/component/wt-label.vue

+ 3 - 2
src/views/task/component/task.vue

@@ -78,7 +78,7 @@
           <div>
             <wt-label
               @submit="handleTags"
-              :ids="form.tags.split(',')"
+              :ids="[form.tags, form.category]"
               :disabled="!canEdit"
             />
           </div>
@@ -421,7 +421,8 @@ export default {
       this.form.executeUser = list.map(ele => ele.id).join(',')
     },
     handleTags(tags) {
-      this.form.tags = tags
+      this.form.tags = tags.find(ele => ele.type === 'tags').id
+      this.form.category = tags.find(ele => ele.type === 'category').id
     },
     /**
      * 成果文件上传成果

+ 9 - 4
src/views/task/component/wt-label.vue

@@ -80,7 +80,10 @@ export default {
     init() {
       this.$api.common.dicList({ code: 'edit_task_type' }).then(res => {
         if (res.code === 200) {
-          this.options = res.data
+          this.options = res.data.map(ele => {
+            ele.type = 'tags'
+            return ele
+          })
           if (this.ids.length > 0) {
             const tmp = this.options.find(ele => ele.id === this.ids[0])
             if (tmp) {
@@ -91,7 +94,10 @@ export default {
       })
       this.$api.common.dicList({ code: 'edit_task' }).then(res => {
         if (res.code === 200) {
-          this.options1 = res.data
+          this.options1 = res.data.map(ele => {
+            ele.type = 'category'
+            return ele
+          })
           if (this.ids.length > 1) {
             const tmp = this.options1.find(ele => ele.id === this.ids[1])
             this.tags.push(tmp)
@@ -106,8 +112,7 @@ export default {
       ]
       this.show = false
       this.form = {}
-      const tmps = this.tags.map(ele => ele.id).join(',')
-      this.$emit('submit', tmps)
+      this.$emit('submit', this.tags)
     },
     remove(res) {
       this.tags = this.tags.filter(ele => ele.id !== res.id)