yuan
2026-10-10 1bc5d77b95c15e5e23940402352da36a32c4547a
src/components/PIMTable/PIMTable.vue
@@ -40,7 +40,7 @@
      :fixed="item.fixed"
      :label="item.label"
      :prop="item.prop"
      show-overflow-tooltip
      :show-overflow-tooltip="item.dataType !== 'action' && item.dataType !== 'slot'"
      :align="item.align"
      :sortable="!!item.sortable"
      :type="item.type"
@@ -130,7 +130,7 @@
        </div>
        <!-- 按钮 -->
        <div v-else-if="item.dataType == 'action'">
        <div v-else-if="item.dataType == 'action'" @click.stop>
          <template v-for="(o, key) in item.operation" :key="key">
            <el-button
              v-show="o.type != 'upload'"
@@ -145,7 +145,7 @@
                    : o.color,
              }"
              link
              @click="o.clickFun(scope.row)"
              @click.stop="o.clickFun(scope.row)"
              :key="key"
            >
              {{ o.name }}
@@ -201,19 +201,17 @@
          style="width: 100%"
          @click="goLink(scope.row, item.linkMethod)"
        >
          <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span>
          <span>{{ formatters(scope.row[item.prop], item.formatData) }}</span>
        </div>
        <!-- 默认纯展示数据 -->
        <div v-else class="cell" style="width: 100%">
          <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span>
          <span v-else>{{
            formatters(scope.row[item.prop], item.formatData)
          }}</span>
          <span>{{ formatters(scope.row[item.prop], item.formatData) }}</span>
        </div>
      </template>
    </el-table-column>
  </el-table>
  <pagination
      v-if="isShowPagination"
    :total="page.total"
    :layout="page.layout"
    :page="page.current"
@@ -226,13 +224,14 @@
import pagination from "./Pagination.vue";
import { ref, inject, getCurrentInstance } from "vue";
import { ElMessage } from "element-plus";
import { dateOnly } from "@/utils/ruoyi";
// 获取全局的 uploadHeader
const { proxy } = getCurrentInstance();
const uploadHeader = proxy.uploadHeader;
const javaApi = proxy.javaApi;
const emit = defineEmits(["pagination", "expand-change", "selection-change"]);
const emit = defineEmits(["pagination", "expand-change", "selection-change", "row-click"]);
// Filters
const typeFn = (val, row) => {
@@ -240,7 +239,9 @@
};
const formatters = (val, format) => {
  return typeof format === "function" ? format(val) : val;
  if (typeof format === "function") return format(val);
  // 未显式指定格式化函数时:日期时间统一只显示年月日(非日期值原样返回)
  return dateOnly(val);
};
// Props(使用 defineProps 的非 TS 形式)
@@ -276,6 +277,10 @@
  isSelection: {
    type: Boolean,
    default: false,
  },
   isShowPagination: {
    type: Boolean,
    default: true,
  },
  isShowSummary: {
    type: Boolean,
@@ -422,6 +427,10 @@
  emit("pagination", { page: page, limit: limit });
};
const rowClick = (row) => {
  emit("row-click", row);
};
const expandChange = (row, expandedRows) => {
  emit("expand-change", row, expandedRows);
};
@@ -438,19 +447,6 @@
  text-overflow: ellipsis;
  padding-right: 0 !important;
  padding-left: 0 !important;
}
.pim-table-header-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}
.pim-table-header-title {
  font-weight: 500;
}
.pim-table-header-extra :deep(.el-input),