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

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

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