Selaa lähdekoodia

Merge branch 'http_mock' of git.xiaojukeji.com:jacklijiajia/thoth-frontend into wangziqian

PrinceLee 5 vuotta sitten
vanhempi
sitoutus
02c524a2bd

+ 4 - 8
src/layout/components/Navbar.vue

@@ -9,13 +9,9 @@
         </el-button>
         <el-dropdown-menu slot="dropdown">
           <div style="margin: 0 10% 10px;">
-            <el-select v-model="value" filterable remote :remote-method="remoteMethod" size="small" style="width: 100%" placeholder="请搜索业务线">
-              <el-option v-for="item in arr_data" :key="item.code" :label="item.name" :value="item.code" @click.native="sumTypeCkeck(item)">
-                {{ item.name }}
-              </el-option>
-            </el-select>
+            <el-input v-model="value" clearable size="small" style="width: 100%" placeholder="业务线搜索" @input="remoteMethod" />
           </div>
-          <div style="height: 200px; overflow:scroll; overflow-x: hidden">
+          <div style="max-height: 200px; overflow:scroll; overflow-x: hidden">
             <el-dropdown-item
               v-for="(item,index) in sumTypeArray"
               :key="index"
@@ -104,11 +100,11 @@ export default {
       if (query !== '') {
         setTimeout(() => {
           settingGetBizList({ bizName: query }).then(res => {
-            this.arr_data = res.data
+            this.sumTypeArray = res.data
           })
         }, 200)
       } else {
-        this.arr_data = []
+        this.get_bizArr()
       }
     },
     // toggleSideBar() {

+ 100 - 68
src/views/projectManage/bugList/details/index.vue

@@ -13,14 +13,17 @@
         @command="openStatsDialog"
       />
       <div style="display: inline-block;float:right">
-        <el-dropdown placement="bottom">
+        <span class="newBtn" @click="getToDetails()"><i class="el-icon-document" /> 查看详情</span>
+        <span class="newBtn" style="padding: 0 10px" @click="openQueryDialog()"><i class="el-icon-document-copy" /> 复制</span>
+        <span class="newBtn" @click="openDeleteDialog()"><i class="el-icon-delete" /> 删除</span>
+        <!-- <el-dropdown placement="bottom">
           <el-button size="small" plain class="button_delete" style="padding:5px"> ··· </el-button>
           <el-dropdown-menu slot="dropdown" style="text-align: center;">
-            <el-dropdown-item @click.native="openQueryDialog()">复制</el-dropdown-item>
-            <el-dropdown-item @click.native="getToDetails()">查看详情</el-dropdown-item>
-            <el-dropdown-item @click.native="openDeleteDialog()">删除</el-dropdown-item>
+            <el-dropdown-item @click.native="openQueryDialog()">复制 </el-dropdown-item>
+            <el-dropdown-item @click.native="getToDetails()">查看详情 </el-dropdown-item>
+            <el-dropdown-item @click.native="openDeleteDialog()">删除 </el-dropdown-item>
           </el-dropdown-menu>
-        </el-dropdown>
+        </el-dropdown> -->
         <div style="display: inline-block;margin-left: 10px;margin-right: 15px;" @mouseover="iconName = 'float_反馈_icon_close_蓝色'" @mouseleave="iconName = 'float_反馈_icon_close'" @mousedown="closeDrawer();">
           <el-button size="medium" type="text" style="margin-top:-5px;">
             <svg-icon :icon-class="iconName" />
@@ -287,11 +290,11 @@
             </div>
             <el-divider v-if="type !== 'page'" />
             <el-aside :width="type=='page'?'100%':'100%'">
-              <el-form :label-width="type=='page'?'30%':'16%'" label-position="left" label-suffix=":">
+              <el-form :rules="rules" :label-width="type=='page'?'30%':'16%'" label-position="left" label-suffix=":" :hide-required-asterisk="true">
                 <el-form-item label="提报人">
                   <div style="padding-left: 15px" class="bug_manage_div">{{ bug.creatorList }}</div>
                 </el-form-item>
-                <el-form-item label="责任人">
+                <el-form-item label="责任人" prop="assigner" :style="formHeight1 == 'type' ? { 'height': '60px' } : { 'height': 'auto' }">
                   <el-select
                     v-model="bug.assigner"
                     class="current"
@@ -321,7 +324,7 @@
                     </el-option>
                   </el-select>
                 </el-form-item>
-                <el-form-item label="修复人">
+                <el-form-item label="修复人" prop="currentHandler" :style="formHeight == 'type' ? { 'height': '60px' } : { 'height': 'auto' }">
                   <el-select
                     v-model="bug.currentHandler"
                     class="current"
@@ -750,6 +753,8 @@ export default {
       uploadDialogImageUrl: '',
       test: '测试',
       num: 0,
+      formHeight: '',
+      formHeight1: '',
       userLoading: false,
       statusDialogVisible: false,
       statusDialogTitle: '',
@@ -779,6 +784,12 @@ export default {
       showWordLimit: false,
       showRule: false,
       rules: {
+        assigner: [
+          { required: true, message: '责任人不可为空', trigger: 'change' }
+        ],
+        currentHandler: [
+          { required: true, message: '修复人不可为空', trigger: 'change' }
+        ],
         bugName: [
           { required: true, message: '标题不可为空', trigger: 'blur' }
         ],
@@ -811,7 +822,6 @@ export default {
       }
     },
     id(newVal, oldVal) {
-      // window.scrollTo(0, 0)
       this.bug = {}
       this.bugModel = {}
       this.bugNameForm = { bugName: '' }
@@ -819,6 +829,7 @@ export default {
       this.init()
     },
     drawerShow(newV) {
+      this.init()
       this.uploadButton = newV
     }
   },
@@ -836,18 +847,19 @@ export default {
     this.bugGetEnum()
     this.$nextTick(() => {
       this.bugGet(this.id, false).then(res => {
-        this.assignerOptions = []
-        for (const i in this.bug.assignerList.length) {
-          this.searchUser(this.bug.assigner[i]).then(res => {
-            this.assignerOptions = res.data
-          })
-        }
-        this.currentHandlerOptions = []
-        for (const i in this.bug.currentHandlerList.length) {
-          this.searchUser(this.bug.currentHandler[i]).then(res => {
-            this.currentHandlerOptions = res.data
-          })
-        }
+        // this.assignerOptions = []
+        // for (const i in this.bug.assignerList.length) {
+        //   this.searchUser(this.bug.assigner[i]).then(res => {
+        //     this.assignerOptions = res.data
+        //   })
+        // }
+        // this.currentHandlerOptions = []
+        // for (const i in this.bug.currentHandlerList.length) {
+        //   this.searchUser(this.bug.currentHandler[i]).then(res => {
+        //     this.currentHandlerOptions = res.data
+        //   })
+        // }
+        this.PersonnelData()
         this.changeWidthOnBlur()
         releaseList().then(res => {
           this.appClientList = res.data.appClient // 客户端
@@ -867,19 +879,10 @@ export default {
       this.$emit('close', false)
     },
     init() {
+      this.formHeight = ''
+      this.formHeight1 = ''
       this.bugGet(this.id, false).then(res => {
-        this.assignerOptions = []
-        for (const i in this.bug.assignerList.length) {
-          this.searchUser(this.bug.assigner[i]).then(res => {
-            this.assignerOptions = res.data
-          })
-        }
-        this.currentHandlerOptions = []
-        for (const i in this.bug.currentHandlerList.length) {
-          this.searchUser(this.bug.currentHandler[i]).then(res => {
-            this.currentHandlerOptions = res.data
-          })
-        }
+        this.PersonnelData()
         this.changeWidthOnBlur()
         this.getCommentList()
         releaseList().then(res => {
@@ -889,6 +892,20 @@ export default {
         this.editor.txt.html(this.bugDescribe === null ? '' : this.bugDescribe)
       })
     },
+    PersonnelData() {
+      this.assignerOptions = []
+      for (const i in this.bug.assignerList.length) {
+        this.searchUser(this.bug.assigner[i]).then(res => {
+          this.assignerOptions = res.data
+        })
+      }
+      this.currentHandlerOptions = []
+      for (const i in this.bug.currentHandlerList.length) {
+        this.searchUser(this.bug.currentHandler[i]).then(res => {
+          this.currentHandlerOptions = res.data
+        })
+      }
+    },
     listen(event) {
       event.preventDefault() // 阻止浏览器默认换行操作
       return false
@@ -1083,7 +1100,6 @@ export default {
           if (this.num === 0) {
             document.getElementsByClassName('scop')[0].scrollTop = 0
           }
-
           // if (this.type !== 'page') {
           //   if (res.data.bizId !== Number(localStorage.getItem('bizId'))) {
           //     Utils.$emit('demo', res.data.bizId)
@@ -1169,42 +1185,46 @@ export default {
       })
     },
     bugUpdate(form, loadingStr) {
-      loadingStr ? this.loading[loadingStr] = true : this.loading.fullscreen = true
-      const userData = {
-        id: '',
-        ename: this.userInformation,
-        name: this.userNames
-      }
-      this.num = 1
-      let objData
-      if (form) {
-        const data = form
-        data.currentHandler = form.currentHandler.join(',')
-        data.assigner = form.assigner.join(',')
-        objData = { bugBaseInfo: data, user: userData }
-      } else {
-        const data = form
-        data.currentHandler = form.currentHandler.join(',')
-        data.assigner = form.assigner.join(',')
-        objData = { bugBaseInfo: data, user: userData }
-      }
-      if (objData.bugBaseInfo.currentHandler !== '' && objData.bugBaseInfo.assigner !== '') {
-        return bugUpdate(objData).then(res => {
-          if (res.code === 200) {
-            this.changeWidthOnBlur()
-            this.init()
-            this.bugModel = JSON.parse(JSON.stringify(this.bug))
-            this.$emit('update', false)
+      if (form.currentHandler.length > 0) {
+        if (form.assigner.length > 0) {
+          this.formHeight = ''
+          this.formHeight1 = ''
+          loadingStr ? this.loading[loadingStr] = true : this.loading.fullscreen = true
+          const userData = {
+            id: '',
+            ename: this.userInformation,
+            name: this.userNames
+          }
+          this.num = 1
+          let objData
+          if (form) {
+            const data = form
+            data.currentHandler = form.currentHandler.join(',')
+            data.assigner = form.assigner.join(',')
+            objData = { bugBaseInfo: data, user: userData }
           } else {
-            this.bug = JSON.parse(JSON.stringify(this.bugModel))
+            const data = form
+            data.currentHandler = form.currentHandler.join(',')
+            data.assigner = form.assigner.join(',')
+            objData = { bugBaseInfo: data, user: userData }
           }
-          loadingStr ? this.loading[loadingStr] = false : this.loading.fullscreen = false
-          return res
-        })
+          return bugUpdate(objData).then(res => {
+            if (res.code === 200) {
+              this.changeWidthOnBlur()
+              this.bugModel = JSON.parse(JSON.stringify(this.bug))
+              this.$emit('update', false)
+              this.init()
+            } else {
+              this.bug = JSON.parse(JSON.stringify(this.bugModel))
+            }
+            loadingStr ? this.loading[loadingStr] = false : this.loading.fullscreen = false
+            return res
+          })
+        } else {
+          this.formHeight1 = 'type'
+        }
       } else {
-        this.$message.warning('责任人,修复人不能为空')
-        this.loading.userInfo = false
-        this.bugGet(this.bug.id, false)
+        this.formHeight = 'type'
       }
     },
     searchUser(query) {
@@ -1537,6 +1557,9 @@ export default {
 .bug_manage .el-cascader:hover .el-input__suffix-inner {
   visibility: visible;
 }
+.layout_main .el-form-item.is-error .el-input__inner {
+border-color: #DCDFE6;
+}
 </style>
 
 <style scoped>
@@ -1556,7 +1579,7 @@ export default {
   border-bottom-right-radius: 4px;
 }
 .bug_describe {
-  color: #C0C4CC;
+  color: #666666;
   font-size: 14px;
 }
 .bug_describe:hover {
@@ -1574,6 +1597,15 @@ export default {
 </style>
 
 <style scoped lang="scss">
+.newBtn {
+  font-size: 14px;
+  color: rgb(51, 59, 74);
+  font-weight: 500;
+}
+.newBtn:hover {
+  color: #409EFF;
+  cursor: pointer;
+}
 .current:hover{
   border-radius: 4px;
   border: 1px solid #DCDFE6;

+ 2 - 2
src/views/projectManage/bugList/file/createdBug.vue

@@ -269,7 +269,7 @@ export default {
         priority: [{ required: true, message: '缺陷等级不能为空', trigger: 'change' }],
         discoveryStage: [{ required: true, message: '发现阶段不能为空', trigger: 'change' }],
         theBugType: [{ required: true, message: '缺陷类型不能为空', trigger: 'change' }],
-        creatorList: [{ required: true, message: '修复人不能为空', trigger: 'change' }],
+        creatorList: [{ required: true, message: '提报人不能为空', trigger: 'change' }],
         currentHandler: [{ required: true, message: '修复人不能为空', trigger: 'change' }]
 
       },
@@ -315,7 +315,7 @@ export default {
       this.fileList = []
       this.fileDbList = []
       this.formInline = {}
-      this.$set(this.formInline, 'creatorList', this.userNames)
+      this.$set(this.formInline, 'creatorList', localStorage.getItem('realname'))
       this.$set(this.formInline, 'bizId', Number(localStorage.getItem('bizId')))
 
       if (e === 1) {