yyb
9 小时以前 a567edf28abb00581c93b27405ed9657b63a8bd7
模板类型设置
已修改2个文件
21 ■■■■ 文件已修改
src/api/officeProcessAutomation/approvalTemplate.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/officeProcessAutomation/approvalTemplate.js
@@ -1,8 +1,8 @@
import request from "@/utils/request";
/** 模板类型:1 系统内置,2 自定义 */
export const TEMPLATE_TYPE_BUILTIN = 1;
export const TEMPLATE_TYPE_CUSTOM = 2;
/** 模板类型:0 系统内置,1 自定义(与后端 templateType 一致) */
export const TEMPLATE_TYPE_BUILTIN = 0;
export const TEMPLATE_TYPE_CUSTOM = 1;
export const TEMPLATE_TYPE_OPTIONS = [
  { value: TEMPLATE_TYPE_BUILTIN, label: "系统内置" },
src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js
@@ -14,7 +14,9 @@
export { TEMPLATE_TYPE_OPTIONS };
export function templateTypeLabel(type) {
  return TEMPLATE_TYPE_OPTIONS.find((x) => x.value === type)?.label || "—";
  if (type == null || type === "") return "—";
  const n = Number(type);
  return TEMPLATE_TYPE_OPTIONS.find((x) => x.value === n)?.label || "—";
}
/** 节点内审批方式:会签 / 或签 */
@@ -162,7 +164,7 @@
    description: row.description || "",
    enabled: mapEnabledFromApi(row.enabled),
    enabledRaw: row.enabled,
    templateType: row.templateType,
    templateType: row.templateType != null ? Number(row.templateType) : undefined,
    formConfig: row.formConfig,
    formConfigData: parseFormConfigToData(row.formConfig),
    createdUser: row.createdUser,
@@ -210,15 +212,14 @@
  return dto;
}
/** 构建分页查询参数 */
export function buildApprovalTemplateListParams({ page, searchForm }) {
export function buildApprovalTemplateListParams({ page, searchForm, templateType = TEMPLATE_TYPE_CUSTOM }) {
  const params = {
    current: page.current,
    size: page.size,
    templateType: searchForm?.templateType != null && searchForm.templateType !== ""
      ? searchForm.templateType
      : templateType,
  };
  if (searchForm?.templateType != null && searchForm.templateType !== "") {
    params.templateType = searchForm.templateType;
  }
  const kw = (searchForm?.keyword || "").trim();
  if (kw) params.templateName = kw;
  if (searchForm?.enabledOnly) params.enabled = "1";