|
@@ -20,7 +20,11 @@
|
|
|
/>
|
|
|
</el-col>
|
|
|
<el-col :span="2">
|
|
|
- <el-button class="search-button" @click="queryOrgTeacherUserList">Search</el-button>
|
|
|
+ <el-button
|
|
|
+ class="search-button"
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="queryOrgTeacherUserList"
|
|
|
+ ></el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -29,7 +33,7 @@
|
|
|
<div class="teacher-manager-list-title">
|
|
|
<div>教师列表</div>
|
|
|
</div>
|
|
|
- <el-table :data="org_teacher_user_list" height="500" max-height="500">
|
|
|
+ <el-table :data="org_teacher_user_list">
|
|
|
<el-table-column prop="user_name" label="用户名" width="180" />
|
|
|
<el-table-column prop="user_real_name" label="姓名" width="180" />
|
|
|
<el-table-column prop="org_name" label="服务机构" width="180" />
|
|
@@ -52,6 +56,23 @@
|
|
|
审核{{ scope.row.is_audited === 'true' ? '拒绝' : '同意' }}
|
|
|
</el-link>
|
|
|
</el-col>
|
|
|
+ <el-col>
|
|
|
+ <el-popover trigger="click" width="200" @show="getPopedomList(scope.row.id)">
|
|
|
+ <div class="popedom">
|
|
|
+ <span class="popedom-manager">权限管理</span>
|
|
|
+ <div v-for="item in popedom_list" :key="item.popedom_code" class="popedom-list">
|
|
|
+ <span>{{ item.popedom_name }}</span>
|
|
|
+ <el-switch
|
|
|
+ v-model="item.is_selected"
|
|
|
+ active-color="#34CC83"
|
|
|
+ inactive-color="#C4C4C4"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <el-button type="primary" @click="setPopedom(scope.row.id)">保存</el-button>
|
|
|
+ </div>
|
|
|
+ <el-link slot="reference" :underline="false">权限</el-link>
|
|
|
+ </el-popover>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -75,7 +96,11 @@
|
|
|
|
|
|
<script>
|
|
|
import { pageQueryOrgTeacherUserList } from '@/api/list';
|
|
|
-import { auditOrgTeacherUser } from '@/api/teacher';
|
|
|
+import {
|
|
|
+ auditOrgTeacherUser,
|
|
|
+ getPopedomList_OrgTeacherUse,
|
|
|
+ setPopedom_OrgTeacherUser
|
|
|
+} from '@/api/teacher';
|
|
|
|
|
|
export default {
|
|
|
name: 'TeacherManager',
|
|
@@ -86,7 +111,8 @@ export default {
|
|
|
org_teacher_user_list: [],
|
|
|
page_capacity: 10,
|
|
|
total_count: 0,
|
|
|
- cur_page: 1
|
|
|
+ cur_page: 1,
|
|
|
+ popedom_list: []
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -117,6 +143,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 审核教师
|
|
|
auditOrgTeacher(row) {
|
|
|
let data = {
|
|
|
id_list: [row.id],
|
|
@@ -132,6 +159,52 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ // 得到权限列表
|
|
|
+ getPopedomList(user_org_id) {
|
|
|
+ getPopedomList_OrgTeacherUse({ user_org_id }).then(response => {
|
|
|
+ if (response.status) {
|
|
|
+ response.popedom_list.forEach((el, i, arr) => {
|
|
|
+ el.is_selected = el.is_selected === 'true';
|
|
|
+ console.log(arr);
|
|
|
+ arr[i] = el;
|
|
|
+ });
|
|
|
+ this.popedom_list = response.popedom_list;
|
|
|
+ console.log(this.popedom_list);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: response.error
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 设置教师权限
|
|
|
+ setPopedom(user_org_id) {
|
|
|
+ let popedom_code_list = this.popedom_list.filter(el => {
|
|
|
+ return el.is_selected;
|
|
|
+ });
|
|
|
+ popedom_code_list.forEach((el, i, arr) => {
|
|
|
+ arr[i] = el.popedom_code;
|
|
|
+ });
|
|
|
+
|
|
|
+ let data = {
|
|
|
+ user_org_id,
|
|
|
+ popedom_code_list
|
|
|
+ };
|
|
|
+ setPopedom_OrgTeacherUser(data).then(response => {
|
|
|
+ if (response.status) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '设置教师权限成功'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: response.error
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -142,6 +215,7 @@ export default {
|
|
|
|
|
|
.teacher-manager {
|
|
|
@include container;
|
|
|
+ @include pagination;
|
|
|
|
|
|
padding: 24px 0 46px;
|
|
|
|
|
@@ -156,45 +230,40 @@ export default {
|
|
|
}
|
|
|
|
|
|
.search-button {
|
|
|
- width: 100%;
|
|
|
+ float: right;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
&-list {
|
|
|
- width: 100%;
|
|
|
- height: 594px;
|
|
|
- border-radius: 8px;
|
|
|
- margin-top: 24px;
|
|
|
- background-color: #fff;
|
|
|
+ @include list;
|
|
|
|
|
|
&-title {
|
|
|
- height: 78px;
|
|
|
- line-height: 78px;
|
|
|
- padding: 0 30px;
|
|
|
font-size: 20px;
|
|
|
font-weight: 400;
|
|
|
- border-bottom: 1px solid #d9d9d9;
|
|
|
}
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- .el-table {
|
|
|
- width: 100%;
|
|
|
-
|
|
|
- &__header th:first-child,
|
|
|
- &__body .el-table__row > td:first-child {
|
|
|
- padding-left: 20px;
|
|
|
- font-weight: 700;
|
|
|
- }
|
|
|
- }
|
|
|
+// 权限管理
|
|
|
+.popedom {
|
|
|
+ &-manager {
|
|
|
+ display: flex;
|
|
|
+ font-weight: 700;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-bottom: 8px;
|
|
|
+ border-bottom: 1px solid #d9d9d9;
|
|
|
}
|
|
|
|
|
|
- .el-pagination {
|
|
|
- margin-top: 24px;
|
|
|
+ &-list {
|
|
|
+ padding-top: 10px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
|
|
|
- &.is-background .btn-next,
|
|
|
- &.is-background .btn-prev,
|
|
|
- &.is-background .el-pager li {
|
|
|
- background-color: #fff;
|
|
|
- }
|
|
|
+ .el-button {
|
|
|
+ width: 100%;
|
|
|
+ padding: 6px 20px;
|
|
|
+ margin-top: 16px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|