|
@@ -10,7 +10,20 @@
|
|
@close="close"
|
|
@close="close"
|
|
>
|
|
>
|
|
<template #left>
|
|
<template #left>
|
|
- <OrganizationalTree @select="handleSelect" />
|
|
|
|
|
|
+ <OrganizationalTree v-if="userType !== 3" @select="handleSelect" />
|
|
|
|
+ <div v-else style="overflow-y: scroll">
|
|
|
|
+ <BasicTree
|
|
|
|
+ expandOnSearch
|
|
|
|
+ :expanded-keys="treeExpandedKeys"
|
|
|
|
+ :auto-expand-parent="autoExpandParent"
|
|
|
|
+ @expand="onExpand"
|
|
|
|
+ title="班级列表"
|
|
|
|
+ :fieldNames="{ title: 'name', key: 'id' }"
|
|
|
|
+ search
|
|
|
|
+ :treeData="treeData"
|
|
|
|
+ @select="handleTreeSelect"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
<!-- 已选 -->
|
|
<!-- 已选 -->
|
|
<Selected
|
|
<Selected
|
|
@@ -28,7 +41,7 @@
|
|
<div class="list-page-box" v-if="data.visible && data.list.length > 0">
|
|
<div class="list-page-box" v-if="data.visible && data.list.length > 0">
|
|
<UserCard
|
|
<UserCard
|
|
:class="data.selectedIds.includes(item.id) ? 'picked' : 'not-picked'"
|
|
:class="data.selectedIds.includes(item.id) ? 'picked' : 'not-picked'"
|
|
- :disabled="props.disabledIds && props.disabledIds.includes(item.id) ? true : false"
|
|
|
|
|
|
+ :disabled="props.disabledIds && props.disabledIds.includes(item.id)"
|
|
v-for="(item, index) in data.list"
|
|
v-for="(item, index) in data.list"
|
|
:key="index"
|
|
:key="index"
|
|
:item="item"
|
|
:item="item"
|
|
@@ -62,10 +75,11 @@
|
|
import { UserInfo } from '/@/api/system/user/model';
|
|
import { UserInfo } from '/@/api/system/user/model';
|
|
import { cloneDeep } from 'lodash-es';
|
|
import { cloneDeep } from 'lodash-es';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
- import { useUserStore } from '/@/store/modules/user';
|
|
|
|
|
|
+ import { getStudentmanagerMajorGradeClassTree } from '/@/services/apis/StudentManagerController';
|
|
|
|
+ import BasicTree from '/@/components/Tree/src/Tree.vue';
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
- const defaultSelectName = ref('');
|
|
|
|
-
|
|
|
|
|
|
+ const treeExpandedKeys = ref<any[]>([]);
|
|
|
|
+ const autoExpandParent = ref(true);
|
|
const emits = defineEmits(['change', 'changeNames', 'close']);
|
|
const emits = defineEmits(['change', 'changeNames', 'close']);
|
|
const props = withDefaults(
|
|
const props = withDefaults(
|
|
defineProps<{
|
|
defineProps<{
|
|
@@ -73,7 +87,7 @@
|
|
disabledIds?: Array<string>;
|
|
disabledIds?: Array<string>;
|
|
multiple?: Boolean;
|
|
multiple?: Boolean;
|
|
visible?: Boolean;
|
|
visible?: Boolean;
|
|
- userType?: string;
|
|
|
|
|
|
+ userType?: Number;
|
|
}>(),
|
|
}>(),
|
|
{
|
|
{
|
|
selectedIds: () => {
|
|
selectedIds: () => {
|
|
@@ -84,6 +98,7 @@
|
|
},
|
|
},
|
|
},
|
|
},
|
|
);
|
|
);
|
|
|
|
+ const treeData = ref<any[]>([]);
|
|
let data: {
|
|
let data: {
|
|
visible: boolean;
|
|
visible: boolean;
|
|
multiSelect: boolean;
|
|
multiSelect: boolean;
|
|
@@ -94,6 +109,7 @@
|
|
searchConfig: {
|
|
searchConfig: {
|
|
keyword: string;
|
|
keyword: string;
|
|
deptId: string;
|
|
deptId: string;
|
|
|
|
+ classId: string;
|
|
};
|
|
};
|
|
} = reactive({
|
|
} = reactive({
|
|
visible: false,
|
|
visible: false,
|
|
@@ -113,11 +129,14 @@
|
|
});
|
|
});
|
|
|
|
|
|
const paramRef = computed(() => {
|
|
const paramRef = computed(() => {
|
|
|
|
+ console.log(data.searchConfig);
|
|
|
|
+
|
|
return {
|
|
return {
|
|
limit: data.page.current,
|
|
limit: data.page.current,
|
|
size: data.page.pageSize,
|
|
size: data.page.pageSize,
|
|
departmentId: data.searchConfig.deptId,
|
|
departmentId: data.searchConfig.deptId,
|
|
keyword: data.searchConfig.keyword,
|
|
keyword: data.searchConfig.keyword,
|
|
|
|
+ classId: data.searchConfig.classId,
|
|
userType: props.userType,
|
|
userType: props.userType,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
@@ -129,12 +148,36 @@
|
|
},
|
|
},
|
|
);
|
|
);
|
|
|
|
|
|
- onMounted(() => {
|
|
|
|
|
|
+ onMounted(async () => {
|
|
if (props.selectedIds && Array.isArray(props.selectedIds)) {
|
|
if (props.selectedIds && Array.isArray(props.selectedIds)) {
|
|
data.selectedIds = cloneDeep(props.selectedIds);
|
|
data.selectedIds = cloneDeep(props.selectedIds);
|
|
- getSelectedList();
|
|
|
|
|
|
+ await getSelectedList();
|
|
|
|
+ }
|
|
|
|
+ if (props.userType === 3) {
|
|
|
|
+ treeData.value = await getStudentmanagerMajorGradeClassTree({});
|
|
|
|
+ console.log(treeData.value);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ const onExpand = (keys: string[]) => {
|
|
|
|
+ treeExpandedKeys.value = keys;
|
|
|
|
+ autoExpandParent.value = false;
|
|
|
|
+ };
|
|
|
|
+ function handleTreeSelect(e, { node }) {
|
|
|
|
+ console.log(node);
|
|
|
|
+ if (node.treeType !== 4) {
|
|
|
|
+ treeExpandedKeys.value = e;
|
|
|
|
+ autoExpandParent.value = true;
|
|
|
|
+ if (node.expanded) {
|
|
|
|
+ console.log(node);
|
|
|
|
+ treeExpandedKeys.value = [node.parentId];
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ data.page.current = 1;
|
|
|
|
+ data.searchConfig.classId = e[0];
|
|
|
|
+ data.searchConfig.keyword = '';
|
|
|
|
+ getList();
|
|
|
|
+ }
|
|
async function show() {
|
|
async function show() {
|
|
data.selectedIds = [];
|
|
data.selectedIds = [];
|
|
data.selectedList = [];
|
|
data.selectedList = [];
|
|
@@ -233,7 +276,11 @@
|
|
}
|
|
}
|
|
function handleSelect(deptId = '') {
|
|
function handleSelect(deptId = '') {
|
|
data.page.current = 1;
|
|
data.page.current = 1;
|
|
- data.searchConfig.deptId = deptId;
|
|
|
|
|
|
+ if (props.userType === 3) {
|
|
|
|
+ data.searchConfig.classId = deptId[0];
|
|
|
|
+ } else {
|
|
|
|
+ data.searchConfig.deptId = deptId;
|
|
|
|
+ }
|
|
data.searchConfig.keyword = '';
|
|
data.searchConfig.keyword = '';
|
|
getList();
|
|
getList();
|
|
}
|
|
}
|