haoxuan
2024-04-09 4bf10a1ba42ddaeab565c105b376c5732b0f3dab
src/components/makepager/TableCommonView.vue
@@ -20,7 +20,13 @@
      :row-class-name="tableRowClassName"
    >
      <el-table-column v-if="selectBox" type="selection" width="40" :selectable="selectable"> </el-table-column>
      <el-table-column v-if="tableList.selectIndex" type="index" label="序号" width="50"></el-table-column>
      <el-table-column
        v-if="tableList.selectIndex"
        type="index"
        label="序号"
        width="50"
        :fixed="tableList.isFixed"
      ></el-table-column>
      <el-table-column
        v-for="(item, i) in tableList.tableColumn"
        :key="i"
@@ -30,8 +36,20 @@
        :min-width="item.min"
        show-overflow-tooltip
        :sortable="item.sortable"
        :fixed="item.fixed"
        v-if="item.isShowColumn"
      >
      <template slot="header">
          {{ item.label }}
          <span v-if="item.iconRight">
            <i
              :class="item.iconRight"
              style="font-size: 16px; margin-left: 5px; cursor: pointer"
              @click="handleShow(item)"
            ></i>
          </span>
        </template>
        <template slot-scope="scope">
          <span v-if="item.price">{{ "¥" + number_format(scope.row[item.prop], 2, ".", ",") }}</span>
          <div v-else-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div>
@@ -158,6 +176,7 @@
      default: () => {
        return {
          selectIndex: true,
          isFixed: false,
          tableInfomation: [], // 接口返回数据
          showcol: [],
          allcol: [],
@@ -404,7 +423,11 @@
      } else {
        return false
      }
    }
    },
    // 自定义表头点击事件
    handleShow(item) {
      this.$emit("handleShow", item);
    },
  }
}
</script>