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

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

parent 6771399d
{
"name": "panda-xform",
"version": "1.5.9",
"description": "1.5.9: 字段名称防止重复",
"version": "1.6.0",
"description": "1.6.0: 在运维取值兼容性增强,附件根据文件类型固定样式,字段名称修复",
"keywords": [
"panda-xform"
],
......
......@@ -657,7 +657,88 @@ const textWidgets = [
schema: {
title: '编码',
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 = [
},
}
},
// {
// text: '开关',
// name: '开关',
// schema: {
// title: '开关',
// name: '开关',
// type: 'Boolean',
// widget: 'Switch',
// },
// },
{
text: '关联选择',
name: '关联选择',
schema: {
title: '关联选择',
name: '关联选择',
title: '关联选择',
name: '关联选择',
type: 'string',
widget: 'RelevanceSelect',
require: true,
......@@ -2178,20 +2269,20 @@ const fileWidgets = [
type: 'boolean',
widget: 'checkbox',
default: false,
hidden: "{{formData.fileType !== '图片'}}"
hidden: "{{!['图片','音频', '视频'].includes(formData.fileType)}}"
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
showType: {
title: '显示方式',
type: 'string',
default: 'picture',
enum: ['picture', 'text', 'picture-card'],
enumNames: ['列表_详细', '列表_省略', '卡片'],
},
// showType: {
// title: '显示方式',
// type: 'string',
// default: 'picture',
// enum: ['picture', 'text', 'picture-card'],
// enumNames: ['列表_详细', '列表_省略', '卡片'],
// },
// width: {
// title: '元素宽度',
// type: 'string',
......
......@@ -20,8 +20,8 @@ const Coordinate = ({ value, onChange, name, schema }) => {
const mapConfig = window.globalConfig.mapsettings?.layers || null
return { layers: mapConfig };
});
const mapSettings = window.globalConfig.mapsettings;
const layers = window.globalConfig.mapsettings.layers;
const mapSettings = window.globalConfig?.mapsettings;
const layers = window.globalConfig?.mapsettings?.layers;
const [loading, setLoading] = useState(false);
const [visible, setVisible] = useState(false);
const [currentPointer, setCurrentPointer] = useState([]);
......
......@@ -190,7 +190,7 @@ const initMapConfig = [
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 [visible, setVisible] = useState(false)
......
......@@ -51,12 +51,14 @@ const getFileType = (fileName) => {
const FileUpload = (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 [visible, setVisible] = useState(false)
const [showFile, setShowFile] = useState({ fileType: '', filePath: '' })
const showType = fileType === '图片' ? 'picture-card' : 'picture'
const option = {
name: 'file',
action: `${window.location.origin}${uploadFileUrl}`,
......
......@@ -4,12 +4,16 @@ import { LoadTableFields, ReloadTableFields } from '../../../../../apis/process'
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 { tableNameParent, name } = addons.formData
const [fieldName, setFieldName] = useState([])
const options = useMemo(() => {
if (name === '关联选择') {
return fieldName
}
return fieldName.filter(v => !fields.includes(v.name))
}, [fieldName])
......@@ -47,25 +51,13 @@ const FieldNames = (props) => {
<Select
onFocus={onFocus}
onChange={selectChange}
style={{ width: '100%' }}
style={{ width: '100%', maxWidth: '222px' }}
showSearch
optionFilterProp='children'
value={value}
fieldNames={{ label: 'name', value: 'name' }}
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>
)
}
......
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'
import TextArea from './TextArea'
import NumberInput from './NumberInput'
import RichText from './RichText'
import Coding from './Coding'
const text = {
TextInput,
TextArea,
NumberInput,
RichText,
Coding,
}
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