gaoluyang
2025-02-15 04f5690ca3d4f7e95bd284fbece8369bc9f63ae4
src/components/Table/lims-table.vue
@@ -68,17 +68,19 @@
                <template v-for="(o, key) in item.operation">
                  <el-button
                      v-if="o.type!='upload'"
                      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)"
                      :plain="o.plain" :size="o.size"
                      :style="{ 'color': o.color }"
                      :icon="iconFn(o)"
                      :plain="o.plain"
                      :style="{ 'color': o.name === '删除' ? '#f56c6c' : o.color }"
                      :type="o.type | typeFn(scope.row)"
                      @click="o.clickFun(scope.row)">
                    {{ o.name }}
                  </el-button>
                  <el-upload
                    action="#"
                    size="mini"
                    :on-change="(file, fileList)=>o.clickFun(scope.row,file, fileList)"
                    :multiple="o.multiple?o.multiple:false"
                    :limit="o.limit?o.limit:1"
@@ -165,11 +167,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') {
@@ -275,6 +272,20 @@
    },
    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);