yangfeng
2023-07-11 7955d7693a5854add1f1718644f380e94a4f0573
src/components/makepager/TableCommonView.vue
@@ -21,14 +21,19 @@
        :label="item.label"
        :width="item.width"
        :min-width="item.min"
        show-overflow-tooltip
        sortable
      >
        <template slot-scope="scope">
          <span v-if="item.price">{{ "¥" + number_format(scope.row[item.prop], 2, ".", ",") }}</span>
          <span v-else-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</span>
          <span v-else>{{ scope.row[item.prop] }}</span>
        </template>
      </el-table-column>
      <slot name="tableButton" />
      <div slot="empty">
        <el-empty description="暂无数据"></el-empty>
      </div>
    </el-table>
  </div>
</template>
@@ -93,7 +98,6 @@
    getSummaries(param) {
      if (this.showSummary.show) {
        const { columns, data } = param
        console.log(param)
        const sums = []
        columns.forEach((column, index) => {
          if (index === this.showSummary.mergeNumber) {
@@ -116,7 +120,7 @@
        return sums
      }
    },
    //定义number_format方法
    // 数字换行为金额显示格式
    number_format(number, decimals, dec_point, thousands_sep) {
      decimals = 2 //这里默认设置保留两位小数,也可以注释这句采用传入的参数
      /*
@@ -154,6 +158,12 @@
  margin-top: 20px;
  margin-right: 10px;
  margin-bottom: 40px;
  .blue {
    padding: 10px;
    color: #fff;
    background-color: blue;
    border-radius: 4px;
  }
}
::v-deep {
  .el-table__footer-wrapper tbody td.el-table__cell {