Commit 8c177d1d authored by 田翔's avatar 田翔

fix: BUG 修复

parent 2b3544c5
{
"name": "panda-xform",
"version": "2.5.5",
"description": "2.5.5: 前端页面中,附件图片的下载按钮位黑色,需要修改为白色,和其他按钮统一",
"version": "2.5.6",
"description": "2.5.6: BUG修复",
"keywords": [
"panda-xform"
],
......
......@@ -8,7 +8,6 @@ const commonSettings = {
required: true,
displayType: 'row',
labelWidth: 80,
// width: '70%',
},
title: {
title: '展示名称',
......@@ -26,10 +25,6 @@ const commonSettings = {
labelWidth: 80,
dependencies: ['title']
},
// description: {
// title: '说明',
// type: 'string',
// },
presetValue: {
title: '默认值',
type: 'string',
......
......@@ -63,6 +63,7 @@ const textWidgets = [
type: 'string',
widget: 'TextInput',
placeholder: '请输入内容'
},
setting: {
widget: {
......@@ -109,8 +110,6 @@ const textWidgets = [
type: 'array',
default: [],
widget: 'VerifyTextInput',
// displayType: 'row',
// labelWidth: 100,
},
uniqueVerify: {
title: '唯一值校验',
......@@ -1094,8 +1093,7 @@ const selectWidgets = [
title: '开关按钮',
name: '开关按钮',
type: 'string',
widget: 'SwitchSelector',
default: '0',
widget: 'SwitchSelector'
},
setting: {
widget: {
......@@ -1143,14 +1141,9 @@ const selectWidgets = [
showText: {
title: '显示文字',
type: 'string',
widget: 'select',
enum: ['开/关', '是/否', '明/暗'],
enumNames: ['开/关', '是/否', '明/暗'],
displayType: 'row',
labelWidth: 80,
props: {
allowClear: true
}
widget: 'ShowText',
default: '开/关',
description: '示例(开/关)'
},
description: {
title: '说明',
......
......@@ -97,7 +97,7 @@ const getFieldName = (configs, tableName) => {
}
const automaticComputation = async (params) => {
if ((new Date().getTime() - params.startTime) < 1000) return
if ((new Date().getTime() - params.startTime) < 2000) return
let param = {
tableName: params.tableName,
filedFormulas: params.filedFormulas,
......@@ -170,7 +170,7 @@ const getAutoWatch = (schema, form, startTime) => {
}
const getSelectItemList = async (params) => {
if ((new Date().getTime() - params.startTime) < 1000) return
if ((new Date().getTime() - params.startTime) < 2000) return
const { sourcePath, form, targetPath, dictionary, value } = params
const { code, data, msg } = await GetSelectItemList({ nodeName: dictionary })
if (code === 0) {
......
......@@ -5,28 +5,28 @@ const SwitchSelector = (props) => {
const { value, onChange, schema, addons } = props
const { disabled, presetValue, showText } = schema
const text = showText ? showText.split('/') : ['', '']
const text = (showText && showText.includes('/')) ? showText.split('/') : ['开', '关']
useEffect(() => {
if (addons) {
addons.setValue(addons.dataPath, presetValue ? '1' : '0')
addons.setValue(addons.dataPath, presetValue === text[0])
} else {
onChange(presetValue ? '1' : '0')
onChange(presetValue === text[0])
}
}, [presetValue])
const switchChange = (checked) => {
if (addons) {
onChange(checked ? '1' : '0')
onChange(checked ? text[0] : text[1])
}
}
return (
<Switch
checked={Boolean(Number(value))}
checked={Boolean(Number(value === text[0]))}
disabled={disabled}
checkedChildren={Array.isArray(text) ? text[0] : ''}
unCheckedChildren={Array.isArray(text) ? text[1] : ''}
checkedChildren={text[0]}
unCheckedChildren={text[1]}
onChange={switchChange}
>
......
import React, { useMemo, useState } from 'react'
import { Input, Modal, Popover, Select, Dropdown, Menu } from 'antd'
import { PlusOutlined } from '@ant-design/icons'
const options = [
{ label: '开/关', key: '开/关' },
{ label: '是/否', key: '是/否' },
{ label: '明/暗', key: '明/暗' },
]
const ShowText = (props) => {
const { value, onChange } = props
const inputChange = (e) => {
onChange(e.target.value)
}
const menuClick = (item) => {
onChange(item.key)
}
return (
<div className='showText'>
<Input
allowClear
value={value}
onChange={inputChange}
addonAfter={
<Dropdown
overlay={(
<Menu
onClick={menuClick}
items={options}
/>
)}
>
<PlusOutlined />
</Dropdown>
}
/>
</div>
)
}
export default ShowText
\ No newline at end of file
import PercentSlider from "./PercentSlider"
import PercentSlider from './PercentSlider'
import ShowText from './ShowText'
const groupStyle = {
PercentSlider,
ShowText,
}
export default groupStyle
\ No newline at end of file
......@@ -17,7 +17,7 @@ const options = [
{
name: 'mobile',
label: '手机号(mobile)',
value: '1[3-9]\\d{9}',
value: '/^[1][3,4,5,6,7,8,9][0-9]{9}$/',
message: '手机号校验未通过',
},
{
......
......@@ -8,9 +8,9 @@ const NumberInput = (props) => {
useEffect(() => {
if (addons) {
addons.setValueByPath(addons.dataPath, presetValue)
addons.setValueByPath(addons.dataPath, presetValue || '0')
} else {
onChange(presetValue)
onChange(presetValue || '0')
}
}, [presetValue])
......
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