| | |
| | | } from "./approveTemplateConstants.js"; |
| | | import { parseFormConfigToData } from "./formConfigUtils.js"; |
| | | |
| | | const LEGACY_STORAGE_KEY = "oa_approve_template_custom_v1"; |
| | | |
| | | const FALLBACK_TEMPLATE_TYPE_OPTIONS = [ |
| | | { value: 0, label: "系统内置" }, |
| | | { value: 1, label: "自定义" }, |
| | |
| | | ); |
| | | } |
| | | |
| | | function clearLegacyStorage() { |
| | | try { |
| | | localStorage.removeItem(LEGACY_STORAGE_KEY); |
| | | } catch { |
| | | /* ignore */ |
| | | } |
| | | } |
| | | |
| | | export function useApproveTemplate() { |
| | | clearLegacyStorage(); |
| | | |
| | | const templateTypeOptions = ref([...FALLBACK_TEMPLATE_TYPE_OPTIONS]); |
| | | |
| | | function templateTypeLabel(type) { |
| | |
| | | ), |
| | | enabled: row.enabled !== false, |
| | | flowNodes: JSON.parse(JSON.stringify(row.flowNodes || [base.flowNodes[0]])), |
| | | storageBlobDTOs: JSON.parse(JSON.stringify(row.storageBlobDTOs || [])), |
| | | }); |
| | | } |
| | | |