From c4bdce63c1a4a18c7ad7159b5cb7366613cb99d5 Mon Sep 17 00:00:00 2001 From: TimSpan Date: Mon, 19 May 2025 14:48:51 +0800 Subject: [PATCH] Update index.vue --- .../IntelligentEarlyWarningCenter/index.vue | 124 ++++++++++-------- 1 file changed, 68 insertions(+), 56 deletions(-) diff --git a/src/views/IntelligentEarlyWarningCenter/index.vue b/src/views/IntelligentEarlyWarningCenter/index.vue index b5699c3..b9f5cd4 100644 --- a/src/views/IntelligentEarlyWarningCenter/index.vue +++ b/src/views/IntelligentEarlyWarningCenter/index.vue @@ -73,7 +73,13 @@ name="设备监控" tab="设备监控" > -
设备监控
+ @@ -95,16 +101,10 @@ NTag, useModal, } from "naive-ui"; - import { - type HardwareData, - type ElectronicScale, - } from "@/views/hardwareData/index.ts"; - import hardwareData from "@/views/hardwareData/index.ts"; + import { ref, reactive } from "vue"; const tableRef = useTemplateRef("tableRef"); - const modal = useModal(); - const forms = ref(null); const reqApi_1: TableType["requestApi"] = (params) => { return new Promise((resolve) => { @@ -114,7 +114,16 @@ current: "1", // @ts-ignore pages: "2", - records: [], + records: [ + // { + // name: "张三", + // status: false, + // }, + // { + // name: "李四", + // status: false, + // }, + ], size: "10", total: "0", }, @@ -125,11 +134,11 @@ const columns_1 = ref([ { key: "name", - title: "菜谱名称", + title: "员工姓名", }, { key: "status", - title: "食品搭配状态", + title: "员工健康状态", render: ({ status }) => { return ( @@ -174,6 +183,53 @@ }, ]); + const reqApi_3: TableType["requestApi"] = (params) => { + return new Promise((resolve) => { + resolve({ + code: 200, + data: { + current: "1", + // @ts-ignore + pages: "2", + records: [ + { + name: "晨检仪", + status: true, + }, + { + name: "摄像头", + status: true, + }, + { + name: "电子秤", + status: false, + }, + ], + size: "10", + total: "0", + }, + message: "操作成功!", + }); + }); + }; + const columns_3 = ref([ + { + key: "name", + title: "设备名称", + }, + { + key: "status", + title: "设备状态", + render: ({ status }) => { + return ( + + {status ? "在线" : "离线"} + + ); + }, + }, + ]); + const reqApi: TableType["requestApi"] = (params) => { return new Promise((resolve) => { resolve({ @@ -196,16 +252,7 @@ }); }; type TableType = TableProProps; - const searchFormOptions = reactive({ - time: { - type: "datePicker", - label: "时间", - }, - userName: { - type: "input", - label: "员工姓名", - }, - }); + const columns = ref([ { key: "name", @@ -223,40 +270,6 @@ }, }, ]); - const workAccountsValueList = { - bodyImage: "", - bodyImageUrl: "", - checkResultStr: "", - checkStatusStr: "", - createTime: "", - createTimeStr: "", - diseases: "", - handImageUrl: "", - handbackImageUrl: "", - headImageUrl: "", - isDefault: true, - sexStr: "", - temperature: "", - updateTime: "", - userName: "", - }; - const userValue = ref({ - ...workAccountsValueList, - }); - const resetModelValue = () => { - userValue.value = { ...workAccountsValueList }; - title.value = "添加晨检记录"; - }; - const addUserOrUpdate = () => { - forms.value?.validate().then(() => { - // loading.value = true - }); - }; - const loading = ref(false); - const modalRef = ref(); - const title = ref("添加晨检记录"); - - // 电子秤 const reqApiElectronicScale: TableType["requestApi"] = (params) => { return new Promise((resolve) => { @@ -372,4 +385,3 @@ }, ]); -