0ad07283 by 任超

feat:系统

1 parent 2a6afc13
import request from '@/utils/request'
import SERVER from './config'
// 用户首页
// 获取首页待办事项
export function getHomeTodoList () {
// 获取用户信息
export function getUserInfo () {
return request({
url: SERVER.SERVERAPI + '/rest/workBench/getHomeTodoList',
method: 'get'
url: SERVER.SERVERAPI + '/rest/user/getUserInfo',
method: 'get',
})
}
//获取首页已办事项
export function getHomeDoneList () {
// 获取菜单信息
export function getMenuInfo () {
return request({
url: SERVER.SERVERAPI + '/rest/workBench/getHomeDoneList',
method: 'get'
url: SERVER.SERVERAPI + '/rest/user/getUserAuthorizationMenus',
method: 'get',
})
}
//获取首页常办项目
export function getHomeFrequentProjects () {
/*
获取全部字典数据
*/
export function getAllDict () {
return request({
url: SERVER.SERVERAPI + '/rest/workBench/getHomeFrequentProjects',
method: 'get'
url: SERVER.SERVERAPI + '/rest/sys/dict/getAllDict',
method: 'post'
})
}
//保存常办项目
export function saveFrequentProjectsList (data) {
export function getQlxxDictList (data) {
return request({
url: SERVER.SERVERAPI + '/rest/workBench/saveFrequentProjectsList',
url: SERVER.SERVERAPI + '/rest/sys/dict/getQlxxDictList',
method: 'post',
data
})
}
// 获取用户信息
export function getUserInfo () {
/*
获取字典子级列表
*/
export function getChildDictList (bsmDict) {
return request({
url: SERVER.SERVERAPI + '/rest/user/getUserInfo',
url: SERVER.SERVERAPI + '/rest/sys/dict/getChildDictList',
method: 'get',
params: {
bsmDict: bsmDict
}
})
}
// 获取菜单信息
export function getMenuInfo () {
/*
编辑字典数据
*/
export function editDictNode (data) {
return request({
url: SERVER.SERVERAPI + '/rest/user/getUserAuthorizationMenus',
method: 'get',
url: SERVER.SERVERAPI + '/rest/sys/dict/editDictNode',
method: 'post',
data
})
}
/*
刷新字典缓存
*/
export function refreshDictCache () {
return request({
url: SERVER.SERVERAPI + '/rest/sys/dict/refreshDictCache',
method: 'get'
})
}
\ No newline at end of file
......
......@@ -270,14 +270,14 @@ export const asyncRoutes = [
path: '/system',
component: Layout,
meta: { title: '系统管理', icon: 'sqcx', breadcrumb: false },
redirect: '/system/dictionary-config',
redirect: '/system/dictionaries',
alwaysShow: true,
name: 'system',
children: [
{
path: 'dictionary-config',
component: () => import('@/views/system/dictionary-config'),
name: 'dictionary-config',
path: 'dictionaries',
component: () => import('@/views/system/dictionaries/dictionaries.vue'),
name: 'dictionaries',
meta: { title: '字典管理' }
},
{
......
<template>
<!-- 编辑 -->
<dialogBox submitForm="submitForm" @closeDialog="closeDialog" @submitForm="handleSubmit" width="80%" v-model="myValue"
:isSave="details.isenable == 1" title="字典信息">
<el-form :model="ruleForm" ref="ruleForm" label-width="100px">
<el-row :gutter="20">
<el-col :span="4">
<el-form-item label="字典类型编码">
{{ ruleForm.dcode }}
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="字典类型名称">
{{ ruleForm.dname }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<lb-table :column="column" :heightNum="420" :key="key" :expand-row-keys="keyList" row-key="bsmDict"
:tree-props="{ children: 'children' }" :pagination="false" :data="tableData">
</lb-table>
</dialogBox>
</template>
<script>
import { getUuid, judgeSort, realMove, findParents, removeTreeListItem } from '@/utils/operation'
import { editDictNode } from '@/api/user'
export default {
props: {
value: { type: Boolean, default: false },
details: {
type: Object,
default: {}
}
},
data () {
return {
key: 0,
myValue: this.value,
keyList: [],
ruleForm: {
dcode: '',
dname: ''
},
column: [],
columns: [
{
width: '70',
renderHeader: (h, scope) => {
return (<div>
{
this.details.isenable === '0' ?
<span>序号</span> :
<i class="el-icon-plus" onClick={() => { this.handleAdd() }} style="cursor:pointer;color:#409EFF"></i>
}
</div>)
},
render: (h, scope) => {
return (
<span>{scope.row.index}</span>
)
}
},
{
prop: 'dcode',
width: '100',
label: '字典项编码',
render: (h, scope) => {
return (
<div>
<el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={scope.row.codeShow} v-fo value={scope.row[scope.column.property]}
onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }}
onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input>
<el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={!scope.row.codeShow} value={scope.row[scope.column.property]}
onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }}
onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input>
</div>
)
}
},
{
prop: 'dname',
label: '字典项名称',
render: (h, scope) => {
return (
<div>
<el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={scope.row.nameShow} v-fo value={scope.row[scope.column.property]}
onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }}
onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input>
<el-input placeholder="字典项名称" disabled={this.details.isenable == 2} v-show={!scope.row.nameShow} value={scope.row[scope.column.property]}
onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }}
onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input>
</div>
)
}
},
{
prop: 'normcode',
label: '部标编码',
width: '100',
render: (h, scope) => {
return (
<div>
<el-input placeholder="部标编码" disabled={this.details.isenable == 2} v-show={scope.row.normcodeShow} v-fo value={scope.row[scope.column.property]}
onFocus={() => { this.itemShowFalse(); scope.row.normcodeShow = true; }}
onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input>
<el-input placeholder="部标编码" disabled={this.details.isenable == 2} v-show={!scope.row.normcodeShow} value={scope.row[scope.column.property]}
onFocus={() => { this.itemShowFalse(); scope.row.normcodeShow = true; }}
onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input>
</div>
)
}
},
{
prop: 'normname',
label: '部标名称',
render: (h, scope) => {
return (
<div>
<el-input placeholder="部标名称" disabled={this.details.isenable == 2} v-show={scope.row.normnameShow} v-fo value={scope.row[scope.column.property]}
onFocus={() => { this.itemShowFalse(); scope.row.normnameShow = true; }}
onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input>
<el-input placeholder="部标名称" disabled={this.details.isenable == 2} v-show={!scope.row.normnameShow} value={scope.row[scope.column.property]}
onFocus={() => { this.itemShowFalse(); scope.row.normnameShow = true; }}
onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input>
</div>
)
}
},
{
prop: 'isenable',
width: '160',
label: '是否禁用',
render: (h, scope) => {
return (
<el-radio-group disabled={this.details.isenable == 2} v-model={scope.row.isenable}>
<el-radio label="1">启用</el-radio>
<el-radio label="0">禁用</el-radio>
</el-radio-group>
)
}
},
{
width: '130',
label: '移动',
render: (h, scope) => {
return (
<div>
<el-button type='text' disabled={scope.row.isTop} onClick={() => { this.moveUpward(scope.$index, scope.row) }}>上移</el-button>
<el-button type='text' disabled={scope.row.isBottom} onClick={() => { this.moveDown(scope.$index, scope.row) }}>下移</el-button >
</div >
)
}
},
{
width: '150',
label: '操作',
render: (h, scope) => {
return (
<div>
<el-button type="text" style="margin-right:10px" onClick={() => { this.handleAddSubordinate(scope.row) }}>增加下级</el-button>
<el-button type="text" style="margin-left:0" onClick={() => { this.handleMinus(scope.$index, scope.row) }}>删除</el-button>
</div>
)
}
}
],
tableData: []
}
},
watch: {
value (val) {
this.myValue = val
},
details: {
handler: function (newValue) {
this.tableData = judgeSort(_.cloneDeep(newValue.dataList))
if (newValue.isenable == 2) {
this.column = this.columns.slice(0, 6)
} else {
this.column = this.columns
}
this.ruleForm = newValue.rowData
this.addIndexes()
this.key++
},
deep: true
}
},
methods: {
// 添加索引
addIndexes (data = this.tableData, isAdd = true) {
data.forEach((item, index) => {
if (index == 0) {
item.codeShow = true
item.nameShow = false
item.normcodeShow = false
item.normnameShow = false
} else {
item.codeShow = false
item.nameShow = false
item.normcodeShow = false
item.normnameShow = false
}
if (isAdd) {
item.index = index + 1
}
if (item.children) {
this.addIndexes(item.children, false)
}
})
},
itemShowFalse () {
this.tableData.forEach((item, index) => {
item.codeShow = false
item.nameShow = false
item.normcodeShow = false
item.normnameShow = false
})
},
handleMinus (index, row) {
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeTreeListItem(this.tableData, row.bsmDict)
this.$message({
type: 'success',
message: '删除成功!'
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleSubmit () {
editDictNode({
bsmDict: this.details.rowData.bsmDict,
typeid: this.details.rowData.typeid,
children: this.tableData
}).then(res => {
if (res.code === 200) {
this.$message({
message: '修改成功',
type: 'success'
})
this.$emit('input', false)
}
})
},
closeDialog () {
this.$emit('input', false)
},
// 增加下级
handleAddSubordinate (row) {
if (!row.children) {
row.children = []
}
row.children.push(
{
dcode: '',
dname: '',
isenable: '1',
normcode: '',
normname: '',
bsmDict: getUuid(32),
typeid: row.typeid,
}
)
this.keyList = [];
this.keyList.push(row.bsmDict)
},
// 增加
handleAdd () {
this.$nextTick(() => {
let container = this.$el.querySelector('.el-table__body-wrapper');
container.scrollTop = container.scrollHeight;
})
this.tableData.push(
{
dcode: '',
dname: '',
isenable: '1',
normcode: '',
normname: '',
bsmDict: getUuid(32),
typeid: this.ruleForm.typeid,
}
)
this.addIndexes()
this.key++
},
// 上移下移
moveUpward (index, row) {
realMove(row.bsmDict, 'UP', this.tableData)
this.key++
let id = findParents(this.tableData, row.bsmDict)
this.keyList = id
},
moveDown (index, row) {
realMove(row.bsmDict, 'DOWN', this.tableData)
this.key++
let id = findParents(this.tableData, row.bsmDict)
this.keyList = id
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/.el-radio {
margin-right: 5px !important;
}
</style>
import filter from '@/utils/filter.js'
let vm = null
const sendThis = (_this) => {
vm = _this
}
class data extends filter {
constructor() {
super()
}
columns () {
return [
{
label: '序号',
type: 'index',
width: '50',
render: (h, scope) => {
return (
<div>
{(vm.pageData.currentPage - 1) * vm.pageData.pageSize + scope.$index + 1}
</div>
)
}
},
{
prop: "dcode",
label: "字典类型编码",
},
{
prop: "dname",
label: "字典类型名称",
},
{
label: "是否允许修改",
width: '150',
render: (h, scope) => {
return (
<div>
{
scope.row.isenable == '1' ?
<div class='allow'>允许</div> :
<div class='prohibit'>禁止</div>
}
</div>
)
}
},
{
label: '操作',
width: '150',
align: 'center',
fixed: 'right',
render: (h, scope) => {
return (
<div>
{
scope.row.isenable == '1' ?
<el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.editClick(scope.row, 1) }}>修改</el-button> :
<el-button type="text" icon="el-icon-view" onClick={() => { vm.editClick(scope.row, 2) }}>查看</el-button>
}
</div>
)
}
}
]
}
}
let datas = new data()
export {
datas,
sendThis
}
<template>
<div class="from-clues">
<!-- 表单部分 -->
<div class="from-clues-header">
<el-form @submit.native.prevent :model="ruleForm">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="字典类型编码">
<el-input v-model="ruleForm.dcode" @clear="queryClick" clearable placeholder="字典类型编码"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="字典类型名称">
<el-input v-model="ruleForm.dname" @clear="queryClick" clearable placeholder="字典类型名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="btnColRight">
<el-form-item>
<el-button type="primary" native-type="submit" icon="el-icon-search" @click="queryClick">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleRefresh">刷新缓存</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 表格 -->
<div class="from-clues-content">
<lb-table :page-size="pageData.pageSize" class="loadingtext" :current-page.sync="pageData.currentPage"
:total="tableData.total" @size-change="handleSizeChange" @p-current-change="handleCurrentChange"
:column="tableData.columns" :data="tableData.data">
</lb-table>
</div>
<editDialog v-model="isDialog" :details="details" />
</div>
</template>
<script>
import table from "@/utils/mixin/table"
import { getQlxxDictList, getChildDictList, refreshDictCache } from "@/api/user.js"
import { datas, sendThis } from "./dictionaries"
import editDialog from "./components/editDialog.vue"
export default {
name: "djbcx",
components: {
editDialog
},
mixins: [table],
mounted () {
sendThis(this);
this.queryClick()
},
data () {
return {
isDialog: false,
details: {
dataList: [],
isenable: 1,
rowData: {}
},
ruleForm: {
dcode: '',
dname: ''
},
tableData: {
total: 0,
columns: datas.columns(),
data: []
}
}
},
methods: {
// 初始化数据
queryClick () {
this.$startLoading();
getQlxxDictList({ ...this.ruleForm, ...this.pageData }).then(res => {
this.$endLoading();
let { records, total } = res.result
this.tableData.data = records ? records : []
this.tableData.total = total ? total : 0
})
},
handleRefresh () {
this.$confirm('是否确认刷新', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$startLoading()
refreshDictCache().then(res => {
if (res.code == 200) {
let refech = this.$store.dispatch('dict/generateDic')
this.$endLoading()
refech && this.$message({
message: '刷新成功',
type: 'success'
});
} else {
this.$message.error(res.message)
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消刷新'
});
});
},
editClick (row, val) {
this.details.rowData = row
this.details.isenable = val
getChildDictList(row.bsmDict).then(res => {
this.isDialog = true
let { result } = res
this.details.dataList = result ? result : []
})
}
}
};
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
</style>
import filter from '@/utils/filter.js'
class data extends filter {
constructor() {
super()
}
columns () {
return [
{
label: "序号",
prop: 'ROWNUM',
width: 60
},
{
prop: "DCODE",
label: "字典类型编码"
},
{
prop: "DNAME",
label: "字典类型名称"
},
{
label: "字典结构",
render: (h, scope) => {
return (
<div>
{scope.row.ISTREE == 1 ? '树形' : '列表'}
</div>
)
},
},
]
}
}
export default new data()
<template>
<div class="dictionary-config from-clues">
<div class="from-clues-header">
<el-form ref="form" :model="form" label-width="125px">
<el-row>
<el-col :span="5">
<el-form-item label="字典类型编码">
<el-input v-model="form.DCODE" placeholder="字典类型编码"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="字典类型名称">
<el-input v-model="form.DNAME" placeholder="字典类型名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="14" class="btnColRight">
<el-button @click="handleUpdateDic">刷新字典缓存</el-button>
<el-button type="primary" @click="handleSubmit">查询结果</el-button>
</el-col>
</el-row>
</el-form>
</div>
<div class="from-clues-content">
<lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total"
@size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
:data="tableData.data">
</lb-table>
<message-tips ref="msg" :message="message" />
</div>
<edit-dictionary ref="dictionary" :dictList="dictList" :dicData="dicRowData"></edit-dictionary>
</div>
</template>
<script>
// 字典
import data from "./data"
import dictionaries from '@/api/dictionaries'
import tableMixin from '@/mixins/tableMixin.js'
import editDictionary from '../components/editDictionary.vue'
export default {
name: "dictionary-config",
mixins: [tableMixin],
components: {
editDictionary
},
data () {
return {
message: '',
form: {
DCODE: '',
DNAME: '',
currentPage: 1
},
preContent: '',
tableData: {
columns: data.columns().concat([
{
label: "操作",
render: (h, scope) => {
return (
<div>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
onClick={() => { this.handleEdit(scope.row) }}
>
编辑
</el-button>
</div>
);
},
}
]),
data: []
},
pageData: {
total: 0,
pageSize: 15,
current: 1,
},
dictList: [],
dicRowData: null
}
},
methods: {
async featchData () {
try {
this.form = Object.assign(this.form, this.formData)
let { result: { list, total, pages: pageSize, pageNum: current }
} = await dictionaries.getSysDictParent(this.form)
this.tableData.data = list
this.pageData = {
pageSize,
current,
total
}
} catch (error) {
this.message = error
this.$refs.msg.messageShow()
}
},
async handleEdit (row) {
this.dicRowData = row
try {
let { result: res } = await dictionaries.getSysDictByTypeId(row.TYPEID)
this.dictList = res
this.$refs.dictionary.isShow()
} catch (error) {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
}
},
// 更新字典
handleUpdateDic () {
this.$store.dispatch('dictionaries/generateDic').then((res) => {
if (res) {
this.$message({
message: '刷新成功!',
type: 'success'
});
}
})
}
}
}
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
@import "./index.scss";
</style>
<template>
<!-- 中心日志 -->
<div class="from-clues">
<!-- 头部搜索 -->
<div class="from-clues-header">
<el-form ref="ruleForm" :model="form" label-width="80px">
<el-row>
......@@ -28,6 +30,7 @@
</el-select>
</el-form-item>
</el-col>
<!-- 操作按钮 -->
<el-col :span="4" class="btnColRight">
<el-button @click="resetForm('ruleForm')">重置</el-button>
<el-button type="primary" @click="handleSubmit">查询结果</el-button>
......@@ -35,6 +38,7 @@
</el-row>
</el-form>
</div>
<!-- 列表 -->
<div class="from-clues-content">
<lb-table ref="table" :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total"
@size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
......@@ -44,10 +48,13 @@
</div>
</template>
<script>
// 中心日志
// 引入列表头部数据
import data from "./data"
// 引入列表混入方法
import tableMixin from '@/mixins/tableMixin.js'
export default {
name: "reportLog",
name: "zxrz",
mixins: [tableMixin],
data () {
return {
......@@ -71,8 +78,7 @@ export default {
}
}
},
bsmSjsb: '',
diaData: [],
// 表单
form: {
name: '',
startTime: '',
......@@ -81,6 +87,7 @@ export default {
czlx: '',
currentPage: 1
},
// 表单校验
rules: {
name: [
{ required: true, message: '用户名称', trigger: 'change' }
......@@ -95,7 +102,9 @@ export default {
{ required: true, message: '操作类型', trigger: 'change' }
]
},
// 列表
tableData: {
// 列表头部数据
columns: [{
label: '序号',
type: 'index',
......@@ -122,8 +131,10 @@ export default {
}
}
]),
// 列表
data: []
},
// 分页
pageData: {
total: 0,
pageSize: 15,
......@@ -132,6 +143,7 @@ export default {
}
},
methods: {
// 重置表单
resetForm () {
this.$refs.ruleForm.resetFields();
},
......