Commit d818d58b authored by 田翔's avatar 田翔

命名规范问题

parent af60a167
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "2.0.8", "version": "2.0.9",
"description": "2.0.8: 解决下拉框组件以及时间类组件弹出层不随组件滚动问题", "description": "2.0.9: 命名规范问题",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
This diff is collapsed.
...@@ -5,14 +5,14 @@ import city from '../../../../constant/city' ...@@ -5,14 +5,14 @@ import city from '../../../../constant/city'
const CascadeSelector = (props) => { const CascadeSelector = (props) => {
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { presetValue, disabled, placeholder, soruceType, } = schema const { presetValue, disabled, placeholder, sourceType, } = schema
const enums = useMemo(() => { const enums = useMemo(() => {
if (soruceType === '城市数据') { if (sourceType === '城市数据') {
return city return city
} }
return [] return []
}, [soruceType]) }, [sourceType])
const getDefaultValue = selectedValues => { const getDefaultValue = selectedValues => {
if (!selectedValues || !selectedValues.length) { if (!selectedValues || !selectedValues.length) {
......
...@@ -5,11 +5,11 @@ import { GetSelectItemList } from '../../../../apis/process' ...@@ -5,11 +5,11 @@ import { GetSelectItemList } from '../../../../apis/process'
const CheckBox = (props) => { const CheckBox = (props) => {
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { presetValue, disabled, soruceType, options, dictionary } = schema const { presetValue, disabled, sourceType, options, dictionary } = schema
const [dictionaryList, setDictionaryList] = useState([]) const [dictionaryList, setDictionaryList] = useState([])
const enums = useMemo(() => { const enums = useMemo(() => {
switch (soruceType) { switch (sourceType) {
case '手动输入': case '手动输入':
return Array.isArray(options) ? options.map(v => v.value) : [] return Array.isArray(options) ? options.map(v => v.value) : []
case '数据字典': case '数据字典':
...@@ -17,7 +17,7 @@ const CheckBox = (props) => { ...@@ -17,7 +17,7 @@ const CheckBox = (props) => {
default: default:
return [] return []
} }
}, [soruceType, options, dictionaryList]) }, [sourceType, options, dictionaryList])
useEffect(() => { useEffect(() => {
if (addons) { if (addons) {
...@@ -41,10 +41,10 @@ const CheckBox = (props) => { ...@@ -41,10 +41,10 @@ const CheckBox = (props) => {
} }
useEffect(() => { useEffect(() => {
if (soruceType === '数据字典' && dictionary) { if (sourceType === '数据字典' && dictionary) {
onFocus() onFocus()
} }
}, [soruceType, dictionary]) }, [sourceType, dictionary])
return ( return (
<Checkbox.Group <Checkbox.Group
......
...@@ -8,7 +8,7 @@ const ComboBox = (props) => { ...@@ -8,7 +8,7 @@ const ComboBox = (props) => {
const userID = window?.globalConfig?.userInfo?.OID || 1 const userID = window?.globalConfig?.userInfo?.OID || 1
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { placeholder, disabled, soruceType, options, dictionary, tableName, fieldName, presetValue, isMultiple, isEdit, isMySite, isSearch } = schema const { placeholder, disabled, sourceType, options, dictionary, tableName, fieldName, presetValue, isMultiple, isEdit, isMySite, isSearch } = schema
const [dictionaryList, setDictionaryList] = useState([]) const [dictionaryList, setDictionaryList] = useState([])
const [tableData, setTableData] = useState([]) const [tableData, setTableData] = useState([])
const [site, setSite] = useState([]) const [site, setSite] = useState([])
...@@ -30,7 +30,7 @@ const ComboBox = (props) => { ...@@ -30,7 +30,7 @@ const ComboBox = (props) => {
}, [isEdit, isMultiple, value]) }, [isEdit, isMultiple, value])
const enums = useMemo(() => { const enums = useMemo(() => {
switch (soruceType) { switch (sourceType) {
case '手动输入': case '手动输入':
return Array.isArray(options) ? options.map(v => v.value) : [] return Array.isArray(options) ? options.map(v => v.value) : []
case '数据字典': case '数据字典':
...@@ -42,7 +42,7 @@ const ComboBox = (props) => { ...@@ -42,7 +42,7 @@ const ComboBox = (props) => {
default: default:
return [] return []
} }
}, [soruceType, options, dictionaryList, tableData, site]) }, [sourceType, options, dictionaryList, tableData, site])
const children = useMemo(() => { const children = useMemo(() => {
let children = [] let children = []
...@@ -64,7 +64,7 @@ const ComboBox = (props) => { ...@@ -64,7 +64,7 @@ const ComboBox = (props) => {
const onFocus = async () => { const onFocus = async () => {
if (addons) { if (addons) {
if (soruceType === '数据字典') { if (sourceType === '数据字典') {
if (!dictionary) { if (!dictionary) {
return message.error('请选择数据字典!') return message.error('请选择数据字典!')
} }
...@@ -73,7 +73,7 @@ const ComboBox = (props) => { ...@@ -73,7 +73,7 @@ const ComboBox = (props) => {
setDictionaryList(data) setDictionaryList(data)
} }
} }
if (soruceType === '表数据') { if (sourceType === '表数据') {
if (!tableName) { if (!tableName) {
return message.info('请选择表名!') return message.info('请选择表名!')
} }
...@@ -91,7 +91,7 @@ const ComboBox = (props) => { ...@@ -91,7 +91,7 @@ const ComboBox = (props) => {
message.error(msg) message.error(msg)
} }
} }
if (soruceType === '站点') { if (sourceType === '站点') {
const { code, data, msg } = await getStationListByUserID(userID, !isMySite) const { code, data, msg } = await getStationListByUserID(userID, !isMySite)
if (code === 0) { if (code === 0) {
if (Array.isArray(data)) { if (Array.isArray(data)) {
......
...@@ -5,7 +5,7 @@ import { GetSelectItemList } from '../../../../apis/process' ...@@ -5,7 +5,7 @@ import { GetSelectItemList } from '../../../../apis/process'
const RadioButton = (props) => { const RadioButton = (props) => {
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { presetValue, disabled, soruceType, options, dictionary } = schema const { presetValue, disabled, sourceType, options, dictionary } = schema
const [dictionaryList, setDictionaryList] = useState([]) const [dictionaryList, setDictionaryList] = useState([])
useEffect(() => { useEffect(() => {
...@@ -28,13 +28,13 @@ const RadioButton = (props) => { ...@@ -28,13 +28,13 @@ const RadioButton = (props) => {
} }
useEffect(() => { useEffect(() => {
if (soruceType === '数据字典' && dictionary) { if (sourceType === '数据字典' && dictionary) {
onFocus() onFocus()
} }
}, [soruceType, dictionary]) }, [sourceType, dictionary])
const enums = useMemo(() => { const enums = useMemo(() => {
switch (soruceType) { switch (sourceType) {
case '手动输入': case '手动输入':
return Array.isArray(options) ? options.map(v => v.value) : [] return Array.isArray(options) ? options.map(v => v.value) : []
case '数据字典': case '数据字典':
...@@ -42,7 +42,7 @@ const RadioButton = (props) => { ...@@ -42,7 +42,7 @@ const RadioButton = (props) => {
default: default:
return [] return []
} }
}, [soruceType, options, dictionaryList]) }, [sourceType, options, dictionaryList])
return ( return (
<Radio.Group onChange={radioChange} value={value} disabled={disabled}> <Radio.Group onChange={radioChange} value={value} disabled={disabled}>
......
...@@ -4,14 +4,14 @@ import { Switch } from 'antd' ...@@ -4,14 +4,14 @@ import { Switch } from 'antd'
const BooleanSwitch = (props) => { const BooleanSwitch = (props) => {
const { value, onChange, addons, schema, disabled } = props const { value, onChange, addons, schema, disabled } = props
const { name } = addons.formData const { widget } = addons.formData
const switchChange = (checked) => { const switchChange = (checked) => {
onChange(checked) onChange(checked)
} }
useEffect(() => { useEffect(() => {
if (name === '下拉框') { if (widget === 'ComboBox') {
if (value) { if (value) {
addons.setValue('isMultiple', false) addons.setValue('isMultiple', false)
} }
......
...@@ -5,14 +5,14 @@ import city from '../../../../../constant/city' ...@@ -5,14 +5,14 @@ import city from '../../../../../constant/city'
const CascadeDefault = (props) => { const CascadeDefault = (props) => {
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { soruceType } = addons.formData const { sourceType } = addons.formData
const enums = useMemo(() => { const enums = useMemo(() => {
if (soruceType === '城市数据') { if (sourceType === '城市数据') {
return city return city
} }
return [] return []
}, [soruceType]) }, [sourceType])
const getDefaultValue = selectedValues => { const getDefaultValue = selectedValues => {
......
...@@ -7,18 +7,18 @@ const FieldNames = (props) => { ...@@ -7,18 +7,18 @@ const FieldNames = (props) => {
let fieldsStr = window.sessionStorage.getItem('designerRef') || '' let fieldsStr = window.sessionStorage.getItem('designerRef') || ''
let fields = fieldsStr.split(',') || [] let fields = fieldsStr.split(',') || []
const { value, onChange, addons } = props const { value, onChange, addons } = props
const { tableNameParent, name } = addons.formData const { tableNameParent, widget } = addons.formData
const [fieldName, setFieldName] = useState([]) const [fieldName, setFieldName] = useState([])
const options = useMemo(() => { const options = useMemo(() => {
if (name === '关联选择' && addons.dataPath === 'fieldParent') { if (widget === 'RelevanceSelect' && addons.dataPath === 'fieldParent') {
return fieldName return fieldName
} }
return fieldName.filter(v => !fields.includes(v.name)) return fieldName.filter(v => !fields.includes(v.name))
}, [fieldName, addons]) }, [fieldName, addons])
const selectChange = (value) => { const selectChange = (value) => {
if (name !== '关联表单') { if (widget !== 'RelationForm') {
addons.setValueByPath('title', value) addons.setValueByPath('title', value)
} else { } else {
addons.setValueByPath('titleShow', value) addons.setValueByPath('titleShow', value)
......
...@@ -5,7 +5,7 @@ import { LoadLedgers } from '../../../../../apis/process' ...@@ -5,7 +5,7 @@ import { LoadLedgers } from '../../../../../apis/process'
const AccountName = (props) => { const AccountName = (props) => {
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { name } = addons.formData const { widget } = addons.formData
const [options, setOptions] = useState([]) const [options, setOptions] = useState([])
const onFocus = async () => { const onFocus = async () => {
...@@ -22,9 +22,9 @@ const AccountName = (props) => { ...@@ -22,9 +22,9 @@ const AccountName = (props) => {
} }
const selectChange = (value) => { const selectChange = (value) => {
if (name === '台账选择器') { if (widget === 'AccountSelector') {
addons.setValueByPath('fieldshine', []) addons.setValueByPath('fieldshine', [])
} else if (name === '关联表单') { } else if (widget === 'RelationForm') {
addons.setValueByPath('mappedField', []) addons.setValueByPath('mappedField', [])
} }
onChange(value) onChange(value)
......
...@@ -21,7 +21,7 @@ const fnList = [ ...@@ -21,7 +21,7 @@ const fnList = [
const CalculateRule = (props) => { const CalculateRule = (props) => {
const { value, onChange, addons } = props const { value, onChange, addons } = props
const { tableNameParent, name } = addons.formData const { tableNameParent } = addons.formData
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
const [fieldList, setFieldList] = useState([]) const [fieldList, setFieldList] = useState([])
const [rule, setRule] = useState([]) const [rule, setRule] = useState([])
......
...@@ -14,7 +14,7 @@ const fnList = [ ...@@ -14,7 +14,7 @@ const fnList = [
const ControlRules = (props) => { const ControlRules = (props) => {
const { value, onChange, addons } = props const { value, onChange, addons } = props
const { tableNameParent, name } = addons.formData const { tableNameParent } = addons.formData
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
const [fieldList, setFieldList] = useState([]) const [fieldList, setFieldList] = useState([])
const [rule, setRule] = useState([]) const [rule, setRule] = useState([])
......
...@@ -8,20 +8,20 @@ const initOptions = [ ...@@ -8,20 +8,20 @@ const initOptions = [
{ label: '站点', value: '站点' } { label: '站点', value: '站点' }
] ]
const SoruceType = (props) => { const SourceType = (props) => {
const { value, onChange, schema, addons } = props const { value, onChange, addons } = props
const { name } = schema const { widget } = addons.formData
const options = useMemo(() => { const options = useMemo(() => {
if ('下拉框' === name) { if (widget === 'ComboBox') {
return initOptions return initOptions
} }
return [ return [
{ label: '手动输入', value: '手动输入' }, { label: '手动输入', value: '手动输入' },
{ label: '数据字典', value: '数据字典' }, { label: '数据字典', value: '数据字典' },
] ]
}, [name]) }, [widget])
const selectChange = (e) => { const selectChange = (e) => {
if (value === '手动输入') { if (value === '手动输入') {
...@@ -49,4 +49,4 @@ const SoruceType = (props) => { ...@@ -49,4 +49,4 @@ const SoruceType = (props) => {
} }
export default SoruceType export default SourceType
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ import AccountName from './AccountName' ...@@ -3,7 +3,7 @@ import AccountName from './AccountName'
import Fieldshine from './Fieldshine' import Fieldshine from './Fieldshine'
import MappedField from './MappedField' import MappedField from './MappedField'
import ControlRules from './ControlRules' import ControlRules from './ControlRules'
import SoruceType from './SoruceType' import SourceType from './SourceType'
import TableName from './TableName' import TableName from './TableName'
import FieldName from './FieldName' import FieldName from './FieldName'
import CalculateRule from './CalculateRule' import CalculateRule from './CalculateRule'
...@@ -14,7 +14,7 @@ const groupSource = { ...@@ -14,7 +14,7 @@ const groupSource = {
Fieldshine, Fieldshine,
MappedField, MappedField,
ControlRules, ControlRules,
SoruceType, SourceType,
TableName, TableName,
FieldName, FieldName,
CalculateRule, CalculateRule,
......
import React from 'react'
import { Form, Input } from 'antd'
const UniqueVerify = (props) => {
return (
<Form
layout='inline'
>
<Form.Item
label='表名'
name='表名'
>
<Input />
</Form.Item>
<Form.Item
label='字段名'
name='字段名'
>
<Input />
</Form.Item>
</Form>
)
}
export default UniqueVerify
\ No newline at end of file
import VerifyTextInput from './VerifyTextInput' import VerifyTextInput from './VerifyTextInput'
import UniqueVerify from './UniqueVerify'
const groupVerify = { const groupVerify = {
VerifyTextInput, VerifyTextInput,
UniqueVerify,
} }
export default groupVerify export default groupVerify
\ 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