|
@@ -247,14 +247,21 @@ export default {
|
|
|
configGroups: [],
|
|
|
curGroupForAdd: null,
|
|
|
groupConfigList: [],
|
|
|
- hideReadonly: true
|
|
|
+ hideReadonly: true,
|
|
|
+ user: {}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
IS_BASELINE() {
|
|
|
return this.filter.envId === null;
|
|
|
+ },
|
|
|
+ IS_MAINTAINER() {
|
|
|
+ return this.curEnv.userId === this.user.id;
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.user = this.$ls.get("user", {});
|
|
|
+ },
|
|
|
methods: {
|
|
|
isEmpty(val) {
|
|
|
return val === null || val === "" || val === undefined;
|
|
@@ -264,11 +271,14 @@ export default {
|
|
|
await this.appConfigGroups();
|
|
|
if (!this.filter.appId !== this.app.id) this.resetData();
|
|
|
this.filter.appId = this.app.id;
|
|
|
- await this.$refs.VersionSelect.search();
|
|
|
- await this.$refs.ModuleSelect.search();
|
|
|
|
|
|
- await this.getEnvList();
|
|
|
- this.selectEnv(this.envList[0]);
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ await this.$refs.VersionSelect.search();
|
|
|
+ await this.$refs.ModuleSelect.search();
|
|
|
+
|
|
|
+ await this.getEnvList();
|
|
|
+ this.selectEnv(this.envList[0]);
|
|
|
+ });
|
|
|
},
|
|
|
resetData() {
|
|
|
this.filter = {
|
|
@@ -291,7 +301,8 @@ export default {
|
|
|
(this.checkPrivilege("app_config_test_item_add") &&
|
|
|
this.curEnv.type === "TEST") ||
|
|
|
(this.checkPrivilege("app_config_prod_item_add") &&
|
|
|
- this.curEnv.type === "PROD");
|
|
|
+ this.curEnv.type === "PROD") ||
|
|
|
+ this.IS_MAINTAINER;
|
|
|
return group.name !== "custom" && !this.IS_BASELINE && privilege;
|
|
|
},
|
|
|
checkEditPrivilege(item) {
|
|
@@ -304,7 +315,8 @@ export default {
|
|
|
return (
|
|
|
(item.mode !== "READONLY" && privilege) ||
|
|
|
(this.checkPrivilege("app_config_baseline_item_edit") &&
|
|
|
- this.IS_BASELINE)
|
|
|
+ this.IS_BASELINE) ||
|
|
|
+ (!this.IS_BASELINE && this.IS_MAINTAINER)
|
|
|
);
|
|
|
},
|
|
|
cancel() {
|