Browse Source

质量: 半浮层

洪海涛 4 years ago
parent
commit
89f5a60d7d

+ 0 - 1
src/utils/request.js

@@ -19,7 +19,6 @@ service.interceptors.request.use(
     config.headers['secret'] = Encrypt()
     // config.retry = 2// 如果请求超时,重试次数
     // config.retryInterval = 1000 // 重试间隔
-    
     return config
   },
   error => {

+ 14 - 27
src/views/dataBigManage/components/drawerModal/components/table.vue

@@ -19,12 +19,11 @@
       >
         <!-- 自定义表头 -->
         <template slot="header" slot-scope="scope">
-          <div v-if="scope.column.label.search(/研发周期|缺陷等级/) > -1">
+          <div v-if="scope.column.tips">
             {{ scope.column.label }}
             <el-tooltip
-              v-if="setContent(scope.column.label)"
               effect="dark"
-              :content="setContent(scope.column.label)"
+              :content="setContent(scope.column.tips)"
               placement="top"
               popper-class="cycleStatistic-tips">
               <i class="el-icon-info" />
@@ -37,20 +36,19 @@
         <!-- 自定义列内容 -->
         <template slot-scope="scope" style="text-align: center;">
           <!-- 缺陷等级 -->
-          <div v-if="columnItem.key === 'priorityName'">
+          <div v-if="columnItem.type === 'level'">
             <div class="div_priority" :style="{background: priorityColors[scope.row[columnItem.key][1]]}">
               {{ scope.row[columnItem.key] }}
             </div>
           </div>
-          <!-- 缺陷名称 -->
-          <div v-else-if="columnItem.key === 'bugName'">
-            <div class="drawer-id">{{ 'BUG-' + scope.row.id }}</div>
-            <div class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</div>
+          <!-- 2行 -->
+          <div v-else-if="columnItem.type === 'topTitle'">
+            <div class="drawer-id">{{ `${columnItem.topName} - ${scope.row[columnItem.topKey]}` }}</div>
+            <div class="drawer-name" @click.stop="columnItemChange(columnItem, scope.row)">{{ scope.row[columnItem.key] }}</div>
           </div>
-          <!-- 报告名称 -->
-          <div v-else-if="columnItem.key === 'bugName'">
-            <div class="drawer-id">{{ 'BUG-' + scope.row.id }}</div>
-            <div class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</div>
+          <!-- 插槽 -->
+          <div v-else-if="columnItem.type === 'slot'">
+            <slot :name="columnItem.slotName" :scope="scope" />
           </div>
           <div v-else>
             {{ scope.row[columnItem.key] }}
@@ -58,11 +56,12 @@
         </template>
       </el-table-column>
     </el-table>
+
   </div>
 </template>
 
 <script>
-import { EncryptId } from '@/utils/crypto-js'
+// import { EncryptId } from '@/utils/crypto-js'
 import { requireTips, priorityColors } from './tableData'
 // Object.freeze(requireTips)
 Object.freeze(priorityColors)
@@ -93,19 +92,8 @@ export default {
     }
   },
   methods: {
-    jumper(val, name) { // 需求、任务、缺陷跳转
-      const { bizId = null } = this.$store.state.global || {}
-      const bizId_id = EncryptId(`${bizId}_${val.id}`)
-      const newTab = this.$router.resolve({ name: name + '详情', query: { bizId_id: bizId_id }})
-      window.open(newTab.href, '_blank')
-    },
-    //
-    setContent(label) {
-      const item = this.requireTips.filter(elm => elm.label === label)[0]
-      if (item) {
-        return item.tips
-      }
-      return ''
+    columnItemChange(column, row) {
+      this.$emit('change', { column, row })
     }
   }
 }
@@ -132,7 +120,6 @@ export default {
 .drawer-name:hover {
   color: #409eff;
   cursor: pointer;
-
 }
 
 .wrap {

+ 15 - 15
src/views/dataBigManage/components/drawerModal/components/timeline.vue

@@ -1,10 +1,10 @@
 <template>
-  <div :class="[!bgmargin ? 'qz-timeline-bg' : 'qz-timeline-bgOne']">
-    <div class="qz-timeline-layout">
+  <div :class="[!bgmargin ? 'timeline-bg' : 'timeline-bgOne']">
+    <div class="timeline-layout">
       <div v-for="(item, index) in list" ref="ss" :key="'item' + index">
-        <div class="qz-timeline-name" :class="[index === key ? 'qz-time-color1' : 'qz-time-color']">{{ item }}</div>
-        <span class="circular" :class="[index === key ? 'qz-time-code1' : 'qz-time-code']" @click="qz_click_code({value: index, name: item})" />
-        <div class="qz-timeline-divider" />
+        <div class="timeline-name" :class="[index === key ? 'time-color1' : 'time-color']">{{ item }}</div>
+        <span class="circular" :class="[index === key ? 'time-code1' : 'time-code']" @click="click_code({value: index, name: item})" />
+        <div class="timeline-divider" />
       </div>
     </div>
   </div>
@@ -50,7 +50,7 @@ export default {
       }))
     },
     // 点击节点
-    qz_click_code(val) {
+    click_code(val) {
       this.key = val.value
       this.$emit('update', val)
     }
@@ -59,28 +59,28 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.qz-timeline-bgOne {
+.timeline-bgOne {
   min-width: max-content;
   margin: 0 30px 18px;
   text-align: center;
   padding-right: 30px;
 }
-.qz-timeline-bg {
+.timeline-bg {
   min-width: max-content;
   margin: 29px 30px 30px;
   text-align: center;
   padding-right: 30px;
 }
-.qz-timeline-layout {
+.timeline-layout {
   display: flex;
   justify-content: center;
 }
-.qz-timeline-divider {
+.timeline-divider {
   content: '';
   min-width: 100px;
   border: 1px solid #E5E5E5;
 }
-.qz-timeline-name {
+.timeline-name {
   padding: 0 10px;
   font-weight: 400;
   font-size: 12px;
@@ -99,16 +99,16 @@ export default {
   top: 12px;
   cursor: pointer;
 }
-.qz-time-code {
+.time-code {
   background: #FFF;
 }
-.qz-time-code1 {
+.time-code1 {
   background: #60AEFF;
 }
-.qz-time-color {
+.time-color {
   color: #444;
 }
-.qz-time-color1 {
+.time-color1 {
   color: #60AEFF;
 }
 </style>

+ 35 - 2
src/views/dataBigManage/components/drawerModal/drawerModalData.js

@@ -5,13 +5,17 @@ export const columns = {
       label: '缺陷等级',
       key: 'priorityName',
       minWidth: 90,
-      align: 'left'
+      align: 'left',
+      type: 'level'
     },
     {
       label: '缺陷名称',
       key: 'bugName',
       minWidth: 360,
-      align: 'left'
+      align: 'left',
+      type: 'topTitle',
+      topName: 'BUG',
+      topKey: 'id'
     },
     {
       label: '状态',
@@ -19,6 +23,35 @@ export const columns = {
       minWidth: 100,
       align: 'center'
     }
+  ],
+  // 提测报告
+  deliverTestReportIdListColumns: [
+    {
+      label: '报告名称',
+      key: 'returnReason',
+      minWidth: 100,
+      align: 'left',
+      type: 'slot',
+      slotName: 'returnReasonSlot'
+    },
+    {
+      label: '状态',
+      key: 'statusString',
+      minWidth: 100,
+      align: 'center'
+    },
+    {
+      label: '报告人',
+      key: 'creatorObject',
+      minWidth: 100,
+      type: 'slot',
+      align: 'center',
+      slotName: 'creatorObjectSlot'
+    }
+  ],
+  // 准出记录
+  releaseReportIdListColumns: [
+
   ]
 }
 // 时间轴数据

+ 129 - 22
src/views/dataBigManage/components/drawerModal/index.vue

@@ -1,14 +1,15 @@
 <template>
   <el-drawer
     :modal="false"
-    size="50%"
+    size="100%"
     class="drawer-box"
     destroy-on-close
     :visible.sync="drawer"
     :before-close="handleClose"
+    @click.stop
   >
     <template slot="title">
-      <div>{{ title }}<span class="sub-title">{{ subTitle }}</span></div>
+      <div v-if="title">{{ title }}<span class="sub-title">{{ subTitle }}</span></div>
     </template>
     <!-- 时间线 -->
     <div v-if="openDrawer && isTimeLine(1)" class="qz-drawer-padding qz-drawer-header">
@@ -21,9 +22,24 @@
     </div>
 
     <!-- 表格 -->
-    <dmTable v-if="openDrawer" :table-list="tableList" :total="tableList" :column="column" :table-height="tableHeight" />
+    <dmTable v-if="openDrawer" v-loading="loading" :table-list="tableList" :total="tableList" :column="column" :table-height="tableHeight" @change="dmTableChange">
+      <template #bugStatusNameSlot="{scope}">
+        <div @click="print(scope)">自定义</div>
+      </template>
+      <!-- 报告名称 -->
+      <template #returnReasonSlot="{scope}">
+        <div v-if="scope.row.reportName">
+          <div class="drawer-name" @click.stop="jumper(scope.row,'提测')">{{ scope.row.reportName }}</div>
+          <div v-if="scope.row.returnReason" style="color: red">打开报告:{{ scope.row.returnReason }}</div>
+        </div>
+      </template>
+      <!-- 报告人 -->
+      <template #creatorObjectSlot="{scope}">
+        <div v-if="scope && scope.row && scope.row.creatorObject">{{ scope.row.creatorObject.name }}</div>
+      </template>
+    </dmTable>
     <!-- 下拉 -->
-    <div class="qz-footer-laout">
+    <div class="qz-footer-laout" @click.stop>
       <div style="line-height: 60px;">
 <!--        <el-button type="primary" size="mini" @click="exportTable">导 出</el-button>-->
       </div>
@@ -41,11 +57,14 @@
   </el-drawer>
 </template>
 <script>
-import { mapGetters } from 'vuex'
+// import { mapGetters } from 'vuex'
 import { bugList } from '@/api/defectManage'
+import { getReportList } from '@/api/reportTemplate'
 import dmTable from './components/table.vue'
 import timeline from './components/timeline'
 import { columns, timelineData } from './drawerModalData'
+import { EncryptId } from '@/utils/crypto-js'
+import Clickoutside from 'element-ui/src/utils/clickoutside'
 
 Object.freeze(timelineData)
 export default {
@@ -53,6 +72,7 @@ export default {
   components: {
     dmTable, timeline
   },
+  directives: { Clickoutside },
   props: {
     // title: {
     //   type: String,
@@ -83,6 +103,9 @@ export default {
   data() {
     return {
       drawer: false,
+      loading: false,
+      title: '',
+      headerTitle: '',
       timelineData,
       tableList: [],
       tableHeight: 'auto',
@@ -97,16 +120,17 @@ export default {
       }
     }
   },
-  computed: {
-    ...mapGetters(['bizId'])
-  },
+
   watch: {
+    drawerData() {
+      if (this.openDrawer) {
+        this.init()
+      }
+    },
     openDrawer(value) {
+      this.drawer = false
       if (value) {
         this.init()
-        this.setTitleHeight()
-        this.setTimeLine()
-        this.setColumn()
       }
     }
   },
@@ -117,34 +141,50 @@ export default {
     this.drawer = false
   },
   methods: {
+    print(slotProp) {
+      console.log(slotProp)
+    },
     init() {
+      console.log(this.drawerData)
+      this.pagingInit()
+      this.column = []
+      this.tableList = []
       this.drawer = this.openDrawer
       this.title = this.drawerData.label
-      this.ids = this.drawerData.IdList.map(e => e)
+      this.headerTitle = this.drawerData.headerTitle
+      // this.ids = this.drawerData.IdList.map(e => e)
       // this.ids = [14952, 15453, 15988, 16182, 17445, 17447, 17735, 18062, 18064, 18067, 19255, 19568, 19569, 19570, 19571, 19572, 19574, 19575, 19576, 19577, 19578, 19579, 19587, 19588, 19590, 19593, 19595, 19596, 19597, 19599, 19619, 19642, 19644, 19645, 19652, 19655, 19673, 19674, 19887, 19888, 19931, 19935, 19970, 20048, 20049, 20058, 20071, 20086, 20149, 20181, 20182, 20183, 20184, 20301, 20442, 20755, 20758, 20760, 20765, 20770, 20777, 20778, 20782, 20783, 20789, 20803, 20804, 20805, 20808, 20809, 20810, 20812, 20813, 20814, 20815, 20816, 20817, 20818, 20819, 20820, 20825, 20826, 20831, 20848, 20850, 20851]
-      this.getBugStatisticData()
+      this.ids = [2049, 1662, 2050, 1644, 2051, 1657, 1670, 1715, 1728, 1692, 2048, 2052, 2047] // 提测报告
+      this.setTableList()
+      this.setTitleHeight()
+      this.setTimeLine()
+      this.setColumn()
     },
     handleClose() {
+      console.log(123)
       this.drawer = false
       this.$emit('update:openDrawer', this.drawer)
     },
     handleSizeChange(value) {
       this.paging.pageSize = value
-      this.getBugStatisticData()
+      this.setTableList()
     },
     handleCurrentChange(value) {
       console.log(value)
       this.paging.curIndex = value
-      this.getBugStatisticData()
+      this.setTableList()
     },
     // 导出
     exportTable() {
     },
     // 设置表格头
     setColumn() {
-      if (this.title.search(/新增缺陷|reopen缺陷|缺陷24小时修复率/) > -1) {
+      if (this.title.search(/新增缺陷|reopen|缺陷24小时修复率/) > -1) {
         this.column = columns.bugColumn.map(e => e)
       }
+      if (this.title.search(/提测打回率|准出不通过/) > -1) {
+        this.column = columns.deliverTestReportIdListColumns.map(e => e)
+      }
     },
     // 时间轴点击事件
     timeLineClick({ value, name }, index) {
@@ -156,6 +196,17 @@ export default {
         console.log(value, name, '第二条')
       }
     },
+    // 设置列表数据
+    setTableList() {
+      if (this.title.search(/新增缺陷|reopen/) > -1) {
+        this.loading = true
+        this.getBugStatisticData()
+      }
+      if (this.title.search(/提测打回率|准出不通过/) > -1) {
+        this.loading = true
+        this.setReportList()
+      }
+    },
     // 累计新增缺陷
     async getBugStatisticData() {
       const paging = this.paging
@@ -165,9 +216,30 @@ export default {
         curIndex: this.paging.curIndex,
         pageSize: this.paging.pageSize
       })
-      this.tableList = res.data
-      this.paging.pageTotal = res.total
-      this.paging = { ...paging }
+      if (res.code === 200) {
+        this.tableList = res.data
+        this.paging.pageTotal = res.total
+        this.paging = { ...paging }
+        this.loading = false
+      }
+    },
+    //
+    // 提测报告 deliverTestReportIdList 准出记录 releaseReportIdList
+    async setReportList() {
+      const key = this.title === '提测打回率' ? 'deliverTestReportIdList' : 'releaseReportIdList'
+      const paging = this.paging
+      const params = {
+        ...paging,
+        [key]: this.ids
+      }
+      delete params.pageTotal
+      const res = await getReportList(params)
+      if (res.code === 200) {
+        this.tableList = res.data
+        this.paging.pageTotal = res.total
+        this.paging = { ...paging }
+        this.loading = false
+      }
     },
     // 分页数据初始化
     pagingInit() {
@@ -190,15 +262,19 @@ export default {
         this.tableHeight = 'calc(100vh - 175px)'
       } else if (this.title === '缺陷24小时修复率') {
         this.tableHeight = 'calc(100vh - 416px)'
-      } else if (this.title === '新增缺陷') {
+      } else if (this.title.search(/新增缺陷|提测打回率|reopen|准出不通过/) > -1) {
         this.tableHeight = 'calc(100vh - 136px)'
       } else {
-        this.tableHeight = 'calc(100vh - 318px)'
+        this.tableHeight = 'calc(100vh - 136px)'
         // this.tableHeight = 'calc(100vh - 10px)'
       }
     },
     // 设置表头
-
+    // 表格跳转
+    dmTableChange({ column, row }) {
+      // console.log(column, row)
+      this.jumper(row, '缺陷')
+    },
     // 设置时间轴自动滚动
     setTimeLine() {
       this.$nextTick(() => {
@@ -212,6 +288,12 @@ export default {
         }
       })
     },
+    jumper(val, name) { // 需求、任务、缺陷跳转
+      const { bizId = null } = this.$store.state.global || {}
+      const bizId_id = EncryptId(`${bizId}_${val.id}`)
+      const newTab = this.$router.resolve({ name: name + '详情', query: { bizId_id: bizId_id }})
+      window.open(newTab.href, '_blank')
+    },
     // 设置时间轴自动滚动
     isTimeLine(index = 1) {
       // 是第一条
@@ -246,6 +328,27 @@ export default {
 .drawer-box {
   box-shadow: 0 8px 10px -5px rgba(0, 0, 0, .2), 0 16px 24px 2px rgba(0, 0, 0, .14), 0 6px 30px 5px rgba(0, 0, 0, .12);
 }
+.el-drawer-fade-enter-active {
+  animation: el-drawer-fade-in 10ms;
+}
+.el-drawer-fade-leave-active {
+  animation: el-drawer-fade-in 10ms reverse;
+}
+.el-drawer__wrapper {
+  width: 100%;
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 50%;
+  overflow: hidden;
+  margin: 0;
+}
+/deep/.el-drawer__container {
+  left: 0;
+  right: 0;
+  width: 50%;
+}
 /* S 时间轴 */
 .qz-drawer-header {
   text-align: center;
@@ -285,4 +388,8 @@ export default {
   justify-content: space-between;
   margin: 0 30px;
 }
+.drawer-name:hover {
+  color: #409eff;
+  cursor: pointer;
+}
 </style>