yanghao vor 1 Tag
Ursprung
Commit
b5415fd79d

+ 26 - 21
src/views/pms/stat/rdkb/rd-value.vue

@@ -61,7 +61,6 @@ const chartData: ValueDistributionItem[] = [
 const chartRef = ref<HTMLDivElement>()
 let chart: echarts.ECharts | null = null
 const BAR_WIDTH = 22
-const LABEL_FONT_SIZE = 13
 
 function getBarStyle(color: (typeof THEME.color)[keyof typeof THEME.color]) {
   return {
@@ -178,19 +177,22 @@ function getChartOption(data: ValueDistributionItem[]): echarts.EChartsOption {
         barGap: '18%',
         itemStyle: getBarStyle(THEME.color.blue),
         label: {
-          show: true,
-          position: 'top',
-          distance: 10,
-          color: THEME.color.blue.strong,
-          fontSize: LABEL_FONT_SIZE,
-          fontWeight: 700,
-          fontFamily: FONT_FAMILY,
-          formatter(params: any) {
-            return Number(params.value) ? formatMoney(params.value) : ''
-          }
+          show: false
         },
         emphasis: {
           focus: 'series',
+          label: {
+            show: true,
+            position: 'top',
+            distance: 10,
+            color: THEME.color.blue.strong,
+            fontSize: 13,
+            fontWeight: 700,
+            fontFamily: FONT_FAMILY,
+            formatter(params: any) {
+              return Number(params.value) ? formatMoney(params.value) : ''
+            }
+          },
           itemStyle: {
             ...getBarStyle(THEME.color.blue),
             shadowColor: THEME.color.blue.shadow,
@@ -206,19 +208,22 @@ function getChartOption(data: ValueDistributionItem[]): echarts.EChartsOption {
         barMaxWidth: 28,
         itemStyle: getBarStyle(THEME.color.green),
         label: {
-          show: true,
-          position: 'top',
-          distance: 6,
-          color: THEME.color.green.strong,
-          fontSize: LABEL_FONT_SIZE,
-          fontWeight: 700,
-          fontFamily: FONT_FAMILY,
-          formatter(params: any) {
-            return Number(params.value) ? formatMoney(params.value) : ''
-          }
+          show: false
         },
         emphasis: {
           focus: 'series',
+          label: {
+            show: true,
+            position: 'top',
+            distance: 6,
+            color: THEME.color.green.strong,
+            fontSize: 13,
+            fontWeight: 700,
+            fontFamily: FONT_FAMILY,
+            formatter(params: any) {
+              return Number(params.value) ? formatMoney(params.value) : ''
+            }
+          },
           itemStyle: {
             ...getBarStyle(THEME.color.green),
             shadowColor: THEME.color.green.shadow,

+ 87 - 27
src/views/pms/stat/rhkb/deviceList.vue

@@ -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,17 @@ interface RhDeviceListRow {
   projectDeptId: number
   projectDeptName: string
   teamCount: number
-  cumulativeDays: number
-  constructionDays: number
-  utilizationRate: number
+  sgTeamCount: number
+  zbTeamCount: number
+  dmTeamCount: number
+  hourUtilizationRate: number
+  yearHourUtilizationRate: number
+  waterInjection: number
+  yearWaterInjection: number
   gasInjection: number
+  yearGasInjection: number
   sort?: number | null
+  productionSummary: string
 }
 
 interface RhTeamRateRow {
@@ -24,9 +29,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 +40,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 +50,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,38 +128,51 @@ 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>
     </div>
-    <!-- v-loading="loading" -->
     <div class="device-list-panel__body flex flex-col flex-1 min-h-0">
       <el-table
+        v-loading="loading"
         :data="tableData"
         :height="tableHeight"
+        element-loading-text="加载中..."
+        element-loading-background="rgb(222 236 252 / 72%)"
         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) }}
+            <div class="device-list-table__multi-value">
+              <span>当日运行时效:{{ formatRate(row.hourUtilizationRate) }}</span>
+              <span>平均运行时效:{{ formatRate(row.yearHourUtilizationRate) }}</span>
+            </div>
+          </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 +224,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 +243,41 @@ onMounted(() => {
     height: 100%;
   }
 }
+
+.device-list-table {
+  :deep(.el-table__header-wrapper th.el-table__cell) {
+    color: #10233c;
+    background: #b5cde7;
+    border-color: rgb(255 255 255 / 62%);
+  }
+
+  :deep(.el-table__body td.el-table__cell) {
+    color: #07192c;
+    background: #89b3de;
+    border-color: rgb(255 255 255 / 62%);
+  }
+
+  :deep(.el-table__body tr:nth-child(2n) td.el-table__cell) {
+    background: #b8cee5;
+  }
+
+  :deep(.el-table__row:hover > td.el-table__cell) {
+    background: #75a5d6 !important;
+  }
+}
+
+.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>

+ 4 - 1
src/views/pms/stat/rhkb/rhsummary.vue

@@ -225,7 +225,10 @@ async function loadGasCards() {
   try {
     const [todayRes, yearRes] = await Promise.all([
       IotStatApi.getRhZqlTotal({
-        createTime: getCreateTimeRange(dayjs().startOf('day'), dayjs().endOf('day'))
+        createTime: getCreateTimeRange(
+          dayjs().subtract(1, 'day').startOf('day'),
+          dayjs().subtract(1, 'day').endOf('day')
+        )
       }),
       IotStatApi.getRhZqlTotal({
         createTime: getCreateTimeRange(dayjs().startOf('year'), dayjs().endOf('day'))