moonyeju 2023-10-04
[add]
@24affc1adcc05b2e92dc9c2922b9a0a819bba8aa
kogas_app/package-lock.json
--- kogas_app/package-lock.json
+++ kogas_app/package-lock.json
@@ -21,6 +21,8 @@
         "react-native-reanimated": "^3.5.4",
         "react-native-safe-area-context": "^4.7.2",
         "react-native-screens": "^3.25.0",
+        "react-native-sensitive-info": "^5.5.8",
+        "react-native-svg": "^13.14.0",
         "react-native-vector-icons": "^10.0.0",
         "react-native-webview": "^13.6.0"
       },
@@ -5264,6 +5266,11 @@
         "safe-buffer": "~5.2.0"
       }
     },
+    "node_modules/boolbase": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
+      "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="
+    },
     "node_modules/brace-expansion": {
       "version": "1.1.11",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -5818,6 +5825,52 @@
       "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz",
       "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q=="
     },
+    "node_modules/css-select": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz",
+      "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==",
+      "dependencies": {
+        "boolbase": "^1.0.0",
+        "css-what": "^6.1.0",
+        "domhandler": "^5.0.2",
+        "domutils": "^3.0.1",
+        "nth-check": "^2.0.1"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/fb55"
+      }
+    },
+    "node_modules/css-tree": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
+      "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==",
+      "dependencies": {
+        "mdn-data": "2.0.14",
+        "source-map": "^0.6.1"
+      },
+      "engines": {
+        "node": ">=8.0.0"
+      }
+    },
+    "node_modules/css-tree/node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/css-what": {
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz",
+      "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==",
+      "engines": {
+        "node": ">= 6"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/fb55"
+      }
+    },
     "node_modules/csstype": {
       "version": "3.1.2",
       "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
@@ -6037,6 +6090,57 @@
         "node": ">=6.0.0"
       }
     },
+    "node_modules/dom-serializer": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
+      "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
+      "dependencies": {
+        "domelementtype": "^2.3.0",
+        "domhandler": "^5.0.2",
+        "entities": "^4.2.0"
+      },
+      "funding": {
+        "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
+      }
+    },
+    "node_modules/domelementtype": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
+      "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/fb55"
+        }
+      ]
+    },
+    "node_modules/domhandler": {
+      "version": "5.0.3",
+      "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
+      "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
+      "dependencies": {
+        "domelementtype": "^2.3.0"
+      },
+      "engines": {
+        "node": ">= 4"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/domhandler?sponsor=1"
+      }
+    },
+    "node_modules/domutils": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz",
+      "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==",
+      "dependencies": {
+        "dom-serializer": "^2.0.0",
+        "domelementtype": "^2.3.0",
+        "domhandler": "^5.0.3"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/domutils?sponsor=1"
+      }
+    },
     "node_modules/ee-first": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@@ -6075,6 +6179,17 @@
       "license": "MIT",
       "engines": {
         "node": ">= 0.8"
+      }
+    },
+    "node_modules/entities": {
+      "version": "4.5.0",
+      "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
+      "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
+      "engines": {
+        "node": ">=0.12"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/entities?sponsor=1"
       }
     },
     "node_modules/envinfo": {
@@ -9440,6 +9555,11 @@
         "tmpl": "1.0.5"
       }
     },
+    "node_modules/mdn-data": {
+      "version": "2.0.14",
+      "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz",
+      "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow=="
+    },
     "node_modules/memoize-one": {
       "version": "5.2.1",
       "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz",
@@ -10352,6 +10472,17 @@
         "node": ">=8"
       }
     },
+    "node_modules/nth-check": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
+      "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
+      "dependencies": {
+        "boolbase": "^1.0.0"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/nth-check?sponsor=1"
+      }
+    },
     "node_modules/nullthrows": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz",
@@ -11147,6 +11278,24 @@
         "react-native": "*"
       }
     },
+    "node_modules/react-native-sensitive-info": {
+      "version": "5.5.8",
+      "resolved": "https://registry.npmjs.org/react-native-sensitive-info/-/react-native-sensitive-info-5.5.8.tgz",
+      "integrity": "sha512-p99oaEW4QG1RdUNrkvd/c6Qdm856dQw/Rk81f9fA6Y3DlPs6ADNdU+jbPuTz3CcOUJwuKBDNenX6LR9KfmGFEg=="
+    },
+    "node_modules/react-native-svg": {
+      "version": "13.14.0",
+      "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.14.0.tgz",
+      "integrity": "sha512-27ZnxUkHgWICimhuj6MuqBkISN53lVvgWJB7pIypjXysAyM+nqgQBPh4vXg+7MbqLBoYvR4PiBgKfwwGAqVxHg==",
+      "dependencies": {
+        "css-select": "^5.1.0",
+        "css-tree": "^1.1.3"
+      },
+      "peerDependencies": {
+        "react": "*",
+        "react-native": "*"
+      }
+    },
     "node_modules/react-native-vector-icons": {
       "version": "10.0.0",
       "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
+++ kogas_app/package.json
@@ -23,6 +23,8 @@
     "react-native-reanimated": "^3.5.4",
     "react-native-safe-area-context": "^4.7.2",
     "react-native-screens": "^3.25.0",
+    "react-native-sensitive-info": "^5.5.8",
+    "react-native-svg": "^13.14.0",
     "react-native-vector-icons": "^10.0.0",
     "react-native-webview": "^13.6.0"
   },
kogas_app/src/components/Button.js
--- kogas_app/src/components/Button.js
+++ kogas_app/src/components/Button.js
@@ -1,19 +1,18 @@
-import { ActivityIndicator, Pressable, StyleSheet, Text } from 'react-native';
+import {ActivityIndicator, Pressable, StyleSheet, Text} from 'react-native';
 import PropTypes from 'prop-types';
-import { GRAY, PRIMARY, WHITE } from '../color';
+import {GRAY, PRIMARY, WHITE} from '../color';
 
-const Button = ({ title, onPress, disabled, isLoading }) => {
+const Button = ({title, onPress, disabled, isLoading}) => {
   return (
     <Pressable
       onPress={onPress}
-      style={({ pressed }) => [
+      style={({pressed}) => [
         styles.container,
-        { backgroundColor: PRIMARY.DEFAULT },
-        pressed && { backgroundColor: PRIMARY.DARK },
-        disabled && { backgroundColor: PRIMARY.LIGHT },
+        {backgroundColor: PRIMARY.DEFAULT},
+        pressed && {backgroundColor: PRIMARY.DARK},
+        disabled && {backgroundColor: PRIMARY.LIGHT},
       ]}
-      disabled={disabled}
-    >
+      disabled={disabled}>
       {isLoading ? (
         <ActivityIndicator size={'small'} color={GRAY} />
       ) : (
@@ -36,7 +35,7 @@
     borderRadius: 8,
     justifyContent: 'center',
     alignItems: 'center',
-    paddingVertical: 20,
+    paddingVertical: 15,
   },
   title: {
     color: WHITE,
 
kogas_app/src/components/CircularProgressBar.js (added)
+++ kogas_app/src/components/CircularProgressBar.js
@@ -0,0 +1,71 @@
+import React from 'react';
+import { View, StyleSheet } from 'react-native';
+import { Circle, G, Svg, Text } from 'react-native-svg';
+import { BLACK } from '../color';
+
+const CircularProgressBar = ({ percentage }) => {
+  // 원의 반지름
+  const radius = 30;
+
+  // 원의 중심 좌표
+  const centerX = radius + 5; // X 좌표
+  const centerY = radius + 5; // Y 좌표
+
+  // 원의 둘레
+  const circumference = 2 * Math.PI * radius;
+
+  // 원의 시작 각도 (12시 방향이 0도)
+  const startAngle = -Math.PI / 2;
+
+  // 퍼센티지에 따른 끝 각도 계산
+  const endAngle = startAngle + (percentage / 100) * (2 * Math.PI);
+
+  return (
+    <View style={styles.container}>
+      <Svg width={2 * (radius + 5)} height={2 * (radius + 5)}>
+        <G>
+          {/* 배경 원 */}
+          <Circle
+            r={radius}
+            cx={centerX}
+            cy={centerY}
+            fill="none"
+            stroke="#ddd"
+            strokeWidth={10}
+          />
+          {/* 원형 그래프 */}
+          <Circle
+            r={radius}
+            cx={centerX}
+            cy={centerY}
+            fill="none"
+            stroke="#007AFF" // 원형 그래프의 색상
+            strokeWidth={10} // 원형 그래프의 두께
+            strokeDasharray={`${circumference}, ${circumference}`}
+            strokeDashoffset={circumference - (percentage / 100) * circumference}
+          />
+          {/* 텍스트 */}
+          <Text
+            x={centerX - 7}
+            y={centerY + 5} // 텍스트 위치 조절
+            fontSize="15"
+            textAnchor="middle"
+            fill={BLACK} // 텍스트 색상
+          >
+            {percentage}%
+          </Text>
+        </G>
+      </Svg>
+    </View>
+  );
+};
+
+const styles = StyleSheet.create({
+  container: {
+    alignItems: 'center',
+    justifyContent: 'center',
+    marginRight:10,
+  },
+});
+
+export default CircularProgressBar;
kogas_app/src/components/DetailListItem.js
--- kogas_app/src/components/DetailListItem.js
+++ kogas_app/src/components/DetailListItem.js
@@ -1,9 +1,21 @@
 import {Pressable, StyleSheet, Text, View} from 'react-native';
 import {memo} from 'react';
-import {useNavigation} from '@react-navigation/native';
+import { useNavigation } from '@react-navigation/native';
+import { useEffect, useState } from 'react';
 
 const DetailListItem = memo(({name, item}) => {
   const navigation = useNavigation();
+  const [statusMessage, setStatusMessage] = useState('');
+
+  useEffect(() => {
+    if (item.status === 'Y') {
+      setStatusMessage("서명완료");
+    } else if (item.status === 'N') {
+      setStatusMessage("진행중");
+    } else if (item.status === 'X') {
+      setStatusMessage("반려");
+  }
+  }, [statusMessage]);
   return (
     <Pressable>
       <View style={styles.container}>
@@ -13,8 +25,8 @@
         </View>
 
         <View style={styles.right}>
-            <Text>{item.status}</Text>
-            <Text>{item.date}</Text>
+            <Text>{statusMessage}</Text>
+          <Text>{item.datetime}</Text>
         </View>
       </View>
     </Pressable>
kogas_app/src/components/ListItem.js
--- kogas_app/src/components/ListItem.js
+++ kogas_app/src/components/ListItem.js
@@ -2,32 +2,45 @@
 import {memo} from 'react';
 import {useNavigation} from '@react-navigation/native';
 import { BLACK } from '../color';
+import { useEffect, useState } from 'react';
 
 const ListItem = memo(({name, item}) => {
   const navigation = useNavigation();
+  const [stageMessage, setStageMessage] = useState('');
+
+  useEffect(() => {
+  if (item.stage === 0) {
+    setStageMessage('서명 진행중');
+  } else if (item.stage === -1) {
+    setStageMessage('반려 처리');
+  } else if (item.stage >= 1) {
+    setStageMessage(`${item.stage}차 서명완료`);
+  }
+  }, [stageMessage]);
+  
   return (
     <Pressable
       onPress={() => {
-          navigation.navigate('ListDetail', {
-            status: item.status,
-            title: item.title,
-            department: item.department,
-            name: item.name,
-            registrationDate: item.registrationDate,
-            content: item.content,
+        navigation.navigate('ListDetail', {
+            document_id: item.document_id,
+            document_name: item.document_name,
+            main_department: item.main_department,
+            reg_date: item.reg_date,
+            name: item.name, 
+            stage: stageMessage
           });
     }}
     hitSlop={10}
     >
       <View style={styles.container}>
         <View>
-          <Text>{item.status}</Text>
-          <Text>제목: {item.title}</Text>
-          <Text>기안자: {item.department} {item.name}</Text>
+          <Text>{stageMessage}</Text>
+          <Text>제목: {item.document_name}</Text>
+          <Text>기안자: {item.main_department} {item.name}</Text>
         </View>
 
         <View>
-          <Text>기안일자: {item.registrationDate}</Text>
+          <Text>기안일자: {item.reg_date}</Text>
         </View>
       </View>
     </Pressable>
kogas_app/src/components/TextInput.js
--- kogas_app/src/components/TextInput.js
+++ kogas_app/src/components/TextInput.js
@@ -1,7 +1,7 @@
 import {StyleSheet, Text, TextInput, View} from 'react-native';
 import PropTypes from 'prop-types';
 import {forwardRef, useState} from 'react';
-import {GRAY, BLACK, PRIMARY} from '../color';
+import {GRAY, BLACK, PRIMARY, WHITE} from '../color';
 import Icon from 'react-native-vector-icons/Ionicons';
 
 export const ReturnKeyTypes = {
@@ -10,64 +10,57 @@
 };
 
 export const IconNames = {
-  ID: 'lock-closed-outline',
-  PASSWORD: 'lock-closed-outline',
+  ID: 'mail',
+  PASSWORD: 'lock-closed',
 };
 
-const Input = forwardRef(
-  ({title, placeholder, value, iconName, ...props}, ref) => {
-    const [isFocused, setIsFocused] = useState(false);
+const Input = forwardRef(({placeholder, value, iconName, ...props}, ref) => {
+  const [isFocused, setIsFocused] = useState(false);
 
-    return (
-      <View style={styles.container}>
-        <Text
+  return (
+    <View style={styles.container}>
+      <View>
+        <TextInput
+          ref={ref}
+          {...props}
+          value={value}
           style={[
-            styles.title, // default
-            value && styles.hasValueTitle, // value
-            isFocused && styles.focusedTitle, // value + focus
-          ]}>
-          {title}
-        </Text>
-        <View>
-          <TextInput
-            ref={ref}
-            {...props}
-            value={value}
-            style={[
-              styles.input,
-              iconName && {paddingLeft: 30},
-              value && styles.hasValueInput,
-              isFocused && styles.focusedInput,
-            ]}
-            autoCapitalize={'none'}
-            autoCorrect={false}
-            textContentType={'none'}
-            keyboardAppearance={'light'}
-            onBlur={() => setIsFocused(false)}
-            onFocus={() => setIsFocused(true)}
-          />
+            styles.input,
+            iconName && {paddingLeft: 50},
+            value && styles.hasValueInput,
+            isFocused && styles.focusedInput,
+          ]}
+          autoCapitalize={'none'}
+          autoCorrect={false}
+          autoCompleteType={'off'}
+          textContentType={'none'}
+          keyboardAppearance={'light'}
+          onBlur={() => setIsFocused(false)}
+          onFocus={() => setIsFocused(true)}
+          placeholder={placeholder}
+        />
 
-          <View style={styles.icon}>
-            <Icon
-              name={iconName}
-              size={20}
-              // color={(() => {
-              //   switch (true) {
-              //     case isFocused:
-              //       return PRIMARY.DEFAULT;
-              //     case !!value:
-              //       return BLACK;
-              //     default:
-              //       return GRAY;
-              //   }
-              // })()}
-            />
-          </View>
+        <View style={styles.icon}>
+          <Icon
+            name={iconName}
+            size={20}
+            color={WHITE}
+            // color={(() => {
+            //   switch (true) {
+            //     case isFocused:
+            //       return PRIMARY.DEFAULT;
+            //     case !!value:
+            //       return BLACK;
+            //     default:
+            //       return GRAY;
+            //   }
+            // })()}
+          />
         </View>
       </View>
-    );
-  },
-);
+    </View>
+  );
+});
 Input.displayName = 'Input';
 
 Input.defaultProps = {
@@ -100,6 +93,8 @@
   },
   input: {
     borderWidth: 1,
+    borderRadius: 10,
+    borderColor: '#E7EEEE',
     // paddingHorizontal: 20,
     // height: 42,
     // paddingLeft: 5,
@@ -115,8 +110,13 @@
   },
   icon: {
     position: 'absolute',
+    width: 'auto',
     height: '100%',
     justifyContent: 'center',
+    backgroundColor: PRIMARY.DEFAULT,
+    padding: 10,
+    borderTopLeftRadius: 10,
+    borderBottomLeftRadius: 10,
   },
 });
 
 
kogas_app/src/img/logo.png (Binary) (added)
+++ kogas_app/src/img/logo.png
Binary file is not shown
kogas_app/src/navigations/BottomStack.js
--- kogas_app/src/navigations/BottomStack.js
+++ kogas_app/src/navigations/BottomStack.js
@@ -2,8 +2,6 @@
 import HomeScreen from '../screens/HomeScreen.js';
 import {PRIMARY, WHITE} from '../color';
 import Icon from 'react-native-vector-icons/Ionicons';
-
-import SignatureListScreen from '../screens/SignatureListScreen.js';
 import SettingsScreen from '../screens/SettingsScreen.js';
 import SignatureScreen from '../screens/SignatureScreen.js';
 
kogas_app/src/navigations/MainStack.js
--- kogas_app/src/navigations/MainStack.js
+++ kogas_app/src/navigations/MainStack.js
@@ -1,16 +1,41 @@
-import { Button,Text } from 'react-native';
+import { Button,Text ,View} from 'react-native';
 import { createStackNavigator } from '@react-navigation/stack';
 import BottomStack from './BottomStack';
 import ListDetailScreen from '../screens/ListDetailScreen';
 import {useNavigation} from '@react-navigation/native';
 import { PRIMARY } from '../color';
 import { TouchableOpacity } from 'react-native-gesture-handler';
+import { useEffect, useState } from 'react';
+import { url } from '../url';
 const Stack = createStackNavigator();
 
 
 const MainStack = () => {
   const navigation = useNavigation();
-  const a = '수요공급처 000';
+  const [user, setUser] = useState(''); 
+  const [department, setDepartment] = useState(''); 
+  useEffect(() => {
+     // 세션 정보를 가져옴
+    getSession();
+  }, []); // 여기에서는 세션 정보를 한 번만 가져오도록 수정
+
+  // 세션 정보를 가져오는 함수
+  const getSession = async () => {
+    try {
+      const response = await fetch(`${url}/`); // 세션 정보를 가져오는 엔드포인트로 변경
+      if (response.ok) {
+        const data = await response.json();
+        console.log('서버에서 받은 세션 정보mainstack:', data);
+        setUser(data.user);
+        setDepartment(data.department);
+      } else {
+        console.error('세션 정보를 가져오는 데 실패했습니다.');
+      }
+    } catch (error) {
+      console.error('오류:', error);
+    }
+  };
+  
   return (
       <Stack.Navigator initialRouteName="BottomHome" screenOptions={{
         title: 'KOGAS',
@@ -20,7 +45,8 @@
       headerTitleStyle: { fontWeight: '700' },
         headerRight: () => (
     <TouchableOpacity onPress={() => {/* 오른쪽 헤더 버튼 눌렀을 때 수행할 동작 */}}>
-      <Text>{a}</Text>
+            <View><Text>{department}</Text>
+            <Text>{user}</Text></View>
     </TouchableOpacity>
   ),
       }}>
kogas_app/src/navigations/index.js
--- kogas_app/src/navigations/index.js
+++ kogas_app/src/navigations/index.js
@@ -1,23 +1,50 @@
-import {NavigationContainer} from '@react-navigation/native';
-import {createStackNavigator} from '@react-navigation/stack';
-import React, {useEffect} from 'react';
+import { NavigationContainer } from '@react-navigation/native';
+import { createStackNavigator } from '@react-navigation/stack';
+import React, { useEffect, useState } from 'react';
 import SignInScreen from '../screens/SignInScreen';
 import MainStack from './MainStack';
-import PdfOpen from '../test/PdfOpen';
+import { url } from '../url';
 
 const RootStack = createStackNavigator();
 
 const Navigation = () => {
+  const [session, setSession] = useState(''); // 세션 정보가 유효한지 여부
+
+  useEffect(() => {
+     // 세션 정보를 가져옴
+    getSession();
+  }, []); // 여기에서는 세션 정보를 한 번만 가져오도록 수정
+
+  // 세션 정보를 가져오는 함수
+  const getSession = async () => {
+    try {
+      const response = await fetch(`${url}/`); // 세션 정보를 가져오는 엔드포인트로 변경
+      if (response.ok) {
+        const data = await response.json();
+        console.log('서버에서 받은 세션 정보index:', data);
+        if (data) {
+        setSession(data.user);
+      }
+      } else {
+        console.error('세션 정보를 가져오는 데 실패했습니다.');
+      }
+    } catch (error) {
+      console.error('오류:', error);
+    }
+  };
+
   return (
     <NavigationContainer>
       <RootStack.Navigator
-        initialRouteName="Main"
-        screenOptions={{ headerShown: false }}>
-        <RootStack.Screen name="Login" component={SignInScreen}/>
+        //initialRouteName={session!==undefined ? 'Main' : 'Login'}  // 세션 정보에 따라 초기 라우트 설정
+        initialRouteName={'Login'}  // 세션 정보에 따라 초기 라우트 설정
+        screenOptions={{ headerShown: false }}
+      >
+        <RootStack.Screen name="Login" component={SignInScreen} />
         <RootStack.Screen name="Main" component={MainStack} />
-        {/* <RootStack.Screen name="Pdf" component={PdfOpen} /> */}
       </RootStack.Navigator>
     </NavigationContainer>
   );
 };
+
 export default Navigation;
kogas_app/src/screens/HomeScreen.js
--- kogas_app/src/screens/HomeScreen.js
+++ kogas_app/src/screens/HomeScreen.js
@@ -4,153 +4,89 @@
 import { FlatList } from 'react-native-gesture-handler';
 import ListItem from '../components/ListItem';
 import { useEffect, useState } from 'react';
+import { url } from '../url';
+import CircularProgressBar from '../components/CircularProgressBar';
 
 const HomeScreen = () => {
   const navigation = useNavigation();
-  const mydocs = {
-      id: 1,
-      status: '서명진행중', //상태
-      title: '모바일 구축사업 인수인계 협의2',
-      department: '수요공급처',
-      name: 'aa',
-      registrationDate: '2023-09-25', //등록 날짜
-      content: [{
-        department: '계약운용부',
-        name: 'aaa',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-      }, {
-        department: '발전영업부',
-        name: 'aaaa',
-        status: '서명 진행중',
-        date: '2023/09/25 15:00'
-        }]
-    }
-  const newdocs = {
-      id: 1,
-      status: '서명진행중', //상태
-      title: '모바일 구축사업 인수인계 협의2',
-      department: '수요공급처',
-      name: 'bb',
-      registrationDate: '2023-09-25', //등록 날짜
-      content: [{
-        department: '계약운용부',
-        name: 'bbb',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-      }, {
-        department: '계약운용부',
-        name: 'bbb',
-        status: '서명 진행중',
-        date: '2023/09/25 15:00'
-      },{
-        department: '발전영업부',
-        name: 'bbbb',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-        }]
-  }
-  const [mycount, setMyCount] = useState(0); // useState로 상태 변수 관리
-  const [newcount, setNewCount] = useState(0); // useState로 상태 변수 관리
+  const [list, setList] = useState([]);
+  const [signatureAll, setSignatureAll] = useState(0);
+  const [signatureClear, setSignatureClear] = useState(0);
+  const [recentAll, setRecentAll] = useState(0);
+  const [recentClear, setRecentClear] = useState(0);
+  const myperc = Math.floor((signatureClear / signatureAll) * 100);
+  const recentperc = Math.floor((recentClear / recentAll) * 100); 
 
-  const myperc = Math.floor((mycount / mydocs.content.length) * 100); // mycount 사용
-  const newperc = Math.floor((newcount / newdocs.content.length) * 100); // newcount 사용
-
-  useEffect(() => {
-    setMyCount(0); // 초기화
-    setNewCount(0); // 초기화
-    mydocs.content.forEach((item) => {
-      if (item.status === '서명완료') {
-        setMyCount((prevCount) => prevCount + 1); // 상태 업데이트
-      }
-    });
-
-    newdocs.content.forEach((item) => {
-      if (item.status === '서명완료') {
-        setNewCount((prevCount) => prevCount + 1); // 상태 업데이트
-      }
-    });
-  }, [mydocs, newdocs]);
+useEffect(() => {
+  getMainChart();
+}, [signatureAll, signatureClear, recentAll, recentClear]);
   
-  const List = [
-    {
-      id: 1,
-      status: '서명진행중', //상태
-      title: '모바일 구축사업 인수인계 협의2',
-      department: '수요공급처',
-      name: 'aaa',
-      registrationDate: '2023-09-25', //등록 날짜
-      content: [{
-        department: '계약운용부',
-        name: 'aaa',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-      }, {
-        department: '발전영업부',
-        name: 'bbb',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-        }]
-    },
-    {
-      id: 2,
-      status: '서명완료', //상태
-      title: '모바일 구축사업 인수인계 협의1',
-      department: '수요공급처',
-      name: 'bbb',
-      registrationDate: '2023-09-25', //등록 날짜
-      content: [{department: '발전영업부', name: 'bbb', status: '서명완료', date: '2023/09/25 15:00'}]
-    },
-  ];
+const getMainChart = async () => {
+  try {
+    const response = await fetch(`${url}/main_chart`, {
+      method: 'GET',
+      headers: {
+        'Content-Type': 'application/json',
+      },
+    })
+    if (response.ok) {
+      const data = await response.json();
+      //console.log('aalistpage:', data);
+      setSignatureAll(data.signature_all);
+      setSignatureClear(data.signature_clear);
+      setRecentAll(data.now_all);
+      setRecentClear(data.now_clear);
+      } else {
+      console.error('main_chart 데이터를 가져오는 데 실패했습니다.');
+    }
+  }catch (error) {
+      console.error('데이터를 가져오는 중 오류 발생:', error);
+    }
+  };
+  useEffect(() => {
+  getList();
+}, []);
+const getList = async () => {
+  try {
+    const response = await fetch(`${url}/list`, {
+      method: 'GET',
+      headers: {
+        'Content-Type': 'application/json',
+      },
+    })
+    if (response.ok) {
+      const data = await response.json();
+      //console.log('listpage:', data);
+      setList(data);
+    } else {
+      console.error('list 데이터를 가져오는 데 실패했습니다.');
+    }
+  } catch (error) {
+      console.error('데이터를 가져오는 중 오류 발생:', error);
+    }
+};
+
 
   return (
     <View style={styles.container}>
     <View style={styles.containerTop}>
       <Text style={styles.title}>내 진행 상황</Text>
-      <Pressable
-            onPress={() => {
-              navigation.navigate('ListDetail',{
-            status: mydocs.status,
-            title: mydocs.title,
-            department: mydocs.department,
-            name: mydocs.name,
-            registrationDate: mydocs.registrationDate,
-            content: mydocs.content,
-          });
-            }}
-        hitSlop={10}
-        style={styles.mydocs}
-      >
-        <View>
-          <Text>{myperc}%</Text><Text>내 문서 진행률</Text>
-          <Text>서명 대상자 {mydocs.content.length}명 중 {mycount}명이 서명을 완료하였습니다.</Text>
-        </View>
-      </Pressable>
-      <Pressable
-            onPress={() => {
-              navigation.navigate('ListDetail',{
-            status: newdocs.status,
-            title: newdocs.title,
-            department: newdocs.department,
-            name: newdocs.name,
-            registrationDate: newdocs.registrationDate,
-            content: newdocs.content,
-          });
-            }}
-        hitSlop={10}
-        style={styles.mydocs}
-      >
-        <View>
-          <Text>{newperc}%</Text><Text>최근 문서 진행률</Text>
-          <Text>서명 대상자 {newdocs.content.length}명 중 {newcount}명이 서명을 완료하였습니다.</Text>
-        </View>
-      </Pressable>
+        <View style={styles.mydocs}><CircularProgressBar percentage={myperc} />
+          <View style={styles.text}>
+            <Text>내 문서 진행률</Text>
+          <Text>서명 대상자 {signatureAll}명 중 {signatureClear}명이 서명을 완료하였습니다.</Text>
+        </View></View>
+        <View style={styles.mydocs}><CircularProgressBar percentage={recentperc} />
+          <View style={styles.text}>
+            <Text>내 문서 진행률</Text>
+          <Text>서명 대상자 {recentAll}명 중 {recentClear}명이 서명을 완료하였습니다.</Text>
+        </View></View>
     </View>
     <View style={styles.containerBottom}>
         <Text style={styles.title}>서명 이력</Text>
         <View>
         <FlatList
-        data={List}
+        data={list}
         renderItem={({item}) => (
           <ListItem name="HomeScreen" item={item} />
         )}
@@ -171,6 +107,7 @@
     
   },
   mydocs: {
+    flexDirection: 'row',
     borderWidth: 0.5,
     borderColor: GRAY,
     borderRadius: 10, 
@@ -185,6 +122,6 @@
     borderBottomColor: BLACK,
     paddingVertical: 5,
     marginHorizontal:10,
-  }
+  },
 });
 export default HomeScreen;
kogas_app/src/screens/ListDetailScreen.js
--- kogas_app/src/screens/ListDetailScreen.js
+++ kogas_app/src/screens/ListDetailScreen.js
@@ -1,38 +1,147 @@
-import {FlatList, StyleSheet, Text, View,Button} from 'react-native';
-import {GRAY} from '../color';
+import { FlatList, StyleSheet, Text, View, Button, Alert } from 'react-native';
+import { GRAY } from '../color';
 import DetailListItem from '../components/DetailListItem';
+import { useEffect, useState } from 'react';
+import { url } from '../url';
 
 const ListDetailScreen = ({ route, navigation }) => {
-  const {status} = route.params;
-  const { title } = route.params;
+  const { document_id } = route.params;
+  const { document_name } = route.params;
   const { name } = route.params;
-  const {department} = route.params;
-  const {registrationDate} = route.params;
-  const { content } = route.params;
+  const { main_department } = route.params;
+  const { reg_date } = route.params;
+  const { stage } = route.params;
+  const [user, setUser] = useState('');
+  const [department, setDepartment] = useState('');
+  const [list, setList] = useState([]);
+  const [actionType, setActionType] = useState(null); // 서명 완료, 승인, 반려 액션 타입
+
+  useEffect(() => {
+    // 세션 정보를 가져옴
+    getSession();
+  }, []); // 여기에서는 세션 정보를 한 번만 가져오도록 수정
+
+  // 세션 정보를 가져오는 함수
+  const getSession = async () => {
+    try {
+      const response = await fetch(`${url}/`); // 세션 정보를 가져오는 엔드포인트로 변경
+      if (response.ok) {
+        const data = await response.json();
+        console.log('서버에서 받은 세션 정보listdetail:', data);
+        setUser(data.user);
+        setDepartment(data.department);
+      } else {
+        console.error('세션 정보를 가져오는 데 실패했습니다.');
+      }
+    } catch (error) {
+      console.error('오류:', error);
+    }
+  };
+
+  useEffect(() => {
+    getList();
+  }, []);
+
+  const getList = async () => {
+    //await SInfo.getItem('SessionId', {}).then(sessionId => {
+    //if (sessionId) {
+    fetch(`${url}/show_sig`, {
+      method: 'POST',
+      body: JSON.stringify({
+        document_id: document_id
+      }),
+      headers: {
+        'Content-Type': 'application/json',
+        //Authorization: `Bearer ${sessionId}`, // 세션 아이디 사용
+      },
+    })
+      .then(response => response.json())
+      .then(data => {
+        console.log('listdetailpage:', data);
+        setList(data);
+      })
+      .catch(error => {
+        console.error(error);
+      });
+    //} else {
+    //  console.log('세션 아이디 없음');
+    //}
+    //});
+  };
+
+  // user와 department 정보를 기반으로 stage 정보를 필터링
+  const filteredItem = list.find(item => item.name === user && item.department === department);
+
+  // 서명 완료, 승인, 반려 여부에 따라 액션 타입 설정
+  useEffect(() => {
+    if (filteredItem) {
+      setActionType(filteredItem.status);
+    }
+  }, [filteredItem, actionType]);
+
+  // 승인 또는 반려 버튼 클릭 시
+  const handleApproveOrReject = (isApprove) => {
+    const message = isApprove ? '승인하시겠습니까?' : '반려하시겠습니까?';
+    Alert.alert(
+      '알림',
+      message,
+      [
+        {
+          text: '예',
+          onPress: () => {
+            // 승인 또는 반려 동작 처리
+            if (isApprove) {
+              // 승인 처리 로직
+              // ...
+              console.log('승인 처리');
+            } else {
+              // 반려 처리 로직
+              // ...
+              console.log('반려 처리');
+            }
+          }
+        },
+        {
+          text: '아니요',
+          style: 'cancel'
+        }
+      ]
+    );
+  };
+
   return (
-    
     <View style={styles.container}>
       <View>
-      <Text style={styles.title}>{status}</Text>
-      <Text style={styles.title}>{title}</Text>
-        <Text style={styles.date}>기안자: {department} {name}</Text>
-        <Text style={styles.date}>기안일자: {registrationDate}</Text>
+        <Text style={styles.title}>{stage}</Text>
+        <Text style={styles.title}>{document_name}</Text>
+        <Text style={styles.date}>기안자: {main_department} {name}</Text>
+        <Text style={styles.date}>기안일자: {reg_date}</Text>
       </View>
-      <Button title={'문서보기'}/> 
+      <Button title={'문서 보기'} />
       <View>
         <Text style={styles.v}>서명 정보</Text>
         <FlatList
-        data={content}
-        renderItem={({item}) => (
-          <DetailListItem name="ListDetailScreen" item={item} />
-        )}
-        windowSize={5}
-        ListHeaderComponent={View}
-        ListHeaderComponentStyle={{height: 10}}
+          data={list}
+          renderItem={({ item }) => (
+            <DetailListItem name="ListDetailScreen" item={item} />
+          )}
+          windowSize={5}
+          ListHeaderComponent={View}
+          ListHeaderComponentStyle={{ height: 10 }}
         />
-        <Button title={'??'}/> 
+        {actionType === 'Y' && (
+          <Button title={'서명 완료'} />
+        )}
+        {actionType === 'N' && (
+          <View>
+            <Button title={'승인'} onPress={() => handleApproveOrReject(true)} />
+            <Button title={'반려'} onPress={() => handleApproveOrReject(false)} />
+          </View>
+        )}
+        {actionType === 'X' && (
+          <Button title={'반려 처리'} />
+        )}
       </View>
-      
     </View>
   );
 };
@@ -42,33 +151,6 @@
     marginTop: 10,
     fontWeight: 'bold',
   }
-  // container: {
-  //   flex: 1,
-  // },
-  // title: {
-  //   fontSize: 20,
-  //   fontWeight: 'bold',
-  //   marginHorizontal: 10,
-  //   paddingVertical: 10,
-  //   paddingHorizontal: 30,
-  //   marginTop: 15,
-  // },
-  // content: {
-  //   fontSize: 15,
-  //   marginHorizontal: 25,
-  //   paddingVertical: 25,
-  // },
-  // date: {
-  //   fontSize: 15,
-  //   color: GRAY,
-  // },
-  // dateview: {
-  //   alignItems: 'flex-end',
-  //   marginHorizontal: 10,
-  //   paddingHorizontal: 10,
-  //   paddingVertical: 10,
-  //   borderBottomWidth: 1,
-  // },
 });
 
 export default ListDetailScreen;
kogas_app/src/screens/SettingsScreen.js
--- kogas_app/src/screens/SettingsScreen.js
+++ kogas_app/src/screens/SettingsScreen.js
@@ -1,15 +1,35 @@
-import { StyleSheet, Switch, Text, View } from 'react-native';
+import { Alert, StyleSheet, Switch, Text, View } from 'react-native';
 import PropTypes from 'prop-types';
 import { GRAY, PRIMARY, WHITE } from '../color';
 import { useState } from 'react';
 import Button from '../components/Button';
+import { url } from '../url';
 
-const SettingsScreen = ({navigation}) => {
+const SettingsScreen = ({ navigation }) => {
   const [alarm, setAlarm] = useState(false);
   const [dark, setDark] = useState(false);
 
   const toggleSwitchAlarm = () => setAlarm((previousState) => !previousState);
   const toggleSwitchDark = () => setDark((previousState) => !previousState);
+
+  const handleLogout = () => {
+    fetch(`${url}/logout`, {
+      method: 'POST',
+      credentials: 'same-origin'
+    })
+      .then((response) => {
+        console.log(response.status);
+        if (response.status === 200) {
+          navigation.navigate('Login');
+        } else {
+          Alert.alert('로그아웃 실패');
+        }
+      })
+      .catch((error) => {
+        console.error('로그아웃 중 오류 발생:', error);
+        Alert.alert('로그아웃 중 오류가 발생했습니다.');
+      });
+  };
 
   return (
     <View style={styles.container}>
@@ -26,41 +46,24 @@
             />
           </View>
         </View>
-        {alarm && ( // 알림 설정이 켜져 있을 때만 하단 텍스트를 표시
+        {alarm && (
           <View>
-            <Text>시간대별알림설정 여부</Text>
+            <Text>시간대별 알림 설정 여부</Text>
           </View>
         )}
-        {/* <View style={styles.textContainer}>
-          <Text style={styles.text}>다크 모드</Text>
-          <View style={styles.switchStyle}>
-            <Switch
-              trackColor={{ false: GRAY, true: PRIMARY.DEFAULT }}
-              thumbColor={WHITE}
-              ios_backgroundColor={GRAY}
-              onValueChange={toggleSwitchDark}
-              value={dark}
-            />
-          </View>
-        </View> */}
         <View style={styles.view}>
-          <Button
-              title={'기기등록'}
-          />
-          </View>
+          <Button title={'기기 등록'} onPress={() => {}} />
+        </View>
         <View style={styles.view}>
-          <Button
-            title={'로그아웃'}
-            onPress={() => {
-          navigation.navigate('Login');
-    }}
-          />
-          </View>
+          <Button title={'로그아웃'} onPress={handleLogout} />
+        </View>
       </View>
     </View>
   );
 };
+
 SettingsScreen.propTypes = {};
+
 const styles = StyleSheet.create({
   container: {
     flex: 1,
@@ -93,7 +96,7 @@
   },
   view: {
     margin: 15,
-    
-  }
+  },
 });
-export default SettingsScreen;
(파일 끝에 줄바꿈 문자 없음)
+
+export default SettingsScreen;
kogas_app/src/screens/SignInScreen.js
--- kogas_app/src/screens/SignInScreen.js
+++ kogas_app/src/screens/SignInScreen.js
@@ -37,33 +37,36 @@
         fetch(`${url}/login`, {
           method: 'POST',
           body: JSON.stringify({
-            id: email,
+            username: id,
             password: password,
           }),
           headers: {
             'Content-Type': 'application/json',
           },
         })
-          .then((response) => response.json())
-          .then(async (data) => {
-            //const token = data.token; // 토큰 추출
-            //console.log(token);
-
             try {
               //await SecureStore.setItemAsync('Token', token);
               // 로그인 성공 후 메인 화면으로 이동
-              navigation.navigate('Main');
+              console.log("성공")
+              Alert.alert('로그인 성공');
+              try {
+                const response = await fetch(`${url}/`); // 세션 정보를 가져오는 엔드포인트로 변경
+                if (response.ok) {
+                  console.log('세션성공');
+                    navigation.navigate('Main');
+                } else {
+                  console.error('세션 정보를 가져오는 데 실패했습니다.');
+                }
+              } catch (error) {
+                console.error('오류:', error);
+              }
             } catch (e) {
+              console.log("실패")
               Alert.alert('로그인 실패');
-              console.error('token 에러: ' + e);
               setIsLoading(false);
             }
-          })
-          .catch((error) => {
-            console.error('tokne 만료:' + error);
-            setIsLoading(false);
-          });
       } catch (e) {
+        console.log("실패")
         Alert.alert('로그인 실패', e, [
           {
             text: 'Ok',
@@ -78,12 +81,18 @@
   return (
     <TouchableWithoutFeedback onPress={handleDismissKeyboard}>
       <View style={styles.container}>
-        <Text style={styles.text}>스마트 전자서명 시스템</Text>
-        <View style={styles.view}>
+        <View style={styles.titleContainer}>
+          <Image source={require('../img/logo.png')} style={styles.image} />
+          <Text
+            style={[styles.textContainer, {alignSelf: 'center'}]}>
+            스마트 전자서명 시스템
+          </Text>
+        </View>
+        <View style={styles.viewContainer}>
           <TextInput
             value={id}
-            onChangeText={(text) => setId(text.trim())}
-            title={'아이디'}
+            onChangeText={text => setId(text.trim())}
+            placeholder={'아이디'}
             returnKeyType={ReturnKeyTypes.NEXT}
             iconName={IconNames.ID}
             onSubmitEditing={() => passwordRef.current.focus()}
@@ -91,8 +100,8 @@
           <TextInput
             ref={passwordRef}
             value={password}
-            onChangeText={(text) => setPassword(text.trim())}
-            title={'비밀번호'}
+            onChangeText={text => setPassword(text.trim())}
+            placeholder={'비밀번호'}
             secureTextEntry
             iconName={IconNames.PASSWORD}
             onSubmitEditing={onSubmit}
@@ -118,33 +127,40 @@
 const styles = StyleSheet.create({
   container: {
     flex: 1,
-    justifyContent: 'center',
+    paddingTop: 20,
+    justifyContent: 'flex-start',
     alignItems: 'center',
   },
-  view: {
-    width: '70%',
+  titleContainer: {
+    width: '100%',
+    flex: 1,
+    justifyContent: 'center',
+    alignItems: 'center',
+    marginTop: 50,
   },
-  view2: {
-    width: '65%',
+  image: {
+    flex: 1,
+    width: '60%',
+    resizeMode: 'contain',
+    justifyContent: 'flex-end',
+    alignItems: 'center',
+  },
+  viewContainer: {
+    flex: 2,
+    width: '90%',
   },
   buttonContainer: {
     padding: 5,
     marginTop: 10,
   },
   textContainer: {
+    flex: 1,
     padding: 10,
-    flexDirection: 'row',
     alignItems: 'center',
-    fontSize: 5,
-    justifyContent: 'space-evenly',
+    fontSize: 30,
+    justifyContent: 'flex-start',
+    fontWeight: '900',
   },
-  text: {
-    fontSize: 25,
-    padding: 30,
-    fontWeight: 'bold',
-  },
-
-  line: { flex: 1, height: 1, backgroundColor: 'black' },
 });
 
 export default SignInScreen;
 
kogas_app/src/screens/SignatureListScreen.js (deleted)
--- kogas_app/src/screens/SignatureListScreen.js
@@ -1,57 +0,0 @@
-// import {FlatList, StyleSheet, View} from 'react-native';
-// import ListItem from '../components/ListItem';
-// import EmptyList from '../components/EmptyList';
-
-// const SignatureListScreen = () => {
-//   const List = [
-//     {
-//       id: 1,
-//       status: '서명진행중', //상태
-//       title: '제목',
-//       writer: '작성자',
-//       registrationDate: '2023-09-25', //등록 날짜
-//       content: [{
-//         department: '계약운용부',
-//         name: 'aaa',
-//         status: '서명완료',
-//         date: '2023/09/25 15:00'
-//       }, {
-//         department: '발전영업부',
-//         name: 'bbb',
-//         status: '서명완료',
-//         date: '2023/09/25 15:00'
-//         }]
-//     },
-//     {
-//       id: 2,
-//       status: '서명완료', //상태
-//       title: '제목',
-//       writer: '작성자',
-//       registrationDate: '2023-09-25', //등록 날짜
-//       content: [{department: '발전영업부', name: 'bbb', status: '서명완료', date: '2023/09/25 15:00'}]
-//     },
-//   ];
-//   return List.length ? (
-//     <View style={styles.container}>
-//       <FlatList
-//         data={List}
-//         renderItem={({item}) => (
-//           <ListItem name="SignatureListScreen" item={item} />
-//         )}
-//         windowSize={5}
-//         ListHeaderComponent={View}
-//         ListHeaderComponentStyle={{height: 10}}
-//       />
-//     </View>
-//   ) : (
-//     <EmptyList />
-//   );
-// };
-
-// const styles = StyleSheet.create({
-//   container: {
-//     flex: 1,
-//   },
-// });
-
-// export default SignatureListScreen;
kogas_app/src/screens/SignatureScreen.js
--- kogas_app/src/screens/SignatureScreen.js
+++ kogas_app/src/screens/SignatureScreen.js
@@ -2,6 +2,7 @@
 import { View, Text, TouchableOpacity } from 'react-native';
 import { FlatList } from 'react-native-gesture-handler';
 import ListItem from '../components/ListItem';
+import { url } from '../url';
 
 // 라디오 버튼 컴포넌트
 const RadioButton = ({ options, selectedOption, onSelect }) => {
@@ -34,109 +35,125 @@
 
 // 예제 앱
 const SignatureScreen = () => {
-    const List0 = [
-    {
-      id: 1,
-      status: '서명진행중', //상태
-      title: '모바일 구축사업 인수인계 협의2',
-      department: '수요공급처',
-      name: 'aaa',
-      registrationDate: '2023-09-25', //등록 날짜
-      content: [{
-        department: '계약운용부',
-        name: 'aaa',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-      }, {
-        department: '발전영업부',
-        name: 'bbb',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-        }]
-    },
-    {
-      id: 2,
-      status: '서명완료', //상태
-      title: '모바일 구축사업 인수인계 협의1',
-      department: '수요공급처',
-      name: 'aaa',
-      registrationDate: '2023-09-25', //등록 날짜
-      content: [{department: '발전영업부', name: 'bbb', status: '서명완료', date: '2023/09/25 15:00'}]
-    },
-    ];
-    const List1 = [
-    {
-      id: 1,
-      status: '서명진행중', //상태
-      title: '모바일 구축사업 인수인계 협의2',
-      department: '수요공급처',
-      name: 'bbb',
-      registrationDate: '2023-09-25', //등록 날짜
-      content: [{
-        department: '계약운용부',
-        name: 'aaa',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-      }, {
-        department: '발전영업부',
-        name: 'bbb',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-        }]
-    },
-    {
-      id: 2,
-      status: '서명완료', //상태
-      title: '모바일 구축사업 인수인계 협의1',
-      department: '수요공급처',
-      name: 'bbb',
-      registrationDate: '2023-09-25', //등록 날짜
-      content: [{department: '발전영업부', name: 'bbb', status: '서명완료', date: '2023/09/25 15:00'}]
-    },
-    ];
-    const List2 = [
-    {
-      id: 1,
-      status: '서명진행중', //상태
-      title: '모바일 구축사업 인수인계 협의2',
-      department: '수요공급처',
-      name: 'ccc',
-      registrationDate: '2023-09-25', //등록 날짜
-      content: [{
-        department: '계약운용부',
-        name: 'aaa',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-      }, {
-        department: '발전영업부',
-        name: 'bbb',
-        status: '서명완료',
-        date: '2023/09/25 15:00'
-        }]
-    },
-  ];
+  //const [myList, setMyList] = useState([]);
+  //const [proceedingList, setProceedingList] = useState([]);
+  //const [doneList, setDoneList] = useState([]);
+  const [user, setUser] = useState('');
   const options = ['내 기안', '진행 문서', '완료 문서'];
   const [selectedOption, setSelectedOption] = useState(null);
-    const [selectedList, setSelectedList] = useState([]);
+  const [selectedList, setSelectedList] = useState([]);
     useEffect(() => {
-    if (selectedOption === null && options.length > 0) {
-        setSelectedOption(options[0]);
-        setSelectedList(List0);
-    }
-  }, []);
+      if (user !== '') {
+        if (selectedOption === null && options.length > 0) {
+          getMyDoc();
+          setSelectedOption(options[0]);
+        }
+      }  else {
+        console.log("user 없음")
+      }
+    }, [user,selectedList]);
+  
   // 옵션 선택 시 호출되는 함수
   const handleSelect = (option,index) => {
       setSelectedOption(option);
       // 선택된 옵션에 따라 다른 리스트 데이터를 설정
     if (index === 0) {
-      setSelectedList(List0);
+      getMyDoc();
     } else if (index === 1) {
-      setSelectedList(List1);
+      getProceedingDoc();
     } else if (index === 2) {
-      setSelectedList(List2);
+      getDoneDoc();
+    }
+  };
+  useEffect(() => {
+    // 세션 정보를 가져옴
+    getSession();
+  }, []); // 여기에서는 세션 정보를 한 번만 가져오도록 수정
+
+  // 세션 정보를 가져오는 함수
+  const getSession = async () => {
+    try {
+      const response = await fetch(`${url}/`); // 세션 정보를 가져오는 엔드포인트로 변경
+      if (response.ok) {
+        const data = await response.json();
+        console.log('서버에서 받은 세션 정보signaturelist:', data);
+        setUser(data.user);
+        
+      } else {
+        console.error('세션 정보를 가져오는 데 실패했습니다.');
+      }
+    } catch (error) {
+      console.error('오류:', error);
+    }
+  };
+  
+const getMyDoc = async () => {
+  console.log('mydoc user signaturelist:',user);
+    try {
+      const response = await fetch(`${url}/my_doc`, {
+        method: 'POST',
+        body: JSON.stringify({
+          user_id: user,
+        }),
+        headers: {
+          'Content-Type': 'application/json',
+        },
+      });
+      if (response.ok) {
+        const data = await response.json();
+        console.log("my"+data);
+        setSelectedList(data);
+      } else {
+        console.error('mydoc 데이터를 가져오는 데 실패했습니다.',response);
+      }
+    } catch (error) {
+      console.error('mydoc 데이터를 가져오는 중 오류 발생:', error);
+    }
+};
+
+const getProceedingDoc = async () => {
+  try {
+    const response = await fetch(`${url}/trying_doc`, {
+      method: 'POST',
+      body: JSON.stringify({
+        user_id: user,
+      }),
+      headers: {
+        'Content-Type': 'application/json',
+      },
+    })
+    if (response.ok) {
+      const data = await response.json();
+      console.log("proceed"+data);
+      //console.log('listpage:', data);
+      setSelectedList(data);
+    } else {
+      console.error('proceedingdoc 데이터를 가져오는 데 실패했습니다.');
+    }
+  } catch (error) {
+      console.error('proceedingdoc 데이터를 가져오는 중 오류 발생:', error);
     }
   };
 
+const getDoneDoc = async () => {
+  try {
+    const response = await fetch(`${url}/done_doc`, {
+      method: 'GET',
+      headers: {
+        'Content-Type': 'application/json',
+      },
+    })
+    if (response.ok) {
+      const data = await response.json();
+      //console.log('listpage:', data);
+      setSelectedList(data);
+    } else {
+      console.error('donedoc 데이터를 가져오는 데 실패했습니다.');
+    }
+  } catch (error) {
+      console.error('donedoc 데이터를 가져오는 중 오류 발생:', error);
+    }
+};
     return (
     <View>
       {/* 라디오 버튼 컴포넌트 사용 */}
kogas_app/yarn.lock
--- kogas_app/yarn.lock
+++ kogas_app/yarn.lock
@@ -2508,6 +2508,11 @@
     inherits "^2.0.4"
     readable-stream "^3.4.0"
 
+boolbase@^1.0.0:
+  version "1.0.0"
+  resolved "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz"
+  integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==
+
 brace-expansion@^1.1.7:
   version "1.1.11"
   resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz"
@@ -2876,6 +2881,30 @@
   resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz"
   integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==
 
+css-select@^5.1.0:
+  version "5.1.0"
+  resolved "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz"
+  integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==
+  dependencies:
+    boolbase "^1.0.0"
+    css-what "^6.1.0"
+    domhandler "^5.0.2"
+    domutils "^3.0.1"
+    nth-check "^2.0.1"
+
+css-tree@^1.1.3:
+  version "1.1.3"
+  resolved "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz"
+  integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==
+  dependencies:
+    mdn-data "2.0.14"
+    source-map "^0.6.1"
+
+css-what@^6.1.0:
+  version "6.1.0"
+  resolved "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz"
+  integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==
+
 csstype@^3.0.2:
   version "3.1.2"
   resolved "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz"
@@ -3026,6 +3055,36 @@
   dependencies:
     esutils "^2.0.2"
 
+dom-serializer@^2.0.0:
+  version "2.0.0"
+  resolved "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz"
+  integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==
+  dependencies:
+    domelementtype "^2.3.0"
+    domhandler "^5.0.2"
+    entities "^4.2.0"
+
+domelementtype@^2.3.0:
+  version "2.3.0"
+  resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz"
+  integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==
+
+domhandler@^5.0.2, domhandler@^5.0.3:
+  version "5.0.3"
+  resolved "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz"
+  integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==
+  dependencies:
+    domelementtype "^2.3.0"
+
+domutils@^3.0.1:
+  version "3.1.0"
+  resolved "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz"
+  integrity sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==
+  dependencies:
+    dom-serializer "^2.0.0"
+    domelementtype "^2.3.0"
+    domhandler "^5.0.3"
+
 [email protected]:
   version "1.1.1"
   resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz"
@@ -3050,6 +3109,11 @@
   version "1.0.2"
   resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz"
   integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==
+
+entities@^4.2.0:
+  version "4.5.0"
+  resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz"
+  integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==
 
 envinfo@^7.7.2:
   version "7.10.0"
@@ -4864,6 +4928,11 @@
   dependencies:
     tmpl "1.0.5"
 
[email protected]:
+  version "2.0.14"
+  resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz"
+  integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==
+
 memoize-one@^5.0.0:
   version "5.2.1"
   resolved "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz"
@@ -5556,6 +5625,13 @@
   dependencies:
     path-key "^3.0.0"
 
+nth-check@^2.0.1:
+  version "2.1.1"
+  resolved "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz"
+  integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==
+  dependencies:
+    boolbase "^1.0.0"
+
 nullthrows@^1.1.1:
   version "1.1.1"
   resolved "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz"
@@ -6044,6 +6120,19 @@
     react-freeze "^1.0.0"
     warn-once "^0.1.0"
 
+react-native-sensitive-info@^5.5.8:
+  version "5.5.8"
+  resolved "https://registry.npmjs.org/react-native-sensitive-info/-/react-native-sensitive-info-5.5.8.tgz"
+  integrity sha512-p99oaEW4QG1RdUNrkvd/c6Qdm856dQw/Rk81f9fA6Y3DlPs6ADNdU+jbPuTz3CcOUJwuKBDNenX6LR9KfmGFEg==
+
+react-native-svg@^13.14.0:
+  version "13.14.0"
+  resolved "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.14.0.tgz"
+  integrity sha512-27ZnxUkHgWICimhuj6MuqBkISN53lVvgWJB7pIypjXysAyM+nqgQBPh4vXg+7MbqLBoYvR4PiBgKfwwGAqVxHg==
+  dependencies:
+    css-select "^5.1.0"
+    css-tree "^1.1.3"
+
 react-native-vector-icons@^10.0.0:
   version "10.0.0"
   resolved "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-10.0.0.tgz"
Add a comment
List