Commit 368e8dbe authored by Spark's avatar Spark
Browse files

doe_array using form as=select

parent 4527d9d2
......@@ -34,6 +34,7 @@
"react-use": "^17.2.4",
"sass": "^1.35.1",
"sequelize": "^6.6.5",
"sweetalert2": "^11.0.19",
"web-vitals": "^1.1.2"
}
},
......@@ -20778,6 +20779,14 @@
"boolbase": "~1.0.0"
}
},
"node_modules/sweetalert2": {
"version": "11.0.19",
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.0.19.tgz",
"integrity": "sha512-fJkiIhvOjDux8Ns08uWNdWPcLql5tpMpiuc78sYLjY9zTBvkj7rvmPHHckdkAZLKVGUmOfy8ckDZ1ElS0lLpjw==",
"funding": {
"url": "https://sweetalert2.github.io/#donations"
}
},
"node_modules/symbol-tree": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
......@@ -39678,6 +39687,11 @@
}
}
},
"sweetalert2": {
"version": "11.0.19",
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.0.19.tgz",
"integrity": "sha512-fJkiIhvOjDux8Ns08uWNdWPcLql5tpMpiuc78sYLjY9zTBvkj7rvmPHHckdkAZLKVGUmOfy8ckDZ1ElS0lLpjw=="
},
"symbol-tree": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
......@@ -30,6 +30,7 @@
"react-use": "^17.2.4",
"sass": "^1.35.1",
"sequelize": "^6.6.5",
"sweetalert2": "^11.0.19",
"web-vitals": "^1.1.2"
},
"scripts": {
......
import React from 'react'
import React, { useEffect, useState } from 'react'
import '../App.css'
import { Form, Button, Row, Col, Card, DropdownButton, Dropdown, ButtonGroup } from 'react-bootstrap';
import { useState } from 'react';
import axios from 'axios';
// import { doeCode } from '../utils/Auth';
function LocCodeChange() {
......@@ -28,7 +26,6 @@ function LocCodeChange() {
padding: '10px'
}
const btnstyled2 = {
background: 'white',
margin: '1px',
......@@ -47,34 +44,32 @@ function LocCodeChange() {
auth.style.visibility = 'visible'
}
// console.log(typeof (locCode()))
// console.log(locCode())
// const [ddoe, setDdoe] = useState([])
// async function DoeCode() {
// await doeCode().then((res) => {
// // // // for (let i = 0; i < res.length; i++) {
// // // console.log(res[0]['code_doe'])
// // // console.log(0, res[0]['name_doe'])
// ddoe.push(res[0]['name_doe'])
// ddoe.push(res[1]['name_doe'])
// console.log(ddoe)
// console.log(typeof(ddoe))
// // // }
// })
// }
const res = axios.get("localhost:4500/d/loccode");
// const does = res.data["locCodes"]["DOE"] // object
const [does, setDoes] = useState([])
const [sggs, setSggs] = useState([])
// const [emds, setEmds] = useState([])
const does_array = []
const sggs_array = []
// const emds_array = []
does.map((doesObj) => does_array.push(doesObj['name_doe']))
sggs.map((sggsObj) => console.log(sggsObj['sgg']))
console.log('does :: ', does)
console.log('does_array:::', does_array)
async function getLocCode() {
const res = await axios.get("http://localhost:4500/api/data/loccode")
const local_codes = res.data.locCodes
console.log('local_codes::: ', local_codes)
setDoes(local_codes.DOE)
setSggs(local_codes.SGG)
}
useEffect(() => {
getLocCode()
}, [])
return (
<Row className='text-center w-100 my-2'>
{/* {DoeCode()} */}
{/* {data} */}
asd
<Card style={cardstyled}>
<Card.Title id='impactTitle'>
Local Code
......@@ -84,22 +79,34 @@ function LocCodeChange() {
</Card.Subtitle>
<hr />
<Card.Text>
<Form style={inboxstyled}>
<Row className='m-auto w-100 d-flex justify-content-center'>
<Col md={12} xs={12} style={{ padding: '0', display: 'flex', justifyContent: 'center', width: '100%' }}>
{['', '시군구', '읍면동'].map((localname) => (
<DropdownButton
variant='light'
style={btnstyled2}
title='지역코드'
as={ButtonGroup}
title={` ${localname} `}>
<Dropdown.Item></Dropdown.Item>
<Dropdown.Item>Another action</Dropdown.Item>
<Dropdown.Item>Something else here</Dropdown.Item>
</DropdownButton>
))}
<Form.Group style={btnstyled2}>
<Form.Control as='select' aria-label="Floating label select example">
<option></option>
{does.map((doe) => (
<option value={`${doe["code_doe"]}`}>
{`${doe["name_doe"]}`}</option>
))}
</Form.Control>
<Form.Control as='select' aria-label="Floating label select example">
<option>시군구</option>
{does.map((doe) => (
<option value={`${doe["code_doe"]}`}>
{`${doe["name_doe"]}`}</option>
))}
</Form.Control>
<Form.Control as='select' aria-label="Floating label select example">
<option>읍면동</option>
{does.map((doe) => (
<option value={`${doe["code_doe"]}`}>
{`${doe["name_doe"]}`}</option>
))}
</Form.Control>
</Form.Group>
<Button variant='light' style={btnstyled2} onClick={!locCodeShow && handleClickLoc}>확인</Button>
</Col>
<Col md={6} xs={4} id='loc-code' style={{
......@@ -109,8 +116,8 @@ function LocCodeChange() {
display: 'flex',
justifyContent: 'center',
padding: '2px',
visibility: 'hidden',
transition: 'all 4s'
// visibility: 'hidden',
transition: 'all 2s'
}}>
지역코드
</Col>
......
......@@ -31,7 +31,15 @@ function LoginComp() {
function CheckEmailSend() {
setEmailSent(!emailSent)
}
function addressUrl() {
localStorage.setItem('Email-Address', emailAddress)
const afterAt = localStorage.getItem('Email-Address').split('@')[1]
console.log(afterAt)
const newLink = 'https://www.' + afterAt;
window.open(newLink);
}
const [emailAddress, setEmailAddress] = useState('')
......@@ -41,7 +49,6 @@ function LoginComp() {
console.log(emailAddress)
}
const
return (
<Row className='text-center w-100 my-2'>
<Card style={cardstyled}>
......@@ -59,7 +66,7 @@ function LoginComp() {
<Col>
😍 이메일 전송이 완료 되었습니다.
</Col>
<Alert.Link href='/' target='_blank' style={{ fontSize: '0.8em' }}>
<Alert.Link href="" onClick={addressUrl} target='_blank' style={{ fontSize: '0.8em' }}>
이메일 확인 하러가기
</Alert.Link>
</Alert>
......@@ -68,6 +75,9 @@ function LoginComp() {
<Col>
😭 이메일을 정확하게 적어주세요.
</Col>
<Alert.Link href="/signup" target='_blank' style={{ fontSize: '0.8em' }}>
회원가입 하러가기
</Alert.Link>
</Alert>
}
<Button onClick={() => setAlertShow(true)}>보여주고</Button>
......@@ -77,7 +87,8 @@ function LoginComp() {
<Form.Group controlId="formBasicEmail">
<Form.Control type="email" placeholder="Email" onChange={handleChange} />
</Form.Group>
<Button variant='light' type="submit" id='formbtn' onClick={CheckEmailSend}>
<Button variant='light' id='formbtn' onClick={CheckEmailSend}>
LOGIN
</Button>
......
......@@ -38,6 +38,7 @@ function MainLayer() {
return (
<>
<Row className='d-flex align-items-center m-auto w-100'>
<Link to='/' className=' m-auto'>
<Image src='/images/EUE11.jpg' alt='EUE' style={boxstyled} />
......
......@@ -109,7 +109,7 @@ function SignupComp() {
<Button onClick={() => setAlertShow(true)}>보여주고</Button>
<Button onClick={() => setAlertShow(false)}>안보여주고</Button>
</Row>
<Form style={inboxstyled}
onSubmit={handleSubmit}>
<Form.Group controlId="userEmail">
......@@ -138,7 +138,8 @@ function SignupComp() {
</Row>
</Form.Group>
<Button variant='light' className='mt-2' type="submit" id='formbtn' onClick={CheckUserExist}>
<Button variant='light' className='mt-2' id='formbtn' onClick={CheckUserExist}>
{/* type="submit" */}
Sign Up
</Button>
</Form>
......
// # Global Routes
const BASE = "/api";
// # Data Routes
const DATA = "/data";
// Data - Collector
const DATA_INPUT = "/input";
// Data - Consumer
const DATA_USER = "/user";
const DATA_OUTSIDE = "/outside";
// # Local Code Data
const LOCCODE = "/loccode";
// # Auth
const SIGNUP = "/signup";
const LOGIN = "/login";
const CONFIRM = "/confirm";
const EDIT_PROFILE = "/edit-profile";
// # Detail Object
const DETAIL = "/:id";
const routes = {
base: BASE,
data: DATA,
dataInput: DATA_INPUT,
dataUser: DATA_USER,
dataOutside: DATA_OUTSIDE,
locCode: LOCCODE,
signup: SIGNUP,
login: LOGIN,
confirm: CONFIRM,
editProfile: EDIT_PROFILE,
Detail: (id) => {
if (id) {
return `/${id}`;
} else {
return DETAIL;
}
},
};
export default routes;
......@@ -5,7 +5,7 @@
"main": "init.js",
"scripts": {
"dev:server": "nodemon --exec babel-node src/init.js --delay 2",
"dev:server_window": "nodemon --exec\"npx babel-node src/init.js\" --delay 2",
"dev:server_window": "nodemon --exec \"npx babel-node src/init.js\" --delay 2",
"start": "babel-node src/init.js"
},
"repository": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment