Forráskód Böngészése

团队工作台筛选变更多选

qinzhipeng_v@didiglobal.com 4 éve
szülő
commit
328000559b

+ 2 - 1
src/api/workSchedule.js

@@ -111,7 +111,8 @@ export function teamQueryWorkList(data) {
   return request({
     url: TeamManagement + `/workbench/team/queryWorkList`,
     method: 'post',
-    data
+    data,
+    timeout: '10000'
   })
 }
 

+ 16 - 0
src/views/quality/defectStatistics.vue

@@ -232,6 +232,13 @@
                 <span class="repair-span">{{ scope.row.repairData.detail[1].label }}:{{ scope.row.repairData.detail[1].total }}</span>
               </template>
             </el-table-column>
+            <el-table-column prop="holdData" label="Hold" sortable="custom">
+              <template slot-scope="scope">
+                <span class="table-repair-item2 repair-span2">{{ scope.row.holdData.total }}</span>
+                <span class="repair-span">{{ scope.row.holdData.detail[0].label }}:{{ scope.row.holdData.detail[0].total }}</span>
+                <span class="repair-span">{{ scope.row.holdData.detail[1].label }}:{{ scope.row.holdData.detail[1].total }}</span>
+              </template>
+            </el-table-column>
             <el-table-column prop="repairTimeAvgData" label="平均修复时长" min-width="120">
               <template slot-scope="scope">
                 <span class="table-repair-item3 repair-span">{{ scope.row.repairTimeAvgData.total }}</span>
@@ -298,6 +305,15 @@
                 <span class="repair-span">{{ scope.row.repairData.detail[1].label }}:{{ scope.row.repairData.detail[1].total }}</span>
               </template>
             </el-table-column>
+            <el-table-column prop="holdData" label="Hold" sortable="custom">
+              <template slot-scope="scope">
+                <span class="table-repair-item2 repair-span2" @click.stop>
+                  <span style="cursor: pointer;" @click="getBugmembers(scope.row, 'holdData')">{{ scope.row.holdData.total }}</span>
+                </span>
+                <span class="repair-span">{{ scope.row.holdData.detail[0].label }}:{{ scope.row.holdData.detail[0].total }}</span>
+                <span class="repair-span">{{ scope.row.holdData.detail[1].label }}:{{ scope.row.holdData.detail[1].total }}</span>
+              </template>
+            </el-table-column>
             <el-table-column prop="repairTimeAvgData" label="平均修复时长" min-width="120">
               <template slot-scope="scope">
                 <span class="table-repair-item3 repair-span" @click.stop>

+ 3 - 2
src/views/workbench/components/listView.vue

@@ -172,7 +172,7 @@ export default {
   },
   props: {
     type: { type: String, required: true },
-    biz: { type: Number, default: null }
+    biz: { type: Object, default: null }
   },
   data() {
     return {
@@ -234,7 +234,7 @@ export default {
     biz: {
       handler(newV) {
         if (newV) {
-          this.searchForm.bizId = newV
+          this.searchForm = newV
           this.radio_aelect()
         }
       },
@@ -251,6 +251,7 @@ export default {
       this.radioChange()
     },
     async radioChange() {
+      console.log(this.searchForm, '那就看你空间内即可')
       const data = {
         timeInfo: {
           startTime: this.team_timeSelectVal[0] || '',

+ 1 - 1
src/views/workbench/components/searchSection.vue

@@ -132,7 +132,7 @@ export default {
   methods: {
     async queryTeamMember() { // 获取团队人员
       if (this.workbench === '团队' || this.workbench === '团队忙碌' || this.workbench === '团队空闲') {
-        const res = await queryTeamMember(this.searchForm)
+        const res = await queryTeamMember({ teamIds: this.searchForm.teamIds })
         if (res.code === 200) {
           res.data = res.data || []
           this.memberList = this.handleMember(res.data)

+ 2 - 2
src/views/workbench/team/components/ganntViews.vue

@@ -109,8 +109,8 @@ export default {
     async radioChange() {
       const data = {
         teamSearchInfo: {
-          bizId: this.searchForm.bizId, // 业务线
-          teamId: this.searchForm.teamId // 团队id
+          bizIds: this.searchForm.bizIds, // 业务线
+          teamIds: this.searchForm.teamIds // 团队id
         },
         timeInfo: {
           startTime: moment(this.timeSelectVal[0]).format('YYYY.MM.DD'),

+ 190 - 31
src/views/workbench/team/index.vue

@@ -3,9 +3,11 @@
     <!-- 顶部导航栏 -->
     <el-header class="main-header">
       <div class="select-group">
-        <el-cascader ref="cascader" v-model="teamNames" :options="options" class="cascader" @change="handleChange" />
-        <span class="el-dropdown-link" @click="setCascader">{{ teamBizName.length > 11 ? teamBizName.substring(0, 11) + '...' : teamBizName }} <i class="el-icon-arrow-down" /></span>
-        <el-dropdown size="small" style="margin-left: 20px" @command="handleBizId">
+        <el-cascader ref="cascader" v-model="teamNames" collapse-tags :options="options" :props="props" class="cascader" style="width: 20%" @change="handleChange(teamNames, options)" />
+        <span class="el-dropdown-link" style="margin-right: 20px;" @click="setCascader">{{ teamBizName.length > 11 ? teamBizName.substring(0, 11) + '...' : teamBizName }} <i class="el-icon-arrow-down" /></span>
+        <el-cascader ref="cascader" v-model="bizIdCode" collapse-tags :options="searchEnum.businesslines" :props="propsBizId" class="cascader" @change="handleBizIdChange(bizIdCode, searchEnum.businesslines)" />
+        <span class="el-dropdown-link" @click="setCascader">{{ bizName.length > 11 ? bizName.substring(0, 11) + '...' : bizName }} <i class="el-icon-arrow-down" /></span>
+        <!-- <el-dropdown size="small" style="margin-left: 20px" @command="handleBizId">
           <span class="el-dropdown-link">
             {{ bizName }}<i class="el-icon-arrow-down el-icon--right" />
           </span>
@@ -16,7 +18,7 @@
               :command="item.code"
             >{{ item.name }}</el-dropdown-item>
           </el-dropdown-menu>
-        </el-dropdown>
+        </el-dropdown> -->
       </div>
       <div class="top-tabs">
         <el-tabs v-model="activeName" @tab-click="handleClick">
@@ -42,7 +44,7 @@
           <el-tab-pane label="列表视图" name="3" />
           <el-tab-pane label="甘特图" name="2" />
         </el-tabs>
-        <list-view v-show="activeSchedule === '3'" :type="'团队'" :biz="bizId" />
+        <list-view v-show="activeSchedule === '3'" :type="'团队'" :biz="searchForm" />
         <search-section
           v-show="activeSchedule === '1'"
           ref="search-section"
@@ -253,12 +255,20 @@ export default {
   data() {
     return {
       value: [],
+      props: { multiple: true },
+      propsBizId: {
+        multiple: true,
+        value: 'code',
+        label: 'name',
+        children: 'children'
+      },
       options: [],
       activeName: '1', // 顶部导航栏
       activeSchedule: '1', // 日历和甘特图切换
+      optionData: [],
       searchForm: {
-        teamId: null,
-        bizId: null
+        teamIds: [],
+        bizIds: []
       },
       searchEnum: {
         businesslines: []
@@ -266,6 +276,7 @@ export default {
       dialog_team_visible: false, // 删除日程弹窗
       // teamName: '团队', // 团队名字
       teamNames: [],
+      bizIdCode: [-1],
       teamBizName: '团队',
       bizName: '业务线', // 业务线名字
       filtrate: {// 筛选区域
@@ -281,6 +292,8 @@ export default {
         }
       ],
       loading: true,
+      bizCode: 0,
+      teamCode: 0,
       calendarView: null, // 日程图表数据
       showDetail: false, // 显示详情弹框
       nowDetailData: {}, // 当前选中日程的数据
@@ -296,6 +309,7 @@ export default {
         visible: false,
         data: null
       },
+      datas: [],
       DialogTitle: '新建排期', // 排期弹框标题
       isDelete: false, // 删除排期操作
       visibleSchedule: false, // 排期任务弹框
@@ -339,32 +353,160 @@ export default {
     })
   },
   mounted() {
-    this.queryTeamInfoList()
+    this.queryTeamInfoList([-1])
     this.teamReminding()
   },
   methods: {
     setCascader() {
       this.$refs.cascader.$el.click()
     },
-    handleChange(val) {
-      let a = ''
-      let b = ''
-      this.options.map(item => {
-        if (item.value === val[0]) {
-          a = item.label
+    handleBizIdChange(val, option) {
+      console.log(val, option, '业务线1')
+      if (val.length > 0) {
+        const one = val[0]
+        const tow = val[1] || ''
+        let [name, nameTow] = ['', '']
+        option.map(item => {
+          this.optionData.push(item.code)
+          if (one[0] !== -1 && item.code === one[0]) name = item.name
+          if (val[1] && item.code === tow[0]) nameTow = item.name
+        })
+        if (this.bizCode === 0 && one[0] === -1) { // 默认全选
+          console.log('默认全选')
+          this.bizName = '业务线'
+          this.bizIdCode = this.optionData
+          this.bizCode = 1
+        } else {
+          if (one[0] !== -1 && this.bizCode === 1) { // 取消全选
+            console.log('取消全选')
+            this.bizIdCode = null
+            this.bizName = name + (nameTow ? '/' + nameTow : '')
+            this.bizCode = 0
+          } else if (one[0] === -1 && val.length < option.length) { // 点击全选以外的,取消全选
+            console.log('点击全选以外的,取消全选')
+            const data = val.filter(item => { return item[0] })
+            data.splice(0, 1)
+            this.bizIdCode = data
+            this.bizName = (name ? name + '/' : '') + (nameTow ? '' + nameTow : '')
+            this.bizCode = 0
+          } else if (one[0] !== -1 && val.length === (option.length - 1)) { // 点击其余的全部,触发全选
+            console.log('点击其余的全部,触发全选')
+            const data = val.filter(item => { return item[0] })
+            data.unshift([-1])
+            this.bizIdCode = data
+            this.bizName = '业务线'
+            this.bizCode = 1
+          } else if (one[0] !== -1) { // 基础多选
+            console.log('基础多选')
+            const data = val.filter(item => { return item[0] })
+            this.bizIdCode = data
+            this.bizName = name + (nameTow ? '/' + nameTow : '')
+          }
+        }
+        const arr = this.bizIdCode.map(value => {
+          return value[0]
+        })
+        console.log(arr, 'bizId')
+        if (arr[0] === undefined) {
+          this.handleBizId([-1])
+        } else {
+          this.handleBizId(arr)
         }
-        if (item.children) {
-          item.children.map(item => {
-            if (item.value === val[1]) {
-              b = item.label
+      } else {
+        this.bizIdCode = [-1]
+        this.bizName = '业务线'
+      }
+    },
+    handleChange(val, options) {
+      console.log(val, options, '团队')
+      if (val.length > 0) {
+        let [a, b, stop] = ['', '', true]
+        val.map(e => {
+          this.options.map(item => {
+            if (item.value === e[0]) a = item.label
+            if (item.children && stop) {
+              item.children.map(item => {
+                this.searchForm.teamIds.push(item.value)
+                if (item.value === e[1]) {
+                  b = item.label
+                  stop = false
+                }
+              })
             }
           })
+        })
+        const arr = val[0]
+        if (this.teamCode === 0 && arr[0] === -1) { // 默认全选
+          console.log('默认全选')
+          this.teamNames = this.datas
+          this.teamBizName = '团队'
+          this.teamCode = 1
+          this.bizName = '业务线'
+          this.bizIdCode = this.optionData
+        } else if (arr[0] !== -1 && this.teamCode === 1) {
+          console.log('取消全选')
+          this.teamNames = null
+          this.teamBizName = '团队'
+          this.teamCode = 0
+          this.bizIdCode = null
+        } else {
+          if (arr[0] === -1 && val.length < this.datas.length) {
+            const data = val.filter(item => { return item[0] })
+            data.splice(0, 1)
+            this.teamBizName = a + (b ? ' / ' + b : '')
+            this.teamNames = data
+            this.teamCode = 0
+            const datas = data.map(item => { return item[0] })
+            const bizIds = Array.from(new Set(datas))
+            console.log('点击全选以外的,取消全选', data, datas, bizIds)
+            this.bizIdCode = bizIds
+            let [n, nameTow] = ['', '']
+            this.searchEnum.businesslines.map(item => {
+              if (item.code === bizIds[0]) n = item.name
+              if (bizIds[1] && item.code === bizIds[1]) nameTow = item.name
+            })
+            this.bizName = n + (nameTow ? '/' + nameTow : '')
+          } else if (arr[0] !== -1 && val.length === (this.datas.length - 1)) {
+            console.log('点击其余的全部,触发全选')
+            const data = val.filter(item => { return item[0] })
+            data.unshift([-1])
+            this.teamBizName = '团队'
+            this.teamNames = data
+            this.teamCode = 1
+            this.bizName = '业务线'
+            this.bizIdCode = this.optionData
+          } else if (arr[0] !== -1) {
+            console.log('基础多选')
+            this.teamNames = val
+            this.teamBizName = a + (b ? ' / ' + b : '')
+            const datas = val.map(item => { return item[0] })
+            const bizIds = Array.from(new Set(datas))
+            this.bizIdCode = bizIds
+            let [name, nameTow] = ['', '']
+            this.searchEnum.businesslines.map(item => {
+              if (item.code === bizIds[0]) name = item.name
+              if (bizIds[1] && item.code === bizIds[1]) nameTow = item.name
+            })
+            this.bizName = name + (nameTow ? '/' + nameTow : '')
+          }
         }
-      })
-      this.searchForm.teamId = val[1]
-      this.searchForm.bizId = val[0]
-      this.bizName = a
-      this.teamBizName = a + (b ? ' / ' + b : '')
+        console.log(this.teamNames, this.bizIdCode, '看看你是谁')
+        this.searchForm.bizIds = this.bizIdCode
+        this.handleBizId(this.searchForm.bizIds)
+        const teamNum = []
+        this.teamNames.map(s => {
+          if (s[0] === -1) {
+            this.searchForm.teamIds = [-1]
+          } else {
+            teamNum.push(s[1])
+          }
+        })
+        this.searchForm.teamIds = Array.from(new Set(teamNum))
+        console.log(this.searchForm.teamIds, '看看ssss你是谁')
+      } else {
+        this.teamBizName = '团队'
+        this.bizName = '业务线'
+      }
     },
     handleClick() {
       if (this.activeName === '5' && this.$refs.bugTableDialog) {
@@ -390,29 +532,43 @@ export default {
           label: item.bizName,
           children: item.teamInfos ? this.setTeamChildren(item.teamInfos) : null
         }))
+        this.options[0].value = -1
+        this.datas = []
+        this.options.map(item => {
+          if (item.children) {
+            item.children.map(i => {
+              this.datas.push([item.value, i.value])
+            })
+          } else {
+            this.datas.push([item.value])
+          }
+        })
+        this.handleChange(this.datas, this.options)
       }
       const res = await settingGetBizList({})
       if (res.code === 200 && res.data) {
         this.searchEnum.businesslines = res.data.filter(item => item.isSecret === 0)
-        this.searchEnum.businesslines.unshift({ code: null, name: '全部' })
+        this.searchEnum.businesslines.unshift({ code: -1, name: '全部' })
+        this.handleBizIdChange([[-1]], this.searchEnum.businesslines)
       }
     },
     setTeamChildren(data) {
       const arr = data.map(item => ({ value: item.code, label: item.name }))
       return arr
     },
-    async queryTeamInfoList() { // 获取用户团队列表
-      const res = await queryTeamInfoList({ curIndex: 1, pageSize: 9999, type: 0, bizId: this.searchForm.bizId })
+    async queryTeamInfoList(e) { // 获取用户团队列表
+      const res = await queryTeamInfoList({ curIndex: 1, pageSize: 9999, type: 0, bizIds: e })
       if (res.code === 200 && res.data) {
         this.searchEnum.teams = res.data.list
         this.searchEnum.teams.unshift({ teamId: null, teamName: '全部团队' })
       }
     },
     handleBizId(e) { // 业务线变动
-      this.searchForm.bizId = e
-      this.queryTeamInfoList()// 重新获取团队
-      const res = this.searchEnum.businesslines.find(item => item.code === e)
-      this.bizName = res.name
+      console.log(e, 'bizList')
+      this.searchForm.bizIds = e
+      this.queryTeamInfoList(this.searchForm.bizIds)// 重新获取团队
+      // const res = this.searchEnum.businesslines.find(item => item.code === e)
+      // this.bizName = res.name
       // this.$store.dispatch('global/setBizId', res.code)
       this.handleClick()
     },
@@ -736,6 +892,9 @@ export default {
   }
   /deep/.el-input__icon {
     display: none;
-}
+  }
+  /deep/.el-cascader__tags .el-tag {
+    display: none;
+  }
 }
 </style>