Commit bcc1f503 authored by 田翔's avatar 田翔

fix: 增加移动端预览

parent daf6d641
...@@ -2558,13 +2558,6 @@ const advancedWidgets = [ ...@@ -2558,13 +2558,6 @@ const advancedWidgets = [
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
}, },
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
'台账名称': { '台账名称': {
title: '台账名称', title: '台账名称',
type: 'string', type: 'string',
...@@ -2577,6 +2570,11 @@ const advancedWidgets = [ ...@@ -2577,6 +2570,11 @@ const advancedWidgets = [
default: [], default: [],
dependencies: ['台账名称'], dependencies: ['台账名称'],
}, },
'控制规则': {
title: '控制规则',
type: 'string',
widget: 'ControlRules',
},
'默认显示': { '默认显示': {
title: '默认显示', title: '默认显示',
type: 'boolean', type: 'boolean',
...@@ -2585,10 +2583,17 @@ const advancedWidgets = [ ...@@ -2585,10 +2583,17 @@ const advancedWidgets = [
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 80,
}, },
'控制规则': { // otherAccount: {
title: '控制规则', // title: '数据来源',
type: 'string', // type: 'string',
widget: 'ControlRules', // widget: 'OtherAccount',
// },
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
......
import React, { useRef, useState, forwardRef, useImperativeHandle, useMemo, useLayoutEffect } from 'react' import React, { useRef, useState, forwardRef, useImperativeHandle, useMemo, useLayoutEffect } from 'react'
import { message, Modal, Button } from 'antd' import { message, Modal, Button, Popover } from 'antd'
import { ExclamationCircleOutlined } from '@ant-design/icons' import { ExclamationCircleOutlined } from '@ant-design/icons'
import QRcode from 'qrcode.react'
import Generator, { defaultSettings, defaultCommonSettings, defaultGlobalSettings } from 'fr-generator' import Generator, { defaultSettings, defaultCommonSettings, defaultGlobalSettings } from 'fr-generator'
import { settings, baseSettings, globalSettings } from './config' import { settings, baseSettings, globalSettings } from './config'
import widgets from '../widgets' import widgets from '../widgets'
...@@ -26,6 +27,7 @@ const FormDesigner = (props, ref) => { ...@@ -26,6 +27,7 @@ const FormDesigner = (props, ref) => {
const [schema, setSchema] = useState({}) const [schema, setSchema] = useState({})
const [fieldName, setFieldName] = useState([]) const [fieldName, setFieldName] = useState([])
const [textShow, setTextShow] = useState(false) const [textShow, setTextShow] = useState(false)
const [open, setOpen] = useState(false)
const designerRef = useRef(null) const designerRef = useRef(null)
const formRenderRef = useRef(null) const formRenderRef = useRef(null)
...@@ -330,6 +332,10 @@ const FormDesigner = (props, ref) => { ...@@ -330,6 +332,10 @@ const FormDesigner = (props, ref) => {
return true return true
} }
const onOpenChange = (value) => {
console.log('value', value)
}
if (!tableName) { if (!tableName) {
return null return null
} }
...@@ -365,6 +371,18 @@ const FormDesigner = (props, ref) => { ...@@ -365,6 +371,18 @@ const FormDesigner = (props, ref) => {
<div> <div>
<span style={{ color: '#18b918', fontSize: '14px', paddingRight: '10px', display: textShow ? 'inline-block' : 'none' }}>该表单内容校验通过,可正常使用!</span> <span style={{ color: '#18b918', fontSize: '14px', paddingRight: '10px', display: textShow ? 'inline-block' : 'none' }}>该表单内容校验通过,可正常使用!</span>
<Button onClick={() => setVisible(false)}>取消</Button> <Button onClick={() => setVisible(false)}>取消</Button>
<Popover
trigger="click"
open={open}
onOpenChange={onOpenChange}
content={
<div>
<QRcode value={`${window.origin}/civ_mobile/product/workflow/formTest?env=dev&tableName=${tableName}`} />
</div>
}
>
<Button>移动端预览</Button>
</Popover>
<Button type='primary' onClick={testSubmit}>测试提交</Button> <Button type='primary' onClick={testSubmit}>测试提交</Button>
</div> </div>
} }
......
...@@ -73,15 +73,9 @@ const FileUpload = (props) => { ...@@ -73,15 +73,9 @@ const FileUpload = (props) => {
action: `${window.location.origin}${uploadFileUrl}`, action: `${window.location.origin}${uploadFileUrl}`,
listType: showType, listType: showType,
withCredentials: true, withCredentials: true,
// showUploadList: download ?
// {
// showDownloadIcon: '下载',
// downloadIcon: <ArrowDownOutlined style={{ color: fileType === '图片' ? 'white' : '' }} />,
// } : {},
showUploadList: { showUploadList: {
showRemoveIcon: !disabled, showRemoveIcon: !disabled,
showDownloadIcon: download, showDownloadIcon: download,
// downloadIcon: <ArrowDownOutlined style={{ color: fileType === '图片' ? 'white' : '' }} />,
}, },
beforeUpload(file, fileList) { beforeUpload(file, fileList) {
/** @Tips: 解决提交文件中存在特殊字符的问题 */ /** @Tips: 解决提交文件中存在特殊字符的问题 */
......
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