master
sunzehua 10 months ago
parent 745a769407
commit e1ce334a93

@ -7,16 +7,14 @@
:wrapClassName="`drawer-sider ${navTheme}`"
:closable="false"
:visible="collapsed"
@close="drawerClose"
>
@close="drawerClose">
<side-menu
mode="inline"
:menus="menus"
:theme="navTheme"
:collapsed="false"
:collapsible="true"
@menuSelect="menuSelect"
></side-menu>
@menuSelect="menuSelect"></side-menu>
</a-drawer>
<side-menu
@ -25,8 +23,7 @@
:menus="menus"
:theme="navTheme"
:collapsed="collapsed"
:collapsible="true"
></side-menu>
:collapsible="true"></side-menu>
<div :style="{ minWidth: placeholderDivMinWidth }" v-if="!isMobile()"></div>
<a-layout :class="[layoutMode, `content-width-${contentWidth}`]" :style="{ minHeight: '100vh' }">
@ -37,8 +34,7 @@
:theme="navTheme"
:collapsed="collapsed"
:device="device"
@toggle="toggle"
/>
@toggle="toggle" />
<!-- layout content -->
<!-- height: '100%', -->
@ -87,6 +83,9 @@ export default {
//
mainMenu: state => state.permission.addRouters
}),
...mapGetters([
'FirstLoading'
]),
contentPaddingLeft() {
if (!this.fixSidebar || this.isMobile()) {
return '0'
@ -97,7 +96,7 @@ export default {
return '80px'
},
placeholderDivMinWidth() {
let width = this.collapsed ? '80px' : '230px'
const width = this.collapsed ? '80px' : '230px'
return width
}
},
@ -162,21 +161,23 @@ export default {
}
return left
},
menuSelect() {},
menuSelect() { },
drawerClose() {
this.collapsed = false
},
setBookingInfo() {
this.setCarrierList()
this.setYardList()
this.setPackageList()
this.setIssuetypeList()
this.setBlfrtList()
this.setCtnallList()
this.setLineList()
this.setCodeCountryList()
this.setBookingSourcePage()
this.setBookingInitData()
if (this.FirstLoading) {
this.setCarrierList()
this.setYardList()
this.setPackageList()
this.setIssuetypeList()
this.setBlfrtList()
this.setCtnallList()
this.setLineList()
this.setCodeCountryList()
this.setBookingSourcePage()
this.setBookingInitData()
}
}
}
}

@ -7,6 +7,7 @@ const getters = {
token: state => state.user.token,
avatar: state => state.user.avatar,
nickname: state => state.user.name,
FirstLoading: state => state.user.FirstLoading,
welcome: state => state.user.welcome,
roles: state => state.user.roles,
buttons: state => state.user.buttons,

@ -19,6 +19,7 @@ const user = {
buttons: [], // 按钮权限
admintype: '', // 是否是超管
roles: [],
FirstLoading: true,
messageNum: 0,
info: {},
notices: [], // 接收的通知公告
@ -90,6 +91,9 @@ const user = {
},
SET_MESSAGENUM: (state, num) => {
state.messageNum = num
},
SET_LOADING: (state, flag) => {
state.FirstLoading = flag
}
},
@ -116,8 +120,8 @@ const user = {
})
})
},
// 跨平台登录
LoginWithCode({ commit }, userInfo) {
// 跨平台登录
LoginWithCode({ commit }, userInfo) {
return new Promise((resolve, reject) => {
loginWithCode(userInfo)
.then(response => {
@ -130,6 +134,7 @@ const user = {
Vue.ls.set(ACCESS_TOKEN, result, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set('FIRSTFLAG', true, 7 * 24 * 60 * 60 * 1000)
commit('SET_TOKEN', result)
commit('SET_LOADING', false)
resolve()
})
.catch(error => {
@ -211,20 +216,20 @@ const user = {
})
},
// 登出
ClearnInfo({ commit, state }) {
return new Promise(resolve => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
commit('SET_BUTTONS', [])
commit('SET_ADMINTYPE', '')
commit('SET_INFO', null)
Vue.ls.remove(ACCESS_TOKEN)
Vue.ls.remove(ALL_APPS_MENU)
Vue.ls.remove(DICT_TYPE_TREE_DATA)
resolve()
})
},
// 登出
ClearnInfo({ commit, state }) {
return new Promise(resolve => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
commit('SET_BUTTONS', [])
commit('SET_ADMINTYPE', '')
commit('SET_INFO', null)
Vue.ls.remove(ACCESS_TOKEN)
Vue.ls.remove(ALL_APPS_MENU)
Vue.ls.remove(DICT_TYPE_TREE_DATA)
resolve()
})
},
// 加载所有字典数据
dictTypeData() {
@ -319,25 +324,25 @@ const user = {
})
},
// 加载所有货物状态
configPageList() {
return new Promise((resolve, reject) => {
getconfigPage({ 'PageSize': 1000 })
.then(data => {
if (data.success) {
const result = data.data.rows
Vue.ls.set('configPageList', result)
resolve()
} else {
// eslint-disable-next-line no-undef
reject(new Error(data.message))
}
})
.catch(error => {
reject(error)
})
})
},
// 加载所有货物状态
configPageList() {
return new Promise((resolve, reject) => {
getconfigPage({ 'PageSize': 1000 })
.then(data => {
if (data.success) {
const result = data.data.rows
Vue.ls.set('configPageList', result)
resolve()
} else {
// eslint-disable-next-line no-undef
reject(new Error(data.message))
}
})
.catch(error => {
reject(error)
})
})
},
// 设置订舱列表
setBookingList({ commit }, obj) {

@ -98,7 +98,6 @@ export default {
this.configPageList().then(res => {})
},
requestFailed(res) {
console.log(res)
this.$message.error(res.message)
}
}

@ -117,7 +117,7 @@
@cancel="cancelRemove">
<div class="nav"><i class="iconfont icon-shanchu2"></i>删除</div>
</a-popconfirm>
<div class="nav" ><i class="iconfont icon-jiahao2fill"></i>导入</div>
<div class="nav"><i class="iconfont icon-jiahao2fill"></i>导入</div>
</div>
</template>
<template #tools>
@ -1062,7 +1062,7 @@ export default {
}
},
computed: {
...mapGetters(['bookingList', 'bookingGridOptions', 'messageNum'])
...mapGetters(['bookingList', 'bookingGridOptions', 'messageNum', 'FirstLoading'])
},
watch: {
'$route': {
@ -1091,7 +1091,21 @@ export default {
this.getMessageNumber()
},
methods: {
...mapActions(['setBookingList', 'setBookingGridOptions']),
...mapActions([
'setBookingList',
'setBookingGridOptions',
'setSidebar',
'setCarrierList',
'setYardList',
'setPackageList',
'setIssuetypeList',
'setBlfrtList',
'setCtnallList',
'setLineList',
'setBookingSourcePage',
'setBookingInitData',
'setCodeCountryList'
]),
createdInit() {
this.showColumns = JSON.parse(JSON.stringify(initData.columns))
this.formAllData = JSON.parse(JSON.stringify(initData.condAllData))
@ -2292,7 +2306,18 @@ export default {
} else {
this.$refs.xGrid.clearSort()
}
if (!this.FirstLoading) {
this.setCarrierList()
this.setYardList()
this.setPackageList()
this.setIssuetypeList()
this.setBlfrtList()
this.setCtnallList()
this.setLineList()
this.setCodeCountryList()
this.setBookingSourcePage()
this.setBookingInitData()
}
this.$forceUpdate()
} else {
this.$set(this.gridOptions, 'data', [...[]])

Loading…
Cancel
Save