新增的功能

master
xielei 2024-11-07 10:49:42 +08:00
commit bb7b0d9ae7
13 changed files with 296 additions and 830 deletions

View File

@ -15,8 +15,6 @@
</div>
</div>
<div class="right">
<!-- <div>{{ monthDay }}</div>
<div>{{ dataType[dayOfWeek] }}</div> -->
<u-icon name="bell-fill" size="30" color="#fff" @click="todetailmessgae()">
</u-icon>
@ -26,7 +24,8 @@
<!-- nav -->
<view class="navBar" style="display: flex;flex-wrap: wrap;">
<div class="navList" v-for="(item, index) in getNavList" :key="index">
<div @click="myNavigateTo(item.url,item.value)" style="display:flex;flex-direction: column;align-items: center;">
<div @click="myNavigateTo(item.url,item.value)"
style="display:flex;flex-direction: column;align-items: center;">
<div class="navIcon">
<image style="width: 100%; height: 100%" :src="item.icon" mode="aspectFit"></image>
<div class="readStatus" v-show="
@ -39,22 +38,10 @@
</div>
</view>
<view class="warn">
<!-- <image
style="
width: 18rpx;
height: 22rpx;
margin-right: 16rpx;
vertical-align: middle;
"
src="../../static/tabs/ld.png"
mode="aspectFit"
></image
><span style="color: #000">当前防汛应急响应</span>
<span style="color: #59a7ff">{{ !level || !yjStatus ? '无' : level }}</span> -->
<sk-info />
</view>
<view class="warn" v-for="item in Ylzlist">
<ylz-list :item='item'/>
<view class="warn" v-for="item in Ylzlist" :key="item.stnm">
<ylz-list :item='item' />
</view>
<view class="info_24"
@ -66,30 +53,9 @@
</template>
<script>
const dataType = {
Monday: '星期一',
Tuesday: '星期二',
Wednesday: '星期三',
Thursday: '星期四',
Friday: '星期五',
Saturday: '星期六',
Sunday: '星期天'
}
import moment from 'moment'
import {
level
} from '../../pages/utils/dicType'
import {
disType
} from '../utils/dicType.js'
import drpOption from './chartOption.js'
import {
restm
} from '../utils/tool'
import SkInfo from '../skInfo/index.vue'
import YlzList from '../ylzList/index.vue'
export default {
components: {
SkInfo,
@ -97,99 +63,40 @@
},
data() {
return {
Ylzlist:[],
monthDay: '',
dayOfWeek: '',
dataType,
Ylzlist: [],
userList: uni.getStorageSync('value').data,
changeBool: false,
tableData: [],
loading: false,
list: {},
date: '',
ydate: '',
showTextTypeTab: 1,
tableData: {},
tm: '',
level: '',
yjStatus: 0,
// limit: disType(uni.getStorageSync('value').adcd),
limit: 1,
value1: 3,
rainChartData: [],
formData: {
stm: moment()
.subtract(1, 'days')
.startOf('day')
.set({
hour: 8,
minute: 0
}),
etm: moment().startOf('day').set({
hour: 8,
minute: 0
})
},
rainChartData: [],
chartData: {},
current: 0,
hdList: [],
skList: [],
readStatus: false, //
readYjStatus: false, //
dispatchStatus: false, //
default_src: uni.getStorageSync('avatar'),
imgList: {},
imgtm: moment().format('YYYYMMDD'),
imgData: [],
imgHours: '',
imgHourstm: [],
imgHoursList: {
url: ''
},
interval: null,
numPic: 0,
allStatus: false,
messagelist:[],
ylzList:[],
messagelist: [],
ylzList: [],
}
},
onPullDownRefresh() {
// this.getSwiperList()
this.getOverview()
this.getDataTime()
this.getResponseLevel()
this.getDispatchStatus()
this.getReadStatus()
if (this.limit == 1) {
this.getYjRead()
// this.getInterval()
this.getImgs()
this.getHoursImg()
}
setTimeout(function() {
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
},
computed: {
getNavList() {
return [
{
return [{
value: '巡查任务',
key: 1,
icon: '../../static/tabs/yujing_icon@2x2.png',
icon: '../../static/tabs/xcrw.png',
url: '/pages/xcrw/index'
},
{
value: '维修养护',
key: 2,
icon: '../../static/tabs/yujing_icon@2x2.png',
icon: '../../static/tabs/wxyh.png',
url: '/pages/wxyh/index'
},
{
value: '问题处理',
key: 3,
icon: '../../static/tabs/yujing_icon@2x2.png',
icon: '../../static/tabs/wtcl.png',
url: '/pages/wtcl/index'
},
{
@ -201,77 +108,39 @@
{
value: '视频监控',
key: 5,
icon: '../../static/tabs/yujing_icon@2x2.png',
icon: '../../static/tabs/spjk.png',
url: '/pages/spjk/index'
},
{
value: '生态流量监控',
key: 6,
icon: '../../static/tabs/yujing_icon@2x2.png',
icon: '../../static/tabs/stlljk.png',
url: '/pages/stlljk/index'
},
{
value: '安全监测',
key: 7,
icon: '../../static/tabs/yujing_icon@2x2.png',
icon: '../../static/tabs/aqjc.png',
url: '/pages/aqjc/index'
},
]
}
},
watch: {
rainChartData(newValue) {
this.chartData = {
...drpOption(newValue)
}
},
limit: {
handler(newValue) {
if (!newValue) {
this.getRainList()
}
},
immediate: true
},
current: {
handler(newValue) {
if (newValue == 0) {
this.getHdList()
} else {
this.getSkList()
}
},
immediate: true
},
allStatus: {
handler(newValue) {
const newArr = this.getNavList()
},
immediate: true
}
},
methods: {
getYlzList(){
getYlzList() {
uni.$http.post('/gunshiApp/xyt/stPptnRReal/list').then(res => {
if (res.data.code == 200) {
this.Ylzlist = res.data.data
}
})
},
getList() {
console.log(111);
uni.$http.post('/gunshiApp/xyt/messageCenter/list', {
start:'',
end:''
start: '',
end: ''
}).then(res => {
if (res.data.code == 200) {
this.messagelist = res.data.data
}
})
},
@ -280,176 +149,7 @@
url: '/pages/messageList/index'
})
},
async getImgs() {
let h = moment().format('HH')
let m = moment().format('mm')
uni.request({
url: 'http://223.75.53.124:8005/grb/latest',
success: res => {
const myTm = res.data.data.tm
if (myTm) {
uni.request({
url: 'http://223.75.53.124:8005/grb/rainimglist',
data: {
tm: moment(myTm).format('YYYYMMDDHH')
},
success: res => {
console.log(res.data.data)
this.imgList = res.data.data
// let inx = restm(h)
// this.imgHours = res.data.data.imgHours[inx]
let tm = moment().add(1, 'days').format('MM月DD日')
let tm2 = moment().format('MM月DD日')
this.imgData = [`${tm2}08时`, `${tm}08时`]
// this.imgHourstm = [`${tm2}${h + 1}`, `${tm2}${h + 2}`]
}
})
}
}
})
},
getTmData() {
let hn = this.numPic > 0 ? this.numPic : 1
let h = moment().subtract(hn, 'hours').format()
let m = moment().format('mm')
console.log('hhh--', h, m, this.numPic)
let tms = null,
mm = null
let h1 = Number(h) - 1
if (h1 < 9) {
h1 = Number(h) - this.numPic
}
if (h1 < 10) {
h1 = `0${h1}`
}
if (m > 30) {
h1 = Number(h) - 1
let m1 = h > 10 ? h : `0${h}`
tms = `${this.imgtm}${m1}30`
mm = '30'
} else if (m < 10) {
tms = `${this.imgtm}${h1}`
mm = '00'
} else {
tms = `${this.imgtm}${h1}30`
mm = '30'
}
},
async getHoursImg() {
let h = moment().format('HH')
let m = moment().format('mm')
console.log('hhh--', h, m, this.numPic)
let tms = null,
mm = null
let h1 = Number(h) - 1
if (h1 < 10) {
let t = Number(h1) - Number(this.numPic)
h1 = `0${t}`
}
if (m > 30) {
h1 = Number(h) - 1
let t3 = Number(h) - this.numPic
if (this.numPic <= 0) {
let m3 = h1 > 10 ? h1 : `0${h1}`
tms = `${this.imgtm}${m3}30`
} else {
t3 = t3 < 10 ? `0${t3}` : t3
tms = `${this.imgtm}${t3}30`
}
mm = '30'
} else if (m < 10) {
tms = `${this.imgtm}${h1}00`
mm = '00'
} else {
tms = `${this.imgtm}${h1}30`
mm = '30'
}
console.log('小时', h1)
console.log('需要参数', tms)
uni.request({
url: 'http://223.75.53.124:8005/radar/latest',
success: res => {
let tm = moment(res.data.data.tm);
let subfix = '?rainFile=' + res.data.data.rainFile;
let url =
`http://shqxjs.cloudowr.cn/yj_folder/rain/radar/${tm.format('YYYYMM')}/${tm.format('DD')}/${tm.format('YYYYMMDDHHmm')}+00.02.jpg${subfix}`;
console.log(222222222227, url)
console.log('pic---', tms, res.data.data)
this.imgHoursList = {
'url': url
}
let m = moment().format('MM月DD日')
console.log('am222', this.imgHoursList)
let m1 = Number(h1) + 2
this.imgHourstm = [`${m}${h1}${mm}`, `${m}${m1}${mm}`]
if (url == null) {
this.numPic++
setTimeout(() => {
this.getHoursImg()
}, 10 * 1000)
} else {
this.numPic = 0
return
}
}
})
},
// async getInterval () {
// this.interval = setInterval(() => {
// this.getHoursImg()
// }, 60 * 1000)
// },
async getYjRead() {
try {
const {
data
} = await uni.$http.get(
'/gunshiApp/xfflood/current/situation/flag'
)
if (data.code == 200) {
this.readYjStatus = data.data
}
} catch (error) {
uni.$showMsg()
}
},
async getReadStatus() {
try {
const {
data
} = await uni.$http.get(
'/gunshiApp/xfflood/xfProjectRun/has/read'
)
if (data.code == 200) {
this.readStatus = Object.values(data.data).some(item => item == true)
}
} catch (error) {
uni.$showMsg()
}
},
async getDispatchStatus() {
try {
const res = await uni.$http.post('/gunshiApp/xfflood/xfEmerDispatchR/app/list', {
status: 1,
dispatchTypeList: ["0", "1"]
})
if (res.data.code == 200) {
this.dispatchStatus = res.data.data.length > 0 ? true : false
}
} catch (error) {
console.log(error);
}
},
async setInsert(menu2) {
try {
const params = {
@ -458,287 +158,28 @@
menu1: '首页',
menu2: menu2 || '首页',
}
const {
data
} = await uni.$http.post('/gunshiApp/xfflood/visitMenuLog/insert', params)
console.log('用户行为', params, data)
} catch (error) {}
},
jumpHdDetail(params) {
uni.navigateTo({
url: `/pages/hdDetail/hdDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&wrz=${params.wrz}&grz=${params.grz}`
})
},
jumpSkDetail(params) {
uni.navigateTo({
url: `/pages/skDetail/skDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&afsltdz=${params.afsltdz}&flLowLimLev=${params.flLowLimLev}&desFloodLev=${params.desFloodLev}&calFloodLev=${params.calFloodLev}&resCode=${params.resCode}`
})
},
async getSkList() {
try {
const {
data
} = await uni.$http.post(
'/gunshiApp/xfflood/reservoir/water/list', {
sources: ['SW', 'SK'],
adcd: uni.getStorageSync('value').adcd
}
)
if (data.code == 200) {
this.skList = data.data
}
} catch (error) {
uni.$showMsg()
}
},
async getHdList() {
try {
const {
data
} = await uni.$http.post(
'/gunshiApp/xfflood/river/water/list', {
sources: ['SH', 'SW'],
adcd: uni.getStorageSync('value').adcd
}
)
if (data.code == 200) {
this.hdList = data.data
}
} catch (error) {
uni.$showMsg()
}
},
subChange(e) {
this.current = e
},
async getRainList() {
try {
const {
data
} = await uni.$http.post(
'/gunshiApp/xfflood/real/rain/home/list', {
start: this.formData.stm.format('YYYY-MM-DD HH:mm:ss'),
end: this.formData.etm.format('YYYY-MM-DD HH:00:00')
}
)
if (data.code == 200) {
console.log('rainChartData0,', data)
this.rainChartData = data.data
}
} catch (error) {
uni.$showMsg()
}
},
changeTime(params) {
let tmValue = []
if (params === 1) {
tmValue = [
moment()
.subtract(1, 'days')
.startOf('day')
.set({
hour: 8,
minute: 0
}),
moment()
]
} else if (params === 2) {
tmValue = [
moment().startOf('day').set({
hour: 8,
minute: 0
}),
moment()
]
} else if (params === 3) {
tmValue = [
moment()
.subtract(1, 'days')
.startOf('day')
.set({
hour: 8,
minute: 0
}),
moment().startOf('day').set({
hour: 8,
minute: 0
})
]
} else if (params === 4) {
tmValue = [moment().subtract(1, 'hours'), moment()]
} else if (params === 5) {
tmValue = [moment().subtract(3, 'hours'), moment()]
} else if (params === 6) {
tmValue = [moment().subtract(6, 'hours'), moment()]
} else if (params === 7) {
tmValue = [moment().subtract(12, 'hours'), moment()]
} else if (params === 8) {
tmValue = [moment().subtract(24, 'hours'), moment()]
}
this.formData.stm = tmValue[0]
this.formData.etm = tmValue[1]
this.getRainList()
},
todetail(val) {
console.log('val', val)
if (val == 1) {
uni.navigateTo({
url: '/pages/rain/index'
})
}
if (val == 3) {
uni.navigateTo({
url: '/pages/gqzq/index'
})
}
},
tabChange(val) {
this.showTextTypeTab = val
if (val == 1) {
this.getWeather()
} else {
this.getWeatherArea()
}
},
changeTable(val) {
this.changeBool = !this.changeBool
if (val) {
this.getWeather()
}
console.log('this.changeBool', this.changeBool)
},
// /weather/area
async getWeatherArea() {
try {
const res = await uni.$http.post('/gunshiApp/xfflood/weather/area', {
tm: this.tm
})
console.log('--44-', res)
this.tableData = res
// this.userList = res.data
// console.log('--333-', this.tableData)
} catch (e) {
uni.$showMsg()
}
},
// /weather/res
async getWeather() {
try {
const res = await uni.$http.post('/gunshiApp/xfflood/weather/res', {
tm: this.tm
})
console.log('--3-', res)
this.tableData = res
// this.userList = res.data
console.log('--333-', this.tableData)
} catch (e) {
uni.$showMsg()
}
},
async getSwiperList() {
try {
const res = await uni.$http.get('/gunshiApp/xfflood/getLoginInfo')
console.log('--1-', res.data)
this.userList = res.data
console.log('--1-', this.userList)
} catch (e) {
uni.$showMsg()
}
},
async getOverview() {
try {
let res = await uni.$http.get('/gunshiApp/xfflood/real/rain/overview')
console.log('--2-', res)
this.list = res.data
console.log('--2-', res)
} catch (e) {
uni.$showMsg()
}
},
getDataTime() {
this.monthDay = moment().format('MM月DD日')
this.dayOfWeek = moment().format('dddd')
this.date = moment().format('MM月DD日HH时')
this.ydate = moment().subtract(1, 'days').format('MM月DD日HH时')
console.log('moment11', this.date, this.ydate)
let d1 = moment().format('YYYYMMDD')
let h1 = moment().format('HH') >= 20 ? '20' : '08'
this.tm = d1 + h1
},
async getResponseLevel() {
try {
const {
data
} = await uni.$http.post(
'/gunshiApp/xfflood/xfEmerRespR/page', {
pageSo: {
pageSize: 10,
pageNumber: 1
},
year: moment().format('YYYY')
}
)
if (data.code == 200) {
if (data.data.records.length > 0) {
console.log('1111111data', data)
this.level = level(data.data.records[0].level)
this.yjStatus = data.data.records[0].status
} else {
this.level = '无'
}
}
} catch (e) {
uni.$showMsg()
}
},
myNavigateTo(url, menu2) {
uni.navigateTo({
url: url //
})
console.log(url);
this.setInsert(menu2)
}
//
},
onLoad() {
// this.getSwiperList()
this.getOverview()
this.getDataTime()
this.getResponseLevel()
this.getList()
this.getYlzList()
this.userList = uni.getStorageSync('value')
console.log(this.userList.userName, uni.getStorageSync('value'), '=============777777');
},
onShow() {
this.getReadStatus()
this.getResponseLevel()
this.getDispatchStatus()
this.setInsert()
// this.userList=uni.getStorageSync('value')
//
// console.log(this.userList.userName,uni.getStorageSync('value'),'=============777777');
if (this.limit == 1) {
this.getYjRead()
// this.getInterval()
this.getImgs()
this.getHoursImg()
}
}
// onUnload () {
// clearInterval(this.interval)
// this.interval = null
// }
}
</script>
@ -821,55 +262,11 @@
text-align: left;
margin-bottom: 12rpx;
}
/* 24小时 */
.chartChange {
text-align: center;
margin: 16rpx 0;
}
.chart_tit {
width: 129rpx;
height: 43rpx;
background: #d3e1ff;
border-radius: 20rpx;
color: #3380ff;
}
.chart_tit image {
margin-right: 10rpx;
width: 36rpx;
height: 30rpx;
}
.table_h {
display: flex;
text-align: center;
height: 24px;
/* position: absolute;
top: 0;
right: 0; */
}
/* info_24 */
.info_24 {
padding: 15px;
background-color: #fff;
margin-bottom: 12rpx;
}
.heart {
display: flex;
justify-content: space-between;
align-items: center;
}
.fl {
display: flex;
justify-content: space-between;
align-items: center;
}
.title .line {
border: 2px solid #3380ff;
border-radius: 3rpx;

View File

@ -26,11 +26,7 @@
<script>
import CryptoJS from 'crypto-js'
import {
onMounted
} from "vue"
let checked = false
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const imgUrl = uni.getStorageSync("imgUrl");
export default {
data() {
return {
@ -55,6 +51,19 @@
checked = !checked
formData.checked = !formData.checked
},
// async getImgFlow(avatar){
// if(!avatar) {
// uni.setStorageSync("avatar",'../../static/tabs/touxiang.png')
// return
// }
// try {
// const {data} = await uni.$http.get(`/gunshiApp/xyt/common/download/resource?resource=${avatar}`)
// const url = fileChange(data)
// uni.setStorageSync("avatar",url)
// } catch (error) {
// }
// },
login(formData) {
//loading
uni.showLoading({
@ -101,12 +110,8 @@
if (res.data.token) {
uni.setStorageSync('Gs-Token', res.data.token)
uni.$http.get('/gunshiApp/xyt/getInfo').then(res => {
// let avatarUrl = res.data.user.avatar ? url + res.data.user.avatar : '../../static/tabs/touxiang.png';
let avatarUrl = res.data.user.avatar ? url + '/gunshiApp/common/1/ResPlanB/微信图片_20240420225339_1723542338744.jpg' : '../../static/tabs/touxiang.png';
console.log("avatarUrl",avatarUrl);
// this.getImgFlow(res.data.user.avatar)
uni.setStorageSync('value', res.data.user)
uni.setStorageSync('avatar', avatarUrl)
setTimeout(function () {
uni.hideLoading()
uni.reLaunch({

View File

@ -2,12 +2,8 @@
<view class="container">
<view class="userInfo">
<div class="icon">
<image
class="image-left"
style="width: 100%; height: 100%"
:src="default_src"
mode="aspectFill"
></image>
<image class="image-left" style="width: 100%; height: 100%" :src="default_src" mode="aspectFill">
</image>
</div>
<div class="user">
<div class="username">{{this.userList.nickName}}</div>
@ -15,15 +11,11 @@
</div>
</view>
<view class="funcBar">
<div class="funcList" v-for="(item, index) in func" :key="index" >
<div class="funcList" v-for="(item, index) in func" :key="index">
<div @click="navigateToSubPage(index)">
<div class="funcIcon">
<image
class="icon-left"
style="width: 100%; height: 100%"
:src="item.img"
mode="aspectFit"
></image>
<image class="icon-left" style="width: 100%; height: 100%" :src="item.img" mode="aspectFit">
</image>
</div>
<div class="funcTxt">{{ item.name }}</div>
</div>
@ -67,9 +59,16 @@
</template>
<script>
const func = [
{img: '../../static/images/info.png', name: '个人信息', url:'/pages/personInfo/personInfo'},
{img: '../../static/images/password.png', name: '修改密码', url:'/pages/modifyPassword/modifyPassword'},
const func = [{
img: '../../static/images/info.png',
name: '个人信息',
url: '/pages/personInfo/personInfo'
},
{
img: '../../static/images/password.png',
name: '修改密码',
url: '/pages/modifyPassword/modifyPassword'
},
]
const xjxList = [
{img: '../../static/images/info.png', name: '巡查任务', url:'/pages/mypage/compents/xcrw/index'},
@ -80,24 +79,23 @@
data() {
return {
userList: uni.getStorageSync('value'),
username:'',
userresponse:'防汛办',
version:'011.14.23',
username: '',
userresponse: '防汛办',
version: '011.14.23',
func: func,
xjxList:xjxList,
default_src: uni.getStorageSync('avatar'),
}
},
methods: {
navigateToSubPage(index){
navigateToSubPage(index) {
uni.navigateTo({
url: xjxList[index].url,
animationType:'pop-in',
})
},
logout(){
if(uni.getStorageSync('loginChecked')===true){
logout() {
if (uni.getStorageSync('loginChecked') === true) {
uni.redirectTo({
url: '/pages/login/login'
})
@ -107,6 +105,7 @@
uni.removeStorageSync('Gs-Token')
uni.removeStorageSync('value')
uni.removeStorageSync('password')
uni.removeStorageSync('avatar')
uni.redirectTo({
url: '/pages/login/login'
})
@ -114,19 +113,20 @@
}
}
},
}
</script>
<style>
.container{
.container {
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
background-color: #f3f5f8;
}
.userInfo{
.userInfo {
border-radius: 5px;
display: flex;
flex-direction: row;
@ -139,7 +139,8 @@
background-color: #fff;
}
.icon{
.icon {
width: 50px;
height: 50px;
border-radius: 50%;
@ -149,22 +150,26 @@
color: #007afd;
line-height: 50px;
}
.image-left{
.image-left {
width: 80px;
height: 80px;
border-radius: 50%;
}
.user{
.user {
display: flex;
flex-direction: column;
margin-left: 6vw;
}
.username{
.username {
font-size: 20px;
font-weight: bold;
margin-bottom: 1vh;
}
.funcIcon{
.funcIcon {
width: 50px;
height: 50px;
margin-left: 4px;
@ -173,6 +178,7 @@
justify-content: center;
align-items: center;
}
.funcBar {
border-radius: 5px;
margin-bottom: 2vh;
@ -184,12 +190,14 @@
height: 15vh;
background-color: #fff;
}
.funcList {
text-align: center;
font-size: 14px;
margin: 2vw;
}
.version{
.version {
margin-left: 2vw;
border-radius: 5px;
display: flex;
@ -199,35 +207,42 @@
background-color: #fff;
}
.content{
.content {
display: flex;
flex-direction: row;
}
.left{
width:100px;
.left {
width: 100px;
text-align: start;
margin-left: 1vw;
line-height: 8vh;
}
.icon-left{
.icon-left {
align-items: center;
width: 30px;
/* background-color: red; */
}
.mid{
.mid {
flex: 1;
line-height: 8vh;
}
.right{
width:100px;
.right {
width: 100px;
text-align: end;
line-height: 8vh;
margin-right: 10px;
}
.null{
.null {
height: 45vh;
}
.button{
.button {
border-radius: 10px;
display: flex;
justify-content: center;
@ -238,6 +253,7 @@
color: white;
background-color: #007afd;
}
<<<<<<< HEAD
.xjxList{
display: flex;
flex-direction: column;
@ -246,3 +262,6 @@
height: 20vh;
}
</style>
=======
</style>
>>>>>>> 7aeb4aa5a071cd3d557c15ebc6cd5b0525da319b

View File

@ -80,6 +80,9 @@
'Authorization': 'Bearer ' + uni.getStorageSync('Gs-Token')
},
success: (res) => {
const imgUrl = JSON.parse(res.data).imgUrl;
this.getImgFlow(imgUrl)
// uni.setStorageSync("imgUrl",imgUrl)
uni.$showMsg("上传成功")
},
})
@ -93,6 +96,20 @@
}
});
},
getImgFlow(imgUrl) {
uni.request({
url: 'http://local.gunshiiot.com:18083' +
`/gunshiApp/xyt/common/download/resource?resource=${imgUrl}`,
responseType: 'arraybuffer',
success: (res) => {
// arraybufferBase64
let base64 = uni.arrayBufferToBase64(res.data);
const p = 'data:image/png;base64,' + base64;
uni.setStorageSync("avatar",p)
}
})
},
modifyValue(item) {
console.log(item);
@ -139,7 +156,6 @@
=await uni.$http.put('/gunshiApp/xyt/system/user/profile', new_userList);
if (data.code == 200) {
uni.setStorageSync('value', new_userList)
uni.setStorageSync('avatar', new_userList.avatar)
uni.reLaunch({
url: '/pages/mypage/mypage'
})

View File

@ -62,3 +62,22 @@ export const adnmZhen = adcd => {
}
return nameMap[`${adcd.substr(0, 9)}000000`]
}
export const fileChange = (file) => {
let target= ''
let blob = new Blob([file]);
console.log("blobblob",blob);
let url = window.URL.createObjectURL(blob);
// let reader = new FileReader(blob);
// console.log("reader",reader);
// reader.readAsDataURL(url);
// reader.onload = function (e) {
// target=e.target.result
// }
console.log("target",url);
return url
}

View File

@ -1,6 +1,6 @@
<template>
<view :style="{height:'100vh',overflow:'auto'}">
<u-navbar :title="123" :autoBack="true" :titleStyle="{
<u-navbar :title="stnm" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='40' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
@ -13,7 +13,7 @@
</view>
</view>
<view style="padding:10px" v-if="activeOne == 0">
<view class="time-ranger" >
<view class="time-ranger">
<view class="start-time">
<text>开始时间</text>
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{stm}}</text>
@ -37,60 +37,59 @@
<view v-if="activeOne == 1" style="padding:10px">
<Table></Table>
</view>
<u-datetime-picker
:show="showTime"
v-model="startTime"
mode="datetime"
@confirm="handleStartTime"
@cancel="showTime=false"
></u-datetime-picker>
<u-datetime-picker
:show="showTime1"
v-model="endTime"
mode="datetime"
@confirm="handleEndTime"
@cancel="showTime1=false"
></u-datetime-picker>
<u-datetime-picker :show="showTime" v-model="startTime" mode="datetime" @confirm="handleStartTime"
@cancel="showTime=false"></u-datetime-picker>
<u-datetime-picker :show="showTime1" v-model="endTime" mode="datetime" @confirm="handleEndTime"
@cancel="showTime1=false"></u-datetime-picker>
</view>
</template>
<script>
import moment from'moment';
import moment from 'moment';
import Table from "./tjsjTable.vue"
import YlzTable from "./jcTable.vue"
import drpOptions from './jcOptions'
const stm = moment().subtract(7, 'days').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
const etm = moment().set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
export default {
components:{
const stm = moment().subtract(7, 'days').set({
minute: 0,
second: 0
}).format("YYYY-MM-DD HH:mm");
const etm = moment().set({
minute: 0,
second: 0
}).format("YYYY-MM-DD HH:mm");
export default {
components: {
Table,
YlzTable
},
data() {
return {
startTime:stm,
endTime:etm,
startTime: stm,
endTime: etm,
stm,
etm,
showTime:false,
showTime1:false,
activeOne:0,
ylzData:[],
chartData1:{},
chartData:{}
showTime: false,
showTime1: false,
activeOne: 0,
ylzData: [],
chartData1: {},
chartData: {},
stnm:'',
}
},
methods: {
//
async getrainInfo(){
async getrainInfo() {
try {
const {data} = await uni.$http.post(
"/gunshiApp/xyt/attResBase/rainBasinDivision/queryStStbprpPerHour/StcdAndStartTimeAndEndTime",{
stcd:"716164061",
startTime:moment(this.stm).format("YYYY-MM-DD HH:mm:ss"),
endTime:moment(this.etm).format("YYYY-MM-DD HH:mm:ss")
const {
data
} = await uni.$http.post(
"/gunshiApp/xyt/attResBase/rainBasinDivision/queryStStbprpPerHour/StcdAndStartTimeAndEndTime", {
stcd: "716164061",
startTime: moment(this.stm).format("YYYY-MM-DD HH:mm:ss"),
endTime: moment(this.etm).format("YYYY-MM-DD HH:mm:ss")
})
if(data.code == 200){
if (data.code == 200) {
this.ylzData = data.data;
}
} catch (error) {
@ -99,74 +98,85 @@ export default {
},
//
async getrainChartInfo(){
async getrainChartInfo() {
try {
const {data} = await uni.$http.post(
"/gunshiApp/xyt/attResBase/rainBasinDivision/queryStStbprpPerHourChart/StcdAndStartTimeAndEndTime",{
stcd:"716164061",
startTime:moment(this.stm).format("YYYY-MM-DD HH:mm:ss"),
endTime:moment(this.etm).format("YYYY-MM-DD HH:mm:ss")
const {
data
} = await uni.$http.post(
"/gunshiApp/xyt/attResBase/rainBasinDivision/queryStStbprpPerHourChart/StcdAndStartTimeAndEndTime", {
stcd: "716164061",
startTime: moment(this.stm).format("YYYY-MM-DD HH:mm:ss"),
endTime: moment(this.etm).format("YYYY-MM-DD HH:mm:ss")
})
if(data.code == 200){
this.chartData1 = {...data.data}
if (data.code == 200) {
this.chartData1 = {
...data.data
}
}
} catch (error) {
uni.$showMsg();
}
},
handleStartTime(e){
handleStartTime(e) {
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.stm = time
this.showTime = false
},
handleEndTime(e){
handleEndTime(e) {
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.etm = time;
this.showTime1 = false
},
searchHandle(){
searchHandle() {
this.getrainInfo();
this.getrainChartInfo();
}
},
watch:{
chartData1(n,o){
this.chartData = {...drpOptions(n)}
watch: {
chartData1(n, o) {
this.chartData = {
...drpOptions(n)
}
}
},
onLoad(options){
this.stnm = options.stnm
},
mounted() {
this.getrainInfo();
this.getrainChartInfo();
}
}
}
</script>
<style lang="scss" scoped>
.time-ranger{
.time-ranger {
margin-bottom: 10px;
.start-time, .end-time{
.start-time,
.end-time {
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
}
.tab-bar{
.tab-bar {
display: flex;
justify-content: space-around;
padding: 10px 40px;
border-bottom: 1px solid #dfdfdf;
}
.active{
.active {
color: #39a6ff;
}
.ylz-chart-area{
.ylz-chart-area {
width: 100%;
height: 230px;
}
.ylz-chart-table{
}
</style>

View File

@ -74,7 +74,7 @@
},
toDetail(){
uni.navigateTo({
url:'/pages/ylzList/detail/index'
url:`/pages/ylzList/detail/index?stnm=${this.item.stnm}`
})
},
},

BIN
static/tabs/aqjc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
static/tabs/spjk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
static/tabs/stlljk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
static/tabs/wtcl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
static/tabs/wxyh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
static/tabs/xcrw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB