| | |
| | | import { webSocketUrl,BaseUrl } from '@/api/request.js' |
| | | // 请求相关 |
| | | import { |
| | | reqGet, |
| | | reqGet |
| | | } from '@/api/index.js' |
| | | Vue.use(Vuex) |
| | | |
| | |
| | | iconPath: '/static/tabBar-icon/statistics.png', |
| | | selectedIconPath: '/static/tabBar-icon/statisticsactive.png', |
| | | // #endif |
| | | text: '日计划' |
| | | text: '日计划' |
| | | }, |
| | | { |
| | | pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar', |
| | |
| | | globalWarning: false, |
| | | filedId:'', //场地id |
| | | bunkerList:'', //仓库list |
| | | samplingPersonList:'', //采样员list |
| | | }, |
| | | mutations: { |
| | | setUserInfo(state, identity) { |
| | |
| | | uni.setStorageSync('filedId', state.filedId) |
| | | }, |
| | | getBunkerList(state, payload) { |
| | | console.log('我执行了getBunkerList====',payload) |
| | | state.bunkerList = payload |
| | | uni.setStorageSync('bunkerList', state.bunkerList) |
| | | } |
| | | }, |
| | | getSamplingPersonList(state, payload) { |
| | | console.log('我执行了samplingPersonList====',payload) |
| | | state.samplingPersonList = payload |
| | | uni.setStorageSync('samplingPersonList', state.samplingPersonList) |
| | | }, |
| | | }, |
| | | actions: { |
| | | websocketInit({ state, dispatch, commit }) { |
| | | // #ifdef H5 |
| | | let wsUrl = `access_token=${uni.getStorageSync('token')}` |
| | | let wsUrl = `${webSocketUrl}?UUID=${uni.getStorageSync('token')}` |
| | | // #endif |
| | | // #ifndef H5 |
| | | let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}` |
| | |
| | | }) |
| | | |
| | | }, |
| | | getSamplingPerson({ state, commit }) { //采样人 |
| | | let params = { |
| | | current: 1, |
| | | size: 999, |
| | | type: 7 |
| | | } |
| | | reqGet('pageCarAndHuoDai',params).then(res => { |
| | | console.log(res,'pageCarAndHuoDai======') |
| | | if(res.code == 0) { |
| | | let temp = res.data.records |
| | | commit('getSamplingPersonList',temp) |
| | | } |
| | | }) |
| | | }, |
| | | getFiledIdCoalBunker({ state, commit }) { //仓库列表(采样地点) |
| | | let filedId = uni.getStorageSync('filedId') |
| | | console.log(filedId,'最终的filedId=============') |
| | |
| | | }, |
| | | }, |
| | | getters:{ |
| | | websocketData:(state) => state.websocketData |
| | | websocketData:(state) => state.websocketData, |
| | | samplingPersonList: (state) => state.samplingPersonList |
| | | |
| | | } |
| | | }) |