yuan
2026-10-10 1390eec135de33236c025457d5b21008b67f33c8
src/components/PIMTable/PIMTable.vue
@@ -189,7 +189,6 @@
                :disabled="isOperationDisabled(o, scope.row)"
                :style="{
                  color: getOperationColor(o, scope.row),
                  fontWeight: 'bold',
                }"
                >{{ o.name }}</el-button
              >
@@ -203,14 +202,11 @@
          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>
@@ -229,6 +225,7 @@
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();
@@ -243,7 +240,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 形式)
@@ -368,11 +367,11 @@
    return format(val);
  } else return val;
};
const validTagTypes = ["primary", "success", "info", "warning", "danger"];
const formatType = (val, format) => {
  if (typeof format === "function") {
    return format(val);
  } else return "";
  const type = typeof format === "function" ? format(val) : undefined;
  return validTagTypes.includes(type) ? type : undefined;
};
const isOperationDisabled = (operation, row) => {
@@ -430,6 +429,8 @@
  const baseColor =
    operation?.name === "删除" || operation?.name === "delete"
      ? "#D93025"
      : operation?.name === "详情"
      ? "#67C23A"
      : operation?.color || "var(--el-color-primary)";
  if (isOperationDisabled(operation, row)) {