From 9b143797a700aa6d3e97dba53d4f95797919e989 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com>
Date: Thu, 19 Mar 2026 13:34:59 +0800
Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=81=94=E8=AE=BE=E5=A4=87=E8=AE=BE?=
=?UTF-8?q?=E5=A4=87=E7=AE=A1=E7=90=86=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/iot/weihu/index.vue | 8 ++-
src/views/iot/weihu/weihu.data.ts | 40 +++++++-------
.../components/AreaDeviceAddList.vue | 19 +++++--
.../components/AreaDeviceAddModal.vue | 2 +-
.../iotManager/components/AreaDeviceList.vue | 1 +
src/views/iotManager/components/AreaList.vue | 2 +-
.../components/OrgDeviceAddList.vue | 17 ++++--
.../components/OrgDeviceAddModal.vue | 2 +-
.../iotManager/components/PreviewList.vue | 54 ++++++++++++++++---
src/views/iotManager/index.vue | 2 +-
src/views/iotManager/manager.api.ts | 10 ++++
src/views/iotManager/manager.data.ts | 9 +++-
12 files changed, 124 insertions(+), 42 deletions(-)
diff --git a/src/views/iot/weihu/index.vue b/src/views/iot/weihu/index.vue
index 822a32a..339e1b7 100644
--- a/src/views/iot/weihu/index.vue
+++ b/src/views/iot/weihu/index.vue
@@ -9,17 +9,20 @@
+ @change="handleChange" allow-clear >
{{item.departName}}
+ v-model:value="model[field]" allow-clear >
{{item.nuId}}
+
+
+
@@ -39,6 +42,7 @@ import {onMounted, reactive, ref} from 'vue';
import { useDrawer } from "@/components/Drawer";
import SendOrgDrawer from './components/SendOrgDrawer.vue';
import ReamrksListModal from './components/ReamrksListModal.vue'
+import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const [registerDrawer, { openDrawer }] = useDrawer();
const queryParam = reactive({});
const selectedRows = ref([]);
diff --git a/src/views/iot/weihu/weihu.data.ts b/src/views/iot/weihu/weihu.data.ts
index 0836f2a..18bb443 100644
--- a/src/views/iot/weihu/weihu.data.ts
+++ b/src/views/iot/weihu/weihu.data.ts
@@ -46,7 +46,7 @@ export const columns: BasicColumn[] = [
{
title: '设备类型',
align: "center",
- dataIndex: 'deviceType',
+ dataIndex: 'deviceType_dictText',
width: 100,
},
{
@@ -76,7 +76,13 @@ export const columns: BasicColumn[] = [
width: 100,
},
{
- title: '时间戳',
+ title: '操作人',
+ align: "center",
+ dataIndex: 'updateBy',
+ width: 160,
+ },
+ {
+ title: '操作时间',
align: "center",
dataIndex: 'updateDate',
width: 160,
@@ -110,19 +116,11 @@ export const searchFormSchema: FormSchema[] = [
label: '设备类型',
field: 'deviceType',
component: 'JDictSelectTag',
- componentProps: {
- placeholder: '请选择类型',
- options: [
- { label: '录像机', value: '录像机' },
- { label: '摄像头', value: '摄像头' },
- { label: '路由器', value: '路由器' },
- { label: '交换机', value: '交换机' },
- { label: '无线AP', value: '无线AP' },
- { label: '智能电表', value: '智能电表' },
- { label: '智能水表', value: '智能水表' },
- { label: '温湿度计', value: '温湿度计' },
- ],
- },
+ slot: 'deviceType',
+ // componentProps: {
+ // placeholder: '请选择类型',
+ // dictCode: 'tplink_device_type',
+ // },
colProps: { span: 6 },
},
{
@@ -147,6 +145,7 @@ export const searchFormSchema: FormSchema[] = [
options: [
{ label: '未分配', value: '未分配' },
{ label: '已分配', value: '已分配' },
+ { label: '释放', value: '释放' },
],
},
colProps: { span: 6 },
@@ -159,8 +158,7 @@ export const searchFormSchema: FormSchema[] = [
placeholder: '请选择设备状态',
options: [
{ label: '正常', value: '0' },
- { label: '释放', value: '1' },
- { label: '损坏', value: '2' },
+ { label: '损坏', value: '1' },
],
},
colProps: { span: 6 },
@@ -175,7 +173,13 @@ export const logColumns: BasicColumn[] = [
dataIndex: 'remark'
},
{
- title: '创建时间',
+ title: '操作人',
+ align:"center",
+ dataIndex: 'updateBy',
+ width: 160
+ },
+ {
+ title: '操作时间',
align:"center",
dataIndex: 'updateDate',
width: 160
diff --git a/src/views/iotManager/components/AreaDeviceAddList.vue b/src/views/iotManager/components/AreaDeviceAddList.vue
index 4db9bc1..ff2095d 100644
--- a/src/views/iotManager/components/AreaDeviceAddList.vue
+++ b/src/views/iotManager/components/AreaDeviceAddList.vue
@@ -37,7 +37,7 @@
- 绑定设备
+
@@ -70,6 +70,8 @@ import { deviceAddColumns } from '../manager.data';
import { canAddList,addBatch } from '../manager.api';
import { useUserStore } from '/@/store/modules/user';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
+import { useMessage } from '/@/hooks/web/useMessage';
+const { createMessage } = useMessage();
const formRef = ref();
const confirmLoading = ref(false);
@@ -80,6 +82,7 @@ const orgCode = ref('');
const remarks = ref('');
const visible = ref();
const userStore = useUserStore();
+const emit = defineEmits(['register', 'ok']);
//注册table数据
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
@@ -149,7 +152,11 @@ function searchReset() {
searchQuery();
}
-function handleCreate(){
+function submitForm(){
+ if(!selectedRowKeys.value.length > 0){
+ createMessage.warning('请选择要添加的设备');
+ return;
+ }
visible.value = true;
}
@@ -164,7 +171,8 @@ function handleOk(){
}
addBatch(record)
.then((res) => {
- searchQuery();
+ // searchQuery();
+ emit('ok');
}).catch(() =>{})
.finally(() => {
confirmLoading.value = false;
@@ -176,12 +184,13 @@ function handleOk(){
function init(record) {
departId.value = record.departId;
nuId.value = record.nuId;
- orgCode.value = record.orgCode;
+ orgCode.value = record.sysOrgCode;
searchQuery();
}
defineExpose({
- init
+ init,
+ submitForm
});
diff --git a/src/views/iotManager/components/AreaDeviceAddModal.vue b/src/views/iotManager/components/AreaDeviceAddModal.vue
index 48afbc4..a1b3e24 100644
--- a/src/views/iotManager/components/AreaDeviceAddModal.vue
+++ b/src/views/iotManager/components/AreaDeviceAddModal.vue
@@ -3,7 +3,7 @@
:bodyStyle="{ padding: '14px' }" @close="handleCancel">
关闭
- 确认
+ 添加设备
diff --git a/src/views/iotManager/components/AreaDeviceList.vue b/src/views/iotManager/components/AreaDeviceList.vue
index 4089ab8..db21872 100644
--- a/src/views/iotManager/components/AreaDeviceList.vue
+++ b/src/views/iotManager/components/AreaDeviceList.vue
@@ -81,6 +81,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
canResize: false,
useSearchForm: false,
showIndexColumn: true,
+ showActionColumn: false,
actionColumn: {
width: 180,
fixed: 'right',
diff --git a/src/views/iotManager/components/AreaList.vue b/src/views/iotManager/components/AreaList.vue
index 26a2eee..75577dc 100644
--- a/src/views/iotManager/components/AreaList.vue
+++ b/src/views/iotManager/components/AreaList.vue
@@ -125,7 +125,7 @@ function getTableAction(record) {
* 添加设备
*/
function deviceManager(record: Recordable){
- areaAddDrawer.value.disableSubmit = true;
+ areaAddDrawer.value.disableSubmit = false;
areaAddDrawer.value.edit(record);
}
diff --git a/src/views/iotManager/components/OrgDeviceAddList.vue b/src/views/iotManager/components/OrgDeviceAddList.vue
index 5193de0..e23fb9a 100644
--- a/src/views/iotManager/components/OrgDeviceAddList.vue
+++ b/src/views/iotManager/components/OrgDeviceAddList.vue
@@ -37,7 +37,7 @@
- 绑定设备
+
@@ -70,6 +70,8 @@ import { deviceAddColumns } from '../manager.data';
import { canAddList,addOrgBatch } from '../manager.api';
import { useUserStore } from '/@/store/modules/user';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
+import { useMessage } from '/@/hooks/web/useMessage';
+const { createMessage } = useMessage();
const formRef = ref();
const confirmLoading = ref(false);
@@ -79,6 +81,7 @@ const orgCode = ref('');
const remarks = ref('');
const visible = ref();
const userStore = useUserStore();
+const emit = defineEmits(['register', 'ok']);
//注册table数据
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
@@ -148,7 +151,11 @@ function searchReset() {
searchQuery();
}
-function handleCreate(){
+function submitForm(){
+ if(!selectedRowKeys.value.length > 0){
+ createMessage.warning('请选择要添加的设备');
+ return;
+ }
visible.value = true;
}
@@ -162,7 +169,8 @@ function handleOk(){
}
addOrgBatch(record)
.then((res) => {
- searchQuery();
+ // searchQuery();
+ emit('ok');
}).catch(() =>{})
.finally(() => {
confirmLoading.value = false;
@@ -178,7 +186,8 @@ function init(record) {
}
defineExpose({
- init
+ init,
+ submitForm
});
diff --git a/src/views/iotManager/components/OrgDeviceAddModal.vue b/src/views/iotManager/components/OrgDeviceAddModal.vue
index fb5ec70..79e9305 100644
--- a/src/views/iotManager/components/OrgDeviceAddModal.vue
+++ b/src/views/iotManager/components/OrgDeviceAddModal.vue
@@ -3,7 +3,7 @@
:bodyStyle="{ padding: '14px' }" @close="handleCancel">
关闭
- 确认
+ 绑定设备
diff --git a/src/views/iotManager/components/PreviewList.vue b/src/views/iotManager/components/PreviewList.vue
index cf9a2c9..44eda2c 100644
--- a/src/views/iotManager/components/PreviewList.vue
+++ b/src/views/iotManager/components/PreviewList.vue
@@ -74,13 +74,15 @@