v13-f1 Task 1.7: uploadFile + uploadImg 0 误差 (uploadFile 9 sample 对齐)

- UploadFileFieldBuilder: 36 字段 (17 顶层 + 19 __config__), baseline 9 sample 100% 覆盖关键键
- UploadImgFieldBuilder: 36 字段 (16 顶层 + 20 __config__), componentMap 镜像 (无 accept/isAccount, showType=card)
- SPI 注册 2 行, Test 8 个 8/8 PASS, 累计 28/28
- renderKey 加回 (baseline 9/9 = long timestamp, JNPF runtime 同步需要)
- 盲点 33 TODO: uploadImg 真实 baseline 缺, 待 tds form 扫描时重对齐
This commit is contained in:
ssw committed 2026-06-11 21:40:56 +08:00
1 parent c5383f978f
commit 405327d11e
11 files changed
+550

No files matched your search

@@ -0,0 +1 @@
{"__config__":{"formId":"formItem1781185194988","jnpfKey":"uploadFile","label":"附件","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfUploadFile","tagIcon":"icon-ym icon-ym-generator-upload","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781185194988,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"disabled":false,"accept":"","fileSize":10,"sizeUnit":"MB","buttonText":"点击上传","limit":9,"pathType":"defaultPath","sortRule":[],"timeFormat":"YYYY","folder":"","tipText":"","showType":"button","__vModel__":"f_attachment","isAccount":0,"id":"f_attachment"}
@@ -0,0 +1 @@
{"__config__":{"formId":"formItem1781185195010","jnpfKey":"uploadImg","label":"头像","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfUploadImg","tagIcon":"icon-ym icon-ym-generator-upload","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781185195010,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"disabled":false,"fileSize":10,"sizeUnit":"MB","buttonText":"点击上传","limit":9,"pathType":"defaultPath","sortRule":[],"timeFormat":"YYYY","folder":"","tipText":"","showType":"card","__vModel__":"f_avatar","id":"f_avatar"}
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env python3
"""从 35 form baseline 提取所有 uploadFile 控件的 formData 真实样本.
uploadFile 控件判定: __config__.jnpfKey == 'uploadFile'."""
import json, glob, os
OUT = "scripts/uploadFile-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') == 'uploadFile':
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)} uploadFile 控件 samples to {OUT}")
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env python3
"""从 35 form baseline 提取所有 uploadImg 控件的 formData 真实样本.
uploadImg 控件判定: __config__.jnpfKey == 'uploadImg'."""
import json, glob, os
OUT = "scripts/uploadImg-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') == 'uploadImg':
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)} uploadImg 控件 samples to {OUT}")
@@ -0,0 +1,9 @@
{"source": "833722857270812549.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}}
{"source": "833723220895997829.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}}
{"source": "833724748268576645.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}}
{"source": "623417538411233285.json", "label": "文件交接", "formData": {"buttonText": "点击上传", "pathType": "defaultPath", "accept": "", "__config__": {"formId": "formItem567e4d", "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "文件交接", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt623417550885093381", "renderKey": 1730770641994, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "tableAlign": "left", "span": 24}, "folder": "", "fileSize": 10, "sortRule": [], "timeFormat": "YYYY", "limit": 9, "__vModel__": "uploadFileField567e4d", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}}
{"source": "833721891595231109.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}}
{"source": "833723449187770245.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}}
{"source": "623425065425305605.json", "label": "合同附件", "formData": {"buttonText": "点击上传", "pathType": "defaultPath", "accept": "", "__config__": {"formId": "formItemb4e26c", "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "合同附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt623425084727492613", "renderKey": 1730772435424, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "tableAlign": "left", "span": 24}, "folder": "", "fileSize": 10, "sortRule": [], "timeFormat": "YYYY", "limit": 9, "__vModel__": "uploadFileFieldb4e26c", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}}
{"source": "833723152176521093.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}}
{"source": "833722442491895685.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}}
Whitespace-only changes.