feat:系统
Showing
9 changed files
with
254 additions
and
206 deletions
1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
2 | import SERVER from './config' | 2 | import SERVER from './config' |
3 | 3 | // 获取用户信息 | |
4 | // 用户首页 | 4 | export function getUserInfo () { |
5 | // 获取首页待办事项 | ||
6 | export function getHomeTodoList () { | ||
7 | return request({ | 5 | return request({ |
8 | url: SERVER.SERVERAPI + '/rest/workBench/getHomeTodoList', | 6 | url: SERVER.SERVERAPI + '/rest/user/getUserInfo', |
9 | method: 'get' | 7 | method: 'get', |
10 | }) | 8 | }) |
11 | } | 9 | } |
12 | 10 | ||
13 | //获取首页已办事项 | 11 | // 获取菜单信息 |
14 | export function getHomeDoneList () { | 12 | export function getMenuInfo () { |
15 | return request({ | 13 | return request({ |
16 | url: SERVER.SERVERAPI + '/rest/workBench/getHomeDoneList', | 14 | url: SERVER.SERVERAPI + '/rest/user/getUserAuthorizationMenus', |
17 | method: 'get' | 15 | method: 'get', |
18 | }) | 16 | }) |
19 | } | 17 | } |
20 | 18 | /* | |
21 | //获取首页常办项目 | 19 | 获取全部字典数据 |
22 | export function getHomeFrequentProjects () { | 20 | */ |
21 | export function getAllDict () { | ||
23 | return request({ | 22 | return request({ |
24 | url: SERVER.SERVERAPI + '/rest/workBench/getHomeFrequentProjects', | 23 | url: SERVER.SERVERAPI + '/rest/sys/dict/getAllDict', |
25 | method: 'get' | 24 | method: 'post' |
26 | }) | 25 | }) |
27 | } | 26 | } |
28 | 27 | export function getQlxxDictList (data) { | |
29 | //保存常办项目 | ||
30 | export function saveFrequentProjectsList (data) { | ||
31 | return request({ | 28 | return request({ |
32 | url: SERVER.SERVERAPI + '/rest/workBench/saveFrequentProjectsList', | 29 | url: SERVER.SERVERAPI + '/rest/sys/dict/getQlxxDictList', |
33 | method: 'post', | 30 | method: 'post', |
34 | data | 31 | data |
35 | }) | 32 | }) |
36 | } | 33 | } |
37 | 34 | /* | |
38 | 35 | 获取字典子级列表 | |
39 | // 获取用户信息 | 36 | */ |
40 | export function getUserInfo () { | 37 | export function getChildDictList (bsmDict) { |
41 | return request({ | 38 | return request({ |
42 | url: SERVER.SERVERAPI + '/rest/user/getUserInfo', | 39 | url: SERVER.SERVERAPI + '/rest/sys/dict/getChildDictList', |
43 | method: 'get', | 40 | method: 'get', |
41 | params: { | ||
42 | bsmDict: bsmDict | ||
43 | } | ||
44 | }) | 44 | }) |
45 | } | 45 | } |
46 | 46 | /* | |
47 | // 获取菜单信息 | 47 | 编辑字典数据 |
48 | export function getMenuInfo () { | 48 | */ |
49 | export function editDictNode (data) { | ||
49 | return request({ | 50 | return request({ |
50 | url: SERVER.SERVERAPI + '/rest/user/getUserAuthorizationMenus', | 51 | url: SERVER.SERVERAPI + '/rest/sys/dict/editDictNode', |
51 | method: 'get', | 52 | method: 'post', |
53 | data | ||
52 | }) | 54 | }) |
53 | } | 55 | } |
56 | |||
57 | /* | ||
58 | 刷新字典缓存 | ||
59 | */ | ||
60 | export function refreshDictCache () { | ||
61 | return request({ | ||
62 | url: SERVER.SERVERAPI + '/rest/sys/dict/refreshDictCache', | ||
63 | method: 'get' | ||
64 | }) | ||
65 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -270,14 +270,14 @@ export const asyncRoutes = [ | ... | @@ -270,14 +270,14 @@ export const asyncRoutes = [ |
270 | path: '/system', | 270 | path: '/system', |
271 | component: Layout, | 271 | component: Layout, |
272 | meta: { title: '系统管理', icon: 'sqcx', breadcrumb: false }, | 272 | meta: { title: '系统管理', icon: 'sqcx', breadcrumb: false }, |
273 | redirect: '/system/dictionary-config', | 273 | redirect: '/system/dictionaries', |
274 | alwaysShow: true, | 274 | alwaysShow: true, |
275 | name: 'system', | 275 | name: 'system', |
276 | children: [ | 276 | children: [ |
277 | { | 277 | { |
278 | path: 'dictionary-config', | 278 | path: 'dictionaries', |
279 | component: () => import('@/views/system/dictionary-config'), | 279 | component: () => import('@/views/system/dictionaries/dictionaries.vue'), |
280 | name: 'dictionary-config', | 280 | name: 'dictionaries', |
281 | meta: { title: '字典管理' } | 281 | meta: { title: '字典管理' } |
282 | }, | 282 | }, |
283 | { | 283 | { | ... | ... |
This diff is collapsed.
Click to expand it.
1 | import filter from '@/utils/filter.js' | ||
2 | let vm = null | ||
3 | |||
4 | const sendThis = (_this) => { | ||
5 | vm = _this | ||
6 | } | ||
7 | class data extends filter { | ||
8 | constructor() { | ||
9 | super() | ||
10 | } | ||
11 | columns () { | ||
12 | return [ | ||
13 | { | ||
14 | label: '序号', | ||
15 | type: 'index', | ||
16 | width: '50', | ||
17 | render: (h, scope) => { | ||
18 | return ( | ||
19 | <div> | ||
20 | {(vm.pageData.currentPage - 1) * vm.pageData.pageSize + scope.$index + 1} | ||
21 | </div> | ||
22 | ) | ||
23 | } | ||
24 | }, | ||
25 | { | ||
26 | prop: "dcode", | ||
27 | label: "字典类型编码", | ||
28 | }, | ||
29 | { | ||
30 | prop: "dname", | ||
31 | label: "字典类型名称", | ||
32 | }, | ||
33 | { | ||
34 | label: "是否允许修改", | ||
35 | width: '150', | ||
36 | render: (h, scope) => { | ||
37 | return ( | ||
38 | <div> | ||
39 | { | ||
40 | scope.row.isenable == '1' ? | ||
41 | <div class='allow'>允许</div> : | ||
42 | <div class='prohibit'>禁止</div> | ||
43 | } | ||
44 | </div> | ||
45 | ) | ||
46 | } | ||
47 | }, | ||
48 | { | ||
49 | label: '操作', | ||
50 | width: '150', | ||
51 | align: 'center', | ||
52 | fixed: 'right', | ||
53 | render: (h, scope) => { | ||
54 | return ( | ||
55 | <div> | ||
56 | { | ||
57 | scope.row.isenable == '1' ? | ||
58 | <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.editClick(scope.row, 1) }}>修改</el-button> : | ||
59 | <el-button type="text" icon="el-icon-view" onClick={() => { vm.editClick(scope.row, 2) }}>查看</el-button> | ||
60 | } | ||
61 | </div> | ||
62 | ) | ||
63 | } | ||
64 | } | ||
65 | ] | ||
66 | } | ||
67 | |||
68 | } | ||
69 | let datas = new data() | ||
70 | export { | ||
71 | datas, | ||
72 | sendThis | ||
73 | } |
1 | <template> | ||
2 | <div class="from-clues"> | ||
3 | <!-- 表单部分 --> | ||
4 | <div class="from-clues-header"> | ||
5 | <el-form @submit.native.prevent :model="ruleForm"> | ||
6 | <el-row :gutter="20"> | ||
7 | <el-col :span="6"> | ||
8 | <el-form-item label="字典类型编码"> | ||
9 | <el-input v-model="ruleForm.dcode" @clear="queryClick" clearable placeholder="字典类型编码"></el-input> | ||
10 | </el-form-item> | ||
11 | </el-col> | ||
12 | <el-col :span="6"> | ||
13 | <el-form-item label="字典类型名称"> | ||
14 | <el-input v-model="ruleForm.dname" @clear="queryClick" clearable placeholder="字典类型名称"></el-input> | ||
15 | </el-form-item> | ||
16 | </el-col> | ||
17 | <el-col :span="12" class="btnColRight"> | ||
18 | <el-form-item> | ||
19 | <el-button type="primary" native-type="submit" icon="el-icon-search" @click="queryClick">查询</el-button> | ||
20 | <el-button icon="el-icon-refresh" @click="handleRefresh">刷新缓存</el-button> | ||
21 | </el-form-item> | ||
22 | </el-col> | ||
23 | </el-row> | ||
24 | </el-form> | ||
25 | </div> | ||
26 | <!-- 表格 --> | ||
27 | <div class="from-clues-content"> | ||
28 | <lb-table :page-size="pageData.pageSize" class="loadingtext" :current-page.sync="pageData.currentPage" | ||
29 | :total="tableData.total" @size-change="handleSizeChange" @p-current-change="handleCurrentChange" | ||
30 | :column="tableData.columns" :data="tableData.data"> | ||
31 | </lb-table> | ||
32 | </div> | ||
33 | <editDialog v-model="isDialog" :details="details" /> | ||
34 | </div> | ||
35 | </template> | ||
36 | <script> | ||
37 | import table from "@/utils/mixin/table" | ||
38 | import { getQlxxDictList, getChildDictList, refreshDictCache } from "@/api/user.js" | ||
39 | import { datas, sendThis } from "./dictionaries" | ||
40 | import editDialog from "./components/editDialog.vue" | ||
41 | export default { | ||
42 | name: "djbcx", | ||
43 | components: { | ||
44 | editDialog | ||
45 | }, | ||
46 | mixins: [table], | ||
47 | mounted () { | ||
48 | sendThis(this); | ||
49 | this.queryClick() | ||
50 | }, | ||
51 | data () { | ||
52 | return { | ||
53 | isDialog: false, | ||
54 | details: { | ||
55 | dataList: [], | ||
56 | isenable: 1, | ||
57 | rowData: {} | ||
58 | }, | ||
59 | ruleForm: { | ||
60 | dcode: '', | ||
61 | dname: '' | ||
62 | }, | ||
63 | tableData: { | ||
64 | total: 0, | ||
65 | columns: datas.columns(), | ||
66 | data: [] | ||
67 | } | ||
68 | } | ||
69 | }, | ||
70 | methods: { | ||
71 | // 初始化数据 | ||
72 | queryClick () { | ||
73 | this.$startLoading(); | ||
74 | getQlxxDictList({ ...this.ruleForm, ...this.pageData }).then(res => { | ||
75 | this.$endLoading(); | ||
76 | let { records, total } = res.result | ||
77 | this.tableData.data = records ? records : [] | ||
78 | this.tableData.total = total ? total : 0 | ||
79 | }) | ||
80 | }, | ||
81 | handleRefresh () { | ||
82 | this.$confirm('是否确认刷新', '提示', { | ||
83 | confirmButtonText: '确定', | ||
84 | cancelButtonText: '取消', | ||
85 | type: 'warning' | ||
86 | }).then(() => { | ||
87 | this.$startLoading() | ||
88 | refreshDictCache().then(res => { | ||
89 | if (res.code == 200) { | ||
90 | let refech = this.$store.dispatch('dict/generateDic') | ||
91 | this.$endLoading() | ||
92 | refech && this.$message({ | ||
93 | message: '刷新成功', | ||
94 | type: 'success' | ||
95 | }); | ||
96 | } else { | ||
97 | this.$message.error(res.message) | ||
98 | } | ||
99 | }) | ||
100 | }).catch(() => { | ||
101 | this.$message({ | ||
102 | type: 'info', | ||
103 | message: '取消刷新' | ||
104 | }); | ||
105 | }); | ||
106 | }, | ||
107 | editClick (row, val) { | ||
108 | this.details.rowData = row | ||
109 | this.details.isenable = val | ||
110 | getChildDictList(row.bsmDict).then(res => { | ||
111 | this.isDialog = true | ||
112 | let { result } = res | ||
113 | this.details.dataList = result ? result : [] | ||
114 | }) | ||
115 | } | ||
116 | } | ||
117 | }; | ||
118 | </script> | ||
119 | <style scoped lang="scss"> | ||
120 | @import "~@/styles/public.scss"; | ||
121 | </style> |
1 | import filter from '@/utils/filter.js' | ||
2 | class data extends filter { | ||
3 | constructor() { | ||
4 | super() | ||
5 | } | ||
6 | columns () { | ||
7 | return [ | ||
8 | { | ||
9 | label: "序号", | ||
10 | prop: 'ROWNUM', | ||
11 | width: 60 | ||
12 | }, | ||
13 | { | ||
14 | prop: "DCODE", | ||
15 | label: "字典类型编码" | ||
16 | }, | ||
17 | { | ||
18 | prop: "DNAME", | ||
19 | label: "字典类型名称" | ||
20 | }, | ||
21 | { | ||
22 | label: "字典结构", | ||
23 | render: (h, scope) => { | ||
24 | return ( | ||
25 | <div> | ||
26 | {scope.row.ISTREE == 1 ? '树形' : '列表'} | ||
27 | </div> | ||
28 | ) | ||
29 | }, | ||
30 | }, | ||
31 | ] | ||
32 | } | ||
33 | } | ||
34 | export default new data() |
File mode changed
1 | <template> | ||
2 | <div class="dictionary-config from-clues"> | ||
3 | <div class="from-clues-header"> | ||
4 | <el-form ref="form" :model="form" label-width="125px"> | ||
5 | <el-row> | ||
6 | <el-col :span="5"> | ||
7 | <el-form-item label="字典类型编码"> | ||
8 | <el-input v-model="form.DCODE" placeholder="字典类型编码"></el-input> | ||
9 | </el-form-item> | ||
10 | </el-col> | ||
11 | <el-col :span="5"> | ||
12 | <el-form-item label="字典类型名称"> | ||
13 | <el-input v-model="form.DNAME" placeholder="字典类型名称"></el-input> | ||
14 | </el-form-item> | ||
15 | </el-col> | ||
16 | |||
17 | <el-col :span="14" class="btnColRight"> | ||
18 | <el-button @click="handleUpdateDic">刷新字典缓存</el-button> | ||
19 | <el-button type="primary" @click="handleSubmit">查询结果</el-button> | ||
20 | </el-col> | ||
21 | </el-row> | ||
22 | </el-form> | ||
23 | </div> | ||
24 | <div class="from-clues-content"> | ||
25 | <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total" | ||
26 | @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" | ||
27 | :data="tableData.data"> | ||
28 | </lb-table> | ||
29 | <message-tips ref="msg" :message="message" /> | ||
30 | </div> | ||
31 | <edit-dictionary ref="dictionary" :dictList="dictList" :dicData="dicRowData"></edit-dictionary> | ||
32 | </div> | ||
33 | </template> | ||
34 | |||
35 | <script> | ||
36 | // 字典 | ||
37 | import data from "./data" | ||
38 | import dictionaries from '@/api/dictionaries' | ||
39 | import tableMixin from '@/mixins/tableMixin.js' | ||
40 | import editDictionary from '../components/editDictionary.vue' | ||
41 | export default { | ||
42 | name: "dictionary-config", | ||
43 | mixins: [tableMixin], | ||
44 | components: { | ||
45 | editDictionary | ||
46 | }, | ||
47 | data () { | ||
48 | return { | ||
49 | message: '', | ||
50 | form: { | ||
51 | DCODE: '', | ||
52 | DNAME: '', | ||
53 | currentPage: 1 | ||
54 | }, | ||
55 | preContent: '', | ||
56 | tableData: { | ||
57 | columns: data.columns().concat([ | ||
58 | { | ||
59 | label: "操作", | ||
60 | render: (h, scope) => { | ||
61 | return ( | ||
62 | <div> | ||
63 | <el-button | ||
64 | type="text" | ||
65 | size="mini" | ||
66 | icon="el-icon-edit" | ||
67 | onClick={() => { this.handleEdit(scope.row) }} | ||
68 | > | ||
69 | 编辑 | ||
70 | </el-button> | ||
71 | </div> | ||
72 | ); | ||
73 | }, | ||
74 | } | ||
75 | ]), | ||
76 | data: [] | ||
77 | }, | ||
78 | pageData: { | ||
79 | total: 0, | ||
80 | pageSize: 15, | ||
81 | current: 1, | ||
82 | }, | ||
83 | dictList: [], | ||
84 | dicRowData: null | ||
85 | } | ||
86 | }, | ||
87 | methods: { | ||
88 | async featchData () { | ||
89 | try { | ||
90 | this.form = Object.assign(this.form, this.formData) | ||
91 | let { result: { list, total, pages: pageSize, pageNum: current } | ||
92 | } = await dictionaries.getSysDictParent(this.form) | ||
93 | this.tableData.data = list | ||
94 | this.pageData = { | ||
95 | pageSize, | ||
96 | current, | ||
97 | total | ||
98 | } | ||
99 | } catch (error) { | ||
100 | this.message = error | ||
101 | this.$refs.msg.messageShow() | ||
102 | } | ||
103 | }, | ||
104 | async handleEdit (row) { | ||
105 | this.dicRowData = row | ||
106 | try { | ||
107 | let { result: res } = await dictionaries.getSysDictByTypeId(row.TYPEID) | ||
108 | this.dictList = res | ||
109 | this.$refs.dictionary.isShow() | ||
110 | } catch (error) { | ||
111 | this.$alert(error, '提示', { | ||
112 | confirmButtonText: '确定', | ||
113 | type: 'error' | ||
114 | }) | ||
115 | } | ||
116 | }, | ||
117 | // 更新字典 | ||
118 | handleUpdateDic () { | ||
119 | this.$store.dispatch('dictionaries/generateDic').then((res) => { | ||
120 | if (res) { | ||
121 | this.$message({ | ||
122 | message: '刷新成功!', | ||
123 | type: 'success' | ||
124 | }); | ||
125 | } | ||
126 | }) | ||
127 | } | ||
128 | } | ||
129 | } | ||
130 | </script> | ||
131 | <style scoped lang="scss"> | ||
132 | @import "~@/styles/public.scss"; | ||
133 | @import "./index.scss"; | ||
134 | </style> | ||
135 | |||
136 |
1 | <template> | 1 | <template> |
2 | <!-- 中心日志 --> | ||
2 | <div class="from-clues"> | 3 | <div class="from-clues"> |
4 | <!-- 头部搜索 --> | ||
3 | <div class="from-clues-header"> | 5 | <div class="from-clues-header"> |
4 | <el-form ref="ruleForm" :model="form" label-width="80px"> | 6 | <el-form ref="ruleForm" :model="form" label-width="80px"> |
5 | <el-row> | 7 | <el-row> |
... | @@ -28,6 +30,7 @@ | ... | @@ -28,6 +30,7 @@ |
28 | </el-select> | 30 | </el-select> |
29 | </el-form-item> | 31 | </el-form-item> |
30 | </el-col> | 32 | </el-col> |
33 | <!-- 操作按钮 --> | ||
31 | <el-col :span="4" class="btnColRight"> | 34 | <el-col :span="4" class="btnColRight"> |
32 | <el-button @click="resetForm('ruleForm')">重置</el-button> | 35 | <el-button @click="resetForm('ruleForm')">重置</el-button> |
33 | <el-button type="primary" @click="handleSubmit">查询结果</el-button> | 36 | <el-button type="primary" @click="handleSubmit">查询结果</el-button> |
... | @@ -35,6 +38,7 @@ | ... | @@ -35,6 +38,7 @@ |
35 | </el-row> | 38 | </el-row> |
36 | </el-form> | 39 | </el-form> |
37 | </div> | 40 | </div> |
41 | <!-- 列表 --> | ||
38 | <div class="from-clues-content"> | 42 | <div class="from-clues-content"> |
39 | <lb-table ref="table" :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total" | 43 | <lb-table ref="table" :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total" |
40 | @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" | 44 | @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" |
... | @@ -44,10 +48,13 @@ | ... | @@ -44,10 +48,13 @@ |
44 | </div> | 48 | </div> |
45 | </template> | 49 | </template> |
46 | <script> | 50 | <script> |
51 | // 中心日志 | ||
52 | // 引入列表头部数据 | ||
47 | import data from "./data" | 53 | import data from "./data" |
54 | // 引入列表混入方法 | ||
48 | import tableMixin from '@/mixins/tableMixin.js' | 55 | import tableMixin from '@/mixins/tableMixin.js' |
49 | export default { | 56 | export default { |
50 | name: "reportLog", | 57 | name: "zxrz", |
51 | mixins: [tableMixin], | 58 | mixins: [tableMixin], |
52 | data () { | 59 | data () { |
53 | return { | 60 | return { |
... | @@ -71,8 +78,7 @@ export default { | ... | @@ -71,8 +78,7 @@ export default { |
71 | } | 78 | } |
72 | } | 79 | } |
73 | }, | 80 | }, |
74 | bsmSjsb: '', | 81 | // 表单 |
75 | diaData: [], | ||
76 | form: { | 82 | form: { |
77 | name: '', | 83 | name: '', |
78 | startTime: '', | 84 | startTime: '', |
... | @@ -81,6 +87,7 @@ export default { | ... | @@ -81,6 +87,7 @@ export default { |
81 | czlx: '', | 87 | czlx: '', |
82 | currentPage: 1 | 88 | currentPage: 1 |
83 | }, | 89 | }, |
90 | // 表单校验 | ||
84 | rules: { | 91 | rules: { |
85 | name: [ | 92 | name: [ |
86 | { required: true, message: '用户名称', trigger: 'change' } | 93 | { required: true, message: '用户名称', trigger: 'change' } |
... | @@ -95,7 +102,9 @@ export default { | ... | @@ -95,7 +102,9 @@ export default { |
95 | { required: true, message: '操作类型', trigger: 'change' } | 102 | { required: true, message: '操作类型', trigger: 'change' } |
96 | ] | 103 | ] |
97 | }, | 104 | }, |
105 | // 列表 | ||
98 | tableData: { | 106 | tableData: { |
107 | // 列表头部数据 | ||
99 | columns: [{ | 108 | columns: [{ |
100 | label: '序号', | 109 | label: '序号', |
101 | type: 'index', | 110 | type: 'index', |
... | @@ -122,8 +131,10 @@ export default { | ... | @@ -122,8 +131,10 @@ export default { |
122 | } | 131 | } |
123 | } | 132 | } |
124 | ]), | 133 | ]), |
134 | // 列表 | ||
125 | data: [] | 135 | data: [] |
126 | }, | 136 | }, |
137 | // 分页 | ||
127 | pageData: { | 138 | pageData: { |
128 | total: 0, | 139 | total: 0, |
129 | pageSize: 15, | 140 | pageSize: 15, |
... | @@ -132,6 +143,7 @@ export default { | ... | @@ -132,6 +143,7 @@ export default { |
132 | } | 143 | } |
133 | }, | 144 | }, |
134 | methods: { | 145 | methods: { |
146 | // 重置表单 | ||
135 | resetForm () { | 147 | resetForm () { |
136 | this.$refs.ruleForm.resetFields(); | 148 | this.$refs.ruleForm.resetFields(); |
137 | }, | 149 | }, | ... | ... |
-
Please register or sign in to post a comment