|
@@ -0,0 +1,52 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-card>
|
|
|
|
|
+ <el-row :gutter="20" v-for="(item, index) in configList" :key="index" style="margin-bottom: 20px;">
|
|
|
|
|
+ <el-col :span="2">{{ item.name }}:</el-col>
|
|
|
|
|
+ <el-col :span="3">
|
|
|
|
|
+ <el-input size="small" v-model="item.val" :placeholder="'请输入' + item.name"></el-input>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-button size="small" type="primary" @click="handleEdit">修改</el-button>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+export default {
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ configList: [],
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.getInfo()
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ getInfo() {
|
|
|
|
|
+ this.$api.sys.getConfig().then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.configList = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ handleEdit(row) {
|
|
|
|
|
+ console.log(row)
|
|
|
|
|
+ this.$api.sys.updateConfig(this.configList).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success(res.msg)
|
|
|
|
|
+ this.getInfo()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
|
+.el-col {
|
|
|
|
|
+ line-height: 34px;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|