Commit 7e86fce8 authored by TZW's avatar TZW

1111

parent 0cbd87a7
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-29 14:03:07
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-16 11:38:33
* @Last Modified time: 2022-12-16 16:42:47
*/
import { doFetch } from '@/utils/doFetch';
......@@ -14,11 +14,12 @@ const App = ({
setDrawer,
onFinish,
drawer,
actionRef,
formRef,
columns,
urlParams,
formId,
defaultFormValue,
onValuesChange,
}) => {
const [value, setValue] = useState('');
const [fieldscolumns, setfieldscolumns] = useState(columns);
......@@ -96,12 +97,14 @@ const App = ({
return (
<>
<InitForm
formRef={formRef}
defaultFormValue={defaultFormValue}
extendField={selectextendField(formId)}
detailpath={urlParams?.detail || null}
params={{ id: drawer?.item?.id || null }}
fields={fieldscolumns}
onFinish={onFinish}
onValuesChange={onValuesChange}
/>
</>
);
......
......@@ -17,24 +17,6 @@ function getcolumns(setDrawer, usermsg) {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select',
options,
fieldProps: {
onChange: (e) => {
let item = usermsg?.filter((it) => {
return it?.id == e;
});
console.log(item);
setDrawer((s) => ({
...s,
item: {
mailNo: item?.mailbox,
telephone: item?.phone,
status: item?.enabled,
fullName: item?.fullName,
username: item?.username,
},
}));
},
},
},
{
title: '姓名',
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-16 14:09:32
* @Last Modified time: 2022-12-16 16:57:18
*/
import * as React from 'react';
......@@ -156,7 +156,7 @@ function User(props) {
width: 150,
render: (text, row, _, action) => [edit(text, row, _, action), remove(text, row, _, action)],
});
}, [data, drawer?.item]);
}, [data]);
function selectType(type) {
switch (type) {
......@@ -165,7 +165,7 @@ function User(props) {
<ExtendField
setDrawer={setDrawer}
drawer={drawer}
actionRef={actionRef}
formRef={formRef}
columns={columns}
formId={'1'}
// urlParams={urlParams}
......@@ -205,6 +205,16 @@ function User(props) {
}
}}
defaultFormValue={drawer.item}
onValuesChange={(changedValues, allValues) => {
if (changedValues['username']) {
let item = data?.filter((it) => {
return it?.id == ;
});
console.log(item);
console.log(changedValues, allValues);
formRef.current.setFieldValue('telephone', '123123');
}
}}
/>
);
......
......@@ -19,6 +19,7 @@ function getcolumns(setdrawer) {
title: '预览',
dataIndex: 'ruleNames',
key: 'ruleNames',
search: false,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
hideInForm: true,
},
......
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