Browse Source

列表 序号更新

linweizeng 2 năm trước cách đây
mục cha
commit
51353c4f73

+ 1 - 0
src/components/ibps-crud/index.vue

@@ -158,6 +158,7 @@
                     :label="handleAttribute(indexRow.label, $t('components.crud.index'))"
                     :label="handleAttribute(indexRow.label, $t('components.crud.index'))"
                     :width="60"
                     :width="60"
                     type="index"
                     type="index"
+                    :index="indexMethod"
                 />
                 />
                 <slot name="prepend-column" />
                 <slot name="prepend-column" />
                 <template v-for="(column, index) in tableColumns">
                 <template v-for="(column, index) in tableColumns">

+ 3 - 0
src/components/ibps-crud/mixin/base.js

@@ -98,6 +98,9 @@ export default {
         }
         }
     },
     },
     methods: {
     methods: {
+        indexMethod(index) {
+            return (this.currentPage - 1) * this.pageSize + index + 1
+        },
         /* 表格換颜色*/
         /* 表格換颜色*/
         tableRowClassName({ row, rowIndex }) {
         tableRowClassName({ row, rowIndex }) {
             if (rowIndex % 2 === 1) return "warning-row"
             if (rowIndex % 2 === 1) return "warning-row"