|
@@ -9,36 +9,19 @@
|
|
<!-- 搜索 -->
|
|
<!-- 搜索 -->
|
|
<el-form inline :model="searchForm">
|
|
<el-form inline :model="searchForm">
|
|
<el-form-item v-if="isSuperAdmin" label="学校">
|
|
<el-form-item v-if="isSuperAdmin" label="学校">
|
|
- <el-select
|
|
|
|
|
|
+ <SchoolSelectForRoot
|
|
v-model="searchForm.rootOrgId"
|
|
v-model="searchForm.rootOrgId"
|
|
- placeholder="请选择"
|
|
|
|
- :disabled="!isSuperAdmin"
|
|
|
|
class="input_width"
|
|
class="input_width"
|
|
- filterable
|
|
|
|
- @change="rootOrgChanged4Search"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in rootSchoolSelect"
|
|
|
|
- :key="item.id"
|
|
|
|
- :label="item.name"
|
|
|
|
- :value="item.id"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ @change="() => (searchForm.roleId = '')"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="角色">
|
|
<el-form-item label="角色">
|
|
- <el-select
|
|
|
|
|
|
+ <RoleSelect
|
|
v-model="searchForm.roleId"
|
|
v-model="searchForm.roleId"
|
|
- clearable
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
|
+ :school-id="searchForm.rootOrgId"
|
|
|
|
+ :enable-super="isSuperAdmin"
|
|
class="input_width"
|
|
class="input_width"
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in roleList4Search"
|
|
|
|
- :key="item.roleId"
|
|
|
|
- :label="item.roleName"
|
|
|
|
- :value="item.roleId"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="登录名">
|
|
<el-form-item label="登录名">
|
|
<el-input
|
|
<el-input
|
|
@@ -118,13 +101,13 @@
|
|
type="danger"
|
|
type="danger"
|
|
icon="el-icon-close"
|
|
icon="el-icon-close"
|
|
:disabled="noBatchSelected"
|
|
:disabled="noBatchSelected"
|
|
- @click="disableByIds"
|
|
|
|
|
|
+ @click="disableUsers"
|
|
>禁用
|
|
>禁用
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
<div class="block-seperator"></div>
|
|
<div class="block-seperator"></div>
|
|
<!-- 添加用户信息弹出框 -->
|
|
<!-- 添加用户信息弹出框 -->
|
|
- <el-dialog title="新增用户" width="450px" :visible.sync="addingDialog">
|
|
|
|
|
|
+ <el-dialog title="新增用户" width="520px" :visible.sync="addingDialog">
|
|
<el-form
|
|
<el-form
|
|
ref="addingForm"
|
|
ref="addingForm"
|
|
:inline="true"
|
|
:inline="true"
|
|
@@ -176,41 +159,22 @@
|
|
</el-row>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
<el-form-item v-if="isSuperAdmin" label="学校" prop="rootOrgId">
|
|
<el-form-item v-if="isSuperAdmin" label="学校" prop="rootOrgId">
|
|
- <el-select
|
|
|
|
- v-model="userForm.rootOrgId"
|
|
|
|
|
|
+ <SchoolSelectForRoot
|
|
|
|
+ v-model="searchForm.rootOrgId"
|
|
class="input_width_lg"
|
|
class="input_width_lg"
|
|
- placeholder="请选择"
|
|
|
|
- :disabled="!isSuperAdmin"
|
|
|
|
- filterable
|
|
|
|
- @change="rootOrgChanged4InsertOrUpdate"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in rootSchoolSelect"
|
|
|
|
- :key="item.id"
|
|
|
|
- :label="item.name"
|
|
|
|
- :value="item.id"
|
|
|
|
- >
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ @change="() => (userForm.roleIds = '')"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
<el-form-item label="角色" prop="roleIds">
|
|
<el-form-item label="角色" prop="roleIds">
|
|
- <el-select
|
|
|
|
|
|
+ <RoleSelect
|
|
v-model="userForm.roleIds"
|
|
v-model="userForm.roleIds"
|
|
- class="input_width_lg"
|
|
|
|
|
|
+ :school-id="searchForm.rootOrgId"
|
|
multiple
|
|
multiple
|
|
- placeholder="请选择"
|
|
|
|
- @change="rolesChanged"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in roleList4InsertOrUpdateWithoutSuperAdmin"
|
|
|
|
- :key="item.roleId"
|
|
|
|
- :label="item.roleName"
|
|
|
|
- :value="item.roleId"
|
|
|
|
- >
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ class="input_width_lg"
|
|
|
|
+ @change="selectRoleChanged"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
@@ -252,7 +216,7 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 修改用户信息弹出框 -->
|
|
<!-- 修改用户信息弹出框 -->
|
|
- <el-dialog title="编辑用户" width="450px" :visible.sync="updateDialog">
|
|
|
|
|
|
+ <el-dialog title="编辑用户" width="520px" :visible.sync="updateDialog">
|
|
<el-form
|
|
<el-form
|
|
ref="updateForm"
|
|
ref="updateForm"
|
|
:inline="true"
|
|
:inline="true"
|
|
@@ -303,41 +267,22 @@
|
|
</el-row>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
<el-form-item v-if="isSuperAdmin" label="学校" prop="rootOrgId">
|
|
<el-form-item v-if="isSuperAdmin" label="学校" prop="rootOrgId">
|
|
- <el-select
|
|
|
|
- v-model="userForm.rootOrgId"
|
|
|
|
|
|
+ <SchoolSelectForRoot
|
|
|
|
+ v-model="searchForm.rootOrgId"
|
|
class="input_width_lg"
|
|
class="input_width_lg"
|
|
- placeholder="请选择"
|
|
|
|
- :disabled="true"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in rootSchoolSelect"
|
|
|
|
- :key="item.id"
|
|
|
|
- :label="item.name"
|
|
|
|
- :value="item.id"
|
|
|
|
- >
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ @change="() => (userForm.roleIds = '')"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
<el-form-item label="角色" prop="roleIds">
|
|
<el-form-item label="角色" prop="roleIds">
|
|
- <el-select
|
|
|
|
|
|
+ <RoleSelect
|
|
v-model="userForm.roleIds"
|
|
v-model="userForm.roleIds"
|
|
- class="input_width_lg"
|
|
|
|
|
|
+ :school-id="searchForm.rootOrgId"
|
|
multiple
|
|
multiple
|
|
- placeholder="请选择"
|
|
|
|
- :disabled="rowIsSuperAdmin"
|
|
|
|
- @change="rolesChanged"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in roleList4InsertOrUpdate"
|
|
|
|
- :key="item.roleId"
|
|
|
|
- :label="item.roleName"
|
|
|
|
- :disabled="item.roleCode == 'SUPER_ADMIN'"
|
|
|
|
- :value="item.roleId"
|
|
|
|
- >
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ class="input_width_lg"
|
|
|
|
+ @change="selectRoleChanged"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
@@ -397,7 +342,6 @@
|
|
<el-table-column prop="name" width="120" label="姓名" />
|
|
<el-table-column prop="name" width="120" label="姓名" />
|
|
<el-table-column prop="loginName" width="100" label="登录名" />
|
|
<el-table-column prop="loginName" width="100" label="登录名" />
|
|
<el-table-column prop="rootOrgName" label="学校" />
|
|
<el-table-column prop="rootOrgName" label="学校" />
|
|
- <!-- <el-table-column prop="roleNamesStr" width="110" label="角色" /> -->
|
|
|
|
<el-table-column width="120" label="角色">
|
|
<el-table-column width="120" label="角色">
|
|
<span
|
|
<span
|
|
slot-scope="scope"
|
|
slot-scope="scope"
|
|
@@ -452,7 +396,7 @@
|
|
size="mini"
|
|
size="mini"
|
|
type="danger"
|
|
type="danger"
|
|
icon="el-icon-close"
|
|
icon="el-icon-close"
|
|
- @click="disableById(scope.row)"
|
|
|
|
|
|
+ @click="disableTheUser(scope.row)"
|
|
>
|
|
>
|
|
禁用
|
|
禁用
|
|
</el-button>
|
|
</el-button>
|
|
@@ -548,22 +492,13 @@ export default {
|
|
callback();
|
|
callback();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- var validateRoles = (rule, value, callback) => {
|
|
|
|
- if (value.length == 0) {
|
|
|
|
- callback(new Error("请选择角色"));
|
|
|
|
- } else {
|
|
|
|
- callback();
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
return {
|
|
return {
|
|
rolePrivileges: {
|
|
rolePrivileges: {
|
|
user_data_rule_setting: false,
|
|
user_data_rule_setting: false,
|
|
},
|
|
},
|
|
loading: false,
|
|
loading: false,
|
|
orgLoading4InsertOrUpdate: false,
|
|
orgLoading4InsertOrUpdate: false,
|
|
- roleList4Search: [],
|
|
|
|
roleList4InsertOrUpdate: [],
|
|
roleList4InsertOrUpdate: [],
|
|
- rootOrgList: [],
|
|
|
|
orgList4InsertOrUpdate: [],
|
|
orgList4InsertOrUpdate: [],
|
|
searchForm: {
|
|
searchForm: {
|
|
name: "",
|
|
name: "",
|
|
@@ -618,24 +553,23 @@ export default {
|
|
trigger: "blur",
|
|
trigger: "blur",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- phoneNumber: [
|
|
|
|
- // {
|
|
|
|
- // message: "请输入联系方式",
|
|
|
|
- // trigger: "blur"
|
|
|
|
- // }
|
|
|
|
- ],
|
|
|
|
rootOrgId: [
|
|
rootOrgId: [
|
|
{
|
|
{
|
|
validator: validateRootOrg,
|
|
validator: validateRootOrg,
|
|
trigger: "blur",
|
|
trigger: "blur",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- orgId: [],
|
|
|
|
|
|
+ orgId: [
|
|
|
|
+ {
|
|
|
|
+ required: "", // changed by role
|
|
|
|
+ message: "学习中心用户必须选择子机构",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
roleIds: [
|
|
roleIds: [
|
|
{
|
|
{
|
|
required: true,
|
|
required: true,
|
|
- validator: validateRoles,
|
|
|
|
- trigger: ["blur", "change"],
|
|
|
|
|
|
+ message: "请选择角色",
|
|
|
|
+ trigger: "blur",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
@@ -659,36 +593,20 @@ export default {
|
|
noBatchSelected() {
|
|
noBatchSelected() {
|
|
return this.selectedUserIds.length === 0;
|
|
return this.selectedUserIds.length === 0;
|
|
},
|
|
},
|
|
- roleList4InsertOrUpdateWithoutSuperAdmin() {
|
|
|
|
- // console.log(
|
|
|
|
- // this.isSuperAdminOrOrgAdmin,
|
|
|
|
- // this.roleList4InsertOrUpdate.map((v) => v.roleCode)
|
|
|
|
- // );
|
|
|
|
- return this.roleList4InsertOrUpdate
|
|
|
|
- .filter((item) => item.roleCode != "SUPER_ADMIN")
|
|
|
|
- .filter(
|
|
|
|
- (item) => !this.isSuperAdminOrOrgAdmin && item.roleCode != "ORG_ADMIN"
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
isSuperAdmin() {
|
|
isSuperAdmin() {
|
|
return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
|
|
return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
|
|
},
|
|
},
|
|
|
|
+ isOrgAdminNotSuperAdmin() {
|
|
|
|
+ return (
|
|
|
|
+ this.user.roleList.some((role) => role.roleCode == "ORG_ADMIN") &&
|
|
|
|
+ !this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN")
|
|
|
|
+ );
|
|
|
|
+ },
|
|
isSuperAdminOrOrgAdmin() {
|
|
isSuperAdminOrOrgAdmin() {
|
|
return this.user.roleList.some(
|
|
return this.user.roleList.some(
|
|
(role) => role.roleCode == "SUPER_ADMIN" || role.roleCode == "ORG_ADMIN"
|
|
(role) => role.roleCode == "SUPER_ADMIN" || role.roleCode == "ORG_ADMIN"
|
|
);
|
|
);
|
|
},
|
|
},
|
|
- rootSchoolSelect() {
|
|
|
|
- let rootSchools = [];
|
|
|
|
- for (let i = 0; i < this.rootOrgList.length; i++) {
|
|
|
|
- let info = {
|
|
|
|
- name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
|
|
|
|
- id: this.rootOrgList[i].id,
|
|
|
|
- };
|
|
|
|
- rootSchools.push(info);
|
|
|
|
- }
|
|
|
|
- return rootSchools;
|
|
|
|
- },
|
|
|
|
},
|
|
},
|
|
//初始化查询
|
|
//初始化查询
|
|
created() {
|
|
created() {
|
|
@@ -696,6 +614,14 @@ export default {
|
|
this.init();
|
|
this.init();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ selectRoleChanged(selectRoles, roleList) {
|
|
|
|
+ const isLCUser = selectRoles.includes(
|
|
|
|
+ roleList.filter((v) => v.roleCode === "LC_USER").map((v) => v.roleId)[0]
|
|
|
|
+ );
|
|
|
|
+ this.rules.orgId[0].required = isLCUser;
|
|
|
|
+ this.$refs.addingForm && this.$refs.addingForm.validateField("orgId");
|
|
|
|
+ this.$refs.updateForm && this.$refs.updateForm.validateField("orgId");
|
|
|
|
+ },
|
|
resetEcsFormSearch() {
|
|
resetEcsFormSearch() {
|
|
this.searchForm = Object.assign(this.searchForm, {
|
|
this.searchForm = Object.assign(this.searchForm, {
|
|
roleId: "",
|
|
roleId: "",
|
|
@@ -709,71 +635,6 @@ export default {
|
|
this.pageSize = val;
|
|
this.pageSize = val;
|
|
this.search();
|
|
this.search();
|
|
},
|
|
},
|
|
- validateOrg(rule, value, callback) {
|
|
|
|
- if (0 != value && !value) {
|
|
|
|
- callback(new Error("请选择子机构"));
|
|
|
|
- } else {
|
|
|
|
- callback();
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- rolesChanged() {
|
|
|
|
- var isLC = false;
|
|
|
|
- for (let cur of this.roleList4InsertOrUpdate) {
|
|
|
|
- if (
|
|
|
|
- cur.roleCode == "LC_USER" &&
|
|
|
|
- this.userForm.roleIds.includes(cur.roleId)
|
|
|
|
- ) {
|
|
|
|
- isLC = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- console.log("rolesChanged(); isLC:", isLC);
|
|
|
|
- if (isLC) {
|
|
|
|
- this.rules.orgId = [
|
|
|
|
- {
|
|
|
|
- validator: this.validateOrg,
|
|
|
|
- trigger: ["blur", "change"],
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
- } else {
|
|
|
|
- this.rules.orgId = [];
|
|
|
|
- if (this.updateDialog) {
|
|
|
|
- this.$refs.updateForm && this.$refs.updateForm.clearValidate("orgId");
|
|
|
|
- } else if (this.addingDialog) {
|
|
|
|
- this.$refs.addingForm && this.$refs.addingForm.clearValidate("orgId");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (this.updateDialog) {
|
|
|
|
- this.$refs.updateForm && this.$refs.updateForm.validateField("orgId");
|
|
|
|
- } else if (this.addingDialog) {
|
|
|
|
- this.$refs.addingForm && this.$refs.addingForm.validateField("orgId");
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- rootOrgChanged4Search() {
|
|
|
|
- var url =
|
|
|
|
- CORE_API +
|
|
|
|
- "/rolePrivilege/getRoles?includeSuperAdmin=" +
|
|
|
|
- true +
|
|
|
|
- "&rootOrgId=" +
|
|
|
|
- this.searchForm.rootOrgId;
|
|
|
|
- this.$httpWithMsg.post(url).then((response) => {
|
|
|
|
- this.roleList4Search = response.data;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- rootOrgChanged4InsertOrUpdate() {
|
|
|
|
- this.orgList4InsertOrUpdate = [];
|
|
|
|
-
|
|
|
|
- var url =
|
|
|
|
- CORE_API +
|
|
|
|
- "/rolePrivilege/getRoles?includeSuperAdmin=" +
|
|
|
|
- true +
|
|
|
|
- "&rootOrgId=" +
|
|
|
|
- this.userForm.rootOrgId;
|
|
|
|
- this.$httpWithMsg.post(url).then((response) => {
|
|
|
|
- this.roleList4InsertOrUpdate = response.data;
|
|
|
|
- this.rolesChanged();
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
getOrgList4InsertOrUpdate(query) {
|
|
getOrgList4InsertOrUpdate(query) {
|
|
this.orgLoading4InsertOrUpdate = true;
|
|
this.orgLoading4InsertOrUpdate = true;
|
|
var url =
|
|
var url =
|
|
@@ -793,22 +654,6 @@ export default {
|
|
this.orgLoading4InsertOrUpdate = false;
|
|
this.orgLoading4InsertOrUpdate = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- getTag(status) {
|
|
|
|
- if (status == true) {
|
|
|
|
- return "success";
|
|
|
|
- } else if (status == false) {
|
|
|
|
- return "danger";
|
|
|
|
- }
|
|
|
|
- return status;
|
|
|
|
- },
|
|
|
|
- getLevel(level) {
|
|
|
|
- if (level == "ZSB") {
|
|
|
|
- return "专升本";
|
|
|
|
- } else if (level == "GQZ") {
|
|
|
|
- return "高起专";
|
|
|
|
- }
|
|
|
|
- return level;
|
|
|
|
- },
|
|
|
|
handleSearchBtn() {
|
|
handleSearchBtn() {
|
|
this.currentPage = 1;
|
|
this.currentPage = 1;
|
|
this.search();
|
|
this.search();
|
|
@@ -821,6 +666,11 @@ export default {
|
|
}
|
|
}
|
|
}, 500);
|
|
}, 500);
|
|
var param = new URLSearchParams(this.searchForm);
|
|
var param = new URLSearchParams(this.searchForm);
|
|
|
|
+ if (!this.isSuperAdminOrOrgAdmin)
|
|
|
|
+ param.append("ignoreRoleCodes", "SUPER_ADMIN,ORG_ADMIN");
|
|
|
|
+ else if (this.isOrgAdminNotSuperAdmin) {
|
|
|
|
+ param.append("ignoreRoleCodes", "SUPER_ADMIN");
|
|
|
|
+ }
|
|
var url =
|
|
var url =
|
|
CORE_API +
|
|
CORE_API +
|
|
"/user/all/" +
|
|
"/user/all/" +
|
|
@@ -854,11 +704,14 @@ export default {
|
|
},
|
|
},
|
|
//新增
|
|
//新增
|
|
openAddingDialog() {
|
|
openAddingDialog() {
|
|
|
|
+ this.rules.orgId[0].required = false;
|
|
if (this.$refs.addingForm) {
|
|
if (this.$refs.addingForm) {
|
|
this.$refs.addingForm.resetFields();
|
|
this.$refs.addingForm.resetFields();
|
|
|
|
+ this.$refs.addingForm.clearValidate();
|
|
}
|
|
}
|
|
if (this.$refs.updateForm) {
|
|
if (this.$refs.updateForm) {
|
|
this.$refs.updateForm.resetFields();
|
|
this.$refs.updateForm.resetFields();
|
|
|
|
+ this.$refs.updateForm.clearValidate();
|
|
}
|
|
}
|
|
this.addingDialog = true;
|
|
this.addingDialog = true;
|
|
this.userForm.name = "";
|
|
this.userForm.name = "";
|
|
@@ -869,10 +722,10 @@ export default {
|
|
this.userForm.orgId = null;
|
|
this.userForm.orgId = null;
|
|
this.enableStr = "true";
|
|
this.enableStr = "true";
|
|
this.orgList4InsertOrUpdate = [];
|
|
this.orgList4InsertOrUpdate = [];
|
|
- this.rolesChanged();
|
|
|
|
},
|
|
},
|
|
//修改
|
|
//修改
|
|
openUpdateDialog(row) {
|
|
openUpdateDialog(row) {
|
|
|
|
+ this.rules.orgId[0].required = row.roleCodes.includes("LC_USER");
|
|
if (this.$refs.updateForm) {
|
|
if (this.$refs.updateForm) {
|
|
this.$refs.updateForm.resetFields();
|
|
this.$refs.updateForm.resetFields();
|
|
}
|
|
}
|
|
@@ -897,14 +750,9 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- this.rootOrgChanged4InsertOrUpdate();
|
|
|
|
this.orgList4InsertOrUpdate = [{ id: row.orgId, name: row.orgName }];
|
|
this.orgList4InsertOrUpdate = [{ id: row.orgId, name: row.orgName }];
|
|
this.userForm.orgId = row.orgId;
|
|
this.userForm.orgId = row.orgId;
|
|
},
|
|
},
|
|
- exportUser() {
|
|
|
|
- var param = new URLSearchParams(this.searchForm);
|
|
|
|
- window.open(CORE_API + "/user/export?" + param);
|
|
|
|
- },
|
|
|
|
//保存
|
|
//保存
|
|
add() {
|
|
add() {
|
|
var url = CORE_API + "/user";
|
|
var url = CORE_API + "/user";
|
|
@@ -1043,38 +891,27 @@ export default {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- //禁用
|
|
|
|
- disableByIds() {
|
|
|
|
|
|
+ disableUsers() {
|
|
if (this.selectedUserIds.length === 0) {
|
|
if (this.selectedUserIds.length === 0) {
|
|
this.$notify({
|
|
this.$notify({
|
|
type: "warning",
|
|
type: "warning",
|
|
message: "请选择要禁用的用户",
|
|
message: "请选择要禁用的用户",
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- this.$confirm("是否禁用这些用户?", "提示", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "error",
|
|
|
|
- }).then(() => {
|
|
|
|
- var url = CORE_API + "/user/disable/" + this.userIds;
|
|
|
|
- this.$httpWithMsg.put(url, {}).then(() => {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "success",
|
|
|
|
- message: "禁用成功!",
|
|
|
|
- });
|
|
|
|
- this.search();
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
|
|
+ this.disableByIds(this.userIds);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ disableTheUser(user) {
|
|
|
|
+ this.disableByIds(user.id);
|
|
|
|
+ },
|
|
//禁用
|
|
//禁用
|
|
- disableById(row) {
|
|
|
|
- this.$confirm("是否禁用该用户?", "提示", {
|
|
|
|
|
|
+ disableByIds(ids) {
|
|
|
|
+ this.$confirm("是否禁用用户?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "error",
|
|
type: "error",
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- var url = CORE_API + "/user/disable/" + row.id;
|
|
|
|
|
|
+ var url = CORE_API + "/user/disable/" + ids;
|
|
this.$httpWithMsg.put(url, {}).then(() => {
|
|
this.$httpWithMsg.put(url, {}).then(() => {
|
|
this.$notify({
|
|
this.$notify({
|
|
type: "success",
|
|
type: "success",
|
|
@@ -1089,21 +926,7 @@ export default {
|
|
this.searchForm.rootOrgId = this.user.rootOrgId;
|
|
this.searchForm.rootOrgId = this.user.rootOrgId;
|
|
this.userForm.rootOrgId = this.user.rootOrgId;
|
|
this.userForm.rootOrgId = this.user.rootOrgId;
|
|
|
|
|
|
- var url1 = CORE_API + "/org/getRootOrgList";
|
|
|
|
- var url2 =
|
|
|
|
- CORE_API +
|
|
|
|
- "/rolePrivilege/getRoles?includeSuperAdmin=true&rootOrgId=" +
|
|
|
|
- this.user.rootOrgId;
|
|
|
|
-
|
|
|
|
- Promise.all([
|
|
|
|
- this.$httpWithMsg.get(url1),
|
|
|
|
- this.$httpWithMsg.post(url2),
|
|
|
|
- ]).then(([resp1, resp2]) => {
|
|
|
|
- this.rootOrgList = resp1.data;
|
|
|
|
- this.roleList4Search = resp2.data;
|
|
|
|
- this.roleList4InsertOrUpdate = resp2.data;
|
|
|
|
- this.search();
|
|
|
|
- });
|
|
|
|
|
|
+ this.search();
|
|
},
|
|
},
|
|
initPrivileges() {
|
|
initPrivileges() {
|
|
let params = new URLSearchParams();
|
|
let params = new URLSearchParams();
|
|
@@ -1121,17 +944,11 @@ export default {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
- let roleCodes = row.roleCodes;
|
|
|
|
- // console.log(JSON.stringify(roleCodes));
|
|
|
|
-
|
|
|
|
- for (let n = 0; n < roleCodes.length; n++) {
|
|
|
|
- let roleCode = roleCodes[n];
|
|
|
|
- if (roleCode == "SUPER_ADMIN" || roleCode == "ORG_ADMIN") {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ const isSuperOrOrgAdmin = row.roleCodes.includes((v) =>
|
|
|
|
+ ["SUPER_ADMIN", "ORG_ADMIN"].includes(v)
|
|
|
|
+ );
|
|
|
|
|
|
- return true;
|
|
|
|
|
|
+ return !isSuperOrOrgAdmin;
|
|
},
|
|
},
|
|
copyPrevillegeDialog() {
|
|
copyPrevillegeDialog() {
|
|
const refIds = this.$refs.table.selection;
|
|
const refIds = this.$refs.table.selection;
|