فهرست منبع

Merge branch 'master' of http://49.234.186.218:9000/root/ieplus

mingfu 1 ماه پیش
والد
کامیت
197a426ed2
2فایلهای تغییر یافته به همراه14 افزوده شده و 6 حذف شده
  1. 6 1
      back-ui/src/components/Table/index.vue
  2. 8 5
      back-ui/src/views/dz/cards/index.vue

+ 6 - 1
back-ui/src/components/Table/index.vue

@@ -108,7 +108,12 @@
 
             <!-- 自定义slot -->
             <template v-else-if="column.type === 'slot'">
-              <slot :name="column.slotName" :row="scope.row" :column="column" />
+              <slot
+                :name="column.slotName"
+                :row="scope.row"
+                :column="column"
+                :$index="scope.$index"
+              />
             </template>
 
             <!-- 普通文本 -->

+ 8 - 5
back-ui/src/views/dz/cards/index.vue

@@ -168,11 +168,7 @@
     >
       <!-- 序号插槽 -->
       <template #index="{ row, $index }">
-        {{
-          (data.queryParams.pageNum - 1) * data.queryParams.pageSize +
-          $index +
-          1
-        }}
+        {{ getRowIndex($index) }}
       </template>
 
       <!-- 姓名-手机插槽 -->
@@ -508,6 +504,13 @@ watch(
   { immediate: true, deep: true }
 );
 
+/** 获取行序号 */
+function getRowIndex(index) {
+  const pageNum = queryParams.value?.pageNum || 1;
+  const pageSize = queryParams.value?.pageSize || 10;
+  return (pageNum - 1) * pageSize + index + 1;
+}
+
 /** 查询学习卡列表 */
 function getList() {
   loading.value = true;