fix: bug#10706、10678
This commit is contained in:
parent
d19f39a0ae
commit
0e09858d38
|
@ -259,8 +259,10 @@ const table: any = {
|
|||
// 选中
|
||||
onSelectChange: (row: any) => {
|
||||
// 若该项的可选权限中没有分享权限,则不支持任何操作
|
||||
if (!row.permissionList.find((item: any) => item.value === 'share'))
|
||||
if (!row.permissionList.find((item: any) => item.value === 'share')) {
|
||||
message.warning('该资产不支持共享');
|
||||
return;
|
||||
}
|
||||
const selectedRowKeys = table._selectedRowKeys.value;
|
||||
const index = selectedRowKeys.indexOf(row.id);
|
||||
|
||||
|
@ -330,7 +332,9 @@ const table: any = {
|
|||
resolve({
|
||||
code: 200,
|
||||
result: {
|
||||
data: data.sort((a, b) => a.createTime - b.createTime),
|
||||
data: data.sort(
|
||||
(a, b) => a.createTime - b.createTime,
|
||||
),
|
||||
pageIndex,
|
||||
pageSize,
|
||||
total,
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
placeholder="请选择上级组织"
|
||||
:tree-data="treeData"
|
||||
:field-names="{ value: 'id' }"
|
||||
@change="handleTreeSelectChange"
|
||||
>
|
||||
<template #title="{ name }"> {{ name }} </template>
|
||||
</j-tree-select>
|
||||
|
@ -60,6 +61,21 @@ import {
|
|||
updateDepartment_api,
|
||||
} from '@/api/system/department';
|
||||
|
||||
type treeType = {
|
||||
id: string;
|
||||
parentId?: string;
|
||||
name: string;
|
||||
sortIndex: string | number;
|
||||
children?: treeType[];
|
||||
disabled?: boolean;
|
||||
};
|
||||
type formType = {
|
||||
id?: string;
|
||||
parentId?: string;
|
||||
name: string;
|
||||
sortIndex: string | number;
|
||||
};
|
||||
|
||||
const emits = defineEmits(['refresh', 'update:visible']);
|
||||
const props = defineProps<{
|
||||
treeData: any[];
|
||||
|
@ -91,8 +107,8 @@ const treeData = computed(() => {
|
|||
});
|
||||
/**
|
||||
* 在给定的树中通过id匹配
|
||||
* @param node
|
||||
* @param id
|
||||
* @param node
|
||||
* @param id
|
||||
*/
|
||||
const findItemById = (node: treeType[], id: string): treeType | null => {
|
||||
let result = null;
|
||||
|
@ -107,7 +123,7 @@ const findItemById = (node: treeType[], id: string): treeType | null => {
|
|||
};
|
||||
/**
|
||||
* 将此树下的所有节点禁用
|
||||
* @param treeNode
|
||||
* @param treeNode
|
||||
*/
|
||||
const filterTree = (treeNode: treeType[]) => {
|
||||
if (treeNode.length < 1) return;
|
||||
|
@ -160,18 +176,15 @@ const form = reactive({
|
|||
});
|
||||
form.init();
|
||||
|
||||
type treeType = {
|
||||
id: string;
|
||||
parentId?: string;
|
||||
name: string;
|
||||
sortIndex: string | number;
|
||||
children?: treeType[];
|
||||
disabled?: boolean;
|
||||
};
|
||||
type formType = {
|
||||
id?: string;
|
||||
parentId?: string;
|
||||
name: string;
|
||||
sortIndex: string | number;
|
||||
/**
|
||||
* 上级组织选择改变
|
||||
*/
|
||||
const handleTreeSelectChange = () => {
|
||||
// 上级组织
|
||||
const parent = treeData.value.find((f: any) => f.id === form.data.parentId);
|
||||
// 当前编辑的组织排序, 为选择上级组织的最大排序+1, 如上级组织没有自组织, 则默认为1
|
||||
form.data.sortIndex = parent?.children
|
||||
? parent.children[parent.children.length - 1].sortIndex + 1
|
||||
: 1;
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -520,7 +520,7 @@ const dialogs = reactive({
|
|||
});
|
||||
|
||||
table.init();
|
||||
nextTick(() => {
|
||||
watchEffect(() => {
|
||||
props.bindBool && table.clickAdd();
|
||||
emits('update:bindBool', false);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue