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

feat: 增加文本扫一扫功能

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