From e9725b46740591f6ebb7432663a12717dfa98ce2 Mon Sep 17 00:00:00 2001 From: "Blank.li" Date: Thu, 9 Oct 2025 16:38:41 +0800 Subject: [PATCH] feat: Update HR employee synchronization functionality; add sync button and improve user feedback --- src/api/http.js | 2 +- .../hr/employeesync/HR_EmployeeSync.jsx | 50 +++++++++++++++++++ .../sys/quartz/Sys_QuartzOptions.jsx | 16 +++--- src/views/hr/employeesync/HR_EmployeeSync.vue | 43 +--------------- 4 files changed, 60 insertions(+), 51 deletions(-) diff --git a/src/api/http.js b/src/api/http.js index 2966f0b..a33a829 100644 --- a/src/api/http.js +++ b/src/api/http.js @@ -15,7 +15,7 @@ if (process.env.NODE_ENV == 'development') { axios.defaults.baseURL = 'http://localhost:9991/' } else if (process.env.NODE_ENV == 'production') { //部署的后台接口地址 - axios.defaults.baseURL = 'http://api.volcore.xyz/' + axios.defaults.baseURL = 'http://localhost:9991/' } if (!axios.defaults.baseURL.endsWith('/')) { axios.defaults.baseURL += '/' diff --git a/src/extension/hr/employeesync/HR_EmployeeSync.jsx b/src/extension/hr/employeesync/HR_EmployeeSync.jsx index 645548b..eeadd15 100644 --- a/src/extension/hr/employeesync/HR_EmployeeSync.jsx +++ b/src/extension/hr/employeesync/HR_EmployeeSync.jsx @@ -20,6 +20,39 @@ let extension = { tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写) buttons: { view: [], box: [], detail: [] }, //扩展的按钮 methods: { + + +//同步这个用户 + syncThis(row){ + this.$confirm('是否同步该用户?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + // this.http.post(url, {}, '生成关联关系中').then((reslut) => { + // this.$Message.success('生成完成,请点击查询进行刷新'); + // this.search(); + // }); + //点击确定 + const res = await this.http.post('api/HR_EmployeeSync/SyncYSEmpToDingTalk', row.EmpYSID,'正在同步信息...'); + if (res.success) { + this.$message({ + type: 'success', + message: '同步成功!' + }); + // gridRef.load(); + this.search(); + } else { + this.$message({ + type: 'error', + message: res.message + }); + } + }).catch(() => { + //取消操作 + }); +}, + //下面这些方法可以保留也可以删除 onInit() { //框架初始化配置前, this.buttons.unshift({ @@ -37,6 +70,23 @@ let extension = { } }); + this.columns.push({ + title: '操作', //按钮名称 + field: '操作', + align: 'center', + width: 70, + fixed: 'right', + render: (h, { row, column, index }) => { + return ( +
+ { this.syncThis(row) }} + type="primary" link>同步这个用户 +
+ ); + } + }); + }, onInited() { diff --git a/src/extension/sys/quartz/Sys_QuartzOptions.jsx b/src/extension/sys/quartz/Sys_QuartzOptions.jsx index 37769fb..7d5cf0c 100644 --- a/src/extension/sys/quartz/Sys_QuartzOptions.jsx +++ b/src/extension/sys/quartz/Sys_QuartzOptions.jsx @@ -33,7 +33,7 @@ let extension = { render: (h, { row, column, index }) => { return (
- { this.edit(row); @@ -41,8 +41,8 @@ let extension = { type="text" > 编辑 - - + { this.request('Run', row, 'once'); @@ -50,8 +50,8 @@ let extension = { type="text" > 执行一次 - - + { if (row.Status == 1) { @@ -64,8 +64,8 @@ let extension = { type="text" > {row.Status == 1 ? '恢复' : '暂停'} - - + { this.$store.getters.data().quartzId = row.Id; @@ -74,7 +74,7 @@ let extension = { type="text" > 日志 - +
); } diff --git a/src/views/hr/employeesync/HR_EmployeeSync.vue b/src/views/hr/employeesync/HR_EmployeeSync.vue index a34c4b3..3d504a3 100644 --- a/src/views/hr/employeesync/HR_EmployeeSync.vue +++ b/src/views/hr/employeesync/HR_EmployeeSync.vue @@ -26,50 +26,9 @@ const { table, editFormFields, editFormOptions, searchFormFields, searchFormOpti let gridRef; -//同步这个用户 -const syncThis = async (row) => { - proxy.$confirm('是否同步该用户?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(async () => { - //点击确定 - const res = await proxy.http.post('api/HR_EmployeeSync/SyncYSEmpToDingTalk', row.EmpYSID,'正在同步信息...'); - if (res.success) { - proxy.$message({ - type: 'success', - message: '同步成功!' - }); - gridRef.load(); - } else { - proxy.$message({ - type: 'error', - message: res.message - }); - } - }).catch(() => { - //取消操作 - }); -} const onInit = async ($vm) => { gridRef = $vm; - //最后添加一行保存按钮 - columns.push({ - title: '操作', //按钮名称 - field: '操作', - align: 'center', - width: 70, - fixed: 'right', - render: (h, { row, column, index }) => { - return ( -
- { syncThis(row) }} - type="primary" link>同步这个用户 -
- ); - } - }); + } //生成对象属性初始化后,操作明细表配置用到 const onInited = async () => {