Bladeren bron

🦄 refactor(ruiheng): 调整日报表格

Zimo 2 weken geleden
bovenliggende
commit
96ff580fc0
1 gewijzigde bestanden met toevoegingen van 37 en 23 verwijderingen
  1. 37 23
      src/views/pms/iotrhdailyreport/index.vue

+ 37 - 23
src/views/pms/iotrhdailyreport/index.vue

@@ -132,6 +132,8 @@
             :style="{ width: '100%' }"
             max-height="600"
             :cell-style="cellStyle"
+            show-overflow-tooltip
+            border
           >
             <el-table-column :label="t('iotDevice.serial')" width="56px" align="center">
               <template #default="scope">
@@ -144,12 +146,14 @@
               prop="createTime"
               :formatter="dateFormatter"
               :min-width="columnWidths.createTime.width"
+              resizable
             />
             <el-table-column
               label="施工队伍"
               align="center"
               prop="deptName"
               :min-width="columnWidths.deptName.width"
+              resizable
             />
             <el-table-column
               label="项目"
@@ -158,12 +162,14 @@
               :show-overflow-tooltip="true"
               class-name="contract-name-column"
               :min-width="columnWidths.contractName.width"
+              resizable
             />
             <el-table-column
               label="任务"
               align="center"
               prop="taskName"
               :min-width="columnWidths.taskName.width"
+              resizable
             />
             <!-- <el-table-column label="施工状态" align="center" prop="constructionStatus" /> -->
             <el-table-column
@@ -171,6 +177,7 @@
               align="center"
               prop="constructionStatus"
               :min-width="columnWidths.constructionStatus.width"
+              resizable
             >
               <template #default="scope">
                 <dict-tag
@@ -185,12 +192,14 @@
               prop="relocationDays"
               :formatter="relocationDaysFormatter"
               :min-width="columnWidths.relocationDays.width"
+              resizable
             />
             <el-table-column
               label="设计注气量(万方)"
               align="center"
               prop="designInjection"
               :min-width="columnWidths.designInjection.width"
+              resizable
             />
             <el-table-column
               label="运行时效"
@@ -198,6 +207,7 @@
               prop="transitTime"
               :formatter="percentageFormatter"
               :min-width="columnWidths.transitTime.width"
+              resizable
             />
             <el-table-column label="当日" align="center">
               <el-table-column
@@ -206,30 +216,35 @@
                 prop="dailyGasInjection"
                 :formatter="gasInjectionFormatter"
                 :min-width="columnWidths.dailyGasInjection.width"
+                resizable
               />
               <el-table-column
                 label="注水量(方)"
                 align="center"
                 prop="dailyWaterInjection"
                 :min-width="columnWidths.dailyWaterInjection.width"
+                resizable
               />
               <el-table-column
                 label="注气时间(H)"
                 align="center"
                 prop="dailyInjectGasTime"
                 :min-width="columnWidths.dailyInjectGasTime.width"
+                resizable
               />
               <el-table-column
                 label="注水时间(H)"
                 align="center"
                 prop="dailyInjectWaterTime"
                 :min-width="columnWidths.dailyInjectWaterTime.width"
+                resizable
               />
               <el-table-column
                 label="用电量(kWh)"
                 align="center"
                 prop="dailyPowerUsage"
                 :min-width="columnWidths.dailyPowerUsage.width"
+                resizable
               />
             </el-table-column>
             <el-table-column
@@ -237,12 +252,14 @@
               align="center"
               prop="nonProductionTime"
               :min-width="columnWidths.nonProductionTime.width"
+              resizable
             />
             <el-table-column
               :label="t('project.nptReason')"
               align="center"
               prop="nptReason"
               :min-width="columnWidths.nptReason.width"
+              resizable
             >
               <template #default="scope">
                 <dict-tag :type="DICT_TYPE.PMS_PROJECT_NPT_REASON" :value="scope.row.nptReason" />
@@ -254,6 +271,7 @@
               prop="constructionStartDate"
               :formatter="dateFormatter"
               :min-width="columnWidths.constructionStartDate.width"
+              resizable
             />
             <el-table-column
               label="施工结束日期"
@@ -261,27 +279,16 @@
               prop="constructionEndDate"
               :formatter="dateFormatter"
               :min-width="columnWidths.constructionEndDate.width"
+              resizable
             />
             <el-table-column
               label="生产动态"
               align="center"
               :min-width="columnWidths.productionStatus.width"
               fixed-width
-            >
-              <template #default="scope">
-                <el-tooltip
-                  effect="light"
-                  :content="scope.row.productionStatus"
-                  placement="top"
-                  popper-class="design-well-struct-tooltip"
-                  :disabled="!scope.row.productionStatus || scope.row.productionStatus.length <= 30"
-                >
-                  <span class="design-well-struct-text">{{
-                    formatDesignWellStruct(scope.row.productionStatus)
-                  }}</span>
-                </el-tooltip>
-              </template>
-            </el-table-column>
+              prop="productionStatus"
+              resizable
+            />
             <el-table-column label="累计" align="center">
               <el-table-column
                 label="注气量(万方)"
@@ -289,18 +296,21 @@
                 prop="totalGasInjection"
                 :formatter="gasInjectionFormatter"
                 :min-width="columnWidths.totalGasInjection.width"
+                resizable
               />
               <el-table-column
                 label="注水量(方)"
                 align="center"
                 prop="totalWaterInjection"
                 :min-width="columnWidths.totalWaterInjection.width"
+                resizable
               />
               <el-table-column
                 label="完工井次"
                 align="center"
                 prop="cumulativeCompletion"
                 :min-width="columnWidths.cumulativeCompletion.width"
+                resizable
               />
             </el-table-column>
             <el-table-column
@@ -309,6 +319,7 @@
               prop="capacity"
               :formatter="gasInjectionFormatter"
               :min-width="columnWidths.capacity.width"
+              resizable
             />
             <el-table-column label="操作" align="center" fixed="right">
               <template #default="scope">
@@ -590,16 +601,19 @@ const calculateColumnWidths = useDebounceFn(() => {
   if (!tableContainerRef.value?.$el) return
   Object.values(columnWidths.value).forEach(({ fn, prop, label, width }) => {
     width =
-      Math.max(
+      Math.min(
         ...[
-          getTextWidth(label),
-          ...list.value.map((v) => {
-            return getTextWidth(fn ? fn(v) : v[prop])
-          })
+          Math.max(
+            ...[
+              getTextWidth(label),
+              ...list.value.map((v) => {
+                return getTextWidth(fn ? fn(v) : v[prop])
+              })
+            ]
+          ) + (label === '施工状态' || label === '非生产时间原因' ? 30 : 20),
+          200
         ]
-      ) +
-      (label === '施工状态' || label === '非生产时间原因' ? 30 : 20) +
-      'px'
+      ) + 'px'
 
     columnWidths.value[prop].width = width
   })