gongchunyi
8 天以前 a7a9f53ef126659f664f5cbfe4eb10bebdfc4a6a
src/components/PIMTable/PIMTable.vue
@@ -146,7 +146,7 @@
              @click.stop="o.clickFun(scope.row)"
              :key="key"
            >
              {{ o.name }}
              {{ typeof o.name === 'function' ? o.name(scope.row) : o.name }}
            </el-button>
            <el-upload
              :action="
@@ -189,7 +189,6 @@
                :disabled="isOperationDisabled(o, scope.row)"
                :style="{
                  color: getOperationColor(o, scope.row),
                  fontWeight: 'bold',
                }"
                >{{ o.name }}</el-button
              >
@@ -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) => {
@@ -427,10 +426,13 @@
};
const getOperationColor = (operation, row) => {
  const colorValue = typeof operation?.color === 'function' ? operation.color(row) : operation?.color;
  const baseColor =
    operation?.name === "删除" || operation?.name === "delete"
      ? "#D93025"
      : operation?.color || "var(--el-color-primary)";
      : operation?.name === "详情"
      ? "#67C23A"
      : colorValue || "var(--el-color-primary)";
  if (isOperationDisabled(operation, row)) {
    return fadeColor(baseColor, 0.35);