meixioacomponent 1.1.62 → 1.1.64

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.64",
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"
@@ -260,6 +257,7 @@ import {tableSectionMixins} from "../mixins/tableSectionMixins";
260
257
  import TableCheckControl from "./TableCheckControl";
261
258
  import proTableLocalConfigManage from "../../config/ProTableLocalConfigManage/ProTableLocalConfigManage";
262
259
 
260
+ const ColIndexStr = 'colIndex'
263
261
  export default {
264
262
  name: "baseProTable",
265
263
  data() {
@@ -521,6 +519,10 @@ export default {
521
519
  useIndex: {
522
520
  type: Boolean,
523
521
  default: false
522
+ },
523
+ indexDefaultValue: {
524
+ type: Number,
525
+ default: 0
524
526
  }
525
527
 
526
528
  },
@@ -632,6 +634,20 @@ export default {
632
634
  },
633
635
  mixins: [tableSectionMixins],
634
636
  methods: {
637
+ /**
638
+ * 初始化表格下标
639
+ */
640
+ initTableIndex() {
641
+ if (this.$props.useIndex) {
642
+ this.tableConfigColumnList.unshift({
643
+ key: ColIndexStr,
644
+ colKey: ColIndexStr,
645
+ label: '序号',
646
+ title: '序号',
647
+ disabledSortable: true
648
+ })
649
+ }
650
+ },
635
651
  isToolTip(value) {
636
652
  if (!value) {
637
653
  return false;
@@ -641,6 +657,7 @@ export default {
641
657
  init() {
642
658
  this.setTableConfigColumList();
643
659
  const {rowKey} = this.$props;
660
+ this.initTableIndex();
644
661
  if (rowKey) {
645
662
  this.initTableControl();
646
663
  }
@@ -985,6 +1002,14 @@ export default {
985
1002
  this.refreshData(false);
986
1003
  } else {
987
1004
  const {refreshLayout} = this.$props;
1005
+
1006
+ if (this.$props.useIndex) {
1007
+ const size = this.$props.pageProps[this.$props.pageConfig.size];
1008
+ data.forEach((item, index) => {
1009
+ item[`${ColIndexStr}`] = (((pageNum - 1) * size) + (index + this.$props.indexDefaultValue))
1010
+ })
1011
+ }
1012
+
988
1013
  this.tableData = [];
989
1014
  this.tableData = data;
990
1015