yuang-framework-ui-common 1.0.73 → 1.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,37 @@
|
|
1
|
+
import { nextTick } from 'vue';
|
2
|
+
import { http } from '../../../lib/config/httpConfig';
|
1
3
|
|
4
|
+
/**
|
5
|
+
* 处理分组树默认展开节点,由于树组件的默认展开节点是异步的,所以需要手动处理默认展开节点
|
6
|
+
*/
|
7
|
+
const handleFrameworkGroupTreeDefaultExpandNode = async ({ id, treeId }) => {
|
8
|
+
if (document.querySelectorAll(`#${treeId}`).length == 0) {
|
9
|
+
console.error(`参数[treeId]不存在`);
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
const res = await http.post('/uims-api/core/framework-group/selectAncestorList', { idForEqual: id, isReverseAncestorList: true });
|
13
|
+
const ancestorList = res.data.data;
|
14
|
+
expandNodeImpl({ ancestorList, index: 0, treeId });
|
15
|
+
};
|
2
16
|
|
3
|
-
|
17
|
+
/** 默认展开节点实现 */
|
18
|
+
const expandNodeImpl = ({ ancestorList, index, treeId }) => {
|
19
|
+
if (index >= ancestorList.length) {
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
const nodeList = document.querySelectorAll(`${!treeId ? '' : '#' + treeId}.el-tree [data-key='${ancestorList[index].id}'] .el-tree-node__expand-icon`) as any;
|
23
|
+
for (let i = 0; i < nodeList.length; i++) {
|
24
|
+
if (!nodeList[i].classList.contains('expanded')) {
|
25
|
+
nodeList[i] && nodeList[i].click();
|
26
|
+
}
|
27
|
+
}
|
28
|
+
nextTick(() => {
|
29
|
+
// 这里必须延迟一会运行,否则下级分组不会展开
|
30
|
+
setTimeout(() => {
|
31
|
+
index++;
|
32
|
+
expandNodeImpl({ ancestorList, index, treeId });
|
33
|
+
}, 200);
|
34
|
+
});
|
35
|
+
};
|
36
|
+
|
37
|
+
export { handleFrameworkGroupTreeDefaultExpandNode };
|
@@ -4,7 +4,7 @@ import { http } from '../../../lib/config/httpConfig';
|
|
4
4
|
/**
|
5
5
|
* 处理机构树默认展开节点,由于树组件的默认展开节点是异步的,所以需要手动处理默认展开节点
|
6
6
|
*/
|
7
|
-
const
|
7
|
+
const handleUimsOrganizationTreeDefaultExpandNode = async ({ id, treeId }) => {
|
8
8
|
if (document.querySelectorAll(`#${treeId}`).length == 0) {
|
9
9
|
console.error(`参数[treeId]不存在`);
|
10
10
|
return;
|
@@ -34,4 +34,4 @@ const expandNodeImpl = ({ ancestorList, index, treeId }) => {
|
|
34
34
|
});
|
35
35
|
};
|
36
36
|
|
37
|
-
export {
|
37
|
+
export { handleUimsOrganizationTreeDefaultExpandNode };
|
@@ -19,11 +19,11 @@ export interface FrameworkConfig extends FrameworkBase {
|
|
19
19
|
/** 配置占据的列数 */
|
20
20
|
colspan?: number;
|
21
21
|
/** 配置默认值 */
|
22
|
-
defaultValue?: string;
|
22
|
+
defaultValue?: string | number;
|
23
23
|
/** 配置是否必填 */
|
24
24
|
isRequired?: boolean;
|
25
25
|
/** 配置值 */
|
26
|
-
value?: string;
|
26
|
+
value?: string | number;
|
27
27
|
/** 配置描述 */
|
28
28
|
description?: string;
|
29
29
|
}
|