Commit 6163ddd5 authored by 田翔's avatar 田翔

fix: 时间格式自动补全年月日,关联表单只读形态修复,提示语样式调整

parent 82816325
{
"name": "panda-xform",
"version": "2.3.6",
"description": "2.3.6: 问题调整",
"version": "2.3.7",
"description": "2.3.7: 时间格式自动补全年月日,关联表单只读形态修复,提示语样式调整",
"keywords": [
"panda-xform"
],
......
......@@ -126,6 +126,7 @@ export const getWatch = (schema, form, startTime) => {
let { relationForm } = form?.getValues()
const configs = relationForm?.configs || []
const AutoCalculate = getRules(schema)
// console.log('AutoCalculate', AutoCalculate)
if (Array.isArray(AutoCalculate)) {
AutoCalculate.forEach(item => {
const { filedName, rules, calculateRule } = item
......@@ -151,7 +152,9 @@ export const getWatch = (schema, form, startTime) => {
watch[v] = () => {
let params = {
tableName: schema.tableName,
filedFormulas: [{ fieldName: filedName, formula: calculateRule }],
filedFormulas: [
{ fieldName: filedName, formula: calculateRule }
],
form: form,
paths: paths,
relationForm,
......@@ -164,7 +167,7 @@ export const getWatch = (schema, form, startTime) => {
}
})
}
console.log('watch', watch)
// console.log('watch', watch)
return watch
}
......
......@@ -13,7 +13,7 @@ const BaseForm = (props, ref) => {
}
))
const { schemaForm, config, formState } = props
const { schemaForm, config, formState, disabled } = props
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext)
const prefixCls = getPrefixCls('pandaXform')
const pandaXform = getPrefixCls()
......@@ -51,7 +51,11 @@ const BaseForm = (props, ref) => {
value = v.fieldValue
}
})
childObj[s] = { ...child[s], presetValue: value || child[s].presetValue }
let disabledField = child[s].disabled
if (disabled) {
disabledField = true
}
childObj[s] = { ...child[s], presetValue: value || child[s].presetValue, disabled: disabledField }
}
}
}
......@@ -61,7 +65,7 @@ const BaseForm = (props, ref) => {
}
}
return { ...group, properties: parentObj }
}, [schemaForm, field, formState])
}, [schemaForm, field, disabled])
const watch = useMemo(() => {
return getWatch(schema, form, startTime)
......
......@@ -389,6 +389,7 @@ const RelationForm = (props) => {
formState={formState}
config={config}
ref={baseFormRef}
disabled={!['编辑', '添加'].includes(formState)}
/>
</Drag>
</div>
......
......@@ -39,7 +39,7 @@ const DateTime = (props) => {
disabledDate={disabledDate}
picker={format}
disabled={disabled}
placeholder={placeholder}
placeholder={!disabled ? placeholder : ''}
value={value ? moment(value) : null}
onChange={dateChange}
showNow
......
......@@ -6,7 +6,7 @@ import moment from 'moment'
const Time = (props) => {
const { value, onChange, schema, addons } = props
const { presetValue, currentDate, defaultCurrent, options } = schema
const { presetValue, currentDate, defaultCurrent, options, disabled, placeholder } = schema
const disabledDate = (current) => {
if (options === '不超过当前时间') {
......@@ -17,7 +17,7 @@ const Time = (props) => {
}
const timeChange = (time, timeStr) => {
onChange(timeStr)
onChange(moment(time).format('YYYY-MM-DD HH:ss:mm'))
}
useEffect(() => {
......@@ -36,6 +36,7 @@ const Time = (props) => {
onChange={timeChange}
disabledDate={disabledDate}
locale={locale}
placeholder={!disabled ? placeholder : ''}
getPopupContainer={(targterNode) => targterNode.parentElement || document.body}
/>
)
......
......@@ -37,7 +37,7 @@ body #app {
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
.@{ant-prefix}-select-selection-placeholder {
color: #dad9d9;
color: #8a8282;
} // 单行文本框
input[disabled] {
color: @disabledColor;
......
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