Prechádzať zdrojové kódy

页面提示优化以及数据处理

panxiandiao_i 5 rokov pred
rodič
commit
4134d4ac5a

+ 47 - 0
src/api/HMvehicle.js

@@ -0,0 +1,47 @@
+import request from '@/utils/request'
+import { HMvehicleUrl } from '@/apiConfig/api'
+
+// 创建设备/激活设备
+export function createHmVirtualDevice(data) {
+  return request({
+    url: HMvehicleUrl + '/virtual-devices/hm/createDevice',
+    method: 'post',
+    data
+  })
+}
+
+// 查询设备信息
+export function queryDeviceInfo(params) {
+  return request({
+    url: HMvehicleUrl + '/virtual-devices/hm/queryDeviceInfo',
+    method: 'get',
+    params
+  })
+}
+
+// 删除设备
+export function delHmVirtualDevice(params) {
+  return request({
+    url: HMvehicleUrl + '/virtual-devices/hm/delDevice',
+    method: 'get',
+    params
+  })
+}
+
+// 下线设备
+export function offHmvirtualDevice(params) {
+  return request({
+    url: HMvehicleUrl + '/virtual-devices/hm/offDevice',
+    method: 'get',
+    params
+  })
+}
+
+// 更新锁状态
+export function updateLockStatus(params) {
+  return request({
+    url: HMvehicleUrl + '/virtual-devices/hm/updateLockStatus',
+    method: 'get',
+    params
+  })
+}

+ 1 - 1
src/api/qualityCenter.js

@@ -49,7 +49,7 @@ export function getOnlineProblem(params) {
 // 线上缺陷
 export function getOnlineVitium(params) {
   return request({
-    url: qualityUrl + '/api/off-line-defects/data-all-count',
+    url: qualityUrl + '/api/off-line-defects/data-count',
     method: 'get',
     params
   })

+ 2 - 0
src/apiConfig/api.js

@@ -5,3 +5,5 @@ export const mockUrl = 'http://10.179.24.176:8980' // 线下
 // export const mockUrl = 'http://172.23.162.48:8980' // 美双姐本地
 
 export const qualityUrl = 'http://10.179.209.19:8898' // 质量度量
+
+export const HMvehicleUrl = 'http://172.23.161.143:9999' // 电单车

+ 9 - 7
src/views/Platform/bugManage/bugCreate.vue

@@ -256,7 +256,7 @@ export default {
         this.clientTypeEnumList = res.data.clientTypeEnumList
         this.serviceTypeEnumList = res.data.serviceTypeEnumList
       })
-      await taskListCreate({ statusList: [6, 7] }).then(res => { // 获取任务数据 (后期用this.taskStatus)
+      await taskListCreate({ statusList: [5, 6, 7, 8, 9, 10] }).then(res => { // 获取任务数据 (后期用this.taskStatus)
         this.taskIdStr = res.data
       })
       if (this.$route.query.id) {
@@ -286,7 +286,7 @@ export default {
         if (res.code === 200) {
           this.bizOptions = res.data
         } else {
-          this.errorFun()
+          this.errorFun('业务线数据获取失败')
         }
       })
     },
@@ -334,17 +334,19 @@ export default {
           this.userData = { id: '', ename: this.userInformation, name: this.userNames }
           this.objData = { bugBaseInfo: form, user: this.userData }
           bugCreate(this.objData).then(res => {
-            res.code === 200 ? this.successFun() : this.errorFun()
+            res.code === 200 ? this.successFun('create') : this.errorFun('create Failed')
             this.$router.go(-1)
           })
+        } else {
+          this.errorFun('还有未填写的信息')
         }
       })
     },
-    successFun() {
-      this.$notify({ title: 'Success', message: 'Created Successfully', type: 'success', duration: 2000 })
+    successFun(successText) {
+      this.$notify({ title: 'Success', message: `${successText} Successfully`, type: 'success', duration: 2000 })
     },
-    errorFun() {
-      this.$notify({ title: 'Failed', message: 'Created Failed', type: 'error', duration: 2000 })
+    errorFun(errorText) {
+      this.$notify({ title: 'Failed', message: `${errorText}`, type: 'error', duration: 2000 })
     }
   }
 }

+ 1 - 1
src/views/Platform/bugManage/bugUpdate.vue

@@ -271,7 +271,7 @@ export default {
     },
     // 获取任务数据
     taskIdGet() {
-      taskListCreate({ statusList: [6, 7] }).then(res => {
+      taskListCreate({ statusList: [5, 6, 7, 8, 9, 10] }).then(res => {
         this.taskIdStr = res.data
       })
     },

+ 1 - 1
src/views/Platform/defectManagement.vue

@@ -13,7 +13,7 @@
           </el-select>
           <el-input v-model="queryCode.currentHandler" clearable filterable placeholder="处理人" style="width:12%;margin-right:5px;" />
           <el-input v-model="queryCode.creator" clearable filterable placeholder="创建人" style="width:12%;margin-right:5px;" />
-          <el-date-picker v-model="queryCode.gmtCreateBegin" style="width:12%;margin-right:5px;" type="datetime" placeholder="创建时间" /> -
+          <el-date-picker v-model="queryCode.gmtCreateBegin" style="width:12%;margin-right:5px;" type="datetime" placeholder="创建时间" />
           <el-date-picker v-model="queryCode.gmtCreateEnd" style="width:12%;margin-right:5px;" type="datetime" placeholder="截止时间" />
           <el-input v-model="queryCode.bugName" clearable filterable placeholder="主题" style="width:12%;margin-right:5px;" />
           <el-button type="primary" @click="dataQuery(queryCode)">查询</el-button>

+ 46 - 26
src/views/quality/qualityMeasurement.vue

@@ -4,7 +4,7 @@
     <el-header class="header">
       <el-menu :default-active="activeIndex" active-text-color="#409EFF" mode="horizontal" @select="handleSelect">
         <el-menu-item index="0">业务线数据</el-menu-item>
-        <el-menu-item index="2">部门数据</el-menu-item>
+        <el-menu-item index="3">部门数据</el-menu-item>
       </el-menu>
       <el-date-picker
         v-model="timeInterval"
@@ -13,6 +13,7 @@
         start-placeholder="开始日期"
         end-placeholder="结束日期"
         value-format="timestamp"
+        @change="dataSearch"
       />
     </el-header>
     <el-container style="height:calc(100vh - 140px);">
@@ -37,14 +38,14 @@
             style="width:50%;"
             align="center"
           >
-            <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(0)">{{ scope.row.totalOnlineNum }}</a></template>
+            <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView('0')">{{ scope.row.totalOnlineNum }}</a></template>
           </el-table-column>
           <el-table-column
             label="免提测上线数"
             style="width:50%;"
             align="center"
           >
-            <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(1)">{{ scope.row.noTestNum }}</a></template>
+            <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView('1')">{{ scope.row.noTestNum }}</a></template>
           </el-table-column>
         </el-table>
         <el-table
@@ -64,7 +65,7 @@
               style="width:20%;"
               align="center"
             >
-              <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(2)">{{ scope.row.rollbackNum }}</a></template>
+              <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView('2')">{{ scope.row.rollbackNum }}</a></template>
             </el-table-column>
             <el-table-column
               prop="name"
@@ -77,21 +78,21 @@
               style="width:20%;"
               align="center"
             >
-              <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(3)">{{ scope.row.preRollbackNum }}</a></template>
+              <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView('3')">{{ scope.row.preRollbackNum }}</a></template>
             </el-table-column>
             <el-table-column
               label="小流量回滚数"
               style="width:20%;"
               align="center"
             >
-              <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(4)">{{ scope.row.preLess5Min }}</a></template>
+              <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView('4')">{{ scope.row.preLess5Min }}</a></template>
             </el-table-column>
             <el-table-column
               label="全量回滚数"
               style="width:20%;"
               align="center"
             >
-              <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(5)">{{ scope.row.allRollbackNum }}</a></template>
+              <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView('5')">{{ scope.row.allRollbackNum }}</a></template>
             </el-table-column>
           </el-table-column>
         </el-table>
@@ -298,10 +299,11 @@
           size="mini"
         >
           <el-table-column
-            prop="totalBugNum"
             label="提报bug数"
             align="center"
-          />
+          >
+            <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toDefectView()">{{ scope.row.totalBugNum }}</a></template>
+          </el-table-column>
           <el-table-column
             label="缺陷分级"
             align="center"
@@ -402,8 +404,8 @@ import { getBusiness, getDepartment, getOnlineProblem, getOnlineAllCount, getOnl
 export default {
   filters: {
     toPercent(value) {
-      if (value === 0) {
-        return 0
+      if (!value) {
+        return
       } else {
         return Number(value * 100).toFixed(2) + '%'
       }
@@ -422,11 +424,11 @@ export default {
       loadingOnlineProcess: true,
       activeIndex: '0',
       activeIndexSecondary: '3',
-      timeInterval: '',
+      // timeInterval: '',
       pauseTreeNode: {},
       pauseKey: '',
-      dealWithBusinessDate: []
-      // timeInterval: [new Date().getTime() - 15 * 24 * 60 * 60 * 1000, new Date().getTime()]
+      dealWithBusinessDate: [],
+      timeInterval: [new Date().getTime() - 365 * 24 * 60 * 60 * 1000, new Date().getTime()]
     }
   },
   created() {
@@ -438,10 +440,10 @@ export default {
       this.loadingOnlineProcess = true
       await getBusiness().then(res => {
         this.businessData = res.code === 0 ? res.data : ''
-        const processFunc = (arr) => { // models和child
+        const processFunc = (arr) => { // modules和child
           arr.forEach((each) => {
-            if (each.models.length !== 0) {
-              each.child = each.models
+            if (each.modules) {
+              each.child = each.modules
             } else {
               each.child = processFunc(each.child)
             }
@@ -461,9 +463,18 @@ export default {
       await getDepartment().then(res => {
         this.dealWithBusinessDate = res.code === 0 ? res.data : ''
         this.pauseTreeNode = this.dealWithBusinessDate[0] ? this.dealWithBusinessDate[0] : ''
-        this.pauseKey = 2
+        this.pauseKey = 3
       })
-      this.allCountAndProlemGet()
+      this.deleteAfter()
+    },
+    deleteAfter() {
+      const pretermitSearch = { id: this.pauseTreeNode.id, type: this.pauseKey, startTime: this.timeInterval[0], endTime: this.timeInterval[1] }
+      axios.all([getOnlineAllCount(pretermitSearch), getOnlineProblem({ id: this.pauseTreeNode.id })]).then(axios.spread((resAllCount, resProblem) => {
+        this.onlineProcess = resAllCount.code === 0 ? resAllCount.data : ''
+        this.problemData = resProblem.code === 0 ? resProblem.data : ''
+        // Object.assign(this.onlineProcess, this.toPercent([this.onlineProcess.allRollbackPercent, this.onlineProcess.preLess5MinPercent, this.onlineProcess.preRollbackPercent, this.onlineProcess.rollbackPercent, this.onlineProcess.noTestPercent]))
+        this.loadingOnlineProcess = false
+      }))
     },
     allCountAndProlemGet() {
       const pretermitSearch = { id: this.pauseTreeNode.id, type: this.pauseKey, startTime: this.timeInterval[0], endTime: this.timeInterval[1] }
@@ -475,11 +486,18 @@ export default {
         this.loadingOnlineProcess = false
       }))
     },
+    dataSearch() {
+      if (this.pauseKey === 0) {
+        this._initBusinessTreeAndBeginInfo()
+      } else if (this.pauseKey === 3) {
+        this.initDepartmentTree()
+      }
+    },
     handleSelect(key) {
       if (key === '0') {
         this.pauseKey = key
         this._initBusinessTreeAndBeginInfo()
-      } else if (key === '2') {
+      } else if (key === '3') {
         this.pauseKey = key
         this.initDepartmentTree()
       } else {
@@ -489,17 +507,19 @@ export default {
     toReportView(e) {
       this.$router.push({ name: '上线过程', query: { id: this.pauseTreeNode.id, type: this.pauseKey, dataType: e, startTime: this.timeInterval[0], endTime: this.timeInterval[1] }})
     },
+    toDefectView() {
+      this.$router.push({ name: '上线过程', query: { id: this.pauseTreeNode.id, type: this.pauseKey, startTime: this.timeInterval[0], endTime: this.timeInterval[1] }})
+    },
     handleSelectSecondary(key) {
       console.log(key)
     },
     handleNodeClick(data) {
       this.loadingOnlineProcess = true
       this.pauseTreeNode = data
-      if (!this.pauseTreeNode.child) {
-        this.pauseKey = 1
-      }
-      if (this.pauseTreeNode.models) {
-        this.pauseKey = 0
+      this.pauseKey = data.type
+      if (this.pauseKey === 3) {
+        this.deleteAfter()
+        return
       }
       this.allCountAndProlemGet()
     },
@@ -560,7 +580,7 @@ export default {
     .combine-table >>> .is-active
       font-weight bold
     .combine-table >>> th
-      background-color #F0F7FF !important
+      background-color #F1F4F7 !important
       font-size 10px
     .combine-table >>> .move-border-top
       border-top 0px

+ 11 - 4
src/views/quality/qualityProcess.vue

@@ -116,7 +116,8 @@ export default {
       input: '',
       curIndex: 1,
       pageSize: 10,
-      total: 0
+      total: 0,
+      processSerach: {}
     }
   },
   created() {
@@ -124,8 +125,14 @@ export default {
   },
   methods: {
     _initProcess() {
-      const processSerach = { id: this.$route.query.id, type: this.$route.query.type, dataType: this.$route.query.dataType, page: this.curIndex, perPage: this.pageSize }
-      getOnlineInfo(processSerach).then(res => {
+      if (!this.$route.query.dataType) {
+        console.log(this.$route.query.dataType)
+        this.processSerach = { id: this.$route.query.id, type: this.$route.query.type, page: this.curIndex, perPage: this.pageSize, startTime: this.$route.query.startTime, endTime: this.$route.query.endTime }
+      } else {
+        console.log(this.$route.query.dataType)
+        this.processSerach = { id: this.$route.query.id, type: this.$route.query.type, dataType: this.$route.query.dataType, page: this.curIndex, perPage: this.pageSize, startTime: this.$route.query.startTime, endTime: this.$route.query.endTime }
+      }
+      getOnlineInfo(this.processSerach).then(res => {
         this.tableData = res.data.data
         this.total = res.data.total
       })
@@ -165,7 +172,7 @@ export default {
           display flex
           justify-content space-around
     .block >>> th
-      background-color #F0F7FF !important
+      background-color #F1F4F7 !important
       font-size 10px
     .block >>> .el-table__body-wrapper  .cell
       font-size 10px