Ver código fonte

任务业务线更改

wangziqian 4 anos atrás
pai
commit
ff38c070eb

+ 1 - 0
src/router/needIdList.js

@@ -2,5 +2,6 @@ export const needIdList = [
   '项目详情',
   '需求详情',
   '任务详情',
+  '子任务详情',
   '迭代详情'
 ]

+ 1 - 1
src/views/business/bizIdSelect.vue

@@ -73,7 +73,7 @@ export default {
       const name = fromRoute.name
       const isDetailPage = needIdList.find(item => item === name)
       if (isDetailPage) {
-        this.$router.push({ name: name.substr(0, 2), query: { bizId: EncryptId(biz.code) }})
+        this.$router.push({ name: name.replace(/子|详情/g, ''), query: { bizId: EncryptId(biz.code) }})
       } else {
         this.$router.push({
           path: fromRoute.path,

+ 0 - 2
src/views/projectManage/iteration/details/iterationDetails.vue

@@ -85,11 +85,9 @@ export default {
   mounted() {
     this.iteratioFilter()
     this.$store.state.data.status = true
-    // this.$store.state.data.bizId = true
   },
   destroyed() {
     this.$store.state.data.status = false
-    // this.$store.state.data.bizId = false
   },
   methods: {
     async iteratioFilter() { // 迭代list

+ 10 - 5
src/views/projectManage/taskList/childrenTask/childDetail.vue

@@ -142,6 +142,7 @@
   </div>
 </template>
 <script>
+import { analysisBizId_id } from '@/utils/crypto-js.js'
 const _ = require('lodash')
 import { getById, subTaskUpdate, showIterationEnum, subTaskDelete } from '@/api/taskChild'
 import searchPeople from '@/components/select/searchPeople'
@@ -168,7 +169,7 @@ export default {
       userInformation: localStorage.getItem('username'),
       userNames: localStorage.getItem('realname'),
       deleteDialog: false, // 删除弹窗
-      taskId: Number(this.$route.query.id), // 任务id
+      taskId: -1, // 任务id
       allStatus: [], // 任务所有状态
       createChildren: false, // 新建子任务
       statusDialog: false, // 状态弹框
@@ -193,16 +194,20 @@ export default {
     }
   },
   created() {
+    this.analysisBizId_id()
     this.$store.state.data.status = true
-    this.$store.state.data.bizId = true
-    this.getTaskStatus()
-    this.getById()
   },
   destroyed() {
     this.$store.state.data.status = false
-    this.$store.state.data.bizId = false
   },
   methods: {
+    analysisBizId_id() { // 解析路由中的bizId_id
+      if (!this.$route.query.bizId_id) return
+      const bizId_id = analysisBizId_id(this.$route.query.bizId_id)
+      this.taskId = bizId_id[1]
+      this.getTaskStatus()
+      this.getById()
+    },
     inputProcess(val) { // 校验数字
       this.formData.process = val.replace(/[^\d\.\d]/g, '')
     },

+ 0 - 2
src/views/projectManage/taskList/childrenTask/childDrawer.vue

@@ -233,12 +233,10 @@ export default {
   },
   created() {
     this.$store.state.data.status = true
-    this.$store.state.data.bizId = true
     this.getTaskStatus()
   },
   destroyed() {
     this.$store.state.data.status = false
-    this.$store.state.data.bizId = false
   },
   methods: {
     inputProcess(val) { // 校验数字

+ 11 - 3
src/views/projectManage/taskList/childrenTask/childrenList.vue

@@ -60,6 +60,7 @@
   </div>
 </template>
 <script>
+import { analysisBizId_id } from '@/utils/crypto-js.js'
 import { getSubTaskList, subTaskUpdate, showIterationEnum } from '@/api/taskChild'
 import childDrawer from './childDrawer'
 import changeStatus from './changeStatus'
@@ -71,6 +72,7 @@ export default {
   },
   data() {
     return {
+      taskId: -1, // id
       all_task: [], // 任务列表
       allStatus: [
         { code: 0, msg: '未开始' },
@@ -91,8 +93,7 @@ export default {
     }
   },
   created() {
-    this.getTaskStatus()
-    this.getSubTasksList()
+    this.analysisBizId_id()
   },
   methods: {
     handleSizeChange(val) {
@@ -103,9 +104,16 @@ export default {
       this.pages.curIndex = val
       this.getSubTasksList()
     },
+    analysisBizId_id() { // 解析路由中的bizId_id
+      if (!this.$route.query.bizId_id) return
+      const bizId_id = analysisBizId_id(this.$route.query.bizId_id)
+      this.taskId = bizId_id[1]
+      this.getTaskStatus()
+      this.getSubTasksList()
+    },
     async getSubTasksList() { // 获取全部子任务
       const param = {
-        taskId: this.$route.query.id,
+        taskId: this.taskId,
         psgeSize: this.pages.pageSize,
         curIndex: this.pages.curIndex
       }

+ 6 - 1
src/views/projectManage/taskList/components/dataStatistics.vue

@@ -19,6 +19,7 @@
   </div>
 </template>
 <script>
+import { analysisBizId_id } from '@/utils/crypto-js.js'
 import normalEchart from '@/components/chart/normalEchart'
 import createdBug from '@/views/projectManage/bugList/file/createdBug'
 import { getTaskSumData } from '@/api/taskIndex'
@@ -30,6 +31,7 @@ export default {
   },
   data() {
     return {
+      taskId: -1,
       bugImg: bugImg,
       edit: false,
       dataChart1: false,
@@ -44,7 +46,10 @@ export default {
   },
   methods: {
     async getProjectSumData() { // 获取数据
-      const res = await getTaskSumData(this.$route.query.id)
+      const bizId_id = analysisBizId_id(this.$route.query.bizId_id)
+      this.taskId = bizId_id[1]
+      if (this.taskId === -1) return
+      const res = await getTaskSumData(this.taskId)
       if (res.code === 200) {
         this.bugData = res.data.bugData
         this.setDataChart(this.bugData.detail, 'echartsOption3')

+ 25 - 8
src/views/projectManage/taskList/components/reportList.vue

@@ -232,6 +232,8 @@
   </div>
 </template>
 <script>
+import { mapGetters } from 'vuex'
+import { analysisBizId_id } from '@/utils/crypto-js.js'
 import {
   dailyReport,
   projectTestReport,
@@ -264,7 +266,7 @@ export default {
       reportDaily: false,
       userInformation: localStorage.getItem('username'),
       userNames: localStorage.getItem('realname'),
-      taskId: Number(this.$route.query.id), // 任务id
+      taskId: -1, // 任务id
       stColors: ['#409EFF', '#07BCA4', '#F56C6C', '#07BCA4'],
       dataStatus: false, // 数据状态
       releaseDataStatus: false, // 准出
@@ -302,15 +304,30 @@ export default {
       dialogClient: false // 新建准出报告
     }
   },
-  created() {
-    this.reportdelivertestGetByTaskId()
-    this.dailyReportGetByTaskIdV2()
-    this.reportreleaseGetByTaskId()
+  computed: {
+    ...mapGetters(['bizId'])
+  },
+  watch: {
+    bizId: {
+      handler(newV) {
+        if (newV === -1) return
+        this.analysisBizId_id()
+      },
+      immediate: true
+    }
   },
   methods: {
+    analysisBizId_id() { // 解析路由中的bizId_id
+      if (!this.$route.query.bizId_id) return
+      const bizId_id = analysisBizId_id(this.$route.query.bizId_id)
+      this.taskId = bizId_id[1]
+      this.reportdelivertestGetByTaskId()
+      this.dailyReportGetByTaskIdV2()
+      this.reportreleaseGetByTaskId()
+    },
     async reportdelivertestGetByTaskId(e) { // 获取新提测
       e ? this.dataStatus = false : ''
-      const data = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.testPages.curIndex, pageSize: this.testPages.pageSize }
+      const data = { taskId: this.taskId, bizId: this.taskId, curIndex: this.testPages.curIndex, pageSize: this.testPages.pageSize }
       const res = await reportdelivertestGetByTaskId(data)
       if (res.code === 200) {
         this.testData = res.data.list
@@ -337,7 +354,7 @@ export default {
 
     async dailyReportGetByTaskIdV2(e) {
       e ? this.dailyDataStatus = false : ''
-      const indexPage = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.dailyPages.curIndex, pageSize: this.dailyPages.pageSize }
+      const indexPage = { taskId: this.taskId, bizId: this.bizId, curIndex: this.dailyPages.curIndex, pageSize: this.dailyPages.pageSize }
       const res = await dailyReportGetByTaskIdV2(indexPage)
       if (res.code === 200) {
         this.dailyData = res.data.list
@@ -364,7 +381,7 @@ export default {
 
     async reportreleaseGetByTaskId(e) {
       e ? this.releaseDataStatus = false : ''
-      const indexPage = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
+      const indexPage = { taskId: this.taskId, bizId: this.bizId, curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
       const res = await reportreleaseGetByTaskId(indexPage)
       if (res.code === 200) {
         this.clientData = res.data.list

+ 1 - 0
src/views/projectManage/taskList/components/scheduleList.vue

@@ -172,6 +172,7 @@ export default {
   watch: {
     id: {
       handler(newV, oldV) {
+        if (newV === -1) return
         this.$nextTick(() => {
           this.listByTask(newV)
         })

+ 21 - 7
src/views/projectManage/taskList/taskIndex.vue

@@ -215,6 +215,8 @@
 </template>
 
 <script>
+import { EncryptId } from '@/utils/crypto-js.js'
+import { mapGetters } from 'vuex'
 import {
   taskList,
   configShowTaskEnum,
@@ -270,6 +272,15 @@ export default {
       arry: []
     }
   },
+  computed: {
+    ...mapGetters(['bizId'])
+  },
+  watch: {
+    bizId() {
+      this.get_taskList()
+      this.get_taskSelect()
+    }
+  },
   created() {
     this.get_taskList()
     this.get_taskSelect()
@@ -288,13 +299,14 @@ export default {
       return item.idap
     },
     get_taskList(e) {
+      if (this.bizId === -1) return
       // 查询
       if (this.isToOne) {
         this.curIndex = 1
         this.currentPage = 1
       }
       this.table_loading = true
-      this.form_task.bizId = Number(localStorage.getItem('bizId'))
+      this.form_task.bizId = this.bizId
       this.form_task.pageSize = this.pageSize
       this.form_task.curIndex = this.curIndex
       for (const key in this.form_task) { // 接口不接受空值的处理
@@ -307,7 +319,7 @@ export default {
         this.total = res.total
         this.table_loading = false
       })
-      configShowRequirementVersionEnum({ bizId: Number(localStorage.getItem('bizId')) }).then(res => {
+      configShowRequirementVersionEnum({ bizId: this.bizId }).then(res => {
         // 获取需求(查询)
         this.demandList = res.data
       })
@@ -353,11 +365,12 @@ export default {
       })
     },
     link_task(id) {
+      const bizId_id = EncryptId(`${this.bizId}_${id}`)
       if (this.newTabOpen) {
-        const newTab = this.$router.resolve({ name: '任务详情', query: { id: id }})
+        const newTab = this.$router.resolve({ name: '任务详情', query: { bizId_id: bizId_id }})
         window.open(newTab.href, '_blank')
       } else {
-        this.$router.push({ name: '任务详情', query: { id: id }})
+        this.$router.push({ name: '任务详情', query: { bizId_id: bizId_id }})
       }
     },
     query_Reset() {
@@ -392,6 +405,7 @@ export default {
       this.get_taskList()
     },
     async get_taskSelect() {
+      if (this.bizId === -1) return
       // 下拉菜单数据
       const res = await configShowTaskEnum()
       if (res.code === 200) {
@@ -400,17 +414,17 @@ export default {
         this.taskSource = res.data.taskSource // 归属需求
         this.appClient = res.data.appClient // 涉及客户端
       }
-      const res1 = await configShowTaskStatusEnum(localStorage.getItem('bizId'))
+      const res1 = await configShowTaskStatusEnum(this.bizId)
       if (res1.code === 200) {
         this.daStatus = res1.data.taskStatus
       }
-      const res2 = await projectListProject({ bizId: Number(localStorage.getItem('bizId')) })
+      const res2 = await projectListProject({ bizId: this.bizId })
       if (res2.code === 200) {
         this.projectList = res2.data
       }
     },
     bugDataGet() { // 所属模块
-      settingQueryBizModuleList(Number(localStorage.getItem('bizId'))).then(res => {
+      settingQueryBizModuleList(this.bizId).then(res => {
         this.business_platform_Modular = res.data.map(item => ({
           ...item,
           value: item.id,

+ 24 - 19
src/views/projectManage/taskList/taskViewDetail.vue

@@ -258,7 +258,7 @@
             <div class="title-left-icon" />
             <div class="title-left-name">动态</div>
           </div>
-          <el-tabs v-model="tabPosition" class="sign-tabs" @tab-click="handleClick">
+          <el-tabs v-model="tabPosition" class="sign-tabs">
             <el-tab-pane label="评论" name="first">
               <div class="detail-info">
                 <ul class="comment-main">
@@ -300,7 +300,7 @@
       <!-- 缺陷 -->
       <el-container v-if="activeName === '3'" class="is-vertical">
         <section class="main-section contain">
-          <bugTableDialog ref="bugTableDialog" no-show="taskName" :obj-id="{ taskId: Number(this.$route.query.id) }" />
+          <bugTableDialog ref="bugTableDialog" no-show="taskName" :obj-id="{ taskId: taskId }" />
         </section>
       </el-container>
       <!-- 缺陷 -->
@@ -378,6 +378,8 @@ const _ = require('lodash')
 import Vue from 'vue'
 import VueClipboard from 'vue-clipboard2'
 Vue.use(VueClipboard)
+import { mapGetters } from 'vuex'
+import { analysisBizId_id } from '@/utils/crypto-js.js'
 import {
   taskGet,
   configShowTaskEnum,
@@ -477,7 +479,7 @@ export default {
       userNames: localStorage.getItem('realname'),
       textarea: '', // 评论
       showTaskDialog: false, // 状态弹窗
-      taskId: Number(this.$route.query.id), // 任务id
+      taskId: -1, // 任务id
       allStatus: [], // 任务所有状态
       belongProjectList: [], // 所属项目列表
       requireList: [], // 所属需求列表
@@ -504,40 +506,43 @@ export default {
       dplOption: [] // 关联的望岳任务
     }
   },
+
   computed: {
     getStatus() {
       return this.allStatus.find(item => item.code === this.form_query.status) || { name: null }
-    }
+    },
+    ...mapGetters(['bizId'])
   },
   watch: {
     activeName: {
       handler(newV) {
         Number(newV) > 0
-          ? this.$router.push({ path: this.$route.path, query: { id: this.$route.query.id, page: newV }})
-          : this.$router.push({ path: this.$route.path, query: { id: this.$route.query.id, page: '1' }})
+          ? this.$router.replace({ path: this.$route.path, query: { ...this.$route.query, page: newV }})
+          : this.$router.replace({ path: this.$route.path, query: { ...this.$route.query, page: '1' }})
       }
     }
   },
   created() {
+    this.analysisBizId_id()
     this.$nextTick(() => {
       this.activeName = this.$route.query.page ? this.$route.query.page : '1'
     })
-    this.taskGet()
-    this.getTaskStatus()
-    this.getBelongProject()
-    this.getRequireList()
-    this.getCommentList()
-    this.getScheduleGetTaskScheduleHistory()
     this.$store.state.data.status = true
-    // this.$store.state.data.bizId = true
   },
   destroyed() {
     this.$store.state.data.status = false
-    // this.$store.state.data.bizId = false
   },
   methods: {
-    handleClick(tab, event) {
-      console.log(tab, event)
+    analysisBizId_id() { // 解析路由中的bizId_id
+      if (!this.$route.query.bizId_id) return
+      const bizId_id = analysisBizId_id(this.$route.query.bizId_id)
+      this.taskId = bizId_id[1]
+      this.taskGet()
+      this.getTaskStatus()
+      this.getBelongProject()
+      this.getRequireList()
+      this.getCommentList()
+      this.getScheduleGetTaskScheduleHistory()
     },
     async getScheduleGetTaskScheduleHistory() {
       this.scheduleVisble = false
@@ -627,13 +632,13 @@ export default {
       this.taskGet()
     },
     async getBelongProject() { // 获取所属项目列表
-      const res = await projectListProject({ bizId: Number(localStorage.getItem('bizId')) })
+      const res = await projectListProject({ bizId: this.bizId })
       if (res.code === 200) {
         this.belongProjectList = res.data
       }
     },
     async getRequireList() { // 获取所属需求列表
-      const res = await configShowRequirementVersionEnum({ bizId: Number(localStorage.getItem('bizId')) })
+      const res = await configShowRequirementVersionEnum({ bizId: this.bizId })
       if (res.code === 200) {
         this.requireList = res.data
       }
@@ -651,7 +656,7 @@ export default {
       }
     },
     async taskGet() { // 获取任务详情
-      const res = await taskGet(this.$route.query.id)
+      const res = await taskGet(this.taskId)
       if (res.code === 200) {
         this.form_query = res.data
         if (this.form_query.isDirectlyFromDpm === 0 || this.form_query.isDirectlyFromDpm === 1) {