|
@@ -49,7 +49,7 @@
|
|
<div class="search-input" v-if="state.isshowwindturbineName">
|
|
<div class="search-input" v-if="state.isshowwindturbineName">
|
|
<span class="lable">机组:</span>
|
|
<span class="lable">机组:</span>
|
|
<el-select
|
|
<el-select
|
|
- v-model="state.windturbineId"
|
|
|
|
|
|
+ v-model="state.deviceId"
|
|
clearable
|
|
clearable
|
|
size="mini"
|
|
size="mini"
|
|
placeholder="全部"
|
|
placeholder="全部"
|
|
@@ -163,7 +163,7 @@
|
|
header-align="center"
|
|
header-align="center"
|
|
>
|
|
>
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <p :style="item.style && item.style(item)">
|
|
|
|
|
|
+ <p :style="item.style && item.style(scope.row)">
|
|
<span v-if="item.code == 'rank'">
|
|
<span v-if="item.code == 'rank'">
|
|
{{ tableFilter(scope.row.rank) }}
|
|
{{ tableFilter(scope.row.rank) }}
|
|
</span>
|
|
</span>
|
|
@@ -211,7 +211,7 @@
|
|
header-align="center"
|
|
header-align="center"
|
|
>
|
|
>
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <p :style="item.style && item.style(item)">
|
|
|
|
|
|
+ <p :style="item.style && item.style(scope.row)">
|
|
<span v-if="item.code == 'rank'">
|
|
<span v-if="item.code == 'rank'">
|
|
{{ tableFilter(scope.row.rank) }}
|
|
{{ tableFilter(scope.row.rank) }}
|
|
</span>
|
|
</span>
|
|
@@ -270,7 +270,16 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { watch, reactive, nextTick, computed, onMounted, ref } from "vue";
|
|
|
|
|
|
+import {
|
|
|
|
+ watch,
|
|
|
|
+ reactive,
|
|
|
|
+ nextTick,
|
|
|
|
+ computed,
|
|
|
|
+ onMounted,
|
|
|
|
+ ref,
|
|
|
|
+ onActivated,
|
|
|
|
+ onUpdated,
|
|
|
|
+} from "vue";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
import {
|
|
import {
|
|
@@ -302,6 +311,7 @@ onMounted(() => {
|
|
getequipmentmodel_list();
|
|
getequipmentmodel_list();
|
|
getfetchRelatePart();
|
|
getfetchRelatePart();
|
|
});
|
|
});
|
|
|
|
+
|
|
// 机型
|
|
// 机型
|
|
const getequipmentmodel_list = async () => {
|
|
const getequipmentmodel_list = async () => {
|
|
const { data } = await fetchModel();
|
|
const { data } = await fetchModel();
|
|
@@ -347,10 +357,10 @@ const getColumnStyle = (columnItem) => {
|
|
|
|
|
|
const state = reactive({
|
|
const state = reactive({
|
|
typeList: [
|
|
typeList: [
|
|
- {
|
|
|
|
- label: "升压站",
|
|
|
|
- value: "booststation",
|
|
|
|
- },
|
|
|
|
|
|
+ // {
|
|
|
|
+ // label: "升压站",
|
|
|
|
+ // value: "booststation",
|
|
|
|
+ // },
|
|
// {
|
|
// {
|
|
// label: "自定义",
|
|
// label: "自定义",
|
|
// value: "custom",
|
|
// value: "custom",
|
|
@@ -369,7 +379,7 @@ const state = reactive({
|
|
alarmId: "",
|
|
alarmId: "",
|
|
typeVal: "windturbine",
|
|
typeVal: "windturbine",
|
|
windturbineList: [],
|
|
windturbineList: [],
|
|
- windturbineId: "",
|
|
|
|
|
|
+ deviceId: "",
|
|
modelListAll: {},
|
|
modelListAll: {},
|
|
fetchListAll: {},
|
|
fetchListAll: {},
|
|
modelId: "", //型号
|
|
modelId: "", //型号
|
|
@@ -421,6 +431,19 @@ const stationList = ref([]);
|
|
const getStationList = async () => {
|
|
const getStationList = async () => {
|
|
const { data } = await getWpList(state.typeVal);
|
|
const { data } = await getWpList(state.typeVal);
|
|
stationList.value = data;
|
|
stationList.value = data;
|
|
|
|
+ if (state.deviceId) {
|
|
|
|
+ let station = data.find((i) => {
|
|
|
|
+ let st = i.id.split("_")[2];
|
|
|
|
+ let dt = state.deviceId.split("_")[2];
|
|
|
|
+ if (st == dt) {
|
|
|
|
+ return i;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ state.stationId = station?.id;
|
|
|
|
+ } else {
|
|
|
|
+ state.stationId =
|
|
|
|
+ state.typeVal == "windturbine" ? "SXJ_KGDL_DJY_FDC_STA" : data[0]?.id;
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
watch(
|
|
watch(
|
|
@@ -428,7 +451,6 @@ watch(
|
|
(val, old) => {
|
|
(val, old) => {
|
|
val?.value?.length &&
|
|
val?.value?.length &&
|
|
nextTick(async () => {
|
|
nextTick(async () => {
|
|
- state.stationId = val.value[0]?.id;
|
|
|
|
await getWindturbineList();
|
|
await getWindturbineList();
|
|
await getAlarmHistoryt();
|
|
await getAlarmHistoryt();
|
|
});
|
|
});
|
|
@@ -443,11 +465,11 @@ watch(
|
|
(val, old) => {
|
|
(val, old) => {
|
|
state.deviceId = route.params.deviceId || "";
|
|
state.deviceId = route.params.deviceId || "";
|
|
state.alarmId = route.params.alarmId || "";
|
|
state.alarmId = route.params.alarmId || "";
|
|
- nextTick(async () => {
|
|
|
|
- if (route.params.deviceId && route.params.alarmId) {
|
|
|
|
- await getAlarmHistoryt();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // nextTick(async () => {
|
|
|
|
+ // if (route.params.deviceId && route.params.alarmId) {
|
|
|
|
+ // await getAlarmHistoryt();
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
},
|
|
},
|
|
{
|
|
{
|
|
deep: true,
|
|
deep: true,
|
|
@@ -456,37 +478,29 @@ watch(
|
|
);
|
|
);
|
|
//型号列表
|
|
//型号列表
|
|
const modelList = computed(() => {
|
|
const modelList = computed(() => {
|
|
- if (state.typeVal == "windturbine") {
|
|
|
|
- if (state.stationId == "") {
|
|
|
|
- return [];
|
|
|
|
- } else {
|
|
|
|
- state.modelId = state.modelListAll[state.stationId]?.[0]?.id || "";
|
|
|
|
- return state.modelListAll[state.stationId];
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (state.stationId == "") {
|
|
return [];
|
|
return [];
|
|
|
|
+ } else {
|
|
|
|
+ state.modelId = route.params.deviceId
|
|
|
|
+ ? ""
|
|
|
|
+ : state.modelListAll[state.stationId]?.[0]?.id || "";
|
|
|
|
+ return state.modelListAll[state.stationId];
|
|
}
|
|
}
|
|
});
|
|
});
|
|
//部件列表
|
|
//部件列表
|
|
const componentList = computed(() => {
|
|
const componentList = computed(() => {
|
|
- if (state.typeVal == "windturbine") {
|
|
|
|
- if (state.stationId == "") {
|
|
|
|
- return [];
|
|
|
|
|
|
+ if (state.stationId == "") {
|
|
|
|
+ return [];
|
|
|
|
+ } else {
|
|
|
|
+ if (state.stationId.includes("FDC")) {
|
|
|
|
+ return state.fetchListAll?.fjbj;
|
|
} else {
|
|
} else {
|
|
- if (state.stationId.includes("FDC")) {
|
|
|
|
- return state.fetchListAll?.fjbj;
|
|
|
|
- } else {
|
|
|
|
- return state.fetchListAll?.gfbj;
|
|
|
|
- }
|
|
|
|
|
|
+ return state.fetchListAll?.gfbj;
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- return [];
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
//get 风机
|
|
//get 风机
|
|
const getWindturbineList = async () => {
|
|
const getWindturbineList = async () => {
|
|
- state.windturbineList = [];
|
|
|
|
- state.windturbineId = "";
|
|
|
|
const { data } = await fetchWindturbineList(state.stationId);
|
|
const { data } = await fetchWindturbineList(state.stationId);
|
|
state.windturbineList = data;
|
|
state.windturbineList = data;
|
|
};
|
|
};
|
|
@@ -498,9 +512,9 @@ const query = reactive({
|
|
|
|
|
|
// 获取历史记录表
|
|
// 获取历史记录表
|
|
const getAlarmHistoryt = async () => {
|
|
const getAlarmHistoryt = async () => {
|
|
- if (route.params.deviceId && route.params.alarmId) {
|
|
|
|
- state.stationId = "";
|
|
|
|
- }
|
|
|
|
|
|
+ // if (route.params.deviceId && route.params.alarmId) {
|
|
|
|
+ // state.stationId = "";
|
|
|
|
+ // }
|
|
let params = {
|
|
let params = {
|
|
pageNum: query.page,
|
|
pageNum: query.page,
|
|
pageSize: query.limit,
|
|
pageSize: query.limit,
|
|
@@ -509,8 +523,7 @@ const getAlarmHistoryt = async () => {
|
|
deviceType: state.typeVal,
|
|
deviceType: state.typeVal,
|
|
stationid: state.stationId,
|
|
stationid: state.stationId,
|
|
deviceid:
|
|
deviceid:
|
|
- state.deviceId ||
|
|
|
|
- (state.typeVal == "booststation" ? "" : state.windturbineId),
|
|
|
|
|
|
+ state.deviceId || (state.typeVal == "booststation" ? "" : state.deviceId),
|
|
modelId: state.typeVal == "booststation" ? "" : state.modelId,
|
|
modelId: state.typeVal == "booststation" ? "" : state.modelId,
|
|
components: state.components,
|
|
components: state.components,
|
|
description: state.description,
|
|
description: state.description,
|
|
@@ -527,6 +540,8 @@ const getAlarmHistoryt = async () => {
|
|
};
|
|
};
|
|
//报警类型变化
|
|
//报警类型变化
|
|
const typechange = () => {
|
|
const typechange = () => {
|
|
|
|
+ state.alarmId = "";
|
|
|
|
+ state.deviceId = "";
|
|
state.isshowwindturbineName = state.typeVal == "booststation" ? false : true;
|
|
state.isshowwindturbineName = state.typeVal == "booststation" ? false : true;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -537,7 +552,7 @@ const export2Excel = async () => {
|
|
pageSize: query.pageTotal,
|
|
pageSize: query.pageTotal,
|
|
alarmType: state.typeVal,
|
|
alarmType: state.typeVal,
|
|
stationid: state.stationId,
|
|
stationid: state.stationId,
|
|
- deviceid: state.typeVal == "booststation" ? "" : state.windturbineId,
|
|
|
|
|
|
+ deviceid: state.typeVal == "booststation" ? "" : state.deviceId,
|
|
modelId: state.modelId,
|
|
modelId: state.modelId,
|
|
components: state.components,
|
|
components: state.components,
|
|
description: state.description,
|
|
description: state.description,
|