This commit is contained in:
sunshuaizhong 2020-03-19 17:03:33 +08:00
parent b7107a4dba
commit c239c27dc4
12 changed files with 291 additions and 577 deletions

View File

@ -14,7 +14,7 @@
"test:ci": "npm run lint && npm run test:unit", "test:ci": "npm run lint && npm run test:unit",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
"new": "plop" "new": "plop"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "lint-staged" "pre-commit": "lint-staged"
@ -45,7 +45,7 @@
"vue-cropper": "0.4.9", "vue-cropper": "0.4.9",
"axios": "0.18.1", "axios": "0.18.1",
"echarts": "4.2.1", "echarts": "4.2.1",
"element-ui": "2.11.1", "element-ui": "2.13.0",
"fuse.js": "3.4.4", "fuse.js": "3.4.4",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",

View File

@ -10,7 +10,7 @@ import './assets/styles/element-variables.scss'
import '@/assets/styles/index.scss' // global css import '@/assets/styles/index.scss' // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css import '@/assets/styles/ruoyi.scss' // ruoyi css
import App from './App' import App from './App'
import store from './store' import store from './store'
import router from './router' import router from './router'
import permission from './directive/permission' import permission from './directive/permission'

View File

@ -27,39 +27,39 @@ service.interceptors.request.use(
// 响应拦截器 // 响应拦截器
service.interceptors.response.use(res => { service.interceptors.response.use(res => {
const code = res.data.code const code = res.data.code
if (code === 401) { if (code === 401) {
MessageBox.confirm( MessageBox.confirm(
'登录状态已过期,您可以继续留在该页面,或者重新登录', '登录状态已过期,您可以继续留在该页面,或者重新登录',
'系统提示', '系统提示',
{ {
confirmButtonText: '重新登录', confirmButtonText: '重新登录',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
} }
).then(() => { ).then(() => {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug location.reload() // 为了重新实例化vue-router对象 避免bug
})
}) })
} else if (code !== 200) {
Notification.error({
title: res.data.msg
})
return Promise.reject('error')
} else {
return res.data
}
},
error => {
console.log('err' + error)
Message({
message: error.message,
type: 'error',
duration: 5 * 1000
}) })
return Promise.reject(error) } else if (code !== 200) {
Notification.error({
title: res.data.msg
})
return Promise.reject('error')
} else {
return res.data
} }
},
error => {
console.log('err' + error)
Message({
message: error.message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
}
) )
export default service export default service

View File

@ -147,7 +147,7 @@ export default {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url("../assets/image/login-background.jpg"); background-image: url("../assets/image/login-background.jpg");
background-size: cover; background-size: cover;
} }

View File

@ -2,39 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="登录地址" prop="ipaddr"> <el-form-item label="登录地址" prop="ipaddr">
<el-input <el-input v-model="queryParams.ipaddr" placeholder="请输入登录地址" clearable style="width: 240px;" size="small" @keyup.enter.native="handleQuery" />
v-model="queryParams.ipaddr"
placeholder="请输入登录地址"
clearable
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="用户名称" prop="userName"> <el-form-item label="用户名称" prop="userName">
<el-input <el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px;" size="small" @keyup.enter.native="handleQuery" />
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select <el-select v-model="queryParams.status" placeholder="登录状态" clearable size="small" style="width: 240px">
v-model="queryParams.status" <el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
placeholder="登录状态"
clearable
size="small"
style="width: 240px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="登录时间"> <el-form-item label="登录时间">
@ -57,33 +32,10 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['monitor:logininfor:remove']">删除</el-button>
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['monitor:logininfor:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleClean"
v-hasPermi="['monitor:logininfor:remove']"
>清空</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:logininfor:export']"
>导出</el-button>
</el-col> </el-col>
<el-col :span="1.5"><el-button type="danger" icon="el-icon-delete" size="mini" @click="handleClean" v-hasPermi="['monitor:logininfor:remove']">清空</el-button></el-col>
<el-col :span="1.5"><el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:logininfor:export']">导出</el-button></el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
@ -103,21 +55,15 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { list, delLogininfor, cleanLogininfor, exportLogininfor } from "@/api/monitor/logininfor"; import { list, delLogininfor, cleanLogininfor, exportLogininfor } from '@/api/monitor/logininfor';
export default { export default {
name: "Logininfor", name: 'Logininfor',
data() { data() {
return { return {
// //
@ -146,7 +92,7 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_common_status").then(response => { this.getDicts('sys_common_status').then(response => {
this.statusOptions = response.data; this.statusOptions = response.data;
}); });
}, },
@ -155,11 +101,10 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
list(this.addDateRange(this.queryParams, this.dateRange)).then(response => { list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.list = response.rows; this.list = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
} });
);
}, },
// //
statusFormat(row, column) { statusFormat(row, column) {
@ -173,55 +118,63 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm("queryForm"); this.resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.infoId) this.ids = selection.map(item => item.infoId);
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const infoIds = row.infoId || this.ids; const infoIds = row.infoId || this.ids;
this.$confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?', "警告", { this.$confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?', '警告', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(function() { })
.then(function() {
return delLogininfor(infoIds); return delLogininfor(infoIds);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess('删除成功');
}).catch(function() {}); })
.catch(function() {});
}, },
/** 清空按钮操作 */ /** 清空按钮操作 */
handleClean() { handleClean() {
this.$confirm('是否确认清空所有登录日志数据项?', "警告", { this.$confirm('是否确认清空所有登录日志数据项?', '警告', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(function() { })
.then(function() {
return cleanLogininfor(); return cleanLogininfor();
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.msgSuccess("清空成功"); this.msgSuccess('清空成功');
}).catch(function() {}); })
.catch(function() {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$confirm('是否确认导出所有操作日志数据项?', "警告", { this.$confirm('是否确认导出所有操作日志数据项?', '警告', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(function() { })
.then(function() {
return exportLogininfor(queryParams); return exportLogininfor(queryParams);
}).then(response => { })
.then(response => {
this.download(response.msg); this.download(response.msg);
}).catch(function() {}); })
.catch(function() {});
} }
} }
}; };
</script> </script>

View File

@ -2,33 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="参数名称" prop="configName"> <el-form-item label="参数名称" prop="configName">
<el-input <el-input v-model="queryParams.configName" placeholder="请输入参数名称" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
v-model="queryParams.configName"
placeholder="请输入参数名称"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="参数键名" prop="configKey"> <el-form-item label="参数键名" prop="configKey">
<el-input <el-input v-model="queryParams.configKey" placeholder="请输入参数键名" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
v-model="queryParams.configKey"
placeholder="请输入参数键名"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="系统内置" prop="configType"> <el-form-item label="系统内置" prop="configType">
<el-select v-model="queryParams.configType" placeholder="系统内置" clearable size="small"> <el-select v-model="queryParams.configType" placeholder="系统内置" clearable size="small">
<el-option <el-option v-for="dict in typeOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
@ -50,44 +31,14 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"><el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:config:add']">新增</el-button></el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:config:edit']">修改</el-button>
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:config:add']"
>新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:config:remove']">删除</el-button>
type="success"
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"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:config:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:config:export']"
>导出</el-button>
</el-col> </el-col>
<el-col :span="1.5"><el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:config:export']">导出</el-button></el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
@ -105,56 +56,26 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:config:edit']">修改</el-button>
size="mini" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:config:remove']">删除</el-button>
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:config:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:config:remove']"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px"> <el-dialog :title="title" :visible.sync="open" width="500px">
<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="configName"> <el-form-item label="参数名称" prop="configName"><el-input v-model="form.configName" placeholder="请输入参数名称" /></el-form-item>
<el-input v-model="form.configName" placeholder="请输入参数名称" /> <el-form-item label="参数键名" prop="configKey"><el-input v-model="form.configKey" placeholder="请输入参数键名" /></el-form-item>
</el-form-item> <el-form-item label="参数键值" prop="configValue"><el-input v-model="form.configValue" placeholder="请输入参数键值" /></el-form-item>
<el-form-item label="参数键名" prop="configKey">
<el-input v-model="form.configKey" placeholder="请输入参数键名" />
</el-form-item>
<el-form-item label="参数键值" prop="configValue">
<el-input v-model="form.configValue" placeholder="请输入参数键值" />
</el-form-item>
<el-form-item label="系统内置" prop="configType"> <el-form-item label="系统内置" prop="configType">
<el-radio-group v-model="form.configType"> <el-radio-group v-model="form.configType">
<el-radio <el-radio v-for="dict in typeOptions" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark"><el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /></el-form-item>
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -165,10 +86,10 @@
</template> </template>
<script> <script>
import { listConfig, getConfig, delConfig, addConfig, updateConfig, exportConfig } from "@/api/system/config"; import { listConfig, getConfig, delConfig, addConfig, updateConfig, exportConfig } from '@/api/system/config';
export default { export default {
name: "Config", name: 'Config',
data() { data() {
return { return {
// //
@ -184,7 +105,7 @@ export default {
// //
configList: [], configList: [],
// //
title: "", title: '',
// //
open: false, open: false,
// //
@ -203,21 +124,15 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
configName: [ configName: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }],
{ required: true, message: "参数名称不能为空", trigger: "blur" } configKey: [{ required: true, message: '参数键名不能为空', trigger: 'blur' }],
], configValue: [{ required: true, message: '参数键值不能为空', trigger: 'blur' }]
configKey: [
{ required: true, message: "参数键名不能为空", trigger: "blur" }
],
configValue: [
{ required: true, message: "参数键值不能为空", trigger: "blur" }
]
} }
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_yes_no").then(response => { this.getDicts('sys_yes_no').then(response => {
this.typeOptions = response.data; this.typeOptions = response.data;
}); });
}, },
@ -226,11 +141,10 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => { listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.configList = response.rows; this.configList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
} });
);
}, },
// //
typeFormat(row, column) { typeFormat(row, column) {
@ -248,10 +162,10 @@ export default {
configName: undefined, configName: undefined,
configKey: undefined, configKey: undefined,
configValue: undefined, configValue: undefined,
configType: "Y", configType: 'Y',
remark: undefined remark: undefined
}; };
this.resetForm("form"); this.resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -261,39 +175,39 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm("queryForm"); this.resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加参数"; this.title = '添加参数';
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.configId) this.ids = selection.map(item => item.configId);
this.single = selection.length!=1 this.single = selection.length != 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const configId = row.configId || this.ids const configId = row.configId || this.ids;
getConfig(configId).then(response => { getConfig(configId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改参数"; this.title = '修改参数';
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.form.configId != undefined) { if (this.form.configId != undefined) {
updateConfig(this.form).then(response => { updateConfig(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess('修改成功');
this.open = false; this.open = false;
this.getList(); this.getList();
} else { } else {
@ -303,7 +217,7 @@ export default {
} else { } else {
addConfig(this.form).then(response => { addConfig(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess('新增成功');
this.open = false; this.open = false;
this.getList(); this.getList();
} else { } else {
@ -317,30 +231,36 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const configIds = row.configId || this.ids; const configIds = row.configId || this.ids;
this.$confirm('是否确认删除参数编号为"' + configIds + '"的数据项?', "警告", { this.$confirm('是否确认删除参数编号为"' + configIds + '"的数据项?', '警告', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(function() { })
.then(function() {
return delConfig(configIds); return delConfig(configIds);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess('删除成功');
}).catch(function() {}); })
.catch(function() {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$confirm('是否确认导出所有参数数据项?', "警告", { this.$confirm('是否确认导出所有参数数据项?', '警告', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(function() { })
.then(function() {
return exportConfig(queryParams); return exportConfig(queryParams);
}).then(response => { })
.then(response => {
this.download(response.msg); this.download(response.msg);
}).catch(function() {}); })
.catch(function() {});
} }
} }
}; };
</script> </script>

View File

@ -3,31 +3,15 @@
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="字典名称" prop="dictType"> <el-form-item label="字典名称" prop="dictType">
<el-select v-model="queryParams.dictType" size="small"> <el-select v-model="queryParams.dictType" size="small">
<el-option <el-option v-for="item in typeOptions" :key="item.dictId" :label="item.dictName" :value="item.dictType" />
v-for="item in typeOptions"
:key="item.dictId"
:label="item.dictName"
:value="item.dictType"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="字典标签" prop="dictLabel"> <el-form-item label="字典标签" prop="dictLabel">
<el-input <el-input v-model="queryParams.dictLabel" placeholder="请输入字典标签" clearable size="small" @keyup.enter.native="handleQuery" />
v-model="queryParams.dictLabel"
placeholder="请输入字典标签"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small"> <el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">
<el-option <el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -37,44 +21,14 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"><el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:dict:add']">新增</el-button></el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:dict:edit']">修改</el-button>
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:dict:add']"
>新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:dict:remove']">删除</el-button>
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
</el-col> </el-col>
<el-col :span="1.5"><el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:dict:export']">导出</el-button></el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
@ -92,59 +46,27 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button>
size="mini" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button>
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px"> <el-dialog :title="title" :visible.sync="open" width="500px">
<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="字典类型"> <el-form-item label="字典类型"><el-input v-model="form.dictType" :disabled="true" /></el-form-item>
<el-input v-model="form.dictType" :disabled="true" /> <el-form-item label="数据标签" prop="dictLabel"><el-input v-model="form.dictLabel" placeholder="请输入数据标签" /></el-form-item>
</el-form-item> <el-form-item label="数据键值" prop="dictValue"><el-input v-model="form.dictValue" placeholder="请输入数据键值" /></el-form-item>
<el-form-item label="数据标签" prop="dictLabel"> <el-form-item label="显示排序" prop="dictSort"><el-input-number v-model="form.dictSort" controls-position="right" :min="0" /></el-form-item>
<el-input v-model="form.dictLabel" placeholder="请输入数据标签" />
</el-form-item>
<el-form-item label="数据键值" prop="dictValue">
<el-input v-model="form.dictValue" placeholder="请输入数据键值" />
</el-form-item>
<el-form-item label="显示排序" prop="dictSort">
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
</el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
<el-radio <el-radio v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark"><el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input></el-form-item>
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -155,11 +77,11 @@
</template> </template>
<script> <script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/system/dict/data"; import { listData, getData, delData, addData, updateData, exportData } from '@/api/system/dict/data';
import { listType, getType } from "@/api/system/dict/type"; import { listType, getType } from '@/api/system/dict/type';
export default { export default {
name: "Data", name: 'Data',
data() { data() {
return { return {
// //
@ -175,9 +97,9 @@ export default {
// //
dataList: [], dataList: [],
// //
defaultDictType: "", defaultDictType: '',
// //
title: "", title: '',
// //
open: false, open: false,
// //
@ -196,15 +118,9 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
dictLabel: [ dictLabel: [{ required: true, message: '数据标签不能为空', trigger: 'blur' }],
{ required: true, message: "数据标签不能为空", trigger: "blur" } dictValue: [{ required: true, message: '数据键值不能为空', trigger: 'blur' }],
], dictSort: [{ required: true, message: '数据顺序不能为空', trigger: 'blur' }]
dictValue: [
{ required: true, message: "数据键值不能为空", trigger: "blur" }
],
dictSort: [
{ required: true, message: "数据顺序不能为空", trigger: "blur" }
]
} }
}; };
}, },
@ -212,7 +128,7 @@ export default {
const dictId = this.$route.params && this.$route.params.dictId; const dictId = this.$route.params && this.$route.params.dictId;
this.getType(dictId); this.getType(dictId);
this.getTypeList(); this.getTypeList();
this.getDicts("sys_normal_disable").then(response => { this.getDicts('sys_normal_disable').then(response => {
this.statusOptions = response.data; this.statusOptions = response.data;
}); });
}, },
@ -256,10 +172,10 @@ export default {
dictLabel: undefined, dictLabel: undefined,
dictValue: undefined, dictValue: undefined,
dictSort: 0, dictSort: 0,
status: "0", status: '0',
remark: undefined remark: undefined
}; };
this.resetForm("form"); this.resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -268,7 +184,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm('queryForm');
this.queryParams.dictType = this.defaultDictType; this.queryParams.dictType = this.defaultDictType;
this.handleQuery(); this.handleQuery();
}, },
@ -276,33 +192,33 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加字典数据"; this.title = '添加字典数据';
this.form.dictType = this.queryParams.dictType; this.form.dictType = this.queryParams.dictType;
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictCode) this.ids = selection.map(item => item.dictCode);
this.single = selection.length!=1 this.single = selection.length != 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const dictCode = row.dictCode || this.ids const dictCode = row.dictCode || this.ids;
getData(dictCode).then(response => { getData(dictCode).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改字典数据"; this.title = '修改字典数据';
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.form.dictCode != undefined) { if (this.form.dictCode != undefined) {
updateData(this.form).then(response => { updateData(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess('修改成功');
this.open = false; this.open = false;
this.getList(); this.getList();
} else { } else {
@ -312,7 +228,7 @@ export default {
} else { } else {
addData(this.form).then(response => { addData(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess('新增成功');
this.open = false; this.open = false;
this.getList(); this.getList();
} else { } else {
@ -326,30 +242,36 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const dictCodes = row.dictCode || this.ids; const dictCodes = row.dictCode || this.ids;
this.$confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?', "警告", { this.$confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?', '警告', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(function() { })
.then(function() {
return delData(dictCodes); return delData(dictCodes);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess('删除成功');
}).catch(function() {}); })
.catch(function() {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$confirm('是否确认导出所有数据项?', "警告", { this.$confirm('是否确认导出所有数据项?', '警告', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(function() { })
.then(function() {
return exportData(queryParams); return exportData(queryParams);
}).then(response => { })
.then(response => {
this.download(response.msg); this.download(response.msg);
}).catch(function() {}); })
.catch(function() {});
} }
} }
}; };
</script> </script>

View File

@ -2,39 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="字典名称" prop="dictName"> <el-form-item label="字典名称" prop="dictName">
<el-input <el-input v-model="queryParams.dictName" placeholder="请输入字典名称" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
v-model="queryParams.dictName"
placeholder="请输入字典名称"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="字典类型" prop="dictType"> <el-form-item label="字典类型" prop="dictType">
<el-input <el-input v-model="queryParams.dictType" placeholder="请输入字典类型" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
v-model="queryParams.dictType"
placeholder="请输入字典类型"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select <el-select v-model="queryParams.status" placeholder="字典状态" clearable size="small" style="width: 240px">
v-model="queryParams.status" <el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
placeholder="字典状态"
clearable
size="small"
style="width: 240px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
@ -56,44 +31,14 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"><el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:dict:add']">新增</el-button></el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:dict:edit']">修改</el-button>
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:dict:add']"
>新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:dict:remove']">删除</el-button>
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
</el-col> </el-col>
<el-col :span="1.5"><el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:dict:export']">导出</el-button></el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
@ -116,53 +61,25 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button>
size="mini" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button>
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px"> <el-dialog :title="title" :visible.sync="open" width="500px">
<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="dictName"> <el-form-item label="字典名称" prop="dictName"><el-input v-model="form.dictName" placeholder="请输入字典名称" /></el-form-item>
<el-input v-model="form.dictName" placeholder="请输入字典名称" /> <el-form-item label="字典类型" prop="dictType"><el-input v-model="form.dictType" placeholder="请输入字典类型" /></el-form-item>
</el-form-item>
<el-form-item label="字典类型" prop="dictType">
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
</el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
<el-radio <el-radio v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark"><el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input></el-form-item>
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -173,10 +90,10 @@
</template> </template>
<script> <script>
import { listType, getType, delType, addType, updateType, exportType } from "@/api/system/dict/type"; import { listType, getType, delType, addType, updateType, exportType } from '@/api/system/dict/type';
export default { export default {
name: "Dict", name: 'Dict',
data() { data() {
return { return {
// //
@ -192,7 +109,7 @@ export default {
// //
typeList: [], typeList: [],
// //
title: "", title: '',
// //
open: false, open: false,
// //
@ -211,18 +128,14 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
dictName: [ dictName: [{ required: true, message: '字典名称不能为空', trigger: 'blur' }],
{ required: true, message: "字典名称不能为空", trigger: "blur" } dictType: [{ required: true, message: '字典类型不能为空', trigger: 'blur' }]
],
dictType: [
{ required: true, message: "字典类型不能为空", trigger: "blur" }
]
} }
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_normal_disable").then(response => { this.getDicts('sys_normal_disable').then(response => {
this.statusOptions = response.data; this.statusOptions = response.data;
}); });
}, },
@ -231,11 +144,11 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => { listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.typeList = response.rows; console.log(response);
this.total = response.total; this.typeList = response.rows;
this.loading = false; this.total = response.total;
} this.loading = false;
); });
}, },
// //
statusFormat(row, column) { statusFormat(row, column) {
@ -252,10 +165,10 @@ export default {
dictId: undefined, dictId: undefined,
dictName: undefined, dictName: undefined,
dictType: undefined, dictType: undefined,
status: "0", status: '0',
remark: undefined remark: undefined
}; };
this.resetForm("form"); this.resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -265,39 +178,39 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm("queryForm"); this.resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加字典类型"; this.title = '添加字典类型';
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictId) this.ids = selection.map(item => item.dictId);
this.single = selection.length!=1 this.single = selection.length != 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const dictId = row.dictId || this.ids const dictId = row.dictId || this.ids;
getType(dictId).then(response => { getType(dictId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改字典类型"; this.title = '修改字典类型';
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.form.dictId != undefined) { if (this.form.dictId != undefined) {
updateType(this.form).then(response => { updateType(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess('修改成功');
this.open = false; this.open = false;
this.getList(); this.getList();
} else { } else {
@ -307,7 +220,7 @@ export default {
} else { } else {
addType(this.form).then(response => { addType(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess('新增成功');
this.open = false; this.open = false;
this.getList(); this.getList();
} else { } else {
@ -321,30 +234,36 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const dictIds = row.dictId || this.ids; const dictIds = row.dictId || this.ids;
this.$confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', "警告", { this.$confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', '警告', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(function() { })
.then(function() {
return delType(dictIds); return delType(dictIds);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess('删除成功');
}).catch(function() {}); })
.catch(function() {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$confirm('是否确认导出所有类型数据项?', "警告", { this.$confirm('是否确认导出所有类型数据项?', '警告', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(function() { })
.then(function() {
return exportType(queryParams); return exportType(queryParams);
}).then(response => { })
.then(response => {
this.download(response.msg); this.download(response.msg);
}).catch(function() {}); })
.catch(function() {});
} }
} }
}; };
</script> </script>

View File

@ -1,5 +1,5 @@
'use strict' 'use strict'
const path = require('path') const path = require('path')
const defaultSettings = require('./src/settings.js') const defaultSettings = require('./src/settings.js')
function resolve(dir) { function resolve(dir) {
@ -8,7 +8,7 @@ function resolve(dir) {
const name = defaultSettings.title || '若依管理系统' // 标题 const name = defaultSettings.title || '若依管理系统' // 标题
const port = process.env.port || process.env.npm_config_port || 80 // 端口 const port = process.env.port || process.env.npm_config_port || 80// 端口
// vue.config.js 配置说明 // vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
@ -33,7 +33,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`, target: `http://localhost:8090`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

View File

@ -8,14 +8,14 @@ spring:
master: master:
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: password password: root
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: false enabled: false
url: url:
username: username:
password: password:
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量
@ -35,7 +35,7 @@ spring:
testWhileIdle: true testWhileIdle: true
testOnBorrow: false testOnBorrow: false
testOnReturn: false testOnReturn: false
webStatFilter: webStatFilter:
enabled: true enabled: true
statViewServlet: statViewServlet:
enabled: true enabled: true
@ -43,8 +43,8 @@ spring:
allow: allow:
url-pattern: /druid/* url-pattern: /druid/*
# 控制台管理用户名和密码 # 控制台管理用户名和密码
login-username: login-username:
login-password: login-password:
filter: filter:
stat: stat:
enabled: true enabled: true

View File

@ -16,7 +16,7 @@ ruoyi:
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为8080 # 服务器的HTTP端口默认为8080
port: 8080 port: 8090
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /
@ -41,7 +41,7 @@ spring:
messages: messages:
# 国际化资源文件路径 # 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: druid active: druid
# 文件上传 # 文件上传
servlet: servlet:
@ -62,7 +62,7 @@ spring:
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 6379
# 密码 # 密码
password: password:
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
@ -84,7 +84,7 @@ token:
secret: abcdefghijklmnopqrstuvwxyz secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟 # 令牌有效期默认30分钟
expireTime: 30 expireTime: 30
# MyBatis配置 # MyBatis配置
mybatis: mybatis:
# 搜索指定包别名 # 搜索指定包别名
@ -95,23 +95,23 @@ mybatis:
configLocation: classpath:mybatis/mybatis-config.xml configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件 # PageHelper分页插件
pagehelper: pagehelper:
helperDialect: mysql helperDialect: mysql
reasonable: true reasonable: true
supportMethodsArguments: true supportMethodsArguments: true
params: count=countSql params: count=countSql
# 防止XSS攻击 # 防止XSS攻击
xss: xss:
# 过滤开关 # 过滤开关
enabled: true enabled: true
# 排除链接(多个用逗号分隔) # 排除链接(多个用逗号分隔)
excludes: /system/notice/* excludes: /system/notice/*
# 匹配链接 # 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/* urlPatterns: /system/*,/monitor/*,/tool/*
# 代码生成 # 代码生成
gen: gen:
# 作者 # 作者
author: ruoyi author: ruoyi
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration>
<!-- 日志存放路径 --> <!-- 日志存放路径 -->
<property name="log.path" value="/home/ruoyi/logs" /> <property name="log.path" value="/Users/apple/Documents/ruoyi/logs" />
<!-- 日志输出格式 --> <!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
@ -11,7 +11,7 @@
<pattern>${log.pattern}</pattern> <pattern>${log.pattern}</pattern>
</encoder> </encoder>
</appender> </appender>
<!-- 系统日志输出 --> <!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file> <file>${log.path}/sys-info.log</file>
@ -34,7 +34,7 @@
<onMismatch>DENY</onMismatch> <onMismatch>DENY</onMismatch>
</filter> </filter>
</appender> </appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file> <file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 --> <!-- 循环政策:基于时间创建日志文件 -->
@ -56,7 +56,7 @@
<onMismatch>DENY</onMismatch> <onMismatch>DENY</onMismatch>
</filter> </filter>
</appender> </appender>
<!-- 用户访问日志输出 --> <!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file> <file>${log.path}/sys-user.log</file>
@ -70,7 +70,7 @@
<pattern>${log.pattern}</pattern> <pattern>${log.pattern}</pattern>
</encoder> </encoder>
</appender> </appender>
<!-- 系统模块日志级别控制 --> <!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info" /> <logger name="com.ruoyi" level="info" />
<!-- Spring日志级别控制 --> <!-- Spring日志级别控制 -->
@ -79,15 +79,15 @@
<root level="info"> <root level="info">
<appender-ref ref="console" /> <appender-ref ref="console" />
</root> </root>
<!--系统操作日志--> <!--系统操作日志-->
<root level="info"> <root level="info">
<appender-ref ref="file_info" /> <appender-ref ref="file_info" />
<appender-ref ref="file_error" /> <appender-ref ref="file_error" />
</root> </root>
<!--系统用户操作日志--> <!--系统用户操作日志-->
<logger name="sys-user" level="info"> <logger name="sys-user" level="info">
<appender-ref ref="sys-user"/> <appender-ref ref="sys-user"/>
</logger> </logger>
</configuration> </configuration>