Commit 9ce41d07 by tungnq

TODO: Đã bổ sung thêm logic để lọc công việc theo role và status

parent fb8e80c7
......@@ -33,3 +33,35 @@ export const ADD_PRODUCT = "ADD_PRODUCT";
export const REMOVE_PRODUCT = "REMOVE_PRODUCT";
export const CLEAR_CART = "CLEAR_CART";
//ACTION CÔNG VIỆC VAI TRÒ
export const ROLE = {
ALL : 'ALL',
ASSIGNEE : 'ASSIGNEE', //Giao cho tôi (Giảng viên nhận công việc)
SUPERVISOR : 'SUPERVISOR' //Đang giám sát (Giảng viên giám sát)
}
//ACTION TRẠNG THÁI THEO VAI TRÒ
export const STATUS_BY_ROLE ={
[ROLE.ASSIGNEE]: [
'Đang thực hiện',
'Cần chỉnh sửa',
'Chờ duyệt',
'Đợi báo cáo',
'Đã hoàn thành'
],
[ROLE.SUPERVISOR]:[
'Đang thực hiện',
'Đợi chỉnh sửa',
'Chờ duyệt',
'Đợi báo cáo',
'Đã hoàn thành'
]
}
//ACTION TIẾN ĐỘ CÔNG VIỆC
export const WORK_PROGRESS = {
ALL_WORK_PROGRESS: 'ALL_WORK_PROGRESS',
SUCCESS_WORK_PROGRESS: 'SUCCESS_WORK_PROGRESS',
CONTINUE_WORK_PROGRESS: 'CONTINUE_WORK_PROGRESS',
}
\ No newline at end of file
......@@ -3,10 +3,8 @@ import {
Modal,
View,
Text,
TextInput,
TouchableOpacity,
ScrollView,
StyleSheet,
Image,
FlatList,
} from 'react-native';
......
......@@ -37,6 +37,26 @@ const styles = StyleSheet.create({
justifyContent: 'center',
borderColor: R.colors.grayBorderInputTextHeader,
},
container_tab_view:{
marginVertical:5
},
item_tab_view:{
backgroundColor: R.colors.gray,
marginHorizontal: 5,
borderRadius: 10,
width: 107,
justifyContent: 'center',
alignItems: 'center',
},
active_tab_view:{
backgroundColor: R.colors.blue,
},
text_tab_view:{
color: R.colors.white,
fontWeight: '400',
fontFamily: R.fonts.fontRegular,
fontSize: R.fontsize.fontSizeContent,
},
text: {
fontSize: R.sizes.sm,
color: R.colors.black,
......
......@@ -23,6 +23,7 @@ const ListWorkView = props => {
setSearchQuery,
dataList,
modalVisible,
tabView,
onFilterChange,
onAddWork,
onSaveWork,
......@@ -31,37 +32,20 @@ const ListWorkView = props => {
onReportAction,
onApprovalAction,
getStatusColor,
getButtonsForStatus,
tabView,
getButtonsForStatus
} = props;
const renderTabView = () => {
return (
<TabViewComponent
data={tabView}
tabStyle={{
backgroundColor: R.colors.gray,
marginHorizontal: 5,
borderRadius: 10,
width: 107,
justifyContent: 'center',
alignItems: 'center',
}}
style={{
marginVertical: 5,
}}
tabStyle={styles.item_tab_view}
style={styles.container_tab_view}
mode="filter"
defaultActiveKey="all"
scrollable={true}
activeTabStyle={{
backgroundColor: R.colors.blue,
}}
textStyle={{
color: R.colors.white,
fontWeight: '400',
fontFamily: R.fonts.fontRegular,
fontSize: R.fontsize.fontSizeContent,
}}
activeTabStyle={styles.active_tab_view}
textStyle={styles.text_tab_view}
showActiveIndicator={false}
onFilterChange={onFilterChange}
/>
......@@ -69,6 +53,7 @@ const ListWorkView = props => {
};
const renderActionButtons = item => {
const buttons = getButtonsForStatus(item.status);
return buttons.map((button, index) => (
......
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