Compare commits

..

24 Commits

Author SHA1 Message Date
a7a41c3715 添加井口压力 2025-10-17 18:20:57 +08:00
2d0c4ff808 修改人员信息页面的uni-unput换成wd-input没有chenge事件的问题,用confirm的事件 2025-10-11 16:10:55 +08:00
yangzhq68909
2dacbe6c08 2.3.1 2025-10-10 10:01:51 +08:00
c705efe142 添加工艺参数、可燃气体报警仪、压缩机参数的实时数据页面。 2025-10-01 19:58:57 +08:00
祥瑞 张
86c345ae81 Merge branch 'zxrapp' into 'master'
9.26张祥瑞

See merge request cxc/jeecguniapp!41
2025-09-26 01:47:28 +00:00
张祥瑞
1add87973a 9.26张祥瑞 2025-09-26 09:46:31 +08:00
祥瑞 张
5d4ac0d3e7 Merge branch 'zxruniapp' into 'master'
Zxruniapp

See merge request cxc/jeecguniapp!40
2025-09-25 02:43:00 +00:00
张祥瑞
7df7696fe1 Merge remote-tracking branch 'remotes/origin/master'
# Conflicts:
#	env/.env.development
2025-09-25 10:20:04 +08:00
张祥瑞
9dbae0a56e 9.25张祥瑞 2025-09-25 10:19:03 +08:00
yangzhq68909
4ba99e3990 请假获取劳资员接口修改 2025-09-23 16:47:27 +08:00
yangzhq68909
ab9669637b 1 2025-09-22 16:28:44 +08:00
yangzhq68909
875d6e7168 Merge remote-tracking branch 'remotes/origin/master'
# Conflicts:
#	env/.env.development
#	manifest.config.ts
#	src/manifest.json
2025-09-22 09:44:39 +08:00
yangzhq68909
f56b003766 1 2025-09-22 09:43:26 +08:00
年泽 闵
136bf74b25 Merge branch 'minJeecg' into 'master'
Min jeecg

See merge request cxc/jeecguniapp!39
2025-09-17 06:57:12 +00:00
lagos
cab2794040 Merge remote-tracking branch 'remotes/origin/master' into minJeecg 2025-09-17 14:56:06 +08:00
lagos
74c0d48277 1.ofice 2025-09-17 14:55:44 +08:00
张祥瑞
bec69289ac 9.17张祥瑞 2025-09-17 10:39:59 +08:00
3d088049ae Merge branch 'ldeyun' into 'master'
修改完善多曲线组件

See merge request cxc/jeecguniapp!38
2025-09-16 14:48:24 +00:00
efb6ae7daa Merge branch 'master' into 'ldeyun'
# Conflicts:
#   src/api/production/index.ts
#   src/pages-production/shishishuju/chart/lssjChart.vue
#   src/pages-production/shishishuju/trqSssj.vue
2025-09-16 14:48:09 +00:00
f382f24345 修改pages-production的页面及跳转逻辑,增加实时数据总揽页面,通过总览卡片跳转至实时数据页面。
修改了tab经营分包及跳转逻辑。
2025-09-16 22:39:12 +08:00
312005b3dc Update trqSssj.vue 2025-09-16 02:46:39 +00:00
ce9b557511 修改完善多曲线组件
完成实时采集页面瞬时流量点击查询五分钟存盘数据的历史趋势功能
2025-09-16 08:59:06 +08:00
yangzhq68909
aa9da6a821 2.2.0 2025-09-09 14:56:40 +08:00
yangzhq68909
814cad17d8 2.2.0 2025-09-09 14:56:05 +08:00
29 changed files with 1815 additions and 100 deletions

View File

@ -7,13 +7,11 @@ VITE_SHOW_SOURCEMAP = true
# 是否启用读取配置文件 min # 是否启用读取配置文件 min
#VITE_WEBAPP = 'D://opt//AppUpdateTest' #VITE_WEBAPP = 'D://opt//AppUpdateTest'
VITE_WEBAPP = '' VITE_WEBAPP = ''
#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.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://10.75.166.6/test'
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot' #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' #VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/wwapi'

4
env/.env.production vendored
View File

@ -8,7 +8,7 @@ VITE_SHOW_SOURCEMAP = false
#VITE_WEBAPP = 'D://opt//AppUpdateTest' #VITE_WEBAPP = 'D://opt//AppUpdateTest'
VITE_WEBAPP = '' VITE_WEBAPP = ''
VITE_SERVER_BASEURL = 'https://10.75.166.6/test' #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/jeecg-boot'
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/wwapi' #VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/wwapi'
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/yjapi' #VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/yjapi'

View File

@ -17,8 +17,8 @@ export default defineManifestConfig({
name: VITE_APP_TITLE, name: VITE_APP_TITLE,
appid: VITE_UNI_APPID, appid: VITE_UNI_APPID,
description: '', description: '',
versionName: '2.3.0', versionName: '2.3.1',
versionCode: '202509011', versionCode: '20251010',
transformPx: false, transformPx: false,
locale: VITE_FALLBACK_LOCALE, // 'zh-Hans' locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
/* 5+App特有相关 */ /* 5+App特有相关 */

View File

@ -10,6 +10,33 @@ 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
})
}
//20250925id
export function getfjkzbmforfjidApp(config : object) { //
return http({
url: mqtturl +
"/mqttcontroller/mqttcontroller/getfjkzbmforfjid",
method: 'GET',
data: config
})
}
export function testcontiont(config : object) { // export function testcontiont(config : object) { //
return http({ return http({
url: mqtturl + '/mqttSubclient/mqttSubclient/testgetcontint', url: mqtturl + '/mqttSubclient/mqttSubclient/testgetcontint',
@ -78,9 +105,17 @@ 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) { // export function Selecthomelist(config : object) { //
return http({ return http({
url: '/RoomOperation/RoomOperation/Selecthomelist', url: '/RoomAPP/RoomAPP/SelecthomelistForApp',
method: 'GET', method: 'GET',
data: config data: config
}) })

View File

@ -65,3 +65,11 @@ export function queryJldRbDataByJldID(params : object) { // 获取计量点日
data: params data: params
}) })
} }
export function queryGyKrDataByZc(params : object) { //
return http({
url: '/http://10.75.166.6:9999/Gyk/sssj/GetGyKrByZc',
method: 'GET',
data: params
})
}

View File

@ -29,7 +29,7 @@ export function editUserApi(config : object) {
/*根据部门Cod和角色Id查询用户信息*/ /*根据部门Cod和角色Id查询用户信息*/
export function queryUserByOrgRoleApi(config : object) { export function queryUserByOrgRoleApi(config : object) {
return http({ return http({
url: '/cxcChangesInPersonnel/cxcChangesInPersonnel/queryByDepCodRoleId', url: '/sys/user/queryByDepCodRoleId',
method: 'GET', method: 'GET',
data: config data: config
}) })

View File

@ -7,7 +7,7 @@ const baseUrl = import.meta.env.VITE_SERVER_BASEURL
class socket { class socket {
constructor() { constructor() {
console.log(77777777777777) // console.log(77777777777777)
this.socketUrl = baseUrl this.socketUrl = baseUrl
this.socketStart = false this.socketStart = false
this.socketType = '' this.socketType = ''
@ -50,7 +50,7 @@ class socket {
}) })
// update-end-author:taoyan date:20220422 for: v2.4.6 websocket #3278 // update-end-author:taoyan date:20220422 for: v2.4.6 websocket #3278
uni.onSocketOpen((res) => { uni.onSocketOpen((res) => {
console.log("连接进来了--------53333333333323----") // console.log("--------53333333333323----")
this.socketStart = true this.socketStart = true
callback && callback() callback && callback()
console.log('WebSocket连接已打开') console.log('WebSocket连接已打开')
@ -85,10 +85,10 @@ class socket {
socketReceive() { socketReceive() {
const _this = this const _this = this
uni.onSocketMessage(function (res) { uni.onSocketMessage(function (res) {
console.log('APP:--》收到服务器内容:', res) // console.log('APP:--', res)
console.log('连接路径----', baseUrl) // console.log('----', baseUrl)
if (res.data.startsWith('CONNECTED') || res.data.startsWith('MESSAGE') || res.data.startsWith('RECEIPT')) { if (res.data.startsWith('CONNECTED') || res.data.startsWith('MESSAGE') || res.data.startsWith('RECEIPT')) {
console.log('放行----------', res) // console.log('----------', res)
// STOMP socketTask.onMessage by // STOMP socketTask.onMessage by
return; return;
} }

View File

@ -2,8 +2,8 @@
"name": "数智产销", "name": "数智产销",
"appid": "__UNI__9F097F0", "appid": "__UNI__9F097F0",
"description": "", "description": "",
"versionName": "2.3.0", "versionName": "2.3.1",
"versionCode": "202509011", "versionCode": "20251010",
"transformPx": false, "transformPx": false,
"app-plus": { "app-plus": {
"usingComponents": true, "usingComponents": true,

View File

@ -39,7 +39,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <!--
<view class="connection-section"> <view class="connection-section">
<button v-if="!connected" @click="connectWebSocket" class="connect-btn"> <button v-if="!connected" @click="connectWebSocket" class="connect-btn">
连接WebSocket 连接WebSocket
@ -84,7 +84,8 @@
getMqttPushClient, getMqttPushClient,
treeChildList, treeChildList,
listAllRegions, listAllRegions,
Selecthomelist Selecthomelist,
getfjkzbmforfjidApp
} from '@/api/devicecontrol/officedevice'; } from '@/api/devicecontrol/officedevice';
// import socketforleader from '@/common/socketforleader' // import socketforleader from '@/common/socketforleader'
@ -127,7 +128,7 @@
if (res.success) { if (res.success) {
homelist.value = res.result.map((item, index) => ({ homelist.value = res.result.map((item, index) => ({
...item, // ...item, //
homezt: 0, // homezt0 // homezt: 0, // homezt0
})); }));
// //
} }
@ -176,6 +177,21 @@
} }
} }
} }
/**
* 房间信息订阅
*
*/
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) => { const getfjkzbm = async (item) => {
// console.log("5555----------",item.id) // console.log("5555----------",item.id)
let fjkzbm = {}; let fjkzbm = {};
@ -288,7 +304,9 @@
filteredFloors.value = groupByFloor(selectBydata) filteredFloors.value = groupByFloor(selectBydata)
// console.log("-555---", filteredFloors.value[0].rooms) // console.log("-555---", filteredFloors.value[0].rooms)
// //
getAllswitchByids() console.log("进入房间订阅:")
getfjkzbmforfjid();
// getAllswitchByids()
} }
} }
@ -297,7 +315,7 @@
//---------------------------end------------- //---------------------------end-------------
// //
const handlesocketMessage = (jsonString) => { const handlesocketMessage = (jsonString) => {
console.log("1300--666666666666666---", jsonString) // console.log("1300--666666666666666---", jsonString)
try { try {
const messageObj = JSON.parse(jsonString); const messageObj = JSON.parse(jsonString);
@ -378,12 +396,12 @@
uni.sendSocketMessage({ uni.sendSocketMessage({
data: connectFrame data: connectFrame
}); });
console.log("77777777777") // console.log("77777777777")
}); });
// //
socketTask.onMessage((res) => { socketTask.onMessage((res) => {
console.log("8888888888888888888") // console.log("8888888888888888888")
const data = res.data; const data = res.data;
const [commandLine, ...headerLines] = data.split('\n'); const [commandLine, ...headerLines] = data.split('\n');
const emptyLineIndex = headerLines.findIndex(line => line === ''); const emptyLineIndex = headerLines.findIndex(line => line === '');
@ -395,8 +413,8 @@
} }
const body = headerLines.slice(emptyLineIndex + 1).join('\n').replace(/\x00$/, ''); const body = headerLines.slice(emptyLineIndex + 1).join('\n').replace(/\x00$/, '');
console.log("999999999999999", res) // console.log("999999999999999", res)
console.log("121212121212", commandLine) // console.log("121212121212", commandLine)
switch (commandLine) { switch (commandLine) {
case 'CONNECTED': case 'CONNECTED':
connectionStatus.value = 'STOMP已连接'; connectionStatus.value = 'STOMP已连接';

View File

@ -13,30 +13,11 @@
<text class="info-value">{{ room.ssbmname }}</text> <text class="info-value">{{ room.ssbmname }}</text>
</view> </view>
</view> </view>
<!-- 补位元素确保网格始终保持两列布局 -->
<view v-if="floor.rooms.length % 2 !== 0" class="room-placeholder"></view>
</view> </view>
</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> </view>
</template> </template>
@ -48,11 +29,13 @@
} from 'vue' } from 'vue'
import { import {
gethomelist, gethomelist,
gethomelistforApp,
getMqttPushClient, getMqttPushClient,
selectfjkzbmforfjid, selectfjkzbmforfjid,
createdSwitch, createdSwitch,
listAllRegions, listAllRegions,
Selecthomelist Selecthomelist,
getfjkzbmforfjidApp
} from '@/api/devicecontrol/officedevice'; } from '@/api/devicecontrol/officedevice';
// import useWebSocketService from '@/api/devicecontrol/webSocketService' // import useWebSocketService from '@/api/devicecontrol/webSocketService'
@ -90,18 +73,33 @@
// //
const getofficehomelist = async () => { const getofficehomelist = async () => {
await gethomelist().then((res) => { //20250811,,
await gethomelistforApp().then((res) => {
if (res.success) { if (res.success) {
homelist.value = res.result.map((item, index) => ({ homelist.value = res.result.map((item, index) => ({
...item, ...item,
homezt: 0, // homezt0 // homezt: 0, // homezt0
})); }));
} }
}).catch((err) => { }).catch((err) => {
console.log(err); console.log(err);
}); });
filteredFloors.value = groupByFloor(homelist) filteredFloors.value = groupByFloor(homelist)
getAllswitchByids(); // 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);
});
}
} }
// //
@ -246,7 +244,7 @@
if (res.success) { if (res.success) {
selectBydata.value = res.result; selectBydata.value = res.result;
filteredFloors.value = groupByFloor(selectBydata) filteredFloors.value = groupByFloor(selectBydata)
getAllswitchByids() // getAllswitchByids()
} }
} }
//----------------end----------- //----------------end-----------

View File

@ -62,15 +62,15 @@
<view class="ac-controls" v-if="ktpd"> <view class="ac-controls" v-if="ktpd">
<button class="ac-btn" :class="{ 'active': acMode === 1 }" @click="conditioning(1)"> <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> <text>制冷 25°C</text>
</button> </button>
<button class="ac-btn" :class="{ 'active': acMode === 2 }" @click="conditioning(2)"> <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> <text>制热 27°C</text>
</button> </button>
<button class="ac-btn" :class="{ 'active': acMode === 0 }" @click="conditioning(0)"> <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> <text>关闭空调</text>
</button> </button>
</view> </view>

View File

@ -335,17 +335,13 @@
roleId: '1554379432313397250', roleId: '1554379432313397250',
orgCode: code orgCode: code
}).then(res => { }).then(res => {
if (res.result.length > 0) { model.hr = res.result.user.username
model.hr = res.result[0].username hrData.value = res.result.list.map(item => {
}
if (!code) {
hrData.value = res.result.map(item => {
return { return {
label: item.realname, label: item.realname,
value: item.username value: item.username
} }
}) })
}
}) })
} }
@ -364,8 +360,6 @@
getZwmcAndExa() getZwmcAndExa()
/*获取工作单位*/ /*获取工作单位*/
queryDepName() queryDepName()
/*获取劳资员*/
getHrList()
/*获取*/ /*获取*/
queryHisDate() queryHisDate()
}); });

View File

@ -16,11 +16,11 @@
</wd-row> </wd-row>
<wd-row> <wd-row>
<wd-col :span="12"> <wd-col :span="12">
<wd-input v-model="realname" clearable placeholder="姓名模糊查询" @change="getList" <wd-input v-model="realname" clearable placeholder="姓名模糊查询" @confirm="getList"
@clear="getList"></wd-input> @clear="getList"></wd-input>
</wd-col> </wd-col>
<wd-col :span="12"> <wd-col :span="12">
<wd-input v-model="contractNumber" clearable placeholder="劳动合同号模糊查询" @change="getList" <wd-input v-model="contractNumber" clearable placeholder="劳动合同号模糊查询" @confirm="getList"
@clear="getList"></wd-input> @clear="getList"></wd-input>
</wd-col> </wd-col>
</wd-row> </wd-row>

View File

@ -9,9 +9,7 @@
</route> </route>
<template> <template>
<PageLayout :navbarShow="false"> <PageLayout :navbarShow="false">
<view> <wd-text text="功能正在开发..." bold style="margin: 20px;"></wd-text>
财务管理
</view>
</PageLayout> </PageLayout>
</template> </template>

View File

@ -3,15 +3,13 @@
layout: 'default', layout: 'default',
style: { style: {
navigationStyle: 'custom', navigationStyle: 'custom',
navigationBarTitleText: '经营考核 ', navigationBarTitleText: '外部市场',
}, },
} }
</route> </route>
<template> <template>
<PageLayout :navbarShow="false"> <PageLayout :navbarShow="false">
<view> <wd-text text="功能正在开发..." bold style="margin: 20px;"></wd-text>
经营管理
</view>
</PageLayout> </PageLayout>
</template> </template>

View File

@ -12,7 +12,8 @@
<wd-col-picker label="选择目录" v-model="selectedValue" :columns="dataSource" :column-change="columnChange" <wd-col-picker label="选择目录" v-model="selectedValue" :columns="dataSource" :column-change="columnChange"
@confirm="handleConfirm" :display-format="displayFormat"></wd-col-picker> @confirm="handleConfirm" :display-format="displayFormat"></wd-col-picker>
<iframe id="bdIframe" :src="fileUrl" ref="bdIframe" style="border: none;" class="iframe" v-if="fileUrl" /> <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> <wd-card :title="item.name"></wd-card>
</view> </view>
<view v-else style="padding: 20px;"> <view v-else style="padding: 20px;">
@ -76,10 +77,12 @@
let insFlag = res.result.insFlag let insFlag = res.result.insFlag
if (url) { if (url) {
if (isH5()) { 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)) Base64.encode(baseUrl + url))
} else { } 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)) new base64().encode(baseUrl + url))
} }
} else if (/^-?\d+$/.test(quote) && !insFlag) { } else if (/^-?\d+$/.test(quote) && !insFlag) {

View File

@ -0,0 +1,20 @@
<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>

View File

@ -0,0 +1,20 @@
<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>

View File

@ -1,8 +1,336 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '站场工艺参数实时数据',
},
}
</route>
<template> <template>
</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>
<script> </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> <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>

View File

@ -14,18 +14,37 @@
<date-time-show></date-time-show> <date-time-show></date-time-show>
</view> </view>
<wd-card title="天然气实时数据"> <wd-card title="天然气实时数据">
天然气实时数据汇总计算结果用标签显示出各类天然气的实时数据需要工业库后台进行计算 天然气计量实时数据
<template #footer> <template #footer>
<wd-button size="small" @click="gotoTrqSssj" plain>查看详情</wd-button> <wd-button size="small" @click="gotoTrqSssj" plain>查看详情</wd-button>
</template> </template>
</wd-card> </wd-card>
<wd-card title="管道运行实时数据"> <wd-card title="工艺参数实时数据">
条管线的天然气实时数据汇总计算结果用标签显示出各类天然气的实时数据需要工业库后台进行计算 站场工艺参数实时数据
<template #footer> <template #footer>
<wd-button size="small" @click="gotoGdSssj" plain>查看详情</wd-button> <wd-button size="small" @click="gotoGycsSssj" plain>查看详情</wd-button>
</template> </template>
</wd-card> </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> </view>
</PageLayout> </PageLayout>
</template> </template>
@ -40,6 +59,36 @@
} }
function gotoGdSssj() { 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({ uni.navigateTo({
url: '/pages-production/shishishuju/trqSssj' url: '/pages-production/shishishuju/trqSssj'
}) })

View File

@ -0,0 +1,385 @@
<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>

View File

@ -0,0 +1,336 @@
<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>

View File

@ -1,8 +1,465 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '压缩机实时数据',
},
}
</route>
<template> <template>
</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>
<script> </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> <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>

View File

@ -376,7 +376,7 @@
"layout": "default", "layout": "default",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "经营考核 " "navigationBarTitleText": "外部市场"
} }
}, },
{ {
@ -387,6 +387,15 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "三册" "navigationBarTitleText": "三册"
} }
},
{
"path": "wbsc/index",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "外部市场 "
}
} }
] ]
}, },
@ -611,6 +620,15 @@
{ {
"root": "pages-production", "root": "pages-production",
"pages": [ "pages": [
{
"path": "anquanguanli/index",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "安全管理"
}
},
{ {
"path": "ribaoshuju/index", "path": "ribaoshuju/index",
"type": "page", "type": "page",
@ -643,7 +661,12 @@
}, },
{ {
"path": "shishishuju/gycsSssj", "path": "shishishuju/gycsSssj",
"type": "page" "type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "站场工艺参数实时数据"
}
}, },
{ {
"path": "shishishuju/index", "path": "shishishuju/index",
@ -654,6 +677,24 @@
"navigationBarTitleText": "实时数据 " "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", "path": "shishishuju/nyxhSssj",
"type": "page" "type": "page"
@ -669,7 +710,12 @@
}, },
{ {
"path": "shishishuju/ysjSssj", "path": "shishishuju/ysjSssj",
"type": "page" "type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "压缩机实时数据"
}
}, },
{ {
"path": "shishishuju/chart/lssjChart", "path": "shishishuju/chart/lssjChart",

View File

@ -29,6 +29,11 @@
<jingying-guanli></jingying-guanli> <jingying-guanli></jingying-guanli>
</scroll-view> </scroll-view>
</view> </view>
<view v-if="current === 2">
<scroll-view scroll-y :style="{ height: scrollViewHeight + 'px' }">
<waibu-guanli></waibu-guanli>
</scroll-view>
</view>
</view> </view>
</PageLayout> </PageLayout>
</template> </template>
@ -44,6 +49,7 @@
} from 'vue'; } from 'vue';
import caiwuGuanli from '@/pages-operate/caiwu/index' import caiwuGuanli from '@/pages-operate/caiwu/index'
import jingyingGuanli from '@/pages-operate/jingying/index' import jingyingGuanli from '@/pages-operate/jingying/index'
import waibuGuanli from '@/pages-operate/wbsc/index'
const items = ref(['计划财务', '经营考核', '外部市场']) const items = ref(['计划财务', '经营考核', '外部市场'])
const current = ref(0) const current = ref(0)
const res = wx.getSystemInfoSync(); const res = wx.getSystemInfoSync();

View File

@ -29,9 +29,22 @@
<rb-data></rb-data> <rb-data></rb-data>
</scroll-view> </scroll-view>
</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> </view>
</PageLayout> </PageLayout>
</template> </template>
@ -49,6 +62,7 @@
import rbData from '@/pages-production/ribaoshuju/index'; import rbData from '@/pages-production/ribaoshuju/index';
import sssjData from '@/pages-production/shishishuju/index'; import sssjData from '@/pages-production/shishishuju/index';
import anquanData from '@/pages-production/anquanguanli/index';
const items = ref(['实时数据', '日报数据', '安全管理', '工程技术', '仪控设备']) const items = ref(['实时数据', '日报数据', '安全管理', '工程技术', '仪控设备'])
const current = ref(0) const current = ref(0)
const res = wx.getSystemInfoSync(); const res = wx.getSystemInfoSync();

View File

@ -40,6 +40,7 @@ interface NavigateToOptions {
"/pages-operate/file/index" | "/pages-operate/file/index" |
"/pages-operate/jingying/index" | "/pages-operate/jingying/index" |
"/pages-operate/sc/index" | "/pages-operate/sc/index" |
"/pages-operate/wbsc/index" |
"/pages-humanResource/absence/add" | "/pages-humanResource/absence/add" |
"/pages-humanResource/absence/detail" | "/pages-humanResource/absence/detail" |
"/pages-humanResource/absence/index" | "/pages-humanResource/absence/index" |
@ -72,6 +73,7 @@ interface NavigateToOptions {
"/pages-bpm/unconventional/index" | "/pages-bpm/unconventional/index" |
"/pages-bpm/unconventional/stamp" | "/pages-bpm/unconventional/stamp" |
"/pages-bpm/zbkh/index" | "/pages-bpm/zbkh/index" |
"/pages-production/anquanguanli/index" |
"/pages-production/ribaoshuju/index" | "/pages-production/ribaoshuju/index" |
"/pages-production/ribaoshuju/rbsjLsxq" | "/pages-production/ribaoshuju/rbsjLsxq" |
"/pages-production/ribaoshuju/trqRbsj" | "/pages-production/ribaoshuju/trqRbsj" |
@ -79,6 +81,8 @@ interface NavigateToOptions {
"/pages-production/shishishuju/aqbjSssj" | "/pages-production/shishishuju/aqbjSssj" |
"/pages-production/shishishuju/gycsSssj" | "/pages-production/shishishuju/gycsSssj" |
"/pages-production/shishishuju/index" | "/pages-production/shishishuju/index" |
"/pages-production/shishishuju/jkYtYali" |
"/pages-production/shishishuju/krqtSssj" |
"/pages-production/shishishuju/nyxhSssj" | "/pages-production/shishishuju/nyxhSssj" |
"/pages-production/shishishuju/trqSssj" | "/pages-production/shishishuju/trqSssj" |
"/pages-production/shishishuju/ysjSssj" | "/pages-production/shishishuju/ysjSssj" |

View File

@ -51,7 +51,7 @@ export const http = <T>(options: CustomRequestOptions) => {
!options.hideErrorToast && !options.hideErrorToast &&
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: (res.data as IResData<T>).msg || '请求错误', title: (res.data as IResData<T>).msg,
}) })
} }
// 使z-paginguni.$emit('z-paging-error-emit') // 使z-paginguni.$emit('z-paging-error-emit')

View File

@ -30,7 +30,7 @@ const http = <T>(options: CustomRequestOptions) => {
!options.hideErrorToast && !options.hideErrorToast &&
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: (res.data as T & { msg?: string })?.msg || '请求错误', title: (res.data as T & { msg?: string })?.msg,
}) })
reject(res) reject(res)
} }