实验室运维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.

65 lines
2.0 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) {
/*
1 year ago
admin 超管 1123598816738675201
1 year ago
客户 1846419477876510721
1 year ago
客服 1839536982874193922
维修负责人 1839537055389515777
维修人员 1839552581620793346
1 year ago
*/
1 year ago
// console.log(66666666666,role_id)
1 year ago
if(role_id == "1123598816738675201"||role_id == "1846419477876510721"){
1 year ago
commit('updateDatatype', 1) //客户
}
1 year ago
if(role_id == "1839536982874193922"){
1 year ago
commit('updateDatatype', 2) //客服
}
1 year ago
if(role_id == "1839537055389515777"){
commit('updateDatatype', 3) //维修负责人
}
if(role_id == "1839552581620793346"){
commit('updateDatatype', 4) //维修人员
}
1 year ago
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