Commit c6ace4be authored by 田翔's avatar 田翔

fix: 地址转化地名优化

parent 3b8604aa
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "6.10.13", "version": "6.10.14",
"description": "6.10.13 坐标控件回填地址名称支持文本形态", "description": "6.10.14 地址转化地名优化",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
import React, { useState, useImperativeHandle, forwardRef, useMemo, useRef } from 'react'
import Drag from '../../components/Drag'
import styles from './index.less'
import { CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons';
const options = [
{
title: '基础控件',
child: [
{
title: '单行文本',
height: 136,
descriptions: (
<div>
<div>用于表单中录入短文本信息的场景,可混合输入汉字、字母和数字:</div>
<div>例如:本人姓名、本人部门、邮箱、手机号、身份证号、银行卡号等。</div>
<div>备注:支持配置字段必填或只读,默认限制文本框录入字符总数200</div>
</div>
)
},
{
title: '多行文本',
height: 114,
descriptions: (
<div>
<div>用于表单中录入较长文本信息的场景,例如:备注说明、会议记录、订单详情等;</div>
<div>备注:默认限制文本框录入字符总数200</div>
</div>
)
},
{
title: '数值输入',
height: 136,
descriptions: (
<div>
<div>用于表单中数值记录或计算的场景,仅允许录入数字,例如物料数量、价格、金额等;</div>
<div>支持设置数值前缀和后缀符号,例如金额前增加¥符号;</div>
<div>支持设置整数、小数、货币、百分比等数值格式的最大、最小值范围</div>
</div>
)
},
{
title: '搜索地址',
height: 92,
descriptions: (
<div>
<div>用于表单中输入关键词进行地址搜素,在表单中展示下拉框形态</div>
</div>
)
},
{
title: '单选框组',
height: 114,
descriptions: (
<div>
<div>适用于表单中选项较少目为单选的场景,选项固定,平铺显示;</div>
<div>例如性别、满意度、优先级等。</div>
</div>
)
},
{
title: '复选框组',
height: 114,
descriptions: (
<div>
<div>适用于表单中选项多选的场景,选项固定,平铺显示;</div>
<div>例如维修来源、维修配件等。</div>
</div>
)
},
{
title: '下拉选择',
height: 136,
descriptions: (
<div>
<div>适用于表单中选项较多且为单选的场景,以下拉形式展现,选项内容可以自定义内容或者关联已有表单、数据字典的数据。</div>
<div>例如选择行业、地区、物料等。</div>
</div>
)
},
{
title: '开关按钮',
height: 114,
descriptions: (
<div>
<div>用于表单中进行确认的场景,打开为“是”,关闭为“否</div>
<div>例如是否同意、是否超预算、是否有漏点等。</div>
</div>
)
},
{
title: '附件',
height: 114,
descriptions: (
<div>
<div>用于表单中上传附件的场景</div>
<div>例如产品、物料、电子版合同等,视频、音频等资料上传</div>
</div>
)
},
{
title: '图片',
height: 114,
descriptions: (
<div>
<div>用于表单中拍照上传或选择本地图片上传</div>
<div>例现场施工照片、现场维修照片等。</div>
</div>
)
},
{
title: '日期选择',
height: 114,
descriptions: (
<div>
<div>用于表单中选择日期的场景,以日历的形式展开呈现,支持日期时间、日期年份、月份等多种形式</div>
<div>例如维修日期、出入库日期、合同签订日期等。</div>
</div>
)
},
{
title: '时间选择',
height: 114,
descriptions: (
<div>
<div>用于表单中选择时间的场景,以时间选择的形式展开呈现。</div>
<div>例如维修时间、出入库时间、合同签订时间等。</div>
</div>
)
},
{
title: '人员选择',
height: 114,
descriptions: (
<div>
<div>用于表单中读取组织机构中人员姓名的场景。支持单选和多选。</div>
<div>例如责任人、维修人员等。</div>
</div>
)
},
{
title: '部门选择',
height: 114,
descriptions: (
<div>
<div>用于表单中读取组织机构中部门名称的场景。支持单选和多选.</div>
<div>例如维修部门、办理部门等等。</div>
</div>
)
},
{
title: '台账选择',
height: 114,
descriptions: (
<div>
<div>用于表单中读取组织机构中部门名称的场景。支持单选和多选.</div>
<div>例如台账选择等等。</div>
</div>
)
}
]
},
{
title: 'GIS控件',
child: [
{
title: '地图坐标',
height: 136,
descriptions: (
<div>
<div>用于表单中打开GIS地图选择对应地图坐标位置的场暴,支持关联字段,同步该坐标点对应的详细地址信息</div>
<div>例如维修坐标、漏点位置、坐标点位置等。</div>
</div>
)
},
{
title: '设备选择',
height: 136,
descriptions: (
<div>
<div>用于表单中选择GIS管网地图中的GIS设备的场景。支持将设备信息回填显示在表单中。例如维修中选择阀门、压力表、管段等设备,</div>
<div>支持关联字段,当表单中存在“GIS 编码"、“GIS 图层”字段时,会将该信息自动填充。</div>
</div>
)
},
{
title: '绘制路径',
height: 114,
descriptions: (
<div>
<div>用于表单中在GIS管网地图中进行路径绘制的场景.</div>
<div>例如巡检路径等等。</div>
</div>
)
},
{
title: '绘制区域',
height: 114,
descriptions: (
<div>
<div>用于表单中在GIS管网地图中进行区域绘制的场景.</div>
<div>例如漏点区域范围等等。</div>
</div>
)
},
{
title: '区域任务',
height: 70,
// descriptions: (
// <div>
// <div>用于表单中在GIS管网地图中进行区域绘制的场景.</div>
// <div>例如漏点区域范围等等。</div>
// </div>
// )
}
]
},
{
title: '高级控件',
child: [
{
title: '富文本',
height: 114,
descriptions: (
<div>
<div>用于表单中录入大量文本,并需要对文本的段落、字体格式样式进行辑的使用场景。</div>
<div>例如停水通知、公告发布、用户反馈信息等。</div>
</div>
)
},
{
title: '编码',
height: 114,
descriptions: (
<div>
<div>用于系统自动生成字段内容,根据预设规则生成编码或流水号信息的场景。</div>
<div>例如采购单号、订单号、流水号等。</div>
</div>
)
},
{
title: '级联选择',
height: 92,
descriptions: (
<div>
<div>用于表单中选择城市的场景,例如湖北省/武汉市/洪山区等。</div>
</div>
)
},
{
title: '关联表单',
height: 114,
descriptions: (
<div>
<div>适用于当前表单关联其他表单,从而在两个表单之间建立联系。</div>
<div>例如在维修工单中增加维修物料清单等等。</div>
</div>
)
},
{
title: '手写签名',
height: 114,
descriptions: (
<div>
<div>在收集数据时,让填写人上传手写签名保障数据的真实性;</div>
<div>例如:新用户申请供水服务时,可能需要在申请表上签名,以证明申请的真实性</div>
</div>
)
},
{
title: '身份证识别',
height: 92,
descriptions: (
<div>
<div>在填写身份证信息时,通过上传身份证图片自动填充证件信息,提升效率、避免输入出错</div>
</div>
)
},
]
}
]
const Help = (props, ref) => {
useImperativeHandle(ref, () => ({
open,
}));
const [visible, setVisible] = useState(false)
const [active, setActive] = useState('单行文本')
const [shink, setShink] = useState({ 基础控件: true, GIS控件: false, advanced: false })
const rightRef = useRef(null)
const contentHTML = useMemo(() => {
let array = []
options.forEach(v => {
array.push(...v.child)
})
return array
}, [])
const activeChange = (value) => {
setActive(value)
let scrollTop = 0
let bool = true
for (let i = 0; i < contentHTML.length; i++) {
if (value === contentHTML[i].title) {
bool = false
}
if (bool) {
scrollTop = scrollTop + (contentHTML[i].height || 0)
}
}
rightRef.current.scrollTop = scrollTop
}
const open = (value) => {
setVisible(true)
setTimeout(() => {
activeChange(value)
}, 500)
}
return (
<Drag
title={(
<div className={styles.helpTitle}>
<div className={styles.titleIcon}></div>
<div className={styles.titleText}>控件-使用说明</div>
</div>
)}
width={800}
bodyStyle={{ height: '450px', padding: 0, }}
onOk={() => setVisible(false)}
onCancel={() => setVisible(false)}
visible={visible}
getContainer={false}
destroyOnClose
>
<div className={styles['help-content']}>
<div className={styles['c-left']}>
{
options.map(v => {
let style = { position: 'absolute', color: '#646464', right: 18, top: 13 }
return (
<div className={styles['t-item']} key={v.title}>
<div className={styles['m-header']} onClick={() => setShink({ ...shink, [v.title]: !shink[v.title] })}>
<div>{v.title}</div>
{
shink[v.title] ? <CaretDownOutlined style={style} /> : <CaretUpOutlined style={style} />
}
</div>
<div className={styles['m-content']} style={{ height: shink[v.title] ? 0 : 'unset' }}>
{
v.child.map(s => {
return (
<div className={styles['t-list']} key={s.title} active={`${s.title === active}`} onClick={() => activeChange(s.title)}>{s.title}</div>
)
})
}
</div>
</div>
)
})
}
</div>
<div className={styles['c-right']} ref={rightRef}>
{
contentHTML.map(v => {
return (
<div className={styles['t-box']} key={v.title}>
<div className={['x-title']}>{v.title}</div>
<div className={styles['x-content']}>{v.descriptions}</div>
</div>
)
})
}
</div>
</div>
</Drag>
)
}
export default forwardRef(Help)
\ No newline at end of file
@imgSrc: '../../../assets/images/designer';
.helpTitle {
height: 24px;
display: flex;
align-items: center;
.titleIcon {
width: 23px;
height: 23px;
background: url('@{imgSrc}/控件说明.png');
background-size: 100% 100%;
margin-right: 10px;
}
.titleText {
color: black;
font-weight: bold;
font-size: 16px;
}
}
.help-content {
width: 100%;
height: 100%;
display: flex;
.c-left {
width: 120px;
height: 100%;
overflow: auto;
.t-item {
width: 100%;
.m-header {
width: 100%;
padding-left: 15px;
height: 40px;
line-height: 40px;
position: relative;
color: #646464;
}
.m-content {
overflow: hidden;
width: 100%;
transition: all 0.3s ease-in-out;
.t-list {
width: 100%;
height: 40px;
line-height: 40px;
padding-left: 15px;
&:hover {
cursor: pointer;
}
&[active='true'] {
border-left: 2px solid #1685FF;
background: #E9F3FF;
}
}
}
}
}
.c-right {
width: calc(100% - 120px);
padding: 10px;
height: 100%;
overflow: auto;
background: #F1F1F1;
transition: all 0.3s all;
.t-box {
margin-bottom: 10px;
border-radius: 5px;
background: white;
.x-title {
padding-left: 10px;
width: 100%;
height: 40px;
line-height: 40px;
background: linear-gradient(to right, #EAF3FF, #FCFDFF);
font-size: 14px;
font-weight: bold;
}
.x-content {
padding: 10px;
color: #646464;
}
}
}
}
\ No newline at end of file
...@@ -21,11 +21,11 @@ const groupStyle = { ...@@ -21,11 +21,11 @@ const groupStyle = {
const layoutWidgets = [ const layoutWidgets = [
{ {
text: '分组名称', text: '分组标题',
name: '分组名称', name: '分组标题',
icon: <GroupOutlined />, icon: <GroupOutlined />,
schema: { schema: {
title: '分组名称', title: '分组标题',
type: 'object', type: 'object',
width: '100%', width: '100%',
}, },
...@@ -39,8 +39,8 @@ const layoutWidgets = [ ...@@ -39,8 +39,8 @@ const layoutWidgets = [
}, },
}, },
{ {
text: '描述控件', text: '描述说明',
name: '描述控件', name: '描述说明',
icon: <IconPack.SearchLocation />, icon: <IconPack.SearchLocation />,
schema: { schema: {
title: '', title: '',
...@@ -72,13 +72,13 @@ const layoutWidgets = [ ...@@ -72,13 +72,13 @@ const layoutWidgets = [
}, },
] ]
const textWidgets = [ const baseWidgets = [
{ {
text: '文本', text: '单行文本',
name: '文本', name: '单行文本',
icon: <IconPack.TextInput />, icon: <IconPack.TextInput />,
schema: { schema: {
title: '文本', title: '单行文本',
type: 'string', type: 'string',
widget: 'TextInput', widget: 'TextInput',
placeholder: '', placeholder: '',
...@@ -404,8 +404,8 @@ const textWidgets = [ ...@@ -404,8 +404,8 @@ const textWidgets = [
}, },
}, },
{ {
text: '数值', text: '数值输入',
name: '数值', name: '数值输入',
icon: <IconPack.NumberInput />, icon: <IconPack.NumberInput />,
schema: { schema: {
title: '数值', title: '数值',
...@@ -561,14 +561,14 @@ const textWidgets = [ ...@@ -561,14 +561,14 @@ const textWidgets = [
}, },
}, },
{ {
text: '富文本', text: '搜索地址',
name: '富文本', name: '搜索地址',
icon: <IconPack.RichText />, icon: <IconPack.SearchLocation />,
schema: { schema: {
title: '富文本', title: '搜索地址',
type: 'string', type: 'string',
widget: 'RichText', widget: 'SearchLocation',
width: '100%', placeholder: '',
}, },
setting: { setting: {
widget: { widget: {
...@@ -576,7 +576,7 @@ const textWidgets = [ ...@@ -576,7 +576,7 @@ const textWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 75,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
...@@ -586,9 +586,12 @@ const textWidgets = [ ...@@ -586,9 +586,12 @@ const textWidgets = [
}, },
title: { title: {
title: '展示名称', title: '展示名称',
type: 'string',
required: true, required: true,
},
placeholder: {
title: '提示语',
type: 'string', type: 'string',
widget: 'htmlInput',
}, },
description: { description: {
title: '字段说明', title: '字段说明',
...@@ -610,23 +613,25 @@ const textWidgets = [ ...@@ -610,23 +613,25 @@ const textWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
presetValue: { coordSync: {
title: '默认值', title: '坐标同步',
type: 'string', type: 'string',
widget: 'RichTextDefault', widget: 'CoordSync',
description: '坐标信息将会同步到下方字段中'
}, },
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
widget: 'checkbox',
default: false, default: false,
width: '50%', width: '33%',
}, },
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '50%', width: '25%',
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
...@@ -641,15 +646,14 @@ const textWidgets = [ ...@@ -641,15 +646,14 @@ const textWidgets = [
}, },
}, },
{ {
text: '编码', text: '单选框组',
name: '编码', name: '单选框组',
icon: <IconPack.Coding />, icon: <IconPack.RadioButton />,
schema: { schema: {
title: '编码', title: '单选框组',
name: '单选框组',
type: 'string', type: 'string',
widget: 'Coding', widget: 'RadioButton',
disabled: true,
required: false,
}, },
setting: { setting: {
widget: { widget: {
...@@ -657,33 +661,27 @@ const textWidgets = [ ...@@ -657,33 +661,27 @@ const textWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 74,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
title: { title: {
title: '展示名称', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
placeholder: { presetValue: {
title: '提示语', title: '默认值',
type: 'string', type: 'string',
}, },
description: { description: {
title: '字段说明', title: '字段说明',
type: 'string', type: 'string',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
isHidden: { isHidden: {
title: '是否隐藏', title: '是否隐藏',
...@@ -701,22 +699,63 @@ const textWidgets = [ ...@@ -701,22 +699,63 @@ const textWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
prefixion: { sourceType: {
title: '前缀', title: '来源方式',
type: 'string', type: 'string',
disabled: disabled, widget: 'SourceType',
dependencies: ['tableTypeParent', 'IsSystemField'], default: '手动输入',
}, },
codingType: { options: {
title: '编码方式', title: '',
name: '选项',
type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ key: '选项一', value: '选项一' }],
widget: 'SimpleList',
dependencies: ['sourceType', 'color']
},
dictionary: {
title: '{{formData.sourceType}}',
name: '{{formData.sourceType}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
type: 'string', type: 'string',
widget: 'select', widget: 'Dictionary',
enum: ['1', '2', '3'], value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
default: '3', },
enumNames: ['前缀-年份-六位编码', '前缀-年份月份-六位编码', '前缀-八位编码'], tableName: {
description: '{{rootValue.codingType === "1" ?"示例:XJ-2019-000001" : (rootValue.codingType === "2" ? "示例: XJ-201909-000001" : "示例: XJ00000001")}}', title: '表名',
disabled: disabled, name: '表名',
dependencies: ['tableTypeParent', 'IsSystemField'], hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
},
fieldName: {
title: '字段名',
name: '字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['sourceType', 'tableName'],
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '40%',
props: {
style: {
marginLeft: '10px',
}
}
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '30%',
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
...@@ -727,20 +766,18 @@ const textWidgets = [ ...@@ -727,20 +766,18 @@ const textWidgets = [
title: '控件占比', title: '控件占比',
type: 'string', type: 'string',
widget: 'RadioGroupW', widget: 'RadioGroupW',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
}, }
}, },
{ {
text: '地址', text: '复选框组',
name: '地址', name: '复选框组',
icon: <IconPack.SearchLocation />, icon: <IconPack.CheckBox />,
schema: { schema: {
title: '地址', title: '复选框组',
name: '复选框组',
type: 'string', type: 'string',
widget: 'SearchLocation', widget: 'CheckBox',
placeholder: '',
}, },
setting: { setting: {
widget: { widget: {
...@@ -758,11 +795,12 @@ const textWidgets = [ ...@@ -758,11 +795,12 @@ const textWidgets = [
}, },
title: { title: {
title: '展示名称', title: '展示名称',
type: 'string',
required: true, required: true,
type: 'string',
widget: 'htmlInput',
}, },
placeholder: { presetValue: {
title: '提示语', title: '默认值',
type: 'string', type: 'string',
}, },
description: { description: {
...@@ -774,6 +812,7 @@ const textWidgets = [ ...@@ -774,6 +812,7 @@ const textWidgets = [
type: 'boolean', type: 'boolean',
widget: 'IsHidden', widget: 'IsHidden',
default: false, default: false,
disabled: disabled,
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 80,
}, },
...@@ -785,25 +824,63 @@ const textWidgets = [ ...@@ -785,25 +824,63 @@ const textWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
coordSync: { sourceType: {
title: '坐标同步', title: '来源方式',
type: 'string', type: 'string',
widget: 'CoordSync', widget: 'SourceType',
description: '坐标信息将会同步到下方字段中' default: '手动输入',
},
options: {
title: '',
name: '选项',
type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }],
widget: 'SimpleList',
dependencies: ['sourceType', 'color']
},
dictionary: {
title: '{{formData.sourceType}}',
name: '{{formData.sourceType}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
type: 'string',
widget: 'Dictionary',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
},
tableName: {
title: '表名',
name: '表名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
},
fieldName: {
title: '字段名',
name: '字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['sourceType', 'tableName'],
}, },
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '33%', width: '40%',
props: {
style: {
marginLeft: '10px',
}
}
}, },
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '25%', width: '30%',
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
...@@ -815,17 +892,14 @@ const textWidgets = [ ...@@ -815,17 +892,14 @@ const textWidgets = [
type: 'string', type: 'string',
widget: 'RadioGroupW', widget: 'RadioGroupW',
}, },
}, }
}, },
]
const selectWidgets = [
{ {
text: '下拉', text: '下拉选择',
name: '下拉', name: '下拉选择',
icon: <IconPack.ComboBox />, icon: <IconPack.ComboBox />,
schema: { schema: {
title: '下拉', title: '下拉选择',
type: 'string', type: 'string',
widget: 'ComboBox', widget: 'ComboBox',
}, },
...@@ -990,14 +1064,14 @@ const selectWidgets = [ ...@@ -990,14 +1064,14 @@ const selectWidgets = [
} }
}, },
{ {
text: '单选框', text: '开关按钮',
name: '单选框', name: '开关按钮',
icon: <IconPack.RadioButton />, icon: <IconPack.SwitchSelector />,
schema: { schema: {
title: '单选框', title: '开关按钮',
name: '单选框', name: '开关按钮',
type: 'string', type: 'string',
widget: 'RadioButton', widget: 'SwitchSelector'
}, },
setting: { setting: {
widget: { widget: {
...@@ -1021,7 +1095,9 @@ const selectWidgets = [ ...@@ -1021,7 +1095,9 @@ const selectWidgets = [
}, },
presetValue: { presetValue: {
title: '默认值', title: '默认值',
type: 'string', type: 'boolean',
widget: 'SwitchDefault',
dependencies: ['showText'],
}, },
description: { description: {
title: '字段说明', title: '字段说明',
...@@ -1032,6 +1108,7 @@ const selectWidgets = [ ...@@ -1032,6 +1108,7 @@ const selectWidgets = [
type: 'boolean', type: 'boolean',
widget: 'IsHidden', widget: 'IsHidden',
default: false, default: false,
disabled: disabled,
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 80,
}, },
...@@ -1043,38 +1120,1273 @@ const selectWidgets = [ ...@@ -1043,38 +1120,1273 @@ const selectWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
sourceType: { disabled: {
title: '来源方式', title: '只读',
type: 'string', type: 'boolean',
widget: 'SourceType', widget: 'checkbox',
default: '手动输入', default: false,
width: '25%',
}, },
options: { showText: {
title: '', title: '显示文字',
name: '选项', type: 'string',
type: 'array', widget: 'ShowText',
hidden: '{{formData.sourceType !== "手动输入"}}', default: '开/关',
default: [{ key: '选项一', value: '选项一' }], description: '示例(开/关)'
widget: 'SimpleList',
dependencies: ['sourceType', 'color']
}, },
dictionary: { description: {
title: '{{formData.sourceType}}', title: '字段说明',
name: '{{formData.sourceType}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
type: 'string', type: 'string',
widget: 'Dictionary',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
}, },
tableName: { groupStyle: {
title: '表名', title: '控件样式',
name: '表名', type: 'object',
hidden: '{{formData.sourceType !== "表数据"}}', properties: {}
},
width: {
title: '控件占比',
type: 'string', type: 'string',
widget: 'TableName', widget: 'RadioGroupW',
dependencies: ['sourceType'],
}, },
fieldName: { },
},
{
text: '附件',
name: '附件',
icon: <IconPack.FileUpload />,
schema: {
title: '附件',
type: 'string',
widget: 'FileUpload',
width: '100%',
preview: true,
isUncompressed: true,
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 80,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
type: 'string',
required: true,
},
placeholder: {
title: '提示语',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
fileType: {
title: '文件类型',
type: 'string',
widget: 'FileTypeSelect',
enum: ['全部', '图片', '文档', '音频', '视频'],
enumNames: ['全部', '图片', '文档', '音频', '视频'],
default: '全部',
},
durationTime: {
title: "{{formData.fileType+'最大时长'}}",
type: 'number',
description: '秒',
widget: 'slider',
default: 60,
min: 1,
max: 60,
hidden: "{{!['音频', '视频'].includes(formData.fileType)}}",
dependencies: ['fileType']
},
templateFile: {
title: '模板文件',
type: 'string',
widget: 'TemplateFile',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '50%',
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '50%',
},
preview: {
title: '预览',
type: 'boolean',
widget: 'checkbox',
default: true,
width: '50%',
},
download: {
title: '下载',
type: 'boolean',
widget: 'checkbox',
default: true,
width: '50%',
},
isUncompressed: {
title: '压缩',
type: 'boolean',
widget: 'BooleanSwitch',
description: '附件是否压缩(压缩后清晰度会降低)',
},
photo: {
title: '允许从相册选取',
type: 'boolean',
widget: 'BooleanSwitch',
description: '仅支持移动端',
default: false,
hidden: "{{!['图片', '视频'].includes(formData.fileType)}}"
},
watermark: {
title: '水印',
type: 'boolean',
widget: 'BooleanSwitch',
description: '图片是否添加水印(仅支持移动端)',
default: false,
hidden: "{{!['图片'].includes(formData.fileType)}}"
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
},
},
// {
// text: '图片',
// name: '图片',
// icon: <IconPack.FileUpload />,
// schema: {
// title: '图片',
// type: 'string',
// widget: 'FileUpload',
// width: '100%',
// preview: true,
// isUncompressed: true,
// },
// setting: {
// widget: {
// title: '控件类型',
// type: 'string',
// widget: 'WidgetType',
// displayType: 'row',
// labelWidth: 80,
// },
// $id: {
// title: '数据源',
// type: 'string',
// widget: 'FieldNames',
// required: true,
// },
// title: {
// title: '展示名称',
// type: 'string',
// required: true,
// },
// placeholder: {
// title: '提示语',
// type: 'string',
// },
// description: {
// title: '字段说明',
// type: 'string',
// },
// presetValue: {
// title: '默认值',
// type: 'string',
// },
// isHidden: {
// title: '是否隐藏',
// type: 'boolean',
// widget: 'IsHidden',
// default: false,
// displayType: 'row',
// labelWidth: 80,
// },
// hiddenCondition: {
// title: '隐藏条件',
// type: 'string',
// description: '所有形态默认显示',
// widget: 'HiddenCondition',
// hidden: "{{formData.isHidden}}",
// dependencies: ['isHidden'],
// },
// fileType: {
// title: '文件类型',
// type: 'string',
// widget: 'FileTypeSelect',
// enum: ['全部', '图片', '文档', '音频', '视频'],
// enumNames: ['全部', '图片', '文档', '音频', '视频'],
// default: '全部',
// },
// durationTime: {
// title: "{{formData.fileType+'最大时长'}}",
// type: 'number',
// description: '秒',
// widget: 'slider',
// default: 60,
// min: 1,
// max: 60,
// hidden: "{{!['音频', '视频'].includes(formData.fileType)}}",
// dependencies: ['fileType']
// },
// templateFile: {
// title: '模板文件',
// type: 'string',
// widget: 'TemplateFile',
// },
// disabled: {
// title: '只读',
// type: 'boolean',
// widget: 'checkbox',
// default: false,
// width: '50%',
// },
// required: {
// title: '必填',
// type: 'boolean',
// widget: 'checkbox',
// default: false,
// width: '50%',
// },
// preview: {
// title: '预览',
// type: 'boolean',
// widget: 'checkbox',
// default: true,
// width: '50%',
// },
// download: {
// title: '下载',
// type: 'boolean',
// widget: 'checkbox',
// default: true,
// width: '50%',
// },
// isUncompressed: {
// title: '压缩',
// type: 'boolean',
// widget: 'BooleanSwitch',
// description: '附件是否压缩(压缩后清晰度会降低)',
// },
// photo: {
// title: '允许从相册选取',
// type: 'boolean',
// widget: 'BooleanSwitch',
// description: '仅支持移动端',
// default: false,
// hidden: "{{!['图片', '视频'].includes(formData.fileType)}}"
// },
// watermark: {
// title: '水印',
// type: 'boolean',
// widget: 'BooleanSwitch',
// description: '图片是否添加水印(仅支持移动端)',
// default: false,
// hidden: "{{!['图片'].includes(formData.fileType)}}"
// },
// groupStyle: {
// title: '控件样式',
// type: 'object',
// properties: {}
// },
// width: {
// title: '控件占比',
// type: 'string',
// widget: 'RadioGroupW',
// },
// },
// },
{
text: '日期选择',
name: '日期选择',
icon: <IconPack.DateTime />,
schema: {
title: '日期选择',
type: 'string',
widget: 'DateTime',
placeholder: '',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
required: true,
type: 'string',
},
placeholder: {
title: '提示语',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
calculateRule: {
title: '计算规则',
type: 'string',
widget: 'CalculateRule',
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '40%',
props: {
style: {
marginLeft: '10px',
}
}
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '30%',
},
format: {
title: '日期格式',
type: 'string',
enum: ['date', 'dateTime', 'year', 'month', 'week', 'quarter', 'datePeriod'],
default: 'date',
enumNames: ['日期', '日期时间', '日期年份', '日期月份', '日期周', '日期季度', '日期时段'],
},
options: {
title: '选项',
type: 'string',
widget: 'select',
enum: ['默认为空', '默认为当前时间', '不超过当前时间'],
default: '默认为空',
enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
},
},
{
text: '时间选择',
name: '时间选择',
icon: <IconPack.Time />,
schema: {
title: '时间选择',
type: 'string',
widget: 'Time',
placeholder: '',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
},
placeholder: {
title: '提示语',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
calculateRule: {
title: '计算规则',
type: 'string',
widget: 'CalculateRule',
},
presetValue: {
title: '默认值',
type: 'string',
widget: 'TimeDefault',
format: '{{formData.format}}',
description: '勾选默认当前时间此处配置无效'
},
options: {
title: '选项',
type: 'string',
widget: 'select',
enum: ['默认为空', '默认为当前时间', '不超过当前时间'],
default: '默认为空',
enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '50%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '50%',
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
}
},
{
text: '人员选择',
name: '人员选择',
icon: <IconPack.PersonSelector />,
schema: {
title: '人员选择',
type: 'string',
widget: 'PersonSelector',
placeholder: '',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 80,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
required: true,
type: 'string',
},
placeholder: {
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
role: {
title: '机构角色',
type: 'string',
widget: 'GroupAndRole',
},
isMySite: {
title: '本人站点',
name: '本人站点',
required: true,
default: false,
type: 'boolean',
widget: 'checkbox',
width: '50%',
},
isStoreID: {
title: '是否存储ID',
type: 'boolean',
default: false,
width: '50%',
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
isMultiple: {
title: '多选',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
interactiveType: {
title: '交互方式',
type: 'string',
widget: 'select',
enum: ['下拉框', '分组模态', '树形模态'],
default: '下拉框',
enumNames: ['下拉框', '分组模态', '树形模态'],
displayType: 'row',
labelWidth: 80,
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
}
},
{
text: '部门选择',
name: '部门选择',
icon: <IconPack.DeptSelector />,
schema: {
title: '部门选择',
type: 'string',
widget: 'DeptSelector',
placeholder: '',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 80,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
required: true,
type: 'string',
},
placeholder: {
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
isMultiple: {
title: '多选',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
isStoreID: {
title: '是否存储ID',
type: 'boolean',
default: false,
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
}
},
{
text: '台账选择',
name: '台账选择',
icon: <IconPack.AccountSelector />,
schema: {
title: '台账选择',
type: 'string',
widget: 'AccountSelector',
placeholder: '',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
type: 'string',
required: true,
},
placeholder: {
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
accountName: {
title: '台账名称',
name: '台账名称',
type: 'string',
widget: 'AccountName',
},
fieldshine: {
title: '映射字段',
name: '映射字段',
type: 'array',
widget: 'Fieldshine',
dependencies: ['accountName', '$id'],
default: [],
description: '多字段映射仅支持单选',
},
fieldList: {
title: '前端显示字段',
type: 'array',
default: [],
widget: 'FieldList',
dependencies: ['accountName', '$id'],
description: '默认获取前端台账字段',
},
isStoreID: {
title: '存储ID',
name: '存储ID',
type: 'boolean',
default: false,
displayType: 'row',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后将会存储台账的ID',
},
siteFilter: {
title: '站点过滤',
name: '站点过滤',
type: 'boolean',
default: false,
displayType: 'row',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后只显示自己所属站点数据',
},
autofill: {
title: '自动映射值',
name: '站点过滤',
type: 'boolean',
default: false,
displayType: 'row',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后会将台账中的值自动映射在表单中(移动端)',
},
isMultiple: {
title: '多选',
type: 'boolean',
widget: 'checkbox',
default: false,
displayType: 'row',
labelWidth: 100,
widget: 'BooleanSwitch',
hidden: '{{formData.fieldshine.length !== 1}}',
},
sql: {
title: 'SQL过滤',
name: 'SQL过滤',
type: 'string',
widget: 'SqlFilter',
props: {
placeholder: '示例:部门="XX部门"'
}
},
required: {
title: '必填',
type: 'boolean',
default: false,
width: '33%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
...groupStyle,
}
}
]
const selectWidgets = [
{
text: '下拉框',
name: '下拉框',
icon: <IconPack.ComboBox />,
schema: {
title: '下拉框',
type: 'string',
widget: 'ComboBox',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
},
placeholder: {
title: '提示语',
type: 'string',
default: '',
},
description: {
title: '字段说明',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
presetValue: {
title: '默认值',
type: 'string',
},
sourceType: {
title: '来源方式',
name: '下拉框',
type: 'string',
widget: 'SourceType',
default: '手动输入',
},
options: {
title: '',
name: '选项',
type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }],
widget: 'SimpleList',
dependencies: ['sourceType', 'color', 'isMultiple']
},
dictionary: {
title: '{{formData.sourceType}}',
name: '{{formData.sourceType}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
type: 'string',
widget: 'Dictionary',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
dependencies: ['sourceType']
},
tableName: {
title: '表名',
name: '表名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
},
fieldName: {
title: '字段名',
name: '字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['sourceType', 'tableName'],
},
isMySite: {
title: '仅显示本人所属的站点',
default: false,
hidden: '{{formData.sourceType !== "站点"}}',
type: 'boolean',
widget: 'checkbox',
props: {
style: {
paddingLeft: '10px'
}
}
},
required: {
title: '必填',
type: 'boolean',
default: false,
width: '30%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '30%',
},
isMultiple: {
title: '多选',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '30%',
// hidden: '{{formData.isEdit}}'
},
isSearch: {
title: '搜索',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '30%',
default: true
},
isStoreID: {
title: '是否存储ID',
default: false,
hidden: '{{formData.sourceType !== "站点"}}',
type: 'boolean',
widget: 'checkbox',
width: '40%',
},
isEdit: {
title: '是否可编辑',
type: 'boolean',
widget: 'BooleanSwitch',
displayType: 'row',
labelWidth: 120,
description: '勾选后可直接输入选项,可编辑选择仅支持多选',
hidden: '{{formData.sourceType !== "手动输入"}}'
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
}
},
{
text: '单选框',
name: '单选框',
icon: <IconPack.RadioButton />,
schema: {
title: '单选框',
name: '单选框',
type: 'string',
widget: 'RadioButton',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 74,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
},
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
sourceType: {
title: '来源方式',
type: 'string',
widget: 'SourceType',
default: '手动输入',
},
options: {
title: '',
name: '选项',
type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ key: '选项一', value: '选项一' }],
widget: 'SimpleList',
dependencies: ['sourceType', 'color']
},
dictionary: {
title: '{{formData.sourceType}}',
name: '{{formData.sourceType}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
type: 'string',
widget: 'Dictionary',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
},
tableName: {
title: '表名',
name: '表名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
},
fieldName: {
title: '字段名',
name: '字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['sourceType', 'tableName'],
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '40%',
props: {
style: {
marginLeft: '10px',
}
}
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '30%',
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
}
},
{
text: '复选框',
name: '复选框',
icon: <IconPack.CheckBox />,
schema: {
title: '复选框',
name: '复选框',
type: 'string',
widget: 'CheckBox',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
},
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
disabled: disabled,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
sourceType: {
title: '来源方式',
type: 'string',
widget: 'SourceType',
default: '手动输入',
},
options: {
title: '',
name: '选项',
type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }],
widget: 'SimpleList',
dependencies: ['sourceType', 'color']
},
dictionary: {
title: '{{formData.sourceType}}',
name: '{{formData.sourceType}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
type: 'string',
widget: 'Dictionary',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
},
tableName: {
title: '表名',
name: '表名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
},
fieldName: {
title: '字段名', title: '字段名',
name: '字段名', name: '字段名',
hidden: '{{formData.sourceType !== "表数据"}}', hidden: '{{formData.sourceType !== "表数据"}}',
...@@ -1114,14 +2426,14 @@ const selectWidgets = [ ...@@ -1114,14 +2426,14 @@ const selectWidgets = [
} }
}, },
{ {
text: '复选框', text: '开关按钮',
name: '复选框', name: '开关按钮',
icon: <IconPack.CheckBox />, icon: <IconPack.SwitchSelector />,
schema: { schema: {
title: '复选框', title: '开关按钮',
name: '复选框', name: '开关按钮',
type: 'string', type: 'string',
widget: 'CheckBox', widget: 'SwitchSelector'
}, },
setting: { setting: {
widget: { widget: {
...@@ -1129,7 +2441,7 @@ const selectWidgets = [ ...@@ -1129,7 +2441,7 @@ const selectWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 75, labelWidth: 74,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
...@@ -1145,7 +2457,9 @@ const selectWidgets = [ ...@@ -1145,7 +2457,9 @@ const selectWidgets = [
}, },
presetValue: { presetValue: {
title: '默认值', title: '默认值',
type: 'string', type: 'boolean',
widget: 'SwitchDefault',
dependencies: ['showText'],
}, },
description: { description: {
title: '字段说明', title: '字段说明',
...@@ -1168,44 +2482,200 @@ const selectWidgets = [ ...@@ -1168,44 +2482,200 @@ const selectWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
sourceType: { disabled: {
title: '来源方式', title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
showText: {
title: '显示文字',
type: 'string', type: 'string',
widget: 'SourceType', widget: 'ShowText',
default: '手动输入', default: '开/关',
description: '示例(开/关)'
}, },
options: { description: {
title: '', title: '字段说明',
name: '选项', type: 'string',
type: 'array', },
hidden: '{{formData.sourceType !== "手动输入"}}', groupStyle: {
default: [{ value: '选项一' }], title: '控件样式',
widget: 'SimpleList', type: 'object',
dependencies: ['sourceType', 'color'] properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
},
},
{
text: '关联选择',
name: '关联选择',
icon: <IconPack.RelevanceSelect />,
schema: {
title: '关联选择',
name: '关联选择',
type: 'string',
widget: 'RelevanceSelect',
placeholder: '',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
},
placeholder: {
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
widget: 'CascadeDefault',
dependencies: ['sourceType'],
},
description: {
title: '字段说明',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
fieldParent: {
title: '父字段名',
type: 'string',
// required: true,
widget: 'FieldNames',
dependencies: ['$id'],
}, },
dictionary: { dictionary: {
title: '{{formData.sourceType}}', title: '数据字典',
name: '{{formData.sourceType}}', name: '数据字典',
hidden: '{{formData.sourceType !== "数据字典"}}', // required: true,
type: 'string', type: 'string',
widget: 'Dictionary', widget: 'Dictionary',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
}, },
tableName: { required: {
title: '表名', title: '必填',
name: '表名', type: 'boolean',
hidden: '{{formData.sourceType !== "表数据"}}', widget: 'checkbox',
default: false,
width: '33%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
description: {
title: '字段说明',
type: 'string', type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
}, },
fieldName: { ...groupStyle,
title: '字段名', }
name: '字段名', },
hidden: '{{formData.sourceType !== "表数据"}}', {
text: '级联选择',
name: '级联选择',
icon: <IconPack.CascadeSelector />,
schema: {
title: '级联选择',
name: '级联选择',
type: 'string',
widget: 'CascadeSelector',
placeholder: '',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
},
placeholder: {
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
widget: 'CascadeDefault',
},
description: {
title: '字段说明',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
sourceType: {
title: '来源方式',
name: '来源方式',
type: 'string', type: 'string',
widget: 'FieldName', widget: 'select',
dependencies: ['sourceType', 'tableName'], default: '城市数据',
enum: ['城市数据'],
enumNames: ['城市数据'],
}, },
required: { required: {
title: '必填', title: '必填',
...@@ -1236,17 +2706,20 @@ const selectWidgets = [ ...@@ -1236,17 +2706,20 @@ const selectWidgets = [
type: 'string', type: 'string',
widget: 'RadioGroupW', widget: 'RadioGroupW',
}, },
} },
}, }
]
const businessWidgets = [
{ {
text: '开关按钮', text: '人员选择',
name: '开关按钮', name: '人员选择',
icon: <IconPack.SwitchSelector />, icon: <IconPack.PersonSelector />,
schema: { schema: {
title: '开关按钮', title: '人员选择',
name: '开关按钮',
type: 'string', type: 'string',
widget: 'SwitchSelector' widget: 'PersonSelector',
placeholder: '',
}, },
setting: { setting: {
widget: { widget: {
...@@ -1254,7 +2727,7 @@ const selectWidgets = [ ...@@ -1254,7 +2727,7 @@ const selectWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 74, labelWidth: 80,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
...@@ -1266,13 +2739,14 @@ const selectWidgets = [ ...@@ -1266,13 +2739,14 @@ const selectWidgets = [
title: '展示名称', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', },
placeholder: {
title: '提示语',
type: 'string',
}, },
presetValue: { presetValue: {
title: '默认值', title: '默认值',
type: 'boolean', type: 'string',
widget: 'SwitchDefault',
dependencies: ['showText'],
}, },
description: { description: {
title: '字段说明', title: '字段说明',
...@@ -1283,7 +2757,6 @@ const selectWidgets = [ ...@@ -1283,7 +2757,6 @@ const selectWidgets = [
type: 'boolean', type: 'boolean',
widget: 'IsHidden', widget: 'IsHidden',
default: false, default: false,
disabled: disabled,
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 80,
}, },
...@@ -1295,45 +2768,77 @@ const selectWidgets = [ ...@@ -1295,45 +2768,77 @@ const selectWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
role: {
title: '机构角色',
type: 'string',
widget: 'GroupAndRole',
},
isMySite: {
title: '本人站点',
name: '本人站点',
required: true,
default: false,
type: 'boolean',
widget: 'checkbox',
width: '50%',
},
isStoreID: {
title: '是否存储ID',
type: 'boolean',
default: false,
width: '50%',
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '25%', width: '33%',
},
showText: {
title: '显示文字',
type: 'string',
widget: 'ShowText',
default: '开/关',
description: '示例(开/关)'
}, },
description: { isMultiple: {
title: '字段说明', title: '多选',
type: 'string', type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
type: 'object', type: 'object',
properties: {} properties: {}
}, },
interactiveType: {
title: '交互方式',
type: 'string',
widget: 'select',
enum: ['下拉框', '分组模态', '树形模态'],
default: '下拉框',
enumNames: ['下拉框', '分组模态', '树形模态'],
displayType: 'row',
labelWidth: 80,
},
width: { width: {
title: '控件占比', title: '控件占比',
type: 'string', type: 'string',
widget: 'RadioGroupW', widget: 'RadioGroupW',
}, },
}, }
}, },
{ {
text: '关联选择', text: '部门选择',
name: '关联选择', name: '部门选择',
icon: <IconPack.RelevanceSelect />, icon: <IconPack.DeptSelector />,
schema: { schema: {
title: '关联选择', title: '部门选择',
name: '关联选择',
type: 'string', type: 'string',
widget: 'RelevanceSelect', widget: 'DeptSelector',
placeholder: '', placeholder: '',
}, },
setting: { setting: {
...@@ -1342,7 +2847,7 @@ const selectWidgets = [ ...@@ -1342,7 +2847,7 @@ const selectWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 75, labelWidth: 80,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
...@@ -1354,7 +2859,6 @@ const selectWidgets = [ ...@@ -1354,7 +2859,6 @@ const selectWidgets = [
title: '展示名称', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput',
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
...@@ -1363,8 +2867,6 @@ const selectWidgets = [ ...@@ -1363,8 +2867,6 @@ const selectWidgets = [
presetValue: { presetValue: {
title: '默认值', title: '默认值',
type: 'string', type: 'string',
widget: 'CascadeDefault',
dependencies: ['sourceType'],
}, },
description: { description: {
title: '字段说明', title: '字段说明',
...@@ -1386,50 +2888,52 @@ const selectWidgets = [ ...@@ -1386,50 +2888,52 @@ const selectWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
fieldParent: {
title: '父字段名',
type: 'string',
// required: true,
widget: 'FieldNames',
dependencies: ['$id'],
},
dictionary: {
title: '数据字典',
name: '数据字典',
// required: true,
type: 'string',
widget: 'Dictionary',
},
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '33%', width: '25%',
}, },
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '33%', width: '25%',
}, },
description: { isMultiple: {
title: '字段说明', title: '多选',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
isStoreID: {
title: '是否存储ID',
type: 'boolean',
default: false,
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string', type: 'string',
widget: 'RadioGroupW',
}, },
...groupStyle,
} }
}, },
{ {
text: '级联选择', text: '台账选择',
name: '级联选择', name: '台账选择',
icon: <IconPack.CascadeSelector />, icon: <IconPack.AccountSelector />,
schema: { schema: {
title: '级联选择', title: '台账选择',
name: '级联选择',
type: 'string', type: 'string',
widget: 'CascadeSelector', widget: 'AccountSelector',
placeholder: '', placeholder: '',
}, },
setting: { setting: {
...@@ -1448,9 +2952,8 @@ const selectWidgets = [ ...@@ -1448,9 +2952,8 @@ const selectWidgets = [
}, },
title: { title: {
title: '展示名称', title: '展示名称',
required: true,
type: 'string', type: 'string',
widget: 'htmlInput', required: true,
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
...@@ -1459,7 +2962,6 @@ const selectWidgets = [ ...@@ -1459,7 +2962,6 @@ const selectWidgets = [
presetValue: { presetValue: {
title: '默认值', title: '默认值',
type: 'string', type: 'string',
widget: 'CascadeDefault',
}, },
description: { description: {
title: '字段说明', title: '字段说明',
...@@ -1481,57 +2983,105 @@ const selectWidgets = [ ...@@ -1481,57 +2983,105 @@ const selectWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
sourceType: { accountName: {
title: '来源方式', title: '台账名称',
name: '来源方式', name: '台账名称',
type: 'string', type: 'string',
widget: 'select', widget: 'AccountName',
default: '城市数据',
enum: ['城市数据'],
enumNames: ['城市数据'],
}, },
required: { fieldshine: {
title: '必填', title: '映射字段',
name: '映射字段',
type: 'array',
widget: 'Fieldshine',
dependencies: ['accountName', '$id'],
default: [],
description: '多字段映射仅支持单选',
},
fieldList: {
title: '前端显示字段',
type: 'array',
default: [],
widget: 'FieldList',
dependencies: ['accountName', '$id'],
description: '默认获取前端台账字段',
},
isStoreID: {
title: '存储ID',
name: '存储ID',
type: 'boolean',
default: false,
displayType: 'row',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后将会存储台账的ID',
},
siteFilter: {
title: '站点过滤',
name: '站点过滤',
type: 'boolean',
default: false,
displayType: 'row',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后只显示自己所属站点数据',
},
autofill: {
title: '自动映射值',
name: '站点过滤',
type: 'boolean',
default: false,
displayType: 'row',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后会将台账中的值自动映射在表单中(移动端)',
},
isMultiple: {
title: '多选',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '40%', displayType: 'row',
labelWidth: 100,
widget: 'BooleanSwitch',
hidden: '{{formData.fieldshine.length !== 1}}',
},
sql: {
title: 'SQL过滤',
name: 'SQL过滤',
type: 'string',
widget: 'SqlFilter',
props: { props: {
style: { placeholder: '示例:部门="XX部门"'
marginLeft: '10px',
}
} }
}, },
required: {
title: '必填',
type: 'boolean',
default: false,
width: '33%',
},
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '30%', width: '33%',
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
}, },
}, ...groupStyle,
}
} }
] ]
const businessWidgets = [ const dateWidgets = [
{ {
text: '人员选择', text: '日期选择',
name: '人员选择', name: '日期选择',
icon: <IconPack.PersonSelector />, icon: <IconPack.DateTime />,
schema: { schema: {
title: '人员选择', title: '日期选择',
type: 'string', type: 'string',
widget: 'PersonSelector', widget: 'DateTime',
placeholder: '', placeholder: '',
}, },
setting: { setting: {
...@@ -1540,7 +3090,7 @@ const businessWidgets = [ ...@@ -1540,7 +3090,7 @@ const businessWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 75,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
...@@ -1557,10 +3107,6 @@ const businessWidgets = [ ...@@ -1557,10 +3107,6 @@ const businessWidgets = [
title: '提示语', title: '提示语',
type: 'string', type: 'string',
}, },
presetValue: {
title: '默认值',
type: 'string',
},
description: { description: {
title: '字段说明', title: '字段说明',
type: 'string', type: 'string',
...@@ -1581,77 +3127,65 @@ const businessWidgets = [ ...@@ -1581,77 +3127,65 @@ const businessWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
role: { calculateRule: {
title: '机构角色', title: '计算规则',
type: 'string', type: 'string',
widget: 'GroupAndRole', widget: 'CalculateRule',
},
isMySite: {
title: '本人站点',
name: '本人站点',
required: true,
default: false,
type: 'boolean',
widget: 'checkbox',
width: '50%',
},
isStoreID: {
title: '是否存储ID',
type: 'boolean',
default: false,
width: '50%',
}, },
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '33%', width: '40%',
props: {
style: {
marginLeft: '10px',
}
}
}, },
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '33%', width: '30%',
}, },
isMultiple: { format: {
title: '多选', title: '日期格式',
type: 'boolean', type: 'string',
widget: 'checkbox', enum: ['date', 'dateTime', 'year', 'month', 'week', 'quarter', 'datePeriod'],
default: false, default: 'date',
width: '33%', enumNames: ['日期', '日期时间', '日期年份', '日期月份', '日期周', '日期季度', '日期时段'],
},
options: {
title: '选项',
type: 'string',
widget: 'select',
enum: ['默认为空', '默认为当前时间', '不超过当前时间'],
default: '默认为空',
enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
type: 'object', type: 'object',
properties: {} properties: {}
}, },
interactiveType: {
title: '交互方式',
type: 'string',
widget: 'select',
enum: ['下拉框', '分组模态', '树形模态'],
default: '下拉框',
enumNames: ['下拉框', '分组模态', '树形模态'],
displayType: 'row',
labelWidth: 80,
},
width: { width: {
title: '控件占比', title: '控件占比',
type: 'string', type: 'string',
widget: 'RadioGroupW', widget: 'RadioGroupW',
}, },
} },
}, },
{ {
text: '部门选择', text: '时间选择',
name: '部门选择', name: '时间选择',
icon: <IconPack.DeptSelector />, icon: <IconPack.Time />,
schema: { schema: {
title: '部门选择', title: '时间选择',
type: 'string', type: 'string',
widget: 'DeptSelector', widget: 'Time',
placeholder: '', placeholder: '',
}, },
setting: { setting: {
...@@ -1660,7 +3194,7 @@ const businessWidgets = [ ...@@ -1660,7 +3194,7 @@ const businessWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 75,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
...@@ -1672,15 +3206,12 @@ const businessWidgets = [ ...@@ -1672,15 +3206,12 @@ const businessWidgets = [
title: '展示名称', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput',
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
type: 'string', type: 'string',
}, },
presetValue: {
title: '默认值',
type: 'string',
},
description: { description: {
title: '字段说明', title: '字段说明',
type: 'string', type: 'string',
...@@ -1701,31 +3232,39 @@ const businessWidgets = [ ...@@ -1701,31 +3232,39 @@ const businessWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
calculateRule: {
title: '计算规则',
type: 'string',
widget: 'CalculateRule',
},
presetValue: {
title: '默认值',
type: 'string',
widget: 'TimeDefault',
format: '{{formData.format}}',
description: '勾选默认当前时间此处配置无效'
},
options: {
title: '选项',
type: 'string',
widget: 'select',
enum: ['默认为空', '默认为当前时间', '不超过当前时间'],
default: '默认为空',
enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
},
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '25%', width: '50%',
}, },
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '25%', width: '50%',
},
isMultiple: {
title: '多选',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
isStoreID: {
title: '是否存储ID',
type: 'boolean',
default: false,
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
...@@ -1739,15 +3278,20 @@ const businessWidgets = [ ...@@ -1739,15 +3278,20 @@ const businessWidgets = [
}, },
} }
}, },
]
const fileWidgets = [
{ {
text: '台账选择', text: '附件',
name: '台账选择', name: '附件',
icon: <IconPack.AccountSelector />, icon: <IconPack.FileUpload />,
schema: { schema: {
title: '台账选择', title: '附件',
type: 'string', type: 'string',
widget: 'AccountSelector', widget: 'FileUpload',
placeholder: '', width: '100%',
preview: true,
isUncompressed: true,
}, },
setting: { setting: {
widget: { widget: {
...@@ -1755,7 +3299,7 @@ const businessWidgets = [ ...@@ -1755,7 +3299,7 @@ const businessWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 75, labelWidth: 80,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
...@@ -1772,14 +3316,14 @@ const businessWidgets = [ ...@@ -1772,14 +3316,14 @@ const businessWidgets = [
title: '提示语', title: '提示语',
type: 'string', type: 'string',
}, },
presetValue: {
title: '默认值',
type: 'string',
},
description: { description: {
title: '字段说明', title: '字段说明',
type: 'string', type: 'string',
}, },
presetValue: {
title: '默认值',
type: 'string',
},
isHidden: { isHidden: {
title: '是否隐藏', title: '是否隐藏',
type: 'boolean', type: 'boolean',
...@@ -1796,105 +3340,103 @@ const businessWidgets = [ ...@@ -1796,105 +3340,103 @@ const businessWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
accountName: { fileType: {
title: '台账名称', title: '文件类型',
name: '台账名称',
type: 'string', type: 'string',
widget: 'AccountName', widget: 'FileTypeSelect',
enum: ['全部', '图片', '文档', '音频', '视频'],
enumNames: ['全部', '图片', '文档', '音频', '视频'],
default: '全部',
}, },
fieldshine: { durationTime: {
title: '映射字段', title: "{{formData.fileType+'最大时长'}}",
name: '映射字段', type: 'number',
type: 'array', description: '秒',
widget: 'Fieldshine', widget: 'slider',
dependencies: ['accountName', '$id'], default: 60,
default: [], min: 1,
description: '多字段映射仅支持单选', max: 60,
hidden: "{{!['音频', '视频'].includes(formData.fileType)}}",
dependencies: ['fileType']
}, },
fieldList: { templateFile: {
title: '前端显示字段', title: '模板文件',
type: 'array', type: 'string',
default: [], widget: 'TemplateFile',
widget: 'FieldList',
dependencies: ['accountName', '$id'],
description: '默认获取前端台账字段',
}, },
isStoreID: { disabled: {
title: '存储ID', title: '只读',
name: '存储ID',
type: 'boolean', type: 'boolean',
widget: 'checkbox',
default: false, default: false,
displayType: 'row', width: '50%',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后将会存储台账的ID',
}, },
siteFilter: { required: {
title: '站点过滤', title: '必填',
name: '站点过滤',
type: 'boolean', type: 'boolean',
widget: 'checkbox',
default: false, default: false,
displayType: 'row', width: '50%',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后只显示自己所属站点数据',
}, },
autofill: { preview: {
title: '自动映射值', title: '预览',
name: '站点过滤',
type: 'boolean', type: 'boolean',
default: false, widget: 'checkbox',
displayType: 'row', default: true,
labelWidth: 110, width: '50%',
widget: 'BooleanSwitch', },
description: '开启后会将台账中的值自动映射在表单中(移动端)', download: {
title: '下载',
type: 'boolean',
widget: 'checkbox',
default: true,
width: '50%',
}, },
isMultiple: { isUncompressed: {
title: '多选', title: '压缩',
type: 'boolean', type: 'boolean',
widget: 'checkbox',
default: false,
displayType: 'row',
labelWidth: 100,
widget: 'BooleanSwitch', widget: 'BooleanSwitch',
hidden: '{{formData.fieldshine.length !== 1}}', description: '附件是否压缩(压缩后清晰度会降低)',
},
sql: {
title: 'SQL过滤',
name: 'SQL过滤',
type: 'string',
widget: 'SqlFilter',
props: {
placeholder: '示例:部门="XX部门"'
}
}, },
required: { photo: {
title: '必填', title: '允许从相册选取',
type: 'boolean', type: 'boolean',
widget: 'BooleanSwitch',
description: '仅支持移动端',
default: false, default: false,
width: '33%', hidden: "{{!['图片', '视频'].includes(formData.fileType)}}"
}, },
disabled: { watermark: {
title: '只读', title: '水印',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'BooleanSwitch',
description: '图片是否添加水印(仅支持移动端)',
default: false, default: false,
width: '33%', hidden: "{{!['图片'].includes(formData.fileType)}}"
}, },
...groupStyle, groupStyle: {
} title: '控件样式',
} type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
},
},
] ]
const dateWidgets = [ const mapWidgets = [
{ {
text: '日期选择', text: '地图坐标',
name: '日期选择', name: '地图坐标',
icon: <IconPack.DateTime />, icon: <IconPack.Coordinate />,
schema: { schema: {
title: '日期选择', title: '地图坐标',
type: 'string', type: 'string',
widget: 'DateTime', widget: 'Coordinate',
placeholder: '', placeholder: '',
}, },
setting: { setting: {
...@@ -1913,8 +3455,8 @@ const dateWidgets = [ ...@@ -1913,8 +3455,8 @@ const dateWidgets = [
}, },
title: { title: {
title: '展示名称', title: '展示名称',
required: true,
type: 'string', type: 'string',
required: true,
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
...@@ -1940,44 +3482,44 @@ const dateWidgets = [ ...@@ -1940,44 +3482,44 @@ const dateWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
calculateRule: { currentAddress: {
title: '计算规则', title: '自动获取',
type: 'boolean',
widget: 'BooleanSwitch',
description: '自动获取当前地址(手持端专用)'
},
addressSync: {
title: '地址同步',
type: 'string', type: 'string',
widget: 'CalculateRule', widget: 'AddressSync',
description: '位置信息将会同步到下方字段中',
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
description: '只读情况下会显示缩略图'
},
areaSync: {
title: '区域同步',
type: 'string',
widget: 'AreaSync',
description: '坐标对应最小区域会同步到下方字段中',
}, },
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '40%', width: '33%',
props: {
style: {
marginLeft: '10px',
}
}
}, },
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '30%', width: '25%',
},
format: {
title: '日期格式',
type: 'string',
enum: ['date', 'dateTime', 'year', 'month', 'week', 'quarter', 'datePeriod'],
default: 'date',
enumNames: ['日期', '日期时间', '日期年份', '日期月份', '日期周', '日期季度', '日期时段'],
},
options: {
title: '选项',
type: 'string',
widget: 'select',
enum: ['默认为空', '默认为当前时间', '不超过当前时间'],
default: '默认为空',
enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
...@@ -1992,13 +3534,13 @@ const dateWidgets = [ ...@@ -1992,13 +3534,13 @@ const dateWidgets = [
}, },
}, },
{ {
text: '时间选择', text: '设备选择',
name: '时间选择', name: '设备选择',
icon: <IconPack.Time />, icon: <IconPack.Device />,
schema: { schema: {
title: '时间选择', title: '设备选择',
type: 'string', type: 'string',
widget: 'Time', widget: 'Device',
placeholder: '', placeholder: '',
}, },
setting: { setting: {
...@@ -2019,7 +3561,6 @@ const dateWidgets = [ ...@@ -2019,7 +3561,6 @@ const dateWidgets = [
title: '展示名称', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput',
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
...@@ -2045,39 +3586,33 @@ const dateWidgets = [ ...@@ -2045,39 +3586,33 @@ const dateWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
calculateRule: { fieldshine: {
title: '计算规则', title: '映射字段',
type: 'string', name: '映射字段',
widget: 'CalculateRule', type: 'array',
}, widget: 'DeviceFieldshine',
presetValue: { default: [],
title: '默认值',
type: 'string',
widget: 'TimeDefault',
format: '{{formData.format}}',
description: '勾选默认当前时间此处配置无效'
}, },
options: { screenShot: {
title: '选项', title: '是否显示缩略图',
type: 'string', type: 'boolean',
widget: 'select', widget: 'BooleanSwitch',
enum: ['默认为空', '默认为当前时间', '不超过当前时间'], default: false,
default: '默认为空', description: '只读情况下会显示缩略图'
enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
}, },
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '50%', width: '33%',
}, },
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '50%', width: '25%',
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
...@@ -2089,22 +3624,17 @@ const dateWidgets = [ ...@@ -2089,22 +3624,17 @@ const dateWidgets = [
type: 'string', type: 'string',
widget: 'RadioGroupW', widget: 'RadioGroupW',
}, },
} },
}, },
]
const fileWidgets = [
{ {
text: '件', text: '路径控件',
name: '件', name: '路径控件',
icon: <IconPack.FileUpload />, icon: <IconPack.DrawPath />,
schema: { schema: {
title: '件', title: '路径控件',
type: 'string', type: 'string',
widget: 'FileUpload', widget: 'DrawPath',
width: '100%', placeholder: '',
preview: true,
isUncompressed: true,
}, },
setting: { setting: {
widget: { widget: {
...@@ -2112,7 +3642,7 @@ const fileWidgets = [ ...@@ -2112,7 +3642,7 @@ const fileWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 75,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
...@@ -2122,8 +3652,8 @@ const fileWidgets = [ ...@@ -2122,8 +3652,8 @@ const fileWidgets = [
}, },
title: { title: {
title: '展示名称', title: '展示名称',
type: 'string',
required: true, required: true,
type: 'string',
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
...@@ -2133,15 +3663,12 @@ const fileWidgets = [ ...@@ -2133,15 +3663,12 @@ const fileWidgets = [
title: '字段说明', title: '字段说明',
type: 'string', type: 'string',
}, },
presetValue: {
title: '默认值',
type: 'string',
},
isHidden: { isHidden: {
title: '是否隐藏', title: '是否隐藏',
type: 'boolean', type: 'boolean',
widget: 'IsHidden', widget: 'IsHidden',
default: false, default: false,
disabled: disabled,
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 80,
}, },
...@@ -2150,82 +3677,30 @@ const fileWidgets = [ ...@@ -2150,82 +3677,30 @@ const fileWidgets = [
type: 'string', type: 'string',
description: '所有形态默认显示', description: '所有形态默认显示',
widget: 'HiddenCondition', widget: 'HiddenCondition',
disabled: disabled,
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['tableTypeParent', 'IsSystemField', 'isHidden'],
},
fileType: {
title: '文件类型',
type: 'string',
widget: 'FileTypeSelect',
enum: ['全部', '图片', '文档', '音频', '视频'],
enumNames: ['全部', '图片', '文档', '音频', '视频'],
default: '全部',
},
durationTime: {
title: "{{formData.fileType+'最大时长'}}",
type: 'number',
description: '秒',
widget: 'slider',
default: 60,
min: 1,
max: 60,
hidden: "{{!['音频', '视频'].includes(formData.fileType)}}",
dependencies: ['fileType']
},
templateFile: {
title: '模板文件',
type: 'string',
widget: 'TemplateFile',
}, },
disabled: { screenShot: {
title: '只读', title: '是否显示缩略图',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'BooleanSwitch',
default: false, default: false,
width: '50%', description: '只读情况下会显示缩略图'
}, },
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '50%', width: '33%',
},
preview: {
title: '预览',
type: 'boolean',
widget: 'checkbox',
default: true,
width: '50%',
},
download: {
title: '下载',
type: 'boolean',
widget: 'checkbox',
default: true,
width: '50%',
},
isUncompressed: {
title: '压缩',
type: 'boolean',
widget: 'BooleanSwitch',
description: '附件是否压缩(压缩后清晰度会降低)',
},
photo: {
title: '允许从相册选取',
type: 'boolean',
widget: 'BooleanSwitch',
description: '仅支持移动端',
default: false,
hidden: "{{!['图片', '视频'].includes(formData.fileType)}}"
}, },
watermark: { disabled: {
title: '水印', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'BooleanSwitch', widget: 'checkbox',
description: '图片是否添加水印(仅支持移动端)',
default: false, default: false,
hidden: "{{!['图片'].includes(formData.fileType)}}" width: '25%',
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
...@@ -2239,17 +3714,14 @@ const fileWidgets = [ ...@@ -2239,17 +3714,14 @@ const fileWidgets = [
}, },
}, },
}, },
]
const mapWidgets = [
{ {
text: '地图坐标', text: '区域控件',
name: '地图坐标', name: '区域控件',
icon: <IconPack.Coordinate />, icon: <IconPack.DrawArea />,
schema: { schema: {
title: '地图坐标', title: '区域控件',
type: 'string', type: 'string',
widget: 'Coordinate', widget: 'DrawArea',
placeholder: '', placeholder: '',
}, },
setting: { setting: {
...@@ -2268,8 +3740,8 @@ const mapWidgets = [ ...@@ -2268,8 +3740,8 @@ const mapWidgets = [
}, },
title: { title: {
title: '展示名称', title: '展示名称',
type: 'string',
required: true, required: true,
type: 'string',
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
...@@ -2295,18 +3767,6 @@ const mapWidgets = [ ...@@ -2295,18 +3767,6 @@ const mapWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
currentAddress: {
title: '自动获取',
type: 'boolean',
widget: 'BooleanSwitch',
description: '自动获取当前地址(手持端专用)'
},
addressSync: {
title: '地址同步',
type: 'string',
widget: 'AddressSync',
description: '位置信息将会同步到下方字段中',
},
screenShot: { screenShot: {
title: '是否显示缩略图', title: '是否显示缩略图',
type: 'boolean', type: 'boolean',
...@@ -2314,12 +3774,6 @@ const mapWidgets = [ ...@@ -2314,12 +3774,6 @@ const mapWidgets = [
default: false, default: false,
description: '只读情况下会显示缩略图' description: '只读情况下会显示缩略图'
}, },
areaSync: {
title: '区域同步',
type: 'string',
widget: 'AreaSync',
description: '坐标对应最小区域会同步到下方字段中',
},
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
...@@ -2347,14 +3801,16 @@ const mapWidgets = [ ...@@ -2347,14 +3801,16 @@ const mapWidgets = [
}, },
}, },
{ {
text: '设备选择', text: '区域任务',
name: '设备选择', name: '区域任务',
icon: <IconPack.Device />, icon: <IconPack.DrawArea />,
schema: { schema: {
title: '设备选择', title: '区域任务',
type: 'string', type: 'string',
widget: 'Device', widget: 'AreaTask',
placeholder: '', placeholder: '',
width: '100%',
labelWidth: 1,
}, },
setting: { setting: {
widget: { widget: {
...@@ -2372,13 +3828,18 @@ const mapWidgets = [ ...@@ -2372,13 +3828,18 @@ const mapWidgets = [
}, },
title: { title: {
title: '展示名称', title: '展示名称',
required: true,
type: 'string', type: 'string',
widget: 'htmlInput',
default: '区域任务',
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
type: 'string', type: 'string',
}, },
presetValue: {
title: '默认值',
type: 'string',
},
description: { description: {
title: '字段说明', title: '字段说明',
type: 'string', type: 'string',
...@@ -2399,19 +3860,30 @@ const mapWidgets = [ ...@@ -2399,19 +3860,30 @@ const mapWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
fieldshine: { areaTaskShine: {
title: '映射字段', title: '巡检对象',
name: '映射字段', name: '巡检对象',
type: 'array', type: 'array',
widget: 'DeviceFieldshine', widget: 'AreaTaskShine',
default: [], default: [],
}, },
screenShot: { fieldList: {
title: '是否显示缩略图', title: '前端显示字段',
type: 'boolean', name: '前端显示字段',
widget: 'BooleanSwitch', type: 'array',
default: false, default: [],
description: '只读情况下会显示缩略图' widget: 'TaskFieldList',
description: '用于区域控件列表显示',
dependencies: ['areaTaskShine']
},
taskSummary: {
title: '任务摘要',
name: '任务摘要',
type: 'array',
default: [],
widget: 'TaskFieldList',
description: '用于任务对象显示',
dependencies: ['areaTaskShine']
}, },
required: { required: {
title: '必填', title: '必填',
...@@ -2439,15 +3911,18 @@ const mapWidgets = [ ...@@ -2439,15 +3911,18 @@ const mapWidgets = [
}, },
}, },
}, },
]
const advancedWidgets = [
{ {
text: '路径控件', text: '富文本',
name: '路径控件', name: '富文本',
icon: <IconPack.DrawPath />, icon: <IconPack.RichText />,
schema: { schema: {
title: '路径控件', title: '富文本',
type: 'string', type: 'string',
widget: 'DrawPath', widget: 'RichText',
placeholder: '', width: '100%',
}, },
setting: { setting: {
widget: { widget: {
...@@ -2455,7 +3930,7 @@ const mapWidgets = [ ...@@ -2455,7 +3930,7 @@ const mapWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 75, labelWidth: 80,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
...@@ -2467,10 +3942,7 @@ const mapWidgets = [ ...@@ -2467,10 +3942,7 @@ const mapWidgets = [
title: '展示名称', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
}, widget: 'htmlInput',
placeholder: {
title: '提示语',
type: 'string',
}, },
description: { description: {
title: '字段说明', title: '字段说明',
...@@ -2481,7 +3953,6 @@ const mapWidgets = [ ...@@ -2481,7 +3953,6 @@ const mapWidgets = [
type: 'boolean', type: 'boolean',
widget: 'IsHidden', widget: 'IsHidden',
default: false, default: false,
disabled: disabled,
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 80,
}, },
...@@ -2490,30 +3961,26 @@ const mapWidgets = [ ...@@ -2490,30 +3961,26 @@ const mapWidgets = [
type: 'string', type: 'string',
description: '所有形态默认显示', description: '所有形态默认显示',
widget: 'HiddenCondition', widget: 'HiddenCondition',
disabled: disabled,
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['tableTypeParent', 'IsSystemField', 'isHidden'], dependencies: ['isHidden'],
}, },
screenShot: { presetValue: {
title: '是否显示缩略图', title: '默认值',
type: 'boolean', type: 'string',
widget: 'BooleanSwitch', widget: 'RichTextDefault',
default: false,
description: '只读情况下会显示缩略图'
}, },
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
widget: 'checkbox',
default: false, default: false,
width: '33%', width: '50%',
}, },
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '25%', width: '50%',
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
...@@ -2528,14 +3995,15 @@ const mapWidgets = [ ...@@ -2528,14 +3995,15 @@ const mapWidgets = [
}, },
}, },
{ {
text: '区域控件', text: '编码',
name: '区域控件', name: '编码',
icon: <IconPack.DrawArea />, icon: <IconPack.Coding />,
schema: { schema: {
title: '区域控件', title: '编码',
type: 'string', type: 'string',
widget: 'DrawArea', widget: 'Coding',
placeholder: '', disabled: true,
required: false,
}, },
setting: { setting: {
widget: { widget: {
...@@ -2543,18 +4011,23 @@ const mapWidgets = [ ...@@ -2543,18 +4011,23 @@ const mapWidgets = [
type: 'string', type: 'string',
widget: 'WidgetType', widget: 'WidgetType',
displayType: 'row', displayType: 'row',
labelWidth: 75, labelWidth: 80,
}, },
$id: { $id: {
title: '数据源', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
title: { title: {
title: '展示名称', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
...@@ -2563,6 +4036,8 @@ const mapWidgets = [ ...@@ -2563,6 +4036,8 @@ const mapWidgets = [
description: { description: {
title: '字段说明', title: '字段说明',
type: 'string', type: 'string',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
isHidden: { isHidden: {
title: '是否隐藏', title: '是否隐藏',
...@@ -2580,26 +4055,22 @@ const mapWidgets = [ ...@@ -2580,26 +4055,22 @@ const mapWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
screenShot: { prefixion: {
title: '是否显示缩略图', title: '前缀',
type: 'boolean', type: 'string',
widget: 'BooleanSwitch', disabled: disabled,
default: false, dependencies: ['tableTypeParent', 'IsSystemField'],
description: '只读情况下会显示缩略图'
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
}, },
disabled: { codingType: {
title: '只读', title: '编码方式',
type: 'boolean', type: 'string',
widget: 'checkbox', widget: 'select',
default: false, enum: ['1', '2', '3'],
width: '25%', default: '3',
enumNames: ['前缀-年份-六位编码', '前缀-年份月份-六位编码', '前缀-八位编码'],
description: '{{rootValue.codingType === "1" ?"示例:XJ-2019-000001" : (rootValue.codingType === "2" ? "示例: XJ-201909-000001" : "示例: XJ00000001")}}',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
...@@ -2610,20 +4081,21 @@ const mapWidgets = [ ...@@ -2610,20 +4081,21 @@ const mapWidgets = [
title: '控件占比', title: '控件占比',
type: 'string', type: 'string',
widget: 'RadioGroupW', widget: 'RadioGroupW',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
}, },
}, },
{ {
text: '区域任务', text: '级联选择',
name: '区域任务', name: '级联选择',
icon: <IconPack.DrawArea />, icon: <IconPack.CascadeSelector />,
schema: { schema: {
title: '区域任务', title: '级联选择',
name: '级联选择',
type: 'string', type: 'string',
widget: 'AreaTask', widget: 'CascadeSelector',
placeholder: '', placeholder: '',
width: '100%',
labelWidth: 1,
}, },
setting: { setting: {
widget: { widget: {
...@@ -2641,9 +4113,9 @@ const mapWidgets = [ ...@@ -2641,9 +4113,9 @@ const mapWidgets = [
}, },
title: { title: {
title: '展示名称', title: '展示名称',
required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
default: '区域任务',
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
...@@ -2652,6 +4124,7 @@ const mapWidgets = [ ...@@ -2652,6 +4124,7 @@ const mapWidgets = [
presetValue: { presetValue: {
title: '默认值', title: '默认值',
type: 'string', type: 'string',
widget: 'CascadeDefault',
}, },
description: { description: {
title: '字段说明', title: '字段说明',
...@@ -2673,44 +4146,33 @@ const mapWidgets = [ ...@@ -2673,44 +4146,33 @@ const mapWidgets = [
hidden: "{{formData.isHidden}}", hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'], dependencies: ['isHidden'],
}, },
areaTaskShine: { sourceType: {
title: '巡检对象', title: '来源方式',
name: '巡检对象', name: '来源方式',
type: 'array', type: 'string',
widget: 'AreaTaskShine', widget: 'select',
default: [], default: '城市数据',
}, enum: ['城市数据'],
fieldList: { enumNames: ['城市数据'],
title: '前端显示字段',
name: '前端显示字段',
type: 'array',
default: [],
widget: 'TaskFieldList',
description: '用于区域控件列表显示',
dependencies: ['areaTaskShine']
},
taskSummary: {
title: '任务摘要',
name: '任务摘要',
type: 'array',
default: [],
widget: 'TaskFieldList',
description: '用于任务对象显示',
dependencies: ['areaTaskShine']
}, },
required: { required: {
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '33%', width: '40%',
props: {
style: {
marginLeft: '10px',
}
}
}, },
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '25%', width: '30%',
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
...@@ -2724,9 +4186,6 @@ const mapWidgets = [ ...@@ -2724,9 +4186,6 @@ const mapWidgets = [
}, },
}, },
}, },
]
const advancedWidgets = [
{ {
text: '关联表单', text: '关联表单',
name: '关联表单', name: '关联表单',
...@@ -3062,25 +4521,25 @@ const settings = [ ...@@ -3062,25 +4521,25 @@ const settings = [
widgets: layoutWidgets widgets: layoutWidgets
}, },
{ {
title: '文本控件', title: '基础控件',
widgets: textWidgets widgets: baseWidgets
},
{
title: '选择器控件',
widgets: selectWidgets,
},
{
title: '业务控件',
widgets: businessWidgets,
},
{
title: '时间控件',
widgets: dateWidgets,
},
{
title: '附件控件',
widgets: fileWidgets,
}, },
// {
// title: '选择器控件',
// widgets: selectWidgets,
// },
// {
// title: '业务控件',
// widgets: businessWidgets,
// },
// {
// title: '时间控件',
// widgets: dateWidgets,
// },
// {
// title: '附件控件',
// widgets: fileWidgets,
// },
{ {
title: 'GIS控件', title: 'GIS控件',
widgets: mapWidgets, widgets: mapWidgets,
......
...@@ -10,6 +10,30 @@ import FormRender from '../FormRender' ...@@ -10,6 +10,30 @@ import FormRender from '../FormRender'
import { isObject, getVerify, setFieldJson, getNanoid } from '../../utils' import { isObject, getVerify, setFieldJson, getNanoid } from '../../utils'
import Drag from '../components/Drag' import Drag from '../components/Drag'
import styles from '../../main.less' import styles from '../../main.less'
import Help from './Help'
const options = [
{
title: '布局控件',
one: '',
background: '#F8F7FF',
},
{
title: '基础控件',
one: '单行文本',
background: '#F4F8FF',
},
{
title: 'GIS控件',
one: '地图坐标',
background: '#F2F9F4',
},
{
title: '高级控件',
one: '富文本',
background: '#FDF8EC',
},
]
const FormDesigner = (props, ref) => { const FormDesigner = (props, ref) => {
...@@ -30,6 +54,7 @@ const FormDesigner = (props, ref) => { ...@@ -30,6 +54,7 @@ const FormDesigner = (props, ref) => {
const [open, setOpen] = useState(false) const [open, setOpen] = useState(false)
const designerRef = useRef(null) const designerRef = useRef(null)
const formRenderRef = useRef(null) const formRenderRef = useRef(null)
const helpRef = useRef(null)
const settingsParent = useMemo(() => { const settingsParent = useMemo(() => {
let settingsParent = [] let settingsParent = []
...@@ -355,8 +380,42 @@ const FormDesigner = (props, ref) => { ...@@ -355,8 +380,42 @@ const FormDesigner = (props, ref) => {
return null return null
} }
const addHelp = () => {
let eles = document.querySelectorAll('.left-layout .f6')
eles.forEach((v, i) => {
let div = document.createElement('div')
div.setAttribute('class', 'iocn-help')
div.setAttribute('type', options?.[i]?.title)
v.appendChild(div)
div.onclick = (e) => {
helpRef.current.open(options?.[i]?.one)
}
})
}
const changeUI = () => {
let eles = document.querySelectorAll('.left-layout .pl0')
eles.forEach((ele, i) => {
let item = ele.querySelectorAll('.left-item')
item.forEach(sls => {
sls.style.background = options?.[i]?.background
})
})
}
const changeElement = () => {
// addHelp()
changeUI()
}
useEffect(() => {
setTimeout(() => {
changeElement()
}, 1000)
}, [])
return ( return (
<div className={styles.pandaXform} style={{ height: '100%' }}> <div className={styles.pandaXform} style={{ height: '100%', padding: 0 }}>
<div style={{ width: '100%', height: '100%' }}> <div style={{ width: '100%', height: '100%' }}>
<Generator <Generator
// configProvider={{ prefixCls: prefixClsPandaXform }} // configProvider={{ prefixCls: prefixClsPandaXform }}
...@@ -405,13 +464,10 @@ const FormDesigner = (props, ref) => { ...@@ -405,13 +464,10 @@ const FormDesigner = (props, ref) => {
<FormRender <FormRender
ref={formRenderRef} ref={formRenderRef}
schemaValues={{ formJson: schema }} schemaValues={{ formJson: schema }}
// codes={{
// 工单编号: '12421413431',
// 事件编号: 'PO230000013',
// }}
/> />
</Drag> </Drag>
</div> </div>
<Help ref={helpRef} />
</div> </div>
) )
......
...@@ -174,9 +174,10 @@ const Coordinate = (props) => { ...@@ -174,9 +174,10 @@ const Coordinate = (props) => {
addons.setValue(targetPath, targetPathText) addons.setValue(targetPath, targetPathText)
} else { } else {
let LngLat = mercatorToLngLat(currentPointerCoordinate[0], currentPointerCoordinate[1]) let LngLat = mercatorToLngLat(currentPointerCoordinate[0], currentPointerCoordinate[1])
let newCoord = gcj02_To_gps84(LngLat[0], LngLat[1])
let postStr = { let postStr = {
lon: LngLat[0], lon: newCoord.lng,
lat: LngLat[1], lat: newCoord.lat,
ver: 1, ver: 1,
} }
let url = `http://api.tianditu.gov.cn/geocoder?postStr=${JSON.stringify(postStr)}&type=geocode&tk=a1d480f55b805db96e1ed295e62c72b1` let url = `http://api.tianditu.gov.cn/geocoder?postStr=${JSON.stringify(postStr)}&type=geocode&tk=a1d480f55b805db96e1ed295e62c72b1`
...@@ -208,13 +209,62 @@ const Coordinate = (props) => { ...@@ -208,13 +209,62 @@ const Coordinate = (props) => {
onChange(currentPointerCoordinate.join(',')) onChange(currentPointerCoordinate.join(','))
} }
/**火星转84*/
const gcj02_To_gps84 = (lng, lat) => {
const pi = 3.1415926535897932384626;
const a = 6378245.0;
const ee = 0.00669342162296594323;
const x_pi = (pi * 3000.0) / 180.0;
const R = 6378137;
const transformLat = (x, y) => {
var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
ret += ((20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0) / 3.0;
ret += ((20.0 * Math.sin(y * pi) + 40.0 * Math.sin((y / 3.0) * pi)) * 2.0) / 3.0;
ret += ((160.0 * Math.sin((y / 12.0) * pi) + 320 * Math.sin((y * pi) / 30.0)) * 2.0) / 3.0;
return ret;
};
const transformLng = (x, y) => {
var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
ret += ((20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0) / 3.0;
ret += ((20.0 * Math.sin(x * pi) + 40.0 * Math.sin((x / 3.0) * pi)) * 2.0) / 3.0;
ret += ((150.0 * Math.sin((x / 12.0) * pi) + 300.0 * Math.sin((x / 30.0) * pi)) * 2.0) / 3.0;
return ret;
};
const transform = (lng, lat) => {
var dLat = transformLat(lng - 105.0, lat - 35.0);
var dLng = transformLng(lng - 105.0, lat - 35.0);
var radLat = (lat / 180.0) * pi;
var magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
var sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / (((a * (1 - ee)) / (magic * sqrtMagic)) * pi);
dLng = (dLng * 180.0) / ((a / sqrtMagic) * Math.cos(radLat) * pi);
var mgLat = lat + dLat;
var mgLng = lng + dLng;
var newCoord = {
lng: mgLng,
lat: mgLat,
};
return newCoord;
};
var coord = transform(lng, lat);
var lontitude = lng * 2 - coord.lng;
var latitude = lat * 2 - coord.lat;
var newCoord = {
lng: lontitude,
lat: latitude,
};
return newCoord;
};
const getAddress = async (presetValue) => { const getAddress = async (presetValue) => {
if (presetValue) { if (presetValue) {
let coordinate = presetValue.split(',') let coordinate = presetValue.split(',')
let LngLat = mercatorToLngLat(coordinate[0], coordinate[1]) let LngLat = mercatorToLngLat(coordinate[0], coordinate[1])
let newCoord = gcj02_To_gps84(LngLat[0], LngLat[1])
let postStr = { let postStr = {
lon: LngLat[0], lon: newCoord.lng,
lat: LngLat[1], lat: newCoord.lat,
ver: 1, ver: 1,
} }
let url = `http://api.tianditu.gov.cn/geocoder?postStr=${JSON.stringify(postStr)}&type=geocode&tk=a1d480f55b805db96e1ed295e62c72b1` let url = `http://api.tianditu.gov.cn/geocoder?postStr=${JSON.stringify(postStr)}&type=geocode&tk=a1d480f55b805db96e1ed295e62c72b1`
......
...@@ -9,7 +9,6 @@ const Placeholder = (props) => { ...@@ -9,7 +9,6 @@ const Placeholder = (props) => {
const { title } = addons.formData const { title } = addons.formData
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
const [areaValue, setAreaValue] = useState('') const [areaValue, setAreaValue] = useState('')
console.log('props', props)
const inputChange = (e) => { const inputChange = (e) => {
onChange(e.target.value) onChange(e.target.value)
......
...@@ -6,7 +6,6 @@ import { filenameVerification } from '../../../../../utils' ...@@ -6,7 +6,6 @@ import { filenameVerification } from '../../../../../utils'
const TemplateFile = (props) => { const TemplateFile = (props) => {
console.log('TemplateFile', props)
const site = window.globalConfig?.userInfo?.site || window.globalConfig?.userInfo?.LocalSite const site = window.globalConfig?.userInfo?.site || window.globalConfig?.userInfo?.LocalSite
const { value, onChange, addons } = props const { value, onChange, addons } = props
......
@import '~antd/es/style/themes/default.less'; @import '~antd/es/style/themes/default.less';
@imgSrc: './assets/images/designer';
@disabledBgColor: rgb(248, 250, 252); @disabledBgColor: rgb(248, 250, 252);
@disabledColor: rgba(0, 0, 0, 0.7); @disabledColor: rgba(0, 0, 0, 0.7);
...@@ -12,6 +13,86 @@ body #app { ...@@ -12,6 +13,86 @@ body #app {
} }
} }
.pandaXform {
//最外层样式
.dnd-container.edit>.field-wrapper.relative.w-100 {
border: none;
padding: 0 !important;
}
.object>.field-wrapper.relative.w-100 {
padding: 0 !important;
margin: 0 !important;
}
//内层框线样式
.fr-content.ml3 {
.field-wrapper.relative.w-100 {
border: none !important;
}
}
//
.fr-field-complex {
border: none !important;
}
.flex.flex-wrap.pl0 {
padding: 10px;
padding-bottom: 0;
}
//选中样式
.field-wrapper.selected-field-wrapper.relative.w-100 {
background: #ecf7ff !important;
}
.left-layout {
width: 267px !important;
padding: 7px;
background: #F1F3F6;
&::-webkit-scrollbar {
width: 0;
}
}
.left-layout>div {
border-radius: 5px;
background: white;
.f6 {
position: relative;
padding: 5px 10px;
margin: 0;
font-weight: bold;
.iocn-help {
position: absolute;
right: 10px;
top: 10px;
width: 12px;
height: 12px;
background: url('@{imgSrc}/帮助.png');
background-size: 100% 100%;
&:hover {
cursor: pointer;
}
}
}
.pl0 {
margin-bottom: 7px;
}
}
.mid-layout.pr2 {
border: none;
}
}
.formRender { .formRender {
.fr-content { .fr-content {
.fr-field.w-100.flex-column { .fr-field.w-100.flex-column {
...@@ -34,7 +115,6 @@ body #app { ...@@ -34,7 +115,6 @@ body #app {
padding-top: 0; padding-top: 0;
.fr-generator-container .left-layout { .fr-generator-container .left-layout {
padding: 10px 0 0 0;
.left-item { .left-item {
justify-content: left; justify-content: left;
......
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