Commit 29b8e51b authored by 田翔's avatar 田翔

feat: 增加文本扫一扫功能

parent 4bf467ce
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "6.0.36", "version": "6.0.37",
"description": "6.0.36 逻辑兼容性增强", "description": "6.0.37 增加文本扫一扫功能",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -226,6 +226,16 @@ const textWidgets = [ ...@@ -226,6 +226,16 @@ const textWidgets = [
disabled: disabled, disabled: disabled,
dependencies: ['presetValue', 'tableTypeParent', 'IsSystemField'], dependencies: ['presetValue', 'tableTypeParent', 'IsSystemField'],
}, },
isSweep: {
title: '扫一扫',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
displayType: 'row',
labelWidth: 120,
description: '是否提供扫一扫功能(手持端专用)',
disabled: disabled,
},
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
type: 'object', type: 'object',
...@@ -2364,11 +2374,12 @@ const mapWidgets = [ ...@@ -2364,11 +2374,12 @@ const mapWidgets = [
name: '区域任务', name: '区域任务',
icon: <IconPack.DrawArea />, icon: <IconPack.DrawArea />,
schema: { schema: {
title: '区域任务', title: '',
type: 'string', type: 'string',
widget: 'AreaTask', widget: 'AreaTask',
placeholder: '', placeholder: '',
width: '100%', width: '100%',
labelWidth: 1,
}, },
setting: { setting: {
widget: { widget: {
...@@ -2386,8 +2397,9 @@ const mapWidgets = [ ...@@ -2386,8 +2397,9 @@ const mapWidgets = [
}, },
title: { title: {
title: '展示名称', title: '展示名称',
required: true,
type: 'string', type: 'string',
widget: 'htmlInput',
default: '区域任务',
}, },
placeholder: { placeholder: {
title: '提示语', title: '提示语',
......
...@@ -319,6 +319,7 @@ const FormDesigner = (props, ref) => { ...@@ -319,6 +319,7 @@ const FormDesigner = (props, ref) => {
const testSubmit = async () => { const testSubmit = async () => {
const { formValue, relationForm, errors } = await formRenderRef?.current?.getValues() const { formValue, relationForm, errors } = await formRenderRef?.current?.getValues()
console.log(formValue, relationForm)
if (errors.length) { if (errors.length) {
setTextShow(false) setTextShow(false)
return message.error('表单校验未通过!') return message.error('表单校验未通过!')
......
...@@ -75,7 +75,9 @@ const XRender = (props, ref) => { ...@@ -75,7 +75,9 @@ const XRender = (props, ref) => {
} }
childObj[s] = { childObj[s] = {
...child[s], ...child[s],
labelWidth: child[s].widget === 'RelationForm' ? 1 : 110, title: ['RelationForm', 'AreaTask'].includes(child[s].widget) ? '' : child[s].title,
titleShow: child[s].title || child[s].titleShow,
labelWidth: ['RelationForm', 'AreaTask'].includes(child[s].widget) ? 1 : 110,
presetValue: value || child[s].presetValue || '', presetValue: value || child[s].presetValue || '',
textDefalut: child[s].presetValue, textDefalut: child[s].presetValue,
formDisabled: disabled, formDisabled: disabled,
...@@ -146,6 +148,7 @@ const XRender = (props, ref) => { ...@@ -146,6 +148,7 @@ const XRender = (props, ref) => {
const onMount = () => { } const onMount = () => { }
useEffect(() => { useEffect(() => {
window.relationForm = { configs: [], data: [] }
window.configsLocal = [] window.configsLocal = []
window.tableLocal = [] window.tableLocal = []
}, []) }, [])
......
...@@ -24,6 +24,7 @@ const AreaTask = (props) => { ...@@ -24,6 +24,7 @@ const AreaTask = (props) => {
const { token, client } = window.globalConfig const { token, client } = window.globalConfig
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { const {
titleShow,
disabled, disabled,
placeholder, placeholder,
presetValue, presetValue,
...@@ -231,7 +232,7 @@ const AreaTask = (props) => { ...@@ -231,7 +232,7 @@ const AreaTask = (props) => {
values: values values: values
}) })
}) })
window.relationForm = { configs: [{ ...schema, '台账名称': schema.accountName, '映射字段': schema.fieldshine }], data: items } window.relationForm = { configs: [{ ...schema, '台账名称': schema.accountName, '映射字段': [{ fromField: '工单编号', toField: '工单编号' }] }], data: items }
setDataSource(array) setDataSource(array)
} }
} }
...@@ -337,6 +338,7 @@ const AreaTask = (props) => { ...@@ -337,6 +338,7 @@ const AreaTask = (props) => {
return ( return (
<div className={styles.AreaTask}> <div className={styles.AreaTask}>
<div className={styles.areaTitle}>{titleShow}</div>
<div className={styles.areaBox}> <div className={styles.areaBox}>
<div className={styles.areaInput}> <div className={styles.areaInput}>
{ {
......
.AreaTask { .AreaTask {
width: 100%; width: 100%;
.areaTitle {
text-align: center;
padding-bottom: 5px;
}
.areaBox { .areaBox {
width: 100%; width: 100%;
......
...@@ -46,6 +46,9 @@ const AreaTaskShine = (props) => { ...@@ -46,6 +46,9 @@ const AreaTaskShine = (props) => {
if (!toField.some(v => v.name === '工单编号')) { if (!toField.some(v => v.name === '工单编号')) {
return message.error(`【${accountName}】台账不存在工单编号字段`) return message.error(`【${accountName}】台账不存在工单编号字段`)
} }
if (!toField.some(v => v.name === '反馈状态')) {
return message.error(`【${accountName}】台账不存在反馈状态字段`)
}
addons.setValue('accountName', accountName) addons.setValue('accountName', accountName)
addons.setValue('service', service) addons.setValue('service', service)
addons.setValue('layerName', layerName) addons.setValue('layerName', layerName)
...@@ -288,7 +291,7 @@ const AreaTaskShine = (props) => { ...@@ -288,7 +291,7 @@ const AreaTaskShine = (props) => {
{index > 2 ? <MinusCircleOutlined onClick={() => remove(name)} /> : null} {index > 2 ? <MinusCircleOutlined onClick={() => remove(name)} /> : null}
</Space> </Space>
))} ))}
<Form.Item style={{ padding: '0 10px' }}> <Form.Item style={{ padding: '0 10px', display: 'none' }}>
<Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}> <Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}>
添加映射 添加映射
</Button> </Button>
......
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