Commit c6ace4be authored by 田翔's avatar 田翔

fix: 地址转化地名优化

parent 3b8604aa
{
"name": "panda-xform",
"version": "6.10.13",
"description": "6.10.13 坐标控件回填地址名称支持文本形态",
"version": "6.10.14",
"description": "6.10.14 地址转化地名优化",
"keywords": [
"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 = {
const layoutWidgets = [
{
text: '分组名称',
name: '分组名称',
text: '分组标题',
name: '分组标题',
icon: <GroupOutlined />,
schema: {
title: '分组名称',
title: '分组标题',
type: 'object',
width: '100%',
},
......@@ -39,8 +39,8 @@ const layoutWidgets = [
},
},
{
text: '描述控件',
name: '描述控件',
text: '描述说明',
name: '描述说明',
icon: <IconPack.SearchLocation />,
schema: {
title: '',
......@@ -72,13 +72,13 @@ const layoutWidgets = [
},
]
const textWidgets = [
const baseWidgets = [
{
text: '文本',
name: '文本',
text: '单行文本',
name: '单行文本',
icon: <IconPack.TextInput />,
schema: {
title: '文本',
title: '单行文本',
type: 'string',
widget: 'TextInput',
placeholder: '',
......@@ -404,8 +404,8 @@ const textWidgets = [
},
},
{
text: '数值',
name: '数值',
text: '数值输入',
name: '数值输入',
icon: <IconPack.NumberInput />,
schema: {
title: '数值',
......@@ -561,14 +561,14 @@ const textWidgets = [
},
},
{
text: '富文本',
name: '富文本',
icon: <IconPack.RichText />,
text: '搜索地址',
name: '搜索地址',
icon: <IconPack.SearchLocation />,
schema: {
title: '富文本',
title: '搜索地址',
type: 'string',
widget: 'RichText',
width: '100%',
widget: 'SearchLocation',
placeholder: '',
},
setting: {
widget: {
......@@ -576,7 +576,7 @@ const textWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 80,
labelWidth: 75,
},
$id: {
title: '数据源',
......@@ -586,9 +586,12 @@ const textWidgets = [
},
title: {
title: '展示名称',
type: 'string',
required: true,
},
placeholder: {
title: '提示语',
type: 'string',
widget: 'htmlInput',
},
description: {
title: '字段说明',
......@@ -610,23 +613,25 @@ const textWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
presetValue: {
title: '默认值',
coordSync: {
title: '坐标同步',
type: 'string',
widget: 'RichTextDefault',
widget: 'CoordSync',
description: '坐标信息将会同步到下方字段中'
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '50%',
width: '33%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '50%',
width: '25%',
},
groupStyle: {
title: '控件样式',
......@@ -641,15 +646,14 @@ const textWidgets = [
},
},
{
text: '编码',
name: '编码',
icon: <IconPack.Coding />,
text: '单选框组',
name: '单选框组',
icon: <IconPack.RadioButton />,
schema: {
title: '编码',
title: '单选框组',
name: '单选框组',
type: 'string',
widget: 'Coding',
disabled: true,
required: false,
widget: 'RadioButton',
},
setting: {
widget: {
......@@ -657,33 +661,27 @@ const textWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 80,
labelWidth: 74,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
placeholder: {
title: '提示语',
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
isHidden: {
title: '是否隐藏',
......@@ -701,22 +699,63 @@ const textWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
prefixion: {
title: '前缀',
sourceType: {
title: '来源方式',
type: 'string',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
widget: 'SourceType',
default: '手动输入',
},
codingType: {
title: '编码方式',
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: 'select',
enum: ['1', '2', '3'],
default: '3',
enumNames: ['前缀-年份-六位编码', '前缀-年份月份-六位编码', '前缀-八位编码'],
description: '{{rootValue.codingType === "1" ?"示例:XJ-2019-000001" : (rootValue.codingType === "2" ? "示例: XJ-201909-000001" : "示例: XJ00000001")}}',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
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: '控件样式',
......@@ -727,20 +766,18 @@ const textWidgets = [
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
},
}
},
{
text: '地址',
name: '地址',
icon: <IconPack.SearchLocation />,
text: '复选框组',
name: '复选框组',
icon: <IconPack.CheckBox />,
schema: {
title: '地址',
title: '复选框组',
name: '复选框组',
type: 'string',
widget: 'SearchLocation',
placeholder: '',
widget: 'CheckBox',
},
setting: {
widget: {
......@@ -758,11 +795,12 @@ const textWidgets = [
},
title: {
title: '展示名称',
type: 'string',
required: true,
type: 'string',
widget: 'htmlInput',
},
placeholder: {
title: '提示语',
presetValue: {
title: '默认值',
type: 'string',
},
description: {
......@@ -774,6 +812,7 @@ const textWidgets = [
type: 'boolean',
widget: 'IsHidden',
default: false,
disabled: disabled,
displayType: 'row',
labelWidth: 80,
},
......@@ -785,25 +824,63 @@ const textWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
coordSync: {
title: '坐标同步',
sourceType: {
title: '来源方式',
type: 'string',
widget: 'CoordSync',
description: '坐标信息将会同步到下方字段中'
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: '字段名',
name: '字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['sourceType', 'tableName'],
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '40%',
props: {
style: {
marginLeft: '10px',
}
}
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
width: '30%',
},
groupStyle: {
title: '控件样式',
......@@ -815,17 +892,14 @@ const textWidgets = [
type: 'string',
widget: 'RadioGroupW',
},
},
}
},
]
const selectWidgets = [
{
text: '下拉',
name: '下拉',
text: '下拉选择',
name: '下拉选择',
icon: <IconPack.ComboBox />,
schema: {
title: '下拉',
title: '下拉选择',
type: 'string',
widget: 'ComboBox',
},
......@@ -990,14 +1064,14 @@ const selectWidgets = [
}
},
{
text: '单选框',
name: '单选框',
icon: <IconPack.RadioButton />,
text: '开关按钮',
name: '开关按钮',
icon: <IconPack.SwitchSelector />,
schema: {
title: '单选框',
name: '单选框',
title: '开关按钮',
name: '开关按钮',
type: 'string',
widget: 'RadioButton',
widget: 'SwitchSelector'
},
setting: {
widget: {
......@@ -1021,7 +1095,9 @@ const selectWidgets = [
},
presetValue: {
title: '默认值',
type: 'string',
type: 'boolean',
widget: 'SwitchDefault',
dependencies: ['showText'],
},
description: {
title: '字段说明',
......@@ -1032,6 +1108,7 @@ const selectWidgets = [
type: 'boolean',
widget: 'IsHidden',
default: false,
disabled: disabled,
displayType: 'row',
labelWidth: 80,
},
......@@ -1043,38 +1120,1273 @@ const selectWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
sourceType: {
title: '来源方式',
type: 'string',
widget: 'SourceType',
default: '手动输入',
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
options: {
title: '',
name: '选项',
type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ key: '选项一', value: '选项一' }],
widget: 'SimpleList',
dependencies: ['sourceType', 'color']
showText: {
title: '显示文字',
type: 'string',
widget: 'ShowText',
default: '开/关',
description: '示例(开/关)'
},
dictionary: {
title: '{{formData.sourceType}}',
name: '{{formData.sourceType}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
description: {
title: '字段说明',
type: 'string',
widget: 'Dictionary',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
},
tableName: {
title: '表名',
name: '表名',
hidden: '{{formData.sourceType !== "表数据"}}',
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
widget: 'RadioGroupW',
},
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: '字段名',
name: '字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
......@@ -1114,14 +2426,14 @@ const selectWidgets = [
}
},
{
text: '复选框',
name: '复选框',
icon: <IconPack.CheckBox />,
text: '开关按钮',
name: '开关按钮',
icon: <IconPack.SwitchSelector />,
schema: {
title: '复选框',
name: '复选框',
title: '开关按钮',
name: '开关按钮',
type: 'string',
widget: 'CheckBox',
widget: 'SwitchSelector'
},
setting: {
widget: {
......@@ -1129,7 +2441,7 @@ const selectWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
labelWidth: 74,
},
$id: {
title: '数据源',
......@@ -1145,7 +2457,9 @@ const selectWidgets = [
},
presetValue: {
title: '默认值',
type: 'string',
type: 'boolean',
widget: 'SwitchDefault',
dependencies: ['showText'],
},
description: {
title: '字段说明',
......@@ -1168,44 +2482,200 @@ const selectWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
sourceType: {
title: '来源方式',
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
showText: {
title: '显示文字',
type: 'string',
widget: 'SourceType',
default: '手动输入',
widget: 'ShowText',
default: '开/关',
description: '示例(开/关)'
},
options: {
title: '',
name: '选项',
type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }],
widget: 'SimpleList',
dependencies: ['sourceType', 'color']
description: {
title: '字段说明',
type: 'string',
},
groupStyle: {
title: '控件样式',
type: 'object',
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: {
title: '{{formData.sourceType}}',
name: '{{formData.sourceType}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
title: '数据字典',
name: '数据字典',
// required: true,
type: 'string',
widget: 'Dictionary',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
},
tableName: {
title: '表名',
name: '表名',
hidden: '{{formData.sourceType !== "表数据"}}',
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
description: {
title: '字段说明',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
},
fieldName: {
title: '字段名',
name: '字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
...groupStyle,
}
},
{
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',
widget: 'FieldName',
dependencies: ['sourceType', 'tableName'],
widget: 'select',
default: '城市数据',
enum: ['城市数据'],
enumNames: ['城市数据'],
},
required: {
title: '必填',
......@@ -1236,17 +2706,20 @@ const selectWidgets = [
type: 'string',
widget: 'RadioGroupW',
},
}
},
},
}
]
const businessWidgets = [
{
text: '开关按钮',
name: '开关按钮',
icon: <IconPack.SwitchSelector />,
text: '人员选择',
name: '人员选择',
icon: <IconPack.PersonSelector />,
schema: {
title: '开关按钮',
name: '开关按钮',
title: '人员选择',
type: 'string',
widget: 'SwitchSelector'
widget: 'PersonSelector',
placeholder: '',
},
setting: {
widget: {
......@@ -1254,7 +2727,7 @@ const selectWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 74,
labelWidth: 80,
},
$id: {
title: '数据源',
......@@ -1266,13 +2739,14 @@ const selectWidgets = [
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
},
placeholder: {
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'boolean',
widget: 'SwitchDefault',
dependencies: ['showText'],
type: 'string',
},
description: {
title: '字段说明',
......@@ -1283,7 +2757,6 @@ const selectWidgets = [
type: 'boolean',
widget: 'IsHidden',
default: false,
disabled: disabled,
displayType: 'row',
labelWidth: 80,
},
......@@ -1295,45 +2768,77 @@ const selectWidgets = [
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: '25%',
},
showText: {
title: '显示文字',
type: 'string',
widget: 'ShowText',
default: '开/关',
description: '示例(开/关)'
width: '33%',
},
description: {
title: '字段说明',
type: 'string',
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.RelevanceSelect />,
text: '部门选择',
name: '部门选择',
icon: <IconPack.DeptSelector />,
schema: {
title: '关联选择',
name: '关联选择',
title: '部门选择',
type: 'string',
widget: 'RelevanceSelect',
widget: 'DeptSelector',
placeholder: '',
},
setting: {
......@@ -1342,7 +2847,7 @@ const selectWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
labelWidth: 80,
},
$id: {
title: '数据源',
......@@ -1354,7 +2859,6 @@ const selectWidgets = [
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
},
placeholder: {
title: '提示语',
......@@ -1363,8 +2867,6 @@ const selectWidgets = [
presetValue: {
title: '默认值',
type: 'string',
widget: 'CascadeDefault',
dependencies: ['sourceType'],
},
description: {
title: '字段说明',
......@@ -1386,50 +2888,52 @@ const selectWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
fieldParent: {
title: '父字段名',
type: 'string',
// required: true,
widget: 'FieldNames',
dependencies: ['$id'],
},
dictionary: {
title: '数据字典',
name: '数据字典',
// required: true,
type: 'string',
widget: 'Dictionary',
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '25%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '25%',
},
description: {
title: '字段说明',
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',
},
...groupStyle,
}
},
{
text: '级联选择',
name: '级联选择',
icon: <IconPack.CascadeSelector />,
text: '台账选择',
name: '台账选择',
icon: <IconPack.AccountSelector />,
schema: {
title: '级联选择',
name: '级联选择',
title: '台账选择',
type: 'string',
widget: 'CascadeSelector',
widget: 'AccountSelector',
placeholder: '',
},
setting: {
......@@ -1448,9 +2952,8 @@ const selectWidgets = [
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
required: true,
},
placeholder: {
title: '提示语',
......@@ -1459,7 +2962,6 @@ const selectWidgets = [
presetValue: {
title: '默认值',
type: 'string',
widget: 'CascadeDefault',
},
description: {
title: '字段说明',
......@@ -1481,57 +2983,105 @@ const selectWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
sourceType: {
title: '来源方式',
name: '来源方式',
accountName: {
title: '台账名称',
name: '台账名称',
type: 'string',
widget: 'select',
default: '城市数据',
enum: ['城市数据'],
enumNames: ['城市数据'],
widget: 'AccountName',
},
required: {
title: '必填',
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,
width: '40%',
displayType: 'row',
labelWidth: 100,
widget: 'BooleanSwitch',
hidden: '{{formData.fieldshine.length !== 1}}',
},
sql: {
title: 'SQL过滤',
name: 'SQL过滤',
type: 'string',
widget: 'SqlFilter',
props: {
style: {
marginLeft: '10px',
}
placeholder: '示例:部门="XX部门"'
}
},
required: {
title: '必填',
type: 'boolean',
default: false,
width: '33%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '30%',
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
width: '33%',
},
},
...groupStyle,
}
}
]
const businessWidgets = [
const dateWidgets = [
{
text: '人员选择',
name: '人员选择',
icon: <IconPack.PersonSelector />,
text: '日期选择',
name: '日期选择',
icon: <IconPack.DateTime />,
schema: {
title: '人员选择',
title: '日期选择',
type: 'string',
widget: 'PersonSelector',
widget: 'DateTime',
placeholder: '',
},
setting: {
......@@ -1540,7 +3090,7 @@ const businessWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 80,
labelWidth: 75,
},
$id: {
title: '数据源',
......@@ -1557,10 +3107,6 @@ const businessWidgets = [
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
......@@ -1581,77 +3127,65 @@ const businessWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
role: {
title: '机构角色',
calculateRule: {
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%',
widget: 'CalculateRule',
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '40%',
props: {
style: {
marginLeft: '10px',
}
}
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '30%',
},
isMultiple: {
title: '多选',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
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: {}
},
interactiveType: {
title: '交互方式',
type: 'string',
widget: 'select',
enum: ['下拉框', '分组模态', '树形模态'],
default: '下拉框',
enumNames: ['下拉框', '分组模态', '树形模态'],
displayType: 'row',
labelWidth: 80,
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
}
},
},
{
text: '部门选择',
name: '部门选择',
icon: <IconPack.DeptSelector />,
text: '时间选择',
name: '时间选择',
icon: <IconPack.Time />,
schema: {
title: '部门选择',
title: '时间选择',
type: 'string',
widget: 'DeptSelector',
widget: 'Time',
placeholder: '',
},
setting: {
......@@ -1660,7 +3194,7 @@ const businessWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 80,
labelWidth: 75,
},
$id: {
title: '数据源',
......@@ -1672,15 +3206,12 @@ const businessWidgets = [
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
},
placeholder: {
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
......@@ -1701,31 +3232,39 @@ const businessWidgets = [
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: '25%',
width: '50%',
},
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,
width: '50%',
},
groupStyle: {
title: '控件样式',
......@@ -1739,15 +3278,20 @@ const businessWidgets = [
},
}
},
]
const fileWidgets = [
{
text: '台账选择',
name: '台账选择',
icon: <IconPack.AccountSelector />,
text: '附件',
name: '附件',
icon: <IconPack.FileUpload />,
schema: {
title: '台账选择',
title: '附件',
type: 'string',
widget: 'AccountSelector',
placeholder: '',
widget: 'FileUpload',
width: '100%',
preview: true,
isUncompressed: true,
},
setting: {
widget: {
......@@ -1755,7 +3299,7 @@ const businessWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
labelWidth: 80,
},
$id: {
title: '数据源',
......@@ -1772,14 +3316,14 @@ const businessWidgets = [
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -1796,105 +3340,103 @@ const businessWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
accountName: {
title: '台账名称',
name: '台账名称',
fileType: {
title: '文件类型',
type: 'string',
widget: 'AccountName',
widget: 'FileTypeSelect',
enum: ['全部', '图片', '文档', '音频', '视频'],
enumNames: ['全部', '图片', '文档', '音频', '视频'],
default: '全部',
},
fieldshine: {
title: '映射字段',
name: '映射字段',
type: 'array',
widget: 'Fieldshine',
dependencies: ['accountName', '$id'],
default: [],
description: '多字段映射仅支持单选',
durationTime: {
title: "{{formData.fileType+'最大时长'}}",
type: 'number',
description: '秒',
widget: 'slider',
default: 60,
min: 1,
max: 60,
hidden: "{{!['音频', '视频'].includes(formData.fileType)}}",
dependencies: ['fileType']
},
fieldList: {
title: '前端显示字段',
type: 'array',
default: [],
widget: 'FieldList',
dependencies: ['accountName', '$id'],
description: '默认获取前端台账字段',
templateFile: {
title: '模板文件',
type: 'string',
widget: 'TemplateFile',
},
isStoreID: {
title: '存储ID',
name: '存储ID',
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
displayType: 'row',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后将会存储台账的ID',
width: '50%',
},
siteFilter: {
title: '站点过滤',
name: '站点过滤',
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
displayType: 'row',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后只显示自己所属站点数据',
width: '50%',
},
autofill: {
title: '自动映射值',
name: '站点过滤',
preview: {
title: '预览',
type: 'boolean',
default: false,
displayType: 'row',
labelWidth: 110,
widget: 'BooleanSwitch',
description: '开启后会将台账中的值自动映射在表单中(移动端)',
widget: 'checkbox',
default: true,
width: '50%',
},
download: {
title: '下载',
type: 'boolean',
widget: 'checkbox',
default: true,
width: '50%',
},
isMultiple: {
title: '多选',
isUncompressed: {
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部门"'
}
description: '附件是否压缩(压缩后清晰度会降低)',
},
required: {
title: '必填',
photo: {
title: '允许从相册选取',
type: 'boolean',
widget: 'BooleanSwitch',
description: '仅支持移动端',
default: false,
width: '33%',
hidden: "{{!['图片', '视频'].includes(formData.fileType)}}"
},
disabled: {
title: '只读',
watermark: {
title: '水印',
type: 'boolean',
widget: 'checkbox',
widget: 'BooleanSwitch',
description: '图片是否添加水印(仅支持移动端)',
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: '日期选择',
name: '日期选择',
icon: <IconPack.DateTime />,
text: '地图坐标',
name: '地图坐标',
icon: <IconPack.Coordinate />,
schema: {
title: '日期选择',
title: '地图坐标',
type: 'string',
widget: 'DateTime',
widget: 'Coordinate',
placeholder: '',
},
setting: {
......@@ -1913,8 +3455,8 @@ const dateWidgets = [
},
title: {
title: '展示名称',
required: true,
type: 'string',
required: true,
},
placeholder: {
title: '提示语',
......@@ -1940,44 +3482,44 @@ const dateWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
calculateRule: {
title: '计算规则',
currentAddress: {
title: '自动获取',
type: 'boolean',
widget: 'BooleanSwitch',
description: '自动获取当前地址(手持端专用)'
},
addressSync: {
title: '地址同步',
type: 'string',
widget: 'CalculateRule',
widget: 'AddressSync',
description: '位置信息将会同步到下方字段中',
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
description: '只读情况下会显示缩略图'
},
areaSync: {
title: '区域同步',
type: 'string',
widget: 'AreaSync',
description: '坐标对应最小区域会同步到下方字段中',
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '40%',
props: {
style: {
marginLeft: '10px',
}
}
width: '33%',
},
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: ['默认为空', '默认为当前时间', '不超过当前时间'],
width: '25%',
},
groupStyle: {
title: '控件样式',
......@@ -1992,13 +3534,13 @@ const dateWidgets = [
},
},
{
text: '时间选择',
name: '时间选择',
icon: <IconPack.Time />,
text: '设备选择',
name: '设备选择',
icon: <IconPack.Device />,
schema: {
title: '时间选择',
title: '设备选择',
type: 'string',
widget: 'Time',
widget: 'Device',
placeholder: '',
},
setting: {
......@@ -2019,7 +3561,6 @@ const dateWidgets = [
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
},
placeholder: {
title: '提示语',
......@@ -2045,39 +3586,33 @@ const dateWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
calculateRule: {
title: '计算规则',
type: 'string',
widget: 'CalculateRule',
},
presetValue: {
title: '默认值',
type: 'string',
widget: 'TimeDefault',
format: '{{formData.format}}',
description: '勾选默认当前时间此处配置无效'
fieldshine: {
title: '映射字段',
name: '映射字段',
type: 'array',
widget: 'DeviceFieldshine',
default: [],
},
options: {
title: '选项',
type: 'string',
widget: 'select',
enum: ['默认为空', '默认为当前时间', '不超过当前时间'],
default: '默认为空',
enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
description: '只读情况下会显示缩略图'
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '50%',
width: '33%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '50%',
width: '25%',
},
groupStyle: {
title: '控件样式',
......@@ -2089,22 +3624,17 @@ const dateWidgets = [
type: 'string',
widget: 'RadioGroupW',
},
}
},
},
]
const fileWidgets = [
{
text: '件',
name: '件',
icon: <IconPack.FileUpload />,
text: '路径控件',
name: '路径控件',
icon: <IconPack.DrawPath />,
schema: {
title: '件',
title: '路径控件',
type: 'string',
widget: 'FileUpload',
width: '100%',
preview: true,
isUncompressed: true,
widget: 'DrawPath',
placeholder: '',
},
setting: {
widget: {
......@@ -2112,7 +3642,7 @@ const fileWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 80,
labelWidth: 75,
},
$id: {
title: '数据源',
......@@ -2122,8 +3652,8 @@ const fileWidgets = [
},
title: {
title: '展示名称',
type: 'string',
required: true,
type: 'string',
},
placeholder: {
title: '提示语',
......@@ -2133,15 +3663,12 @@ const fileWidgets = [
title: '字段说明',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
widget: 'IsHidden',
default: false,
disabled: disabled,
displayType: 'row',
labelWidth: 80,
},
......@@ -2150,82 +3677,30 @@ const fileWidgets = [
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
disabled: disabled,
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',
dependencies: ['tableTypeParent', 'IsSystemField', 'isHidden'],
},
disabled: {
title: '只读',
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'checkbox',
widget: 'BooleanSwitch',
default: false,
width: '50%',
description: '只读情况下会显示缩略图'
},
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)}}"
width: '33%',
},
watermark: {
title: '水印',
disabled: {
title: '只读',
type: 'boolean',
widget: 'BooleanSwitch',
description: '图片是否添加水印(仅支持移动端)',
widget: 'checkbox',
default: false,
hidden: "{{!['图片'].includes(formData.fileType)}}"
width: '25%',
},
groupStyle: {
title: '控件样式',
......@@ -2239,17 +3714,14 @@ const fileWidgets = [
},
},
},
]
const mapWidgets = [
{
text: '地图坐标',
name: '地图坐标',
icon: <IconPack.Coordinate />,
text: '区域控件',
name: '区域控件',
icon: <IconPack.DrawArea />,
schema: {
title: '地图坐标',
title: '区域控件',
type: 'string',
widget: 'Coordinate',
widget: 'DrawArea',
placeholder: '',
},
setting: {
......@@ -2268,8 +3740,8 @@ const mapWidgets = [
},
title: {
title: '展示名称',
type: 'string',
required: true,
type: 'string',
},
placeholder: {
title: '提示语',
......@@ -2295,18 +3767,6 @@ const mapWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
currentAddress: {
title: '自动获取',
type: 'boolean',
widget: 'BooleanSwitch',
description: '自动获取当前地址(手持端专用)'
},
addressSync: {
title: '地址同步',
type: 'string',
widget: 'AddressSync',
description: '位置信息将会同步到下方字段中',
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
......@@ -2314,12 +3774,6 @@ const mapWidgets = [
default: false,
description: '只读情况下会显示缩略图'
},
areaSync: {
title: '区域同步',
type: 'string',
widget: 'AreaSync',
description: '坐标对应最小区域会同步到下方字段中',
},
required: {
title: '必填',
type: 'boolean',
......@@ -2347,14 +3801,16 @@ const mapWidgets = [
},
},
{
text: '设备选择',
name: '设备选择',
icon: <IconPack.Device />,
text: '区域任务',
name: '区域任务',
icon: <IconPack.DrawArea />,
schema: {
title: '设备选择',
title: '区域任务',
type: 'string',
widget: 'Device',
widget: 'AreaTask',
placeholder: '',
width: '100%',
labelWidth: 1,
},
setting: {
widget: {
......@@ -2372,13 +3828,18 @@ const mapWidgets = [
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
default: '区域任务',
},
placeholder: {
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
......@@ -2399,19 +3860,30 @@ const mapWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
fieldshine: {
title: '映射字段',
name: '映射字段',
areaTaskShine: {
title: '巡检对象',
name: '巡检对象',
type: 'array',
widget: 'DeviceFieldshine',
widget: 'AreaTaskShine',
default: [],
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
description: '只读情况下会显示缩略图'
fieldList: {
title: '前端显示字段',
name: '前端显示字段',
type: 'array',
default: [],
widget: 'TaskFieldList',
description: '用于区域控件列表显示',
dependencies: ['areaTaskShine']
},
taskSummary: {
title: '任务摘要',
name: '任务摘要',
type: 'array',
default: [],
widget: 'TaskFieldList',
description: '用于任务对象显示',
dependencies: ['areaTaskShine']
},
required: {
title: '必填',
......@@ -2439,15 +3911,18 @@ const mapWidgets = [
},
},
},
]
const advancedWidgets = [
{
text: '路径控件',
name: '路径控件',
icon: <IconPack.DrawPath />,
text: '富文本',
name: '富文本',
icon: <IconPack.RichText />,
schema: {
title: '路径控件',
title: '富文本',
type: 'string',
widget: 'DrawPath',
placeholder: '',
widget: 'RichText',
width: '100%',
},
setting: {
widget: {
......@@ -2455,7 +3930,7 @@ const mapWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
labelWidth: 80,
},
$id: {
title: '数据源',
......@@ -2467,10 +3942,7 @@ const mapWidgets = [
title: '展示名称',
required: true,
type: 'string',
},
placeholder: {
title: '提示语',
type: 'string',
widget: 'htmlInput',
},
description: {
title: '字段说明',
......@@ -2481,7 +3953,6 @@ const mapWidgets = [
type: 'boolean',
widget: 'IsHidden',
default: false,
disabled: disabled,
displayType: 'row',
labelWidth: 80,
},
......@@ -2490,30 +3961,26 @@ const mapWidgets = [
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
disabled: disabled,
hidden: "{{formData.isHidden}}",
dependencies: ['tableTypeParent', 'IsSystemField', 'isHidden'],
dependencies: ['isHidden'],
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
description: '只读情况下会显示缩略图'
presetValue: {
title: '默认值',
type: 'string',
widget: 'RichTextDefault',
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '50%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
width: '50%',
},
groupStyle: {
title: '控件样式',
......@@ -2528,14 +3995,15 @@ const mapWidgets = [
},
},
{
text: '区域控件',
name: '区域控件',
icon: <IconPack.DrawArea />,
text: '编码',
name: '编码',
icon: <IconPack.Coding />,
schema: {
title: '区域控件',
title: '编码',
type: 'string',
widget: 'DrawArea',
placeholder: '',
widget: 'Coding',
disabled: true,
required: false,
},
setting: {
widget: {
......@@ -2543,18 +4011,23 @@ const mapWidgets = [
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
labelWidth: 80,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
placeholder: {
title: '提示语',
......@@ -2563,6 +4036,8 @@ const mapWidgets = [
description: {
title: '字段说明',
type: 'string',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
isHidden: {
title: '是否隐藏',
......@@ -2580,26 +4055,22 @@ const mapWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
description: '只读情况下会显示缩略图'
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
prefixion: {
title: '前缀',
type: 'string',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
codingType: {
title: '编码方式',
type: 'string',
widget: 'select',
enum: ['1', '2', '3'],
default: '3',
enumNames: ['前缀-年份-六位编码', '前缀-年份月份-六位编码', '前缀-八位编码'],
description: '{{rootValue.codingType === "1" ?"示例:XJ-2019-000001" : (rootValue.codingType === "2" ? "示例: XJ-201909-000001" : "示例: XJ00000001")}}',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
groupStyle: {
title: '控件样式',
......@@ -2610,20 +4081,21 @@ const mapWidgets = [
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
},
},
{
text: '区域任务',
name: '区域任务',
icon: <IconPack.DrawArea />,
text: '级联选择',
name: '级联选择',
icon: <IconPack.CascadeSelector />,
schema: {
title: '区域任务',
title: '级联选择',
name: '级联选择',
type: 'string',
widget: 'AreaTask',
widget: 'CascadeSelector',
placeholder: '',
width: '100%',
labelWidth: 1,
},
setting: {
widget: {
......@@ -2641,9 +4113,9 @@ const mapWidgets = [
},
title: {
title: '展示名称',
required: true,
type: 'string',
widget: 'htmlInput',
default: '区域任务',
},
placeholder: {
title: '提示语',
......@@ -2652,6 +4124,7 @@ const mapWidgets = [
presetValue: {
title: '默认值',
type: 'string',
widget: 'CascadeDefault',
},
description: {
title: '字段说明',
......@@ -2673,44 +4146,33 @@ const mapWidgets = [
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
areaTaskShine: {
title: '巡检对象',
name: '巡检对象',
type: 'array',
widget: 'AreaTaskShine',
default: [],
},
fieldList: {
title: '前端显示字段',
name: '前端显示字段',
type: 'array',
default: [],
widget: 'TaskFieldList',
description: '用于区域控件列表显示',
dependencies: ['areaTaskShine']
},
taskSummary: {
title: '任务摘要',
name: '任务摘要',
type: 'array',
default: [],
widget: 'TaskFieldList',
description: '用于任务对象显示',
dependencies: ['areaTaskShine']
sourceType: {
title: '来源方式',
name: '来源方式',
type: 'string',
widget: 'select',
default: '城市数据',
enum: ['城市数据'],
enumNames: ['城市数据'],
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '40%',
props: {
style: {
marginLeft: '10px',
}
}
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
width: '30%',
},
groupStyle: {
title: '控件样式',
......@@ -2724,9 +4186,6 @@ const mapWidgets = [
},
},
},
]
const advancedWidgets = [
{
text: '关联表单',
name: '关联表单',
......@@ -3062,25 +4521,25 @@ const settings = [
widgets: layoutWidgets
},
{
title: '文本控件',
widgets: textWidgets
},
{
title: '选择器控件',
widgets: selectWidgets,
},
{
title: '业务控件',
widgets: businessWidgets,
},
{
title: '时间控件',
widgets: dateWidgets,
},
{
title: '附件控件',
widgets: fileWidgets,
title: '基础控件',
widgets: baseWidgets
},
// {
// title: '选择器控件',
// widgets: selectWidgets,
// },
// {
// title: '业务控件',
// widgets: businessWidgets,
// },
// {
// title: '时间控件',
// widgets: dateWidgets,
// },
// {
// title: '附件控件',
// widgets: fileWidgets,
// },
{
title: 'GIS控件',
widgets: mapWidgets,
......
......@@ -10,6 +10,30 @@ import FormRender from '../FormRender'
import { isObject, getVerify, setFieldJson, getNanoid } from '../../utils'
import Drag from '../components/Drag'
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) => {
......@@ -30,6 +54,7 @@ const FormDesigner = (props, ref) => {
const [open, setOpen] = useState(false)
const designerRef = useRef(null)
const formRenderRef = useRef(null)
const helpRef = useRef(null)
const settingsParent = useMemo(() => {
let settingsParent = []
......@@ -355,8 +380,42 @@ const FormDesigner = (props, ref) => {
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 (
<div className={styles.pandaXform} style={{ height: '100%' }}>
<div className={styles.pandaXform} style={{ height: '100%', padding: 0 }}>
<div style={{ width: '100%', height: '100%' }}>
<Generator
// configProvider={{ prefixCls: prefixClsPandaXform }}
......@@ -405,13 +464,10 @@ const FormDesigner = (props, ref) => {
<FormRender
ref={formRenderRef}
schemaValues={{ formJson: schema }}
// codes={{
// 工单编号: '12421413431',
// 事件编号: 'PO230000013',
// }}
/>
</Drag>
</div>
<Help ref={helpRef} />
</div>
)
......
......@@ -174,9 +174,10 @@ const Coordinate = (props) => {
addons.setValue(targetPath, targetPathText)
} else {
let LngLat = mercatorToLngLat(currentPointerCoordinate[0], currentPointerCoordinate[1])
let newCoord = gcj02_To_gps84(LngLat[0], LngLat[1])
let postStr = {
lon: LngLat[0],
lat: LngLat[1],
lon: newCoord.lng,
lat: newCoord.lat,
ver: 1,
}
let url = `http://api.tianditu.gov.cn/geocoder?postStr=${JSON.stringify(postStr)}&type=geocode&tk=a1d480f55b805db96e1ed295e62c72b1`
......@@ -208,13 +209,62 @@ const Coordinate = (props) => {
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) => {
if (presetValue) {
let coordinate = presetValue.split(',')
let LngLat = mercatorToLngLat(coordinate[0], coordinate[1])
let newCoord = gcj02_To_gps84(LngLat[0], LngLat[1])
let postStr = {
lon: LngLat[0],
lat: LngLat[1],
lon: newCoord.lng,
lat: newCoord.lat,
ver: 1,
}
let url = `http://api.tianditu.gov.cn/geocoder?postStr=${JSON.stringify(postStr)}&type=geocode&tk=a1d480f55b805db96e1ed295e62c72b1`
......
......@@ -9,7 +9,6 @@ const Placeholder = (props) => {
const { title } = addons.formData
const [visible, setVisible] = useState(false)
const [areaValue, setAreaValue] = useState('')
console.log('props', props)
const inputChange = (e) => {
onChange(e.target.value)
......
......@@ -6,7 +6,6 @@ import { filenameVerification } from '../../../../../utils'
const TemplateFile = (props) => {
console.log('TemplateFile', props)
const site = window.globalConfig?.userInfo?.site || window.globalConfig?.userInfo?.LocalSite
const { value, onChange, addons } = props
......
@import '~antd/es/style/themes/default.less';
@imgSrc: './assets/images/designer';
@disabledBgColor: rgb(248, 250, 252);
@disabledColor: rgba(0, 0, 0, 0.7);
......@@ -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 {
.fr-content {
.fr-field.w-100.flex-column {
......@@ -34,7 +115,6 @@ body #app {
padding-top: 0;
.fr-generator-container .left-layout {
padding: 10px 0 0 0;
.left-item {
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