diff --git a/src/main.ts b/src/main.ts index 32231b8..c861efe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -83,10 +83,10 @@ async function bootstrap(props?: MainAppProps) { setupErrorHandle(app); // 注册第三方组件 - // await registerThirdComp(app); + await registerThirdComp(app); // 当路由准备好时再执行挂载( https://next.router.vuejs.org/api/#isready) - // await router.isReady(); + await router.isReady(); // 挂载应用 app.mount(getMountContainer(props), true); diff --git a/src/views/deviceSync/IotDeviceContent/IotDeviceContent.api.ts b/src/views/deviceSync/IotDeviceContent/IotDeviceContent.api.ts new file mode 100644 index 0000000..c045291 --- /dev/null +++ b/src/views/deviceSync/IotDeviceContent/IotDeviceContent.api.ts @@ -0,0 +1,72 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/IotDeviceContent/iotDeviceContent/list', + save='/IotDeviceContent/iotDeviceContent/add', + edit='/IotDeviceContent/iotDeviceContent/edit', + deleteOne = '/IotDeviceContent/iotDeviceContent/delete', + deleteBatch = '/IotDeviceContent/iotDeviceContent/deleteBatch', + importExcel = '/IotDeviceContent/iotDeviceContent/importExcel', + exportXls = '/IotDeviceContent/iotDeviceContent/exportXls', +} + +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; + +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; + +/** + * 列表接口 + * @param params + */ +export const list = (params) => defHttp.get({ url: Api.list, params }); + +/** + * 删除单个 + * @param params + * @param handleSuccess + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} + +/** + * 批量删除 + * @param params + * @param handleSuccess + */ +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 + * @param isUpdate + */ +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/deviceSync/IotDeviceContent/IotDeviceContent.data.ts b/src/views/deviceSync/IotDeviceContent/IotDeviceContent.data.ts new file mode 100644 index 0000000..82cbce4 --- /dev/null +++ b/src/views/deviceSync/IotDeviceContent/IotDeviceContent.data.ts @@ -0,0 +1,37 @@ +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: 'orgCode' + // }, + { + title: '备注信息', + align: "center", + dataIndex: 'content' + }, + { + title: '创建日期', + align: "center", + dataIndex: 'createTime', + width: 160, + }, + // { + // title: 'NUID', + // align: "center", + // dataIndex: 'nuId' + // }, +]; + +// 高级查询数据 +export const superQuerySchema = { + orgCode: {title: '机构编码',order: 0,view: 'text', type: 'string',}, + content: {title: '备注信息',order: 1,view: 'text', type: 'string',}, + filePath: {title: '附件信息',order: 2,view: 'text', type: 'string',}, + nuId: {title: 'NUID',order: 3,view: 'text', type: 'string',}, +}; diff --git a/src/views/deviceSync/IotDeviceContent/IotDeviceContentList.vue b/src/views/deviceSync/IotDeviceContent/IotDeviceContentList.vue new file mode 100644 index 0000000..b0f187a --- /dev/null +++ b/src/views/deviceSync/IotDeviceContent/IotDeviceContentList.vue @@ -0,0 +1,224 @@ + + + + + diff --git a/src/views/deviceSync/IotDeviceContent/IotDeviceContentListModal.vue b/src/views/deviceSync/IotDeviceContent/IotDeviceContentListModal.vue new file mode 100644 index 0000000..005598f --- /dev/null +++ b/src/views/deviceSync/IotDeviceContent/IotDeviceContentListModal.vue @@ -0,0 +1,82 @@ + + + + + + diff --git a/src/views/deviceSync/IotDeviceContent/components/IotDeviceContentForm.vue b/src/views/deviceSync/IotDeviceContent/components/IotDeviceContentForm.vue new file mode 100644 index 0000000..91e9c50 --- /dev/null +++ b/src/views/deviceSync/IotDeviceContent/components/IotDeviceContentForm.vue @@ -0,0 +1,163 @@ + + + + + diff --git a/src/views/deviceSync/IotDeviceContent/components/IotDeviceContentModal.vue b/src/views/deviceSync/IotDeviceContent/components/IotDeviceContentModal.vue new file mode 100644 index 0000000..c962ffa --- /dev/null +++ b/src/views/deviceSync/IotDeviceContent/components/IotDeviceContentModal.vue @@ -0,0 +1,83 @@ + + + + + + diff --git a/src/views/deviceSync/compoents/DbList.vue b/src/views/deviceSync/compoents/DbList.vue index 40237c4..ee3c590 100644 --- a/src/views/deviceSync/compoents/DbList.vue +++ b/src/views/deviceSync/compoents/DbList.vue @@ -14,7 +14,7 @@ - NUID: {{item.nuId?item.nuId:'未配置'}} + NUID: {{item.nuId?item.nuId:'未配置'}} 用电量:{{item.eleValue?item.eleValue:'0.0'}}KWH diff --git a/src/views/deviceSync/compoents/DevicesForm.vue b/src/views/deviceSync/compoents/DevicesForm.vue index bb64fef..4b2f0b9 100644 --- a/src/views/deviceSync/compoents/DevicesForm.vue +++ b/src/views/deviceSync/compoents/DevicesForm.vue @@ -6,8 +6,8 @@ 电表 水表 温湿度计 - 同步 - 日志 + 同步 + 日志 @@ -22,6 +22,7 @@ + @@ -32,7 +33,7 @@ import { useMessage } from '/@/hooks/web/useMessage'; import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import { getValueType } from '/@/utils'; import { addNuIot } from '../DeviceSync.api'; -import { Form } from 'ant-design-vue'; +import { Form,Modal } from 'ant-design-vue'; import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue'; import SxtList from '/@/views/deviceSync/compoents/SxtList.vue' import DbList from '/@/views/deviceSync/compoents/DbList.vue' @@ -42,6 +43,8 @@ import CheckSxtModal from '/@/views/deviceSync/compoents/CheckSxtModal.vue' import CheckDbModal from '/@/views/deviceSync/compoents/CheckDbModal.vue' import CheckSbModal from '/@/views/deviceSync/compoents/CheckSbModal.vue' import CheckWsdjModal from '/@/views/deviceSync/compoents/CheckWsdjModal.vue' +import IotDeviceContentListModal from '/@/views/deviceSync/IotDeviceContent/IotDeviceContentListModal.vue' +import { set } from 'lodash-es'; const props = defineProps({ @@ -54,6 +57,7 @@ const checkSxtModal = ref(); const checkDbModal = ref(); const checkSbModal = ref(); const checkWsdjModal = ref(); +const iotDeviceContentListModal = ref(); const useForm = Form.useForm; const emit = defineEmits(['register', 'ok']); const formData = reactive>({ @@ -89,7 +93,24 @@ const disabled = computed(() => { } return props.formDisabled; }); - +function handleSync(){ + Modal.confirm({ + title: '物联设备同步', + content: '是否要进行物联设备同步?', + okText: '确认', + cancelText: '取消', + onOk: async () => { + var params = { nuId: nuInfo.value.nuId }; + await defHttp.get({url: '/iot/syncbiz/syncIot',params}).then((res) => { + console.log("🚀 ~ handleSync ~ res:", res) + setTimeout(() => { + reload(); + }, 2000); + + }); + }, + }); +} //选择温湿度计 function checkWsdj(){ checkWsdjModal.value.disabled = true; @@ -173,6 +194,14 @@ function handleWsdjSuccess(record) { }); console.log("🚀 ~ handleDbSuccess ~ params:", params) } +//添加日志 +function handleAddContent(){ + var params = {nuId:nuInfo.value.nuId,orgCode:nuInfo.value.sysOrgCode} + console.log("🚀 ~ handleAddContent ~ nuInfo.value:", nuInfo.value) + console.log("🚀 ~ handleAddContent ~ params:", params) + iotDeviceContentListModal.value.disableSubmit = false; + iotDeviceContentListModal.value.init(params) +} function hadleSuccess(){ reload(); } @@ -189,7 +218,7 @@ function add(record) { } function reload() { - defHttp.get({ url: '/iot/ddvicesIot/list', params: { nuId: nuInfo.value.nuId } }).then((res) => { + defHttp.get({ url: '/iot/devicesIot/list', params: { nuId: nuInfo.value.nuId } }).then((res) => { console.log("🚀 ~ reload ~ res:", res) dataList.value = res; }); diff --git a/src/views/deviceSync/compoents/DevicesPriviewForm.vue b/src/views/deviceSync/compoents/DevicesPriviewForm.vue new file mode 100644 index 0000000..ed9201c --- /dev/null +++ b/src/views/deviceSync/compoents/DevicesPriviewForm.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/src/views/deviceSync/compoents/DevicesPriviewModal.vue b/src/views/deviceSync/compoents/DevicesPriviewModal.vue new file mode 100644 index 0000000..299fa10 --- /dev/null +++ b/src/views/deviceSync/compoents/DevicesPriviewModal.vue @@ -0,0 +1,70 @@ + + + + + + diff --git a/src/views/deviceSync/compoents/SbList.vue b/src/views/deviceSync/compoents/SbList.vue index 2a27095..4c001ea 100644 --- a/src/views/deviceSync/compoents/SbList.vue +++ b/src/views/deviceSync/compoents/SbList.vue @@ -14,7 +14,7 @@ - NUID: {{item.nuId?item.nuId:'未配置'}} + NUID: {{item.nuId?item.nuId:'未配置'}} 用水量:{{item.eleValue?item.eleValue:'0.0'}}m³ @@ -37,7 +37,7 @@ --> -
+
抄表
diff --git a/src/views/deviceSync/compoents/SxtList.vue b/src/views/deviceSync/compoents/SxtList.vue index 7b92832..46e289b 100644 --- a/src/views/deviceSync/compoents/SxtList.vue +++ b/src/views/deviceSync/compoents/SxtList.vue @@ -14,7 +14,7 @@ - NUID: {{item.nuId?item.nuId:'未配置'}} + NUID: {{item.nuId?item.nuId:'未配置'}} 同步状态:{{item.syncType =='1'?'已同步':'未同步'}} diff --git a/src/views/deviceSync/compoents/WsdjList.vue b/src/views/deviceSync/compoents/WsdjList.vue index 946afa5..508f5d6 100644 --- a/src/views/deviceSync/compoents/WsdjList.vue +++ b/src/views/deviceSync/compoents/WsdjList.vue @@ -37,7 +37,7 @@ --> -
+
抄表
diff --git a/src/views/deviceSync/index.vue b/src/views/deviceSync/index.vue index 9587409..27cd938 100644 --- a/src/views/deviceSync/index.vue +++ b/src/views/deviceSync/index.vue @@ -44,16 +44,16 @@
-

加1盟时间:{{ item.franchiseTime?.substring(0, 10) }}

+

加盟时间:{{ item.franchiseTime?.substring(0, 10) }}

机构负责人:{{ item.orgLeader }}

负责人电话:{{ item.orgLeaderPhone }}

机构地址:{{ item.comRegisterAddress }}

- 预览 + 预览 配置 - 日志 + 日志
@@ -78,7 +78,7 @@ 添加区域 - 设备预览 + 设备预览 + +