Эх сурвалжийг харах

pms 瑞恒日报列表 项目名称 精简

zhangcl 10 цаг өмнө
parent
commit
80c5a6071a

+ 20 - 3
src/views/pms/iotrhdailyreport/index.vue

@@ -99,7 +99,8 @@
               :width="columnWidths.createTime"
             />
             <el-table-column label="施工队伍" align="center" prop="deptName" :width="columnWidths.deptName"/>
-            <el-table-column label="项目" align="center" prop="contractName" :width="columnWidths.contractName"/>
+            <el-table-column label="项目" align="center" prop="contractName" :width="columnWidths.contractName"
+                             :show-overflow-tooltip="true" class-name="contract-name-column"/>
             <el-table-column label="任务" align="center" prop="taskName" :width="columnWidths.taskName"/>
             <!-- <el-table-column label="施工状态" align="center" prop="constructionStatus" /> -->
             <el-table-column :label="t('project.status')" align="center" prop="constructionStatus" :width="columnWidths.constructionStatus">
@@ -260,7 +261,7 @@ const tableContainerRef = ref()
 // 列宽度配置
 const columnWidths = ref({
   deptName: '120px',
-  contractName: '150px',
+  contractName: '200px',
   taskName: '120px',
   constructionStatus: '110px',
   relocationDays: '120px',
@@ -316,7 +317,7 @@ const percentageFormatter = (row: any, column: any, cellValue: any, index: numbe
 };
 
 // 可伸缩列配置
-const FLEXIBLE_COLUMNS = ['deptName', 'contractName', 'taskName', 'constructionStatus', 'relocationDays', 'designInjection',
+const FLEXIBLE_COLUMNS = ['deptName', 'taskName', 'constructionStatus', 'relocationDays', 'designInjection',
   'transitTime', 'dailyGasInjection', 'dailyWaterInjection', 'dailyPowerUsage', 'dailyInjectGasTime',
   'dailyInjectWaterTime', 'nonProductionTime', 'nptReason', 'constructionStartDate',
   'constructionEndDate', 'productionStatus', 'totalGasInjection', 'totalWaterInjection',
@@ -409,6 +410,13 @@ const calculateColumnWidths = () => {
 
   // 计算列最小宽度的函数
   const calculateColumnMinWidth = (key: string, label: string, getValue: Function) => {
+    // 跳过 contractName 列的计算,使用固定宽度
+    if (key === 'contractName') {
+      minWidths[key] = 200; // 固定宽度
+      totalMinWidth += 200;
+      return 200;
+    }
+
     const headerWidth = getTextWidth(label) * 1.2;
     let contentMaxWidth = 0;
 
@@ -496,6 +504,9 @@ const calculateColumnWidths = () => {
     });
   }
 
+  // 确保 contractName 保持固定宽度
+  newWidths.contractName = '200px';
+
   // 3. 更新列宽配置
   columnWidths.value = newWidths;
 
@@ -645,6 +656,12 @@ watch(list, () => {
   text-overflow: clip !important;
 }
 
+:deep(.contract-name-column .cell) {
+  overflow: hidden !important;
+  text-overflow: ellipsis !important;
+  white-space: nowrap !important;
+}
+
 /* 颜色说明区域样式 */
 .color-legend {
   display: flex;