|
@@ -2,10 +2,10 @@
|
|
|
<div class="container">
|
|
|
<div class="top">
|
|
|
<ul class="tab-ul">
|
|
|
- <li :class="['tab-li',{act: default_tab===item.key}]" v-for="item in tabs" :key="item.key" @click="changeTab(item)">{{item.label}}</li>
|
|
|
+ <li :class="['tab-li',{act: default_tab===item.key}]" v-for="item in authTabs" :key="item.key" @click="changeTab(item)">{{item.label}}</li>
|
|
|
</ul>
|
|
|
|
|
|
- <div class="right-side">
|
|
|
+ <div class="right-side" v-if="authTabs.length">
|
|
|
<el-input
|
|
|
v-model="searchForm.key_word"
|
|
|
:placeholder="default_tab === 5 ? '请输入图表名称' : '请输入指标Id/指标名称'"
|
|
@@ -19,7 +19,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="top">
|
|
|
- <div>
|
|
|
+ <div v-if="authTabs.length">
|
|
|
<el-cascader
|
|
|
v-model="searchForm.classification"
|
|
|
:options="classificationList"
|
|
@@ -58,9 +58,10 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-button type="primary" @click="editAuthHandle({},'multiple')">批量编辑</el-button>
|
|
|
+ <el-button type="primary" @click="editAuthHandle({},'multiple')"
|
|
|
+ v-if="[3,4].includes(default_tab)?authBtn('edit'):authTabs.length">批量编辑</el-button>
|
|
|
<el-button type="primary" @click="edbAuthSetHandle({},'multiple')" v-if="[3,4].includes(default_tab
|
|
|
- )">权限设置</el-button>
|
|
|
+ )&&authBtn('auth')">权限设置</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-table
|
|
@@ -193,7 +194,26 @@ export default {
|
|
|
{ label: '创建人',key: 'CreateUserName' },
|
|
|
{ label: '操作',key: 'handle' },
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ //权限配置化后的tabs
|
|
|
+ authTabs(){
|
|
|
+ const {operateAuthPermission,checkPermissionBtn} = this.permissionBtn
|
|
|
+ const operaMap = {
|
|
|
+ 1:checkPermissionBtn(operateAuthPermission.operateAuth_manual),
|
|
|
+ 2:checkPermissionBtn(operateAuthPermission.operateAuth_mysteel),
|
|
|
+ 3:checkPermissionBtn(operateAuthPermission.operateAuth_etaLib),
|
|
|
+ 4:checkPermissionBtn(operateAuthPermission.operateAuth_etaPredictLib),
|
|
|
+ 5:checkPermissionBtn(operateAuthPermission.operateAuth_chartLib),
|
|
|
+ }
|
|
|
+ let temp = []
|
|
|
+ for(const k in operaMap){
|
|
|
+ console.log('k',k,operaMap[k])
|
|
|
+ if(operaMap[k]){
|
|
|
+ temp.push(this.tabs[k-1])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return temp
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -349,13 +369,34 @@ export default {
|
|
|
cancelDialogHandle() {
|
|
|
this.$refs.formRef.resetFields();
|
|
|
this.isOpenDialog = false
|
|
|
+ },
|
|
|
+ authBtn(type){
|
|
|
+ const {operateAuthPermission,checkPermissionBtn} = this.permissionBtn
|
|
|
+ const authMap = {
|
|
|
+ 3:operateAuthPermission.operateAuth_etaLib_authSetting,
|
|
|
+ 4:operateAuthPermission.operateAuth_etaPredictLib_authSetting,
|
|
|
+ }
|
|
|
+ const editMap = {
|
|
|
+ 3:operateAuthPermission.operateAuth_etaLib_edit,
|
|
|
+ 4:operateAuthPermission.operateAuth_etaPredictLib_edit,
|
|
|
+ }
|
|
|
+ if(type==='auth'){
|
|
|
+ return checkPermissionBtn(authMap[this.default_tab])
|
|
|
+ }else{
|
|
|
+ return checkPermissionBtn(editMap[this.default_tab])
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getUserList();
|
|
|
+ if(this.authTabs.length){
|
|
|
+ this.getUserList();
|
|
|
+ }
|
|
|
},
|
|
|
created(){
|
|
|
- this.getClassificationList()
|
|
|
+ if(this.authTabs.length){
|
|
|
+ this.default_tab = this.authTabs[0].key
|
|
|
+ this.getClassificationList()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|