|
@@ -0,0 +1,238 @@
|
|
|
+<template>
|
|
|
+ <div class='container'>
|
|
|
+ <div class='handle-box'>
|
|
|
+ <el-form :inline='true'>
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ v-model='searchForm.remark'
|
|
|
+ placeholder='请输入配置描述'
|
|
|
+ clearable>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click='loadData'>搜索</el-button>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type='primary' @click='dialogVisible = true' v-if="hasAuth('sys:user:save')">新增
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ ref='noticeTable'
|
|
|
+ :data='tableData'
|
|
|
+ tooltip-effect='dark'
|
|
|
+ style='width: 100%'
|
|
|
+ border
|
|
|
+ stripe>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ type='index'
|
|
|
+ label='序号'
|
|
|
+ width='50'>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop='configKey'
|
|
|
+ label='配置key'>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop='configValue'
|
|
|
+ label='配置value'
|
|
|
+ :show-overflow-tooltip='true'>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop='remark'
|
|
|
+ label='配置描述'
|
|
|
+ :show-overflow-tooltip='true'>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop='createTime'
|
|
|
+ width='150'
|
|
|
+ label='创建时间'>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop='updateTime'
|
|
|
+ width='150'
|
|
|
+ label='修改时间'>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop='icon'
|
|
|
+ width='180px'
|
|
|
+ fixed='right'
|
|
|
+ label='操作'>
|
|
|
+ <template slot-scope='scope'>
|
|
|
+ <el-button type='text' @click='editHandle(scope.row)'>编辑</el-button>
|
|
|
+ <el-divider direction='vertical'></el-divider>
|
|
|
+ <template>
|
|
|
+ <el-popconfirm title='确定删除这条数据吗?' @confirm='delHandle(scope.row.id)'>
|
|
|
+ <el-button type='text' slot='reference'>删除</el-button>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <el-pagination
|
|
|
+ @size-change='handleSizeChange'
|
|
|
+ @current-change='handleCurrentChange'
|
|
|
+ layout='total, sizes, prev, pager, next, jumper'
|
|
|
+ :page-sizes='[10, 20, 50, 100]'
|
|
|
+ :current-page='current'
|
|
|
+ :page-size='size'
|
|
|
+ :total='total'>
|
|
|
+ </el-pagination>
|
|
|
+
|
|
|
+
|
|
|
+ <!--新增对话框-->
|
|
|
+ <el-dialog
|
|
|
+ title='提示'
|
|
|
+ :visible.sync='dialogVisible'
|
|
|
+ width='60%'
|
|
|
+ :before-close='handleClose'>
|
|
|
+
|
|
|
+ <el-form :model='editForm' :rules='editFormRules' ref='editForm'>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span='12'>
|
|
|
+ <el-form-item label='配置key:' prop='configKey' label-width='100px'>
|
|
|
+ <el-input v-model='editForm.configKey' autocomplete='off' placeholder='请输入配置key'></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span='12'>
|
|
|
+ <el-form-item label='配置value:' prop='configValue' label-width='100px'>
|
|
|
+ <el-input v-model='editForm.configValue' autocomplete='off'
|
|
|
+ placeholder='请输入配置value'></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span='24'>
|
|
|
+ <el-form-item label='配置描述:' prop='remark' label-width='100px'>
|
|
|
+ <el-input type='textarea' rows='3' v-model='editForm.remark'
|
|
|
+ autocomplete='off'
|
|
|
+ placeholder='请输入配置描述'></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot='footer' class='dialog-footer'>
|
|
|
+ <el-button @click="resetForm('editForm')">取 消</el-button>
|
|
|
+ <el-button type='primary' @click="submitForm('editForm')">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'configManage',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ searchForm: {
|
|
|
+ title: ''
|
|
|
+ },
|
|
|
+ delBtlStatu: true,
|
|
|
+ total: 0,
|
|
|
+ size: 10,
|
|
|
+ current: 1,
|
|
|
+ dialogVisible: false,
|
|
|
+ editForm: {
|
|
|
+ configKey: '',
|
|
|
+ configValue: '',
|
|
|
+ remark: ''
|
|
|
+ },
|
|
|
+ tableData: [],
|
|
|
+ editFormRules: {
|
|
|
+ configKey: [
|
|
|
+ { required: true, message: '请输入配置key', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ configValue: [
|
|
|
+ { required: true, message: '请输入配置value', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ loadData() {
|
|
|
+ this.$axios.get('/api/config/list', {
|
|
|
+ params: {
|
|
|
+ remark: this.searchForm.remark,
|
|
|
+ current: this.current,
|
|
|
+ size: this.size
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ this.tableData = res.data.data.records;
|
|
|
+ this.size = res.data.data.size;
|
|
|
+ this.current = res.data.data.current;
|
|
|
+ this.total = res.data.data.total;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ this.resetForm('editForm');
|
|
|
+ },
|
|
|
+ resetForm(formName) {
|
|
|
+ this.$refs[formName].resetFields();
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.editForm = {};
|
|
|
+ },
|
|
|
+ submitForm(formName) {
|
|
|
+ let _this = this;
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ _this.$axios.post('/api/config/' + (_this.editForm.id ? 'updateBean' : 'addBean'), _this.editForm)
|
|
|
+ .then(res => {
|
|
|
+ _this.loadData();
|
|
|
+ _this.$notify({
|
|
|
+ showClose: true,
|
|
|
+ message: '恭喜你,操作成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ _this.resetForm(formName);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ editHandle(row) {
|
|
|
+ this.editForm = JSON.parse(JSON.stringify(row));
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ delHandle(id) {
|
|
|
+ this.$axios.post('/api/config/deleteById?id=' + id).then(res => {
|
|
|
+ this.$notify({
|
|
|
+ showClose: true,
|
|
|
+ message: '恭喜你,操作成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.loadData();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.size = val;
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.current = val;
|
|
|
+ this.loadData();
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|