This commit is contained in:
77
2024-05-20 15:16:43 +08:00
parent 1dfe676da9
commit a37d27f1ca
2 changed files with 131 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import request from '@/utils/request'
export function listSystemConfigList() {
return request({
url: '/dk/systemConfig/system/all',
method: 'get'
})
}
export function updateSystemConfig(data) {
return request({
url: '/dk/systemConfig/system/update',
method: 'get',
params: data
})
}

View File

@@ -0,0 +1,115 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="configList" >
<el-table-column label="名称" align="center" prop="desc" />
<el-table-column label="数值" align="center" prop="value" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template v-slot="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="desc">
<el-input v-model="form.desc" placeholder="请输入" disabled/>
</el-form-item>
<el-form-item label="数值" prop="value">
<el-input v-model="form.value" placeholder="请输入数值" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listSystemConfigList, updateSystemConfig } from '@/api/dk/systemConfig'
export default {
name: "Banner",
components: {
},
data() {
return {
// 遮罩层
buttonLoading: false,
loading: true,
// 显示搜索条件
showSearch: true,
queryParams:{},
form:{},
// 轮播表格数据
configList: [],
title: "",
open: false,
rules:[]
};
},
created() {
this.getList();
},
methods: {
/** 查询轮播列表 */
getList() {
this.loading = true;
listSystemConfigList().then(response => {
this.configList = response.data;
}).finally(()=>{
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
reset() {
this.form = {
key: undefined,
desc: undefined,
value: undefined
};
this.resetForm("form");
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = {
key: row.key,
desc: row.desc,
value: row.value
};
this.open = true;
this.title = "修改业务设置";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
updateSystemConfig(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
});
},
}
};
</script>