bc93437e by 任超

style:打印模板管理

1 parent b0c09b49
import request from '@/utils/request'
/*
获取全部字典数据
*/
export function getAllDict () {
return request({
url: '/sys/dict/getAllDict',
method: 'post'
})
}
......@@ -19,6 +19,7 @@ import router from './router'
import _ from 'lodash'
import * as filters from './filters' // global filters
import './permission' // permission control
Vue.use(Element, { size: 'small' })
Vue.use(Base)
Object.keys(filters).forEach(key => {
......
......@@ -6,47 +6,16 @@ import getPageTitle from '@/utils/get-page-title'
import Cookies from 'js-cookie'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/login', '/auth-redirect'] // no redirect whitelist
router.beforeEach(async (to, from, next) => {
NProgress.start()
document.title = getPageTitle(to.meta.title)
const hasInfo = Cookies.get("userInfo")
if (hasInfo) {
if (to.path === '/login') {
next({ path: '/' })
NProgress.done()
} else {
if (whiteList.indexOf(to.path) !== -1) {
next()
} else {
let hasAddRoute = store.state.permission.addRoutes
if (hasAddRoute) {
next()
} else {
const { result: getMenuData } = await getMenuInfo()
const accessRoutes = await store.dispatch('permission/generateRoutes', getMenuData)
router.addRoutes(accessRoutes)
// 解决页面刷新报404问题,过滤登录页重复访问
const routeTo = Cookies.get('routerTo')
if (routeTo.indexOf('login') > -1) {
// 解决登录成功进入404界面
next('/')
} else {
next(routeTo)
}
}
let hasAddDict = store.state.dict.addDict
if (!hasAddDict) {
store.dispatch('dict/generateDic')
}
}
} else {
if (whiteList.indexOf(to.path) !== -1) {
next()
} else {
// other pages that do not have permission to access are redirected to the login page.
next(`/login?redirect=${to.path}`)
NProgress.done()
}
}
next()
})
router.afterEach(to => {
// 解决刷新页面报404问题
......
......@@ -224,7 +224,15 @@ export const asyncRoutes = [
component: () => import('@/views/system/qtjfjmb/qtjfjmb.vue'),
name: 'qtjfjmb',
meta: { title: '其他及附记模板' }
}
},
{
path: 'dymbgl',
id: '94',
parentId: '9',
component: () => import('@/views/system/dymbgl/dymbgl.vue'),
name: 'dymbgl',
meta: { title: '打印模板管理' }
},
]
}
]
......
......@@ -8,6 +8,7 @@ const getters = {
name: state => state.user.name,
permission_routes: state => state.permission.routes,
addRoutes: state => state.permission.addRoutes,
errorLogs: state => state.errorLog.logs
addDict: state => state.dict.addDict,
dictData: state => state.dict.dictData
}
export default getters
......
import { getAllDict } from '@/api/dict'
const state = {
dictData: {},
addDict: false,
}
const mutations = {
SET_DATA: (state, data) => {
state.addDict = true
state.dictData = data
},
RESET_DICT: (state) => {
state.addDict = false
}
}
const actions = {
// 添加全部字典
generateDic ({ commit }) {
return new Promise(async (resolve) => {
let { result: res } = await getAllDict()
commit('SET_DATA', res)
resolve(true)
})
},
resetdict ({ commit }) {
commit('RESET_DICT')
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
......@@ -38,6 +38,8 @@
}
.el-scrollbar {
height: 100%;
&::-webkit-scrollbar {
display: none;
}
......@@ -133,7 +135,7 @@
.el-submenu__title {
font-weight: 600;
font-size: $sideBarFontSize;
margin: 0 20px;
margin: 0 10px;
border-radius: 6px;
>i {
......@@ -179,7 +181,7 @@
background-color: transparent !important;
font-weight: 600;
font-size: $sideBarFontSize;
margin: 0 20px;
margin: 0 10px;
border-radius: 6px;
}
}
......
import { mapGetters } from 'vuex'
export default {
data () {
return {
......@@ -10,6 +11,9 @@ export default {
created () {
this.fetchData()
},
computed: {
...mapGetters(['dictData'])
},
methods: {
handleSizeChange (val) {
this.pageData.currentPage = 1
......
<template>
<dialogBox title="证明模板" @submitForm="submitForm" width="60%" @closeDialog="closeDialog" v-model="value">
</dialogBox>
</template>
<script>
export default {
components: {
},
props: {
value: { type: Boolean, default: false },
},
data () {
return {
}
},
methods: {
submitForm () {
this.$emit('input', false)
},
closeDialog () {
this.$emit('input', false)
}
}
}
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
</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: "mbmc",
label: "模板编码",
},
{
prop: "mblx",
label: "模板类型",
},
{
prop: "zt",
label: "字体",
},
{
prop: "ztdx",
label: "字体大小",
},
{
prop: "zjczsj",
label: "最近操作时间",
},
{
prop: "zjczr",
label: "最近操作人",
},
{
label: '操作',
width: '150',
align: 'center',
fixed: 'right',
render: (h, scope) => {
return (
<div>
<el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.editClick(scope) }}>设置打印模板</el-button>
</div>
)
}
}
]
}
}
let datas = new data()
export {
datas,
sendThis
}
<template>
<div class="dymbgl from-clues-content">
<lb-table :page-size="pageData.size" :current-page.sync="pageData.current" heightNum="210" :total="tableData.total"
@size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
:data="tableData.data">
</lb-table>
<editDialog v-model="isDialog" />
</div>
</template>
<script>
import table from "@/utils/mixin/table"
import { datas, sendThis } from "./dymbgl"
import editDialog from "./components/editDialog.vue"
export default {
name: "djbcx",
components: {
editDialog
},
mixins: [table],
mounted () {
sendThis(this);
},
data () {
return {
isDialog: false,
tableData: {
total: 0,
columns: datas.columns(),
data: [
{
slsj: "2022-5-12",
}
]
}
}
},
methods: {
// 初始化数据
fetchData () {
},
editClick () {
this.isDialog = true
}
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
.dymbgl {
margin-top: -2px;
}
</style>