Merge branch 'master' of http://10.75.166.171/cxcxt/jeecguniapp
This commit is contained in:
commit
8329b325c4
@ -18,7 +18,7 @@ export default defineManifestConfig({
|
||||
appid: VITE_UNI_APPID,
|
||||
description: '',
|
||||
versionName: '2.0.0',
|
||||
versionCode: '20250603',
|
||||
versionCode: '20250605',
|
||||
transformPx: false,
|
||||
locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
|
||||
/* 5+App特有相关 */
|
||||
|
@ -106,6 +106,7 @@
|
||||
// 只有在页面中才默认返回,弹层中不返回
|
||||
if (props.type === 'page') {
|
||||
const pages = getCurrentPages()
|
||||
console.log(router)
|
||||
if (props.backRouteName || props.backRoutePath) {
|
||||
const prevPage = pages[pages.length - 2]
|
||||
if (prevPage) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
"appid": "__UNI__9F097F0",
|
||||
"description": "",
|
||||
"versionName": "2.0.0",
|
||||
"versionCode": "20250603",
|
||||
"versionCode": "20250605",
|
||||
"transformPx": false,
|
||||
"app-plus": {
|
||||
"usingComponents": true,
|
||||
|
@ -202,7 +202,7 @@
|
||||
|
||||
const startMutilProcess = (id) => {
|
||||
startMutilProcessApi({
|
||||
flowCode: "dev_cxc_qxj_new",
|
||||
flowCode: "dev_cxc_qxj",
|
||||
id,
|
||||
formUrl: "modules/qxj/modules/CxcQxjBpmModel",
|
||||
formUrlMobile: "leaveApplication"
|
||||
|
@ -112,7 +112,7 @@
|
||||
|
||||
function detail(record) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/views/renliziyuan/renyuanxinxi/detail?data=' + encodeURIComponent(JSON.stringify(record))
|
||||
url: '/pages-humanResource/personnel/detail?data=' + encodeURIComponent(JSON.stringify(record))
|
||||
});
|
||||
}
|
||||
// 计算年龄
|
||||
|
@ -11,12 +11,14 @@
|
||||
<PageLayout navTitle="制度详情">
|
||||
<view class="container">
|
||||
<wd-card title="制度">
|
||||
<view @click="onlinePreview(`/pages/onlinePreview/detail?data=${dataSource.sszd}`)">
|
||||
<view style="color: blue;"
|
||||
@click="onlinePreview(`/pages/onlinePreview/detail?data=${dataSource.sszd}`)">
|
||||
{{dataSource.zdmc}}
|
||||
</view>
|
||||
</wd-card>
|
||||
<wd-card title="解读材料">
|
||||
<view @click="onlinePreview(`/pages/onlinePreview/detail?data=${dataSource.jdwj}`)">
|
||||
<view style="color: blue;"
|
||||
@click="onlinePreview(`/pages/onlinePreview/detail?data=${dataSource.jdwj}`)">
|
||||
{{dataSource.jdwj}}
|
||||
</view>
|
||||
</wd-card>
|
||||
|
@ -93,6 +93,7 @@
|
||||
pageSize
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
console.log('---',res)
|
||||
list.value = [...list.value,...res.result.records];
|
||||
}
|
||||
loading = false
|
||||
|
@ -177,7 +177,12 @@
|
||||
},
|
||||
{
|
||||
"path": "pages/production/ribaoshuju/rbsjLsxq",
|
||||
"type": "page"
|
||||
"type": "page",
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "历史数据"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/production/ribaoshuju/trqRbsj",
|
||||
|
@ -14,7 +14,7 @@
|
||||
<view class="dot"></view>
|
||||
<wd-text text="文件预览"></wd-text>
|
||||
</view>
|
||||
<view v-if="isH5">
|
||||
<view v-if="ifH5">
|
||||
<!-- 在线预览 by 闵 -->
|
||||
<wd-text color="#1890ff" :lines='1' style="font-size: 40rpx;padding-left: 25rpx;padding-top: 25rpx;"
|
||||
decoration="underline"
|
||||
@ -35,9 +35,17 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { isH5 } from '@/utils/platform'
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app';
|
||||
const detail = ref({})
|
||||
const detailArr = ref([])
|
||||
const ifBackAll = ref(false); //判断是否直接返回最上级
|
||||
//判断是否h5 by 闵
|
||||
var ifH5 = false;
|
||||
const onlinePreview = (url) => { //在线预览文件 by 闵
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
@ -50,13 +58,31 @@
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
console.log(2222)
|
||||
detail.value = options.data
|
||||
detailArr.value = options.data.split(",");
|
||||
//#ifdef H5 || MP-WEIXIN
|
||||
ifH5 = true;
|
||||
//#endif
|
||||
//判断是否只有一个文件
|
||||
if (detailArr.value && detailArr.value.length == 1) {
|
||||
|
||||
let url = '/pages/onlinePreview/onlinePreview';
|
||||
if (isH5) url = '/pages/onlinePreview/onlinePreviewH5'
|
||||
onlinePreview(url + `?data=${JSON.stringify(options.data)}`);
|
||||
if (ifH5) url = '/pages/onlinePreview/onlinePreviewH5'
|
||||
uni.navigateTo({ //跳转成功赋予状态
|
||||
url: url + `?data=${JSON.stringify(options.data)}`,
|
||||
success: () => ifBackAll.value = true //只有一个文件,且加载了
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
onShow (()=>{
|
||||
//页面卸载,如果是从
|
||||
console.log(ifBackAll.value)
|
||||
if(ifBackAll.value){
|
||||
//直接返回上一级
|
||||
uni.navigateBack({
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
@ -18,9 +18,6 @@
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app';
|
||||
import base64 from '@/utils/code';
|
||||
import {
|
||||
getEnvBaseUrl
|
||||
} from '@/utils/index'
|
||||
const baseUrl = 'https://10.75.166.6/jeecg-boot/sys/common/static/';
|
||||
var fileUrl = "";
|
||||
|
||||
|
@ -12,14 +12,14 @@
|
||||
<view>
|
||||
<view class="placeholder"></view>
|
||||
<view style="width: 100%; display: grid; place-items: center">
|
||||
<uni-title :title="dateDate + ':生产经营情况'" type="h1" color="blue" />
|
||||
<uni-title :title="dateDate + ':生产情况'" type="h1" color="blue" />
|
||||
</view>
|
||||
<view style="margin: 0 10px;">
|
||||
<uni-segmented-control style="margin-top: 10px;margin-bottom: 10px" :current="current" :values="items"
|
||||
@clickItem="onClickItem" styleType="button" activeColor="#0055ff"></uni-segmented-control>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view v-show="current === 0">
|
||||
<view v-if="current === 0">
|
||||
<view style="padding: 0 10px">
|
||||
<view class="progress-bartime">
|
||||
<!-- 动态设置宽度和颜色 -->
|
||||
@ -35,7 +35,7 @@
|
||||
<yy-data></yy-data>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view v-show="current === 1">
|
||||
<view v-if="current === 1">
|
||||
<scroll-view scroll-y :style="{ height: scrollViewHeight + 'px' }">
|
||||
<sssjForm></sssjForm>
|
||||
</scroll-view>
|
||||
@ -98,6 +98,10 @@
|
||||
window.removeEventListener('resize', calculateScrollViewHeight);
|
||||
});
|
||||
|
||||
onHide(()=>{ //切换首页后,将生产切换为日本数据以清楚定时 by闵
|
||||
current.value = 0;
|
||||
})
|
||||
|
||||
const calculateScrollViewHeight = () => {
|
||||
// 获取屏幕的总高度
|
||||
const screenHeight = uni.getSystemInfoSync().windowHeight;
|
||||
|
@ -1,5 +1,14 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '历史数据',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout :navbarShow="false">
|
||||
<PageLayout navTitle="历史数据">
|
||||
<view class="stats-container">
|
||||
<uni-title v-if="type === 'trq'" :title="name.unit + '天然气---单位(万方)'" color="blue" type="h2"></uni-title>
|
||||
<uni-title v-if="type === 'yy'" :title="name.dw + '原油---单位(吨)'" color="blue" type="h2"></uni-title>
|
||||
@ -18,54 +27,19 @@
|
||||
<view class="stats-item">最小值: {{ dataStats.min }}</view>
|
||||
<view class="stats-item">平均值: {{ dataStats.average }}</view>
|
||||
</view>
|
||||
|
||||
<wd-table :data="dataList" :height="800" v-if="type === 'trq'" :index="true">
|
||||
<wd-table-col prop="unit" label="名称" :width="screenWidth / 3" align="center"></wd-table-col>
|
||||
<wd-table-col prop="rqDate" label="日期" :width="screenWidth / 4" align="center"></wd-table-col>
|
||||
<wd-table-col prop="rq" label="日气量" :width="screenWidth / 5" align="center"></wd-table-col>
|
||||
</wd-table>
|
||||
|
||||
<view v-if="type === 'trq'" class="table-container">
|
||||
<!-- 表头 -->
|
||||
<view class="tr header">
|
||||
<view class="th1">序号</view>
|
||||
<view class="th">名称</view>
|
||||
<view class="th">日期</view>
|
||||
<view class="th">日气量</view>
|
||||
</view>
|
||||
<scroll-view scroll-Y="true" class="scroll-wrapper">
|
||||
<!-- 表格内容 -->
|
||||
<view class="tr" v-for="(item, index) in dataList" :key="index" :class="{ even: index % 2 === 0 }">
|
||||
<view class="td1">{{ index + 1 }}</view>
|
||||
<view class="td">{{ item.unit }}</view>
|
||||
<view class="td">{{ item.rqDate }}</view>
|
||||
<view class="td" :class="{ negative: item.rq < 0 }">
|
||||
{{ item.rq }}
|
||||
</view>
|
||||
</view>
|
||||
<wd-table :data="dataList" :height="800" v-if="type === 'yy'" :index="true">
|
||||
<wd-table-col prop="dw" label="名称" :width="screenWidth / 3" align="center"></wd-table-col>
|
||||
<wd-table-col prop="scrq" label="日期" :width="screenWidth / 4" align="center"></wd-table-col>
|
||||
<wd-table-col prop="rcwy" label="日油量" :width="screenWidth / 5" align="center"></wd-table-col>
|
||||
</wd-table>
|
||||
|
||||
<!-- 空数据提示 -->
|
||||
<view v-if="!dataList.length" class="empty">暂无相关数据</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view v-if="type === 'yy'" class="table-container">
|
||||
<!-- 表头 -->
|
||||
<view class="tr header">
|
||||
<view class="th1">序号</view>
|
||||
<view class="th">名称</view>
|
||||
<view class="th">日期</view>
|
||||
<view class="th">日油量</view>
|
||||
</view>
|
||||
<scroll-view scroll-Y="true" class="scroll-wrapper">
|
||||
<!-- 表格内容 -->
|
||||
<view class="tr" v-for="(item, index) in dataList" :key="index" :class="{ even: index % 2 === 0 }">
|
||||
<view class="td1">{{ index + 1 }}</view>
|
||||
<view class="td">{{ item.dw }}</view>
|
||||
<view class="td">{{ item.scrq }}</view>
|
||||
<view class="td" :class="{ negative: item.rcwy < 0 }">
|
||||
{{ item.rcwy }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空数据提示 -->
|
||||
<view v-if="!dataList.length" class="empty">暂无相关数据</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
@ -91,6 +65,11 @@
|
||||
max: 0,
|
||||
avg: 0
|
||||
});
|
||||
const screenWidth = ref(0)
|
||||
const calculateTableHeight = () => {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
screenWidth.value = systemInfo.screenWidth;
|
||||
}
|
||||
const getJinriShengchansj = (tempDateRange) => {
|
||||
// console.log(tempDateRange);
|
||||
// 添加日期有效性检查
|
||||
@ -232,6 +211,11 @@
|
||||
onMounted(() => {
|
||||
// nextTick();
|
||||
// getJinriShengchansj(dateRange.value);
|
||||
calculateTableHeight();
|
||||
// 监听屏幕旋转变化
|
||||
uni.onWindowResize(() => {
|
||||
calculateTableHeight();
|
||||
});
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
@ -253,70 +237,6 @@
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.table-container {
|
||||
width: 100%;
|
||||
height: 40vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.scroll-wrapper {
|
||||
width: 100%;
|
||||
height: 35vh;
|
||||
}
|
||||
|
||||
.tr {
|
||||
display: flex;
|
||||
min-height: 14px;
|
||||
font-size: 12px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
}
|
||||
|
||||
.th,
|
||||
.td {
|
||||
flex: 1;
|
||||
min-width: 80px;
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
height: 18px;
|
||||
vertical-align: middle;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.th1,
|
||||
.td1 {
|
||||
flex: 1;
|
||||
max-width: 40px;
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
height: 14px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.th {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.td.negative {
|
||||
color: #ff4444;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.empty {
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
color: #888;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.stats-container {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
|
@ -48,42 +48,19 @@
|
||||
</view>
|
||||
</wd-popup>
|
||||
<!-- 数据弹窗 -->
|
||||
<wd-popup v-model="popup" position="bottom" background-color="#fff">
|
||||
<view class="popup-content">
|
||||
<view class="popup-header">
|
||||
<text class="title">{{ selectedGas }}数据详情 单位(万立方米)</text>
|
||||
<uni-icons type="closeempty" size="24" color="#666" @click="closePopup"></uni-icons>
|
||||
</view>
|
||||
|
||||
<view class="table">
|
||||
<!-- 表头 -->
|
||||
<view class="tr header">
|
||||
<view class="th1">序号</view>
|
||||
<view class="th">名称</view>
|
||||
<view class="th">日气量</view>
|
||||
<view class="th">年累计</view>
|
||||
<view class="th1">操作</view>
|
||||
</view>
|
||||
<scroll-view scroll-X="true" scroll-Y="true" class="table-container">
|
||||
<!-- 表格内容 -->
|
||||
<view class="tr" v-for="(item, index) in filteredData" :key="index"
|
||||
:class="{ even: index % 2 === 0 }">
|
||||
<view class="td1">{{ index + 1 }}</view>
|
||||
<view class="td">{{ item.unit }}</view>
|
||||
<view class="td" :class="{ negative: item.rq < 0 }">
|
||||
{{ formatNumber(item.rq) }}
|
||||
</view>
|
||||
<view class="td" :class="{ negative: item.yearVolume < 0 }">
|
||||
{{ formatNumber(item.yearVolume) }}
|
||||
</view>
|
||||
<view class="td1" style="color: red" @click="goHistory(item)">历史</view>
|
||||
</view>
|
||||
|
||||
<!-- 空数据提示 -->
|
||||
<view v-if="!filteredData.length" class="empty">暂无相关数据</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<wd-popup v-model="popup" position="bottom" closable custom-style="height: 400px;" @close="handleClose">
|
||||
<wd-cell-group :title="tableTitle">
|
||||
<wd-table :data="filteredData" :height="800">
|
||||
<wd-table-col prop="unit" label="名称" :width="screenWidth * 57 / 140 " align="center"></wd-table-col>
|
||||
<wd-table-col prop="rq" label="日气量" :width="screenWidth / 5" align="center"></wd-table-col>
|
||||
<wd-table-col prop="yearVolume" label="年累计" :width="screenWidth / 4" align="center"></wd-table-col>
|
||||
<wd-table-col prop="" label="操作" :width="screenWidth / 7" align="center">
|
||||
<template #value="{row}">
|
||||
<text style="color: red;" @click="goHistory(row)">历史</text>
|
||||
</template>
|
||||
</wd-table-col>
|
||||
</wd-table>
|
||||
</wd-cell-group>
|
||||
</wd-popup>
|
||||
</template>
|
||||
|
||||
@ -102,7 +79,7 @@
|
||||
const shishiArrSelect = ref([]);
|
||||
const shishiArrDisplay = ref(['气井气', '商品量', '站线综合输差']);
|
||||
const dataJinriUnit = ref([]);
|
||||
const selectedGas = ref('');
|
||||
const tableTitle = ref('')
|
||||
const filteredData = ref([]);
|
||||
const popup = ref(false);
|
||||
const popupSelect = ref(false);
|
||||
@ -117,12 +94,13 @@
|
||||
const splNdjs = ref(7220);
|
||||
const zhqNdjs = ref(300);
|
||||
const zhscNdjs = ref(50);
|
||||
|
||||
|
||||
|
||||
const screenWidth = ref(0)
|
||||
const handleClose = () => {
|
||||
popup.value = false
|
||||
}
|
||||
|
||||
// 点击卡片处理
|
||||
// const handleCardClick = (gas) => {
|
||||
// selectedGas.value = gas;
|
||||
// let queryParms = {};
|
||||
// filteredData.value = [];
|
||||
// queryParms.day = strDate.value;
|
||||
@ -173,19 +151,37 @@
|
||||
};
|
||||
|
||||
const handleCardClick = (gas) => {
|
||||
selectedGas.value = gas;
|
||||
tableTitle.value = gas + '数据详情 单位(万立方米)'
|
||||
filteredData.value = dataJinriSumUnit.value.filter((item) => item.gas === gas);
|
||||
filteredData.value = filteredData.value.map(item => {
|
||||
return {
|
||||
...item,
|
||||
rq: formatNumber(item.rq),
|
||||
yearVolume: formatNumber(item.yearVolume)
|
||||
}
|
||||
})
|
||||
popup.value = true;
|
||||
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const closePopup = () => {
|
||||
popup.value = false;
|
||||
};
|
||||
|
||||
const calculateTableHeight = () => {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
screenWidth.value = systemInfo.screenWidth;
|
||||
}
|
||||
onMounted(() => {
|
||||
getJinriTrqShengchansj();
|
||||
|
||||
getJinriShengchansj();
|
||||
|
||||
calculateTableHeight();
|
||||
// 监听屏幕旋转变化
|
||||
uni.onWindowResize(() => {
|
||||
calculateTableHeight();
|
||||
});
|
||||
});
|
||||
|
||||
// 数字格式化
|
||||
@ -202,7 +198,6 @@
|
||||
|
||||
// 自动计算综合输差
|
||||
function calcZhsc(tempArray) {
|
||||
console.log(tempArray)
|
||||
let totalJinqi = {
|
||||
gas: '总进气',
|
||||
dailyVolume: 0,
|
||||
@ -274,8 +269,6 @@
|
||||
tempArray.push(trqSpl);
|
||||
|
||||
return tempArray;
|
||||
|
||||
// console.log(composite);
|
||||
}
|
||||
|
||||
const getJinriTrqShengchansj = () => {
|
||||
@ -287,9 +280,7 @@
|
||||
}
|
||||
let queryParms = {};
|
||||
shishiArr.value = [];
|
||||
|
||||
queryParms.day = strDate.value;
|
||||
// // console.log(queryParms);
|
||||
queryJinriTrqShengchansj(queryParms).then((res) => {
|
||||
if (res.success) {
|
||||
console.log(1, res);
|
||||
@ -301,20 +292,16 @@
|
||||
item.yearPerCent = calcPercent(item.yearPlan, item.yearVolume);
|
||||
}
|
||||
});
|
||||
console.log(2, temp);
|
||||
console.log(calcZhsc(temp))
|
||||
shishiArr.value = calcZhsc(temp);
|
||||
nextTick();
|
||||
onselectionchange();
|
||||
console.log(3, shishiArr.value);
|
||||
console.log(4, shishiArrSelect.value);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function goHistory(val) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/views/shengchan/ribaoshuju/rbsjLsxq?data=' + JSON.stringify(val) + '&type=trq'
|
||||
url: '/pages/production/ribaoshuju/rbsjLsxq?data=' + JSON.stringify(val) + '&type=trq'
|
||||
});
|
||||
}
|
||||
|
||||
@ -345,13 +332,10 @@
|
||||
dataJinriSumUnit.value = [];
|
||||
queryParms.rqDate = strDate.value;
|
||||
queryParms.pageSize = 100;
|
||||
// console.log(queryParms);
|
||||
queryJinriShengchansj(queryParms).then((res) => {
|
||||
if (res.success) {
|
||||
console.log(res);
|
||||
dataJinri.value = res.result.records;
|
||||
dataJinriSumUnit.value = sumByUnit(dataJinri.value); //包含gas unit rq cq totalGas
|
||||
console.log(dataJinriSumUnit.value);
|
||||
// // 使用 nextTick 等待 DOM 更新
|
||||
nextTick();
|
||||
getYearShengchansj(); //再获取今年以来的数据
|
||||
@ -364,15 +348,10 @@
|
||||
let queryParms = {};
|
||||
queryParms.yearStart = year;
|
||||
queryParms.yearEnd = year;
|
||||
|
||||
// // console.log(2, queryParms.value);
|
||||
queryYearShengchansj(queryParms).then((res) => {
|
||||
if (res.success) {
|
||||
try {
|
||||
// // console.log(res.result);
|
||||
let yearData = res.result[year];
|
||||
// console.log(dataJinriSumUnit.value.length, dataJinriSumUnit.value, yearData.length,
|
||||
// yearData);
|
||||
dataJinriSumUnit.value.forEach((item) => {
|
||||
yearData.forEach((itemYear) => {
|
||||
// // console.log(item, itemYear);
|
||||
@ -382,7 +361,6 @@
|
||||
});
|
||||
});
|
||||
dataJinriSum.value = sumByGas(dataJinriSumUnit.value);
|
||||
// console.log(dataJinriSum.value);
|
||||
shishiArr.value.forEach((item) => {
|
||||
dataJinriSum.value.forEach((itemjinri) => {
|
||||
if (item.gas === itemjinri.gas) {
|
||||
@ -399,7 +377,6 @@
|
||||
};
|
||||
|
||||
function sumByGas(records) {
|
||||
// console.log(records);
|
||||
const summaryMap = {};
|
||||
try {
|
||||
records.forEach((record) => {
|
||||
@ -574,88 +551,6 @@
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
padding: 30rpx;
|
||||
max-height: 40vh;
|
||||
}
|
||||
|
||||
.popup-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.table-container {
|
||||
width: 100%;
|
||||
height: 30vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table {
|
||||
min-width: 100%;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
|
||||
.tr {
|
||||
display: flex;
|
||||
border-bottom: 2rpx solid #e8e8e8;
|
||||
|
||||
&.header {
|
||||
background-color: #fafafa;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.even {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
}
|
||||
|
||||
.th,
|
||||
.td {
|
||||
flex: 1;
|
||||
min-width: 80rpx;
|
||||
padding: 10rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
height: 30rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.th1,
|
||||
.td1 {
|
||||
flex: 1;
|
||||
max-width: 40rpx;
|
||||
padding: 10rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
height: 30rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.th {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.td.negative {
|
||||
color: #ff4444;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
padding: 40rpx;
|
||||
text-align: center;
|
||||
@ -664,7 +559,7 @@
|
||||
}
|
||||
|
||||
.card-item {
|
||||
flex: 1 1 200rpx; // 基础宽度300rpx,自动伸缩 selectedGas formatNumber
|
||||
flex: 1 1 200rpx; // 基础宽度300rpx,自动伸缩 formatNumber
|
||||
min-width: 240rpx;
|
||||
max-width: calc(50% - 10rpx); // 最大不超过容器一半(考虑间距)
|
||||
|
||||
@ -710,10 +605,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.progress-item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
position: relative;
|
||||
height: 20px;
|
||||
|
@ -39,44 +39,20 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 数据弹窗 -->
|
||||
<wd-popup v-model="popup" position="bottom" background-color="#fff">
|
||||
<view class="popup-content">
|
||||
<view class="popup-header">
|
||||
<text class="title">原油数据详情 单位(吨)</text>
|
||||
<wd-icon name="closeempty" size="24" @click="closePopup"></wd-icon>
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-X="true" scroll-Y="true" class="table-container">
|
||||
<view class="table">
|
||||
<!-- 表头 -->
|
||||
<view class="tr header">
|
||||
<view class="th1">序号</view>
|
||||
<view class="th">名称</view>
|
||||
<view class="th">日油量</view>
|
||||
<view class="th">月累计</view>
|
||||
<view class="th">年累计</view>
|
||||
<view class="th1">操作</view>
|
||||
</view>
|
||||
|
||||
<!-- 表格内容 -->
|
||||
<view class="tr" v-for="(item, index) in dataJinri" :key="index" :class="{ even: index % 2 === 0 }">
|
||||
<view class="td1">{{ index }}</view>
|
||||
<view class="td">{{ item.dw }}</view>
|
||||
<view class="td">
|
||||
{{ formatNumber(item.rcwy) }}
|
||||
</view>
|
||||
<view class="td">{{ formatNumber(item.yl) }}</view>
|
||||
<view class="td">
|
||||
{{ formatNumber(item.nl) }}
|
||||
</view>
|
||||
<view class="td1" style="color: red" @click="goHistory(item)">历史</view>
|
||||
</view>
|
||||
|
||||
<!-- 空数据提示 -->
|
||||
<view v-if="!dataJinri.length" class="empty">暂无相关数据</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<wd-popup v-model="popup" position="bottom" closable custom-style="height: 400px;" @close="handleClose">
|
||||
<wd-cell-group title="原油数据详情 单位(吨)">
|
||||
<wd-table :data="dataJinri" :height="800">
|
||||
<wd-table-col prop="dw" label="名称" :width="screenWidth * 29 / 140" align="center"></wd-table-col>
|
||||
<wd-table-col prop="rcwy" label="日油量" :width="screenWidth / 5" align="center"></wd-table-col>
|
||||
<wd-table-col prop="yl" label="月累计" :width="screenWidth / 5" align="center"></wd-table-col>
|
||||
<wd-table-col prop="nl" label="年累计" :width="screenWidth / 4" align="center"></wd-table-col>
|
||||
<wd-table-col prop="" label="操作" :width="screenWidth / 7" align="center">
|
||||
<template #value="{row}">
|
||||
<text style="color: red;" @click="goHistory(row)">历史</text>
|
||||
</template>
|
||||
</wd-table-col>
|
||||
</wd-table>
|
||||
</wd-cell-group>
|
||||
</wd-popup>
|
||||
</template>
|
||||
|
||||
@ -96,7 +72,7 @@
|
||||
yearPlan: '1500',
|
||||
yearPerCent: ''
|
||||
}]);
|
||||
|
||||
const screenWidth = ref(0)
|
||||
const dataJinri = ref([]);
|
||||
const dataJinriSum = ref([]);
|
||||
const popup = ref(false);
|
||||
@ -112,6 +88,11 @@
|
||||
onMounted(() => {
|
||||
getJinriYuanyouShengchansj();
|
||||
// getYearShengchansj();
|
||||
calculateTableHeight();
|
||||
// 监听屏幕旋转变化
|
||||
uni.onWindowResize(() => {
|
||||
calculateTableHeight();
|
||||
});
|
||||
});
|
||||
|
||||
const strDate = ref('');
|
||||
@ -120,12 +101,19 @@
|
||||
if (typeof num !== 'number') return '-';
|
||||
return num.toFixed(4).replace(/\.?0+$/, '');
|
||||
};
|
||||
const handleClose = () => {
|
||||
popup.value = false
|
||||
}
|
||||
|
||||
function goHistory(val) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/views/shengchan/ribaoshuju/rbsjLsxq?data=' + JSON.stringify(val) + '&type=yy'
|
||||
url: '/pages/production/ribaoshuju/rbsjLsxq?data=' + JSON.stringify(val) + '&type=yy'
|
||||
});
|
||||
}
|
||||
const calculateTableHeight = () => {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
screenWidth.value = systemInfo.screenWidth;
|
||||
}
|
||||
const getJinriYuanyouShengchansj = () => {
|
||||
const now = new Date();
|
||||
if (now.getHours() < 11) {
|
||||
@ -138,10 +126,8 @@
|
||||
dataJinriSum.value = [];
|
||||
queryParms.scrq = strDate.value;
|
||||
queryParms.pageSize = 100;
|
||||
// // console.log(queryParms);
|
||||
queryJinriYuanyouShengchansj(queryParms).then((res) => {
|
||||
if (res.success) {
|
||||
// // console.log(res);
|
||||
dataJinri.value = res.result.records;
|
||||
dataJinriSum.value = sumByOil(dataJinri.value); //包含gas unit rq cq totalGas
|
||||
// // console.log(dataJinriSum.value);
|
||||
@ -154,6 +140,15 @@
|
||||
item.yearPerCent = calcPercent(item.yearPlan, item.nl);
|
||||
});
|
||||
});
|
||||
|
||||
dataJinri.value = dataJinri.value.map(item => {
|
||||
return {
|
||||
...item,
|
||||
rcwy: formatNumber(item.rcwy),
|
||||
yl: formatNumber(item.yl),
|
||||
nl: formatNumber(item.nl)
|
||||
}
|
||||
})
|
||||
// getYearShengchansj(); //再获取今年以来的数据
|
||||
}
|
||||
});
|
||||
@ -247,93 +242,6 @@
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
padding: 30rpx;
|
||||
max-height: 70vh;
|
||||
}
|
||||
|
||||
.popup-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.table-container {
|
||||
width: 100%;
|
||||
height: 30vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table {
|
||||
min-width: 100%;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
|
||||
.tr {
|
||||
display: flex;
|
||||
border-bottom: 2rpx solid #e8e8e8;
|
||||
|
||||
&.header {
|
||||
background-color: #fafafa;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.even {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
}
|
||||
|
||||
.th,
|
||||
.td {
|
||||
flex: 1;
|
||||
min-width: 80rpx;
|
||||
padding: 10rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.th1,
|
||||
.td1 {
|
||||
flex: 1;
|
||||
max-width: 40rpx;
|
||||
padding: 10rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
height: 30rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.th {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.td.negative {
|
||||
color: #ff4444;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
padding: 40rpx;
|
||||
text-align: center;
|
||||
color: #888;
|
||||
font-size: 16rpx;
|
||||
}
|
||||
|
||||
.card-item {
|
||||
flex: 1 1 200rpx; // 基础宽度300rpx,自动伸缩 selectedGas formatNumber
|
||||
min-width: 200rpx;
|
||||
@ -381,10 +289,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.progress-item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
position: relative;
|
||||
height: 20px;
|
||||
|
@ -3,18 +3,5 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
queryJinriShengchansj,
|
||||
queryYearShengchansj,
|
||||
queryJinriTrqShengchansj
|
||||
} from '@/api/production';
|
||||
import {
|
||||
formatDate,
|
||||
getDateAfterDays
|
||||
} from '@/utils/dateTime';
|
||||
import trqSssjVue from './trqSssj';
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
</script>
|
@ -8,7 +8,7 @@
|
||||
</cxc-szcx-stationJl-select>
|
||||
</view>
|
||||
</view>
|
||||
<button size="mini" @click="getData">连接WebSocket</button>
|
||||
<!-- <button size="mini" @click="getData">连接WebSocket</button> -->
|
||||
|
||||
<view class="container">
|
||||
<view v-for="(item, index) in jlData" :key="index" class="card">
|
||||
@ -114,18 +114,7 @@
|
||||
});
|
||||
uni.onSocketMessage(function(res) {
|
||||
console.log('收到服务器内容:' + res.data);
|
||||
// 语音播放 start
|
||||
const innerAudioContext = uni.createInnerAudioContext();
|
||||
innerAudioContext.autoplay = true;
|
||||
innerAudioContext.src = 'https://wzs1.oss-cn-beijing.aliyuncs.com/music.mp3';
|
||||
innerAudioContext.onPlay(() => {
|
||||
console.log('开始播放');
|
||||
});
|
||||
innerAudioContext.onError(res => {
|
||||
console.log(res.errMsg);
|
||||
console.log(res.errCode);
|
||||
});
|
||||
//语音播放 end
|
||||
|
||||
});
|
||||
// 这里仅是事件监听【如果socket关闭了会执行】
|
||||
uni.onSocketClose(function(res) {
|
||||
@ -141,15 +130,22 @@
|
||||
console.log(2, e, data.value);
|
||||
stationID.value = e
|
||||
stationName.value = data.value.title
|
||||
getScData(); //获取生产数据
|
||||
|
||||
}
|
||||
|
||||
const getScData= ()=>{
|
||||
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 websock = ref(null);
|
||||
const timer2 = ref(null);
|
||||
// 封装心跳函数
|
||||
@ -157,7 +153,10 @@
|
||||
timer2.value = setInterval(() => {
|
||||
if (websock.value && websock.value.readyState === 1) {
|
||||
// 如果连接正常,发送心跳消息
|
||||
connectSocketInit()
|
||||
// connectSocketInit()
|
||||
}
|
||||
if(stationID.value){
|
||||
getScData();
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
@ -176,9 +175,13 @@
|
||||
|
||||
websocketheart()
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
onUnmounted(()=>{ //页面销毁删除定时
|
||||
// 销毁定时器
|
||||
console.log(22222)
|
||||
clearInterval(timer2.value);
|
||||
})
|
||||
|
||||
// 数字格式化
|
||||
const formatNumber = (num) => {
|
||||
let temp = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user