From 72ddc3d5f386f244a134293463559a85b5a3eb0a Mon Sep 17 00:00:00 2001 From: FLL <2162874245@qq.com> Date: Wed, 16 Jul 2025 17:30:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deviceLocation/model.d.ts | 10 ++ .../deviceLocation/data.ts | 107 +++++++++--------- .../deviceLocation/deviceLocation-detail.vue | 52 +++++++++ .../deviceLocation/deviceLocation-modal.vue | 104 ++++++++++++++--- .../deviceLocation/index.vue | 58 ++++------ 5 files changed, 228 insertions(+), 103 deletions(-) create mode 100644 apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-detail.vue diff --git a/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/model.d.ts b/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/model.d.ts index 384a696c..ed267001 100644 --- a/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/model.d.ts +++ b/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/model.d.ts @@ -26,6 +26,16 @@ export interface DeviceLocationVO { */ searchValue: string; + /** + * 位置类型 + */ + locationObjName: string; + + /** + * 搜索值 + */ + remark: string; + } export interface DeviceLocationForm extends BaseEntity { diff --git a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts index 69886942..a4f6b9f9 100644 --- a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts +++ b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts @@ -1,5 +1,7 @@ import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; +import {getDictOptions} from "#/utils/dict"; +import {renderDict} from "#/utils/render"; export const querySchema: FormSchemaGetter = () => [ @@ -8,23 +10,14 @@ export const querySchema: FormSchemaGetter = () => [ fieldName: 'locationName', label: '位置名称', }, - { - component: 'Input', - fieldName: 'locationCode', - label: '位置编号', - }, { component: 'Select', componentProps: { + options: getDictOptions('pro_location_type'), }, fieldName: 'locationType', label: '位置类型', }, - { - component: 'Input', - fieldName: 'searchValue', - label: '搜索值', - }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 @@ -32,24 +25,30 @@ export const querySchema: FormSchemaGetter = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { - title: '主键', - field: 'id', + title: '位置编码', + field: 'locationCode', }, { title: '位置名称', field: 'locationName', }, - { - title: '位置编号', - field: 'locationCode', - }, + { title: '位置类型', field: 'locationType', + slots: { + default: ({ row }) => { + return renderDict(row.locationType, 'pro_location_type'); + }, + }, }, { - title: '搜索值', - field: 'searchValue', + title: '位置对象', + field: 'locationObject', + }, + { + title: '备注', + field: 'remark', }, { field: 'action', @@ -60,37 +59,41 @@ export const columns: VxeGridProps['columns'] = [ }, ]; -export const modalSchema: FormSchemaGetter = () => [ - { - label: '主键', - fieldName: 'id', - component: 'Input', - dependencies: { - show: () => false, - triggerFields: [''], - }, - }, - { - label: '位置名称', - fieldName: 'locationName', - component: 'Input', - rules: 'required', - }, - { - label: '位置编号', - fieldName: 'locationCode', - component: 'Input', - }, - { - label: '位置类型', - fieldName: 'locationType', - component: 'Select', - componentProps: { - }, - }, - { - label: '搜索值', - fieldName: 'searchValue', - component: 'Input', - }, -]; +// export const modalSchema: FormSchemaGetter = () => [ +// { +// label: '主键', +// fieldName: 'id', +// component: 'Input', +// dependencies: { +// show: () => false, +// triggerFields: [''], +// }, +// }, +// { +// label: '位置名称', +// fieldName: 'locationName', +// component: 'Input', +// rules: 'required', +// }, +// { +// label: '位置类型', +// fieldName: 'locationType', +// component: 'Select', +// componentProps: { +// options: getDictOptions('pro_location_type'), +// }, +// rules: 'selectRequired', +// }, +// { +// component: 'TreeSelect', +// fieldName: 'locationObject', +// defaultValue: undefined, +// label: '位置对象', +// rules: 'selectRequired', +// }, +// { +// label: '备注', +// fieldName: 'remark', +// component: 'Textarea', +// }, +// ]; diff --git a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-detail.vue b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-detail.vue new file mode 100644 index 00000000..bd463857 --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-detail.vue @@ -0,0 +1,52 @@ + + + diff --git a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-modal.vue b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-modal.vue index ccdbc0c3..5d8a8542 100644 --- a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-modal.vue +++ b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-modal.vue @@ -1,23 +1,71 @@