Browse Source

DVP编制-tableLoading查缺补漏

weibowen 8 months ago
parent
commit
dce600a913

+ 6 - 0
src/views/componentsDVP/dvpPlan/index.vue

@@ -150,6 +150,7 @@
           :rowKey='(record, index) => { return index; }'
           :scroll='{ x: 1850, y: tableHeightValue }'
           :pagination='pagination'
+          :loading='tableLoading'
           @change='handlePageChange'
         >
           <!-- 序号列 -->
@@ -278,6 +279,8 @@ export default {
       /** 表格高度 */
       tableHeight: window.innerHeight - 352 + 'px',
       tableHeightValue: window.innerHeight - 352,
+      /** 表格加载状态 */
+      tableLoading: false,
       /** 表格数据 */
       tableData: [],
       /** 表格列 */
@@ -574,6 +577,7 @@ export default {
      */
     initData() {
       let _that = this;
+      _that.tableLoading = true;
       _that.formData.dvpId = 1;
       _that.formData.pagination = {
         pageSize: _that.pagination.pageSize,
@@ -599,6 +603,8 @@ export default {
           _that.tableData = [];
           _that.pagination.total = 0;
         }
+      }).finally(() => {
+        _that.tableLoading = false;
       });
 
       // 变更申请按钮显示隐藏,如果DVP编制进行到DVP验证阶段,则显示

+ 4 - 14
src/views/fullVehicle/dvpPlan/index.vue

@@ -246,7 +246,7 @@ export default {
         pageSizeOptions: ['10', '20', '50', '100', '200'], // 每页数量选项
         onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize), // 改变每页数量时更新显示
         total: 0, //总条数
-        showQuickJumper: true,
+        showQuickJumper: true
       },
       /** 表格高度 */
       tableHeight: window.innerHeight - 421 + 'px',
@@ -273,7 +273,6 @@ export default {
           title: this.$t('plan.dvp.vehicle-performance-module'),
           dataIndex: 'performanceModule',
           align: 'center',
-          // width: 100,
           ellipsis: true
         },
         //试验车用途描述
@@ -281,7 +280,6 @@ export default {
           title: this.$t('plan.dvp.description-of-the-purpose-of-the-test-vehicle'),
           dataIndex: 'vehicleUse',
           align: 'center',
-          // width: 100,
           ellipsis: true
         },
         //试验类型
@@ -289,7 +287,6 @@ export default {
           title: this.$t('plan.dvp.test-type'),
           dataIndex: 'testType',
           align: 'center',
-          // width: 100,
           ellipsis: true
         },
         //车辆状态描述
@@ -297,7 +294,6 @@ export default {
           title: this.$t('plan.dvp.description-of-the-vehicle-status'),
           dataIndex: 'vehicleState',
           align: 'center',
-          // width: 100,
           ellipsis: true
         },
         //数量
@@ -305,7 +301,6 @@ export default {
           title: this.$t('plan.dvp.quantity'),
           dataIndex: 'count',
           align: 'center',
-          // width: 100,
           ellipsis: true
         }
       ],
@@ -316,7 +311,6 @@ export default {
           title: this.$t('plan.dvp.test-location'),
           dataIndex: 'testSite',
           align: 'center',
-          // width: 150,
           ellipsis: true
         },
         //试验负责人
@@ -324,7 +318,6 @@ export default {
           title: this.$t('plan.dvp.study-director'),
           dataIndex: 'testOwner',
           align: 'center',
-          // width: 150,
           ellipsis: true
         },
         //节点
@@ -332,7 +325,6 @@ export default {
           title: this.$t('plan.dvp.panel-point'),
           dataIndex: 'node',
           align: 'center',
-          // width: 150,
           ellipsis: true
         },
         //样车计划提供时间
@@ -340,7 +332,6 @@ export default {
           title: this.$t('plan.dvp.sample-vehicle-plan-delivery-time'),
           dataIndex: 'prototypePlanTime',
           align: 'center',
-          // width: 150,
           ellipsis: true
         },
         //计划开始时间
@@ -348,7 +339,6 @@ export default {
           title: this.$t('plan.dvp.scheduled-start-time'),
           dataIndex: 'planStartTime',
           align: 'center',
-          // width: 150,
           ellipsis: true
         },
         //计划结束时间
@@ -356,7 +346,6 @@ export default {
           title: this.$t('plan.dvp.scheduled-end-time'),
           dataIndex: 'planEndTime',
           align: 'center',
-          // width: 150,
           ellipsis: true
         },
         //操作
@@ -395,8 +384,6 @@ export default {
     };
   this.getProjectNodeList();
   },
-  created() {
-  },
   methods: {
     /**
      * 获取项目节点下拉选项
@@ -600,6 +587,7 @@ export default {
      */
     initData() {
       let _that = this;
+      _that.tableLoading = true;
       _that.formData.dvpId = _that.$store.getters.dvpId;
       _that.formData.pagination = {
         pageSize: _that.pagination.pageSize,
@@ -664,6 +652,8 @@ export default {
             }
           }
         }
+      }).finally(() => {
+        _that.tableLoading = false;
       });
       // 变更申请按钮显示隐藏,如果DVP编制进行到DVP验证阶段,则显示
       let data = {

+ 3 - 0
src/views/systemDVP/dvpPlan/index.vue

@@ -639,6 +639,7 @@ export default {
      */
     initData() {
       let _that = this;
+      _that.tableLoading = true;
       _that.formData.dvpId = _that.$store.getters.dvpId;
       _that.formData.pagination = {
         pageSize: _that.pagination.pageSize,
@@ -653,6 +654,8 @@ export default {
           _that.tableData = [];
           _that.pagination.total = 0;
         }
+      }).finally( () => {
+        _that.tableLoading = false;
       });
       // 变更申请按钮显示隐藏,如果DVP编制进行到DVP验证阶段,则显示
       let data = {