style:打印模板管理
Showing
11 changed files
with
224 additions
and
40 deletions
src/api/dict.js
0 → 100644
... | @@ -19,6 +19,7 @@ import router from './router' | ... | @@ -19,6 +19,7 @@ import router from './router' |
19 | import _ from 'lodash' | 19 | import _ from 'lodash' |
20 | 20 | ||
21 | import * as filters from './filters' // global filters | 21 | import * as filters from './filters' // global filters |
22 | import './permission' // permission control | ||
22 | Vue.use(Element, { size: 'small' }) | 23 | Vue.use(Element, { size: 'small' }) |
23 | Vue.use(Base) | 24 | Vue.use(Base) |
24 | Object.keys(filters).forEach(key => { | 25 | Object.keys(filters).forEach(key => { | ... | ... |
... | @@ -6,47 +6,16 @@ import getPageTitle from '@/utils/get-page-title' | ... | @@ -6,47 +6,16 @@ import getPageTitle from '@/utils/get-page-title' |
6 | import Cookies from 'js-cookie' | 6 | import Cookies from 'js-cookie' |
7 | 7 | ||
8 | NProgress.configure({ showSpinner: false }) // NProgress Configuration | 8 | NProgress.configure({ showSpinner: false }) // NProgress Configuration |
9 | const whiteList = ['/login', '/auth-redirect'] // no redirect whitelist | ||
10 | 9 | ||
11 | router.beforeEach(async (to, from, next) => { | 10 | router.beforeEach(async (to, from, next) => { |
12 | NProgress.start() | 11 | NProgress.start() |
13 | document.title = getPageTitle(to.meta.title) | 12 | document.title = getPageTitle(to.meta.title) |
14 | const hasInfo = Cookies.get("userInfo") | 13 | let hasAddDict = store.state.dict.addDict |
15 | if (hasInfo) { | 14 | if (!hasAddDict) { |
16 | if (to.path === '/login') { | 15 | store.dispatch('dict/generateDic') |
17 | next({ path: '/' }) | ||
18 | NProgress.done() | ||
19 | } else { | ||
20 | if (whiteList.indexOf(to.path) !== -1) { | ||
21 | next() | ||
22 | } else { | ||
23 | let hasAddRoute = store.state.permission.addRoutes | ||
24 | if (hasAddRoute) { | ||
25 | next() | ||
26 | } else { | ||
27 | const { result: getMenuData } = await getMenuInfo() | ||
28 | const accessRoutes = await store.dispatch('permission/generateRoutes', getMenuData) | ||
29 | router.addRoutes(accessRoutes) | ||
30 | // 解决页面刷新报404问题,过滤登录页重复访问 | ||
31 | const routeTo = Cookies.get('routerTo') | ||
32 | if (routeTo.indexOf('login') > -1) { | ||
33 | // 解决登录成功进入404界面 | ||
34 | next('/') | ||
35 | } else { | ||
36 | next(routeTo) | ||
37 | } | ||
38 | } | ||
39 | } | ||
40 | } | ||
41 | } else { | ||
42 | if (whiteList.indexOf(to.path) !== -1) { | ||
43 | next() | ||
44 | } else { | ||
45 | // other pages that do not have permission to access are redirected to the login page. | ||
46 | next(`/login?redirect=${to.path}`) | ||
47 | NProgress.done() | ||
48 | } | ||
49 | } | 16 | } |
17 | NProgress.done() | ||
18 | next() | ||
50 | }) | 19 | }) |
51 | router.afterEach(to => { | 20 | router.afterEach(to => { |
52 | // 解决刷新页面报404问题 | 21 | // 解决刷新页面报404问题 | ... | ... |
... | @@ -224,7 +224,15 @@ export const asyncRoutes = [ | ... | @@ -224,7 +224,15 @@ export const asyncRoutes = [ |
224 | component: () => import('@/views/system/qtjfjmb/qtjfjmb.vue'), | 224 | component: () => import('@/views/system/qtjfjmb/qtjfjmb.vue'), |
225 | name: 'qtjfjmb', | 225 | name: 'qtjfjmb', |
226 | meta: { title: '其他及附记模板' } | 226 | meta: { title: '其他及附记模板' } |
227 | } | 227 | }, |
228 | { | ||
229 | path: 'dymbgl', | ||
230 | id: '94', | ||
231 | parentId: '9', | ||
232 | component: () => import('@/views/system/dymbgl/dymbgl.vue'), | ||
233 | name: 'dymbgl', | ||
234 | meta: { title: '打印模板管理' } | ||
235 | }, | ||
228 | ] | 236 | ] |
229 | } | 237 | } |
230 | ] | 238 | ] | ... | ... |
... | @@ -8,6 +8,7 @@ const getters = { | ... | @@ -8,6 +8,7 @@ const getters = { |
8 | name: state => state.user.name, | 8 | name: state => state.user.name, |
9 | permission_routes: state => state.permission.routes, | 9 | permission_routes: state => state.permission.routes, |
10 | addRoutes: state => state.permission.addRoutes, | 10 | addRoutes: state => state.permission.addRoutes, |
11 | errorLogs: state => state.errorLog.logs | 11 | addDict: state => state.dict.addDict, |
12 | dictData: state => state.dict.dictData | ||
12 | } | 13 | } |
13 | export default getters | 14 | export default getters | ... | ... |
src/store/modules/dict.js
0 → 100644
1 | import { getAllDict } from '@/api/dict' | ||
2 | const state = { | ||
3 | dictData: {}, | ||
4 | addDict: false, | ||
5 | } | ||
6 | |||
7 | const mutations = { | ||
8 | SET_DATA: (state, data) => { | ||
9 | state.addDict = true | ||
10 | state.dictData = data | ||
11 | }, | ||
12 | RESET_DICT: (state) => { | ||
13 | state.addDict = false | ||
14 | } | ||
15 | } | ||
16 | |||
17 | const actions = { | ||
18 | // 添加全部字典 | ||
19 | generateDic ({ commit }) { | ||
20 | return new Promise(async (resolve) => { | ||
21 | let { result: res } = await getAllDict() | ||
22 | commit('SET_DATA', res) | ||
23 | resolve(true) | ||
24 | }) | ||
25 | }, | ||
26 | resetdict ({ commit }) { | ||
27 | commit('RESET_DICT') | ||
28 | } | ||
29 | } | ||
30 | |||
31 | export default { | ||
32 | namespaced: true, | ||
33 | state, | ||
34 | mutations, | ||
35 | actions | ||
36 | } |
... | @@ -38,6 +38,8 @@ | ... | @@ -38,6 +38,8 @@ |
38 | } | 38 | } |
39 | 39 | ||
40 | .el-scrollbar { | 40 | .el-scrollbar { |
41 | height: 100%; | ||
42 | |||
41 | &::-webkit-scrollbar { | 43 | &::-webkit-scrollbar { |
42 | display: none; | 44 | display: none; |
43 | } | 45 | } |
... | @@ -133,7 +135,7 @@ | ... | @@ -133,7 +135,7 @@ |
133 | .el-submenu__title { | 135 | .el-submenu__title { |
134 | font-weight: 600; | 136 | font-weight: 600; |
135 | font-size: $sideBarFontSize; | 137 | font-size: $sideBarFontSize; |
136 | margin: 0 20px; | 138 | margin: 0 10px; |
137 | border-radius: 6px; | 139 | border-radius: 6px; |
138 | 140 | ||
139 | >i { | 141 | >i { |
... | @@ -179,7 +181,7 @@ | ... | @@ -179,7 +181,7 @@ |
179 | background-color: transparent !important; | 181 | background-color: transparent !important; |
180 | font-weight: 600; | 182 | font-weight: 600; |
181 | font-size: $sideBarFontSize; | 183 | font-size: $sideBarFontSize; |
182 | margin: 0 20px; | 184 | margin: 0 10px; |
183 | border-radius: 6px; | 185 | border-radius: 6px; |
184 | } | 186 | } |
185 | } | 187 | } | ... | ... |
1 | import { mapGetters } from 'vuex' | ||
1 | export default { | 2 | export default { |
2 | data () { | 3 | data () { |
3 | return { | 4 | return { |
... | @@ -10,6 +11,9 @@ export default { | ... | @@ -10,6 +11,9 @@ export default { |
10 | created () { | 11 | created () { |
11 | this.fetchData() | 12 | this.fetchData() |
12 | }, | 13 | }, |
14 | computed: { | ||
15 | ...mapGetters(['dictData']) | ||
16 | }, | ||
13 | methods: { | 17 | methods: { |
14 | handleSizeChange (val) { | 18 | handleSizeChange (val) { |
15 | this.pageData.currentPage = 1 | 19 | this.pageData.currentPage = 1 | ... | ... |
1 | <template> | ||
2 | <dialogBox title="证明模板" @submitForm="submitForm" width="60%" @closeDialog="closeDialog" v-model="value"> | ||
3 | |||
4 | </dialogBox> | ||
5 | </template> | ||
6 | |||
7 | <script> | ||
8 | export default { | ||
9 | components: { | ||
10 | }, | ||
11 | props: { | ||
12 | value: { type: Boolean, default: false }, | ||
13 | }, | ||
14 | data () { | ||
15 | return { | ||
16 | } | ||
17 | }, | ||
18 | methods: { | ||
19 | submitForm () { | ||
20 | this.$emit('input', false) | ||
21 | }, | ||
22 | closeDialog () { | ||
23 | this.$emit('input', false) | ||
24 | } | ||
25 | } | ||
26 | } | ||
27 | </script> | ||
28 | <style scoped lang="scss"> | ||
29 | @import "~@/styles/mixin.scss"; | ||
30 | </style> |
src/views/system/dymbgl/dymbgl.js
0 → 100644
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: "mbmc", | ||
27 | label: "模板编码", | ||
28 | }, | ||
29 | { | ||
30 | prop: "mblx", | ||
31 | label: "模板类型", | ||
32 | }, | ||
33 | { | ||
34 | prop: "zt", | ||
35 | label: "字体", | ||
36 | }, | ||
37 | { | ||
38 | prop: "ztdx", | ||
39 | label: "字体大小", | ||
40 | }, | ||
41 | { | ||
42 | prop: "zjczsj", | ||
43 | label: "最近操作时间", | ||
44 | }, | ||
45 | { | ||
46 | prop: "zjczr", | ||
47 | label: "最近操作人", | ||
48 | }, | ||
49 | { | ||
50 | label: '操作', | ||
51 | width: '150', | ||
52 | align: 'center', | ||
53 | fixed: 'right', | ||
54 | render: (h, scope) => { | ||
55 | return ( | ||
56 | <div> | ||
57 | <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.editClick(scope) }}>设置打印模板</el-button> | ||
58 | </div> | ||
59 | ) | ||
60 | } | ||
61 | } | ||
62 | ] | ||
63 | } | ||
64 | } | ||
65 | let datas = new data() | ||
66 | export { | ||
67 | datas, | ||
68 | sendThis | ||
69 | } |
src/views/system/dymbgl/dymbgl.vue
0 → 100644
1 | <template> | ||
2 | <div class="dymbgl from-clues-content"> | ||
3 | <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" heightNum="210" :total="tableData.total" | ||
4 | @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" | ||
5 | :data="tableData.data"> | ||
6 | </lb-table> | ||
7 | <editDialog v-model="isDialog" /> | ||
8 | </div> | ||
9 | </template> | ||
10 | <script> | ||
11 | import table from "@/utils/mixin/table" | ||
12 | import { datas, sendThis } from "./dymbgl" | ||
13 | import editDialog from "./components/editDialog.vue" | ||
14 | export default { | ||
15 | name: "djbcx", | ||
16 | components: { | ||
17 | editDialog | ||
18 | }, | ||
19 | mixins: [table], | ||
20 | mounted () { | ||
21 | sendThis(this); | ||
22 | }, | ||
23 | data () { | ||
24 | return { | ||
25 | isDialog: false, | ||
26 | tableData: { | ||
27 | total: 0, | ||
28 | columns: datas.columns(), | ||
29 | data: [ | ||
30 | { | ||
31 | slsj: "2022-5-12", | ||
32 | } | ||
33 | ] | ||
34 | } | ||
35 | } | ||
36 | }, | ||
37 | methods: { | ||
38 | // 初始化数据 | ||
39 | fetchData () { | ||
40 | }, | ||
41 | editClick () { | ||
42 | this.isDialog = true | ||
43 | } | ||
44 | }, | ||
45 | }; | ||
46 | </script> | ||
47 | <style scoped lang="scss"> | ||
48 | @import "~@/styles/public.scss"; | ||
49 | |||
50 | .dymbgl { | ||
51 | margin-top: -2px; | ||
52 | } | ||
53 | </style> |
-
Please register or sign in to post a comment