v13-f1 Task 1.8: relationForm 0 误差 (P0 两阶段, 前端代码反推)

This commit is contained in:
ssw committed 2026-06-11 21:46:20 +08:00
1 parent 405327d11e
commit 4b29146696
6 files changed
+360

No files matched your search

@@ -0,0 +1 @@
{"__config__":{"formId":"formItem1781185555079","jnpfKey":"relationForm","label":"关联表单","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfRelationForm","tagIcon":"icon-ym icon-ym-generator-menu","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781185555080,"transferList":[]},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","modelId":"form123","relationField":"f_name","hasPage":false,"pageSize":20,"queryType":0,"propsValue":"f_id","extraOptions":[],"columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"名称"}],"clearable":true,"popupType":"dialog","popupTitle":"选择数据","popupWidth":"800px","filterable":false,"disabled":false,"__vModel__":"f_relate","id":"f_relate","multiple":false,"actionType":"table"}
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env python3
"""从 35 form baseline 提取所有 relationForm 控件的 formData 真实样本.
relationForm 控件判定: __config__.jnpfKey == 'relationForm'."""
import json, glob, os
OUT = "scripts/relationForm-baseline-samples.jsonl"
samples = []
for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"):
try:
d = json.load(open(path))['data']
fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {}
for f in fd.get('fields', []):
if isinstance(f, dict):
cfg = f.get('__config__', {})
if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'relationForm':
samples.append({
"source": os.path.basename(path),
"label": f.get('label') or cfg.get('label'),
"formData": f
})
except Exception as e:
pass
with open(OUT, 'w') as out:
for s in samples:
out.write(json.dumps(s, ensure_ascii=False) + "\n")
print(f"Extracted {len(samples)} relationForm 控件 samples to {OUT}")
Whitespace-only changes.