Commit cc98dce3 authored by liuzhaoh's avatar liuzhaoh

BUG修复0530—1

parent d11833c6
......@@ -284,7 +284,7 @@ export const getGaugeOption = (option) => {
},
pointer: {
itemStyle: {
color: 'auto'
color: 'auto',
}
},
axisTick: {
......@@ -302,12 +302,14 @@ export const getGaugeOption = (option) => {
color: '#fff',
width: 2
},
},
axisLabel: {
color: 'inherit',
fontSize: 10,
distance: 30,
rotate: "tangential",
formatter: option.formatter || "{value}",
},
title: {
offsetCenter: [0, "70%"],
......@@ -316,7 +318,7 @@ export const getGaugeOption = (option) => {
},
detail: {
fontSize: 20,
offsetCenter: [0, 0],
offsetCenter: [0, 40],
valueAnimation: true,
formatter: function (value) {
return Math.round(value * 100) + "";
......
......@@ -12,6 +12,7 @@
v-model="form.dusterNo"
placeholder="请选择除尘器"
style="width: 240px"
filterable
>
<el-option
v-for="item in dusterList"
......@@ -30,6 +31,9 @@
format="YYYY-MM-DD HH:mm:ss"
date-format="YYYY/MM/DD ddd"
time-format="A hh:mm:ss"
@calendar-change="calendarChange"
@visible-change="visibleChange"
:disabled-date="disabledFn"
/>
</el-form-item>
</el-form>
......@@ -72,7 +76,11 @@
<div class="part">
<div
class="point"
:class="item.healthStatus == 1 ? 'health' : 'warn'"
:class="{
'status-normal': item.healthStatus === 1,
'status-warning': item.healthStatus === 2,
'status-error': item.healthStatus === 3,
}"
v-for="item in detailObj.compartHealthList[0]"
:key="item"
></div>
......@@ -80,7 +88,11 @@
<div class="part">
<div
class="point"
:class="item.healthStatus == 1 ? 'health' : 'warn'"
:class="{
'status-normal': item.healthStatus === 1,
'status-warning': item.healthStatus === 2,
'status-error': item.healthStatus === 3,
}"
v-for="item in detailObj.compartHealthList[1]"
:key="item"
></div>
......@@ -130,10 +142,27 @@ const userStore = useUsersStore();
const form = reactive({
dusterNo: "",
dateValue: [
new Date(new Date().getTime() - 24 * 60 * 60 * 1000 * 7),
new Date(new Date().getTime() - 24 * 60 * 60 * 1000 * 10),
new Date(),
],
});
const startVal = ref(null);
const calendarChange = (e) => {
if (e[0] && !e[1]) {
startVal.value = e[0];
}
};
const visibleChange = (e) => {
if (e) {
startVal.value = null;
}
};
const disabledFn = (current) => {
if (!startVal.value) return false;
let range = [new Date(startVal.value).getTime() - 24 * 60 * 60 * 1000 * 30, new Date(startVal.value).getTime() + 24 * 60 * 60 * 1000 * 30];
let cur = new Date(current).getTime();
return cur < range[0] || cur > range[1];
};
const option = {
xAxis: {
type: "category",
......@@ -466,6 +495,9 @@ const getDustDetail = () => {
chartName: "压差",
min: parseInt(res.data.pressureDiffLow),
max: parseInt(res.data.pressureDiffHigh),
formatter: parseInt(res.data.pressureDiffHigh) > 10 ? function(value) {
return parseInt(value)
} : ''
})
);
indicatorFun(
......@@ -476,6 +508,9 @@ const getDustDetail = () => {
chartName: "粉尘浓度",
min: 5,
max: 50,
formatter: function(value) {
return parseInt(value)
}
})
);
})
......@@ -692,11 +727,16 @@ $borderColor: #bbbdc391;
display: block;
padding-bottom: 100%; /* 9/16 * 100% = 56.25% */
}
.warn {
background-color: rgb(217, 10, 10);
.status-normal {
background-color: #67c23a; // 绿色
}
.health {
background-color: #67c23a;
.status-warning {
background-color: #e6a23c; // 橙色
}
.status-error {
background-color: #f56c6c; // 红色
}
}
.other-info {
......
......@@ -8,7 +8,6 @@
v-model="formInline.productionLineId"
placeholder="请选择工序"
style="width: 120px"
clearable
>
<el-option
v-for="item in processOptions"
......@@ -29,7 +28,7 @@
<el-form-item label="设备名称">
<el-input
v-model="formInline.deviceName"
placeholder="请输入除尘器名称"
placeholder="请输入设备名称"
style="width: 240px"
clearable
/>
......@@ -37,9 +36,8 @@
<el-form-item label="设备类型">
<el-select
v-model="formInline.deviceTypeId"
placeholder="请选择工序"
placeholder="请选择设备类型"
style="width: 120px"
clearable
>
<el-option
v-for="item in deviceTypeEnum"
......@@ -110,7 +108,7 @@
</template>
<template #operation="{ row }">
<el-button type="text" @click="getParamsConfig(row)">
<el-button text @click="getParamsConfig(row)">
参数设置
</el-button>
</template>
......@@ -132,6 +130,7 @@ import CommonTable from "@/components/commonTable/index.vue";
import "@/css/elementUiSelf.css";
import { getDataFun, exportFile } from "@/request/method.js";
import { getToken } from "@/utils/auth";
import axios from "axios";
const ENV = import.meta.env;
const uploadUrl = ENV.VITE_APP_BASE_API5 + "/importDeviceAndSignal";
const currentPage = ref(1);
......@@ -141,7 +140,7 @@ const getIndex = (index) => {
return (currentPage.value - 1) * pageSize.value + index + 1;
};
let formInline = reactive({
const formInline = reactive({
deviceName: "",
dusterName: "",
deviceTypeId: " ",
......@@ -273,12 +272,10 @@ const getDeviceContent = () => {
};
// 重置
const onReset = () => {
formInline = {
deviceName: "",
dusterName: "",
deviceTypeId: " ",
productionLineId: " ",
};
formInline.deviceName = "";
formInline.dusterName = "";
formInline.deviceTypeId = " ";
formInline.productionLineId = " ";
pageSize.value = 10;
currentPage.value = 1;
getDeviceContent();
......@@ -323,7 +320,33 @@ const onExportFile = () => {
};
// 模板下载
const onDownloadTemplate = () => {
window.open('http://visimg.bmetech.com/stone/img/1748314002767/设备数据.xlsx')
// window.open('http://visimg.bmetech.com/stone/img/1748314002767/设备数据.xlsx')
axios.get('http://visimg.bmetech.com/stone/img/1748314002767/设备数据.xlsx', {
responseType: 'blob'
}).then(res => {
console.log(res)
const blob = res.data;
// 创建 URL 对象
const url = URL.createObjectURL(blob);
// 创建临时 <a> 元素
const a = document.createElement("a");
a.href = url;
// 设置下载的文件名
if (res.data.type === 'application/vnd.ms-excel') {
a.download = `设备数据.xls`; // 设置下载的文件名
} else {
a.download = `设备数据.xlsx`;
}
// 模拟点击下载
document.body.appendChild(a);
a.click();
// 清理资源
document.body.removeChild(a);
URL.revokeObjectURL(url);
})
};
// 页面参数改变
const handlePaginationChange = (pagination) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment