diff --git a/package.json b/package.json index 782224781cee81c0e5d1ef270715100e62469aaa..30eb682e2cf91cdf13fd8a93c1a2d144da6bd74c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "panda-xform", - "version": "2.4.1", - "description": "2.4.1: 褰撲竴涓洜瀛愬奖鍝嶅涓殑鏃跺€欒绠楀睘鎬у嚭鐜癇UG", + "version": "2.4.3", + "description": "2.4.3: 鏁板€奸粯璁ゅ€奸棶棰�", "keywords": [ "panda-xform" ], diff --git a/src/core/FormDesigner/config/settings.js b/src/core/FormDesigner/config/settings.js index 86cd208660f14a02e1962fd80f0efb7d81f593f9..b59ce2335886634ea4ac08e32ffccb5c1098bf35 100644 --- a/src/core/FormDesigner/config/settings.js +++ b/src/core/FormDesigner/config/settings.js @@ -441,7 +441,7 @@ const textWidgets = [ title: '鏁板€�', type: 'string', widget: 'NumberInput', - presetValue: 0, + presetValue: '0', }, setting: { groupBase: { diff --git a/src/core/FormRender/watch.js b/src/core/FormRender/watch.js index 52cf4cd2deddcf02f69811445cea119b84f5d4f2..de7f67a29d80175f68702194fe2ca32576d0f2dd 100644 --- a/src/core/FormRender/watch.js +++ b/src/core/FormRender/watch.js @@ -167,7 +167,6 @@ export const getWatch = (schema, form, startTime) => { } }) } - console.log('paths', paths) return watch } diff --git a/src/core/widgets/coord/DrawPartition/index.js b/src/core/widgets/coord/DrawPartition/index.js index a661dedff180f2a6ac17866d832dc440c0afadf1..f32ab3d8c975c1dc3ece36177e6c204e9258b4df 100644 --- a/src/core/widgets/coord/DrawPartition/index.js +++ b/src/core/widgets/coord/DrawPartition/index.js @@ -10,7 +10,7 @@ let AMapFunction = null; // 瀛樺偍鍦板浘鐨勬瀯閫犲嚱鏁� let coverLayer = {}; // 瀛樺偍鍒嗗尯鐨勫湴鍥惧璞� const DrawPartition = ({ value, onChange, name, schema }) => { - console.log('DrawPartition') + const mapSettings = window.globalConfig.mapsettings; const [loading, setLoading] = useState(false); const [visible, setVisible] = useState(false); diff --git a/src/core/widgets/settings/groupBase/InputDefault/index.js b/src/core/widgets/settings/groupBase/InputDefault/index.js index 3025e6839bdb57a558d74f30ff0a28722e01fb56..2e29d90909371c9199a18f373c237937115debe6 100644 --- a/src/core/widgets/settings/groupBase/InputDefault/index.js +++ b/src/core/widgets/settings/groupBase/InputDefault/index.js @@ -1,10 +1,10 @@ import React, { useMemo, useState } from 'react' -import { Input, Modal, Popover, Select } from 'antd' +import { Input, Modal, Popover, Select, Dropdown, Menu } from 'antd' import { EllipsisOutlined } from '@ant-design/icons' const options = [ - { label: '鏈汉濮撳悕', value: '銆愭湰浜哄鍚嶃€�' }, - { label: '鏈汉閮ㄩ棬', value: '銆愭湰浜洪儴闂ㄣ€�' }, + { label: '鏈汉濮撳悕', key: '銆愭湰浜哄鍚嶃€�' }, + { label: '鏈汉閮ㄩ棬', key: '銆愭湰浜洪儴闂ㄣ€�' }, ] const InputDefault = (props) => { @@ -19,24 +19,13 @@ const InputDefault = (props) => { return null }, [value]) - const selectChange = (value) => { - onChange(value) - } - - const inputChange = (e) => { onChange(e.target.value) } - const content = ( - <Select - placeholder='璇烽€夋嫨鐜鍙橀噺' - style={{ width: '100%' }} - options={options} - onChange={selectChange} - > - </Select> - ) + const menuClick = (item) => { + onChange(item.key) + } return ( <div className='InputDefault'> @@ -46,14 +35,16 @@ const InputDefault = (props) => { onChange={inputChange} style={style} addonAfter={ - <Popover - placement="topRight" - content={content} - title="鐜鍙橀噺" - trigger="click" + <Dropdown + overlay={( + <Menu + onClick={menuClick} + items={options} + /> + )} > <EllipsisOutlined /> - </Popover> + </Dropdown> } /> </div> diff --git a/src/core/widgets/settings/groupSource/MappedField/index.js b/src/core/widgets/settings/groupSource/MappedField/index.js index 205d63ea89d0f5f1312e01f8a4614ca0f90003d8..bb76c22fbc724af4d11cfd27a0cc5081b9041ae9 100644 --- a/src/core/widgets/settings/groupSource/MappedField/index.js +++ b/src/core/widgets/settings/groupSource/MappedField/index.js @@ -17,7 +17,6 @@ const MappedField = (props) => { const [toField, setToField] = useState([]) const inputClick = async () => { - console.log('addons', addons) if (!accountName) { message.info('璇烽€夋嫨鍙拌处鍚嶇О') } diff --git a/src/core/widgets/settings/groupStyle/PercentSlider/index.js b/src/core/widgets/settings/groupStyle/PercentSlider/index.js index 583872367d4e1d753dbc872e6cefe9552595f270..f7c47dbe9811192fac7281b8d401e423d3969bfe 100644 --- a/src/core/widgets/settings/groupStyle/PercentSlider/index.js +++ b/src/core/widgets/settings/groupStyle/PercentSlider/index.js @@ -63,8 +63,6 @@ const PercentSlider = (props) => { setInputValue(value) } - console.log('marks', marks) - return ( <Slider min={0} diff --git a/src/core/widgets/settings/groupVerify/VerifyTextInput/index.js b/src/core/widgets/settings/groupVerify/VerifyTextInput/index.js index 085f95b551b7fa9df5b763ad28f79739bcc88854..d3ebfc098f36dbc02d7967e5acf8f764330628c2 100644 --- a/src/core/widgets/settings/groupVerify/VerifyTextInput/index.js +++ b/src/core/widgets/settings/groupVerify/VerifyTextInput/index.js @@ -9,7 +9,7 @@ const options = [ message: '閭鏍¢獙鏈€氳繃' }, { - name: 'email', + name: 'identity', label: '韬唤璇佸彿(identity)', value: '(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)', message: '鎵嬫満鍙锋牎楠屾湭閫氳繃' diff --git a/src/core/widgets/text/Coding/index.js b/src/core/widgets/text/Coding/index.js index d958fafc9daa4dc1ae3884f394c91d09c4c20a71..4daa55b7eb8381429ed43e054a1d290399fa89ba 100644 --- a/src/core/widgets/text/Coding/index.js +++ b/src/core/widgets/text/Coding/index.js @@ -39,7 +39,6 @@ const Coding = (props) => { // } // let code = toUtf8(tableNameParent) // let codeValue = `${prefixion ? `${prefixion}-` : ''}${date ? `${date}-` : date}${code}` - // console.log('value', value, code) // onChange(codeValue) // }, [prefixion, codingType]) diff --git a/src/core/widgets/text/RichText/index.js b/src/core/widgets/text/RichText/index.js index 2511328da25f361590c59da98ca8b0830bd02c7f..ed90d50a7a3ab56e68a7baf7a000f9e2fc6b5d16 100644 --- a/src/core/widgets/text/RichText/index.js +++ b/src/core/widgets/text/RichText/index.js @@ -70,12 +70,10 @@ const RichText = forwardRef(({ schema, onChange, value }, ref) => { MENU_CONF: { uploadImage: { customInsert(res, inserFn) { - console.log('res', res) const formData = new FormData(); formData.append('file', file); }, // onBeforeUpload: (e) => { - // console.log(e) // const file = e?.clipboardData?.items[0]?.getAsFile() || null; // if (!file) return; // const formData = new FormData(); diff --git a/src/core/widgets/text/TextInput/index.js b/src/core/widgets/text/TextInput/index.js index 5be66481affe3cc1b97d4aababca1cd548d82f59..2e2902c820920c2474bed4ae3346c6d68cbcc090 100644 --- a/src/core/widgets/text/TextInput/index.js +++ b/src/core/widgets/text/TextInput/index.js @@ -27,7 +27,7 @@ const TextInput = (props) => { const { getPrefixCls } = useContext(ConfigProvider.ConfigContext) const prefixCls = getPrefixCls('pandaXform') const { value, onChange, schema, addons } = props - const { title, disabled, placeholder, presetValue, addonBefore, addonAfter, maxLength, rules, uniqueVerify, tableName, fieldName } = schema + const { title, disabled, placeholder, presetValue, addonBefore, addonAfter, maxLength, rules, uniqueVerify, tableName, fieldName, isStoreID } = schema const handleChange = (e) => { if (addons) { @@ -35,14 +35,34 @@ const TextInput = (props) => { } } + const valueShow = useMemo(() => { + if (isStoreID) { + if (presetValue === '銆愭湰浜哄鍚嶃€�') { + return userInfo.fullName + } + if (presetValue === '銆愭湰浜洪儴闂ㄣ€�') { + return userInfo.depart.name + } + } + return value + }, [presetValue, value, isStoreID]) + useEffect(() => { let paths = ['銆愭湰浜哄鍚嶃€�', '銆愭湰浜洪儴闂ㄣ€�'] let value = presetValue if (paths.includes(value)) { if (value === '銆愭湰浜哄鍚嶃€�') { - value = userInfo.fullName + if (isStoreID) { + value = userInfo.OID + '' + } else { + value = userInfo.fullName + } } else if (value === '銆愭湰浜洪儴闂ㄣ€�') { - value = userInfo.depart.name + if (isStoreID) { + value = userInfo.depart.OID + '' + } else { + value = userInfo.depart.name + } } } if (addons) { @@ -78,7 +98,7 @@ const TextInput = (props) => { <div className={`${prefixCls}-input`} isdisabled={JSON.stringify(disabled)}> <Input disabled={disabled} - value={value} + value={valueShow} maxLength={maxLength} placeholder={disabled ? null : placeholder} onChange={handleChange}