Commit 28ecd8f6 authored by 田翔's avatar 田翔

fix: 在运维取值兼容性增强,附件根据文件类型固定样式,字段名称修复

parent 6771399d
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "1.5.9", "version": "1.6.0",
"description": "1.5.9: 字段名称防止重复", "description": "1.6.0: 在运维取值兼容性增强,附件根据文件类型固定样式,字段名称修复",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -657,7 +657,88 @@ const textWidgets = [ ...@@ -657,7 +657,88 @@ const textWidgets = [
schema: { schema: {
title: '编码', title: '编码',
type: 'string', type: 'string',
widget: 'RichText', widget: 'Coding',
},
setting: {
groupBase: {
title: '基础信息',
type: 'object',
properties: {}
},
$id: {
title: '字段名称',
type: 'string',
widget: 'FieldNames',
required: true,
displayType: 'row',
labelWidth: 80,
},
title: {
title: '标题',
required: true,
type: 'string',
widget: 'htmlInput',
displayType: 'row',
labelWidth: 80,
},
presetValue: {
title: '默认值',
type: 'string',
displayType: 'row',
labelWidth: 80,
},
groupSetting: {
title: '控件设置',
type: 'object',
properties: {}
},
required: {
title: '必填',
type: 'boolean',
default: false,
width: '40%',
props: {
style: {
marginLeft: '10px'
}
}
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '30%',
},
hidden: {
title: '隐藏',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '30%',
},
description: {
title: '说明',
type: 'string',
displayType: 'row',
labelWidth: 55,
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
type: 'number',
widget: 'slider',
max: 400,
props: {
hideNumber: true,
},
},
}, },
} }
] ]
...@@ -1194,12 +1275,22 @@ const selectWidgets = [ ...@@ -1194,12 +1275,22 @@ const selectWidgets = [
}, },
} }
}, },
// {
// text: '开关',
// name: '开关',
// schema: {
// title: '开关',
// name: '开关',
// type: 'Boolean',
// widget: 'Switch',
// },
// },
{ {
text: '关联选择', text: '关联选择',
name: '关联选择', name: '关联选择',
schema: { schema: {
title: '关联选择', title: '关联选择',
name: '关联选择', name: '关联选择',
type: 'string', type: 'string',
widget: 'RelevanceSelect', widget: 'RelevanceSelect',
require: true, require: true,
...@@ -2178,20 +2269,20 @@ const fileWidgets = [ ...@@ -2178,20 +2269,20 @@ const fileWidgets = [
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
hidden: "{{formData.fileType !== '图片'}}" hidden: "{{!['图片','音频', '视频'].includes(formData.fileType)}}"
}, },
groupStyle: { groupStyle: {
title: '控件样式', title: '控件样式',
type: 'object', type: 'object',
properties: {} properties: {}
}, },
showType: { // showType: {
title: '显示方式', // title: '显示方式',
type: 'string', // type: 'string',
default: 'picture', // default: 'picture',
enum: ['picture', 'text', 'picture-card'], // enum: ['picture', 'text', 'picture-card'],
enumNames: ['列表_详细', '列表_省略', '卡片'], // enumNames: ['列表_详细', '列表_省略', '卡片'],
}, // },
// width: { // width: {
// title: '元素宽度', // title: '元素宽度',
// type: 'string', // type: 'string',
......
...@@ -20,8 +20,8 @@ const Coordinate = ({ value, onChange, name, schema }) => { ...@@ -20,8 +20,8 @@ const Coordinate = ({ value, onChange, name, schema }) => {
const mapConfig = window.globalConfig.mapsettings?.layers || null const mapConfig = window.globalConfig.mapsettings?.layers || null
return { layers: mapConfig }; return { layers: mapConfig };
}); });
const mapSettings = window.globalConfig.mapsettings; const mapSettings = window.globalConfig?.mapsettings;
const layers = window.globalConfig.mapsettings.layers; const layers = window.globalConfig?.mapsettings?.layers;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [currentPointer, setCurrentPointer] = useState([]); const [currentPointer, setCurrentPointer] = useState([]);
......
...@@ -190,7 +190,7 @@ const initMapConfig = [ ...@@ -190,7 +190,7 @@ const initMapConfig = [
const Device = ({ addons, value, onChange, schema }) => { const Device = ({ addons, value, onChange, schema }) => {
const mapConfig = window.globalConfig.mapsettings?.layers || initMapConfig const mapConfig = window.globalConfig?.mapsettings?.layers || initMapConfig
const { placeholder, disabled } = schema const { placeholder, disabled } = schema
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
......
...@@ -51,12 +51,14 @@ const getFileType = (fileName) => { ...@@ -51,12 +51,14 @@ const getFileType = (fileName) => {
const FileUpload = (props) => { const FileUpload = (props) => {
const { value, schema, onChange } = props const { value, schema, onChange } = props
const { disabled, fileType, showType, presetValue, placeholder, preview, download } = schema const { disabled, fileType, presetValue, placeholder, preview, download } = schema
const [showList, setShowList] = useState('') const [showList, setShowList] = useState('')
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
const [showFile, setShowFile] = useState({ fileType: '', filePath: '' }) const [showFile, setShowFile] = useState({ fileType: '', filePath: '' })
const showType = fileType === '图片' ? 'picture-card' : 'picture'
const option = { const option = {
name: 'file', name: 'file',
action: `${window.location.origin}${uploadFileUrl}`, action: `${window.location.origin}${uploadFileUrl}`,
......
...@@ -4,12 +4,16 @@ import { LoadTableFields, ReloadTableFields } from '../../../../../apis/process' ...@@ -4,12 +4,16 @@ import { LoadTableFields, ReloadTableFields } from '../../../../../apis/process'
const FieldNames = (props) => { const FieldNames = (props) => {
let fields = window.sessionStorage.getItem('designerRef') || [] let fieldsStr = window.sessionStorage.getItem('designerRef') || ''
let fields = fieldsStr.split(',') || []
const { value, onChange, addons } = props const { value, onChange, addons } = props
const { tableNameParent, name } = addons.formData const { tableNameParent, name } = addons.formData
const [fieldName, setFieldName] = useState([]) const [fieldName, setFieldName] = useState([])
const options = useMemo(() => { const options = useMemo(() => {
if (name === '关联选择') {
return fieldName
}
return fieldName.filter(v => !fields.includes(v.name)) return fieldName.filter(v => !fields.includes(v.name))
}, [fieldName]) }, [fieldName])
...@@ -47,25 +51,13 @@ const FieldNames = (props) => { ...@@ -47,25 +51,13 @@ const FieldNames = (props) => {
<Select <Select
onFocus={onFocus} onFocus={onFocus}
onChange={selectChange} onChange={selectChange}
style={{ width: '100%' }} style={{ width: '100%', maxWidth: '222px' }}
showSearch showSearch
optionFilterProp='children' optionFilterProp='children'
value={value} value={value}
fieldNames={{ label: 'name', value: 'name' }} fieldNames={{ label: 'name', value: 'name' }}
options={options} options={options}
> >
{/* {
options.map(v => {
return (
<Select.Option key={v.name} value={v.name}>
<div>
<span>{v.name}</span>
<span>{v.check ? '已选': '未选'}</span>
</div>
</Select.Option>
)
})
} */}
</Select> </Select>
) )
} }
......
import React from 'react'
const Coding = (props) => {
return (
<div>编码</div>
)
}
export default Coding
\ No newline at end of file
...@@ -2,12 +2,14 @@ import TextInput from './TextInput' ...@@ -2,12 +2,14 @@ import TextInput from './TextInput'
import TextArea from './TextArea' import TextArea from './TextArea'
import NumberInput from './NumberInput' import NumberInput from './NumberInput'
import RichText from './RichText' import RichText from './RichText'
import Coding from './Coding'
const text = { const text = {
TextInput, TextInput,
TextArea, TextArea,
NumberInput, NumberInput,
RichText, RichText,
Coding,
} }
export default text export default text
\ No newline at end of file
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