fix: 上传、短临图片

master
张林 2024-06-19 14:15:15 +08:00
parent bc98aca1a2
commit ded3afbfbe
6 changed files with 153 additions and 41 deletions

View File

@ -219,7 +219,7 @@
<div class="time">{{ imgHourstm[0] }} {{ imgHourstm[1] }}</div> <div class="time">{{ imgHourstm[0] }} {{ imgHourstm[1] }}</div>
</div> </div>
<div class="imgs" style="height: 100%; text-align: center"> <div class="imgs" style="height: 100%; text-align: center">
<image :src="imgHours.url" mode="aspectFit"></image> <image :src="imgHoursList.url" mode="aspectFit"></image>
</div> </div>
</view> </view>
</view> </view>
@ -373,7 +373,9 @@ export default {
imgtm: moment().format('YYYYMMDD'), imgtm: moment().format('YYYYMMDD'),
imgData: [], imgData: [],
imgHours: '', imgHours: '',
imgHourstm: [] imgHourstm: [],
imgHoursList: {},
interval: null
} }
}, },
computed: { computed: {
@ -429,12 +431,12 @@ export default {
icon: '../../static/tabs/water2.png', icon: '../../static/tabs/water2.png',
url: '/pages/water/water' url: '/pages/water/water'
}, },
{ // {
value: '工情灾情', // value: '',
key: 3, // key: 3,
icon: '../../static/tabs/gongqing2.png', // icon: '../../static/tabs/gongqing2.png',
url: '/pages/gqzq/index' // url: '/pages/gqzq/index'
}, // },
{ {
value: '调令反馈', value: '调令反馈',
key: 5, key: 5,
@ -476,7 +478,9 @@ export default {
}, },
methods: { methods: {
async getImgs () { async getImgs () {
uni.request({ let h = moment().format('HH')
let m = moment().format('mm')
await uni.request({
url: 'http://223.75.53.124:8005/grb/rainimglist', url: 'http://223.75.53.124:8005/grb/rainimglist',
data: { data: {
tm: `${this.imgtm}08` tm: `${this.imgtm}08`
@ -484,18 +488,57 @@ export default {
success: res => { success: res => {
console.log(res.data.data) console.log(res.data.data)
this.imgList = res.data.data this.imgList = res.data.data
let h = moment().format('HH') - 1
let inx = restm(h)
this.imgHours = res.data.data.imgHours[inx] // let inx = restm(h)
let tm = moment().subtract(1, 'days').format('MM月DD日') // this.imgHours = res.data.data.imgHours[inx]
let tm = moment().add(1, 'days').format('MM月DD日')
let tm2 = moment().format('MM月DD日') let tm2 = moment().format('MM月DD日')
this.imgData = [`${tm}08时`, `${tm2}08时`] this.imgData = [`${tm2}08时`, `${tm}08时`]
this.imgHourstm = [`${tm2}${h}`, `${tm2}${h + 1}`] // this.imgHourstm = [`${tm2}${h + 1}`, `${tm2}${h + 2}`]
} }
}) })
}, },
async getHoursImg () {
let h = moment().format('HH')
let m = moment().format('mm')
console.log('hhh--', h, m)
let tms = null,
mm = null
let h1 = Number(h) - 1
if (m > 30) {
tms = `${this.imgtm}${h1}30`
mm = '30'
} else if (m < 10) {
tms = `${this.imgtm}${h1}00`
mm = '00'
} else {
tms = `${this.imgtm}${h1}30`
mm = '30'
}
uni.request({
url: 'https://shqxjs.cloudowr.cn/service/radar/rainimg',
data: {
tm: tms
},
success: res => {
console.log('000000', tms, res.data.data)
this.imgHoursList = res.data.data.img
let m = moment().format('MM月DD日')
console.log('am222', this.imgHoursList)
this.imgHourstm = [`${m}${h1}${mm}`, `${m}${h1 + 2}${mm}`]
}
})
},
async getInterval () {
this.interval = setInterval(() => {
this.getHoursImg()
}, 60 * 1000)
},
async getYjRead () { async getYjRead () {
try { try {
const { data } = await uni.$http.get( const { data } = await uni.$http.get(
@ -575,6 +618,7 @@ export default {
} }
) )
if (data.code == 200) { if (data.code == 200) {
console.log('rainChartData0,', data)
this.rainChartData = data.data this.rainChartData = data.data
} }
} catch (error) { } catch (error) {
@ -744,12 +788,19 @@ export default {
this.getDataTime() this.getDataTime()
this.getResponseLevel() this.getResponseLevel()
this.getImgs() this.getImgs()
this.getHoursImg()
this.getInterval()
}, },
onShow () { onShow () {
this.getReadStatus() this.getReadStatus()
if (this.limit == 1) { if (this.limit == 1) {
this.getYjRead() this.getYjRead()
} }
},
onUnload () {
clearInterval(this.interval)
this.interval = null
} }
} }
</script> </script>

View File

@ -51,3 +51,14 @@ export function restm (e) {
} }
return index return index
} }
export const adnmZhen = adcd => {
if (!adcd || !nameMap) {
return undefined
}
if (adcd.endsWith('000000000')) {
return undefined
} else if (adcd.endsWith('000000')) {
return nameMap[adcd]
}
return nameMap[`${adcd.substr(0, 9)}000000`]
}

View File

@ -333,6 +333,7 @@
<script> <script>
import moment from 'moment' import moment from 'moment'
import newmap from './map.vue' import newmap from './map.vue'
const adcd = uni.getStorageSync('value').adcd
export default { export default {
name: 'dsfrom', name: 'dsfrom',
components: { components: {
@ -341,6 +342,7 @@ export default {
data () { data () {
return { return {
isMap: false, isMap: false,
adcd,
showTextTypeTab: 1, showTextTypeTab: 1,
activeType: '', activeType: '',
valueTime2: Number(moment()), valueTime2: Number(moment()),
@ -438,6 +440,7 @@ export default {
onLoad (options) { onLoad (options) {
this.key = options.key this.key = options.key
console.log('搜索框22', options.key) console.log('搜索框22', options.key)
console.log('adcd', this.adcd)
this.getresList() this.getresList()
}, },
@ -607,7 +610,7 @@ export default {
} else if (this.formList.severity == '特别重大险情') { } else if (this.formList.severity == '特别重大险情') {
params.severity = 4 params.severity = 4
} }
params.adcd = '' // params.adcd = ''
if (this.fileList1.length > 0) { if (this.fileList1.length > 0) {
params.fileId = this.fileList1.map(item => { params.fileId = this.fileList1.map(item => {

View File

@ -268,6 +268,9 @@
</template> </template>
<script> <script>
import { adnmZhen } from '../utils/tool'
import { disType } from '../utils/dicType.js'
const adcd = uni.getStorageSync('value').adcd
export default { export default {
data () { data () {
return { return {
@ -276,6 +279,7 @@ export default {
isSk: true, isSk: true,
resList: [], resList: [],
key: '', key: '',
adcd,
title: { title: {
1: '运行情况上报', 1: '运行情况上报',
2: '工程险情上报', 2: '工程险情上报',
@ -366,7 +370,18 @@ export default {
let res = null let res = null
this.resList = [] this.resList = []
res = await uni.$http.get('/gunshiApp/xfflood/webi/resList') res = await uni.$http.get('/gunshiApp/xfflood/webi/resList')
this.resList = res.data.data.map(item => { // console.log('res', adcd.endsWith('000000000'))
console.log('res---', this.adcd)
let list = res.data.data.filter(item => {
if (this.adcd.endsWith('000000000')) {
return item
} else {
return item.adcd == this.adcd
}
})
console.log('listlist---', list)
this.resList = list.map(item => {
item.isShow = false item.isShow = false
return item return item
@ -376,8 +391,14 @@ export default {
async gethystList () { async gethystList () {
this.resList = [] this.resList = []
let res = await uni.$http.get('/gunshiApp/xfflood/webi/hystList') let res = await uni.$http.get('/gunshiApp/xfflood/webi/hystList')
console.log('res', res.data.data) let list = res.data.data.filter(item => {
this.resList = res.data.data.map(item => { if (this.adcd.endsWith('000000000')) {
return item
} else {
return item.adcd == this.adcd
}
})
this.resList = list.map(item => {
item.isShow = false item.isShow = false
item.resName = item.hystName item.resName = item.hystName
@ -482,12 +503,6 @@ export default {
}, },
open () {}, open () {},
groupChange (n) {
// console.log('groupChange', n);
},
radioChange (n) {
// console.log('radioChange', n);
},
navigateBack () { navigateBack () {
uni.navigateBack() uni.navigateBack()
}, },
@ -516,7 +531,6 @@ export default {
this.$refs.form1 this.$refs.form1
.validate() .validate()
.then(res => { .then(res => {
debugger
console.log('文件', this.fileId) console.log('文件', this.fileId)
let params = this.model1 let params = this.model1
@ -527,8 +541,10 @@ export default {
console.log('参数', params) console.log('参数', params)
if (this.fileId != '') { if (this.fileList1.length > 0) {
params.fileId = [this.fileId] params.fileId = this.fileList1.map(item => {
return JSON.parse(item.url).data.fileId
})
} }
uni.$http uni.$http
@ -537,11 +553,17 @@ export default {
console.log('this.model1---', res) console.log('this.model1---', res)
if (res.data.code == 200) { if (res.data.code == 200) {
console.log('this.model122', res.data) console.log('this.model122', res.data)
uni.reLaunch({ uni.navigateTo({
url: '/pages/xxsb/index' url: `./index`
}) })
} }
}) })
.catch(e => {
this.model1.isPowerGeneration =
params.isPowerGeneration == 1 ? '是' : '否'
this.model1.isFloodRelease =
params.isPowerGeneration == 1 ? '是' : '否'
})
}) })
.catch(errors => { .catch(errors => {
uni.$u.toast('校验失败', errors) uni.$u.toast('校验失败', errors)

View File

@ -36,7 +36,7 @@
</u-form-item> </u-form-item>
<u-form-item <u-form-item
label="严重程度" label="严重程度"
prop="severityList" prop="severity"
:borderBottom="false" :borderBottom="false"
@click=" @click="
isseverity = true isseverity = true
@ -155,7 +155,7 @@
<u-popup <u-popup
:show="isName" :show="isName"
@close="isName = false" @close="isName = false"
mode="right" mode="bottom"
@open="open" @open="open"
> >
<view style="padding: 30px 20px"> <view style="padding: 30px 20px">
@ -252,9 +252,11 @@
</template> </template>
<script> <script>
const adcd = uni.getStorageSync('value').adcd
export default { export default {
data () { data () {
return { return {
adcd,
showTextTypeTab: 1, showTextTypeTab: 1,
activeType: '', activeType: '',
isSk: true, isSk: true,
@ -321,6 +323,14 @@ export default {
message: '请选择工程名称', message: '请选择工程名称',
trigger: ['blur', 'change'] trigger: ['blur', 'change']
} }
],
severity: [
{
type: 'string',
required: true,
message: '请选择严重程度',
trigger: ['blur', 'change']
}
] ]
}, },
projectType: 1, projectType: 1,
@ -343,7 +353,14 @@ export default {
let res = null let res = null
this.resList = [] this.resList = []
res = await uni.$http.get('/gunshiApp/xfflood/webi/resList') res = await uni.$http.get('/gunshiApp/xfflood/webi/resList')
this.resList = res.data.data.map(item => { let list = res.data.data.filter(item => {
if (this.adcd.endsWith('000000000')) {
return item
} else {
return item.adcd == this.adcd
}
})
this.resList = list.map(item => {
item.isShow = false item.isShow = false
return item return item
@ -353,8 +370,15 @@ export default {
async gethystList () { async gethystList () {
this.resList = [] this.resList = []
let res = await uni.$http.get('/gunshiApp/xfflood/webi/hystList') let res = await uni.$http.get('/gunshiApp/xfflood/webi/hystList')
let list = res.data.data.filter(item => {
if (this.adcd.endsWith('000000000')) {
return item
} else {
return item.adcd == this.adcd
}
})
console.log('res', res.data.data) console.log('res', res.data.data)
this.resList = res.data.data.map(item => { this.resList = list.map(item => {
item.isShow = false item.isShow = false
item.resName = item.hystName item.resName = item.hystName

View File

@ -79,13 +79,14 @@ export default {
console.log('lnglatlnglat', self.lnglat, res) console.log('lnglatlnglat', self.lnglat, res)
console.log('地址', res.address) console.log('地址', res.address)
if (res.address) { if (res.address) {
console.log('地址', res.address.province) console.log('地址', res.address)
self.address = self.address = res.address.city
res.address.province + ? res.address.city
res.address.city + : '' + res.address.district
res.address.district + ? res.address.district
res.address.street + : '' + res.address.street
res.address.poiName ? res.address.street
: ''
console.log('地址', self.address) console.log('地址', self.address)
} }
} }