diff --git a/src/components/Form/src/jeecg/components/JDictSelectTag.vue b/src/components/Form/src/jeecg/components/JDictSelectTag.vue index e6d1b8e..91972b9 100644 --- a/src/components/Form/src/jeecg/components/JDictSelectTag.vue +++ b/src/components/Form/src/jeecg/components/JDictSelectTag.vue @@ -150,7 +150,7 @@ const { mode } = unref(getBindValue); let changeValue:any; // 兼容多选模式 - + //update-begin---author:wangshuai ---date:20230216 for:[QQYUN-4290]公文发文:选择机关代字报错,是因为值改变触发了change事件三次,导致数据发生改变------------ //采用一个值,不然的话state值变换触发多个change if (mode === 'multiple') { @@ -171,7 +171,7 @@ emit('update:value',changeValue) //update-end---author:wangshuai ---date:20230403 for:【issues/4507】JDictSelectTag组件使用时,浏览器给出警告提示:Expected Function, got Array述------------ //update-end---author:wangshuai ---date:20230216 for:[QQYUN-4290]公文发文:选择机关代字报错,是因为值改变触发了change事件三次,导致数据发生改变------------ - + // nextTick(() => formItemContext.onFieldChange()); } diff --git a/src/views/appmana/deploy/SurvDeviceDeploy.api.ts b/src/views/appmana/deploy/SurvDeviceDeploy.api.ts index 08b65c6..799f48e 100644 --- a/src/views/appmana/deploy/SurvDeviceDeploy.api.ts +++ b/src/views/appmana/deploy/SurvDeviceDeploy.api.ts @@ -21,6 +21,8 @@ enum Api { cameraStopApi = '/appmana/survDeviceDeploy/cameraStop', getDeviceCateList = '/appmana/fDictDeviceCate/getDeviceCateList', getDeviceList='/appmana/survDeviceDeploy/getDeviceList', + syncRelays = '/api/farm/fDeviceDeployRelay/syncRelays', + getRelayList = '/appmana/survDeviceDeploy/getRelayList', } /** @@ -179,3 +181,33 @@ export const getDeviceCateList = (params) => defHttp.get({ url: Api.getDeviceCat * @param params */ export const getDeviceList = (params) => defHttp.post({ url: Api.getDeviceList, params }); + +/** + * 继电器同步 + * @param params + * @param handleSuccess + */ +export const relaySync = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认同步', + content: '该操作会删除所有当前已绑定继电器,是否继续', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.post({url: Api.syncRelays, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} + + +/** + * 获取继电器列表 + * @param params + * @param isUpdate + */ +export const getRelayList = (params) => { + return defHttp.get({ url: Api.getRelayList,params}, { isTransformResponse: false }); +} diff --git a/src/views/appmana/deploy/SurvDeviceDeployList.vue b/src/views/appmana/deploy/SurvDeviceDeployList.vue index 448cd62..7f847d9 100644 --- a/src/views/appmana/deploy/SurvDeviceDeployList.vue +++ b/src/views/appmana/deploy/SurvDeviceDeployList.vue @@ -99,7 +99,9 @@ - + + + @@ -108,7 +110,7 @@ import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { useListPage } from '/@/hooks/system/useListPage'; import { columns } from './SurvDeviceDeploy.data'; - import { list, deleteOne, batchDelete, getImportUrl, getExportUrl,deviceInit,getDeviceCateList} from './SurvDeviceDeploy.api'; + import { list, deleteOne, batchDelete, getImportUrl, getExportUrl,deviceInit,getDeviceCateList,relaySync} from './SurvDeviceDeploy.api'; import { downloadFile } from '/@/utils/common/renderUtils'; import SurvDeviceDeployModal from './components/SurvDeviceDeployModal.vue' import ControlModal from './components/ControlModal.vue' @@ -116,7 +118,8 @@ import { getStationList } from '../station/SurvStationInfo.api' import { useDrawer } from '/@/components/Drawer'; import ZhiBiaoList from './components/ZhiBiaoList.vue'; - + import SetupList from './components/SetupList.vue'; + import RelayGroupList from './components/RelayGroupList.vue'; //指标drawer const [registerDrawer, { openDrawer }] = useDrawer(); @@ -126,6 +129,8 @@ const registerModal = ref(); const qiuFaModal = ref(); const open = ref(false); + const [registerSetupDrawer, { openDrawer: openDrawerSetup }] = useDrawer(); + const [registerGroupDrawer, { openDrawer: openDrawerGroup }] = useDrawer(); //注册table数据 const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ @@ -224,7 +229,7 @@ function handleControl(record) { qiuFaModal.value.disableSubmit = false; qiuFaModal.value.showup({ - deployCode: record.deployCode, + deployId: record.id, }); } @@ -294,6 +299,56 @@ } ] } + else if(record.deployType == 'control_cab' ){ + return [ + { + label: '继电器同步', + onClick: handleRelay.bind(null, record), + }, + { + label: '继电器分组', + onClick: handleRelayGroup.bind(null, record), + }, + { + label: '详情', + onClick: handleDetail.bind(null, record), + }, { + label: '删除', + popConfirm: { + title: '是否确认删除', + placement: "leftBottom", + confirm: handleDelete.bind(null, record), + } + } + ] + } + else if(record.deployType =="water_orient" || record.deployType =="water_live"){ + return [ + { + label: '控制配置', + onClick: handleRelayDetail.bind(null, record), + }, + // { + // label: '继电器同步', + // onClick: handleRelay.bind(null, record), + // }, + { + label: '继电器分组', + onClick: handleRelayGroup.bind(null, record), + }, + { + label: '详情', + onClick: handleDetail.bind(null, record), + }, { + label: '删除', + popConfirm: { + title: '是否确认删除', + placement: "leftBottom", + confirm: handleDelete.bind(null, record), + } + } + ] + } else{ return [ { @@ -311,6 +366,31 @@ } + /** + * 继电器明细 + */ + async function handleRelayDetail(record: Recordable) { + openDrawerSetup(true, { + id: record.id, + }); + } + + /** + * 继电器分组 + */ + async function handleRelayGroup(record: Recordable) { + openDrawerGroup(true, { + id: record.id, + }); + } + + /** + * 继电器同步 + */ + async function handleRelay(record: Recordable) { + await relaySync({ ids: record.id }, handleSuccess); + } + /** * 查询 */ diff --git a/src/views/appmana/deploy/components/ControlModal.vue b/src/views/appmana/deploy/components/ControlModal.vue index bbf3997..42061c7 100644 --- a/src/views/appmana/deploy/components/ControlModal.vue +++ b/src/views/appmana/deploy/components/ControlModal.vue @@ -1,6 +1,6 @@