add changeStatus service
This commit is contained in:
@@ -20,6 +20,7 @@ import wechatUser from '@/wechat';
|
||||
import { addToOreo } from '@/service/addToOreo';
|
||||
import { pickTicket } from '@/service/pickTicket';
|
||||
import { retrieve } from '@/service/retrieve';
|
||||
import { changeStatus } from '@/service/changeStatus';
|
||||
|
||||
const submitInterval = 5000;
|
||||
|
||||
@@ -40,6 +41,8 @@ interface TicketDetailState {
|
||||
isPickDisable: boolean;
|
||||
isRetrieveLoading: boolean;
|
||||
isRetrieveDisable: boolean;
|
||||
isStatusLoading: boolean;
|
||||
isStatusDisable: boolean;
|
||||
}
|
||||
|
||||
export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||
@@ -60,6 +63,8 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||
isPickDisable: false,
|
||||
isRetrieveLoading: false,
|
||||
isRetrieveDisable: false,
|
||||
isStatusLoading: false,
|
||||
isStatusDisable: false,
|
||||
};
|
||||
|
||||
componentDidMount(): void {
|
||||
@@ -176,7 +181,15 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||
handleStatusChange(status: number): void {
|
||||
this.setState({
|
||||
showStatusSheet: false,
|
||||
isStatusDisable: true,
|
||||
});
|
||||
changeStatus(this, status);
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
isStatusDisable: false,
|
||||
});
|
||||
}, submitInterval);
|
||||
return;
|
||||
}
|
||||
|
||||
handleCommentChange(comment: string) {
|
||||
@@ -252,8 +265,13 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||
className='at-col'
|
||||
style={{ marginLeft: 10, paddingRight: 5, width: '50%' }}
|
||||
>
|
||||
<AtButton type='primary' onClick={this.onChangeStatus.bind(this)}>
|
||||
{pt.get().ticketDetail.status.button}
|
||||
<AtButton
|
||||
loading={this.state.isStatusLoading}
|
||||
disabled={this.state.isStatusDisable}
|
||||
type='secondary'
|
||||
onClick={this.onChangeStatus.bind(this)}
|
||||
>
|
||||
{pt.get().ticketDetail.addNote}
|
||||
</AtButton>
|
||||
</View>
|
||||
<View
|
||||
@@ -288,7 +306,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||
className='at-col'
|
||||
style={{ marginRight: 10, paddingLeft: 5, width: '50%' }}
|
||||
>
|
||||
<AtButton type='secondary' onClick={this.onChangeStatus.bind(this)}>
|
||||
<AtButton type='secondary' onClick={this.onAddComment.bind(this)}>
|
||||
{pt.get().ticketDetail.addNote}
|
||||
</AtButton>
|
||||
</View>
|
||||
@@ -384,6 +402,12 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 5)}>
|
||||
{pt.get().ticketDetail.status.status5}
|
||||
</AtActionSheetItem>
|
||||
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 6)}>
|
||||
{pt.get().ticketDetail.status.status6}
|
||||
</AtActionSheetItem>
|
||||
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 7)}>
|
||||
{pt.get().ticketDetail.status.status7}
|
||||
</AtActionSheetItem>
|
||||
</AtActionSheet>
|
||||
<DetailFramework
|
||||
middleButton={middleButton}
|
||||
|
||||
Reference in New Issue
Block a user