From f7f647a20cca0d106473e6a862b85d89a7a93d19 Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期四, 01 十二月 2022 10:59:06 +0800
Subject: [PATCH] 堆栈溢出
---
src/views/riskWarningSys/warningBigScreen/components/SPI.vue | 81 ++++++++++++++--------------------------
1 files changed, 29 insertions(+), 52 deletions(-)
diff --git a/src/views/riskWarningSys/warningBigScreen/components/SPI.vue b/src/views/riskWarningSys/warningBigScreen/components/SPI.vue
index cb42132..a52fdca 100644
--- a/src/views/riskWarningSys/warningBigScreen/components/SPI.vue
+++ b/src/views/riskWarningSys/warningBigScreen/components/SPI.vue
@@ -5,7 +5,7 @@
class="spiSe"
:teleported="false"
v-model="spiValue"
- :options="spiOptions"
+ :options="departList"
:props="spiProps"
:show-all-levels="false"
@change="handleChange"
@@ -31,11 +31,13 @@
import * as echarts from 'echarts';
import '/@/theme/bigScreen.css'
import {useScreenTheme} from "/@/stores/screenTheme";
+ import {teamManageApi} from "/@/api/systemManage/basicDateManage/personShiftManage/teamManage";
interface stateType {
spiValue: number;
- spiOptions: Array<any>;
- spiChart: string
+ departList: Array<any>;
+ spiChart: string;
+ spiProps: object
}
export default defineComponent({
name: 'SPI',
@@ -51,55 +53,30 @@
const { screenTheme } = storeToRefs(screenThemes);
const spi = ref("eChartSpi" + Date.now() + Math.random())
const state = reactive<stateType>({
- spiValue: 0,
- spiOptions: [
- {
- value: 0,
- label: '公司级别SPI'
- },
- {
- value: 1,
- label: 'A事业部SPI',
- children: [
- {
- value: 11,
- label: 'A车间SPI'
- },
- {
- value: 12,
- label: 'B车间SPI'
- },
- {
- value: 13,
- label: 'C车间SPI'
- }
- ]
- },
- {
- value: 2,
- label: 'B事业部SPI',
- children: [
- {
- value: 21,
- label: 'D车间SPI'
- },
- {
- value: 22,
- label: 'E车间SPI'
- },
- {
- value: 23,
- label: 'F车间SPI'
- }
- ]
- }
- ],
+ spiValue: 1,
+ departList: [],
+ spiProps: {
+ expandTrigger: 'hover',
+ checkStrictly: true,
+ value: 'depId',
+ label: 'depName',
+ },
spiChart: 'spi-dark'
})
- const spiProps = {
- expandTrigger: 'hover',
- checkStrictly: true
- }
+
+ // 获取部门列表
+ const getAllDepartment = async () => {
+ let res = await teamManageApi().getAllDepartment();
+ if (res.data.code === '200') {
+ state.departList = JSON.parse(JSON.stringify(res.data.data))
+ } else {
+ ElMessage({
+ type: 'warning',
+ message: res.data.msg
+ });
+ }
+ };
+
type EChartsOption = echarts.EChartsOption
// 隐患整改情况
const initSpi =()=>{
@@ -125,7 +102,7 @@
grid: {
left: '8%',
right: '8%',
- bottom: '4%',
+ bottom: '5%',
},
xAxis: [
{
@@ -312,6 +289,7 @@
// 页面载入时执行方法
onMounted(() => {
+ getAllDepartment();
initSpi();
getTheme();
});
@@ -319,7 +297,6 @@
return {
spi,
Search,
- spiProps,
fontSize,
...toRefs(state)
};
--
Gitblit v1.9.2