|
@@ -1,8 +1,8 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-11-29 09:27:43
|
|
|
- * @LastEditTime: 2022-03-01 10:30:44
|
|
|
- * @LastEditors: Please set LastEditors
|
|
|
+ * @LastEditTime: 2022-03-16 12:01:30
|
|
|
+ * @LastEditors: your name
|
|
|
* @Description: 权限管理
|
|
|
* @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\home.vue
|
|
|
-->
|
|
@@ -119,7 +119,7 @@
|
|
|
<div v-if="data.Type > 0" class="flex details">
|
|
|
<div class="details-msg">状态:<span :class="data.Status === 1 ? 'success' : 'error'">{{data.Status === 1 ? '启用' : '禁用'}}</span></div>
|
|
|
<div v-is="['authtree_btn_state_swatch']" class="details-info">
|
|
|
- <el-switch v-model="data.flag" @click.stop.native @change="renderChange(data,index)" active-color="#6F81BC">
|
|
|
+ <el-switch v-model="data.flag" @click.stop.native @change="childrenRenderChange(data,index)" active-color="#6F81BC">
|
|
|
</el-switch>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -148,7 +148,7 @@
|
|
|
<!--删除弹框-->
|
|
|
<Dialog :flag="flag">
|
|
|
<div class="airportInfoDialog">
|
|
|
- <div class="title">删除{{ title }}</div>
|
|
|
+ <div class="title">删除{{ type === 1 ? '应用' : '权限' }}</div>
|
|
|
<div class="content">是否确认删除{{ title }}?</div>
|
|
|
<div class="foot right t30">
|
|
|
<el-button size="medium" class="r24" @click="remove" type="danger">删除</el-button>
|
|
@@ -228,26 +228,10 @@ export default {
|
|
|
},
|
|
|
//下级关闭
|
|
|
childrenRenderChange (data, index) {
|
|
|
- try {
|
|
|
- const { OrganId, flag } = data;
|
|
|
- const Status = flag ? 1 : 0;
|
|
|
- tissueTreeStart({
|
|
|
- OrganId: OrganId,
|
|
|
- Status: Status,
|
|
|
- }).then((res) => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.$message.success(res.message);
|
|
|
- this.childrenData[index].Status = Status;
|
|
|
- // this.getOrganTree();
|
|
|
- } else {
|
|
|
- this.$message.error(res.message);
|
|
|
- this.childrenData[index].flag = !flag;
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (error) {
|
|
|
- console.log("出错了", error);
|
|
|
- this.childrenData[index].flag = !flag;
|
|
|
- }
|
|
|
+ const { AuthId, flag, Type } = data
|
|
|
+ const Status = flag ? 1 : 0
|
|
|
+ const isChildren = true
|
|
|
+ this.handleChange(AuthId, Status, Type, index, isChildren)
|
|
|
},
|
|
|
filterNode (value, data) {
|
|
|
if (!value) return true;
|
|
@@ -311,40 +295,40 @@ export default {
|
|
|
return arr
|
|
|
},
|
|
|
//渲染节点
|
|
|
- renderContent (h, data) {
|
|
|
- return (
|
|
|
- <div class="account-left-content-teams">
|
|
|
- <div class="team">
|
|
|
- <div class={[data.Type <= 1 ? 'status1' : 'status2', 'bg']}></div>
|
|
|
- <div class={[data.QueryTarget == 1 ? 'activeStatus' : '', 'list']}>
|
|
|
- <div class="flex info">
|
|
|
- <div class="name">{data.AuthName}</div>
|
|
|
- <div class="icon">
|
|
|
- <span v-show={data.Type === 0} onClick={() => this.renderAdd()} class="cap cap-plus"></span>
|
|
|
- <span v-show={data.Type === 1} onClick={() => this.renderEdit(data)} class="cap cap-edit"></span>
|
|
|
- <span v-show={data.Type === 2} onClick={() => this.renderSub(data)} class="cap cap-sub"></span>
|
|
|
- <span v-show={data.Type > 2} onClick={() => this.renderEdit(data)} class="cap cap-edit"></span>
|
|
|
- <span v-show={data.Type > 2} onClick={() => this.renderSub(data)} class="cap cap-sub"></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-show={data.Type > 0} class="flex details">
|
|
|
- <div class="details-msg">状态:<span class={[data.Status === 1 ? 'success' : 'error']}>{data.Status === 1 ? '启用' : '禁用'}</span></div>
|
|
|
- <div class="details-info">
|
|
|
- <el-switch v-model={data.flag} onChange={() => this.renderChange(data)} active-color="#6F81BC">
|
|
|
- </el-switch>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-show={data.Type !== 0 && data.Type !== 2} onClick={() => this.onNodeClick(data)} class="info-close">
|
|
|
- <i class={[data.Type === 1 ? 'close1' : data.Type > 2 ? 'close2' : '', 'icon', 'el-icon-close']}></i>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- )
|
|
|
- },
|
|
|
+ // renderContent (h, data) {
|
|
|
+ // return (
|
|
|
+ // <div class="account-left-content-teams">
|
|
|
+ // <div class="team">
|
|
|
+ // <div class={[data.Type <= 1 ? 'status1' : 'status2', 'bg']}></div>
|
|
|
+ // <div class={[data.QueryTarget == 1 ? 'activeStatus' : '', 'list']}>
|
|
|
+ // <div class="flex info">
|
|
|
+ // <div class="name">{data.AuthName}</div>
|
|
|
+ // <div class="icon">
|
|
|
+ // <span v-show={data.Type === 0} onClick={() => this.renderAdd()} class="cap cap-plus"></span>
|
|
|
+ // <span v-show={data.Type === 1} onClick={() => this.renderEdit(data)} class="cap cap-edit"></span>
|
|
|
+ // <span v-show={data.Type === 2} onClick={() => this.renderSub(data)} class="cap cap-sub"></span>
|
|
|
+ // <span v-show={data.Type > 2} onClick={() => this.renderEdit(data)} class="cap cap-edit"></span>
|
|
|
+ // <span v-show={data.Type > 2} onClick={() => this.renderSub(data)} class="cap cap-sub"></span>
|
|
|
+ // </div>
|
|
|
+ // </div>
|
|
|
+ // <div v-show={data.Type > 0} class="flex details">
|
|
|
+ // <div class="details-msg">状态:<span class={[data.Status === 1 ? 'success' : 'error']}>{data.Status === 1 ? '启用' : '禁用'}</span></div>
|
|
|
+ // <div class="details-info">
|
|
|
+ // <el-switch v-model={data.flag} onChange={() => this.renderChange(data)} active-color="#6F81BC">
|
|
|
+ // </el-switch>
|
|
|
+ // </div>
|
|
|
+ // </div>
|
|
|
+ // </div>
|
|
|
+ // </div>
|
|
|
+ // <div v-show={data.Type !== 0 && data.Type !== 2} onClick={() => this.onNodeClick(data)} class="info-close">
|
|
|
+ // <i class={[data.Type === 1 ? 'close1' : data.Type > 2 ? 'close2' : '', 'icon', 'el-icon-close']}></i>
|
|
|
+ // </div>
|
|
|
+ // </div>
|
|
|
+ // )
|
|
|
+ // },
|
|
|
//-----------获取数据------------
|
|
|
//应用状态变更
|
|
|
- async handleChange (id, val, type, index) {
|
|
|
+ async handleChange (id, val, type, index, isChildren = false) {
|
|
|
try {
|
|
|
let res = null
|
|
|
if (type === 1) {
|
|
@@ -360,7 +344,7 @@ export default {
|
|
|
}
|
|
|
if (res.code === 0) {
|
|
|
this.$message.success(res.message)
|
|
|
- if (type === 1) {
|
|
|
+ if (!isChildren) {
|
|
|
this.currDataArr[0].Status = val
|
|
|
} else {
|
|
|
this.childrenData[index].Status = val
|
|
@@ -368,7 +352,7 @@ export default {
|
|
|
//this.getAuthTree()
|
|
|
} else {
|
|
|
this.$message.error(res.message)
|
|
|
- if (type === 1) {
|
|
|
+ if (!isChildren) {
|
|
|
this.currDataArr[0].flag = !flag;
|
|
|
} else {
|
|
|
this.childrenData[index].flag = !flag;
|
|
@@ -376,7 +360,7 @@ export default {
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log('出错了', error)
|
|
|
- if (type === 1) {
|
|
|
+ if (!isChildren) {
|
|
|
this.currDataArr[0].flag = !flag;
|
|
|
} else {
|
|
|
this.childrenData[index].flag = !flag;
|