add entry for conclusion page
parent
0351819fa2
commit
be687d0372
|
|
@ -11,6 +11,7 @@ export default defineAppConfig({
|
||||||
'pages/TicketDetail/TicketDetail',
|
'pages/TicketDetail/TicketDetail',
|
||||||
'pages/TicketList/TicketList',
|
'pages/TicketList/TicketList',
|
||||||
'pages/AskLeave/AskLeave',
|
'pages/AskLeave/AskLeave',
|
||||||
|
'pages/Conclusion/Conclusion',
|
||||||
'pages/404/404',
|
'pages/404/404',
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default definePageConfig({
|
||||||
|
usingComponents: {},
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,190 @@
|
||||||
|
import {
|
||||||
|
AtTextarea,
|
||||||
|
AtButton,
|
||||||
|
AtForm,
|
||||||
|
AtMessage,
|
||||||
|
AtInput,
|
||||||
|
AtList,
|
||||||
|
AtListItem,
|
||||||
|
AtModal,
|
||||||
|
} from 'taro-ui';
|
||||||
|
import { Component, ReactNode } from 'react';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
import pt from '@/plain-text';
|
||||||
|
import { Picker, View } from '@tarojs/components';
|
||||||
|
import { askLeave } from '@/service/askleave';
|
||||||
|
import './Conclusion.scss';
|
||||||
|
|
||||||
|
const submitInterval = 5000;
|
||||||
|
|
||||||
|
export default class ConclusionPage extends Component {
|
||||||
|
state = {
|
||||||
|
isLoading: false,
|
||||||
|
isDisable: false,
|
||||||
|
showModal: false,
|
||||||
|
range: [
|
||||||
|
['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
||||||
|
['第一班', '第二班', '第三班'],
|
||||||
|
],
|
||||||
|
shift: [0, 0],
|
||||||
|
reason: '',
|
||||||
|
substitute: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
componentDidMount(): void {
|
||||||
|
Taro.setNavigationBarTitle({
|
||||||
|
title: pt.get().navBar.askLeave,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onShiftSelect(event) {
|
||||||
|
this.setState({
|
||||||
|
shift: event.detail.value,
|
||||||
|
});
|
||||||
|
console.log(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
onModalClose() {
|
||||||
|
this.setState({
|
||||||
|
showModal: false,
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
this.setState({
|
||||||
|
isDisable: false,
|
||||||
|
});
|
||||||
|
}, submitInterval);
|
||||||
|
}
|
||||||
|
|
||||||
|
onModalCancel() {
|
||||||
|
this.setState({
|
||||||
|
showModal: false,
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
this.setState({
|
||||||
|
isDisable: false,
|
||||||
|
});
|
||||||
|
}, submitInterval);
|
||||||
|
}
|
||||||
|
|
||||||
|
onModalConfirm() {
|
||||||
|
this.setState({
|
||||||
|
showModal: false,
|
||||||
|
});
|
||||||
|
askLeave(this);
|
||||||
|
setTimeout(() => {
|
||||||
|
this.setState({
|
||||||
|
isDisable: false,
|
||||||
|
});
|
||||||
|
}, submitInterval);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleReasonChange(reason: string) {
|
||||||
|
this.setState({
|
||||||
|
reason,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
handleSubstituteChange(substitute: string) {
|
||||||
|
this.setState({
|
||||||
|
substitute,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmit() {
|
||||||
|
this.setState({
|
||||||
|
isDisable: true,
|
||||||
|
});
|
||||||
|
if (this.state.reason == '') {
|
||||||
|
Taro.atMessage({
|
||||||
|
message: pt.get().button.submitText.blank,
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
this.setState({
|
||||||
|
isDisable: false,
|
||||||
|
});
|
||||||
|
}, submitInterval);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.state.substitute == '') {
|
||||||
|
this.setState({
|
||||||
|
showModal: true,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
askLeave(this);
|
||||||
|
setTimeout(() => {
|
||||||
|
this.setState({
|
||||||
|
isDisable: false,
|
||||||
|
});
|
||||||
|
}, submitInterval);
|
||||||
|
}
|
||||||
|
render(): ReactNode {
|
||||||
|
return (
|
||||||
|
<View style={{ marginTop: '30rpx', width: '94%', marginLeft: '3%' }}>
|
||||||
|
<AtMessage />
|
||||||
|
<AtModal
|
||||||
|
isOpened={this.state.showModal}
|
||||||
|
title={pt.get().askLeave.modal.title}
|
||||||
|
cancelText={pt.get().modal.cancel}
|
||||||
|
confirmText={pt.get().modal.confirm}
|
||||||
|
onClose={this.onModalClose.bind(this)}
|
||||||
|
onCancel={this.onModalCancel.bind(this)}
|
||||||
|
onConfirm={this.onModalConfirm.bind(this)}
|
||||||
|
content={pt.get().askLeave.modal.content}
|
||||||
|
/>
|
||||||
|
<AtForm onSubmit={this.onSubmit.bind(this)}>
|
||||||
|
<View style={{ width: '98%', marginLeft: '1%' }}>
|
||||||
|
<Picker
|
||||||
|
mode='multiSelector'
|
||||||
|
range={this.state.range}
|
||||||
|
onChange={this.onShiftSelect.bind(this)}
|
||||||
|
value={this.state.shift}
|
||||||
|
>
|
||||||
|
<AtList>
|
||||||
|
<AtListItem
|
||||||
|
title={pt.get().askLeave.shift.title}
|
||||||
|
extraText={
|
||||||
|
pt.get().askLeave.shift.week[this.state.shift[0]] +
|
||||||
|
pt.get().askLeave.shift.shift[this.state.shift[1]]
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</AtList>
|
||||||
|
</Picker>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
className='at-article__h3'
|
||||||
|
style={{ marginTop: '20rpx', marginBottom: '20rpx' }}
|
||||||
|
>
|
||||||
|
{pt.get().askLeave.reason.title}
|
||||||
|
</View>
|
||||||
|
<AtTextarea
|
||||||
|
value={this.state.reason}
|
||||||
|
onChange={this.handleReasonChange.bind(this)}
|
||||||
|
maxLength={200}
|
||||||
|
placeholder={pt.get().askLeave.reason.placeHolder}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<AtInput
|
||||||
|
name='substitute'
|
||||||
|
title={pt.get().askLeave.substitute.title}
|
||||||
|
type='text'
|
||||||
|
placeholder={pt.get().askLeave.substitute.placeHolder}
|
||||||
|
value={this.state.substitute}
|
||||||
|
onChange={this.handleSubstituteChange.bind(this)}
|
||||||
|
/>
|
||||||
|
<View>
|
||||||
|
<AtButton
|
||||||
|
loading={this.state.isLoading}
|
||||||
|
formType='submit'
|
||||||
|
type='primary'
|
||||||
|
disabled={this.state.isDisable}
|
||||||
|
>
|
||||||
|
{pt.get().button.buttonText.submit}
|
||||||
|
</AtButton>
|
||||||
|
</View>
|
||||||
|
</AtForm>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -153,6 +153,12 @@ export default class MainPage extends Component<{}, MainPageState> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
conclusionPage() {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: '/pages/Conclusion/Conclusion',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
const mainPage = pt.get().mainPage;
|
const mainPage = pt.get().mainPage;
|
||||||
const memberPage = pt.get().memberPage;
|
const memberPage = pt.get().memberPage;
|
||||||
|
|
@ -185,6 +191,7 @@ export default class MainPage extends Component<{}, MainPageState> {
|
||||||
<ExpandItem
|
<ExpandItem
|
||||||
title={memberPage.expandTitle.admin}
|
title={memberPage.expandTitle.admin}
|
||||||
content={
|
content={
|
||||||
|
<View style={{ marginBottom: '40rpx' }}>
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -226,6 +233,12 @@ export default class MainPage extends Component<{}, MainPageState> {
|
||||||
</AtButton>
|
</AtButton>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
<View>
|
||||||
|
<AtButton type='primary' onClick={this.conclusionPage}>
|
||||||
|
{pt.get().button.indexText.conclusion}
|
||||||
|
</AtButton>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@ export interface ButtonText {
|
||||||
memberText: {
|
memberText: {
|
||||||
auth: string;
|
auth: string;
|
||||||
};
|
};
|
||||||
|
indexText: {
|
||||||
|
conclusion: string;
|
||||||
|
askLeave: string;
|
||||||
|
};
|
||||||
loginText: {
|
loginText: {
|
||||||
success: string;
|
success: string;
|
||||||
error: string;
|
error: string;
|
||||||
|
|
@ -39,6 +43,10 @@ export const buttonZhCn: ButtonText = {
|
||||||
memberText: {
|
memberText: {
|
||||||
auth: '协会统一身份认证登录',
|
auth: '协会统一身份认证登录',
|
||||||
},
|
},
|
||||||
|
indexText: {
|
||||||
|
conclusion: '提交值班总结',
|
||||||
|
askLeave: '我要请假',
|
||||||
|
},
|
||||||
loginText: {
|
loginText: {
|
||||||
success: '登录成功',
|
success: '登录成功',
|
||||||
error: '登录失败',
|
error: '登录失败',
|
||||||
|
|
@ -65,6 +73,10 @@ export const buttonEnUs: ButtonText = {
|
||||||
memberText: {
|
memberText: {
|
||||||
auth: 'EVA Auth Login Entry',
|
auth: 'EVA Auth Login Entry',
|
||||||
},
|
},
|
||||||
|
indexText: {
|
||||||
|
conclusion: 'Submit Duty Conclusion',
|
||||||
|
askLeave: 'Ask for Leave',
|
||||||
|
},
|
||||||
loginText: {
|
loginText: {
|
||||||
success: 'Login Success',
|
success: 'Login Success',
|
||||||
error: 'Login Failed',
|
error: 'Login Failed',
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ export interface MainPageText {
|
||||||
reason: string;
|
reason: string;
|
||||||
};
|
};
|
||||||
askLeave: string;
|
askLeave: string;
|
||||||
|
conclusion: string;
|
||||||
titleLine: {
|
titleLine: {
|
||||||
main: string;
|
main: string;
|
||||||
sub: string;
|
sub: string;
|
||||||
|
|
@ -50,6 +51,7 @@ export const mainPageZhCn: MainPageText = {
|
||||||
reason: '正常下班',
|
reason: '正常下班',
|
||||||
},
|
},
|
||||||
askLeave: '我要请假',
|
askLeave: '我要请假',
|
||||||
|
conclusion: '提交值班总结',
|
||||||
titleLine: {
|
titleLine: {
|
||||||
main: '您好,这里是E志者协会',
|
main: '您好,这里是E志者协会',
|
||||||
sub: '维修请至【东三-204】实验室',
|
sub: '维修请至【东三-204】实验室',
|
||||||
|
|
@ -120,6 +122,7 @@ export const mainPageEnUs: MainPageText = {
|
||||||
reason: 'Normal shift',
|
reason: 'Normal shift',
|
||||||
},
|
},
|
||||||
askLeave: 'Ask for leave',
|
askLeave: 'Ask for leave',
|
||||||
|
conclusion: 'Submit Duty Conclusion',
|
||||||
titleLine: {
|
titleLine: {
|
||||||
main: 'Hi! This is EVA.',
|
main: 'Hi! This is EVA.',
|
||||||
sub: 'For maintenance, please go to [204 Lab, E3 building]',
|
sub: 'For maintenance, please go to [204 Lab, E3 building]',
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ export interface NavBarTitle {
|
||||||
ticketDetail: string;
|
ticketDetail: string;
|
||||||
ticketList: string;
|
ticketList: string;
|
||||||
askLeave: string;
|
askLeave: string;
|
||||||
|
conclusion: string;
|
||||||
user: {
|
user: {
|
||||||
myTicket: string;
|
myTicket: string;
|
||||||
report: string;
|
report: string;
|
||||||
|
|
@ -18,6 +19,7 @@ export const navBarTitleZhCn: NavBarTitle = {
|
||||||
ticketDetail: '工单详情',
|
ticketDetail: '工单详情',
|
||||||
ticketList: '所有工单',
|
ticketList: '所有工单',
|
||||||
askLeave: '请假单填写',
|
askLeave: '请假单填写',
|
||||||
|
conclusion: '值班总结',
|
||||||
user: {
|
user: {
|
||||||
myTicket: '我的工单',
|
myTicket: '我的工单',
|
||||||
report: '意见反馈',
|
report: '意见反馈',
|
||||||
|
|
@ -33,6 +35,7 @@ export const navBarTitleEnUs: NavBarTitle = {
|
||||||
ticketDetail: 'Ticket Detail',
|
ticketDetail: 'Ticket Detail',
|
||||||
ticketList: 'All Tickets',
|
ticketList: 'All Tickets',
|
||||||
askLeave: 'Ask for leave',
|
askLeave: 'Ask for leave',
|
||||||
|
conclusion: 'Duty Conclusion',
|
||||||
user: {
|
user: {
|
||||||
myTicket: 'My Tickets',
|
myTicket: 'My Tickets',
|
||||||
report: 'Report',
|
report: 'Report',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue