浏览代码

🦄 refactor(日报): 调整表格显示效果

Zimo 3 天之前
父节点
当前提交
6a44522b48

+ 10 - 5
src/views/pms/iotrhdailyreport/fill.vue

@@ -48,6 +48,7 @@ interface Column {
   label: string
   'min-width'?: string
   isTag?: boolean
+  fixed?: 'left' | 'right'
   formatter?: (row: List) => any
   children?: Column[]
   dictType?: string
@@ -58,26 +59,25 @@ const columns = ref<Column[]>([
     label: '日期',
     prop: 'createTime',
     'min-width': '120px',
+    fixed: 'left',
     formatter: (row: List) => dayjs(row.createTime).format('YYYY-MM-DD')
   },
   {
     label: '施工队伍',
     prop: 'deptName',
-    'min-width': '120px'
-  },
-  {
-    label: '项目',
-    prop: 'contractName',
+    fixed: 'left',
     'min-width': '120px'
   },
   {
     label: '任务',
     prop: 'taskName',
+    fixed: 'left',
     'min-width': '120px'
   },
   {
     label: '施工状态',
     prop: 'constructionStatus',
+    fixed: 'left',
     'min-width': '120px',
     isTag: true,
     dictType: DICT_TYPE.PMS_PROJECT_TASK_SCHEDULE
@@ -185,6 +185,11 @@ const columns = ref<Column[]>([
     prop: 'productionStatus',
     'min-width': '120px'
   },
+  {
+    label: '项目',
+    prop: 'contractName',
+    'min-width': '120px'
+  },
   {
     label: '累计',
     children: [

+ 19 - 15
src/views/pms/iotrhdailyreport/index.vue

@@ -154,9 +154,10 @@
               label="日期"
               align="center"
               prop="createTime"
-              :formatter="dateFormatter"
+              :formatter="dateFormatter2"
               :min-width="columnWidths.createTime.width"
               resizable
+              fixed="left"
             />
             <el-table-column
               label="施工队伍"
@@ -164,14 +165,7 @@
               prop="deptName"
               :min-width="columnWidths.deptName.width"
               resizable
-            />
-            <el-table-column
-              label="项目"
-              align="center"
-              prop="contractName"
-              class-name="contract-name-column"
-              :min-width="columnWidths.contractName.width"
-              resizable
+              fixed="left"
             />
             <el-table-column
               label="任务"
@@ -179,6 +173,7 @@
               prop="taskName"
               :min-width="columnWidths.taskName.width"
               resizable
+              fixed="left"
             />
             <!-- <el-table-column label="施工状态" align="center" prop="constructionStatus" /> -->
             <el-table-column
@@ -187,6 +182,7 @@
               prop="constructionStatus"
               :min-width="columnWidths.constructionStatus.width"
               resizable
+              fixed="left"
             >
               <template #default="scope">
                 <dict-tag
@@ -281,7 +277,7 @@
                 <dict-tag :type="DICT_TYPE.PMS_PROJECT_NPT_REASON" :value="scope.row.nptReason" />
               </template>
             </el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               label="施工开始日期"
               align="center"
               prop="constructionStartDate"
@@ -296,7 +292,7 @@
               :formatter="dateFormatter"
               :min-width="columnWidths.constructionEndDate.width"
               resizable
-            />
+            /> -->
             <el-table-column
               label="生产动态"
               align="center"
@@ -304,6 +300,14 @@
               prop="productionStatus"
               resizable
             />
+            <el-table-column
+              label="项目"
+              align="center"
+              prop="contractName"
+              class-name="contract-name-column"
+              :min-width="columnWidths.contractName.width"
+              resizable
+            />
             <el-table-column label="累计" align="center">
               <el-table-column
                 label="注气量(万方)"
@@ -336,7 +340,7 @@
               :min-width="columnWidths.capacity.width"
               resizable
             />
-            <el-table-column label="操作" align="center" fixed="right">
+            <!-- <el-table-column label="操作" align="center" fixed="right">
               <template #default="scope">
                 <el-button
                   link
@@ -355,7 +359,7 @@
                   删除
                 </el-button>
               </template>
-            </el-table-column>
+            </el-table-column> -->
           </el-table>
         </div>
         <!-- 分页 -->
@@ -380,7 +384,7 @@
 </template>
 
 <script setup lang="ts">
-import { dateFormatter, rangeShortcuts } from '@/utils/formatTime'
+import { dateFormatter, dateFormatter2, rangeShortcuts } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { IotRhDailyReportApi, IotRhDailyReportVO } from '@/api/pms/iotrhdailyreport'
 import IotRhDailyReportForm from './IotRhDailyReportForm.vue'
@@ -486,7 +490,7 @@ const columnWidths = ref<
     label: '日期',
     prop: 'createTime',
     width: '120px',
-    fn: (row: IotRhDailyReportVO) => dateFormatter(null, null, row.createTime)
+    fn: (row: IotRhDailyReportVO) => dateFormatter2(null, null, row.createTime)
   },
   deptName: {
     label: '施工队伍',

+ 19 - 14
src/views/pms/iotrydailyreport/fill.vue

@@ -78,6 +78,7 @@ interface Column {
   label: string
   'min-width'?: string
   isTag?: boolean
+  fixed?: 'left' | 'right'
   formatter?: (row: List) => any
   children?: Column[]
   dictType?: string
@@ -88,34 +89,28 @@ const columns = ref<Column[]>([
     label: '日期',
     prop: 'createTime',
     'min-width': '120px',
-    formatter: (row: List) => dayjs(row.createTime).format('YYYY-MM-DD')
+    formatter: (row: List) => dayjs(row.createTime).format('YYYY-MM-DD'),
+    fixed: 'left'
   },
   {
     label: '施工队伍',
     prop: 'deptName',
-    'min-width': '120px'
-  },
-  {
-    label: '项目',
-    prop: 'contractName',
-    'min-width': '120px'
+    'min-width': '120px',
+    fixed: 'left'
   },
   {
     label: '任务',
     prop: 'taskName',
-    'min-width': '120px'
-  },
-  {
-    label: '设备型号',
-    prop: 'equipmentType',
-    'min-width': '120px'
+    'min-width': '120px',
+    fixed: 'left'
   },
   {
     label: '施工状态',
     prop: 'rigStatus',
     'min-width': '120px',
     isTag: true,
-    dictType: DICT_TYPE.PMS_PROJECT_TASK_RY_SCHEDULE
+    dictType: DICT_TYPE.PMS_PROJECT_TASK_RY_SCHEDULE,
+    fixed: 'left'
   },
   {
     label: '审批状态',
@@ -137,6 +132,11 @@ const columns = ref<Column[]>([
       }
     }
   },
+  {
+    label: '设备型号',
+    prop: 'equipmentType',
+    'min-width': '120px'
+  },
   {
     label: '上井次完井时间',
     prop: 'latestWellDoneTime',
@@ -256,6 +256,11 @@ const columns = ref<Column[]>([
     prop: 'productionStatus',
     'min-width': '120px'
   },
+  {
+    label: '项目',
+    prop: 'contractName',
+    'min-width': '120px'
+  },
   {
     label: '进尺工作时间(H)',
     prop: 'drillingWorkingTime',

+ 24 - 18
src/views/pms/iotrydailyreport/index.vue

@@ -122,6 +122,7 @@
               :formatter="dateFormatter2"
               :min-width="columnWidths.createTime.width"
               resizable
+              fixed="left"
             />
             <el-table-column
               label="施工队伍"
@@ -129,34 +130,25 @@
               prop="deptName"
               :min-width="columnWidths.deptName.width"
               resizable
+              fixed="left"
             />
-            <el-table-column
-              label="项目"
-              align="center"
-              prop="contractName"
-              :min-width="columnWidths.contractName.width"
-              resizable
-            />
+
             <el-table-column
               label="任务"
               align="center"
               prop="taskName"
               :min-width="columnWidths.taskName.width"
               resizable
+              fixed="left"
             />
-            <el-table-column
-              label="设备型号"
-              align="center"
-              prop="equipmentType"
-              :min-width="columnWidths.equipmentType.width"
-              resizable
-            />
+
             <el-table-column
               :label="t('project.status')"
               align="center"
               prop="rigStatus"
               :min-width="columnWidths.rigStatus.width"
               resizable
+              fixed="left"
             >
               <template #default="scope">
                 <dict-tag
@@ -165,6 +157,13 @@
                 />
               </template>
             </el-table-column>
+            <el-table-column
+              label="设备型号"
+              align="center"
+              prop="equipmentType"
+              :min-width="columnWidths.equipmentType.width"
+              resizable
+            />
             <el-table-column
               label="上井次完井时间"
               align="center"
@@ -266,7 +265,7 @@
               </el-table-column>
             </el-table-column>
 
-            <el-table-column
+            <!-- <el-table-column
               label="施工开始日期"
               align="center"
               prop="constructionStartDate"
@@ -281,7 +280,7 @@
               :formatter="dateFormatter"
               :min-width="columnWidths.constructionEndDate.width"
               resizable
-            />
+            /> -->
             <el-table-column
               label="水平段长度(m)"
               align="center"
@@ -316,6 +315,13 @@
               prop="productionStatus"
               :width="columnWidths.productionStatus.width"
             />
+            <el-table-column
+              label="项目"
+              align="center"
+              prop="contractName"
+              :min-width="columnWidths.contractName.width"
+              resizable
+            />
             <el-table-column
               label="进尺工作时间(H)"
               align="center"
@@ -388,7 +394,7 @@
                 resizable
               />
             </el-table-column>
-            <el-table-column label="操作" align="center" fixed="right">
+            <!-- <el-table-column label="操作" align="center" fixed="right">
               <template #default="scope">
                 <el-button
                   link
@@ -407,7 +413,7 @@
                   删除
                 </el-button>
               </template>
-            </el-table-column>
+            </el-table-column> -->
           </el-table>
         </div>
         <!-- 分页 -->

+ 15 - 9
src/views/pms/iotrydailyreport/xfill.vue

@@ -53,6 +53,7 @@ interface Column {
   label: string
   'min-width'?: string
   isTag?: boolean
+  fixed?: 'left' | 'right'
   formatter?: (row: List) => any
   children?: Column[]
   dictType?: string
@@ -63,29 +64,29 @@ const columns = ref<Column[]>([
     label: '日期',
     prop: 'createTime',
     'min-width': '120px',
-    formatter: (row: List) => dayjs(row.createTime).format('YYYY-MM-DD')
+    formatter: (row: List) => dayjs(row.createTime).format('YYYY-MM-DD'),
+    fixed: 'left'
   },
   {
     label: '施工队伍',
     prop: 'deptName',
-    'min-width': '120px'
-  },
-  {
-    label: '项目',
-    prop: 'contractName',
-    'min-width': '120px'
+    'min-width': '120px',
+    fixed: 'left'
   },
+
   {
     label: '任务',
     prop: 'taskName',
-    'min-width': '120px'
+    'min-width': '120px',
+    fixed: 'left'
   },
   {
     label: '施工状态',
     prop: 'repairStatus',
     'min-width': '120px',
     isTag: true,
-    dictType: DICT_TYPE.PMS_PROJECT_TASK_RY_REPAIR_SCHEDULE
+    dictType: DICT_TYPE.PMS_PROJECT_TASK_RY_REPAIR_SCHEDULE,
+    fixed: 'left'
   },
   {
     label: '审批状态',
@@ -214,6 +215,11 @@ const columns = ref<Column[]>([
     prop: 'productionStatus',
     'min-width': '120px'
   },
+  {
+    label: '项目',
+    prop: 'contractName',
+    'min-width': '120px'
+  },
   {
     label: '全员数量',
     prop: 'totalStaffNum',

+ 20 - 10
src/views/pms/iotrydailyreport/xjindex.vue

@@ -116,7 +116,12 @@
             show-overflow-tooltip
             border
           >
-            <el-table-column :label="t('iotDevice.serial')" width="56px" align="center">
+            <el-table-column
+              :label="t('iotDevice.serial')"
+              width="56px"
+              align="center"
+              fixed="left"
+            >
               <template #default="scope">
                 {{ scope.$index + 1 }}
               </template>
@@ -128,6 +133,7 @@
               :formatter="dateFormatter2"
               :min-width="columnWidths.createTime.width"
               resizable
+              fixed="left"
             />
             <el-table-column
               label="施工队伍"
@@ -135,20 +141,16 @@
               prop="deptName"
               :min-width="columnWidths.deptName.width"
               resizable
+              fixed="left"
             />
-            <el-table-column
-              label="项目"
-              align="center"
-              prop="contractName"
-              :min-width="columnWidths.contractName.width"
-              resizable
-            />
+
             <el-table-column
               label="任务"
               align="center"
               prop="taskName"
               :min-width="columnWidths.taskName.width"
               resizable
+              fixed="left"
             />
             <el-table-column
               :label="t('project.status')"
@@ -156,6 +158,7 @@
               prop="repairStatus"
               :min-width="columnWidths.repairStatus.width"
               resizable
+              fixed="left"
             >
               <template #default="scope">
                 <dict-tag
@@ -318,6 +321,13 @@
               :min-width="columnWidths.productionStatus.width"
               resizable
             />
+            <el-table-column
+              label="项目"
+              align="center"
+              prop="contractName"
+              :min-width="columnWidths.contractName.width"
+              resizable
+            />
             <el-table-column
               label="全员数量"
               align="center"
@@ -348,7 +358,7 @@
               :min-width="columnWidths.leaveStaffNum.width"
               resizable
             />
-            <el-table-column label="操作" align="center" fixed="right">
+            <!-- <el-table-column label="操作" align="center" fixed="right">
               <template #default="scope">
                 <el-button
                   link
@@ -367,7 +377,7 @@
                   删除
                 </el-button>
               </template>
-            </el-table-column>
+            </el-table-column> -->
           </el-table>
         </div>
         <!-- 分页 -->