master
张林 2024-06-24 09:56:50 +08:00
parent 8aa407f7f2
commit ba009f0da3
5 changed files with 244 additions and 205 deletions

View File

@ -219,7 +219,11 @@
<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="imgHoursList.url" mode="aspectFit"></image> <image
v-if="imgHoursList"
:src="imgHoursList.url"
mode="aspectFit"
></image>
</div> </div>
</view> </view>
</view> </view>
@ -229,7 +233,7 @@
<p class="title"> <p class="title">
<span class="line"></span><span class="h4">雨情</span> <span class="line"></span><span class="h4">雨情</span>
</p> </p>
<div class="time" style="width:50%; color: #000" v-if="timeList"> <div class="time" style="width: 50%; color: #000" v-if="timeList">
<uni-data-select <uni-data-select
v-model="value1" v-model="value1"
:localdata="timeList" :localdata="timeList"
@ -239,7 +243,11 @@
</uni-data-select> </uni-data-select>
</div> </div>
</div> </div>
<div class="info_icon" style="height: 260px; width: 100%" v-if="chartData.chartData"> <div
class="info_icon"
style="height: 260px; width: 100%"
v-if="chartData.chartData"
>
<qiun-data-charts <qiun-data-charts
:chartData="chartData.chartData" :chartData="chartData.chartData"
:echartsApp="true" :echartsApp="true"
@ -252,7 +260,7 @@
<p class="title"> <p class="title">
<span class="line"></span><span class="h4">水情</span> <span class="line"></span><span class="h4">水情</span>
</p> </p>
<div class="time" style="width:50%; color: #000"> <div class="time" style="width: 50%; color: #000">
<u-subsection <u-subsection
:list="subList" :list="subList"
:current="current" :current="current"
@ -312,7 +320,7 @@ const dataType = {
Tuesday: '星期二', Tuesday: '星期二',
Wednesday: '星期三', Wednesday: '星期三',
Thursday: '星期四', Thursday: '星期四',
Thursday: '星期五', Friday: '星期五',
Saturday: '星期六', Saturday: '星期六',
Sunday: '星期天' Sunday: '星期天'
} }
@ -507,16 +515,26 @@ export default {
let tms = null, let tms = null,
mm = null mm = null
let h1 = Number(h) - 1 let h1 = Number(h) - 1
if (h1 < 9) {
h1 = Number(h) - 3
}
if (h1 < 10) {
h1 = `0${h1}`
}
if (m > 30) { if (m > 30) {
tms = `${this.imgtm}${h1}30` h1 = Number(h) - 1
tms = `${this.imgtm}${h}30`
mm = '30' mm = '30'
} else if (m < 10) { } else if (m < 10) {
tms = `${this.imgtm}${h1}00` tms = `${this.imgtm}${h1}`
mm = '00' mm = '00'
} else { } else {
tms = `${this.imgtm}${h1}30` tms = `${this.imgtm}${h1}30`
mm = '30' mm = '30'
} }
console.log('ddddd', h, h1)
console.log('ddddd', tms)
uni.request({ uni.request({
url: 'https://shqxjs.cloudowr.cn/service/radar/rainimg', url: 'https://shqxjs.cloudowr.cn/service/radar/rainimg',
data: { data: {
@ -529,8 +547,8 @@ export default {
let m = moment().format('MM月DD日') let m = moment().format('MM月DD日')
console.log('am222', this.imgHoursList) console.log('am222', this.imgHoursList)
let m1 = Number(h1) + 2
this.imgHourstm = [`${m}${h1}${mm}`, `${m}${h1 + 2}${mm}`] this.imgHourstm = [`${m}${h1}${mm}`, `${m}${m1}${mm}`]
} }
}) })
}, },
@ -787,15 +805,15 @@ export default {
this.getOverview() this.getOverview()
this.getDataTime() this.getDataTime()
this.getResponseLevel() this.getResponseLevel()
this.getImgs()
this.getHoursImg()
this.getInterval()
}, },
onShow () { onShow () {
this.getReadStatus() this.getReadStatus()
if (this.limit == 1) { if (this.limit == 1) {
this.getYjRead() this.getYjRead()
this.getInterval()
this.getImgs()
this.getHoursImg()
} }
}, },
onUnload () { onUnload () {

View File

@ -1,178 +1,192 @@
<template> <template>
<view class="container"> <view class="container">
<div class="img"> <div class="img">
<image style="width: 100%; height: 100%" src="../../static/images/u8.png" mode="scaleToFill"></image> <image
</div> style="width: 100%; height: 100%"
<uni-forms :modelValue="formData" class="form"> src="../../static/images/u8.png"
<uni-forms-item> mode="scaleToFill"
<uni-easyinput type="text" v-model="formData.username" placeholder="请输入用户名" /> ></image>
</uni-forms-item> </div>
<uni-forms-item> <uni-forms :modelValue="formData" class="form">
<uni-easyinput type="password" v-model="formData.password" placeholder="请输入密码" /> <uni-forms-item>
</uni-forms-item> <uni-easyinput
<uni-forms-item> type="text"
<checkbox :checked="false" @click="handleChange(formData)" /><text>记住用户名和密码</text> v-model="formData.username"
</uni-forms-item> placeholder="请输入用户名"
<!-- <button type="primary" class="button" @click="xian"></button> --> />
<!-- <button type="primary" class="button" @click="xiang"></button> --> </uni-forms-item>
<button type="primary" class="button" @click="login(formData)"></button> <uni-forms-item>
</uni-forms> <uni-easyinput
</view> type="password"
v-model="formData.password"
placeholder="请输入密码"
/>
</uni-forms-item>
<uni-forms-item>
<checkbox :checked="false" @click="handleChange(formData)" /><text
>记住用户名和密码</text
>
</uni-forms-item>
<!-- <button type="primary" class="button" @click="xian"></button> -->
<!-- <button type="primary" class="button" @click="xiang"></button> -->
<button type="primary" class="button" @click="login(formData)">
登录
</button>
</uni-forms>
</view>
</template> </template>
<script> <script>
import CryptoJS from 'crypto-js' import CryptoJS from 'crypto-js'
let checked = false let checked = false
export default { export default {
data() { data () {
return { return {
formData: { formData: {
username: '', username: '',
password: '', password: '',
checked: false, checked: false
}, }
}
},
methods: {
handleChange (formData) {
checked = !checked
formData.checked = !formData.checked
},
xian () {
this.formData = {
username: 'cwz',
password: '12345678a',
checked: false
}
},
xiang () {
this.formData = {
username: 'mdx',
password: '1234567a',
checked: false
}
},
login (formData) {
//loading
// uni.showLoading({title:'...', mask:true});
} //MD5
}, const encryptData = data => {
methods: { const encryptedData = CryptoJS.MD5(data).toString()
return encryptedData
}
handleChange(formData){ //
checked = !checked let postForm = {
formData.checked = !formData.checked loginName: formData.username,
}, secretKey: encryptData(formData.password)
xian() { }
this.formData = {
username: 'cwz',
password: '12345678a',
checked: false,
}
},
xiang() {
this.formData = {
username: 'mdx',
password: '1234567a',
checked: false,
}
},
login(formData){
//loading //
// uni.showLoading({title:'...', mask:true}); if (formData.checked === true) {
uni.setStorageSync('loginName', postForm.loginName)
uni.setStorageSync('secretKey', postForm.secretKey)
} else {
// uni.removeStorageSync('loginName')
// uni.removeStorageSync('secretKey')
// this.formData.username = ''
// this.formData.password = ''
}
//MD5 //
const encryptData = (data) => {
const encryptedData = CryptoJS.MD5(data).toString()
return encryptedData
}
// uni.$http.post('/gunshiApp/xfflood/doLogin', postForm).then(res => {
let postForm = { uni.showLoading({ title: '努力登录中...', mask: true })
loginName: formData.username,
secretKey: encryptData(formData.password),
}
// if (res.data.code === 200) {
if (formData.checked === true){ //localStoragetoken
uni.setStorageSync('loginName',postForm.loginName) if (res.data.data) {
uni.setStorageSync('secretKey',postForm.secretKey) uni.setStorageSync('Gs-Token', res.data.data)
} else { uni.$http.get('/gunshiApp/xfflood/getLoginInfo').then(res => {
// uni.removeStorageSync('loginName') console.log('sss', res.data.data)
// uni.removeStorageSync('secretKey') uni.setStorageSync('value', res.data.data)
// this.formData.username = '' console.log('-----value------', res.data.data)
// this.formData.password = '' })
}
// //userId
uni.$http
.get('/gunshiApp/xfflood/my/info/getByUserId')
.then(res => {
console.log('-----avatar1------', res.data)
if (res.data.data) {
let url =
'/gunshiApp/xfflood/bzProjectManipulationRecord/file/get/'
url = url + res.data.data.fileId
uni.$http.get(url).then(res => {
uni.setStorageSync(
'avatar',
'http://223.75.53.141:9102/test.by-lyf.tmp' +
res.data.data.filePath
)
console.log(
'-----avatar------',
uni.getStorageSync('avatar')
)
})
} else {
uni.setStorageSync('avatar', '../../static/tabs/touxiang.png')
}
})
}
uni.$http.post('/gunshiApp/xfflood/doLogin',postForm).then(res=>{ //
uni.showLoading({title:'努力登录中...', mask:true}); setTimeout(function () {
uni.hideLoading()
if (res.data.code === 200) { uni.reLaunch({
url: '/pages/homeIndex/index'
//localStoragetoken })
if (res.data.data){ }, 1000)
uni.setStorageSync('Gs-Token', res.data.data) clearTimeout()
uni.$http.get('/gunshiApp/xfflood/getLoginInfo').then(res=>{ } else if (res.data.code === 400) {
console.log("sss",res.data.data); //
uni.setStorageSync('value', res.data.data) setTimeout(function () {
console.log('-----value------',res.data.data); uni.hideLoading()
}) uni.showToast({
title: res.data.description,
//userId icon: 'none',
uni.$http.get('/gunshiApp/xfflood/my/info/getByUserId').then(res=>{ duration: 2000
console.log('-----avatar1------',res.data); })
if (res.data.data) { }, 1000)
let url = '/gunshiApp/xfflood/bzProjectManipulationRecord/file/get/' clearTimeout()
url = url + res.data.data.fileId }
uni.$http.get(url).then(res=>{ })
uni.setStorageSync('avatar','http://223.75.53.141:9102/test.by-lyf.tmp'+res.data.data.filePath) }
console.log('-----avatar------',uni.getStorageSync('avatar')); }
}) }
} else {
uni.setStorageSync('avatar','../../static/tabs/touxiang.png')
}
})
}
//
setTimeout(
function(){
uni.hideLoading()
uni.reLaunch({
url: '/pages/homeIndex/index'
})
}
,1000)
clearTimeout()
} else if (res.data.code === 400) {
//
setTimeout(
function(){
uni.hideLoading()
uni.showToast({
title:res.data.description,
icon: 'none',
duration: 2000
})
}
,1000)
clearTimeout()
}
})
}
}
}
</script> </script>
<style> <style>
.container{ .container {
display: flex; display: flex;
flex: 1; flex: 1;
flex-direction: column; flex-direction: column;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
align-items: center; align-items: center;
background-color: #f3f5f8; background-color: #f3f5f8;
} }
.img{ .img {
width: 100vw; width: 100vw;
height: 50vh; height: 50vh;
margin-top: 5vh; margin-top: 5vh;
/* background-color: red; */ /* background-color: red; */
}
} .form {
.form{ margin-top: 4vh;
margin-top: 4vh; width: 80%;
width: 80%; height: 8vh;
height: 8vh; align-items: center;
align-items: center; justify-content: center;
justify-content: center; }
} .button {
.button{ }
}
</style> </style>

View File

@ -15,8 +15,8 @@
<u--form <u--form
labelPosition="left" labelPosition="left"
:model="formList" :model="formList"
ref="form2" ref="form3"
labelWidth="150" labelWidth="100"
v-if="key == 3" v-if="key == 3"
> >
<u-form-item <u-form-item
@ -57,8 +57,11 @@
<u-form-item <u-form-item
label="灾害发生地点" label="灾害发生地点"
prop="address" prop="address"
@click="toMap"
:borderBottom="false" :borderBottom="false"
@click="
isMap = true
hideKeyboard()
"
ref="item1" ref="item1"
> >
<u--input <u--input
@ -408,7 +411,7 @@ export default {
name: '否' name: '否'
} }
], ],
rules: { rules2: {
otime: [ otime: [
{ {
type: 'string', type: 'string',
@ -429,7 +432,7 @@ export default {
{ {
type: 'string', type: 'string',
required: true, required: true,
message: '请选择灾害发生点', message: '请选择',
trigger: ['blur', 'change'] trigger: ['blur', 'change']
} }
] ]
@ -447,7 +450,7 @@ export default {
onReady () { onReady () {
console.log('搜索框22key', this.key) console.log('搜索框22key', this.key)
// setRules // setRules
this.$refs.form2.setRules(this.rules) this.$refs.form3.setRules(this.rules2)
}, },
methods: { methods: {
back (lnglat, address) { back (lnglat, address) {
@ -456,6 +459,7 @@ export default {
this.formList.lgtd = lnglat[0] this.formList.lgtd = lnglat[0]
this.formList.lttd = lnglat[1] this.formList.lttd = lnglat[1]
this.formList.address = address this.formList.address = address
this.$refs.form3.validateField('address')
}, },
toMap () { toMap () {
this.isMap = true this.isMap = true
@ -577,25 +581,26 @@ export default {
open () {}, open () {},
navigateBack () { navigateBack () {
uni.navigateBack() uni.reLaunch({
url: '/pages/xxsb/index'
})
}, },
severitySelect (e) { severitySelect (e) {
console.log('severitySelect0', e) console.log('severitySelect0', e)
this.formList.severity = e.name this.formList.severity = e.name
this.$refs.form2.validateField('severity') this.$refs.form3.validateField('severity')
}, },
controlledSelect (e) { controlledSelect (e) {
this.formList.isControlled = e.name this.formList.isControlled = e.name
this.$refs.form2.validateField('isControlled') this.$refs.form3.validateField('isControlled')
}, },
submit () { submit () {
this.$refs.form2 this.$refs.form3
.validate() .validate()
.then(res => { .then(res => {
uni.$u.toast('校验通过', res) uni.$u.toast('校验通过', res)
debugger
let params = Object.assign(this.formList) let params = Object.assign(this.formList)
// 1 2 3 4 // 1 2 3 4
if (this.formList.severity == '一般险情') { if (this.formList.severity == '一般险情') {
@ -635,11 +640,11 @@ export default {
// catchthentrue // catchthentrue
}, },
reset () { reset () {
const validateList = ['projectName', 'radiovalue1'] const validateList = ['otime', 'severity', 'address']
this.$refs.form1.resetFields() this.$refs.form3.resetFields()
this.$refs.form1.clearValidate() this.$refs.form3.clearValidate()
setTimeout(() => { setTimeout(() => {
this.$refs.form1.clearValidate(validateList) this.$refs.form3.clearValidate(validateList)
// 使 this.$refs.form1.clearValidate() // 使 this.$refs.form1.clearValidate()
}, 10) }, 10)
}, },

View File

@ -504,7 +504,9 @@ export default {
open () {}, open () {},
navigateBack () { navigateBack () {
uni.navigateBack() uni.reLaunch({
url: '/pages/xxsb/index'
})
}, },
// //
sexSelect (e) { sexSelect (e) {
@ -539,14 +541,14 @@ export default {
params.isPowerGeneration = params.isPowerGeneration == '是' ? 1 : 0 params.isPowerGeneration = params.isPowerGeneration == '是' ? 1 : 0
params.isFloodRelease = params.isFloodRelease == '是' ? 1 : 0 params.isFloodRelease = params.isFloodRelease == '是' ? 1 : 0
console.log('参数', params)
if (this.fileList1.length > 0) { if (this.fileList1.length > 0) {
params.fileId = this.fileList1.map(item => { params.fileIds = this.fileList1.map(item => {
return JSON.parse(item.url).data.fileId return JSON.parse(item.url).data.fileId
}) })
} else {
params.fileIds = []
} }
console.log('参数', params)
uni.$http uni.$http
.post('/gunshiApp/xfflood/xfProjectRun/insert', params) .post('/gunshiApp/xfflood/xfProjectRun/insert', params)
.then(res => { .then(res => {
@ -559,10 +561,10 @@ export default {
} }
}) })
.catch(e => { .catch(e => {
this.model1.isPowerGeneration = // this.model1.isPowerGeneration =
params.isPowerGeneration == 1 ? '是' : '否' // params.isPowerGeneration == 1 ? '' : ''
this.model1.isFloodRelease = // this.model1.isFloodRelease =
params.isPowerGeneration == 1 ? '是' : '否' // params.isPowerGeneration == 1 ? '' : ''
}) })
}) })
.catch(errors => { .catch(errors => {

View File

@ -2,7 +2,7 @@
<view> <view>
<view class="page-section page-section-gap"> <view class="page-section page-section-gap">
<map <map
style="width: 100%; height: 450px" style="width: 100%; height: 300px; flex: 1"
id="container" id="container"
:latitude="lnglat[1]" :latitude="lnglat[1]"
:longitude="lnglat[0]" :longitude="lnglat[0]"