|
@@ -55,29 +55,8 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['system:config:add']"
|
|
|
- >新增</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- plain
|
|
|
- icon="el-icon-edit"
|
|
|
- size="mini"
|
|
|
- :disabled="single"
|
|
|
- @click="handleUpdate"
|
|
|
- v-hasPermi="['system:config:edit']"
|
|
|
- >修改</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- plain
|
|
|
- icon="el-icon-delete"
|
|
|
- size="mini"
|
|
|
- :disabled="multiple"
|
|
|
- @click="handleDelete"
|
|
|
- v-hasPermi="['system:config:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -87,7 +66,8 @@
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['system:config:export']"
|
|
|
- >导出</el-button>
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -97,23 +77,24 @@
|
|
|
size="mini"
|
|
|
@click="handleRefreshCache"
|
|
|
v-hasPermi="['system:config:remove']"
|
|
|
- >刷新缓存</el-button>
|
|
|
+ >刷新缓存
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="参数主键" align="center" prop="configId" />
|
|
|
- <el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="参数键名" align="center" prop="configKey" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="参数键值" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column label="参数主键" align="center" prop="configId"/>
|
|
|
+ <el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="参数键名" align="center" prop="configKey" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="参数键值" align="center" prop="configValue" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="系统内置" align="center" prop="configType">
|
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.configType"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
@@ -126,15 +107,18 @@
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
+ v-if="scope.row.configType !== 'Y'"
|
|
|
v-hasPermi="['system:config:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['system:config:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -151,13 +135,13 @@
|
|
|
<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="configName">
|
|
|
- <el-input v-model="form.configName" placeholder="请输入参数名称" />
|
|
|
+ <el-input v-model="form.configName" placeholder="请输入参数名称"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="参数键名" prop="configKey">
|
|
|
- <el-input v-model="form.configKey" placeholder="请输入参数键名" />
|
|
|
+ <el-input v-model="form.configKey" placeholder="请输入参数键名"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="参数键值" prop="configValue">
|
|
|
- <el-input v-model="form.configValue" placeholder="请输入参数键值" />
|
|
|
+ <el-input v-model="form.configValue" placeholder="请输入参数键值"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="系统内置" prop="configType">
|
|
|
<el-radio-group v-model="form.configType">
|
|
@@ -165,20 +149,21 @@
|
|
|
v-for="dict in dict.type.sys_yes_no"
|
|
|
:key="dict.value"
|
|
|
:label="dict.value"
|
|
|
- >{{dict.label}}</el-radio>
|
|
|
+ >{{ dict.label }}
|
|
|
+ </el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="json配置" prop="cfgJson">
|
|
|
<vue-json-editor
|
|
|
- v-model="cfgJson"
|
|
|
- :showBtns="false"
|
|
|
- mode="code"
|
|
|
- lang="zh"
|
|
|
- :expanded-on-start="true"
|
|
|
+ v-model="cfgJson"
|
|
|
+ :showBtns="false"
|
|
|
+ mode="code"
|
|
|
+ lang="zh"
|
|
|
+ :expanded-on-start="true"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
|
+ <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -190,12 +175,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { addConfig, delConfig, getConfig, listConfig, refreshCache, updateConfig } from '@/api/system/config';
|
|
|
+import {addConfig, delConfig, getConfig, listConfig, refreshCache, updateConfig} from '@/api/system/config';
|
|
|
import vueJsonEditor from 'vue-json-editor';
|
|
|
|
|
|
export default {
|
|
|
name: "Config",
|
|
|
- components: { vueJsonEditor },
|
|
|
+ components: {vueJsonEditor},
|
|
|
dicts: ['sys_yes_no'],
|
|
|
data() {
|
|
|
return {
|
|
@@ -233,13 +218,13 @@ export default {
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
configName: [
|
|
|
- { required: true, message: "参数名称不能为空", trigger: "blur" }
|
|
|
+ {required: true, message: "参数名称不能为空", trigger: "blur"}
|
|
|
],
|
|
|
configKey: [
|
|
|
- { required: true, message: "参数键名不能为空", trigger: "blur" }
|
|
|
+ {required: true, message: "参数键名不能为空", trigger: "blur"}
|
|
|
],
|
|
|
configValue: [
|
|
|
- { required: true, message: "参数键值不能为空", trigger: "blur" }
|
|
|
+ {required: true, message: "参数键值不能为空", trigger: "blur"}
|
|
|
],
|
|
|
}
|
|
|
};
|
|
@@ -308,7 +293,7 @@ export default {
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.configId)
|
|
|
- this.single = selection.length!=1
|
|
|
+ this.single = selection.length != 1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
@@ -325,7 +310,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
- submitForm: function() {
|
|
|
+ submitForm: function () {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
if (this.form.configId != undefined) {
|
|
@@ -347,12 +332,13 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const configIds = row.configId || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function() {
|
|
|
- return delConfig(configIds);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ this.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function () {
|
|
|
+ return delConfig(configIds);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|