修改测试问题

This commit is contained in:
guanj
2026-06-29 11:01:44 +08:00
parent f008bcb4b8
commit 1d73755a43
56 changed files with 2875 additions and 2702 deletions

View File

@@ -72,4 +72,5 @@ export default {
// .uni-page-refresh__icon { // .uni-page-refresh__icon {
// fill: #007aff !important; /* 改成你想要的颜色,比如红色 #ff0000 */ // fill: #007aff !important; /* 改成你想要的颜色,比如红色 #ff0000 */
// } // }
</style> </style>

View File

@@ -11,6 +11,7 @@ export function addFeedBack(params) {
console.log(files.length); console.log(files.length);
let data = JSON.parse(JSON.stringify(params)); let data = JSON.parse(JSON.stringify(params));
delete data.files delete data.files
console.log("🚀 ~ addFeedBack ~ files.length:", files.length)
if (files.length) { if (files.length) {
return uni.uploadFile({ return uni.uploadFile({
url: config.domain + '/cs-system-boot/feedback/addFeedBack', //仅为示例,非真实的接口地址 url: config.domain + '/cs-system-boot/feedback/addFeedBack', //仅为示例,非真实的接口地址

View File

@@ -2,6 +2,7 @@ const debug = true // true 是连地服务端本地false 是连接线上
const development = { const development = {
domain: 'http://192.168.1.103:10215', domain: 'http://192.168.1.103:10215',
// domain: 'http://192.168.1.102:27707/api',
} }
const production = { const production = {

View File

@@ -1,5 +1,6 @@
// export const MQTT_IP = 'pqmcn.com:8085/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt export const MQTT_IP = 'pqmcn.com:8085/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
export const MQTT_IP = '192.168.1.103:38083/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt // export const MQTT_IP = '192.168.1.103:38083/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
// export const MQTT_IP = '192.168.1.103:38083/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
const MQTT_USERNAME = 't_user'//mqtt用户名 const MQTT_USERNAME = 't_user'//mqtt用户名
const MQTT_PASSWORD = 'njcnpqs'//密码 const MQTT_PASSWORD = 'njcnpqs'//密码

View File

@@ -83,7 +83,10 @@ function errHandler(res) {
break break
default: default:
uni.showToast({ uni.showToast({
title: res.message || res.msg || '网络异常,请稍后再试', title:
res.message.substring(res.message.indexOf(',') + 1) ||
res.msg.substring(msg.indexOf(',') + 1) ||
'网络异常,请稍后再试',
duration: 2000, duration: 2000,
icon: 'none', icon: 'none',
}) })

View File

@@ -34,7 +34,7 @@ const isCustomDebugBase = (appName = '') => {
export const checkAppUpdate = () => { export const checkAppUpdate = () => {
// #ifndef APP-PLUS // #ifndef APP-PLUS
return // return
// #endif // #endif
// 开发环境跳过检查 // 开发环境跳过检查
@@ -225,7 +225,7 @@ const downloadAndInstallApk = (url) => {
const percent = ((task.downloadedSize / task.totalSize) * 100).toFixed(0) const percent = ((task.downloadedSize / task.totalSize) * 100).toFixed(0)
console.log('🚀 ~ downloadAndInstallApk ~ percent:', percent) console.log('🚀 ~ downloadAndInstallApk ~ percent:', percent)
// 直接更新 waiting 的标题,不会闪烁 // 直接更新 waiting 的标题,不会闪烁
progressWaiting.setTitle(`正在下载更新 ${percent}%`) progressWaiting.setTitle(`正在下载更新...`)
} }
}) })

View File

@@ -183,35 +183,6 @@ const validatePhoneNumber = (phone) => {
return testReg.test(phone) return testReg.test(phone)
} }
const getUserLocation = (call) => {
uni.getLocation({
type: 'wgs84',
success: function (address) {
call(address)
},
fail: (err) => {
uni.showModal({
title: '提示',
content: '定位失败,请打开定位权限',
success: function (res) {
if (res.confirm) {
uni.openSetting({
success: (resSett) => {
if (resSett.authSetting['scope.userLocation']) {
uni.getLocation({
success: (address) => {
call && call(address)
},
})
}
},
})
}
},
})
},
})
}
// 加载用户配置 // 加载用户配置
var globalConfigIsLoading = false, var globalConfigIsLoading = false,
@@ -349,7 +320,6 @@ export default {
formatTime, formatTime,
parseTime, parseTime,
h5Helper, h5Helper,
getUserLocation,
loadConfig, loadConfig,
prePage, prePage,
loginSuccess, loginSuccess,

View File

@@ -12,7 +12,7 @@
:style="{ color: confirmColor }" :style="{ color: confirmColor }"
hover-class="hover-c" hover-class="hover-c"
@tap="_confirm" @tap="_confirm"
>确定</view >完成</view
> >
</view> </view>
<view class="tki-tree-bar1"> <view class="tki-tree-bar1">

View File

@@ -4,18 +4,18 @@
<view class="mask" v-if="show" @tap="show = false" @touchmove.stop.prevent></view> <view class="mask" v-if="show" @tap="show = false" @touchmove.stop.prevent></view>
<!-- 按钮 --> <!-- 按钮 -->
<view class="major-box" :class="{ show: show }"> <view class="major-box" :class="{ show: show }">
<view <view class="click-btn" v-if="!show" @tap="show = !show" draggable="true">
class="click-btn"
v-if="!show"
@tap="show = !show"
draggable="true"
> <!-- <view>&lt;&nbsp;</view> -->
<!-- @touchstart="touchstart" <uni-icons type="left" size="26" color="#645555"></uni-icons>
@touchmove.stop.prevent="touchmove" -->
<view>&lt;&nbsp;</view>
</view> </view>
<view class="nav-box" v-if="show" style="max-width: 320px;"> <view class="nav-box" v-if="show" style="max-width: 320px;">
<view class="click-btn click-btn-right" @tap="show = !show" draggable="true">
<!-- <view>&gt;&nbsp;</view> -->
<uni-icons type="right" size="26" color="#645555"></uni-icons>
</view>
<view class="nav-box-list">
<view class="nav-btn" v-for="(btn, index) in btnList" :key="index" @tap="clickBtn(btn)"> <view class="nav-btn" v-for="(btn, index) in btnList" :key="index" @tap="clickBtn(btn)">
<view class="nav-icon"> <view class="nav-icon">
<image class="icon" :src="btn.iconPath"></image> <image class="icon" :src="btn.iconPath"></image>
@@ -25,6 +25,7 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
@@ -40,7 +41,7 @@ export default {
show: false, // 是否显示 show: false, // 是否显示
deviationTop: 0, // 偏移量 deviationTop: 0, // 偏移量
windowHeight: uni.getSystemInfoSync().windowHeight, // 视图高度 windowHeight: uni.getSystemInfoSync().windowHeight, // 视图高度
// btnList: [ // btnList1: [
// // 所有按钮 // // 所有按钮
// { // {
// text: '首页', // text: '首页',
@@ -84,7 +85,7 @@ export default {
// 点击按钮 // 点击按钮
clickBtn: function (type) { clickBtn: function (type) {
// console.log(`123`, type) // console.log(`123`, type)
this.$emit('trigger',type) this.$emit('trigger', type)
}, },
// 拖动开始,记录一下偏移量 // 拖动开始,记录一下偏移量
touchstart: function (e) { touchstart: function (e) {
@@ -142,51 +143,71 @@ export default {
.nav-box { .nav-box {
background-color: #fff; background-color: #fff;
border-radius: 0 0 0 5px; border-radius: 0 0 0 5px;
padding: 5px 0;
} }
.click-btn { .click-btn {
width: 20px; display: flex;
height: 40px; align-items: center;
background-color: #999; justify-content: center;
width: 30px;
min-height: 40px;
height: 100%;
background-color: #d8d7d7;
color: #fff; color: #fff;
opacity: 0.8; opacity: 0.8;
text-align: center; text-align: center;
border-radius: 50px 0 0 50px; border-radius: 50px 0 0 50px;
padding: 6px 0; padding: 6px 0;
font-weight: 700;
} }
.click-btn uni-view { .click-btn uni-view {
line-height: 40px; line-height: 40px;
font-size: 12px; font-size: 15px;
} }
.click-btn view { .click-btn view {
padding-left: 8px; padding-left: 8px;
} }
.click-btn-right {
background-color: #d8d7d7;
margin-left: 5px;
}
/* 按钮盒子 */ /* 按钮盒子 */
.nav-box { .nav-box {
display: flex; display: flex;
flex-wrap: wrap;
text-align: center; text-align: center;
padding-left: 20px; align-items: center;
/* justify-content: center; */
background-color: #d8d7d7; background-color: #d8d7d7;
color: #000; color: #000;
font-size: 12rpx; font-size: 12rpx;
/* opacity: 0.8; */
text-align: center; text-align: center;
border-radius: 50px 0 0 50px; border-radius: 50px 0 0 50px;
}
/* border-width: 0px; */ .nav-box-list{
display: flex;
flex-wrap: wrap;
text-align: center;
align-items: center;
gap: 8px 0;
background-color: #d8d7d7;
color: #000;
font-size: 12rpx;
text-align: center;
} }
.nav-btn { .nav-btn {
/* flex: 1; */ /* flex: 1; */
border: 0px #000 solid; border: 0px #000 solid;
min-width: 63px; min-width: 55px;
padding: 5px 0 5px 0;
} }
.icon { .icon {

View File

@@ -2,7 +2,7 @@
"name" : "灿能物联", "name" : "灿能物联",
"appid" : "__UNI__88BC25B", "appid" : "__UNI__88BC25B",
"description" : "", "description" : "",
"versionName" : "1.6.82", "versionName" : "1.6.83",
"versionCode" : 170, "versionCode" : 170,
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
@@ -143,6 +143,7 @@
"/api" : { "/api" : {
"https" : true, "https" : true,
// "target" : "https://pqmcn.com:8092/api", // "target" : "https://pqmcn.com:8092/api",
// "target" : "http://192.168.1.102:27707/api",
"target" : "http://192.168.1.103:10215", "target" : "http://192.168.1.103:10215",
"changOrigin" : true, "changOrigin" : true,
"pathRewrite" : { "pathRewrite" : {

View File

@@ -125,7 +125,7 @@
{ {
"path": "pages/index/comp/monitoringPoint", "path": "pages/index/comp/monitoringPoint",
"style": { "style": {
"navigationBarTitleText": "监测点电能质量信息", "navigationBarTitleText": "关键指标概览",
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"pullToRefresh": { "pullToRefresh": {
"support":true, "support":true,
@@ -234,13 +234,13 @@
{ {
"path": "pages/device/APF/about", "path": "pages/device/APF/about",
"style": { "style": {
"navigationBarTitleText": "关于" "navigationBarTitleText": "详情"
} }
}, },
{ {
"path": "pages/device/DVR/about", "path": "pages/device/DVR/about",
"style": { "style": {
"navigationBarTitleText": "关于" "navigationBarTitleText": "详情"
} }
}, },
{ {
@@ -446,12 +446,7 @@
"navigationBarTitleText": "服务内容配置" "navigationBarTitleText": "服务内容配置"
} }
}, },
{
"path": "pages/mine/transientSetting",
"style": {
"navigationBarTitleText": "暂态事件配置"
}
},
{ {
"path": "pages/user/erweima", "path": "pages/user/erweima",
"style": { "style": {

View File

@@ -1,86 +1,70 @@
<template> <template>
<view> <view>
<uni-load-more status="loading" v-if="IOData.length == 0"></uni-load-more> <uni-load-more status="loading" v-if="IOData.length == 0"></uni-load-more>
<view class="basic" v-else> <view class="basic mt10" v-else>
<view class="grid-card"> <view class="params-wrap">
<text> <view class="section-title-row">
<view class="grid-card-title grid-card-title-with-icon"></view>温度 <view class="section-title">
</text> <view class="grid-card-title-with-icon"></view>
<view class="grid-card-content-4"> <text>温度</text>
<template v-for="item in renderData"> </view>
<view class="item item-title">{{ item[0].clDid }} </view>
<template v-if="item[0].clDid"> (°C)</template> <view class="params-section">
</view> <view
<view class="item item-title">{{ item[1].clDid }} v-for="(rowItems, rowIdx) in chunkedChildren(temperatureCards)"
<template v-if="item[1].clDid"> (°C)</template> :key="'temp-' + rowIdx"
</view> class="double-row"
<view class="item item-title">{{ item[2].clDid }} >
<template v-if="item[2].clDid"> (°C)</template> <view v-for="(child, childIdx) in rowItems" :key="childIdx" class="param-group">
</view> <view class="param-title">
<view class="item item-title">{{ item[3].clDid }} <text>{{ child.name }}</text>
<template v-if="item[3].clDid"> (°C)</template> </view>
</view> <view class="param-value-wrap">
<view class="item">{{ item[0].clDid ? Math.round(item[0].value) || '-' : '' }}</view> <text class="param-value">{{ child.value }}</text>
<view class="item">{{ item[1].clDid ? Math.round(item[1].value) || '-' : '' }}</view> </view>
<view class="item">{{ item[2].clDid ? Math.round(item[2].value) || '-' : '' }}</view> </view>
<view class="item">{{ item[3].clDid ? Math.round(item[3].value) || '-' : '' }}</view> </view>
</template>
</view> </view>
</view> </view>
<!-- 运维管理员工程用户 可看 -->
<view class="grid-card"
v-if="(userInfo.authorities == 'operation_manager' || userInfo.authorities == 'engineering_user') && moduleData.length > 0">
<view class="grid-card-title">
<text><view class="grid-card-title-with-icon"></view>状态</text> <view class="params-wrap" v-if="showModuleSection">
</view> <view class="section-title-row">
<view class="grid-card-content-4"> <view class="section-title">
<template v-for="(item, index) in moduleData"> <view class="grid-card-title-with-icon"></view>
<view class="item item-title">{{ item[0].moduleName }} <text>状态</text>
<template v-if="item[0].moduleName"></template> </view>
</view> </view>
<view class="item item-title">{{ item[1].moduleName }} <view class="params-section">
<template v-if="item[1].moduleName"></template> <view
</view> v-for="(rowItems, rowIdx) in chunkedChildren(moduleCards)"
<view class="item item-title">{{ item[2].moduleName }} :key="'module-' + rowIdx"
<template v-if="item[2].moduleName"></template> class="double-row"
</view> >
<view class="item item-title">{{ item[3].moduleName }} <view v-for="(child, childIdx) in rowItems" :key="childIdx" class="param-group">
<template v-if="item[3].moduleName"></template> <view class="param-title">
</view> <text>{{ child.name }}</text>
<!-- <uni-tag :text="item[0].moduleState" :type=" item[0].moduleState=='离线'?'error' : 'success'" /> --> </view>
<view class="item">{{ item[0].moduleState }}</view> <view class="param-value-wrap">
<view class="item">{{ item[1].moduleState }}</view> <text
<view class="item">{{ item[2].moduleState }}</view> class="param-value"
<view class="item">{{ item[3].moduleState }}</view> :class="{ 'param-value--offline': child.value === '离线' }"
</template> >{{ child.value }}</text>
</view>
</view>
</view>
</view> </view>
</view> </view>
<!-- <view class="grid-card">-->
<!-- <view class="grid-card-title">干接点</view>-->
<!-- <view class="grid-card-content-4">-->
<!-- <view class="item item-title">干接点1</view>-->
<!-- <view class="item item-title">干接点2</view>-->
<!-- <view class="item item-title"></view>-->
<!-- <view class="item item-title"></view>-->
<!-- <view class="item">正常</view>-->
<!-- <view class="item">正常</view>-->
<!-- <view class="item"></view>-->
<!-- <view class="item"></view>-->
<!-- </view>-->
<!-- </view>-->
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { getModuleState } from '@/common/api/harmonic.js' import { getModuleState } from '@/common/api/harmonic.js'
export default { export default {
props: { props: {
IOData: { IOData: {
type: Array, type: Array,
default: () => { default: () => [],
return []
},
}, },
ndid: { ndid: {
type: String, type: String,
@@ -90,88 +74,175 @@ export default {
return { return {
list: [], list: [],
userInfo: {}, userInfo: {},
flag: false,
} }
}, },
computed: { computed: {
renderData() { renderData() {
let arr = [] const arr = []
const data = this.IOData || []
// 把IOData转换成每4个一组的二维数组 for (let i = 0; i < data.length; i += 4) {
for (let i = 0; i < this.IOData.length; i += 4) { const group = data.slice(i, i + 4).map((item) => {
this.IOData.slice(i, i + 4).forEach((item) => { const next = { ...item }
if (Number.isInteger(item.value) || item.value == '') { if (!Number.isInteger(next.value) && next.value !== '') {
} else { next.value = (next.value - 0).toFixed(2)
item.value = (item.value - 0).toFixed(2)
} }
return next
}) })
arr.push(this.IOData.slice(i, i + 4)) while (group.length < 4) {
group.push({})
} }
// 把每组的长度补齐到4 arr.push(group)
arr.forEach((item) => {
if (item.length < 4) {
let length = 4 - item.length
for (let i = 0; i < length; i++) {
item.push({})
} }
}
})
return arr return arr
}, },
moduleData() { moduleData() {
let arr = [] const arr = []
// 把IOData转换成每4个一组的二维数组
for (let i = 0; i < this.list.length; i += 4) { for (let i = 0; i < this.list.length; i += 4) {
arr.push(this.list.slice(i, i + 4)) const group = this.list.slice(i, i + 4)
while (group.length < 4) {
group.push({})
} }
// 把每组的长度补齐到4 arr.push(group)
arr.forEach((item) => {
if (item.length < 4) {
let length = 4 - item.length
for (let i = 0; i < length; i++) {
item.push({})
} }
}
})
console.warn(arr)
return arr return arr
}, },
temperatureCards() {
const cards = []
this.renderData.forEach((row) => {
row.forEach((item) => {
if (!item.clDid) return
cards.push({
name: `${item.clDid} (°C)`,
value: Math.round(item.value) ,
})
})
})
return cards
},
moduleCards() {
const cards = []
this.moduleData.forEach((row) => {
row.forEach((item) => {
if (!item.moduleName) return
cards.push({
name: item.moduleName,
value: item.moduleState ,
})
})
})
return cards
},
showModuleSection() {
return (
(this.userInfo.authorities === 'operation_manager' ||
this.userInfo.authorities === 'engineering_user') &&
this.moduleCards.length > 0
)
},
},
mounted() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.info()
}, },
methods: { methods: {
info() { info() {
getModuleState({ getModuleState({
id: this.ndid, id: this.ndid,
}).then((res) => { }).then((res) => {
this.list = res.data this.list = res.data || []
}) })
}, },
chunkedChildren(children) {
const result = []
for (let i = 0; i < children.length; i += 2) {
result.push(children.slice(i, i + 2))
}
return result
}, },
mounted() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.info()
}, },
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.basic { .basic {
.params-wrap {
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 10rpx;
overflow: hidden;
}
.section-title-row {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 12rpx;
padding: 20rpx 20rpx 0;
}
.section-title {
display: flex;
align-items: center;
font-size: 30rpx;
font-weight: 600;
color: #333;
}
.grid-card-title-with-icon { .grid-card-title-with-icon {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
position: relative; position: relative;
padding-left: 20rpx;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8rpx; width: 8rpx;
height: 28rpx; height: 28rpx;
margin-right: 12rpx;
background: $uni-theme-color; background: $uni-theme-color;
border-radius: 3rpx; border-radius: 3rpx;
} }
.params-section {
padding: 16rpx 16rpx 20rpx;
}
.double-row {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16rpx;
margin-bottom: 16rpx;
&:last-child {
margin-bottom: 0;
}
}
.param-group {
min-width: 0;
background: #f3f3f3;
border-radius: 16rpx;
padding: 16rpx 8rpx 12rpx;
}
.param-title {
font-size: 26rpx;
color: #666666;
margin-bottom: 8rpx;
padding-left: 4rpx;
}
.param-value-wrap {
display: flex;
justify-content: center;
align-items: center;
padding: 4rpx;
}
.param-value {
font-size: 28rpx;
font-weight: 700;
color: #333;
&--offline {
color: #ff3b30;
}
} }
} }
</style> </style>

View File

@@ -1,115 +1,105 @@
<template> <template>
<view> <view>
<uni-load-more status="loading" <uni-load-more status="loading" v-if="!isDataReady"></uni-load-more>
v-if="renderData.电网电流.length == 0 || renderData.电网电压.length == 0 || renderData.负载电流.length == 0 || renderData.补偿电流.length == 0"></uni-load-more> <view class="basic mt10" v-else>
<view class="basic" v-else> <view class="params-wrap" v-for="(section, ind) in sections" :key="section.title">
<view class="grid-card"> <view class="section-title-row">
<view class="section-title">
<text> <view class="grid-card-title-with-icon"></view>
<view class="grid-card-title grid-card-title-with-icon"></view>电网电流 <text>{{ section.title }}</text>
</text> </view>
<view class="legend-row" v-if="ind == 0">
<view class="grid-card-content-3"> <view class="legend-item" v-for="phase in phaseColors" :key="phase.name">
<view class="item item-title">名称</view> <view class="legend-dot" :style="{ background: phase.color }" />
<view class="item item-title">有效值(A)</view> <text class="legend-text">{{ phase.name }}</text>
<view class="item item-title">畸变率(%)</view>
<template v-for="(item, index) in renderData.电网电流">
<view class="item">{{ item.phase }}</view>
<view class="item">{{
item['Apf_RmsI_Sys(A)'] > 0 ? item['Apf_RmsI_Sys(A)'].toFixed(2) : item['Apf_RmsI_Sys(A)']
}}</view>
<view class="item">{{
item['Apf_ThdA_Sys(%)'] > 0 ? item['Apf_ThdA_Sys(%)'].toFixed(2) : item['Apf_ThdA_Sys(%)']
}}</view>
</template>
</view> </view>
</view> </view>
<view class="grid-card"> </view>
<view class="params-section">
<text> <view v-for="(rowItems, rowIdx) in chunkedChildren(getSectionCards(section))" :key="rowIdx"
<view class="grid-card-title grid-card-title-with-icon"></view>电网电压 class="double-row">
</text> <view v-for="(child, childIdx) in rowItems" :key="childIdx" class="param-group">
<view class="param-title">
<view class="grid-card-content-4"> <text>{{ child.name }}</text>
<view class="item item-title">名称</view> </view>
<view class="item item-title">电压(V)</view> <view class="phase-vertical">
<view class="item item-title">频率(Hz)</view> <view class="phase-item-vertical">
<view class="item item-title">畸变率(%)</view> <text class="phase-value-vertical" :style="{ color: phaseColors[0].color }">{{
<template v-for="(item, index) in renderData.电网电压"> child.A
<view class="item">{{ item.phase }}</view> }}</text>
<view class="item">{{ </view>
item['Apf_PhV_Sys(V)'] > 0 ? item['Apf_PhV_Sys(V)'].toFixed(2) : item['Apf_PhV_Sys(V)'] <view class="phase-divider" />
}}</view> <view class="phase-item-vertical">
<view class="item">{{ <text class="phase-value-vertical" :style="{ color: phaseColors[1].color }">{{
item['Apf_Freq(Hz)'] > 0 ? item['Apf_Freq(Hz)'].toFixed(2) : item['Apf_Freq(Hz)'] child.B
}}</view> }}</text>
<view class="item">{{ </view>
item['Apf_ThdU_Sys(%)'] > 0 ? item['Apf_ThdU_Sys(%)'].toFixed(2) : item['Apf_ThdU_Sys(%)'] <view class="phase-divider" />
}}</view> <view class="phase-item-vertical">
</template> <text class="phase-value-vertical" :style="{ color: phaseColors[2].color }">{{
child.C
}}</text>
</view> </view>
</view> </view>
<view class="grid-card">
<text>
<view class="grid-card-title grid-card-title-with-icon"></view>负载电流
</text>
<view class="grid-card-content-3">
<view class="item item-title">名称</view>
<view class="item item-title">有效值(A)</view>
<view class="item item-title">畸变率(%)</view>
<template v-for="(item, index) in renderData.负载电流">
<view class="item">{{ item.phase }}</view>
<view class="item">{{
item['Apf_RmsI_Load(A)'] > 0
? item['Apf_RmsI_Load(A)'].toFixed(2)
: item['Apf_RmsI_Load(A)']
}}</view>
<view class="item">{{
item['Apf_ThdA_Load(%)'] > 0
? item['Apf_ThdA_Load(%)'].toFixed(2)
: item['Apf_ThdA_Load(%)']
}}</view>
</template>
</view> </view>
</view> </view>
<view class="grid-card">
<text>
<view class="grid-card-title grid-card-title-with-icon"></view>补偿电流
</text>
<view class="grid-card-content-3">
<view class="item item-title">名称</view>
<view class="item item-title">有效值(A)</view>
<view class="item item-title">负载率(%)</view>
<template v-for="(item, index) in renderData.补偿电流">
<view class="item">{{ item.phase }}</view>
<view class="item">{{
item['Apf_RmsI_TolOut(A)'] == 3.1415926
? '-'
: item['Apf_RmsI_TolOut(A)'] > 0
? item['Apf_RmsI_TolOut(A)'].toFixed(2)
: item['Apf_RmsI_TolOut(A)']
}}</view>
<view class="item">{{
item['load_Rate'] == 3.1415926
? '-'
: item['load_Rate'] > 0
? item['load_Rate'].toFixed(2)
: item['load_Rate']
}}</view>
</template>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
const SECTIONS = [
{
title: '电网电流',
dataKey: '电网电流',
metrics: [
{ label: '有效值(A)', field: 'Apf_RmsI_Sys(A)' },
{ label: '畸变率(%)', field: 'Apf_ThdA_Sys(%)' },
],
},
{
title: '电网电压',
dataKey: '电网电压',
metrics: [
{ label: '电压(V)', field: 'Apf_PhV_Sys(V)' },
{ label: '频率(Hz)', field: 'Apf_Freq(Hz)' },
{ label: '畸变率(%)', field: 'Apf_ThdU_Sys(%)' },
],
},
{
title: '负载电流',
dataKey: '负载电流',
metrics: [
{ label: '有效值(A)', field: 'Apf_RmsI_Load(A)' },
{ label: '畸变率(%)', field: 'Apf_ThdA_Load(%)' },
],
},
{
title: '补偿电流',
dataKey: '补偿电流',
metrics: [
{ label: '有效值(A)', field: 'Apf_RmsI_TolOut(A)' },
{ label: '负载率(%)', field: 'load_Rate' },
],
},
]
export default { export default {
props: {
basicData: {
type: Array,
default: () => [],
},
},
data() { data() {
return { return {
sections: SECTIONS,
phaseColors: [
{ name: 'A相', color: '#F1B22E' },
{ name: 'B相', color: '#2BA471' },
{ name: 'C相', color: '#D54941' },
],
renderData: { renderData: {
电网电流: [], 电网电流: [],
电网电压: [], 电网电压: [],
@@ -119,101 +109,209 @@ export default {
}, },
} }
}, },
props: { computed: {
basicData: { isDataReady() {
type: Array, return (
default: () => { this.renderData.电网电流.length > 0 &&
return [] this.renderData.电网电压.length > 0 &&
}, this.renderData.负载电流.length > 0 &&
this.renderData.补偿电流.length > 0
)
}, },
}, },
watch: { watch: {
basicData: { basicData: {
handler: function (newVal, oldVal) { handler(newVal) {
newVal.forEach((item) => { this.renderData = {
电网电流: [],
电网电压: [],
负载电流: [],
补偿电流: [],
未知: [],
}
; (newVal || []).forEach((item) => {
if (item.phase === 'avg') { if (item.phase === 'avg') {
return return
} }
let key = '' const key = this.getDataKey(item.statisticalName)
switch (item.statisticalName) { const index = this.renderData[key].findIndex((item2) => item2.phase === item.phase)
case 'Apf_RmsI_Sys(A)':
key = '电网电流'
break
case 'Apf_ThdA_Sys(%)':
key = '电网电流'
break
case 'Apf_PhV_Sys(V)':
key = '电网电压'
break
case 'Apf_Freq(Hz)':
key = '电网电压'
break
case 'Apf_ThdU_Sys(%)':
key = '电网电压'
break
case 'Apf_RmsI_Load(A)':
key = '负载电流'
break
case 'Apf_ThdA_Load(%)':
key = '负载电流'
break
case 'Apf_RmsI_TolOut(A)':
key = '补偿电流'
break
case 'Apf_PhV_Sys(V)':
key = '补偿电流'
break
case 'Apf_PhV_Sys(V)':
key = '补偿电流'
break
case 'load_Rate':
key = '补偿电流'
break
default:
key = '未知'
break
}
let index = this.renderData[key].findIndex((item2) => {
return item2.phase === item.phase
})
if (index > -1) { if (index > -1) {
this.renderData[key][index][item.statisticalName] = item.statisticalData // this.renderData[key][index][item.statisticalName] = item.statisticalData
} else { } else {
this.renderData[key].push({ this.renderData[key].push({
phase: item.phase, phase: item.phase,
[item.statisticalName]: item.statisticalData, //, [item.statisticalName]: item.statisticalData,
}) })
} }
}) })
console.log(this.renderData)
}, },
deep: true, deep: true,
immediate: true, immediate: true,
}, },
}, },
methods: {}, methods: {
getDataKey(statisticalName) {
switch (statisticalName) {
case 'Apf_RmsI_Sys(A)':
case 'Apf_ThdA_Sys(%)':
return '电网电流'
case 'Apf_PhV_Sys(V)':
case 'Apf_Freq(Hz)':
case 'Apf_ThdU_Sys(%)':
return '电网电压'
case 'Apf_RmsI_Load(A)':
case 'Apf_ThdA_Load(%)':
return '负载电流'
case 'Apf_RmsI_TolOut(A)':
case 'load_Rate':
return '补偿电流'
default:
return '未知'
}
},
getSectionCards(section) {
const list = this.renderData[section.dataKey] || []
return section.metrics.map((metric) => ({
name: metric.label,
A: this.getPhaseValue(list, metric.field, 'A'),
B: this.getPhaseValue(list, metric.field, 'B'),
C: this.getPhaseValue(list, metric.field, 'C'),
}))
},
getPhaseValue(list, field, phase) {
const item = list.find(
(row) => String(row.phase || '').toUpperCase() === phase,
)
return this.formatValue(item[field])
},
formatValue(value) {
if (value == 3.1415926) return '-'
if (value === undefined || value === null || value === '') return '-'
const num = Number(value)
if (Number.isNaN(num)) return value
return num > 0 ? num.toFixed(2) : num
},
chunkedChildren(children) {
const result = []
for (let i = 0; i < children.length; i += 2) {
result.push(children.slice(i, i + 2))
}
return result
},
},
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.basic { .basic {
.params-wrap {
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 10rpx;
overflow: hidden;
}
.section-title-row {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 12rpx;
padding: 20rpx 20rpx 0;
}
.section-title {
display: flex;
align-items: center;
font-size: 30rpx;
font-weight: 600;
color: #333;
}
.grid-card-title-with-icon { .grid-card-title-with-icon {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
position: relative; position: relative;
padding-left: 20rpx;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8rpx; width: 8rpx;
height: 28rpx; height: 28rpx;
margin-right: 12rpx;
background: $uni-theme-color; background: $uni-theme-color;
border-radius: 3rpx; border-radius: 3rpx;
} }
.legend-row {
display: flex;
gap: 20rpx;
align-items: center;
}
.legend-item {
display: flex;
align-items: center;
gap: 8rpx;
}
.legend-dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
}
.legend-text {
font-size: 24rpx;
color: #666666;
}
.params-section {
padding: 16rpx 16rpx 20rpx;
}
.double-row {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16rpx;
margin-bottom: 16rpx;
&:last-child {
margin-bottom: 0;
}
}
.param-group {
min-width: 0;
background: #f3f3f3;
border-radius: 16rpx;
padding: 16rpx 8rpx 12rpx;
}
.param-title {
font-size: 26rpx;
color: #666666;
margin-bottom: 8rpx;
padding-left: 4rpx;
}
.phase-vertical {
display: flex;
align-items: stretch;
}
.phase-item-vertical {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
padding: 4rpx;
}
.phase-value-vertical {
font-size: 28rpx;
font-weight: 700;
}
.phase-divider {
width: 1px;
background: #d2d2d2;
margin: 8rpx 0;
} }
} }
</style> </style>

View File

@@ -1,64 +1,92 @@
<template> <template>
<view> <view>
<uni-load-more status="loading" v-if="renderData.电网侧.length == 0 || renderData.负载侧.length == 0"></uni-load-more> <uni-load-more status="loading" v-if="!isDataReady"></uni-load-more>
<view class="basic" v-else> <view class="basic mt10" v-else>
<view class="grid-card"> <view class="params-wrap" v-for="(section, ind) in sections" :key="section.title">
<text> <view class="section-title-row">
<view class="grid-card-title grid-card-title-with-icon"></view>电网侧 <view class="section-title">
</text> <view class="grid-card-title-with-icon"></view>
<view class="grid-card-content-5"> <text>{{ section.title }}</text>
<view class="item item-title">名称</view>
<view class="item item-title">有功功率(kW)</view>
<view class="item item-title">无功功率(kVar)</view>
<view class="item item-title">视在功率(kVA)</view>
<view class="item item-title">功率因数</view>
<template v-for="(item, index) in renderData.电网侧">
<view class="item">{{ item.phase }}</view>
<view class="item">{{ item['Apf_P_Sys(W)'] == '-' ? '-' : (item['Apf_P_Sys(W)'] /
1000).toFixed(2) }}
</view> </view>
<view class="item">{{ item['Apf_Q_Sys(Var)'] == '-' ? '-' : (item['Apf_Q_Sys(Var)'] / <view class="legend-row" v-if="ind == 0">
1000).toFixed(2) }} <view class="legend-item" v-for="phase in phaseColors" :key="phase.name">
</view> <view class="legend-dot" :style="{ background: phase.color }" />
<view class="item">{{ item['Apf_S_Sys(VA)'] == '-' ? '-' : (item['Apf_S_Sys(VA)'] / <text class="legend-text">{{ phase.name }}</text>
1000).toFixed(2) }} </view>
</view> </view>
<view class="item">{{ item['Apf_PF_Sys(null)'] || '-' }}</view> </view>
</template> <view class="params-section">
<view v-for="(rowItems, rowIdx) in chunkedChildren(getSectionCards(section))" :key="rowIdx"
class="double-row">
<view v-for="(child, childIdx) in rowItems" :key="childIdx" class="param-group">
<view class="param-title">
<text>{{ child.name }}</text>
</view>
<view class="phase-vertical">
<view class="phase-item-vertical">
<text class="phase-value-vertical" :style="{ color: phaseColors[0].color }">{{
child.A
}}</text>
</view>
<view class="phase-divider" />
<view class="phase-item-vertical">
<text class="phase-value-vertical" :style="{ color: phaseColors[1].color }">{{
child.B
}}</text>
</view>
<view class="phase-divider" />
<view class="phase-item-vertical">
<text class="phase-value-vertical" :style="{ color: phaseColors[2].color }">{{
child.C
}}</text>
</view> </view>
</view> </view>
<view class="grid-card">
<text>
<view class="grid-card-title grid-card-title-with-icon"></view>负载侧
</text>
<view class="grid-card-content-5">
<view class="item item-title">名称</view>
<view class="item item-title">有功功率(kW)</view>
<view class="item item-title">无功功率(kVar)</view>
<view class="item item-title">视在功率(kVA)</view>
<view class="item item-title">功率因数</view>
<template v-for="(item, index) in renderData.负载侧">
<view class="item">{{ item.phase }}</view>
<view class="item">{{ item['Apf_P_Load(W)'] == '-' ? '-' : (item['Apf_P_Load(W)'] /
1000).toFixed(2) }}
</view> </view>
<view class="item">{{
item['Apf_Q_Load(Var)'] == '-' ? '-' : (item['Apf_Q_Load(Var)'] / 1000).toFixed(2)
}}</view>
<view class="item">{{ item['Apf_S_Load(VA)'] == '-' ? '-' : (item['Apf_S_Load(VA)'] /
1000).toFixed(2) }}
</view> </view>
<view class="item">{{ item['Apf_PF_Load(null)'] || '-' }}</view>
</template>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
const SECTIONS = [
{
title: '电网侧',
dataKey: '电网侧',
metrics: [
{ label: '有功功率(kW)', field: 'Apf_P_Sys(W)', divide: 1000 },
{ label: '无功功率(kVar)', field: 'Apf_Q_Sys(Var)', divide: 1000 },
{ label: '视在功率(kVA)', field: 'Apf_S_Sys(VA)', divide: 1000 },
{ label: '功率因数', field: 'Apf_PF_Sys(null)' },
],
},
{
title: '负载侧',
dataKey: '负载侧',
metrics: [
{ label: '有功功率(kW)', field: 'Apf_P_Load(W)', divide: 1000 },
{ label: '无功功率(kVar)', field: 'Apf_Q_Load(Var)', divide: 1000 },
{ label: '视在功率(kVA)', field: 'Apf_S_Load(VA)', divide: 1000 },
{ label: '功率因数', field: 'Apf_PF_Load(null)' },
],
},
]
export default { export default {
props: {
basicData: {
type: Array,
default: () => [],
},
},
data() { data() {
return { return {
sections: SECTIONS,
phaseColors: [
{ name: 'A相', color: '#F1B22E' },
{ name: 'B相', color: '#2BA471' },
{ name: 'C相', color: '#D54941' },
],
renderData: { renderData: {
电网侧: [], 电网侧: [],
负载侧: [], 负载侧: [],
@@ -66,92 +94,210 @@ export default {
}, },
} }
}, },
props: { computed: {
basicData: { isDataReady() {
type: Array, return this.renderData.电网侧.length > 0 && this.renderData.负载侧.length > 0
default: () => {
return []
},
}, },
}, },
watch: { watch: {
basicData: { basicData: {
handler: function (newVal, oldVal) { handler(newVal) {
newVal.forEach((item) => { this.renderData = {
电网侧: [],
负载侧: [],
未知: [],
}
; (newVal || []).forEach((item) => {
if (item.phase === 'avg') { if (item.phase === 'avg') {
return return
} }
let key = '' const key = this.getDataKey(item.statisticalName)
switch (item.statisticalName) { const index = this.renderData[key].findIndex((item2) => item2.phase === item.phase)
case 'Apf_P_Sys(W)':
key = '电网侧'
break
case 'Apf_Q_Sys(Var)':
key = '电网侧'
break
case 'Apf_S_Sys(VA)':
key = '电网侧'
break
case 'Apf_PF_Sys(null)':
key = '电网侧'
break
case 'Apf_P_Load(W)':
key = '负载侧'
break
case 'Apf_Q_Load(Var)':
key = '负载侧'
break
case 'Apf_S_Load(VA)':
key = '负载侧'
break
case 'Apf_PF_Load(null)':
key = '负载侧'
break
default:
key = '未知'
break
}
let index = this.renderData[key].findIndex((item2) => {
return item2.phase === item.phase
})
if (index > -1) { if (index > -1) {
this.renderData[key][index][item.statisticalName] = item.statisticalData || '-' this.renderData[key][index][item.statisticalName] = this.normalizeStatisticalData(
item.statisticalData,
)
} else { } else {
this.renderData[key].push({ this.renderData[key].push({
phase: item.phase, phase: item.phase,
[item.statisticalName]: item.statisticalData || '-', [item.statisticalName]: this.normalizeStatisticalData(item.statisticalData),
}) })
} }
}) })
console.log(this.renderData)
}, },
deep: true, deep: true,
immediate: true, immediate: true,
}, },
}, },
methods: {}, methods: {
getDataKey(statisticalName) {
switch (statisticalName) {
case 'Apf_P_Sys(W)':
case 'Apf_Q_Sys(Var)':
case 'Apf_S_Sys(VA)':
case 'Apf_PF_Sys(null)':
return '电网侧'
case 'Apf_P_Load(W)':
case 'Apf_Q_Load(Var)':
case 'Apf_S_Load(VA)':
case 'Apf_PF_Load(null)':
return '负载侧'
default:
return '未知'
}
},
getSectionCards(section) {
const list = this.renderData[section.dataKey] || []
return section.metrics.map((metric) => ({
name: metric.label,
A: this.getPhaseValue(list, metric, 'A'),
B: this.getPhaseValue(list, metric, 'B'),
C: this.getPhaseValue(list, metric, 'C'),
}))
},
getPhaseValue(list, metric, phase = 'A') {
const item = list.find((row) => String(row.phase || '').toUpperCase() === phase)
return item ? this.formatValue(item[metric.field], metric.divide) : '-'
},
normalizeStatisticalData(value) {
if (value == 3.1415926 || value === null || value === '') {
return '-'
}
return value
},
formatValue(value, divide) {
if (value == 3.1415926 || value === null || value === '' || value === '-') {
return '-'
}
const num = Number(value)
if (Number.isNaN(num)) return value
if (divide) {
// return (num / divide).toFixed(2)
return num != 0 ? (num / divide).toFixed(2) : num
}
return num
},
chunkedChildren(children) {
const result = []
for (let i = 0; i < children.length; i += 2) {
result.push(children.slice(i, i + 2))
}
return result
},
},
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.basic { .basic {
.params-wrap {
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 10rpx;
overflow: hidden;
}
.section-title-row {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 12rpx;
padding: 20rpx 20rpx 0;
}
.section-title {
display: flex;
align-items: center;
font-size: 30rpx;
font-weight: 600;
color: #333;
}
.grid-card-title-with-icon { .grid-card-title-with-icon {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
position: relative; position: relative;
padding-left: 20rpx;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8rpx; width: 8rpx;
height: 28rpx; height: 28rpx;
margin-right: 12rpx;
background: $uni-theme-color; background: $uni-theme-color;
border-radius: 3rpx; border-radius: 3rpx;
} }
.legend-row {
display: flex;
gap: 20rpx;
align-items: center;
}
.legend-item {
display: flex;
align-items: center;
gap: 8rpx;
}
.legend-dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
}
.legend-text {
font-size: 24rpx;
color: #666666;
}
.params-section {
padding: 16rpx 16rpx 20rpx;
}
.double-row {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16rpx;
margin-bottom: 16rpx;
&:last-child {
margin-bottom: 0;
}
}
.param-group {
min-width: 0;
background: #f3f3f3;
border-radius: 16rpx;
padding: 16rpx 8rpx 12rpx;
}
.param-title {
font-size: 26rpx;
color: #666666;
margin-bottom: 8rpx;
padding-left: 4rpx;
}
.phase-vertical {
display: flex;
align-items: stretch;
}
.phase-item-vertical {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
padding: 4rpx;
}
.phase-value-vertical {
font-size: 28rpx;
font-weight: 700;
}
.phase-divider {
width: 1px;
background: #d2d2d2;
margin: 8rpx 0;
} }
} }
</style> </style>

View File

@@ -1,24 +1,14 @@
<template> <template>
<view> <view class="xieBo">
<uni-load-more status="loading" v-if="basicData.length == 0"></uni-load-more> <uni-load-more status="loading" v-if="loading"></uni-load-more>
<view v-else> <view v-else>
<div class="header-form"> <div class="header-form">
<uni-data-select <uni-data-select v-model="parity" :localdata="parityOption" @change="initEcharts" style="flex: 1"
v-model="parity" :clear="false"></uni-data-select>
:localdata="parityOption"
@change="initEcharts"
style="flex: 1"
:clear="false"
></uni-data-select>
<!-- <uni-data-checkbox v-model="dataRadio" :localdata="dataOptions" @change="initEcharts"></uni-data-checkbox> --> <!-- <uni-data-checkbox v-model="dataRadio" :localdata="dataOptions" @change="initEcharts"></uni-data-checkbox> -->
<uni-data-select <uni-data-select v-model="dataRadio" :localdata="dataOptions" @change="initEcharts"
v-model="dataRadio" style="flex: 2; margin-left: 20rpx" :clear="false"></uni-data-select>
:localdata="dataOptions"
@change="initEcharts"
style="flex: 2; margin-left: 20rpx"
:clear="false"
></uni-data-select>
</div> </div>
<view class="charts-box"> <view class="charts-box">
<!-- <view class="data-time">{{ time }}</view> --> <!-- <view class="data-time">{{ time }}</view> -->
@@ -54,6 +44,7 @@ export default {
value: 1, value: 1,
}, },
], ],
loading: true,
parity: 2, parity: 2,
time: '', time: '',
dataOptions: [], dataOptions: [],
@@ -216,7 +207,6 @@ export default {
watch: { watch: {
basicData: { basicData: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
console.log(this.basicData)
let basicData = JSON.parse(JSON.stringify(this.basicData)) let basicData = JSON.parse(JSON.stringify(this.basicData))
// this.dataRadio = 0 // this.dataRadio = 0
this.renderData = { this.renderData = {
@@ -284,9 +274,9 @@ export default {
}) })
}) })
this.dataOptions = dataOptions this.dataOptions = dataOptions
console.log(dataOptions)
this.initEcharts()
this.initEcharts()
this.loading = false
this.time = this.$util.parseTime(this.dataTime - 8 * 60 * 60) this.time = this.$util.parseTime(this.dataTime - 8 * 60 * 60)
}, },
deep: true, deep: true,
@@ -365,13 +355,29 @@ export default {
}, 100) }, 100)
}, },
}, },
mounted() {
this.loading = true
setTimeout(() => {
this.loading = false
}, 5000)
},
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.xieBo {
margin-top: 10rpx;
background-color: #fff;
padding: 20rpx;
border-radius: 10rpx;
}
.charts-box { .charts-box {
margin-top: 20rpx; margin-top: 20rpx;
height: 100vh; height: 100vh;
.data-time { .data-time {
position: absolute; position: absolute;
right: 20rpx; right: 20rpx;
@@ -379,6 +385,7 @@ export default {
font-size: 24rpx; font-size: 24rpx;
} }
} }
.header-form { .header-form {
display: flex; display: flex;
} }

View File

@@ -25,8 +25,8 @@
<template v-for="(item, index) in IOData"> <template v-for="(item, index) in IOData">
<view class="item">{{ item.clDid }}</view> <view class="item">{{ item.clDid }}</view>
<view class="item" style="font-weight: 700"> <view class="item" style="font-weight: 700">
{{ Math.floor(item.value) || '-' }} {{ Math.floor(item.value) }}
<view v-if="item.value"> °C</view> <view> °C</view>
</view> </view>
</template> </template>
<template v-for="(item, index) in 3 - (IOData.length % 3)"> <template v-for="(item, index) in 3 - (IOData.length % 3)">
@@ -170,7 +170,7 @@ export default {
// }, // },
{ {
iconPath: '/static/about.png', iconPath: '/static/about.png',
text: '关于', text: '详情',
}, },
// { // {
// iconPath: '/static/access.png', // iconPath: '/static/access.png',
@@ -235,7 +235,7 @@ export default {
uni.switchTab({ uni.switchTab({
url: '/pages/index/message1', url: '/pages/index/message1',
}) })
} else if (e.text === '关于') { } else if (e.text === '详情') {
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId }) uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId })
} else if (e.text === '移交') { } else if (e.text === '移交') {
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.devId }) uni.navigateTo({ url: '/pages/device/transfer?id=' + this.devId })
@@ -673,8 +673,9 @@ export default {
.header { .header {
position: relative; position: relative;
width: 375px; width: 100vw;
margin: 0 auto; display: flex;
justify-content: center;
overflow: hidden; overflow: hidden;
image { image {

View File

@@ -98,7 +98,7 @@ export default {
// }, // },
{ {
iconPath: '/static/about.png', iconPath: '/static/about.png',
text: '关于', text: '详情',
}, },
// { // {
// iconPath: '/static/access.png', // iconPath: '/static/access.png',
@@ -130,7 +130,7 @@ export default {
uni.navigateTo({ url: '/pages/device/DVR/record' }) uni.navigateTo({ url: '/pages/device/DVR/record' })
} else if (e.text === '事件') { } else if (e.text === '事件') {
uni.navigateTo({ url: '/pages/device/DVR/report' }) uni.navigateTo({ url: '/pages/device/DVR/report' })
} else if (e.text === '关于') { } else if (e.text === '详情') {
uni.navigateTo({ url: '/pages/device/DVR/about' }) uni.navigateTo({ url: '/pages/device/DVR/about' })
} else if (e.text === '移交') { } else if (e.text === '移交') {
uni.navigateTo({ url: '/pages/device/transfer' }) uni.navigateTo({ url: '/pages/device/transfer' })

View File

@@ -95,7 +95,7 @@
@change="positionChange" :clear="false" disabled></uni-data-select> @change="positionChange" :clear="false" disabled></uni-data-select>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="别名"> <uni-forms-item label="别名">
<uni-easyinput :clearable="false" type="text" v-model="point.alias" <uni-easyinput :clearable="false" maxlength="24" type="text" v-model="point.alias"
@change="aliasChange" placeholder="别名(非必填)" /> @change="aliasChange" placeholder="别名(非必填)" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="绑定指标"> <uni-forms-item label="绑定指标">

View File

@@ -492,6 +492,6 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 99; z-index: 1;
} }
</style> </style>

View File

@@ -107,7 +107,7 @@
@change="positionChange" disabled :clear="false"></uni-data-select> @change="positionChange" disabled :clear="false"></uni-data-select>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="别名"> <uni-forms-item label="别名">
<uni-easyinput :clearable="false" type="text" v-model="point.alias" <uni-easyinput :clearable="false" maxlength="24" type="text" v-model="point.alias"
@change="aliasChange" placeholder="别名(非必填)" /> @change="aliasChange" placeholder="别名(非必填)" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="绑定指标"> <uni-forms-item label="绑定指标">
@@ -369,7 +369,7 @@ export default {
}, },
changeAuth() { changeAuth() {
uni.scanCode({ uni.scanCode({
onlyFromCamera: true, onlyFromCamera: false,
success: (res) => { success: (res) => {
console.log('条码类型:' + res.scanType) console.log('条码类型:' + res.scanType)
console.log('条码内容:' + res.result) console.log('条码内容:' + res.result)

View File

@@ -21,7 +21,10 @@
所属工程<view>{{ device.engineeringName }}</view> 所属工程<view>{{ device.engineeringName }}</view>
</view> </view>
<view class="info-item"> <view class="info-item">
所属项目<view>{{ device.equipmentName }}</view> 所属项目<view>{{ device.projectName }}</view>
</view>
<view class="info-item">
所属设备<view>{{ device.equipmentName }}</view>
</view> </view>
<view class="info-item status"> <view class="info-item status">
@@ -87,9 +90,14 @@
</view> </view>
<!-- 底部指标数据 --> <!-- 底部指标数据 -->
<view class="params-wrap"> <view class="params-wrap ">
<view class="legend-row mt10">
<view class="params-section"> <view class="legend-item" v-for="phase in phaseColors" :key="phase.name">
<view class="legend-dot" :style="{ background: phase.color }" />
<text class="legend-text">{{ phase.name }}</text>
</view>
</view>
<view class="params-section mb40">
<view v-for="(rowItems, rowIdx) in chunkedChildren(realTimeData)" :key="rowIdx" <view v-for="(rowItems, rowIdx) in chunkedChildren(realTimeData)" :key="rowIdx"
class="double-row"> class="double-row">
<view v-for="(child, childIdx) in rowItems" :key="childIdx" class="param-group"> <view v-for="(child, childIdx) in rowItems" :key="childIdx" class="param-group">
@@ -135,7 +143,11 @@ export default {
data() { data() {
return { return {
loading: true, loading: true,
phaseColors: [
{ name: 'A相', color: '#F1B22E' },
{ name: 'B相', color: '#2BA471' },
{ name: 'C相', color: '#D54941' },
],
deviceInfo: {}, deviceInfo: {},
// 使用上面定义的图表配置项 // 使用上面定义的图表配置项
option: {}, option: {},
@@ -190,7 +202,7 @@ export default {
}, },
{ {
iconPath: '/static/about.png', iconPath: '/static/about.png',
text: '关于', text: '详情',
}, },
], ],
device: {}, device: {},
@@ -969,7 +981,7 @@ export default {
url: '/pages/index/message1', url: '/pages/index/message1',
}) })
// uni.navigateTo({ url: '/pages/device/APF/report?id=' + this.device.equipmentId }) // uni.navigateTo({ url: '/pages/device/APF/report?id=' + this.device.equipmentId })
} else if (e.text === '关于') { } else if (e.text === '详情') {
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.device.equipmentId }) uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.device.equipmentId })
} else if (e.text === '移交') { } else if (e.text === '移交') {
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.device.equipmentId }) uni.navigateTo({ url: '/pages/device/transfer?id=' + this.device.equipmentId })
@@ -1191,4 +1203,29 @@ export default {
height: 45rpx; height: 45rpx;
line-height: 45rpx; line-height: 45rpx;
} }
.legend-row {
display: flex;
gap: 20rpx;
align-items: center;
justify-content: end;
padding: 16rpx 20rpx;
}
.legend-item {
display: flex;
align-items: center;
gap: 8rpx;
}
.legend-dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
}
.legend-text {
font-size: 24rpx;
color: #666666;
}
</style> </style>

View File

@@ -10,10 +10,8 @@
<view class="message"> <view class="message">
<uni-swipe-action>
<uni-swipe-action-item v-for="(item, index) in store.data" <view v-for="(item, index) in store.data" :key="index" style="margin: 0px 7px 7px;">
:style="{ marginTop: index === 0 ? '0' : '' }" :key="index" :threshold="0"
:right-options="item.isTop == 0 ? options1 : options12" @click="bindClick($event, item)">
<!-- extra="🔍" --> <!-- extra="🔍" -->
<uni-card class="boxClick" :title="item.name" @click="jump(item)"> <uni-card class="boxClick" :title="item.name" @click="jump(item)">
<view class="term-list-bottom"> <view class="term-list-bottom">
@@ -26,10 +24,9 @@
<view>{{ item.createTime }}</view> <view>{{ item.createTime }}</view>
</view> </view>
</view> </view>
<view class="pinToTop" v-if="item.isTop == 1"> 置顶 </view>
</uni-card> </uni-card>
</uni-swipe-action-item> </view>
</uni-swipe-action>

View File

@@ -6,7 +6,7 @@
<page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta> <page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta>
<uni-forms :label-width="80"> <uni-forms :label-width="80">
<uni-forms-item label="工程名称"> <uni-forms-item label="工程名称">
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入工程名称"/> <uni-easyinput type="text" v-model="formData.name" maxlength="50" placeholder="请输入工程名称"/>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="位置"> <uni-forms-item label="位置">
<!-- <view style="display:flex;"> <!-- <view style="display:flex;">

View File

@@ -25,11 +25,8 @@
<template v-slot:header> <template v-slot:header>
<view class="slot-box"> <view class="slot-box">
<view class="slot-box-left hide-txt mr20">{{ item.engineerName }}</view> <view class="slot-box-left hide-txt mr20">{{ item.engineerName }}</view>
<switch <switch :checked="selectList.indexOf(item.engineerId) > -1" style="transform: scale(0.8)"
:checked="selectList.indexOf(item.engineerId) > -1" @change="switchChange(item)" />
style="transform: scale(0.8)"
@change="switchChange(item)"
/>
</view> </view>
</template> </template>
</uni-list-item> </uni-list-item>
@@ -74,8 +71,9 @@ export default {
init() { init() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo) this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
queryAllEnginner().then((res) => { queryAllEnginner().then((res) => {
this.list = res.data this.list = (res.data || []).slice().sort((a, b) =>
console.log(this.list) (a.engineerName || '').localeCompare(b.engineerName || '', 'zh', { sensitivity: 'accent' }),
)
this.selectList = res.data.filter((item) => item.isSelect === '1').map((item) => item.engineerId) this.selectList = res.data.filter((item) => item.isSelect === '1').map((item) => item.engineerId)
console.log(this.selectList) console.log(this.selectList)
this.loading = false this.loading = false

View File

@@ -24,7 +24,7 @@
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="位置"> <uni-forms-item label="位置">
<view style="display:flex;"> <view style="display:flex;">
<uni-easyinput :clearable="false" type="textarea" autoHeight v-model="formData.address" <uni-easyinput :clearable="false" maxlength="250" type="textarea" autoHeight v-model="formData.address"
placeholder="请输入位置信息" /> placeholder="请输入位置信息" />
<!-- <uni-icons type="location" color="#007aff" size="26" class="ml20" <!-- <uni-icons type="location" color="#007aff" size="26" class="ml20"
@click="chooseLocation"></uni-icons> --> @click="chooseLocation"></uni-icons> -->

View File

@@ -65,7 +65,7 @@
<view class="content"> <view class="content">
<view class="content-des">请拖动图中的蓝色定位图标选择监测点位置(左上角)</view> <view class="content-des">请拖动图中的蓝色定位图标选择监测点位置(左上角)</view>
<uni-forms> <uni-forms>
<uni-easyinput type="text" v-model="pointName" placeholder="请输入设监测点名称" /> <uni-easyinput type="text" v-model="pointName" maxlength="24" placeholder="请输入设监测点名称" />
</uni-forms> </uni-forms>
<view class="btn-wrap"> <view class="btn-wrap">
<view class="btn-wrap-item" @click="closeDrawer"> 取消 </view> <view class="btn-wrap-item" @click="closeDrawer"> 取消 </view>

View File

@@ -8,10 +8,10 @@
<uni-data-select v-model="item.type" :localdata="range"></uni-data-select> <uni-data-select v-model="item.type" :localdata="range"></uni-data-select>
</uni-forms-item> --> </uni-forms-item> -->
<uni-forms-item label="标题"> <uni-forms-item label="标题">
<uni-easyinput type="text" v-model="formData.title" placeholder="请输入问题简要"/> <uni-easyinput type="text" v-model="formData.title" maxlength="32" placeholder="请输入问题简要"/>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="描述"> <uni-forms-item label="描述">
<uni-easyinput type="textarea" v-model="formData.description" placeholder="请输入详细描述"/> <uni-easyinput type="textarea" v-model="formData.description" maxlength="999" placeholder="请输入详细描述"/>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="图片"> <uni-forms-item label="图片">
<uni-file-picker :auto-upload="false" @select="fileChange" @delete="delImg"> <uni-file-picker :auto-upload="false" @select="fileChange" @delete="delImg">
@@ -23,9 +23,9 @@
<view class="btn-wrap"> <view class="btn-wrap">
<view class="btn-wrap-item " @click="submit"> 提交</view> <view class="btn-wrap-item " @click="submit"> 提交</view>
</view> </view>
<navigator url="/pages/home/service" hover-class="none" class="fixed-btn"> <!-- <navigator url="/pages/home/service" hover-class="none" class="fixed-btn">
<image src="/static/service.png" style="height:66rpx;width:66rpx"/> <image src="/static/service.png" style="height:66rpx;width:66rpx"/>
</navigator> </navigator> -->
</view> </view>
</view> </view>
</Cn-page> </Cn-page>
@@ -83,6 +83,7 @@ export default {
}) })
return return
} }
console.log("🚀 ~ this.formData:", this.formData)
addFeedBack(this.formData).then(res => { addFeedBack(this.formData).then(res => {
console.log(res) console.log(res)
console.log(this.formData.files.length) console.log(this.formData.files.length)

View File

@@ -9,11 +9,11 @@
</view> </view>
<view class="smallLabel mt20"> <view class="smallLabel mt20">
<view class="boxCenter"> <view class="boxCenter">
<view> <!-- <view>
<checkbox-group @change="changeBox" class="boxCenter" <checkbox-group @change="changeBox" class="boxCenter"
><checkbox value="true" :checked="checkedAll" />全选  ><checkbox value="true" :checked="checkedAll" />全选 
</checkbox-group></view </checkbox-group></view
> > -->
已选择 {{ checkedTotal }} 条事件 已选择 {{ checkedTotal }} 条事件
</view> </view>
<view class="nav-menu nav-menu-btn" @click="selectDevice">申请报告 </view> <view class="nav-menu nav-menu-btn" @click="selectDevice">申请报告 </view>

View File

@@ -63,7 +63,9 @@
<view class="card-header-info"> <view class="card-header-info">
<view class="point-name-row"> <view class="point-name-row">
<text class="point-name ellipsis">{{ point.pointName }}</text> <text class="point-name ellipsis">{{ point.pointName }}</text>
<text class="event-tag" :class="point.runStatus == 1 ? 'lx-tag' : 'zx-tag'">
{{ point.runStatus == 1 ? '离线' : '在线' }}
</text>
</view> </view>
<view class="meta-row"> <view class="meta-row">
<text class="meta-item ellipsis">项目{{ point.projectName }}</text> <text class="meta-item ellipsis">项目{{ point.projectName }}</text>
@@ -397,16 +399,12 @@ export default {
this.saveSelectedIndicators() this.saveSelectedIndicators()
this.closeIndicatorPopup() this.closeIndicatorPopup()
}, },
// 跳转指标详情页;治理测点展示全部指标,普通测点展示未选中的指标 // 跳转指标详情页,展示该监测点全部指标
onMoreIndicators(point) { onMoreIndicators(point) {
uni.setStorageSync('monitorPointDetail', { uni.setStorageSync('monitorPointDetail', {
...point, ...point,
engineeringName: this.engineeringName, engineeringName: this.engineeringName,
selectedIndicators: showAllIndicators: true,
point.lineType === 0
? [...GOVERNANCE_DEFAULT_INDICATORS]
: [...this.selectedIndicators],
showAllIndicators: point.lineType === 0,
}) })
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/comp/targetInfo', url: '/pages/index/comp/targetInfo',
@@ -424,14 +422,9 @@ export default {
this.selectedIndicators.some((name) => this.matchIndicator(child.name, name)), this.selectedIndicators.some((name) => this.matchIndicator(child.name, name)),
) )
}, },
// 治理测点存在默认四项以外的指标时显示「更多指标」 // 有指标数据时显示「更多指标」
shouldShowMoreBtn(point) { shouldShowMoreBtn(point) {
if (point.lineType !== 0) return true return (point.children || []).length > 0
const children = point.children || []
return children.some(
(child) =>
!GOVERNANCE_DEFAULT_INDICATORS.some((name) => this.matchIndicator(child.name, name)),
)
}, },
// 将指标列表按每行两个分组 // 将指标列表按每行两个分组
@@ -477,7 +470,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 99; z-index: 1;
} }
.card { .card {
@@ -691,7 +684,7 @@ export default {
} }
.point-name { .point-name {
flex: 1; // flex: 1;
min-width: 0; min-width: 0;
font-size: 30rpx; font-size: 30rpx;
font-weight: 700; font-weight: 700;
@@ -710,7 +703,7 @@ export default {
.meta-row { .meta-row {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr;
gap: 6rpx 12rpx; gap: 6rpx 12rpx;
} }
@@ -867,4 +860,24 @@ export default {
background: #376cf310; background: #376cf310;
} }
} }
.event-tag {
font-size: 22rpx;
padding: 2rpx 10rpx;
border-radius: 8rpx;
margin-top: 5rpx;
margin-left: 10rpx;
// height: 38rpx;
}
// 在线
.zx-tag {
background-color: #10b98120;
color: #10b981;
}
.lx-tag {
background-color: #ff3b3020;
color: #ff3b30;
}
</style> </style>

View File

@@ -384,6 +384,9 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 99; z-index: 1;
}
/deep/ .segmented-control__text {
line-height: 60rpx !important;
} }
</style> </style>

View File

@@ -56,7 +56,7 @@
</view> </view>
</view> </view>
<view v-else class="empty-wrap"> <view v-else class="empty-wrap">
<Cn-empty msg="暂无更多指标" :paddingTop="120"></Cn-empty> <Cn-empty msg="暂无指标数据" :paddingTop="120"></Cn-empty>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@@ -77,24 +77,13 @@ export default {
}, },
computed: { computed: {
moreChildren() { moreChildren() {
const children = this.pointInfo.children || [] return this.pointInfo.children || []
// 治理测点「更多指标」页展示全部
if (this.pointInfo.lineType === 0 && this.pointInfo.showAllIndicators) {
return children
}
const selected = this.getSelectedIndicators()
return children.filter(
(child) => !selected.some((name) => this.matchIndicator(child.name, name)),
)
}, },
}, },
onLoad() { onLoad() {
const point = uni.getStorageSync('monitorPointDetail') const point = uni.getStorageSync('monitorPointDetail')
if (point) { if (point) {
this.pointInfo = { this.pointInfo = { ...point }
...point,
selectedIndicators: this.getSelectedIndicatorsFromStorage(point.selectedIndicators),
}
if (point.pointName) { if (point.pointName) {
uni.setNavigationBarTitle({ title: point.pointName }) uni.setNavigationBarTitle({ title: point.pointName })
} }
@@ -104,22 +93,6 @@ export default {
uni.removeStorageSync('monitorPointDetail') uni.removeStorageSync('monitorPointDetail')
}, },
methods: { methods: {
getSelectedIndicatorsFromStorage(fallback = []) {
const cached = uni.getStorageSync(this.$cacheKey.monitorSelectedIndicators)
if (Array.isArray(cached) && cached.length) {
return cached
}
return Array.isArray(fallback) ? fallback : []
},
getSelectedIndicators() {
return this.getSelectedIndicatorsFromStorage(this.pointInfo.selectedIndicators)
},
matchIndicator(name, selected) {
if (!name || !selected) return false
const base = (name || '').replace(/\(.*\)/, '').trim()
const selectedBase = (selected || '').replace(/\(.*\)/, '').trim()
return base === selectedBase
},
hasTPhaseData(child) { hasTPhaseData(child) {
return child.T !== undefined && child.T !== null && child.T !== '-' return child.T !== undefined && child.T !== null && child.T !== '-'
}, },

View File

@@ -416,6 +416,9 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 99; z-index: 1;
}
/deep/ .segmented-control__text {
line-height: 60rpx !important;
} }
</style> </style>

View File

@@ -363,7 +363,7 @@ export default {
padding: 4rpx 20rpx; padding: 4rpx 20rpx;
// margin-left: 20rpx; // margin-left: 20rpx;
// margin-bottom: 20rpx; // margin-bottom: 20rpx;
line-height: 38rpx; line-height: 40rpx;
font-size: 24rpx; font-size: 24rpx;
border-radius: 8rpx; border-radius: 8rpx;
background: #ebeaec; background: #ebeaec;
@@ -394,6 +394,6 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 99; z-index: 1;
} }
</style> </style>

View File

@@ -343,4 +343,5 @@ export default {
// white-space: nowrap; // white-space: nowrap;
line-height: 1; line-height: 1;
} }
</style> </style>

View File

@@ -82,11 +82,7 @@
<view class="mine-nav-label">关注工程配置</view> <view class="mine-nav-label">关注工程配置</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> </view>
<!-- <view class="mine-nav" @click="jump('transientSetting')" v-if="userInfo.authorities !== 'tourist'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/tongji.png" />
<view class="mine-nav-label">暂态统计配置</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> -->
<view class="mine-nav" @click="jump('setup')" style="border-bottom: none"> <view class="mine-nav" @click="jump('setup')" style="border-bottom: none">
<image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png" /> <image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png" />
<view class="mine-nav-label">设置</view> <view class="mine-nav-label">设置</view>

View File

@@ -6,33 +6,32 @@
<view class="detail-content-title mb20">{{ pageData.title }}</view> <view class="detail-content-title mb20">{{ pageData.title }}</view>
<view> {{ pageData.createTime }}</view> <view> {{ pageData.createTime }}</view>
<view class="mt10 mb10">{{ pageData.description }}</view> <view class="mt10 mb10">{{ pageData.description }}</view>
<uni-file-picker readonly v-model="imageValue" mode="grid"/> <uni-file-picker readonly v-model="imageValue" mode="grid" />
</view> </view>
<view class="detail-content " style="margin-bottom:0"> <view class="detail-content " style="margin-bottom:0">
<view class="detail-content-title "> <view class="detail-content-title ">
<view class="title">进度</view> <view class="title">进度</view>
<!-- <template v-if="pageData.status === '1'">--> <template v-if="pageData.status === '1'">
<!-- <view class="title-btn mr10" @click="updateFeedBackStatus('2')">解决</view>--> <view class="title-btn mr10" @click="updateFeedBackStatus('2')">解决</view>
<!-- <view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>--> <view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>
<!-- </template>--> </template>
<!-- <template v-if="pageData.status === '2'">--> <template v-if="pageData.status === '2'">
<!-- <view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>--> <view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>
<!-- </template>--> </template>
<!-- <view class="title-btn" @click="open">回复</view>--> <!-- <view class="title-btn" @click="open">回复</view> -->
</view> </view>
</view> </view>
<uni-list> <uni-list>
<uni-list-item :title="item.userName" :note="item.chatContent" :rightText="item.createTime" <uni-list-item :title="item.userName" :note="item.chatContent" :rightText="item.createTime"
v-for="(item, index) in pageData.csFeedbackChatPOList" :key="index"/> v-for="(item, index) in pageData.csFeedbackChatPOList" :key="index" />
<Cn-empty <Cn-empty
v-if="pageData.csFeedbackChatPOList && pageData.csFeedbackChatPOList.length == 0"></Cn-empty> v-if="pageData.csFeedbackChatPOList && pageData.csFeedbackChatPOList.length == 0"></Cn-empty>
</uni-list> </uni-list>
<!-- 输入框示例 --> <!-- 输入框示例 -->
<uni-popup ref="inputDialog" type="dialog"> <uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" type="info" mode="input" title="输入内容" <uni-popup-dialog ref="inputClose" type="info" mode="input" title="输入内容" value="对话框预置提示内容!"
value="对话框预置提示内容!"
placeholder="请输入内容" @confirm="dialogInputConfirm"> placeholder="请输入内容" @confirm="dialogInputConfirm">
<uni-easyinput type="textarea" :maxlength="250" autoHeight v-model="chatContent" <uni-easyinput type="textarea" :maxlength="250" autoHeight v-model="chatContent" clearable
placeholder="请输入内容"></uni-easyinput> placeholder="请输入内容"></uni-easyinput>
</uni-popup-dialog> </uni-popup-dialog>
</uni-popup> </uni-popup>
@@ -41,7 +40,7 @@
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
import {queryFeedBackDetail, AddFeedbackChat, updateChatStatus, updateFeedBackStatus} from '../../common/api/feedback' import { queryFeedBackDetail, AddFeedbackChat, updateChatStatus, updateFeedBackStatus } from '../../common/api/feedback'
export default { export default {
data() { data() {
@@ -93,7 +92,7 @@ export default {
}) })
}, },
dialogInputConfirm() { dialogInputConfirm() {
AddFeedbackChat({chatContent: this.chatContent, id: this.pageOption.id}).then(res => { AddFeedbackChat({ chatContent: this.chatContent, id: this.pageOption.id }).then(res => {
console.log(res); console.log(res);
this.$util.toast('回复成功') this.$util.toast('回复成功')
this.init() this.init()
@@ -101,6 +100,7 @@ export default {
}) })
}, },
open() { open() {
this.chatContent = ''
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}, },
over() { over() {

View File

@@ -190,6 +190,6 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 99; z-index: 1;
} }
</style> </style>

View File

@@ -28,7 +28,7 @@
<text v-if="!item.harmDetailList[0].hasT">A相</text> <text v-if="!item.harmDetailList[0].hasT">A相</text>
<text v-if="!item.harmDetailList[0].hasT">B相</text> <text v-if="!item.harmDetailList[0].hasT">B相</text>
<text v-if="!item.harmDetailList[0].hasT">C相</text> <text v-if="!item.harmDetailList[0].hasT">C相</text>
<text v-if="item.harmDetailList[0].hasT"></text> <text v-if="item.harmDetailList[0].hasT"></text>
<text>限值</text> <text>限值</text>
</view> </view>
<view class="table-row" v-for="value in item.harmDetailList"> <view class="table-row" v-for="value in item.harmDetailList">

View File

@@ -4,17 +4,21 @@
<view class="detail-content" style="font-size: 32rpx"> <view class="detail-content" style="font-size: 32rpx">
<view>{{ detail.startTime }}</view> <view>{{ detail.startTime }}</view>
</view> </view>
<view class="detail-content"> <view class="detail-content ">
<view class="detail-content-title mb20">基础信息</view> <view class="detail-content-title mb20">基础信息</view>
<view class="mb5"> 工程{{ detail.engineeringName }} </view> <view class="mb5"> 工程{{ detail.engineeringName }} </view>
<view class="mb5"> 项目{{ detail.projectName }} </view> <view class="mb5"> 项目{{ detail.projectName }} </view>
<view class="mb5"> 设备{{ detail.equipmentName }}</view> <view class="mb5"> 设备{{ detail.equipmentName }}</view>
<view class="mb5"> 监测点{{ detail.lineName }}</view> <view class="mb5"> 监测点{{ detail.lineName }}</view>
<view class="mb5"> 暂态类型{{ detail.showName }}</view> <view class="mb5"> 暂态类型{{ detail.showName }}</view>
<view class="mb5" v-if="detail.evtParamPhase"> 相别{{ detail.evtParamPhase }}</view>
<view class="mb5" v-if="detail.evtParamTm"> 持续时间{{ detail.evtParamTm }}s</view> <view class="mb5" v-if="detail.evtParamTm"> 持续时间{{ detail.evtParamTm }}s</view>
<view class="mb5" v-if="detail.evtParamVVaDepth"> 幅值{{ detail.evtParamVVaDepth }}%</view> <view class="mb5" v-if="detail.evtParamVVaDepth"> 幅值{{ detail.evtParamVVaDepth }}%</view>
<view class="mb5" v-if="detail.evtParamPhase"> 相别{{ detail.evtParamPhase }}</view> <view class="mb5"> 落点区域{{ detail.landPoint != null && detail.landPoint !== '' ? detail.landPoint :
<view class="mb5" > 落点区域{{ detail.landPoint != null && detail.landPoint !== '' ? detail.landPoint : '未知' }}</view> '未知'
}}</view>
</view> </view>
<view class="detail-tabs"> <view class="detail-tabs">
<uni-segmented-control :current="detailTab" active-color="#376cf3" :values="['波形图', 'ITIC', 'F47']" <uni-segmented-control :current="detailTab" active-color="#376cf3" :values="['波形图', 'ITIC', 'F47']"
@@ -60,6 +64,7 @@ import F47 from './F47.vue'
import waveform from './waveform.vue' import waveform from './waveform.vue'
import { analyseWave } from '@/common/api/harmonic.js'; import { analyseWave } from '@/common/api/harmonic.js';
export default { export default {
components: { ITIC, F47, waveform }, components: { ITIC, F47, waveform },
data() { data() {
@@ -190,25 +195,9 @@ export default {
font-size: 28rpx; font-size: 28rpx;
.detail-content-title { .detail-content-title {
display: inline-flex;
align-items: center;
position: relative;
padding-left: 20rpx;
font-size: 30rpx; font-size: 30rpx;
color: #111; color: #111;
font-weight: 700; font-weight: 700;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8rpx;
height: 28rpx;
background: $uni-theme-color;
border-radius: 3rpx;
}
} }
} }
@@ -233,4 +222,23 @@ export default {
margin-right: 24rpx; margin-right: 24rpx;
height: 60rpx; height: 60rpx;
} }
/deep/ .segmented-control__text {
line-height: 60rpx !important;
}
.detail-content-info {
display: grid;
grid-template-columns: 1fr 1fr;
}
// .detail-content-info {
// display: grid;
// grid-template-columns: 1fr 1fr;
// }
.detail-content-info {
display: grid;
grid-template-columns: 1fr 1fr;
}
</style> </style>

View File

@@ -186,7 +186,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 99; z-index: 1;
} }
</style> </style>

View File

@@ -337,7 +337,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 99; z-index: 1;
} }
.textBox { .textBox {

View File

@@ -59,8 +59,8 @@
<text> <text>
{{ item.startTime ? '发生时间:' + item.startTime : '' }} {{ item.startTime ? '发生时间:' + item.startTime : '' }}
{{ {{
item.evtParamVVaDepth != null && item.evtParamVVaDepth !== '' item.evtParamPhase != null && item.evtParamPhase !== ''
? '幅值' + item.evtParamVVaDepth + '%' ? '相别' + item.evtParamPhase
: '' : ''
}} }}
{{ {{
@@ -69,10 +69,12 @@
: '' : ''
}} }}
{{ {{
item.evtParamPhase != null && item.evtParamPhase !== '' item.evtParamVVaDepth != null && item.evtParamVVaDepth !== ''
? '相别' + item.evtParamPhase ? '幅值' + item.evtParamVVaDepth + '%'
: '' : ''
}} {{ }}
{{
item.landPoint != null && item.landPoint !== '' item.landPoint != null && item.landPoint !== ''
? ',落点区域:' + item.landPoint ? ',落点区域:' + item.landPoint
: ',落点区域:未知' : ',落点区域:未知'
@@ -287,6 +289,6 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35); box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 99; z-index: 1;
} }
</style> </style>

View File

@@ -8,7 +8,7 @@
<uni-data-select v-model="item.type" :localdata="range"></uni-data-select> <uni-data-select v-model="item.type" :localdata="range"></uni-data-select>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="区域"> <uni-forms-item label="区域">
<uni-easyinput type="textarea" v-model="item.title" placeholder="请输入问题简要" /> <uni-easyinput type="textarea" v-model="item.title" placeholder="请输入区域" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="描述"> <uni-forms-item label="描述">
<uni-easyinput type="textarea" v-model="item.des" placeholder="请输入详细描述" /> <uni-easyinput type="textarea" v-model="item.des" placeholder="请输入详细描述" />

View File

@@ -48,7 +48,7 @@
<!-- @click="jump('about')" --> <!-- @click="jump('about')" -->
<view class="mine-nav" style="border-bottom: none"> <view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">版本信息</view> <view class="mine-nav-label">版本信息</view>
<view style="color: #828282; font-size: 14rpx">当前版本V{{ version }}</view> <view style="color: #828282; font-size: 24rpx">V{{ version }}</view>
<!-- <uni-icons type="forward" color="#aaa" size="20"></uni-icons> --> <!-- <uni-icons type="forward" color="#aaa" size="20"></uni-icons> -->
</view> </view>
<view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none"> <view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none">

View File

@@ -1,41 +1,25 @@
<template> <template>
<Cn-page :loading="loading"> <Cn-page >
<view class="mine" slot="body"> <view class="mine" slot="body">
<view class="mine-nav mt20" style="border-bottom: none"> <view class="mine-nav mt20" style="border-bottom: none">
<view class="mine-nav-label">暂态事件</view> <view class="mine-nav-label">暂态事件</view>
<switch <switch style="transform: scale(0.8)" color="#376cf3" @change="change('eventInfo')"
style="transform: scale(0.8)" :checked="config.eventInfo === 1" />
color="#376cf3"
@change="change('eventInfo')"
:checked="config.eventInfo === 1"
/>
</view> </view>
<view class="mine-nav" style="border-bottom: none"> <view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">稳态事件</view> <view class="mine-nav-label">稳态事件</view>
<switch <switch style="transform: scale(0.8)" color="#376cf3" @change="change('harmonicInfo')"
style="transform: scale(0.8)" :checked="config.harmonicInfo === 1" />
color="#376cf3"
@change="change('harmonicInfo')"
:checked="config.harmonicInfo === 1"
/>
</view> </view>
<view class="mine-nav" style="border-bottom: none"> <view class="mine-nav" style="border-bottom: none" v-if="flag">
<view class="mine-nav-label">运行告警</view> <view class="mine-nav-label">运行告警</view>
<switch <switch style="transform: scale(0.8)" color="#376cf3" @change="change('alarmInfo')"
style="transform: scale(0.8)" :checked="config.alarmInfo === 1" />
color="#376cf3"
@change="change('alarmInfo')"
:checked="config.alarmInfo === 1"
/>
</view> </view>
<view class="mine-nav" > <view class="mine-nav" v-if="flag">
<view class="mine-nav-label">运行事件</view> <view class="mine-nav-label">运行事件</view>
<switch <switch style="transform: scale(0.8)" color="#376cf3" @change="change('runInfo')"
style="transform: scale(0.8)" :checked="config.runInfo === 1" />
color="#376cf3"
@change="change('runInfo')"
:checked="config.runInfo === 1"
/>
</view> </view>
</view> </view>
</Cn-page> </Cn-page>
@@ -49,6 +33,7 @@ export default {
return { return {
loading: true, loading: true,
config: {}, config: {},
flag: false,
} }
}, },
methods: { methods: {
@@ -106,6 +91,9 @@ export default {
}, },
}, },
onLoad() { onLoad() {
if (uni.getStorageSync(this.$cacheKey.userInfo).authorities === 'operation_manager') {
this.flag = true
}
this.init() this.init()
}, },
} }

View File

@@ -1,129 +0,0 @@
<template>
<Cn-page :loading="loading">
<view class="mine" slot="body">
<view class="mine-nav" style="margin-top: 20rpx">
<view class="mine-nav-label">ITIC</view>
<switch
style="transform: scale(0.8)"
color="#376cf3"
@change="change('iticFunction')"
:checked="config.iticFunction === 1"
/>
</view>
<view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">F47</view>
<switch
style="transform: scale(0.8)"
color="#376cf3"
@change="change('f47Function')"
:checked="config.f47Function === 1"
/>
</view>
</view>
</Cn-page>
</template>
<script>
import { queryUserPushConfig, updatePushConfig } from '@/common/api/mine'
export default {
data() {
return {
loading: true,
config: {},
}
},
onLoad() {
this.init()
},
methods: {
init() {
queryUserPushConfig().then((res) => {
this.config = res.data
this.loading = false
})
},
change(type) {
this.config[type] = this.config[type] === 1 ? 0 : 1
// updatePushConfig(this.config).then((res) => {
// let str = ''
// switch (type) {
// case 'iticFunction':
// str = 'ITIC'
// break
// case 'f47Function':
// str = 'F47'
// break
// }
// this.$util.toast(`${str}配置${this.config[type] === 1 ? '开启' : '关闭'}成功`)
// })
},
},
onLoad() {
this.init()
},
onUnload() {
updatePushConfig(this.config).then((res) => {
// this.$util.toast(`配置修改成功!`)
})
},
}
</script>
<style lang="scss">
.mine {
.title {
padding: 0 20rpx;
font-size: 28rpx;
font-weight: 500;
}
.mine-header {
padding: 200rpx 34rpx 34rpx;
display: flex;
align-items: center;
background: $uni-theme-white;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 8rpx #e7e7e74c;
.mine-header-head {
margin-right: 30rpx;
height: 128rpx;
width: 128rpx;
border-radius: $uni-theme-radius;
overflow: hidden;
}
.mine-header-name {
margin-right: 30rpx;
flex: 1;
font-size: 36rpx;
color: #111;
font-weight: 700;
}
}
.mine-nav {
padding: 34rpx;
display: flex;
align-items: center;
background: $uni-theme-white;
border-bottom: 1rpx solid #e8e8e8;
&-icon {
margin-right: 30rpx;
height: 44rpx;
width: 44rpx;
border-radius: $uni-theme-radius;
overflow: hidden;
}
&-label {
margin-right: 30rpx;
flex: 1;
font-size: 28rpx;
color: #111;
}
}
}
</style>

View File

@@ -42,7 +42,7 @@ export default {
}, },
newDevice() { newDevice() {
uni.scanCode({ uni.scanCode({
onlyFromCamera: true, onlyFromCamera: false,
success: function (res) { success: function (res) {
console.log('条码类型:' + res.scanType) console.log('条码类型:' + res.scanType)
console.log('条码内容:' + res.result) console.log('条码内容:' + res.result)

View File

@@ -1,29 +1,27 @@
<template> <template>
<Cn-page :loading="loading"> <Cn-page :loading="loading">
<view slot="body"> <view slot="body">
<view class="new" :class="{'project-new':!this.options.project}"> <view class="new" :class="{ 'project-new': !this.options.project }">
<view class="content"> <view class="content">
<uni-forms :label-width="80"> <uni-forms :label-width="80">
<uni-forms-item label="工程名称" @click.native.stop.prevent="selectEngineering"> <uni-forms-item label="工程名称">
<view class="engineering-select" @click="selectEngineering">
<uni-easyinput <uni-easyinput
v-model="formData.engineeringName" v-model="formData.engineeringName"
disabled
maxlength="50"
placeholder="请选择工程" placeholder="请选择工程"
:clearable="false" :clearable="false"
:disabled="true"
/> />
</view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="项目名称"> <uni-forms-item label="项目名称">
<uni-easyinput v-model="formData.name" placeholder="请输入项目名称"/> <uni-easyinput v-model="formData.name" maxlength="50" placeholder="请输入项目名称" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="区域"> <uni-forms-item label="区域">
<view style="display: flex"> <view style="display: flex">
<uni-easyinput <uni-easyinput :clearable="false" type="textarea" maxlength="250" autoHeight
:clearable="false" v-model="formData.area" placeholder="请输入区域信息" />
type="textarea"
autoHeight
v-model="formData.area"
placeholder="请输入区域信息"
/>
<!-- <uni-icons <!-- <uni-icons
type="location" type="location"
color="#007aff" color="#007aff"
@@ -34,25 +32,17 @@
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="描述"> <uni-forms-item label="描述">
<uni-easyinput <uni-easyinput type="textarea" autoHeight maxlength="999" v-model="formData.description"
type="textarea" placeholder="请输入项目描述" />
autoHeight
maxlength="999"
v-model="formData.description"
placeholder="请输入项目描述"
/>
</uni-forms-item> </uni-forms-item>
<view class="temp-choose"> <view class="temp-choose">
<view class="temp-choose-title">从模版库选择拓扑图</view> <view class="temp-choose-title">从模版库选择拓扑图</view>
<view class="temp-choose-content"> <view class="temp-choose-content">
<view class="temp-choose-content-item" v-for="(item, index) in formData.tempFiles"> <view class="temp-choose-content-item" v-for="(item, index) in formData.tempFiles">
<image <image class="temp-choose-content-item-img" :src="item.filePath"
class="temp-choose-content-item-img" mode="aspectFill" />
:src="item.filePath"
mode="aspectFill"
/>
<view class="temp-choose-content-item-close" @click="deleteImg(index)"> <view class="temp-choose-content-item-close" @click="deleteImg(index)">
<uni-icons style="font-size: 18px" type="closeempty" color="#fff" size="20"/> <uni-icons style="font-size: 18px" type="closeempty" color="#fff" size="20" />
</view> </view>
</view> </view>
<view class="temp-choose-content-item" @click="openTemp"> <view class="temp-choose-content-item" @click="openTemp">
@@ -60,13 +50,8 @@
</view> </view>
</view> </view>
</view> </view>
<uni-file-picker <uni-file-picker v-model="formData.files" title="从本地上传拓扑图" :sourceType="['album']"
v-model="formData.files" :before-remove="beforeRemove" @select="select"></uni-file-picker>
title="从本地上传拓扑图"
:sourceType="['album']"
:before-remove="beforeRemove"
@select="select"
></uni-file-picker>
</uni-forms> </uni-forms>
</view> </view>
<view class="btn-wrap"> <view class="btn-wrap">
@@ -76,21 +61,16 @@
<view class="popup-header"> <view class="popup-header">
<view class="popup-header-title">模版库</view> <view class="popup-header-title">模版库</view>
<view class="popup-header-close" @click="closeTemp"> <view class="popup-header-close" @click="closeTemp">
<uni-icons type="closeempty" color="#111" size="20"/> <uni-icons type="closeempty" color="#111" size="20" />
</view> </view>
</view> </view>
<view class="temp-list"> <view class="temp-list">
<view <view class="temp-list-item" :class="{
class="temp-list-item"
:class="{
'temp-list-item-active': formData.tempFiles.some( 'temp-list-item-active': formData.tempFiles.some(
(item2) => item2.id === item.id || item2.topoId === item.id, (item2) => item2.id === item.id || item2.topoId === item.id,
), ),
}" }" v-for="(item, index) in tempList" @click="chooseTempItem(item)">
v-for="(item, index) in tempList" <image class="temp-list-item-img" :src="item.filePath" mode="aspectFill" />
@click="chooseTempItem(item)"
>
<image class="temp-list-item-img" :src="item.filePath" mode="aspectFill"/>
<view class="temp-list-item-name">{{ item.name }}</view> <view class="temp-list-item-name">{{ item.name }}</view>
</view> </view>
</view> </view>
@@ -100,10 +80,10 @@
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
import {pinyin} from 'pinyin-pro' import { pinyin } from 'pinyin-pro'
import {addAppProject, updateAppProject, checkCanDelete} from '../../common/api/project' import { addAppProject, updateAppProject, checkCanDelete } from '../../common/api/project'
import {getTopoTemplate} from '../../common/api/device' import { getTopoTemplate } from '../../common/api/device'
import {queryEngineering} from '@/common/api/engineering.js' import { queryEngineering } from '@/common/api/engineering.js'
export default { export default {
data() { data() {
@@ -154,20 +134,13 @@ export default {
this.formData.engineeringId = engineering.id this.formData.engineeringId = engineering.id
this.formData.engineeringName = engineering.name this.formData.engineeringName = engineering.name
} }
uni.getLocation({
type: 'wgs84',
success: function (res) {
console.log(res)
console.log('当前位置的经度:' + res.longitude)
console.log('当前位置的纬度:' + res.latitude)
},
})
getTopoTemplate().then((res) => { getTopoTemplate().then((res) => {
console.log(res) console.log(res)
this.tempList = res.data.map((item) => { this.tempList = res.data.map((item) => {
return { return {
...item, ...item,
filePath:this.$config.static + item.filePath filePath: this.$config.static + item.filePath
} }
}) })
if (this.project) { if (this.project) {
@@ -337,12 +310,19 @@ export default {
color: #111; color: #111;
} }
.engineering-select {
width: 100%;
/deep/ .uni-easyinput,
/deep/ .uni-easyinput__content {
pointer-events: none;
}
}
.new { .new {
padding: 34rpx; padding: 34rpx;
.project-new { .project-new {}
}
.content { .content {
.content-des { .content-des {

View File

@@ -3,7 +3,7 @@
<view slot="body"> <view slot="body">
<view class="change-name"> <view class="change-name">
<view class="content"> <view class="content">
<uni-easyinput type="text" v-model="name" placeholder="请输入昵称" /> <uni-easyinput type="text" maxlength="24" v-model="name" placeholder="请输入昵称" />
</view> </view>
<view class="btn-wrap"> <view class="btn-wrap">
<view class="btn-wrap-item" @click="submit"> 提交 </view> <view class="btn-wrap-item" @click="submit"> 提交 </view>

View File

@@ -4,33 +4,18 @@
<view class="index"> <view class="index">
<uni-forms ref="form" :modelValue="formData" :rules="rules"> <uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-forms-item name="phone"> <uni-forms-item name="phone">
<uni-easyinput <uni-easyinput type="number" maxlength="11" v-model="formData.phone" placeholder="请输入手机号" />
type="number"
maxlength="11"
v-model="formData.phone"
placeholder="请输入手机号"
/>
</uni-forms-item> </uni-forms-item>
<uni-forms-item name="code"> <uni-forms-item name="code">
<view class="login-box-input"> <view class="login-box-input">
<uni-easyinput <uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
type="text" <view class="ml40" style="
v-model="formData.code"
placeholder="请输入验证码"
maxlength="6"
/>
<view
class="ml40"
style="
margin-left: 40rpx; margin-left: 40rpx;
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
width: 200rpx; width: 200rpx;
text-align: center; text-align: center;
" " v-if="waitTime > 0">{{ waitTime + 's后重新获取' }}</view>
v-if="waitTime > 0"
>{{ waitTime + 's后重新获取' }}</view
>
<button class="login-box-input-btn" v-else @click="getCode" size="mini">获取验证码</button> <button class="login-box-input-btn" v-else @click="getCode" size="mini">获取验证码</button>
</view> </view>
</uni-forms-item> </uni-forms-item>
@@ -41,7 +26,8 @@
<uni-easyinput type="password" v-model="formData.password2" placeholder="请再次确认密码" /> <uni-easyinput type="password" v-model="formData.password2" placeholder="请再次确认密码" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<button type="default" class="submit-btn" @click="submit">提交</button> <button type="default" class="submit-btn" :loading="loadingButton" :disabled="loadingButton"
@click="submit">提交</button>
<view class="login-box-tips"> <view class="login-box-tips">
<view style="color: #999">说明密码长度为6-18</view> <view style="color: #999">说明密码长度为6-18</view>
</view> </view>
@@ -71,6 +57,7 @@ export default {
password: '', password: '',
password2: '', password2: '',
}, },
loadingButton: false,
rules: { rules: {
phone: { phone: {
rules: [ rules: [
@@ -107,7 +94,7 @@ export default {
}, },
} }
}, },
onLoad() {}, onLoad() { },
methods: { methods: {
getCode() { getCode() {
if (!this.formData.phone) { if (!this.formData.phone) {
@@ -151,6 +138,7 @@ export default {
}) })
return return
} }
this.loadingButton = true
let loginName = encrypt(this.formData.phone) let loginName = encrypt(this.formData.phone)
gongkey({ loginName }).then((response) => { gongkey({ loginName }).then((response) => {
let publicKey = response.data let publicKey = response.data
@@ -169,9 +157,13 @@ export default {
}, 1000) }, 1000)
}) })
.catch((err) => { .catch((err) => {
uni.hideLoading()
console.log(err) console.log(err)
}) })
.finally(() => {
this.loadingButton = false
})
}).finally(() => {
this.loadingButton = false
}) })
}) })
}, },

View File

@@ -5,32 +5,18 @@
<template v-if="step == 1"> <template v-if="step == 1">
<uni-forms ref="form" :rules="rules" :modelValue="formData"> <uni-forms ref="form" :rules="rules" :modelValue="formData">
<uni-forms-item name="phone"> <uni-forms-item name="phone">
<uni-easyinput <uni-easyinput type="number" v-model="formData.phone" maxlength="11" placeholder="请输入手机号" />
type="number"
v-model="formData.phone"
maxlength="11"
placeholder="请输入手机号"
/>
</uni-forms-item> </uni-forms-item>
<uni-forms-item name="code"> <uni-forms-item name="code">
<view class="login-box-input"> <view class="login-box-input">
<uni-easyinput <uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
type="text" <view class="ml40" style="
v-model="formData.code"
placeholder="请输入验证码"
maxlength="6"
/>
<view
class="ml40"
style="
margin-left: 40rpx; margin-left: 40rpx;
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
width: 200rpx; width: 200rpx;
text-align: center; text-align: center;
" " v-if="waitTime > 0">{{ waitTime + 's后重新获取' }}
v-if="waitTime > 0"
>{{ waitTime + 's后重新获取' }}
</view> </view>
<button class="login-box-input-btn" v-else @click="getCode" size="mini"> <button class="login-box-input-btn" v-else @click="getCode" size="mini">
获取验证码 获取验证码
@@ -38,16 +24,13 @@
</view> </view>
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<button type="default" class="submit-btn" @click="firstSubmit">注册</button> <button type="default" class="submit-btn" :loading="loadingButton" :disabled="loadingButton"
@click="firstSubmit">注册</button>
<view class="login-box-tips"> <view class="login-box-tips">
<view style="color: #999" <view style="color: #999">
><checkbox <checkbox style="transform: scale(0.7)" :checked="checkbox" @click="checkbox = !checkbox" />
style="transform: scale(0.7)" 我已阅读并同意
:checked="checkbox" </view>
@click="checkbox = !checkbox"
/>
我已阅读并同意</view
>
<navigator url="/pages/mine/agreement" hover-class="none">用户协议</navigator> <navigator url="/pages/mine/agreement" hover-class="none">用户协议</navigator>
<navigator url="/pages/mine/policy" hover-class="none">隐私政策</navigator> <navigator url="/pages/mine/policy" hover-class="none">隐私政策</navigator>
</view> </view>
@@ -61,7 +44,8 @@
<uni-easyinput type="text" v-model="formData.password2" placeholder="请再次确认密码" /> <uni-easyinput type="text" v-model="formData.password2" placeholder="请再次确认密码" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<button type="default" class="submit-btn" @click="secondSubmit">提交</button> <button type="default" class="submit-btn" :loading="loadingButton" :disabled="loadingButton"
@click="secondSubmit">提交</button>
<view class="login-box-tips"> <view class="login-box-tips">
<view style="color: #999">说明密码长度为6-18</view> <view style="color: #999">说明密码长度为6-18</view>
</view> </view>
@@ -82,6 +66,7 @@ export default {
loading: false, loading: false,
waitTime: 0, waitTime: 0,
inter: null, inter: null,
loadingButton: false,
// 表单数据 // 表单数据
formData: { formData: {
phone: '', phone: '',
@@ -125,7 +110,7 @@ export default {
}, },
} }
}, },
onLoad() {}, onLoad() { },
methods: { methods: {
getCode() { getCode() {
if (!this.checkbox) { if (!this.checkbox) {
@@ -163,7 +148,9 @@ export default {
if (!this.checkbox) { if (!this.checkbox) {
return this.$util.toast('请先阅读并同意用户协议和隐私政策!') return this.$util.toast('请先阅读并同意用户协议和隐私政策!')
} }
this.$refs.form.validate().then((valid, errors) => { this.$refs.form.validate().then((valid, errors) => {
this.loadingButton = true
apiRegister({ apiRegister({
phone: this.formData.phone, phone: this.formData.phone,
code: this.formData.code, code: this.formData.code,
@@ -176,11 +163,14 @@ export default {
autoLogin(this.formData.phone).then((res) => { autoLogin(this.formData.phone).then((res) => {
this.$util.loginSuccess(res.data) this.$util.loginSuccess(res.data)
}) })
}).finally(() => {
this.loadingButton = false
}) })
}) })
}, },
secondSubmit() { secondSubmit() {
this.$refs.form.validate().then((valid, errors) => { this.$refs.form.validate().then((valid, errors) => {
this.loadingButton = true
console.log(this.formData.password.length) console.log(this.formData.password.length)
if (this.formData.password.length < 6 || this.formData.password.length > 18) { if (this.formData.password.length < 6 || this.formData.password.length > 18) {
return this.$util.toast('密码长度为6-18位') return this.$util.toast('密码长度为6-18位')
@@ -197,6 +187,8 @@ export default {
uni.reLaunch({ uni.reLaunch({
url: '/pages/user/login', url: '/pages/user/login',
}) })
}).finally(() => {
this.loadingButton = false
}) })
}) })
}, },

View File

@@ -381,11 +381,12 @@ export default {
}, },
}) })
.then((result) => { .then((result) => {
console.log('选择失败', result) if (this.autoUpload && !this.noSpace) {
this.setSuccessAndError(result.tempFiles) this.setSuccessAndError(result.tempFiles)
}
}) })
.catch((err) => { .catch((err) => {
console.log('选择失败', err) console.log('选择文件失败', err)
}) })
}, },