|
|
@@ -1,6 +1,5 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { IotStatApi } from '@/api/pms/stat'
|
|
|
-import { rangeShortcuts } from '@/utils/formatTime'
|
|
|
import dayjs from 'dayjs'
|
|
|
import type { Ref } from 'vue'
|
|
|
|
|
|
@@ -8,11 +7,16 @@ interface RhDeviceListRow {
|
|
|
projectDeptId: number
|
|
|
projectDeptName: string
|
|
|
teamCount: number
|
|
|
- cumulativeDays: number
|
|
|
- constructionDays: number
|
|
|
- utilizationRate: number
|
|
|
+ sgTeamCount: number
|
|
|
+ zbTeamCount: number
|
|
|
+ dmTeamCount: number
|
|
|
+ hourUtilizationRate: number
|
|
|
+ waterInjection: number
|
|
|
+ yearWaterInjection: number
|
|
|
gasInjection: number
|
|
|
+ yearGasInjection: number
|
|
|
sort?: number | null
|
|
|
+ productionSummary: string
|
|
|
}
|
|
|
|
|
|
interface RhTeamRateRow {
|
|
|
@@ -24,9 +28,7 @@ interface RhTeamRateRow {
|
|
|
|
|
|
const TABLE_HEIGHT = 220
|
|
|
const TEAM_TABLE_HEIGHT = 500
|
|
|
-const DEFAULT_TIME_RANGE = rangeShortcuts[2]
|
|
|
- .value()
|
|
|
- .map((item) => dayjs(item).format('YYYY-MM-DD HH:mm:ss'))
|
|
|
+const DEFAULT_DATE = dayjs().subtract(1, 'day').format('YYYY-MM-DD')
|
|
|
|
|
|
const props = withDefaults(
|
|
|
defineProps<{
|
|
|
@@ -37,7 +39,7 @@ const props = withDefaults(
|
|
|
}
|
|
|
)
|
|
|
|
|
|
-const createTime = ref<string[]>(DEFAULT_TIME_RANGE)
|
|
|
+const createDate = ref(DEFAULT_DATE)
|
|
|
const loading = ref(false)
|
|
|
const list = ref<RhDeviceListRow[]>([])
|
|
|
const teamDialogVisible = ref(false)
|
|
|
@@ -47,16 +49,20 @@ const teamList = ref<RhTeamRateRow[]>([])
|
|
|
const kbScale = inject<Ref<number>>('rhKbScale', ref(1))
|
|
|
|
|
|
const tableData = computed(() => list.value)
|
|
|
+const createTime = computed(() => [
|
|
|
+ dayjs(createDate.value).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
+ dayjs(createDate.value).endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
|
|
+])
|
|
|
const tableHeight = computed<number | string>(() =>
|
|
|
props.pageMode === 'full' ? '100%' : Math.round(TABLE_HEIGHT * kbScale.value)
|
|
|
)
|
|
|
|
|
|
function formatRate(value?: number | null) {
|
|
|
- return `${(Number(value ?? 0) * 100).toFixed(2)}%`
|
|
|
+ return value === null || value === undefined ? '--' : `${(Number(value) * 100).toFixed(2)}%`
|
|
|
}
|
|
|
|
|
|
-function formatGasInjection(value?: number | null) {
|
|
|
- return (Number(value ?? 0) / 10000).toFixed(2)
|
|
|
+function formatInjection(value?: number | null) {
|
|
|
+ return value === null || value === undefined ? '--' : value
|
|
|
}
|
|
|
|
|
|
function handleDateChange() {
|
|
|
@@ -121,14 +127,11 @@ onMounted(() => {
|
|
|
</div>
|
|
|
<div class="device-list-panel__picker">
|
|
|
<el-date-picker
|
|
|
- v-model="createTime"
|
|
|
- value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
- type="daterange"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
+ v-model="createDate"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
:clearable="false"
|
|
|
- :shortcuts="rangeShortcuts"
|
|
|
class="device-list-panel__picker-input"
|
|
|
@change="handleDateChange" />
|
|
|
</div>
|
|
|
@@ -141,18 +144,29 @@ onMounted(() => {
|
|
|
class="device-list-table"
|
|
|
:class="{ 'device-list-table--full': props.pageMode === 'full' }"
|
|
|
@row-click="handleRowClick">
|
|
|
- <el-table-column prop="projectDeptName" label="项目部" min-width="220" align="center" />
|
|
|
- <el-table-column prop="teamCount" label="队伍数量" min-width="120" align="center" />
|
|
|
- <el-table-column prop="cumulativeDays" label="累计天数" min-width="120" align="center" />
|
|
|
- <el-table-column prop="constructionDays" label="施工天数" min-width="120" align="center" />
|
|
|
- <el-table-column label="注气量(万方)" min-width="150" align="center">
|
|
|
+ <el-table-column prop="projectDeptName" label="项目部" width="140" align="center" />
|
|
|
+ <el-table-column prop="teamCount" label="队伍总数" width="124" align="center" />
|
|
|
+ <el-table-column prop="dmTeamCount" label="驻地待命" width="124" align="center" />
|
|
|
+ <el-table-column prop="zbTeamCount" label="施工准备" width="124" align="center" />
|
|
|
+ <el-table-column prop="sgTeamCount" label="施工队伍" width="124" align="center" />
|
|
|
+ <el-table-column label="注入量(万方)" width="170" align="center">
|
|
|
<template #default="{ row }">
|
|
|
- {{ formatGasInjection(row.gasInjection) }}
|
|
|
+ <div class="device-list-table__multi-value">
|
|
|
+ <span>日注气:{{ formatInjection(row.gasInjection) }}</span>
|
|
|
+ <span>累注气:{{ formatInjection(row.yearGasInjection) }}</span>
|
|
|
+ <span>日注水:{{ formatInjection(row.waterInjection) }}</span>
|
|
|
+ <span>累注水:{{ formatInjection(row.yearWaterInjection) }}</span>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="设备利用率" min-width="140" align="center">
|
|
|
+ <el-table-column label="运行时效" width="220" align="center">
|
|
|
<template #default="{ row }">
|
|
|
- {{ formatRate(row.utilizationRate) }}
|
|
|
+ 当日运行时效:{{ formatRate(row.hourUtilizationRate) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="productionSummary" label="生产动态概述" min-width="220" align="left">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div class="device-list-table__summary">{{ row.productionSummary || '--' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
@@ -204,6 +218,11 @@ onMounted(() => {
|
|
|
margin-top: 0;
|
|
|
}
|
|
|
|
|
|
+.device-list-panel__picker,
|
|
|
+.device-list-panel__picker-input {
|
|
|
+ width: calc(160px * var(--kb-scale, 1)) !important;
|
|
|
+}
|
|
|
+
|
|
|
.device-list-table--full {
|
|
|
:deep(.el-scrollbar__view) {
|
|
|
display: block;
|
|
|
@@ -218,6 +237,19 @@ onMounted(() => {
|
|
|
height: 100%;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.device-list-table__multi-value {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: calc(4px * var(--kb-scale, 1));
|
|
|
+ line-height: 1.35;
|
|
|
+}
|
|
|
+
|
|
|
+.device-list-table__summary {
|
|
|
+ line-height: 1.5;
|
|
|
+ white-space: pre-wrap;
|
|
|
+ overflow-wrap: anywhere;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style>
|