From 5c88ee83d98a418952ca2e96f104ef38075d16b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com>
Date: Wed, 18 Mar 2026 18:10:29 +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/jeecg/components/JDictSelectTag.vue | 35 ++-
.../components/AreaDeviceAddList.vue | 25 +-
.../components/AreaDeviceAddModal.vue | 2 +-
.../iotManager/components/AreaDeviceList.vue | 45 +---
.../iotManager/components/AreaDeviceModal.vue | 4 +-
src/views/iotManager/components/AreaList.vue | 44 ++--
src/views/iotManager/components/LogModal.vue | 2 +-
.../components/OrgDeviceAddList.vue | 26 +-
.../components/OrgDeviceAddModal.vue | 2 +-
.../iotManager/components/OrgDeviceList.vue | 207 ----------------
.../iotManager/components/PreviewList.vue | 226 ++++++++++++++++++
.../{OrgDeviceModal.vue => PreviewModal.vue} | 11 +-
src/views/iotManager/index.vue | 71 +++++-
src/views/iotManager/manager.api.ts | 7 +
src/views/iotManager/manager.data.ts | 73 ++++--
15 files changed, 431 insertions(+), 349 deletions(-)
delete mode 100644 src/views/iotManager/components/OrgDeviceList.vue
create mode 100644 src/views/iotManager/components/PreviewList.vue
rename src/views/iotManager/components/{OrgDeviceModal.vue => PreviewModal.vue} (84%)
diff --git a/src/components/Form/src/jeecg/components/JDictSelectTag.vue b/src/components/Form/src/jeecg/components/JDictSelectTag.vue
index 74bb3bd..cd8717f 100644
--- a/src/components/Form/src/jeecg/components/JDictSelectTag.vue
+++ b/src/components/Form/src/jeecg/components/JDictSelectTag.vue
@@ -1,10 +1,10 @@
+ @change="handleChangeRadio">
+ :style="{ backgroundColor: `${useDicColor && item.color}` }">
{{ item.label }}
@@ -12,7 +12,7 @@
+ buttonStyle="solid" @change="handleChangeRadio">
{{ item.label }}
@@ -28,13 +28,14 @@
+ :getPopupContainer="getPopupContainer" :style="style" @change="handleChange">
请选择…
- {{ item.label }}{{ ignoreDisabled && item.disabled ? '(已停用)' : '' }}
+ :style="{ backgroundColor: `${useDicColor && item.color}` }" :title="item.label">
+ {{ item.label }}{{ ignoreDisabled && item.disabled ? '(已停用)' : ''
+ }}
@@ -76,9 +77,10 @@ export default defineComponent({
},
style: propTypes.any,
ignoreDisabled: propTypes.bool.def(false),
- orgCode:'',//组织机构编码 会切换数据源
+ orgCode: '',//组织机构编码 会切换数据源
+ showLabel: propTypes.bool.def(true)
},
- emits: ['options-change', 'change', 'update:value'],
+ emits: ['options-change', 'change', 'update:value', 'upDictCode', 'currentText'],
setup(props, { emit, refs }) {
const dictOptions = ref([]);
const attrs = useAttrs();
@@ -127,21 +129,25 @@ export default defineComponent({
async function initDictData() {
let { dictCode, stringToNumber } = props;
//根据字典Code, 初始化字典数组
- const dictData = await initDictOptions(dictCode,props.orgCode);
-
+ const dictData = await initDictOptions(dictCode, props.orgCode);
dictOptions.value = dictData.reduce((prev, next) => {
if (next) {
const value = next['value'];
- prev.push({
+ const value1 = {
label: next['text'] || next['label'],
value: stringToNumber ? +value : value,
disabled: next['status'] == 1,
color: next['color'],
...omit(next, ['text', 'value', 'color']),
- });
+ }
+ if(!props.showLabel&&next['status'] == 1){
+ }else{
+ prev.push(value1);
+ }
}
return prev;
}, []);
+ emit('upDictCode', dictOptions.value)
}
function handleChange(e) {
@@ -162,6 +168,11 @@ export default defineComponent({
}
} else {
changeValue = e?.target?.value ?? e;
+ if (!e) {
+ emit('currentText', null)
+ } else {
+ emit('currentText', dictOptions.value.filter(item => item.value == changeValue)[0].label)
+ }
}
state.value = changeValue;
diff --git a/src/views/iotManager/components/AreaDeviceAddList.vue b/src/views/iotManager/components/AreaDeviceAddList.vue
index 8ee21e6..4db9bc1 100644
--- a/src/views/iotManager/components/AreaDeviceAddList.vue
+++ b/src/views/iotManager/components/AreaDeviceAddList.vue
@@ -9,24 +9,15 @@
设备类型
-
- 摄像头
- 录像机
- 交换机
- 路由器
- 无线AP
- 智能电表
- 智能水表
- 温湿度计
-
+
-
- 在线状态
-
- 未分配
- 释放
+
+ 在线状态
+
+ 在线
+ 离线
@@ -78,6 +69,7 @@ import { useListPage } from '/@/hooks/system/useListPage';
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';
const formRef = ref();
const confirmLoading = ref(false);
@@ -103,7 +95,8 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
fixed: 'right',
},
beforeFetch: async (params) => {
- queryParam.dimension = '区域维度';
+ // queryParam.dimension = '区域维度';
+ queryParam.departId = departId.value;
return Object.assign(params, queryParam);
},
},
diff --git a/src/views/iotManager/components/AreaDeviceAddModal.vue b/src/views/iotManager/components/AreaDeviceAddModal.vue
index accc78f..48afbc4 100644
--- a/src/views/iotManager/components/AreaDeviceAddModal.vue
+++ b/src/views/iotManager/components/AreaDeviceAddModal.vue
@@ -16,7 +16,7 @@ import { ref, nextTick, defineExpose } from 'vue';
import AreaDeviceAddList from './AreaDeviceAddList.vue'
const title = ref('');
-const width = ref(1500);
+const width = ref(1200);
const visible = ref(false);
const disableSubmit = ref(false);
const registerForm = ref();
diff --git a/src/views/iotManager/components/AreaDeviceList.vue b/src/views/iotManager/components/AreaDeviceList.vue
index 395f134..4089ab8 100644
--- a/src/views/iotManager/components/AreaDeviceList.vue
+++ b/src/views/iotManager/components/AreaDeviceList.vue
@@ -5,28 +5,19 @@
-
-
- 区域名称
-
-
-
-
+
+
+
+
+
+
+
设备类型
-
- 摄像头
- 录像机
- 交换机
- 路由器
- 无线AP
- 智能电表
- 智能水表
- 温湿度计
-
+
-
+
在线状态
@@ -35,7 +26,7 @@
-
+
查询
@@ -51,7 +42,6 @@
- 添加区域设备
@@ -61,7 +51,6 @@
-
@@ -73,12 +62,11 @@ import { useListPage } from '/@/hooks/system/useListPage';
import { areaDeviceColumns } from '../manager.data';
import { deviceList } from '../manager.api';
import { useUserStore } from '/@/store/modules/user';
-import AreaDeviceAddModal from './AreaDeviceAddModal.vue';
import LogModal from './LogModal.vue';
+import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const formRef = ref();
const queryParam = reactive({});
-const registerDrawer = ref();
const logDrawer = ref();
const departId = ref('');
const nuId = ref('');
@@ -87,7 +75,7 @@ const userStore = useUserStore();
//注册table数据
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
- title: '设备管理',
+ title: '设备预览',
api: deviceList,
columns: areaDeviceColumns,
canResize: false,
@@ -99,6 +87,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
},
beforeFetch: async (params) => {
queryParam.dimension = '区域维度';
+ queryParam.departId = departId.value;
return Object.assign(params, queryParam);
},
},
@@ -134,14 +123,6 @@ function getTableAction(record) {
];
}
-/**
- * 设备管理
- */
-function handleAdd(){
- let record = { "departId" : departId.value,"nuId":nuId.value,"orgCode":orgCode.value };
- registerDrawer.value.disableSubmit = true;
- registerDrawer.value.edit(record);
-}
/**
* 设备日志
diff --git a/src/views/iotManager/components/AreaDeviceModal.vue b/src/views/iotManager/components/AreaDeviceModal.vue
index 9d0378d..fd97a55 100644
--- a/src/views/iotManager/components/AreaDeviceModal.vue
+++ b/src/views/iotManager/components/AreaDeviceModal.vue
@@ -16,7 +16,7 @@ import { ref, nextTick, defineExpose } from 'vue';
import AreaDeviceList from './AreaDeviceList.vue'
const title = ref('');
-const width = ref(1800);
+const width = ref(1200);
const visible = ref(false);
const disableSubmit = ref(false);
const registerForm = ref();
@@ -37,7 +37,7 @@ function add() {
* @param record
*/
function edit(record) {
- title.value = disableSubmit.value ? '设备管理' : '编辑';
+ title.value = disableSubmit.value ? '设备预览' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
diff --git a/src/views/iotManager/components/AreaList.vue b/src/views/iotManager/components/AreaList.vue
index a103f96..26a2eee 100644
--- a/src/views/iotManager/components/AreaList.vue
+++ b/src/views/iotManager/components/AreaList.vue
@@ -34,8 +34,6 @@
- 添加机构设备
- 机构解绑
@@ -45,7 +43,7 @@
-
+
@@ -58,14 +56,14 @@ import { nuColumns } from '../manager.data';
import { areaList,unbindOrg } from '../manager.api';
import { useUserStore } from '/@/store/modules/user';
import AreaDeviceModal from './AreaDeviceModal.vue';
-import OrgDeviceModal from './OrgDeviceModal.vue';
+import AreaDeviceAddModal from './AreaDeviceAddModal.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import {Modal} from "ant-design-vue";
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
const formRef = ref();
const queryParam = reactive({});
-const orgDrawer = ref();
+const areaAddDrawer = ref();
const areaDrawer = ref();
const orgCode = ref('');
const departId = ref('');
@@ -100,23 +98,6 @@ const wrapperCol = reactive({
sm: 16,
});
-function handleOrgUnbind(){
- let param = {"orgCode":orgCode.value};
- Modal.confirm({
- title: '机构解绑',
- width: '500px',
- icon: createVNode(ExclamationCircleOutlined),
- content: createVNode('div', { style: 'color:red;' }, '解除当前机构已绑定的所有设备,确定要解绑该机构吗?'),
- okText: '确定',
- onOk() {
- unbindOrg(param).then((res) => {}).catch(() =>{}).finally(() => {});
- },
- onCancel() {
- },
- class: 'test',
- });
-}
-
/**
* 成功回调
*/
@@ -130,25 +111,28 @@ function handleSuccess() {
function getTableAction(record) {
return [
{
- label: '设备管理',
+ label: '添加设备',
onClick: deviceManager.bind(null, record),
},
+ {
+ label: '设备预览',
+ onClick: handlePreview.bind(null, record),
+ },
];
}
/**
- * 设备管理
+ * 添加设备
*/
-function handleAdd(){
- let record = { "departId" : departId.value,"orgCode":orgCode.value };
- orgDrawer.value.disableSubmit = true;
- orgDrawer.value.edit(record);
+function deviceManager(record: Recordable){
+ areaAddDrawer.value.disableSubmit = true;
+ areaAddDrawer.value.edit(record);
}
/**
- * 设备管理
+ * 区域设备预览
*/
-function deviceManager(record: Recordable){
+function handlePreview(record: Recordable){
areaDrawer.value.disableSubmit = true;
areaDrawer.value.edit(record);
}
diff --git a/src/views/iotManager/components/LogModal.vue b/src/views/iotManager/components/LogModal.vue
index a4a6088..3782187 100644
--- a/src/views/iotManager/components/LogModal.vue
+++ b/src/views/iotManager/components/LogModal.vue
@@ -16,7 +16,7 @@ import { ref, nextTick, defineExpose } from 'vue';
import LogList from './LogList.vue'
const title = ref('');
-const width = ref(1800);
+const width = ref(1400);
const visible = ref(false);
const disableSubmit = ref(false);
const registerForm = ref();
diff --git a/src/views/iotManager/components/OrgDeviceAddList.vue b/src/views/iotManager/components/OrgDeviceAddList.vue
index 80b4e07..5193de0 100644
--- a/src/views/iotManager/components/OrgDeviceAddList.vue
+++ b/src/views/iotManager/components/OrgDeviceAddList.vue
@@ -9,24 +9,15 @@
设备类型
-
- 摄像头
- 录像机
- 交换机
- 路由器
- 无线AP
- 智能电表
- 智能水表
- 温湿度计
-
+
-
- 在线状态
-
- 未分配
- 释放
+
+ 在线状态
+
+ 在线
+ 离线
@@ -78,6 +69,7 @@ import { useListPage } from '/@/hooks/system/useListPage';
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';
const formRef = ref();
const confirmLoading = ref(false);
@@ -102,7 +94,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
fixed: 'right',
},
beforeFetch: async (params) => {
- queryParam.dimension = '机构维度';
+ // queryParam.dimension = '机构维度';
queryParam.departId = departId.value;
return Object.assign(params, queryParam);
},
@@ -180,7 +172,7 @@ function handleOk(){
//初始化
function init(record) {
- departId.value = record.departId;
+ departId.value = record.id;
orgCode.value = record.orgCode;
searchQuery();
}
diff --git a/src/views/iotManager/components/OrgDeviceAddModal.vue b/src/views/iotManager/components/OrgDeviceAddModal.vue
index 3153d47..fb5ec70 100644
--- a/src/views/iotManager/components/OrgDeviceAddModal.vue
+++ b/src/views/iotManager/components/OrgDeviceAddModal.vue
@@ -16,7 +16,7 @@ import { ref, nextTick, defineExpose } from 'vue';
import OrgDeviceAddList from './OrgDeviceAddList.vue'
const title = ref('');
-const width = ref(1500);
+const width = ref(1200);
const visible = ref(false);
const disableSubmit = ref(false);
const registerForm = ref();
diff --git a/src/views/iotManager/components/OrgDeviceList.vue b/src/views/iotManager/components/OrgDeviceList.vue
deleted file mode 100644
index 9500fe4..0000000
--- a/src/views/iotManager/components/OrgDeviceList.vue
+++ /dev/null
@@ -1,207 +0,0 @@
-
-
-
-
-
-
-
-
- 添加区域设备
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/iotManager/components/PreviewList.vue b/src/views/iotManager/components/PreviewList.vue
new file mode 100644
index 0000000..cf9a2c9
--- /dev/null
+++ b/src/views/iotManager/components/PreviewList.vue
@@ -0,0 +1,226 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iotManager/components/OrgDeviceModal.vue b/src/views/iotManager/components/PreviewModal.vue
similarity index 84%
rename from src/views/iotManager/components/OrgDeviceModal.vue
rename to src/views/iotManager/components/PreviewModal.vue
index a489451..316dd6c 100644
--- a/src/views/iotManager/components/OrgDeviceModal.vue
+++ b/src/views/iotManager/components/PreviewModal.vue
@@ -5,18 +5,18 @@
关闭
确认
-
-
+