|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-11-29 11:26:07
|
|
|
- * @LastEditTime: 2022-01-13 14:01:12
|
|
|
+ * @LastEditTime: 2022-02-14 15:49:05
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description:新增组织
|
|
|
* @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\authorityPower.vue
|
|
@@ -17,19 +17,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="addApp-form-content dialog-public-background">
|
|
|
- <el-form
|
|
|
- :inline="true"
|
|
|
- ref="form"
|
|
|
- :rules="rules"
|
|
|
- class="form"
|
|
|
- :model="form"
|
|
|
- >
|
|
|
+ <el-form :inline="true" ref="form" :rules="rules" class="form" :model="form">
|
|
|
<el-form-item prop="name" label="组织名称">
|
|
|
- <el-input
|
|
|
- placeholder="请输入组织名称"
|
|
|
- maxlength="32"
|
|
|
- v-model="form.name"
|
|
|
- ></el-input>
|
|
|
+ <el-input placeholder="请输入组织名称" maxlength="32" v-model="form.name"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="id" label="组织类型">
|
|
|
<el-select v-model="form.id" placeholder="请选择">
|
|
@@ -38,85 +28,15 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="描述">
|
|
|
- <el-input
|
|
|
- style="width: 640px"
|
|
|
- maxlength="200"
|
|
|
- placeholder="请输入描述"
|
|
|
- v-model="form.app"
|
|
|
- ></el-input>
|
|
|
+ <el-input style="width: 640px" maxlength="200" placeholder="请输入描述" v-model="form.app"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="power-content flex-wrap">
|
|
|
<div class="r24 flex1 part">
|
|
|
- <Organization
|
|
|
- :defaultProps="defaultProps"
|
|
|
- :data="data"
|
|
|
- nodekey="OrganId"
|
|
|
- :checkedKeys="checkedKeys"
|
|
|
- title="上级组织"
|
|
|
- />
|
|
|
+ <Organization :defaultProps="defaultProps" :data="data" nodekey="OrganId" :checkedKeys="checkedKeys" title="上级组织" />
|
|
|
</div>
|
|
|
- <!--有角色-->
|
|
|
- <template v-if="openRole">
|
|
|
- <div class="r24 flex1 part">
|
|
|
- <Rolelist
|
|
|
- @checkChange="checkChange"
|
|
|
- @checkClick="checkClick"
|
|
|
- :dataList="arrs"
|
|
|
- :active="true"
|
|
|
- class="hucRole"
|
|
|
- :number="8"
|
|
|
- title="角色列表"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="flex1 part">
|
|
|
- <Permissionlist
|
|
|
- :RoleList="RoleList"
|
|
|
- :check="true"
|
|
|
- class="hucPower"
|
|
|
- title="权限列表"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <!--有账号组-->
|
|
|
- <template v-else-if="OpenGroup">
|
|
|
- <div class="r24 flex1 part">
|
|
|
- <Rolelist
|
|
|
- @checkChange="checkChange"
|
|
|
- @checkClick="checkGroup"
|
|
|
- :dataList="arrs"
|
|
|
- :active="true"
|
|
|
- class="hucRole"
|
|
|
- :number="8"
|
|
|
- title="权限组列表"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="flex1 part">
|
|
|
- <Permissionlist
|
|
|
- :RoleList="RoleList"
|
|
|
- :check="true"
|
|
|
- class="hucPower"
|
|
|
- title="权限列表"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <!--无角色-->
|
|
|
- <template v-else>
|
|
|
- <div class="r24 flex1 part">
|
|
|
- <Permissiontree
|
|
|
- :queryType="queryType"
|
|
|
- :queryId="AppId"
|
|
|
- @nodeClick="nodeClick"
|
|
|
- @getTreeData="getTreeData"
|
|
|
- title="权限树"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="flex1 part">
|
|
|
- <Rulesofcompetency @getData="getData" title="权限规则" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -142,7 +62,7 @@ export default {
|
|
|
Permissionlist,
|
|
|
Rolelist,
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
Status: null,
|
|
|
AppId: null,
|
|
@@ -183,27 +103,15 @@ export default {
|
|
|
watch: {
|
|
|
//监听上级组织数据
|
|
|
dataList: {
|
|
|
- handler(val) {
|
|
|
+ handler (val) {
|
|
|
const arr = [val];
|
|
|
- this.decompose(arr, this.AppId);
|
|
|
- if (Array.isArray(this.dataObj)) {
|
|
|
- if (this.dataObj.children) {
|
|
|
- delete this.dataObj.children;
|
|
|
- }
|
|
|
- this.data = this.dataObj;
|
|
|
- } else {
|
|
|
- if (this.dataObj.children) {
|
|
|
- delete this.dataObj.children;
|
|
|
- }
|
|
|
- this.data = [this.dataObj];
|
|
|
- }
|
|
|
+ this.data = arr;
|
|
|
this.checkedKeys = [this.AppId];
|
|
|
},
|
|
|
deep: true,
|
|
|
},
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getOrganTree();
|
|
|
+ created () {
|
|
|
const { OrganId, Status } = this.$route.query;
|
|
|
const { OpenRole, OpenGroup } =
|
|
|
typeof this.systemSet === "string"
|
|
@@ -213,28 +121,15 @@ export default {
|
|
|
this.AppId = OrganId;
|
|
|
this.openRole = OpenRole;
|
|
|
this.OpenGroup = OpenGroup;
|
|
|
- if (OpenRole) {
|
|
|
- this.getRoleByOrgan(this.AppId);
|
|
|
- } else if (OpenGroup) {
|
|
|
- if (OrganId == -1) {
|
|
|
- this.getGroupTree();
|
|
|
- } else {
|
|
|
- this.getGroupByOrgan(this.AppId);
|
|
|
- }
|
|
|
- }
|
|
|
- if (OrganId == -1) {
|
|
|
- this.queryType = "all";
|
|
|
- } else {
|
|
|
- this.queryType = "origin";
|
|
|
- }
|
|
|
+ this.getOrganTree();
|
|
|
},
|
|
|
methods: {
|
|
|
//获取选中的树数据
|
|
|
- getTreeData(arr) {
|
|
|
+ getTreeData (arr) {
|
|
|
this.checkTrees = arr;
|
|
|
},
|
|
|
//获取指定数据
|
|
|
- decompose(data, id) {
|
|
|
+ decompose (data, id) {
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
if (data[i].OrganId == id) {
|
|
|
this.dataObj = data[i];
|
|
@@ -244,21 +139,21 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//权限树点击
|
|
|
- nodeClick(obj) {
|
|
|
+ nodeClick (obj) {
|
|
|
const arr = this.$store.getters.authArrs;
|
|
|
arr.push(obj);
|
|
|
this.$store.dispatch("auth/changeAuthArrs", arr);
|
|
|
},
|
|
|
//角色点击回调
|
|
|
- checkClick(item) {
|
|
|
+ checkClick (item) {
|
|
|
this.roleAuths(item.RoleId);
|
|
|
},
|
|
|
//账号组点击回调
|
|
|
- checkGroup(item) {
|
|
|
+ checkGroup (item) {
|
|
|
this.groupAuths(item.GroupId);
|
|
|
},
|
|
|
//根据角色查看权限列表
|
|
|
- async roleAuths(id) {
|
|
|
+ async roleAuths (id) {
|
|
|
try {
|
|
|
let params = {
|
|
|
RoleId: id,
|
|
@@ -274,7 +169,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//角色选取
|
|
|
- checkChange(arr) {
|
|
|
+ checkChange (arr) {
|
|
|
const datas = [];
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
|
datas.push(this.arrs[arr[i]]);
|
|
@@ -285,11 +180,11 @@ export default {
|
|
|
this.checkRoles = datas;
|
|
|
},
|
|
|
//获取权限规则
|
|
|
- getData(obj) {
|
|
|
+ getData (obj) {
|
|
|
this.rulesObj = obj;
|
|
|
},
|
|
|
//保存
|
|
|
- saveBtn(formName) {
|
|
|
+ saveBtn (formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.saveOrgan();
|
|
@@ -300,7 +195,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
//组织新增保存
|
|
|
- async saveOrgan() {
|
|
|
+ async saveOrgan () {
|
|
|
try {
|
|
|
const datas = [];
|
|
|
this.checkTrees.forEach((item) => {
|