Commit 9ae21109 authored by zrs's avatar zrs

Merge branch 'b-master' of http://gitlab.91isoft.com:90/hikvision/web-project into b-master

parents b80ed964 d3e09c86
This diff is collapsed.
......@@ -280,6 +280,7 @@ import {
ArrowRight,
Warning
} from '@element-plus/icons-vue'
import {pipeReal, pipeReal2} from '../../dataJson/RealPage/RealPipePage.js'
const enterpriseId = ref(null);
enterpriseId.value = store.getters.getEnterpriseId();
var gatherTime = ref([]);
......@@ -444,9 +445,7 @@ async function getForms() {
deviceType = 1;
}
makeFormsTitle(deviceType);
await http.post('/api/pipe/title', { enterpriseId: enterpriseId.value, deviceType: deviceType }).then((result) => {
result.data.otherList.forEach(element => {
pipeReal2.title.forEach(element => {
var tmp = false;
formLoop:
for (var i = 0; i < cardForms.forms.length - 1; i++) {
......@@ -482,17 +481,58 @@ async function getForms() {
cardForms.forms.length = cardForms.forms.length - 1;
}
})
// await http.post('/api/pipe/title', { enterpriseId: enterpriseId.value, deviceType: deviceType }).then((result) => {
// console.log( JSON.stringify(result.data.otherList));
// result.data.otherList.forEach(element => {
// var tmp = false;
// formLoop:
// for (var i = 0; i < cardForms.forms.length - 1; i++) {
//
// for (var j = 0; j < cardForms.forms[i].title.length; j++) {
// if (element.baseId === cardForms.forms[i].title[j].baseId) {
// cardForms.forms[i].title[j].prop = element.enName;
// cardForms.forms[i].title[j].color = element.backColor;
// cardForms.forms[i].title[j].label = element.alias;
// cardForms.forms[i].title[j].decimalPoint = element.decimalPoint;
// cardForms.forms[i].title[j].width = element.width;
// tmp = true;
// break formLoop;
// }
// }
// }
// //不行,要再重新处理
// if (tmp === false) {
// //放到其他表里
// var tmpelement = {
// baseId: element.baseId,
// prop: element.enName,
// color: element.backColor,
// label: element.alias,
// decimalPoint: element.decimalPoint,
// width: element.width
// }
// cardForms.forms[cardForms.forms.length - 1].title.push(tmpelement);
// tmp = true;
// }
// })
// if (cardForms.forms[cardForms.forms.length - 1].title.length === 0) {
// cardForms.forms.length = cardForms.forms.length - 1;
// }
//
// })
console.log(cardForms);
await http.post('/api/pipe/Real', { enterpriseId: enterpriseId.value, deviceType: deviceType }).then((result) => {
//根据返回结果,构建数据表cardForms.tableData和警告表
//处理:将字段与form对比,放取出对应的name和value,存入正确的tableData
findBoilderTableData(result.data, selectList.supplyList[showDropdown.value].value);
// findBoilderTableData(result.data, selectList.dropdownList[showDropdown.value].pipeId);
console.log(cardForms)
})
findBoilderTableData(pipeReal, selectList.supplyList[showDropdown.value].value);
// await http.post('/api/pipe/Real', { enterpriseId: enterpriseId.value, deviceType: deviceType }).then((result) => {
// //根据返回结果,构建数据表cardForms.tableData和警告表
// //处理:将字段与form对比,放取出对应的name和value,存入正确的tableData
// console.log('/api/pipe/Real========',result)
// findBoilderTableData(result.data, selectList.supplyList[showDropdown.value].value);
// // findBoilderTableData(result.data, selectList.dropdownList[showDropdown.value].pipeId);
// console.log(cardForms)
// })
}
function findBoilderTableData(dataSource, Id) {
......
......@@ -362,6 +362,7 @@ import DataForm from '../../components/DataForm.vue';
import { useRoute } from 'vue-router'
import http from '../../api/http'
import store from "../../store/index";
import {boilerStatus} from "@/dataJson/RealPage/RealPipePage.js";
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import {
Search,
......@@ -629,21 +630,44 @@ function makeFormsData(realData) {
tableInfo.tableData.length = 0;
tableInfo.tableData.push.apply(tableInfo.tableData, realData);
}
//获取静态数据
async function getForms(NenterpriseId, deviceType, supplyIdList, boilerIdList, sortList) {
// enterpriseId: NenterpriseId,supplyIdList:selectList,transferName:transferName, pageIndex: pageIndex, pageCount: pageCount,sortList:sortList
loading.value = true
await http.post('/api/status/boiler', { enterpriseId: NenterpriseId, deviceType: deviceType, supplyIdList: supplyIdList, boilerIdList: boilerIdList, sortList: sortList }).then((result) => {
makeFormsTitle(result.data.title);
titleData.value = result.data.title;
makeFormsData(result.data.realData);
// console.log(tableInfo)
})
loading.value = false
}
try {
// 设置加载状态为 true
loading.value = true;
// 使用已定义的 boilerStatus 更新表单标题和数据
if (boilerStatus && boilerStatus.title && boilerStatus.realData) {
makeFormsTitle(boilerStatus.title);
titleData.value = boilerStatus.title;
makeFormsData(boilerStatus.realData);
} else {
console.error('boilerStatus is not properly defined or lacks necessary properties.');
makeFormsData([]); // 如果 boilerStatus 不完整,则初始化表单数据为空数组
}
} catch (error) {
// 捕获并处理任何发生的错误
console.error('Error processing forms data:', error);
makeFormsData([]); // 在发生错误时初始化表单数据为空数组
} finally {
// 无论请求成功与否,最后都将加载状态设置为 false
loading.value = false;
}
}
//获取动态数据
// async function getForms(NenterpriseId, deviceType, supplyIdList, boilerIdList, sortList) {
// // enterpriseId: NenterpriseId,supplyIdList:selectList,transferName:transferName, pageIndex: pageIndex, pageCount: pageCount,sortList:sortList
// loading.value = true
// await http.post('/api/status/boiler', { enterpriseId: NenterpriseId, deviceType: deviceType, supplyIdList: supplyIdList, boilerIdList: boilerIdList, sortList: sortList }).then((result) => {
// makeFormsTitle(result.data.title);
// titleData.value = result.data.title;
//
//
//
// makeFormsData(result.data.realData);
// // console.log(tableInfo)
// })
// loading.value = false
// }
function getImgUrl(scope, item) {
......
......@@ -365,6 +365,7 @@ import DataForm from '../../components/DataForm.vue';
import { useRoute } from 'vue-router'
import http from '../../api/http'
import store from "../../store/index";
import {pipeStatus} from '../../dataJson/RealPage/RealPipePage.js'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import {
Search,
......@@ -575,24 +576,49 @@ function makeFormsData(realData) {
tableInfo.tableData.push.apply(tableInfo.tableData, realData);
}
//使用静态数据
async function getForms(NenterpriseId, deviceType, supplyIdList, sortList) {
// enterpriseId: NenterpriseId,supplyIdList:selectList,transferName:transferName, pageIndex: pageIndex, pageCount: pageCount,sortList:sortList
loading.value = true
await http.post('/api/status/pipe', { enterpriseId: NenterpriseId, deviceType: deviceType, supplyIdList: supplyIdList, name: null, sortList: sortList }).then((result) => {
if (result.status === 0) {
makeFormsTitle(result.data.title);
titleData.value = result.data.title;
makeFormsData(result.data.realData);
try {
// 设置加载状态为 true
loading.value = true;
// 使用已定义的 pipeStatus 更新表单标题和数据
if (pipeStatus && pipeStatus.title && pipeStatus.realData) {
makeFormsTitle(pipeStatus.title);
titleData.value = pipeStatus.title;
makeFormsData(pipeStatus.realData);
} else {
makeFormsData([]);
console.error('pipeStatus is not properly defined or lacks necessary properties.');
makeFormsData([]); // 如果 pipeStatus 不完整,则初始化表单数据为空数组
}
} catch (error) {
// 捕获并处理任何发生的错误
console.error('Error processing forms data:', error);
makeFormsData([]); // 在发生错误时初始化表单数据为空数组
} finally {
// 无论请求成功与否,最后都将加载状态设置为 false
loading.value = false;
}
// console.log(tableInfo)
})
loading.value = false
}
// 使用动态数据
// async function getForms(NenterpriseId, deviceType, supplyIdList, sortList) {
// // enterpriseId: NenterpriseId,supplyIdList:selectList,transferName:transferName, pageIndex: pageIndex, pageCount: pageCount,sortList:sortList
// loading.value = true
// await http.post('/api/status/pipe', { enterpriseId: NenterpriseId, deviceType: deviceType, supplyIdList: supplyIdList, name: null, sortList: sortList }).then((result) =>{
// if (result.status === 0) {
// makeFormsTitle(result.data.title);
// titleData.value = result.data.title;
// makeFormsData(result.data.realData);
// } else {
// makeFormsData([]);
// }
// // console.log(tableInfo)
// })
// loading.value = false
// }
function getImgUrl(scope, item) {
......@@ -651,8 +677,7 @@ function checkAge() {
}
})
}
};
}
// function setCellStyle({ row, column, rowIndex, columnIndex }) {
// let css_color = {};
......
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