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

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

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