Compare commits

..

2 Commits

8 changed files with 390 additions and 365 deletions

View File

@ -114,7 +114,7 @@ export const getResourceByDept = (data, success, fail) => {
Request({
methods: 'get',
// url: '/resource/getByDept',
url: '/workdynamics/getDeptWork',
url: '/workdynamics/page',
data
}).then(res => {
success && success(res)

View File

@ -86,7 +86,8 @@ export default {
getResourceByDept () {
const data = {
limit: 5,
page: 1
page: 1,
name: ''
}
this.loadingDynamic = true
Apis.getResourceByDept(

View File

@ -1,3 +1,10 @@
<!--
* @Author: hisense.wuhongjian
* @Date: 2022-07-05 12:53:03
* @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-08-26 10:24:16
* @Description: 告诉大家这是什么
-->
<template>
<div class="center-view">
<!-- 频率 -->
@ -14,7 +21,7 @@ import RiskView from './risk-view.vue'
import TrendView from './trend-view.vue'
export default {
components: { frequencyTop5View, TrendView, RiskView },
components: { frequencyTop5View, TrendView, RiskView }
}
</script>

View File

@ -8,13 +8,13 @@
</template>
<script>
import * as echarts from 'echarts';
import * as echarts from 'echarts'
export default {
data () {
return {
dataListCopy: [],
myChart: null,
myChart: null
}
},
props: {
@ -33,41 +33,41 @@ export default {
colorArray: {
type: Array,
default: () => [
'#fe845e', '#ff3e55', '#d5c438', '#ff9999', '#9c78ed', '#48c760', '#48c6c7', '#0058e1',
'#fe845e', '#ff3e55', '#d5c438', '#ff9999', '#9c78ed', '#48c760', '#48c6c7', '#0058e1'
]
},
}
},
watch: {
dataList: {
handler (newVal, oldVal) {
if (newVal) {
this.dataListCopy = newVal;
this.dataListCopy = newVal
this.initChart()
}
},
deep: true,
immediate: true
},
}
},
mounted () {
},
methods: {
initChart () {
var chartDom = document.getElementById(this.id);
var chartDom = document.getElementById(this.id)
if (this.myChart) {
this.myChart.dispose()
}
this.myChart = chartDom && echarts.init(chartDom);
this.myChart = chartDom && echarts.init(chartDom)
let lengendArr = this.dataListCopy.filter(v => v.name);
let total = 0;
const lengendArr = this.dataListCopy.filter(v => v.name)
let total = 0
this.dataListCopy.map(v => {
if (v.value || v.value === 0) {
total = total + Number(v.value || 0)
}
})
let option = {
"animation": true,
const option = {
animation: true,
title: [
{
text: '{val|' + total + '} {unit|' + '个' + '}',
@ -85,11 +85,11 @@ export default {
fontSize: 16,
fontWeight: 'normal',
color: '#212121',
padding: [80, 0],
padding: [80, 0]
}
}
}
}
},
},
},
],
tooltip: {
triagger: 'item',
@ -101,90 +101,90 @@ export default {
str = `<span style="display:inline-block;margin-right:5px;
border-radius:10px;width:10px;height:10px;background-color:${params.color};"></span>${params.name}: ${params.value}`
}
return str;
return str
}
},
"legend": {
legend: {
type: 'scroll',
"width": "90%",
"left": "center",
"textStyle": {
"color": "#212121",
"fontSize": 12
width: '90%',
left: 'center',
textStyle: {
color: '#212121',
fontSize: 12
},
"icon": "circle",
"right": "0",
"bottom": "30",
icon: 'circle',
right: '0',
bottom: '30',
// "padding": [10, 60],
"itemGap": 10,
"data": lengendArr
itemGap: 10,
data: lengendArr
},
"series": [{
"type": "pie",
"center": ["50%", "40%"],
"radius": ["50%", "63%"],
"color": this.colorArray,
"startAngle": 135,
series: [{
type: 'pie',
center: ['50%', '40%'],
radius: ['50%', '63%'],
color: this.colorArray,
startAngle: 135,
label: {
show: false
},
"emphasis": {
"label": {
"show": false,
"formatter": "{b|{b}:} {per|{d}%} ",
"backgroundColor": "rgba(255, 147, 38, 0)",
"borderColor": "transparent",
"borderRadius": 4,
"rich": {
"a": {
"color": "#999",
"lineHeight": 22,
"align": "center"
emphasis: {
label: {
show: false,
formatter: '{b|{b}:} {per|{d}%} ',
backgroundColor: 'rgba(255, 147, 38, 0)',
borderColor: 'transparent',
borderRadius: 4,
rich: {
a: {
color: '#999',
lineHeight: 22,
align: 'center'
},
"hr": {
"borderColor": "#aaa",
"width": "100%",
"borderWidth": 1,
"height": 0
hr: {
borderColor: '#aaa',
width: '100%',
borderWidth: 1,
height: 0
},
"b": {
"color": "#fff",
"fontSize": 18,
"lineHeight": 33
b: {
color: '#fff',
fontSize: 18,
lineHeight: 33
},
"c": {
"fontSize": 14,
"color": "#eee"
c: {
fontSize: 14,
color: '#eee'
},
"per": {
"color": "#FDF44E",
"fontSize": 25,
"padding": [5, 6],
"borderRadius": 2
per: {
color: '#FDF44E',
fontSize: 25,
padding: [5, 6],
borderRadius: 2
}
}
}
},
data: this.dataListCopy,
data: this.dataListCopy
},
{
"type": "pie",
"center": ["50%", "40%"],
"radius": ["38%", "39%"],
"label": {
"show": false
type: 'pie',
center: ['50%', '40%'],
radius: ['38%', '39%'],
label: {
show: false
},
hoverAnimation: false,
showTooltip: false,
color: ['#d8dde8'],
"data": [{
"value": 0,
"name": "线",
data: [{
value: 0,
name: '线'
}]
}
]
}
this.myChart && option && this.myChart.setOption(option, true);
this.myChart && option && this.myChart.setOption(option, true)
}
}
}

View File

@ -100,7 +100,19 @@ import processModule from '@/mixins/process-module'
export default {
mixins: [mixinViewModule, processModule],
data () {
return {}
return {
mixinViewModuleOptions: {
createdIsNeed: false, //
activatedIsNeed: false, //
getDataListURL: '', // API
getDataListIsPage: false, //
deleteURL: '', // API
deleteIsBatch: false, //
deleteIsBatchKey: 'id', // keypiduid...
exportURL: '', // API
requestCallback: null //
}
}
},
props: {
dataInfo: {

View File

@ -61,7 +61,7 @@ export default {
)
.then((res) => {
console.log(res.data.data)
if (res.data.data) {
if (res.data.data && res.data.data.length > 0) {
this.topData = res.data.data
this.oneData = this.topData[0].count
} else {

View File

@ -91,6 +91,7 @@ export default {
// if (res.data.code !== 0) {
// return
// }
if (res.data.data && res.data.data.length > 0) {
this.data = res.data.data[0].values
this.data.map((item) => {
const time = moment(item[0] * 1000).format('YYYY-MM-DD')
@ -104,6 +105,13 @@ export default {
xaxis: this.ydata,
ydata: this.xaxis
}
} else {
this.trendChartData = {
xaxis: [],
ydata: []
}
}
this.$nextTick(() => {
trendLineChart('trendId', this.trendChartData)
})

View File

@ -41,7 +41,7 @@ export default {
deptTodoView,
BottomView,
CenterView,
DeptChartView,
DeptChartView
},
data () {
return {
@ -74,15 +74,15 @@ export default {
resourceColor: ['#7b2cff', '#fd5151', , '#2ca1ff', '#0adbfa', '#febe13', '#65e5dd', '#f071ff', '#85f67a'],
//
applyData: [],
applyColor: ["#5085f2", "#e75fc3", "#f87be2", "#f2719a", "#fca4bb", "#f59a8f", "#fdb301", "#57e7ec", "#cf9ef1"],
applyColor: ['#5085f2', '#e75fc3', '#f87be2', '#f2719a', '#fca4bb', '#f59a8f', '#fdb301', '#57e7ec', '#cf9ef1'],
//
requireData: [],
requireColor: ['#FD866A', '#9E87FF', '#58D5FF', '#73DDFF', '#73ACFF', '#FDD56A', '#FDB36A',],
requireColor: ['#FD866A', '#9E87FF', '#58D5FF', '#73DDFF', '#73ACFF', '#FDD56A', '#FDB36A'],
loadingToDo: false,
loadingHasToDo: false,
loadingResource: false,
loadingApply: false,
loadingRequire: false,
loadingRequire: false
}
},
mounted () {
@ -100,118 +100,115 @@ export default {
methods: {
//
getToDo () {
this.loadingToDo = true;
let data = {
this.loadingToDo = true
const data = {
limit: 5,
page: 1,
page: 1
}
Apis.getToDoTask(data, res => {
this.loadingToDo = false;
this.loadingToDo = false
if (res.data.code !== 0) {
return this.$message.error(res.data.msg)
}
console.log('res----待办-------->', res.data);
console.log('res----待办-------->', res.data)
this.toToData.list = res.data.data.records || []
this.toToData.num = res.data.data.total || 0
}, err => {
this.$message.error(err);
this.loadingToDo = false;
this.$message.error(err)
this.loadingToDo = false
})
},
//
getHasToDo () {
let data = {
const data = {
limit: 5,
page: 1,
page: 1
}
this.loadingHasToDo = true;
this.loadingHasToDo = true
Apis.getHasToDoTask(data, res => {
this.loadingHasToDo = false;
this.loadingHasToDo = false
if (res.data.code !== 0) {
return this.$message.error(res.data.msg)
}
console.log('res----已办-------->', res.data);
console.log('res----已办-------->', res.data)
this.hasToDodoData.list = res.data.data.records || []
this.hasToDodoData.num = res.data.data.total || 0
}, err => {
this.$message.error(err)
this.loadingHasToDo = false;
console.log('err-----已办------->', err);
this.loadingHasToDo = false
console.log('err-----已办------->', err)
})
},
//
getShelvesTotal () {
this.loadingResource = true;
this.loadingResource = true
Apis.getTotalByDept({}, res => {
this.loadingResource = false;
this.loadingResource = false
if (res.data.code !== 0) {
return this.$message.error(res.data.msg)
}
console.log('res----部门上架-------->', res.data);
console.log('res----部门上架-------->', res.data)
this.resourceData = this.formatList(res.data.data.total || [])
this.$nextTick(() => {
this.$refs.resourceChart.initChart(this.resourceData)
})
}, err => {
this.$message.error(err)
this.loadingResource = false;
this.loadingResource = false
})
},
//
getApplyTotal () {
this.loadingApply = true;
this.loadingApply = true
Apis.getApply({}, res => {
this.loadingApply = false;
this.loadingApply = false
if (res.data.code !== 0) {
return this.$message.error(res.data.msg)
}
console.log('res----部门申请-------->', res.data);
console.log('res----部门申请-------->', res.data)
this.applyData = this.formatList(res.data.data.total || [])
this.$nextTick(() => {
console.log('this.applyData------------>', this.applyData);
console.log('this.applyData------------>', this.applyData)
this.$refs.applyChart.initChart(this.applyData)
})
}, err => {
this.$message.error(err)
this.loadingApply = false;
this.loadingApply = false
})
},
formatList (list = [], nameStr = 'type') {
let arr = []
const arr = []
list.map(v => {
let obj = {}
obj.name = v[nameStr];
obj.value = v.count;
const obj = {}
obj.name = v[nameStr]
obj.value = v.count
arr.push(obj)
})
return arr;
return arr
},
//
getRequireTotal () {
this.loadingRequire = true;
this.loadingRequire = true
Apis.getRequire({}, res => {
this.loadingRequire = false;
this.loadingRequire = false
if (res.data.code !== 0) {
return this.$message.error(res.data.msg)
}
console.log('res----部门需求-------->', res.data);
console.log('res----部门需求-------->', res.data)
this.requireData = this.formatList(res.data.data.total || [], 'flag')
this.$nextTick(() => {
this.$refs.requireChart.initChart(this.requireData)
})
}, err => {
this.$message.error(err)
this.loadingRequire = false;
this.loadingRequire = false
})
},
}
},
}
}
</script>
<style lang="scss" scoped>
.margin-h-16 {
margin: 0 16px;