|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <LinkTitlesCustom :current-paths="['用户管理', '关联课程']" />
|
|
|
+ <LinkTitlesCustom :current-paths="['用户管理', '权限设置']" />
|
|
|
<section class="content">
|
|
|
<div v-loading.body="loading" class="box box-info">
|
|
|
<!-- 正文信息 -->
|
|
@@ -12,16 +12,39 @@
|
|
|
inline-message
|
|
|
label-position="right"
|
|
|
>
|
|
|
- <div style="margin-bottom: 10px">
|
|
|
- <!-- <el-button type="primary" size="small">保 存</el-button> -->
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- icon="el-icon-arrow-left"
|
|
|
- @click="back"
|
|
|
- >返 回</el-button
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="18"
|
|
|
+ ><span>{{ userName }}</span></el-col
|
|
|
>
|
|
|
- </div>
|
|
|
+ <el-col :span="6"
|
|
|
+ ><div style="margin-bottom: 10px">
|
|
|
+ <el-button type="primary" size="small" @click="save"
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-arrow-left"
|
|
|
+ @click="back"
|
|
|
+ >返回</el-button
|
|
|
+ >
|
|
|
+ </div></el-col
|
|
|
+ >
|
|
|
+ </el-row>
|
|
|
+ <div class="block-seperator"></div>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="审核权限">
|
|
|
+ <el-radio-group v-model="form.auditAuthority" class="input">
|
|
|
+ <el-radio label="FIRST">初级</el-radio>
|
|
|
+ <el-radio label="SECOND">中级</el-radio>
|
|
|
+ <el-radio label="THIRD">高级</el-radio>
|
|
|
+ </el-radio-group></el-form-item
|
|
|
+ >
|
|
|
+ <el-button type="primary" size="small" @click="clear"
|
|
|
+ >清空</el-button
|
|
|
+ >
|
|
|
+ </el-row>
|
|
|
+ <div class="block-seperator"></div>
|
|
|
<el-tabs v-model="activeName" type="border-card">
|
|
|
<el-tab-pane label="关联课程" name="tab1">
|
|
|
<el-row class="mb-2">
|
|
@@ -102,7 +125,7 @@
|
|
|
</section>
|
|
|
<DataPrevillegeAddCourseDialog
|
|
|
ref="addCourseDialog"
|
|
|
- :user-id="userId"
|
|
|
+ :user-id="form.userId"
|
|
|
@reload="init"
|
|
|
/>
|
|
|
</div>
|
|
@@ -123,6 +146,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ userName: "",
|
|
|
rolePrivileges: {
|
|
|
user_data_rule_setting: false,
|
|
|
},
|
|
@@ -135,9 +159,10 @@ export default {
|
|
|
activeName: "tab1",
|
|
|
toActiveName: null,
|
|
|
form: {
|
|
|
+ userId: "",
|
|
|
defaultStatusCourse: false,
|
|
|
+ auditAuthority: "",
|
|
|
},
|
|
|
- userId: "",
|
|
|
paginationShow: false,
|
|
|
selectedChanged: false,
|
|
|
tableDataCourse: [],
|
|
@@ -162,21 +187,49 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- this.userId = this.$route.params.userId;
|
|
|
+ this.form.userId = this.$route.params.userId;
|
|
|
await this.init();
|
|
|
this.$nextTick(function () {
|
|
|
this.paginationShow = true;
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ async save() {
|
|
|
+ try {
|
|
|
+ await this.$httpWithMsg.post(
|
|
|
+ QUESTION_API + "/user/updateAuditAuthority",
|
|
|
+ {
|
|
|
+ auditAuthority: this.form.auditAuthority,
|
|
|
+ id: this.form.userId,
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ this.$notify({
|
|
|
+ type: "success",
|
|
|
+ message: "保存成功",
|
|
|
+ });
|
|
|
+ await this.back();
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ clear() {
|
|
|
+ this.form.auditAuthority = null;
|
|
|
+ },
|
|
|
async init() {
|
|
|
+ this.$httpWithMsg
|
|
|
+ .get(QUESTION_API + "/user/" + this.form.userId)
|
|
|
+ .then((res) => {
|
|
|
+ this.userName = res.data.name + "(" + res.data.roleNamesStr + ")";
|
|
|
+ this.form.auditAuthority = res.data.auditAuthority;
|
|
|
+ });
|
|
|
const reqs = [];
|
|
|
const defaultPrevilleges = ["COURSE"];
|
|
|
for (const defP of defaultPrevilleges) {
|
|
|
let url =
|
|
|
QUESTION_API +
|
|
|
"/user/data/rule/default/status?" +
|
|
|
- `userId=${this.userId}&type=${defP}`;
|
|
|
+ `userId=${this.form.userId}&type=${defP}`;
|
|
|
reqs.push(this.$httpWithMsg.post(url));
|
|
|
}
|
|
|
|
|
@@ -189,7 +242,7 @@ export default {
|
|
|
const pageSize = this.$data["pageSize" + defP];
|
|
|
reqs.push(
|
|
|
this.$httpWithMsg.post(url, {
|
|
|
- userId: this.userId,
|
|
|
+ userId: this.form.userId,
|
|
|
pageNo,
|
|
|
pageSize,
|
|
|
})
|
|
@@ -237,7 +290,7 @@ export default {
|
|
|
object2QueryString({
|
|
|
enabled,
|
|
|
type: type.toUpperCase(),
|
|
|
- userId: this.userId,
|
|
|
+ userId: this.form.userId,
|
|
|
})
|
|
|
);
|
|
|
this.$notify({
|
|
@@ -255,7 +308,7 @@ export default {
|
|
|
await this.$httpWithMsg.post(QUESTION_API + "/user/data/rule/delete", {
|
|
|
refIds,
|
|
|
type: type.toUpperCase(),
|
|
|
- userId: this.userId,
|
|
|
+ userId: this.form.userId,
|
|
|
});
|
|
|
|
|
|
this.$notify({
|
|
@@ -289,9 +342,6 @@ export default {
|
|
|
width: 800px;
|
|
|
}
|
|
|
|
|
|
-.input {
|
|
|
- width: 440px;
|
|
|
-}
|
|
|
.input >>> .el-input__inner {
|
|
|
-webkit-appearance: button;
|
|
|
}
|