Files
dacli/docs/archive/jnpf-browser-automation/scripts/controls_config.json
T

443 lines
11 KiB
JSON

{
"version": "v2",
"date": "2026-06-17",
"appCode": "tdd",
"parentMenuId": "836650888410965189",
"targetTable": "spike_dm2",
"formPrefix": "tddCtrl",
"dacliFallback": true,
"injectMode": true,
"controls": [
{
"jnpfKey": "input",
"label": "单行输入",
"fieldName": "f_title",
"fieldLabel": "标题",
"required": false,
"configSchema": {},
"userEnd": {
"fillSelector": ".ant-modal input.ant-input",
"fillMethod": "press_sequentially",
"fillValue": "ctrl input 测试"
}
},
{
"jnpfKey": "textarea",
"label": "多行输入",
"fieldName": "f_desc",
"fieldLabel": "描述",
"required": false,
"configSchema": {
"autoSize": {
"minRows": 4,
"maxRows": 4
}
},
"userEnd": {
"fillSelector": ".ant-modal textarea",
"fillMethod": "press_sequentially",
"fillValue": "textarea line1\\nline2 测试"
}
},
{
"jnpfKey": "inputNumber",
"label": "数字输入",
"fieldName": "f_qty",
"fieldLabel": "数量",
"required": false,
"configSchema": {
"min": 0,
"max": 9999,
"precision": 0
},
"userEnd": {
"fillSelector": ".ant-modal .ant-input-number-input",
"fillMethod": "press_sequentially",
"fillValue": "100"
}
},
{
"jnpfKey": "select",
"label": "下拉选择",
"fieldName": "f_status",
"fieldLabel": "状态",
"required": false,
"configSchema": {
"options": [
{
"label": "待处理",
"value": "1"
},
{
"label": "处理中",
"value": "2"
},
{
"label": "已完成",
"value": "3"
}
]
},
"userEnd": {
"fillSelector": ".ant-modal .ant-select",
"fillMethod": "select_option",
"fillValue": "待处理"
}
},
{
"jnpfKey": "radio",
"label": "单选框组",
"fieldName": "f_priority",
"fieldLabel": "优先级",
"required": false,
"configSchema": {
"options": [
{
"label": "高",
"value": "1"
},
{
"label": "中",
"value": "2"
},
{
"label": "低",
"value": "3"
}
]
},
"userEnd": {
"fillSelector": ".ant-modal .ant-radio-wrapper",
"fillMethod": "click_radio",
"fillValue": "高"
}
},
{
"jnpfKey": "checkbox",
"label": "多选框组",
"fieldName": "f_tags",
"fieldLabel": "标签",
"required": false,
"configSchema": {
"options": [
{
"label": "紧急",
"value": "1"
},
{
"label": "重要",
"value": "2"
},
{
"label": "一般",
"value": "3"
}
]
},
"userEnd": {
"fillSelector": ".ant-modal .ant-checkbox-wrapper",
"fillMethod": "click_checkbox",
"fillValue": [
"紧急",
"重要"
]
}
},
{
"jnpfKey": "switch",
"label": "开关",
"fieldName": "f_enabled",
"fieldLabel": "是否启用",
"required": false,
"configSchema": {},
"userEnd": {
"fillSelector": ".ant-modal .ant-switch",
"fillMethod": "click_switch",
"fillValue": true
}
},
{
"jnpfKey": "datePicker",
"label": "日期选择",
"fieldName": "f_deadline",
"fieldLabel": "截止日期",
"required": false,
"configSchema": {
"format": "yyyy-MM-dd"
},
"userEnd": {
"fillSelector": ".ant-modal .ant-picker input",
"fillMethod": "date_picker",
"fillValue": "today+1"
}
},
{
"jnpfKey": "timePicker",
"label": "时间选择",
"fieldName": "f_remind_time",
"fieldLabel": "提醒时间",
"required": false,
"configSchema": {
"format": "HH:mm"
},
"userEnd": {
"fillSelector": ".ant-modal .ant-picker input",
"fillMethod": "time_picker",
"fillValue": "10:30"
}
},
{
"jnpfKey": "cascader",
"label": "级联选择",
"fieldName": "f_region",
"fieldLabel": "地区",
"required": false,
"configSchema": {
"options": [
{
"value": "1",
"label": "北京市",
"children": [
{
"value": "101",
"label": "北京市",
"children": [
{
"value": "10101",
"label": "东城区"
}
]
}
]
}
]
},
"userEnd": {
"fillSelector": ".ant-modal .ant-cascader-picker",
"fillMethod": "cascader",
"fillValue": [
"北京市",
"北京市",
"东城区"
]
}
},
{
"jnpfKey": "colorPicker",
"label": "颜色选择",
"fieldName": "f_color",
"fieldLabel": "颜色",
"required": false,
"configSchema": {
"colorFormat": "hex",
"showAlpha": false
},
"userEnd": {
"fillSelector": ".ant-modal .ant-color-picker-trigger",
"fillMethod": "click_color_picker",
"fillValue": "#1890ff"
}
},
{
"jnpfKey": "rate",
"label": "评分",
"fieldName": "f_score",
"fieldLabel": "评分",
"required": false,
"configSchema": {
"count": 5,
"allowHalf": false
},
"userEnd": {
"fillSelector": ".ant-modal .ant-rate",
"fillMethod": "click_rate_star",
"fillValue": 4
}
},
{
"jnpfKey": "slider",
"label": "滑块",
"fieldName": "f_progress",
"fieldLabel": "进度",
"required": false,
"configSchema": {
"min": 0,
"max": 100,
"step": 1
},
"userEnd": {
"fillSelector": ".ant-modal .ant-slider",
"fillMethod": "click_slider_rail",
"fillValue": 60
}
},
{
"jnpfKey": "treeSelect",
"label": "下拉树形",
"fieldName": "f_dept",
"fieldLabel": "部门",
"required": false,
"configSchema": {
"options": [
{
"value": "1",
"label": "技术部",
"children": [
{
"value": "11",
"label": "前端组"
},
{
"value": "12",
"label": "后端组"
}
]
},
{
"value": "2",
"label": "产品部",
"children": [
{
"value": "21",
"label": "产品组"
}
]
}
],
"props": {
"label": "label",
"value": "value",
"children": "children"
},
"multiple": false
},
"userEnd": {
"fillSelector": ".ant-modal .ant-select.ant-tree-select, .ant-modal .ant-tree-select",
"fillMethod": "click_tree_select",
"fillValue": "技术部"
}
},
{
"jnpfKey": "uploadImg",
"label": "图片上传",
"fieldName": "f_avatar",
"fieldLabel": "头像",
"required": false,
"configSchema": {
"fileSize": 5,
"sizeUnit": "MB",
"limit": 3,
"accept": "image/*",
"buttonText": "上传图片",
"showType": "button"
},
"userEnd": {
"fillSelector": ".ant-modal input[type=file][accept^='image'], .ant-modal input[type=file]",
"fillMethod": "set_file_input_img",
"fillValue": "test.png"
}
},
{
"jnpfKey": "uploadFile",
"label": "文件上传",
"fieldName": "f_attachment",
"fieldLabel": "附件",
"required": false,
"configSchema": {
"fileSize": 10,
"sizeUnit": "MB",
"limit": 5,
"accept": "*/*",
"buttonText": "上传文件",
"showType": "button"
},
"userEnd": {
"fillSelector": ".ant-modal input[type=file]",
"fillMethod": "set_file_input_file",
"fillValue": "test.txt"
}
},
{
"jnpfKey": "relationForm",
"label": "关联表单",
"fieldName": "f_link_id",
"fieldLabel": "关联单据",
"required": false,
"configSchema": {
"modelId": "",
"relationField": "f_name",
"placeholder": "请选择关联单据",
"hasPage": false,
"pageSize": 20,
"columnOptions": [
{
"label": "名称",
"value": "f_name",
"width": 200
},
{
"label": "编码",
"value": "f_code",
"width": 150
}
]
},
"userEnd": {
"fillSelector": ".ant-modal .jnpf-relation-form-trigger, .ant-modal .relation-form-trigger",
"fillMethod": "click_relation_form_popup",
"fillValue": null
}
},
{
"jnpfKey": "userSelect",
"label": "用户选择",
"fieldName": "f_assignee",
"fieldLabel": "负责人",
"required": false,
"configSchema": {
"ableRelation": false,
"multiple": true,
"selectType": "all"
},
"userEnd": {
"fillSelector": ".ant-modal .jnpf-user-select, .ant-modal .user-select-trigger",
"fillMethod": "click_user_select_popup",
"fillValue": [
"管理员"
]
}
},
{
"jnpfKey": "organizeSelect",
"label": "组织选择",
"fieldName": "f_org",
"fieldLabel": "所属组织",
"required": false,
"configSchema": {
"ableRelation": false,
"multiple": false,
"selectType": "department"
},
"userEnd": {
"fillSelector": ".ant-modal .jnpf-organize-select, .ant-modal .organize-select-trigger",
"fillMethod": "click_organize_select_popup",
"fillValue": "技术部"
}
},
{
"jnpfKey": "editor",
"label": "富文本",
"fieldName": "f_content",
"fieldLabel": "内容",
"required": false,
"configSchema": {
"placeholder": "请输入内容"
},
"userEnd": {
"fillSelector": ".ant-modal .jnpf-editor-content, .ant-modal [contenteditable=true]",
"fillMethod": "editor_input",
"fillValue": "<p>富文本测试内容, 含 <strong>加粗</strong> 和换行<br/>第二行</p>"
}
}
]
}