|
@@ -61,8 +61,8 @@
|
|
</el-button>
|
|
</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="config-table">
|
|
|
|
- <div class="part-box part-box-pad config-table-guide">
|
|
|
|
|
|
+ <div class="config-body">
|
|
|
|
+ <div class="part-box part-box-pad config-guide">
|
|
<ul>
|
|
<ul>
|
|
<li
|
|
<li
|
|
v-for="group in groupConfigList"
|
|
v-for="group in groupConfigList"
|
|
@@ -74,51 +74,52 @@
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div
|
|
|
|
- ref="ConfigTableBody"
|
|
|
|
- class="part-box part-box-pad config-table-body"
|
|
|
|
- >
|
|
|
|
|
|
+ <div ref="ConfigTableBody" class="part-box part-box-pad config-content">
|
|
<div
|
|
<div
|
|
v-for="group in groupConfigList"
|
|
v-for="group in groupConfigList"
|
|
:key="group.name"
|
|
:key="group.name"
|
|
- class="table-part"
|
|
|
|
|
|
+ :class="[
|
|
|
|
+ 'config-content-part',
|
|
|
|
+ { 'config-content-none': !group.children.length }
|
|
|
|
+ ]"
|
|
:id="group.name"
|
|
:id="group.name"
|
|
>
|
|
>
|
|
- <div class="box-justify mb-2">
|
|
|
|
- <h3 class="table-part-title">
|
|
|
|
|
|
+ <div class="config-content-title">
|
|
|
|
+ <h3>
|
|
{{ group.name | groupNameFilter }}
|
|
{{ group.name | groupNameFilter }}
|
|
</h3>
|
|
</h3>
|
|
<el-button
|
|
<el-button
|
|
v-if="group.name !== 'custom' && !IS_BASELINE"
|
|
v-if="group.name !== 'custom' && !IS_BASELINE"
|
|
- size="mini"
|
|
|
|
- type="primary"
|
|
|
|
|
|
+ class="btn-success"
|
|
|
|
+ type="text"
|
|
@click="toAddGroupConfigItem(group)"
|
|
@click="toAddGroupConfigItem(group)"
|
|
>新增</el-button
|
|
>新增</el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
- <el-table ref="TableList" :data="group.children" border>
|
|
|
|
- <el-table-column prop="key" label="配置项"> </el-table-column>
|
|
|
|
- <el-table-column prop="value" label="配置值"> </el-table-column>
|
|
|
|
- <el-table-column prop="mode" label="模式" width="100">
|
|
|
|
- <span slot-scope="scope">{{ modeMap[scope.row.mode] }}</span>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="comment" label="注释"> </el-table-column>
|
|
|
|
- <el-table-column
|
|
|
|
- label="操作"
|
|
|
|
- width="80"
|
|
|
|
- class-name="action-column"
|
|
|
|
|
|
+ <div class="config-content-list">
|
|
|
|
+ <div
|
|
|
|
+ v-for="item in group.children"
|
|
|
|
+ :key="item.key"
|
|
|
|
+ class="config-content-item"
|
|
>
|
|
>
|
|
- <template slot-scope="scope">
|
|
|
|
|
|
+ <div v-if="item.comment" class="config-content-comment">
|
|
|
|
+ {{ item.comment }}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="config-content-cont">
|
|
|
|
+ <span>{{ item.key }}</span>
|
|
|
|
+ <span>=</span>
|
|
|
|
+ <span>{{ item.value }}</span>
|
|
|
|
+ <span class="cont-mode">[{{ modeMap[item.mode] }}]</span>
|
|
<el-button
|
|
<el-button
|
|
- v-if="scope.row.mode !== 'READONLY'"
|
|
|
|
|
|
+ v-if="item.mode !== 'READONLY'"
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
- @click="toEdit(scope.row)"
|
|
|
|
|
|
+ @click="toEdit(item)"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
>
|
|
>
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -157,6 +158,7 @@ import {
|
|
import UpdateAppBaseline from "../components/UpdateAppBaseline.vue";
|
|
import UpdateAppBaseline from "../components/UpdateAppBaseline.vue";
|
|
import ModifyAppBaselineItem from "../components/ModifyAppBaselineItem.vue";
|
|
import ModifyAppBaselineItem from "../components/ModifyAppBaselineItem.vue";
|
|
import ModifyAppConfigItem from "../components/ModifyAppConfigItem.vue";
|
|
import ModifyAppConfigItem from "../components/ModifyAppConfigItem.vue";
|
|
|
|
+import { deepCopy } from "@/plugins/utils";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "app-config-manage",
|
|
name: "app-config-manage",
|
|
@@ -339,23 +341,23 @@ export default {
|
|
this.configList = configList;
|
|
this.configList = configList;
|
|
},
|
|
},
|
|
buildGroupConfigList(dataList) {
|
|
buildGroupConfigList(dataList) {
|
|
- let groupConfigList = [];
|
|
|
|
|
|
+ let groupConfigList = deepCopy(this.configGroups);
|
|
|
|
+ groupConfigList.forEach(item => {
|
|
|
|
+ item.children = [];
|
|
|
|
+ });
|
|
|
|
+ const defaultAvailable = {
|
|
|
|
+ type: "string"
|
|
|
|
+ };
|
|
|
|
+
|
|
dataList.forEach(configItem => {
|
|
dataList.forEach(configItem => {
|
|
const info = this.getConfigItemGroupPosInfo(configItem.key);
|
|
const info = this.getConfigItemGroupPosInfo(configItem.key);
|
|
if (info) {
|
|
if (info) {
|
|
let group = groupConfigList.find(
|
|
let group = groupConfigList.find(
|
|
gitem => gitem.name === info.group.name
|
|
gitem => gitem.name === info.group.name
|
|
);
|
|
);
|
|
- if (!group) {
|
|
|
|
- group = {
|
|
|
|
- ...info.group,
|
|
|
|
- children: []
|
|
|
|
- };
|
|
|
|
- groupConfigList.push(group);
|
|
|
|
- }
|
|
|
|
group.children.push({
|
|
group.children.push({
|
|
...configItem,
|
|
...configItem,
|
|
- available: info.available
|
|
|
|
|
|
+ available: info.available || { ...defaultAvailable }
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -371,15 +373,16 @@ export default {
|
|
}
|
|
}
|
|
group.children.push({
|
|
group.children.push({
|
|
...configItem,
|
|
...configItem,
|
|
- available: null
|
|
|
|
|
|
+ available: { ...defaultAvailable }
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ groupConfigList.sort((a, b) => b.children.length - a.children.length);
|
|
|
|
|
|
this.groupConfigList = groupConfigList;
|
|
this.groupConfigList = groupConfigList;
|
|
},
|
|
},
|
|
getConfigItemGroupPosInfo(configItemKey) {
|
|
getConfigItemGroupPosInfo(configItemKey) {
|
|
const curGroup = this.configGroups.find(group =>
|
|
const curGroup = this.configGroups.find(group =>
|
|
- configItemKey.includes(group.prefix)
|
|
|
|
|
|
+ configItemKey.startsWith(group.prefix)
|
|
);
|
|
);
|
|
if (!curGroup) return;
|
|
if (!curGroup) return;
|
|
let groupData = {
|
|
let groupData = {
|
|
@@ -428,10 +431,11 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- const unvalidKeys = group.children.map(item => item.key);
|
|
|
|
|
|
+ const unvalidKeys = this.configList.map(item => item.key);
|
|
this.curGroupForAdd = { ...ginfo, unvalidKeys };
|
|
this.curGroupForAdd = { ...ginfo, unvalidKeys };
|
|
|
|
+ const groupUnvalidKeys = group.children.map(item => item.key);
|
|
this.curGroupForAdd.available = this.curGroupForAdd.available.filter(
|
|
this.curGroupForAdd.available = this.curGroupForAdd.available.filter(
|
|
- item => !unvalidKeys.includes(item.key)
|
|
|
|
|
|
+ item => !groupUnvalidKeys.includes(item.key)
|
|
);
|
|
);
|
|
if (!this.curGroupForAdd.available.length && ginfo.available.length) {
|
|
if (!this.curGroupForAdd.available.length && ginfo.available.length) {
|
|
this.$message.error("当前分组不可添加配置项!");
|
|
this.$message.error("当前分组不可添加配置项!");
|