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

fix: 样式尝试修复

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