diff --git a/src/views/notice/Config/SyncUser/index.vue b/src/views/notice/Config/SyncUser/index.vue index 0856b041..7fa34d68 100644 --- a/src/views/notice/Config/SyncUser/index.vue +++ b/src/views/notice/Config/SyncUser/index.vue @@ -34,65 +34,72 @@ - + 自动绑定 + + - - - - + @@ -184,23 +191,10 @@ const getDepartment = async () => { ); } - // deptTreeData.value = arrayToTree(_result, _result[0]?.parentId); deptTreeData.value = _result; deptId.value = _result[0]?.id; }; -/** - * 扁平数据转树形结构 - */ -// const arrayToTree = (arr: any, pid: string | number) => { -// return arr -// .filter((item: any) => item.parentId === pid) -// .map((item: any) => ({ -// ...item, -// children: arrayToTree(arr, item.id), -// })); -// }; - /** * 部门点击 */ @@ -230,6 +224,7 @@ const columns = [ }, { title: '操作', + dataIndex: 'action', key: 'action', scopedSlots: true, }, @@ -285,7 +280,7 @@ const handleAutoBind = () => { thirdPartyUserId: i.thirdPartyUserId, }; }); - // console.log('arr: ', arr); + configApi.dingTalkBindUser(arr, props.data.id).then(() => { message.success('操作成功'); getTableData(); @@ -346,8 +341,8 @@ const dataSource = ref([]); const tableLoading = ref(false); const getTableData = () => { tableLoading.value = true; - Promise.all([getDeptUsers(), getBindUsers(), getAllUsers()]).then( - (res) => { + Promise.all([getDeptUsers(), getBindUsers(), getAllUsers()]) + .then((res) => { dataSource.value = []; const [deptUsers, bindUsers, unBindUsers] = res; (deptUsers || []).forEach((deptUser: any) => { @@ -379,9 +374,20 @@ const getTableData = () => { }); }); // console.log('dataSource.value: ', dataSource.value); - }, - ); - tableLoading.value = false; + }) + .finally(() => { + tableLoading.value = false; + }); +}; + +/** + * 前端分页 + */ +const current = ref(1); +const pageSize = ref(12); +const handleTableChange = (pagination: any) => { + current.value = pagination.current; + pageSize.value = pagination.pageSize; }; watch( @@ -475,5 +481,8 @@ const handleCancel = () => { .model-body { height: 600px; overflow-y: auto; + &:deep(.ant-pagination-item) { + display: none; + } }