做生产数据展示页面
@ -1,4 +1,4 @@
|
|||||||
# 开发环境
|
# 开发环境
|
||||||
# 请求接口地址
|
# 请求接口地址
|
||||||
# VITE_REQUEST_BASE_URL = https://36.112.48.190
|
VITE_REQUEST_BASE_URL = https://36.112.48.190
|
||||||
VITE_REQUEST_BASE_URL = http://10.75.15.249:8080
|
#VITE_REQUEST_BASE_URL = http://10.75.15.249:8080
|
||||||
|
11
api/shengchan.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import {
|
||||||
|
https
|
||||||
|
} from '@/utils/http.js';
|
||||||
|
|
||||||
|
export function queryJinriShengchansj(orgCode) { // 获取今日生产数据
|
||||||
|
return https({
|
||||||
|
url: '/scdt.CxcScdtChart/cxcScdtChart/list',
|
||||||
|
method: 'get',
|
||||||
|
data: orgCode
|
||||||
|
})
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
<view class="info_box">
|
<view class="info_box">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
申请信息
|
申请信息
|
||||||
<b style="text-align: right;color: blue;" @click="goToHis">历史查询</b>
|
<b style="text-align: right;color: blue;" @click="goToHis">历史查询</b>
|
||||||
</view>
|
</view>
|
||||||
<view class="info f-row aic jcb">
|
<view class="info f-row aic jcb">
|
||||||
<view>
|
<view>
|
||||||
@ -49,7 +49,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="info f-row aic jcb">
|
<view class="info f-row aic jcb">
|
||||||
<view>
|
<view>
|
||||||
审批人:
|
{{examineleader}}:
|
||||||
</view>
|
</view>
|
||||||
<text>{{info.examineleader_dictText}}</text>
|
<text>{{info.examineleader_dictText}}</text>
|
||||||
</view>
|
</view>
|
||||||
@ -125,6 +125,7 @@
|
|||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
const examineleader = ref('')
|
||||||
const imageValue = ref([])
|
const imageValue = ref([])
|
||||||
const ifShowFj = ref(false)
|
const ifShowFj = ref(false)
|
||||||
const imageStyles = {
|
const imageStyles = {
|
||||||
@ -144,6 +145,12 @@
|
|||||||
id: props.dataId
|
id: props.dataId
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
if (res.result.records[0].zwmc == '单位专家' || res.result.records[0].zwmc == '基层正职' ||
|
||||||
|
res.result.records[0].zwmc == '高级主管') {
|
||||||
|
examineleader.value = '分管领导';
|
||||||
|
} else {
|
||||||
|
examineleader.value = '审批领导';
|
||||||
|
}
|
||||||
info.value = res.result.records[0]
|
info.value = res.result.records[0]
|
||||||
// 构造 imageValue 数组
|
// 构造 imageValue 数组
|
||||||
if (info.value.path) {
|
if (info.value.path) {
|
||||||
|
239
manifest.json
@ -1,123 +1,122 @@
|
|||||||
{
|
{
|
||||||
"name" : "数智产销",
|
"name": "数智产销",
|
||||||
"appid" : "__UNI__9F097F0",
|
"appid": "__UNI__9F097F0",
|
||||||
"description" : "",
|
"description": "",
|
||||||
"versionName" : "1.1.9",
|
"versionName": "1.1.11",
|
||||||
"versionCode" : 20250302,
|
"versionCode": 20250303,
|
||||||
"transformPx" : false,
|
"transformPx": false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus": {
|
||||||
"usingComponents" : true,
|
"usingComponents": true,
|
||||||
"nvueStyleCompiler" : "uni-app",
|
"nvueStyleCompiler": "uni-app",
|
||||||
"compilerVersion" : 3,
|
"compilerVersion": 3,
|
||||||
"splashscreen" : {
|
"splashscreen": {
|
||||||
"alwaysShowBeforeRender" : true,
|
"alwaysShowBeforeRender": true,
|
||||||
"waiting" : true,
|
"waiting": true,
|
||||||
"autoclose" : true,
|
"autoclose": true,
|
||||||
"delay" : 0
|
"delay": 0
|
||||||
},
|
},
|
||||||
"compatible" : {
|
"compatible": {
|
||||||
"ignoreVersion" : true
|
"ignoreVersion": true
|
||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"modules" : {
|
"modules": {
|
||||||
"Geolocation" : {},
|
"Geolocation": {},
|
||||||
"Fingerprint" : {},
|
"Fingerprint": {},
|
||||||
"Camera" : {},
|
"Camera": {},
|
||||||
"Barcode" : {}
|
"Barcode": {}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute" : {
|
"distribute": {
|
||||||
/* android打包配置 */
|
/* android打包配置 */
|
||||||
"android" : {
|
"android": {
|
||||||
"permissions" : [
|
"permissions": [
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"ios" : {
|
"ios": {
|
||||||
"dSYMs" : false
|
"dSYMs": false
|
||||||
},
|
},
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
"sdkConfigs" : {
|
"sdkConfigs": {
|
||||||
"ad" : {},
|
"ad": {},
|
||||||
"geolocation" : {
|
"geolocation": {
|
||||||
"system" : {
|
"system": {
|
||||||
"__platform__" : [ "android" ]
|
"__platform__": ["android"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"icons" : {
|
"icons": {
|
||||||
"android" : {
|
"android": {
|
||||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
"hdpi": "unpackage/res/icons/72x72.png",
|
||||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||||
},
|
},
|
||||||
"ios" : {
|
"ios": {
|
||||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||||
"ipad" : {
|
"ipad": {
|
||||||
"app" : "unpackage/res/icons/76x76.png",
|
"app": "unpackage/res/icons/76x76.png",
|
||||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
"app@2x": "unpackage/res/icons/152x152.png",
|
||||||
"notification" : "unpackage/res/icons/20x20.png",
|
"notification": "unpackage/res/icons/20x20.png",
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||||
"settings" : "unpackage/res/icons/29x29.png",
|
"settings": "unpackage/res/icons/29x29.png",
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
"spotlight": "unpackage/res/icons/40x40.png",
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||||
},
|
},
|
||||||
"iphone" : {
|
"iphone": {
|
||||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
"app@2x": "unpackage/res/icons/120x120.png",
|
||||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
"app@3x": "unpackage/res/icons/180x180.png",
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
"quickapp" : {},
|
"quickapp": {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin": {
|
||||||
"appid" : "",
|
"appid": "",
|
||||||
"setting" : {
|
"setting": {
|
||||||
"urlCheck" : false
|
"urlCheck": false
|
||||||
},
|
},
|
||||||
"usingComponents" : true
|
"usingComponents": true
|
||||||
},
|
},
|
||||||
"mp-alipay" : {
|
"mp-alipay": {
|
||||||
"usingComponents" : true
|
"usingComponents": true
|
||||||
},
|
},
|
||||||
"mp-baidu" : {
|
"mp-baidu": {
|
||||||
"usingComponents" : true
|
"usingComponents": true
|
||||||
},
|
},
|
||||||
"mp-toutiao" : {
|
"mp-toutiao": {
|
||||||
"usingComponents" : true
|
"usingComponents": true
|
||||||
},
|
},
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
},
|
},
|
||||||
"vueVersion" : "3"
|
"vueVersion": "3"
|
||||||
}
|
}
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
|
|
||||||
|
40
pages.json
@ -26,6 +26,12 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/tab/product",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/tab/my",
|
"path": "pages/tab/my",
|
||||||
"style": {
|
"style": {
|
||||||
@ -110,14 +116,6 @@
|
|||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/leave/application",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "请假申请",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/checkin/index",
|
"path": "pages/checkin/index",
|
||||||
"style": {
|
"style": {
|
||||||
@ -256,6 +254,14 @@
|
|||||||
"navigationBarTitleText": "请假详情",
|
"navigationBarTitleText": "请假详情",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/views/renliziyuan/qingjiaxinxi/application",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "请假申请",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
@ -270,17 +276,23 @@
|
|||||||
"iconPath": "static/tab/index1.png",
|
"iconPath": "static/tab/index1.png",
|
||||||
"selectedIconPath": "static/tab/index2.png"
|
"selectedIconPath": "static/tab/index2.png"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"text": "任务",
|
"text": "生产",
|
||||||
"pagePath": "pages/task/todotask",
|
"pagePath": "pages/tab/product",
|
||||||
"iconPath": "static/tab/office1.png",
|
"iconPath": "/static/tab/product.png",
|
||||||
"selectedIconPath": "static/tab/office2.png"
|
"selectedIconPath": "/static/tab/product1.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "办公",
|
"text": "办公",
|
||||||
"pagePath": "pages/tab/office",
|
"pagePath": "pages/tab/office",
|
||||||
"iconPath": "static/tab/product1.png",
|
"iconPath": "static/tab/OA.png",
|
||||||
"selectedIconPath": "static/tab/product2.png"
|
"selectedIconPath": "static/tab/OA1.png"
|
||||||
|
}, {
|
||||||
|
"text": "任务",
|
||||||
|
"pagePath": "pages/task/todotask",
|
||||||
|
"iconPath": "static/tab/office1.png",
|
||||||
|
"selectedIconPath": "static/tab/office2.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "我的",
|
"text": "我的",
|
||||||
|
@ -202,7 +202,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(deviceIp)
|
|
||||||
return deviceIp;
|
return deviceIp;
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
@ -1,32 +1,234 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :class="['f-col','aic',{'gray':store.isgray==1}]">
|
<view :class="{'gray':store.isgray==1}">
|
||||||
<dataCom title="实时输差" :list="shishiArr"></dataCom>
|
<view class="container">
|
||||||
<dataCom title="偏远计量点" :list="shishiArr"></dataCom>
|
<uni-card class="main-card" :is-link="false">
|
||||||
<dataCom title="生产实时数据" :list="productArr"></dataCom>
|
<uni-title title="气产量" type="h3" color="blue" />
|
||||||
|
<view class="card-content">
|
||||||
|
<view v-for="(row, rowIndex) in groupedData" :key="rowIndex" class="data-row">
|
||||||
|
<uni-row>
|
||||||
|
<uni-col v-for="(item, colIndex) in row" :key="colIndex" :span="8">
|
||||||
|
<uni-title :title="item.gas" type="h5" class="data-label" />
|
||||||
|
<view class="value-group">
|
||||||
|
<text class="value">今日量:{{ item.dailyVolume }}</text>
|
||||||
|
<text class="value">年累计:{{ item.dailyVolume }}</text>
|
||||||
|
</view>
|
||||||
|
</uni-col>
|
||||||
|
</uni-row>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-card>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import dataCom from '@/bpm/dataCom.vue';
|
import {
|
||||||
|
ref,
|
||||||
|
onMounted,
|
||||||
|
computed
|
||||||
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
onLoad
|
onLoad
|
||||||
} from '@dcloudio/uni-app';
|
} from '@dcloudio/uni-app';
|
||||||
import {
|
import {
|
||||||
ref
|
queryJinriShengchansj
|
||||||
} from 'vue';
|
} from "@/api/shengchan.js"
|
||||||
|
import {
|
||||||
|
formatDate
|
||||||
|
} from "@/utils/dateTime.js"
|
||||||
|
import {
|
||||||
|
beforeJump
|
||||||
|
} from '@/utils/index.js';
|
||||||
import {
|
import {
|
||||||
useStore
|
useStore
|
||||||
} from '@/store'
|
} from '@/store';
|
||||||
const store = useStore()
|
const store = useStore();
|
||||||
const shishiArr = ref([])
|
import dataCom from '@/bpm/dataCom.vue';
|
||||||
const productArr = ref([])
|
|
||||||
onLoad((options) => {
|
const shishiArr = ref([{
|
||||||
shishiArr.value = JSON.parse(options.shishi)
|
gas: '气井气',
|
||||||
productArr.value = JSON.parse(options.product)
|
dailyVolume: '',
|
||||||
|
yearVolume: ''
|
||||||
|
}, {
|
||||||
|
gas: '伴生气',
|
||||||
|
dailyVolume: '',
|
||||||
|
yearVolume: ''
|
||||||
|
}, {
|
||||||
|
gas: '外部气',
|
||||||
|
dailyVolume: '',
|
||||||
|
yearVolume: ''
|
||||||
|
}, {
|
||||||
|
gas: '站输差',
|
||||||
|
dailyVolume: '',
|
||||||
|
yearVolume: ''
|
||||||
|
}, {
|
||||||
|
gas: '线输差',
|
||||||
|
dailyVolume: '',
|
||||||
|
yearVolume: ''
|
||||||
|
}, {
|
||||||
|
gas: '综合输差',
|
||||||
|
dailyVolume: '',
|
||||||
|
yearVolume: ''
|
||||||
|
}, ])
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getJinriShengchansj()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const dataJinri = ref([])
|
||||||
|
const dataJinriSum = ref([])
|
||||||
|
|
||||||
|
const queryParms = ref({})
|
||||||
|
|
||||||
|
// 计算属性自动分组
|
||||||
|
const groupedData = computed(() => {
|
||||||
|
const groups = [];
|
||||||
|
for (let i = 0; i < shishiArr.value.length; i += 3) {
|
||||||
|
groups.push(shishiArr.value.slice(i, i + 3));
|
||||||
|
}
|
||||||
|
return groups;
|
||||||
|
});
|
||||||
|
const getJinriShengchansj = () => {
|
||||||
|
const now = new Date();
|
||||||
|
queryParms.rqDate = formatDate(now);
|
||||||
|
queryParms.pageSize = 100
|
||||||
|
queryJinriShengchansj(queryParms).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
console.log(res.result.records)
|
||||||
|
dataJinri.value = res.result.records;
|
||||||
|
dataJinriSum.value = sumByGas(dataJinri.value)
|
||||||
|
console.log(dataJinriSum.value, shishiArr.value)
|
||||||
|
try {
|
||||||
|
shishiArr.value.forEach((item) => {
|
||||||
|
dataJinriSum.value.forEach((itemjinri) => {
|
||||||
|
if (item.gas === itemjinri.gas) {
|
||||||
|
if (item.gas.includes("输差")) {
|
||||||
|
item.dailyVolume = itemjinri.totalGas.toFixed(4);
|
||||||
|
} else {
|
||||||
|
item.dailyVolume = itemjinri.rq.toFixed(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(dataJinriSum.value, shishiArr.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function sumByGas(records) {
|
||||||
|
const summaryMap = {};
|
||||||
|
records.forEach(record => {
|
||||||
|
const gas = record.gas;
|
||||||
|
if (!summaryMap[gas]) {
|
||||||
|
summaryMap[gas] = {
|
||||||
|
gas: gas,
|
||||||
|
rq: 0,
|
||||||
|
sq: 0,
|
||||||
|
totalGas: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
summaryMap[gas].rq += record.rq || 0;
|
||||||
|
summaryMap[gas].sq += record.sq || 0;
|
||||||
|
summaryMap[gas].totalGas += record.totalGas || 0;
|
||||||
|
});
|
||||||
|
return Object.values(summaryMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = wx.getSystemInfoSync();
|
||||||
|
const statusHeight = res.statusBarHeight; //状态栏高度
|
||||||
|
const cusnavbarheight = (statusHeight + 44) + "px";
|
||||||
|
const indexChartScdtData = () => {
|
||||||
|
indexChartScdtDataApi().then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
productArr.value = handleData(res.result.today)
|
||||||
|
otherArr = [{
|
||||||
|
text: '安全管理',
|
||||||
|
img: '../../static/tab/anquan.png',
|
||||||
|
path: '/pages/safe/manage'
|
||||||
|
}, {
|
||||||
|
text: '生产数据',
|
||||||
|
img: '../../static/tab/product.png',
|
||||||
|
path: `/pages/product/index?shishi=${JSON.stringify(shishiArr)}&product=${JSON.stringify(productArr.value)}`
|
||||||
|
}, {
|
||||||
|
text: '运输管理',
|
||||||
|
img: '../../static/tab/yunshu.png',
|
||||||
|
path: ''
|
||||||
|
}, {
|
||||||
|
text: '设备台账',
|
||||||
|
img: '../../static/tab/taizhang.png',
|
||||||
|
path: ''
|
||||||
|
}, {
|
||||||
|
text: '车辆派遣',
|
||||||
|
img: '../../static/tab/cheliang.png',
|
||||||
|
path: ''
|
||||||
|
}, {
|
||||||
|
text: '事项审批',
|
||||||
|
img: '../../static/tab/shenpi.png',
|
||||||
|
path: ''
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const handleData = (arr) => {
|
||||||
|
let arrMap = new Map()
|
||||||
|
arr.forEach(el => {
|
||||||
|
if (arrMap.has(el.gas)) {
|
||||||
|
let obj = arrMap.get(el.gas)
|
||||||
|
arrMap.set(el.gas, {
|
||||||
|
...el,
|
||||||
|
dailyVolume: Number(el.dailyVolume + +obj.dailyVolume).toFixed(4)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
arrMap.set(el.gas, el)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return [...arrMap.values()]
|
||||||
|
}
|
||||||
|
const jump = (url) => {
|
||||||
|
beforeJump(url, () => {
|
||||||
|
if (!url) return
|
||||||
|
uni.navigateTo({
|
||||||
|
url
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.container {
|
||||||
|
padding: 20rpx;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-card {
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.1);
|
||||||
|
padding: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-row {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 覆盖uni-col默认样式 */
|
||||||
|
.uni-col {
|
||||||
|
padding: 15rpx;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -1,140 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :class="{'gray':store.isgray==1}">
|
<view>
|
||||||
<view class="nav">
|
<product-data></product-data>
|
||||||
|
|
||||||
</view>
|
|
||||||
<view class="content">
|
|
||||||
<view class="info f-col aic">
|
|
||||||
<view class="item_box">
|
|
||||||
<dataCom title="实时输差" :list="shishiArr"></dataCom>
|
|
||||||
<dataCom title="偏远计量点" :list="shishiArr"></dataCom>
|
|
||||||
<dataCom title="生产实时数据" :list="productArr"></dataCom>
|
|
||||||
|
|
||||||
<view class="item">
|
|
||||||
<view class="title_box other f-row aic jcb">
|
|
||||||
<view class="title">
|
|
||||||
其他信息
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="other_box f-row aic">
|
|
||||||
<view class="data" v-for="other,i in otherArr" :key="i" @click="jump(other.path)">
|
|
||||||
<view class="f-col aic">
|
|
||||||
<image :src="other.img" mode=""></image>
|
|
||||||
<view class="">
|
|
||||||
{{other.text}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import productData from "@/pages/product/index.vue"
|
||||||
ref
|
|
||||||
} from 'vue';
|
|
||||||
import {
|
|
||||||
onLoad
|
|
||||||
} from '@dcloudio/uni-app';
|
|
||||||
import {
|
|
||||||
indexChartScdtDataApi
|
|
||||||
} from '@/api/api.js';
|
|
||||||
import {
|
|
||||||
beforeJump
|
|
||||||
} from '@/utils/index.js';
|
|
||||||
import {
|
|
||||||
useStore
|
|
||||||
} from '@/store';
|
|
||||||
const store = useStore();
|
|
||||||
import dataCom from '@/bpm/dataCom.vue';
|
|
||||||
const shishiArr = [{
|
|
||||||
gas: '今日进气总量',
|
|
||||||
dailyVolume: '28392'
|
|
||||||
}, {
|
|
||||||
gas: '今日进气总量',
|
|
||||||
dailyVolume: '28392'
|
|
||||||
}, {
|
|
||||||
gas: '今日输差百分数',
|
|
||||||
dailyVolume: '0.32'
|
|
||||||
}, {
|
|
||||||
gas: '实时进气总量',
|
|
||||||
dailyVolume: '28392'
|
|
||||||
}, {
|
|
||||||
gas: '实时进气总量',
|
|
||||||
dailyVolume: '28392'
|
|
||||||
}, {
|
|
||||||
gas: '实时输差百分数',
|
|
||||||
dailyVolume: '0.32'
|
|
||||||
}, ]
|
|
||||||
const productArr = ref([])
|
|
||||||
let otherArr
|
|
||||||
onLoad(() => {
|
|
||||||
indexChartScdtData()
|
|
||||||
})
|
|
||||||
const res = wx.getSystemInfoSync();
|
|
||||||
const statusHeight = res.statusBarHeight; //状态栏高度
|
|
||||||
const cusnavbarheight = (statusHeight + 44) + "px";
|
|
||||||
const indexChartScdtData = () => {
|
|
||||||
indexChartScdtDataApi().then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
productArr.value = handleData(res.result.today)
|
|
||||||
otherArr = [{
|
|
||||||
text: '安全管理',
|
|
||||||
img: '../../static/tab/anquan.png',
|
|
||||||
path: '/pages/safe/manage'
|
|
||||||
}, {
|
|
||||||
text: '生产数据',
|
|
||||||
img: '../../static/tab/product.png',
|
|
||||||
path: `/pages/product/index?shishi=${JSON.stringify(shishiArr)}&product=${JSON.stringify(productArr.value)}`
|
|
||||||
}, {
|
|
||||||
text: '运输管理',
|
|
||||||
img: '../../static/tab/yunshu.png',
|
|
||||||
path: ''
|
|
||||||
}, {
|
|
||||||
text: '设备台账',
|
|
||||||
img: '../../static/tab/taizhang.png',
|
|
||||||
path: ''
|
|
||||||
}, {
|
|
||||||
text: '车辆派遣',
|
|
||||||
img: '../../static/tab/cheliang.png',
|
|
||||||
path: ''
|
|
||||||
}, {
|
|
||||||
text: '事项审批',
|
|
||||||
img: '../../static/tab/shenpi.png',
|
|
||||||
path: ''
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}).catch((err) => {
|
|
||||||
console.log(err);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const handleData = (arr) => {
|
|
||||||
let arrMap = new Map()
|
|
||||||
arr.forEach(el => {
|
|
||||||
if (arrMap.has(el.gas)) {
|
|
||||||
let obj = arrMap.get(el.gas)
|
|
||||||
arrMap.set(el.gas, {
|
|
||||||
...el,
|
|
||||||
dailyVolume: Number(el.dailyVolume + +obj.dailyVolume).toFixed(4)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
arrMap.set(el.gas, el)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return [...arrMap.values()]
|
|
||||||
}
|
|
||||||
const jump = (url) => {
|
|
||||||
beforeJump(url, () => {
|
|
||||||
if (!url) return
|
|
||||||
uni.navigateTo({
|
|
||||||
url
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@ -143,102 +14,5 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.nav {
|
|
||||||
width: calc(100% - 60rpx);
|
|
||||||
padding: 0 30rpx;
|
|
||||||
height: v-bind(cusnavbarheight);
|
|
||||||
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 99;
|
|
||||||
background-image: url('../../static/my/navbg.png');
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 750rpx 458rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
padding: v-bind(cusnavbarheight) 0 42rpx 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
.item_box {
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 690rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.5);
|
|
||||||
border-radius: 16rpx;
|
|
||||||
padding: 30rpx 0;
|
|
||||||
margin-top: 24rpx;
|
|
||||||
|
|
||||||
.title_box {
|
|
||||||
padding: 0 30rpx;
|
|
||||||
margin-bottom: -20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
background-image: url('../../static/index/line.png');
|
|
||||||
background-size: 44rpx 13rpx;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: left bottom;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.more {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
|
|
||||||
text {
|
|
||||||
margin-right: 6rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.data_box {
|
|
||||||
.data {
|
|
||||||
width: 33.33%;
|
|
||||||
margin-top: 60rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
view {
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.other {
|
|
||||||
margin-bottom: -10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.other_box {
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
.data {
|
|
||||||
width: 25%;
|
|
||||||
margin-top: 40rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 98rpx;
|
|
||||||
height: 98rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
@ -51,10 +51,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
<picker @change="bindType" :value="typeIndex" :range="typeArr" range-key="realname" v-if="ifShow">
|
<picker @change="bindType" :value="typeIndex" :range="typeArr" range-key="realname">
|
||||||
<view class="f-row aic jcb box">
|
<view class="f-row aic jcb box">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
审批领导:
|
{{examineleader}}:
|
||||||
</view>
|
</view>
|
||||||
<view class="f-row aic">
|
<view class="f-row aic">
|
||||||
<view :class="[{'choose':typeIndex==null},{'choosed':typeIndex!=null}]">
|
<view :class="[{'choose':typeIndex==null},{'choosed':typeIndex!=null}]">
|
||||||
@ -155,8 +155,8 @@
|
|||||||
/**审批领导*/
|
/**审批领导*/
|
||||||
const typeArr = ref([])
|
const typeArr = ref([])
|
||||||
const typeIndex = ref(null)
|
const typeIndex = ref(null)
|
||||||
/**判断是否显示审批领导字段*/
|
/**判断显示审批 / 分管 领导*/
|
||||||
const ifShow = ref(true)
|
const examineleader = ref(true)
|
||||||
/**职位层级*/
|
/**职位层级*/
|
||||||
const zwcj = ref('')
|
const zwcj = ref('')
|
||||||
/**出发地*/
|
/**出发地*/
|
||||||
@ -205,10 +205,8 @@
|
|||||||
if (!type.value) return proxy.$toast('请选择请假类型')
|
if (!type.value) return proxy.$toast('请选择请假类型')
|
||||||
if (!beginTime.value) return proxy.$toast('请选择开始时间')
|
if (!beginTime.value) return proxy.$toast('请选择开始时间')
|
||||||
if (!endTime.value) return proxy.$toast('请选择结束时间')
|
if (!endTime.value) return proxy.$toast('请选择结束时间')
|
||||||
if (ifShow.value) {
|
if (typeIndex.value == null) { //副职、员工需要选择审批领导
|
||||||
if (typeIndex.value == null) { //副职、员工需要选择审批领导
|
return proxy.$toast('请选择' + examineleader.value)
|
||||||
return proxy.$toast('请选择审批领导')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!departure.value.trim()) return proxy.$toast('请输入出发地')
|
if (!departure.value.trim()) return proxy.$toast('请输入出发地')
|
||||||
if (!destination.value.trim()) return proxy.$toast('请输入目的地')
|
if (!destination.value.trim()) return proxy.$toast('请输入目的地')
|
||||||
@ -270,7 +268,9 @@
|
|||||||
typeArr.value = res.result.list
|
typeArr.value = res.result.list
|
||||||
zwcj.value = res.result.zwmc
|
zwcj.value = res.result.zwmc
|
||||||
if (zwcj.value == '单位专家' || zwcj.value == '基层正职' || zwcj.value == '高级主管') {
|
if (zwcj.value == '单位专家' || zwcj.value == '基层正职' || zwcj.value == '高级主管') {
|
||||||
ifShow.value = false;
|
examineleader.value = '分管领导';
|
||||||
|
}else{
|
||||||
|
examineleader.value = '审批领导';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
proxy.$toast(res.message);
|
proxy.$toast(res.message);
|
@ -120,43 +120,50 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.date {
|
// 使用变量来定义颜色,便于统一修改
|
||||||
width: 690rpx;
|
$primary-color: #0056b3;
|
||||||
padding: 20rpx 30rpx 0 30rpx;
|
$secondary-color: #f2f9fc;
|
||||||
font-size: 28rpx;
|
$border-color: #d1e7ff;
|
||||||
color: #333333;
|
$text-color: #333;
|
||||||
}
|
|
||||||
|
|
||||||
|
.date {
|
||||||
|
width: 100%; // 让宽度更具响应性
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: $text-color;
|
||||||
|
text-align: center; // 文字居中
|
||||||
|
background: $secondary-color; // 使用变量代替直接颜色值
|
||||||
|
border-bottom: 1px solid $border-color; // 调整边框颜色
|
||||||
|
}
|
||||||
|
|
||||||
.titleStyle {
|
.titleStyle {
|
||||||
font-size: 12px;
|
font-size: 14px; // 增加字体大小以提高可读性
|
||||||
color: #747474;
|
color: $primary-color; // 更清晰的颜色
|
||||||
line-height: 25px;
|
line-height: 2;
|
||||||
height: 25px;
|
height: auto; // 根据内容自动调整高度
|
||||||
background: #F2F9FC;
|
background: $secondary-color;
|
||||||
text-align: center;
|
text-align: center; // 文字居中
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
border-left: 1px solid #919191;
|
border-left: 1px solid $border-color;
|
||||||
border-bottom: 1px solid #919191;
|
border-bottom: 1px solid $border-color;
|
||||||
;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* 内容样式 */
|
/* 内容样式 */
|
||||||
.dataStyle {
|
.dataStyle {
|
||||||
max-font-size: 14px;
|
font-size: 14px;
|
||||||
/* 最大字体限制 */
|
color: $text-color;
|
||||||
min-font-size: 10px;
|
line-height: 1.5; // 改进行高以提升阅读体验
|
||||||
/* 最小字体限制 */
|
height: auto; // 动态高度
|
||||||
font-size: 12px;
|
font-weight: normal; // 减少字体重量
|
||||||
color: #00007f;
|
text-align: center; // 文字居中
|
||||||
line-height: 25px;
|
vertical-align: middle;
|
||||||
height: 25px;
|
border-bottom: 1px solid $border-color;
|
||||||
font-weight: 500;
|
border-left: 1px solid $border-color;
|
||||||
text-align: center;
|
padding: 10rpx; // 添加内边距
|
||||||
vertical-align: middle;
|
|
||||||
border-bottom: 1px solid #919191;
|
|
||||||
border-left: 1px solid #919191;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
}
|
// 当内容超出容器大小时,显示省略号
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
BIN
static/tab/OA.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 53 KiB |
59
utils/dateTime.js
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
// 日期格式化函数 by liaody 2025-3-5
|
||||||
|
// 使用示例
|
||||||
|
///const now = new Date();
|
||||||
|
//const formattedDate = formatDate(now);
|
||||||
|
//console.log(formattedDate);
|
||||||
|
|
||||||
|
function formatDate(date, format = 'YYYY-MM-DD') {
|
||||||
|
if (!(date instanceof Date)) {
|
||||||
|
date = new Date(date);
|
||||||
|
}
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hour = String(date.getHours()).padStart(2, '0');
|
||||||
|
const minute = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
const second = String(date.getSeconds()).padStart(2, '0');
|
||||||
|
|
||||||
|
return format
|
||||||
|
.replace('YYYY', year)
|
||||||
|
.replace('MM', month)
|
||||||
|
.replace('DD', day)
|
||||||
|
.replace('HH', hour)
|
||||||
|
.replace('mm', minute)
|
||||||
|
.replace('ss', second);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 计算两个日期之间相差的天数
|
||||||
|
// 使用示例
|
||||||
|
// const dateA = '2025-01-01';
|
||||||
|
// const dateB = '2025-01-10';
|
||||||
|
// const daysDiff = getDaysDifference(dateA, dateB);
|
||||||
|
// console.log(daysDiff);
|
||||||
|
function getDaysDifference(date1, date2) {
|
||||||
|
const oneDay = 24 * 60 * 60 * 1000; // 一天的毫秒数
|
||||||
|
const firstDate = new Date(date1);
|
||||||
|
const secondDate = new Date(date2);
|
||||||
|
const diffDays = Math.round(Math.abs((firstDate - secondDate) / oneDay));
|
||||||
|
return diffDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用示例
|
||||||
|
// const startDate = '2025-03-01';
|
||||||
|
// const daysToAdd = 5;
|
||||||
|
// const futureDate = getDateAfterDays(startDate, daysToAdd);
|
||||||
|
// const formattedFutureDate = formatDate(futureDate);
|
||||||
|
// console.log(formattedFutureDate);
|
||||||
|
// 获取指定日期之后 n 天的日期
|
||||||
|
function getDateAfterDays(date, days) {
|
||||||
|
const newDate = new Date(date);
|
||||||
|
newDate.setDate(newDate.getDate() + days);
|
||||||
|
return newDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
formatDate,
|
||||||
|
getDateAfterDays,
|
||||||
|
getDaysDifference
|
||||||
|
}
|