3
0
zhangjie 2 سال پیش
والد
کامیت
5a06d20f5c

+ 5 - 2
src/modules/admin/components/AppConfigManage.vue

@@ -143,6 +143,7 @@
       ref="ModifyAppConfigItem"
       :instance="curConfigItem"
       :group="curGroupForAdd"
+      @modified="search"
     ></modify-app-config-item>
   </div>
 </template>
@@ -247,6 +248,7 @@ export default {
       this.baselineList = [];
       this.curBaselineItem = {};
       this.envList = [];
+      this.groupConfigList = [];
     },
     cancel() {
       this.modalIsShow = false;
@@ -382,7 +384,7 @@ export default {
     },
     getConfigItemGroupPosInfo(configItemKey) {
       const curGroup = this.configGroups.find(group =>
-        configItemKey.startsWith(group.prefix)
+        configItemKey.startsWith(group.prefix + ".")
       );
       if (!curGroup) return;
       let groupData = {
@@ -442,7 +444,7 @@ export default {
         return;
       }
 
-      this.curConfigItem = { ...this.filter };
+      this.curConfigItem = { ...this.filter, available: { type: "string" } };
       this.$refs.ModifyAppConfigItem.open();
     },
     toEdit(row) {
@@ -465,6 +467,7 @@ export default {
     },
     baselineModified(data) {
       this.setCacheBaselineList(data);
+      this.search();
     },
     scrollTo(group) {
       this.$refs.ConfigTableBody.scrollTop =

+ 5 - 2
src/modules/admin/components/ModifyAppConfigItem.vue

@@ -16,6 +16,9 @@
       :rules="rules"
       label-width="100px"
     >
+      <el-form-item v-if="!isEdit" label="分组:">
+        {{ group && group.name }}
+      </el-form-item>
       <el-form-item
         v-if="!isEdit && group && group.available && group.available.length"
         prop="selectAvailableKey"
@@ -106,7 +109,7 @@ export default {
         this.group &&
         this.group.available &&
         !this.group.available.length &&
-        !value.startsWith(this.group.prefix)
+        !value.startsWith(this.group.prefix + ".")
       ) {
         return callback(
           new Error(`配置项需要带有${this.group.prefix}的前缀。`)
@@ -175,7 +178,7 @@ export default {
           }
         ]
       },
-      available: null,
+      available: { type: "string" },
       selectAvailableKey: "",
       selectAvailable: {},
       isStrictKey: false

+ 1 - 1
src/modules/admin/views/AppManage.vue

@@ -49,7 +49,7 @@
             >
           </template>
         </el-table-column>
-        <el-table-column label="管理" width="280" class-name="action-column">
+        <el-table-column label="管理" width="220" class-name="action-column">
           <template slot-scope="scope">
             <el-button
               class="btn-primary"