fixed the bug

pull/141/head
hyh123a 2022-04-21 14:36:15 +08:00
parent 2c8c3ac0e1
commit 715503e69e
2 changed files with 8 additions and 4 deletions

View File

@ -373,8 +373,8 @@ const TicketAggent = ({ setRedirect, setRedirectUrl, t }) => {
console.log(key); console.log(key);
}; };
let submitApplication = target => { let submitApplication = ({target}) => {
console.log('submitApplication', target); console.log('submitApplication', target.value);
hiddenModal(); hiddenModal();
// Patch the agent ticket // Patch the agent ticket
ticketFields.value.field_list.map(item => { ticketFields.value.field_list.map(item => {
@ -384,7 +384,7 @@ const TicketAggent = ({ setRedirect, setRedirectUrl, t }) => {
temp[item_key] = value; temp[item_key] = value;
setTicketBody({ ...ticketBody, ...temp }); setTicketBody({ ...ticketBody, ...temp });
}); });
console.log("firssubmitApplication ticketBody", ticketBody)
let isResponseOK = false; let isResponseOK = false;
fetch(APIBaseURL + '/ticket/agent/' + ticketId + '?username=admin', { fetch(APIBaseURL + '/ticket/agent/' + ticketId + '?username=admin', {
method: 'PATCH', method: 'PATCH',
@ -425,7 +425,9 @@ Hello world
let onFieldChange = (index, { target }) => { let onFieldChange = (index, { target }) => {
console.log('fieldChange', target.value); console.log('fieldChange', target.value);
setTicketBody({ ...ticketBody, index: target.value }); let temp={};
temp[index] = target.value;
setTicketBody({ ...ticketBody, ...temp });
}; };
useEffect(() => { useEffect(() => {
@ -568,6 +570,7 @@ Hello world
<Form.Item key={index} label={item.field_name} name={item.field_name}> <Form.Item key={index} label={item.field_name} name={item.field_name}>
<TextArea <TextArea
defaultValue={item.field_value} defaultValue={item.field_value}
onChange={onFieldChange.bind(this, item.field_key)}
disabled={item.field_attribute == 1 ? true : false} disabled={item.field_attribute == 1 ? true : false}
/> />
</Form.Item> </Form.Item>

View File

@ -41,6 +41,7 @@ import { Steps, Timeline, Collapse, message } from 'antd';
const { Step } = Steps; const { Step } = Steps;
const { Panel } = Collapse; const { Panel } = Collapse;
const TicketApplication = ({ setRedirect, setRedirectUrl, t }) => { const TicketApplication = ({ setRedirect, setRedirectUrl, t }) => {
useEffect(() => { useEffect(() => {
let is_logged_in = getCookieValue('is_logged_in'); let is_logged_in = getCookieValue('is_logged_in');