From b63dc8ccc6163e73b9f4e4b79f9497070e8ba5ec Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期四, 05 十二月 2024 15:53:06 +0800 Subject: [PATCH] feat:PVC流程代码提交 --- store/index.js | 437 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 355 insertions(+), 82 deletions(-) diff --git a/store/index.js b/store/index.js index 3a3d5eb..d206873 100644 --- a/store/index.js +++ b/store/index.js @@ -1,61 +1,223 @@ import Vue from 'vue' import Vuex from 'vuex' -import { webSocketUrl } from '@/api/request.js' +import { webSocketUrl,BaseUrl } from '@/api/request.js' +// 璇锋眰鐩稿叧 +import { + reqGet +} from '@/api/index.js' Vue.use(Vuex) // 鍔ㄦ�佸簳閮╰abbar const userRoleTabbar = { first: [{ pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar', + //#ifdef MP-WEIXIN iconPath: '../../static/tabBar-icon/home.png', selectedIconPath: '../../static/tabBar-icon/homeblue.png', + // #endif + // #ifdef H5 + iconPath: '/static/tabBar-icon/home.png', + selectedIconPath: '/static/tabBar-icon/homeblue.png', + // #endif text: '棣栭〉' }, { pagePath: 'pages/customer-page/customer-my/faYunstatistics/faYunstatistics', + //#ifdef MP-WEIXIN iconPath: '../../static/tabBar-icon/statistics.png', selectedIconPath: '../../static/tabBar-icon/statisticsactive.png', + // #endif + // #ifdef H5 + iconPath: '/static/tabBar-icon/statistics.png', + selectedIconPath: '/static/tabBar-icon/statisticsactive.png', + // #endif text: '缁熻' }, { pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar', + //#ifdef MP-WEIXIN iconPath: '../../static/tabBar-icon/Gmine10.png', selectedIconPath: '../../static/tabBar-icon/Bmine57.png', + // #endif + // #ifdef H5 + iconPath: '/static/tabBar-icon/Gmine10.png', + selectedIconPath: '/static/tabBar-icon/Bmine57.png', + // #endif text: '鎴戠殑' } ], second: [{ pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar', + //#ifdef MP-WEIXIN iconPath: '../../static/tabBar-icon/home.png', selectedIconPath: '../../static/tabBar-icon/homeblue.png', + // #endif + // #ifdef H5 + iconPath: '/static/tabBar-icon/home.png', + selectedIconPath: '/static/tabBar-icon/homeblue.png', + // #endif text: '棣栭〉' }, { pagePath: 'pages/customer-page/customer-my/faYunstatistics/faYunstatistics', + //#ifdef MP-WEIXIN iconPath: '../../static/tabBar-icon/statistics.png', selectedIconPath: '../../static/tabBar-icon/statisticsactive.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/statistics.png', + selectedIconPath: '/static/tabBar-icon/statisticsactive.png', + // #endif text: '缁熻' }, { pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar', + //#ifdef MP-WEIXIN iconPath: '../../static/tabBar-icon/Gmine10.png', selectedIconPath: '../../static/tabBar-icon/Bmine57.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/Gmine10.png', + selectedIconPath: '/static/tabBar-icon/Bmine57.png', + // #endif text: '鎴戠殑' } ], three: [{ pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar', + //#ifdef MP-WEIXIN iconPath: '../../static/tabBar-icon/home.png', selectedIconPath: '../../static/tabBar-icon/homeblue.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/home.png', + selectedIconPath: '/static/tabBar-icon/homeblue.png', + // #endif text: '棣栭〉' }, { pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar', + //#ifdef MP-WEIXIN iconPath: '../../static/tabBar-icon/Gmine10.png', selectedIconPath: '../../static/tabBar-icon/Bmine57.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/Gmine10.png', + selectedIconPath: '/static/tabBar-icon/Bmine57.png', + // #endif text: '鎴戠殑' } - ] + ], + fourth: [{ + pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar', + //#ifdef MP-WEIXIN + iconPath: '../../static/tabBar-icon/home.png', + selectedIconPath: '../../static/tabBar-icon/homeblue.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/home.png', + selectedIconPath: '/static/tabBar-icon/homeblue.png', + // #endif + text: '杩涘満' + },{ + pagePath: 'pages/doorkeeper-page/doorkeeper-index/exit-index', + //#ifdef MP-WEIXIN + iconPath: '../../static/tabBar-icon/home.png', + selectedIconPath: '../../static/tabBar-icon/homeblue.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/home.png', + selectedIconPath: '/static/tabBar-icon/homeblue.png', + // #endif + text: '鍑哄満' + }, + { + pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar', + //#ifdef MP-WEIXIN + iconPath: '../../static/tabBar-icon/Gmine10.png', + selectedIconPath: '../../static/tabBar-icon/Bmine57.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/Gmine10.png', + selectedIconPath: '/static/tabBar-icon/Bmine57.png', + // #endif + text: '鎴戠殑' + }, + + ], + five:[{ + pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar', + //#ifdef MP-WEIXIN + iconPath: '../../static/tabBar-icon/home.png', + selectedIconPath: '../../static/tabBar-icon/homeblue.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/home.png', + selectedIconPath: '/static/tabBar-icon/homeblue.png', + // #endif + text: '棣栭〉' + }, + { + pagePath: 'pages/loadUnload-page/historyOrder/index', + //#ifdef MP-WEIXIN + iconPath: '../../static/tabBar-icon/home.png', + selectedIconPath: '../../static/tabBar-icon/homeblue.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/home.png', + selectedIconPath: '/static/tabBar-icon/homeblue.png', + // #endif + text: '鍘嗗彶鏀跺彂鍗�' + }, + { + pagePath: 'pages/loadUnload-page/orderPlanList/index', + //#ifdef MP-WEIXIN + iconPath: '../../static/tabBar-icon/statistics.png', + selectedIconPath: '../../static/tabBar-icon/statisticsactive.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/statistics.png', + selectedIconPath: '/static/tabBar-icon/statisticsactive.png', + // #endif + text: '鏃ヨ鍒�' + }, + { + pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar', + //#ifdef MP-WEIXIN + iconPath: '../../static/tabBar-icon/Gmine10.png', + selectedIconPath: '../../static/tabBar-icon/Bmine57.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/Gmine10.png', + selectedIconPath: '/static/tabBar-icon/Bmine57.png', + // #endif + text: '鎴戠殑' + } + ], + six:[{ + pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar', + //#ifdef MP-WEIXIN + iconPath: '../../static/tabBar-icon/home.png', + selectedIconPath: '../../static/tabBar-icon/homeblue.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/home.png', + selectedIconPath: '/static/tabBar-icon/homeblue.png', + // #endif + text: '棣栭〉' + }, + { + pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar', + //#ifdef MP-WEIXIN + iconPath: '../../static/tabBar-icon/Gmine10.png', + selectedIconPath: '../../static/tabBar-icon/Bmine57.png', + // #endif + //#ifdef H5 + iconPath: '/static/tabBar-icon/Gmine10.png', + selectedIconPath: '/static/tabBar-icon/Bmine57.png', + // #endif + text: '鎴戠殑' + }] } const store = new Vuex.Store({ state: { @@ -93,63 +255,69 @@ globalIntervalId: null, is_open_socket: false, //閬垮厤閲嶅杩炴帴 connectNum: 1, //閲嶈繛娆℃暟, - reconnectTimeOut: null, - // 鎵撳嵃鍑哄叆闂ㄨ瘉 涓�娆″氨鍙互鏈夋墦鍗板叆闂ㄨ瘉锛� 涓ゆ鍙互鏈夊叆闂ㄨ瘉 鍑洪棬璇� 0娆′竴寮犻兘娌℃湁 + reconnectTimeOut: null, //閲嶆柊閾炬帴鐨勫畾鏃跺櫒 + // 鎵撳嵃鍑哄叆闂ㄨ瘉 涓�娆″氨鍙互鏈夋墦鍗板叆闂ㄨ瘉锛� 涓ゆ鍙互鏈夊叆闂ㄨ瘉 鍑洪棬璇� 0娆′竴寮犻兘娌℃湁 ablePrintInduction: false, //鍏ラ棬璇� ablePrintOut: false, //鍑洪棬璇� - driverTourImgList: ['https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj2.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj3.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj4.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj5.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj6.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj7.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj8.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj9.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj10.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj11.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj12.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj13.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj14.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj15.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj16.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj17.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj18.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj19.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj20.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj21.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj22.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj23.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj24.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj25.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj26.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj27.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj28.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj29.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj30.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj31.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj32.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj33.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj33-1.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj34.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj35.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj36.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj37.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj38.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj39.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj40.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj41.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj42.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj43.jpg', - 'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj44.jpg', + driverTourImgList: ['https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj1.png', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj2.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj3.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj4.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj5.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj6.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj7.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj8.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj9.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj10.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj11.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj12.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj13.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj14.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj15.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj16.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj17.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj18.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj19.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj20.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj21.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj22.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj23.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj24.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj25.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj26.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj27.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj28.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj29.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj30.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj31.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj32.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj33.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj33-1.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj34.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj35.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj36.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj37.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj38.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj39.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj40.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj41.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj42.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj43.jpg', + 'https://wrzs.czjlchem.com:9090/appimg/image/tour/driver/sj44.jpg', ], wsgVisiable: false, //纾呮埧蹇欑寮圭獥鎺у埗 - wsgContent: '' + wsgContent: '', + globalIsFirstWeighing: 1, //鏄惁鏄涓�娆′笂纾� + confirmWeighVisiable: false, //纾呮埧绠$悊纭绉伴噸瀹屾垚鎻愮ず寮圭獥 + confirmWeighContent: '', + // 绉伴噸绋冲畾鎬� 0/绋冲畾 1/闈炵ǔ瀹� 闈炵ǔ瀹氭�佷笉鑳界偣绉伴噸 + globalWarning: false, + filedId:'', //鍦哄湴id + bunkerList:'', //浠撳簱list + samplingPersonList:'', //閲囨牱鍛榣ist + pvcIdList:['1818242458023153665'], }, mutations: { - lengthchange(state, payload) { - state.fleetDriverDataLength = payload - }, setUserInfo(state, identity) { state.userInfo = userObj[identity] }, @@ -163,7 +331,13 @@ state.userTabbar = userRoleTabbar.second uni.setStorageSync('userTabbar', state.userTabbar) } else if (roleType == 5) { - state.userTabbar = userRoleTabbar.three + state.userTabbar = userRoleTabbar.five + uni.setStorageSync('userTabbar', state.userTabbar) + }else if (roleType == 6) { + state.userTabbar = userRoleTabbar.fourth + uni.setStorageSync('userTabbar', state.userTabbar) + }else if (roleType == 7) { + state.userTabbar = userRoleTabbar.six uni.setStorageSync('userTabbar', state.userTabbar) } }, @@ -188,7 +362,10 @@ changeuserInfo(state, payload) { state.globaluserInfo = payload }, - // 鏀圭増鍏ㄥ眬websocket鐘舵�� + changesocketTask(state, payload) { + state.socketTask = payload + }, + // 鏀圭増鍏ㄥ眬websocket鐘舵�侊紙鍒ゆ柇鏄惁姝e父閾炬帴锛� changeisconnect(state, payload) { state.globalisconnect = payload }, @@ -200,6 +377,7 @@ console.log(state.globalisLogin, '鍏ㄥ眬鐧诲綍鐘舵�佹敼鍙樹簡') }, setWebsocketData(state, data) { + console.log(data,'data-----') state.websocketData = data }, // 鏀瑰彉閲嶈繛鐘舵�� @@ -208,10 +386,14 @@ }, // 鏀瑰彉閲嶈繛娆℃暟 changereconnectNum(state, payload) { - if (state.connectNum < 6) { - state.connectNum += payload + if (payload.isWeigh) { + state.connectNum = payload.connectNum } else { - state.connectNum = payload + if (state.connectNum < 6) { + state.connectNum += payload.connectNum + } else { + state.connectNum = payload.connectNum + } } }, changeablePrintInduction(state, payload) { @@ -225,14 +407,50 @@ }, changewsgContent(state, payload) { state.wsgContent = payload - } + }, + changeglobalIsFirstWeighing(state, payload) { + state.globalIsFirstWeighing = payload + }, + changeconfirmWeighVisiable(state, payload) { + state.confirmWeighVisiable = payload + }, + changeconfirmWeighContent(state, payload) { + state.confirmWeighContent = payload + }, + // 鏀瑰彉绋冲畾鎬� + changeWarning(state, payload) { + state.globalWarning = payload + }, + // 鍦哄湴filedId鐨勮幏鍙� + getFiledId(state, payload) { + console.log(payload,'filedId=====') + state.filedId = payload + uni.setStorageSync('filedId', state.filedId) + }, + getBunkerList(state, 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 = `${webSocketUrl}?UUID=${uni.getStorageSync('token')}` + // #endif + // #ifndef H5 let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}` - state.socketTast = uni.connectSocket({ + // #endif + state.socketTask = uni.connectSocket({ url: wsUrl, - header: { CLIENT_TOC: 'Y' }, + header: { + clientToc: 'Y' , + 'CLIENT_TOC': 'Y', + }, success: res => { console.log(res, 'socketSuccess') if (res.errMsg === 'connectSocket:ok') { @@ -245,19 +463,20 @@ console.log('ws澶辫触'); commit('changereconnectState', false) dispatch('reconnect') + commit('changeisconnect', false) } }) - state.socketTast.onOpen(() => dispatch('websocketOnOpen')) - state.socketTast.onMessage(result => dispatch('websocketOnMessage', result.data)) - state.socketTast.onClose(e => dispatch('websocketOnClose', e)) - state.socketTast.onError(e => dispatch('websocketOnError', e)) + state.socketTask.onOpen(() => dispatch('websocketOnOpen')) + state.socketTask.onMessage(result => dispatch('websocketOnMessage', result.data)) + state.socketTask.onClose(e => dispatch('websocketOnClose', e)) + state.socketTask.onError(e => dispatch('websocketOnError', e)) }, websocketOnOpen({ state, commit }) { console.log('ws鎵撳紑') - clearInterval(state.reconnectTimeOut) - clearInterval(state.globalIntervalId) + clearInterval(state.reconnectTimeOut) //娓呴櫎涓婁竴娆$殑瀹氭椂鍣� + clearInterval(state.globalIntervalId) //娓呴櫎蹇冭烦 state.globalIntervalId = setInterval(() => { - state.socketTast.send({ + state.socketTask.send({ data: JSON.stringify({ type: 'ping' }), success(e) { console.log(e, '鍙戦�佸績璺虫垚鍔�') @@ -266,24 +485,24 @@ }, 30000) }, websocketOnClose({ state, commit, dispatch }, e) { - if (!state.socketTast) return + if (!state.socketTask) return console.log('ws鍏抽棴', e) - state.socketTast.close(e => { + state.socketTask.close(e => { commit('changeisconnect', false) }) clearInterval(state.globalIntervalId) clearInterval(state.reconnectTimeOut) - state.socketTast = null + state.socketTask = null commit('changereconnectState', false) - if (state.connectNum < 6 && state.globalisLogin) { + if ((state.connectNum < 6 || state.connectNum.connectNum < 6) && state.globalisLogin) { uni.showToast({ - title: `杩炴帴澶辫触锛屾鍦ㄥ皾璇曠${state.connectNum}娆¤繛鎺, + title: '杩炴帴澶辫触锛屾鍦ㄥ皾璇曢噸鏂拌繛鎺�', icon: 'none' }) - commit('changereconnectNum', 1) + commit('changereconnectNum', { connectNum: 1, isWeigh: false }) dispatch('reconnect') } else if (state.connectNum >= 6 && state.globalisLogin) { - commit('changereconnectNum', 1) + commit('changereconnectNum', { connectNum: 1, isWeigh: false }) uni.showToast({ title: '缃戠粶寮傚父,璇风◢鍚庨噸璇�', icon: 'none' @@ -297,17 +516,17 @@ console.log('ws鎶ラ敊', e) clearInterval(state.globalIntervalId) clearInterval(state.reconnectTimeOut) - state.socketTast = null + state.socketTask = null commit('changereconnectState', false) - if (state.connectNum < 6 && state.globalisLogin) { + if (state.connectNum < 6 || state.connectNum.connectNum < 6 && state.globalisLogin) { uni.showToast({ - title: `杩炴帴澶辫触锛屾鍦ㄥ皾璇曠${state.connectNum}娆¤繛鎺, + title: '杩炴帴澶辫触锛屾鍦ㄥ皾璇曢噸鏂拌繛鎺�', icon: 'none' }) - commit('changereconnectNum', 1) + commit('changereconnectNum', { connectNum: 1, isWeigh: false }) dispatch('reconnect') } else if (state.connectNum > 6 && state.globalisLogin) { - commit('changereconnectNum', 1) + commit('changereconnectNum', { connectNum: 1, isWeigh: false }) uni.showToast({ title: '缃戠粶寮傚父,璇风◢鍚庨噸璇�', icon: 'none' @@ -329,8 +548,62 @@ dispatch('websocketInit') }, 5000) } - } + }, + + //filedId + async getBunkerList({ state,dispatch, commit }) { //鑾峰彇filedId + // this.$reqGet(`getList/${this.deptId}`).then(res => { + // console.log(res,'鎯冲緱鍒癴iledId') + // }) + let deptId = uni.getStorageSync('userInfo').deptIds + console.log(deptId,'deptId====') + await uni.request({ //鑾峰彇deptId + url: `/wrzs/jccoalfiled/list/${deptId}`, + method: 'GET', + header: { + Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'), + clientToc: 'Y', + 'CLIENT_TOC': 'Y', + }, + success: res => { + console.log(res,'filedId鎺ュ彛000000000000') + commit('getFiledId',res.data.data[0].id || '') + dispatch('getFiledIdCoalBunker') + // console.log(res,'shuj------') + // this.filedId = res.data?.data.length > 0 ? res.data.data[0].id : ''; + // this.getFiledIdCoalBunker() + } + }) + + }, + 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=============') + reqGet('getFiledIdCoalBunker', {filedId: filedId}).then(res => { + console.log(res,'res----浠撳簱') + commit('getBunkerList',res.data) + }) + }, + }, + getters:{ + websocketData:(state) => state.websocketData, + samplingPersonList: (state) => state.samplingPersonList + } }) -export default store \ No newline at end of file +export default store -- Gitblit v1.9.1