qinzhipeng_v преди 5 години
родител
ревизия
ffb690df90
променени са 1 файла, в които са добавени 41 реда и са изтрити 3 реда
  1. 41 3
      src/views/projectManage/bugList/details/index.vue

+ 41 - 3
src/views/projectManage/bugList/details/index.vue

@@ -95,8 +95,9 @@
             <el-container width="100%">
               <el-aside width="49%" style="margin-right: 2%">
                 <el-form label-width="30%" label-position="left" label-suffix=":">
-                  <el-form-item label="所属的任务">
-                    <el-select v-model="bug.taskId" filterable clearable @change="bugUpdate(bug,'details')">
+                  <el-form-item label="所属任务">
+                    <span v-if="clielIcon === true" class="str-task-name" @mouseover="mouseOver" @mouseleave="mouseLeave"><span @click="JumpTask(bug.taskId)">{{ bug.taskName }}</span> <i v-if="active" class="el-icon-edit" @click="getclielIcon" /></span>
+                    <el-select v-if="clielIcon === false" ref="searchOfChatRoom" v-model="bug.taskId" @blur="mouseLeaves" @change="bugUpdate(bug,'details')">
                       <el-option
                         v-for="item in taskEnumList"
                         :key="item.id"
@@ -149,7 +150,9 @@
               </el-aside>
               <el-aside width="49%">
                 <el-form label-width="30%" label-position="left" label-suffix=":">
-
+                  <el-form-item label="所属需求">
+                    <span class="str-task-name" @click="JumpRequire(bug.requireId)">{{ bug.requirementName }}</span>
+                  </el-form-item>
                   <el-form-item label="缺陷等级">
                     <el-select v-model="bug.priority" @change="bugUpdate(bug,'details')">
                       <el-option
@@ -626,6 +629,8 @@ export default {
         toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent table | undo redo | removeformat formatselect'
       },
       text_content: '',
+      clielIcon: true, // 所属任务交互
+      active: false,
       changeRecord: [], // 变更记录Data
       modalShow: false,
       activeName: 'first', // 选项卡默认评论
@@ -790,6 +795,9 @@ export default {
       event.preventDefault() // 阻止浏览器默认换行操作
       return false
     },
+    JumpRequire(id) {
+      this.$router.push({ name: '需求详情', query: { id: id }})
+    },
     getToDetails() {
       this.$router.push({ name: '缺陷详情', params: { id: this.id }})
     },
@@ -1086,6 +1094,8 @@ export default {
           return bugUpdate(objData).then(res => {
             if (res.code === 200) {
               this.changeWidthOnBlur()
+              this.clielIcon = true
+              this.active = false
               this.bugModel = JSON.parse(JSON.stringify(this.bug))
               this.$emit('update', false)
               this.init()
@@ -1126,6 +1136,9 @@ export default {
       // this.statusDialogForm.status = null
       this.statusDialogVisible = true
     },
+    JumpTask(id) { // 转到任务
+      this.$router.push({ name: '任务详情', query: { id: id }})
+    },
     statusDialogConfirm() {
       const userData = { id: '', ename: this.userInformation, name: this.userNames }
       bugDelete(userData, this.bug.id).then(res => {
@@ -1165,6 +1178,24 @@ export default {
         }
       }
     },
+    mouseOver() {
+      this.active = true
+    },
+    // 移出
+    mouseLeave() {
+      this.active = false
+    },
+    getclielIcon() {
+      this.clielIcon = !this.clielIcon
+      this.$nextTick(() => {
+        console.log(this.$refs.searchOfChatRoom, 'xsaxa')
+        this.$refs.searchOfChatRoom.focus()
+      })
+    },
+    mouseLeaves() {
+      alert()
+      this.clielIcon = true
+    },
     async confirmUpload() {
       if (this.imageName.name === null || this.imageName.name.replace(/\s+/g, '') === '') {
         return false
@@ -1373,6 +1404,13 @@ border-color: #DCDFE6;
 </style>
 
 <style scoped lang="scss">
+.str-task-name {
+ margin-left: 14px;
+}
+.str-task-name:hover {
+   color:#409EFF;
+   cursor: pointer;
+}
 /deep/ .el-tabs__nav-wrap::after {
     content: "";
     position: absolute;