|
@@ -221,7 +221,7 @@
|
|
|
layout="total, sizes, prev, pager, next"
|
|
|
:current-page="query.page"
|
|
|
:page-size="query.limit"
|
|
|
- :page-sizes="[21, 100, 500, 1000]"
|
|
|
+ :page-sizes="[10, 100, 500, 1000]"
|
|
|
:total="query.pageTotal"
|
|
|
@size-change="
|
|
|
(value) => {
|
|
@@ -302,10 +302,11 @@ onMounted(() => {
|
|
|
const pageTitle = "报警分析";
|
|
|
const store = useStore();
|
|
|
const changZhanArray = ref([]);
|
|
|
+const windName = ref([]);
|
|
|
|
|
|
const query = reactive({
|
|
|
page: 1,
|
|
|
- limit: 21,
|
|
|
+ limit: 10,
|
|
|
pageTotal: null,
|
|
|
});
|
|
|
const state = reactive({
|
|
@@ -331,7 +332,7 @@ const state = reactive({
|
|
|
tableData: [],
|
|
|
tHeard: [],
|
|
|
changZhan: "",
|
|
|
- components: ["LG"], //部件
|
|
|
+ components: ["FDJ", "CLX"], //部件
|
|
|
modelId: "", //型号
|
|
|
alarmIds: "",
|
|
|
alarmIdList: [],
|
|
@@ -589,11 +590,11 @@ watch(
|
|
|
return ele.nemCode === "FDJ";
|
|
|
})?.nemCode || "";
|
|
|
componenDefaultSelect
|
|
|
- ? (state.components = ["LG"])
|
|
|
+ ? (state.components = ["FDJ", "CLX"])
|
|
|
: arr[1]?.[0]?.nemCode
|
|
|
? (state.components = [arr[1]?.[0]?.nemCode])
|
|
|
: (state.components = []);
|
|
|
- // getAlarmId();
|
|
|
+ getAlarmId();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -661,8 +662,9 @@ function getTableList() {
|
|
|
alarmIds: state.alarmIds,
|
|
|
alarmType: state.typeVal,
|
|
|
}).then((res) => {
|
|
|
- if (res && res.length>0) {
|
|
|
- changeTableData(res)
|
|
|
+ if (res && res.result.length>0) {
|
|
|
+ changeTableData(res.result)
|
|
|
+ query.pageTotal = res.total
|
|
|
} else {
|
|
|
state.tHeard = [];
|
|
|
state.tableData = [];
|
|
@@ -678,32 +680,41 @@ function getTableList() {
|
|
|
}
|
|
|
|
|
|
const changeTableData = (res) => {
|
|
|
- query.pageTotal = res.length
|
|
|
if (res.length) {
|
|
|
+ if (query.page === 1) {
|
|
|
+ windName.value = []
|
|
|
+ }
|
|
|
let tableData = [];
|
|
|
let tHeard = [];
|
|
|
let data = res;
|
|
|
- data.forEach((pEle) => {
|
|
|
+ data.forEach((pEle, index) => {
|
|
|
for (let wtId in pEle) {
|
|
|
let wtItem = data.find((tableItem) => {
|
|
|
return wtId === tableItem.windturbineId;
|
|
|
});
|
|
|
!wtItem && (wtItem = { wtId });
|
|
|
- pEle[wtId].forEach((cEle) => {
|
|
|
- let someRes = tHeard.some((findEle) => {
|
|
|
- return findEle.label == cEle.alertText;
|
|
|
- });
|
|
|
+ if (pEle[wtId].length>0) {
|
|
|
+ pEle[wtId].forEach((cEle) => {
|
|
|
+ let someRes = tHeard.some((findEle) => {
|
|
|
+ return findEle.label == cEle.alertText;
|
|
|
+ });
|
|
|
|
|
|
- if (!someRes) {
|
|
|
- tHeard.push({
|
|
|
- label: cEle.alertText,
|
|
|
- code: cEle.alarmid,
|
|
|
+ if (!someRes) {
|
|
|
+ tHeard.push({
|
|
|
+ label: cEle.alertText,
|
|
|
+ code: cEle.alarmid,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ wtItem[`${cEle.alarmid}_count`] = cEle.count;
|
|
|
+ wtItem[`${cEle.alarmid}_time`] = cEle.time;
|
|
|
+ wtItem["wtname"] = cEle.windturbineCode
|
|
|
});
|
|
|
- }
|
|
|
- wtItem[`${cEle.alarmid}_count`] = cEle.count;
|
|
|
- wtItem[`${cEle.alarmid}_time`] = cEle.time;
|
|
|
- wtItem["wtname"] = cEle.windturbineCode;
|
|
|
- });
|
|
|
+ } else {
|
|
|
+ wtItem["wtname"] = windName.value[index]
|
|
|
+ }
|
|
|
+ if (query.page === 1) {
|
|
|
+ windName.value.push(wtItem["wtname"])
|
|
|
+ }
|
|
|
tableData.push(wtItem);
|
|
|
}
|
|
|
});
|