实验室运维app端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.9 KiB

1 year ago
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
1 year ago
import tabBar from "@/utils/tabbar.js"; // 引入刚刚创建的tabBar.js
1 year ago
const store = new Vuex.Store({
state: {
dynamicTabbar: [], // 动态tabbar
tabBarList: [],
1 year ago
dataType:null,//数据标识权限
1 year ago
},
getters: {},
actions: {
1 year ago
changeTabbar({ commit }, role_id) {
/*
admin 1123598816738675201
客户 1846419477876510721
维修负责人
*/
if(role_id == "1846419477876510721"){
commit('updateDatatype', 1) //客户
}
if(role_id == "1846419477876510721"){
commit('updateDatatype', 2) //客服
}
// if(role_id == "1846419477876510721"){
// commit('updateDatatype', 3) //维修负责人
// }
// if(role_id == "1846419477876510721"){
// commit('updateDatatype', 4) //维修人员
// }
if (role_id == "1123598816738675201" || role_id == '1846419477876510721' || role_id == '1839537055389515777') {
commit('updateTabbar', tabBar.member)
uni.switchTab({
url: "/pages/home/index",
});
} else {
commit('updateTabbar', tabBar.ordinary)
uni.switchTab({
url: "/pages/order/tasking",
});
}
},
changeDatatype({ commit }, type){
1 year ago
commit('updateTabbar', payload)
}
},
mutations: {
1 year ago
updateTabbar(state, list) {
uni.setStorageSync('tabBarList', list) // 根据登录时传过来的值,存储对应的tabbarlist
state.dynamicTabbar = list
1 year ago
},
1 year ago
updateDatatype(state, data){
state.dataType = data
}
1 year ago
}
})
export default store