qinzhipeng_v 5 年之前
父節點
當前提交
937553507a
共有 2 個文件被更改,包括 13 次插入2 次删除
  1. 4 1
      src/views/Platform/bugManage/bugCreate.vue
  2. 9 1
      src/views/Platform/bugManage/bugUpdate.vue

+ 4 - 1
src/views/Platform/bugManage/bugCreate.vue

@@ -233,6 +233,7 @@ export default {
       userData: '',
       businessTypeShow: false,
       moduleTypeShow: false,
+      accessory: '',
       userInformation: localStorage.getItem('username'),
       userNames: localStorage.getItem('realname'),
       fileDbList: [{ name: '智慧平台.png', url: 'http://pt-starimg.didistatic.com/static/starimg/node/qo4sKioLko1571277086594.png' }, { name: '智慧平台.png', url: 'http://pt-starimg.didistatic.com/static/starimg/node/qo4sKioLko1571277086594.png' }]
@@ -253,7 +254,8 @@ export default {
       for (var a of this.fileList) {
         this.fileDbList.push({ 'name': a.name, 'url': 'http:' + a.response.url })
       }
-      this.$set(this.form, 'accessory', JSON.stringify(this.fileDbList))
+      this.accessory = JSON.stringify(this.fileDbList)
+      // this.$set(this.form, 'accessory', JSON.stringify(this.fileDbList))
       // localStorage.setItem('updata', JSON.stringify(this.fileDbList))
       // }, 500)
     },
@@ -340,6 +342,7 @@ export default {
           if (this.$route.query.id && typeof this.form.bizId === 'string') {
             form.bizId = this.bizOptions.filter(value => value.name === form.bizId)[0].code
           }
+          form.accessory = this.accessory
           form.reopenTimes = parseInt(form.reopenTimes)
           form.projectId = this.taskIdStr.filter(value => value.id === this.form.taskId)[0].projectId
           this.userData = { id: '', ename: this.userInformation, name: this.userNames }

+ 9 - 1
src/views/Platform/bugManage/bugUpdate.vue

@@ -247,7 +247,8 @@ export default {
       businessTypeShow: false,
       moduleTypeShow: false,
       userInformation: localStorage.getItem('username'),
-      userNames: localStorage.getItem('realname')
+      userNames: localStorage.getItem('realname'),
+      accessory: ''
     }
   },
   created() {
@@ -267,7 +268,13 @@ export default {
       this.$refs.upload.submit()
     },
     handleChange(file, fileList) {
+      this.fileDbList = []
       this.fileList = fileList.slice(-3)
+      for (var a of this.fileList) {
+        this.fileDbList.push({ 'name': a.name, 'url': 'http:' + a.response.url })
+      }
+      this.accessory = JSON.stringify(this.fileDbList)
+      // this.$set(this.form, 'accessory', JSON.stringify(this.fileDbList))
     },
     async _initBegin() {
       await bugGetEnum().then(res => {
@@ -346,6 +353,7 @@ export default {
     createFormData(form) {
       this.$refs.form.validate((valid) => {
         if (valid) {
+          form.accessory = this.accessory
           form.reopenTimes = parseInt(form.reopenTimes)
           this.userData = { id: '', ename: this.userInformation, name: this.userNames }
           this.objData = { bugBaseInfo: form, user: this.userData }