From e6d39fd5fa4be6b1c14f88b9425f369a45ed4cf3 Mon Sep 17 00:00:00 2001 From: zhujiyan <17812234322@163.com> Date: Wed, 19 Jun 2024 20:32:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=96=B9=E6=A1=88-=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=BF=A1=E6=81=AF=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/cs-device-boot/planData.ts | 38 ++- src/components/form/datePicker/index.vue | 2 +- src/components/table/header/index.vue | 2 + src/components/tree/govern/deviceInfoTree.vue | 107 +++++++ .../terminal/planData/components/device.vue | 256 ++++++++++++++++ .../planData/components/deviceInfo.vue | 283 ------------------ .../terminal/planData/components/popup.vue | 15 +- src/views/govern/terminal/planData/index.vue | 136 ++++++--- 8 files changed, 487 insertions(+), 352 deletions(-) create mode 100644 src/components/tree/govern/deviceInfoTree.vue create mode 100644 src/views/govern/terminal/planData/components/device.vue delete mode 100644 src/views/govern/terminal/planData/components/deviceInfo.vue diff --git a/src/api/cs-device-boot/planData.ts b/src/api/cs-device-boot/planData.ts index a744be9..d373a97 100644 --- a/src/api/cs-device-boot/planData.ts +++ b/src/api/cs-device-boot/planData.ts @@ -9,14 +9,14 @@ export function getSchemeTree() { } // 根据方案查询测试项信息 -export function getTestRecordInfo(id:any) { +export function getTestRecordInfo(id: any) { return createAxios({ - url: '/cs-device-boot/wlRecord/getTestRecordById?testRecordId='+id, + url: '/cs-device-boot/wlRecord/getTestRecordById?testRecordId=' + id, method: 'GET' }) } //新增修改方案 -export function addPlan(data:any) { +export function addPlan(data: any) { return createAxios({ url: '/cs-device-boot/wlRecord/updateSchemeRecord', method: 'POST', @@ -25,7 +25,7 @@ export function addPlan(data:any) { } //新增测试项 -export function addRecord(data:any) { +export function addRecord(data: any) { return createAxios({ url: '/cs-device-boot/wlRecord/addRecord', method: 'POST', @@ -34,7 +34,7 @@ export function addRecord(data:any) { } //新增测试项 -export function updateRecord(data:any) { +export function updateRecord(data: any) { return createAxios({ url: '/cs-device-boot/wlRecord/updateTestRecord', method: 'POST', @@ -43,16 +43,15 @@ export function updateRecord(data:any) { } //删除方案或测试项 -export function delRecord(data:any) { +export function delRecord(data: any) { return createAxios({ - url: '/cs-device-boot/wlRecord/deleteRecord?id='+data.id, - method: 'DELETE', + url: '/cs-device-boot/wlRecord/deleteRecord?id=' + data.id, + method: 'DELETE' }) } - //查询历史趋势折线图 -export function getHistoryTrend(data:any) { +export function getHistoryTrend(data: any) { return createAxios({ url: '/cs-device-boot/wlRecord/queryCommonStatisticalByTest', method: 'POST', @@ -61,7 +60,7 @@ export function getHistoryTrend(data:any) { } //查询设备列表 -export function getDeviceList(data:any) { +export function getDeviceList(data: any) { return createAxios({ url: '/cs-device-boot/wlRecord/queryPage', method: 'POST', @@ -69,3 +68,20 @@ export function getDeviceList(data:any) { }) } +//添加测试项中的设备基础数据 +export function addDevice(data: any) { + return createAxios({ + url: '/cs-device-boot/wlRecord/saveDataRecord', + method: 'POST', + data + }) +} + +//删除测试项中的设备基础数据 +export function delDevice(data: any) { + return createAxios({ + url: '/cs-device-boot/wlRecord/deleteDataRecord', + method: 'DELETE', + data + }) +} diff --git a/src/components/form/datePicker/index.vue b/src/components/form/datePicker/index.vue index 45c825b..a14f192 100644 --- a/src/components/form/datePicker/index.vue +++ b/src/components/form/datePicker/index.vue @@ -496,7 +496,7 @@ function formatDate(date: Date): string { const day = String(date.getDate()).padStart(2, '0') return `${year}-${month}-${day}` } -defineExpose({ timeValue, interval, timeFlag, setTimeOptions, setInterval, getYearOnYear, getMonthOnMonth }) +defineExpose({ timeValue, interval, timeFlag, setTimeOptions, setInterval, getYearOnYear, getMonthOnMonth,timeChange }) diff --git a/src/views/govern/terminal/planData/components/deviceInfo.vue b/src/views/govern/terminal/planData/components/deviceInfo.vue deleted file mode 100644 index 51f9ee3..0000000 --- a/src/views/govern/terminal/planData/components/deviceInfo.vue +++ /dev/null @@ -1,283 +0,0 @@ - - - - diff --git a/src/views/govern/terminal/planData/components/popup.vue b/src/views/govern/terminal/planData/components/popup.vue index 3179e1c..37fb7b0 100644 --- a/src/views/govern/terminal/planData/components/popup.vue +++ b/src/views/govern/terminal/planData/components/popup.vue @@ -183,7 +183,6 @@ import { ref, inject, defineEmits } from 'vue' import { ElMessage } from 'element-plus' import { Plus, Minus, Message } from '@element-plus/icons-vue' -import deviceInfo from './deviceInfo.vue' import { addPlan, addRecord, updateRecord, getDeviceList } from '@/api/cs-device-boot/planData' import { useDictData } from '@/stores/dictData' const dictData = useDictData() @@ -223,8 +222,8 @@ const title: any = ref('') const activeFormIndex: any = ref(null) const planId: any = ref('') const deviceRef: any = ref(null) -const details=(val:any)=>{ - form.value=val +const details = (val: any) => { + form.value = val } // 0 新增方案 1 修改方案 2 新增测试项 3 修改测试项 4 删除方案 5 删除测试项 6 设备信息 const open = (val: any, id: any) => { @@ -248,8 +247,8 @@ const open = (val: any, id: any) => { //数据回显 if (val == 0 || val == 2) { form.value = { - itemName: row.itemName, //方案名称 - describe: row.describe, //方案描述 + itemName: '', //方案名称 + describe: '', //方案描述 //测试项数据 records: [ { @@ -273,12 +272,10 @@ const open = (val: any, id: any) => { } } if (val == 1 || val == 3) { - } if (val == 6) { //1 列表 0树 - getDeviceList({ id: id ,isTrueFlag:0,pageNum:1,pageSize:200}).then(res => { - console.log(res, '查询列表') + getDeviceList({ id: id, isTrueFlag: 0, pageNum: 1, pageSize: 200 }).then(res => { }) } } @@ -395,7 +392,7 @@ const submit = () => { }) } } -defineExpose({ open ,details}) +defineExpose({ open, details })