代码提交
This commit is contained in:
parent
e2d194eab3
commit
0548069a08
|
@ -463,6 +463,9 @@ onMounted(() => {
|
|||
}
|
||||
&-bottom {
|
||||
height: vh(288);
|
||||
.switch::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.switch {
|
||||
margin-top: vh(16);
|
||||
width: 100%;
|
||||
|
@ -471,8 +474,10 @@ onMounted(() => {
|
|||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
align-content: space-between;
|
||||
overflow: scroll;
|
||||
&-item {
|
||||
width: vw(392);
|
||||
margin-bottom: vh(12);
|
||||
height: vh(92);
|
||||
box-sizing: border-box;
|
||||
padding: vh(8) vw(16);
|
||||
|
|
|
@ -139,12 +139,15 @@ function drawHealthIndex(list) {
|
|||
"rgba(174, 211, 255, 0.7)",
|
||||
];
|
||||
let result = []
|
||||
let total = 0
|
||||
for (let key in list) {
|
||||
if (key !== "错误总数") {
|
||||
result.push({
|
||||
name: key,
|
||||
value: list[key],
|
||||
});
|
||||
}else{
|
||||
total = list[key]
|
||||
}
|
||||
}
|
||||
let dom = document.querySelector("#healthIndex");
|
||||
|
@ -186,6 +189,9 @@ function drawHealthIndex(list) {
|
|||
backgroundColor: "rgba(0,0,0,0.7)", // 背景
|
||||
padding: [8, 10], //内边距
|
||||
extraCssText: "box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);", //添加阴影
|
||||
formatter: function (params) {
|
||||
return params.name + ': ' + total*params.value
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
orient: "vertical",
|
||||
|
@ -319,12 +325,15 @@ function drawSpareParts(list) {
|
|||
"rgba(174, 211, 255, 0.7)",
|
||||
];
|
||||
let result = []
|
||||
let total = 0
|
||||
for (let key in list) {
|
||||
if (key !== "总数") {
|
||||
result.push({
|
||||
name: key,
|
||||
value: list[key],
|
||||
});
|
||||
}else{
|
||||
total = list[key]
|
||||
}
|
||||
}
|
||||
let dom = document.querySelector("#spareParts");
|
||||
|
@ -342,6 +351,7 @@ function drawSpareParts(list) {
|
|||
shadowBlur: 40,
|
||||
borderWidth: 10,
|
||||
shadowColor: "rgba(0, 0, 0, 0)", //边框阴影
|
||||
|
||||
},
|
||||
};
|
||||
let placeHolderStyle = {
|
||||
|
@ -366,6 +376,9 @@ function drawSpareParts(list) {
|
|||
backgroundColor: "rgba(0,0,0,0.7)", // 背景
|
||||
padding: [8, 10], //内边距
|
||||
extraCssText: "box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);", //添加阴影
|
||||
formatter: function (params) {
|
||||
return params.name + ': ' + total*params.value
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
orient: "vertical",
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
<div class="title">
|
||||
<span> 已完成维保统计 </span>
|
||||
<el-date-picker
|
||||
v-model="value1"
|
||||
type="year"
|
||||
placeholder="请选择年份"
|
||||
@change="completedMaintenancePlan"
|
||||
/>
|
||||
v-model="value1"
|
||||
type="year"
|
||||
placeholder="请选择年份"
|
||||
@change="completedMaintenancePlan"
|
||||
/>
|
||||
</div>
|
||||
<div class="chart" id="pieChart1"></div>
|
||||
</div>
|
||||
|
@ -23,11 +23,11 @@
|
|||
<div class="title">
|
||||
<span> 保养计划 </span>
|
||||
<el-date-picker
|
||||
v-model="value2"
|
||||
type="year"
|
||||
placeholder="请选择年份"
|
||||
@change="maintenancePlan"
|
||||
/>
|
||||
v-model="value2"
|
||||
type="year"
|
||||
placeholder="请选择年份"
|
||||
@change="maintenancePlan"
|
||||
/>
|
||||
</div>
|
||||
<div class="chart" id="pieChart2"></div>
|
||||
</div>
|
||||
|
@ -36,9 +36,7 @@
|
|||
<div class="title">
|
||||
<span> 维护计划 </span>
|
||||
<el-select
|
||||
@change="
|
||||
getMaintenancePlanData();
|
||||
"
|
||||
@change="getMaintenancePlanData()"
|
||||
clearable
|
||||
v-model="planParams.facName"
|
||||
placeholder="请选择"
|
||||
|
@ -52,22 +50,19 @@
|
|||
</el-select>
|
||||
</div>
|
||||
<div class="box-content-bottom-table">
|
||||
<el-table
|
||||
:data="tableList"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table :data="tableList" style="width: 100%">
|
||||
<el-table-column prop="keepPlanTime" label="计划时间" />
|
||||
<el-table-column prop="facCode" label="设备编码" />
|
||||
<el-table-column prop="facName" label="设备名称" />
|
||||
<el-table-column prop="keepFinishTime" label="执行时间" />
|
||||
<el-table-column prop="keepContent" label="保养内容" />
|
||||
<el-table-column prop="status" label="状态" align="center">
|
||||
<template #default="{ row }">
|
||||
<div :style="row.status ? 'color:rgba(28, 238, 251, 1)' : ''">
|
||||
{{ row.status ? "已完成" : "未完成" }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #default="{ row }">
|
||||
<div :style="row.status ? 'color:rgba(28, 238, 251, 1)' : ''">
|
||||
{{ row.status ? "已完成" : "未完成" }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
@ -91,11 +86,14 @@
|
|||
<script setup>
|
||||
import * as echarts from "echarts";
|
||||
import { onMounted, ref, nextTick, reactive } from "vue";
|
||||
import { countKeepRecord ,getMaintenancePlan,allDeviceNames} from "@/api/equipmentManagement/index";
|
||||
import {
|
||||
countKeepRecord,
|
||||
getMaintenancePlan,
|
||||
allDeviceNames,
|
||||
} from "@/api/equipmentManagement/index";
|
||||
const emit = defineEmits(["closeMaintenance"]);
|
||||
|
||||
function close() {
|
||||
|
||||
emit("closeMaintenance", -1);
|
||||
}
|
||||
const tableList = ref([
|
||||
|
@ -136,12 +134,15 @@ function drawLeftChart(list) {
|
|||
"rgba(174, 211, 255, 0.7)",
|
||||
];
|
||||
let result = [];
|
||||
let total = 0;
|
||||
for (let key in list) {
|
||||
if (key != "总数") {
|
||||
result.push({
|
||||
name: key,
|
||||
value: list[key],
|
||||
});
|
||||
} else {
|
||||
total = list[key];
|
||||
}
|
||||
}
|
||||
let dom = document.querySelector("#pieChart1");
|
||||
|
@ -181,6 +182,9 @@ function drawLeftChart(list) {
|
|||
backgroundColor: "rgba(0,0,0,0.7)", // 背景
|
||||
padding: [8, 10], //内边距
|
||||
extraCssText: "box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);", //添加阴影
|
||||
formatter: function (params) {
|
||||
return params.name + ': ' + total*params.value
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
orient: "vertical",
|
||||
|
@ -281,7 +285,7 @@ function drawLeftChart(list) {
|
|||
},
|
||||
},
|
||||
};
|
||||
})
|
||||
}),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
@ -299,12 +303,15 @@ function drawRightChart(list) {
|
|||
"rgba(174, 211, 255, 0.7)",
|
||||
];
|
||||
let result = [];
|
||||
let total = 0
|
||||
for (let key in list) {
|
||||
if (key != "总数") {
|
||||
result.push({
|
||||
name: key,
|
||||
value: list[key],
|
||||
});
|
||||
}else{
|
||||
total = list[key]
|
||||
}
|
||||
}
|
||||
let dom = document.querySelector("#pieChart2");
|
||||
|
@ -343,6 +350,9 @@ function drawRightChart(list) {
|
|||
backgroundColor: "rgba(0,0,0,0.7)", // 背景
|
||||
padding: [8, 10], //内边距
|
||||
extraCssText: "box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);", //添加阴影
|
||||
formatter: function (params) {
|
||||
return params.name + ': ' + total*params.value
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
orient: "vertical",
|
||||
|
@ -358,7 +368,6 @@ function drawRightChart(list) {
|
|||
},
|
||||
itemWidth: 8,
|
||||
itemHeight: 8,
|
||||
|
||||
},
|
||||
series: [
|
||||
{
|
||||
|
@ -460,45 +469,45 @@ function drawRightChart(list) {
|
|||
myChart.resize();
|
||||
});
|
||||
}
|
||||
const value1 = ref(new Date())
|
||||
const value2 = ref(new Date())
|
||||
const value1 = ref(new Date());
|
||||
const value2 = ref(new Date());
|
||||
|
||||
// 保养计划接口
|
||||
function maintenancePlan() {
|
||||
let params = {
|
||||
year:value2.value.getFullYear(),
|
||||
status:false
|
||||
}
|
||||
year: value2.value.getFullYear(),
|
||||
status: false,
|
||||
};
|
||||
countKeepRecord(params).then((res) => {
|
||||
drawRightChart(res.result);
|
||||
});
|
||||
}
|
||||
// 已完成维保计划接口
|
||||
function completedMaintenancePlan(){
|
||||
function completedMaintenancePlan() {
|
||||
let params = {
|
||||
year:value1.value.getFullYear(),
|
||||
status:true
|
||||
}
|
||||
year: value1.value.getFullYear(),
|
||||
status: true,
|
||||
};
|
||||
countKeepRecord(params).then((res) => {
|
||||
drawLeftChart(res.result);
|
||||
});
|
||||
}
|
||||
|
||||
const planParams = reactive({
|
||||
pageIndex:1,
|
||||
pageSize:3,
|
||||
facName:''
|
||||
})
|
||||
const total = ref(0)
|
||||
pageIndex: 1,
|
||||
pageSize: 3,
|
||||
facName: "",
|
||||
});
|
||||
const total = ref(0);
|
||||
// 维护计划接口
|
||||
function getMaintenancePlanData(){
|
||||
getMaintenancePlan(planParams).then(res=>{
|
||||
total.value = res.result.totalNum
|
||||
tableList.value = res.result.data
|
||||
})
|
||||
function getMaintenancePlanData() {
|
||||
getMaintenancePlan(planParams).then((res) => {
|
||||
total.value = res.result.totalNum;
|
||||
tableList.value = res.result.data;
|
||||
});
|
||||
}
|
||||
|
||||
const allName = ref([])
|
||||
const allName = ref([]);
|
||||
// 获取所有设备名称
|
||||
function getAllDeviceNames() {
|
||||
allDeviceNames().then((res) => {
|
||||
|
@ -508,11 +517,11 @@ function getAllDeviceNames() {
|
|||
onMounted(() => {
|
||||
maintenancePlan();
|
||||
|
||||
completedMaintenancePlan()
|
||||
completedMaintenancePlan();
|
||||
|
||||
getMaintenancePlanData()
|
||||
getMaintenancePlanData();
|
||||
|
||||
getAllDeviceNames()
|
||||
getAllDeviceNames();
|
||||
// drawRightChart();
|
||||
});
|
||||
</script>
|
||||
|
@ -700,7 +709,7 @@ onMounted(() => {
|
|||
position: absolute;
|
||||
left: vw(40) !important;
|
||||
}
|
||||
:deep(.el-input__inner){
|
||||
:deep(.el-input__inner) {
|
||||
color: #fff;
|
||||
}
|
||||
:deep(.el-input__wrapper) {
|
||||
|
@ -719,8 +728,8 @@ onMounted(() => {
|
|||
)
|
||||
1 1;
|
||||
}
|
||||
:deep(.el-input){
|
||||
:deep(.el-input) {
|
||||
width: vw(160);
|
||||
height: vh(28);
|
||||
height: vh(28);
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue