Compare commits

...

2 Commits

8 changed files with 390 additions and 365 deletions

View File

@ -1,7 +1,7 @@
// /resource/getByDept
import http from '@/utils/request'
function Request({
function Request ({
methods, url, data, success, fali
}) {
const _key = methods == 'get' ? 'params' : 'data'
@ -15,7 +15,7 @@ function Request({
})
})
}
function RequestPost({
function RequestPost ({
methods, url, data, success, fali
}) {
return new Promise((resolve, reject) => {
@ -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() {
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) {
handler (newVal, oldVal) {
if (newVal) {
this.dataListCopy = newVal;
this.dataListCopy = newVal
this.initChart()
}
},
deep: true,
immediate: true
}
},
},
mounted() {
mounted () {
},
methods: {
initChart() {
var chartDom = document.getElementById(this.id);
initChart () {
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,9 +41,9 @@ export default {
deptTodoView,
BottomView,
CenterView,
DeptChartView,
DeptChartView
},
data() {
data () {
return {
//
toToData: {
@ -74,18 +74,18 @@ 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() {
mounted () {
//
this.getToDo()
//
@ -99,119 +99,116 @@ export default {
},
methods: {
//
getToDo() {
this.loadingToDo = true;
let data = {
getToDo () {
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 = {
getHasToDo () {
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;
getShelvesTotal () {
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;
getApplyTotal () {
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 = []
formatList (list = [], nameStr = 'type') {
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;
getRequireTotal () {
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;