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

fix: BUG 修复

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