Commit 4e3e07f1 authored by 李纪文's avatar 李纪文

fix: 接入台账解析

parents a16386d0 d8ed41ff
Pipeline #25010 passed with stages
in 5 minutes 6 seconds
......@@ -75,7 +75,7 @@ export default {
},
{
title: '数据录入',
children: ['Empty'],
children: ['ParseForm'],
},
{
title: '数据展示',
......@@ -83,5 +83,4 @@ export default {
},
],
},
webpack5: {},
};
......@@ -141,9 +141,11 @@
"@wisdom-components/timerangepicker": "^1.2.0",
"classnames": "^2.2.6",
"cross-spawn": "^7.0.3",
"form-render": "^0.9.12",
"highcharts": "^9.0.1",
"highcharts-react-official": "^3.0.0",
"mqtt-client": "^1.0.11"
"mqtt-client": "^1.0.11",
"parseForm": "0.0.4"
},
"size-limit": [
{
......
# `ParseForm`
> TODO: description
## Usage
```
const parseForm = require('ParseForm');
// TODO: DEMONSTRATE API
```
{
"name": "parseform",
"version": "1.0.0",
"description": "> TODO: description",
"author": "lijiwen <961370825@qq.com>",
"homepage": "",
"license": "ISC",
"main": "lib/ParseForm.js",
"directories": {
"lib": "lib",
"test": "__tests__"
},
"files": [
"lib"
],
"publishConfig": {
"registry": "https://g.civnet.cn:4873/"
},
"repository": {
"type": "git",
"url": "https://g.civnet.cn:8443/ReactWeb5/wisdom-components.git"
},
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1"
},
"dependencies": {
"form-render": "^0.9.12",
"parseForm": "^0.0.4"
}
}
---
title: ParseForm - 台账解析
nav:
title: 组件
path: /components
group:
path: /
---
# QuotaSelect 指标选择
基础业务组件
- 允许对分类指标进行选择
- 允许限制选择最大指标数
- 允许搜索指标
## 何时使用
- 在指标选择时。
## 代码演示
<code src="./demos/Base.tsx">
## API
指标选择按钮 props 参考 https://ant.design/components/button-cn/#API
已选指标树 props 参考 https://ant.design/components/tree-cn/#API
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| buttonProps | 指标选择按钮 | object | { } |
| width | 模态框宽度 | number | 900 |
| title | 模态框标题 | string | 选择显示字段 |
| cancelText | 模态框取消文本 | string | 取消选择 |
| placeholder | 搜索框占位符 | string | 搜索关键词 |
| searchPrefix | 搜索框前置图标 | ReactNode | SearchOutlined |
| targetValue | 指标类型 | string | 重要指标 |
| maximum | 最多可选择指标数量 | number | 0 |
| dataSource | 指标列表数据源 | array | [ ] |
| selectData | 已选指标数据 | array | [ ] |
| treeProps | 已选指标树 props | object | { } |
| onModalCancel | 点击模态框取消按钮的回调 | function(value){ } | - |
| onModalOk | 模态框点击确定回调 | function(value){ } | - |
| onSearch | 搜索框输入事件的回调,会返回搜索框输入信息 | function(value){ } | - |
| onRadioChange | 指标类型切换的回调 | function(value){ } | - |
| onCancelSelect | 点击已选指标树的删除按钮的回调 | function(value){ } | - |
// @ts-ignore
import React from 'react';
import ParseForm from 'parseForm';
window._config = {
userInfo: {
fullName: 'admin',
depart: {
name: '平台管理员',
},
},
};
const _options =
'{"Groups":[{"GroupName":"基本信息","Schema":[{"Alias":"数值","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"数值","IsSync":0,"Order":1,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"数值","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"数值","UIGroup":"基本信息","Unit":"m","ValidateRule":"number","Visible":1},{"Alias":"日期时间","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"不可选择","FieldName":"日期时间","IsSync":0,"Order":3,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"日期时间","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:25","Visible":1},{"Alias":"日期","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"不可选择","FieldName":"日期","IsSync":0,"Order":3,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"日期","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:25","Visible":1},{"Alias":"日期年份","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"不可选择","FieldName":"日期年份","IsSync":0,"Order":3,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"日期年份","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:25","Visible":1},{"Alias":"日期月份","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"不可选择","FieldName":"日期月份","IsSync":0,"Order":3,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"日期月份","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:25","Visible":1},{"Alias":"日期周","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"不可选择","FieldName":"日期周","IsSync":0,"Order":3,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"日期周","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:25","Visible":1},{"Alias":"城市选择器","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"城市选择器","IsSync":0,"Order":4,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"城市选择器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:50","Visible":1},{"Alias":"值选择器","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"坐标位置,坐标地点","FieldName":"值选择器","IsSync":0,"Order":2,"PresetValue":"123","ReadOnly":0,"RowSpan":1,"Shape":"值选择器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"数值","UIGroup":"基本信息","Unit":"","ValidateRule":"number","Visible":1},{"Alias":"值复选器","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"坐标位置,坐标地点","FieldName":"值复选器","IsSync":0,"Order":2,"PresetValue":"123","ReadOnly":0,"RowSpan":1,"Shape":"值复选器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"数值","UIGroup":"基本信息","Unit":"","ValidateRule":"number","Visible":1},{"Alias":"可编辑值选择器","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"坐标位置,坐标地点","FieldName":"可编辑值选择器","IsSync":0,"Order":2,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"可编辑值选择器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"数值","UIGroup":"基本信息","Unit":"","ValidateRule":"number","Visible":1},{"Alias":"搜索选择器","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"选项内容.选项","FieldName":"搜索选择器","IsSync":0,"Order":4,"PresetValue":"选项2_2","ReadOnly":0,"RowSpan":1,"Shape":"搜索选择器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:50","Visible":1},{"Alias":"选择器","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"选项","FieldName":"选择器","IsSync":0,"Order":4,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"选择器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:50","Visible":1},{"Alias":"多级联动选择器","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"选项.选项","FieldName":"多级联动选择器","IsSync":0,"Order":4,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"选择器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:50","Visible":1},{"Alias":"台账选择器","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"二供泵房.设备名称","FieldName":"台账选择器","IsSync":0,"Order":4,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"台账选择器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:50","Visible":1},{"Alias":"人员选择器","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"选项.选项","FieldName":"人员选择器","IsSync":0,"Order":4,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"人员选择器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:50","Visible":1},{"Alias":"供水方式","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"供水方式","IsSync":0,"Order":5,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"多行文本","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:10","Visible":1},{"Alias":"站点选择器","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"选项.选项","FieldName":"站点选择器","IsSync":0,"Order":4,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"站点选择器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:50","Visible":1},{"Alias":"供水方式","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"供水方式","IsSync":0,"Order":5,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"多行文本","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:10","Visible":1},{"Alias":"画板名称","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"画板名称","IsSync":0,"Order":6,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"位置坐标","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:50","Visible":1},{"Alias":"设备简称","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"坐标位置","FieldName":"设备简称","IsSync":0,"Order":7,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"位置坐标","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:50","Visible":1},{"Alias":"图片","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"图片","IsSync":0,"Order":8,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"图片","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:25","Visible":1},{"Alias":"附件","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"附件","IsSync":0,"Order":8,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"附件","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"基本信息","Unit":"","ValidateRule":"maxlength:25","Visible":1},{"Alias":"本人姓名","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"本人姓名","IsSync":0,"Order":9,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"本人姓名","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"","TriggerEventFields":"","TriggerProblemValue":"","Type":"数值","UIGroup":"基本信息","Unit":"","ValidateRule":"number","Visible":1},{"Alias":"本人部门","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"本人部门","IsSync":0,"Order":9,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"本人部门","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"","TriggerEventFields":"","TriggerProblemValue":"","Type":"数值","UIGroup":"基本信息","Unit":"","ValidateRule":"number","Visible":1},{"Alias":"顺序","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"顺序","IsSync":0,"Order":10,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"文本","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"","TriggerEventFields":"","TriggerProblemValue":"","Type":"数值","UIGroup":"基本信息","Unit":"","ValidateRule":"number","Visible":1}],"Visible":1},{"GroupName":"坐标信息","Schema":[{"Alias":"所属分区","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"所属分区","IsSync":0,"Order":11,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"文本","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"坐标信息","Unit":"","ValidateRule":"maxlength:25","Visible":1},{"Alias":"详细地址","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"详细地址","IsSync":0,"Order":12,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"文本","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"坐标信息","Unit":"","ValidateRule":"maxlength:127","Visible":1},{"Alias":"GIS编码","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"GIS编码","IsSync":0,"Order":13,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"城市选择器","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"坐标信息","Unit":"","ValidateRule":"maxlength:25","Visible":1},{"Alias":"坐标位置","AllowCorrect":0,"ColSpan":1,"ConfigInfo":"","FieldName":"坐标位置","IsSync":0,"Order":14,"PresetValue":"","ReadOnly":0,"RowSpan":1,"Shape":"坐标控件","ShowCss":"","TableGroup":null,"TableName":"设备_台账_二供泵房2","TriggerEvent":"(无)","TriggerEventFields":"","TriggerProblemValue":"","Type":"文本","UIGroup":"坐标信息","Unit":"","ValidateRule":"maxlength:100","Visible":1}],"Visible":1}],"Modules":[],"Values":[{"FieldName":"采集频率","FieldValue":""},{"FieldName":"存储频率","FieldValue":""},{"FieldName":"地址方案版本","FieldValue":""},{"FieldName":"地址方案名","FieldValue":""},{"FieldName":"供水方式","FieldValue":""},{"FieldName":"画板名称","FieldValue":""},{"FieldName":"设备简称","FieldValue":"武汉市第一医院门诊楼"},{"FieldName":"设备类型","FieldValue":""},{"FieldName":"水箱个数","FieldValue":""},{"FieldName":"顺序","FieldValue":""},{"FieldName":"所属分区","FieldValue":""},{"FieldName":"详细地址","FieldValue":""},{"FieldName":"GIS编码","FieldValue":"北京市/市辖区/东城区"},{"FieldName":"坐标位置","FieldValue":"12720649.754511954,3577341.9326459174"}]}';
const Demo = (props) => {
return (
<div style={{ width: '100%' }}>
<ParseForm tablesSchema={JSON.parse(_options)} />
</div>
);
};
export default Demo;
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