feat:系统
Showing
9 changed files
with
576 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 | { | ... | ... |
1 | <template> | ||
2 | <!-- 编辑 --> | ||
3 | <dialogBox submitForm="submitForm" @closeDialog="closeDialog" @submitForm="handleSubmit" width="80%" v-model="myValue" | ||
4 | :isSave="details.isenable == 1" title="字典信息"> | ||
5 | <el-form :model="ruleForm" ref="ruleForm" label-width="100px"> | ||
6 | <el-row :gutter="20"> | ||
7 | <el-col :span="4"> | ||
8 | <el-form-item label="字典类型编码"> | ||
9 | {{ ruleForm.dcode }} | ||
10 | </el-form-item> | ||
11 | </el-col> | ||
12 | <el-col :span="6"> | ||
13 | <el-form-item label="字典类型名称"> | ||
14 | {{ ruleForm.dname }} | ||
15 | </el-form-item> | ||
16 | </el-col> | ||
17 | </el-row> | ||
18 | </el-form> | ||
19 | <lb-table :column="column" :heightNum="420" :key="key" :expand-row-keys="keyList" row-key="bsmDict" | ||
20 | :tree-props="{ children: 'children' }" :pagination="false" :data="tableData"> | ||
21 | </lb-table> | ||
22 | </dialogBox> | ||
23 | </template> | ||
24 | |||
25 | <script> | ||
26 | import { getUuid, judgeSort, realMove, findParents, removeTreeListItem } from '@/utils/operation' | ||
27 | import { editDictNode } from '@/api/user' | ||
28 | export default { | ||
29 | props: { | ||
30 | value: { type: Boolean, default: false }, | ||
31 | details: { | ||
32 | type: Object, | ||
33 | default: {} | ||
34 | } | ||
35 | }, | ||
36 | data () { | ||
37 | return { | ||
38 | key: 0, | ||
39 | myValue: this.value, | ||
40 | keyList: [], | ||
41 | ruleForm: { | ||
42 | dcode: '', | ||
43 | dname: '' | ||
44 | }, | ||
45 | column: [], | ||
46 | columns: [ | ||
47 | { | ||
48 | width: '70', | ||
49 | renderHeader: (h, scope) => { | ||
50 | return (<div> | ||
51 | { | ||
52 | this.details.isenable === '0' ? | ||
53 | <span>序号</span> : | ||
54 | <i class="el-icon-plus" onClick={() => { this.handleAdd() }} style="cursor:pointer;color:#409EFF"></i> | ||
55 | } | ||
56 | </div>) | ||
57 | }, | ||
58 | render: (h, scope) => { | ||
59 | return ( | ||
60 | <span>{scope.row.index}</span> | ||
61 | ) | ||
62 | } | ||
63 | }, | ||
64 | { | ||
65 | prop: 'dcode', | ||
66 | width: '100', | ||
67 | label: '字典项编码', | ||
68 | render: (h, scope) => { | ||
69 | return ( | ||
70 | <div> | ||
71 | <el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={scope.row.codeShow} v-fo value={scope.row[scope.column.property]} | ||
72 | onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }} | ||
73 | onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input> | ||
74 | |||
75 | |||
76 | <el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={!scope.row.codeShow} value={scope.row[scope.column.property]} | ||
77 | onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }} | ||
78 | onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input> | ||
79 | </div> | ||
80 | ) | ||
81 | } | ||
82 | }, | ||
83 | { | ||
84 | prop: 'dname', | ||
85 | label: '字典项名称', | ||
86 | render: (h, scope) => { | ||
87 | return ( | ||
88 | <div> | ||
89 | <el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={scope.row.nameShow} v-fo value={scope.row[scope.column.property]} | ||
90 | onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }} | ||
91 | onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input> | ||
92 | |||
93 | <el-input placeholder="字典项名称" disabled={this.details.isenable == 2} v-show={!scope.row.nameShow} value={scope.row[scope.column.property]} | ||
94 | onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }} | ||
95 | onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input> | ||
96 | </div> | ||
97 | ) | ||
98 | } | ||
99 | }, | ||
100 | { | ||
101 | prop: 'normcode', | ||
102 | label: '部标编码', | ||
103 | width: '100', | ||
104 | render: (h, scope) => { | ||
105 | return ( | ||
106 | <div> | ||
107 | <el-input placeholder="部标编码" disabled={this.details.isenable == 2} v-show={scope.row.normcodeShow} v-fo value={scope.row[scope.column.property]} | ||
108 | onFocus={() => { this.itemShowFalse(); scope.row.normcodeShow = true; }} | ||
109 | onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input> | ||
110 | |||
111 | <el-input placeholder="部标编码" disabled={this.details.isenable == 2} v-show={!scope.row.normcodeShow} value={scope.row[scope.column.property]} | ||
112 | onFocus={() => { this.itemShowFalse(); scope.row.normcodeShow = true; }} | ||
113 | onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input> | ||
114 | </div> | ||
115 | ) | ||
116 | } | ||
117 | }, | ||
118 | { | ||
119 | prop: 'normname', | ||
120 | label: '部标名称', | ||
121 | render: (h, scope) => { | ||
122 | return ( | ||
123 | <div> | ||
124 | <el-input placeholder="部标名称" disabled={this.details.isenable == 2} v-show={scope.row.normnameShow} v-fo value={scope.row[scope.column.property]} | ||
125 | onFocus={() => { this.itemShowFalse(); scope.row.normnameShow = true; }} | ||
126 | onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input> | ||
127 | |||
128 | <el-input placeholder="部标名称" disabled={this.details.isenable == 2} v-show={!scope.row.normnameShow} value={scope.row[scope.column.property]} | ||
129 | onFocus={() => { this.itemShowFalse(); scope.row.normnameShow = true; }} | ||
130 | onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input> | ||
131 | </div> | ||
132 | ) | ||
133 | } | ||
134 | }, | ||
135 | { | ||
136 | prop: 'isenable', | ||
137 | width: '160', | ||
138 | label: '是否禁用', | ||
139 | render: (h, scope) => { | ||
140 | return ( | ||
141 | <el-radio-group disabled={this.details.isenable == 2} v-model={scope.row.isenable}> | ||
142 | <el-radio label="1">启用</el-radio> | ||
143 | <el-radio label="0">禁用</el-radio> | ||
144 | </el-radio-group> | ||
145 | ) | ||
146 | } | ||
147 | }, | ||
148 | { | ||
149 | width: '130', | ||
150 | label: '移动', | ||
151 | render: (h, scope) => { | ||
152 | return ( | ||
153 | <div> | ||
154 | <el-button type='text' disabled={scope.row.isTop} onClick={() => { this.moveUpward(scope.$index, scope.row) }}>上移</el-button> | ||
155 | <el-button type='text' disabled={scope.row.isBottom} onClick={() => { this.moveDown(scope.$index, scope.row) }}>下移</el-button > | ||
156 | </div > | ||
157 | ) | ||
158 | } | ||
159 | }, | ||
160 | { | ||
161 | width: '150', | ||
162 | label: '操作', | ||
163 | render: (h, scope) => { | ||
164 | return ( | ||
165 | <div> | ||
166 | <el-button type="text" style="margin-right:10px" onClick={() => { this.handleAddSubordinate(scope.row) }}>增加下级</el-button> | ||
167 | <el-button type="text" style="margin-left:0" onClick={() => { this.handleMinus(scope.$index, scope.row) }}>删除</el-button> | ||
168 | </div> | ||
169 | ) | ||
170 | } | ||
171 | } | ||
172 | ], | ||
173 | tableData: [] | ||
174 | } | ||
175 | }, | ||
176 | watch: { | ||
177 | value (val) { | ||
178 | this.myValue = val | ||
179 | }, | ||
180 | details: { | ||
181 | handler: function (newValue) { | ||
182 | this.tableData = judgeSort(_.cloneDeep(newValue.dataList)) | ||
183 | if (newValue.isenable == 2) { | ||
184 | this.column = this.columns.slice(0, 6) | ||
185 | } else { | ||
186 | this.column = this.columns | ||
187 | } | ||
188 | this.ruleForm = newValue.rowData | ||
189 | this.addIndexes() | ||
190 | this.key++ | ||
191 | }, | ||
192 | deep: true | ||
193 | } | ||
194 | }, | ||
195 | methods: { | ||
196 | // 添加索引 | ||
197 | addIndexes (data = this.tableData, isAdd = true) { | ||
198 | data.forEach((item, index) => { | ||
199 | if (index == 0) { | ||
200 | item.codeShow = true | ||
201 | item.nameShow = false | ||
202 | item.normcodeShow = false | ||
203 | item.normnameShow = false | ||
204 | } else { | ||
205 | item.codeShow = false | ||
206 | item.nameShow = false | ||
207 | item.normcodeShow = false | ||
208 | item.normnameShow = false | ||
209 | } | ||
210 | if (isAdd) { | ||
211 | item.index = index + 1 | ||
212 | } | ||
213 | if (item.children) { | ||
214 | this.addIndexes(item.children, false) | ||
215 | } | ||
216 | }) | ||
217 | }, | ||
218 | itemShowFalse () { | ||
219 | this.tableData.forEach((item, index) => { | ||
220 | item.codeShow = false | ||
221 | item.nameShow = false | ||
222 | item.normcodeShow = false | ||
223 | item.normnameShow = false | ||
224 | }) | ||
225 | }, | ||
226 | handleMinus (index, row) { | ||
227 | this.$confirm('此操作将永久删除, 是否继续?', '提示', { | ||
228 | confirmButtonText: '确定', | ||
229 | cancelButtonText: '取消', | ||
230 | type: 'warning' | ||
231 | }).then(() => { | ||
232 | removeTreeListItem(this.tableData, row.bsmDict) | ||
233 | this.$message({ | ||
234 | type: 'success', | ||
235 | message: '删除成功!' | ||
236 | }) | ||
237 | }).catch(() => { | ||
238 | this.$message({ | ||
239 | type: 'info', | ||
240 | message: '已取消删除' | ||
241 | }) | ||
242 | }) | ||
243 | }, | ||
244 | handleSubmit () { | ||
245 | editDictNode({ | ||
246 | bsmDict: this.details.rowData.bsmDict, | ||
247 | typeid: this.details.rowData.typeid, | ||
248 | children: this.tableData | ||
249 | }).then(res => { | ||
250 | if (res.code === 200) { | ||
251 | this.$message({ | ||
252 | message: '修改成功', | ||
253 | type: 'success' | ||
254 | }) | ||
255 | this.$emit('input', false) | ||
256 | } | ||
257 | }) | ||
258 | }, | ||
259 | closeDialog () { | ||
260 | this.$emit('input', false) | ||
261 | }, | ||
262 | // 增加下级 | ||
263 | handleAddSubordinate (row) { | ||
264 | if (!row.children) { | ||
265 | row.children = [] | ||
266 | } | ||
267 | row.children.push( | ||
268 | { | ||
269 | dcode: '', | ||
270 | dname: '', | ||
271 | isenable: '1', | ||
272 | normcode: '', | ||
273 | normname: '', | ||
274 | bsmDict: getUuid(32), | ||
275 | typeid: row.typeid, | ||
276 | } | ||
277 | ) | ||
278 | this.keyList = []; | ||
279 | this.keyList.push(row.bsmDict) | ||
280 | }, | ||
281 | // 增加 | ||
282 | handleAdd () { | ||
283 | this.$nextTick(() => { | ||
284 | let container = this.$el.querySelector('.el-table__body-wrapper'); | ||
285 | container.scrollTop = container.scrollHeight; | ||
286 | }) | ||
287 | this.tableData.push( | ||
288 | { | ||
289 | dcode: '', | ||
290 | dname: '', | ||
291 | isenable: '1', | ||
292 | normcode: '', | ||
293 | normname: '', | ||
294 | bsmDict: getUuid(32), | ||
295 | typeid: this.ruleForm.typeid, | ||
296 | } | ||
297 | ) | ||
298 | this.addIndexes() | ||
299 | this.key++ | ||
300 | }, | ||
301 | // 上移下移 | ||
302 | moveUpward (index, row) { | ||
303 | realMove(row.bsmDict, 'UP', this.tableData) | ||
304 | this.key++ | ||
305 | let id = findParents(this.tableData, row.bsmDict) | ||
306 | this.keyList = id | ||
307 | }, | ||
308 | moveDown (index, row) { | ||
309 | realMove(row.bsmDict, 'DOWN', this.tableData) | ||
310 | this.key++ | ||
311 | let id = findParents(this.tableData, row.bsmDict) | ||
312 | this.keyList = id | ||
313 | } | ||
314 | } | ||
315 | } | ||
316 | </script> | ||
317 | <style rel="stylesheet/scss" lang="scss" scoped> | ||
318 | /deep/.el-radio { | ||
319 | margin-right: 5px !important; | ||
320 | } | ||
321 | </style> | ||
322 |
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