From d518ff607fa203ba3620689deb740cdd7f7d33ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com>
Date: Tue, 11 Nov 2025 08:47:03 +0800
Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=81=94bug=E5=A4=84=E7=90=86?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/iot/tplink/camera/index.vue | 53 ++--
src/views/iot/tq/config/config.data.ts | 22 ++
src/views/iot/weihu/components/Reamrks.api.ts | 54 ++++
.../iot/weihu/components/Reamrks.data.ts | 62 +++++
.../iot/weihu/components/ReamrksFormModal.vue | 77 ++++++
.../iot/weihu/components/ReamrksListModal.vue | 76 ++++++
.../iot/weihu/components/RemarksForm.vue | 154 +++++++++++
.../iot/weihu/components/RemarksList.vue | 255 ++++++++++++++++++
src/views/iot/weihu/index.vue | 46 ++--
9 files changed, 761 insertions(+), 38 deletions(-)
create mode 100644 src/views/iot/weihu/components/Reamrks.api.ts
create mode 100644 src/views/iot/weihu/components/Reamrks.data.ts
create mode 100644 src/views/iot/weihu/components/ReamrksFormModal.vue
create mode 100644 src/views/iot/weihu/components/ReamrksListModal.vue
create mode 100644 src/views/iot/weihu/components/RemarksForm.vue
create mode 100644 src/views/iot/weihu/components/RemarksList.vue
diff --git a/src/views/iot/tplink/camera/index.vue b/src/views/iot/tplink/camera/index.vue
index d6cf7fe..181afa3 100644
--- a/src/views/iot/tplink/camera/index.vue
+++ b/src/views/iot/tplink/camera/index.vue
@@ -74,7 +74,7 @@ import {ref, reactive, createVNode, h, onMounted, watch, unref,nextTick} from 'v
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from './camera.data';
-import {list, syncAllDevices} from './camera.api';
+import {getImageCommon, list, syncAllDevices} from './camera.api';
import { useUserStore } from '/@/store/modules/user';
import { useDrawer } from "@/components/Drawer";
import { useRouter } from 'vue-router';
@@ -140,11 +140,18 @@ function handleEdit(record: Recordable) {
* 预览
*/
function handlePreview(record: Recordable) {
- nextTick(()=>{
- previewModal.value.disableSubmit = true;
- previewModal.value.edit(record);
- })
-
+ if (record.deviceIndex == null) {
+ return
+ }
+ getImageCommon({
+ "deviceIndex": record.deviceIndex,
+ "type": "switch"
+ }).then(res => {
+ previewModal.value.disableSubmit = true;
+ previewModal.value.edit(record);
+ }).catch(res=>{
+ reload();
+ });
}
/**
@@ -158,19 +165,29 @@ function handleSuccess() {
* 画面配置
*/
function handlePicConfig(record) {
- var params = {
- deviceIndex: record.deviceIndex,
- deviceName: record.deviceName,
- parentId: record.parentId,
- multitrans: record.multitrans,
- projectId: record.projectId,
- regionId: record.regionId,
- ip: record.ip
+ if (record.deviceIndex == null) {
+ return
}
- nextTick(()=>{
- cameraPictureConfigModal.value.disableSubmit = true;
- cameraPictureConfigModal.value.edit(params);
- })
+ getImageCommon({
+ "deviceIndex": record.deviceIndex,
+ "type": "switch"
+ }).then(res => {
+ var params = {
+ deviceIndex: record.deviceIndex,
+ deviceName: record.deviceName,
+ parentId: record.parentId,
+ multitrans: record.multitrans,
+ projectId: record.projectId,
+ regionId: record.regionId,
+ ip: record.ip
+ }
+ nextTick(()=>{
+ cameraPictureConfigModal.value.disableSubmit = true;
+ cameraPictureConfigModal.value.edit(params);
+ })
+ }).catch(res=>{
+ reload();
+ });
}
/**
diff --git a/src/views/iot/tq/config/config.data.ts b/src/views/iot/tq/config/config.data.ts
index 2302992..f346f48 100644
--- a/src/views/iot/tq/config/config.data.ts
+++ b/src/views/iot/tq/config/config.data.ts
@@ -3,6 +3,15 @@ import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
+ {
+ title: '平台标识',
+ align: "center",
+ dataIndex: 'sysFlag',
+ width: 80,
+ customRender:({record}) =>{
+ return record.sysFlag?(record.sysFlag=='0'?'运维平台':'业务平台'):'';
+ }
+ },
{
title: '机构编码',
align: "center",
@@ -52,6 +61,19 @@ export const formSchema: FormSchema[] = [
component: 'Input',
show: false,
},
+ {
+ label: '平台标识',
+ field: 'sysFlag',
+ component: 'Select',
+ componentProps: {
+ options: [
+ {label:'运维平台',value:'0'},
+ {label:'业务平台',value:'1'},
+ ]
+ },
+ defaultValue: '1',
+ required: true
+ },
{
label: '机构',
field: 'orgCode',
diff --git a/src/views/iot/weihu/components/Reamrks.api.ts b/src/views/iot/weihu/components/Reamrks.api.ts
new file mode 100644
index 0000000..69207a4
--- /dev/null
+++ b/src/views/iot/weihu/components/Reamrks.api.ts
@@ -0,0 +1,54 @@
+import {defHttp} from '/@/utils/http/axios';
+import { useMessage } from "/@/hooks/web/useMessage";
+
+const { createConfirm } = useMessage();
+
+enum Api {
+ list = '/iot/weihu/deviceMaintain/remarksList',
+ save='/iot/weihu/deviceMaintain/add',
+ edit='/iot/weihu/deviceMaintain/edit',
+ deleteOne = '/iot/weihu/deviceMaintain/delete',
+ deleteBatch = '/iot/weihu/deviceMaintain/deleteBatch',
+}
+
+/**
+ * 列表接口
+ * @param params
+ */
+export const list = (params) =>
+ defHttp.get({url: Api.list, params});
+
+/**
+ * 删除单个
+ */
+export const deleteOne = (params,handleSuccess) => {
+ return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
+ handleSuccess();
+ });
+}
+/**
+ * 批量删除
+ * @param params
+ */
+export const batchDelete = (params, handleSuccess) => {
+ createConfirm({
+ iconType: 'warning',
+ title: '确认删除',
+ content: '是否删除选中数据',
+ okText: '确认',
+ cancelText: '取消',
+ onOk: () => {
+ return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
+ handleSuccess();
+ });
+ }
+ });
+}
+/**
+ * 保存或者更新
+ * @param params
+ */
+export const saveOrUpdate = (params, isUpdate) => {
+ let url = isUpdate ? Api.edit : Api.save;
+ return defHttp.post({url: url, params}, { isTransformResponse: false });
+}
diff --git a/src/views/iot/weihu/components/Reamrks.data.ts b/src/views/iot/weihu/components/Reamrks.data.ts
new file mode 100644
index 0000000..54b6a46
--- /dev/null
+++ b/src/views/iot/weihu/components/Reamrks.data.ts
@@ -0,0 +1,62 @@
+import {BasicColumn} from '/@/components/Table';
+import {FormSchema} from '/@/components/Table';
+import { rules} from '/@/utils/helper/validator';
+import { render } from '/@/utils/common/renderUtils';
+import { getWeekMonthQuarterYear } from '/@/utils';
+//列表数据
+export const columns: BasicColumn[] = [
+ {
+ title: '设备类型',
+ align: "center",
+ dataIndex: 'type'
+ },
+ {
+ title: '设备编码',
+ align: "center",
+ dataIndex: 'deviceId'
+ },
+ {
+ title: 'SN',
+ align: "center",
+ dataIndex: 'sn'
+ },
+ {
+ title: '发往机构名',
+ align: "center",
+ dataIndex: 'reserveDepartName'
+ },
+ {
+ title: '更新时间',
+ align:"center",
+ dataIndex: 'updateDate',
+ width: 160
+ },
+ {
+ title: '备注',
+ align:"center",
+ dataIndex: 'remark'
+ },
+];
+//查询数据
+export const searchFormSchema: FormSchema[] = [
+ {
+ label: '删除',
+ field: 'delFlag',
+ component: 'Select',
+ componentProps: {
+ options: [
+ {
+ label: '正常',
+ value: '0',
+ key: '0',
+ },
+ {
+ label: '删除',
+ value: '1',
+ key: '1',
+ },
+ ],
+ },
+ colProps: { span: 6 },
+ },
+];
diff --git a/src/views/iot/weihu/components/ReamrksFormModal.vue b/src/views/iot/weihu/components/ReamrksFormModal.vue
new file mode 100644
index 0000000..e94a817
--- /dev/null
+++ b/src/views/iot/weihu/components/ReamrksFormModal.vue
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/weihu/components/ReamrksListModal.vue b/src/views/iot/weihu/components/ReamrksListModal.vue
new file mode 100644
index 0000000..9540306
--- /dev/null
+++ b/src/views/iot/weihu/components/ReamrksListModal.vue
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/weihu/components/RemarksForm.vue b/src/views/iot/weihu/components/RemarksForm.vue
new file mode 100644
index 0000000..3c5c79a
--- /dev/null
+++ b/src/views/iot/weihu/components/RemarksForm.vue
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/weihu/components/RemarksList.vue b/src/views/iot/weihu/components/RemarksList.vue
new file mode 100644
index 0000000..d7cd067
--- /dev/null
+++ b/src/views/iot/weihu/components/RemarksList.vue
@@ -0,0 +1,255 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+ 删除
+
+
+
+ 批量操作
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/weihu/index.vue b/src/views/iot/weihu/index.vue
index 20bb178..d7a6d67 100644
--- a/src/views/iot/weihu/index.vue
+++ b/src/views/iot/weihu/index.vue
@@ -27,6 +27,7 @@
+
@@ -38,11 +39,11 @@ import {onMounted, reactive, ref} from 'vue';
import { columns, searchFormSchema } from './weihu.data';
import { useDrawer } from "@/components/Drawer";
import SendOrgDrawer from './components/SendOrgDrawer.vue';
-
+ import ReamrksListModal from './components/ReamrksListModal.vue'
const [registerDrawer, { openDrawer }] = useDrawer();
const queryParam = reactive({});
const selectedRows = ref([]);
-
+ const remarksModal = ref();
//注册table数据
const { prefixCls,tableContext } = useListPage({
tableProps:{
@@ -89,31 +90,36 @@ import {onMounted, reactive, ref} from 'vue';
(selectedRowKeys.value = []) && reload();
}
+// function handleDetail(record){
+// let records = [];
+// records.push(record);
+// openDrawer(true, {
+// records : records,
+// isUpdate: true,
+// showFooter: false,
+// tenantSaas: false,
+// });
+// }
+
function handleDetail(record){
- let records = [];
- records.push(record);
- openDrawer(true, {
- records : records,
- isUpdate: true,
- showFooter: false,
- tenantSaas: false,
- });
+ remarksModal.value.disableSubmit = true;
+ remarksModal.value.edit(record)
}
/**
* 操作栏
*/
function getTableAction(record){
- const actions = [];
- if(record.reserveDepartId){
- actions.push({
- label: '详情',
- onClick: () => {
- handleDetail(record);
- }
- });
- }
- return actions;
+ return [
+ // {
+ // label: '备注',
+ // onClick: handleDetail.bind(null, record),
+ // },
+ {
+ label: '备注',
+ onClick: handleDetail.bind(null, record),
+ },
+ ];
}
const departInfos = ref();