From 75c83930c3da20464661c2ebf6bf966c7cf1873b Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Wed, 20 May 2026 09:57:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E7=BB=93=E6=9E=9C=EF=BC=8C?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E5=9B=BE=E5=BD=A2=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/antvx6/echartsModel.vue | 83 +++++++++++++------ .../src/components/antvx6/tableModel.vue | 42 ++++++++-- .../frontend/src/components/antvx6/viewx6.vue | 14 +++- .../views/business/database/device/index.vue | 2 +- .../src/views/component/scenario/index.vue | 32 +++++-- 5 files changed, 131 insertions(+), 42 deletions(-) diff --git a/business-css/frontend/src/components/antvx6/echartsModel.vue b/business-css/frontend/src/components/antvx6/echartsModel.vue index ca2d930..2f9b2ee 100644 --- a/business-css/frontend/src/components/antvx6/echartsModel.vue +++ b/business-css/frontend/src/components/antvx6/echartsModel.vue @@ -18,7 +18,6 @@ import { } from 'vue'; import { init, EChartsOption } from 'echarts'; import { getByScenario } from "@/api/business/scenario"; - import * as echarts from 'echarts'; import resize from '@/utils/resize'; @@ -33,31 +32,48 @@ const props = defineProps({ type: String, default: '' }, + deviceType: { + required: false, + type: String, + default: '' + }, className: { type: String, default: '', + }, + sizeSchemaInfo: { + required: false, + type: Object, + default: () => ({}) } }); const { mounted, chart, beforeDestroy, activated, deactivated } = resize(); + +function getDeviceName(code:any){ + let name = '' + for(let i = 0;i { onDeactivated(() => { deactivated(); }); +const deviceData = ref([]) onMounted(() => { + deviceData.value = props.sizeSchemaInfo[props.deviceType].fields mounted(); nextTick(() => { - getScenarioResults() }); }); diff --git a/business-css/frontend/src/components/antvx6/tableModel.vue b/business-css/frontend/src/components/antvx6/tableModel.vue index a37db85..1c27366 100644 --- a/business-css/frontend/src/components/antvx6/tableModel.vue +++ b/business-css/frontend/src/components/antvx6/tableModel.vue @@ -9,6 +9,16 @@ import { onMounted, ref, nextTick } from "vue"; import { ElForm, ElMessage, ElMessageBox, selectEmits } from "element-plus"; import Page from '@/components/Pagination/page.vue' import { getByScenario,exportAllExports } from "@/api/business/scenario"; +// import { sizeSchemaAll } from "@/api/business/database/device"; +//获取所有设备列表 + +const sourceTempData:any = ref([]) // 当前设备的属性列表 +// async function getSizeSchemaList(){ +// let result = await sizeSchemaAll({}) +// sizeSchemaInfo.value = result +// } + + const apiUrl = import.meta.env.VITE_APP_BASE_API; // 基础路径 const emit = defineEmits([ 'closeEditdevice']); @@ -23,8 +33,18 @@ const props = defineProps({ type: String, default: '' }, - + deviceType: { + required: false, + type: String, + default: '' + }, + sizeSchemaInfo: { + required: false, + type: Object, + default: () => {} + } }) +const sizeSchemaInfo:any = ref(props.sizeSchemaInfo); const queryParams = ref({ current: 1, size: 10, @@ -43,6 +63,7 @@ function getIf(list:any,code:any){ } function getScenarioResults(){ scenarioResultData.value = [] + sourceTempData.value = sizeSchemaInfo.value[props.deviceType].fields getByScenario({ scenarioId: props.scenarioId, deviceId: props.deviceId, @@ -68,7 +89,7 @@ function getScenarioResults(){ total.value = res.data.total }) } -onMounted(() => { +onMounted(async () => { getScenarioResults() }); @@ -102,10 +123,15 @@ function exportExportsClick(){ - + + + + @@ -114,11 +140,17 @@ function exportExportsClick(){ - + + + + + + +
diff --git a/business-css/frontend/src/components/antvx6/viewx6.vue b/business-css/frontend/src/components/antvx6/viewx6.vue index 6786a7f..47cebeb 100644 --- a/business-css/frontend/src/components/antvx6/viewx6.vue +++ b/business-css/frontend/src/components/antvx6/viewx6.vue @@ -174,6 +174,7 @@ function addAttrText(item:any,index:any,useData:any){ width: 14, height: 14, correlationId: item.id, + deviceType: item.deviceInfo?.type || '', type:'echarts', attrs: { img: { @@ -193,6 +194,7 @@ function addAttrText(item:any,index:any,useData:any){ width: 14, height: 14, correlationId: item.id, + deviceType: item.deviceInfo?.type || '', type:'text', attrs: { img: { @@ -632,11 +634,13 @@ onMounted(() => { if(node.store.data == null)return if(node.store.data.type == 'echarts'){ deviceId.value = node.store.data.correlationId + deviceType.value = node.store.data.deviceType isEchartsModel.value = true return } if(node.store.data.type == 'text'){ deviceId.value = node.store.data.correlationId + deviceType.value = node.store.data.deviceType isTableModel.value = true return } @@ -644,7 +648,7 @@ onMounted(() => { }) }) - +const deviceType = ref('') const left = ref(0) const top = ref(0) @@ -887,12 +891,14 @@ function dialogAttributeDialog(){ // 关闭变动设置弹窗
显示设置
- - + + - + { getAlgorithmType() gettableData(); initDeviceData() - + getSizeSchemaList() searchAlgorithmsModelPage({ pageNum: 1, pageSize: 9999 @@ -388,6 +403,7 @@ function getMenuData() { if (res.code == 0) { deviceList.value = res.data; deviceId.value = res.data[0].deviceId + deviceType.value = res.data[0].deviceType } }) } @@ -395,10 +411,11 @@ function getMenuData() { function handleClick(item:any, index:any){ // formulaInfo.value.correlation = JSON.parse(JSON.stringify(item.deviceName)) isAcitve.value = index - + deviceType.value = "" deviceId.value = "" setTimeout(() => { deviceId.value = item.deviceId + deviceType.value = item.deviceType }, 200); } @@ -680,8 +697,11 @@ function handlefailDetail(row:any){
- - + + +