init
This commit is contained in:
@@ -6,7 +6,12 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" :data="configList" >
|
<el-table v-loading="loading" :data="configList" >
|
||||||
<el-table-column label="名称" align="center" prop="desc" />
|
<el-table-column label="名称" align="center" prop="desc" />
|
||||||
<el-table-column label="数值" align="center" prop="value" />
|
<el-table-column label="数值" align="center" prop="value" >
|
||||||
|
<template v-slot="scope">
|
||||||
|
<span v-if="scope.row.inputType !== 'textarea'">{{ scope.row.value }}</span>
|
||||||
|
<span v-if="scope.row.inputType === 'textarea'" v-html="scope.row.valueTextArea"></span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -19,13 +24,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="名称" prop="desc">
|
<el-form-item label="名称" prop="desc">
|
||||||
<el-input v-model="form.desc" placeholder="请输入" disabled/>
|
<el-input v-model="form.desc" placeholder="请输入" disabled/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数值" prop="value">
|
<el-form-item label="数值" prop="value">
|
||||||
<el-input v-model="form.value" placeholder="请输入数值" />
|
<el-input v-model="form.value" placeholder="请输入数值" v-if="form.inputType !== 'textarea'" />
|
||||||
|
<el-input v-model="form.value" placeholder="请输入数值" type="textarea" autosize v-if="form.inputType === 'textarea'" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@@ -69,6 +75,11 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listBusinessConfigList().then(response => {
|
listBusinessConfigList().then(response => {
|
||||||
|
response.data.forEach(i => {
|
||||||
|
if(i.inputType === 'textarea'){
|
||||||
|
i.valueTextArea = i.value.replace(/\n/g, "<br/>");
|
||||||
|
}
|
||||||
|
})
|
||||||
this.configList = response.data;
|
this.configList = response.data;
|
||||||
}).finally(()=>{
|
}).finally(()=>{
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@@ -83,7 +94,8 @@ export default {
|
|||||||
this.form = {
|
this.form = {
|
||||||
key: undefined,
|
key: undefined,
|
||||||
desc: undefined,
|
desc: undefined,
|
||||||
value: undefined
|
value: undefined,
|
||||||
|
inputType: undefined
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
@@ -93,7 +105,8 @@ export default {
|
|||||||
this.form = {
|
this.form = {
|
||||||
key: row.key,
|
key: row.key,
|
||||||
desc: row.desc,
|
desc: row.desc,
|
||||||
value: row.value
|
value: row.value,
|
||||||
|
inputType: row.inputType
|
||||||
};
|
};
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改业务设置";
|
this.title = "修改业务设置";
|
||||||
|
|||||||
Reference in New Issue
Block a user