ERP-node/frontend/components/screen/templates/NumberingRuleTemplate.ts

82 lines
1.8 KiB
TypeScript

/**
* 채번 규칙 템플릿
* 화면관리 시스템에 등록하여 드래그앤드롭으로 사용
*/
import { Hash } from "lucide-react";
export const getDefaultNumberingRuleConfig = () => ({
template_code: "numbering-rule-designer",
template_name: "코드 채번 규칙",
template_name_eng: "Numbering Rule Designer",
description: "코드 자동 채번 규칙을 설정하는 컴포넌트",
category: "admin" as const,
icon_name: "hash",
default_size: {
width: 1200,
height: 800,
},
layout_config: {
components: [
{
type: "numbering-rule" as const,
label: "채번 규칙 설정",
position: { x: 0, y: 0 },
size: { width: 1200, height: 800 },
ruleConfig: {
ruleId: "new-rule",
ruleName: "새 채번 규칙",
parts: [],
separator: "-",
resetPeriod: "none",
currentSequence: 1,
},
maxRules: 6,
style: {
padding: "16px",
backgroundColor: "#ffffff",
},
},
],
},
});
/**
* 템플릿 패널에서 사용할 컴포넌트 정보
*/
export const numberingRuleTemplate = {
id: "numbering-rule",
name: "채번 규칙",
description: "코드 자동 채번 규칙 설정",
category: "admin" as const,
icon: Hash,
defaultSize: { width: 1200, height: 800 },
components: [
{
type: "numbering-rule" as const,
widgetType: undefined,
label: "채번 규칙 설정",
position: { x: 0, y: 0 },
size: { width: 1200, height: 800 },
style: {
padding: "16px",
backgroundColor: "#ffffff",
},
ruleConfig: {
ruleId: "new-rule",
ruleName: "새 채번 규칙",
parts: [],
separator: "-",
resetPeriod: "none",
currentSequence: 1,
},
maxRules: 6,
},
],
};