2022-06-29 15:50:26 +08:00
|
|
|
<template>
|
|
|
|
<div class="work-brnch-box">
|
|
|
|
<!-- 上 -->
|
|
|
|
<div class="flex-row-start top">
|
|
|
|
<div class="flex-row-start dept-left">
|
2022-06-30 13:15:27 +08:00
|
|
|
<dept-todo-view title="部门待办" v-loading="loadingToDo" :dataInfo="toToData"></dept-todo-view>
|
|
|
|
<dept-todo-view title="部门已办" v-loading="loadingHasToDo" :dataInfo="hasToDodoData"
|
|
|
|
style="margin-left: 0"></dept-todo-view>
|
2022-06-30 10:33:23 +08:00
|
|
|
</div>
|
|
|
|
<div class="flex-row-start dept-chart-box">
|
2022-07-01 14:03:31 +08:00
|
|
|
<dept-chart-view id="shelves" title="部门上架" v-loading="loadingResource" :dataList="resourceData"
|
2022-07-18 14:17:28 +08:00
|
|
|
ref="resourceChart" :colorArray="resourceColor">
|
2022-06-30 13:15:27 +08:00
|
|
|
</dept-chart-view>
|
2022-07-18 14:17:28 +08:00
|
|
|
<dept-chart-view id="apply" title="部门申请" v-loading="loadingApply" :dataList="applyData" ref="applyChart"
|
2022-07-01 14:03:31 +08:00
|
|
|
:colorArray="applyColor">
|
2022-06-30 13:15:27 +08:00
|
|
|
</dept-chart-view>
|
2022-07-01 14:03:31 +08:00
|
|
|
<dept-chart-view id="demand" title="部门需求" v-loading="loadingRequire" :dataList="requireData"
|
2022-07-18 14:17:28 +08:00
|
|
|
ref="requireChart" :colorArray="requireColor">
|
2022-06-30 13:15:27 +08:00
|
|
|
</dept-chart-view>
|
2022-06-29 15:50:26 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 中 -->
|
|
|
|
<div class="center">
|
|
|
|
<center-view></center-view>
|
|
|
|
</div>
|
|
|
|
<!-- 下 -->
|
|
|
|
<div class="bottom">
|
|
|
|
<bottom-view></bottom-view>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import BottomView from '../workBench/components/bottom-view.vue'
|
|
|
|
import CenterView from '../workBench/components/center-view.vue'
|
2022-06-30 10:33:23 +08:00
|
|
|
import DeptChartView from '../workBench/components/dept-chart-view.vue'
|
2022-06-29 15:50:26 +08:00
|
|
|
import deptTodoView from '../workBench/components/dept-todo-view.vue'
|
2022-06-30 10:33:23 +08:00
|
|
|
import * as Apis from './api.js'
|
2022-06-29 15:50:26 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
deptTodoView,
|
|
|
|
BottomView,
|
|
|
|
CenterView,
|
2022-06-30 10:33:23 +08:00
|
|
|
DeptChartView,
|
2022-06-29 15:50:26 +08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
// 部门待办
|
|
|
|
toToData: {
|
|
|
|
color: '#f86f01',
|
2022-06-29 17:23:32 +08:00
|
|
|
imgSrc: require('@/assets/img/workBench/todo.png'),
|
|
|
|
bgColor: 'rgba(228,138,1,0.12)',
|
|
|
|
borderColor: 'rgba(250,123,12,0.54)',
|
|
|
|
textColor: '#f86f01',
|
2022-06-30 10:33:23 +08:00
|
|
|
num: 0,
|
2022-06-29 17:23:32 +08:00
|
|
|
list: [],
|
2022-07-18 14:17:28 +08:00
|
|
|
type: 'todo',
|
2022-07-01 15:43:13 +08:00
|
|
|
url: 'activiti-my-todo-task'
|
2022-06-29 15:50:26 +08:00
|
|
|
},
|
|
|
|
// 部门已办
|
|
|
|
hasToDodoData: {
|
2022-06-29 17:23:32 +08:00
|
|
|
noMarginleft: true,
|
2022-06-29 15:50:26 +08:00
|
|
|
color: '#21b107',
|
2022-06-29 17:23:32 +08:00
|
|
|
imgSrc: require('@/assets/img/workBench/hasToDo.png'),
|
|
|
|
bgColor: 'rgba(37,165,13,0.12)',
|
|
|
|
borderColor: 'rgba(49,194,20,0.54)',
|
|
|
|
textColor: '#21b107',
|
2022-06-30 10:33:23 +08:00
|
|
|
num: 0,
|
2022-06-29 17:23:32 +08:00
|
|
|
list: [],
|
2022-07-01 15:43:13 +08:00
|
|
|
url: 'activiti-my-join-task'
|
2022-06-30 10:33:23 +08:00
|
|
|
},
|
2022-07-01 14:03:31 +08:00
|
|
|
// 部门申请
|
2022-06-30 10:33:23 +08:00
|
|
|
resourceData: [],
|
2022-07-01 14:03:31 +08:00
|
|
|
resourceColor: ['#7b2cff', '#fd5151', , '#2ca1ff', '#0adbfa', '#febe13', '#65e5dd', '#f071ff', '#85f67a'],
|
|
|
|
// 部门申请
|
2022-06-30 10:33:23 +08:00
|
|
|
applyData: [],
|
2022-07-01 14:03:31 +08:00
|
|
|
applyColor: ["#5085f2", "#e75fc3", "#f87be2", "#f2719a", "#fca4bb", "#f59a8f", "#fdb301", "#57e7ec", "#cf9ef1"],
|
|
|
|
// 部门需求
|
2022-06-30 10:33:23 +08:00
|
|
|
requireData: [],
|
2022-07-01 14:03:31 +08:00
|
|
|
requireColor: ['#FD866A', '#9E87FF', '#58D5FF', '#73DDFF', '#73ACFF', '#FDD56A', '#FDB36A',],
|
2022-06-30 13:15:27 +08:00
|
|
|
loadingToDo: false,
|
|
|
|
loadingHasToDo: false,
|
|
|
|
loadingResource: false,
|
|
|
|
loadingApply: false,
|
|
|
|
loadingRequire: false,
|
2022-06-29 15:50:26 +08:00
|
|
|
}
|
|
|
|
},
|
2022-06-29 17:23:32 +08:00
|
|
|
mounted() {
|
2022-06-30 10:33:23 +08:00
|
|
|
// 部门待办
|
2022-06-29 17:23:32 +08:00
|
|
|
this.getToDo()
|
2022-06-30 10:33:23 +08:00
|
|
|
// 部门已办
|
2022-06-29 17:23:32 +08:00
|
|
|
this.getHasToDo()
|
2022-06-30 10:33:23 +08:00
|
|
|
// 上架
|
|
|
|
this.getShelvesTotal()
|
|
|
|
// 申请
|
|
|
|
this.getApplyTotal()
|
|
|
|
// 需求
|
|
|
|
this.getRequireTotal()
|
2022-06-29 17:23:32 +08:00
|
|
|
},
|
2022-06-29 15:50:26 +08:00
|
|
|
methods: {
|
2022-06-29 17:23:32 +08:00
|
|
|
// 待办
|
|
|
|
getToDo() {
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingToDo = true;
|
2022-06-29 17:23:32 +08:00
|
|
|
let data = {
|
|
|
|
limit: 5,
|
|
|
|
page: 1,
|
|
|
|
}
|
|
|
|
Apis.getToDoTask(data, res => {
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingToDo = false;
|
2022-06-29 17:23:32 +08:00
|
|
|
if (res.data.code !== 0) {
|
2022-06-30 10:33:23 +08:00
|
|
|
return this.$message.error(res.data.msg)
|
2022-06-29 17:23:32 +08:00
|
|
|
}
|
|
|
|
console.log('res----待办-------->', res.data);
|
|
|
|
this.toToData.list = res.data.data.records || []
|
2022-07-01 13:29:38 +08:00
|
|
|
this.toToData.num = res.data.data.total || 0
|
2022-06-29 17:23:32 +08:00
|
|
|
}, err => {
|
2022-06-30 13:15:27 +08:00
|
|
|
this.$message.error(err);
|
|
|
|
this.loadingToDo = false;
|
2022-06-29 17:23:32 +08:00
|
|
|
})
|
|
|
|
},
|
|
|
|
// 已办
|
|
|
|
getHasToDo() {
|
|
|
|
let data = {
|
|
|
|
limit: 5,
|
|
|
|
page: 1,
|
|
|
|
}
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingHasToDo = true;
|
2022-06-29 17:23:32 +08:00
|
|
|
Apis.getHasToDoTask(data, res => {
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingHasToDo = false;
|
2022-06-29 17:23:32 +08:00
|
|
|
if (res.data.code !== 0) {
|
2022-06-30 10:33:23 +08:00
|
|
|
return this.$message.error(res.data.msg)
|
2022-06-29 17:23:32 +08:00
|
|
|
}
|
|
|
|
console.log('res----已办-------->', res.data);
|
|
|
|
this.hasToDodoData.list = res.data.data.records || []
|
2022-07-01 13:29:38 +08:00
|
|
|
this.hasToDodoData.num = res.data.data.total || 0
|
2022-07-18 14:17:28 +08:00
|
|
|
|
2022-06-29 17:23:32 +08:00
|
|
|
}, err => {
|
2022-06-30 10:33:23 +08:00
|
|
|
this.$message.error(err)
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingHasToDo = false;
|
2022-06-29 17:23:32 +08:00
|
|
|
console.log('err-----已办------->', err);
|
|
|
|
})
|
|
|
|
},
|
2022-06-30 10:33:23 +08:00
|
|
|
// 部门上架
|
|
|
|
getShelvesTotal() {
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingResource = true;
|
2022-06-30 10:33:23 +08:00
|
|
|
Apis.getTotalByDept({}, res => {
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingResource = false;
|
2022-06-30 10:33:23 +08:00
|
|
|
if (res.data.code !== 0) {
|
|
|
|
return this.$message.error(res.data.msg)
|
|
|
|
}
|
|
|
|
console.log('res----部门上架-------->', res.data);
|
|
|
|
this.resourceData = this.formatList(res.data.data.total || [])
|
2022-07-18 14:17:28 +08:00
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.resourceChart.initChart(this.resourceData)
|
|
|
|
})
|
2022-06-30 10:33:23 +08:00
|
|
|
}, err => {
|
|
|
|
this.$message.error(err)
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingResource = false;
|
2022-06-30 10:33:23 +08:00
|
|
|
})
|
|
|
|
},
|
|
|
|
// 部门申请
|
|
|
|
getApplyTotal() {
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingApply = true;
|
2022-06-30 10:33:23 +08:00
|
|
|
Apis.getApply({}, res => {
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingApply = false;
|
2022-06-30 10:33:23 +08:00
|
|
|
if (res.data.code !== 0) {
|
|
|
|
return this.$message.error(res.data.msg)
|
|
|
|
}
|
|
|
|
console.log('res----部门申请-------->', res.data);
|
|
|
|
this.applyData = this.formatList(res.data.data.total || [])
|
2022-07-18 14:17:28 +08:00
|
|
|
this.$nextTick(() => {
|
|
|
|
console.log('this.applyData------------>', this.applyData);
|
|
|
|
this.$refs.applyChart.initChart(this.applyData)
|
|
|
|
})
|
2022-06-30 10:33:23 +08:00
|
|
|
}, err => {
|
|
|
|
this.$message.error(err)
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingApply = false;
|
2022-06-30 10:33:23 +08:00
|
|
|
})
|
|
|
|
},
|
|
|
|
formatList(list = [], nameStr = 'type') {
|
|
|
|
let arr = []
|
|
|
|
list.map(v => {
|
|
|
|
let obj = {}
|
|
|
|
obj.name = v[nameStr];
|
|
|
|
obj.value = v.count;
|
|
|
|
arr.push(obj)
|
|
|
|
})
|
|
|
|
return arr;
|
|
|
|
},
|
|
|
|
// 部门需求
|
|
|
|
getRequireTotal() {
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingRequire = true;
|
2022-06-30 10:33:23 +08:00
|
|
|
Apis.getRequire({}, res => {
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingRequire = false;
|
2022-06-30 10:33:23 +08:00
|
|
|
if (res.data.code !== 0) {
|
|
|
|
return this.$message.error(res.data.msg)
|
|
|
|
}
|
|
|
|
console.log('res----部门需求-------->', res.data);
|
|
|
|
this.requireData = this.formatList(res.data.data.total || [], 'flag')
|
2022-07-18 14:17:28 +08:00
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.requireChart.initChart(this.requireData)
|
|
|
|
})
|
2022-06-30 13:15:27 +08:00
|
|
|
|
2022-06-30 10:33:23 +08:00
|
|
|
}, err => {
|
|
|
|
this.$message.error(err)
|
2022-06-30 13:15:27 +08:00
|
|
|
this.loadingRequire = false;
|
2022-06-30 10:33:23 +08:00
|
|
|
})
|
|
|
|
},
|
|
|
|
|
2022-06-29 15:50:26 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.margin-h-16 {
|
|
|
|
margin: 0 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.flex-row-start {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-start;
|
|
|
|
}
|
|
|
|
|
|
|
|
.work-brnch-box {
|
2022-07-01 14:50:29 +08:00
|
|
|
|
2022-06-29 15:50:26 +08:00
|
|
|
.top {
|
|
|
|
height: 284px;
|
|
|
|
margin-bottom: 16px;
|
2022-06-30 10:33:23 +08:00
|
|
|
|
2022-06-29 15:50:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.dept-left {
|
|
|
|
width: 836px;
|
2022-06-30 10:33:23 +08:00
|
|
|
background: #fff;
|
|
|
|
margin-right: 16px;
|
2022-06-29 15:50:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.dept-chart-box {
|
|
|
|
width: 780px;
|
|
|
|
height: 100%;
|
2022-06-30 10:33:23 +08:00
|
|
|
background: #fff;
|
2022-06-29 15:50:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|