Commit 00eb6093 authored by 田翔's avatar 田翔

fix: 时间日期格式增加确定按钮

parent a1db4b1a
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "4.3.1", "version": "4.3.3",
"description": "4.3.1 将表格嵌入关联表单", "description": "4.3.3 时间日期格式增加确定按钮",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -125,6 +125,7 @@ const TablePack = (props, ref) => { ...@@ -125,6 +125,7 @@ const TablePack = (props, ref) => {
sorter: true, sorter: true,
sortOrder: sortedInfo.field === v ? sortedInfo.order : null, sortOrder: sortedInfo.field === v ? sortedInfo.order : null,
filteredValue: filteredInfo[v] || null, filteredValue: filteredInfo[v] || null,
...searchProps,
onHeaderCell: (column) => ({ onHeaderCell: (column) => ({
width: column.width, width: column.width,
onResize: (e, props) => { onResize: (e, props) => {
......
...@@ -855,7 +855,7 @@ const selectWidgets = [ ...@@ -855,7 +855,7 @@ const selectWidgets = [
hidden: '{{formData.sourceType !== "手动输入"}}', hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }], default: [{ value: '选项一' }],
widget: 'SimpleList', widget: 'SimpleList',
dependencies: ['sourceType', 'color'] dependencies: ['sourceType', 'color', 'isMultiple']
}, },
dictionary: { dictionary: {
title: '{{formData.sourceType}}', title: '{{formData.sourceType}}',
......
// 自定义时间组件 // 自定义时间组件
import React, { useState, useEffect, useMemo } from 'react' import React, { useEffect } from 'react'
import { DatePicker, Input } from 'antd' import { DatePicker } from 'antd'
import moment from 'moment' import moment from 'moment'
import locale from 'antd/lib/date-picker/locale/zh_CN' import locale from 'antd/lib/date-picker/locale/zh_CN'
...@@ -45,13 +45,13 @@ const DateTime = (props) => { ...@@ -45,13 +45,13 @@ const DateTime = (props) => {
} }
: :
{ {
picker: format,
showTime: false showTime: false
} }
return ( return (
<DatePicker <DatePicker
disabledDate={disabledDate} disabledDate={disabledDate}
picker={format}
disabled={disabled} disabled={disabled}
placeholder={!disabled ? placeholder : ''} placeholder={!disabled ? placeholder : ''}
value={isValid ? moment(value) : null} value={isValid ? moment(value) : null}
...@@ -60,7 +60,7 @@ const DateTime = (props) => { ...@@ -60,7 +60,7 @@ const DateTime = (props) => {
{...timeOtions} {...timeOtions}
style={{ width: '100%' }} style={{ width: '100%' }}
locale={locale} locale={locale}
// getPopupContainer={(targterNode) => targterNode.parentElement || document.body} // getPopupContainer={(targterNode) => targterNode.parentElement || document.body}
/> />
); );
......
...@@ -9,11 +9,19 @@ import { colors } from '../../../../../constant' ...@@ -9,11 +9,19 @@ import { colors } from '../../../../../constant'
const SimpleList = (props) => { const SimpleList = (props) => {
const { value, onChange, addons } = props const { value, onChange, addons } = props
const { color } = addons.formData const { color, isMultiple } = addons.formData
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
const [text, setText] = useState('') const [text, setText] = useState('')
const [loading, setLoading] = useState(true) const [loading, setLoading] = useState(true)
useEffect(() => {
if (addons) {
if (!isMultiple) {
addons.setValue('color', false)
}
}
}, [isMultiple])
useEffect(() => { useEffect(() => {
setTimeout(() => { setTimeout(() => {
setLoading(false) setLoading(false)
...@@ -190,7 +198,7 @@ const SimpleList = (props) => { ...@@ -190,7 +198,7 @@ const SimpleList = (props) => {
<div style={{ fontSize: '14px' }}>选项</div> <div style={{ fontSize: '14px' }}>选项</div>
<div style={{ fontSize: '12px' }}> <div style={{ fontSize: '12px' }}>
<span style={{ paddingRight: '5px' }}>彩色</span> <span style={{ paddingRight: '5px' }}>彩色</span>
<Switch size='small' checked={color} onChange={switchChange} /> <Switch disabled={!isMultiple} size='small' checked={color} onChange={switchChange} />
</div> </div>
</div> </div>
<div className={styles.box}> <div className={styles.box}>
......
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