From 23e2c087412f58bf56dae61789f02e42773ffb05 Mon Sep 17 00:00:00 2001 From: Fuyuu <1805498209@qq.com> Date: Fri, 29 Dec 2023 10:51:06 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E7=9B=91=E6=8E=A7=E6=A8=A1=E5=9E=8B=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=20=E6=9F=A5=E8=AF=A2=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2、将项目中相机、站点等选择树替换为限制场景的数据 --- .../modules/ai/aiModel/DtAiModelList.vue | 49 +- .../ai/cameraLinkage/DtCameraLinkageList.vue | 1 - .../DtCameraLinkgeSubInfo.data.ts | 278 ++++++------ .../components/DtCameraLinkgeSubInfoForm.vue | 143 ++++-- .../components/DtCameraLinkageModal.vue | 189 ++++---- .../ai/monitorModel/DtMonitorModelList.vue | 12 +- .../earthMap/camera/MsCameraSite.data.ts | 2 +- .../dataProtocol/DtDeviceDataProtocol.data.ts | 134 +++--- .../components/DtDeviceDataProtocolForm.vue | 130 +++--- .../components/DtDeviceDataProtocolModal.vue | 118 ++--- .../equipmentManage/info/DtDeviceInfo.data.ts | 428 ++++++++++-------- .../netProtocol/DtDeviceNetProtocol.data.ts | 126 +++--- .../cameraManage/CameraSetDemo.vue | 33 +- 13 files changed, 896 insertions(+), 747 deletions(-) diff --git a/src/views/military/modules/ai/aiModel/DtAiModelList.vue b/src/views/military/modules/ai/aiModel/DtAiModelList.vue index 37f1264..6e43325 100644 --- a/src/views/military/modules/ai/aiModel/DtAiModelList.vue +++ b/src/views/military/modules/ai/aiModel/DtAiModelList.vue @@ -9,7 +9,26 @@
- + + + + + + + + + + + + + + + 查询 + 重置 + + + +
@@ -64,7 +83,7 @@ import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DtAiModel.api'; import { downloadFile } from '/@/utils/common/renderUtils'; import DtAiModelModal from './components/DtAiModelModal.vue'; - + import { JInput } from '/@/components/Form'; const formRef = ref(); const queryParam = reactive({}); const toggleSearchStatus = ref(false); @@ -160,6 +179,10 @@ label: '编辑', onClick: handleEdit.bind(null, record), }, + { + label: '详情', + onClick: handleDetail.bind(null, record), + }, ]; } @@ -168,17 +191,17 @@ */ function getDropDownAction(record) { return [ - { - label: '详情', - onClick: handleDetail.bind(null, record), - }, - { - label: '删除', - popConfirm: { - title: '是否确认删除', - confirm: handleDelete.bind(null, record), - }, - }, + // { + // label: '详情', + // onClick: handleDetail.bind(null, record), + // }, + // { + // label: '删除', + // popConfirm: { + // title: '是否确认删除', + // confirm: handleDelete.bind(null, record), + // }, + // }, ]; } diff --git a/src/views/military/modules/ai/cameraLinkage/DtCameraLinkageList.vue b/src/views/military/modules/ai/cameraLinkage/DtCameraLinkageList.vue index bb0240a..78fe641 100644 --- a/src/views/military/modules/ai/cameraLinkage/DtCameraLinkageList.vue +++ b/src/views/military/modules/ai/cameraLinkage/DtCameraLinkageList.vue @@ -89,7 +89,6 @@ canResize: false, showTableSetting: true, formConfig: { - //labelWidth: 120, schemas: searchFormSchema, autoSubmitOnEnter: true, showAdvancedButton: false, diff --git a/src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/DtCameraLinkgeSubInfo.data.ts b/src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/DtCameraLinkgeSubInfo.data.ts index 4f4f07b..cb030c5 100644 --- a/src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/DtCameraLinkgeSubInfo.data.ts +++ b/src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/DtCameraLinkgeSubInfo.data.ts @@ -5,149 +5,149 @@ import { render } from '/@/utils/common/renderUtils'; import { log } from 'console'; //列表数据 export const columns: BasicColumn[] = [ - { - title: '相机名称', - align: "center", - dataIndex: 'cameraId_dictText' - }, - { - title: '联动类型', - align: "center", - dataIndex: 'linkageType_dictText', - width: 120 - }, - { - title: '执行序号', - align: "center", - dataIndex: 'linkageNo', - sorter: true, - width: 100 - }, - { - title: 'PTZ值', - align: "center", - dataIndex: 'ptz', - customRender: ({ text }) => { - console.log(text.length); - return text.length == 2 ? '无PTZ值' : text; - }, - }, - { - title: '预置位', - align: "center", - dataIndex: 'placements', - customRender: ({ text }) => { - console.log(text.length); - return text.length == 0 ? '无预置位' : text; - }, - }, - { - title: '停留时间/秒(s)', - align: "center", - dataIndex: 'sleepNumber' - } - // ,{ - // title: '备用1', - // align: "center", - // dataIndex: 'field1' - // }, - // { - // title: '备用2', - // align: "center", - // dataIndex: 'field2' - // }, - // { - // title: '备用3', - // align: "center", - // dataIndex: 'field3' - // }, - // { - // title: '所属区域', - // align: "center", - // dataIndex: 'sysAreaCode' - // }, - // { - // title: '所属单位', - // align: "center", - // dataIndex: 'sysUnitCode' - // }, + { + title: '相机名称', + align: 'center', + dataIndex: 'cameraId_dictText', + width: 190, + }, + { + title: '联动类型', + align: 'center', + dataIndex: 'linkageType_dictText', + width: 90, + }, + { + title: '执行序号', + align: 'center', + dataIndex: 'linkageNo', + sorter: true, + width: 100, + }, + { + title: 'PTZ值', + align: 'center', + dataIndex: 'ptz', + customRender: ({ text }) => { + return text.length == 2 ? '无PTZ值' : text; + }, + }, + { + title: '预置位', + align: 'center', + dataIndex: 'placements', + customRender: ({ text }) => { + return text.length == 0 ? '无预置位' : text; + }, + }, + { + title: '停留时间/秒(s)', + align: 'center', + dataIndex: 'sleepNumber', + width: 130, + }, + // ,{ + // title: '备用1', + // align: "center", + // dataIndex: 'field1' + // }, + // { + // title: '备用2', + // align: "center", + // dataIndex: 'field2' + // }, + // { + // title: '备用3', + // align: "center", + // dataIndex: 'field3' + // }, + // { + // title: '所属区域', + // align: "center", + // dataIndex: 'sysAreaCode' + // }, + // { + // title: '所属单位', + // align: "center", + // dataIndex: 'sysUnitCode' + // }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ - { - label: "联动编号", - field: 'linkageCode', - component: 'JInput', - colProps: { span: 6 } - } + { + label: '联动编号', + field: 'linkageCode', + component: 'JInput', + colProps: { span: 6 }, + }, ]; //表单数据 export const formSchema: FormSchema[] = [ - { - label: '联动id', - field: 'linkageId', - component: 'Input', - }, - { - label: '相机编号', - field: 'cameraId', - component: 'Input', - }, - { - label: '联动类型', - field: 'linkageType', - component: 'Input', - }, - { - label: '序号', - field: 'linkageNo', - component: 'Input', - }, - { - label: 'PTZ值', - field: 'ptz', - component: 'Input', - }, - { - label: '预置位', - field: 'placements', - component: 'Input', - }, - { - label: '停留时间', - field: 'sleepNumber', - component: 'Input', - }, - { - label: '备用1', - field: 'field1', - component: 'Input', - }, - { - label: '备用2', - field: 'field2', - component: 'Input', - }, - { - label: '备用3', - field: 'field3', - component: 'Input', - }, - // { - // label: '所属区域', - // field: 'sysAreaCode', - // component: 'Input', - // }, - // { - // label: '所属单位', - // field: 'sysUnitCode', - // component: 'Input', - // }, - // TODO 主键隐藏字段,目前写死为ID - { - label: '', - field: 'id', - component: 'Input', - show: false - }, + { + label: '联动id', + field: 'linkageId', + component: 'Input', + }, + { + label: '相机编号', + field: 'cameraId', + component: 'Input', + }, + { + label: '联动类型', + field: 'linkageType', + component: 'Input', + }, + { + label: '序号', + field: 'linkageNo', + component: 'Input', + }, + { + label: 'PTZ值', + field: 'ptz', + component: 'Input', + }, + { + label: '预置位', + field: 'placements', + component: 'Input', + }, + { + label: '停留时间', + field: 'sleepNumber', + component: 'Input', + }, + { + label: '备用1', + field: 'field1', + component: 'Input', + }, + { + label: '备用2', + field: 'field2', + component: 'Input', + }, + { + label: '备用3', + field: 'field3', + component: 'Input', + }, + // { + // label: '所属区域', + // field: 'sysAreaCode', + // component: 'Input', + // }, + // { + // label: '所属单位', + // field: 'sysUnitCode', + // component: 'Input', + // }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, ]; diff --git a/src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/components/DtCameraLinkgeSubInfoForm.vue b/src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/components/DtCameraLinkgeSubInfoForm.vue index 5227677..7e54fb1 100644 --- a/src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/components/DtCameraLinkgeSubInfoForm.vue +++ b/src/views/military/modules/ai/cameraLinkage/cameraLinkageSub/components/DtCameraLinkgeSubInfoForm.vue @@ -9,8 +9,7 @@ - - + @@ -21,7 +20,6 @@ - - 添加 @@ -56,8 +52,6 @@ - {} }, formBpm: { type: Boolean, default: true }, }); + // 当前登录用户信息 + const userStore = useUserStore().userInfo; + // 当前用户权限下的场景id + const sceneId = userStore?.sceneId; + /* 添加内容 */ + // 场景列表 + const sceneList: any = []; + // 防区列表 + const areaList: any = []; + // 站点列表 + const stationList: any = []; + // 相机列表 + const newCameraList: any = []; + // 获取当前场景及子场景信息 + function getCurrentScene() { + return defHttp.get( + { url: '/military/msMapScene/list', params: { sceneId: sceneId + '*', pageNo: 1, pageSize: 9999 } }, + { isTransformResponse: false } + ); + } + // 获取当前场景(包括其子场景)下的所有防区 + function getCurrentSceneArea() { + return defHttp.get({ url: '/military/msMapLine/list', params: { pageNo: 1, pageSize: 9999 } }, { isTransformResponse: false }); + } + // 获取当前防区下的所有站点 + function getCurrentAreaStation() { + return defHttp.get({ url: '/military/camera/site/list', params: { pageNo: 1, pageSize: 9999 } }, { isTransformResponse: false }); + } + // 获取当前站点下的所有相机 + function getCurrentStationCamera() { + return defHttp.get({ url: '/military/camera/setting/list', params: { pageNo: 1, pageSize: 9999 } }, { isTransformResponse: false }); + } + // 树状相机数据 + const nodeTree: any = ref([]); + // 获取相机列表树 + function getNodeTree() { + // 将数据转化为树状结构 + getCurrentScene().then((res) => { + sceneList.value = res.result.records; + getCurrentSceneArea().then((res1) => { + areaList.value = res1.result.records; + getCurrentAreaStation().then((res2) => { + stationList.value = res2.result.records; + getCurrentStationCamera().then((res3) => { + newCameraList.value = res3.result.records; + + // 定义一个空数组作为树状数组的根节点 + const tree: any = []; + //遍历场景列表,查找当前场景(及子场景)数据 + sceneList.value.forEach((row) => { + const node = { title: row.sceneName, value: row.sceneId, children: [] }; + tree.push(node); + }); + // 遍历防区列表,查找对应场景下的数据 + areaList.value.forEach((row) => { + const parentNode = tree.find((node) => node.value === row.sceneId); + if (parentNode) { + const node = { title: row.name, value: row.id, children: [] }; + parentNode.children.push(node); + } + }); + // 遍历站点列表,查找对应防区下的数据 + stationList.value.forEach((row) => { + const parentNodes = tree.map((node) => node.children).flat(); + const parentNode = parentNodes.find((node) => node.value === row.lineId); + if (parentNode) { + const node = { title: row.sitename, value: row.id, children: [] }; + parentNode.children.push(node); + } + }); + // 遍历相机列表,查找对应站点下的数据 + newCameraList.value.forEach((row) => { + // 筛选孙子节点 + const parentNodes = tree.flatMap((node) => node.children).flatMap((node) => node.children); + const parentNode = parentNodes.find((node) => node.value === row.siteId); + if (parentNode) { + const node = { title: row.cameraName, value: row.id, children: null }; + parentNode.children.push(node); + } + }); + // 转化为ant tree-select结构 + nodeTree.value = handleCameraTree(tree); + }); + }); + }); + }); + } + + /* 添加内容 */ const formRef = ref(); const useForm = Form.useForm; const emit = defineEmits(['register', 'ok']); @@ -139,54 +221,32 @@ linkageType: [{ required: true, message: '请选择联动类型!' }], linkageNo: [{ required: true, message: '请输入执行序号!' }], sleepNumber: [{ required: true, message: '请设置停留时间!' }], - // ptz: [{ required: true, message: '请设置PTZ值!' }], - // placements: [{ required: true, message: '请设置预置位!' }] }; onMounted(() => { - setSelectList(); + // 获取相机列表 + getNodeTree(); }); - function setSelectList() { - defHttp - .get( - { - url: '/military/camera/site/getSiteCameraInfo', - params: { pageNo: 1, pageSize: 9999 }, - }, - { isTransformResponse: false } - ) - // getAction(this.url.queryCameraSelectList, {pageNo: 1, pageSize: 9999}) - .then((res) => { - if (res.success) { - console.log(res.result); - cameraList.value = handleCameraTree(res.result); - } - }); - } + // 处理相机树状数据 function handleCameraTree(data, index = undefined) { let arr: any = []; for (let i = 0; i < data.length; i++) { let obj: any = {}; let item = data[i]; - obj.title = item.name; - obj.value = obj.key = item.id; - // obj.selectable = false; + obj.title = item.title; + obj.value = obj.key = item.value; + obj.disabled = item.children?.length >= 0 ? true : false; if (item.children && item.children.length > 0) { obj.children = []; - // obj.key = i + 1; let indexValue: any = index ? index + '-' + (i + 1) : i + 1; obj.children = handleCameraTree(item.children, indexValue); - } else { - // obj.key = index !== undefined ? index + '-' + (i + 1) : (i + 1) + ''; - // let tmp = (obj.key + '').split('-').length; - // obj.selectable = tmp >= 3; } - // obj.key = index !== undefined ? index + '-' + (i + 1) : (i + 1) + ''; arr.push(obj); } return arr; } const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true }); + // 添加PTZ项 function addPTZInput(P: any = null, T = null, Z = null) { formData.ptz.push({ P: P, @@ -194,12 +254,14 @@ Z: Z, }); } + // 移除PTZ项 const removePTZInput = (item: any) => { let index = formData.ptz.indexOf(item); if (index !== -1) { formData.ptz.splice(index, 1); } }; + // 初始化PTZ项 function init(record: any = null) { if (!record.ptz) return []; let arr = JSON.parse(record.ptz); @@ -211,7 +273,6 @@ arr['Z'] = parseFloat(element[2]); name.push(arr); }); - // names.value = name return name; } // 表单禁用 @@ -233,7 +294,6 @@ if (!val) { formData.placements = []; } else { - // console.log("formData.placements", formData.placements); if (!Array.isArray(formData.placements)) { let temp = formData.placements.split(','); temp = temp.filter((item) => { @@ -262,8 +322,6 @@ nextTick(() => { resetFields(); //赋值 - // console.log(record); - // console.log(formData); if (record.id) { record.ptz = init(record); } @@ -315,7 +373,6 @@ if (a.includes(NaN) || a.includes(null)) { throw Error(); } - // console.log(a); arr.push(a); }); model.ptz = JSON.stringify(arr); diff --git a/src/views/military/modules/ai/cameraLinkage/components/DtCameraLinkageModal.vue b/src/views/military/modules/ai/cameraLinkage/components/DtCameraLinkageModal.vue index c94d8dc..7198e7f 100644 --- a/src/views/military/modules/ai/cameraLinkage/components/DtCameraLinkageModal.vue +++ b/src/views/military/modules/ai/cameraLinkage/components/DtCameraLinkageModal.vue @@ -4,106 +4,119 @@ - + \ No newline at end of file + :deep(.ant-calendar-picker) { + width: 100%; + } + diff --git a/src/views/military/modules/ai/monitorModel/DtMonitorModelList.vue b/src/views/military/modules/ai/monitorModel/DtMonitorModelList.vue index ee20e9c..ba737aa 100644 --- a/src/views/military/modules/ai/monitorModel/DtMonitorModelList.vue +++ b/src/views/military/modules/ai/monitorModel/DtMonitorModelList.vue @@ -183,6 +183,10 @@ label: '编辑', onClick: handleEdit.bind(null, record), }, + { + label: '详情', + onClick: handleDetail.bind(null, record), + }, ]; } @@ -203,10 +207,10 @@ // label: '设置模型范围', // onClick: handleAreaTable.bind(null, record), // }, - { - label: '详情', - onClick: handleDetail.bind(null, record), - }, + // { + // label: '详情', + // onClick: handleDetail.bind(null, record), + // }, // { // label: '删除', // popConfirm: { diff --git a/src/views/military/modules/earthMap/camera/MsCameraSite.data.ts b/src/views/military/modules/earthMap/camera/MsCameraSite.data.ts index 25f95f5..c4120ff 100644 --- a/src/views/military/modules/earthMap/camera/MsCameraSite.data.ts +++ b/src/views/military/modules/earthMap/camera/MsCameraSite.data.ts @@ -19,7 +19,7 @@ export const columns: BasicColumn[] = [ dataIndex: 'sitecode', }, { - title: '点位名称', + title: '站点名称', align: "center", dataIndex: 'sitename' }, diff --git a/src/views/military/modules/equipmentManage/dataProtocol/DtDeviceDataProtocol.data.ts b/src/views/military/modules/equipmentManage/dataProtocol/DtDeviceDataProtocol.data.ts index 4904ccf..a8576ca 100644 --- a/src/views/military/modules/equipmentManage/dataProtocol/DtDeviceDataProtocol.data.ts +++ b/src/views/military/modules/equipmentManage/dataProtocol/DtDeviceDataProtocol.data.ts @@ -1,99 +1,101 @@ -import {BasicColumn} from '/@/components/Table'; -import {FormSchema} from '/@/components/Table'; -import { rules} from '/@/utils/helper/validator'; +/* + * @Author: Fuyuu 1805498209@qq.com + * @Date: 2023-12-20 15:41:22 + * @LastEditors: Fuyuu 1805498209@qq.com + * @LastEditTime: 2023-12-28 16:29:13 + * @FilePath: \dt-admin-pc-v2\src\views\military\modules\equipmentManage\protocolType\DtDeviceDataProtocol.data.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import { rules } from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; //列表数据 export const columns: BasicColumn[] = [ - { - title: '数据协议类型编号', - align:"center", - dataIndex: 'protocolType' - }, - { + { + title: '类型编号', + align: 'center', + dataIndex: 'protocolType', + }, + { title: '协议名称', - align:"center", - dataIndex: 'protocolName' - }, - { + align: 'center', + dataIndex: 'protocolName', + }, + { title: '备注', - align:"center", - dataIndex: 'remark' - }, - { - title: '所属区域', - align:"center", - dataIndex: 'sysAreaCode' - }, + align: 'center', + dataIndex: 'remark', + }, + // { + // title: '所属区域', + // align: 'center', + // dataIndex: 'sysAreaCode', + // }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ - { - label: "数据协议类型编号", - field: 'protocolType', - component: 'Input', - colProps: {span: 6}, - }, - { - label: "协议名称", - field: 'protocolName', - component: 'Input', - colProps: {span: 6}, - }, - { - label: "所属区域", - field: 'sysAreaCode', - component: 'Input', - colProps: {span: 6}, - }, + { + label: '类型编号', + field: 'protocolType', + component: 'Input', + colProps: { span: 6 }, + }, + { + label: '协议名称', + field: 'protocolName', + component: 'Input', + colProps: { span: 6 }, + }, + // { + // label: '所属区域', + // field: 'sysAreaCode', + // component: 'Input', + // colProps: { span: 6 }, + // }, ]; //表单数据 export const formSchema: FormSchema[] = [ { - label: '数据协议类型编号', + label: '类型编号', field: 'protocolType', component: 'Input', - dynamicRules: ({model,schema}) => { - return [ - { required: true, message: '请输入数据协议类型编号!'}, - ]; - }, + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '请输入类型编号!' }]; + }, }, { label: '协议名称', field: 'protocolName', component: 'Input', - dynamicRules: ({model,schema}) => { - return [ - { required: true, message: '请输入协议名称!'}, - ]; - }, + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '请输入协议名称!' }]; + }, }, { label: '备注', field: 'remark', component: 'Input', }, + // { + // label: '所属区域', + // field: 'sysAreaCode', + // component: 'Input', + // }, + // TODO 主键隐藏字段,目前写死为ID { - label: '所属区域', - field: 'sysAreaCode', + label: '', + field: 'id', component: 'Input', + show: false, }, - // TODO 主键隐藏字段,目前写死为ID - { - label: '', - field: 'id', - component: 'Input', - show: false - }, ]; - - /** -* 流程表单调用这个方法获取formSchema -* @param param -*/ -export function getBpmFormSchema(_formData): FormSchema[]{ + * 流程表单调用这个方法获取formSchema + * @param param + */ +export function getBpmFormSchema(_formData): FormSchema[] { // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema return formSchema; -} \ No newline at end of file +} diff --git a/src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolForm.vue b/src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolForm.vue index a242693..3f718f1 100644 --- a/src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolForm.vue +++ b/src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolForm.vue @@ -1,70 +1,78 @@ + \ No newline at end of file + async function submitForm() { + let data = getFieldsValue(); + let params = Object.assign({}, formData, data); + console.log('表单数据', params); + await saveOrUpdate(params, true); + } + + initFormData(); + + return { + registerForm, + formDisabled, + submitForm, + }; + }, + }); + diff --git a/src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolModal.vue b/src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolModal.vue index bd62da9..56f3c7c 100644 --- a/src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolModal.vue +++ b/src/views/military/modules/equipmentManage/dataProtocol/components/DtDeviceDataProtocolModal.vue @@ -1,66 +1,74 @@ + \ No newline at end of file + :deep(.ant-calendar-picker) { + width: 100%; + } + diff --git a/src/views/military/modules/equipmentManage/info/DtDeviceInfo.data.ts b/src/views/military/modules/equipmentManage/info/DtDeviceInfo.data.ts index 8cb2392..74324b6 100644 --- a/src/views/military/modules/equipmentManage/info/DtDeviceInfo.data.ts +++ b/src/views/military/modules/equipmentManage/info/DtDeviceInfo.data.ts @@ -2,147 +2,231 @@ import { BasicColumn } from '/@/components/Table'; import { FormSchema } from '/@/components/Table'; import { rules } from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; -import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types' +import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types'; +import { useUserStore } from '/@/store/modules/user'; +import { defHttp } from '/@/utils/http/axios'; +import { ref } from 'vue'; +// 获取当前权限下的场景id +const sceneId = useUserStore().userInfo?.sceneId; +// 场景列表 +const sceneList: any = []; +// 防区列表 +const areaList: any = []; +// 站点列表 +const stationList: any = []; +// 树状相机数据 +const nodeTree: any = ref([]); +// 获取当前场景及子场景信息 +function getCurrentScene() { + return defHttp.get( + { url: '/military/msMapScene/list', params: { sceneId: sceneId + '*', pageNo: 1, pageSize: 9999 } }, + { isTransformResponse: false } + ); +} +// 获取当前场景(包括其子场景)下的所有防区 +function getCurrentSceneArea() { + return defHttp.get({ url: '/military/msMapLine/list', params: { pageNo: 1, pageSize: 9999 } }, { isTransformResponse: false }); +} +// 获取当前防区下的所有站点 +function getCurrentAreaStation() { + return defHttp.get({ url: '/military/camera/site/list', params: { pageNo: 1, pageSize: 9999 } }, { isTransformResponse: false }); +} + +// 处理相机树状数据 +function handleCameraTree(data, index = undefined) { + let arr: any = []; + for (let i = 0; i < data.length; i++) { + let obj: any = {}; + let item = data[i]; + obj.label = item.title; + obj.value = obj.key = item.value; + obj.disabled = item.children?.length >= 0 ? true : false; + if (item.children && item.children.length > 0) { + obj.children = handleCameraTree(item.children); + } + arr.push(obj); + } + return arr; +} + +// 将数据转化为树状结构 +getCurrentScene().then((res) => { + sceneList.value = res.result.records; + getCurrentSceneArea().then((res1) => { + areaList.value = res1.result.records; + getCurrentAreaStation().then((res2) => { + stationList.value = res2.result.records; + + // 定义一个空数组作为树状数组的根节点 + const tree: any = []; + //遍历场景列表,查找当前场景(及子场景)数据 + sceneList.value.forEach((row) => { + const node = { title: row.sceneName, value: row.sceneId, children: [] }; + tree.push(node); + }); + // 遍历防区列表,查找对应场景下的数据 + areaList.value.forEach((row) => { + const parentNode = tree.find((node) => node.value === row.sceneId); + if (parentNode) { + const node = { title: row.name, value: row.id, children: [] }; + parentNode.children.push(node); + } + }); + // 遍历站点列表,查找对应防区下的数据 + stationList.value.forEach((row) => { + const parentNodes = tree.map((node) => node.children).flat(); + const parentNode = parentNodes.find((node) => node.value === row.lineId); + if (parentNode) { + const node = { title: row.sitename, value: row.id, children: null }; + parentNode.children.push(node); + } + }); + // 转化为ant tree-select结构 + nodeTree.value = handleCameraTree(tree); + }); + }); +}); + //列表数据 export const columns: BasicColumn[] = [ { title: '所属站点', - align: "center", - dataIndex: 'deviceOwnerId_dictText' + align: 'center', + dataIndex: 'deviceOwnerId_dictText', }, { - title: '类型', - align: "center", + title: '设备类型', + align: 'center', dataIndex: 'deviceType_dictText', - width: 120 + width: 120, }, { title: '设备编码', - align: "center", + align: 'center', dataIndex: 'deviceCode', - width: 120 + width: 120, }, { - title: '名称', - align: "center", - dataIndex: 'deviceName' + title: '设备名称', + align: 'center', + dataIndex: 'deviceName', }, { - title: '位置', - align: "center", - dataIndex: 'devicePosition' + title: '部署位置', + align: 'center', + dataIndex: 'devicePosition', }, { title: '经度', - align: "center", - dataIndex: 'deviceLon' + align: 'center', + dataIndex: 'deviceLon', }, { title: '纬度', - align: "center", - dataIndex: 'deviceLat' + align: 'center', + dataIndex: 'deviceLat', }, { title: '海拔', - align: "center", - dataIndex: 'deviceAlt' + align: 'center', + dataIndex: 'deviceAlt', }, { title: '设备状态', - align: "center", + align: 'center', dataIndex: 'deviceStatus_dictText', - width: 90 + width: 90, }, { title: '访问路径', - align: "center", - dataIndex: 'deviceUrl' + align: 'center', + dataIndex: 'deviceUrl', }, { title: '网络协议', - align: "center", - dataIndex: 'netProtocol' + align: 'center', + dataIndex: 'netProtocol_dictText', }, { - title:'数据协议', - align:"center", - dataIndex:"dataProtocol" + title: '数据协议', + align: 'center', + dataIndex: 'dataProtocol_dictText', }, { title: 'ip地址', - align: "center", - dataIndex: 'deviceIp' + align: 'center', + dataIndex: 'deviceIp', }, { title: '端口', - align: "center", - dataIndex: 'ipPort' + align: 'center', + dataIndex: 'ipPort', }, { title: '端口2', - align: "center", - dataIndex: 'ipPort2' + align: 'center', + dataIndex: 'ipPort2', }, { title: '入网许可证', - align: "center", + align: 'center', dataIndex: 'isAudit_dictText', - width: 120 + width: 120, }, { title: '用户名', - align: "center", - dataIndex: 'username' + align: 'center', + dataIndex: 'username', }, { title: '密码', - align: "center", - dataIndex: 'password' + align: 'center', + dataIndex: 'password', }, { title: '设备子类型', - align: "center", - dataIndex: 'subtype' + align: 'center', + dataIndex: 'subtype', }, { title: '安装高度', - align: "center", - dataIndex: 'deviceHeight' + align: 'center', + dataIndex: 'deviceHeight', }, { title: '初始方位角', - align: "center", - dataIndex: 'initAzimuth' + align: 'center', + dataIndex: 'initAzimuth', }, { title: '初始俯仰角', - align: "center", - dataIndex: 'initPitch' + align: 'center', + dataIndex: 'initPitch', }, { title: '工作半径', - align: "center", - dataIndex: 'workingRadius' + align: 'center', + dataIndex: 'workingRadius', }, { title: '水平视场角度', - align: "center", - dataIndex: 'horizontalAngle' + align: 'center', + dataIndex: 'horizontalAngle', }, { title: '垂直视场角度', - align: "center", - dataIndex: 'verticalAngle' + align: 'center', + dataIndex: 'verticalAngle', }, { title: '识别刻度', - align: "center", - dataIndex: 'identificationScale' + align: 'center', + dataIndex: 'identificationScale', }, { title: '备注', - align: "center", - dataIndex: 'remark' + align: 'center', + dataIndex: 'remark', }, // { @@ -154,32 +238,31 @@ export const columns: BasicColumn[] = [ //查询数据 export const searchFormSchema: FormSchema[] = [ { - label: "所属站点", + label: '所属站点', field: 'deviceOwnerId', - component: 'JDictSelectTag', - defaultValue: '00001-00001-00002', + component: 'TreeSelect', componentProps: { - dictCode: "ms_map_scene,scene_name,scene_id" + treeData: nodeTree, }, colProps: { span: 6 }, }, { - label: "设备类型", + label: '设备类型', field: 'deviceType', component: 'JDictSelectTag', componentProps: { - dictCode: "dt_deveice_type,type_name,type_no" + dictCode: 'dt_deveice_type,type_name,type_no', }, colProps: { span: 6 }, }, { - label: "设备编码", + label: '设备编码', field: 'deviceCode', component: 'Input', colProps: { span: 6 }, }, { - label: "设备名称", + label: '设备名称', field: 'deviceName', component: 'JInput', colProps: { span: 6 }, @@ -191,11 +274,11 @@ export const searchFormSchema: FormSchema[] = [ // colProps: {span: 6}, // }, { - label: "设备状态", + label: '设备状态', field: 'deviceStatus', component: 'JDictSelectTag', componentProps: { - dictCode: "dt_sensor_status" + dictCode: 'dt_sensor_status', }, colProps: { span: 6 }, }, @@ -212,81 +295,72 @@ export const searchFormSchema: FormSchema[] = [ // colProps: {span: 6}, // }, { - label: "数据协议", + label: '数据协议', field: 'protocol', component: 'JDictSelectTag', componentProps: { - dictCode: "dt_device_data_protocol,protocol_name,protocol_type" + dictCode: 'dt_device_data_protocol,protocol_name,protocol_type', }, colProps: { span: 6 }, }, { - label: "网络协议", + label: '网络协议', field: 'protocol', component: 'JDictSelectTag', componentProps: { - dictCode: "dt_device_net_protocol,protocol_name,protocol_type" + dictCode: 'dt_device_net_protocol,protocol_name,protocol_type', }, colProps: { span: 6 }, }, ]; + //表单数据 export const formSchema: FormSchema[] = [ { label: '所属站点', field: 'deviceOwnerId', - component: 'JDictSelectTag', + component: 'TreeSelect', componentProps: { - dictCode: "ms_map_scene,scene_name,scene_id" + treeData: nodeTree, }, dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '所属站点不能为空!' }, - ]; + return [{ required: true, message: '所属站点不能为空!' }]; }, }, { - label: '类型', + label: '设备类型', field: 'deviceType', component: 'JDictSelectTag', componentProps: { - dictCode: "dt_deveice_type,type_name,type_no", - stringToNumber: true + dictCode: 'dt_deveice_type,type_name,type_no', + stringToNumber: true, }, dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '类型不能为空!' }, - ]; + return [{ required: true, message: '设备类型不能为空!' }]; }, }, { - label: '编码', + label: '设备编码', field: 'deviceCode', component: 'Input', dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '编码不能为空!' }, - ]; + return [{ required: true, message: '设备编码不能为空!' }]; }, }, { - label: '名称', + label: '设备名称', field: 'deviceName', component: 'Input', dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '名称不能为空!' }, - ]; + return [{ required: true, message: '设备名称不能为空!' }]; }, }, { - label: '位置', + label: '部署位置', field: 'devicePosition', component: 'Input', dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '位置不能为空!' }, - ]; + return [{ required: true, message: '部署位置不能为空!' }]; }, }, { @@ -294,9 +368,7 @@ export const formSchema: FormSchema[] = [ field: 'deviceLon', component: 'InputNumber', dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '经度不能为空!' }, - ]; + return [{ required: true, message: '经度不能为空!' }]; }, }, { @@ -304,9 +376,7 @@ export const formSchema: FormSchema[] = [ field: 'deviceLat', component: 'InputNumber', dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '纬度不能为空!' }, - ]; + return [{ required: true, message: '纬度不能为空!' }]; }, }, { @@ -314,9 +384,7 @@ export const formSchema: FormSchema[] = [ field: 'deviceAlt', component: 'InputNumber', dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '海拔不能为空!' }, - ]; + return [{ required: true, message: '海拔不能为空!' }]; }, }, { @@ -324,13 +392,11 @@ export const formSchema: FormSchema[] = [ field: 'deviceStatus', component: 'JDictSelectTag', componentProps: { - dictCode: "dt_sensor_status", - stringToNumber: true + dictCode: 'dt_sensor_status', + stringToNumber: true, }, dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '设备状态不能为空!' }, - ]; + return [{ required: true, message: '设备状态不能为空!' }]; }, }, { @@ -338,27 +404,21 @@ export const formSchema: FormSchema[] = [ field: 'netProtocol', component: 'JDictSelectTag', componentProps: { - dictCode: "dt_device_net_protocol,protocol_name,protocol_type", - stringToNumber: true + dictCode: 'dt_device_net_protocol,protocol_name,protocol_type', }, dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '网络协议不能为空!' }, - ]; + return [{ required: true, message: '网络协议不能为空!' }]; }, }, { label: '数据协议', field: 'dataProtocol', component: 'JDictSelectTag', - componentProps:{ - dictCode:"dt_device_data_protocol,protocol_name,protocol_type", - stringToNumber: true + componentProps: { + dictCode: 'dt_device_data_protocol,protocol_name,protocol_type', }, dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '数据协议不能为空!' }, - ]; + return [{ required: true, message: '数据协议不能为空!' }]; }, }, { @@ -366,9 +426,7 @@ export const formSchema: FormSchema[] = [ field: 'deviceUrl', component: 'Input', dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '访问路径不能为空!' }, - ]; + return [{ required: true, message: '访问路径不能为空!' }]; }, }, { @@ -383,7 +441,7 @@ export const formSchema: FormSchema[] = [ { pattern: /^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$/, message: 'ip地址格式不正确!', - } + }, ], }, { @@ -398,7 +456,7 @@ export const formSchema: FormSchema[] = [ { pattern: /^([1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/, message: '端口格式不正确!', - } + }, ], }, { @@ -409,7 +467,7 @@ export const formSchema: FormSchema[] = [ { pattern: /^([1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/, message: '端口2格式不正确!', - } + }, ], }, { @@ -417,13 +475,11 @@ export const formSchema: FormSchema[] = [ field: 'isAudit', component: 'JDictSelectTag', componentProps: { - dictCode: "dt_is_audit", - stringToNumber: true + dictCode: 'dt_is_audit', + stringToNumber: true, }, dynamicRules: ({ model, schema }) => { - return [ - { required: true, message: '入网许可证不能为空!' }, - ]; + return [{ required: true, message: '入网许可证不能为空!' }]; }, }, { @@ -492,7 +548,7 @@ export const formSchema: FormSchema[] = [ label: '', field: 'id', component: 'Input', - show: false + show: false, }, ]; //子表单数据 @@ -505,53 +561,53 @@ export const dtDeviceSensorInfoColumns: BasicColumn[] = [ // }, { title: '传感器名称', - align: "center", - dataIndex: 'sensorName' + align: 'center', + dataIndex: 'sensorName', }, { title: '传感器编号', - align: "center", - dataIndex: 'sensorCode' + align: 'center', + dataIndex: 'sensorCode', }, { title: '状态', - align: "center", - dataIndex: 'sensorStatus' + align: 'center', + dataIndex: 'sensorStatus', }, { title: '经度', - align: "center", - dataIndex: 'sensorLon' + align: 'center', + dataIndex: 'sensorLon', }, { title: '维度', - align: "center", - dataIndex: 'sensorLat' + align: 'center', + dataIndex: 'sensorLat', }, { title: '地址编号例如01', - align: "center", - dataIndex: 'sensorAddress' + align: 'center', + dataIndex: 'sensorAddress', }, { title: '寄存器地址编号', - align: "center", - dataIndex: 'portId' + align: 'center', + dataIndex: 'portId', }, { title: '值', - align: "center", - dataIndex: 'sdata' + align: 'center', + dataIndex: 'sdata', }, { title: '备注', - align: "center", - dataIndex: 'remark' + align: 'center', + dataIndex: 'remark', }, { title: '所属区域', - align: "center", - dataIndex: 'sysAreaCode' + align: 'center', + dataIndex: 'sysAreaCode', }, ]; //子表列表数据 @@ -568,18 +624,18 @@ export const dtDeviceStatusColumns: BasicColumn[] = [ // }, { title: '设备初始状态', - align: "center", - dataIndex: 'status' + align: 'center', + dataIndex: 'status', }, { title: '状态补充说明', - align: "center", - dataIndex: 'remark' + align: 'center', + dataIndex: 'remark', }, { title: '所属区域', - align: "center", - dataIndex: 'sysAreaCode' + align: 'center', + dataIndex: 'sysAreaCode', }, ]; //子表表格配置 @@ -596,18 +652,16 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [ title: '传感器名称', key: 'sensorName', type: JVxeTypes.input, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', - validateRules: [ - { required: true, message: '${title}不能为空' }, - ], + validateRules: [{ required: true, message: '${title}不能为空' }], }, { title: '传感器编号', key: 'sensorCode', type: JVxeTypes.input, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, @@ -615,7 +669,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [ title: '状态', key: 'sensorStatus', type: JVxeTypes.inputNumber, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, @@ -623,7 +677,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [ title: '经度', key: 'sensorLon', type: JVxeTypes.inputNumber, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, @@ -631,7 +685,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [ title: '维度', key: 'sensorLat', type: JVxeTypes.inputNumber, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, @@ -639,7 +693,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [ title: '地址编号例如01', key: 'sensorAddress', type: JVxeTypes.input, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, @@ -647,7 +701,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [ title: '寄存器地址编号', key: 'portId', type: JVxeTypes.inputNumber, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, @@ -655,7 +709,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [ title: '值', key: 'sdata', type: JVxeTypes.inputNumber, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, @@ -663,7 +717,7 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [ title: '备注', key: 'remark', type: JVxeTypes.input, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, @@ -671,17 +725,17 @@ export const dtDeviceSensorInfoJVxeColumns: JVxeColumn[] = [ title: '所属区域', key: 'sysAreaCode', type: JVxeTypes.input, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, -] +]; export const dtDeviceStatusJVxeColumns: JVxeColumn[] = [ { title: '设备唯一标识', key: 'deviceId', type: JVxeTypes.input, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, @@ -689,29 +743,25 @@ export const dtDeviceStatusJVxeColumns: JVxeColumn[] = [ title: '所属站点ID', key: 'deviceOwnerId', type: JVxeTypes.inputNumber, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', - validateRules: [ - { required: true, message: '${title}不能为空' }, - ], + validateRules: [{ required: true, message: '${title}不能为空' }], }, { title: '设备初始状态', key: 'status', type: JVxeTypes.inputNumber, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', - validateRules: [ - { required: true, message: '${title}不能为空' }, - ], + validateRules: [{ required: true, message: '${title}不能为空' }], }, { title: '状态补充说明', key: 'remark', type: JVxeTypes.input, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, @@ -719,17 +769,17 @@ export const dtDeviceStatusJVxeColumns: JVxeColumn[] = [ title: '所属区域', key: 'sysAreaCode', type: JVxeTypes.input, - width: "200px", + width: '200px', placeholder: '请输入${title}', defaultValue: '', }, -] +]; /** -* 流程表单调用这个方法获取formSchema -* @param param -*/ + * 流程表单调用这个方法获取formSchema + * @param param + */ export function getBpmFormSchema(_formData): FormSchema[] { // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema return formSchema; -} \ No newline at end of file +} diff --git a/src/views/military/modules/equipmentManage/netProtocol/DtDeviceNetProtocol.data.ts b/src/views/military/modules/equipmentManage/netProtocol/DtDeviceNetProtocol.data.ts index 6d9f553..f876f62 100644 --- a/src/views/military/modules/equipmentManage/netProtocol/DtDeviceNetProtocol.data.ts +++ b/src/views/military/modules/equipmentManage/netProtocol/DtDeviceNetProtocol.data.ts @@ -1,99 +1,93 @@ -import {BasicColumn} from '/@/components/Table'; -import {FormSchema} from '/@/components/Table'; -import { rules} from '/@/utils/helper/validator'; +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import { rules } from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; //列表数据 export const columns: BasicColumn[] = [ - { - title: '网络协议类型编号', - align:"center", - dataIndex: 'protocolType' - }, - { + { + title: '类型编号', + align: 'center', + dataIndex: 'protocolType', + }, + { title: '协议名称', - align:"center", - dataIndex: 'protocolName' - }, - { + align: 'center', + dataIndex: 'protocolName', + }, + { title: '备注', - align:"center", - dataIndex: 'remark' - }, - { - title: '所属区域', - align:"center", - dataIndex: 'sysAreaCode' - }, + align: 'center', + dataIndex: 'remark', + }, + // { + // title: '所属区域', + // align: 'center', + // dataIndex: 'sysAreaCode', + // }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ - { - label: "网络协议类型编号", - field: 'protocolType', - component: 'Input', - colProps: {span: 6}, - }, - { - label: "协议名称", - field: 'protocolName', - component: 'Input', - colProps: {span: 6}, - }, - { - label: "所属区域", - field: 'sysAreaCode', - component: 'Input', - colProps: {span: 6}, - }, + { + label: '类型编号', + field: 'protocolType', + component: 'Input', + colProps: { span: 6 }, + }, + { + label: '协议名称', + field: 'protocolName', + component: 'Input', + colProps: { span: 6 }, + }, + // { + // label: '所属区域', + // field: 'sysAreaCode', + // component: 'Input', + // colProps: { span: 6 }, + // }, ]; //表单数据 export const formSchema: FormSchema[] = [ { - label: '网络协议类型编号', + label: '类型编号', field: 'protocolType', component: 'Input', - dynamicRules: ({model,schema}) => { - return [ - { required: true, message: '请输入网络协议类型编号!'}, - ]; - }, + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '请输入类型编号!' }]; + }, }, { label: '协议名称', field: 'protocolName', component: 'Input', - dynamicRules: ({model,schema}) => { - return [ - { required: true, message: '请输入协议名称!'}, - ]; - }, + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '请输入协议名称!' }]; + }, }, { label: '备注', field: 'remark', component: 'Input', }, + // { + // label: '所属区域', + // field: 'sysAreaCode', + // component: 'Input', + // }, + // TODO 主键隐藏字段,目前写死为ID { - label: '所属区域', - field: 'sysAreaCode', + label: '', + field: 'id', component: 'Input', + show: false, }, - // TODO 主键隐藏字段,目前写死为ID - { - label: '', - field: 'id', - component: 'Input', - show: false - }, ]; - - /** -* 流程表单调用这个方法获取formSchema -* @param param -*/ -export function getBpmFormSchema(_formData): FormSchema[]{ + * 流程表单调用这个方法获取formSchema + * @param param + */ +export function getBpmFormSchema(_formData): FormSchema[] { // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema return formSchema; -} \ No newline at end of file +} diff --git a/src/views/military/modules/equipmentManage/videoMonitorEquInfo/cameraManage/CameraSetDemo.vue b/src/views/military/modules/equipmentManage/videoMonitorEquInfo/cameraManage/CameraSetDemo.vue index 06b365a..8a34345 100644 --- a/src/views/military/modules/equipmentManage/videoMonitorEquInfo/cameraManage/CameraSetDemo.vue +++ b/src/views/military/modules/equipmentManage/videoMonitorEquInfo/cameraManage/CameraSetDemo.vue @@ -8,7 +8,7 @@

相机列表 - +

@@ -628,7 +628,6 @@ let user = cameraForm.value.user; let password = cameraForm.value.password; let height = cameraForm.value.height; - let videoRecorderId = cameraForm.value.videoRecorderId; let type = cameraForm.value.type; let factory = cameraForm.value.factory; let leftAngle = cameraForm.value.leftAngle; @@ -750,8 +749,13 @@ // 添加或编辑完成 if (res.success) { createMessage.success(success_message); - // 重新赋值表单 - cameraForm.value = res.result; + // 若为添加成功,则清空表单 + if (!cameraForm.value.id) { + fromClear(); + } else { + // 重新赋值表单 + cameraForm.value = res.result; + } // 重新获取相机 getNodeTree(); } else { @@ -1034,23 +1038,10 @@ // 刷新列表 function reNew() { reNewBtn.value.spin = true; - defHttp - .get( - { - url: url.value.getVMCameraInfo, - }, - { isTransformResponse: false } - ) - .then((res) => { - if (res.success) { - createMessage.success('相机列表更新成功!'); - } else { - createMessage.error(res.message); - } - getNodeTree(); - getVideoRecorderArr(); - reNewBtn.value.spin = false; - }); + // 重新获取相机 + getNodeTree(); + // 刷新成功 + createMessage.success('刷新成功'); } defineExpose({