浏览代码

优化

master
suyanyan 2 个月前
父节点
当前提交
9f91919046
共有 1 个文件被更改,包括 11 次插入5 次删除
  1. +11
    -5
      SafeCampus.WEB/src/components/TreeFilter/index.vue

+ 11
- 5
SafeCampus.WEB/src/components/TreeFilter/index.vue 查看文件

@@ -56,6 +56,7 @@ interface TreeFilterProps {
topName?: string; // 顶级分类名称 ==> 非必传,默认为 “全部”
showAll?: boolean; // 是否显示全部选项 ==> 非必传,默认为 true
width: string;
isData?: boolean;
}
const props = withDefaults(defineProps<TreeFilterProps>(), {
id: "id",
@@ -65,7 +66,8 @@ const props = withDefaults(defineProps<TreeFilterProps>(), {
defaultExpandLevel: 1,
checkStrictly: false,
topName: "全部",
showAll: true
showAll: true,
isData: false
});

const defaultProps = {
@@ -156,13 +158,17 @@ const refresh = async () => {
treeRef.value?.setCheckedKeys([]);
treeRef.value?.setCurrentKey("");
setSelected();
await getRequestData();
if (!props.isData) {
await getRequestData();
}
};

const getRequestData = async () => {
const { data } = await props.requestApi!();
treeData.value = data;
setTreeAllData(data);
if (!props.isData) {
const { data } = await props.requestApi!();
treeData.value = data;
setTreeAllData(data);
}
};

/** 获取默认展开层级 */


正在加载...
取消
保存