fix()
parent
8aa407f7f2
commit
ba009f0da3
|
|
@ -219,7 +219,11 @@
|
|||
<div class="time">{{ imgHourstm[0] }} 至 {{ imgHourstm[1] }}</div>
|
||||
</div>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -229,7 +233,7 @@
|
|||
<p class="title">
|
||||
<span class="line"></span><span class="h4">雨情</span>
|
||||
</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
|
||||
v-model="value1"
|
||||
:localdata="timeList"
|
||||
|
|
@ -239,7 +243,11 @@
|
|||
</uni-data-select>
|
||||
</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
|
||||
:chartData="chartData.chartData"
|
||||
:echartsApp="true"
|
||||
|
|
@ -252,7 +260,7 @@
|
|||
<p class="title">
|
||||
<span class="line"></span><span class="h4">水情</span>
|
||||
</p>
|
||||
<div class="time" style="width:50%; color: #000">
|
||||
<div class="time" style="width: 50%; color: #000">
|
||||
<u-subsection
|
||||
:list="subList"
|
||||
:current="current"
|
||||
|
|
@ -312,7 +320,7 @@ const dataType = {
|
|||
Tuesday: '星期二',
|
||||
Wednesday: '星期三',
|
||||
Thursday: '星期四',
|
||||
Thursday: '星期五',
|
||||
Friday: '星期五',
|
||||
Saturday: '星期六',
|
||||
Sunday: '星期天'
|
||||
}
|
||||
|
|
@ -507,16 +515,26 @@ export default {
|
|||
let tms = null,
|
||||
mm = null
|
||||
let h1 = Number(h) - 1
|
||||
if (h1 < 9) {
|
||||
h1 = Number(h) - 3
|
||||
}
|
||||
if (h1 < 10) {
|
||||
h1 = `0${h1}`
|
||||
}
|
||||
if (m > 30) {
|
||||
tms = `${this.imgtm}${h1}30`
|
||||
h1 = Number(h) - 1
|
||||
tms = `${this.imgtm}${h}30`
|
||||
mm = '30'
|
||||
} else if (m < 10) {
|
||||
tms = `${this.imgtm}${h1}00`
|
||||
tms = `${this.imgtm}${h1}`
|
||||
mm = '00'
|
||||
} else {
|
||||
tms = `${this.imgtm}${h1}30`
|
||||
mm = '30'
|
||||
}
|
||||
|
||||
console.log('ddddd', h, h1)
|
||||
console.log('ddddd', tms)
|
||||
uni.request({
|
||||
url: 'https://shqxjs.cloudowr.cn/service/radar/rainimg',
|
||||
data: {
|
||||
|
|
@ -529,8 +547,8 @@ export default {
|
|||
let m = moment().format('MM月DD日')
|
||||
|
||||
console.log('am222', this.imgHoursList)
|
||||
|
||||
this.imgHourstm = [`${m}${h1}时${mm}分`, `${m}${h1 + 2}时${mm}分`]
|
||||
let m1 = Number(h1) + 2
|
||||
this.imgHourstm = [`${m}${h1}时${mm}分`, `${m}${m1}时${mm}分`]
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -787,15 +805,15 @@ export default {
|
|||
this.getOverview()
|
||||
this.getDataTime()
|
||||
this.getResponseLevel()
|
||||
this.getImgs()
|
||||
this.getHoursImg()
|
||||
this.getInterval()
|
||||
},
|
||||
|
||||
onShow () {
|
||||
this.getReadStatus()
|
||||
if (this.limit == 1) {
|
||||
this.getYjRead()
|
||||
this.getInterval()
|
||||
this.getImgs()
|
||||
this.getHoursImg()
|
||||
}
|
||||
},
|
||||
onUnload () {
|
||||
|
|
|
|||
|
|
@ -1,178 +1,192 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<div class="img">
|
||||
<image style="width: 100%; height: 100%" src="../../static/images/u8.png" mode="scaleToFill"></image>
|
||||
</div>
|
||||
<uni-forms :modelValue="formData" class="form">
|
||||
<uni-forms-item>
|
||||
<uni-easyinput type="text" v-model="formData.username" placeholder="请输入用户名" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item>
|
||||
<uni-easyinput 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>
|
||||
<view class="container">
|
||||
<div class="img">
|
||||
<image
|
||||
style="width: 100%; height: 100%"
|
||||
src="../../static/images/u8.png"
|
||||
mode="scaleToFill"
|
||||
></image>
|
||||
</div>
|
||||
<uni-forms :modelValue="formData" class="form">
|
||||
<uni-forms-item>
|
||||
<uni-easyinput
|
||||
type="text"
|
||||
v-model="formData.username"
|
||||
placeholder="请输入用户名"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item>
|
||||
<uni-easyinput
|
||||
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>
|
||||
|
||||
<script>
|
||||
import CryptoJS from 'crypto-js'
|
||||
|
||||
let checked = false
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
username: '',
|
||||
password: '',
|
||||
checked: false,
|
||||
},
|
||||
import CryptoJS from 'crypto-js'
|
||||
|
||||
}
|
||||
},
|
||||
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) => {
|
||||
const encryptedData = CryptoJS.MD5(data).toString()
|
||||
return encryptedData
|
||||
}
|
||||
|
||||
//创建提交表单
|
||||
let postForm = {
|
||||
loginName: formData.username,
|
||||
secretKey: encryptData(formData.password),
|
||||
}
|
||||
let checked = false
|
||||
|
||||
//记住密码功能
|
||||
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 = ''
|
||||
}
|
||||
|
||||
//提交表单
|
||||
|
||||
uni.$http.post('/gunshiApp/xfflood/doLogin',postForm).then(res=>{
|
||||
uni.showLoading({title:'努力登录中...', mask:true});
|
||||
|
||||
if (res.data.code === 200) {
|
||||
|
||||
//localStorage保存token
|
||||
if (res.data.data){
|
||||
uni.setStorageSync('Gs-Token', res.data.data)
|
||||
uni.$http.get('/gunshiApp/xfflood/getLoginInfo').then(res=>{
|
||||
console.log("sss",res.data.data);
|
||||
uni.setStorageSync('value', res.data.data)
|
||||
console.log('-----value------',res.data.data);
|
||||
})
|
||||
|
||||
//获取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')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//登录成功后跳转界面
|
||||
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()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
username: '',
|
||||
password: '',
|
||||
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 => {
|
||||
const encryptedData = CryptoJS.MD5(data).toString()
|
||||
return encryptedData
|
||||
}
|
||||
|
||||
//创建提交表单
|
||||
let postForm = {
|
||||
loginName: formData.username,
|
||||
secretKey: encryptData(formData.password)
|
||||
}
|
||||
|
||||
//记住密码功能
|
||||
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 = ''
|
||||
}
|
||||
|
||||
//提交表单
|
||||
|
||||
uni.$http.post('/gunshiApp/xfflood/doLogin', postForm).then(res => {
|
||||
uni.showLoading({ title: '努力登录中...', mask: true })
|
||||
|
||||
if (res.data.code === 200) {
|
||||
//localStorage保存token
|
||||
if (res.data.data) {
|
||||
uni.setStorageSync('Gs-Token', res.data.data)
|
||||
uni.$http.get('/gunshiApp/xfflood/getLoginInfo').then(res => {
|
||||
console.log('sss', res.data.data)
|
||||
uni.setStorageSync('value', res.data.data)
|
||||
console.log('-----value------', res.data.data)
|
||||
})
|
||||
|
||||
//获取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')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//登录成功后跳转界面
|
||||
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>
|
||||
|
||||
<style>
|
||||
.container{
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
align-items: center;
|
||||
background-color: #f3f5f8;
|
||||
}
|
||||
.img{
|
||||
width: 100vw;
|
||||
height: 50vh;
|
||||
margin-top: 5vh;
|
||||
/* background-color: red; */
|
||||
|
||||
}
|
||||
.form{
|
||||
margin-top: 4vh;
|
||||
width: 80%;
|
||||
height: 8vh;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.button{
|
||||
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
align-items: center;
|
||||
background-color: #f3f5f8;
|
||||
}
|
||||
.img {
|
||||
width: 100vw;
|
||||
height: 50vh;
|
||||
margin-top: 5vh;
|
||||
/* background-color: red; */
|
||||
}
|
||||
.form {
|
||||
margin-top: 4vh;
|
||||
width: 80%;
|
||||
height: 8vh;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.button {
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@
|
|||
<u--form
|
||||
labelPosition="left"
|
||||
:model="formList"
|
||||
ref="form2"
|
||||
labelWidth="150"
|
||||
ref="form3"
|
||||
labelWidth="100"
|
||||
v-if="key == 3"
|
||||
>
|
||||
<u-form-item
|
||||
|
|
@ -57,8 +57,11 @@
|
|||
<u-form-item
|
||||
label="灾害发生地点"
|
||||
prop="address"
|
||||
@click="toMap"
|
||||
:borderBottom="false"
|
||||
@click="
|
||||
isMap = true
|
||||
hideKeyboard()
|
||||
"
|
||||
ref="item1"
|
||||
>
|
||||
<u--input
|
||||
|
|
@ -408,7 +411,7 @@ export default {
|
|||
name: '否'
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
rules2: {
|
||||
otime: [
|
||||
{
|
||||
type: 'string',
|
||||
|
|
@ -429,7 +432,7 @@ export default {
|
|||
{
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择灾害发生点',
|
||||
message: '请选择',
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
]
|
||||
|
|
@ -447,7 +450,7 @@ export default {
|
|||
onReady () {
|
||||
console.log('搜索框22key', this.key)
|
||||
// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
|
||||
this.$refs.form2.setRules(this.rules)
|
||||
this.$refs.form3.setRules(this.rules2)
|
||||
},
|
||||
methods: {
|
||||
back (lnglat, address) {
|
||||
|
|
@ -456,6 +459,7 @@ export default {
|
|||
this.formList.lgtd = lnglat[0]
|
||||
this.formList.lttd = lnglat[1]
|
||||
this.formList.address = address
|
||||
this.$refs.form3.validateField('address')
|
||||
},
|
||||
toMap () {
|
||||
this.isMap = true
|
||||
|
|
@ -577,25 +581,26 @@ export default {
|
|||
open () {},
|
||||
|
||||
navigateBack () {
|
||||
uni.navigateBack()
|
||||
uni.reLaunch({
|
||||
url: '/pages/xxsb/index'
|
||||
})
|
||||
},
|
||||
|
||||
severitySelect (e) {
|
||||
console.log('severitySelect0', e)
|
||||
this.formList.severity = e.name
|
||||
this.$refs.form2.validateField('severity')
|
||||
this.$refs.form3.validateField('severity')
|
||||
},
|
||||
controlledSelect (e) {
|
||||
this.formList.isControlled = e.name
|
||||
this.$refs.form2.validateField('isControlled')
|
||||
this.$refs.form3.validateField('isControlled')
|
||||
},
|
||||
|
||||
submit () {
|
||||
this.$refs.form2
|
||||
this.$refs.form3
|
||||
.validate()
|
||||
.then(res => {
|
||||
uni.$u.toast('校验通过', res)
|
||||
debugger
|
||||
let params = Object.assign(this.formList)
|
||||
// 严重程度(1一般险情 2较大险情 3重大险情 4特别重大险情
|
||||
if (this.formList.severity == '一般险情') {
|
||||
|
|
@ -635,11 +640,11 @@ export default {
|
|||
// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
|
||||
},
|
||||
reset () {
|
||||
const validateList = ['projectName', 'radiovalue1']
|
||||
this.$refs.form1.resetFields()
|
||||
this.$refs.form1.clearValidate()
|
||||
const validateList = ['otime', 'severity', 'address']
|
||||
this.$refs.form3.resetFields()
|
||||
this.$refs.form3.clearValidate()
|
||||
setTimeout(() => {
|
||||
this.$refs.form1.clearValidate(validateList)
|
||||
this.$refs.form3.clearValidate(validateList)
|
||||
// 或者使用 this.$refs.form1.clearValidate()
|
||||
}, 10)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -504,7 +504,9 @@ export default {
|
|||
|
||||
open () {},
|
||||
navigateBack () {
|
||||
uni.navigateBack()
|
||||
uni.reLaunch({
|
||||
url: '/pages/xxsb/index'
|
||||
})
|
||||
},
|
||||
// 是否发电
|
||||
sexSelect (e) {
|
||||
|
|
@ -539,14 +541,14 @@ export default {
|
|||
params.isPowerGeneration = params.isPowerGeneration == '是' ? 1 : 0
|
||||
params.isFloodRelease = params.isFloodRelease == '是' ? 1 : 0
|
||||
|
||||
console.log('参数', params)
|
||||
|
||||
if (this.fileList1.length > 0) {
|
||||
params.fileId = this.fileList1.map(item => {
|
||||
params.fileIds = this.fileList1.map(item => {
|
||||
return JSON.parse(item.url).data.fileId
|
||||
})
|
||||
} else {
|
||||
params.fileIds = []
|
||||
}
|
||||
|
||||
console.log('参数', params)
|
||||
uni.$http
|
||||
.post('/gunshiApp/xfflood/xfProjectRun/insert', params)
|
||||
.then(res => {
|
||||
|
|
@ -559,10 +561,10 @@ export default {
|
|||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.model1.isPowerGeneration =
|
||||
params.isPowerGeneration == 1 ? '是' : '否'
|
||||
this.model1.isFloodRelease =
|
||||
params.isPowerGeneration == 1 ? '是' : '否'
|
||||
// this.model1.isPowerGeneration =
|
||||
// params.isPowerGeneration == 1 ? '是' : '否'
|
||||
// this.model1.isFloodRelease =
|
||||
// params.isPowerGeneration == 1 ? '是' : '否'
|
||||
})
|
||||
})
|
||||
.catch(errors => {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view>
|
||||
<view class="page-section page-section-gap">
|
||||
<map
|
||||
style="width: 100%; height: 450px"
|
||||
style="width: 100%; height: 300px; flex: 1"
|
||||
id="container"
|
||||
:latitude="lnglat[1]"
|
||||
:longitude="lnglat[0]"
|
||||
|
|
|
|||
Loading…
Reference in New Issue