For vue2 projects, use @94ai/common-ui
LLMs.md

nf-rules ​

Rule editor for intention/personal/custom tags, reply keywords, import/call/current time, duration, dialogue rounds, call count, parameters and call status. Chinese enum exports, remapping, merge strategies, per-field disabling and form validation are retained.

Examples ​

Add rules ​

Loading example…
Add rules

Restore rules ​

Loading example…
Restore rules

Disabled items ​

Loading example…
Disabled items

Custom enums ​

Loading example…
Custom enums

Custom external form ​

Loading example…
Custom external form

Props ​

Text props follow the library language when omitted; defaults below use this language.

ParameterDescriptionTypeOptionsDefault
rulesRule data for display and retrieval; keep the array mutable.RuleItem[]—undefined
showRuleTypesAllowed rule types: enum values, original Chinese names or localized labels; an empty array allows all.(string | number)[]—[]
defaultAddDataDefault data object when adding a rule.RuleItem—undefined
defaultAddTypeDefault rule type when adding a rule.string | number—undefined
initAddDataInitialize an entry when data is absent or empty.boolean—true
sizeControl size; mini maps to small and medium to default.stringmini / small / medium / default / large'mini'
tagCustom form container tag; use div inside an external form to avoid nested forms.string—'el-form'
validPrefixCustom prefix for form validation paths.string—''
rulesKeyCustom data field name.string—'rules'
limitMaximum number of entries; 0 means unlimited.number—0
disabledWhether to disable the component.boolean—false
conditionDisabledDisable the rule-type selector.boolean—false
hiddenAddHide the add action.boolean—false
hiddenReduceHide the remove action.boolean—false
disablesDisable controls by rule type; array entries follow the controls in that rule.Record<string, boolean[]>—undefined
showMessageWhether to show validation error messages.boolean—true
inlineMessageDisplay validation messages inline.boolean—false
statusIconWhether to show validation status icons.boolean—false
规则类型Customize enum values for 规则类型; defaults to the exported enum with the same name.Record<string, string | number>—规则类型
规则类型下拉Customize 规则类型下拉 data for localization or custom dropdown options.DropDownItem[]—undefined
规则类型下拉合并策略Merge strategy for 规则类型下拉: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
操作类型Customize enum values for 操作类型; defaults to the exported enum with the same name.Record<string, string | number>—操作类型
操作类型下拉Customize 操作类型下拉 data for localization or custom dropdown options.DropDownItem[]—undefined
操作类型下拉合并策略Merge strategy for 操作类型下拉: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
计算类型Customize enum values for 计算类型; defaults to the exported enum with the same name.Record<string, string | number>—计算类型
计算类型下拉Customize 计算类型下拉 data for localization or custom dropdown options.DropDownItem[]—undefined
计算类型下拉合并策略Merge strategy for 计算类型下拉: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
日期类型Customize enum values for 日期类型; defaults to the exported enum with the same name.Record<string, string | number>—日期类型
日期类型下拉Customize 日期类型下拉 data for localization or custom dropdown options.DropDownItem[]—undefined
日期类型下拉合并策略Merge strategy for 日期类型下拉: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
外呼状态Customize enum values for 外呼状态; defaults to the exported enum with the same name.Record<string, string | number>—外呼状态
外呼状态下拉Customize 外呼状态下拉 data for localization or custom dropdown options.DropDownItem[]—undefined
外呼状态下拉合并策略Merge strategy for 外呼状态下拉: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
意向标签集合Customize 意向标签集合 data for localization or custom dropdown options.DropDownItem[]—undefined
意向标签集合合并策略Merge strategy for 意向标签集合: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
logicMergeDescCustomize the “and” text.string—and
placeholderCustomize the “Please select” text.string—Please select
numberRequireDescCustomize the “Please enter a number” text.string—Please enter a number
commonLenLimitDescCustomize the “Total length cannot exceed 2000 Chinese characters” text.string—Total length cannot exceed 2000 Chinese characters
placeEnterCustomize the “Please enter” text.string—Please enter
prohibitEmptyDescCustomize the “Cannot be empty” text.string—Cannot be empty
paramsLenLimitDescCustomize the “Up to 50 English characters” text.string—Up to 50 English characters
splitDescCustomize the “Separate multiple entries with #” text.string—Separate multiple entries with #
timesCustomize the “times” text.string—times
secondCustomize the “s” text.string—s
startPlaceholderDateCustomize the “Start date” text.string—Start date
endPlaceholderDateCustomize the “End date” text.string—End date
startPlaceholderTimeCustomize the “Start time” text.string—Start time
endPlaceholderTimeCustomize the “End time” text.string—End time
timePickerPlaceholderCustomize the “Select time range” text.string—Select time range
datePickerPlaceholderCustomize the “Select date range” text.string—Select date range
rangeSeparatorDescCustomize the “→” text.string—→

Events ​

EventDescriptionPayload
onChangeFires when collected rule data changes.(plan: Record<string, RuleItem[]>)
addRuleFires when a rule is added; returns the added object.(rule: RuleItem)
reduceRuleFires when a rule is removed; returns the removed object.(rule: RuleItem)

Slots ​

No custom slots.

Exposed methods and state ​

  • plan
  • nfRulesForm
  • ruleContainer
  • intents
  • ruleTypesPlace
  • operatorTypesPlace
  • calculationMethodPlace
  • dateOptionsTypePlace
  • outboundCallStatusPlace
  • showRuleTypesPlace
  • intentsOperatorTypes
  • commonOperatorTypes
  • ruleMap
  • disablesRecord
  • addRule(type?)
  • removeRule(index)
  • getRule(type, subType?)
  • changeRule(type, index, subType?)
  • operatorSelectChange(type, index, operator?)

Migration notes ​

Vue 3 uses modelValue / update:modelValue; legacy value, update:value and input remain available on selection components. The implementation uses public Element Plus APIs, not Element UI internals. mini maps to small; medium maps to default.

tag="div" + validPrefix integrates into a parent Element Plus Form. Date/time ranges accept Date arrays. Numeric zero is valid. Dropdown merge strategies do not mutate incoming arrays.