Commit 489c989c authored by 田翔's avatar 田翔

fix: 关联表单计算监听逻辑添加

parent ed3ea722
export const options1 = {
groups: [
export const schemaValues = {
"child": {
"tableName": null,
"keyName": null,
"childDatas": []
},
"values": [
{
"groupName": "(未分组)",
"schema": [
"fieldName": "工单编号",
"fieldValue": "RYWX00000497",
"showValue": "RYWX00000497"
},
{
"tableName": "台账_形态测试表",
"fieldName": "ID",
"alias": "ID",
"uiGroup": "(未分组)",
"tableGroup": null,
"type": "数值",
"shape": "文本",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "number",
"allowCorrect": 0,
"order": 1,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "是否为工作日",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "录入时间",
"alias": "录入时间",
"uiGroup": "(未分组)",
"tableGroup": null,
"type": "时间",
"shape": "时间",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "",
"allowCorrect": 0,
"order": 2,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "派单提交时间",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "是否删除",
"alias": "是否删除",
"uiGroup": "(未分组)",
"tableGroup": null,
"type": "数值",
"shape": "文本",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "number",
"allowCorrect": 0,
"order": 3,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "服务人员",
"fieldValue": "张建开",
"showValue": "张建开"
},
{
"tableName": "台账_形态测试表",
"fieldName": "所属站点",
"alias": "所属站点",
"uiGroup": "(未分组)",
"tableGroup": null,
"type": "文本",
"shape": "文本",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 4,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
}
],
"visible": 1
"fieldName": "实收费用",
"fieldValue": "7.1234",
"showValue": "7.1234"
},
{
"groupName": "文本类",
"schema": [
"fieldName": "派单状态数字",
"fieldValue": "71.234",
"showValue": "71.234"
},
{
"tableName": "台账_形态测试表",
"fieldName": "文本",
"alias": "文本",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "文本",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 5,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "是否接单",
"fieldValue": "是",
"showValue": "是"
},
{
"tableName": "台账_形态测试表",
"fieldName": "唯一值文本",
"alias": "唯一值文本",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "唯一值文本",
"unit": "",
"configInfo": "台账_形态测试表.唯一值文本",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:100",
"allowCorrect": 0,
"order": 6,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "恢复状态数字",
"fieldValue": "2023-02-01 17:47:50",
"showValue": "2023-02-01 17:47:50"
},
{
"tableName": "台账_形态测试表",
"fieldName": "多行文本",
"alias": "多行文本",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "多行文本",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 6,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 7,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "接单提交时间",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "本人部门",
"alias": "本人部门",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "本人部门",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 8,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "纬度",
"fieldValue": "0",
"showValue": "0"
},
{
"tableName": "台账_形态测试表",
"fieldName": "本人姓名",
"alias": "本人姓名",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "本人姓名",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 9,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "现场是否需要恢复",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "数值",
"alias": "数值",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "数值",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 10,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "是否收费",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "地址",
"alias": "地址",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "地址",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 11,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "管道资产",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "设备二维码",
"alias": "设备二维码",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "设备二维码",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 12,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "分支环节2",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "本人ID",
"alias": "本人ID",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "本人ID",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 13,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "维修费用比例",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "富文本",
"alias": "富文本",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "富文本",
"unit": "",
"configInfo": "",
"presetValue": "富文本默认值",
"rowSpan": 1,
"colSpan": 6,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 14,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "维修开始时间",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "编码",
"alias": "编码",
"uiGroup": "文本类",
"tableGroup": null,
"type": "文本",
"shape": "编码",
"unit": "",
"configInfo": "一般编码.EGJZ",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 1,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 15,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
}
],
"visible": 1
"fieldName": "维修提交时间",
"fieldValue": "",
"showValue": ""
},
{
"groupName": "选择器类",
"schema": [
"fieldName": "维修状态数字",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "选择器",
"alias": "选择器",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "选择器",
"unit": "",
"configInfo": "维修工单反映区名",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 16,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "经度",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "选择器_关联选择器父",
"alias": "选择器_关联选择器父",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "选择器",
"unit": "",
"configInfo": "维修工单上报类型",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:25",
"allowCorrect": 0,
"order": 17,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "打开阀门位置及大小",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "选择器_关联选择器子",
"alias": "选择器_关联选择器子",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "选择器",
"unit": "",
"configInfo": "选择器_关联选择器父.维修工单上报内容",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:25",
"allowCorrect": 0,
"order": 18,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "分支环节1",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "搜索选择器",
"alias": "搜索选择器",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "搜索选择器",
"unit": "",
"configInfo": "维修工单反映区名.n",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 19,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "确认当前位置",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "值选择器",
"alias": "值选择器",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "值选择器",
"unit": "",
"configInfo": "测试1,测试2,测试3,测试4",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 20,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "现场情况",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "值复选器",
"alias": "值复选器",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "值复选器",
"unit": "",
"configInfo": "test1,test2,test3,test4,test5",
"presetValue": "test5",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 21,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "是否关阀",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "业务选择器",
"alias": "业务选择器",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "业务选择器",
"unit": "",
"configInfo": "台账_形态测试表.唯一值文本.n",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 22,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "无需维修原因",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "可编辑值选择器",
"alias": "可编辑值选择器",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "可编辑值选择器",
"unit": "",
"configInfo": "demo1,demo2,demo3,demo4,demo5",
"presetValue": "demo3",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 23,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "维修管径_DN",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "平铺值选择器",
"alias": "平铺值选择器",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "平铺值选择器",
"unit": "",
"configInfo": "事件,工单",
"presetValue": "事件,工单",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 24,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "关闭阀门位置及大小",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "站点选择器",
"alias": "站点选择器",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "站点选择器",
"unit": "",
"configInfo": "全部.n",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 25,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "处理前图片",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "人员选择器_下拉框",
"alias": "人员选择器_下拉框",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "人员选择器",
"unit": "",
"configInfo": "平台管理员.n",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:25",
"allowCorrect": 0,
"order": 26,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "处理后照片",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "人员选择器_分组模态",
"alias": "人员选择器_分组模态",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "人员选择器",
"unit": "",
"configInfo": "全部.管理员.n",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:25",
"allowCorrect": 0,
"order": 27,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "维修材料清单",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "城市选择器",
"alias": "城市选择器",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "城市选择器",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 28,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "缴费照片留存",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "台账选择器",
"alias": "台账选择器",
"uiGroup": "选择器类",
"tableGroup": null,
"type": "文本",
"shape": "台账选择器",
"unit": "",
"configInfo": "形态测试台账.唯一值文本.n",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"allowCorrect": 0,
"order": 29,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEventFields": "",
"showCss": "中"
"fieldName": "备注",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "恢复前照片",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "恢复提交时间",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "是否已恢复",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "恢复后照片",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "恢复费用要素",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "恢复使用材料拍照",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "恢复费用",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "维修费用要素",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "计算费用",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "派单耗时",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "接单耗时",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "维修耗时",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "恢复耗时",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "派单耗时_分",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "接单耗时_分",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "维修耗时_分",
"fieldValue": "",
"showValue": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "部门选择器",
"alias": "部门选择器",
"uiGroup": "选择器类",
"fieldName": "恢复耗时_分",
"fieldValue": "",
"showValue": ""
},
{
"fieldName": "事件编号",
"fieldValue": "",
"showValue": ""
}
],
"modules": [],
"relationForm": {
"configs": [],
"data": []
},
"groups": [
{
"groupName": "维修派单",
"schema": [
{
"tableName": "工单_维修填报",
"fieldName": "派单提交时间",
"alias": "派单提交时间",
"uiGroup": "维修派单",
"tableGroup": null,
"type": "文本",
"shape": "部门选择器",
"shape": "日期时间",
"unit": "",
"configInfo": "",
"presetValue": "部门选择器默认",
"configInfo": "默认为当前时间",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:25",
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 30,
"order": 102,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
}
],
"visible": 1
"showCss": "大"
},
{
"groupName": "附件类",
"schema": [
{
"tableName": "台账_形态测试表",
"fieldName": "附件",
"alias": "附件",
"uiGroup": "附件类",
"tableName": "工单_维修填报",
"fieldName": "服务人员",
"alias": "服务人员",
"uiGroup": "维修派单",
"tableGroup": null,
"type": "文本",
"shape": "附件",
"shape": "设备二维码",
"unit": "",
"configInfo": "",
"presetValue": "",
"presetValue": "张建开",
"rowSpan": 1,
"colSpan": 6,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"validateRule": "maxLength:200,maxlength:50",
"allowCorrect": 0,
"order": 31,
"order": 103,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "可预览附件",
"alias": "可预览附件",
"uiGroup": "附件类",
"tableName": "工单_维修填报",
"fieldName": "实收费用",
"alias": "实收费用",
"uiGroup": "维修派单",
"tableGroup": null,
"type": "文本",
"shape": "可预览附件",
"shape": "数值",
"unit": "",
"configInfo": "",
"presetValue": "",
"presetValue": "0",
"rowSpan": 1,
"colSpan": 6,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 32,
"order": 104,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "图片",
"alias": "图片",
"uiGroup": "附件类",
"tableName": "工单_维修填报",
"fieldName": "派单状态数字",
"alias": "总费用",
"uiGroup": "维修派单",
"tableGroup": null,
"type": "文本",
"shape": "图片",
"shape": "自动计算",
"unit": "",
"configInfo": "拍照相册",
"configInfo": "{\"calculateRule\":\"{工单_维修填报.实收费用}*10\",\"rules\":[{\"tableName\":\"工单_维修填报\",\"fields\":[\"实收费用\"]}]}",
"presetValue": "",
"rowSpan": 1,
"colSpan": 6,
"readOnly": 0,
"validateRule": "maxlength:127",
"colSpan": 1,
"readOnly": 1,
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 33,
"order": 105,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
"showCss": "大"
}
],
"visible": 1
},
{
"tableName": "台账_形态测试表",
"fieldName": "可预览图片",
"alias": "可预览图片",
"uiGroup": "附件类",
"groupName": "维修接单",
"schema": [
{
"tableName": "工单_维修填报",
"fieldName": "是否接单",
"alias": "是否接单",
"uiGroup": "维修接单",
"tableGroup": null,
"type": "文本",
"shape": "可预览图片",
"shape": "平铺值选择器",
"unit": "",
"configInfo": "拍照相册",
"presetValue": "",
"configInfo": "是,否",
"presetValue": "",
"rowSpan": 1,
"colSpan": 6,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"validateRule": "required,maxlength:50",
"allowCorrect": 0,
"order": 34,
"order": 200,
"visible": 1,
"isSync": 0,
"isSync": 1,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "录音",
"alias": "录音",
"uiGroup": "附件类",
"tableName": "工单_维修填报",
"fieldName": "恢复状态数字",
"alias": "接单结束时间",
"uiGroup": "维修接单",
"tableGroup": null,
"type": "文本",
"shape": "录音",
"shape": "日期时间",
"unit": "",
"configInfo": "",
"configInfo": "默认为空",
"presetValue": "",
"rowSpan": 1,
"colSpan": 6,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 35,
"order": 201,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "视频",
"alias": "视频",
"uiGroup": "附件类",
"tableName": "工单_维修填报",
"fieldName": "纬度",
"alias": "接单用时",
"uiGroup": "维修接单",
"tableGroup": null,
"type": "文本",
"shape": "视频",
"shape": "自动计算",
"unit": "",
"configInfo": "",
"configInfo": "{\"calculateRule\":\"$sql.datediff(day,{工单_维修填报.恢复状态数字},{工单_维修填报.派单提交时间})\",\"rules\":[{\"tableName\":\"工单_维修填报\",\"fields\":[\"恢复状态数字\",\"派单提交时间\"]}]}",
"presetValue": "",
"rowSpan": 1,
"colSpan": 6,
"readOnly": 0,
"validateRule": "maxlength:127",
"colSpan": 1,
"readOnly": 1,
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 36,
"order": 203,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
}
],
"visible": 1
},
{
"groupName": "时间类",
"groupName": "维修内容",
"schema": [
{
"tableName": "台账_形态测试表",
"fieldName": "日期时间",
"alias": "日期时间",
"uiGroup": "时间类",
"tableName": "工单_维修填报",
"fieldName": "现场是否需要恢复",
"alias": "现场是否需要恢复",
"uiGroup": "维修内容",
"tableGroup": null,
"type": "文本",
"shape": "日期时间",
"shape": "平铺值选择器",
"unit": "",
"configInfo": "默认为当前时间",
"presetValue": "",
"configInfo": "不需要,需要",
"presetValue": "不需要",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:25",
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 37,
"order": 300,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "日期",
"alias": "日期",
"uiGroup": "时间类",
"tableName": "工单_维修填报",
"fieldName": "是否收费",
"alias": "是否收费",
"uiGroup": "维修内容",
"tableGroup": null,
"type": "文本",
"shape": "日期",
"shape": "平铺值选择器",
"unit": "",
"configInfo": "默认为当前时间",
"presetValue": "",
"configInfo": "否,是",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:25",
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 38,
"order": 301,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "日期月份",
"alias": "日期月份",
"uiGroup": "时间类",
"tableName": "工单_维修填报",
"fieldName": "管道资产",
"alias": "维修清单",
"uiGroup": "维修内容",
"tableGroup": null,
"type": "文本",
"shape": "日期月份",
"shape": "关联表单",
"unit": "",
"configInfo": "不超过当前时间",
"configInfo": "{\"台账名称\":\"维修清单\",\"默认显示\":false,\"控制规则\":\"{工单_维修填报.是否收费}== '是'\",\"映射字段\":[{\"fromField\":\"工单编号\",\"toField\":\"工单编号\"}]}",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"colSpan": 3,
"readOnly": 0,
"validateRule": "maxlength:25",
"validateRule": "maxlength:255",
"allowCorrect": 0,
"order": 39,
"order": 302,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "日期年份",
"alias": "日期年份",
"uiGroup": "时间类",
"tableName": "工单_维修填报",
"fieldName": "分支环节2",
"alias": "维修人力清单",
"uiGroup": "维修内容",
"tableGroup": null,
"type": "文本",
"shape": "日期年份",
"shape": "关联表单",
"unit": "",
"configInfo": "不超过当前时间",
"configInfo": "{\"台账名称\":\"维修人力使用\",\"默认显示\":false,\"控制规则\":\"{工单_维修填报.现场是否需要恢复}=='需要'\",\"映射字段\":[{\"fromField\":\"工单编号\",\"toField\":\"工单编号\"}]}",
"presetValue": "",
"rowSpan": 1,
"colSpan": 3,
"readOnly": 0,
"validateRule": "maxlength:255",
"allowCorrect": 0,
"order": 303,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "大"
},
{
"tableName": "工单_维修填报",
"fieldName": "维修费用比例",
"alias": "固定折扣",
"uiGroup": "维修内容",
"tableGroup": null,
"type": "数值",
"shape": "数值",
"unit": "",
"configInfo": "",
"presetValue": "0.8",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:25",
"validateRule": "",
"allowCorrect": 0,
"order": 40,
"order": 304,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
"showCss": "大"
}
],
"visible": 1
},
{
"tableName": "台账_形态测试表",
"fieldName": "日期周",
"alias": "日期周",
"uiGroup": "时间类",
"groupName": "自动计算",
"schema": [
{
"tableName": "工单_维修填报",
"fieldName": "维修开始时间",
"alias": "维修开始时间",
"uiGroup": "自动计算",
"tableGroup": null,
"type": "文本",
"shape": "日期",
"type": "时间",
"shape": "日期时间",
"unit": "",
"configInfo": "不超过当前时间",
"configInfo": "默认为空",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:25",
"validateRule": "",
"allowCorrect": 0,
"order": 41,
"order": 400,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "时分秒",
"alias": "时分秒",
"uiGroup": "时间类",
"tableName": "工单_维修填报",
"fieldName": "维修提交时间",
"alias": "维修结束时间",
"uiGroup": "自动计算",
"tableGroup": null,
"type": "文本",
"shape": "时分秒",
"shape": "日期时间",
"unit": "",
"configInfo": "不超过当前时间",
"configInfo": "默认为空",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:25",
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 42,
"order": 401,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
}
],
"visible": 1
"showCss": "大"
},
{
"groupName": "地图类",
"schema": [
{
"tableName": "台账_形态测试表",
"fieldName": "设备选择",
"alias": "设备选择",
"uiGroup": "地图类",
"tableName": "工单_维修填报",
"fieldName": "维修状态数字",
"alias": "物料核算费用",
"uiGroup": "自动计算",
"tableGroup": null,
"type": "文本",
"shape": "设备选择",
"shape": "自动计算",
"unit": "",
"configInfo": "",
"configInfo": "{\"calculateRule\":\"$sql.sum({维修清单.物料金额})*{工单_维修填报.维修费用比例}\",\"rules\":[{\"tableName\":\"维修清单\",\"fields\":[\"物料金额\"]},{\"tableName\":\"工单_维修填报\",\"fields\":[\"维修费用比例\"]}]}",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"readOnly": 1,
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 43,
"order": 402,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "坐标控件",
"alias": "坐标控件",
"uiGroup": "地图类",
"tableName": "工单_维修填报",
"fieldName": "打开阀门位置及大小",
"alias": "用工总费用",
"uiGroup": "自动计算",
"tableGroup": null,
"type": "文本",
"shape": "坐标控件",
"shape": "自动计算",
"unit": "",
"configInfo": "当前坐标",
"configInfo": "{\"calculateRule\":\"$sql.sum({维修人力使用.用工金额})\",\"rules\":[{\"tableName\":\"维修人力使用\",\"fields\":[\"用工金额\"]}]}",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"colSpan": 3,
"readOnly": 1,
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 44,
"order": 404,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "路径控件",
"alias": "路径控件",
"uiGroup": "地图类",
"tableName": "工单_维修填报",
"fieldName": "分支环节1",
"alias": "总费用",
"uiGroup": "自动计算",
"tableGroup": null,
"type": "文本",
"shape": "路径控件",
"shape": "自动计算",
"unit": "",
"configInfo": "",
"configInfo": "{\"calculateRule\":\"{工单_维修填报.打开阀门位置及大小}+{工单_维修填报.维修状态数字}\",\"rules\":[{\"tableName\":\"工单_维修填报\",\"fields\":[\"打开阀门位置及大小\",\"维修状态数字\"]}]}",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"readOnly": 1,
"validateRule": "maxlength:255",
"allowCorrect": 0,
"order": 46,
"order": 405,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
"showCss": "大"
}
],
"visible": 1
},
{
"tableName": "台账_形态测试表",
"fieldName": "位置坐标",
"alias": "位置坐标",
"uiGroup": "地图类",
"groupName": "维修处理",
"schema": [
{
"tableName": "工单_维修填报",
"fieldName": "确认当前位置",
"alias": "确认当前位置",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "位置坐标",
"shape": "坐标控件",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 47,
"order": 500,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "GIS编码",
"alias": "GIS编码",
"uiGroup": "地图类",
"tableName": "工单_维修填报",
"fieldName": "现场情况",
"alias": "现场情况",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "文本",
"shape": "值选择器",
"unit": "",
"configInfo": "",
"presetValue": "",
"configInfo": "表后维修,表前维系,无需维修",
"presetValue": "表后维修",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 1,
"validateRule": "maxlength:25",
"readOnly": 0,
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 48,
"order": 501,
"visible": 1,
"isSync": 0,
"isSync": 1,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "台账_形态测试表",
"fieldName": "GIS图层",
"alias": "GIS图层",
"uiGroup": "地图类",
"tableName": "工单_维修填报",
"fieldName": "是否关阀",
"alias": "是否关阀",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "文本",
"shape": "平铺值选择器",
"unit": "",
"configInfo": "",
"presetValue": "",
"configInfo": "是,否",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 1,
"validateRule": "maxlength:25",
"readOnly": 0,
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 49,
"order": 502,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
}
],
"visible": 1
"showCss": "大"
},
{
"groupName": "台账专有类",
"schema": [
{
"tableName": "台账_形态测试表",
"fieldName": "智能抄表",
"alias": "智能抄表",
"uiGroup": "台账专有类",
"tableName": "工单_维修填报",
"fieldName": "无需维修原因",
"alias": "无需维修原因",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "智能抄表",
"shape": "值选择器",
"unit": "",
"configInfo": "",
"presetValue": "",
"configInfo": "已现场处理,现场情况正常,不需要维修",
"presetValue": "已现场处理",
"rowSpan": 1,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 50,
"order": 503,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "(无)",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
}
],
"visible": 1
"showCss": "大"
},
{
"groupName": "",
"schema": [
{
"tableName": "台账_形态测试表",
"fieldName": "高级表单",
"alias": "高级表单",
"uiGroup": "",
"tableName": "工单_维修填报",
"fieldName": "维修管径_DN",
"alias": "维修管径_DN",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "关联表单",
"shape": "设备二维码",
"unit": "",
"configInfo": "{\"台账名称\":\"二供泵房\",\"默认显示\":true,\"控制规则\":\"\",\"映射字段\":[{\"fromField\":\"工单编号\",\"toField\":\"设备分类\"}]}",
"presetValue": "",
"configInfo": "",
"presetValue": "300",
"rowSpan": 1,
"colSpan": 6,
"colSpan": 1,
"readOnly": 0,
"validateRule": "maxlength:127",
"validateRule": "maxLength:200,maxlength:50",
"allowCorrect": 0,
"order": 51,
"order": 504,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
}
],
"visible": 1
}
],
values: [
{ 'fieldName': '编码', fieldValue: '213' }
]
}
export const options2 = {
groups: [
{
"groupName": "维修派单",
"schema": [
"showCss": "大"
},
{
"tableName": "工单_维修填报",
"fieldName": "分支环节2",
"alias": "分支环节2",
"uiGroup": "维修派单",
"fieldName": "关闭阀门位置及大小",
"alias": "关闭阀门位置及大小",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "文本",
"shape": "地址",
"unit": "",
"configInfo": "",
"presetValue": "这是维修派单环节",
"presetValue": "300流量计后,关阀至50%",
"rowSpan": 1,
"colSpan": 6,
"colSpan": 3,
"readOnly": 0,
"validateRule": "maxlength:255",
"validateRule": "maxLength:500,maxlength:50",
"allowCorrect": 0,
"order": 30,
"order": 505,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "工单_维修填报",
"fieldName": "服务人员",
"alias": "服务人员",
"uiGroup": "维修派单",
"fieldName": "处理前图片",
"alias": "处理前图片",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "文本",
"shape": "可预览图片",
"unit": "",
"configInfo": "",
"presetValue": "张建开",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"colSpan": 3,
"readOnly": 0,
"validateRule": "maxlength:50",
"validateRule": "maxlength:1000",
"allowCorrect": 0,
"order": 31,
"order": 506,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "工单_维修填报",
"fieldName": "派单提交时间",
"alias": "派单提交时间",
"uiGroup": "维修派单",
"fieldName": "处理后照片",
"alias": "处理后照片",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "日期时间",
"shape": "可预览图片",
"unit": "",
"configInfo": "默认为当前时间",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"colSpan": 3,
"readOnly": 0,
"validateRule": "maxlength:50",
"validateRule": "maxlength:1000",
"allowCorrect": 0,
"order": 32,
"order": 507,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
}
],
"visible": 1
"showCss": "大"
},
{
"groupName": "维修接单",
"schema": [
{
"tableName": "工单_维修填报",
"fieldName": "是否接单",
"alias": "是否接单",
"uiGroup": "维修接单",
"fieldName": "维修材料清单",
"alias": "维修材料清单",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "平铺值选择器",
"shape": "可预览图片",
"unit": "",
"configInfo": "是,否",
"presetValue": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"colSpan": 3,
"readOnly": 0,
"validateRule": "required,maxlength:50",
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 34,
"order": 508,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
},
{
"tableName": "工单_维修填报",
"fieldName": "接单提交时间",
"alias": "接单提交时间",
"uiGroup": "维修接单",
"fieldName": "缴费照片留存",
"alias": "缴费照片留存",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "日期时间",
"shape": "可预览图片",
"unit": "",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 1,
"colSpan": 3,
"readOnly": 0,
"validateRule": "maxlength:50",
"allowCorrect": 0,
"order": 35,
"order": 509,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": "中"
}
],
"visible": 1
"showCss": "大"
},
{
"groupName": "维修处理",
"schema": [
{
"tableName": "工单_维修填报",
"fieldName": "管道资产",
"alias": "维修要素清单",
"fieldName": "备注",
"alias": "备注",
"uiGroup": "维修处理",
"tableGroup": null,
"type": "文本",
"shape": "关联表单",
"shape": "地址",
"unit": "",
"configInfo": "{\"台账名称\":\"维修要素清单\",\"默认显示\":false,\"控制规则\":\" {工单_维修填报.是否收费} ='是'\",\"映射字段\":[{\"fromField\":\"工单编号\",\"toField\":\"工单编号\"}]}",
"configInfo": "",
"presetValue": "",
"rowSpan": 1,
"colSpan": 6,
"colSpan": 3,
"readOnly": 0,
"validateRule": "maxlength:255",
"validateRule": "maxLength:500,maxlength:50",
"allowCorrect": 0,
"order": 38,
"order": 510,
"visible": 1,
"isSync": 0,
"triggerProblemValue": "",
"triggerEvent": "",
"triggerEventFields": "",
"showCss": ""
"showCss": ""
}
],
"visible": 1
}
],
values: []
}
// 返回设备类型
function returnObjectType(obj) {
return Object.prototype.toString.call(obj);
}
// 返回驼峰
function returnCamelCaseString(str) {
if (returnObjectType(str) === '[object String]') {
return str.slice(0, 1).toLowerCase() + str.slice(1);
}
return str;
}
/**
* @description: 转换key大小写,删除原来的key:value
* @params: {Object} data = {key:value}
* */
function handleObject(data) {
if (returnObjectType(data) !== '[object Object]') return null;
let _data = { ...data };
Object.keys(data).forEach(key => {
let _key = returnCamelCaseString(key);
_data[_key] = switchCamelCase(data[key]);
delete _data[key];
});
return _data;
}
/**
* @description: 处理数组的逻辑
* @params: {Array} data = []
* */
function handleArray(data) {
if (returnObjectType(data) !== '[object Array]') return null;
let _data = [...data];
return _data.map(item => {
});
}
function switchCamelCase(obj) {
let _type = returnObjectType(obj);
let _obj = null;
if (_type === '[object Object]') {
_obj = handleObject(obj);
} else if (_type === '[object Array]') {
_obj = handleArray(obj);
}
return _obj;
"formJson": "{\"id\":61,\"tableName\":\"工单_维修填报\",\"alias\":\"瑞云维修处理过程\",\"interfaceName\":\"\",\"type\":\"object\",\"displayType\":\"row\",\"column\":3,\"labelWidth\":120,\"properties\":{\"维修派单\":{\"title\":\"维修派单\",\"type\":\"object\",\"collapsed\":false,\"groupBase\":{},\"properties\":{\"派单提交时间\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"派单提交时间\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"DateTime\",\"options\":\"默认为当前时间\",\"format\":\"dateTime\"},\"服务人员\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"服务人员\",\"presetValue\":\"张建开\",\"disabled\":false,\"emphasis\":false,\"maxLength\":200,\"rules\":[],\"widget\":\"TextInput\",\"isQRCode\":true},\"实收费用\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"实收费用\",\"presetValue\":\"0\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"NumberInput\",\"placeholder\":\"\"},\"派单状态数字\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"总费用\",\"presetValue\":\"\",\"disabled\":true,\"emphasis\":false,\"rules\":[{\"tableName\":\"工单_维修填报\",\"fields\":[\"实收费用\"]}],\"widget\":\"AutoCalculate\",\"calculateRule\":\"{工单_维修填报.实收费用}*10\"}}},\"维修接单\":{\"title\":\"维修接单\",\"type\":\"object\",\"collapsed\":false,\"groupBase\":{},\"properties\":{\"是否接单\":{\"type\":\"string\",\"hidden\":false,\"required\":true,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"是否接单\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"RadioButton\",\"sourceType\":\"手动输入\",\"isMultiple\":false,\"options\":[{\"value\":\"\"},{\"value\":\"\"}]},\"恢复状态数字\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"接单结束时间\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"DateTime\",\"options\":\"默认为空\",\"format\":\"dateTime\"},\"纬度\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"接单用时\",\"presetValue\":\"\",\"disabled\":true,\"emphasis\":false,\"rules\":[{\"tableName\":\"工单_维修填报\",\"fields\":[\"恢复状态数字\",\"派单提交时间\"]}],\"widget\":\"AutoCalculate\",\"calculateRule\":\"$sql.datediff(day,{工单_维修填报.恢复状态数字},{工单_维修填报.派单提交时间})\"}}},\"维修内容\":{\"title\":\"维修内容\",\"type\":\"object\",\"collapsed\":false,\"groupBase\":{},\"properties\":{\"现场是否需要恢复\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"现场是否需要恢复\",\"presetValue\":\"不需要\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"RadioButton\",\"sourceType\":\"手动输入\",\"isMultiple\":false,\"options\":[{\"value\":\"不需要\"},{\"value\":\"需要\"}]},\"是否收费\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"是否收费\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"RadioButton\",\"sourceType\":\"手动输入\",\"isMultiple\":false,\"options\":[{\"value\":\"\"},{\"value\":\"\"}]},\"管道资产\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"100%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"RelationForm\",\"台账名称\":\"维修清单\",\"控制规则\":\"{工单_维修填报.是否收费}== '是'\",\"默认显示\":false,\"映射字段\":[{\"fromField\":\"工单编号\",\"toField\":\"工单编号\"}],\"titleShow\":\"维修清单\",\"groupSource\":{},\"labelWidth\":10},\"分支环节2\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"100%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"RelationForm\",\"台账名称\":\"维修人力使用\",\"控制规则\":\"{工单_维修填报.现场是否需要恢复}=='需要'\",\"默认显示\":false,\"映射字段\":[{\"fromField\":\"工单编号\",\"toField\":\"工单编号\"}],\"titleShow\":\"维修人力清单\",\"groupSource\":{},\"labelWidth\":10},\"维修费用比例\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"固定折扣\",\"presetValue\":\"0.8\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"NumberInput\",\"placeholder\":\"\",\"formatter\":\"\",\"labelWidth\":110}}},\"自动计算\":{\"title\":\"自动计算\",\"type\":\"object\",\"collapsed\":false,\"groupBase\":{},\"properties\":{\"维修开始时间\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"维修开始时间\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"DateTime\",\"options\":\"默认为空\",\"format\":\"dateTime\"},\"维修提交时间\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"维修结束时间\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"DateTime\",\"options\":\"默认为空\",\"format\":\"dateTime\",\"placeholder\":\"请选择日期\",\"labelWidth\":110},\"维修状态数字\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"物料核算费用\",\"presetValue\":\"\",\"disabled\":true,\"emphasis\":false,\"rules\":[{\"tableName\":\"维修清单\",\"fields\":[\"物料金额\"]},{\"tableName\":\"工单_维修填报\",\"fields\":[\"维修费用比例\"]}],\"widget\":\"AutoCalculate\",\"calculateRule\":\"$sql.sum({维修清单.物料金额})*{工单_维修填报.维修费用比例}\",\"groupSource\":{},\"labelWidth\":110},\"打开阀门位置及大小\":{\"title\":\"用工总费用\",\"type\":\"string\",\"widget\":\"AutoCalculate\",\"tableNameParent\":\"工单_维修填报\",\"groupBase\":{},\"groupSetting\":{},\"required\":false,\"disabled\":true,\"hidden\":false,\"groupSource\":{},\"calculateRule\":\"$sql.sum({维修人力使用.用工金额})\",\"groupStyle\":{},\"labelWidth\":110,\"rules\":[{\"tableName\":\"维修人力使用\",\"fields\":[\"用工金额\"]}]},\"分支环节1\":{\"title\":\"总费用\",\"type\":\"string\",\"widget\":\"AutoCalculate\",\"tableNameParent\":\"工单_维修填报\",\"groupBase\":{},\"groupSetting\":{},\"required\":false,\"disabled\":true,\"hidden\":false,\"groupSource\":{},\"calculateRule\":\"{工单_维修填报.打开阀门位置及大小}+{工单_维修填报.维修状态数字}\",\"groupStyle\":{},\"labelWidth\":110,\"rules\":[{\"tableName\":\"工单_维修填报\",\"fields\":[\"打开阀门位置及大小\",\"维修状态数字\"]}]}}},\"维修处理\":{\"title\":\"维修处理\",\"type\":\"object\",\"collapsed\":false,\"groupBase\":{},\"properties\":{\"确认当前位置\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"确认当前位置\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"Coordinate\",\"placeholder\":\"请选择坐标位置\",\"currentAddress\":false},\"现场情况\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"现场情况\",\"presetValue\":\"表后维修\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"ComboBox\",\"sourceType\":\"手动输入\",\"isMultiple\":false,\"options\":[{\"value\":\"表后维修\"},{\"value\":\"表前维系\"},{\"value\":\"无需维修\"}]},\"是否关阀\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"是否关阀\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"RadioButton\",\"sourceType\":\"手动输入\",\"isMultiple\":false,\"options\":[{\"value\":\"\"},{\"value\":\"\"}]},\"无需维修原因\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"无需维修原因\",\"presetValue\":\"已现场处理\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"widget\":\"ComboBox\",\"sourceType\":\"手动输入\",\"isMultiple\":false,\"options\":[{\"value\":\"已现场处理\"},{\"value\":\"现场情况正常,不需要维修\"}]},\"维修管径_DN\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"33.33%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"维修管径_DN\",\"presetValue\":\"300\",\"disabled\":false,\"emphasis\":false,\"maxLength\":200,\"rules\":[],\"widget\":\"TextInput\",\"isQRCode\":true},\"关闭阀门位置及大小\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"100%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"关闭阀门位置及大小\",\"presetValue\":\"300流量计后,关阀至50%\",\"disabled\":false,\"emphasis\":false,\"maxLength\":500,\"rules\":[],\"widget\":\"TextArea\",\"placeholder\":\"\",\"currentAddress\":true},\"处理前图片\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"100%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"处理前图片\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"preview\":true,\"photo\":false,\"fileType\":\"图片\",\"widget\":\"FileUpload\",\"download\":true},\"处理后照片\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"100%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"处理后照片\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"preview\":true,\"photo\":false,\"fileType\":\"图片\",\"widget\":\"FileUpload\",\"download\":true},\"维修材料清单\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"100%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"维修材料清单\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"preview\":true,\"photo\":false,\"fileType\":\"图片\",\"widget\":\"FileUpload\",\"download\":true},\"缴费照片留存\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"100%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"缴费照片留存\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"rules\":[],\"preview\":true,\"photo\":false,\"fileType\":\"图片\",\"widget\":\"FileUpload\",\"download\":true},\"备注\":{\"type\":\"string\",\"hidden\":false,\"required\":false,\"width\":\"100%\",\"groupBase\":{},\"groupStyle\":{},\"groupSetting\":{},\"groupVerify\":{},\"tableNameParent\":\"工单_维修填报\",\"title\":\"备注\",\"presetValue\":\"\",\"disabled\":false,\"emphasis\":false,\"maxLength\":500,\"rules\":[],\"widget\":\"TextArea\",\"placeholder\":\"\",\"currentAddress\":true}}}},\"groupBase\":{},\"groupStyle\":{},\"paths\":[\"维修派单\",\"维修接单\",\"维修内容\",\"自动计算\",\"维修处理\",\"维修现场恢复\",\"维修费用上交\",\"时间记录\"]}"
}
\ No newline at end of file
import React, { useState, useEffect, useRef } from 'react';
import { FormRender, FormDesigner } from '../../src/index';
import { options1, options2 } from './data';
import { schemaValues } from './data';
import { Button, Tabs } from 'antd';
window.globalConfig = {
......@@ -3509,7 +3509,11 @@ window.globalConfig = {
const Test = (props) => {
return (
<FormDesigner tableName='事件_测试02' />
// <FormDesigner tableName='工单_维修填报' />
// <FormDesigner tableName='事件_表单测试表' />
<FormRender
schemaValues={schemaValues}
/>
)
}
......
......@@ -28,7 +28,9 @@ app.use(['/admin', '/manager'], admin);
app.use(webpackHotMiddleware(compiler));
app.use(express.static(__dirname));
// app.use('/', createProxyMiddleware('/', { target: 'http://127.0.0.1:8880', changeOrigin: true }));
app.use('/', createProxyMiddleware('/', { target: 'http://192.168.10.167:8088/', changeOrigin: true }));
app.use('/', createProxyMiddleware('/', { target: 'http://192.168.12.178:8085', changeOrigin: true }));
// app.use('/', createProxyMiddleware('/', { target: 'http://192.168.10.167:8083', changeOrigin: true }));
// app.use('/', createProxyMiddleware('/', { target: 'http://192.168.10.167:8088/', changeOrigin: true }));
// app.use('/', createProxyMiddleware('/', { target: 'http://192.168.10.178:8082', changeOrigin: true }));
// app.use('/', createProxyMiddleware('/', { target: 'http://192.168.10.167:8088/', changeOrigin: true }));
const port = process.env.PORT || 8888;
......
{
"name": "panda-xform",
"version": "2.2.9",
"description": "2.2.9: 各个形态组件不做数据类型校验统一使用字符串处理",
"version": "2.3.0",
"description": "2.3.0: 关联表单计算监听逻辑添加",
"keywords": [
"panda-xform"
],
......
......@@ -220,7 +220,10 @@ const FormDesigner = (props, ref) => {
</div>
}
>
<FormRender ref={formRenderRef} schemaValues={{ formJson: schema }} extraData={{ codes: { '事件编号': '123123' } }} />
<FormRender
ref={formRenderRef}
schemaValues={{ formJson: schema }}
/>
</Drag>
</div>
</div>
......
......@@ -97,6 +97,7 @@ const getFieldName = (configs, tableName) => {
}
const automaticComputation = async (params) => {
console.log('form.getValues()', params?.form?.getValues())
if ((new Date().getTime() - params.startTime) < 1000) return
let param = {
tableName: params.tableName,
......
......@@ -20,10 +20,6 @@ const BaseForm = (props, ref) => {
const form = useForm()
const [startTime, setStartTime] = useState(new Date().getTime())
const watch = useMemo(() => {
return getWatch(schemaForm, form, startTime)
}, [schemaForm, form, startTime])
//表单需要显示的字段
const field = useMemo(() => {
const { fieldGroup, editFieldGroup, addFieldGroup } = config
......@@ -67,11 +63,15 @@ const BaseForm = (props, ref) => {
return { ...group, properties: parentObj }
}, [schemaForm, field, formState])
const watch = useMemo(() => {
return getWatch(schema, form, startTime)
}, [schema, form, startTime])
const getValues = async () => {
let { data, errors } = await form.submit()
let formValue = []
Object.keys(data).map((k) => {
if (isObject(data[k]) && ['relationForm'].includes(k)) {
if (isObject(data[k]) && !['relationForm'].includes(k)) {
Object.keys(data[k]).map((key) => {
formValue.push({ fieldName: key, fieldValue: data[k][key] + '' })
})
......
......@@ -4,10 +4,11 @@ import date from '../../../date'
import select from '../../../select'
import business from '../../../business'
import file from '../../../file'
import Signature from '../../Signature'
import coord from '../../../coord'
import AutoCalculate from '../../AutoCalculate'
const coord = {
Signature
const advanced = {
AutoCalculate
}
const widgets = {
......@@ -18,6 +19,7 @@ const widgets = {
...business,
...file,
...coord,
...advanced,
}
export default widgets
\ No newline at end of file
......@@ -91,7 +91,6 @@ const RelationForm = (props) => {
const getFieldValue = (s, formDataObj, codes) => {
return codes ? (codes[s.fromField] || formDataObj[s.fromField]) : formDataObj[s.fromField]
}
console.log('field', field)
field.forEach(v => {
mappedField.forEach(s => {
if (s.toField === v) {
......@@ -231,7 +230,7 @@ const RelationForm = (props) => {
const { code, data, msg } = await GetTableJson(accountName)
if (code === 0) {
if (data && typeof data === 'string') {
setSchemaGroup(JSON.parse(data))
setSchemaGroup(JSON.parse(aa))
}
} else {
message.error(msg)
......@@ -259,7 +258,6 @@ const RelationForm = (props) => {
const getTableData = async (addFieldGroup) => {
if (!addons) return
let queryWheres = getQueryWheres(addFieldGroup)
console.log('queryWheres', queryWheres)
if (!queryWheres.length) {
message.info('映射字段配置错误!')
}
......@@ -355,7 +353,7 @@ const RelationForm = (props) => {
}, [])
return (
<div className={styles.relationForm} style={{ display: (!addons || show) ? 'block' : 'none' }}>
<div className={styles.relationForm} style={{ display: (addons && !show) ? 'none' : 'block' }}>
<div className={styles.header}>
<span className='account-header-title'>{titleShow}</span>
{disabled ? null : <Button className={styles.headerBtn} type='primary' size='middle' icon={<PlusOutlined />} onClick={addClick}>添加</Button>}
......
......@@ -9,20 +9,14 @@ const DateTime = (props) => {
const { value, onChange, schema, addons } = props
const { disabled, format, presetValue, placeholder, options, currentDate, defaultCurrent } = schema
const valueShow = useMemo(() => {
if (options === '默认为当前时间') {
return (value || new Date()) ? moment(value || new Date()) : null
}
return value ? moment(value) : null
}, [defaultCurrent, value])
useEffect(() => {
if (addons) {
addons.setValue(addons.dataPath, presetValue)
let value = presetValue || (options === '默认为当前时间' ? moment(new Date()).format('YYYY-MM-DD HH:ss:mm') : null)
addons.setValue(addons.dataPath, value)
} else {
onChange(presetValue)
}
}, [presetValue])
}, [presetValue, options])
const disabledDate = (current) => {
if (options === '不超过当前时间') {
......@@ -46,7 +40,7 @@ const DateTime = (props) => {
picker={format}
disabled={disabled}
placeholder={placeholder}
value={valueShow}
value={value ? moment(value) : null}
onChange={dateChange}
showNow
showTime={format === 'dateTime'}
......
......@@ -8,13 +8,6 @@ const Time = (props) => {
const { value, onChange, schema, addons } = props
const { presetValue, currentDate, defaultCurrent, options } = schema
const valueShow = useMemo(() => {
if (options === '默认为当前时间') {
return (value || new Date()) ? moment(value || new Date(), 'HH:mm:ss') : null
}
return value ? moment(value, 'HH:mm:ss') : null
}, [value, defaultCurrent])
const disabledDate = (current) => {
if (options === '不超过当前时间') {
return current && current.format('HH:mm:ss') > moment().format('HH:mm:ss')
......@@ -29,16 +22,17 @@ const Time = (props) => {
useEffect(() => {
if (addons) {
addons.setValue(addons.dataPath, presetValue)
let value = presetValue || (options === '默认为当前时间' ? moment(new Date()).format('HH:mm:ss') : null)
addons.setValue(addons.dataPath, value)
} else {
onChange(presetValue)
}
}, [presetValue])
}, [presetValue, options])
return (
<TimePicker
style={{ width: '100%' }}
value={valueShow}
value={value ? moment(value, 'HH:mm:ss') : null}
onChange={timeChange}
disabledDate={disabledDate}
locale={locale}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment