meixioacomponent 1.1.62 → 1.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "1.1.62",
3
+ "version": "1.1.63",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -146,9 +146,6 @@
146
146
  <slot :scope="props.row" name="tableExpand"></slot>
147
147
  </template>
148
148
  </el-table-column>
149
- <!--序号-->
150
- <el-table-column type="index" width="50" v-if="useIndex" label="序号"></el-table-column>
151
-
152
149
  <el-table-column
153
150
  v-for="(item, index) in showTableHeader"
154
151
  :key="index"
@@ -259,7 +256,7 @@ import componentConfig from "../../config/componentConfig";
259
256
  import {tableSectionMixins} from "../mixins/tableSectionMixins";
260
257
  import TableCheckControl from "./TableCheckControl";
261
258
  import proTableLocalConfigManage from "../../config/ProTableLocalConfigManage/ProTableLocalConfigManage";
262
-
259
+ const ColIndexStr = 'colIndex'
263
260
  export default {
264
261
  name: "baseProTable",
265
262
  data() {
@@ -520,7 +517,7 @@ export default {
520
517
  // 使用序号下标
521
518
  useIndex: {
522
519
  type: Boolean,
523
- default: false
520
+ default: true
524
521
  }
525
522
 
526
523
  },
@@ -632,6 +629,20 @@ export default {
632
629
  },
633
630
  mixins: [tableSectionMixins],
634
631
  methods: {
632
+ /**
633
+ * 初始化表格下标
634
+ */
635
+ initTableIndex() {
636
+ if (this.$props.useIndex) {
637
+ this.tableConfigColumnList.unshift({
638
+ key: ColIndexStr,
639
+ colKey: ColIndexStr,
640
+ label: '序号',
641
+ title: '序号',
642
+ disabledSortable:true
643
+ })
644
+ }
645
+ },
635
646
  isToolTip(value) {
636
647
  if (!value) {
637
648
  return false;
@@ -641,6 +652,7 @@ export default {
641
652
  init() {
642
653
  this.setTableConfigColumList();
643
654
  const {rowKey} = this.$props;
655
+ this.initTableIndex();
644
656
  if (rowKey) {
645
657
  this.initTableControl();
646
658
  }
@@ -985,6 +997,14 @@ export default {
985
997
  this.refreshData(false);
986
998
  } else {
987
999
  const {refreshLayout} = this.$props;
1000
+
1001
+ if (this.$props.useIndex) {
1002
+ const size = this.$props.pageProps[this.$props.pageConfig.size];
1003
+ data.forEach((item, index) => {
1004
+ item[`${ColIndexStr}`] = (((pageNum - 1) * size) + (index+1))
1005
+ })
1006
+ }
1007
+
988
1008
  this.tableData = [];
989
1009
  this.tableData = data;
990
1010