feat: Enhance HR employee synchronization with new button for department cache refresh and user sync functionality
This commit is contained in:
parent
7d75a72a3a
commit
5e4960c96d
|
@ -23,15 +23,20 @@ let extension = {
|
|||
//下面这些方法可以保留也可以删除
|
||||
onInit() { //框架初始化配置前,
|
||||
//示例:在按钮的最前面添加一个按钮
|
||||
// this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组
|
||||
// name: '按钮', //按钮名称
|
||||
// icon: 'el-icon-document', //按钮图标:https://element.eleme.cn/#/zh-CN/component/icon
|
||||
// type: 'primary', //按钮样式:https://element-plus.gitee.io/zh-CN/component/button.html
|
||||
// //color:"#eee",//自定义按钮颜色
|
||||
// onClick: function () {
|
||||
// this.$Message.success('点击了按钮');
|
||||
// }
|
||||
// });
|
||||
this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组
|
||||
name: '刷新部门信息缓存', //按钮名称
|
||||
icon: 'el-icon-document', //按钮图标:https://element.eleme.cn/#/zh-CN/component/icon
|
||||
type: 'primary', //按钮样式:https://element-plus.gitee.io/zh-CN/component/button.html
|
||||
//color:"#eee",//自定义按钮颜色
|
||||
onClick: function () {
|
||||
|
||||
this.http.post('api/HR_DeptSync/cacheDingTalkDept', {}, '刷新钉钉部门缓存中').then((reslut) => {
|
||||
this.http.post('api/HR_DeptSync/cacheYSERPDept', {}, '刷新YS部门缓存中').then((reslut) => {
|
||||
this.$Message.warning('部门信息缓存刷新成功');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//示例:设置修改新建、编辑弹出框字段标签的长度
|
||||
// this.boxOptions.labelWidth = 150;
|
||||
|
|
|
@ -22,12 +22,10 @@ let extension = {
|
|||
methods: {
|
||||
//下面这些方法可以保留也可以删除
|
||||
onInit() { //框架初始化配置前,
|
||||
//示例:在按钮的最前面添加一个按钮
|
||||
this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组
|
||||
name: '立即同步', //按钮名称
|
||||
icon: 'el-icon-refresh', //按钮图标:https://element.eleme.cn/#/zh-CN/component/icon
|
||||
type: 'primary', //按钮样式:https://element-plus.gitee.io/zh-CN/component/button.html
|
||||
//color:"#eee",//自定义按钮颜色
|
||||
this.buttons.unshift({
|
||||
name: '立即同步',
|
||||
icon: 'el-icon-refresh',
|
||||
type: 'primary',
|
||||
onClick: function () {
|
||||
let url = 'api/HR_EmployeeSync/GenEmpSystemShip';
|
||||
|
||||
|
@ -39,8 +37,7 @@ let extension = {
|
|||
}
|
||||
});
|
||||
|
||||
//示例:设置修改新建、编辑弹出框字段标签的长度
|
||||
// this.boxOptions.labelWidth = 150;
|
||||
|
||||
},
|
||||
onInited() {
|
||||
//框架初始化配置后
|
||||
|
@ -78,4 +75,8 @@ let extension = {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
function saveClick(row) {
|
||||
|
||||
}
|
||||
export default extension;
|
||||
|
|
|
@ -25,7 +25,7 @@ export default function(){
|
|||
{field:'YSDeptName',title:'YS部门名称',type:'string',width:60,hidden:true,readonly:true,align:'left'},
|
||||
{field:'DingTalkDeptId',title:'钉钉部门',type:'string',bind:{ key:'Q002',data:[]},width:60,align:'left'},
|
||||
{field:'DingTalkDeptName',title:'钉钉部门名称',type:'string',width:60,hidden:true,readonly:true,align:'left'},
|
||||
{field:'IsRoot',title:'根节点',type:'bool',width:120,align:'left'}];
|
||||
{field:'IsRoot',title:'根节点',type:'bool',width:120,hidden:true,align:'left'}];
|
||||
const detail ={columns:[]};
|
||||
const details = [];
|
||||
|
||||
|
|
|
@ -5,25 +5,11 @@
|
|||
*新版本支持vue或【表.jsx]文件编写业务,文档见:https://v3.volcore.xyz/docs/view-grid、https://v3.volcore.xyz/docs/web
|
||||
-->
|
||||
<template>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:details="details"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend"
|
||||
:onInit="onInit"
|
||||
:onInited="onInited"
|
||||
:searchBefore="searchBefore"
|
||||
:searchAfter="searchAfter"
|
||||
:addBefore="addBefore"
|
||||
:updateBefore="updateBefore"
|
||||
:rowClick="rowClick"
|
||||
:modelOpenBefore="modelOpenBefore"
|
||||
:modelOpenAfter="modelOpenAfter">
|
||||
<view-grid ref="grid" :columns="columns" :detail="detail" :details="details" :editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
|
||||
:table="table" :extend="extend" :onInit="onInit" :onInited="onInited" :searchBefore="searchBefore"
|
||||
:searchAfter="searchAfter" :addBefore="addBefore" :updateBefore="updateBefore" :rowClick="rowClick"
|
||||
:modelOpenBefore="modelOpenBefore" :modelOpenAfter="modelOpenAfter">
|
||||
<!-- 自定义组件数据槽扩展,更多数据槽slot见文档 -->
|
||||
<template #gridHeader>
|
||||
</template>
|
||||
|
@ -38,12 +24,52 @@
|
|||
//http请求,proxy.http.post/get
|
||||
const { table, editFormFields, editFormOptions, searchFormFields, searchFormOptions, columns, detail, details } = reactive(viewOptions())
|
||||
|
||||
let gridRef;//对应[表.jsx]文件中this.使用方式一样
|
||||
//生成对象属性初始化
|
||||
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;
|
||||
//与jsx中的this.xx使用一样,只需将this.xx改为gridRef.xx
|
||||
//更多属性见:https://v3.volcore.xyz/docs/view-grid
|
||||
//最后添加一行保存按钮
|
||||
columns.push({
|
||||
title: '操作', //按钮名称
|
||||
field: '操作',
|
||||
align: 'center',
|
||||
width: 70,
|
||||
fixed: 'right',
|
||||
render: (h, { row, column, index }) => {
|
||||
return (
|
||||
<div>
|
||||
<el-button
|
||||
onClick={($e) => { syncThis(row) }}
|
||||
type="primary" link>同步这个用户</el-button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
//生成对象属性初始化后,操作明细表配置用到
|
||||
const onInited = async () => {
|
||||
|
@ -79,5 +105,4 @@
|
|||
//对外暴露数据
|
||||
defineExpose({})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
|
@ -29,7 +29,7 @@ export default function(){
|
|||
{field:'EmpJobNumber',title:'员工工号',type:'string',link:true,width:60,readonly:true,align:'left',sort:true},
|
||||
{field:'EmpYSID',title:'员工YSID',type:'string',width:60,readonly:true,align:'left'},
|
||||
{field:'EmpDingDingID',title:'员工钉钉ID',type:'string',width:60,readonly:true,align:'left'},
|
||||
{field:'EmpYSMobile',title:'员工YS手机号',type:'string',width:60,readonly:true,align:'left'},
|
||||
{field:'EmpYSMobile',title:'员工YS手机号',type:'string',sort:true,width:60,readonly:true,align:'left'},
|
||||
{field:'EmpDingDingMobile',title:'员工钉钉手机号',type:'string',width:60,readonly:true,align:'left'},
|
||||
{field:'EmpYSDeptID',title:'员工YS所属部门',type:'string',bind:{ key:'Q001',data:[]},width:60,readonly:true,align:'left'},
|
||||
{field:'EmpLastSyncInfo',title:'最后一次同步记录',type:'string',width:60,readonly:true,align:'left'},
|
||||
|
|
|
@ -5,25 +5,11 @@
|
|||
*新版本支持vue或【表.jsx]文件编写业务,文档见:https://v3.volcore.xyz/docs/view-grid、https://v3.volcore.xyz/docs/web
|
||||
-->
|
||||
<template>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:details="details"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend"
|
||||
:onInit="onInit"
|
||||
:onInited="onInited"
|
||||
:searchBefore="searchBefore"
|
||||
:searchAfter="searchAfter"
|
||||
:addBefore="addBefore"
|
||||
:updateBefore="updateBefore"
|
||||
:rowClick="rowClick"
|
||||
:modelOpenBefore="modelOpenBefore"
|
||||
:modelOpenAfter="modelOpenAfter">
|
||||
<view-grid ref="grid" :columns="columns" :detail="detail" :details="details" :editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
|
||||
:table="table" :extend="extend" :onInit="onInit" :onInited="onInited" :searchBefore="searchBefore"
|
||||
:searchAfter="searchAfter" :addBefore="addBefore" :updateBefore="updateBefore" :rowClick="rowClick"
|
||||
:modelOpenBefore="modelOpenBefore" :modelOpenAfter="modelOpenAfter">
|
||||
<!-- 自定义组件数据槽扩展,更多数据槽slot见文档 -->
|
||||
<template #gridHeader>
|
||||
</template>
|
||||
|
@ -38,14 +24,14 @@
|
|||
//http请求,proxy.http.post/get
|
||||
const { table, editFormFields, editFormOptions, searchFormFields, searchFormOptions, columns, detail, details } = reactive(viewOptions())
|
||||
|
||||
let gridRef;//对应[表.jsx]文件中this.使用方式一样
|
||||
//生成对象属性初始化
|
||||
let gridRef;
|
||||
|
||||
|
||||
const onInit = async ($vm) => {
|
||||
gridRef = $vm;
|
||||
|
||||
gridRef.paginationHide = true;
|
||||
//与jsx中的this.xx使用一样,只需将this.xx改为gridRef.xx
|
||||
//更多属性见:https://v3.volcore.xyz/docs/view-grid
|
||||
|
||||
}
|
||||
//生成对象属性初始化后,操作明细表配置用到
|
||||
const onInited = async () => {
|
||||
|
@ -81,5 +67,4 @@
|
|||
//对外暴露数据
|
||||
defineExpose({})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
Loading…
Reference in New Issue