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

fix: 样式尝试修复

parent 3b787f93
{
"name": "panda-xform",
"version": "4.7.2",
"description": "4.7.2 默认第一个站点bug修复",
"version": "4.7.3",
"description": "4.7.3 样式尝试修复",
"keywords": [
"panda-xform"
],
......
......@@ -26,7 +26,6 @@ const XRender = (props, ref) => {
const { formJson, values } = schemaValues
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext)
const prefixCls = getPrefixCls('pandaXform')
const pandaXform = getPrefixCls()
const [startTime, setStartTime] = useState(new Date().getTime())
const form = useForm()
......@@ -115,7 +114,6 @@ const XRender = (props, ref) => {
return (
<div className={styles.pandaXform}>
<FormRender
// style={{ display: print ? 'none' : 'block' }}
configProvider={{ prefixCls: pandaXform }}
removeHiddenData={false}
form={form}
......@@ -127,7 +125,6 @@ const XRender = (props, ref) => {
watch={watch}
onMount={onMount}
/>
{/* {print ? <PrintXform schemaForm={schemaForm} form={form} /> : null} */}
</div>
)
......
......@@ -124,7 +124,7 @@ const getFieldName = (configs, tableName) => {
}
const formAutomatic = async (params) => {
// if ((new Date().getTime() - params.startTime) < 2000) return
if ((new Date().getTime() - params.startTime) < 2000) return
let param = {
tableName: params.tableName,
filedFormulas: params.filedFormulas,
......@@ -160,6 +160,7 @@ const getGroupHidden = (form, schema, gorupName) => {
}
const formFieldHide = async (params) => {
if ((new Date().getTime() - params.startTime) < 2000) return
let param = {
tableName: params.tableName,
filedFormulas: params.filedFormulas,
......
......@@ -213,7 +213,7 @@ const RelationForm = (props) => {
if (queryWheres.every(v => !v.value)) return
const { code, data, msg } = await GetAccountPageList(params)
if (code === 0) {
let tableData = JSON.parse(data.jsonData)
let tableData = data?.jsonData ? JSON.parse(data?.jsonData) : []
if (Array.isArray(tableData)) {
setDataSource(tableData)
onChange(`${tableData.length}`)
......@@ -299,6 +299,7 @@ const RelationForm = (props) => {
//初始化关联表单配置信息,初始显示隐藏
if (addons) {
let relationForm = addons.getValue('relationForm') || { configs: [], data: [] }
console.log('relationForm', relationForm)
addons.setValue('relationForm', { ...relationForm, configs: [...relationForm.configs, schema] })
}
}, [])
......
......@@ -58,7 +58,7 @@ const getFileType = (fileName) => {
const FileUpload = (props) => {
const site = window.globalConfig?.userInfo?.site || window.globalConfig?.userInfo?.LocalSite
const { value, schema, onChange } = props
const { addons, value, schema, onChange } = props
const { disabled, fileType, presetValue, placeholder, preview, download } = schema
const [showList, setShowList] = useState([])
......@@ -148,6 +148,11 @@ const FileUpload = (props) => {
let list = presetValue ? presetValue.split(',') : []
list.forEach((item, index) => {
if (item) { // @Tips: 直接过滤掉名字中有异常字符的文件
let src = item
let fileType = getFileType(item)
if (fileType === 'svg') {
src = btoa(encodeURI(item))
}
let uid = index + '_' + Math.random()
let _obj = {
uid: uid,
......@@ -155,13 +160,13 @@ const FileUpload = (props) => {
name: item.split('\\').reverse()[0],
type: fileType === '图片' ? 'image/jpeg' : 'file',
status: 'done',
url: `${downloadFileUrl}?filePath=${item}${site ? `&_site=${site}` : ''}`,
sourcePath: item.url,
url: `${downloadFileUrl}?filePath=${src}${site ? `&_site=${site}` : ''}`,
sourcePath: src,
originFileObj: { "uid": uid },
"response": { "code": 0, "msg": "Ok", "data": item, "stackTrace": null },
"response": { "code": 0, "msg": "Ok", "data": src, "stackTrace": null },
"xhr": {},
};
if (schema.renderTo === 'Image') _obj.thumbUrl = `${downloadFileUrl}?filePath=${item}${site ? `&_site=${site}` : ''}`;
if (schema.renderTo === 'Image') _obj.thumbUrl = `${downloadFileUrl}?filePath=${src}${site ? `&_site=${site}` : ''}`;
fileList.push(_obj);
}
})
......@@ -171,10 +176,10 @@ const FileUpload = (props) => {
useEffect(() => {
if (presetValue && !presetValue.includes('拍照相册')) {
onChange(presetValue)
addons?.setValue(addons?.dataPath, presetValue || '')
setShowList(valueToList(presetValue))
} else {
onChange('')
addons?.setValue(addons?.dataPath, '')
}
}, [presetValue])
......
......@@ -126,30 +126,6 @@ body #app {
background-color: rgb(250, 250, 250);
cursor: default;
border: none;
} // 按钮的disabled样式
.@{ant-prefix}-btn[disabled] {
text-shadow: none;
background: #ffffff;
border-color: #d9d9d9;
box-shadow: none;
cursor: default;
&:hover,
&:focus,
&:active {
color: @disabledColor;
text-shadow: none;
background: #ffffff;
border-color: #d9d9d9;
box-shadow: none;
}
} // 上传组件的图片类型按钮的disabled样式
.@{ant-prefix}-upload-disabled {
color: @disabledColor;
cursor: default;
border: none;
.@{ant-prefix}-btn-default {
display: none;
}
} // 多选下的tag的disabled样式
.@{ant-prefix}-select-disabled.@{ant-prefix}-select-multiple {
.@{ant-prefix}-select-selection-item {
......
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