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"
],
......
......@@ -565,7 +565,6 @@ const textWidgets = [
icon: <HighlightOutlined />,
schema: {
title: '富文本',
name: '富文本',
type: 'string',
widget: 'RichText',
width: '100%',
......@@ -777,7 +776,6 @@ const selectWidgets = [
name: '下拉框',
schema: {
title: '下拉框',
name: '下拉框',
type: 'string',
widget: 'ComboBox',
},
......@@ -816,16 +814,16 @@ const selectWidgets = [
displayType: 'row',
labelWidth: 80,
},
gorupSoruce: {
groupSource: {
title: '数据来源',
type: 'object',
properties: {}
},
soruceType: {
sourceType: {
title: '来源方式',
name: '下拉框',
type: 'string',
widget: 'SoruceType',
widget: 'SourceType',
default: '手动输入',
displayType: 'row',
labelWidth: 80,
......@@ -834,8 +832,8 @@ const selectWidgets = [
title: '',
name: '选项',
type: 'array',
required: '{{formData.soruceType === "手动输入"}}',
hidden: '{{formData.soruceType !== "手动输入"}}',
required: '{{formData.sourceType === "手动输入"}}',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [],
widget: 'simpleList',
items: {
......@@ -863,42 +861,42 @@ const selectWidgets = [
},
displayType: 'row',
labelWidth: 80,
dependencies: ['soruceType']
dependencies: ['sourceType']
},
dictionary: {
title: '{{formData.soruceType}}',
name: '{{formData.soruceType}}',
required: '{{formData.soruceType === "数据字典"}}',
hidden: '{{formData.soruceType !== "数据字典"}}',
title: '{{formData.sourceType}}',
name: '{{formData.sourceType}}',
required: '{{formData.sourceType === "数据字典"}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
type: 'string',
widget: 'Dictionary',
value: '{{formData.soruceType !== "数据字典" ? null : ""}}',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
displayType: 'row',
labelWidth: 80,
dependencies: ['soruceType']
dependencies: ['sourceType']
},
tableName: {
title: '表名',
name: '表名',
required: '{{formData.soruceType === "表数据"}}',
hidden: '{{formData.soruceType !== "表数据"}}',
required: '{{formData.sourceType === "表数据"}}',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'TableName',
displayType: 'row',
labelWidth: 80,
dependencies: ['soruceType'],
dependencies: ['sourceType'],
},
fieldName: {
title: '字段名',
name: '字段名',
required: true,
required: '{{formData.soruceType === "表数据"}}',
hidden: '{{formData.soruceType !== "表数据"}}',
required: '{{formData.sourceType === "表数据"}}',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
displayType: 'row',
labelWidth: 80,
dependencies: ['soruceType', 'tableName'],
dependencies: ['sourceType', 'tableName'],
},
isMySite: {
title: '仅显示本人所属的站点',
......@@ -906,7 +904,7 @@ const selectWidgets = [
required: true,
default: false,
// description: '勾选后仅显示本人所属的站点',
hidden: '{{formData.soruceType !== "站点"}}',
hidden: '{{formData.sourceType !== "站点"}}',
type: 'boolean',
widget: 'checkbox',
props: {
......@@ -963,7 +961,7 @@ const selectWidgets = [
displayType: 'row',
labelWidth: 120,
description: '勾选后可直接输入选项,可编辑选择仅支持多选',
hidden: '{{formData.soruceType !== "手动输入"}}'
hidden: '{{formData.sourceType !== "手动输入"}}'
},
description: {
title: '说明',
......@@ -1032,12 +1030,12 @@ const selectWidgets = [
displayType: 'row',
labelWidth: 80,
},
gorupSoruce: {
groupSource: {
title: '数据来源',
type: 'object',
properties: {}
},
soruceType: {
sourceType: {
title: '来源方式',
name: '单选框',
type: 'string',
......@@ -1050,8 +1048,8 @@ const selectWidgets = [
title: '',
name: '选项',
type: 'array',
required: '{{formData.soruceType === "手动输入"}}',
hidden: '{{formData.soruceType !== "手动输入"}}',
required: '{{formData.sourceType === "手动输入"}}',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [],
widget: 'simpleList',
items: {
......@@ -1081,13 +1079,13 @@ const selectWidgets = [
labelWidth: 80,
},
dictionary: {
title: '{{formData.soruceType}}',
name: '{{formData.soruceType}}',
required: '{{formData.soruceType === "数据字典"}}',
hidden: '{{formData.soruceType !== "数据字典"}}',
title: '{{formData.sourceType}}',
name: '{{formData.sourceType}}',
required: '{{formData.sourceType === "数据字典"}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
type: 'string',
widget: 'Dictionary',
value: '{{formData.soruceType !== "数据字典" ? null : ""}}',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
displayType: 'row',
labelWidth: 80,
},
......@@ -1189,12 +1187,12 @@ const selectWidgets = [
displayType: 'row',
labelWidth: 80,
},
gorupSoruce: {
groupSource: {
title: '数据来源',
type: 'object',
properties: {}
},
soruceType: {
sourceType: {
title: '来源方式',
name: '复选框',
type: 'string',
......@@ -1210,8 +1208,8 @@ const selectWidgets = [
title: '',
name: '选项',
type: 'array',
required: '{{formData.soruceType === "手动输入"}}',
hidden: '{{formData.soruceType !== "手动输入"}}',
required: '{{formData.sourceType === "手动输入"}}',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [],
widget: 'simpleList',
items: {
......@@ -1241,13 +1239,13 @@ const selectWidgets = [
labelWidth: 80,
},
dictionary: {
title: '{{formData.soruceType}}',
name: '{{formData.soruceType}}',
required: '{{formData.soruceType === "数据字典"}}',
hidden: '{{formData.soruceType !== "数据字典"}}',
title: '{{formData.sourceType}}',
name: '{{formData.sourceType}}',
required: '{{formData.sourceType === "数据字典"}}',
hidden: '{{formData.sourceType !== "数据字典"}}',
type: 'string',
widget: 'Dictionary',
value: '{{formData.soruceType !== "数据字典" ? null : ""}}',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
displayType: 'row',
labelWidth: 80,
},
......@@ -1461,9 +1459,9 @@ const selectWidgets = [
displayType: 'row',
widget: 'CascadeDefault',
labelWidth: 80,
dependencies: ['soruceType']
dependencies: ['sourceType']
},
gorupSoruce: {
groupSource: {
title: '数据来源',
type: 'object',
properties: {}
......@@ -1565,14 +1563,14 @@ const selectWidgets = [
widget: 'CascadeDefault',
displayType: 'row',
labelWidth: 80,
// dependencies: ['soruceType']
// dependencies: ['sourceType']
},
gorupSoruce: {
groupSource: {
title: '数据来源',
type: 'object',
properties: {}
},
soruceType: {
sourceType: {
title: '来源方式',
name: '来源方式',
type: 'string',
......@@ -1651,7 +1649,6 @@ const businessWidgets = [
name: '人员选择器',
schema: {
title: '人员选择器',
name: '人员选择器',
type: 'string',
widget: 'PersonSelector',
},
......@@ -1690,7 +1687,7 @@ const businessWidgets = [
displayType: 'row',
labelWidth: 80,
},
gorupSoruce: {
groupSource: {
title: '数据来源',
type: 'object',
properties: {}
......@@ -1796,7 +1793,6 @@ const businessWidgets = [
name: '部门选择器',
schema: {
title: '部门选择器',
name: '部门选择器',
type: 'string',
widget: 'DeptSelector',
},
......@@ -1907,7 +1903,6 @@ const businessWidgets = [
name: '台账选择器',
schema: {
title: '台账选择器',
name: '台账选择器',
type: 'string',
widget: 'AccountSelector',
require: true,
......@@ -1949,7 +1944,7 @@ const businessWidgets = [
displayType: 'row',
labelWidth: 80,
},
gorupSoruce: {
groupSource: {
title: '数据来源',
type: 'object',
properties: {}
......@@ -2052,7 +2047,6 @@ const dateWidgets = [
name: '日期选择',
schema: {
title: '日期选择',
name: '日期选择',
type: 'string',
widget: 'DateTime',
},
......@@ -2200,7 +2194,6 @@ const dateWidgets = [
icon: <FieldTimeOutlined />,
schema: {
title: '时间选择',
name: '时间选择',
type: 'string',
widget: 'Time',
},
......@@ -2760,7 +2753,6 @@ const advancedWidgets = [
name: '关联表单',
schema: {
title: '',
name: '关联表单',
type: 'string',
widget: 'RelationForm',
width: '100%',
......@@ -2819,7 +2811,7 @@ const advancedWidgets = [
displayType: 'row',
labelWidth: 60,
},
gorupSoruce: {
groupSource: {
title: '数据来源',
type: 'object',
properties: {}
......@@ -2885,7 +2877,6 @@ const advancedWidgets = [
name: '自动计算',
schema: {
title: '自动计算',
name: '自动计算',
type: 'string',
widget: 'AutoCalculate',
},
......@@ -2961,7 +2952,7 @@ const advancedWidgets = [
displayType: 'row',
labelWidth: 55,
},
gorupSoruce: {
groupSource: {
title: '数据来源',
type: 'object',
properties: {},
......
......@@ -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