From 1628d64e44ffaebb8e454d8277c1a969c29bbea8 Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Mon, 12 May 2025 14:48:33 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8D=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5bug=202=E3=80=81=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E7=B3=BB=E7=BB=9F=E5=8F=82=E6=95=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=8B=E5=8F=91=E5=8A=9F=E8=83=BD=EF=BC=88=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=B8=8B=E5=8F=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dataAsync/AsyncMainList.vue | 1 + src/views/admin/sysconfig/SysConfig.api.ts | 91 ++++ src/views/admin/sysconfig/SysConfig.data.ts | 43 ++ src/views/admin/sysconfig/SysConfigList.vue | 444 ++++++++++++++++++ .../sysconfig/components/SysConfigForm.vue | 180 +++++++ .../sysconfig/components/SysConfigModal.vue | 77 +++ src/views/synchronization/directive/index.vue | 19 +- src/views/system/dict/index.vue | 3 +- 8 files changed, 854 insertions(+), 4 deletions(-) create mode 100644 src/views/admin/sysconfig/SysConfig.api.ts create mode 100644 src/views/admin/sysconfig/SysConfig.data.ts create mode 100644 src/views/admin/sysconfig/SysConfigList.vue create mode 100644 src/views/admin/sysconfig/components/SysConfigForm.vue create mode 100644 src/views/admin/sysconfig/components/SysConfigModal.vue diff --git a/src/components/dataAsync/AsyncMainList.vue b/src/components/dataAsync/AsyncMainList.vue index 22332e8..a2564f2 100644 --- a/src/components/dataAsync/AsyncMainList.vue +++ b/src/components/dataAsync/AsyncMainList.vue @@ -64,6 +64,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ showTableSetting: false, showActionColumn: false, beforeFetch: async (params) => { + queryParam.type = 'directive' return Object.assign(params, queryParam); }, }, diff --git a/src/views/admin/sysconfig/SysConfig.api.ts b/src/views/admin/sysconfig/SysConfig.api.ts new file mode 100644 index 0000000..9fb96f7 --- /dev/null +++ b/src/views/admin/sysconfig/SysConfig.api.ts @@ -0,0 +1,91 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/sysconfig/sysConfig/list', + save='/sysconfig/sysConfig/add', + edit='/sysconfig/sysConfig/edit', + deleteOne = '/sysconfig/sysConfig/delete', + deleteBatch = '/sysconfig/sysConfig/deleteBatch', + importExcel = '/sysconfig/sysConfig/importExcel', + exportXls = '/sysconfig/sysConfig/exportXls', + async = '/sysconfig/sysConfig/async', + listByType = '/asyncmain/asyncMain/listByType', +} + +/** + * 导出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 }); +} + +/** + * 同步数据 + * @param params + */ +export const asyncData = (params) => { + return defHttp.post({ url: Api.async, params }); +}; + +/** + * 查询同步结果 + * @param params + * @returns + */ +export const listByType = (params) => { + return defHttp.post({ url: Api.listByType, params }); +}; \ No newline at end of file diff --git a/src/views/admin/sysconfig/SysConfig.data.ts b/src/views/admin/sysconfig/SysConfig.data.ts new file mode 100644 index 0000000..0590ada --- /dev/null +++ b/src/views/admin/sysconfig/SysConfig.data.ts @@ -0,0 +1,43 @@ +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: 'name', + }, + { + title: '键名', + align: "center", + dataIndex: 'configKey', + }, + { + title: '键值', + align: "center", + dataIndex: 'configValue' + }, + { + title: '备注', + align: "center", + dataIndex: 'descr' + }, + { + title: '是否启用', + align: "center", + dataIndex: 'izEnabled_dictText', + width:100 + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + name: {title: '参数名称',order: 0,view: 'text', type: 'string',}, + configKey: {title: '键名',order: 1,view: 'text', type: 'string',}, + configValue: {title: '键值',order: 2,view: 'textarea', type: 'string',}, + descr: {title: '备注',order: 3,view: 'textarea', type: 'string',}, + izEnabled: {title: '是否启用',order: 4,view: 'text', type: 'string',}, +}; diff --git a/src/views/admin/sysconfig/SysConfigList.vue b/src/views/admin/sysconfig/SysConfigList.vue new file mode 100644 index 0000000..53e1290 --- /dev/null +++ b/src/views/admin/sysconfig/SysConfigList.vue @@ -0,0 +1,444 @@ + + + + + diff --git a/src/views/admin/sysconfig/components/SysConfigForm.vue b/src/views/admin/sysconfig/components/SysConfigForm.vue new file mode 100644 index 0000000..a19322a --- /dev/null +++ b/src/views/admin/sysconfig/components/SysConfigForm.vue @@ -0,0 +1,180 @@ + + + + + diff --git a/src/views/admin/sysconfig/components/SysConfigModal.vue b/src/views/admin/sysconfig/components/SysConfigModal.vue new file mode 100644 index 0000000..84388fd --- /dev/null +++ b/src/views/admin/sysconfig/components/SysConfigModal.vue @@ -0,0 +1,77 @@ + + + + + + diff --git a/src/views/synchronization/directive/index.vue b/src/views/synchronization/directive/index.vue index 8ed8a94..38bf32c 100644 --- a/src/views/synchronization/directive/index.vue +++ b/src/views/synchronization/directive/index.vue @@ -442,7 +442,7 @@ const loadOrgData = async (org) => { initialDataIds.value = []; // 加载新机构数据 - const res = await list({ dataSourceCode: org.orgCode }); + const res = await list({ dataSourceCode: org.orgCode, pageNo: 1, pageSize: -1 }); // 更新机构数据 orgData.value = org; @@ -501,7 +501,22 @@ const handleAsync = () => { izInc, idStr } - asyncFunc(params) + await asyncFunc(params) + + //处理右侧列表数据移除是否可用 如果已到运营时间则禁用 + if (!orgData.value?.operationStartTime || new Date() >= new Date(orgData.value?.operationStartTime)) { + // 获取当前同步的ID数组 + const syncedIds = Array.from(selectedItems.value.keys()); + // 只添加initialDataIds中不存在的ID + syncedIds.forEach(id => { + if (!initialDataIds.value.includes(id)) { + initialDataIds.value.push(id); + } + }); + } + + //刷新历史数据 + refreshHistory() createMessage.success("同步结果请在同步历史中查看!"); }, }); diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index c46c495..5e80872 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -355,7 +355,6 @@ const opeDictId = ref('') * 同步结果 */ function AsyncResultFunc(record) { - console.log("🌊 ~ AsyncResultFunc ~ record:", record) if (!record.id) { return } @@ -369,7 +368,7 @@ function AsyncResultFunc(record) { processingList.value = []; successList.value = []; pendingList.value = []; - listByType({ primaryKey: record.id }).then(res => { + listByType({ primaryKey: record.id,type:'sys_dict' }).then(res => { if (res) { errorList.value = res.errorList || []; processingList.value = res.processingList || [];