From c99aff48171ee446ad5ff5898c4acf8194f200aa Mon Sep 17 00:00:00 2001
From: betaqi <3188864257@qq.com>
Date: Mon, 14 Jul 2025 12:17:33 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/module/eam/device/index.ts | 1 +
src/pages/deviceInfo/components/BasicInfo.vue | 88 ++++++++++++-------
.../deviceInfo/components/DeliveryInfo.vue | 2 +-
src/pages/deviceInfo/components/TestInfo.vue | 1 -
src/pages/deviceInfo/index.vue | 26 +++++-
src/pages/deviceInfo/info.vue | 7 +-
src/pages/deviceInfo/utils.ts | 1 +
7 files changed, 87 insertions(+), 39 deletions(-)
diff --git a/src/api/module/eam/device/index.ts b/src/api/module/eam/device/index.ts
index eed17ca..abb3d67 100644
--- a/src/api/module/eam/device/index.ts
+++ b/src/api/module/eam/device/index.ts
@@ -31,6 +31,7 @@ export interface IDeviceOV {
cost: string
currentFirmwareId: string
targetFirmwareId: string
+ iccid?: string
}
export const operantDevice = (type: OperantAction, data: IDeviceOV) => {
diff --git a/src/pages/deviceInfo/components/BasicInfo.vue b/src/pages/deviceInfo/components/BasicInfo.vue
index 9a4e915..122ae31 100644
--- a/src/pages/deviceInfo/components/BasicInfo.vue
+++ b/src/pages/deviceInfo/components/BasicInfo.vue
@@ -30,18 +30,19 @@
class="input"
v-model="params.categoryId"
:options="categoryTreeData"
- :disabled="disabled"
+ :disabled="true"
:props="{
checkStrictly: true,
value: 'id',
label: 'name',
emitPath: false,
}"
+ @change="onChangeCategoryId"
/>
-
+
-
+
编辑基础信息
@@ -105,7 +105,7 @@ import EdfsTable from '@/components/dashboard/Edfs-table/index.vue'
import EdfsButton from '@/components/dashboard/Edfs-button/index.vue'
import { isResError } from '@/hooks/useMessage'
import type { TableColumnCtx } from 'element-plus'
-import { useRouter } from 'vue-router'
+import { useRouter, useRoute } from 'vue-router'
import PieChart from './components/pie-chart.vue'
import {
getDeviceLabelBase64,
@@ -113,6 +113,7 @@ import {
getDeviceSummaryByStatus,
getDeviceReportPDF,
type IDevice,
+ getDeviceInfo,
} from '@/api/module/eam/device'
import { ElLoading } from 'element-plus'
import { deviceTableCol, DeviceStatus } from './utils'
@@ -122,6 +123,24 @@ import jsPDF from 'jspdf'
defineOptions({
name: 'DeviceList',
})
+const route = useRoute()
+// 将 updateId 转换为 number 类型,如果不存在则为 undefined
+const updateId = ref(
+ route.query.updateId !== undefined && route.query.updateId !== null
+ ? Number(route.query.updateId)
+ : undefined
+)
+
+onActivated(async () => {
+ await nextTick()
+ const index = list.value.findIndex(r => r.id === updateId.value)
+ if (updateId.value && index !== -1) {
+ const res = await getDeviceInfo(updateId.value)
+ if (!isResError(res)) {
+ list.value[index] = res.data
+ }
+ }
+})
const loading = ref(true)
const total = ref(0)
@@ -262,7 +281,6 @@ function handleCommand(command: string, row: any) {
onPrint(row)
return
}
- debugger
editDevice(row, command)
}
diff --git a/src/pages/deviceInfo/info.vue b/src/pages/deviceInfo/info.vue
index 4df6973..c4593ce 100644
--- a/src/pages/deviceInfo/info.vue
+++ b/src/pages/deviceInfo/info.vue
@@ -6,7 +6,12 @@
class="back-btn"
@click="
() => {
- router.go(-1)
+ router.push({
+ path: '/device/data',
+ query: {
+ updateId: deviceInfoId,
+ },
+ })
}
"
/>
diff --git a/src/pages/deviceInfo/utils.ts b/src/pages/deviceInfo/utils.ts
index 8c3d35b..f7e33cc 100644
--- a/src/pages/deviceInfo/utils.ts
+++ b/src/pages/deviceInfo/utils.ts
@@ -12,6 +12,7 @@ export const deviceTableCol = [
{ label: '设备类型', prop: 'categoryName', minWidth: '10%' },
{ label: '设备状态', prop: 'status', minWidth: '10%' },
{ label: '创建时间', prop: 'createTime', minWidth: '10%' },
+ { label: 'sd', prop: 'cost', minWidth: '10%' }
]
export type OptAction = 'create' | 'update' | 'view'