Commit cc98dce3 authored by liuzhaoh's avatar liuzhaoh

BUG修复0530—1

parent d11833c6
...@@ -284,7 +284,7 @@ export const getGaugeOption = (option) => { ...@@ -284,7 +284,7 @@ export const getGaugeOption = (option) => {
}, },
pointer: { pointer: {
itemStyle: { itemStyle: {
color: 'auto' color: 'auto',
} }
}, },
axisTick: { axisTick: {
...@@ -302,12 +302,14 @@ export const getGaugeOption = (option) => { ...@@ -302,12 +302,14 @@ export const getGaugeOption = (option) => {
color: '#fff', color: '#fff',
width: 2 width: 2
}, },
}, },
axisLabel: { axisLabel: {
color: 'inherit', color: 'inherit',
fontSize: 10, fontSize: 10,
distance: 30, distance: 30,
rotate: "tangential", rotate: "tangential",
formatter: option.formatter || "{value}",
}, },
title: { title: {
offsetCenter: [0, "70%"], offsetCenter: [0, "70%"],
...@@ -316,7 +318,7 @@ export const getGaugeOption = (option) => { ...@@ -316,7 +318,7 @@ export const getGaugeOption = (option) => {
}, },
detail: { detail: {
fontSize: 20, fontSize: 20,
offsetCenter: [0, 0], offsetCenter: [0, 40],
valueAnimation: true, valueAnimation: true,
formatter: function (value) { formatter: function (value) {
return Math.round(value * 100) + ""; return Math.round(value * 100) + "";
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
v-model="form.dusterNo" v-model="form.dusterNo"
placeholder="请选择除尘器" placeholder="请选择除尘器"
style="width: 240px" style="width: 240px"
filterable
> >
<el-option <el-option
v-for="item in dusterList" v-for="item in dusterList"
...@@ -30,6 +31,9 @@ ...@@ -30,6 +31,9 @@
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
date-format="YYYY/MM/DD ddd" date-format="YYYY/MM/DD ddd"
time-format="A hh:mm:ss" time-format="A hh:mm:ss"
@calendar-change="calendarChange"
@visible-change="visibleChange"
:disabled-date="disabledFn"
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -72,7 +76,11 @@ ...@@ -72,7 +76,11 @@
<div class="part"> <div class="part">
<div <div
class="point" 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]" v-for="item in detailObj.compartHealthList[0]"
:key="item" :key="item"
></div> ></div>
...@@ -80,7 +88,11 @@ ...@@ -80,7 +88,11 @@
<div class="part"> <div class="part">
<div <div
class="point" 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]" v-for="item in detailObj.compartHealthList[1]"
:key="item" :key="item"
></div> ></div>
...@@ -130,10 +142,27 @@ const userStore = useUsersStore(); ...@@ -130,10 +142,27 @@ const userStore = useUsersStore();
const form = reactive({ const form = reactive({
dusterNo: "", dusterNo: "",
dateValue: [ dateValue: [
new Date(new Date().getTime() - 24 * 60 * 60 * 1000 * 7), new Date(new Date().getTime() - 24 * 60 * 60 * 1000 * 10),
new Date(), 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 = { const option = {
xAxis: { xAxis: {
type: "category", type: "category",
...@@ -466,6 +495,9 @@ const getDustDetail = () => { ...@@ -466,6 +495,9 @@ const getDustDetail = () => {
chartName: "压差", chartName: "压差",
min: parseInt(res.data.pressureDiffLow), min: parseInt(res.data.pressureDiffLow),
max: parseInt(res.data.pressureDiffHigh), max: parseInt(res.data.pressureDiffHigh),
formatter: parseInt(res.data.pressureDiffHigh) > 10 ? function(value) {
return parseInt(value)
} : ''
}) })
); );
indicatorFun( indicatorFun(
...@@ -476,6 +508,9 @@ const getDustDetail = () => { ...@@ -476,6 +508,9 @@ const getDustDetail = () => {
chartName: "粉尘浓度", chartName: "粉尘浓度",
min: 5, min: 5,
max: 50, max: 50,
formatter: function(value) {
return parseInt(value)
}
}) })
); );
}) })
...@@ -692,11 +727,16 @@ $borderColor: #bbbdc391; ...@@ -692,11 +727,16 @@ $borderColor: #bbbdc391;
display: block; display: block;
padding-bottom: 100%; /* 9/16 * 100% = 56.25% */ padding-bottom: 100%; /* 9/16 * 100% = 56.25% */
} }
.warn { .status-normal {
background-color: rgb(217, 10, 10); background-color: #67c23a; // 绿色
}
.status-warning {
background-color: #e6a23c; // 橙色
} }
.health {
background-color: #67c23a; .status-error {
background-color: #f56c6c; // 红色
} }
} }
.other-info { .other-info {
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
v-model="formInline.productionLineId" v-model="formInline.productionLineId"
placeholder="请选择工序" placeholder="请选择工序"
style="width: 120px" style="width: 120px"
clearable
> >
<el-option <el-option
v-for="item in processOptions" v-for="item in processOptions"
...@@ -29,7 +28,7 @@ ...@@ -29,7 +28,7 @@
<el-form-item label="设备名称"> <el-form-item label="设备名称">
<el-input <el-input
v-model="formInline.deviceName" v-model="formInline.deviceName"
placeholder="请输入除尘器名称" placeholder="请输入设备名称"
style="width: 240px" style="width: 240px"
clearable clearable
/> />
...@@ -37,9 +36,8 @@ ...@@ -37,9 +36,8 @@
<el-form-item label="设备类型"> <el-form-item label="设备类型">
<el-select <el-select
v-model="formInline.deviceTypeId" v-model="formInline.deviceTypeId"
placeholder="请选择工序" placeholder="请选择设备类型"
style="width: 120px" style="width: 120px"
clearable
> >
<el-option <el-option
v-for="item in deviceTypeEnum" v-for="item in deviceTypeEnum"
...@@ -110,7 +108,7 @@ ...@@ -110,7 +108,7 @@
</template> </template>
<template #operation="{ row }"> <template #operation="{ row }">
<el-button type="text" @click="getParamsConfig(row)"> <el-button text @click="getParamsConfig(row)">
参数设置 参数设置
</el-button> </el-button>
</template> </template>
...@@ -132,6 +130,7 @@ import CommonTable from "@/components/commonTable/index.vue"; ...@@ -132,6 +130,7 @@ import CommonTable from "@/components/commonTable/index.vue";
import "@/css/elementUiSelf.css"; import "@/css/elementUiSelf.css";
import { getDataFun, exportFile } from "@/request/method.js"; import { getDataFun, exportFile } from "@/request/method.js";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import axios from "axios";
const ENV = import.meta.env; const ENV = import.meta.env;
const uploadUrl = ENV.VITE_APP_BASE_API5 + "/importDeviceAndSignal"; const uploadUrl = ENV.VITE_APP_BASE_API5 + "/importDeviceAndSignal";
const currentPage = ref(1); const currentPage = ref(1);
...@@ -141,7 +140,7 @@ const getIndex = (index) => { ...@@ -141,7 +140,7 @@ const getIndex = (index) => {
return (currentPage.value - 1) * pageSize.value + index + 1; return (currentPage.value - 1) * pageSize.value + index + 1;
}; };
let formInline = reactive({ const formInline = reactive({
deviceName: "", deviceName: "",
dusterName: "", dusterName: "",
deviceTypeId: " ", deviceTypeId: " ",
...@@ -273,12 +272,10 @@ const getDeviceContent = () => { ...@@ -273,12 +272,10 @@ const getDeviceContent = () => {
}; };
// 重置 // 重置
const onReset = () => { const onReset = () => {
formInline = { formInline.deviceName = "";
deviceName: "", formInline.dusterName = "";
dusterName: "", formInline.deviceTypeId = " ";
deviceTypeId: " ", formInline.productionLineId = " ";
productionLineId: " ",
};
pageSize.value = 10; pageSize.value = 10;
currentPage.value = 1; currentPage.value = 1;
getDeviceContent(); getDeviceContent();
...@@ -323,7 +320,33 @@ const onExportFile = () => { ...@@ -323,7 +320,33 @@ const onExportFile = () => {
}; };
// 模板下载 // 模板下载
const onDownloadTemplate = () => { 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) => { 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