diff --git a/src/page/jobManage/modules/JobDetail.vue b/src/page/jobManage/modules/JobDetail.vue index fc96322..5a3092b 100644 --- a/src/page/jobManage/modules/JobDetail.vue +++ b/src/page/jobManage/modules/JobDetail.vue @@ -388,11 +388,12 @@ return } if(this.firstStateImgs.length<1){ - Toast({ - message: '请拍摄现场图片', - position: 'bottom', - }) - return + // Toast({ + // message: '请拍摄现场图片', + // position: 'bottom', + // }) + // return + this.jobForm.firstStatePhotos = '' }else{ this.jobForm.firstStatePhotos = '' for(const img of this.firstStateImgs){ @@ -450,11 +451,12 @@ return } if(this.handleImgs.length<1){ - Toast({ - message: '请拍摄维护图片', - position: 'bottom', - }) - return + // Toast({ + // message: '请拍摄维护图片', + // position: 'bottom', + // }) + // return + this.jobForm.handlePhotos = '' }else{ this.jobForm.handlePhotos = '' for(const img of this.handleImgs){ diff --git a/src/page/jobManage/modules/JobDetail.vue b/src/page/jobManage/modules/JobDetail.vue index fc96322..5a3092b 100644 --- a/src/page/jobManage/modules/JobDetail.vue +++ b/src/page/jobManage/modules/JobDetail.vue @@ -388,11 +388,12 @@ return } if(this.firstStateImgs.length<1){ - Toast({ - message: '请拍摄现场图片', - position: 'bottom', - }) - return + // Toast({ + // message: '请拍摄现场图片', + // position: 'bottom', + // }) + // return + this.jobForm.firstStatePhotos = '' }else{ this.jobForm.firstStatePhotos = '' for(const img of this.firstStateImgs){ @@ -450,11 +451,12 @@ return } if(this.handleImgs.length<1){ - Toast({ - message: '请拍摄维护图片', - position: 'bottom', - }) - return + // Toast({ + // message: '请拍摄维护图片', + // position: 'bottom', + // }) + // return + this.jobForm.handlePhotos = '' }else{ this.jobForm.handlePhotos = '' for(const img of this.handleImgs){ diff --git a/src/page/jobSearch/searchPage.vue b/src/page/jobSearch/searchPage.vue index 365a44e..27f5908 100644 --- a/src/page/jobSearch/searchPage.vue +++ b/src/page/jobSearch/searchPage.vue @@ -148,12 +148,12 @@ value: '' }] getAlarmContentType('1').then(response => { - // const supportDeviceTypes = this.$store.getters.deviceTypes + const supportDeviceTypes = this.$store.getters.deviceTypes for (const item of response.data.list) { - // if (supportDeviceTypes.indexOf(item.deviceType) !== -1) { + if (supportDeviceTypes.indexOf(item.deviceType) !== -1) { this.alarmContentList.push(item) this.isLoading = false - // } + } } }) }, diff --git a/src/page/jobManage/modules/JobDetail.vue b/src/page/jobManage/modules/JobDetail.vue index fc96322..5a3092b 100644 --- a/src/page/jobManage/modules/JobDetail.vue +++ b/src/page/jobManage/modules/JobDetail.vue @@ -388,11 +388,12 @@ return } if(this.firstStateImgs.length<1){ - Toast({ - message: '请拍摄现场图片', - position: 'bottom', - }) - return + // Toast({ + // message: '请拍摄现场图片', + // position: 'bottom', + // }) + // return + this.jobForm.firstStatePhotos = '' }else{ this.jobForm.firstStatePhotos = '' for(const img of this.firstStateImgs){ @@ -450,11 +451,12 @@ return } if(this.handleImgs.length<1){ - Toast({ - message: '请拍摄维护图片', - position: 'bottom', - }) - return + // Toast({ + // message: '请拍摄维护图片', + // position: 'bottom', + // }) + // return + this.jobForm.handlePhotos = '' }else{ this.jobForm.handlePhotos = '' for(const img of this.handleImgs){ diff --git a/src/page/jobSearch/searchPage.vue b/src/page/jobSearch/searchPage.vue index 365a44e..27f5908 100644 --- a/src/page/jobSearch/searchPage.vue +++ b/src/page/jobSearch/searchPage.vue @@ -148,12 +148,12 @@ value: '' }] getAlarmContentType('1').then(response => { - // const supportDeviceTypes = this.$store.getters.deviceTypes + const supportDeviceTypes = this.$store.getters.deviceTypes for (const item of response.data.list) { - // if (supportDeviceTypes.indexOf(item.deviceType) !== -1) { + if (supportDeviceTypes.indexOf(item.deviceType) !== -1) { this.alarmContentList.push(item) this.isLoading = false - // } + } } }) }, diff --git a/src/page/wellManage/WellManage.vue b/src/page/wellManage/WellManage.vue index 18aa947..649a393 100644 --- a/src/page/wellManage/WellManage.vue +++ b/src/page/wellManage/WellManage.vue @@ -219,7 +219,13 @@ // 获取窨井类型 fetchWellType() { getWellType(this.listQuery).then(response => { - this.wellTypeList = response.data + this.wellTypeList = [] + const wellTypes = this.$store.getters.wellTypes + for (const wellType of response.data) { + if (wellTypes.indexOf(wellType.value) !== -1) { + this.wellTypeList.push(wellType) + } + } this.wellTypeList.unshift({name:'全部',value:''}) }) } diff --git a/src/page/jobManage/modules/JobDetail.vue b/src/page/jobManage/modules/JobDetail.vue index fc96322..5a3092b 100644 --- a/src/page/jobManage/modules/JobDetail.vue +++ b/src/page/jobManage/modules/JobDetail.vue @@ -388,11 +388,12 @@ return } if(this.firstStateImgs.length<1){ - Toast({ - message: '请拍摄现场图片', - position: 'bottom', - }) - return + // Toast({ + // message: '请拍摄现场图片', + // position: 'bottom', + // }) + // return + this.jobForm.firstStatePhotos = '' }else{ this.jobForm.firstStatePhotos = '' for(const img of this.firstStateImgs){ @@ -450,11 +451,12 @@ return } if(this.handleImgs.length<1){ - Toast({ - message: '请拍摄维护图片', - position: 'bottom', - }) - return + // Toast({ + // message: '请拍摄维护图片', + // position: 'bottom', + // }) + // return + this.jobForm.handlePhotos = '' }else{ this.jobForm.handlePhotos = '' for(const img of this.handleImgs){ diff --git a/src/page/jobSearch/searchPage.vue b/src/page/jobSearch/searchPage.vue index 365a44e..27f5908 100644 --- a/src/page/jobSearch/searchPage.vue +++ b/src/page/jobSearch/searchPage.vue @@ -148,12 +148,12 @@ value: '' }] getAlarmContentType('1').then(response => { - // const supportDeviceTypes = this.$store.getters.deviceTypes + const supportDeviceTypes = this.$store.getters.deviceTypes for (const item of response.data.list) { - // if (supportDeviceTypes.indexOf(item.deviceType) !== -1) { + if (supportDeviceTypes.indexOf(item.deviceType) !== -1) { this.alarmContentList.push(item) this.isLoading = false - // } + } } }) }, diff --git a/src/page/wellManage/WellManage.vue b/src/page/wellManage/WellManage.vue index 18aa947..649a393 100644 --- a/src/page/wellManage/WellManage.vue +++ b/src/page/wellManage/WellManage.vue @@ -219,7 +219,13 @@ // 获取窨井类型 fetchWellType() { getWellType(this.listQuery).then(response => { - this.wellTypeList = response.data + this.wellTypeList = [] + const wellTypes = this.$store.getters.wellTypes + for (const wellType of response.data) { + if (wellTypes.indexOf(wellType.value) !== -1) { + this.wellTypeList.push(wellType) + } + } this.wellTypeList.unshift({name:'全部',value:''}) }) } diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 019a5ec..b8ce2ac 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -6,7 +6,7 @@ const app = { state: { device: 'phone', - version: '1.0.3', + version: '1.0.4', kaptcha: '', publicKey: getPublicKey(), sid: '', diff --git a/src/page/jobManage/modules/JobDetail.vue b/src/page/jobManage/modules/JobDetail.vue index fc96322..5a3092b 100644 --- a/src/page/jobManage/modules/JobDetail.vue +++ b/src/page/jobManage/modules/JobDetail.vue @@ -388,11 +388,12 @@ return } if(this.firstStateImgs.length<1){ - Toast({ - message: '请拍摄现场图片', - position: 'bottom', - }) - return + // Toast({ + // message: '请拍摄现场图片', + // position: 'bottom', + // }) + // return + this.jobForm.firstStatePhotos = '' }else{ this.jobForm.firstStatePhotos = '' for(const img of this.firstStateImgs){ @@ -450,11 +451,12 @@ return } if(this.handleImgs.length<1){ - Toast({ - message: '请拍摄维护图片', - position: 'bottom', - }) - return + // Toast({ + // message: '请拍摄维护图片', + // position: 'bottom', + // }) + // return + this.jobForm.handlePhotos = '' }else{ this.jobForm.handlePhotos = '' for(const img of this.handleImgs){ diff --git a/src/page/jobSearch/searchPage.vue b/src/page/jobSearch/searchPage.vue index 365a44e..27f5908 100644 --- a/src/page/jobSearch/searchPage.vue +++ b/src/page/jobSearch/searchPage.vue @@ -148,12 +148,12 @@ value: '' }] getAlarmContentType('1').then(response => { - // const supportDeviceTypes = this.$store.getters.deviceTypes + const supportDeviceTypes = this.$store.getters.deviceTypes for (const item of response.data.list) { - // if (supportDeviceTypes.indexOf(item.deviceType) !== -1) { + if (supportDeviceTypes.indexOf(item.deviceType) !== -1) { this.alarmContentList.push(item) this.isLoading = false - // } + } } }) }, diff --git a/src/page/wellManage/WellManage.vue b/src/page/wellManage/WellManage.vue index 18aa947..649a393 100644 --- a/src/page/wellManage/WellManage.vue +++ b/src/page/wellManage/WellManage.vue @@ -219,7 +219,13 @@ // 获取窨井类型 fetchWellType() { getWellType(this.listQuery).then(response => { - this.wellTypeList = response.data + this.wellTypeList = [] + const wellTypes = this.$store.getters.wellTypes + for (const wellType of response.data) { + if (wellTypes.indexOf(wellType.value) !== -1) { + this.wellTypeList.push(wellType) + } + } this.wellTypeList.unshift({name:'全部',value:''}) }) } diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 019a5ec..b8ce2ac 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -6,7 +6,7 @@ const app = { state: { device: 'phone', - version: '1.0.3', + version: '1.0.4', kaptcha: '', publicKey: getPublicKey(), sid: '', diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 0d6d4cb..4acb4d6 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -127,6 +127,28 @@ }).catch(error => { reject(error) }) + getBizPerm().then(response => { + const data = response.data + if (data.wellTypes && data.wellTypes.length > 0) { // 验证返回的wellTypes是否是一个非空数组 + commit('SET_WELLTYPES', data.wellTypes) + } else { + reject('该用户不支持任何井类型') + } + if (data.deviceTypes && data.deviceTypes.length > 0) { + commit('SET_DEVICETYPES', data.deviceTypes) + } else { + reject('该用户不支持任何设备类型') + } + if (data.communications && data.communications.length > 0) { + commit('SET_COMMUNICATIONS', data.communications) + } else { + reject('该用户不支持任何通讯方式') + } + commit('SET_AREA', data.area) + resolve(response) + }).catch(error => { + reject(error) + }) }) },