Commit 3683972f authored by 田翔's avatar 田翔

fix: 增加压缩文件配置默认为压缩

parent 68cda385
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "5.9.2", "version": "5.9.3",
"description": "5.9.2 身份认证bug", "description": "5.9.3 增加压缩文件配置默认为压缩",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -3,7 +3,8 @@ import { commonSettings, switchSettings, elementSettings } from './otherSettings ...@@ -3,7 +3,8 @@ import { commonSettings, switchSettings, elementSettings } from './otherSettings
import { GroupOutlined } from '@ant-design/icons' import { GroupOutlined } from '@ant-design/icons'
import IconPack from '../../components/IconPack' import IconPack from '../../components/IconPack'
const disabled = '{{formData.tableTypeParent === "物联设备表" && formData.IsSystemField}}' // const disabled = '{{formData.tableTypeParent === "物联设备表" && formData.IsSystemField}}'
const disabled = '{{formData.tableTypeParent === "物联设备表" && formData.$id === "编码"}}'
const groupStyle = { const groupStyle = {
groupStyle: { groupStyle: {
...@@ -35,10 +36,6 @@ const layoutWidgets = [ ...@@ -35,10 +36,6 @@ const layoutWidgets = [
required: true, required: true,
disabled: '{{formData.title === "物联数据"}}', disabled: '{{formData.title === "物联数据"}}',
}, },
// description: {
// title: '分组说明',
// type: 'string',
// },
}, },
}, },
{ {
...@@ -1906,6 +1903,7 @@ const fileWidgets = [ ...@@ -1906,6 +1903,7 @@ const fileWidgets = [
widget: 'FileUpload', widget: 'FileUpload',
width: '100%', width: '100%',
preview: true, preview: true,
isUncompressed: true,
}, },
setting: { setting: {
widget: { widget: {
...@@ -1978,14 +1976,20 @@ const fileWidgets = [ ...@@ -1978,14 +1976,20 @@ const fileWidgets = [
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: true, default: true,
width: '33%', width: '50%',
}, },
download: { download: {
title: '下载', title: '下载',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: true, default: true,
width: '33%', width: '50%',
},
isUncompressed: {
title: '压缩',
type: 'boolean',
widget: 'BooleanSwitch',
description: '附件是否压缩(压缩后清晰度会降低)',
}, },
photo: { photo: {
title: '允许从相册选取', title: '允许从相册选取',
......
...@@ -320,16 +320,20 @@ const FormDesigner = (props, ref) => { ...@@ -320,16 +320,20 @@ const FormDesigner = (props, ref) => {
const canDelete = (values) => { const canDelete = (values) => {
const { $id, tableTypeParent, IsSystemField, title, type } = values const { $id, tableTypeParent, IsSystemField, title, type } = values
if (tableTypeParent === '物联设备表' && IsSystemField) { if (tableTypeParent === '物联设备表' && $id === '编码') {
if (fieldName.some(v => v.name === $id)) { message.info(`表类型为:【物联设备表】内部字段【编码】不允许删除!`)
message.info(`表类型为:【物联设备表】内部字段【${$id}】不允许删除!`)
return false
}
}
if (type === 'object' && ($id === '#/物联数据' || $id === '物联数据')) {
message.info(`表类型为:【物联设备表】包含内部字段不允许删除`)
return false return false
} }
// if (tableTypeParent === '物联设备表' && IsSystemField) {
// if (fieldName.some(v => v.name === $id)) {
// message.info(`表类型为:【物联设备表】内部字段【${$id}】不允许删除!`)
// return false
// }
// }
// if (type === 'object' && ($id === '#/物联数据' || $id === '物联数据')) {
// message.info(`表类型为:【物联设备表】包含内部字段不允许删除`)
// return false
// }
return true return true
} }
......
...@@ -75,7 +75,7 @@ const XRender = (props, ref) => { ...@@ -75,7 +75,7 @@ const XRender = (props, ref) => {
} }
childObj[s] = { childObj[s] = {
...child[s], ...child[s],
labelWidth: 110, labelWidth: child[s].widget === 'RelationForm' ? 1 : 110,
presetValue: value || child[s].presetValue || '', presetValue: value || child[s].presetValue || '',
textDefalut: child[s].presetValue, textDefalut: child[s].presetValue,
formDisabled: disabled, formDisabled: disabled,
...@@ -99,6 +99,7 @@ const XRender = (props, ref) => { ...@@ -99,6 +99,7 @@ const XRender = (props, ref) => {
displayType: schemaForm.displayType === 'column' ? 'column' : 'row',//未知原因出现存储'左右'/'上下' displayType: schemaForm.displayType === 'column' ? 'column' : 'row',//未知原因出现存储'左右'/'上下'
properties: parentObj properties: parentObj
} }
console.log('json', json)
setInitField(array) setInitField(array)
return json return json
}, [formJson, values, disabledFields, disabled]) }, [formJson, values, disabledFields, disabled])
......
...@@ -69,7 +69,7 @@ const FileUpload = (props) => { ...@@ -69,7 +69,7 @@ const FileUpload = (props) => {
const site = window.globalConfig?.userInfo?.site || window.globalConfig?.userInfo?.LocalSite const site = window.globalConfig?.userInfo?.site || window.globalConfig?.userInfo?.LocalSite
const { addons, 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, isUncompressed } = schema
const [imgVisible, setImgVisible] = useState(false) const [imgVisible, setImgVisible] = useState(false)
const [showList, setShowList] = useState([]) const [showList, setShowList] = useState([])
...@@ -92,7 +92,7 @@ const FileUpload = (props) => { ...@@ -92,7 +92,7 @@ const FileUpload = (props) => {
const option = { const option = {
name: 'file', name: 'file',
action: `${window.location.origin}${uploadFileUrl}`, action: `${window.location.origin}${uploadFileUrl}?isUncompressed=${!isUncompressed}`,
listType: showType, listType: showType,
withCredentials: true, withCredentials: true,
showUploadList: { showUploadList: {
......
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