|
@@ -12,7 +12,14 @@
|
|
|
<div v-if="isStatus || isStatuser" class="vStatus">
|
|
|
<slot name="header" />
|
|
|
</div>
|
|
|
- <el-button v-if="isBtn" size="small" @click="handleAdd" plain type="primary">新增</el-button>
|
|
|
+ <template v-if="isBtn">
|
|
|
+ <template v-if="isAuth">
|
|
|
+ <el-button v-if="btnAuthAdd" size="small" @click="handleAdd" plain type="primary">新增</el-button>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-button size="small" @click="handleAdd" plain type="primary">新增</el-button>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
<template v-if="tableData.length">
|
|
|
<div>
|
|
@@ -86,8 +93,18 @@
|
|
|
</template>
|
|
|
</template>
|
|
|
<!-- <el-button class="hrefBtn" type="text" @click="handleHerf(scope.row)" size="small">跳转</el-button> -->
|
|
|
- <el-button type="text" @click="handleEdit(scope.row)" size="small" class="rmScs">编辑</el-button>
|
|
|
- <el-button class="rmSc" type="text" @click="handleRemove(scope.row)" size="small">删除</el-button>
|
|
|
+ <template v-if="isAuth">
|
|
|
+ <el-button v-if="btnAuthEdit" type="text" @click="handleEdit(scope.row)" size="small" class="rmScs">编辑</el-button>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-button type="text" @click="handleEdit(scope.row)" size="small" class="rmScs">编辑</el-button>
|
|
|
+ </template>
|
|
|
+ <template v-if="isAuth">
|
|
|
+ <el-button v-if="btnAuthDel" class="rmSc" type="text" @click="handleRemove(scope.row)" size="small">删除</el-button>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-button class="rmSc" type="text" @click="handleRemove(scope.row)" size="small">删除</el-button>
|
|
|
+ </template>
|
|
|
<el-button class="rmScs" v-if="withColumnSet" type="text" size="small" @click="handleColumnSet(scope.row)">列设置</el-button>
|
|
|
<el-button class="rmScs" v-if="withItemSet" type="text" size="small" @click="handleItemSet(scope.row)">数据项</el-button>
|
|
|
<el-button class="rmScser" v-if="withlodSet" type="text" size="small" @click="handlelodSet(scope.row)">航站设置</el-button>
|
|
@@ -296,6 +313,26 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
},
|
|
|
+ //新增按钮权限
|
|
|
+ authAdd: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
+ //编辑按钮权限
|
|
|
+ authEdit: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
+ //删除按钮权限
|
|
|
+ authDel: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
+ //是否启用权限按钮
|
|
|
+ isAuth: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
},
|
|
|
components: { Dialog, NoData },
|
|
|
data() {
|
|
@@ -325,6 +362,7 @@ export default {
|
|
|
tableOptions: {}, //弹框-下来数据缓存
|
|
|
tableArrs: [], //重组table-表头下拉
|
|
|
proAll: false, //重组时-所有请求是否都完成
|
|
|
+ roles: JSON.parse(sessionStorage.getItem("userAuthList")) ?? [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -366,6 +404,27 @@ export default {
|
|
|
return flag;
|
|
|
});
|
|
|
},
|
|
|
+ btnAuthAdd() {
|
|
|
+ if (this.roles.includes(this.authAdd)) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ btnAuthEdit() {
|
|
|
+ if (this.roles.includes(this.authEdit)) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ btnAuthDel() {
|
|
|
+ if (this.roles.includes(this.authDel)) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
dataContent: {
|