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"; ...@@ -33,3 +33,35 @@ export const ADD_PRODUCT = "ADD_PRODUCT";
export const REMOVE_PRODUCT = "REMOVE_PRODUCT"; export const REMOVE_PRODUCT = "REMOVE_PRODUCT";
export const CLEAR_CART = "CLEAR_CART"; 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 { ...@@ -3,10 +3,8 @@ import {
Modal, Modal,
View, View,
Text, Text,
TextInput,
TouchableOpacity, TouchableOpacity,
ScrollView, ScrollView,
StyleSheet,
Image, Image,
FlatList, FlatList,
} from 'react-native'; } from 'react-native';
......
...@@ -37,6 +37,26 @@ const styles = StyleSheet.create({ ...@@ -37,6 +37,26 @@ const styles = StyleSheet.create({
justifyContent: 'center', justifyContent: 'center',
borderColor: R.colors.grayBorderInputTextHeader, 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: { text: {
fontSize: R.sizes.sm, fontSize: R.sizes.sm,
color: R.colors.black, color: R.colors.black,
......
...@@ -23,6 +23,7 @@ const ListWorkView = props => { ...@@ -23,6 +23,7 @@ const ListWorkView = props => {
setSearchQuery, setSearchQuery,
dataList, dataList,
modalVisible, modalVisible,
tabView,
onFilterChange, onFilterChange,
onAddWork, onAddWork,
onSaveWork, onSaveWork,
...@@ -31,37 +32,20 @@ const ListWorkView = props => { ...@@ -31,37 +32,20 @@ const ListWorkView = props => {
onReportAction, onReportAction,
onApprovalAction, onApprovalAction,
getStatusColor, getStatusColor,
getButtonsForStatus, getButtonsForStatus
tabView,
} = props; } = props;
const renderTabView = () => { const renderTabView = () => {
return ( return (
<TabViewComponent <TabViewComponent
data={tabView} data={tabView}
tabStyle={{ tabStyle={styles.item_tab_view}
backgroundColor: R.colors.gray, style={styles.container_tab_view}
marginHorizontal: 5,
borderRadius: 10,
width: 107,
justifyContent: 'center',
alignItems: 'center',
}}
style={{
marginVertical: 5,
}}
mode="filter" mode="filter"
defaultActiveKey="all" defaultActiveKey="all"
scrollable={true} scrollable={true}
activeTabStyle={{ activeTabStyle={styles.active_tab_view}
backgroundColor: R.colors.blue, textStyle={styles.text_tab_view}
}}
textStyle={{
color: R.colors.white,
fontWeight: '400',
fontFamily: R.fonts.fontRegular,
fontSize: R.fontsize.fontSizeContent,
}}
showActiveIndicator={false} showActiveIndicator={false}
onFilterChange={onFilterChange} onFilterChange={onFilterChange}
/> />
...@@ -69,6 +53,7 @@ const ListWorkView = props => { ...@@ -69,6 +53,7 @@ const ListWorkView = props => {
}; };
const renderActionButtons = item => { const renderActionButtons = item => {
const buttons = getButtonsForStatus(item.status); const buttons = getButtonsForStatus(item.status);
return buttons.map((button, index) => ( 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