|
@@ -47,11 +47,10 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="value" label="配置值:">
|
|
|
- <el-input
|
|
|
- v-model.trim="modalForm.value"
|
|
|
- placeholder="请输入配置值"
|
|
|
- clearable
|
|
|
- ></el-input>
|
|
|
+ <value-modify
|
|
|
+ v-model="modalForm.value"
|
|
|
+ :available="available"
|
|
|
+ ></value-modify>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item v-if="modalForm.comment" label="注释:">
|
|
@@ -69,6 +68,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { appConfigItemUpdate } from "../api";
|
|
|
+import ValueModify from "./ValueModify.vue";
|
|
|
|
|
|
const initModalForm = {
|
|
|
appId: "",
|
|
@@ -82,6 +82,9 @@ const initModalForm = {
|
|
|
|
|
|
export default {
|
|
|
name: "modify-app-config-item",
|
|
|
+ components: {
|
|
|
+ ValueModify
|
|
|
+ },
|
|
|
props: {
|
|
|
instance: {
|
|
|
type: Object,
|
|
@@ -167,19 +170,15 @@ export default {
|
|
|
value: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "请输入配置值",
|
|
|
- trigger: "change"
|
|
|
- },
|
|
|
- {
|
|
|
- max: 200,
|
|
|
- message: "配置值不能超过200字符",
|
|
|
+ message: "请设置配置值",
|
|
|
trigger: "change"
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
+ available: null,
|
|
|
selectAvailableKey: "",
|
|
|
selectAvailable: {},
|
|
|
- isStrictKey: true
|
|
|
+ isStrictKey: false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -198,7 +197,8 @@ export default {
|
|
|
visibleChange() {
|
|
|
this.selectAvailableKey = "";
|
|
|
this.selectAvailable = {};
|
|
|
- this.isStrictKey = true;
|
|
|
+ this.isStrictKey = false;
|
|
|
+ this.available = this.instance.available;
|
|
|
this.initData(this.instance);
|
|
|
},
|
|
|
cancel() {
|
|
@@ -213,8 +213,9 @@ export default {
|
|
|
);
|
|
|
this.isStrictKey = !this.selectAvailableKey.includes(".*.");
|
|
|
this.modalForm.key = this.selectAvailableKey;
|
|
|
- if (this.selectAvailable.defaultValue)
|
|
|
- this.modalForm.value = this.selectAvailable.defaultValue;
|
|
|
+ this.modalForm.value = this.selectAvailable.defaultValue || null;
|
|
|
+ this.available = this.selectAvailable;
|
|
|
+ this.$refs.modalFormComp.validate().catch(() => {});
|
|
|
},
|
|
|
async submit() {
|
|
|
const valid = await this.$refs.modalFormComp.validate().catch(() => {});
|