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