Browse Source

合并http

qinzhipeng_v 5 years ago
parent
commit
1c417c4dbe

+ 5 - 2
src/views/Platform/presentation/Acceptance.vue

@@ -248,7 +248,8 @@ export default {
       pftResult: '',
       safeResult: '',
       Tsk: [],
-      moniterResult: ''
+      moniterResult: '',
+      accpId: ''
     }
   },
   created() {
@@ -492,6 +493,7 @@ export default {
       this.ClientData.safeResult = this.safeResult
       this.ClientData.moniterResult = this.moniterResult
       this.ClientData.status = this.status
+      this.ClientData.id === undefined ? this.ClientData.id = this.accpId : ''
       this.ClientData.taskLateStatus = this.taskLateStatus
       this.userData = { id: '', ename: this.userInformation, name: this.userNames }
       this.objData = { projectTestReport: this.ClientData, user: this.userData }
@@ -504,11 +506,12 @@ export default {
         }
       })
     },
-    parentHandleclick(e, task) {
+    parentHandleclick(e, task, id) {
       if (e === 1) {
         this.Tsk = task
         this.getCreateData(this.ClientData, this.tableData)
       } else {
+        this.accpId = id
         this.getQueryData(this.ClientData, this.tableData)
       }
     },

+ 4 - 1
src/views/Platform/presentation/ClientAcceptance.vue

@@ -176,6 +176,7 @@ export default {
       editorElems: [],
       bugNum: '',
       Ts: [],
+      clienId: '',
       tableData: []
     }
   },
@@ -319,11 +320,12 @@ export default {
         this.formatData()
       })
     },
-    parentHandleclick(e, task) {
+    parentHandleclick(e, task, id) {
       if (e === 1) {
         this.Ts = task
         this.getCreateData(this.ClientData, this.tableData)
       } else {
+        this.clienId = id
         this.getQueryData(this.ClientData, this.tableData)
       }
     },
@@ -368,6 +370,7 @@ export default {
       this.ClientData.sctResult = this.sctResult
       this.ClientData.acceptanceResult = this.acceptanceResult
       this.ClientData.status = this.status
+      this.ClientData.id === undefined ? this.ClientData.id = this.clienId : ''
       this.ClientData.taskLateStatus = this.taskLateStatus
       this.userData = { id: '', ename: this.userInformation, name: this.userNames }
       this.objData = { projectTestReport: this.ClientData, user: this.userData }

+ 5 - 4
src/views/Platform/presentation/DailyNewsAdded.vue

@@ -69,7 +69,8 @@ export default {
       numList: [],
       bugName: [],
       statusMap: [],
-      statusList: []
+      statusList: [],
+      dailys: ''
     }
   },
   created() {
@@ -131,11 +132,12 @@ export default {
         })
       }, 500)
     },
-    parentHandleclick(e, task) {
+    parentHandleclick(e, task, id) {
       if (e === 1) {
         this.ids = task
         this.getCreateData(this.fromCreateData)
       } else {
+        this.dailys = id
         this.getQueryData(this.fromCreateData)
       }
     },
@@ -154,8 +156,6 @@ export default {
             if (res.code === 200) {
               this.$message.success(res.msg)
               this.$emit('daily', res.data)
-            } else {
-              this.$message.error(res.msg)
             }
           })
         } else {
@@ -168,6 +168,7 @@ export default {
     getQueryData(ele) {
       this.fromCreateData = ele
       this.fromCreateData.testExplain = this.editor.editor.innerHTML
+      this.fromCreateData.id === undefined ? this.fromCreateData.id = this.dailys : ''
       this.userData = { id: '', ename: this.userInformation, name: this.userNames }
       this.objData = { dailyTestReport: this.fromCreateData, user: this.userData }
       dailyReportUpdate(this.objData).then(res => {

+ 5 - 2
src/views/Platform/presentation/PresentReport.vue

@@ -151,7 +151,8 @@ export default {
       projectIdCode: '',
       ids: [],
       configIn: '',
-      dependent: ''
+      dependent: '',
+      clien: ''
     }
   },
   created() {
@@ -216,6 +217,7 @@ export default {
     getQueryData(ele) {
       this.dataChange = ele
       this.dataChange.lateStatus = this.lateStatus
+      this.dataChange.id === undefined ? this.dataChange.id = this.clien : ''
       typeof (this.DetailsOfProposal) === 'string' ? this.dataChange.joinTest = this.DetailsOfProposal : ''
       this.userData = { ename: this.userInformation, name: this.userNames }
       this.objData = { launchTestInfo: this.dataChange, user: this.userData }
@@ -228,11 +230,12 @@ export default {
         }
       })
     },
-    parentHandleclick(e, task) { // 判断新建还是编辑
+    parentHandleclick(e, task, id) { // 判断新建还是编辑
       if (e === 1) {
         this.ids = task
         this.getCreateData(this.dataChange)
       } else {
+        this.clien = id
         this.getQueryData(this.dataChange)
       }
     },

+ 6 - 3
src/views/Platform/presentation/Templates/ClientReport.vue

@@ -92,7 +92,8 @@ export default {
       active: 1,
       client_task: [],
       src: clientF,
-      src1: clientK
+      src1: clientK,
+      keys: ''
     }
   },
   methods: {
@@ -165,15 +166,16 @@ export default {
     },
     created_out() {
       if (this.radio === '1') {
-        this.$refs.ClientAcceptance.parentHandleclick(this.newNum, this.client_task)
+        this.$refs.ClientAcceptance.parentHandleclick(this.newNum, this.client_task, this.keys)
       }
       if (this.radio === '2') {
-        this.$refs.Acceptance.parentHandleclick(this.newNum, this.client_task)
+        this.$refs.Acceptance.parentHandleclick(this.newNum, this.client_task, this.keys)
       }
     },
     QuasiReport(e) {
       console.log(e, 'zhunchu')
       this.report = e
+      this.keys = e.id
       this.active = 3
       this.showThree = true
       this.showTow = false
@@ -183,6 +185,7 @@ export default {
       this.showThree = false
       this.showTow = true
       this.active = 2
+      this.newNum = 2
       if (this.clienData.type === 1) {
         this.radio = '1'
         this.$nextTick(() => {

+ 5 - 3
src/views/Platform/presentation/Templates/DailyReport.vue

@@ -78,7 +78,8 @@ export default {
       newIndex: '',
       active: 1,
       daily_task: [],
-      src: daily
+      src: daily,
+      dailys: ''
     }
   },
   destroyed() {
@@ -99,7 +100,6 @@ export default {
           break
         case 2:
           this.dailyNewData = newData
-          console.log(newData, 'dss')
           this.newIndex = 2
           this.showOne = false
           this.showTow = true
@@ -136,17 +136,19 @@ export default {
       this.showTow = false
     },
     created_out() {
-      this.$refs.DailyReport.parentHandleclick(this.newIndex, this.daily_task)
+      this.$refs.DailyReport.parentHandleclick(this.newIndex, this.daily_task, this.dailys)
     },
     gou_out() {
       this.dailyNewData = this.preview
       this.active = 2
+      this.newIndex = 2
       this.showOne = false
       this.showTow = true
       this.showThree = false
     },
     daily(e) {
       this.preview = e
+      this.dailys = e.id
       this.showOne = false
       this.showTow = false
       this.showThree = true

+ 7 - 3
src/views/Platform/presentation/Templates/TestReport.vue

@@ -95,7 +95,8 @@ export default {
       preview: '',
       src: testF,
       src1: testK,
-      dialogVisible1: false
+      dialogVisible1: false,
+      clien: ''
     }
   },
   methods: {
@@ -158,6 +159,7 @@ export default {
       this.showThree = false
       this.showTow = true
       this.active = 2
+      this.newNum = 2
       if (this.clienData.type === 1) {
         this.radio = '1'
         this.Present1 = true
@@ -171,10 +173,10 @@ export default {
     },
     created_out() {
       if (this.radio === '2') { // 服务端
-        this.$refs.presentationRef.parentHandleclick(this.newNum, this.present_task)
+        this.$refs.presentationRef.parentHandleclick(this.newNum, this.present_task, this.clien)
       }
       if (this.radio === '1') { // 客户端
-        this.$refs.Present.parentHandleclick(this.newNum, this.present_task)
+        this.$refs.Present.parentHandleclick(this.newNum, this.present_task, this.clien)
       }
     },
     NextStep() {
@@ -210,6 +212,8 @@ export default {
       this.showTow = false
     },
     fatherMethod(e) {
+      console.log(e, '新建返回')
+      this.clien = e.id
       this.preview = e
       this.showThree = true
       this.showTow = false

+ 3 - 1
src/views/Platform/presentation/presentationReport.vue

@@ -209,6 +209,7 @@ export default {
       typeof (this.editorContent) === 'string' ? this.fromDev.joinTest = this.editorContent : ''
       typeof (this.DetailsOfProposal) === 'string' ? this.fromDev.moduleInfo = this.DetailsOfProposal : ''
       this.fromDev.lateStatus = this.lateStatus
+      this.fromDev.id === undefined ? this.fromDev.id = this.clien : ''
       this.userData = { id: '', ename: this.userInformation, name: this.userNames }
       this.objData = { launchTestInfo: this.fromDev, user: this.userData }
       launchTestUpdate(this.objData).then(res => {
@@ -220,11 +221,12 @@ export default {
         }
       })
     },
-    parentHandleclick(e, task) { // 判断创建还是编辑
+    parentHandleclick(e, task, id) { // 判断创建还是编辑
       if (e === 1) {
         this.ids = task
         this.getCreateData(this.fromDev)
       } else {
+        this.clien = id
         this.getQueryData(this.fromDev)
       }
     },

+ 47 - 5
src/views/projectManage/bugList/details/index.vue

@@ -600,7 +600,10 @@
         <div class="file-dialog">
           <el-form ref="form" label-width="80px">
             <el-form-item label="图片名称">
-              <el-input v-model="imageName" />
+              <el-col :span="20">
+                <el-input v-model="imageName" />
+              </el-col>
+              <el-col :span="4">.png</el-col>
             </el-form-item>
           </el-form>
           <img :src="imageUrl" class="image-url">
@@ -907,10 +910,12 @@ export default {
       this.dialogVisible = true
     },
     handleChange(response, file, fileList) {
-      this.fileDbList.push({
+      const item = {
         name: file.name,
         url: 'http:' + file.response.url
-      })
+      }
+      this.fileDbList.push(item)
+      this.fileList.push(item)
       this.bug.accessory = JSON.stringify(this.fileDbList)
       this.$message({
         showClose: true,
@@ -1279,6 +1284,15 @@ export default {
         return res
       })
     },
+    generateMixed(len) {
+      const chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
+      let res = ''
+      for (let i = 0; i < len; i++) {
+        const id = Math.ceil(Math.random() * 35)
+        res += chars[id]
+      }
+      return res
+    },
     pasteUpload() {
       if (!this.uploadButton) {
         return false
@@ -1287,17 +1301,41 @@ export default {
         const reader = new FileReader()
         reader.readAsDataURL(window.uploadFiles[0])
         reader.onload = () => {
+          const reg = new RegExp(/image\/png/)
           this.imageUrl = reader.result
+          if (this.imageUrl.match(reg)) { // 判断是否是图片
+            this.showCopyFile = true
+            this.imageName = this.generateMixed(10)
+          }
         }
-        this.showCopyFile = true
       }
     },
     async confirmUpload() {
+      if (this.imageName === null || this.imageName.replace(/\s+/g, '') === '') {
+        this.$message({
+          showClose: true,
+          message: '请输入图片名称',
+          type: 'error'
+        })
+        return false
+      }
+      const isExist = this.fileList.some(item => {
+        return this.imageName === item.name
+      })
+      if (isExist) {
+        this.$message({
+          showClose: true,
+          message: '图片名称重复',
+          type: 'error'
+        })
+        return false
+      }
       this.showCopyFile = false
       const res = await this.updateFile(window.uploadFiles[0])
       const data = res.data
       const item = {
         name: this.imageName || '',
+        status: 'success',
         url: 'http:' + data.url
       }
       this.fileList.push(item)
@@ -1530,9 +1568,13 @@ export default {
   display: flex;
   flex-direction: column;
   align-items: center;
+  .el-form {
+    width: 80%;
+  }
 }
 .image-url {
-  width: 80%;
+  width: 90%;
   max-height: 60vh;
+  border:1px solid #EBEEF5;
 }
 </style>

+ 46 - 3
src/views/projectManage/bugList/file/createdBug.vue

@@ -182,7 +182,10 @@
       <div class="file-dialog">
         <el-form ref="form" label-width="80px">
           <el-form-item label="图片名称">
-            <el-input v-model="imageName" />
+            <el-col :span="20">
+              <el-input v-model="imageName" />
+            </el-col>
+            <el-col :span="4">.png</el-col>
           </el-form-item>
         </el-form>
         <img :src="imageUrl" class="image-url">
@@ -350,7 +353,9 @@ export default {
     },
     // 上传成功回调
     handleChange(response, file, fileList) {
-      this.fileDbList.push({ 'name': file.name, 'url': 'http:' + file.response.url })
+      const item = { 'name': file.name, 'url': 'http:' + file.response.url }
+      this.fileDbList.push(item)
+      this.fileList.push(item)
       this.formInline.accessory = JSON.stringify(this.fileDbList)
       this.dis = false
       this.$message({ showClose: true, message: '文件上传成功', type: 'success' })
@@ -482,6 +487,15 @@ export default {
         return item.name !== file.name
       })
     },
+    generateMixed(len) {
+      const chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
+      let res = ''
+      for (let i = 0; i < len; i++) {
+        const id = Math.ceil(Math.random() * 35)
+        res += chars[id]
+      }
+      return res
+    },
     pasteUpload() {
       if (!this.modalShow) {
         return false
@@ -490,17 +504,42 @@ export default {
         const reader = new FileReader()
         reader.readAsDataURL(window.uploadFiles[0])
         reader.onload = () => {
+          const reg = new RegExp(/image\/png/)
           this.imageUrl = reader.result
+          if (this.imageUrl.match(reg)) { // 判断是否是图片
+            this.showCopyFile = true
+            this.imageName = this.generateMixed(10)
+          }
         }
         this.showCopyFile = true
       }
     },
     async confirmUpload() {
+      if (this.imageName === null || this.imageName.replace(/\s+/g, '') === '') {
+        this.$message({
+          showClose: true,
+          message: '请输入图片名称',
+          type: 'error'
+        })
+        return false
+      }
+      const isExist = this.fileList.some(item => {
+        return this.imageName === item.name
+      })
+      if (isExist) {
+        this.$message({
+          showClose: true,
+          message: '图片名称重复',
+          type: 'error'
+        })
+        return false
+      }
       this.showCopyFile = false
       const res = await this.updateFile(window.uploadFiles[0])
       const data = res.data
       const item = {
         name: this.imageName || '',
+        status: 'success',
         url: 'http:' + data.url
       }
       this.fileList.push(item)
@@ -541,9 +580,13 @@ export default {
   display: flex;
   flex-direction: column;
   align-items: center;
+  .el-form {
+    width: 80%;
+  }
 }
 .image-url {
-  width: 80%;
+  width: 90%;
   max-height: 60vh;
+  border:1px solid #EBEEF5;
 }
 </style>

+ 21 - 21
src/views/projectManage/projectList/projectIndex.vue

@@ -392,30 +392,30 @@ export default {
     this.get_projectList()
     this.$store.state.data.status = true
   },
-  beforeRouteLeave(to, from, next) {
-    this.$nextTick(() => {
-      if (this.form.name !== '') {
-      // 这里需要elementui的支持,如果使用其他界面组件自行替换即可
-        this.$confirm('正在离开本页面,本页面内所有未保存数据都会丢失', '警告', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          // 正常跳转
-          next(true)
-        }).catch(() => {
-          // 如果取消跳转地址栏会变化,这时保持地址栏不变
-          window.history.go(1)
-        })
-      }
-    })
-    next(false)
+  // beforeRouteLeave(to, from, next) {
+  //   this.$nextTick(() => {
+  //     if (this.form.name !== '') {
+  //     // 这里需要elementui的支持,如果使用其他界面组件自行替换即可
+  //       this.$confirm('正在离开本页面,本页面内所有未保存数据都会丢失', '警告', {
+  //         confirmButtonText: '确定',
+  //         cancelButtonText: '取消',
+  //         type: 'warning'
+  //       }).then(() => {
+  //         // 正常跳转
+  //         next(true)
+  //       }).catch(() => {
+  //         // 如果取消跳转地址栏会变化,这时保持地址栏不变
+  //         window.history.go(1)
+  //       })
+  //     }
+  //   })
+  //   next(false)
 
-    this.$store.state.data.status = false
-  },
-  // destroyed() {
   //   this.$store.state.data.status = false
   // },
+  destroyed() {
+    this.$store.state.data.status = false
+  },
   methods: {
     test2(item, e) {
       // 获取团队人员信息

+ 0 - 2
src/views/projectManage/taskList/taskViewDetails.vue

@@ -658,8 +658,6 @@ export default {
           this.task_form.stageString === '正常' ? this.bgStyle = '#69B3FF' : ''
           this.task_form.stageString === '延期' ? this.bgStyle = '#FF8952' : ''
           this.task_form.stageString === '已延期' ? this.bgStyle = '#F56C6C' : ''
-        } else {
-          this.$message({ message: res.msg, type: 'error', offset: 150 })
         }
       })
       commentList({ type: 3, joinId: this.taskId[1] }).then(res => {