新增的功能

master
xielei 2024-11-06 15:57:29 +08:00
commit c65d846ada
28 changed files with 1918 additions and 696 deletions

View File

@ -13,7 +13,7 @@
} else {
uni.reLaunch({
url: '/pages/login/login'
// url:'/pages/spjk/index'
// url:'/pages/mypage/mypage'
})
console.log(token.secretKey,'App Launch2')
}

View File

@ -323,6 +323,12 @@
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/ylzList/detail/index",
"style": {
"navigationBarTitleText": ""
}
}
],
@ -340,12 +346,6 @@
"selectedIconPath": "static/tabs/home2.png",
"text": "首页"
},
{
"pagePath": "pages/addressBook/addressBook",
"iconPath": "/static/tabs/phone_icon@2x.png",
"selectedIconPath": "static/tabs/phone_icon@2x2.png",
"text": "通讯录"
},
{
"pagePath": "pages/mypage/mypage",
"iconPath": "/static/images/my2_icon@2x.png",

View File

@ -71,7 +71,7 @@
import moment from "moment"
import drpOption from './jrxOptions';
import JcsjTable from "./jcsjTable"
const stm = moment().subtract(7, 'months').add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
const stm = moment().subtract(1, 'days').add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
const etm = moment().add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
export default {

View File

@ -8,7 +8,7 @@
</image>
</div>
<div class="info_name">
<div v-if="userList.userName">{{ userList.userName }}</div>
<div v-if="userList.userName">{{ userList.nickName }}</div>
<div v-if="userList.dept">
{{ userList.dept.deptName || '' }}
</div>
@ -26,7 +26,7 @@
<!-- 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)">
<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="
@ -115,39 +115,6 @@
yjStatus: 0,
// limit: disType(uni.getStorageSync('value').adcd),
limit: 1,
timeList: [{
text: '昨天08:00~当前时间',
value: 1
},
{
text: '今天08:00~当前时间',
value: 2
},
{
text: '昨天08:00~今天08:00',
value: 3
},
{
text: '最近1小时',
value: 4
},
{
text: '最近3小时',
value: 5
},
{
text: '最近6小时',
value: 6
},
{
text: '最近12小时',
value: 7
},
{
text: '最近24小时',
value: 8
}
],
value1: 3,
rainChartData: [],
formData: {
@ -165,7 +132,6 @@
},
rainChartData: [],
chartData: {},
subList: ['河道水情', '水库水情'],
current: 0,
hdList: [],
skList: [],
@ -184,7 +150,8 @@
interval: null,
numPic: 0,
allStatus: false,
messagelist:[]
messagelist:[],
ylzList:[],
}
},
onPullDownRefresh() {
@ -206,73 +173,40 @@
},
computed: {
getNavList() {
// const adcd = uni.getStorageSync('value').adcd
// let lever = 0
// if (adcd?.endsWith('000000000')) {
//
return [{
value: '雨情',
return [
{
value: '巡查任务',
key: 1,
icon: '../../static/tabs/xingzhuang2.png',
url: '/pages/rain/rain'
},
{
value: '水情',
key: 2,
icon: '../../static/tabs/water2.png',
url: '/pages/water/water'
},
{
value: '工情灾情',
key: 3,
icon: '../../static/tabs/gongqing2.png',
url: '/pages/gqzq/index'
},
{
value: '信息上报',
key: 4,
icon: '../../static/tabs/xinxi_icon@2x2.png',
url: '/pages/xxsb/index'
},
{
value: '预警',
key: 5,
icon: '../../static/tabs/yujing_icon@2x2.png',
url: '/pages/forewarning/forewarning'
},
{
value: '巡查任务111',
key: 6,
icon: '../../static/tabs/yujing_icon@2x2.png',
url: '/pages/xcrw/index'
},
{
value: '维修养护111',
key: 6,
value: '维修养护',
key: 2,
icon: '../../static/tabs/yujing_icon@2x2.png',
url: '/pages/wxyh/index'
},
{
value: '问题处理111',
key: 7,
value: '问题处理',
key: 3,
icon: '../../static/tabs/yujing_icon@2x2.png',
url: '/pages/wtcl/index'
},
{
value: '预警111',
key: 7,
value: '预警',
key: 4,
icon: '../../static/tabs/yujing_icon@2x2.png',
url: '/pages/yj/index'
},
{
value: '视频监控11',
key: 7,
value: '视频监控',
key: 5,
icon: '../../static/tabs/yujing_icon@2x2.png',
url: '/pages/spjk/index'
},
{
value: '生态流量监控11',
key: 7,
value: '生态流量监控',
key: 6,
icon: '../../static/tabs/yujing_icon@2x2.png',
url: '/pages/stlljk/index'
},
@ -283,41 +217,6 @@
url: '/pages/aqjc/index'
},
]
// } else {
// //
// return [
// {
// value: '',
// key: 1,
// icon: '../../static/tabs/xingzhuang2.png',
// url: '/pages/rain/rain'
// },
// {
// value: '',
// key: 2,
// icon: '../../static/tabs/water2.png',
// url: '/pages/water/water'
// },
// // {
// // value: '',
// // key: 3,
// // icon: '../../static/tabs/gongqing2.png',
// // url: '/pages/gqzq/index'
// // },
// {
// value: '',
// key: 5,
// icon: '../../static/tabs/yujing_icon@2x2.png',
// url: '/pages/orderFeedback/orderFeedback'
// },
// {
// value: '',
// key: 4,
// icon: '../../static/tabs/xinxi_icon@2x2.png',
// url: '/pages/xxsb/index'
// }
// ]
// }
}
},
watch: {
@ -885,39 +784,31 @@
}
.navBar {
height: 100%;
background-color: #fff;
margin-bottom: 12rpx;
/* background-color: pink; */
}
.navBar {
padding: 20px;
padding: 13px;
padding-bottom: 0;
/* text-align: center; */
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
// justify-content: center;
margin-bottom: 10px;
}
.navList {
text-align: center;
margin-right: 0px;
margin-bottom: 10px;
}
.navIcon {
position: relative;
width: 50px;
width: 84px;
height: 50px;
/* border-radius: 10px;
background-color: #007afd; */
display: flex;
justify-content: center;
align-items: center;
}
.readStatus {
position: absolute;
top: 0;
right: 0;
right: 17px;
width: 10px;
height: 10px;
border-radius: 50%;

View File

@ -1,34 +1,22 @@
<template>
<view class="container">
<div class="img">
<image
style="width: 100%; height: 100%"
src="../../static/images/u8.png"
mode="scaleToFill"
></image>
<image style="width: 100%; height: 100%" src="../../static/images/bg_img.png" mode="scaleToFill"></image>
</div>
<view class="user-title">
<text class="sub" >用户登录</text>
<text class="line"></text>
</view>
<uni-forms :modelValue="formData" class="form">
<uni-forms-item>
<uni-easyinput
type="text"
v-model="formData.username"
placeholder="请输入用户名"
/>
<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-easyinput type="password" v-model="formData.password" placeholder="请输入密码" />
</uni-forms-item>
<uni-forms-item>
<checkbox :checked="formData.checked" @click="handleChange(formData)" /><text
>记住用户名和密码</text
>
<checkbox :checked="formData.checked" @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>
@ -37,176 +25,163 @@
</template>
<script>
import CryptoJS from 'crypto-js'
import { onMounted } from "vue"
let checked = false
export default {
data () {
return {
formData: {
username: '',
password: '',
checked: false
}
}
},
mounted(){
console.log(uni.getStorageSync('loginChecked'));
if (uni.getStorageSync('loginChecked')===true){
this.formData = {
username: uni.getStorageSync('username'),
password: uni.getStorageSync('password'),
checked: true,
}
}
},
methods: {
handleChange (formData) {
checked = !checked
formData.checked = !formData.checked
},
xian () {
this.formData = {
username: 'cwz',
password: '12345678a',
checked: false
}
},
xiang () {
this.formData = {
username: 'glszfz',
password: '12345678a',
checked: false
}
},
login (formData) {
//loading
uni.showLoading({title:'努力登录中...', mask:true});
//MD5
const encryptData = data => {
const encryptedData = CryptoJS.MD5(data).toString()
return encryptedData
}
//
let postForm = {
username: formData.username,
password: formData.password
}
//
if (formData.checked === true) {
uni.setStorageSync('loginChecked', true)
uni.setStorageSync('username', postForm.username)
uni.setStorageSync('password',formData.password)
uni.setStorageSync('secretKey', postForm.secretKey)
} else {
uni.setStorageSync('loginChecked', false)
uni.removeStorageSync('username')
uni.removeStorageSync('secretKey')
uni.removeStorageSync('password')
this.formData.username = ''
this.formData.password = ''
}
//
console.log(postForm,'---===');
uni.$http.post('/gunshiApp/xyt/login', postForm).then(res => {
uni.showLoading({ title: '努力登录中...', mask: true })
console.log(res,'---===');
if (res.data.code === 200) {
//localStoragetoken
if (res.data.token) {
uni.setStorageSync('Gs-Token', res.data.token)
uni.$http.get('/gunshiApp/xyt/getInfo').then(res => {
// console.log('sss', res.data.data)
uni.setStorageSync('value', res.data.user)
setTimeout(function () {
uni.hideLoading()
uni.reLaunch({
url: '/pages/homeIndex/index'
})
}, 1000)
clearTimeout()
// 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')
}
// uni.showLoading({title:'...', mask:true});
//
})
}
} else if (res.data.code === 400) {
//
setTimeout(function () {
uni.hideLoading()
uni.showToast({
title: res.data.description,
icon: 'none',
duration: 2000
})
}, 1000)
clearTimeout()
import CryptoJS from 'crypto-js'
import {
onMounted
} from "vue"
let checked = false
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
export default {
data() {
return {
formData: {
username: '',
password: '',
checked: false
}
})
}
},
mounted() {
if (uni.getStorageSync('loginChecked') === true) {
this.formData = {
username: uni.getStorageSync('username'),
password: uni.getStorageSync('password'),
checked: true,
}
}
},
methods: {
handleChange(formData) {
checked = !checked
formData.checked = !formData.checked
},
login(formData) {
//loading
uni.showLoading({
title: '努力登录中...',
mask: true
});
//MD5
const encryptData = data => {
const encryptedData = CryptoJS.MD5(data).toString()
return encryptedData
}
//
let postForm = {
username: formData.username,
password: formData.password
}
//
if (formData.checked === true) {
uni.setStorageSync('loginChecked', true)
uni.setStorageSync('username', postForm.username)
uni.setStorageSync('password', formData.password)
uni.setStorageSync('secretKey', postForm.secretKey)
} else {
uni.setStorageSync('loginChecked', false)
uni.removeStorageSync('username')
uni.removeStorageSync('secretKey')
uni.removeStorageSync('password')
this.formData.username = ''
this.formData.password = ''
}
//
uni.$http.post('/gunshiApp/xyt/login', postForm).then(res => {
uni.showLoading({
title: '努力登录中...',
mask: true
})
if (res.data.code === 200) {
//localStoragetoken
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);
uni.setStorageSync('value', res.data.user)
uni.setStorageSync('avatar', avatarUrl)
setTimeout(function () {
uni.hideLoading()
uni.reLaunch({
url: '/pages/homeIndex/index'
})
}, 1000)
})
}
} else {
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 {
}
</style>
<style lang="scss">
.container {
display: flex;
flex: 1;
flex-direction: column;
width: 100vw;
height: 100vh;
align-items: center;
background-color: #f3f5f8;
}
.img {
width: 100vw;
height: 40vh;
margin-top: 0vh;
/* background-color: red; */
}
.form {
margin-top: 10vh;
width: 80%;
height: 8vh;
align-items: center;
justify-content: center;
}
.user-title {
position: relative;
padding: 4px;
text-align: center;
display: flex;
flex-direction: column;
.sub{
font-size: 28px;
color: #000;
}
.line{
position: absolute;
width: 80px;
height: 5px;
left:20px;
bottom: -10px;
background-color: #00a8ff;
border-radius: 15%;
}
}
</style>

View File

@ -11,14 +11,14 @@
<div class="info">
<uni-forms :modelValue="formData" >
<uni-forms-item label="原密码" :required="true" class="form">
<uni-easyinput type="password" v-model="formData.oldSecretKey" placeholder="请输入原密码" class="password"/>
<uni-easyinput type="password" v-model="formData.oldPassword" placeholder="请输入原密码" class="password"/>
</uni-forms-item>
<uni-forms-item label="新密码" :required="true" class="form">
<uni-easyinput type="password" v-model="formData.newSecretKey" placeholder="请输入新密码" class="password"/>
</uni-forms-item>
<uni-forms-item label="再次输入新密码" label-width="120px" :required="true" class="form">
<uni-easyinput type="password" v-model="formData.secondSecretKey" placeholder="请再次输入新密码" class="password"/>
<uni-easyinput type="password" v-model="formData.newPassword" placeholder="请输入新密码" class="password"/>
</uni-forms-item>
<!-- <uni-forms-item label="再次输入新密码" label-width="120px" :required="true" class="form">
<uni-easyinput type="password" v-model="formData.newPassword" placeholder="请再次输入新密码" class="password"/>
</uni-forms-item> -->
<button type="primary" class="button" @click="save(formData)"></button>
</uni-forms>
</div>
@ -34,10 +34,14 @@
export default {
data() {
return {
// formData: {
// oldSecretKey: '',
// newSecretKey: '',
// secondSecretKey: '',
// },
formData: {
oldSecretKey: '',
newSecretKey: '',
secondSecretKey: '',
oldPassword: '',
newPassword: '',
},
}
},
@ -47,28 +51,33 @@
},
save(formData){
let new_params = {
userId: '' ,
oldSecretKey: '',
newSecretKey: '',
secondSecretKey: '',
}
// let new_params = {
// userId: '' ,
// oldSecretKey: '',
// newSecretKey: '',
// secondSecretKey: '',
// }
new_params.oldSecretKey = CryptoJS.MD5(formData.oldSecretKey).toString()
new_params.newSecretKey = CryptoJS.MD5(formData.newSecretKey).toString()
new_params.secondSecretKey = CryptoJS.MD5(formData.secondSecretKey).toString()
new_params.userId = uni.getStorageSync('value').userId
// new_params.oldSecretKey = CryptoJS.MD5(formData.oldSecretKey).toString()
// new_params.newSecretKey = CryptoJS.MD5(formData.newSecretKey).toString()
// new_params.secondSecretKey = CryptoJS.MD5(formData.secondSecretKey).toString()
// new_params.userId = uni.getStorageSync('value').userId
// console.log(formData)
uni.$http.post('/gunshiApp/xfflood/user/updateSecretKey',new_params).then(res=>{
uni.$http.put(`/gunshiApp/xyt/system/user/profile/updatePwd?oldPassword=${formData.oldPassword}&newPassword=${formData.newPassword}`).then(res=>{
console.log(res);
if (res.data.code === 200) {
uni.showToast({
title: res.data.description,
title: "修改成功,即将重新登录",
icon:'none',
duration: 2000
})
setTimeout(uni.navigateBack(),2500)
setTimeout(() => {
uni.reLaunch({
url: '/pages/login/login'
// url:'/pages/homeIndex/index'
})
},2500)
} else {
uni.showToast({
title: res.data.description,

View File

@ -10,8 +10,8 @@
></image>
</div>
<div class="user">
<div class="username">{{this.userList.userName}}</div>
<div class="userresponse">{{this.userList.orgList[0].orgName}}</div>
<div class="username">{{this.userList.nickName}}</div>
<div class="userresponse">{{this.userList.dept.deptName}}</div>
</div>
</view>
<view class="funcBar">
@ -31,7 +31,7 @@
</view>
<view class="version">
<div class="content">
<div class="left">
<div class="left" style="display:flex">
<uni-icons type="info" size="25" class="icon-left"></uni-icons>
版本号
</div>
@ -45,16 +45,11 @@
</template>
<script>
const func = [
{img: '../../static/images/info.png', name: '个人信息', url:'/pages/personInfo/personInfo'},
{img: '../../static/images/password.png', name: '修改密码', url:'/pages/modifyPassword/modifyPassword'},
]
export default {
data() {
return {
userList: uni.getStorageSync('value'),
@ -65,37 +60,14 @@
default_src: uni.getStorageSync('avatar'),
}
},
onShow() {
this.setInsert()
},
mounted() {
this.default_src = uni.getStorageSync('avatar')
this.userList = uni.getStorageSync('value')
console.log('----mypageAvatar',this.default_src);
console.log('-----userList-----',this.userList);
},
methods: {
navigateToSubPage(index){
uni.navigateTo({
url: func[index].url,
animationType:'pop-in',
})
// console.log('click',index,func[index].url)
},
async setInsert () {
try {
const params = {
createId: uni.getStorageSync('value').userId,
loginType:1,
menu1:'我的',
menu2:'我的',
}
const { data } = await uni.$http.post('/gunshiApp/xfflood/visitMenuLog/insert',params)
console.log('用户行为',params,data)
} catch (error) {}
},
logout(){
if(uni.getStorageSync('loginChecked')===true){
uni.redirectTo({

View File

@ -1,257 +1,219 @@
<template>
<view class="container">
<div class="userinfo">
<div class="icon" @click="goBack">
<uni-icons type="back" size="25" color="white"></uni-icons>
</div>
<div class="Header">
<span>个人信息</span>
</div>
</div>
<uni-list class="info">
<uni-list-item
title="头像"
show-arrow="true"
clickable
class="listContainer"
@click="showActionSheet(default_src)"
>
<template v-slot:footer >
<image class="slot-image" :src="default_src" mode="aspectFill"></image>
</template>
</uni-list-item>
<uni-list-item
v-for="(item, index) in userListShow"
:key="index"
clickable
:title="item.name"
class="listContainer"
@click="modifyValue(item)"
>
<template v-slot:footer >
<div class="item" @click.stop="changeItemInfo(item,index)">
<text >{{item.info}}</text>
</div>
</template>
</uni-list-item>
</uni-list>
<button type="primary" class="button" @click="save"></button>
</view>
<view class="container">
<div class="userinfo">
<div class="icon" @click="goBack">
<uni-icons type="back" size="25" color="white"></uni-icons>
</div>
<div class="Header">
<span>个人信息</span>
</div>
</div>
<uni-list class="info">
<uni-list-item title="头像" show-arrow="true" clickable class="listContainer" @click="showActionSheet(default_src)">
<template v-slot:footer>
<image class="slot-image" :src="default_src" mode="aspectFill"></image>
</template>
</uni-list-item>
<uni-list-item v-for="(item, index) in userListShow" :key="index" clickable :title="item.name"
class="listContainer" @click="modifyValue(item)">
<template v-slot:footer>
<div class="item" @click.stop="changeItemInfo(item,index)">
<text>{{item.info}}</text>
</div>
</template>
</uni-list-item>
</uni-list>
<button type="primary" class="button" @click="save"></button>
</view>
</template>
<script>
let modify = false
//访
const userList = uni.getStorageSync('value')
let userListShow = [
{name: '手机号码', info: userList.phone},
]
export default {
data() {
return {
userList: userList,
userListShow:userListShow,
modify: modify,
default_src: uni.getStorageSync('avatar'),
fileId: '',
phone: userList.phone,
reset: false,
}
},
mounted() { //Storage
this.userList = uni.getStorageSync('value')
this.userListShow[0].info = this.userList.phone
},
methods: {
goBack(){
uni.navigateBack()
},
showActionSheet(default_src){ //
uni.showActionSheet({
itemList: ['拍照/上传照片', '恢复默认头像'],
success: (res) => {
console.log('选择了第' + (res.tapIndex + 1) + '个选项');
if (res.tapIndex === 0) { //
uni.chooseImage({
count: 1,
sizeType: ['origin','compressed'],
sourceType: ['camera', 'album'],
success: (res) => {
const tempFilePaths = res.tempFilePaths;
console.log('--------拍照上传照片--------',res);
this.default_src = tempFilePaths[0]
uni.uploadFile({
url: uni.$http.baseUrl+'/gunshiApp/xfflood/my/info/file/upload/singleSimple',
fileType: 'image',
filePath: tempFilePaths[0],
name: 'file',
success: (res) => {
this.fileId = JSON.parse(res.data).data.fileId
},
})
}
})
} else if(res.tapIndex === 1) { //
console.log('click');
this.reset = true
this.default_src = '../../static/tabs/touxiang.png'
}
},
fail: (err) => {
console.log('弹窗取消');
}
});
},
modifyValue(item){
console.log(item);
},
changeItemInfo(item,index){ //
uni.showModal({
title:"修改"+item.name,
editable:true,
placeholderText:item.info,
confirmText:"确认",
cancelText:"取消",
success: (res) => {
const phoneReg = /^[1][3-9]\d{9}$/;
if (res.confirm){
if (phoneReg.test(res.content) ){
this.userListShow[index].info = res.content
this.phone = res.content
uni.showToast({
title:"修改成功,请保存",
icon: "none",
duration: 1000,
})
} else {
uni.showToast({
title:"请输入正确手机号码",
icon: "none",
duration: 1000,
})
}
}
},
fail: (err) => {
console.log('取消');
}
})
},
save(){
if (this.fileId == ''){ //
if (this.reset) { //
//data
uni.$http.get('/gunshiApp/xfflood/my/info/recover').then(res=>{
uni.setStorageSync('avatar','../../static/tabs/touxiang.png')
})
console.log('重置头像');
}
let params = {
"phone": this.phone,
}
uni.$http.post('/gunshiApp/xfflood/my/info/update',params).then(res=>{
console.log('-----修改图片1-----',res);
let new_userList = uni.getStorageSync('value')
new_userList.phone = this.phone
uni.setStorageSync('value', new_userList)
uni.reLaunch({
url:'/pages/mypage/mypage'
})
},err=>{
console.log('----err----',err);
})
} else { //
let params = {
"phone": this.phone,
"attach": {
"fileId": this.fileId,
},
}
uni.$http.post('/gunshiApp/xfflood/my/info/update',params).then(res=>{
console.log('-----修改图片2-----',res);
if (res.data.code == 200){
console.log('---修改图片3---',res);
let url = '/gunshiApp/xfflood/bzProjectManipulationRecord/file/get/'+this.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('-----modifiedAvatar------',uni.getStorageSync('avatar'));
})
uni.reLaunch({
url:'/pages/mypage/mypage'
})
let modify = false
//访
const userList = uni.getStorageSync('value')
let userListShow = [{
name: '手机号码',
info: userList.phonenumber
}, ]
}
})
}
}
}
}
export default {
data() {
return {
userList: userList,
userListShow: userListShow,
modify: modify,
default_src: uni.getStorageSync('avatar'),
phone: userList.phonenumber,
}
},
mounted() { //Storage
this.userList = uni.getStorageSync('value')
this.userListShow[0].info = this.userList.phonenumber
},
methods: {
goBack() {
uni.navigateBack()
},
showActionSheet(default_src) { //
uni.showActionSheet({
itemList: ['拍照/上传照片'],
success: (res) => {
console.log('选择了第' + (res.tapIndex + 1) + '个选项');
if (res.tapIndex === 0) { //
uni.chooseImage({
count: 1,
sizeType: ['origin', 'compressed'],
sourceType: ['camera', 'album'],
success: (res) => {
const tempFilePaths = res.tempFilePaths;
console.log('--------拍照上传照片--------', res);
this.default_src = tempFilePaths[0]
uni.uploadFile({
url: uni.$http.baseUrl + '/gunshiApp/xyt/system/user/profile/avatar',
fileType: 'image',
filePath: tempFilePaths[0],
name: 'avatarfile',
header: {
'Authorization': 'Bearer ' + uni.getStorageSync('Gs-Token')
},
success: (res) => {
uni.$showMsg("上传成功")
},
})
}
})
}
},
fail: (err) => {
console.log('弹窗取消');
}
});
},
modifyValue(item) {
console.log(item);
},
changeItemInfo(item, index) { //
uni.showModal({
title: "修改" + item.name,
editable: true,
placeholderText: item.info,
confirmText: "确认",
cancelText: "取消",
success: (res) => {
const phoneReg = /^[1][3-9]\d{9}$/;
if (res.confirm) {
if (phoneReg.test(res.content)) {
this.userListShow[index].info = res.content
this.phone = res.content
uni.showToast({
title: "修改成功,请保存",
icon: "none",
duration: 1000,
})
} else {
uni.showToast({
title: "请输入正确手机号码",
icon: "none",
duration: 1000,
})
}
}
},
fail: (err) => {
console.log('取消');
}
})
},
async save() {
try {
let new_userList = uni.getStorageSync('value')
new_userList.phonenumber = this.phone;
const
{data}
=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'
})
}
uni.$showMsg("保存成功")
} catch (error) {
uni.$showMsg()
}
}
}
}
</script>
<style>
.userinfo{
border-radius: 5px;
display: flex;
flex-direction: row;
margin-top: 5vh;
margin-left: 2vw;
margin-bottom: 2vh;
align-items: center;
width: 95%;
height: 6vh;
background-color: #007afd;
}
.icon{
width: 6vw;
height: 6vh;
align-items: center;
line-height: 6vh;
}
.Header{
display: flex;
flex-direction: row;
flex: 0.95;
justify-content: center;
color: white;
font-size: 20px;
}
.info{
margin: 1vh;
}
.listContainer{
height: 6vh;
line-height: 8vh;
}
.button{
margin-top: 60vh;
border-radius: 10px;
display: flex;
flex-direction: column-reverse;
width: 92%;
height: 6vh;
font-size: 20px;
color: white;
background-color: #007afd;
}
.slot-image{
margin-top: 12px;
width: 40px;
height: 40px;
border-radius: 50%;
}
</style>
.userinfo {
border-radius: 5px;
display: flex;
flex-direction: row;
margin-top: 5vh;
margin-left: 2vw;
margin-bottom: 2vh;
align-items: center;
width: 95%;
height: 6vh;
background-color: #007afd;
}
.icon {
width: 6vw;
height: 6vh;
align-items: center;
line-height: 6vh;
}
.Header {
display: flex;
flex-direction: row;
flex: 0.95;
justify-content: center;
color: white;
font-size: 20px;
}
.info {
margin: 1vh;
}
.listContainer {
height: 6vh;
line-height: 8vh;
}
.button {
margin-top: 60vh;
border-radius: 10px;
display: flex;
flex-direction: column-reverse;
width: 92%;
height: 6vh;
font-size: 20px;
color: white;
background-color: #007afd;
}
.slot-image {
margin-top: 12px;
width: 40px;
height: 40px;
border-radius: 50%;
}
</style>

View File

@ -95,12 +95,6 @@
<script>
import moment from "moment"
export default {
props:{
stcd:String,
source:String,
default:''
},
data() {
return {
tableData:{},
@ -117,13 +111,8 @@
methods: {
async getTableData(){
try{
const {data} = await uni.$http.post(
`/gunshiApp/xfflood/river/water/detail`,{
source:this.source,
stcd:this.stcd,
type:2
}
)
const {data} = await uni.$http.get(
"/gunshiApp/xyt/reservoir/water/detail?stcd=716164061")
if(data.code == 200){
this.tableData = {...data.data};
}
@ -141,7 +130,6 @@
<style lang="scss" scoped>
.tjsj-box{
max-height: 100vh;
overflow-y: auto;
.tjsj-row{
.first-row{
line-height: 40px;

View File

@ -1,6 +1,6 @@
<template>
<view class="scroll-table">
<view v-for="(item,index) in list" :key="index" >
<view v-for="(item,index) in list" :key="index" style="margin:5px 20px 5px 10px">
<Card :info="item" />
</view>
<view style="height:50px"></view>
@ -10,10 +10,6 @@
<script>
import Card from "./card.vue"
export default {
props:{
resCode:String,
default:''
},
components:{
Card
},
@ -27,11 +23,10 @@
async getData(){
try{
const {data} = await uni.$http.post(
"/gunshiApp/xfflood/reservoir/water/safe/person",
"/gunshiApp/xyt/resSafePersonB/list",
{
resCode:this.resCode
resCode:"42120250085"
})
console.log("data",data);
if(data.code == 200){
this.list = [...data.data];
}
@ -51,5 +46,6 @@
height: calc(100vh - 100px);
overflow-y: auto;
width:100%;
padding: 10px 5px;
}
</style>

View File

@ -0,0 +1,148 @@
<template>
<view class="project-cotent">
<view class="project-basic">
<view class="project-loc">
<text style="opacity:0.5">工程位置{{skInfo.resLoc}}</text>
</view>
</view>
<view class="project-des" >
<view v-for="(item,index) in tableData" :key="index" :style="index % 2 == 0 ? 'width:150px;':'width:197px;'">
<view style="display:flex;align-items:center;margin:15px 0px;">
<view class="circle-dot"></view>
<view class="label-name">
<text style="opacity:0.5">{{item.name}}</text>
<text>{{item.value||"-"}}</text>
</view>
</view>
</view>
</view>
<view class="total-des">
<view style="opacity:0.5">工程概况</view>
<view>{{skInfo.projOverview}}</view>
</view>
</view>
</template>
<script>
import moment from 'moment'
const gmObj = {
"1":"大 (1)型",
"2":"大 (2)型",
"3":"中型",
"4":"小 (1)型",
"5":"小 (2)型",
"9":"其他",
}
const bxObj = {
1:"是",
0:"否",
}
export default {
props:{
skInfo:{
type:Object,
default:{}
}
},
data() {
return {
list:[
{
name:"注册登记号",
key:"regSn"
},
{
name:"所在河流(水系)名称",
key:"rvName"
},
{
name:"水库模型",
key:"engScal"
},
{
name:"设计灌溉面积(亩)",
key:'designIrrArea'
},
{
name:"受益人口(人)",
key:"feedPop"
},
{
name:"是否病险",
key:"isDanger"
},
{
name:"开工日期",
key:"startDate"
},
{
name:"竣工日期",
key:"compDate"
},
]
}
},
computed:{
tableData(){
return this.list.map(item=>{
if(item.key == "engScal"){
this.skInfo[item.key] = gmObj[this.skInfo[item.key]]
}
if(item.key == "isDanger"){
this.skInfo[item.key] = bxObj[this.skInfo[item.key]]
}
if(item.key == "startDate"){
this.skInfo[item.key] = moment(this.skInfo[item.key]).format("YYYY-MM-DD")
}
if(item.key == "compDate"){
this.skInfo[item.key] = moment(this.skInfo[item.key]).format("YYYY-MM-DD")
}
return {
name:item.name,
value:this.skInfo[item.key]
}
})
}
}
}
</script>
<style lang="scss">
.project-cotent{
padding: 0px 3px;
background-color: #f7f7f7;
max-height: calc(100vh - 40px);
overflow-y: auto;
.project-basic{
background-color: #ffffff;
padding: 5px;
margin: 5px 0;
}
.project-des{
display: flex;
flex-wrap: wrap;
border: 1px solid #f2f2f2;
background-color: #ffffff;
padding: 0 10px;
.circle-dot{
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #409eff;
margin-left: 10px;
}
.label-name{
display: flex;
flex-direction: column;
align-items: center;
flex:1
}
}
}
.total-des{
margin-top: 10px;
background-color: #ffffff;
padding: 10px;
}
</style>

View File

@ -1,39 +1,36 @@
<template>
<view :style="{height:'100vh',overflow:'hidden',backgroundColor:'#f0f0f0'}">
<u-navbar title="小玉潭水库1" :autoBack="true" :titleStyle="{
<view :style="{height:'100vh',overflow:'auto'}">
<u-navbar :title="skInfo.resName" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<u-tabs :list="list1" @click="click" style="background-color: #fff;margin-top: 45px;"></u-tabs>
<view class="" style="padding: 5px;">
<view class="swiper-content">
<text class="num">{{nowNum}}/{{15}}</text>
<u-swiper :list="list2" @change="change" @click="click"></u-swiper>
<text class="time">2024-08-12 11:00</text>
</view>
</view>
<u-tabs :list="list1" @click="click" :current="tabs" style="background-color: #fff;margin-top: 60px;"></u-tabs>
<Jcxx v-if="tabs == 0"></Jcxx>
<BasicInfo v-if="tabs == 1" :skInfo="skInfo"></BasicInfo>
<Tzcs v-if="tabs == 2" :skInfo="skInfo"></Tzcs>
<Krqx v-if="tabs == 3"></Krqx>
<Zrtx v-if="tabs == 4"></Zrtx>
</view>
</template>
<script>
import moment from 'moment'
import Jcxx from "./jcxx.vue"
import Zrtx from "../../skDetail/zrtx/zrtx.vue"
import Krqx from "./krqx/index.vue"
import BasicInfo from "./basicInfo.vue"
import Tzcs from "./tzcs.vue"
export default {
data() {
return {
show: false,
tabs:0,
model: {
stm: '',
etm: ''
},
nowNum:1,
customStyle: {
background: '#000'
},
list2: [
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
],
list1: [{
name: '监测信息',
}, {
@ -44,35 +41,30 @@
name: '库容曲线'
}, {
name: '责任人'
}]
}],
skInfo:{},
};
},
components:{
Jcxx,
Zrtx,
Krqx,
BasicInfo,
Tzcs
},
onLoad() {
console.log('小玉潭水库');
this.getList()
this.getList();
},
methods: {
click(item) {
console.log('item', item);
},
change(e){
console.log(e);
this.nowNum = e.current+1
this.tabs = item.index;
},
getList(){
uni.$http.post('/gunshiApp/xyt/attResBase/list',this.model).then(res=>{
console.log(res,'res');
this.skInfo = res.data.data[0];
})
},
confirm(e) {
console.log(e);
this.model.start = e[0]
this.model.end = e[1]
this.show = false
},
cancel() {
this.show = false
},
toDetail() {
uni.navigateTo({
url: '/pages/wtcl/detail/index'

View File

@ -0,0 +1,330 @@
<template>
<view class="" style="padding: 5px;">
<view class="swiper-content">
<text class="num">{{nowNum}}/{{totalNum}}</text>
<u-swiper :list="imgList" height='230px' @change="change" imgMode="scaleToFill" keyName="imgPath"></u-swiper>
<text class="time">{{imgTime}}</text>
</view>
<view class="update-time">
<text>更新时间</text>
<text>{{info.tm}}</text>
</view>
<view class="sk-info">
<view class="sk-first-row">
<view class="first-item">
<text>{{info.normWatLev}}</text>
<text>水位</text>
</view>
<view class="first-item">
<text>{{info.nowCap}}</text>
<text>蓄水量</text>
</view>
<view class="first-line"></view>
<image
style="width: 20px; height: 20px;"
src="../../../static/images/first.jpg"
></image>
</view>
<view class="first-extra-row">
<text>坝顶高程{{info.crestElev}}</text>
<text>汛限水位{{info.flLowLimLev}}</text>
<text>总库容{{info.totCap}}</text>
</view>
<view class="sk-second-row">
<view class="first-item">
<text>{{rainInfo.today}}毫米</text>
<text>今日降雨</text>
</view>
<view class="first-item">
<text>{{rainInfo.yesterdayDrp}}毫米</text>
<text>昨日降雨</text>
</view>
<view class="first-line" style="margin-right:17px"></view>
<image
style="width: 20px; height: 20px;"
src="../../../static/images/second.jpg"
></image>
</view>
</view>
<view class="rain-box">
<view class="rain-title">
<view class="line-icon"></view>
<view >水雨情过程线</view>
</view>
<view class="time-select">
<view class="time-ranger" >
<view class="start-time">
<text>开始时间</text>
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{stm}}</text>
</view>
<view class="end-time">
<text>结束时间</text>
<text @click="showTime1=true" style="margin:0 15%;color:#3399ef">{{etm}}</text>
<view class="search-btn" @click="searchHandle">
搜索
</view>
</view>
</view>
</view>
<view class="switch-btn">
<u-subsection :list="subsectionList" :current="curNow" mode="subsection" @change="subsectionChange"></u-subsection>
</view>
<view class="show-content">
<view style=" height: 500px; overflow-y: auto; padding:0" v-if="curNow == 0">
<qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts" />
</view>
<JcTable v-if="curNow == 1" :tableData='jcTableData'/>
<Tjsj v-if="curNow == 2" />
</view>
</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>
</view>
</template>
<script>
import moment from 'moment'
import Tjsj from "../../skDetail/tjsj/tjsj.vue"
import JcTable from "../../skDetail/jcsj/jcsjTable.vue"
import drpOption from "../../skDetail/jcsj/chartOption.js"
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");
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
export default {
components:{
Tjsj,
JcTable
},
data() {
return {
startTime:stm,
endTime:etm,
imgList:[],
nowNum:1,
totalNum:0,
imgTime:'2024-08-12 11:00',
info:'',
rainInfo:{},
stm,
etm,
showTime:false,
showTime1:false,
subsectionList: ['图', '表', '统计值'],
curNow:0,
jcTableData:[],
chartData: {},
}
},
methods: {
//
async getImgList () {
try {
const {data} = await uni.$http.post(
"/gunshiApp/xyt/reservoir/water/real/img",
{
resCode: "42120250085"
})
if(data.code == 200){
const newArr = data.data.map(item => ({...item,imgPath: url + item.imgPath }))
this.totalNum = newArr.length;
this.imgList = [...newArr];
this.imgTime = this.imgList[0]?.tm || "2024-08-12 11:00";
this.nowNum = !newArr.length ? 0 : 1;
}
} catch (error) {
uni.$showMsg();
}
},
//
async getSkinfo(){
try {
const {data} = await uni.$http.post(
"/gunshiApp/xyt/reservoir/water/list")
if(data.code == 200){
this.info = data.data[0]
}
} catch (error) {
uni.$showMsg();
}
},
//
async getrainInfo(){
try {
const {data} = await uni.$http.get(
"/gunshiApp/xyt/reservoir/water/detail?stcd=716164061")
if(data.code == 200){
this.rainInfo = data.data;
}
} catch (error) {
uni.$showMsg();
}
},
//
async getJcsjData(){
try{
const {data} = await uni.$http.post(
"/gunshiApp/xyt/reservoir/water/monitor/data",
{
stcd:"716164061",
stm:moment(this.stm).format("YYYY-MM-DD HH:mm:ss"),
etm:moment(this.etm).format("YYYY-MM-DD HH:mm:ss"),
})
if(data.code == 200){
this.jcTableData = [...data.data];
}
}catch(e){
uni.$showMsg();
}
},
searchHandle(){
this.getJcsjData()
},
change(e){
this.nowNum = e.current+1;
this.imgTime = this.imgList[e.current].tm
},
handleStartTime(e){
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.stm = time
this.showTime = false
},
handleEndTime(e){
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.etm = time;
this.showTime1 = false
},
subsectionChange(e){
this.curNow = e
}
},
watch:{
jcTableData(newV, oldV){
if(this.info){
this.chartData = {...drpOption(newV,this.info.afsltdz,this.info.flLowLimLev,this.info.desFloodLev,this.info.calFloodLev)}
}
}
},
mounted(){
this.getImgList();
this.getSkinfo();
this.getrainInfo();
this.getJcsjData();
},
}
</script>
<style lang="scss" scoped>
.swiper-content{
position: relative;
.num{
position: absolute;
top: 10px;
left: 10px;
z-index: 1;
background-color: #000;
color: #fff;
padding: 0 4px;
border-radius: 6px;
opacity: .4;
font-size: 12px;
}
.time{
position: absolute;
background-color: #000;
opacity: .4;
color: #fff;
bottom: 0;
width:100%;
padding: 4px;
}
}
.update-time{
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 5px;
border-bottom: 1px solid #dfdfdf;
}
.sk-info{
display: flex;
flex-direction: column;
padding: 2px 5px;
margin: 5px 0;
.sk-first-row,.sk-second-row{
display: flex;
padding: 5px 10px;
align-items: center;
justify-content: space-around;
background-color: #f2fafc;
.first-line{
width: 3px;
height: 20px;
background-color: #c6eae6;
}
.first-item{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
}
.sk-second-row{
margin: 5px 0;
background-color: #f2f8ff;
padding: 5px 10px;
}
}
.first-extra-row{
display: flex;
padding: 5px;
justify-content: space-between;
background-color: #f2fafc;
}
.rain-box{
padding: 5px 0px;
.rain-title{
display: flex;
align-items: center;
.line-icon{
width: 3px;
height: 15px;
background-color: #0079fe;
margin-right: 10px;
}
}
.time-ranger{
margin-bottom: 10px;
.start-time, .end-time{
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
}
.switch-btn{
width: 50%;
margin-left: auto;
}
}
.show-content{
width: 100%;
padding: 0;
margin-top: 10px;
}
</style>

View File

@ -0,0 +1,80 @@
import {GetInterval} from "../../../../utils/tools"
export default function DrpOption(data) {
const maxVal = Math.ceil(Math.max(...data.map(obj => obj.rz)))
const minVal = Math.floor(Math.min(...data.map(obj => obj.rz)))
const maxValX = Math.max(...data.map(obj => obj.w))
const minValX = Math.min(...data.map(obj => obj.w))
let arr = []
data.forEach(item=>{
arr.push([item.w,item.rz])
})
let eopts = {
tooltip: {
trigger: 'axis',
},
grid: [
{
top: "12%",
left: "12%",
right: "18%",
bottom: "8%"
},
],
xAxis: [
{
name: "库容(万m³)",
nameGap: 5,
type: 'value',
min:Math.floor(minValX / 5) *5,
max:Math.ceil(maxValX / 5) *5,
interval:GetInterval(minValX,maxValX),
data: data.map(o => o.w),
splitLine: {
show: false
},
}
],
yAxis: [
{
type: 'value',
name: "库水位(m)",
minInterval:1,
splitLine: {
show: true,
lineStyle: {
color: '#07a6ff',
width: 0.25,
type: 'dotted'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
show: true
},
axisTick: {
show: true,
},
min: minVal,
max: maxVal
}
],
};
let chartData = {
series: [
{
type: 'line',
color: "#007AFD",
data: arr,
smooth: true
},
]
};
return {
eopts,
chartData
}
}

View File

@ -0,0 +1,56 @@
<template>
<view>
<view style="height: 250px; ">
<qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts" />
</view>
<view style="margin-top: 20px;">
<Table :tableData="tableData"/>
</view>
</view>
</template>
<script>
import drpOptions from "./chartOptions.js"
import Table from "./jcsjTable.vue"
export default {
components:{
Table
},
data() {
return {
show:false,
chartData:{},
tableData:[]
}
},
methods: {
async getKrData(){
try {
const {data} = await uni.$http.post(
"/gunshiApp/xyt/stZvarlB/list")
if(data.code == 200){
this.tableData = [...data.data];
}
} catch (error) {
uni.$showMsg();
}
}
},
watch:{
tableData(n,o){
if(n.length > 0){
this.chartData = {...drpOptions(n)}
this.show=true
}
}
},
mounted() {
this.getKrData()
},
}
</script>
<style lang="scss">
</style>

View File

@ -0,0 +1,85 @@
<template>
<div class="table_div">
<div class="table_cur">
<table style="width:100%;display:block">
<tr>
<th style="width: 50%;">
水位(m)
</th>
<th style="width: 50%;">库容(万m³)</th>
</tr>
<!-- style="max-height: 480px; overflow-y: auto" -->
<div class="scroll-table">
<tr v-for="(item, index) in tableData" :key="index">
<td style="width: 50%;">{{ item.rz}}</td>
<td style="width:50%;">{{ item.w }}</td>
</tr>
<div style="height:180px"></div>
</div>
</table>
</div>
</div>
</template>
<script>
import moment from "moment"
export default {
props:{
tableData:{
type:Array,
default:[],
}
},
}
</script>
<style lang="scss" scoped>
.table_div {
height: 100%;
max-width: calc(100% - 0px);
max-height: calc(100vh);
flex: 1;
padding-top: 0px;
overflow-x: scroll;
}
/*table样式*/
.table_cur {
width: 100%;
empty-cells: show;
border-collapse: collapse;
font-size: 14px;
}
.scroll-table{
height: calc(100vh - 180px);
overflow-y: auto;
width:'100%'
}
.table_cur tr {
display: flex;
line-height: 75rpx;
}
.table_cur th {
height: 85rpx;
color: #3399ef;
background: #e1f3ff;
font-size: 14px;
// font-weight: bold;
padding: 0px 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
.table_cur td {
height: 65rpx;
// border-bottom: 1px solid #d8ddeb;
font-size: 14px;
color: #2f4056;
padding: 0 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
/*table样式 end*/
</style>

View File

@ -0,0 +1,119 @@
<template >
<view class="project-des" >
<view v-for="(item,index) in tableData" :key="index" :style="index % 2 != 0 ? 'width:150px;':'width:197px;'">
<view style="display:flex;align-items:center;margin:15px 0px;">
<view class="circle-dot"></view>
<view class="label-name">
<text style="opacity:0.5">{{item.name}}</text>
<text>{{item.value||"-"}}</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props:{
skInfo:{
type:Object,
default:{}
}
},
data() {
return {
list:[
{
name:"坝址以上流域面积(km²)",
key:"watShedArea"
},
{
name:"坝顶高程(m)",
key:"crestElev"
},
{
name:"校核洪水位(m)",
key:"calFloodLev"
},
{
name:"总库容(万m³)",
key:"totCap"
},
{
name:"设计洪水位(m)",
key:"desFloodLev"
},
{
name:"调洪库容(万m³)",
key:"storFlCap"
},
{
name:"正常蓄水位(m)",
key:"normWatLev"
},
{
name:"兴利库容(万m³)",
key:"benResCap"
},
{
name:"防洪高水位(m)",
key:"uppLevFlco"
},
{
name:"防洪库容(万m³)",
key:"flcoCap"
},
{
name:"汛限水位(m)",
key:"flLowLimLev"
},
{
name:"死水位(m)",
key:"deadLev"
},
{
name:"死库容(万m³)",
key:"deadCap"
},
{
name:"堰顶高程(m)",
key:"wcrstel"
},
]
}
},
computed:{
tableData(){
return this.list.map(item=>{
return {
name:item.name,
value:this.skInfo[item.key]
}
})
}
}
}
</script>
<style lang="scss">
.project-des{
display: flex;
flex-wrap: wrap;
border: 1px solid #f2f2f2;
background-color: #ffffff;
padding: 0 10px;
.circle-dot{
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #409eff;
margin-left: 10px;
}
.label-name{
display: flex;
flex-direction: column;
align-items: center;
flex:1
}
}
</style>

View File

@ -87,7 +87,7 @@
this.getData()
},
handleStartTime(e){
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.stm = time
this.showTime = false
},

View File

@ -0,0 +1,172 @@
<template>
<view :style="{height:'100vh',overflow:'auto'}">
<u-navbar :title="123" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='40' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view class="tab-bar" style="margin-top:70px">
<view class="jcsj" @click="activeOne = 0" :class="{'active':activeOne == 0}">
监测数据
</view>
<view class="tjsj" @click="activeOne = 1" :class="{'active':activeOne == 1}">
统计数据
</view>
</view>
<view style="padding:10px" v-if="activeOne == 0">
<view class="time-ranger" >
<view class="start-time">
<text>开始时间</text>
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{stm}}</text>
</view>
<view class="end-time">
<text>结束时间</text>
<text @click="showTime1=true" style="margin:0 15%;color:#3399ef">{{etm}}</text>
<view class="search-btn" @click="searchHandle">
搜索
</view>
</view>
</view>
<view class="ylz-chart-area">
<qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts" />
</view>
<view class="ylz-table-area">
<YlzTable :tableData="ylzData"></YlzTable>
</view>
</view>
<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>
</view>
</template>
<script>
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:{
Table,
YlzTable
},
data() {
return {
startTime:stm,
endTime:etm,
stm,
etm,
showTime:false,
showTime1:false,
activeOne:0,
ylzData:[],
chartData1:{},
chartData:{}
}
},
methods: {
//
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")
})
if(data.code == 200){
this.ylzData = data.data;
}
} catch (error) {
uni.$showMsg();
}
},
//
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")
})
if(data.code == 200){
this.chartData1 = {...data.data}
}
} catch (error) {
uni.$showMsg();
}
},
handleStartTime(e){
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.stm = time
this.showTime = false
},
handleEndTime(e){
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.etm = time;
this.showTime1 = false
},
searchHandle(){
this.getrainInfo();
this.getrainChartInfo();
}
},
watch:{
chartData1(n,o){
this.chartData = {...drpOptions(n)}
}
},
mounted() {
this.getrainInfo();
this.getrainChartInfo();
}
}
</script>
<style lang="scss" scoped>
.time-ranger{
margin-bottom: 10px;
.start-time, .end-time{
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
}
.tab-bar{
display: flex;
justify-content: space-around;
padding: 10px 40px;
border-bottom: 1px solid #dfdfdf;
}
.active{
color: #39a6ff;
}
.ylz-chart-area{
width: 100%;
height: 230px;
}
.ylz-chart-table{
}
</style>

View File

@ -0,0 +1,181 @@
import echarts from 'echarts/lib/echarts';
export default function DrpOption(echartData) {
console.log("echartData",echartData);
let totalDrp = 0;
const DRPLEVEL = [10, 20, 50, 100, 250];
const maxVal = DRPLEVEL.find(o => o > totalDrp);
const xMaxVal = echartData?.actual ? DRPLEVEL.find(o => {
let max = Math.max(...echartData?.actual || [])
return o > max
}):maxVal
// const xMaxVal = Math.ceil(Math.max(...echartData.actual)) + 2
const yMaxVal = echartData?.actual ? DRPLEVEL.find(o => {
let max = Math.max(...echartData?.total)
return o > max
}): maxVal
let eopts = {
tooltip: {
trigger: 'axis',
},
grid: {
x: 40,
y: 30,
x2: 30,
y2: 28,
borderWidth: 0
},
legend: {
// 显示图例
show: true,
// 图例的位置
data: ['实测', '累计']
},
calculable: true,
xAxis: [
{
type: 'category',
data: echartData.time,
splitLine: {
show: false
},
axisLabel: {
color: '#333',
fontSize: 12,
format:"jcDataFormat"
},
axisLine: {
lineStyle: {
color: '#07a6ff',
width: 0.5,
}
},
axisTick: {
show: false,
},
}
],
yAxis: [
{
type: 'value',
position: 'left',
name:"雨量mm",
splitLine: {
show: true,
lineStyle: {
color: '#07a6ff',
width: 0.25,
type: 'dashed'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
show: false
},
axisTick: {
show: false,
},
min: 0,
max: xMaxVal
},
{
type: 'value',
position: 'right',
name:"累计mm",
splitLine: {
show: true,
lineStyle: {
color: '#07a6ff',
width: 0.25,
type: 'dashed'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
show: false
},
axisTick: {
show: false,
},
min: 0,
max: yMaxVal
}
],
};
let chartData = {
series: [
{
name: '实测',
type: 'bar',
barWidth: '60%',
data: echartData.actual,
itemStyle: {
normal: {
barBorderRadius: [3, 3, 0, 0],
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{ offset: 0, color: '#3876cd' },
{ offset: 0.5, color: '#45b4e7' },
{ offset: 1, color: '#54ffff' }
]
),
},
},
label: {
show: false,
},
markPoint: {
data: [
{ type: 'max', name: '最大值', symbol: 'circle', symbolSize: 1, symbolOffset: [0, -12] },
]
},
},
{
yAxisIndex: 1,
name: '累计',
type: 'line',
showSymbol: false,
label: {
show: false,
},
data: echartData.total,
lineStyle: {
normal: {
width: 1,
}
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(3, 194, 236, 0.3)'
}, {
offset: 0.8,
color: 'rgba(3, 194, 236, 0)'
}
], false),
shadowColor: 'rgba(0, 0, 0, 0.1)',
shadowBlur: 10
}
},
itemStyle: {
normal: {
color: '#03C2EC'
}
},
}
]
};
return {
eopts,
chartData
}
}

View File

@ -0,0 +1,89 @@
<template>
<div class="table_div">
<div class="table_cur">
<table style="width:100%;display:block">
<tr>
<th style="width: 12%;">
序号
</th>
<th style="width: 50%;">
时间
</th>
<th style="width: 38%;">小时雨量(mm)</th>
</tr>
<!-- style="max-height: 480px; overflow-y: auto" -->
<div class="scroll-table">
<tr v-for="(item, index) in tableData" :key="index">
<td style="width: 12%;">{{index + 1}}</td>
<td style="width: 50%;">{{ item.time}}</td>
<td style="width:38%;">{{ item.sumDrp }}</td>
</tr>
<div style="height:180px"></div>
</div>
</table>
</div>
</div>
</template>
<script>
import moment from "moment"
export default {
props:{
tableData:{
type:Array,
default:[],
}
},
}
</script>
<style lang="scss" scoped>
.table_div {
height: 100%;
max-width: calc(100% - 0px);
// max-height: calc(80vh);
flex: 1;
padding-top: 0px;
// overflow-x: scroll;
}
/*table样式*/
.table_cur {
width: 100%;
empty-cells: show;
border-collapse: collapse;
font-size: 14px;
}
.scroll-table{
height: calc(55vh - 180px);
overflow-y: auto;
width:'100%'
}
.table_cur tr {
display: flex;
line-height: 75rpx;
}
.table_cur th {
height: 85rpx;
color: #3399ef;
background: #e1f3ff;
font-size: 14px;
// font-weight: bold;
padding: 0px 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
.table_cur td {
height: 65rpx;
// border-bottom: 1px solid #d8ddeb;
font-size: 14px;
color: #2f4056;
padding: 0 10px;
box-sizing: border-box;
white-space: nowrap;
text-align: center !important;
}
/*table样式 end*/
</style>

View File

@ -0,0 +1,139 @@
<template>
<view class="tjsj-box">
<uni-row class="tjsj-row" :width="700">
<uni-col :span="12">
<view class="first-row">近1h雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.h1||0}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row">近3h雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.h3||0}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row">近6h雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.h6||0}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row">近12h雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.h12||0}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row">近24h雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.h24||0}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row">近48h雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.h48||0}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row">今日雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.today||0}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row">昨日雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.yesterdayDrp||0}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row">本月雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.monthDrp||0}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row">本年雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.yearDrp||0}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row">本年降雨天数</view>
</uni-col>
<uni-col :span="12">
<view class="second-row">{{tableData.yearDrpDay||0}}/{{days}}</view>
</uni-col>
<uni-col :span="12">
<view class="first-row" style="border-bottom: 1px solid #dfdfdf;">本年最大日雨量(mm)</view>
</uni-col>
<uni-col :span="12">
<view class="second-row" style="display: flex; justify-content: center;border-bottom: 1px solid #dfdfdf;">
<text>{{tableData.maxDrp||0}}</text>
<text style="color: #E69224;">({{maxDrpTime}})</text>
</view>
</uni-col>
</uni-row>
<view style="height:150px"></view>
</view>
</template>
<script>
import moment from "moment"
export default {
data() {
return {
tableData:{},
days:moment().diff(moment().startOf('year'),'days')+1
}
},
computed:{
maxDrpTime(){
if(this.tableData.maxDrpTime){
return moment(this.tableData.maxDrpTime).format("YYYY-MM-DD")
}
}
},
methods: {
async getTableData(){
try{
const {data} = await uni.$http.get(
"/gunshiApp/xyt/attResBase/rainBasinDivision/queryStPptnDetails/stcd?stcd=716164061")
if(data.code == 200){
this.tableData = {...data.data};
}
}catch(e){
uni.$showMsg()
}
}
},
mounted() {
this.getTableData()
}
}
</script>
<style lang="scss" scoped>
.tjsj-box{
max-height: 100vh;
.tjsj-row{
.first-row{
line-height: 40px;
text-align: center;
border-top: 1px solid #dfdfdf;
border-left: 1px solid #dfdfdf;
}
.second-row{
line-height: 40px;
text-align: center;
border-top: 1px solid #dfdfdf;
border-left: 1px solid #dfdfdf;
border-right: 1px solid #dfdfdf;
}
}
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<view class="skinfo">
<view class="skinfo" @click="toDetail()">
<view class="title">
<view class="left">
<text>{{item.stnm}}</text>
@ -39,9 +39,32 @@
h12:22,
h24:35,
},
ylzList:[]
}
}
},
methods:{
//
async getYlzData(){
try {
const {data} = await uni.$http.post(
"/gunshiApp/xyt/stPptnRReal/list")
if(data.code == 200){
this.ylzList = [...data.data];
}
} catch (error) {
uni.$showMsg();
}
},
toDetail(){
uni.navigateTo({
url:'/pages/ylzList/detail/index'
})
},
},
mounted() {
this.getYlzData();
},
}
</script>

BIN
static/images/bg_img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
static/images/first.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

BIN
static/images/second.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -85,6 +85,9 @@ const cfe = {
let val = value.data.coord[1]
return `${months}月核定生态流量${val}m³/s`
},
"jcDataFormat": function (val) {
return val.substr('2020-'.length, 11)
},
"yhidden": function (value, index, axis) {
console.log("axis",axis);

12
utils/tools.js Normal file
View File

@ -0,0 +1,12 @@
export const GetInterval=(min,max,step=10)=>{
const distance = Math.ceil(max) - Math.floor(min)
console.log(distance);
let s = (distance / step);
console.log(s);
if (s > 5){
s = Math.ceil(s / 5) *5;
return s;
}else{
return Math.ceil(s)
}
}