qinzhipeng_v@didiglobal.com 4 жил өмнө
parent
commit
2520d17502

+ 31 - 15
src/components/timeline/index.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="qz-timeline-bg">
     <div class="qz-timeline-layout">
-      <div v-for="item in list" :key="item.value">
-        <div class="qz-timeline-name">{{ item.name }}</div>
-        <span class="circular" :class="[item.show ? 'qz-time-code1' : 'qz-time-code']" @click="qz_click_code(item)" />
+      <div v-for="(item, index) in list" :key="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>
     </div>
@@ -13,22 +13,31 @@
 <script>
 export default {
   props: {
-    data: { type: Array, required: true }
+    data: { type: Array, required: true },
+    num: { type: Number, default: 0 }
   },
   data() {
     return {
-      list: []
+      list: [],
+      key: this.num
     }
   },
   watch: {
     data: {
       handler(newV) {
+        console.log(newV, 'cdscdscdsc')
         if (!newV) return
         this.list = newV
-        this.timeline_init()
       },
       deep: true,
       immediate: true
+    },
+    num: {
+      handler(newV) {
+        if (!newV) return
+        this.key = newV
+      },
+      deep: true
     }
   },
   methods: {
@@ -42,13 +51,14 @@ export default {
     },
     // 点击节点
     qz_click_code(val) {
-      this.list.map(item => {
-        if (val.value === item.value) {
-          item.show = true
-        } else {
-          item.show = false
-        }
-      })
+      this.key = val.value
+      // this.list.map(item => {
+      //   if (val.value === item.value) {
+      //     item.show = true
+      //   } else {
+      //     item.show = false
+      //   }
+      // })
       this.$emit('update', val)
     }
   }
@@ -57,8 +67,8 @@ export default {
 
 <style lang="scss" scoped>
 .qz-timeline-bg {
-  width: 100%;
-  margin: 30px;
+  min-width: max-content;
+  margin: 20px 30px 40px;
   text-align: center;
 }
 .qz-timeline-layout {
@@ -94,4 +104,10 @@ export default {
 .qz-time-code1 {
   background: #60AEFF;
 }
+.qz-time-color {
+  color: #444;
+}
+.qz-time-color1 {
+  color: #60AEFF;
+}
 </style>

+ 4 - 1
src/views/quality/components/distributionChart.vue

@@ -20,7 +20,7 @@
       </el-row>
     </div>
     <div class="chart-contain">
-      <normal-echart v-if="echartsOption" :chart-id="id" :option="echartsOption" />
+      <normal-echart v-if="echartsOption" :chart-id="id" :option="echartsOption" @onClick="getCode" />
     </div>
   </section>
 </template>
@@ -91,6 +91,9 @@ export default {
       this.$emit('update:status', this.curStatus)
       this.$emit('change')
     },
+    getCode(val) {
+      this.$emit('code', val)
+    },
     changeBarOrPie(type) { // 饼图柱状图切换
       this.barOrPie = type
       if (!this.chartData) return

+ 87 - 91
src/views/quality/components/drawerAll.vue

@@ -1,21 +1,35 @@
 <template>
   <el-drawer :title="Statistics.title" :visible.sync="drawer_" :direction="direction" :modal="false" :class="{'drawer-box': showClass}" size="100%" :before-close="handleClose">
-    <div style="height: calc(100vh - 200px); overflow: scroll; overflow-x: hidden;">
+    <div>
       <div class="qz-drawer-header">
-        <timeline :data="list" @update="getTimeLine" />
-        <timeline :data="list" @update="getTimeLine" />
+        <timeline :data="list" :num="defaultKey" @update="getTimeLine" />
+        <!-- <timeline :data="list" @update="getTimeLine" /> -->
+      </div>
+      <div style="height: calc(100vh - 295px); overflow: scroll; overflow-x: hidden;">
+        <el-table :data="tableData" style="width: 100%;" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }" class="integration-num">
+          <el-table-column label="优先级" min-width="100">
+            <template slot-scope="scope">
+              <div class="div_priority" :style="{background: priorityColors[scope.row.priority % priorityColors.length]}">{{ 'P'+scope.row.priority }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column label="需求名称'" min-width="250">
+            <template slot-scope="scope">
+              <div class="drawer-id">{{ scope.row.requirementDisplayId }}</div>
+              <el-tooltip v-if="scope.row.name.length >= 15" class="item" effect="dark" :content="scope.row.name" placement="top">
+                <div class="drawer-name" @click="jumper(scope.row)">{{ scope.row.name | ellipsis }}</div>
+              </el-tooltip>
+              <div v-else class="drawer-name" @click="jumper(scope.row)">{{ scope.row.name | ellipsis }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column label="状态" min-width="100">
+            <template slot-scope="scope">
+              <div>{{ scope.row.statusName }}</div>
+            </template>
+          </el-table-column>
+        </el-table>
       </div>
-      <qz-table :table-list="tableData" :header="header" />
-      <!-- <qz-table :tableData="tableData" :tableHead="tableHead" selectionShow="true" :indexShow="true" indexLabel="序号" :indexWidth="50" /> -->
-      <!-- <el-table :data="tableData" style="width: 100%;" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }" class="integration-num">
-        <el-table-column label="优先级" min-width="100">
-          <template slot-scope="scope">
-            <div class="div_priority" :style="{background: priorityColors[scope.row.priority % priorityColors.length]}">{{ 'P'+scope.row.priority }}</div>
-          </template>
-        </el-table-column>
-      </el-table> -->
     </div>
-    <!-- <el-pagination
+    <el-pagination
       style="text-align: center;"
       :current-page.sync="currentPage"
       :page-size="10"
@@ -23,31 +37,29 @@
       :total="total"
       @size-change="handleSizeChange"
       @current-change="handleCurrentChange"
-    /> -->
+    />
   </el-drawer>
 </template>
 
 <script>
-// import { EncryptId } from '@/utils/crypto-js.js'
-// import { getRequirement } from '@/api/requirement.js'
+import { EncryptId } from '@/utils/crypto-js.js'
+import { getRequirement } from '@/api/requirement.js'
 // import { taskList } from '@/api/taskIndex'
 // import { bugList, bugGetEnum } from '@/api/defectManage'
 import timeline from '@/components/timeline'
-import qzTable from '@/components/table'
 export default {
   components: {
-    timeline,
-    qzTable
+    timeline
+  },
+  filters: {
+    ellipsis(value) {
+      if (!value) return ''
+      if (value.length > 15) {
+        return value.slice(0, 15) + '...'
+      }
+      return value
+    }
   },
-  // filters: {
-  //   ellipsis(value) {
-  //     if (!value) return ''
-  //     if (value.length > 15) {
-  //       return value.slice(0, 15) + '...'
-  //     }
-  //     return value
-  //   }
-  // },
   props: {
     data: { type: Object, required: true },
     drawer: { type: Boolean, default: false }
@@ -60,44 +72,13 @@ export default {
       direction: 'rtl',
       showClass: false,
       bugList: [],
-      // currentPage: 1,
-      // total: 0,
-      // paging: {
-      //   curIndex: 1, // 分页
-      //   pageSize: 10 // 分页
-      // },
-      header: [
-        { prop: 'w', label: '全部' },
-        { prop: 'x', label: 'x',
-          formatter: (row) => {
-            return row.x.toFixed(3)
-          }
-        },
-        { prop: 'd', label: 'd',
-          formatter: (row) => {
-            return row.d.toFixed(2)
-          }
-        },
-        {
-          label: '操作',
-          render: (h, data) => {
-            return (
-              <el-button
-                type='primary'
-                onClick={() => {
-                  this.handleClick(data.row)
-                }}
-              >
-                点我获取行数据
-              </el-button>
-            )
-          }
-        }
-      ],
-      tableData: [
-        { w: 1, x: 99.25123, d: 0.23892 },
-        { w: 1, x: 255.6666, d: 0.99134 }
-      ]
+      currentPage: 1,
+      total: 0,
+      paging: {
+        curIndex: 1, // 分页
+        pageSize: 10 // 分页
+      },
+      tableData: []
     }
   },
   computed: {
@@ -112,12 +93,14 @@ export default {
     data: {
       handler(newV, oldV) {
         this.Statistics = newV
+        this.list = newV.xaxis
+        this.defaultKey = newV.dataIndex
         this.currentPage = 1
-        // this.paging = {
-        //   curIndex: 1, // 分页
-        //   pageSize: 10 // 分页
-        // }
-        // this.getTableData()
+        this.paging = {
+          curIndex: 1, // 分页
+          pageSize: 10 // 分页
+        }
+        this.getTableData(this.Statistics.yaxis[0].idList[this.defaultKey],)
       },
       immediate: true
     }
@@ -125,22 +108,33 @@ export default {
   // created() {
   //   this.bugGetEnum()
   // },
+  mounted() {
+    this.$nextTick(() => {
+      this.showClass = true
+    })
+  },
   methods: {
     handleClick(row) {
       console.log(row)
     },
     getTimeLine(val) {
       console.log(val, 'vfvdv')
+      this.getTableData(this.Statistics.yaxis[0].idList[val.value])
     },
-    async getTableData() {
+    async getTableData(taskIdList) {
+      const data = {
+        ids: taskIdList,
+        ...this.paging
+      }
       // if (this.Statistics.idList !== undefined && this.Statistics.idList.length > 0) {
       //   this.paging.ids = this.Statistics.idList
       //   if (this.Statistics.typeStr === '需求') {
-      //     const res = await getRequirement(this.paging)
-      //     if (res.code === 200) {
-      //       this.tableData = res.data.list
-      //       this.total = res.data.total
-      //     }
+      const res = await getRequirement(data)
+      if (res.code === 200) {
+        console.log(res, '农村科技大厦')
+        this.tableData = res.data.list
+        // this.total = res.data.total
+      }
       //   } else if (this.Statistics.typeStr === '任务') {
       //     const res = await taskList(this.paging)
       //     if (res.code === 200) {
@@ -158,11 +152,11 @@ export default {
       //   this.tableData = []
       // }
     },
-    // jumper(val) {
-    //   const bizId_id = EncryptId(`${val.bizId}_${val.id}`)
-    //   const newTab = this.$router.resolve({ name: this.Statistics.typeStr + '详情', query: { bizId_id: bizId_id }})
-    //   window.open(newTab.href, '_blank')
-    // },
+    jumper(val) {
+      const bizId_id = EncryptId(`${val.bizId}_${val.id}`)
+      const newTab = this.$router.resolve({ name: this.Statistics.typeStr + '详情', query: { bizId_id: bizId_id }})
+      window.open(newTab.href, '_blank')
+    },
     // async bugGetEnum() {
     //   const res = await bugGetEnum()
     //   if (res.code === 200) {
@@ -170,14 +164,14 @@ export default {
     //     this.showClass = true
     //   }
     // },
-    // handleSizeChange(val) {
-    //   this.paging.pageSize = val
-    //   this.getTableData()
-    // },
-    // handleCurrentChange(val) {
-    //   this.paging.curIndex = val
-    //   this.getTableData()
-    // },
+    handleSizeChange(val) {
+      this.paging.pageSize = val
+      this.getTableData()
+    },
+    handleCurrentChange(val) {
+      this.paging.curIndex = val
+      this.getTableData()
+    },
     handleClose(done) {
       this.$emit('clone')
     }
@@ -193,10 +187,12 @@ export default {
   min-height: 120px;
   margin: 20px 30px;
   padding: 1px 0;
+  overflow: hidden;
+  overflow-x: auto;
 }
 >>> :focus{outline:0;}
 .integration-num {
-  margin: 20px;
+  margin: 20px 30px;
 }
 
 .drawer-name:hover {

+ 9 - 1
src/views/quality/requireStatistics.vue

@@ -155,7 +155,7 @@
             @change="getDevelopeopleData()"
           />
         </div>
-        <div class="chart-item">
+        <div class="chart-item" @click.stop>
           <h3>需求分布图</h3>
           <distribution-chart
             :chart-data="distributeData"
@@ -163,6 +163,7 @@
             :status.sync="distributeStatus"
             :active-tab="activeTab"
             @change="getDistributeData()"
+            @code="clickCodeData"
           />
         </div>
         <div class="chart-item">
@@ -555,8 +556,15 @@ export default {
       this.requireList = value
       this.openDrawer = true
     },
+    clickCodeData(value) {
+      value.title = '需求分布图数据'
+      this.requireList = { ...value, ...this.distributeData }
+      this.openDrawer = true
+      console.log(this.requireList, 'cdscdmckcdscsldmcl')
+    },
     clone(v) {
       this.drawer = v
+      this.openDrawer = false
     }
   }
 }

+ 3 - 0
src/views/reportManagement/ReleaseReport/releaePreview.vue

@@ -215,3 +215,6 @@ export default {
   margin-bottom: 20px;
 }
 </style>
+<style scoped>
+  .parent-style div >>> table {width: 100% !important;}
+</style>

+ 4 - 1
src/views/reportManagement/Testing/TestingPreview.vue

@@ -91,7 +91,7 @@
         <el-table-column prop="referredClientTypeName" label="跟版客户端" min-width="90" />
       </el-table>
 
-      <div v-html="fromCreateData.content" />
+      <div ref="rich" v-html="fromCreateData.content" />
 
     </div>
   </div>
@@ -231,3 +231,6 @@ export default {
     margin-bottom: 20px;
   }
 </style>
+<style scoped>
+  .parent-style div >>> table {width: 100% !important;}
+</style>