|
@@ -37,7 +37,11 @@
|
|
<el-button type="primary" icon="ios-search" @click="search"
|
|
<el-button type="primary" icon="ios-search" @click="search"
|
|
>查询</el-button
|
|
>查询</el-button
|
|
>
|
|
>
|
|
- <el-button type="success" icon="md-add" @click="toUpdate"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('app_config_baseline_edit')"
|
|
|
|
+ type="success"
|
|
|
|
+ icon="md-add"
|
|
|
|
+ @click="toUpdate"
|
|
>配置基线修改</el-button
|
|
>配置基线修改</el-button
|
|
>
|
|
>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -46,19 +50,25 @@
|
|
|
|
|
|
<div class="mb-4 tab-btns tab-nowrap">
|
|
<div class="mb-4 tab-btns tab-nowrap">
|
|
<el-button
|
|
<el-button
|
|
|
|
+ v-if="checkPrivilege('app_config_baseline')"
|
|
size="medium"
|
|
size="medium"
|
|
:type="filter.envId == null ? 'primary' : 'default'"
|
|
:type="filter.envId == null ? 'primary' : 'default'"
|
|
@click="selectEnv({ id: null })"
|
|
@click="selectEnv({ id: null })"
|
|
>基线
|
|
>基线
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button
|
|
|
|
- v-for="env in envList"
|
|
|
|
- :key="env.id"
|
|
|
|
- size="medium"
|
|
|
|
- :type="filter.envId == env.id ? 'primary' : 'default'"
|
|
|
|
- @click="selectEnv(env)"
|
|
|
|
- >{{ env.name }}
|
|
|
|
- </el-button>
|
|
|
|
|
|
+ <template v-for="env in envList">
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="
|
|
|
|
+ (checkPrivilege('app_config_test') && env.type === 'TEST') ||
|
|
|
|
+ (checkPrivilege('app_config_prod') && env.type === 'PROD')
|
|
|
|
+ "
|
|
|
|
+ :key="env.id"
|
|
|
|
+ size="medium"
|
|
|
|
+ :type="filter.envId == env.id ? 'primary' : 'default'"
|
|
|
|
+ @click="selectEnv(env)"
|
|
|
|
+ >{{ env.name }}
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="config-body">
|
|
<div class="config-body">
|
|
@@ -89,7 +99,7 @@
|
|
{{ group.name | groupNameFilter }}
|
|
{{ group.name | groupNameFilter }}
|
|
</h3>
|
|
</h3>
|
|
<el-button
|
|
<el-button
|
|
- v-if="group.name !== 'custom' && !IS_BASELINE"
|
|
|
|
|
|
+ v-if="checkAddPrivilege(group)"
|
|
class="btn-success"
|
|
class="btn-success"
|
|
type="text"
|
|
type="text"
|
|
@click="toAddGroupConfigItem(group)"
|
|
@click="toAddGroupConfigItem(group)"
|
|
@@ -111,7 +121,7 @@
|
|
<span>{{ item.value }}</span>
|
|
<span>{{ item.value }}</span>
|
|
<span class="cont-mode">[{{ modeMap[item.mode] }}]</span>
|
|
<span class="cont-mode">[{{ modeMap[item.mode] }}]</span>
|
|
<el-button
|
|
<el-button
|
|
- v-if="item.mode !== 'READONLY'"
|
|
|
|
|
|
+ v-if="checkEditPrivilege(item)"
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
@click="toEdit(item)"
|
|
@click="toEdit(item)"
|
|
@@ -127,6 +137,7 @@
|
|
|
|
|
|
<!-- UpdateAppBaseline -->
|
|
<!-- UpdateAppBaseline -->
|
|
<update-app-baseline
|
|
<update-app-baseline
|
|
|
|
+ v-if="checkPrivilege('app_config_baseline_edit')"
|
|
ref="UpdateAppBaseline"
|
|
ref="UpdateAppBaseline"
|
|
:data="filter"
|
|
:data="filter"
|
|
@modified="baselineModified"
|
|
@modified="baselineModified"
|
|
@@ -213,6 +224,7 @@ export default {
|
|
configModes: [],
|
|
configModes: [],
|
|
modeMap: {},
|
|
modeMap: {},
|
|
envList: [],
|
|
envList: [],
|
|
|
|
+ curEnv: {},
|
|
configGroups: [],
|
|
configGroups: [],
|
|
curGroupForAdd: null,
|
|
curGroupForAdd: null,
|
|
groupConfigList: []
|
|
groupConfigList: []
|
|
@@ -250,6 +262,24 @@ export default {
|
|
this.envList = [];
|
|
this.envList = [];
|
|
this.groupConfigList = [];
|
|
this.groupConfigList = [];
|
|
},
|
|
},
|
|
|
|
+ checkAddPrivilege(group) {
|
|
|
|
+ const privilege =
|
|
|
|
+ (this.checkPrivilege("app_config_test_item_add") &&
|
|
|
|
+ this.curEnv.type === "TEST") ||
|
|
|
|
+ (this.checkPrivilege("app_config_prod_item_add") &&
|
|
|
|
+ this.curEnv.type === "PROD");
|
|
|
|
+ return group.name !== "custom" && !this.IS_BASELINE && privilege;
|
|
|
|
+ },
|
|
|
|
+ checkEditPrivilege(item) {
|
|
|
|
+ const privilege =
|
|
|
|
+ (this.checkPrivilege("app_config_test_item_edit") &&
|
|
|
|
+ this.curEnv.type === "TEST") ||
|
|
|
|
+ (this.checkPrivilege("app_config_prod_item_edit") &&
|
|
|
|
+ this.curEnv.type === "PROD") ||
|
|
|
|
+ (this.checkPrivilege("app_config_baseline_item_edit") &&
|
|
|
|
+ this.IS_BASELINE);
|
|
|
|
+ return item.mode !== "READONLY" && privilege;
|
|
|
|
+ },
|
|
cancel() {
|
|
cancel() {
|
|
this.modalIsShow = false;
|
|
this.modalIsShow = false;
|
|
},
|
|
},
|
|
@@ -280,6 +310,7 @@ export default {
|
|
this.configGroups = data || [];
|
|
this.configGroups = data || [];
|
|
},
|
|
},
|
|
selectEnv(env) {
|
|
selectEnv(env) {
|
|
|
|
+ this.curEnv = env;
|
|
this.filter.envId = env.id;
|
|
this.filter.envId = env.id;
|
|
this.search();
|
|
this.search();
|
|
},
|
|
},
|