Commit d818d58b authored by 田翔's avatar 田翔

命名规范问题

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