From b2c1554aabc99360fbd5690f28ff59cd4e514efe Mon Sep 17 00:00:00 2001
From: "1378012178@qq.com" <1378012178@qq.com>
Date: Wed, 7 May 2025 14:17:42 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E5=AD=97=E5=85=B8=E5=90=8C=E6=AD=A5=EF=BC=88=E4=B8=B4=E6=97=B6?=
=?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=89=88=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/dict/dict.api.ts | 9 +++++++++
src/views/system/dict/index.vue | 32 +++++++++++++++++++++++++++++--
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/src/views/system/dict/dict.api.ts b/src/views/system/dict/dict.api.ts
index 36fe729..7a1ec9e 100644
--- a/src/views/system/dict/dict.api.ts
+++ b/src/views/system/dict/dict.api.ts
@@ -21,6 +21,7 @@ enum Api {
dictItemCheck = '/sys/dictItem/dictItemCheck',
refreshCache = '/sys/dict/refleshCache',
queryAllDictItems = '/sys/dict/queryAllDictItems',
+ async = '/sys/dict/async',
}
/**
* 导出api
@@ -154,3 +155,11 @@ export const refreshCache = () => defHttp.get({ url: Api.refreshCache }, { isTra
* @param params
*/
export const queryAllDictItems = () => defHttp.get({ url: Api.queryAllDictItems }, { isTransformResponse: false });
+
+/**
+ * 同步数据
+ * @param params
+ */
+export const asyncData = (params) => {
+ return defHttp.post({ url: Api.async, params });
+};
\ No newline at end of file
diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue
index 9e8c784..f1e3737 100644
--- a/src/views/system/dict/index.vue
+++ b/src/views/system/dict/index.vue
@@ -25,7 +25,7 @@
-
+
@@ -48,7 +48,7 @@ import DictRecycleBinModal from './components/DictRecycleBinModal.vue';
import { useMessage } from '/src/hooks/web/useMessage';
import { removeAuthCache, setAuthCache } from '/src/utils/auth';
import { columns, searchFormSchema } from './dict.data';
-import { list, deleteDict, batchDeleteDict, getExportUrl, getImportUrl, refreshCache, queryAllDictItems } from './dict.api';
+import { list, deleteDict, batchDeleteDict, getExportUrl, getImportUrl, refreshCache, queryAllDictItems, asyncData } from './dict.api';
import { DB_DICT_DATA_KEY } from '/src/enums/cacheEnum';
import { useUserStore } from '/@/store/modules/user';
@@ -191,6 +191,34 @@ function getTableAction(record) {
},
];
}
+
+function getTableDropDownAction(record) {
+ return [
+ {
+ label: '同步数据',
+ onClick: handleAsync.bind(null, record),
+ },
+ {
+ label: '同步结果',
+ onClick: AsyncResultFunc.bind(null, record),
+ },
+ ]
+}
+/**
+ * 同步
+ */
+function handleAsync(record) {
+ asyncData(record).then(res => {
+ createMessage.success("操作成功,请在同步结果中进行查看!")
+ })
+}
+/**
+ * 同步结果
+ */
+function AsyncResultFunc(record) {
+ console.log("🌊 ~ AsyncResultFunc ~ record:", record)
+
+}
From a504218a393b591c08c9ef8407c58e48b7c697e7 Mon Sep 17 00:00:00 2001
From: "1378012178@qq.com" <1378012178@qq.com>
Date: Thu, 8 May 2025 16:22:07 +0800
Subject: [PATCH 2/4] =?UTF-8?q?1=E3=80=81=E7=B3=BB=E7=BB=9F=E7=BA=A7?=
=?UTF-8?q?=E5=88=AB=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E5=90=8C=E6=AD=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/dataAsync/AsyncMain.api.ts | 21 ++++----
src/views/system/dict/dict.api.ts | 10 ++++
src/views/system/dict/index.vue | 60 +++++++++++++++++++++--
3 files changed, 78 insertions(+), 13 deletions(-)
diff --git a/src/components/dataAsync/AsyncMain.api.ts b/src/components/dataAsync/AsyncMain.api.ts
index be57271..a1a6c7f 100644
--- a/src/components/dataAsync/AsyncMain.api.ts
+++ b/src/components/dataAsync/AsyncMain.api.ts
@@ -1,12 +1,12 @@
import { defHttp } from '/@/utils/http/axios';
-import { useMessage } from "/@/hooks/web/useMessage";
+import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage();
enum Api {
list = '/asyncmain/asyncMain/list',
- save='/asyncmain/asyncMain/add',
- edit='/asyncmain/asyncMain/edit',
+ save = '/asyncmain/asyncMain/add',
+ edit = '/asyncmain/asyncMain/edit',
deleteOne = '/asyncmain/asyncMain/delete',
deleteBatch = '/asyncmain/asyncMain/deleteBatch',
importExcel = '/asyncmain/asyncMain/importExcel',
@@ -35,11 +35,11 @@ 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(() => {
+export const deleteOne = (params, handleSuccess) => {
+ return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
-}
+};
/**
* 批量删除
@@ -54,12 +54,12 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认',
cancelText: '取消',
onOk: () => {
- return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
+ return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
- }
+ },
});
-}
+};
/**
* 保存或者更新
@@ -69,4 +69,5 @@ export const batchDelete = (params, handleSuccess) => {
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/system/dict/dict.api.ts b/src/views/system/dict/dict.api.ts
index 7a1ec9e..4ba5a5e 100644
--- a/src/views/system/dict/dict.api.ts
+++ b/src/views/system/dict/dict.api.ts
@@ -22,6 +22,7 @@ enum Api {
refreshCache = '/sys/dict/refleshCache',
queryAllDictItems = '/sys/dict/queryAllDictItems',
async = '/sys/dict/async',
+ listByType = '/asyncmain/asyncMain/listByType',
}
/**
* 导出api
@@ -162,4 +163,13 @@ export const queryAllDictItems = () => defHttp.get({ url: Api.queryAllDictItems
*/
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/system/dict/index.vue b/src/views/system/dict/index.vue
index f1e3737..19c2b27 100644
--- a/src/views/system/dict/index.vue
+++ b/src/views/system/dict/index.vue
@@ -34,11 +34,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 5bda280088674dd3de565308c30dc19a8580c73e Mon Sep 17 00:00:00 2001
From: "1378012178@qq.com" <1378012178@qq.com>
Date: Fri, 9 May 2025 11:27:26 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E5=90=8C=E6=AD=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/dict/index.vue | 151 +++++++++++++++++++++++++++-----
1 file changed, 131 insertions(+), 20 deletions(-)
diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue
index 19c2b27..c46c495 100644
--- a/src/views/system/dict/index.vue
+++ b/src/views/system/dict/index.vue
@@ -1,7 +1,6 @@
-
新增
导出
@@ -36,18 +35,58 @@
-
-
-
+
+
+ 刷新
+
+
+
+
+
+
+ 同步
+
+
+
+
-
-
+
+
+
+
+
+ 同步
+
+
+
+
+
+
+
+
+
+
+ 同步
+
+
+
+
-
+
+
+
+
+ 同步
+
+
+
+
@@ -74,6 +113,7 @@ const activeTabKey = ref('error');
const errorList = ref([]);
const processingList = ref([]);
const successList = ref([]);
+const pendingList = ref([]);
const resultColumns = [
{
title: '机构名称',
@@ -89,10 +129,45 @@ const resultColumns = [
title: '备注',
dataIndex: 'descr',
key: 'descr',
- }
+ },
+ {
+ title: '操作',
+ dataIndex: 'action',
+ key: 'action',
+ align: 'center',
+ width: '100px'
+ },
];
-
-const { createMessage } = useMessage();
+const resultColumnsCT = [
+ {
+ title: '机构名称',
+ dataIndex: 'orgName',
+ key: 'orgName',
+ },
+ {
+ title: '机构编码',
+ dataIndex: 'orgCode',
+ key: 'orgCode',
+ },
+ {
+ title: '备注',
+ dataIndex: 'descr',
+ key: 'descr',
+ },
+ {
+ title: '同步开始时间',
+ dataIndex: 'createTime',
+ key: 'createTime',
+ },
+ {
+ title: '操作',
+ dataIndex: 'action',
+ key: 'action',
+ align: 'center',
+ width: '100px'
+ },
+];
+const { createMessage, createConfirm } = useMessage();
//字典model
const [registerModal, { openModal }] = useModal();
//字典配置drawer
@@ -235,12 +310,16 @@ function getTableAction(record) {
function getTableDropDownAction(record) {
return [
{
- label: '同步数据',
+ label: '同步',
+ onClick: AsyncResultFunc.bind(null, Object.assign({}, record, { tabAction: 'pending' })),
+ },
+ {
+ label: '全部同步',
onClick: handleAsync.bind(null, record),
},
{
label: '同步结果',
- onClick: AsyncResultFunc.bind(null, record),
+ onClick: AsyncResultFunc.bind(null, Object.assign({}, record, { tabAction: 'error' })),
},
]
}
@@ -248,31 +327,63 @@ function getTableDropDownAction(record) {
* 同步
*/
function handleAsync(record) {
- asyncData(record).then(res => {
- createMessage.success("操作成功,请在同步结果中进行查看!")
- })
+ createConfirm({
+ iconType: 'warning',
+ title: '确认同步',
+ content: '确定要同步该字典数据吗?',
+ onOk: () => {
+ return new Promise((resolve, reject) => {
+ asyncData(record)
+ .then(res => {
+ createMessage.success("操作成功,请在同步结果中进行查看!");
+ resolve(res);
+ })
+ .catch(err => {
+ createMessage.error('同步失败: ' + err.message);
+ reject(err);
+ });
+ });
+ },
+ onCancel: () => {
+ createMessage.info('已取消同步操作');
+ }
+ });
}
+const opeDictId = ref('')
/**
* 同步结果
*/
function AsyncResultFunc(record) {
+ console.log("🌊 ~ AsyncResultFunc ~ record:", record)
+ if (!record.id) {
+ return
+ }
+ opeDictId.value = record.id
+
showAsyncResult.value = true;
- activeTabKey.value = 'error';
+ activeTabKey.value = record.tabAction
// 清空之前的数据
errorList.value = [];
processingList.value = [];
successList.value = [];
-
+ pendingList.value = [];
listByType({ primaryKey: record.id }).then(res => {
if (res) {
errorList.value = res.errorList || [];
processingList.value = res.processingList || [];
successList.value = res.successList || [];
+ pendingList.value = res.pendingList || [];
}
});
}
+
+function handleAsyncByOrgCode(record) {
+ asyncData({ id: opeDictId.value, orgCode: record.orgCode }).then(res => {
+ createMessage.success("操作成功,请稍后刷新数据查看同步结果!")
+ })
+}
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 4/4] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8D=E6=8C=87?=
=?UTF-8?q?=E4=BB=A4=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5bug=202=E3=80=81?=
=?UTF-8?q?=E5=AE=8C=E6=88=90=E7=B3=BB=E7=BB=9F=E5=8F=82=E6=95=B0=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE=E4=B8=8B=E5=8F=91=E5=8A=9F=E8=83=BD=EF=BC=88=E5=85=A8?=
=?UTF-8?q?=E5=B1=80=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 || [];