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: '字典管理' }
},
{
......
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();
},
......