gaoluyang
2025-02-17 b7adcaff77a5028458380ab1e86a1087f35e7b60
src/components/Table/lims-table.vue
@@ -71,7 +71,7 @@
                      size="mini"
                      v-show="o.showHide ? o.showHide(scope.row) : true"
                      :disabled="o.disabled ? o.disabled(scope.row) : false"
                      :icon="o.icon | iconFn(scope.row, o)"
                      :icon="iconFn(o)"
                      :plain="o.plain"
                      :style="{ 'color': o.name === '删除' ? '#f56c6c' : o.color }"
                      :type="o.type | typeFn(scope.row)"
@@ -107,6 +107,7 @@
      <pagination
      v-show="page.total>0"
      :total="page.total"
      :layout="page.layout"
      :page.sync="page.current"
      :limit.sync="page.size"
      @pagination="pagination"
@@ -167,11 +168,6 @@
  export default {
    name: 'ZTTable',
    filters: {
      iconFn(val, row) {
        if (typeof (val) === 'function') {
          return val(row);
        } else return val;
      },
      typeFn(val, row) {
        // console.log(val, row, '11111111');
        if (typeof (val) === 'function') {
@@ -270,13 +266,28 @@
          return {
            total:0,
            current:0,
            size:10
            size:10,
            layout: 'total, sizes, prev, pager, next, jumper'
          };
        }
      }
    },
    methods: {
      iconFn(row) {
        if (row.name === '编辑') {
          return 'el-icon-edit'
        } else if (row.name === '删除') {
          return 'el-icon-delete'
        } else if (row.name === '查看') {
          return 'el-icon-view'
        } else {
          return row.icon
        }
        // if (typeof (val) === 'function') {
        //   return val(row);
        // } else return val;
      },
      formatType(val, format) {
        if (typeof (format) === 'function') {
          return format(val);