Commit 0ee5e3ac authored by 田翔's avatar 田翔

fix: 只读形态只读取值不读取默认值, 图片参数添加site

parent 1c8137bf
{
"name": "panda-xform",
"version": "3.0.7",
"description": "3.0.7: 关联选择排除本身数据源,数值",
"version": "3.0.8",
"description": "3.0.8: 只读形态只读取值不读取默认值, 图片参数添加site",
"keywords": [
"panda-xform"
],
......
......@@ -64,7 +64,8 @@ const XRender = (props, ref) => {
}
childObj[s] = {
...child[s],
presetValue: value || child[s].presetValue,
// presetValue: value || child[s].presetValue,
presetValue: disabledField ? value : (value || child[s].presetValue),
textInputDefalut: child[s].presetValue,
disabled: disabledField,
required
......
......@@ -35,6 +35,18 @@ const DateTime = (props) => {
}
const isValid = moment(value)._isValid
const timeOtions = format === 'dateTime' ?
{
showTime: {
minuteStep: 5,
format: 'HH:mm'
},
format: 'YYYY-MM-DD HH:mm'
}
:
{
showTime: false
}
return (
<DatePicker
......@@ -45,7 +57,7 @@ const DateTime = (props) => {
value={isValid ? moment(value) : null}
onChange={dateChange}
showNow
showTime={format === 'dateTime'}
{...timeOtions}
style={{ width: '100%' }}
locale={locale}
getPopupContainer={(targterNode) => targterNode.parentElement || document.body}
......
......@@ -51,6 +51,7 @@ const getFileType = (fileName) => {
const FileUpload = (props) => {
const site = window.globalConfig?.userInfo?.LocalSite
const { value, schema, onChange } = props
const { disabled, fileType, presetValue, placeholder, preview, download } = schema
......@@ -95,7 +96,7 @@ const FileUpload = (props) => {
if (filenameVerification(file).type === 'error') return false;
// 返回的链接在file.response内;不设置url,预览图表不可点击
if (file.status === 'done' && file.response.code === 0) {
file.url = `${downloadFileUrl}?filePath=${file.response.data}`
file.url = `${downloadFileUrl}?filePath=${file.response.data}${site ? `&_site=${site}` : ''}`
file.sourcePath = file.response.data;
message.success('上传成功!')
} else if (file.status === 'done' && file.response.code !== 0) {
......@@ -152,13 +153,13 @@ const FileUpload = (props) => {
name: item.split('\\').reverse()[0],
type: fileType === '图片' ? 'image/jpeg' : 'file',
status: 'done',
url: `${downloadFileUrl}?filePath=${item}`,
url: `${downloadFileUrl}?filePath=${item}${site ? `&_site=${site}` : ''}`,
sourcePath: item.url,
originFileObj: { "uid": uid },
"response": { "code": 0, "msg": "Ok", "data": item, "stackTrace": null },
"xhr": {},
};
if (schema.renderTo === 'Image') _obj.thumbUrl = `${downloadFileUrl}?filePath=${item}`;
if (schema.renderTo === 'Image') _obj.thumbUrl = `${downloadFileUrl}?filePath=${item}${site ? `&_site=${site}` : ''}`;
fileList.push(_obj);
}
})
......
......@@ -62,7 +62,7 @@ const NumberInput = (props) => {
addonBefore={addonBefore}
addonAfter={addonAfter}
prefix={prefix}
placeholder={placeholder}
placeholder={disabled ? null : placeholder}
disabled={disabled}
value={value === '' ? null : Number(value)}
formatter={formatterFn}
......
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