Compare commits
No commits in common. "a7a41c3715364dc3b7042ca9f9e427486dea86f1" and "ac2d10e9d2f14812ebec04527fccc48d7157657d" have entirely different histories.
a7a41c3715
...
ac2d10e9d2
6
env/.env.development
vendored
6
env/.env.development
vendored
@ -7,11 +7,13 @@ VITE_SHOW_SOURCEMAP = true
|
||||
# 是否启用读取配置文件 min
|
||||
#VITE_WEBAPP = 'D://opt//AppUpdateTest'
|
||||
VITE_WEBAPP = ''
|
||||
#VITE_SERVER_BASEURL = 'http://10.75.166.6:8080/jeecg-boot'
|
||||
#VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot'
|
||||
VITE_SERVER_BASEURL = 'http://10.75.166.6:8080/jeecg-boot'
|
||||
#VITE_SERVER_BASEURL = 'http://10.75.173.194:8080/jeecg-boot'
|
||||
#VITE_SERVER_BASEURL = 'https://10.75.166.6/test'
|
||||
|
||||
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
|
||||
VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/jeecg-boot'
|
||||
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/jeecg-boot'
|
||||
|
||||
|
||||
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/wwapi'
|
||||
|
||||
4
env/.env.production
vendored
4
env/.env.production
vendored
@ -8,7 +8,7 @@ VITE_SHOW_SOURCEMAP = false
|
||||
#VITE_WEBAPP = 'D://opt//AppUpdateTest'
|
||||
VITE_WEBAPP = ''
|
||||
|
||||
#VITE_SERVER_BASEURL = 'https://10.75.166.6/test'
|
||||
VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/jeecg-boot'
|
||||
VITE_SERVER_BASEURL = 'https://10.75.166.6/test'
|
||||
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/jeecg-boot'
|
||||
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/wwapi'
|
||||
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/yjapi'
|
||||
|
||||
@ -17,8 +17,8 @@ export default defineManifestConfig({
|
||||
name: VITE_APP_TITLE,
|
||||
appid: VITE_UNI_APPID,
|
||||
description: '',
|
||||
versionName: '2.3.1',
|
||||
versionCode: '20251010',
|
||||
versionName: '2.3.0',
|
||||
versionCode: '202509011',
|
||||
transformPx: false,
|
||||
locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
|
||||
/* 5+App特有相关 */
|
||||
|
||||
@ -10,33 +10,6 @@ export function gethomelist(config : object) { // 获取房间信息
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// export function gethomelistforApp(config : object) { // 获取房间信息
|
||||
// return http({
|
||||
// url: '/RoomOperation/RoomOperation/gethomelistforApp',
|
||||
// method: 'GET',
|
||||
// data: config
|
||||
// })
|
||||
// }
|
||||
|
||||
//张祥瑞20250925修改为该方法
|
||||
export function gethomelistforApp(config : object) { // 获取房间信息
|
||||
return http({
|
||||
url: '/RoomAPP/RoomAPP/gethomelistforApp',
|
||||
method: 'GET',
|
||||
data: config
|
||||
})
|
||||
}
|
||||
//张祥瑞20250925添加方法,传参为房间表id
|
||||
export function getfjkzbmforfjidApp(config : object) { // 查询开关状态
|
||||
return http({
|
||||
url: mqtturl +
|
||||
"/mqttcontroller/mqttcontroller/getfjkzbmforfjid",
|
||||
method: 'GET',
|
||||
data: config
|
||||
})
|
||||
}
|
||||
|
||||
export function testcontiont(config : object) { // 获取房间信息
|
||||
return http({
|
||||
url: mqtturl + '/mqttSubclient/mqttSubclient/testgetcontint',
|
||||
@ -105,17 +78,9 @@ export function listAllRegions(config : object) { // 查询开关状态
|
||||
})
|
||||
}
|
||||
|
||||
// export function Selecthomelist(config : object) { // 查询开关状态
|
||||
// return http({
|
||||
// url: '/RoomOperation/RoomOperation/Selecthomelist',
|
||||
// method: 'GET',
|
||||
// data: config
|
||||
// })
|
||||
// }
|
||||
//张祥瑞,20250925修改为该方法
|
||||
export function Selecthomelist(config : object) { // 查询开关状态
|
||||
return http({
|
||||
url: '/RoomAPP/RoomAPP/SelecthomelistForApp',
|
||||
url: '/RoomOperation/RoomOperation/Selecthomelist',
|
||||
method: 'GET',
|
||||
data: config
|
||||
})
|
||||
|
||||
@ -65,11 +65,3 @@ export function queryJldRbDataByJldID(params : object) { // 获取计量点日
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export function queryGyKrDataByZc(params : object) { // 获取工艺和可燃气体实时数据
|
||||
return http({
|
||||
url: '/http://10.75.166.6:9999/Gyk/sssj/GetGyKrByZc',
|
||||
method: 'GET',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
@ -29,7 +29,7 @@ export function editUserApi(config : object) {
|
||||
/*根据部门Cod和角色Id查询用户信息*/
|
||||
export function queryUserByOrgRoleApi(config : object) {
|
||||
return http({
|
||||
url: '/sys/user/queryByDepCodRoleId',
|
||||
url: '/cxcChangesInPersonnel/cxcChangesInPersonnel/queryByDepCodRoleId',
|
||||
method: 'GET',
|
||||
data: config
|
||||
})
|
||||
|
||||
@ -7,7 +7,7 @@ const baseUrl = import.meta.env.VITE_SERVER_BASEURL
|
||||
|
||||
class socket {
|
||||
constructor() {
|
||||
// console.log(77777777777777)
|
||||
console.log(77777777777777)
|
||||
this.socketUrl = baseUrl
|
||||
this.socketStart = false
|
||||
this.socketType = ''
|
||||
@ -50,7 +50,7 @@ class socket {
|
||||
})
|
||||
// update-end-author:taoyan date:20220422 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
||||
uni.onSocketOpen((res) => {
|
||||
// console.log("连接进来了--------53333333333323----")
|
||||
console.log("连接进来了--------53333333333323----")
|
||||
this.socketStart = true
|
||||
callback && callback()
|
||||
console.log('WebSocket连接已打开!')
|
||||
@ -85,10 +85,10 @@ class socket {
|
||||
socketReceive() {
|
||||
const _this = this
|
||||
uni.onSocketMessage(function (res) {
|
||||
// console.log('APP:--》收到服务器内容:', res)
|
||||
// console.log('连接路径----:', baseUrl)
|
||||
console.log('APP:--》收到服务器内容:', res)
|
||||
console.log('连接路径----:', baseUrl)
|
||||
if (res.data.startsWith('CONNECTED') || res.data.startsWith('MESSAGE') || res.data.startsWith('RECEIPT')) {
|
||||
// console.log('放行----------:', res)
|
||||
console.log('放行----------:', res)
|
||||
// 放行 STOMP 协议消息,交给 socketTask.onMessage 处理 by 闵
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
"name": "数智产销",
|
||||
"appid": "__UNI__9F097F0",
|
||||
"description": "",
|
||||
"versionName": "2.3.1",
|
||||
"versionCode": "20251010",
|
||||
"versionName": "2.3.0",
|
||||
"versionCode": "202509011",
|
||||
"transformPx": false,
|
||||
"app-plus": {
|
||||
"usingComponents": true,
|
||||
|
||||
@ -84,8 +84,7 @@
|
||||
getMqttPushClient,
|
||||
treeChildList,
|
||||
listAllRegions,
|
||||
Selecthomelist,
|
||||
getfjkzbmforfjidApp
|
||||
Selecthomelist
|
||||
} from '@/api/devicecontrol/officedevice';
|
||||
// import socketforleader from '@/common/socketforleader'
|
||||
|
||||
@ -128,7 +127,7 @@
|
||||
if (res.success) {
|
||||
homelist.value = res.result.map((item, index) => ({
|
||||
...item, // 保留原有字段
|
||||
// homezt: 0, // 添加homezt字段,默认为0
|
||||
homezt: 0, // 添加homezt字段,默认为0
|
||||
}));
|
||||
//添加楼层情况
|
||||
}
|
||||
@ -177,21 +176,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 房间信息订阅
|
||||
*
|
||||
*/
|
||||
const getfjkzbmforfjid = () => {
|
||||
//查询开关状态
|
||||
for (const item of filteredFloors.value) {
|
||||
console.log("00000000000--------------",item)
|
||||
getfjkzbmforfjidApp({fjbid:item.id}).then((res) => {
|
||||
console.log("订阅成功--------------",res)
|
||||
}).catch((err) => {
|
||||
console.log("订阅失败:"+item.fjh+"。失败信息:"+err);
|
||||
});
|
||||
}
|
||||
}
|
||||
const getfjkzbm = async (item) => {
|
||||
// console.log("5555----------",item.id)
|
||||
let fjkzbm = {};
|
||||
@ -304,9 +288,7 @@
|
||||
filteredFloors.value = groupByFloor(selectBydata)
|
||||
// console.log("数据分组-555---", filteredFloors.value[0].rooms)
|
||||
//分组完进行房间状态查询,张祥瑞
|
||||
console.log("进入房间订阅:")
|
||||
getfjkzbmforfjid();
|
||||
// getAllswitchByids()
|
||||
getAllswitchByids()
|
||||
|
||||
}
|
||||
}
|
||||
@ -315,7 +297,7 @@
|
||||
//------------------------以上为数据处理---end-------------
|
||||
//处理返回的消息
|
||||
const handlesocketMessage = (jsonString) => {
|
||||
// console.log("1300--666666666666666---", jsonString)
|
||||
console.log("1300--666666666666666---", jsonString)
|
||||
try {
|
||||
const messageObj = JSON.parse(jsonString);
|
||||
|
||||
@ -396,12 +378,12 @@
|
||||
uni.sendSocketMessage({
|
||||
data: connectFrame
|
||||
});
|
||||
// console.log("77777777777")
|
||||
console.log("77777777777")
|
||||
});
|
||||
|
||||
// 监听消息
|
||||
socketTask.onMessage((res) => {
|
||||
// console.log("8888888888888888888")
|
||||
console.log("8888888888888888888")
|
||||
const data = res.data;
|
||||
const [commandLine, ...headerLines] = data.split('\n');
|
||||
const emptyLineIndex = headerLines.findIndex(line => line === '');
|
||||
@ -413,8 +395,8 @@
|
||||
}
|
||||
|
||||
const body = headerLines.slice(emptyLineIndex + 1).join('\n').replace(/\x00$/, '');
|
||||
// console.log("999999999999999", res)
|
||||
// console.log("121212121212", commandLine)
|
||||
console.log("999999999999999", res)
|
||||
console.log("121212121212", commandLine)
|
||||
switch (commandLine) {
|
||||
case 'CONNECTED':
|
||||
connectionStatus.value = 'STOMP已连接';
|
||||
|
||||
@ -13,11 +13,30 @@
|
||||
<text class="info-value">{{ room.ssbmname }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 补位元素,确保网格始终保持两列布局 -->
|
||||
<view v-if="floor.rooms.length % 2 !== 0" class="room-placeholder"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="connection-section">
|
||||
<button v-if="!connected" @click="connectWebSocket" class="connect-btn">
|
||||
连接WebSocket
|
||||
</button>
|
||||
|
||||
<button @click="disconnectWebSocket" class="disconnect-btn">
|
||||
断开连接
|
||||
</button>
|
||||
|
||||
<text :class="['status', connected ? 'connected' : 'disconnected']">
|
||||
{{ connectionStatus }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="message-container">
|
||||
<text class="subtitle">消息记录</text>
|
||||
<scroll-view scroll-y="true" class="message-list">
|
||||
<view v-for="(item, index) in messages" :key="index" :class="['message-item', item.type]">
|
||||
<text class="message-content">{{ item.content }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -29,13 +48,11 @@
|
||||
} from 'vue'
|
||||
import {
|
||||
gethomelist,
|
||||
gethomelistforApp,
|
||||
getMqttPushClient,
|
||||
selectfjkzbmforfjid,
|
||||
createdSwitch,
|
||||
listAllRegions,
|
||||
Selecthomelist,
|
||||
getfjkzbmforfjidApp
|
||||
Selecthomelist
|
||||
} from '@/api/devicecontrol/officedevice';
|
||||
// import useWebSocketService from '@/api/devicecontrol/webSocketService'
|
||||
|
||||
@ -73,33 +90,18 @@
|
||||
|
||||
//获取房间信息
|
||||
const getofficehomelist = async () => {
|
||||
//20250811,张祥瑞,修改查询接口
|
||||
await gethomelistforApp().then((res) => {
|
||||
await gethomelist().then((res) => {
|
||||
if (res.success) {
|
||||
homelist.value = res.result.map((item, index) => ({
|
||||
...item,
|
||||
// homezt: 0, // 添加homezt字段,默认为0
|
||||
homezt: 0, // 添加homezt字段,默认为0
|
||||
}));
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
filteredFloors.value = groupByFloor(homelist)
|
||||
// getAllswitchByids();
|
||||
//获取完房间信息然后订阅
|
||||
getfjkzbmforfjid();
|
||||
}
|
||||
//订阅房间信息
|
||||
const getfjkzbmforfjid = () => {
|
||||
for (const item of filteredFloors.value) {
|
||||
getfjkzbmforfjidApp({fjbid:item.id}).then((res) => {
|
||||
console.log("订阅成功--------------",res)
|
||||
}).catch((err) => {
|
||||
console.log("订阅失败:"+item.fjh+"。失败信息:"+err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
getAllswitchByids();
|
||||
}
|
||||
|
||||
// 数据分组处理
|
||||
@ -244,7 +246,7 @@
|
||||
if (res.success) {
|
||||
selectBydata.value = res.result;
|
||||
filteredFloors.value = groupByFloor(selectBydata)
|
||||
// getAllswitchByids()
|
||||
getAllswitchByids()
|
||||
}
|
||||
}
|
||||
//----------------树状展示end-----------
|
||||
|
||||
@ -62,15 +62,15 @@
|
||||
|
||||
<view class="ac-controls" v-if="ktpd">
|
||||
<button class="ac-btn" :class="{ 'active': acMode === 1 }" @click="conditioning(1)">
|
||||
<!-- <uni-icons type="snow" size="20" color="#3498db"></uni-icons> -->
|
||||
<uni-icons type="snow" size="20" color="#3498db"></uni-icons>
|
||||
<text>制冷 25°C</text>
|
||||
</button>
|
||||
<button class="ac-btn" :class="{ 'active': acMode === 2 }" @click="conditioning(2)">
|
||||
<!-- <uni-icons type="fire" size="20" color="#e74c3c"></uni-icons> -->
|
||||
<uni-icons type="fire" size="20" color="#e74c3c"></uni-icons>
|
||||
<text>制热 27°C</text>
|
||||
</button>
|
||||
<button class="ac-btn" :class="{ 'active': acMode === 0 }" @click="conditioning(0)">
|
||||
<!-- <uni-icons type="close" size="20" color="#7f8c8d"></uni-icons> -->
|
||||
<uni-icons type="close" size="20" color="#7f8c8d"></uni-icons>
|
||||
<text>关闭空调</text>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
@ -335,13 +335,17 @@
|
||||
roleId: '1554379432313397250',
|
||||
orgCode: code
|
||||
}).then(res => {
|
||||
model.hr = res.result.user.username
|
||||
hrData.value = res.result.list.map(item => {
|
||||
if (res.result.length > 0) {
|
||||
model.hr = res.result[0].username
|
||||
}
|
||||
if (!code) {
|
||||
hrData.value = res.result.map(item => {
|
||||
return {
|
||||
label: item.realname,
|
||||
value: item.username
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -360,6 +364,8 @@
|
||||
getZwmcAndExa()
|
||||
/*获取工作单位*/
|
||||
queryDepName()
|
||||
/*获取劳资员*/
|
||||
getHrList()
|
||||
/*获取*/
|
||||
queryHisDate()
|
||||
});
|
||||
|
||||
@ -16,11 +16,11 @@
|
||||
</wd-row>
|
||||
<wd-row>
|
||||
<wd-col :span="12">
|
||||
<wd-input v-model="realname" clearable placeholder="姓名模糊查询" @confirm="getList"
|
||||
<wd-input v-model="realname" clearable placeholder="姓名模糊查询" @change="getList"
|
||||
@clear="getList"></wd-input>
|
||||
</wd-col>
|
||||
<wd-col :span="12">
|
||||
<wd-input v-model="contractNumber" clearable placeholder="劳动合同号模糊查询" @confirm="getList"
|
||||
<wd-input v-model="contractNumber" clearable placeholder="劳动合同号模糊查询" @change="getList"
|
||||
@clear="getList"></wd-input>
|
||||
</wd-col>
|
||||
</wd-row>
|
||||
|
||||
@ -9,7 +9,9 @@
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout :navbarShow="false">
|
||||
<wd-text text="功能正在开发..." bold style="margin: 20px;"></wd-text>
|
||||
<view>
|
||||
财务管理
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
|
||||
@ -3,13 +3,15 @@
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '外部市场',
|
||||
navigationBarTitleText: '经营考核 ',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout :navbarShow="false">
|
||||
<wd-text text="功能正在开发..." bold style="margin: 20px;"></wd-text>
|
||||
<view>
|
||||
经营管理
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
|
||||
@ -12,8 +12,7 @@
|
||||
<wd-col-picker label="选择目录" v-model="selectedValue" :columns="dataSource" :column-change="columnChange"
|
||||
@confirm="handleConfirm" :display-format="displayFormat"></wd-col-picker>
|
||||
<iframe id="bdIframe" :src="fileUrl" ref="bdIframe" style="border: none;" class="iframe" v-if="fileUrl" />
|
||||
<view v-if="fileUrl2" class="bdIframe" @click="onlinePreview(item.path)" v-for="(item, i) in fileUrl2"
|
||||
style="padding: 15px 0 0 0">
|
||||
<view v-if="fileUrl2" class="bdIframe" @click="onlinePreview(item.path)" v-for="(item, i) in fileUrl2" style="padding: 15px 0 0 0">
|
||||
<wd-card :title="item.name"></wd-card>
|
||||
</view>
|
||||
<view v-else style="padding: 20px;">
|
||||
@ -77,12 +76,10 @@
|
||||
let insFlag = res.result.insFlag
|
||||
if (url) {
|
||||
if (isH5()) {
|
||||
fileUrl.value = 'https://szcx.zyyt.sinopec.com/preview/onlinePreview?url=' +
|
||||
encodeURIComponent(
|
||||
fileUrl.value = 'https://szcx.zyyt.sinopec.com/preview/onlinePreview?url=' + encodeURIComponent(
|
||||
Base64.encode(baseUrl + url))
|
||||
} else {
|
||||
fileUrl.value = 'https://szcx.zyyt.sinopec.com/preview/onlinePreview?url=' +
|
||||
encodeURIComponent(
|
||||
fileUrl.value = 'https://szcx.zyyt.sinopec.com/preview/onlinePreview?url=' + encodeURIComponent(
|
||||
new base64().encode(baseUrl + url))
|
||||
}
|
||||
} else if (/^-?\d+$/.test(quote) && !insFlag) {
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '外部市场 ',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout :navbarShow="false">
|
||||
<wd-text text="功能正在开发..." bold style="margin: 20px;"></wd-text>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -1,20 +0,0 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '安全管理',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout :navbarShow="false">
|
||||
<wd-text text="功能正在开发..." bold style="margin: 20px;"></wd-text>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -1,336 +1,8 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '站场工艺参数实时数据',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout navTitle="站场工艺参数实时数据" routeMethod="pushTab">
|
||||
<!-- 标题行 -->
|
||||
<wd-text :text="stationName ? stationName: ' '"
|
||||
style="color: blue;font-size:18px;text-align: center;margin: 5px;"></wd-text>
|
||||
<wd-cell :title="'时间:' + nowDateTime " center>
|
||||
<wd-button custom-class="custom-value" size="small" plain clickable
|
||||
@click="handleStop">{{caijiText}}</wd-button>
|
||||
<wd-button custom-class="custom-value" size="small" plain clickable
|
||||
@click="handleRightClick">选择站场</wd-button>
|
||||
|
||||
</wd-cell>
|
||||
|
||||
<scroll-view direction="vertical" class="scroll-container">
|
||||
<view class="container">
|
||||
<view>
|
||||
<view class="field-item">
|
||||
<text class="titlejl">参数名称</text>
|
||||
<text class="field-value">参数数值</text>
|
||||
<text class="field-dw">单位</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view v-for="(item, index) in jlData" :key="index" class="card">
|
||||
<view>
|
||||
<view class="field-item">
|
||||
<text class="titlejl">{{ item.jldname }}:</text>
|
||||
<text class="field-value">{{ formatNumber(item.gyvalue) || '-' }}</text>
|
||||
<text class="field-dw">{{ (item.jlddw) || '-' }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<wd-popup v-model="selectZc" position="bottom" custom-style="width:100%;height: 300px;" @close="handleClose">
|
||||
<view style="font-size: 18px;text-align: center;color: blue;margin: 10px;">选择采输气站场</view>
|
||||
<cxc-szcx-stationJl-select v-model="stationID" returnCodeOrID="id" @change="onChange">
|
||||
</cxc-szcx-stationJl-select>
|
||||
</wd-popup>
|
||||
|
||||
<wd-popup v-model="sssjFlag" position="bottom" custom-style="width:100%;height: 70vh;" @close="handleClose">
|
||||
<sssj-chart :jldData="jldData"></sssj-chart>
|
||||
</wd-popup>
|
||||
<wd-popup v-model="lssjFlag" position="bottom" custom-style="width:100%;height: 70vh;" @close="handleClose">
|
||||
<lssj-chart :jldData="jldData"></lssj-chart>
|
||||
</wd-popup>
|
||||
</PageLayout>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
queryJldZcList,
|
||||
queryJldDataByZc
|
||||
} from '@/api/production'
|
||||
import {
|
||||
ref,
|
||||
onMounted,
|
||||
computed,
|
||||
nextTick,
|
||||
watchEffect,
|
||||
onUnmounted,
|
||||
} from 'vue';
|
||||
import {
|
||||
onHide,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
formatDate
|
||||
} from '@/utils/dateTime.ts';
|
||||
|
||||
import SssjChart from './chart/sssjChart'
|
||||
import LssjChart from './chart/lssjChart'
|
||||
|
||||
const res = wx.getSystemInfoSync();
|
||||
const statusHeight = res.statusBarHeight; //状态栏高度
|
||||
const cusnavbarheight = (statusHeight + 30) + "px";
|
||||
|
||||
const selectZc = ref(false)
|
||||
const lssjFlag = ref(false)
|
||||
const sssjFlag = ref(false)
|
||||
const nowDateTime = ref("")
|
||||
const caijiText = ref("停止采集")
|
||||
const stationList = ref([])
|
||||
const stationID = ref("")
|
||||
const stationName = ref(" ")
|
||||
const jlData = ref([])
|
||||
const jldData = ref({})
|
||||
|
||||
const GyKrByzc = ref('https://szcx.zyyt.sinopec.com/Gyk/sssj/GetGyKrByZc')
|
||||
|
||||
function openSssjChart(e) {
|
||||
sssjFlag.value = true;
|
||||
console.log(11, e)
|
||||
jldData.value = e
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function openlssjChart(e) {
|
||||
lssjFlag.value = true;
|
||||
jldData.value = e
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function handleRightClick() {
|
||||
selectZc.value = true;
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function onChange(e, data) {
|
||||
console.log(2, e, data.value);
|
||||
stationID.value = e
|
||||
stationName.value = data.value.title
|
||||
|
||||
getScData(); //获取生产数据
|
||||
|
||||
}
|
||||
|
||||
function handleStop() {
|
||||
|
||||
if (caijiText.value === "停止采集") {
|
||||
console.log('清除定时器,停止采集')
|
||||
caijiText.value = "开始采集"
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
|
||||
} else {
|
||||
console.log('开始采集,打开定时器')
|
||||
caijiText.value = "停止采集"
|
||||
websocketheart()
|
||||
}
|
||||
}
|
||||
|
||||
const websock = ref(null);
|
||||
const timer2 = ref(null);
|
||||
// 封装心跳函数
|
||||
const websocketheart = () => {
|
||||
// 先清除之前的定时器
|
||||
if (timer2.value) {
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
}
|
||||
timer2.value = setInterval(() => {
|
||||
nowDateTime.value = formatDate(new Date(), "YYYY-MM-DD HH:mm:ss")
|
||||
if (websock.value && websock.value.readyState === 1) {
|
||||
// 如果连接正常,发送心跳消息
|
||||
// connectSocketInit()
|
||||
}
|
||||
if (stationID.value) {
|
||||
getScData();
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
onMounted(() => {
|
||||
websocketheart()
|
||||
// stationID.value = "1267633458481725442"
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(timer2.value);
|
||||
})
|
||||
|
||||
onHide(() => {
|
||||
console.log('页面隐藏,清除定时器')
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
// 页面显示时重新启动定时器
|
||||
websocketheart()
|
||||
})
|
||||
const getScData = () => {
|
||||
uni.request({
|
||||
url: GyKrByzc.value + '?zhanc=' + stationID.value + '&jldLx=1',
|
||||
method: 'GET',
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
jlData.value = JSON.parse(res.data.result).JlData;
|
||||
}
|
||||
})
|
||||
}
|
||||
// 数字格式化
|
||||
const formatNumber = (num) => {
|
||||
let temp = 0;
|
||||
try {
|
||||
temp = parseFloat(num);
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
return temp.toFixed(4).replace(/\.?0+$/, '');
|
||||
};
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.header-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10 10rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.titlejl {
|
||||
font-size: 20rpx;
|
||||
vertical-align: middle;
|
||||
font-weight: bold;
|
||||
color: #0055ff;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 5px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.field-list {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
/* 允许子元素换行 */
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.field-item {
|
||||
display: flex;
|
||||
height: 30px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 5px 5px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
flex-basis: calc(50% - 10px);
|
||||
/* 每个元素占据约一半宽度,减去间隙 */
|
||||
box-sizing: border-box;
|
||||
/* 包含内边距和边框 */
|
||||
}
|
||||
|
||||
/* 当屏幕宽度较小时,每个元素占据整行 */
|
||||
@media (max-width: 200px) {
|
||||
.field-item {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.field-label {
|
||||
color: #666;
|
||||
font-size: 10px;
|
||||
flex: 1;
|
||||
margin-right: 2px;
|
||||
width: 80px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.field-labelssll {
|
||||
color: #0000ff;
|
||||
text-decoration: underline;
|
||||
font-size: 10px;
|
||||
flex: 1;
|
||||
margin-right: 2px;
|
||||
width: 80px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.field-value {
|
||||
color: #1890ff;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
width: 40vw;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.field-dw {
|
||||
color: #1890ff;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
width: 20vw;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.status-circle {
|
||||
width: 70rpx;
|
||||
height: 30rpx;
|
||||
font-size: 12px;
|
||||
vertical-align: middle;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.page-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
}
|
||||
<style>
|
||||
</style>
|
||||
@ -14,37 +14,18 @@
|
||||
<date-time-show></date-time-show>
|
||||
</view>
|
||||
<wd-card title="天然气实时数据">
|
||||
天然气计量实时数据。
|
||||
天然气实时数据汇总计算结果,用标签显示出各类天然气的实时数据,需要工业库后台进行计算
|
||||
<template #footer>
|
||||
<wd-button size="small" @click="gotoTrqSssj" plain>查看详情</wd-button>
|
||||
</template>
|
||||
</wd-card>
|
||||
|
||||
<wd-card title="工艺参数实时数据">
|
||||
各站场工艺参数实时数据
|
||||
<wd-card title="管道运行实时数据">
|
||||
各条管线的天然气实时数据汇总计算结果,用标签显示出各类天然气的实时数据,需要工业库后台进行计算
|
||||
<template #footer>
|
||||
<wd-button size="small" @click="gotoGycsSssj" plain>查看详情</wd-button>
|
||||
<wd-button size="small" @click="gotoGdSssj" plain>查看详情</wd-button>
|
||||
</template>
|
||||
</wd-card>
|
||||
<wd-card title="井口压力实时数据">
|
||||
井口压力实时数据
|
||||
<template #footer>
|
||||
<wd-button size="small" @click="gotoJkYlSssj" plain>查看详情</wd-button>
|
||||
</template>
|
||||
</wd-card>
|
||||
<wd-card title="可燃气体报警实时数据">
|
||||
各站场可燃气体报警仪实时数据
|
||||
<template #footer>
|
||||
<wd-button size="small" @click="gotoKrqtbjSssj" plain>查看详情</wd-button>
|
||||
</template>
|
||||
</wd-card>
|
||||
<wd-card title="压缩机实时数据">
|
||||
各站场压缩机运行参数实时数据
|
||||
<template #footer>
|
||||
<wd-button size="small" @click="gotoYsjSssj" plain>查看详情</wd-button>
|
||||
</template>
|
||||
</wd-card>
|
||||
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
@ -59,36 +40,6 @@
|
||||
}
|
||||
|
||||
function gotoGdSssj() {
|
||||
uni.navigateTo({
|
||||
url: '/pages-production/shishishuju/gycsSssj'
|
||||
})
|
||||
}
|
||||
|
||||
function gotoGycsSssj() {
|
||||
uni.navigateTo({
|
||||
url: '/pages-production/shishishuju/gycsSssj'
|
||||
})
|
||||
}
|
||||
|
||||
function gotoJkYlSssj() {
|
||||
uni.navigateTo({
|
||||
url: '/pages-production/shishishuju/jkYtYali'
|
||||
})
|
||||
}
|
||||
|
||||
function gotoKrqtbjSssj() {
|
||||
uni.navigateTo({
|
||||
url: '/pages-production/shishishuju/krqtSssj'
|
||||
})
|
||||
}
|
||||
|
||||
function gotoYsjSssj() {
|
||||
uni.navigateTo({
|
||||
url: '/pages-production/shishishuju/ysjSssj'
|
||||
})
|
||||
}
|
||||
|
||||
function gotoScSssj() {
|
||||
uni.navigateTo({
|
||||
url: '/pages-production/shishishuju/trqSssj'
|
||||
})
|
||||
|
||||
@ -1,385 +0,0 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '井口油套压实时数据',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout navTitle="井口压力实时数据" routeMethod="pushTab">
|
||||
<!-- 标题行 -->
|
||||
<!-- <wd-text :text="stationName ? stationName: ' '"
|
||||
style="color: blue;font-size:18px;text-align: center;margin: 5px;"></wd-text> -->
|
||||
<wd-cell :title="'时间:' + nowDateTime " center>
|
||||
<wd-button custom-class="custom-value" size="small" plain clickable
|
||||
@click="handleStop">{{caijiText}}</wd-button>
|
||||
<!-- <wd-button custom-class="custom-value" size="small" plain clickable
|
||||
@click="handleRightClick">选择站场</wd-button> -->
|
||||
|
||||
</wd-cell>
|
||||
|
||||
<scroll-view direction="vertical" class="scroll-container">
|
||||
<view class="container">
|
||||
<view v-for="(item, index) in jlData" :key="index" class="card">
|
||||
<view class="field-item">
|
||||
<text class="titlejl">{{ item.jh }}{{item.jldn}}</text>
|
||||
<!-- <view class="status-circle"
|
||||
:style="{ backgroundColor: item.yxzt==='运行' ? '#4CAF50' : '#F44336' }">
|
||||
{{item.yxzt}}
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
|
||||
<view class="field-list" v-if="item.jldn==null">
|
||||
<!-- 压力 -->
|
||||
|
||||
<view class="field-item">
|
||||
<text class="field-labelssll" @click="openSssjChart(item)">油压(MPa)</text>
|
||||
<text class=" field-value">{{ formatNumber(item.yyyl) || '-' }}</text>
|
||||
</view>
|
||||
<!-- 电量 -->
|
||||
<view class="field-item">
|
||||
<text class="field-label">电量(%)</text>
|
||||
<text class="field-value">{{ formatNumber(item.yydl) || '-' }}</text>
|
||||
</view>
|
||||
<!-- 电压 -->
|
||||
<view class="field-item">
|
||||
<text class="field-label">电压(V)</text>
|
||||
<text class="field-value">{{ formatNumber(item.yydy) || '-' }}</text>
|
||||
</view>
|
||||
<!-- 信号强度 -->
|
||||
|
||||
<view class="field-item">
|
||||
<text class="field-label">信号强度(dB)</text>
|
||||
<text class="field-value">{{ formatNumber(item.yyqd) || '-' }}</text>
|
||||
</view>
|
||||
|
||||
<view class="field-item">
|
||||
<text class="field-labelssll" @click="openSssjChart(item)">套压(MPa)</text>
|
||||
<text class=" field-value">{{ formatNumber(item.ytyl) || '-' }}</text>
|
||||
</view>
|
||||
<!-- 电量 -->
|
||||
<view class="field-item">
|
||||
<text class="field-label">电量(%)</text>
|
||||
<text class="field-value">{{ formatNumber(item.ytdl) || '-' }}</text>
|
||||
</view>
|
||||
<!-- 电压 -->
|
||||
<view class="field-item">
|
||||
<text class="field-label">电压(V)</text>
|
||||
<text class="field-value">{{ formatNumber(item.ytdy) || '-' }}</text>
|
||||
</view>
|
||||
<!-- 信号强度 -->
|
||||
|
||||
<view class="field-item">
|
||||
<text class="field-label">信号强度(dB)</text>
|
||||
<text class="field-value">{{ formatNumber(item.ytqd) || '-' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field-list" v-if="item.jldn">
|
||||
<view class="field-item">
|
||||
<text class="field-labelssll" @click="openSssjChart(item)">压力(MPa)</text>
|
||||
<text class=" field-value">{{ formatNumber(item.jtyl) || '-' }}</text>
|
||||
</view>
|
||||
<!-- 电量 -->
|
||||
<view class="field-item">
|
||||
<text class="field-label">电量(%)</text>
|
||||
<text class="field-value">{{ formatNumber(item.jtdl) || '-' }}</text>
|
||||
</view>
|
||||
<!-- 电压 -->
|
||||
<view class="field-item">
|
||||
<text class="field-label">电压(V)</text>
|
||||
<text class="field-value">{{ formatNumber(item.jtdy) || '-' }}</text>
|
||||
</view>
|
||||
<!-- 信号强度 -->
|
||||
|
||||
<view class="field-item">
|
||||
<text class="field-label">信号强度(dB)</text>
|
||||
<text class="field-value">{{ formatNumber(item.jtqd) || '-' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- <wd-popup v-model="selectZc" position="bottom" custom-style="width:100%;height: 300px;" @close="handleClose">
|
||||
<view style="font-size: 18px;text-align: center;color: blue;margin: 10px;">选择采输气站场</view>
|
||||
<cxc-szcx-stationJl-select v-model="stationID" returnCodeOrID="id" @change="onChange">
|
||||
</cxc-szcx-stationJl-select>
|
||||
</wd-popup> -->
|
||||
|
||||
<wd-popup v-model="sssjFlag" position="bottom" custom-style="width:100%;height: 70vh;" @close="handleClose">
|
||||
<sssj-chart :jldData="jldData"></sssj-chart>
|
||||
</wd-popup>
|
||||
<wd-popup v-model="lssjFlag" position="bottom" custom-style="width:100%;height: 70vh;" @close="handleClose">
|
||||
<lssj-chart :jldData="jldData"></lssj-chart>
|
||||
</wd-popup>
|
||||
</PageLayout>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
queryJldZcList,
|
||||
queryJldDataByZc
|
||||
} from '@/api/production'
|
||||
import {
|
||||
ref,
|
||||
onMounted,
|
||||
computed,
|
||||
nextTick,
|
||||
watchEffect,
|
||||
onUnmounted,
|
||||
} from 'vue';
|
||||
import {
|
||||
onHide,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
formatDate
|
||||
} from '@/utils/dateTime.ts';
|
||||
|
||||
import SssjChart from './chart/sssjChart'
|
||||
import LssjChart from './chart/lssjChart'
|
||||
|
||||
const res = wx.getSystemInfoSync();
|
||||
const statusHeight = res.statusBarHeight; //状态栏高度
|
||||
const cusnavbarheight = (statusHeight + 30) + "px";
|
||||
|
||||
const selectZc = ref(false)
|
||||
const lssjFlag = ref(false)
|
||||
const sssjFlag = ref(false)
|
||||
const nowDateTime = ref("")
|
||||
const caijiText = ref("停止采集")
|
||||
const stationList = ref([])
|
||||
const stationID = ref("")
|
||||
const stationName = ref(" ")
|
||||
const jlData = ref([])
|
||||
const jldData = ref({})
|
||||
const sssjUrl = ref('wss://szcx.zyyt.sinopec.com/Gyk/websocket/')
|
||||
const jlByzc = ref('https://szcx.zyyt.sinopec.com/ThingsBoard/tingsboard/list')
|
||||
|
||||
function openSssjChart(e) {
|
||||
sssjFlag.value = true;
|
||||
console.log(11, e)
|
||||
jldData.value = e
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function openlssjChart(e) {
|
||||
lssjFlag.value = true;
|
||||
jldData.value = e
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function handleRightClick() {
|
||||
selectZc.value = true;
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function onChange(e, data) {
|
||||
console.log(2, e, data.value);
|
||||
stationID.value = e
|
||||
stationName.value = data.value.title
|
||||
|
||||
getScData(); //获取生产数据
|
||||
|
||||
}
|
||||
|
||||
function handleStop() {
|
||||
|
||||
if (caijiText.value === "停止采集") {
|
||||
console.log('清除定时器,停止采集')
|
||||
caijiText.value = "开始采集"
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
|
||||
} else {
|
||||
console.log('开始采集,打开定时器')
|
||||
caijiText.value = "停止采集"
|
||||
websocketheart()
|
||||
}
|
||||
}
|
||||
|
||||
const websock = ref(null);
|
||||
const timer2 = ref(null);
|
||||
// 封装心跳函数
|
||||
const websocketheart = () => {
|
||||
// 先清除之前的定时器
|
||||
if (timer2.value) {
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
}
|
||||
timer2.value = setInterval(() => {
|
||||
nowDateTime.value = formatDate(new Date(), "YYYY-MM-DD HH:mm:ss")
|
||||
if (websock.value && websock.value.readyState === 1) {
|
||||
// 如果连接正常,发送心跳消息
|
||||
// connectSocketInit()
|
||||
}
|
||||
getScData();
|
||||
|
||||
}, 1000);
|
||||
};
|
||||
onMounted(() => {
|
||||
websocketheart()
|
||||
// stationID.value = "1267633458481725442"
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(timer2.value);
|
||||
})
|
||||
|
||||
onHide(() => {
|
||||
console.log('页面隐藏,清除定时器')
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
// 页面显示时重新启动定时器
|
||||
websocketheart()
|
||||
})
|
||||
const getScData = () => {
|
||||
|
||||
// console.log(jldData.value)
|
||||
uni.request({
|
||||
url: jlByzc.value + '?zhanc=' + stationID.value + '&jldLx=0',
|
||||
method: 'GET',
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
jlData.value = JSON.parse(res.data.result).JlData;
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
// 数字格式化
|
||||
const formatNumber = (num) => {
|
||||
let temp = 0;
|
||||
try {
|
||||
temp = parseFloat(num);
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
return temp.toFixed(4).replace(/\.?0+$/, '');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.header-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10 10rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.titlejl {
|
||||
font-size: 20rpx;
|
||||
vertical-align: middle;
|
||||
font-weight: bold;
|
||||
color: #0055ff;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 5px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.field-list {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
/* 允许子元素换行 */
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.field-item {
|
||||
display: flex;
|
||||
height: 30px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 5px 5px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
flex-basis: calc(50% - 10px);
|
||||
/* 每个元素占据约一半宽度,减去间隙 */
|
||||
box-sizing: border-box;
|
||||
/* 包含内边距和边框 */
|
||||
}
|
||||
|
||||
/* 当屏幕宽度较小时,每个元素占据整行 */
|
||||
@media (max-width: 200px) {
|
||||
.field-item {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.field-label {
|
||||
color: #666;
|
||||
font-size: 10px;
|
||||
flex: 1;
|
||||
margin-right: 2px;
|
||||
width: 80px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.field-labelssll {
|
||||
color: #0000ff;
|
||||
text-decoration: underline;
|
||||
font-size: 10px;
|
||||
flex: 1;
|
||||
margin-right: 2px;
|
||||
width: 80px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.field-value {
|
||||
color: #1890ff;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
width: 60px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.status-circle {
|
||||
width: 70rpx;
|
||||
height: 30rpx;
|
||||
font-size: 12px;
|
||||
vertical-align: middle;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.page-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
@ -1,336 +0,0 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '可燃气体浓度实时数据',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout navTitle="可燃气体浓度实时数据" routeMethod="pushTab">
|
||||
<!-- 标题行 -->
|
||||
<wd-text :text="stationName ? stationName: ' '"
|
||||
style="color: blue;font-size:18px;text-align: center;margin: 5px;"></wd-text>
|
||||
<wd-cell :title="'时间:' + nowDateTime " center>
|
||||
<wd-button custom-class="custom-value" size="small" plain clickable
|
||||
@click="handleStop">{{caijiText}}</wd-button>
|
||||
<wd-button custom-class="custom-value" size="small" plain clickable
|
||||
@click="handleRightClick">选择站场</wd-button>
|
||||
|
||||
</wd-cell>
|
||||
|
||||
<scroll-view direction="vertical" class="scroll-container">
|
||||
<view class="container">
|
||||
<view>
|
||||
<view class="field-item">
|
||||
<text class="titlejl">安装位置</text>
|
||||
<text class="field-value">参数数值</text>
|
||||
<text class="field-dw">运行状态 </text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view v-for="(item, index) in jlData" :key="index" class="card">
|
||||
<view>
|
||||
<view class="field-item">
|
||||
<text class="titlejl">{{ item.jldname }}:</text>
|
||||
<text class="field-value">{{ formatNumber(item.krvalue) || '-' }}%</text>
|
||||
<text class="field-dw">{{ item.krzt }} </text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<wd-popup v-model="selectZc" position="bottom" custom-style="width:100%;height: 300px;" @close="handleClose">
|
||||
<view style="font-size: 18px;text-align: center;color: blue;margin: 10px;">选择采输气站场</view>
|
||||
<cxc-szcx-stationJl-select v-model="stationID" returnCodeOrID="id" @change="onChange">
|
||||
</cxc-szcx-stationJl-select>
|
||||
</wd-popup>
|
||||
|
||||
<wd-popup v-model="sssjFlag" position="bottom" custom-style="width:100%;height: 70vh;" @close="handleClose">
|
||||
<sssj-chart :jldData="jldData"></sssj-chart>
|
||||
</wd-popup>
|
||||
<wd-popup v-model="lssjFlag" position="bottom" custom-style="width:100%;height: 70vh;" @close="handleClose">
|
||||
<lssj-chart :jldData="jldData"></lssj-chart>
|
||||
</wd-popup>
|
||||
</PageLayout>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
queryJldZcList,
|
||||
queryJldDataByZc
|
||||
} from '@/api/production'
|
||||
import {
|
||||
ref,
|
||||
onMounted,
|
||||
computed,
|
||||
nextTick,
|
||||
watchEffect,
|
||||
onUnmounted,
|
||||
} from 'vue';
|
||||
import {
|
||||
onHide,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
formatDate
|
||||
} from '@/utils/dateTime.ts';
|
||||
|
||||
import SssjChart from './chart/sssjChart'
|
||||
import LssjChart from './chart/lssjChart'
|
||||
|
||||
const res = wx.getSystemInfoSync();
|
||||
const statusHeight = res.statusBarHeight; //状态栏高度
|
||||
const cusnavbarheight = (statusHeight + 30) + "px";
|
||||
|
||||
const selectZc = ref(false)
|
||||
const lssjFlag = ref(false)
|
||||
const sssjFlag = ref(false)
|
||||
const nowDateTime = ref("")
|
||||
const caijiText = ref("停止采集")
|
||||
const stationList = ref([])
|
||||
const stationID = ref("")
|
||||
const stationName = ref(" ")
|
||||
const jlData = ref([])
|
||||
const jldData = ref({})
|
||||
|
||||
const GyKrByzc = ref('https://szcx.zyyt.sinopec.com/Gyk/sssj/GetGyKrByZc')
|
||||
|
||||
function openSssjChart(e) {
|
||||
sssjFlag.value = true;
|
||||
console.log(11, e)
|
||||
jldData.value = e
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function openlssjChart(e) {
|
||||
lssjFlag.value = true;
|
||||
jldData.value = e
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function handleRightClick() {
|
||||
selectZc.value = true;
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function onChange(e, data) {
|
||||
console.log(2, e, data.value);
|
||||
stationID.value = e
|
||||
stationName.value = data.value.title
|
||||
|
||||
getScData(); //获取生产数据
|
||||
|
||||
}
|
||||
|
||||
function handleStop() {
|
||||
|
||||
if (caijiText.value === "停止采集") {
|
||||
console.log('清除定时器,停止采集')
|
||||
caijiText.value = "开始采集"
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
|
||||
} else {
|
||||
console.log('开始采集,打开定时器')
|
||||
caijiText.value = "停止采集"
|
||||
websocketheart()
|
||||
}
|
||||
}
|
||||
|
||||
const websock = ref(null);
|
||||
const timer2 = ref(null);
|
||||
// 封装心跳函数
|
||||
const websocketheart = () => {
|
||||
// 先清除之前的定时器
|
||||
if (timer2.value) {
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
}
|
||||
timer2.value = setInterval(() => {
|
||||
nowDateTime.value = formatDate(new Date(), "YYYY-MM-DD HH:mm:ss")
|
||||
if (websock.value && websock.value.readyState === 1) {
|
||||
// 如果连接正常,发送心跳消息
|
||||
// connectSocketInit()
|
||||
}
|
||||
if (stationID.value) {
|
||||
getScData();
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
onMounted(() => {
|
||||
websocketheart()
|
||||
// stationID.value = "1267633458481725442"
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(timer2.value);
|
||||
})
|
||||
|
||||
onHide(() => {
|
||||
console.log('页面隐藏,清除定时器')
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
// 页面显示时重新启动定时器
|
||||
websocketheart()
|
||||
})
|
||||
const getScData = () => {
|
||||
uni.request({
|
||||
url: GyKrByzc.value + '?zhanc=' + stationID.value + '&jldLx=2',
|
||||
method: 'GET',
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
jlData.value = JSON.parse(res.data.result).JlData;
|
||||
}
|
||||
})
|
||||
}
|
||||
// 数字格式化
|
||||
const formatNumber = (num) => {
|
||||
let temp = 0;
|
||||
try {
|
||||
temp = parseFloat(num);
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
return temp.toFixed(8).replace(/\.?0+$/, '');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.header-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10 10rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.titlejl {
|
||||
font-size: 20rpx;
|
||||
vertical-align: middle;
|
||||
font-weight: bold;
|
||||
color: #0055ff;
|
||||
margin-bottom: 15px;
|
||||
width: 40vw;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 5px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.field-list {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
/* 允许子元素换行 */
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.field-item {
|
||||
display: flex;
|
||||
height: 30px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 5px 5px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
flex-basis: calc(50% - 10px);
|
||||
/* 每个元素占据约一半宽度,减去间隙 */
|
||||
box-sizing: border-box;
|
||||
/* 包含内边距和边框 */
|
||||
}
|
||||
|
||||
/* 当屏幕宽度较小时,每个元素占据整行 */
|
||||
@media (max-width: 200px) {
|
||||
.field-item {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.field-label {
|
||||
color: #666;
|
||||
font-size: 10px;
|
||||
flex: 1;
|
||||
margin-right: 2px;
|
||||
width: 80px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.field-labelssll {
|
||||
color: #0000ff;
|
||||
text-decoration: underline;
|
||||
font-size: 10px;
|
||||
flex: 1;
|
||||
margin-right: 2px;
|
||||
width: 80px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.field-value {
|
||||
color: #1890ff;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
width: 40vw;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.field-dw {
|
||||
color: #1890ff;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
width: 20vw;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.status-circle {
|
||||
width: 70rpx;
|
||||
height: 30rpx;
|
||||
font-size: 12px;
|
||||
vertical-align: middle;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.page-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
@ -1,465 +1,8 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '压缩机实时数据',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout navTitle="压缩机实时数据" routeMethod="pushTab">
|
||||
<!-- 标题行 -->
|
||||
<wd-text :text="stationName ? stationName: ' '"
|
||||
style="color: blue;font-size:18px;text-align: center;margin: 5px;"></wd-text>
|
||||
<wd-cell :title="'时间:' + nowDateTime " center>
|
||||
<wd-button custom-class="custom-value" size="small" plain clickable
|
||||
@click="handleStop">{{caijiText}}</wd-button>
|
||||
<wd-button custom-class="custom-value" size="small" plain clickable
|
||||
@click="handleRightClick">选择站场</wd-button>
|
||||
|
||||
</wd-cell>
|
||||
|
||||
<scroll-view direction="vertical" class="scroll-container">
|
||||
<view class="container">
|
||||
<view v-for="(item, index) in jlData" :key="index" class="card">
|
||||
<view class="field-item">
|
||||
<text class="titlejl">{{ item.jzname }}</text>
|
||||
<view class="status-circle"
|
||||
:style="{ backgroundColor: item.jzzt==='运行' ? '#4CAF50' : '#F44336' }">
|
||||
{{item.jzzt}}
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="field-list">
|
||||
<view v-for="(itempar, indexpar) in item.data" :key="index" class="card">
|
||||
<view class="field-itemData">
|
||||
<text class="titlejl">{{itempar.jldname}}</text>
|
||||
<text class="field-value">{{ formatNumber(itempar.ysvalue) || '' }}</text>
|
||||
<text class="field-dw">{{ (itempar.jlddw) || '' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<wd-popup v-model="selectZc" position="bottom" custom-style="width:100%;height: 300px;" @close="handleClose">
|
||||
<view style="font-size: 18px;text-align: center;color: blue;margin: 10px;">选择采输气站场</view>
|
||||
<cxc-szcx-stationJl-select v-model="stationID" returnCodeOrID="id" @change="onChange">
|
||||
</cxc-szcx-stationJl-select>
|
||||
</wd-popup>
|
||||
|
||||
<wd-popup v-model="sssjFlag" position="bottom" custom-style="width:100%;height: 70vh;" @close="handleClose">
|
||||
<sssj-chart :jldData="jldData"></sssj-chart>
|
||||
</wd-popup>
|
||||
<wd-popup v-model="lssjFlag" position="bottom" custom-style="width:100%;height: 70vh;" @close="handleClose">
|
||||
<lssj-chart :jldData="jldData"></lssj-chart>
|
||||
</wd-popup>
|
||||
</PageLayout>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
queryJldZcList,
|
||||
queryJldDataByZc
|
||||
} from '@/api/production'
|
||||
import {
|
||||
ref,
|
||||
onMounted,
|
||||
computed,
|
||||
nextTick,
|
||||
watchEffect,
|
||||
onUnmounted,
|
||||
} from 'vue';
|
||||
import {
|
||||
onHide,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
formatDate
|
||||
} from '@/utils/dateTime.ts';
|
||||
|
||||
import SssjChart from './chart/sssjChart'
|
||||
import LssjChart from './chart/lssjChart'
|
||||
|
||||
const res = wx.getSystemInfoSync();
|
||||
const statusHeight = res.statusBarHeight; //状态栏高度
|
||||
const cusnavbarheight = (statusHeight + 30) + "px";
|
||||
|
||||
const selectZc = ref(false)
|
||||
const lssjFlag = ref(false)
|
||||
const sssjFlag = ref(false)
|
||||
const nowDateTime = ref("")
|
||||
const caijiText = ref("停止采集")
|
||||
const stationList = ref([])
|
||||
const stationID = ref("")
|
||||
const stationName = ref(" ")
|
||||
const jlData = ref([])
|
||||
const jldData = ref({})
|
||||
const sssjUrl = ref('wss://szcx.zyyt.sinopec.com/Gyk/websocket/')
|
||||
const ysByzc = ref('https://szcx.zyyt.sinopec.com/Gyk/sssj/GetYsByZc')
|
||||
|
||||
function openSssjChart(e) {
|
||||
sssjFlag.value = true;
|
||||
console.log(11, e)
|
||||
jldData.value = e
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function openlssjChart(e) {
|
||||
lssjFlag.value = true;
|
||||
jldData.value = e
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function handleRightClick() {
|
||||
selectZc.value = true;
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
console.log(selectZc.value)
|
||||
}
|
||||
|
||||
function onChange(e, data) {
|
||||
console.log(2, e, data.value);
|
||||
stationID.value = e
|
||||
stationName.value = data.value.title
|
||||
|
||||
getScData(); //获取生产数据
|
||||
|
||||
}
|
||||
|
||||
function handleStop() {
|
||||
|
||||
if (caijiText.value === "停止采集") {
|
||||
console.log('清除定时器,停止采集')
|
||||
caijiText.value = "开始采集"
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
|
||||
} else {
|
||||
console.log('开始采集,打开定时器')
|
||||
caijiText.value = "停止采集"
|
||||
websocketheart()
|
||||
}
|
||||
}
|
||||
|
||||
const websock = ref(null);
|
||||
const timer2 = ref(null);
|
||||
// 封装心跳函数
|
||||
const websocketheart = () => {
|
||||
// 先清除之前的定时器
|
||||
if (timer2.value) {
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
}
|
||||
timer2.value = setInterval(() => {
|
||||
nowDateTime.value = formatDate(new Date(), "YYYY-MM-DD HH:mm:ss")
|
||||
if (websock.value && websock.value.readyState === 1) {
|
||||
// 如果连接正常,发送心跳消息
|
||||
// connectSocketInit()
|
||||
}
|
||||
if (stationID.value) {
|
||||
getScData();
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
onMounted(() => {
|
||||
websocketheart()
|
||||
// stationID.value = "1267633458481725442"
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(timer2.value);
|
||||
})
|
||||
|
||||
onHide(() => {
|
||||
console.log('页面隐藏,清除定时器')
|
||||
clearInterval(timer2.value);
|
||||
timer2.value = null;
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
// 页面显示时重新启动定时器
|
||||
websocketheart()
|
||||
})
|
||||
const getScData = () => {
|
||||
uni.request({
|
||||
url: ysByzc.value + '?zhanc=' + stationID.value,
|
||||
method: 'GET',
|
||||
success: (res) => {
|
||||
console.log(1111, res)
|
||||
jlData.value = processCompressorData(res.data.result);
|
||||
console.log(jlData.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 完整的数据分类和整理方法
|
||||
* @param {Array} data - 原始数据数组
|
||||
* @param {Array} fields - 需要保留的字段数组
|
||||
* @returns {Array} 分组整理后的数据
|
||||
*/
|
||||
function processCompressorData(data, fields = ['id', 'station_id', 'depart_id', 'zhan', 'gykbz', 'jlddw', 'ysvalue']) {
|
||||
// 数据验证
|
||||
if (!Array.isArray(data)) {
|
||||
console.error('数据必须是数组');
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!Array.isArray(fields)) {
|
||||
console.error('字段列表必须是数组');
|
||||
return [];
|
||||
}
|
||||
|
||||
const groupMap = new Map();
|
||||
const validFields = new Set(fields);
|
||||
|
||||
// 添加必要的字段
|
||||
validFields.add('jldname');
|
||||
|
||||
// 处理每个数据项
|
||||
data.forEach((item, index) => {
|
||||
try {
|
||||
// 跳过无效数据
|
||||
if (!item || typeof item !== 'object') {
|
||||
console.warn(`跳过无效数据项 ${index}`);
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析机组名称和参数名称
|
||||
if (!item.jldname || typeof item.jldname !== 'string') {
|
||||
console.warn(`跳过无jldname的数据项 ${index}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const jldnameParts = item.jldname.split('*');
|
||||
if (jldnameParts.length < 3) {
|
||||
console.warn(`无效的jldname格式: ${item.jldname}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const jzname = jldnameParts[1].trim();
|
||||
const paramName = jldnameParts[2].trim();
|
||||
|
||||
if (!jzname) {
|
||||
console.warn(`无法解析机组名称: ${item.jldname}`);
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化或获取机组分组
|
||||
if (!groupMap.has(jzname)) {
|
||||
groupMap.set(jzname, {
|
||||
jzname: jzname,
|
||||
jzzt: '停止', // 默认状态
|
||||
data: []
|
||||
});
|
||||
}
|
||||
|
||||
const group = groupMap.get(jzname);
|
||||
|
||||
// 检查发动机转速以确定机组状态
|
||||
if (paramName.includes('发动机转速')) {
|
||||
const speed = parseFloat(item.ysvalue) || 0;
|
||||
if (speed > 0) {
|
||||
group.jzzt = '运行';
|
||||
} else {
|
||||
group.jzzt = '停运';
|
||||
}
|
||||
}
|
||||
|
||||
// 创建精简的参数数据
|
||||
const paramData = {};
|
||||
validFields.forEach(field => {
|
||||
if (item.hasOwnProperty(field)) {
|
||||
// 特殊处理:参数名称使用解析后的名称
|
||||
if (field === 'jldname') {
|
||||
paramData[field] = paramName;
|
||||
} else {
|
||||
paramData[field] = item[field];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 添加到机组数据
|
||||
group.data.push(paramData);
|
||||
|
||||
} catch (error) {
|
||||
console.error(`处理数据项 ${index} 时出错:`, error);
|
||||
}
|
||||
});
|
||||
|
||||
// 转换为数组
|
||||
const result = Array.from(groupMap.values());
|
||||
|
||||
// 按机组名称排序
|
||||
result.sort((a, b) => a.jzname.localeCompare(b.jzname));
|
||||
|
||||
// 对每个机组的数据按参数名称排序
|
||||
result.forEach(group => {
|
||||
group.data.sort((a, b) => a.jldname.localeCompare(b.jldname));
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// 数字格式化
|
||||
const formatNumber = (num) => {
|
||||
let temp = 0;
|
||||
try {
|
||||
temp = parseFloat(num);
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
return temp.toFixed(4).replace(/\.?0+$/, '');
|
||||
};
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.header-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10 10rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 5px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.field-list {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
/* 允许子元素换行 */
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.field-item {
|
||||
display: flex;
|
||||
height: 30px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 5px 5px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
flex-basis: calc(50% - 10px);
|
||||
/* 每个元素占据约一半宽度,减去间隙 */
|
||||
box-sizing: border-box;
|
||||
/* 包含内边距和边框 */
|
||||
}
|
||||
|
||||
/* 当屏幕宽度较小时,每个元素占据整行 */
|
||||
@media (max-width: 200px) {
|
||||
.field-item {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.field-label {
|
||||
color: #666;
|
||||
font-size: 10px;
|
||||
flex: 1;
|
||||
margin-right: 2px;
|
||||
width: 80px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.field-labelssll {
|
||||
color: #0000ff;
|
||||
text-decoration: underline;
|
||||
font-size: 10px;
|
||||
flex: 1;
|
||||
margin-right: 2px;
|
||||
width: 80px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.field-itemData {
|
||||
display: flex;
|
||||
width: 40vw;
|
||||
height: 30px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 5px 5px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
flex-basis: calc(50% - 10px);
|
||||
/* 每个元素占据约一半宽度,减去间隙 */
|
||||
box-sizing: border-box;
|
||||
/* 包含内边距和边框 */
|
||||
}
|
||||
|
||||
.field-title {
|
||||
font-size: 20rpx;
|
||||
vertical-align: middle;
|
||||
font-weight: bold;
|
||||
color: #0055ff;
|
||||
margin-bottom: 15px;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.field-value {
|
||||
color: #1890ff;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.field-dw {
|
||||
color: #1890ff;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.status-circle {
|
||||
width: 70rpx;
|
||||
height: 30rpx;
|
||||
font-size: 12px;
|
||||
vertical-align: middle;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.page-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
}
|
||||
<style>
|
||||
</style>
|
||||
@ -376,7 +376,7 @@
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "外部市场"
|
||||
"navigationBarTitleText": "经营考核 "
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -387,15 +387,6 @@
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "三册"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "wbsc/index",
|
||||
"type": "page",
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "外部市场 "
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -620,15 +611,6 @@
|
||||
{
|
||||
"root": "pages-production",
|
||||
"pages": [
|
||||
{
|
||||
"path": "anquanguanli/index",
|
||||
"type": "page",
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "安全管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "ribaoshuju/index",
|
||||
"type": "page",
|
||||
@ -661,12 +643,7 @@
|
||||
},
|
||||
{
|
||||
"path": "shishishuju/gycsSssj",
|
||||
"type": "page",
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "站场工艺参数实时数据"
|
||||
}
|
||||
"type": "page"
|
||||
},
|
||||
{
|
||||
"path": "shishishuju/index",
|
||||
@ -677,24 +654,6 @@
|
||||
"navigationBarTitleText": "实时数据 "
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "shishishuju/jkYtYali",
|
||||
"type": "page",
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "井口油套压实时数据"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "shishishuju/krqtSssj",
|
||||
"type": "page",
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "可燃气体浓度实时数据"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "shishishuju/nyxhSssj",
|
||||
"type": "page"
|
||||
@ -710,12 +669,7 @@
|
||||
},
|
||||
{
|
||||
"path": "shishishuju/ysjSssj",
|
||||
"type": "page",
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "压缩机实时数据"
|
||||
}
|
||||
"type": "page"
|
||||
},
|
||||
{
|
||||
"path": "shishishuju/chart/lssjChart",
|
||||
|
||||
@ -29,11 +29,6 @@
|
||||
<jingying-guanli></jingying-guanli>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view v-if="current === 2">
|
||||
<scroll-view scroll-y :style="{ height: scrollViewHeight + 'px' }">
|
||||
<waibu-guanli></waibu-guanli>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
@ -49,7 +44,6 @@
|
||||
} from 'vue';
|
||||
import caiwuGuanli from '@/pages-operate/caiwu/index'
|
||||
import jingyingGuanli from '@/pages-operate/jingying/index'
|
||||
import waibuGuanli from '@/pages-operate/wbsc/index'
|
||||
const items = ref(['计划财务', '经营考核', '外部市场'])
|
||||
const current = ref(0)
|
||||
const res = wx.getSystemInfoSync();
|
||||
|
||||
@ -29,23 +29,10 @@
|
||||
<rb-data></rb-data>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view v-if="current === 2">
|
||||
<scroll-view scroll-y :style="{ height: scrollViewHeight + 'px' }">
|
||||
<anquan-data></anquan-data>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view v-if="current === 3">
|
||||
<scroll-view scroll-y :style="{ height: scrollViewHeight + 'px' }">
|
||||
<anquan-data></anquan-data>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view v-if="current === 4">
|
||||
<scroll-view scroll-y :style="{ height: scrollViewHeight + 'px' }">
|
||||
<anquan-data></anquan-data>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
@ -62,7 +49,6 @@
|
||||
|
||||
import rbData from '@/pages-production/ribaoshuju/index';
|
||||
import sssjData from '@/pages-production/shishishuju/index';
|
||||
import anquanData from '@/pages-production/anquanguanli/index';
|
||||
const items = ref(['实时数据', '日报数据', '安全管理', '工程技术', '仪控设备'])
|
||||
const current = ref(0)
|
||||
const res = wx.getSystemInfoSync();
|
||||
|
||||
4
src/types/uni-pages.d.ts
vendored
4
src/types/uni-pages.d.ts
vendored
@ -40,7 +40,6 @@ interface NavigateToOptions {
|
||||
"/pages-operate/file/index" |
|
||||
"/pages-operate/jingying/index" |
|
||||
"/pages-operate/sc/index" |
|
||||
"/pages-operate/wbsc/index" |
|
||||
"/pages-humanResource/absence/add" |
|
||||
"/pages-humanResource/absence/detail" |
|
||||
"/pages-humanResource/absence/index" |
|
||||
@ -73,7 +72,6 @@ interface NavigateToOptions {
|
||||
"/pages-bpm/unconventional/index" |
|
||||
"/pages-bpm/unconventional/stamp" |
|
||||
"/pages-bpm/zbkh/index" |
|
||||
"/pages-production/anquanguanli/index" |
|
||||
"/pages-production/ribaoshuju/index" |
|
||||
"/pages-production/ribaoshuju/rbsjLsxq" |
|
||||
"/pages-production/ribaoshuju/trqRbsj" |
|
||||
@ -81,8 +79,6 @@ interface NavigateToOptions {
|
||||
"/pages-production/shishishuju/aqbjSssj" |
|
||||
"/pages-production/shishishuju/gycsSssj" |
|
||||
"/pages-production/shishishuju/index" |
|
||||
"/pages-production/shishishuju/jkYtYali" |
|
||||
"/pages-production/shishishuju/krqtSssj" |
|
||||
"/pages-production/shishishuju/nyxhSssj" |
|
||||
"/pages-production/shishishuju/trqSssj" |
|
||||
"/pages-production/shishishuju/ysjSssj" |
|
||||
|
||||
@ -51,7 +51,7 @@ export const http = <T>(options: CustomRequestOptions) => {
|
||||
!options.hideErrorToast &&
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: (res.data as IResData<T>).msg,
|
||||
title: (res.data as IResData<T>).msg || '请求错误',
|
||||
})
|
||||
}
|
||||
// 使用z-paging,在底层的网络请求抛出异常时uni.$emit('z-paging-error-emit'),业务中可不写
|
||||
|
||||
@ -30,7 +30,7 @@ const http = <T>(options: CustomRequestOptions) => {
|
||||
!options.hideErrorToast &&
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: (res.data as T & { msg?: string })?.msg,
|
||||
title: (res.data as T & { msg?: string })?.msg || '请求错误',
|
||||
})
|
||||
reject(res)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user