|
|
|
@ -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) {
|
|
|
|
|