|
@@ -28,13 +28,13 @@
|
|
|
</div>
|
|
|
<div class="user-types">
|
|
|
<div
|
|
|
- :class="['user-type', { 'is-active': userType === 'org' }]"
|
|
|
+ :class="['user-type', { 'is-active': isOrgTab }]"
|
|
|
@click="switchUserType('org')"
|
|
|
>
|
|
|
组织架构
|
|
|
</div>
|
|
|
<div
|
|
|
- :class="['user-type', { 'is-active': userType === 'course' }]"
|
|
|
+ :class="['user-type', { 'is-active': !isOrgTab }]"
|
|
|
@click="switchUserType('course')"
|
|
|
>
|
|
|
课程
|
|
@@ -47,7 +47,8 @@
|
|
|
node-key="id"
|
|
|
:default-checked-keys="selectedUserIds"
|
|
|
:props="defaultProps"
|
|
|
- default-expand-all
|
|
|
+ :default-expand-all="!isOrgTab"
|
|
|
+ :default-expanded-keys="isOrgTab ? userOrgKeys : []"
|
|
|
>
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
<el-checkbox
|
|
@@ -141,6 +142,7 @@ export default {
|
|
|
userList: [],
|
|
|
selectedUsers: [],
|
|
|
selectedUserIds: [],
|
|
|
+ userOrgKeys: [this.$ls.get("orgId")],
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
label: "label",
|
|
@@ -156,6 +158,11 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ isOrgTab() {
|
|
|
+ return this.userType === "org";
|
|
|
+ },
|
|
|
+ },
|
|
|
watch: {
|
|
|
courseId(val, oldval) {
|
|
|
if (val !== oldval) {
|