mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-03 12:05:28 +08:00
3.7.1版本发布
This commit is contained in:
@ -167,7 +167,7 @@
|
||||
Modal.warning(options)
|
||||
} else {
|
||||
createMessage.warning({
|
||||
content: "同步失败,请检查对接信息录入中是否填写正确,并确认是否已开启钉钉配置!",
|
||||
content: res.message || "同步失败,请检查对接信息录入中是否填写正确,并确认是否已开启钉钉配置!",
|
||||
duration: 5
|
||||
});
|
||||
}
|
||||
|
||||
@ -18,13 +18,13 @@ export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '名称',
|
||||
field: 'name',
|
||||
component: 'Input',
|
||||
component: 'JInput',
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '编码',
|
||||
field: 'code',
|
||||
component: 'Input',
|
||||
component: 'JInput',
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
];
|
||||
|
||||
@ -323,7 +323,13 @@
|
||||
}
|
||||
|
||||
function onExportXls() {
|
||||
handleExportXls('部门信息', Api.exportXlsUrl);
|
||||
//update-begin---author:wangshuai---date:2024-07-05---for:【TV360X-1671】部门管理不支持选中的记录导出---
|
||||
let params = {}
|
||||
if(checkedKeys.value && checkedKeys.value.length > 0) {
|
||||
params['selections'] = checkedKeys.value.join(',')
|
||||
}
|
||||
handleExportXls('部门信息', Api.exportXlsUrl,params);
|
||||
//update-end---author:wangshuai---date:2024-07-05---for:【TV360X-1671】部门管理不支持选中的记录导出---
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
:checkedKeys="checkedKeys"
|
||||
:selectedKeys="selectedKeys"
|
||||
:expandedKeys="expandedKeys"
|
||||
:checkStrictly="checkStrictly"
|
||||
:checkStrictly="true"
|
||||
style="height: 500px; overflow: auto"
|
||||
@check="onCheck"
|
||||
@expand="onExpand"
|
||||
@ -28,10 +28,12 @@
|
||||
<a-dropdown :trigger="['click']" placement="top">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="3" @click="toggleCheckALL(true)">全部勾选</a-menu-item>
|
||||
<a-menu-item key="4" @click="toggleCheckALL(false)">取消全选</a-menu-item>
|
||||
<a-menu-item key="5" @click="toggleExpandAll(true)">展开所有</a-menu-item>
|
||||
<a-menu-item key="6" @click="toggleExpandAll(false)">收起所有</a-menu-item>
|
||||
<a-menu-item key="3" @click="toggleCheckALL(true)">{{ t('component.tree.selectAll') }}</a-menu-item>
|
||||
<a-menu-item key="4" @click="toggleCheckALL(false)">{{ t('component.tree.unSelectAll') }}</a-menu-item>
|
||||
<a-menu-item key="5" @click="toggleExpandAll(true)">{{ t('component.tree.expandAll') }}</a-menu-item>
|
||||
<a-menu-item key="6" @click="toggleExpandAll(false)">{{ t('component.tree.unExpandAll') }}</a-menu-item>
|
||||
<a-menu-item key="7" @click="toggleRelationAll(false)">{{ t('component.tree.checkStrictly') }}</a-menu-item>
|
||||
<a-menu-item key="8" @click="toggleRelationAll(true)">{{ t('component.tree.checkUnStrictly') }}</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button style="float: left">
|
||||
@ -54,6 +56,8 @@
|
||||
import { queryRoleTreeList, queryDepartPermission, saveDepartPermission } from '../depart.api';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
import { translateTitle } from '/@/utils/common/compUtils';
|
||||
import { DEPART_MANGE_AUTH_CONFIG_KEY } from '/@/enums/cacheEnum';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
|
||||
const { prefixCls } = useDesign('j-depart-form-content');
|
||||
const props = defineProps({
|
||||
@ -64,29 +68,47 @@
|
||||
|
||||
const basicTree = ref();
|
||||
const loading = ref<boolean>(false);
|
||||
//树的全部节点信息
|
||||
const allTreeKeys = ref([]);
|
||||
const treeData = ref<any[]>([]);
|
||||
const expandedKeys = ref<Array<any>>([]);
|
||||
const selectedKeys = ref<Array<any>>([]);
|
||||
const checkedKeys = ref<Array<any>>([]);
|
||||
const lastCheckedKeys = ref<Array<any>>([]);
|
||||
const checkStrictly = ref(true);
|
||||
const checkStrictly = ref(false);
|
||||
const { t } = useI18n();
|
||||
|
||||
// 注册数据规则授权弹窗抽屉
|
||||
const [registerDataRuleDrawer, dataRuleDrawer] = useDrawer();
|
||||
|
||||
// onCreated
|
||||
loadData();
|
||||
loadData({
|
||||
success: (ids) => {
|
||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1689】同步系统角色改法加上缓存层级关联等功能
|
||||
const localData = localStorage.getItem(DEPART_MANGE_AUTH_CONFIG_KEY);
|
||||
if (localData) {
|
||||
const obj = JSON.parse(localData);
|
||||
obj.level && toggleRelationAll(obj.level == 'relation' ? false : true);
|
||||
obj.expand && toggleExpandAll(obj.expand == 'openAll' ? true :false);
|
||||
} else {
|
||||
// expandedKeys.value = ids;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1689】同步系统角色改法加上缓存层级关联等功能
|
||||
}
|
||||
});
|
||||
watch(departId, () => loadDepartPermission(), { immediate: true });
|
||||
|
||||
async function loadData() {
|
||||
async function loadData(options: any = {}) {
|
||||
try {
|
||||
loading.value = true;
|
||||
let { treeList } = await queryRoleTreeList();
|
||||
let { treeList, ids } = await queryRoleTreeList();
|
||||
//update-begin---author:wangshuai---date:2024-04-08---for:【issues/1169】部门管理功能中的【部门权限】中未翻译 t('') 多语言---
|
||||
treeData.value = translateTitle(treeList);
|
||||
//update-end---author:wangshuai---date:2024-04-08---for:【issues/1169】部门管理功能中的【部门权限】中未翻译 t('') 多语言---
|
||||
await nextTick();
|
||||
toggleExpandAll(true);
|
||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1689】同步系统角色改法加上缓存层级关联等功能
|
||||
allTreeKeys.value = ids;
|
||||
options.success?.(ids);
|
||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1689】同步系统角色改法加上缓存层级关联等功能
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
@ -120,14 +142,59 @@
|
||||
}
|
||||
}
|
||||
|
||||
// tree勾选复选框事件
|
||||
function onCheck(event) {
|
||||
if (!Array.isArray(event)) {
|
||||
checkedKeys.value = event.checked;
|
||||
/**
|
||||
* 点击选中
|
||||
* 2024-07-04
|
||||
* liaozhiyang
|
||||
*/
|
||||
function onCheck(o, e) {
|
||||
// checkStrictly: true=>层级独立,false=>层级关联.
|
||||
if (checkStrictly.value) {
|
||||
checkedKeys.value = o.checked ? o.checked : o;
|
||||
} else {
|
||||
checkedKeys.value = event;
|
||||
const keys = getNodeAllKey(e.node, 'children', 'key');
|
||||
if (e.checked) {
|
||||
// 反复操作下可能会有重复的keys,得用new Set去重下
|
||||
checkedKeys.value = [...new Set([...checkedKeys.value, ...keys])];
|
||||
} else {
|
||||
const result = removeMatchingItems(checkedKeys.value, keys);
|
||||
checkedKeys.value = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 2024-07-04
|
||||
* liaozhiyang
|
||||
* 删除相匹配数组的项
|
||||
*/
|
||||
function removeMatchingItems(arr1, arr2) {
|
||||
// 使用哈希表记录 arr2 中的元素
|
||||
const hashTable = {};
|
||||
for (const item of arr2) {
|
||||
hashTable[item] = true;
|
||||
}
|
||||
// 使用 filter 方法遍历第一个数组,过滤出不在哈希表中存在的项
|
||||
return arr1.filter((item) => !hashTable[item]);
|
||||
}
|
||||
/**
|
||||
* 2024-07-04
|
||||
* liaozhiyang
|
||||
* 获取当前节点及以下所有子孙级的key
|
||||
*/
|
||||
function getNodeAllKey(node: any, children: any, key: string) {
|
||||
const result: any = [];
|
||||
result.push(node[key]);
|
||||
const recursion = (data) => {
|
||||
data.forEach((item: any) => {
|
||||
result.push(item[key]);
|
||||
if (item[children]?.length) {
|
||||
recursion(item[children]);
|
||||
}
|
||||
});
|
||||
};
|
||||
node[children]?.length && recursion(node[children]);
|
||||
return result;
|
||||
}
|
||||
|
||||
// tree展开事件
|
||||
function onExpand($expandedKeys) {
|
||||
@ -152,17 +219,50 @@
|
||||
|
||||
// 切换展开收起
|
||||
async function toggleExpandAll(flag) {
|
||||
basicTree.value.expandAll(flag);
|
||||
await nextTick();
|
||||
expandedKeys.value = basicTree.value.getExpandedKeys();
|
||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1689】同步系统角色改法加上缓存层级关联等功能
|
||||
if (flag) {
|
||||
expandedKeys.value = allTreeKeys.value;
|
||||
saveLocalOperation('expand', 'openAll');
|
||||
} else {
|
||||
expandedKeys.value = [];
|
||||
saveLocalOperation('expand', 'closeAll');
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1689】同步系统角色改法加上缓存层级关联等功能
|
||||
}
|
||||
|
||||
// 切换全选
|
||||
async function toggleCheckALL(flag) {
|
||||
basicTree.value.checkAll(flag);
|
||||
await nextTick();
|
||||
checkedKeys.value = basicTree.value.getCheckedKeys();
|
||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1689】同步系统角色改法加上缓存层级关联等功能
|
||||
if (flag) {
|
||||
checkedKeys.value = allTreeKeys.value;
|
||||
} else {
|
||||
checkedKeys.value = [];
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1689】同步系统角色改法加上缓存层级关联等功能
|
||||
}
|
||||
|
||||
// 切换层级关联(独立)
|
||||
const toggleRelationAll = (flag) => {
|
||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1689】同步系统角色改法加上缓存层级关联等功能
|
||||
checkStrictly.value = flag;
|
||||
if (flag) {
|
||||
saveLocalOperation('level', 'standAlone');
|
||||
} else {
|
||||
saveLocalOperation('level', 'relation');
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1689】同步系统角色改法加上缓存层级关联等功能
|
||||
};
|
||||
/**
|
||||
* 2024-07-04
|
||||
* liaozhiyang
|
||||
* 缓存
|
||||
* */
|
||||
const saveLocalOperation = (key, value) => {
|
||||
const localData = localStorage.getItem(DEPART_MANGE_AUTH_CONFIG_KEY);
|
||||
const obj = localData ? JSON.parse(localData) : {};
|
||||
obj[key] = value;
|
||||
localStorage.setItem(DEPART_MANGE_AUTH_CONFIG_KEY, JSON.stringify(obj))
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<BasicDrawer
|
||||
title="部门角色权限配置"
|
||||
:width="650"
|
||||
:loading="loading"
|
||||
showFooter
|
||||
@ -9,18 +8,35 @@
|
||||
@close="onClose"
|
||||
@register="registerDrawer"
|
||||
>
|
||||
<template #title>
|
||||
部门角色权限配置
|
||||
<a-dropdown>
|
||||
<Icon icon="ant-design:more-outlined" class="more-icon" />
|
||||
<template #overlay>
|
||||
<a-menu @click="treeMenuClick">
|
||||
<a-menu-item key="checkAll">{{ t('component.tree.selectAll') }}</a-menu-item>
|
||||
<a-menu-item key="cancelCheck">{{ t('component.tree.unSelectAll') }}</a-menu-item>
|
||||
<div class="line"></div>
|
||||
<a-menu-item key="openAll">{{ t('component.tree.expandAll') }}</a-menu-item>
|
||||
<a-menu-item key="closeAll">{{ t('component.tree.unExpandAll') }}</a-menu-item>
|
||||
<div class="line"></div>
|
||||
<a-menu-item key="relation">{{ t('component.tree.checkStrictly') }}</a-menu-item>
|
||||
<a-menu-item key="standAlone">{{ t('component.tree.checkUnStrictly') }}</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<div>
|
||||
<a-spin :spinning="loading">
|
||||
<template v-if="treeData.length > 0">
|
||||
<BasicTree
|
||||
title="所拥有的部门权限"
|
||||
toolbar
|
||||
checkable
|
||||
:treeData="treeData"
|
||||
:checkedKeys="checkedKeys"
|
||||
:selectedKeys="selectedKeys"
|
||||
:expandedKeys="expandedKeys"
|
||||
:checkStrictly="checkStrictly"
|
||||
:checkStrictly="true"
|
||||
:clickRowToExpand="false"
|
||||
@check="onCheck"
|
||||
@expand="onExpand"
|
||||
@ -49,10 +65,11 @@
|
||||
import { BasicTree } from '/@/components/Tree/index';
|
||||
import { BasicDrawer, useDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import DepartRoleDataRuleDrawer from './DepartRoleDataRuleDrawer.vue';
|
||||
import { queryTreeListForDeptRole, queryDeptRolePermission, saveDeptRolePermission } from '../depart.user.api';
|
||||
import { translateTitle } from "@/utils/common/compUtils";
|
||||
import { DEPART_ROLE_AUTH_CONFIG_KEY } from '/@/enums/cacheEnum';
|
||||
|
||||
defineEmits(['register']);
|
||||
const { createMessage } = useMessage();
|
||||
@ -65,25 +82,42 @@
|
||||
const expandedKeys = ref<Array<any>>([]);
|
||||
const selectedKeys = ref<Array<any>>([]);
|
||||
const allTreeKeys = ref<Array<any>>([]);
|
||||
const checkStrictly = ref(true);
|
||||
//父子节点选中状态是否关联 true不关联,false关联
|
||||
const checkStrictly = ref(false);
|
||||
const { t } = useI18n();
|
||||
|
||||
// 注册抽屉组件
|
||||
const [registerDrawer, { closeDrawer }] = useDrawerInner((data) => {
|
||||
roleId.value = data.record.id;
|
||||
departId.value = data.record.departId;
|
||||
loadData();
|
||||
loadData({
|
||||
success: (ids) => {
|
||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1619】同步系统角色改法加上缓存,默认层级关联修正原生层级关联bug
|
||||
const localData = localStorage.getItem(DEPART_ROLE_AUTH_CONFIG_KEY);
|
||||
if (localData) {
|
||||
const obj = JSON.parse(localData);
|
||||
obj.level && treeMenuClick({ key: obj.level });
|
||||
obj.expand && treeMenuClick({ key: obj.expand });
|
||||
} else {
|
||||
// expandedKeys.value = ids;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1619】同步系统角色改法加上缓存,默认层级关联修正原生层级关联bug
|
||||
},
|
||||
});
|
||||
});
|
||||
// 注册数据规则授权弹窗抽屉
|
||||
const [registerDataRuleDrawer, dataRuleDrawer] = useDrawer();
|
||||
|
||||
async function loadData() {
|
||||
async function loadData(options: any = {}) {
|
||||
try {
|
||||
loading.value = true;
|
||||
// 用户角色授权功能,查询菜单权限树
|
||||
const { ids, treeList } = await queryTreeListForDeptRole({ departId: departId.value });
|
||||
if (ids.length > 0) {
|
||||
allTreeKeys.value = ids;
|
||||
expandedKeys.value = ids;
|
||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1619】同步系统角色改法加上缓存,默认层级关联修正原生层级关联bug
|
||||
options.success?.(ids);
|
||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1619】同步系统角色改法加上缓存,默认层级关联修正原生层级关联bug
|
||||
//update-begin---author:wangshuai---date:2024-04-08---for:【issues/1169】我的部门功能中的【部门权限】中未翻译 t('') 多语言---
|
||||
treeData.value = translateTitle(treeList);
|
||||
//update-end---author:wangshuai---date:2024-04-08---for:【issues/1169】我的部门功能中的【部门权限】中未翻译 t('') 多语言---
|
||||
@ -107,14 +141,59 @@
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
// tree勾选复选框事件
|
||||
function onCheck(event) {
|
||||
/**
|
||||
* 点击选中
|
||||
* 2024-07-04
|
||||
* liaozhiyang
|
||||
*/
|
||||
function onCheck(o, e) {
|
||||
// checkStrictly: true=>层级独立,false=>层级关联.
|
||||
if (checkStrictly.value) {
|
||||
checkedKeys.value = event.checked;
|
||||
checkedKeys.value = o.checked ? o.checked : o;
|
||||
} else {
|
||||
checkedKeys.value = event;
|
||||
const keys = getNodeAllKey(e.node, 'children', 'key');
|
||||
if (e.checked) {
|
||||
// 反复操作下可能会有重复的keys,得用new Set去重下
|
||||
checkedKeys.value = [...new Set([...checkedKeys.value, ...keys])];
|
||||
} else {
|
||||
const result = removeMatchingItems(checkedKeys.value, keys);
|
||||
checkedKeys.value = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 2024-07-04
|
||||
* liaozhiyang
|
||||
* 删除相匹配数组的项
|
||||
*/
|
||||
function removeMatchingItems(arr1, arr2) {
|
||||
// 使用哈希表记录 arr2 中的元素
|
||||
const hashTable = {};
|
||||
for (const item of arr2) {
|
||||
hashTable[item] = true;
|
||||
}
|
||||
// 使用 filter 方法遍历第一个数组,过滤出不在哈希表中存在的项
|
||||
return arr1.filter((item) => !hashTable[item]);
|
||||
}
|
||||
/**
|
||||
* 2024-07-04
|
||||
* liaozhiyang
|
||||
* 获取当前节点及以下所有子孙级的key
|
||||
*/
|
||||
function getNodeAllKey(node: any, children: any, key: string) {
|
||||
const result: any = [];
|
||||
result.push(node[key]);
|
||||
const recursion = (data) => {
|
||||
data.forEach((item: any) => {
|
||||
result.push(item[key]);
|
||||
if (item[children]?.length) {
|
||||
recursion(item[children]);
|
||||
}
|
||||
});
|
||||
};
|
||||
node[children]?.length && recursion(node[children]);
|
||||
return result;
|
||||
}
|
||||
|
||||
// tree展开事件
|
||||
function onExpand($expandedKeys) {
|
||||
@ -158,4 +237,61 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 树菜单选择
|
||||
* @param key
|
||||
*/
|
||||
function treeMenuClick({ key }) {
|
||||
if (key === 'checkAll') {
|
||||
checkedKeys.value = allTreeKeys.value;
|
||||
} else if (key === 'cancelCheck') {
|
||||
checkedKeys.value = [];
|
||||
} else if (key === 'openAll') {
|
||||
expandedKeys.value = allTreeKeys.value;
|
||||
saveLocalOperation('expand', 'openAll');
|
||||
} else if (key === 'closeAll') {
|
||||
expandedKeys.value = [];
|
||||
saveLocalOperation('expand', 'closeAll');
|
||||
} else if (key === 'relation') {
|
||||
checkStrictly.value = false;
|
||||
saveLocalOperation('level', 'relation');
|
||||
} else {
|
||||
checkStrictly.value = true;
|
||||
saveLocalOperation('level', 'standAlone');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 2024-07-04
|
||||
* liaozhiyang
|
||||
* */
|
||||
const saveLocalOperation = (key, value) => {
|
||||
const localData = localStorage.getItem(DEPART_ROLE_AUTH_CONFIG_KEY);
|
||||
const obj = localData ? JSON.parse(localData) : {};
|
||||
obj[key] = value;
|
||||
localStorage.setItem(DEPART_ROLE_AUTH_CONFIG_KEY, JSON.stringify(obj));
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
/** 固定操作按钮 */
|
||||
.jeecg-basic-tree {
|
||||
position: absolute;
|
||||
width: 618px;
|
||||
}
|
||||
.line {
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
.more-icon {
|
||||
font-size: 20px !important;
|
||||
color: black;
|
||||
display: inline-flex;
|
||||
float: right;
|
||||
margin-right: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
:deep(.jeecg-tree-header) {
|
||||
border-bottom: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="addDepartRole">添加部门角色</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="addDepartRole" :disabled="!departId">添加部门角色</a-button>
|
||||
<template v-if="selectedRowKeys.length > 0">
|
||||
<a-divider type="vertical" />
|
||||
<a-dropdown>
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="selectAddUser">添加已有用户</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="createUser">新建用户</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="selectAddUser" :disabled="!departId">添加已有用户</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="createUser" :disabled="!departId">新建用户</a-button>
|
||||
<template v-if="selectedRowKeys.length > 0">
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
@ -29,7 +29,7 @@
|
||||
</BasicTable>
|
||||
<UserDrawer @register="registerDrawer" @success="onUserDrawerSuccess" />
|
||||
<DepartRoleUserAuthDrawer @register="registerUserAuthDrawer" />
|
||||
<UserSelectModal rowKey="id" @register="registerSelUserModal" @getSelectResult="onSelectUserOk" />
|
||||
<UserSelectModal ref="userSelectModalRef" rowKey="id" @register="registerSelUserModal" @getSelectResult="onSelectUserOk" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@ -50,6 +50,7 @@
|
||||
const props = defineProps({
|
||||
data: { require: true, type: Object },
|
||||
});
|
||||
const userSelectModalRef: any = ref(null);
|
||||
// 当前选中的部门ID,可能会为空,代表未选择部门
|
||||
const departId = computed(() => props.data?.id);
|
||||
|
||||
@ -93,6 +94,9 @@
|
||||
beforeFetch(params) {
|
||||
params.depId = departId.value;
|
||||
},
|
||||
// update-begin--author:liaozhiyang---date:20240717---for:【TV360X-1861】没部门时不加载用户信息
|
||||
immediate: !!departId.value,
|
||||
// update-end--author:liaozhiyang---date:20240717---for:【TV360X-1861】没部门时不加载用户信息
|
||||
},
|
||||
});
|
||||
|
||||
@ -155,6 +159,9 @@
|
||||
|
||||
// 选择添加已有用户
|
||||
function selectAddUser() {
|
||||
// update-begin--author:liaozhiyang---date:20240308---for:【TV360X-1613】再次打开还是上次的选中用户,没置空
|
||||
userSelectModalRef.value.rowSelection.selectedRowKeys = [];
|
||||
// update-end--author:liaozhiyang---date:20240308---for:【TV360X-1613】再次打开还是上次的选中用户,没置空
|
||||
selUserModal.openModal();
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,27 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="字典回收站" :showOkBtn="false" width="1000px" destroyOnClose>
|
||||
<BasicTable @register="registerTable">
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-dropdown v-if="checkedKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
批量删除
|
||||
</a-menu-item>
|
||||
<a-menu-item key="2" @click="batchHandleRevert">
|
||||
<Icon icon="ant-design:redo-outlined"></Icon>
|
||||
批量取回
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button
|
||||
>批量操作
|
||||
<Icon icon="ant-design:down-outlined"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
@ -13,13 +34,16 @@
|
||||
import { BasicModal, useModalInner } from '/src/components/Modal';
|
||||
import { BasicTable, useTable, TableAction } from '/src/components/Table';
|
||||
import { recycleBincolumns } from '../dict.data';
|
||||
import { getRecycleBinList, putRecycleBin, deleteRecycleBin } from '../dict.api';
|
||||
import { getRecycleBinList, putRecycleBin, deleteRecycleBin, batchPutRecycleBin, batchDeleteRecycleBin } from '../dict.api';
|
||||
// 声明Emits
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(() => {
|
||||
checkedKeys.value = [];
|
||||
});
|
||||
//注册table数据
|
||||
const [registerTable, { reload }] = useTable({
|
||||
rowKey: 'id',
|
||||
api: getRecycleBinList,
|
||||
columns: recycleBincolumns,
|
||||
striped: true,
|
||||
@ -39,7 +63,23 @@
|
||||
fixed: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
// update-begin--author:liaozhiyang---date:20240709---for:【TV360X-1663】数据字典回收增加批量功能
|
||||
/**
|
||||
* 选择列配置
|
||||
*/
|
||||
const rowSelection = {
|
||||
type: 'checkbox',
|
||||
columnWidth: 50,
|
||||
selectedRowKeys: checkedKeys,
|
||||
onChange: onSelectChange,
|
||||
};
|
||||
/**
|
||||
* 选择事件
|
||||
*/
|
||||
function onSelectChange(selectedRowKeys: (string | number)[]) {
|
||||
checkedKeys.value = selectedRowKeys;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240709---for:【TV360X-1663】数据字典回收增加批量功能
|
||||
/**
|
||||
* 还原事件
|
||||
*/
|
||||
@ -57,13 +97,24 @@
|
||||
* 批量还原事件
|
||||
*/
|
||||
function batchHandleRevert() {
|
||||
handleRevert({ id: toRaw(checkedKeys.value).join(',') });
|
||||
batchPutRecycleBin({ ids: toRaw(checkedKeys.value).join(',') }, () => {
|
||||
// update-begin--author:liaozhiyang---date:20240709---for:【TV360X-1663】数据字典回收增加批量功能
|
||||
reload();
|
||||
checkedKeys.value = [];
|
||||
emit('success');
|
||||
// update-end--author:liaozhiyang---date:20240709---for:【TV360X-1663】数据字典回收增加批量功能
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
function batchHandleDelete() {
|
||||
handleDelete({ id: toRaw(checkedKeys.value).join(',') });
|
||||
batchDeleteRecycleBin({ ids: toRaw(checkedKeys.value).join(',') }, () => {
|
||||
// update-begin--author:liaozhiyang---date:20240709---for:【TV360X-1663】数据字典回收增加批量功能
|
||||
checkedKeys.value = [];
|
||||
reload();
|
||||
// update-end--author:liaozhiyang---date:20240709---for:【TV360X-1663】数据字典回收增加批量功能
|
||||
});
|
||||
}
|
||||
//获取操作栏事件
|
||||
function getTableAction(record) {
|
||||
|
||||
@ -11,6 +11,8 @@ enum Api {
|
||||
exportXls = '/sys/dict/exportXls',
|
||||
recycleBinList = '/sys/dict/deleteList',
|
||||
putRecycleBin = '/sys/dict/back',
|
||||
batchPutRecycleBin = '/sys/dict/putRecycleBin',
|
||||
batchDeleteRecycleBin = '/sys/dict/deleteRecycleBin',
|
||||
deleteRecycleBin = '/sys/dict/deletePhysic',
|
||||
itemList = '/sys/dictItem/list',
|
||||
deleteItem = '/sys/dictItem/delete',
|
||||
@ -78,6 +80,16 @@ export const duplicateCheck = (params) => defHttp.get({ url: Api.duplicateCheck,
|
||||
* @param params
|
||||
*/
|
||||
export const getRecycleBinList = (params) => defHttp.get({ url: Api.recycleBinList, params });
|
||||
|
||||
/**
|
||||
* 回收站批量还原
|
||||
* @param params
|
||||
*/
|
||||
export const batchPutRecycleBin = (params, handleSuccess) => {
|
||||
return defHttp.put({ url: Api.batchPutRecycleBin, params}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 回收站还原
|
||||
* @param params
|
||||
@ -87,6 +99,15 @@ export const putRecycleBin = (id, handleSuccess) => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 回收站批量删除
|
||||
* @param params
|
||||
*/
|
||||
export const batchDeleteRecycleBin = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: `${Api.batchDeleteRecycleBin}?ids=${params.ids}`}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 回收站删除
|
||||
* @param params
|
||||
|
||||
@ -44,13 +44,13 @@ export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '字典名称',
|
||||
field: 'dictName',
|
||||
component: 'Input',
|
||||
component: 'JInput',
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '字典编码',
|
||||
field: 'dictCode',
|
||||
component: 'Input',
|
||||
component: 'JInput',
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
];
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
});
|
||||
|
||||
//注册table数据
|
||||
const [registerTable, { reload, updateTableDataRecord }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const [registerTable, { reload, updateTableDataRecord }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
@ -127,7 +127,13 @@
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDeleteDict({ ids: selectedRowKeys.value }, reload);
|
||||
await batchDeleteDict({ ids: selectedRowKeys.value }, () => {
|
||||
// update-begin--author:liaozhiyang---date:20240701---for:【TV360X-1665】数据字典批量删除后选中也清空
|
||||
reload();
|
||||
selectedRowKeys.value = [];
|
||||
selectedRows.value = [];
|
||||
// update-end--author:liaozhiyang---date:20240701---for:【TV360X-1665】数据字典批量删除后选中也清空
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" title="数据权限规则" :width="adaptiveWidth">
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" title="数据权限规则" :width="adaptiveWidth" :rootClassName="prefixCls">
|
||||
<BasicTable @register="registerTable">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleCreate"> 新增</a-button>
|
||||
@ -21,8 +21,10 @@
|
||||
import { dataRuleList, deleteRule } from './menu.api';
|
||||
import { ColEx } from '/@/components/Form/src/types';
|
||||
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
const permissionId = ref('');
|
||||
const { adaptiveWidth } = useDrawerAdaptiveWidth();
|
||||
const { prefixCls } = useDesign('sys-menu-dataRulelist');
|
||||
//权限规则model
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const [registerDrawer] = useDrawerInner(async (data) => {
|
||||
@ -120,3 +122,23 @@
|
||||
];
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
// -update-begin--author:liaozhiyang---date:20240702---for:【TV360X-1660】菜单管理-数据权限的查询和按钮没间隙
|
||||
@prefix-cls: ~'@{namespace}-sys-menu-dataRulelist';
|
||||
.@{prefix-cls} {
|
||||
.jeecg-basic-table {
|
||||
padding: 0;
|
||||
}
|
||||
.btnArea {
|
||||
.ant-btn {
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
&:first-child {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// -update-end--author:liaozhiyang---date:20240702---for:【TV360X-1660】菜单管理-数据权限的查询和按钮没间隙
|
||||
</style>
|
||||
|
||||
@ -78,8 +78,8 @@
|
||||
tableSetting: { fullScreen: true },
|
||||
formConfig: {
|
||||
// update-begin--author:liaozhiyang---date:20230803---for:【QQYUN-5873】查询区域lablel默认居左
|
||||
labelWidth:60,
|
||||
owProps: { gutter: 24 },
|
||||
labelWidth: 74,
|
||||
rowProps: { gutter: 24 },
|
||||
// update-end--author:liaozhiyang---date:20230803---for:【QQYUN-5873】查询区域lablel默认居左
|
||||
schemas: searchFormSchema,
|
||||
autoAdvancedCol: 4,
|
||||
@ -167,7 +167,12 @@
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDeleteMenu({ ids: checkedKeys.value }, reload);
|
||||
await batchDeleteMenu({ ids: checkedKeys.value }, () => {
|
||||
// -update-begin--author:liaozhiyang---date:20240702---for:【TV360X-1662】菜单管理、定时任务批量删除清空选中
|
||||
reload();
|
||||
checkedKeys.value = [];
|
||||
// -update-end--author:liaozhiyang---date:20240702---for:【TV360X-1662】菜单管理、定时任务批量删除清空选中
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
|
||||
@ -399,12 +399,50 @@ export const dataRuleFormSchema: FormSchema[] = [
|
||||
getPopupContainer: (node) => document.body,
|
||||
},
|
||||
},
|
||||
// update-begin--author:liaozhiyang---date:20240724---for:【TV360X-1864】添加系统变量
|
||||
{
|
||||
field: 'ruleValue',
|
||||
component: 'JInputSelect',
|
||||
label: '规则值',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
componentProps: {
|
||||
selectPlaceholder: '可选择系统变量',
|
||||
inputPlaceholder: '请输入',
|
||||
getPopupContainer: () => document.body,
|
||||
selectWidth: '200px',
|
||||
options: [
|
||||
{
|
||||
label: '登录用户账号',
|
||||
value: '#{sys_user_code}',
|
||||
},
|
||||
{
|
||||
label: '登录用户名称',
|
||||
value: '#{sys_user_name}',
|
||||
},
|
||||
{
|
||||
label: '当前日期',
|
||||
value: '#{sys_date}',
|
||||
},
|
||||
{
|
||||
label: '当前时间',
|
||||
value: '#{sys_time}',
|
||||
},
|
||||
{
|
||||
label: '登录用户部门',
|
||||
value: '#{sys_org_code}',
|
||||
},
|
||||
{
|
||||
label: '用户拥有部门',
|
||||
value: '#{sys_multi_org_code}',
|
||||
},
|
||||
{
|
||||
label: '登录用户租户',
|
||||
value: '#{tenant_id}',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
// update-end--author:liaozhiyang---date:20240724---for:【TV360X-1864】添加系统变量
|
||||
{
|
||||
field: 'status',
|
||||
label: '状态',
|
||||
|
||||
@ -20,5 +20,8 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 500px;
|
||||
// -update-begin--author:liaozhiyang---date:20240702---for:【TV360X-1685】通知公告查看出现两个滚动条
|
||||
display: block;
|
||||
// -update-end--author:liaozhiyang---date:20240702---for:【TV360X-1685】通知公告查看出现两个滚动条
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -41,13 +41,16 @@
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
//提交表单
|
||||
//update-begin-author:liusq---date:20230404--for: [issue#429]新增通知公告提交指定用户参数有undefined ---
|
||||
//update-begin-author:liusq---date:20230404--for: [issue#429]新增通知公告提交指定用户参数有undefined ---
|
||||
if(values.msgType==='ALL'){
|
||||
values.userIds = '';
|
||||
}else{
|
||||
values.userIds += ',';
|
||||
}
|
||||
//update-end-author:liusq---date:20230404--for: [issue#429]新增通知公告提交指定用户参数有undefined ---
|
||||
//update-end-author:liusq---date:20230404--for: [issue#429]新增通知公告提交指定用户参数有undefined ---
|
||||
if (isUpdate.value) {
|
||||
values.sendStatus = '0';
|
||||
}
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
|
||||
@ -129,7 +129,7 @@
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
ifShow: record.sendStatus == 0,
|
||||
ifShow: record.sendStatus == 0 || record.sendStatus == '2',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@ -95,6 +95,22 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps: {
|
||||
placeholder: '请输入标题',
|
||||
},
|
||||
// update-begin--author:liaozhiyang---date:20240701---for:【TV360X-1632】标题过长保存报错,长度校验
|
||||
dynamicRules() {
|
||||
return [
|
||||
{
|
||||
validator: (_, value) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (value.length > 100) {
|
||||
reject('最长100个字符');
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
// update-end--author:liaozhiyang---date:20240701---for:【TV360X-1632】标题过长保存报错,长度校验
|
||||
},
|
||||
{
|
||||
field: 'msgAbstract',
|
||||
@ -132,7 +148,9 @@ export const formSchema: FormSchema[] = [
|
||||
required: true,
|
||||
componentProps: {
|
||||
rowKey: 'id',
|
||||
labelKey: 'username',
|
||||
// update-begin--author:liaozhiyang---date:20240701---for:【TV360X-1627】通知公告用户选择组件没翻译
|
||||
labelKey: 'realname',
|
||||
// update-end--author:liaozhiyang---date:20240701---for:【TV360X-1627】通知公告用户选择组件没翻译
|
||||
},
|
||||
ifShow: ({ values }) => values.msgType == 'USER',
|
||||
},
|
||||
|
||||
@ -144,7 +144,12 @@
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDeleteUserRole({ userIds: checkedKeys.value.join(','), roleId: roleId.value }, reload);
|
||||
await batchDeleteUserRole({ userIds: checkedKeys.value.join(','), roleId: roleId.value }, () => {
|
||||
// update-begin--author:liaozhiyang---date:20240701---for:【TV360X-1655】批量取消关联之后清空选中记录
|
||||
reload();
|
||||
checkedKeys.value = [];
|
||||
// update-end--author:liaozhiyang---date:20240701---for:【TV360X-1655】批量取消关联之后清空选中记录
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="用户选择列表" width="1000px" @ok="handleSubmit" destroyOnClose>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="用户选择列表" width="1000px" @ok="handleSubmit" destroyOnClose @openChange="handleOpenChange">
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
@ -47,6 +47,14 @@
|
||||
checkedKeys.value = selectedRowKeys;
|
||||
}
|
||||
|
||||
const handleOpenChange = (visible) => {
|
||||
// -update-begin--author:liaozhiyang---date:20240702---for:【TV360X-1679】系统角色-角色用户再次打开弹窗重置之前选中的状态
|
||||
if (visible) {
|
||||
checkedKeys.value = [];
|
||||
}
|
||||
// -update-end--author:liaozhiyang---date:20240702---for:【TV360X-1679】系统角色-角色用户再次打开弹窗重置之前选中的状态
|
||||
};
|
||||
|
||||
//提交事件
|
||||
function handleSubmit() {
|
||||
setModalProps({ confirmLoading: true });
|
||||
|
||||
@ -58,6 +58,7 @@ export const searchUserFormSchema: FormSchema[] = [
|
||||
label: '用户账号',
|
||||
component: 'Input',
|
||||
colProps: { span: 12 },
|
||||
labelWidth: 74,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ import {saveOrUpdate} from '../SysTableWhiteList.api';
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
//表单配置
|
||||
const [registerForm, {resetFields, setFieldsValue, validate}] = useForm({
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
|
||||
labelWidth: 120,
|
||||
wrapperCol: null,
|
||||
schemas: formSchema,
|
||||
@ -44,6 +44,7 @@ const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data)
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter })
|
||||
});
|
||||
//设置标题
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
const isUpdate = ref(true);
|
||||
const rowId = ref('');
|
||||
const departOptions = ref([]);
|
||||
let isFormDepartUser = false;
|
||||
//表单配置
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, updateSchema }] = useForm({
|
||||
labelWidth: 90,
|
||||
@ -78,6 +79,9 @@
|
||||
}
|
||||
//处理角色用户列表情况(和角色列表有关系)
|
||||
data.selectedroles && (await setFieldsValue({ selectedroles: data.selectedroles }));
|
||||
// -update-begin--author:liaozhiyang---date:20240702---for:【TV360X-1737】部门用户编辑接口,增加参数updateFromPage:"deptUsers"
|
||||
isFormDepartUser = data?.departDisabled === true ? true : false;
|
||||
// -update-end--author:liaozhiyang---date:20240702---for:【TV360X-1737】部门用户编辑接口,增加参数updateFromPage:"deptUsers"
|
||||
//编辑时隐藏密码/角色列表隐藏角色信息/我的部门时隐藏所属部门
|
||||
updateSchema([
|
||||
{
|
||||
@ -99,11 +103,11 @@
|
||||
},
|
||||
{
|
||||
field: 'selecteddeparts',
|
||||
show: !data?.departDisabled ?? false,
|
||||
show: !data?.departDisabled,
|
||||
},
|
||||
{
|
||||
field: 'selectedroles',
|
||||
show: !data?.departDisabled ?? false,
|
||||
show: !data?.departDisabled,
|
||||
//update-begin---author:wangshuai ---date:20230424 for:【issues/4844】多租户模式下,新增或编辑用户,选择角色一栏,角色选项没有做租户隔离------------
|
||||
//判断是否为多租户模式
|
||||
componentProps:{
|
||||
@ -155,8 +159,14 @@
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
values.userIdentity === 1 && (values.departIds = '');
|
||||
let isUpdateVal = unref(isUpdate);
|
||||
// -update-begin--author:liaozhiyang---date:20240702---for:【TV360X-1737】部门用户编辑接口,增加参数updateFromPage:"deptUsers"
|
||||
let params = values;
|
||||
if (isFormDepartUser) {
|
||||
params = { ...params, updateFromPage: 'deptUsers' };
|
||||
}
|
||||
// -update-end--author:liaozhiyang---date:20240702---for:【TV360X-1737】部门用户编辑接口,增加参数updateFromPage:"deptUsers"
|
||||
//提交表单
|
||||
await saveOrUpdateUser(values, isUpdateVal);
|
||||
await saveOrUpdateUser(params, isUpdateVal);
|
||||
//关闭弹窗
|
||||
closeDrawer();
|
||||
//刷新列表
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="用户回收站" :showOkBtn="false" width="1000px" destroyOnClose>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="用户回收站" :showOkBtn="false" width="1000px" destroyOnClose @fullScreen="handleFullScreen">
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection" :scroll="scroll">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-dropdown v-if="checkedKeys.length > 0">
|
||||
@ -32,7 +32,7 @@
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, toRaw, unref } from 'vue';
|
||||
import { ref, toRaw, unref, watch } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { recycleColumns } from './user.data';
|
||||
@ -46,6 +46,7 @@
|
||||
const [registerModal] = useModalInner(() => {
|
||||
checkedKeys.value = [];
|
||||
});
|
||||
const scroll = ref({ y: 0 });
|
||||
//注册table数据
|
||||
const [registerTable, { reload }] = useTable({
|
||||
api: getRecycleBinList,
|
||||
@ -68,6 +69,33 @@
|
||||
fixed: undefined,
|
||||
},
|
||||
});
|
||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1657】系统用户回收站弹窗分页展示在可视区内
|
||||
const handleFullScreen = (maximize) => {
|
||||
setTableHeight(maximize);
|
||||
};
|
||||
const setTableHeight = (maximize) => {
|
||||
const clientHeight = document.documentElement.clientHeight;
|
||||
scroll.value = {
|
||||
y: clientHeight - (maximize ? 300 : 500),
|
||||
};
|
||||
};
|
||||
setTableHeight(false);
|
||||
watch(
|
||||
checkedKeys,
|
||||
(newValue, oldValue) => {
|
||||
if (checkedKeys.value.length && oldValue.length == 0) {
|
||||
scroll.value = {
|
||||
y: scroll.value.y - 50,
|
||||
};
|
||||
} else if (checkedKeys.value.length == 0 && oldValue.length) {
|
||||
scroll.value = {
|
||||
y: scroll.value.y + 50,
|
||||
};
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1657】系统用户回收站弹窗分页展示在可视区内
|
||||
/**
|
||||
* 选择列配置
|
||||
*/
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
import { isObject } from '/@/utils/is';
|
||||
enum Api {
|
||||
listNoCareTenant = '/sys/user/listAll',
|
||||
list = '/sys/user/list',
|
||||
@ -103,11 +103,19 @@ export const duplicateCheck = (params) => defHttp.get({ url: Api.duplicateCheck,
|
||||
* 唯一校验( 延迟【防抖】)
|
||||
* @param params
|
||||
*/
|
||||
let timer;
|
||||
const timer = {};
|
||||
export const duplicateCheckDelay = (params) => {
|
||||
return new Promise((resove, rejected) => {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
// -update-begin--author:liaozhiyang---date:20240619---for:【TV360X-1380】表单中使用多个duplicateCheckDelay,validate方法调用时会导致promise被挂起保存不了
|
||||
let key;
|
||||
if (isObject(params)) {
|
||||
key = `${params.tableName}_${params.fieldName}`;
|
||||
} else {
|
||||
key = params;
|
||||
}
|
||||
clearTimeout(timer[key]);
|
||||
// -update-end--author:liaozhiyang---date:20240619---for:【TV360X-1380】表单中使用多个duplicateCheckDelay,validate方法调用时会导致promise被挂起保存不了
|
||||
timer[key] = setTimeout(() => {
|
||||
defHttp
|
||||
.get({ url: Api.duplicateCheck, params }, { isTransformResponse: false })
|
||||
.then((res: any) => {
|
||||
@ -116,6 +124,7 @@ export const duplicateCheckDelay = (params) => {
|
||||
.catch((error) => {
|
||||
rejected(error);
|
||||
});
|
||||
delete timer[key];
|
||||
}, 500);
|
||||
});
|
||||
};
|
||||
|
||||
@ -138,6 +138,7 @@ export const formSchema: FormSchema[] = [
|
||||
label: '用户账号',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
dynamicDisabled: ({ values }) => {
|
||||
return !!values.id;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user