flat: 优化
This commit is contained in:
@@ -176,12 +176,13 @@ function complete(values) {
|
||||
}
|
||||
|
||||
function getTree() {
|
||||
$api.createRequest('/app/common/jobTitle/treeselect', {}, 'GET').then((resData) => {
|
||||
const LoadCache = (resData) => {
|
||||
if (resData.code === 200) {
|
||||
dataSource.value = flattenTree(resData.data);
|
||||
treeDataList.value = resData.data;
|
||||
}
|
||||
});
|
||||
};
|
||||
$api.createRequestWithCache('/app/common/jobTitle/treeselect', {}, 'GET', false, LoadCache).then(LoadCache);
|
||||
}
|
||||
|
||||
function flattenTree(treeData, parentPath = '') {
|
||||
|
||||
Reference in New Issue
Block a user