moonyeju
2023-10-04
[add]
@24affc1adcc05b2e92dc9c2922b9a0a819bba8aa
--- kogas_app/package-lock.json
+++ kogas_app/package-lock.json
... | ... | @@ -21,6 +21,8 @@ |
21 | 21 |
"react-native-reanimated": "^3.5.4", |
22 | 22 |
"react-native-safe-area-context": "^4.7.2", |
23 | 23 |
"react-native-screens": "^3.25.0", |
24 |
+ "react-native-sensitive-info": "^5.5.8", |
|
25 |
+ "react-native-svg": "^13.14.0", |
|
24 | 26 |
"react-native-vector-icons": "^10.0.0", |
25 | 27 |
"react-native-webview": "^13.6.0" |
26 | 28 |
}, |
... | ... | @@ -5264,6 +5266,11 @@ |
5264 | 5266 |
"safe-buffer": "~5.2.0" |
5265 | 5267 |
} |
5266 | 5268 |
}, |
5269 |
+ "node_modules/boolbase": { |
|
5270 |
+ "version": "1.0.0", |
|
5271 |
+ "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", |
|
5272 |
+ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" |
|
5273 |
+ }, |
|
5267 | 5274 |
"node_modules/brace-expansion": { |
5268 | 5275 |
"version": "1.1.11", |
5269 | 5276 |
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", |
... | ... | @@ -5818,6 +5825,52 @@ |
5818 | 5825 |
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", |
5819 | 5826 |
"integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==" |
5820 | 5827 |
}, |
5828 |
+ "node_modules/css-select": { |
|
5829 |
+ "version": "5.1.0", |
|
5830 |
+ "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", |
|
5831 |
+ "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", |
|
5832 |
+ "dependencies": { |
|
5833 |
+ "boolbase": "^1.0.0", |
|
5834 |
+ "css-what": "^6.1.0", |
|
5835 |
+ "domhandler": "^5.0.2", |
|
5836 |
+ "domutils": "^3.0.1", |
|
5837 |
+ "nth-check": "^2.0.1" |
|
5838 |
+ }, |
|
5839 |
+ "funding": { |
|
5840 |
+ "url": "https://github.com/sponsors/fb55" |
|
5841 |
+ } |
|
5842 |
+ }, |
|
5843 |
+ "node_modules/css-tree": { |
|
5844 |
+ "version": "1.1.3", |
|
5845 |
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", |
|
5846 |
+ "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", |
|
5847 |
+ "dependencies": { |
|
5848 |
+ "mdn-data": "2.0.14", |
|
5849 |
+ "source-map": "^0.6.1" |
|
5850 |
+ }, |
|
5851 |
+ "engines": { |
|
5852 |
+ "node": ">=8.0.0" |
|
5853 |
+ } |
|
5854 |
+ }, |
|
5855 |
+ "node_modules/css-tree/node_modules/source-map": { |
|
5856 |
+ "version": "0.6.1", |
|
5857 |
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", |
|
5858 |
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", |
|
5859 |
+ "engines": { |
|
5860 |
+ "node": ">=0.10.0" |
|
5861 |
+ } |
|
5862 |
+ }, |
|
5863 |
+ "node_modules/css-what": { |
|
5864 |
+ "version": "6.1.0", |
|
5865 |
+ "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", |
|
5866 |
+ "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", |
|
5867 |
+ "engines": { |
|
5868 |
+ "node": ">= 6" |
|
5869 |
+ }, |
|
5870 |
+ "funding": { |
|
5871 |
+ "url": "https://github.com/sponsors/fb55" |
|
5872 |
+ } |
|
5873 |
+ }, |
|
5821 | 5874 |
"node_modules/csstype": { |
5822 | 5875 |
"version": "3.1.2", |
5823 | 5876 |
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", |
... | ... | @@ -6037,6 +6090,57 @@ |
6037 | 6090 |
"node": ">=6.0.0" |
6038 | 6091 |
} |
6039 | 6092 |
}, |
6093 |
+ "node_modules/dom-serializer": { |
|
6094 |
+ "version": "2.0.0", |
|
6095 |
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", |
|
6096 |
+ "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", |
|
6097 |
+ "dependencies": { |
|
6098 |
+ "domelementtype": "^2.3.0", |
|
6099 |
+ "domhandler": "^5.0.2", |
|
6100 |
+ "entities": "^4.2.0" |
|
6101 |
+ }, |
|
6102 |
+ "funding": { |
|
6103 |
+ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" |
|
6104 |
+ } |
|
6105 |
+ }, |
|
6106 |
+ "node_modules/domelementtype": { |
|
6107 |
+ "version": "2.3.0", |
|
6108 |
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", |
|
6109 |
+ "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", |
|
6110 |
+ "funding": [ |
|
6111 |
+ { |
|
6112 |
+ "type": "github", |
|
6113 |
+ "url": "https://github.com/sponsors/fb55" |
|
6114 |
+ } |
|
6115 |
+ ] |
|
6116 |
+ }, |
|
6117 |
+ "node_modules/domhandler": { |
|
6118 |
+ "version": "5.0.3", |
|
6119 |
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", |
|
6120 |
+ "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", |
|
6121 |
+ "dependencies": { |
|
6122 |
+ "domelementtype": "^2.3.0" |
|
6123 |
+ }, |
|
6124 |
+ "engines": { |
|
6125 |
+ "node": ">= 4" |
|
6126 |
+ }, |
|
6127 |
+ "funding": { |
|
6128 |
+ "url": "https://github.com/fb55/domhandler?sponsor=1" |
|
6129 |
+ } |
|
6130 |
+ }, |
|
6131 |
+ "node_modules/domutils": { |
|
6132 |
+ "version": "3.1.0", |
|
6133 |
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", |
|
6134 |
+ "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", |
|
6135 |
+ "dependencies": { |
|
6136 |
+ "dom-serializer": "^2.0.0", |
|
6137 |
+ "domelementtype": "^2.3.0", |
|
6138 |
+ "domhandler": "^5.0.3" |
|
6139 |
+ }, |
|
6140 |
+ "funding": { |
|
6141 |
+ "url": "https://github.com/fb55/domutils?sponsor=1" |
|
6142 |
+ } |
|
6143 |
+ }, |
|
6040 | 6144 |
"node_modules/ee-first": { |
6041 | 6145 |
"version": "1.1.1", |
6042 | 6146 |
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", |
... | ... | @@ -6075,6 +6179,17 @@ |
6075 | 6179 |
"license": "MIT", |
6076 | 6180 |
"engines": { |
6077 | 6181 |
"node": ">= 0.8" |
6182 |
+ } |
|
6183 |
+ }, |
|
6184 |
+ "node_modules/entities": { |
|
6185 |
+ "version": "4.5.0", |
|
6186 |
+ "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", |
|
6187 |
+ "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", |
|
6188 |
+ "engines": { |
|
6189 |
+ "node": ">=0.12" |
|
6190 |
+ }, |
|
6191 |
+ "funding": { |
|
6192 |
+ "url": "https://github.com/fb55/entities?sponsor=1" |
|
6078 | 6193 |
} |
6079 | 6194 |
}, |
6080 | 6195 |
"node_modules/envinfo": { |
... | ... | @@ -9440,6 +9555,11 @@ |
9440 | 9555 |
"tmpl": "1.0.5" |
9441 | 9556 |
} |
9442 | 9557 |
}, |
9558 |
+ "node_modules/mdn-data": { |
|
9559 |
+ "version": "2.0.14", |
|
9560 |
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", |
|
9561 |
+ "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==" |
|
9562 |
+ }, |
|
9443 | 9563 |
"node_modules/memoize-one": { |
9444 | 9564 |
"version": "5.2.1", |
9445 | 9565 |
"resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", |
... | ... | @@ -10352,6 +10472,17 @@ |
10352 | 10472 |
"node": ">=8" |
10353 | 10473 |
} |
10354 | 10474 |
}, |
10475 |
+ "node_modules/nth-check": { |
|
10476 |
+ "version": "2.1.1", |
|
10477 |
+ "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", |
|
10478 |
+ "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", |
|
10479 |
+ "dependencies": { |
|
10480 |
+ "boolbase": "^1.0.0" |
|
10481 |
+ }, |
|
10482 |
+ "funding": { |
|
10483 |
+ "url": "https://github.com/fb55/nth-check?sponsor=1" |
|
10484 |
+ } |
|
10485 |
+ }, |
|
10355 | 10486 |
"node_modules/nullthrows": { |
10356 | 10487 |
"version": "1.1.1", |
10357 | 10488 |
"resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", |
... | ... | @@ -11147,6 +11278,24 @@ |
11147 | 11278 |
"react-native": "*" |
11148 | 11279 |
} |
11149 | 11280 |
}, |
11281 |
+ "node_modules/react-native-sensitive-info": { |
|
11282 |
+ "version": "5.5.8", |
|
11283 |
+ "resolved": "https://registry.npmjs.org/react-native-sensitive-info/-/react-native-sensitive-info-5.5.8.tgz", |
|
11284 |
+ "integrity": "sha512-p99oaEW4QG1RdUNrkvd/c6Qdm856dQw/Rk81f9fA6Y3DlPs6ADNdU+jbPuTz3CcOUJwuKBDNenX6LR9KfmGFEg==" |
|
11285 |
+ }, |
|
11286 |
+ "node_modules/react-native-svg": { |
|
11287 |
+ "version": "13.14.0", |
|
11288 |
+ "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.14.0.tgz", |
|
11289 |
+ "integrity": "sha512-27ZnxUkHgWICimhuj6MuqBkISN53lVvgWJB7pIypjXysAyM+nqgQBPh4vXg+7MbqLBoYvR4PiBgKfwwGAqVxHg==", |
|
11290 |
+ "dependencies": { |
|
11291 |
+ "css-select": "^5.1.0", |
|
11292 |
+ "css-tree": "^1.1.3" |
|
11293 |
+ }, |
|
11294 |
+ "peerDependencies": { |
|
11295 |
+ "react": "*", |
|
11296 |
+ "react-native": "*" |
|
11297 |
+ } |
|
11298 |
+ }, |
|
11150 | 11299 |
"node_modules/react-native-vector-icons": { |
11151 | 11300 |
"version": "10.0.0", |
11152 | 11301 |
"resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-10.0.0.tgz", |
--- kogas_app/package.json
+++ kogas_app/package.json
... | ... | @@ -23,6 +23,8 @@ |
23 | 23 |
"react-native-reanimated": "^3.5.4", |
24 | 24 |
"react-native-safe-area-context": "^4.7.2", |
25 | 25 |
"react-native-screens": "^3.25.0", |
26 |
+ "react-native-sensitive-info": "^5.5.8", |
|
27 |
+ "react-native-svg": "^13.14.0", |
|
26 | 28 |
"react-native-vector-icons": "^10.0.0", |
27 | 29 |
"react-native-webview": "^13.6.0" |
28 | 30 |
}, |
--- kogas_app/src/components/Button.js
+++ kogas_app/src/components/Button.js
... | ... | @@ -1,19 +1,18 @@ |
1 |
-import { ActivityIndicator, Pressable, StyleSheet, Text } from 'react-native'; |
|
1 |
+import {ActivityIndicator, Pressable, StyleSheet, Text} from 'react-native'; |
|
2 | 2 |
import PropTypes from 'prop-types'; |
3 |
-import { GRAY, PRIMARY, WHITE } from '../color'; |
|
3 |
+import {GRAY, PRIMARY, WHITE} from '../color'; |
|
4 | 4 |
|
5 |
-const Button = ({ title, onPress, disabled, isLoading }) => { |
|
5 |
+const Button = ({title, onPress, disabled, isLoading}) => { |
|
6 | 6 |
return ( |
7 | 7 |
<Pressable |
8 | 8 |
onPress={onPress} |
9 |
- style={({ pressed }) => [ |
|
9 |
+ style={({pressed}) => [ |
|
10 | 10 |
styles.container, |
11 |
- { backgroundColor: PRIMARY.DEFAULT }, |
|
12 |
- pressed && { backgroundColor: PRIMARY.DARK }, |
|
13 |
- disabled && { backgroundColor: PRIMARY.LIGHT }, |
|
11 |
+ {backgroundColor: PRIMARY.DEFAULT}, |
|
12 |
+ pressed && {backgroundColor: PRIMARY.DARK}, |
|
13 |
+ disabled && {backgroundColor: PRIMARY.LIGHT}, |
|
14 | 14 |
]} |
15 |
- disabled={disabled} |
|
16 |
- > |
|
15 |
+ disabled={disabled}> |
|
17 | 16 |
{isLoading ? ( |
18 | 17 |
<ActivityIndicator size={'small'} color={GRAY} /> |
19 | 18 |
) : ( |
... | ... | @@ -36,7 +35,7 @@ |
36 | 35 |
borderRadius: 8, |
37 | 36 |
justifyContent: 'center', |
38 | 37 |
alignItems: 'center', |
39 |
- paddingVertical: 20, |
|
38 |
+ paddingVertical: 15, |
|
40 | 39 |
}, |
41 | 40 |
title: { |
42 | 41 |
color: WHITE, |
+++ kogas_app/src/components/CircularProgressBar.js
... | ... | @@ -0,0 +1,71 @@ |
1 | +import React from 'react'; | |
2 | +import { View, StyleSheet } from 'react-native'; | |
3 | +import { Circle, G, Svg, Text } from 'react-native-svg'; | |
4 | +import { BLACK } from '../color'; | |
5 | + | |
6 | +const CircularProgressBar = ({ percentage }) => { | |
7 | + // 원의 반지름 | |
8 | + const radius = 30; | |
9 | + | |
10 | + // 원의 중심 좌표 | |
11 | + const centerX = radius + 5; // X 좌표 | |
12 | + const centerY = radius + 5; // Y 좌표 | |
13 | + | |
14 | + // 원의 둘레 | |
15 | + const circumference = 2 * Math.PI * radius; | |
16 | + | |
17 | + // 원의 시작 각도 (12시 방향이 0도) | |
18 | + const startAngle = -Math.PI / 2; | |
19 | + | |
20 | + // 퍼센티지에 따른 끝 각도 계산 | |
21 | + const endAngle = startAngle + (percentage / 100) * (2 * Math.PI); | |
22 | + | |
23 | + return ( | |
24 | + <View style={styles.container}> | |
25 | + <Svg width={2 * (radius + 5)} height={2 * (radius + 5)}> | |
26 | + <G> | |
27 | + {/* 배경 원 */} | |
28 | + <Circle | |
29 | + r={radius} | |
30 | + cx={centerX} | |
31 | + cy={centerY} | |
32 | + fill="none" | |
33 | + stroke="#ddd" | |
34 | + strokeWidth={10} | |
35 | + /> | |
36 | + {/* 원형 그래프 */} | |
37 | + <Circle | |
38 | + r={radius} | |
39 | + cx={centerX} | |
40 | + cy={centerY} | |
41 | + fill="none" | |
42 | + stroke="#007AFF" // 원형 그래프의 색상 | |
43 | + strokeWidth={10} // 원형 그래프의 두께 | |
44 | + strokeDasharray={`${circumference}, ${circumference}`} | |
45 | + strokeDashoffset={circumference - (percentage / 100) * circumference} | |
46 | + /> | |
47 | + {/* 텍스트 */} | |
48 | + <Text | |
49 | + x={centerX - 7} | |
50 | + y={centerY + 5} // 텍스트 위치 조절 | |
51 | + fontSize="15" | |
52 | + textAnchor="middle" | |
53 | + fill={BLACK} // 텍스트 색상 | |
54 | + > | |
55 | + {percentage}% | |
56 | + </Text> | |
57 | + </G> | |
58 | + </Svg> | |
59 | + </View> | |
60 | + ); | |
61 | +}; | |
62 | + | |
63 | +const styles = StyleSheet.create({ | |
64 | + container: { | |
65 | + alignItems: 'center', | |
66 | + justifyContent: 'center', | |
67 | + marginRight:10, | |
68 | + }, | |
69 | +}); | |
70 | + | |
71 | +export default CircularProgressBar; |
--- kogas_app/src/components/DetailListItem.js
+++ kogas_app/src/components/DetailListItem.js
... | ... | @@ -1,9 +1,21 @@ |
1 | 1 |
import {Pressable, StyleSheet, Text, View} from 'react-native'; |
2 | 2 |
import {memo} from 'react'; |
3 |
-import {useNavigation} from '@react-navigation/native'; |
|
3 |
+import { useNavigation } from '@react-navigation/native'; |
|
4 |
+import { useEffect, useState } from 'react'; |
|
4 | 5 |
|
5 | 6 |
const DetailListItem = memo(({name, item}) => { |
6 | 7 |
const navigation = useNavigation(); |
8 |
+ const [statusMessage, setStatusMessage] = useState(''); |
|
9 |
+ |
|
10 |
+ useEffect(() => { |
|
11 |
+ if (item.status === 'Y') { |
|
12 |
+ setStatusMessage("서명완료"); |
|
13 |
+ } else if (item.status === 'N') { |
|
14 |
+ setStatusMessage("진행중"); |
|
15 |
+ } else if (item.status === 'X') { |
|
16 |
+ setStatusMessage("반려"); |
|
17 |
+ } |
|
18 |
+ }, [statusMessage]); |
|
7 | 19 |
return ( |
8 | 20 |
<Pressable> |
9 | 21 |
<View style={styles.container}> |
... | ... | @@ -13,8 +25,8 @@ |
13 | 25 |
</View> |
14 | 26 |
|
15 | 27 |
<View style={styles.right}> |
16 |
- <Text>{item.status}</Text> |
|
17 |
- <Text>{item.date}</Text> |
|
28 |
+ <Text>{statusMessage}</Text> |
|
29 |
+ <Text>{item.datetime}</Text> |
|
18 | 30 |
</View> |
19 | 31 |
</View> |
20 | 32 |
</Pressable> |
--- kogas_app/src/components/ListItem.js
+++ kogas_app/src/components/ListItem.js
... | ... | @@ -2,32 +2,45 @@ |
2 | 2 |
import {memo} from 'react'; |
3 | 3 |
import {useNavigation} from '@react-navigation/native'; |
4 | 4 |
import { BLACK } from '../color'; |
5 |
+import { useEffect, useState } from 'react'; |
|
5 | 6 |
|
6 | 7 |
const ListItem = memo(({name, item}) => { |
7 | 8 |
const navigation = useNavigation(); |
9 |
+ const [stageMessage, setStageMessage] = useState(''); |
|
10 |
+ |
|
11 |
+ useEffect(() => { |
|
12 |
+ if (item.stage === 0) { |
|
13 |
+ setStageMessage('서명 진행중'); |
|
14 |
+ } else if (item.stage === -1) { |
|
15 |
+ setStageMessage('반려 처리'); |
|
16 |
+ } else if (item.stage >= 1) { |
|
17 |
+ setStageMessage(`${item.stage}차 서명완료`); |
|
18 |
+ } |
|
19 |
+ }, [stageMessage]); |
|
20 |
+ |
|
8 | 21 |
return ( |
9 | 22 |
<Pressable |
10 | 23 |
onPress={() => { |
11 |
- navigation.navigate('ListDetail', { |
|
12 |
- status: item.status, |
|
13 |
- title: item.title, |
|
14 |
- department: item.department, |
|
15 |
- name: item.name, |
|
16 |
- registrationDate: item.registrationDate, |
|
17 |
- content: item.content, |
|
24 |
+ navigation.navigate('ListDetail', { |
|
25 |
+ document_id: item.document_id, |
|
26 |
+ document_name: item.document_name, |
|
27 |
+ main_department: item.main_department, |
|
28 |
+ reg_date: item.reg_date, |
|
29 |
+ name: item.name, |
|
30 |
+ stage: stageMessage |
|
18 | 31 |
}); |
19 | 32 |
}} |
20 | 33 |
hitSlop={10} |
21 | 34 |
> |
22 | 35 |
<View style={styles.container}> |
23 | 36 |
<View> |
24 |
- <Text>{item.status}</Text> |
|
25 |
- <Text>제목: {item.title}</Text> |
|
26 |
- <Text>기안자: {item.department} {item.name}</Text> |
|
37 |
+ <Text>{stageMessage}</Text> |
|
38 |
+ <Text>제목: {item.document_name}</Text> |
|
39 |
+ <Text>기안자: {item.main_department} {item.name}</Text> |
|
27 | 40 |
</View> |
28 | 41 |
|
29 | 42 |
<View> |
30 |
- <Text>기안일자: {item.registrationDate}</Text> |
|
43 |
+ <Text>기안일자: {item.reg_date}</Text> |
|
31 | 44 |
</View> |
32 | 45 |
</View> |
33 | 46 |
</Pressable> |
--- kogas_app/src/components/TextInput.js
+++ kogas_app/src/components/TextInput.js
... | ... | @@ -1,7 +1,7 @@ |
1 | 1 |
import {StyleSheet, Text, TextInput, View} from 'react-native'; |
2 | 2 |
import PropTypes from 'prop-types'; |
3 | 3 |
import {forwardRef, useState} from 'react'; |
4 |
-import {GRAY, BLACK, PRIMARY} from '../color'; |
|
4 |
+import {GRAY, BLACK, PRIMARY, WHITE} from '../color'; |
|
5 | 5 |
import Icon from 'react-native-vector-icons/Ionicons'; |
6 | 6 |
|
7 | 7 |
export const ReturnKeyTypes = { |
... | ... | @@ -10,64 +10,57 @@ |
10 | 10 |
}; |
11 | 11 |
|
12 | 12 |
export const IconNames = { |
13 |
- ID: 'lock-closed-outline', |
|
14 |
- PASSWORD: 'lock-closed-outline', |
|
13 |
+ ID: 'mail', |
|
14 |
+ PASSWORD: 'lock-closed', |
|
15 | 15 |
}; |
16 | 16 |
|
17 |
-const Input = forwardRef( |
|
18 |
- ({title, placeholder, value, iconName, ...props}, ref) => { |
|
19 |
- const [isFocused, setIsFocused] = useState(false); |
|
17 |
+const Input = forwardRef(({placeholder, value, iconName, ...props}, ref) => { |
|
18 |
+ const [isFocused, setIsFocused] = useState(false); |
|
20 | 19 |
|
21 |
- return ( |
|
22 |
- <View style={styles.container}> |
|
23 |
- <Text |
|
20 |
+ return ( |
|
21 |
+ <View style={styles.container}> |
|
22 |
+ <View> |
|
23 |
+ <TextInput |
|
24 |
+ ref={ref} |
|
25 |
+ {...props} |
|
26 |
+ value={value} |
|
24 | 27 |
style={[ |
25 |
- styles.title, // default |
|
26 |
- value && styles.hasValueTitle, // value |
|
27 |
- isFocused && styles.focusedTitle, // value + focus |
|
28 |
- ]}> |
|
29 |
- {title} |
|
30 |
- </Text> |
|
31 |
- <View> |
|
32 |
- <TextInput |
|
33 |
- ref={ref} |
|
34 |
- {...props} |
|
35 |
- value={value} |
|
36 |
- style={[ |
|
37 |
- styles.input, |
|
38 |
- iconName && {paddingLeft: 30}, |
|
39 |
- value && styles.hasValueInput, |
|
40 |
- isFocused && styles.focusedInput, |
|
41 |
- ]} |
|
42 |
- autoCapitalize={'none'} |
|
43 |
- autoCorrect={false} |
|
44 |
- textContentType={'none'} |
|
45 |
- keyboardAppearance={'light'} |
|
46 |
- onBlur={() => setIsFocused(false)} |
|
47 |
- onFocus={() => setIsFocused(true)} |
|
48 |
- /> |
|
28 |
+ styles.input, |
|
29 |
+ iconName && {paddingLeft: 50}, |
|
30 |
+ value && styles.hasValueInput, |
|
31 |
+ isFocused && styles.focusedInput, |
|
32 |
+ ]} |
|
33 |
+ autoCapitalize={'none'} |
|
34 |
+ autoCorrect={false} |
|
35 |
+ autoCompleteType={'off'} |
|
36 |
+ textContentType={'none'} |
|
37 |
+ keyboardAppearance={'light'} |
|
38 |
+ onBlur={() => setIsFocused(false)} |
|
39 |
+ onFocus={() => setIsFocused(true)} |
|
40 |
+ placeholder={placeholder} |
|
41 |
+ /> |
|
49 | 42 |
|
50 |
- <View style={styles.icon}> |
|
51 |
- <Icon |
|
52 |
- name={iconName} |
|
53 |
- size={20} |
|
54 |
- // color={(() => { |
|
55 |
- // switch (true) { |
|
56 |
- // case isFocused: |
|
57 |
- // return PRIMARY.DEFAULT; |
|
58 |
- // case !!value: |
|
59 |
- // return BLACK; |
|
60 |
- // default: |
|
61 |
- // return GRAY; |
|
62 |
- // } |
|
63 |
- // })()} |
|
64 |
- /> |
|
65 |
- </View> |
|
43 |
+ <View style={styles.icon}> |
|
44 |
+ <Icon |
|
45 |
+ name={iconName} |
|
46 |
+ size={20} |
|
47 |
+ color={WHITE} |
|
48 |
+ // color={(() => { |
|
49 |
+ // switch (true) { |
|
50 |
+ // case isFocused: |
|
51 |
+ // return PRIMARY.DEFAULT; |
|
52 |
+ // case !!value: |
|
53 |
+ // return BLACK; |
|
54 |
+ // default: |
|
55 |
+ // return GRAY; |
|
56 |
+ // } |
|
57 |
+ // })()} |
|
58 |
+ /> |
|
66 | 59 |
</View> |
67 | 60 |
</View> |
68 |
- ); |
|
69 |
- }, |
|
70 |
-); |
|
61 |
+ </View> |
|
62 |
+ ); |
|
63 |
+}); |
|
71 | 64 |
Input.displayName = 'Input'; |
72 | 65 |
|
73 | 66 |
Input.defaultProps = { |
... | ... | @@ -100,6 +93,8 @@ |
100 | 93 |
}, |
101 | 94 |
input: { |
102 | 95 |
borderWidth: 1, |
96 |
+ borderRadius: 10, |
|
97 |
+ borderColor: '#E7EEEE', |
|
103 | 98 |
// paddingHorizontal: 20, |
104 | 99 |
// height: 42, |
105 | 100 |
// paddingLeft: 5, |
... | ... | @@ -115,8 +110,13 @@ |
115 | 110 |
}, |
116 | 111 |
icon: { |
117 | 112 |
position: 'absolute', |
113 |
+ width: 'auto', |
|
118 | 114 |
height: '100%', |
119 | 115 |
justifyContent: 'center', |
116 |
+ backgroundColor: PRIMARY.DEFAULT, |
|
117 |
+ padding: 10, |
|
118 |
+ borderTopLeftRadius: 10, |
|
119 |
+ borderBottomLeftRadius: 10, |
|
120 | 120 |
}, |
121 | 121 |
}); |
122 | 122 |
|
+++ kogas_app/src/img/logo.png
Binary file is not shown |
--- kogas_app/src/screens/HomeScreen.js
+++ kogas_app/src/screens/HomeScreen.js
... | ... | @@ -4,153 +4,89 @@ |
4 | 4 |
import { FlatList } from 'react-native-gesture-handler'; |
5 | 5 |
import ListItem from '../components/ListItem'; |
6 | 6 |
import { useEffect, useState } from 'react'; |
7 |
+import { url } from '../url'; |
|
8 |
+import CircularProgressBar from '../components/CircularProgressBar'; |
|
7 | 9 |
|
8 | 10 |
const HomeScreen = () => { |
9 | 11 |
const navigation = useNavigation(); |
10 |
- const mydocs = { |
|
11 |
- id: 1, |
|
12 |
- status: '서명진행중', //상태 |
|
13 |
- title: '모바일 구축사업 인수인계 협의2', |
|
14 |
- department: '수요공급처', |
|
15 |
- name: 'aa', |
|
16 |
- registrationDate: '2023-09-25', //등록 날짜 |
|
17 |
- content: [{ |
|
18 |
- department: '계약운용부', |
|
19 |
- name: 'aaa', |
|
20 |
- status: '서명완료', |
|
21 |
- date: '2023/09/25 15:00' |
|
22 |
- }, { |
|
23 |
- department: '발전영업부', |
|
24 |
- name: 'aaaa', |
|
25 |
- status: '서명 진행중', |
|
26 |
- date: '2023/09/25 15:00' |
|
27 |
- }] |
|
28 |
- } |
|
29 |
- const newdocs = { |
|
30 |
- id: 1, |
|
31 |
- status: '서명진행중', //상태 |
|
32 |
- title: '모바일 구축사업 인수인계 협의2', |
|
33 |
- department: '수요공급처', |
|
34 |
- name: 'bb', |
|
35 |
- registrationDate: '2023-09-25', //등록 날짜 |
|
36 |
- content: [{ |
|
37 |
- department: '계약운용부', |
|
38 |
- name: 'bbb', |
|
39 |
- status: '서명완료', |
|
40 |
- date: '2023/09/25 15:00' |
|
41 |
- }, { |
|
42 |
- department: '계약운용부', |
|
43 |
- name: 'bbb', |
|
44 |
- status: '서명 진행중', |
|
45 |
- date: '2023/09/25 15:00' |
|
46 |
- },{ |
|
47 |
- department: '발전영업부', |
|
48 |
- name: 'bbbb', |
|
49 |
- status: '서명완료', |
|
50 |
- date: '2023/09/25 15:00' |
|
51 |
- }] |
|
52 |
- } |
|
53 |
- const [mycount, setMyCount] = useState(0); // useState로 상태 변수 관리 |
|
54 |
- const [newcount, setNewCount] = useState(0); // useState로 상태 변수 관리 |
|
12 |
+ const [list, setList] = useState([]); |
|
13 |
+ const [signatureAll, setSignatureAll] = useState(0); |
|
14 |
+ const [signatureClear, setSignatureClear] = useState(0); |
|
15 |
+ const [recentAll, setRecentAll] = useState(0); |
|
16 |
+ const [recentClear, setRecentClear] = useState(0); |
|
17 |
+ const myperc = Math.floor((signatureClear / signatureAll) * 100); |
|
18 |
+ const recentperc = Math.floor((recentClear / recentAll) * 100); |
|
55 | 19 |
|
56 |
- const myperc = Math.floor((mycount / mydocs.content.length) * 100); // mycount 사용 |
|
57 |
- const newperc = Math.floor((newcount / newdocs.content.length) * 100); // newcount 사용 |
|
58 |
- |
|
59 |
- useEffect(() => { |
|
60 |
- setMyCount(0); // 초기화 |
|
61 |
- setNewCount(0); // 초기화 |
|
62 |
- mydocs.content.forEach((item) => { |
|
63 |
- if (item.status === '서명완료') { |
|
64 |
- setMyCount((prevCount) => prevCount + 1); // 상태 업데이트 |
|
65 |
- } |
|
66 |
- }); |
|
67 |
- |
|
68 |
- newdocs.content.forEach((item) => { |
|
69 |
- if (item.status === '서명완료') { |
|
70 |
- setNewCount((prevCount) => prevCount + 1); // 상태 업데이트 |
|
71 |
- } |
|
72 |
- }); |
|
73 |
- }, [mydocs, newdocs]); |
|
20 |
+useEffect(() => { |
|
21 |
+ getMainChart(); |
|
22 |
+}, [signatureAll, signatureClear, recentAll, recentClear]); |
|
74 | 23 |
|
75 |
- const List = [ |
|
76 |
- { |
|
77 |
- id: 1, |
|
78 |
- status: '서명진행중', //상태 |
|
79 |
- title: '모바일 구축사업 인수인계 협의2', |
|
80 |
- department: '수요공급처', |
|
81 |
- name: 'aaa', |
|
82 |
- registrationDate: '2023-09-25', //등록 날짜 |
|
83 |
- content: [{ |
|
84 |
- department: '계약운용부', |
|
85 |
- name: 'aaa', |
|
86 |
- status: '서명완료', |
|
87 |
- date: '2023/09/25 15:00' |
|
88 |
- }, { |
|
89 |
- department: '발전영업부', |
|
90 |
- name: 'bbb', |
|
91 |
- status: '서명완료', |
|
92 |
- date: '2023/09/25 15:00' |
|
93 |
- }] |
|
94 |
- }, |
|
95 |
- { |
|
96 |
- id: 2, |
|
97 |
- status: '서명완료', //상태 |
|
98 |
- title: '모바일 구축사업 인수인계 협의1', |
|
99 |
- department: '수요공급처', |
|
100 |
- name: 'bbb', |
|
101 |
- registrationDate: '2023-09-25', //등록 날짜 |
|
102 |
- content: [{department: '발전영업부', name: 'bbb', status: '서명완료', date: '2023/09/25 15:00'}] |
|
103 |
- }, |
|
104 |
- ]; |
|
24 |
+const getMainChart = async () => { |
|
25 |
+ try { |
|
26 |
+ const response = await fetch(`${url}/main_chart`, { |
|
27 |
+ method: 'GET', |
|
28 |
+ headers: { |
|
29 |
+ 'Content-Type': 'application/json', |
|
30 |
+ }, |
|
31 |
+ }) |
|
32 |
+ if (response.ok) { |
|
33 |
+ const data = await response.json(); |
|
34 |
+ //console.log('aalistpage:', data); |
|
35 |
+ setSignatureAll(data.signature_all); |
|
36 |
+ setSignatureClear(data.signature_clear); |
|
37 |
+ setRecentAll(data.now_all); |
|
38 |
+ setRecentClear(data.now_clear); |
|
39 |
+ } else { |
|
40 |
+ console.error('main_chart 데이터를 가져오는 데 실패했습니다.'); |
|
41 |
+ } |
|
42 |
+ }catch (error) { |
|
43 |
+ console.error('데이터를 가져오는 중 오류 발생:', error); |
|
44 |
+ } |
|
45 |
+ }; |
|
46 |
+ useEffect(() => { |
|
47 |
+ getList(); |
|
48 |
+}, []); |
|
49 |
+const getList = async () => { |
|
50 |
+ try { |
|
51 |
+ const response = await fetch(`${url}/list`, { |
|
52 |
+ method: 'GET', |
|
53 |
+ headers: { |
|
54 |
+ 'Content-Type': 'application/json', |
|
55 |
+ }, |
|
56 |
+ }) |
|
57 |
+ if (response.ok) { |
|
58 |
+ const data = await response.json(); |
|
59 |
+ //console.log('listpage:', data); |
|
60 |
+ setList(data); |
|
61 |
+ } else { |
|
62 |
+ console.error('list 데이터를 가져오는 데 실패했습니다.'); |
|
63 |
+ } |
|
64 |
+ } catch (error) { |
|
65 |
+ console.error('데이터를 가져오는 중 오류 발생:', error); |
|
66 |
+ } |
|
67 |
+}; |
|
68 |
+ |
|
105 | 69 |
|
106 | 70 |
return ( |
107 | 71 |
<View style={styles.container}> |
108 | 72 |
<View style={styles.containerTop}> |
109 | 73 |
<Text style={styles.title}>내 진행 상황</Text> |
110 |
- <Pressable |
|
111 |
- onPress={() => { |
|
112 |
- navigation.navigate('ListDetail',{ |
|
113 |
- status: mydocs.status, |
|
114 |
- title: mydocs.title, |
|
115 |
- department: mydocs.department, |
|
116 |
- name: mydocs.name, |
|
117 |
- registrationDate: mydocs.registrationDate, |
|
118 |
- content: mydocs.content, |
|
119 |
- }); |
|
120 |
- }} |
|
121 |
- hitSlop={10} |
|
122 |
- style={styles.mydocs} |
|
123 |
- > |
|
124 |
- <View> |
|
125 |
- <Text>{myperc}%</Text><Text>내 문서 진행률</Text> |
|
126 |
- <Text>서명 대상자 {mydocs.content.length}명 중 {mycount}명이 서명을 완료하였습니다.</Text> |
|
127 |
- </View> |
|
128 |
- </Pressable> |
|
129 |
- <Pressable |
|
130 |
- onPress={() => { |
|
131 |
- navigation.navigate('ListDetail',{ |
|
132 |
- status: newdocs.status, |
|
133 |
- title: newdocs.title, |
|
134 |
- department: newdocs.department, |
|
135 |
- name: newdocs.name, |
|
136 |
- registrationDate: newdocs.registrationDate, |
|
137 |
- content: newdocs.content, |
|
138 |
- }); |
|
139 |
- }} |
|
140 |
- hitSlop={10} |
|
141 |
- style={styles.mydocs} |
|
142 |
- > |
|
143 |
- <View> |
|
144 |
- <Text>{newperc}%</Text><Text>최근 문서 진행률</Text> |
|
145 |
- <Text>서명 대상자 {newdocs.content.length}명 중 {newcount}명이 서명을 완료하였습니다.</Text> |
|
146 |
- </View> |
|
147 |
- </Pressable> |
|
74 |
+ <View style={styles.mydocs}><CircularProgressBar percentage={myperc} /> |
|
75 |
+ <View style={styles.text}> |
|
76 |
+ <Text>내 문서 진행률</Text> |
|
77 |
+ <Text>서명 대상자 {signatureAll}명 중 {signatureClear}명이 서명을 완료하였습니다.</Text> |
|
78 |
+ </View></View> |
|
79 |
+ <View style={styles.mydocs}><CircularProgressBar percentage={recentperc} /> |
|
80 |
+ <View style={styles.text}> |
|
81 |
+ <Text>내 문서 진행률</Text> |
|
82 |
+ <Text>서명 대상자 {recentAll}명 중 {recentClear}명이 서명을 완료하였습니다.</Text> |
|
83 |
+ </View></View> |
|
148 | 84 |
</View> |
149 | 85 |
<View style={styles.containerBottom}> |
150 | 86 |
<Text style={styles.title}>서명 이력</Text> |
151 | 87 |
<View> |
152 | 88 |
<FlatList |
153 |
- data={List} |
|
89 |
+ data={list} |
|
154 | 90 |
renderItem={({item}) => ( |
155 | 91 |
<ListItem name="HomeScreen" item={item} /> |
156 | 92 |
)} |
... | ... | @@ -171,6 +107,7 @@ |
171 | 107 |
|
172 | 108 |
}, |
173 | 109 |
mydocs: { |
110 |
+ flexDirection: 'row', |
|
174 | 111 |
borderWidth: 0.5, |
175 | 112 |
borderColor: GRAY, |
176 | 113 |
borderRadius: 10, |
... | ... | @@ -185,6 +122,6 @@ |
185 | 122 |
borderBottomColor: BLACK, |
186 | 123 |
paddingVertical: 5, |
187 | 124 |
marginHorizontal:10, |
188 |
- } |
|
125 |
+ }, |
|
189 | 126 |
}); |
190 | 127 |
export default HomeScreen; |
--- kogas_app/src/screens/ListDetailScreen.js
+++ kogas_app/src/screens/ListDetailScreen.js
... | ... | @@ -1,38 +1,147 @@ |
1 |
-import {FlatList, StyleSheet, Text, View,Button} from 'react-native'; |
|
2 |
-import {GRAY} from '../color'; |
|
1 |
+import { FlatList, StyleSheet, Text, View, Button, Alert } from 'react-native'; |
|
2 |
+import { GRAY } from '../color'; |
|
3 | 3 |
import DetailListItem from '../components/DetailListItem'; |
4 |
+import { useEffect, useState } from 'react'; |
|
5 |
+import { url } from '../url'; |
|
4 | 6 |
|
5 | 7 |
const ListDetailScreen = ({ route, navigation }) => { |
6 |
- const {status} = route.params; |
|
7 |
- const { title } = route.params; |
|
8 |
+ const { document_id } = route.params; |
|
9 |
+ const { document_name } = route.params; |
|
8 | 10 |
const { name } = route.params; |
9 |
- const {department} = route.params; |
|
10 |
- const {registrationDate} = route.params; |
|
11 |
- const { content } = route.params; |
|
11 |
+ const { main_department } = route.params; |
|
12 |
+ const { reg_date } = route.params; |
|
13 |
+ const { stage } = route.params; |
|
14 |
+ const [user, setUser] = useState(''); |
|
15 |
+ const [department, setDepartment] = useState(''); |
|
16 |
+ const [list, setList] = useState([]); |
|
17 |
+ const [actionType, setActionType] = useState(null); // 서명 완료, 승인, 반려 액션 타입 |
|
18 |
+ |
|
19 |
+ useEffect(() => { |
|
20 |
+ // 세션 정보를 가져옴 |
|
21 |
+ getSession(); |
|
22 |
+ }, []); // 여기에서는 세션 정보를 한 번만 가져오도록 수정 |
|
23 |
+ |
|
24 |
+ // 세션 정보를 가져오는 함수 |
|
25 |
+ const getSession = async () => { |
|
26 |
+ try { |
|
27 |
+ const response = await fetch(`${url}/`); // 세션 정보를 가져오는 엔드포인트로 변경 |
|
28 |
+ if (response.ok) { |
|
29 |
+ const data = await response.json(); |
|
30 |
+ console.log('서버에서 받은 세션 정보listdetail:', data); |
|
31 |
+ setUser(data.user); |
|
32 |
+ setDepartment(data.department); |
|
33 |
+ } else { |
|
34 |
+ console.error('세션 정보를 가져오는 데 실패했습니다.'); |
|
35 |
+ } |
|
36 |
+ } catch (error) { |
|
37 |
+ console.error('오류:', error); |
|
38 |
+ } |
|
39 |
+ }; |
|
40 |
+ |
|
41 |
+ useEffect(() => { |
|
42 |
+ getList(); |
|
43 |
+ }, []); |
|
44 |
+ |
|
45 |
+ const getList = async () => { |
|
46 |
+ //await SInfo.getItem('SessionId', {}).then(sessionId => { |
|
47 |
+ //if (sessionId) { |
|
48 |
+ fetch(`${url}/show_sig`, { |
|
49 |
+ method: 'POST', |
|
50 |
+ body: JSON.stringify({ |
|
51 |
+ document_id: document_id |
|
52 |
+ }), |
|
53 |
+ headers: { |
|
54 |
+ 'Content-Type': 'application/json', |
|
55 |
+ //Authorization: `Bearer ${sessionId}`, // 세션 아이디 사용 |
|
56 |
+ }, |
|
57 |
+ }) |
|
58 |
+ .then(response => response.json()) |
|
59 |
+ .then(data => { |
|
60 |
+ console.log('listdetailpage:', data); |
|
61 |
+ setList(data); |
|
62 |
+ }) |
|
63 |
+ .catch(error => { |
|
64 |
+ console.error(error); |
|
65 |
+ }); |
|
66 |
+ //} else { |
|
67 |
+ // console.log('세션 아이디 없음'); |
|
68 |
+ //} |
|
69 |
+ //}); |
|
70 |
+ }; |
|
71 |
+ |
|
72 |
+ // user와 department 정보를 기반으로 stage 정보를 필터링 |
|
73 |
+ const filteredItem = list.find(item => item.name === user && item.department === department); |
|
74 |
+ |
|
75 |
+ // 서명 완료, 승인, 반려 여부에 따라 액션 타입 설정 |
|
76 |
+ useEffect(() => { |
|
77 |
+ if (filteredItem) { |
|
78 |
+ setActionType(filteredItem.status); |
|
79 |
+ } |
|
80 |
+ }, [filteredItem, actionType]); |
|
81 |
+ |
|
82 |
+ // 승인 또는 반려 버튼 클릭 시 |
|
83 |
+ const handleApproveOrReject = (isApprove) => { |
|
84 |
+ const message = isApprove ? '승인하시겠습니까?' : '반려하시겠습니까?'; |
|
85 |
+ Alert.alert( |
|
86 |
+ '알림', |
|
87 |
+ message, |
|
88 |
+ [ |
|
89 |
+ { |
|
90 |
+ text: '예', |
|
91 |
+ onPress: () => { |
|
92 |
+ // 승인 또는 반려 동작 처리 |
|
93 |
+ if (isApprove) { |
|
94 |
+ // 승인 처리 로직 |
|
95 |
+ // ... |
|
96 |
+ console.log('승인 처리'); |
|
97 |
+ } else { |
|
98 |
+ // 반려 처리 로직 |
|
99 |
+ // ... |
|
100 |
+ console.log('반려 처리'); |
|
101 |
+ } |
|
102 |
+ } |
|
103 |
+ }, |
|
104 |
+ { |
|
105 |
+ text: '아니요', |
|
106 |
+ style: 'cancel' |
|
107 |
+ } |
|
108 |
+ ] |
|
109 |
+ ); |
|
110 |
+ }; |
|
111 |
+ |
|
12 | 112 |
return ( |
13 |
- |
|
14 | 113 |
<View style={styles.container}> |
15 | 114 |
<View> |
16 |
- <Text style={styles.title}>{status}</Text> |
|
17 |
- <Text style={styles.title}>{title}</Text> |
|
18 |
- <Text style={styles.date}>기안자: {department} {name}</Text> |
|
19 |
- <Text style={styles.date}>기안일자: {registrationDate}</Text> |
|
115 |
+ <Text style={styles.title}>{stage}</Text> |
|
116 |
+ <Text style={styles.title}>{document_name}</Text> |
|
117 |
+ <Text style={styles.date}>기안자: {main_department} {name}</Text> |
|
118 |
+ <Text style={styles.date}>기안일자: {reg_date}</Text> |
|
20 | 119 |
</View> |
21 |
- <Button title={'문서보기'}/> |
|
120 |
+ <Button title={'문서 보기'} /> |
|
22 | 121 |
<View> |
23 | 122 |
<Text style={styles.v}>서명 정보</Text> |
24 | 123 |
<FlatList |
25 |
- data={content} |
|
26 |
- renderItem={({item}) => ( |
|
27 |
- <DetailListItem name="ListDetailScreen" item={item} /> |
|
28 |
- )} |
|
29 |
- windowSize={5} |
|
30 |
- ListHeaderComponent={View} |
|
31 |
- ListHeaderComponentStyle={{height: 10}} |
|
124 |
+ data={list} |
|
125 |
+ renderItem={({ item }) => ( |
|
126 |
+ <DetailListItem name="ListDetailScreen" item={item} /> |
|
127 |
+ )} |
|
128 |
+ windowSize={5} |
|
129 |
+ ListHeaderComponent={View} |
|
130 |
+ ListHeaderComponentStyle={{ height: 10 }} |
|
32 | 131 |
/> |
33 |
- <Button title={'??'}/> |
|
132 |
+ {actionType === 'Y' && ( |
|
133 |
+ <Button title={'서명 완료'} /> |
|
134 |
+ )} |
|
135 |
+ {actionType === 'N' && ( |
|
136 |
+ <View> |
|
137 |
+ <Button title={'승인'} onPress={() => handleApproveOrReject(true)} /> |
|
138 |
+ <Button title={'반려'} onPress={() => handleApproveOrReject(false)} /> |
|
139 |
+ </View> |
|
140 |
+ )} |
|
141 |
+ {actionType === 'X' && ( |
|
142 |
+ <Button title={'반려 처리'} /> |
|
143 |
+ )} |
|
34 | 144 |
</View> |
35 |
- |
|
36 | 145 |
</View> |
37 | 146 |
); |
38 | 147 |
}; |
... | ... | @@ -42,33 +151,6 @@ |
42 | 151 |
marginTop: 10, |
43 | 152 |
fontWeight: 'bold', |
44 | 153 |
} |
45 |
- // container: { |
|
46 |
- // flex: 1, |
|
47 |
- // }, |
|
48 |
- // title: { |
|
49 |
- // fontSize: 20, |
|
50 |
- // fontWeight: 'bold', |
|
51 |
- // marginHorizontal: 10, |
|
52 |
- // paddingVertical: 10, |
|
53 |
- // paddingHorizontal: 30, |
|
54 |
- // marginTop: 15, |
|
55 |
- // }, |
|
56 |
- // content: { |
|
57 |
- // fontSize: 15, |
|
58 |
- // marginHorizontal: 25, |
|
59 |
- // paddingVertical: 25, |
|
60 |
- // }, |
|
61 |
- // date: { |
|
62 |
- // fontSize: 15, |
|
63 |
- // color: GRAY, |
|
64 |
- // }, |
|
65 |
- // dateview: { |
|
66 |
- // alignItems: 'flex-end', |
|
67 |
- // marginHorizontal: 10, |
|
68 |
- // paddingHorizontal: 10, |
|
69 |
- // paddingVertical: 10, |
|
70 |
- // borderBottomWidth: 1, |
|
71 |
- // }, |
|
72 | 154 |
}); |
73 | 155 |
|
74 | 156 |
export default ListDetailScreen; |
--- kogas_app/src/screens/SettingsScreen.js
+++ kogas_app/src/screens/SettingsScreen.js
... | ... | @@ -1,15 +1,35 @@ |
1 |
-import { StyleSheet, Switch, Text, View } from 'react-native'; |
|
1 |
+import { Alert, StyleSheet, Switch, Text, View } from 'react-native'; |
|
2 | 2 |
import PropTypes from 'prop-types'; |
3 | 3 |
import { GRAY, PRIMARY, WHITE } from '../color'; |
4 | 4 |
import { useState } from 'react'; |
5 | 5 |
import Button from '../components/Button'; |
6 |
+import { url } from '../url'; |
|
6 | 7 |
|
7 |
-const SettingsScreen = ({navigation}) => { |
|
8 |
+const SettingsScreen = ({ navigation }) => { |
|
8 | 9 |
const [alarm, setAlarm] = useState(false); |
9 | 10 |
const [dark, setDark] = useState(false); |
10 | 11 |
|
11 | 12 |
const toggleSwitchAlarm = () => setAlarm((previousState) => !previousState); |
12 | 13 |
const toggleSwitchDark = () => setDark((previousState) => !previousState); |
14 |
+ |
|
15 |
+ const handleLogout = () => { |
|
16 |
+ fetch(`${url}/logout`, { |
|
17 |
+ method: 'POST', |
|
18 |
+ credentials: 'same-origin' |
|
19 |
+ }) |
|
20 |
+ .then((response) => { |
|
21 |
+ console.log(response.status); |
|
22 |
+ if (response.status === 200) { |
|
23 |
+ navigation.navigate('Login'); |
|
24 |
+ } else { |
|
25 |
+ Alert.alert('로그아웃 실패'); |
|
26 |
+ } |
|
27 |
+ }) |
|
28 |
+ .catch((error) => { |
|
29 |
+ console.error('로그아웃 중 오류 발생:', error); |
|
30 |
+ Alert.alert('로그아웃 중 오류가 발생했습니다.'); |
|
31 |
+ }); |
|
32 |
+ }; |
|
13 | 33 |
|
14 | 34 |
return ( |
15 | 35 |
<View style={styles.container}> |
... | ... | @@ -26,41 +46,24 @@ |
26 | 46 |
/> |
27 | 47 |
</View> |
28 | 48 |
</View> |
29 |
- {alarm && ( // 알림 설정이 켜져 있을 때만 하단 텍스트를 표시 |
|
49 |
+ {alarm && ( |
|
30 | 50 |
<View> |
31 |
- <Text>시간대별알림설정 여부</Text> |
|
51 |
+ <Text>시간대별 알림 설정 여부</Text> |
|
32 | 52 |
</View> |
33 | 53 |
)} |
34 |
- {/* <View style={styles.textContainer}> |
|
35 |
- <Text style={styles.text}>다크 모드</Text> |
|
36 |
- <View style={styles.switchStyle}> |
|
37 |
- <Switch |
|
38 |
- trackColor={{ false: GRAY, true: PRIMARY.DEFAULT }} |
|
39 |
- thumbColor={WHITE} |
|
40 |
- ios_backgroundColor={GRAY} |
|
41 |
- onValueChange={toggleSwitchDark} |
|
42 |
- value={dark} |
|
43 |
- /> |
|
44 |
- </View> |
|
45 |
- </View> */} |
|
46 | 54 |
<View style={styles.view}> |
47 |
- <Button |
|
48 |
- title={'기기등록'} |
|
49 |
- /> |
|
50 |
- </View> |
|
55 |
+ <Button title={'기기 등록'} onPress={() => {}} /> |
|
56 |
+ </View> |
|
51 | 57 |
<View style={styles.view}> |
52 |
- <Button |
|
53 |
- title={'로그아웃'} |
|
54 |
- onPress={() => { |
|
55 |
- navigation.navigate('Login'); |
|
56 |
- }} |
|
57 |
- /> |
|
58 |
- </View> |
|
58 |
+ <Button title={'로그아웃'} onPress={handleLogout} /> |
|
59 |
+ </View> |
|
59 | 60 |
</View> |
60 | 61 |
</View> |
61 | 62 |
); |
62 | 63 |
}; |
64 |
+ |
|
63 | 65 |
SettingsScreen.propTypes = {}; |
66 |
+ |
|
64 | 67 |
const styles = StyleSheet.create({ |
65 | 68 |
container: { |
66 | 69 |
flex: 1, |
... | ... | @@ -93,7 +96,7 @@ |
93 | 96 |
}, |
94 | 97 |
view: { |
95 | 98 |
margin: 15, |
96 |
- |
|
97 |
- } |
|
99 |
+ }, |
|
98 | 100 |
}); |
99 |
-export default SettingsScreen;(파일 끝에 줄바꿈 문자 없음) |
|
101 |
+ |
|
102 |
+export default SettingsScreen; |
--- kogas_app/src/screens/SignInScreen.js
+++ kogas_app/src/screens/SignInScreen.js
... | ... | @@ -37,33 +37,36 @@ |
37 | 37 |
fetch(`${url}/login`, { |
38 | 38 |
method: 'POST', |
39 | 39 |
body: JSON.stringify({ |
40 |
- id: email, |
|
40 |
+ username: id, |
|
41 | 41 |
password: password, |
42 | 42 |
}), |
43 | 43 |
headers: { |
44 | 44 |
'Content-Type': 'application/json', |
45 | 45 |
}, |
46 | 46 |
}) |
47 |
- .then((response) => response.json()) |
|
48 |
- .then(async (data) => { |
|
49 |
- //const token = data.token; // 토큰 추출 |
|
50 |
- //console.log(token); |
|
51 |
- |
|
52 | 47 |
try { |
53 | 48 |
//await SecureStore.setItemAsync('Token', token); |
54 | 49 |
// 로그인 성공 후 메인 화면으로 이동 |
55 |
- navigation.navigate('Main'); |
|
50 |
+ console.log("성공") |
|
51 |
+ Alert.alert('로그인 성공'); |
|
52 |
+ try { |
|
53 |
+ const response = await fetch(`${url}/`); // 세션 정보를 가져오는 엔드포인트로 변경 |
|
54 |
+ if (response.ok) { |
|
55 |
+ console.log('세션성공'); |
|
56 |
+ navigation.navigate('Main'); |
|
57 |
+ } else { |
|
58 |
+ console.error('세션 정보를 가져오는 데 실패했습니다.'); |
|
59 |
+ } |
|
60 |
+ } catch (error) { |
|
61 |
+ console.error('오류:', error); |
|
62 |
+ } |
|
56 | 63 |
} catch (e) { |
64 |
+ console.log("실패") |
|
57 | 65 |
Alert.alert('로그인 실패'); |
58 |
- console.error('token 에러: ' + e); |
|
59 | 66 |
setIsLoading(false); |
60 | 67 |
} |
61 |
- }) |
|
62 |
- .catch((error) => { |
|
63 |
- console.error('tokne 만료:' + error); |
|
64 |
- setIsLoading(false); |
|
65 |
- }); |
|
66 | 68 |
} catch (e) { |
69 |
+ console.log("실패") |
|
67 | 70 |
Alert.alert('로그인 실패', e, [ |
68 | 71 |
{ |
69 | 72 |
text: 'Ok', |
... | ... | @@ -78,12 +81,18 @@ |
78 | 81 |
return ( |
79 | 82 |
<TouchableWithoutFeedback onPress={handleDismissKeyboard}> |
80 | 83 |
<View style={styles.container}> |
81 |
- <Text style={styles.text}>스마트 전자서명 시스템</Text> |
|
82 |
- <View style={styles.view}> |
|
84 |
+ <View style={styles.titleContainer}> |
|
85 |
+ <Image source={require('../img/logo.png')} style={styles.image} /> |
|
86 |
+ <Text |
|
87 |
+ style={[styles.textContainer, {alignSelf: 'center'}]}> |
|
88 |
+ 스마트 전자서명 시스템 |
|
89 |
+ </Text> |
|
90 |
+ </View> |
|
91 |
+ <View style={styles.viewContainer}> |
|
83 | 92 |
<TextInput |
84 | 93 |
value={id} |
85 |
- onChangeText={(text) => setId(text.trim())} |
|
86 |
- title={'아이디'} |
|
94 |
+ onChangeText={text => setId(text.trim())} |
|
95 |
+ placeholder={'아이디'} |
|
87 | 96 |
returnKeyType={ReturnKeyTypes.NEXT} |
88 | 97 |
iconName={IconNames.ID} |
89 | 98 |
onSubmitEditing={() => passwordRef.current.focus()} |
... | ... | @@ -91,8 +100,8 @@ |
91 | 100 |
<TextInput |
92 | 101 |
ref={passwordRef} |
93 | 102 |
value={password} |
94 |
- onChangeText={(text) => setPassword(text.trim())} |
|
95 |
- title={'비밀번호'} |
|
103 |
+ onChangeText={text => setPassword(text.trim())} |
|
104 |
+ placeholder={'비밀번호'} |
|
96 | 105 |
secureTextEntry |
97 | 106 |
iconName={IconNames.PASSWORD} |
98 | 107 |
onSubmitEditing={onSubmit} |
... | ... | @@ -118,33 +127,40 @@ |
118 | 127 |
const styles = StyleSheet.create({ |
119 | 128 |
container: { |
120 | 129 |
flex: 1, |
121 |
- justifyContent: 'center', |
|
130 |
+ paddingTop: 20, |
|
131 |
+ justifyContent: 'flex-start', |
|
122 | 132 |
alignItems: 'center', |
123 | 133 |
}, |
124 |
- view: { |
|
125 |
- width: '70%', |
|
134 |
+ titleContainer: { |
|
135 |
+ width: '100%', |
|
136 |
+ flex: 1, |
|
137 |
+ justifyContent: 'center', |
|
138 |
+ alignItems: 'center', |
|
139 |
+ marginTop: 50, |
|
126 | 140 |
}, |
127 |
- view2: { |
|
128 |
- width: '65%', |
|
141 |
+ image: { |
|
142 |
+ flex: 1, |
|
143 |
+ width: '60%', |
|
144 |
+ resizeMode: 'contain', |
|
145 |
+ justifyContent: 'flex-end', |
|
146 |
+ alignItems: 'center', |
|
147 |
+ }, |
|
148 |
+ viewContainer: { |
|
149 |
+ flex: 2, |
|
150 |
+ width: '90%', |
|
129 | 151 |
}, |
130 | 152 |
buttonContainer: { |
131 | 153 |
padding: 5, |
132 | 154 |
marginTop: 10, |
133 | 155 |
}, |
134 | 156 |
textContainer: { |
157 |
+ flex: 1, |
|
135 | 158 |
padding: 10, |
136 |
- flexDirection: 'row', |
|
137 | 159 |
alignItems: 'center', |
138 |
- fontSize: 5, |
|
139 |
- justifyContent: 'space-evenly', |
|
160 |
+ fontSize: 30, |
|
161 |
+ justifyContent: 'flex-start', |
|
162 |
+ fontWeight: '900', |
|
140 | 163 |
}, |
141 |
- text: { |
|
142 |
- fontSize: 25, |
|
143 |
- padding: 30, |
|
144 |
- fontWeight: 'bold', |
|
145 |
- }, |
|
146 |
- |
|
147 |
- line: { flex: 1, height: 1, backgroundColor: 'black' }, |
|
148 | 164 |
}); |
149 | 165 |
|
150 | 166 |
export default SignInScreen; |
--- kogas_app/src/screens/SignatureListScreen.js
... | ... | @@ -1,57 +0,0 @@ |
1 | -// import {FlatList, StyleSheet, View} from 'react-native'; | |
2 | -// import ListItem from '../components/ListItem'; | |
3 | -// import EmptyList from '../components/EmptyList'; | |
4 | - | |
5 | -// const SignatureListScreen = () => { | |
6 | -// const List = [ | |
7 | -// { | |
8 | -// id: 1, | |
9 | -// status: '서명진행중', //상태 | |
10 | -// title: '제목', | |
11 | -// writer: '작성자', | |
12 | -// registrationDate: '2023-09-25', //등록 날짜 | |
13 | -// content: [{ | |
14 | -// department: '계약운용부', | |
15 | -// name: 'aaa', | |
16 | -// status: '서명완료', | |
17 | -// date: '2023/09/25 15:00' | |
18 | -// }, { | |
19 | -// department: '발전영업부', | |
20 | -// name: 'bbb', | |
21 | -// status: '서명완료', | |
22 | -// date: '2023/09/25 15:00' | |
23 | -// }] | |
24 | -// }, | |
25 | -// { | |
26 | -// id: 2, | |
27 | -// status: '서명완료', //상태 | |
28 | -// title: '제목', | |
29 | -// writer: '작성자', | |
30 | -// registrationDate: '2023-09-25', //등록 날짜 | |
31 | -// content: [{department: '발전영업부', name: 'bbb', status: '서명완료', date: '2023/09/25 15:00'}] | |
32 | -// }, | |
33 | -// ]; | |
34 | -// return List.length ? ( | |
35 | -// <View style={styles.container}> | |
36 | -// <FlatList | |
37 | -// data={List} | |
38 | -// renderItem={({item}) => ( | |
39 | -// <ListItem name="SignatureListScreen" item={item} /> | |
40 | -// )} | |
41 | -// windowSize={5} | |
42 | -// ListHeaderComponent={View} | |
43 | -// ListHeaderComponentStyle={{height: 10}} | |
44 | -// /> | |
45 | -// </View> | |
46 | -// ) : ( | |
47 | -// <EmptyList /> | |
48 | -// ); | |
49 | -// }; | |
50 | - | |
51 | -// const styles = StyleSheet.create({ | |
52 | -// container: { | |
53 | -// flex: 1, | |
54 | -// }, | |
55 | -// }); | |
56 | - | |
57 | -// export default SignatureListScreen; |
--- kogas_app/src/screens/SignatureScreen.js
+++ kogas_app/src/screens/SignatureScreen.js
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 |
import { View, Text, TouchableOpacity } from 'react-native'; |
3 | 3 |
import { FlatList } from 'react-native-gesture-handler'; |
4 | 4 |
import ListItem from '../components/ListItem'; |
5 |
+import { url } from '../url'; |
|
5 | 6 |
|
6 | 7 |
// 라디오 버튼 컴포넌트 |
7 | 8 |
const RadioButton = ({ options, selectedOption, onSelect }) => { |
... | ... | @@ -34,109 +35,125 @@ |
34 | 35 |
|
35 | 36 |
// 예제 앱 |
36 | 37 |
const SignatureScreen = () => { |
37 |
- const List0 = [ |
|
38 |
- { |
|
39 |
- id: 1, |
|
40 |
- status: '서명진행중', //상태 |
|
41 |
- title: '모바일 구축사업 인수인계 협의2', |
|
42 |
- department: '수요공급처', |
|
43 |
- name: 'aaa', |
|
44 |
- registrationDate: '2023-09-25', //등록 날짜 |
|
45 |
- content: [{ |
|
46 |
- department: '계약운용부', |
|
47 |
- name: 'aaa', |
|
48 |
- status: '서명완료', |
|
49 |
- date: '2023/09/25 15:00' |
|
50 |
- }, { |
|
51 |
- department: '발전영업부', |
|
52 |
- name: 'bbb', |
|
53 |
- status: '서명완료', |
|
54 |
- date: '2023/09/25 15:00' |
|
55 |
- }] |
|
56 |
- }, |
|
57 |
- { |
|
58 |
- id: 2, |
|
59 |
- status: '서명완료', //상태 |
|
60 |
- title: '모바일 구축사업 인수인계 협의1', |
|
61 |
- department: '수요공급처', |
|
62 |
- name: 'aaa', |
|
63 |
- registrationDate: '2023-09-25', //등록 날짜 |
|
64 |
- content: [{department: '발전영업부', name: 'bbb', status: '서명완료', date: '2023/09/25 15:00'}] |
|
65 |
- }, |
|
66 |
- ]; |
|
67 |
- const List1 = [ |
|
68 |
- { |
|
69 |
- id: 1, |
|
70 |
- status: '서명진행중', //상태 |
|
71 |
- title: '모바일 구축사업 인수인계 협의2', |
|
72 |
- department: '수요공급처', |
|
73 |
- name: 'bbb', |
|
74 |
- registrationDate: '2023-09-25', //등록 날짜 |
|
75 |
- content: [{ |
|
76 |
- department: '계약운용부', |
|
77 |
- name: 'aaa', |
|
78 |
- status: '서명완료', |
|
79 |
- date: '2023/09/25 15:00' |
|
80 |
- }, { |
|
81 |
- department: '발전영업부', |
|
82 |
- name: 'bbb', |
|
83 |
- status: '서명완료', |
|
84 |
- date: '2023/09/25 15:00' |
|
85 |
- }] |
|
86 |
- }, |
|
87 |
- { |
|
88 |
- id: 2, |
|
89 |
- status: '서명완료', //상태 |
|
90 |
- title: '모바일 구축사업 인수인계 협의1', |
|
91 |
- department: '수요공급처', |
|
92 |
- name: 'bbb', |
|
93 |
- registrationDate: '2023-09-25', //등록 날짜 |
|
94 |
- content: [{department: '발전영업부', name: 'bbb', status: '서명완료', date: '2023/09/25 15:00'}] |
|
95 |
- }, |
|
96 |
- ]; |
|
97 |
- const List2 = [ |
|
98 |
- { |
|
99 |
- id: 1, |
|
100 |
- status: '서명진행중', //상태 |
|
101 |
- title: '모바일 구축사업 인수인계 협의2', |
|
102 |
- department: '수요공급처', |
|
103 |
- name: 'ccc', |
|
104 |
- registrationDate: '2023-09-25', //등록 날짜 |
|
105 |
- content: [{ |
|
106 |
- department: '계약운용부', |
|
107 |
- name: 'aaa', |
|
108 |
- status: '서명완료', |
|
109 |
- date: '2023/09/25 15:00' |
|
110 |
- }, { |
|
111 |
- department: '발전영업부', |
|
112 |
- name: 'bbb', |
|
113 |
- status: '서명완료', |
|
114 |
- date: '2023/09/25 15:00' |
|
115 |
- }] |
|
116 |
- }, |
|
117 |
- ]; |
|
38 |
+ //const [myList, setMyList] = useState([]); |
|
39 |
+ //const [proceedingList, setProceedingList] = useState([]); |
|
40 |
+ //const [doneList, setDoneList] = useState([]); |
|
41 |
+ const [user, setUser] = useState(''); |
|
118 | 42 |
const options = ['내 기안', '진행 문서', '완료 문서']; |
119 | 43 |
const [selectedOption, setSelectedOption] = useState(null); |
120 |
- const [selectedList, setSelectedList] = useState([]); |
|
44 |
+ const [selectedList, setSelectedList] = useState([]); |
|
121 | 45 |
useEffect(() => { |
122 |
- if (selectedOption === null && options.length > 0) { |
|
123 |
- setSelectedOption(options[0]); |
|
124 |
- setSelectedList(List0); |
|
125 |
- } |
|
126 |
- }, []); |
|
46 |
+ if (user !== '') { |
|
47 |
+ if (selectedOption === null && options.length > 0) { |
|
48 |
+ getMyDoc(); |
|
49 |
+ setSelectedOption(options[0]); |
|
50 |
+ } |
|
51 |
+ } else { |
|
52 |
+ console.log("user 없음") |
|
53 |
+ } |
|
54 |
+ }, [user,selectedList]); |
|
55 |
+ |
|
127 | 56 |
// 옵션 선택 시 호출되는 함수 |
128 | 57 |
const handleSelect = (option,index) => { |
129 | 58 |
setSelectedOption(option); |
130 | 59 |
// 선택된 옵션에 따라 다른 리스트 데이터를 설정 |
131 | 60 |
if (index === 0) { |
132 |
- setSelectedList(List0); |
|
61 |
+ getMyDoc(); |
|
133 | 62 |
} else if (index === 1) { |
134 |
- setSelectedList(List1); |
|
63 |
+ getProceedingDoc(); |
|
135 | 64 |
} else if (index === 2) { |
136 |
- setSelectedList(List2); |
|
65 |
+ getDoneDoc(); |
|
66 |
+ } |
|
67 |
+ }; |
|
68 |
+ useEffect(() => { |
|
69 |
+ // 세션 정보를 가져옴 |
|
70 |
+ getSession(); |
|
71 |
+ }, []); // 여기에서는 세션 정보를 한 번만 가져오도록 수정 |
|
72 |
+ |
|
73 |
+ // 세션 정보를 가져오는 함수 |
|
74 |
+ const getSession = async () => { |
|
75 |
+ try { |
|
76 |
+ const response = await fetch(`${url}/`); // 세션 정보를 가져오는 엔드포인트로 변경 |
|
77 |
+ if (response.ok) { |
|
78 |
+ const data = await response.json(); |
|
79 |
+ console.log('서버에서 받은 세션 정보signaturelist:', data); |
|
80 |
+ setUser(data.user); |
|
81 |
+ |
|
82 |
+ } else { |
|
83 |
+ console.error('세션 정보를 가져오는 데 실패했습니다.'); |
|
84 |
+ } |
|
85 |
+ } catch (error) { |
|
86 |
+ console.error('오류:', error); |
|
87 |
+ } |
|
88 |
+ }; |
|
89 |
+ |
|
90 |
+const getMyDoc = async () => { |
|
91 |
+ console.log('mydoc user signaturelist:',user); |
|
92 |
+ try { |
|
93 |
+ const response = await fetch(`${url}/my_doc`, { |
|
94 |
+ method: 'POST', |
|
95 |
+ body: JSON.stringify({ |
|
96 |
+ user_id: user, |
|
97 |
+ }), |
|
98 |
+ headers: { |
|
99 |
+ 'Content-Type': 'application/json', |
|
100 |
+ }, |
|
101 |
+ }); |
|
102 |
+ if (response.ok) { |
|
103 |
+ const data = await response.json(); |
|
104 |
+ console.log("my"+data); |
|
105 |
+ setSelectedList(data); |
|
106 |
+ } else { |
|
107 |
+ console.error('mydoc 데이터를 가져오는 데 실패했습니다.',response); |
|
108 |
+ } |
|
109 |
+ } catch (error) { |
|
110 |
+ console.error('mydoc 데이터를 가져오는 중 오류 발생:', error); |
|
111 |
+ } |
|
112 |
+}; |
|
113 |
+ |
|
114 |
+const getProceedingDoc = async () => { |
|
115 |
+ try { |
|
116 |
+ const response = await fetch(`${url}/trying_doc`, { |
|
117 |
+ method: 'POST', |
|
118 |
+ body: JSON.stringify({ |
|
119 |
+ user_id: user, |
|
120 |
+ }), |
|
121 |
+ headers: { |
|
122 |
+ 'Content-Type': 'application/json', |
|
123 |
+ }, |
|
124 |
+ }) |
|
125 |
+ if (response.ok) { |
|
126 |
+ const data = await response.json(); |
|
127 |
+ console.log("proceed"+data); |
|
128 |
+ //console.log('listpage:', data); |
|
129 |
+ setSelectedList(data); |
|
130 |
+ } else { |
|
131 |
+ console.error('proceedingdoc 데이터를 가져오는 데 실패했습니다.'); |
|
132 |
+ } |
|
133 |
+ } catch (error) { |
|
134 |
+ console.error('proceedingdoc 데이터를 가져오는 중 오류 발생:', error); |
|
137 | 135 |
} |
138 | 136 |
}; |
139 | 137 |
|
138 |
+const getDoneDoc = async () => { |
|
139 |
+ try { |
|
140 |
+ const response = await fetch(`${url}/done_doc`, { |
|
141 |
+ method: 'GET', |
|
142 |
+ headers: { |
|
143 |
+ 'Content-Type': 'application/json', |
|
144 |
+ }, |
|
145 |
+ }) |
|
146 |
+ if (response.ok) { |
|
147 |
+ const data = await response.json(); |
|
148 |
+ //console.log('listpage:', data); |
|
149 |
+ setSelectedList(data); |
|
150 |
+ } else { |
|
151 |
+ console.error('donedoc 데이터를 가져오는 데 실패했습니다.'); |
|
152 |
+ } |
|
153 |
+ } catch (error) { |
|
154 |
+ console.error('donedoc 데이터를 가져오는 중 오류 발생:', error); |
|
155 |
+ } |
|
156 |
+}; |
|
140 | 157 |
return ( |
141 | 158 |
<View> |
142 | 159 |
{/* 라디오 버튼 컴포넌트 사용 */} |
--- kogas_app/yarn.lock
+++ kogas_app/yarn.lock
... | ... | @@ -2508,6 +2508,11 @@ |
2508 | 2508 |
inherits "^2.0.4" |
2509 | 2509 |
readable-stream "^3.4.0" |
2510 | 2510 |
|
2511 |
+boolbase@^1.0.0: |
|
2512 |
+ version "1.0.0" |
|
2513 |
+ resolved "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz" |
|
2514 |
+ integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== |
|
2515 |
+ |
|
2511 | 2516 |
brace-expansion@^1.1.7: |
2512 | 2517 |
version "1.1.11" |
2513 | 2518 |
resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" |
... | ... | @@ -2876,6 +2881,30 @@ |
2876 | 2881 |
resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz" |
2877 | 2882 |
integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q== |
2878 | 2883 |
|
2884 |
+css-select@^5.1.0: |
|
2885 |
+ version "5.1.0" |
|
2886 |
+ resolved "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz" |
|
2887 |
+ integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg== |
|
2888 |
+ dependencies: |
|
2889 |
+ boolbase "^1.0.0" |
|
2890 |
+ css-what "^6.1.0" |
|
2891 |
+ domhandler "^5.0.2" |
|
2892 |
+ domutils "^3.0.1" |
|
2893 |
+ nth-check "^2.0.1" |
|
2894 |
+ |
|
2895 |
+css-tree@^1.1.3: |
|
2896 |
+ version "1.1.3" |
|
2897 |
+ resolved "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz" |
|
2898 |
+ integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q== |
|
2899 |
+ dependencies: |
|
2900 |
+ mdn-data "2.0.14" |
|
2901 |
+ source-map "^0.6.1" |
|
2902 |
+ |
|
2903 |
+css-what@^6.1.0: |
|
2904 |
+ version "6.1.0" |
|
2905 |
+ resolved "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz" |
|
2906 |
+ integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== |
|
2907 |
+ |
|
2879 | 2908 |
csstype@^3.0.2: |
2880 | 2909 |
version "3.1.2" |
2881 | 2910 |
resolved "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz" |
... | ... | @@ -3026,6 +3055,36 @@ |
3026 | 3055 |
dependencies: |
3027 | 3056 |
esutils "^2.0.2" |
3028 | 3057 |
|
3058 |
+dom-serializer@^2.0.0: |
|
3059 |
+ version "2.0.0" |
|
3060 |
+ resolved "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz" |
|
3061 |
+ integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== |
|
3062 |
+ dependencies: |
|
3063 |
+ domelementtype "^2.3.0" |
|
3064 |
+ domhandler "^5.0.2" |
|
3065 |
+ entities "^4.2.0" |
|
3066 |
+ |
|
3067 |
+domelementtype@^2.3.0: |
|
3068 |
+ version "2.3.0" |
|
3069 |
+ resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz" |
|
3070 |
+ integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== |
|
3071 |
+ |
|
3072 |
+domhandler@^5.0.2, domhandler@^5.0.3: |
|
3073 |
+ version "5.0.3" |
|
3074 |
+ resolved "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz" |
|
3075 |
+ integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== |
|
3076 |
+ dependencies: |
|
3077 |
+ domelementtype "^2.3.0" |
|
3078 |
+ |
|
3079 |
+domutils@^3.0.1: |
|
3080 |
+ version "3.1.0" |
|
3081 |
+ resolved "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz" |
|
3082 |
+ integrity sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA== |
|
3083 |
+ dependencies: |
|
3084 |
+ dom-serializer "^2.0.0" |
|
3085 |
+ domelementtype "^2.3.0" |
|
3086 |
+ domhandler "^5.0.3" |
|
3087 |
+ |
|
3029 | 3088 |
[email protected]: |
3030 | 3089 |
version "1.1.1" |
3031 | 3090 |
resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" |
... | ... | @@ -3050,6 +3109,11 @@ |
3050 | 3109 |
version "1.0.2" |
3051 | 3110 |
resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz" |
3052 | 3111 |
integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== |
3112 |
+ |
|
3113 |
+entities@^4.2.0: |
|
3114 |
+ version "4.5.0" |
|
3115 |
+ resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz" |
|
3116 |
+ integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== |
|
3053 | 3117 |
|
3054 | 3118 |
envinfo@^7.7.2: |
3055 | 3119 |
version "7.10.0" |
... | ... | @@ -4864,6 +4928,11 @@ |
4864 | 4928 |
dependencies: |
4865 | 4929 |
tmpl "1.0.5" |
4866 | 4930 |
|
4931 |
[email protected]: |
|
4932 |
+ version "2.0.14" |
|
4933 |
+ resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz" |
|
4934 |
+ integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow== |
|
4935 |
+ |
|
4867 | 4936 |
memoize-one@^5.0.0: |
4868 | 4937 |
version "5.2.1" |
4869 | 4938 |
resolved "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz" |
... | ... | @@ -5556,6 +5625,13 @@ |
5556 | 5625 |
dependencies: |
5557 | 5626 |
path-key "^3.0.0" |
5558 | 5627 |
|
5628 |
+nth-check@^2.0.1: |
|
5629 |
+ version "2.1.1" |
|
5630 |
+ resolved "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz" |
|
5631 |
+ integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== |
|
5632 |
+ dependencies: |
|
5633 |
+ boolbase "^1.0.0" |
|
5634 |
+ |
|
5559 | 5635 |
nullthrows@^1.1.1: |
5560 | 5636 |
version "1.1.1" |
5561 | 5637 |
resolved "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz" |
... | ... | @@ -6044,6 +6120,19 @@ |
6044 | 6120 |
react-freeze "^1.0.0" |
6045 | 6121 |
warn-once "^0.1.0" |
6046 | 6122 |
|
6123 |
+react-native-sensitive-info@^5.5.8: |
|
6124 |
+ version "5.5.8" |
|
6125 |
+ resolved "https://registry.npmjs.org/react-native-sensitive-info/-/react-native-sensitive-info-5.5.8.tgz" |
|
6126 |
+ integrity sha512-p99oaEW4QG1RdUNrkvd/c6Qdm856dQw/Rk81f9fA6Y3DlPs6ADNdU+jbPuTz3CcOUJwuKBDNenX6LR9KfmGFEg== |
|
6127 |
+ |
|
6128 |
+react-native-svg@^13.14.0: |
|
6129 |
+ version "13.14.0" |
|
6130 |
+ resolved "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.14.0.tgz" |
|
6131 |
+ integrity sha512-27ZnxUkHgWICimhuj6MuqBkISN53lVvgWJB7pIypjXysAyM+nqgQBPh4vXg+7MbqLBoYvR4PiBgKfwwGAqVxHg== |
|
6132 |
+ dependencies: |
|
6133 |
+ css-select "^5.1.0" |
|
6134 |
+ css-tree "^1.1.3" |
|
6135 |
+ |
|
6047 | 6136 |
react-native-vector-icons@^10.0.0: |
6048 | 6137 |
version "10.0.0" |
6049 | 6138 |
resolved "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-10.0.0.tgz" |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?