first commit

This commit is contained in:
2025-12-09 11:54:54 +09:00
commit d832c8445e
212 changed files with 49182 additions and 0 deletions

26
.gitignore vendored Normal file
View File

@@ -0,0 +1,26 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
#
.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*

20
README.md Normal file
View File

@@ -0,0 +1,20 @@
<div align="center">
<img src="https://capsule-render.vercel.app/api?type=waving&color=0:58D68D,100:239B56&height=300&section=header&text=New%20Ssack%20🌱&fontSize=90&fontColor=fff" />
<h2>✨ NEW SSAK TECH STACK ✨</h2>
<img src="https://img.shields.io/badge/React-61DAFB?style=flat&logo=react&logoColor=white" />
<img src="https://img.shields.io/badge/ReactQuery-FF4154?style=flat&logo=reactquery&logoColor=white" />
<img src="https://img.shields.io/badge/CRA-09D3AC?style=flat&logo=createreactapp&logoColor=white" />
<img src="https://img.shields.io/badge/Recoil-3578E5?style=flat&logo=recoil&logoColor=white" />
<img src="https://img.shields.io/badge/SemanticUI-35BDB2?style=flat&logo=semanticuireact&logoColor=white" /><br>
<img src="https://img.shields.io/badge/JavaScript-F7DF1E?style=flat&logo=javascript&logoColor=white" />
<img src="https://img.shields.io/badge/TypeScript-3178C6?style=flat&logo=typescript&logoColor=white" />
<img src="https://img.shields.io/badge/jQuery-0769AD?style=flat&logo=jquery&logoColor=white" />
<img src="https://img.shields.io/badge/HTML5-E34F26?style=flat&logo=HTML5&logoColor=white" />
</div>
<div align="center">
<h2>✨ NEW SSAK Graph ✨</h2>
<img src="https://github-readme-stats.vercel.app/api/top-langs/?username=tjddhks6814">
<br><br>
<img src="https://github-readme-stats.vercel.app/api?username=tjddhks6814">
</div>

23
craco.config.js Normal file
View File

@@ -0,0 +1,23 @@
const { CracoAliasPlugin } = require('react-app-alias');
const { VanillaExtractPlugin } = require("@vanilla-extract/webpack-plugin");
module.exports = {
plugins: [
{
plugin: CracoAliasPlugin,
options: {
source: 'tsconfig',
baseUrl: './src',
tsConfigPath: './tsconfig.paths.json',
},
},
{
plugin: VanillaExtractPlugin,
}
],
webpack: {
configure: (webpackConfig, { env, paths }) => {
return webpackConfig;
},
},
};

54
npmNote.txt Normal file
View File

@@ -0,0 +1,54 @@
-- 2023-08-07 --
npm i react-bootstrap bootstrap@4.6.0
npm i react-query
npm i react-router-dom
npm i axios
npm i recoil
npm i recoil-persist
npm i qrcode.react
npm i react-tooltip
npm i primereact
npm install @mui/material @emotion/react @emotion/styled --force
npm install react-bootstrap-date-picker
npm i --save-dev @types/react-datepicker
npm i suneditor-react
npm install @tanstack/react-query --force
npm install @tanstack/react-query-devtools --force
ProjectMain -> Setup으로 변경
GenericSetting -> ProjectCommon으로 변경
ParameterSetting -> ProjectParameter으로 변경
ResponseSetting -> ProjectResponse으로 변경
SubHeader -> MainToolBar으로 변경
SubNav -> LeftNav으로 변경
Footer, Header, LeftNav, MainToolBar /views/includes로 이동
Login, MainPage, Setup /views/main로 이동
ProjectCommon, ProjectParameter, ProjectResponse /views/sub로 이동
input+label에서 width:auto -> width:100%
npm i filepond-plugin-image-preview filepond-plugin-image-exif-orientation --save
npm install react-dnd react-dnd-html5-backend
npm install react-player
npm install filepond-plugin-file-validate-type
npm install xlsx
npm install exceljs file-saver
2023-12-27 서성완 react-app-alias 적용
craco는 사용 종료여서 react-app-alias를 사용
설치 npm
npm install --save-dev react-app-alias craco --force
package.json가서 Scripts 부분 수정
"scripts": {
"start": "set PORT=3008 && craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject"
},
tsconfig.paths.json가서 필요할때마다 경로추가해서 사용하면됨
기본경로는 ./src로 설정

21433
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

104
package.json Normal file
View File

@@ -0,0 +1,104 @@
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@monaco-editor/react": "^4.6.0",
"@mui/material": "^5.14.8",
"@stomp/stompjs": "^7.0.0",
"@tanstack/react-query": "^5.4.3",
"@tanstack/react-query-devtools": "^5.4.2",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@tinymce/tinymce-react": "^4.3.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.39",
"@types/react": "^18.2.17",
"@types/react-dom": "^18.2.7",
"@types/react-responsive": "^8.0.8",
"@types/sockjs-client": "^1.5.4",
"@types/stompjs": "^2.3.8",
"@vanilla-extract/babel-plugin": "^1.2.0",
"@vanilla-extract/css": "^1.14.1",
"axios": "^1.6.1",
"bootstrap": "^4.6.2",
"dayjs": "^1.11.9",
"exceljs": "^4.4.0",
"file-saver": "^2.0.5",
"filepond": "^4.30.6",
"filepond-plugin-file-validate-type": "^1.2.9",
"filepond-plugin-image-exif-orientation": "^1.0.11",
"filepond-plugin-image-preview": "^4.6.11",
"history": "^5.3.0",
"http-proxy-middleware": "^2.0.6",
"immutability-helper": "^3.1.1",
"install": "^0.13.0",
"monaco-editor": "^0.48.0",
"npm-check-updates": "^16.14.14",
"primereact": "^9.6.2",
"qrcode.react": "^3.1.0",
"react": "^18.2.0",
"react-bootstrap": "^2.8.0",
"react-bootstrap-date-picker": "^5.1.0",
"react-bootstrap-pagination-control": "^1.0.5",
"react-bootstrap-typeahead": "^6.2.3",
"react-datalist-input": "^3.2.1",
"react-datepicker": "^4.16.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.2.0",
"react-filepond": "^7.1.2",
"react-js-pagination": "^3.0.2",
"react-player": "^2.15.1",
"react-query": "^3.39.3",
"react-router-dom": "^6.14.2",
"react-scripts": "^5.0.1",
"react-switch-input": "^1.1.0",
"react-tooltip": "^5.21.6",
"recoil": "^0.7.7",
"recoil-persist": "^5.1.0",
"sockjs-client": "^1.6.1",
"styled-components": "^6.1.0",
"suneditor": "^2.45.1",
"suneditor-react": "^3.6.1",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4",
"xlsx": "^0.18.5"
},
"scripts": {
"start": "set PORT=3008 && craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@craco/craco": "^5.9.0",
"@types/file-saver": "^2.0.7",
"@types/react-datepicker": "^4.15.0",
"@types/react-js-pagination": "^3.0.4",
"@vanilla-extract/webpack-plugin": "^2.3.4",
"craco": "0.0.3",
"react-app-alias": "^2.2.2"
}
}

18
public/index.html Normal file
View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<title>NEW_SSAK</title>
<link rel = "icon" href = "./public_img/newssak.png" type = "image/x-icon">
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>

BIN
public/public_gif/error.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 10C1 5.02944 5.02944 1 10 1C14.9706 1 19 5.02944 19 10C19 14.9706 14.9706 19 10 19C5.02944 19 1 14.9706 1 10ZM9.4375 2.21112C8.68439 2.44144 7.9352 3.13438 7.31434 4.29849C7.15333 4.60038 7.00451 4.92832 6.86993 5.27906C7.66324 5.45602 8.52681 5.56876 9.4375 5.60187V2.21112ZM5.77958 4.98187C5.94035 4.54977 6.12176 4.14394 6.32169 3.76907C6.52275 3.39209 6.7472 3.03896 6.99317 2.71939C6.02823 3.11834 5.15987 3.70354 4.43288 4.43017C4.83955 4.63699 5.29086 4.8225 5.77958 4.98187ZM4.94701 9.43749C4.98784 8.23373 5.15895 7.0892 5.43793 6.05382C4.79724 5.84539 4.206 5.5934 3.67802 5.30362C2.80721 6.47394 2.25368 7.89434 2.14478 9.43749H4.94701ZM6.52228 6.3537C6.272 7.28475 6.11308 8.32711 6.07269 9.43749H9.4375V6.72753C8.41397 6.69279 7.43171 6.56378 6.52228 6.3537ZM10.5625 6.72753V9.43749H13.9273C13.8869 8.32711 13.728 7.28475 13.4777 6.3537C12.5683 6.56378 11.586 6.69279 10.5625 6.72753ZM6.07269 10.5625C6.11308 11.6729 6.272 12.7152 6.52228 13.6463C7.43171 13.4362 8.41397 13.3072 9.4375 13.2725V10.5625H6.07269ZM10.5625 10.5625V13.2725C11.586 13.3072 12.5683 13.4362 13.4777 13.6463C13.728 12.7152 13.8869 11.6729 13.9273 10.5625H10.5625ZM6.86993 14.7209C7.00451 15.0717 7.15333 15.3996 7.31434 15.7015C7.9352 16.8656 8.68439 17.5585 9.4375 17.7889V14.3981C8.52681 14.4312 7.66324 14.544 6.86993 14.7209ZM6.99317 17.2806C6.74721 16.961 6.52275 16.6079 6.32169 16.2309C6.12176 15.856 5.94035 15.4502 5.77958 15.0181C5.29086 15.1775 4.83955 15.363 4.43288 15.5698C5.15987 16.2964 6.02823 16.8816 6.99317 17.2806ZM5.43793 13.9462C5.15895 12.9108 4.98784 11.7663 4.94701 10.5625H2.14478C2.25368 12.1056 2.80721 13.526 3.67802 14.6964C4.206 14.4066 4.79724 14.1546 5.43793 13.9462ZM13.0068 17.2806C13.9718 16.8816 14.8401 16.2964 15.5671 15.5698C15.1604 15.363 14.7091 15.1775 14.2204 15.0181C14.0596 15.4502 13.8782 15.856 13.6783 16.2309C13.4772 16.6079 13.2528 16.961 13.0068 17.2806ZM10.5625 14.3981V17.7889C11.3156 17.5585 12.0648 16.8656 12.6857 15.7015C12.8467 15.3996 12.9955 15.0717 13.1301 14.7209C12.3368 14.544 11.4732 14.4312 10.5625 14.3981ZM14.5621 13.9462C15.2028 14.1546 15.794 14.4066 16.322 14.6964C17.1928 13.526 17.7463 12.1056 17.8552 10.5625H15.053C15.0122 11.7663 14.841 12.9108 14.5621 13.9462ZM17.8552 9.43749C17.7463 7.89434 17.1928 6.47394 16.322 5.30362C15.794 5.5934 15.2028 5.84539 14.5621 6.05382C14.841 7.0892 15.0122 8.23373 15.053 9.43749H17.8552ZM13.6783 3.76907C13.8782 4.14394 14.0596 4.54977 14.2204 4.98187C14.7091 4.8225 15.1604 4.63699 15.5671 4.43017C14.8401 3.70354 13.9718 3.11834 13.0068 2.71939C13.2528 3.03896 13.4772 3.39209 13.6783 3.76907ZM13.1301 5.27906C12.9955 4.92832 12.8467 4.60038 12.6857 4.29849C12.0648 3.13438 11.3156 2.44144 10.5625 2.21112V5.60187C11.4732 5.56876 12.3368 5.45602 13.1301 5.27906Z" fill="#3B4E4A"/>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.354492 1.59659C0.354492 1.17315 0.522704 0.767048 0.822122 0.46763C1.12154 0.168211 1.52764 0 1.95108 0H14.1916C14.4739 0 14.7446 0.112141 14.9442 0.311753C15.1438 0.511365 15.256 0.782098 15.256 1.06439H1.95108C1.80993 1.06439 1.67457 1.12046 1.57476 1.22027C1.47495 1.32007 1.41888 1.45544 1.41888 1.59659V14.9015C1.13659 14.9015 0.865858 14.7893 0.666245 14.5897C0.466633 14.3901 0.354492 14.1194 0.354492 13.8371V1.59659ZM14.7373 17.032C16.2004 17.032 17.3865 15.8459 17.3865 14.3828C17.3865 12.9196 16.2004 11.7335 14.7373 11.7335C13.2741 11.7335 12.088 12.9196 12.088 14.3828C12.088 15.8459 13.2741 17.032 14.7373 17.032ZM17.4469 16.9589C18.0847 16.2883 18.4761 15.3813 18.4761 14.3828C18.4761 13.3522 18.0592 12.4191 17.3848 11.7428V4.30798C17.3848 3.10445 16.4091 2.12879 15.2056 2.12879H4.66248C3.45894 2.12879 2.48328 3.10445 2.48328 4.30798V14.8511C2.48328 16.0546 3.45894 17.0303 4.66248 17.0303H12.0973C12.7736 17.7047 13.7067 18.1216 14.7373 18.1216C15.3702 18.1216 15.9665 17.9643 16.489 17.6867L18.6278 19.8254C18.8605 20.0581 19.2379 20.0581 19.4706 19.8254C19.7033 19.5927 19.7033 19.2153 19.4706 18.9826L17.4469 16.9589ZM14.7373 10.6439C15.303 10.6439 15.8394 10.7696 16.32 10.9945V4.64562C16.32 3.84326 15.6696 3.19282 14.8672 3.19282H5.00011C4.19775 3.19282 3.54731 3.84326 3.54731 4.64562V14.5127C3.54731 15.3151 4.19775 15.9655 5.00011 15.9655H11.349C11.1241 15.4849 10.9984 14.9485 10.9984 14.3828C10.9984 13.5639 11.2617 12.8065 11.7082 12.1906V8.51499C11.7082 8.12309 12.0259 7.80539 12.4178 7.80539C12.8097 7.80539 13.1274 8.12309 13.1274 8.51498V10.9986C13.1274 11.0015 13.1274 11.0044 13.1273 11.0073C13.6149 10.7744 14.1609 10.6439 14.7373 10.6439ZM7.45044 9.2249C7.05855 9.2249 6.74085 9.54259 6.74085 9.93449V12.0633C6.74085 12.4552 7.05855 12.7729 7.45044 12.7729C7.84234 12.7729 8.16004 12.4552 8.16004 12.0633V9.93449C8.16004 9.54259 7.84234 9.2249 7.45044 9.2249ZM9.22451 7.09595C9.22451 6.70405 9.54221 6.38636 9.93411 6.38636C10.326 6.38636 10.6437 6.70405 10.6437 7.09595V12.0631C10.6437 12.455 10.326 12.7727 9.93411 12.7727C9.54221 12.7727 9.22451 12.455 9.22451 12.0631V7.09595Z" fill="#3B4E4A"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 5C0 5 0 2.5 2.5 2.5H17.5C17.5 2.5 20 2.5 20 5V12.5C20 12.5 20 15 17.5 15H12.5C12.5 15.8333 12.6042 16.4583 12.8125 16.875H13.75C14.0952 16.875 14.375 17.1548 14.375 17.5C14.375 17.8452 14.0952 18.125 13.75 18.125H6.25C5.90482 18.125 5.625 17.8452 5.625 17.5C5.625 17.1548 5.90482 16.875 6.25 16.875H7.1875C7.39583 16.4583 7.5 15.8333 7.5 15H2.5C2.5 15 0 15 0 12.5V5ZM1.74806 3.93069C1.61617 4.01862 1.51264 4.1448 1.43053 4.30902C1.34598 4.47812 1.29747 4.66236 1.27205 4.81487C1.25984 4.88817 1.25422 4.94651 1.25171 4.98164C1.25067 4.9962 1.25019 5.0063 1.25 5.01128V12.5C1.25 12.9063 1.34798 13.1279 1.43069 13.2519C1.51862 13.3838 1.6448 13.4874 1.80902 13.5695C1.97812 13.654 2.16236 13.7025 2.31487 13.7279C2.38817 13.7402 2.44651 13.7458 2.48164 13.7483C2.49621 13.7493 2.50631 13.7498 2.51128 13.75H17.5C17.9063 13.75 18.1279 13.652 18.2519 13.5693C18.3838 13.4814 18.4874 13.3552 18.5695 13.191C18.654 13.0219 18.7025 12.8376 18.7279 12.6851C18.7402 12.6118 18.7458 12.5535 18.7483 12.5184C18.7493 12.5038 18.7498 12.4937 18.75 12.4887V5C18.75 4.59373 18.652 4.37213 18.5693 4.24806C18.4814 4.11617 18.3552 4.01264 18.191 3.93053C18.0219 3.84598 17.8376 3.79747 17.6851 3.77205C17.6118 3.75984 17.5535 3.75422 17.5184 3.75171C17.5038 3.75067 17.4937 3.75019 17.4887 3.75H2.5C2.09373 3.75 1.87213 3.84798 1.74806 3.93069Z" fill="#3B4E4A"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,7 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10 6.625C10.932 6.625 11.6875 5.86948 11.6875 4.9375C11.6875 4.00552 10.932 3.25 10 3.25C9.06802 3.25 8.3125 4.00552 8.3125 4.9375C8.3125 5.86948 9.06802 6.625 10 6.625Z" fill="#3B4E4A"/>
<path d="M14.5 10C15.432 10 16.1875 9.24448 16.1875 8.3125C16.1875 7.38052 15.432 6.625 14.5 6.625C13.568 6.625 12.8125 7.38052 12.8125 8.3125C12.8125 9.24448 13.568 10 14.5 10Z" fill="#3B4E4A"/>
<path d="M7.1875 8.875C7.1875 9.80698 6.43198 10.5625 5.5 10.5625C4.56802 10.5625 3.8125 9.80698 3.8125 8.875C3.8125 7.94302 4.56802 7.1875 5.5 7.1875C6.43198 7.1875 7.1875 7.94302 7.1875 8.875Z" fill="#3B4E4A"/>
<path d="M7.75 15.625C8.68198 15.625 9.4375 14.8695 9.4375 13.9375C9.4375 13.0055 8.68198 12.25 7.75 12.25C6.81802 12.25 6.0625 13.0055 6.0625 13.9375C6.0625 14.8695 6.81802 15.625 7.75 15.625Z" fill="#3B4E4A"/>
<path d="M19 10C19 13.5444 16.9003 12.9081 14.9874 12.3285C13.847 11.9829 12.773 11.6574 12.25 12.25C11.5719 13.0183 11.7157 14.296 11.8551 15.5343C12.0547 17.3075 12.2452 19 10 19C5.02944 19 1 14.9706 1 10C1 5.02944 5.02944 1 10 1C14.9706 1 19 5.02944 19 10ZM10 17.875C10.6875 17.875 10.7353 17.6822 10.7366 17.6768C10.8245 17.5128 10.8762 17.1545 10.8153 16.4184C10.7996 16.2291 10.7742 16.0008 10.7467 15.7529C10.6886 15.2311 10.6209 14.6225 10.614 14.108C10.6034 13.3136 10.7079 12.2971 11.4065 11.5055C11.8208 11.0362 12.3568 10.8549 12.8369 10.8098C13.2919 10.767 13.7512 10.8394 14.1417 10.927C14.5278 11.0136 14.9319 11.1361 15.2951 11.2462L15.3274 11.2559C15.7159 11.3737 16.0665 11.4791 16.3989 11.5545C17.1336 11.7211 17.4159 11.648 17.5142 11.5818C17.5571 11.553 17.875 11.3063 17.875 10C17.875 5.65076 14.3492 2.125 10 2.125C5.65076 2.125 2.125 5.65076 2.125 10C2.125 14.3492 5.65076 17.875 10 17.875Z" fill="#3B4E4A"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 4.375C7.5 3.33947 8.33947 2.5 9.375 2.5H10.625C11.6605 2.5 12.5 3.33947 12.5 4.375V5.625C12.5 6.66053 11.6605 7.5 10.625 7.5V8.75H17.5C17.8452 8.75 18.125 9.02982 18.125 9.375V10.625C18.125 10.9702 17.8452 11.25 17.5 11.25C17.1548 11.25 16.875 10.9702 16.875 10.625V10H10.625V10.625C10.625 10.9702 10.3452 11.25 10 11.25C9.65482 11.25 9.375 10.9702 9.375 10.625V10H3.125V10.625C3.125 10.9702 2.84518 11.25 2.5 11.25C2.15482 11.25 1.875 10.9702 1.875 10.625V9.375C1.875 9.02982 2.15482 8.75 2.5 8.75H9.375V7.5C8.33947 7.5 7.5 6.66053 7.5 5.625V4.375ZM10.625 6.25C10.9702 6.25 11.25 5.97018 11.25 5.625V4.375C11.25 4.02982 10.9702 3.75 10.625 3.75H9.375C9.02982 3.75 8.75 4.02982 8.75 4.375V5.625C8.75 5.97018 9.02982 6.25 9.375 6.25H10.625ZM0 14.375C0 13.3395 0.839466 12.5 1.875 12.5H3.125C4.16053 12.5 5 13.3395 5 14.375V15.625C5 16.6605 4.16053 17.5 3.125 17.5H1.875C0.839466 17.5 0 16.6605 0 15.625V14.375ZM1.875 13.75C1.52982 13.75 1.25 14.0298 1.25 14.375V15.625C1.25 15.9702 1.52982 16.25 1.875 16.25H3.125C3.47018 16.25 3.75 15.9702 3.75 15.625V14.375C3.75 14.0298 3.47018 13.75 3.125 13.75H1.875ZM7.5 14.375C7.5 13.3395 8.33947 12.5 9.375 12.5H10.625C11.6605 12.5 12.5 13.3395 12.5 14.375V15.625C12.5 16.6605 11.6605 17.5 10.625 17.5H9.375C8.33947 17.5 7.5 16.6605 7.5 15.625V14.375ZM9.375 13.75C9.02982 13.75 8.75 14.0298 8.75 14.375V15.625C8.75 15.9702 9.02982 16.25 9.375 16.25H10.625C10.9702 16.25 11.25 15.9702 11.25 15.625V14.375C11.25 14.0298 10.9702 13.75 10.625 13.75H9.375ZM15 14.375C15 13.3395 15.8395 12.5 16.875 12.5H18.125C19.1605 12.5 20 13.3395 20 14.375V15.625C20 16.6605 19.1605 17.5 18.125 17.5H16.875C15.8395 17.5 15 16.6605 15 15.625V14.375ZM16.875 13.75C16.5298 13.75 16.25 14.0298 16.25 14.375V15.625C16.25 15.9702 16.5298 16.25 16.875 16.25H18.125C18.4702 16.25 18.75 15.9702 18.75 15.625V14.375C18.75 14.0298 18.4702 13.75 18.125 13.75H16.875Z" fill="#3B4E4A"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0336 15.8065C7.37533 16.3861 4.48033 15.6639 2.41191 13.6399C-0.803971 10.4931 -0.803972 5.39118 2.41191 2.24439C3.44304 1.23542 4.67959 0.549962 5.98982 0.188015C6.562 0.0648952 7.15648 0 7.76646 0C12.3144 0 16.0012 3.60762 16.0012 8.05785C16.0012 11.7386 13.4791 14.843 10.0336 15.8065ZM12.1167 5.09364C12.3847 4.83141 12.3847 4.40625 12.1167 4.14401C11.8487 3.88178 11.4143 3.88178 11.1463 4.14401L8.23512 6.9926L5.32383 4.14386C5.05584 3.88163 4.62134 3.88163 4.35335 4.14386C4.08536 4.4061 4.08536 4.83126 4.35335 5.09349L7.26464 7.94223L4.3529 10.7914C4.08491 11.0536 4.08491 11.4788 4.3529 11.741C4.62089 12.0033 5.05539 12.0033 5.32338 11.741L8.23512 8.89186L11.1467 11.7409C11.4147 12.0031 11.8492 12.0031 12.1172 11.7409C12.3852 11.4786 12.3852 11.0535 12.1172 10.7913L9.2056 7.94223L12.1167 5.09364Z" fill="#1CAE81"/>
</svg>

After

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,7 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.0625 4.375C15.3732 4.375 15.625 4.62684 15.625 4.9375C15.625 5.24816 15.3732 5.5 15.0625 5.5H9.4375C9.12684 5.5 8.875 5.24816 8.875 4.9375C8.875 4.62684 9.12684 4.375 9.4375 4.375H15.0625Z" fill="#3B4E4A"/>
<path d="M15.0625 7.75C15.3732 7.75 15.625 8.00184 15.625 8.3125C15.625 8.62316 15.3732 8.875 15.0625 8.875H9.4375C9.12684 8.875 8.875 8.62316 8.875 8.3125C8.875 8.00184 9.12684 7.75 9.4375 7.75H15.0625Z" fill="#3B4E4A"/>
<path d="M15.625 11.6875C15.625 11.3768 15.3732 11.125 15.0625 11.125H9.4375C9.12684 11.125 8.875 11.3768 8.875 11.6875C8.875 11.9982 9.12684 12.25 9.4375 12.25H15.0625C15.3732 12.25 15.625 11.9982 15.625 11.6875Z" fill="#3B4E4A"/>
<path d="M15.0625 14.5C15.3732 14.5 15.625 14.7518 15.625 15.0625C15.625 15.3732 15.3732 15.625 15.0625 15.625H9.4375C9.12684 15.625 8.875 15.3732 8.875 15.0625C8.875 14.7518 9.12684 14.5 9.4375 14.5H15.0625Z" fill="#3B4E4A"/>
<path d="M19 3.25C19 2.00736 17.9926 1 16.75 1H3.25C2.00736 1 1 2.00736 1 3.25V16.75C1 17.9926 2.00736 19 3.25 19H16.75C17.9926 19 19 17.9926 19 16.75V3.25ZM5.5 2.125V17.875H3.25C2.62868 17.875 2.125 17.3713 2.125 16.75V3.25C2.125 2.62868 2.62868 2.125 3.25 2.125H5.5ZM6.625 2.125H16.75C17.3713 2.125 17.875 2.62868 17.875 3.25V16.75C17.875 17.3713 17.3713 17.875 16.75 17.875H6.625V2.125Z" fill="#3B4E4A"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,7 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5 13.75C5 13.0596 5.55964 12.5 6.25 12.5C6.94036 12.5 7.5 13.0596 7.5 13.75V15C7.5 15.6904 6.94036 16.25 6.25 16.25C5.55964 16.25 5 15.6904 5 15V13.75Z" fill="#3B4E4A"/>
<path d="M12.5 8.75C12.5 8.05964 13.0596 7.5 13.75 7.5C14.4404 7.5 15 8.05964 15 8.75V15C15 15.6904 14.4404 16.25 13.75 16.25C13.0596 16.25 12.5 15.6904 12.5 15V8.75Z" fill="#3B4E4A"/>
<path d="M8.75 11.25C8.75 10.5596 9.30964 10 10 10C10.6904 10 11.25 10.5596 11.25 11.25V15C11.25 15.6904 10.6904 16.25 10 16.25C9.30964 16.25 8.75 15.6904 8.75 15V11.25Z" fill="#3B4E4A"/>
<path d="M5 1.875H3.75C2.36929 1.875 1.25 2.99429 1.25 4.375V17.5C1.25 18.8807 2.36929 20 3.75 20H16.25C17.6307 20 18.75 18.8807 18.75 17.5V4.375C18.75 2.99429 17.6307 1.875 16.25 1.875H15V3.125H16.25C16.9404 3.125 17.5 3.68464 17.5 4.375V17.5C17.5 18.1904 16.9404 18.75 16.25 18.75H3.75C3.05964 18.75 2.5 18.1904 2.5 17.5V4.375C2.5 3.68464 3.05964 3.125 3.75 3.125H5V1.875Z" fill="#3B4E4A"/>
<path d="M11.875 1.25C12.2202 1.25 12.5 1.52982 12.5 1.875V3.125C12.5 3.47018 12.2202 3.75 11.875 3.75H8.125C7.77982 3.75 7.5 3.47018 7.5 3.125V1.875C7.5 1.52982 7.77982 1.25 8.125 1.25H11.875ZM8.125 0C7.08947 0 6.25 0.839466 6.25 1.875V3.125C6.25 4.16053 7.08947 5 8.125 5H11.875C12.9105 5 13.75 4.16053 13.75 3.125V1.875C13.75 0.839466 12.9105 0 11.875 0H8.125Z" fill="#3B4E4A"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,5 @@
<svg width="10" height="10" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="0.470461" y="1.32495" width="10.3501" height="10.3501" rx="5.17507" fill="white"/>
<rect x="0.470461" y="1.32495" width="10.3501" height="10.3501" rx="5.17507" stroke="#1CAE81" stroke-width="0.940921"/>
<circle cx="5.64552" cy="6.50001" r="3.76368" fill="#1CAE81"/>
</svg>

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 4.5C15 5.32843 14.3284 6 13.5 6C12.6716 6 12 5.32843 12 4.5C12 3.67157 12.6716 3 13.5 3C14.3284 3 15 3.67157 15 4.5ZM15.8331 5.4C15.4718 6.33601 14.5634 7 13.5 7C12.4366 7 11.5282 6.33601 11.1669 5.4H2.7C2.3134 5.4 2 5.0866 2 4.7C2 4.3134 2.3134 4 2.7 4H11.05C11.2816 2.85888 12.2905 2 13.5 2C14.7095 2 15.7184 2.85888 15.95 4H17.3C17.6866 4 18 4.3134 18 4.7C18 5.0866 17.6866 5.4 17.3 5.4H15.8331ZM8 9.5C8 10.3284 7.32843 11 6.5 11C5.67157 11 5 10.3284 5 9.5C5 8.67157 5.67157 8 6.5 8C7.32843 8 8 8.67157 8 9.5ZM8.8331 10.4C8.47179 11.336 7.56344 12 6.5 12C5.43656 12 4.52821 11.336 4.1669 10.4H2.7C2.3134 10.4 2 10.0866 2 9.7C2 9.3134 2.3134 9 2.7 9H4.05001C4.28164 7.85888 5.29052 7 6.5 7C7.70948 7 8.71836 7.85888 8.94999 9H17.3C17.6866 9 18 9.3134 18 9.7C18 10.0866 17.6866 10.4 17.3 10.4H8.8331ZM13.5 16C14.3284 16 15 15.3284 15 14.5C15 13.6716 14.3284 13 13.5 13C12.6716 13 12 13.6716 12 14.5C12 15.3284 12.6716 16 13.5 16ZM13.5 17C14.5634 17 15.4718 16.336 15.8331 15.4H17.3C17.6866 15.4 18 15.0866 18 14.7C18 14.3134 17.6866 14 17.3 14H15.95C15.7184 12.8589 14.7095 12 13.5 12C12.2905 12 11.2816 12.8589 11.05 14H2.7C2.3134 14 2 14.3134 2 14.7C2 15.0866 2.3134 15.4 2.7 15.4H11.1669C11.5282 16.336 12.4366 17 13.5 17Z" fill="#3B4E4A"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,7 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18.125 3.75C18.4702 3.75 18.75 4.02982 18.75 4.375V15.625C18.75 15.9702 18.4702 16.25 18.125 16.25H1.875C1.52982 16.25 1.25 15.9702 1.25 15.625V4.375C1.25 4.02982 1.52982 3.75 1.875 3.75H18.125ZM1.875 2.5C0.839466 2.5 0 3.33947 0 4.375V15.625C0 16.6605 0.839466 17.5 1.875 17.5H18.125C19.1605 17.5 20 16.6605 20 15.625V4.375C20 3.33947 19.1605 2.5 18.125 2.5H1.875Z" fill="#3B4E4A"/>
<path d="M8.75 6.875C8.75 6.52982 9.02982 6.25 9.375 6.25H15.625C15.9702 6.25 16.25 6.52982 16.25 6.875C16.25 7.22018 15.9702 7.5 15.625 7.5H9.375C9.02982 7.5 8.75 7.22018 8.75 6.875Z" fill="#3B4E4A"/>
<path d="M6.87944 5.80806C7.12352 6.05214 7.12352 6.44786 6.87944 6.69194L5.00444 8.56694C4.76037 8.81102 4.36464 8.81102 4.12056 8.56694L3.49556 7.94194C3.25148 7.69786 3.25148 7.30214 3.49556 7.05806C3.73964 6.81398 4.13537 6.81398 4.37944 7.05806L4.5625 7.24112L5.99556 5.80806C6.23964 5.56398 6.63537 5.56398 6.87944 5.80806Z" fill="#3B4E4A"/>
<path d="M8.75 11.875C8.75 11.5298 9.02982 11.25 9.375 11.25H15.625C15.9702 11.25 16.25 11.5298 16.25 11.875C16.25 12.2202 15.9702 12.5 15.625 12.5H9.375C9.02982 12.5 8.75 12.2202 8.75 11.875Z" fill="#3B4E4A"/>
<path d="M6.87944 10.8081C7.12352 11.0521 7.12352 11.4479 6.87944 11.6919L5.00444 13.5669C4.76037 13.811 4.36464 13.811 4.12056 13.5669L3.49556 12.9419C3.25148 12.6979 3.25148 12.3021 3.49556 12.0581C3.73964 11.814 4.13537 11.814 4.37944 12.0581L4.5625 12.2411L5.99556 10.8081C6.23964 10.564 6.63537 10.564 6.87944 10.8081Z" fill="#3B4E4A"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

BIN
public/public_img/alert.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 B

View File

@@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M1 11.5C1 11.7761 1.22386 12 1.5 12H13.2929L10.1464 15.1464C9.95118 15.3417 9.95118 15.6583 10.1464 15.8536C10.3417 16.0488 10.6583 16.0488 10.8536 15.8536L14.8536 11.8536C15.0488 11.6583 15.0488 11.3417 14.8536 11.1464L10.8536 7.14645C10.6583 6.95118 10.3417 6.95118 10.1464 7.14645C9.95118 7.34171 9.95118 7.65829 10.1464 7.85355L13.2929 11H1.5C1.22386 11 1 11.2239 1 11.5Z" fill="#868E96"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 4.5C15 4.77614 14.7761 5 14.5 5H2.70711L5.85355 8.14645C6.04882 8.34171 6.04882 8.65829 5.85355 8.85355C5.65829 9.04882 5.34171 9.04882 5.14645 8.85355L1.14645 4.85355C0.951185 4.65829 0.951185 4.34171 1.14645 4.14645L5.14645 0.146447C5.34171 -0.0488155 5.65829 -0.0488155 5.85355 0.146447C6.04882 0.341709 6.04882 0.658292 5.85355 0.853554L2.70711 4H14.5C14.7761 4 15 4.22386 15 4.5Z" fill="#868E96"/>
</svg>

After

Width:  |  Height:  |  Size: 1002 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path d="M12 13V20L4 12L12 4V11H20V13H12Z" fill="currentColor"></path></svg>

After

Width:  |  Height:  |  Size: 159 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path d="M12 13H4V11H12V4L20 12L12 20V13Z" fill="currentColor"></path></svg>

After

Width:  |  Height:  |  Size: 159 B

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.05896 13.9249L3.06366 7.07313C2.35646 6.2649 2.93044 5 4.00438 5H15.995C17.0689 5 17.6429 6.2649 16.9357 7.07313L10.9404 13.9249C10.4424 14.494 9.55697 14.4941 9.05896 13.9249Z" fill="#868E96"/>
</svg>

After

Width:  |  Height:  |  Size: 310 B

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.941 6.07511L16.9363 12.9269C17.6435 13.7351 17.0696 15 15.9956 15L4.00504 15C2.93109 15 2.35711 13.7351 3.06431 12.9269L9.0596 6.07511C9.55762 5.50595 10.443 5.50595 10.941 6.07511Z" fill="#868E96"/>
</svg>

After

Width:  |  Height:  |  Size: 316 B

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="20" fill="currentColor" class="bi bi-arrows-angle-expand" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M5.828 10.172a.5.5 0 0 0-.707 0l-4.096 4.096V11.5a.5.5 0 0 0-1 0v3.975a.5.5 0 0 0 .5.5H4.5a.5.5 0 0 0 0-1H1.732l4.096-4.096a.5.5 0 0 0 0-.707zm4.344-4.344a.5.5 0 0 0 .707 0l4.096-4.096V4.5a.5.5 0 1 0 1 0V.525a.5.5 0 0 0-.5-.5H11.5a.5.5 0 0 0 0 1h2.768l-4.096 4.096a.5.5 0 0 0 0 .707z"/>
</svg>

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.5 2C5.77614 2 6 2.22386 6 2.5V3H14V2.5C14 2.22386 14.2239 2 14.5 2C14.7761 2 15 2.22386 15 2.5V3H16C17.1046 3 18 3.89543 18 5V6V7V16C18 17.1046 17.1046 18 16 18H4C2.89543 18 2 17.1046 2 16V7H18V6H2V5C2 3.89543 2.89543 3 4 3H5V2.5C5 2.22386 5.22386 2 5.5 2Z" fill="#868E96"/>
</svg>

After

Width:  |  Height:  |  Size: 390 B

BIN
public/public_img/chk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

View File

@@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2759_3546)">
<path d="M8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0ZM11.5 7.5C11.6326 7.5 11.7598 7.55268 11.8536 7.64645C11.9473 7.74021 12 7.86739 12 8C12 8.13261 11.9473 8.25979 11.8536 8.35355C11.7598 8.44732 11.6326 8.5 11.5 8.5H5.707L7.854 10.646C7.90049 10.6925 7.93736 10.7477 7.96252 10.8084C7.98768 10.8692 8.00063 10.9343 8.00063 11C8.00063 11.0657 7.98768 11.1308 7.96252 11.1916C7.93736 11.2523 7.90049 11.3075 7.854 11.354C7.80751 11.4005 7.75232 11.4374 7.69158 11.4625C7.63084 11.4877 7.56574 11.5006 7.5 11.5006C7.43426 11.5006 7.36916 11.4877 7.30842 11.4625C7.24768 11.4374 7.19249 11.4005 7.146 11.354L4.146 8.354C4.09944 8.30755 4.06249 8.25238 4.03729 8.19163C4.01208 8.13089 3.99911 8.06577 3.99911 8C3.99911 7.93423 4.01208 7.86911 4.03729 7.80837C4.06249 7.74762 4.09944 7.69245 4.146 7.646L7.146 4.646C7.23989 4.55211 7.36722 4.49937 7.5 4.49937C7.63278 4.49937 7.76011 4.55211 7.854 4.646C7.94789 4.73989 8.00063 4.86722 8.00063 5C8.00063 5.13278 7.94789 5.26011 7.854 5.354L5.707 7.5H11.5Z" fill="#1CAE81"/>
</g>
<defs>
<clipPath id="clip0_2759_3546">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

View File

@@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2759_3548)">
<path d="M8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0ZM11.5 7.5C11.6326 7.5 11.7598 7.55268 11.8536 7.64645C11.9473 7.74021 12 7.86739 12 8C12 8.13261 11.9473 8.25979 11.8536 8.35355C11.7598 8.44732 11.6326 8.5 11.5 8.5H5.707L7.854 10.646C7.90049 10.6925 7.93736 10.7477 7.96252 10.8084C7.98768 10.8692 8.00063 10.9343 8.00063 11C8.00063 11.0657 7.98768 11.1308 7.96252 11.1916C7.93736 11.2523 7.90049 11.3075 7.854 11.354C7.80751 11.4005 7.75232 11.4374 7.69158 11.4625C7.63084 11.4877 7.56574 11.5006 7.5 11.5006C7.43426 11.5006 7.36916 11.4877 7.30842 11.4625C7.24768 11.4374 7.19249 11.4005 7.146 11.354L4.146 8.354C4.09944 8.30755 4.06249 8.25238 4.03729 8.19163C4.01208 8.13089 3.99911 8.06577 3.99911 8C3.99911 7.93423 4.01208 7.86911 4.03729 7.80837C4.06249 7.74762 4.09944 7.69245 4.146 7.646L7.146 4.646C7.23989 4.55211 7.36722 4.49937 7.5 4.49937C7.63278 4.49937 7.76011 4.55211 7.854 4.646C7.94789 4.73989 8.00063 4.86722 8.00063 5C8.00063 5.13278 7.94789 5.26011 7.854 5.354L5.707 7.5H11.5Z" fill="#008264"/>
</g>
<defs>
<clipPath id="clip0_2759_3548">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

View File

@@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="icon_close">
<path id="Vector" d="M6.96967 6.96967C7.26256 6.67678 7.73744 6.67678 8.03033 6.96967L12 10.9393L15.9697 6.96967C16.2626 6.67678 16.7374 6.67678 17.0303 6.96967C17.3232 7.26256 17.3232 7.73744 17.0303 8.03033L13.0607 12L17.0303 15.9697C17.3232 16.2626 17.3232 16.7374 17.0303 17.0303C16.7374 17.3232 16.2626 17.3232 15.9697 17.0303L12 13.0607L8.03033 17.0303C7.73744 17.3232 7.26256 17.3232 6.96967 17.0303C6.67678 16.7374 6.67678 16.2626 6.96967 15.9697L10.9393 12L6.96967 8.03033C6.67678 7.73744 6.67678 7.26256 6.96967 6.96967Z" fill="#2C3035"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.539098 3.87024L0.499542 3C0.499542 1.89543 1.39497 1 2.49954 1H6.17111C6.70155 1 7.21026 1.21071 7.58533 1.58579L8.41376 2.41421C8.78883 2.78929 9.29754 3 9.82797 3H13.8095C14.9855 3 15.9077 4.00984 15.8013 5.18107L15.1649 12.1811C15.0713 13.2112 14.2075 14 13.1731 14H2.82598C1.79157 14 0.927844 13.2112 0.834193 12.1811L0.19783 5.18107C0.153774 4.69647 0.285825 4.23949 0.539098 3.87024ZM2.18962 4C1.60159 4 1.14048 4.50492 1.19372 5.09054L1.83009 12.0905C1.87691 12.6056 2.30878 13 2.82598 13H13.1731C13.6903 13 14.1222 12.6056 14.169 12.0905L14.8054 5.09054C14.8586 4.50492 14.3975 4 13.8095 4H2.18962ZM6.87822 2.29289C6.69069 2.10536 6.43633 2 6.17111 2H2.49954C1.95356 2 1.50978 2.43755 1.49972 2.98112L1.50601 3.11964C1.71882 3.04231 1.9489 3 2.18962 3H7.58533L6.87822 2.29289Z" fill="#1CAE81"/>
</svg>

After

Width:  |  Height:  |  Size: 918 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16ZM16 8C14.9292 8 14.0925 8.92457 14.199 9.99008L14.9005 17.005C14.957 17.5698 15.4323 18 16 18C16.5677 18 17.043 17.5698 17.0995 17.005L17.801 9.99007C17.9075 8.92457 17.0708 8 16 8ZM16.0031 20C14.8985 20 14.0031 20.8954 14.0031 22C14.0031 23.1046 14.8985 24 16.0031 24C17.1077 24 18.0031 23.1046 18.0031 22C18.0031 20.8954 17.1077 20 16.0031 20Z" fill="#6C757D"/>
</svg>

After

Width:  |  Height:  |  Size: 589 B

View File

@@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.5 1.5C17.3284 1.5 18 2.17157 18 3V21C18 21.8284 17.3284 22.5 16.5 22.5H7.5C6.67157 22.5 6 21.8284 6 21V3C6 2.17157 6.67157 1.5 7.5 1.5H16.5ZM7.5 0C5.84315 0 4.5 1.34315 4.5 3V21C4.5 22.6569 5.84315 24 7.5 24H16.5C18.1569 24 19.5 22.6569 19.5 21V3C19.5 1.34315 18.1569 0 16.5 0H7.5Z" fill="#868E96"/>
<path d="M12 21C12.8284 21 13.5 20.3284 13.5 19.5C13.5 18.6716 12.8284 18 12 18C11.1716 18 10.5 18.6716 10.5 19.5C10.5 20.3284 11.1716 21 12 21Z" fill="#868E96"/>
</svg>

After

Width:  |  Height:  |  Size: 579 B

View File

@@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.5 1.5C17.3284 1.5 18 2.17157 18 3V21C18 21.8284 17.3284 22.5 16.5 22.5H7.5C6.67157 22.5 6 21.8284 6 21V3C6 2.17157 6.67157 1.5 7.5 1.5H16.5ZM7.5 0C5.84315 0 4.5 1.34315 4.5 3V21C4.5 22.6569 5.84315 24 7.5 24H16.5C18.1569 24 19.5 22.6569 19.5 21V3C19.5 1.34315 18.1569 0 16.5 0H7.5Z" fill="#1CAE81"/>
<path d="M12 21C12.8284 21 13.5 20.3284 13.5 19.5C13.5 18.6716 12.8284 18 12 18C11.1716 18 10.5 18.6716 10.5 19.5C10.5 20.3284 11.1716 21 12 21Z" fill="#1CAE81"/>
</svg>

After

Width:  |  Height:  |  Size: 579 B

View File

@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 5.2C0 5.2 0 2 3 2H21C21 2 24 2 24 5.2V14.8C24 14.8 24 18 21 18H15C15 19.0667 15.125 19.8667 15.375 20.4H16.5C16.9142 20.4 17.25 20.7582 17.25 21.2C17.25 21.6418 16.9142 22 16.5 22H7.5C7.08579 22 6.75 21.6418 6.75 21.2C6.75 20.7582 7.08579 20.4 7.5 20.4H8.625C8.875 19.8667 9 19.0667 9 18H3C3 18 0 18 0 14.8V5.2ZM2.09768 3.83128C1.9394 3.94383 1.81517 4.10535 1.71664 4.31554C1.61518 4.532 1.55697 4.76783 1.52647 4.96304C1.51181 5.05685 1.50506 5.13153 1.50205 5.1765C1.5008 5.19514 1.50023 5.20806 1.5 5.21444V14.8C1.5 15.32 1.61757 15.6037 1.71683 15.7625C1.82234 15.9313 1.97377 16.0638 2.17082 16.1689C2.37375 16.2771 2.59484 16.3392 2.77785 16.3718C2.8658 16.3874 2.93581 16.3946 2.97796 16.3978C2.99545 16.3991 3.00757 16.3998 3.01354 16.4H21C21.4875 16.4 21.7534 16.2746 21.9023 16.1687C22.0606 16.0562 22.1848 15.8947 22.2834 15.6845C22.3848 15.468 22.443 15.2322 22.4735 15.037C22.4882 14.9431 22.4949 14.8685 22.498 14.8235C22.4992 14.8049 22.4998 14.7919 22.5 14.7856V5.2C22.5 4.67998 22.3824 4.39633 22.2832 4.23752C22.1777 4.0687 22.0262 3.93618 21.8292 3.83108C21.6263 3.72286 21.4052 3.66077 21.2222 3.62823C21.1342 3.61259 21.0642 3.6054 21.022 3.60218C21.0046 3.60085 20.9924 3.60025 20.9865 3.6H3C2.51248 3.6 2.24656 3.72541 2.09768 3.83128Z" fill="#868E96"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 5.2C0 5.2 0 2 3 2H21C21 2 24 2 24 5.2V14.8C24 14.8 24 18 21 18H15C15 19.0667 15.125 19.8667 15.375 20.4H16.5C16.9142 20.4 17.25 20.7582 17.25 21.2C17.25 21.6418 16.9142 22 16.5 22H7.5C7.08579 22 6.75 21.6418 6.75 21.2C6.75 20.7582 7.08579 20.4 7.5 20.4H8.625C8.875 19.8667 9 19.0667 9 18H3C3 18 0 18 0 14.8V5.2ZM2.09768 3.83128C1.9394 3.94383 1.81517 4.10535 1.71664 4.31554C1.61518 4.532 1.55697 4.76783 1.52647 4.96304C1.51181 5.05685 1.50506 5.13153 1.50205 5.1765C1.5008 5.19514 1.50023 5.20806 1.5 5.21444V14.8C1.5 15.32 1.61757 15.6037 1.71683 15.7625C1.82234 15.9313 1.97377 16.0638 2.17082 16.1689C2.37375 16.2771 2.59484 16.3392 2.77785 16.3718C2.8658 16.3874 2.93581 16.3946 2.97796 16.3978C2.99545 16.3991 3.00757 16.3998 3.01354 16.4H21C21.4875 16.4 21.7534 16.2746 21.9023 16.1687C22.0606 16.0562 22.1848 15.8947 22.2834 15.6845C22.3848 15.468 22.443 15.2322 22.4735 15.037C22.4882 14.9431 22.4949 14.8685 22.498 14.8235C22.4992 14.8049 22.4998 14.7919 22.5 14.7856V5.2C22.5 4.67998 22.3824 4.39633 22.2832 4.23752C22.1777 4.0687 22.0262 3.93618 21.8292 3.83108C21.6263 3.72286 21.4052 3.66077 21.2222 3.62823C21.1342 3.61259 21.0642 3.6054 21.022 3.60218C21.0046 3.60085 20.9924 3.60025 20.9865 3.6H3C2.51248 3.6 2.24656 3.72541 2.09768 3.83128Z" fill="#1CAE81"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
public/public_img/kring.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@@ -0,0 +1,3 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM2.50005 5.50021C2.22391 5.50021 2.00005 5.72407 2.00005 6.00021C2.00005 6.27635 2.22391 6.50021 2.50005 6.50021H9.50005C9.77619 6.50021 10 6.27635 10 6.00021C10 5.72407 9.77619 5.50021 9.50005 5.50021H2.50005Z" fill="#1CAE81"/>
</svg>

After

Width:  |  Height:  |  Size: 493 B

View File

@@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="5" r="1.5" fill="#868E96"/>
<circle cx="12" cy="12" r="1.5" fill="#868E96"/>
<circle cx="12" cy="19" r="1.5" fill="#868E96"/>
</svg>

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM11.9996 3.99998C12.5519 3.99998 12.9996 4.4477 12.9996 4.99998V10.9998H18.9995C19.5518 10.9998 19.9995 11.4476 19.9995 11.9998C19.9995 12.5521 19.5518 12.9998 18.9995 12.9998H12.9996V19C12.9996 19.5523 12.5519 20 11.9996 20C11.4473 20 10.9996 19.5523 10.9996 19V12.9998H4.99952C4.44724 12.9998 3.99952 12.5521 3.99952 11.9998C3.99952 11.4476 4.44724 10.9998 4.99952 10.9998H10.9996V4.99998C10.9996 4.4477 11.4473 3.99998 11.9996 3.99998Z" fill="#1CAE81"/>
</svg>

After

Width:  |  Height:  |  Size: 726 B

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.9476 14.2426C11.6045 16.5857 7.80546 16.5857 5.46232 14.2426C3.11917 11.8994 3.11917 8.10043 5.46232 5.75729C7.80546 3.41414 11.6045 3.41414 13.9476 5.75729C16.2907 8.10043 16.2907 11.8994 13.9476 14.2426ZM10.08 6.81795C10.08 6.61084 9.91206 6.44295 9.70496 6.44295C9.49785 6.44295 9.32996 6.61084 9.32996 6.81795V9.62493L6.52298 9.62493C6.31587 9.62493 6.14798 9.79282 6.14798 9.99993C6.14798 10.207 6.31587 10.3749 6.52298 10.3749L9.32996 10.3749L9.32996 13.1819C9.32996 13.389 9.49785 13.5569 9.70496 13.5569C9.91206 13.5569 10.08 13.389 10.08 13.1819L10.08 10.3749L12.8869 10.3749C13.094 10.3749 13.2619 10.207 13.2619 9.99993C13.2619 9.79282 13.094 9.62493 12.8869 9.62493L10.08 9.62493V6.81795Z" fill="#868E96"/>
</svg>

After

Width:  |  Height:  |  Size: 835 B

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.705 10C15.705 13.3137 13.0187 16 9.70496 16C6.39125 16 3.70496 13.3137 3.70496 10C3.70496 6.68629 6.39125 4 9.70496 4C13.0187 4 15.705 6.68629 15.705 10ZM7.72012 7.48484C7.57367 7.33839 7.33624 7.33839 7.18979 7.48484C7.04334 7.63128 7.04334 7.86872 7.18979 8.01516L9.17463 10L7.18979 11.9848C7.04334 12.1313 7.04334 12.3687 7.18979 12.5152C7.33624 12.6616 7.57367 12.6616 7.72012 12.5152L9.70496 10.5303L11.6898 12.5152C11.8362 12.6616 12.0737 12.6616 12.2201 12.5152C12.3666 12.3687 12.3666 12.1313 12.2201 11.9848L10.2353 10L12.2201 8.01516C12.3666 7.86872 12.3666 7.63128 12.2201 7.48484C12.0737 7.33839 11.8362 7.33839 11.6898 7.48484L9.70496 9.46967L7.72012 7.48484Z" fill="#1CAE81"/>
</svg>

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM10 5.5C10 5.22386 9.77614 5 9.5 5C9.22386 5 9 5.22386 9 5.5V11C9 11.1794 9.09614 11.3451 9.25193 11.4341L12.7519 13.4341C12.9917 13.5711 13.2971 13.4878 13.4341 13.2481C13.5711 13.0083 13.4878 12.7029 13.2481 12.5659L10 10.7098V5.5Z" fill="#868E96"/>
</svg>

After

Width:  |  Height:  |  Size: 477 B

91
src/App.tsx Normal file
View File

@@ -0,0 +1,91 @@
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/css/bootstrap.css'
import "primereact/resources/primereact.min.css";
import "primereact/resources/themes/lara-light-indigo/theme.css";
import '@resources/css/survey.css'
import '@resources/css/main.css'
import '@resources/css/color.css'
import '@resources/css/font.css'
import React, { useEffect, useState } from 'react'
import { Login } from '@main/Login';
import { Logout } from '../src/Logout';
import { Route, RouterProvider, createBrowserRouter, createRoutesFromElements } from 'react-router-dom';
import { MainPage } from '@main/MainPage';
import { ProjectSetup } from '@main/ProjectSetup';
import { QuestionSetup } from '@main/QuestionSetup';
import { DoSurvey } from '@main/DoSurvey';
import { ActionTotal } from '@includes/designLibrary/ActionTotal';
import { ErrorPage } from '@includes/Error';
import { LoadingPage } from '@includes/Loading';
import { QuotaSetup } from '@main/QuotaSetup';
import { ThemeSetup } from '@main/ThemeSetup';
import { DataSetup } from '@main/DataSetup';
import { ListSetup } from '@main/ListSetup';
import { GangLogin } from '@main/GangLogin';
import { CapiListSetup } from './components/capiSetup/CapiListSetup';
import { InterviewerPageSetup } from './components/capiSetup/InterviewerPageSetup';
import { CapiLogin } from '@main/CapiLogin';
import { CapiLogout } from './CapiLogout';
function useScale() {
const [scale, setScale] = useState(1);
useEffect(() => {
function updateScale() {
const scale = Math.min(1, window.innerWidth/1920);
setScale(scale);
}
window.addEventListener('resize', updateScale);
updateScale(); // 초기 스케일 설정
return () => window.removeEventListener('resize', updateScale);
}, []);
return scale;
}
function App() {
const scale = useScale();
const router = createBrowserRouter(
createRoutesFromElements(
<React.Fragment>
<Route path="/" element={<MainPage />}/>
<Route path='/login' element={<Login />} />
<Route path='/logout' element={<Logout />} />
<Route path='/Error' element={<ErrorPage />} />
<Route path='/setup/question' element={<QuestionSetup/>} />
<Route path='/setup/project' element={<ProjectSetup/>} />
<Route path='/setup/theme' element={<ThemeSetup/>} />
<Route path='/setup/quota' element={<QuotaSetup/>} />
<Route path='/setup/data' element={<DataSetup/>} />
<Route path='/setup/list' element={<ListSetup/>} />
<Route path='/survey/:stype/:skey' element={<DoSurvey/>} />
<Route path='/survey' element={<DoSurvey/>} />
<Route path="/total" element={<ActionTotal/>} />
<Route path="/loading" element={<LoadingPage/>} />
<Route path="/gangLogin" element={<GangLogin/>} />
<Route path='/capiList' element={<CapiListSetup/>} />
<Route path='/capiLogin' element={<CapiLogin/>} />
<Route path='/capiLogout' element={<CapiLogout />} />
<Route path='/interviewer' element={<InterviewerPageSetup/>} />
</React.Fragment>
)
);
return (
// <div
// style={{
// transform: `scale(${scale})`,
// // transformOrigin: 'top left',
// width: '100vw',
// height: '100vh',
// // overflow: 'auto', // 스케일링으로 인한 오버플로 방지
// }}
// >
<RouterProvider router={router}/>
// </div>
)
}
export default App;

35
src/CapiLogout.tsx Normal file
View File

@@ -0,0 +1,35 @@
import { useEffect, useState } from 'react';
import { useRecoilState } from 'recoil';
import { capiInfo, loginToken, memberInfo } from "@token/Token";
import { useNavigate } from 'react-router';
export const CapiLogout = () => {
const [token, setToken] = useRecoilState(loginToken);
// const [info, setInfo] = useRecoilState(memberInfo);
const [capiLoginInfo, setCapiLoginInfo] = useRecoilState(capiInfo);
const [tokenEmpty, setTokenEmpty] = useState(false);
const nav = useNavigate();
useEffect(() => {
setToken({
access : "",
refresh : ""
});
setCapiLoginInfo({
code : "",
loginId: "",
name: "",
info: "",
});
setTokenEmpty(true);
},[])
useEffect(() => {
if(capiLoginInfo){
nav("/capiLogin");
}
},[capiLoginInfo])
return null
}

36
src/Logout.tsx Normal file
View File

@@ -0,0 +1,36 @@
import { useEffect, useState } from 'react';
import { useRecoilState } from 'recoil';
import { loginToken, memberInfo } from "@token/Token";
import { useNavigate } from 'react-router';
export const Logout = () => {
const [token, setToken] = useRecoilState(loginToken);
const [info, setInfo] = useRecoilState(memberInfo);
const [tokenEmpty, setTokenEmpty] = useState(false);
const nav = useNavigate();
useEffect(() => {
setToken({
access : "",
refresh : ""
});
setInfo({
member_code : 0,
member_id: "",
member_name: "",
admin: 0,
group_code: "",
team_code: 999
});
setTokenEmpty(true);
},[])
useEffect(() => {
if(tokenEmpty){
nav("/login");
}
},[tokenEmpty])
return null
}

View File

@@ -0,0 +1,68 @@
import { surveyDataDeleteType } from "@modules/TypeModule";
import React, { SetStateAction, useEffect, useState } from "react"
import { Button, Table } from "react-bootstrap"
export const CapiDeleteTable = (props:{
projectCodeSearch: string,
capiDelProjectList:surveyDataDeleteType[];
setSurveyDelOkId:React.Dispatch<SetStateAction<number|null>>;
surveyDelIdOK:() => void;
setSurveyDelResult:React.Dispatch<SetStateAction<number|null>>;
}) => {
//삭제버튼 클릭시 id 넘김
const handleDeleteClick = (id: string, result:number) => {
props.setSurveyDelOkId(Number(id));
props.setSurveyDelResult(result);
};
useEffect(()=>{
props.surveyDelIdOK();
},[handleDeleteClick])
return(
<React.Fragment>
<div style={{height:"500px",overflowY:"auto"}}>
면접원이 삭제한 리스트
<Table className="tbe-list text-center chk-tbe" style={{tableLayout: "fixed"}}>
<thead>
<tr style={{borderRadius: "4px 4px 0 0"}}>
<th >응답 ID</th>
<th >최종 입력 시간</th>
<th >상태</th>
<th >삭제 이유</th>
<th >삭제</th>
</tr>
</thead>
<tbody>
{
props.capiDelProjectList.length === 0 ?
<tr>
<td style={{textAlign: "center"}} colSpan={5}>삭제 데이터가 없습니다.</td>
</tr>
: props.capiDelProjectList?.map((pele, idx) => (
<tr key={idx}>
<td style={{wordBreak: "break-all"}}>{pele.answerId}</td>
<td>{pele.answerEndTime}</td>
<td>
{ pele.answerStatus === 1 ? "진행"
: pele.answerStatus === 10 ? "완료"
: pele.answerStatus === 98 ? "쿼터아웃"
: pele.answerStatus === 99 ? "스크린"
: null
}
</td>
<td style={{wordBreak: "break-all"}}>{pele.reason}</td>
<td>
<Button variant="danger" value="1" id={pele.idx.toString()} onClick={() => handleDeleteClick(pele.idx.toString(), 1)}>삭제</Button>
<Button variant="primary" value="2" id={pele.idx.toString()} onClick={() => handleDeleteClick(pele.idx.toString(), 2)}>반려</Button>
</td>
</tr>
))
}
</tbody>
</Table>
</div>
</React.Fragment>
)
}

View File

@@ -0,0 +1,118 @@
import React, { useEffect, useState } from "react"
import { Row, Col, Button, Form } from "react-bootstrap"
import { SetterOrUpdater, useRecoilState, useRecoilValue } from "recoil"
import { loginToken, memberInfo, projectInfo, tabValue } from "@token/Token"
import { URL_SEED, axiosSessionSeed, axiosPostSeed } from "@modules/AxiosModule"
import { type headerInfoType, type interViewerList, type interViewerInsert, CapiProjectType } from "@modules/TypeModule"
import { CapiProjectSetHeader } from "./CapiProjectHeader"
import { CapiProjectSet } from "./CapiProjectSet"
import axios from "axios"
export const CapiInterview = (props:{
headerArray: headerInfoType[];
subTab:number;
projectCodeSearch: string;
setProjectCodeSearch: SetterOrUpdater<string>;
}) => {
const projectState = useRecoilValue(projectInfo);
const token = useRecoilValue(loginToken);
const [interViewerArray, setInterViewerArray] = useState<interViewerList[]>([]);
const [interViewerStatusArray, setInterViewerStatusArray] = useState<interViewerList[]>([]);
const [refreshData, setRefreshData] = useState<number | null>(null);
const [capiProjectList, setCapiProjectList] = useState<CapiProjectType[]>([]);
const getProjectList = () => {
axiosPostSeed.post(URL_SEED +'/capi/getProjectList', {}, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
setCapiProjectList(response.data);
}).catch((error) => {
console.log("getProjectList Error:", error);
})
}
const interViewerStatus = () => {
const data = {
projectCode: props.projectCodeSearch
}
axiosPostSeed.post(URL_SEED + '/capi/getInterviewerAllocationStatus', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
setInterViewerArray(response.data.interviewerList);
setInterViewerStatusArray(response.data.assignList);
}
})
}
useEffect(() => {
getProjectList();
},[props.projectCodeSearch])
useEffect(() => {
interViewerStatus();
},[refreshData])
const searchUnsignInterViewer = (text: string) => {
const lowerSearchText = text.toLowerCase(); // 대소문자 구분 없이 검색하기 위해 소문자로 변환
const copyData = [...interViewerArray]
const filtered = copyData.filter(obj =>
Object.values(obj).some(value =>
value != null && value.toString().toLowerCase().includes(lowerSearchText)
)
);
if(filtered.length > 0){
setInterViewerArray(filtered);
}
if(lowerSearchText === ""){
interViewerStatus();
}
};
const searchSignInterViewer = (text: string) => {
const lowerSearchText = text.toLowerCase(); // 대소문자 구분 없이 검색하기 위해 소문자로 변환
const copyData = [...interViewerStatusArray]
const filtered = copyData.filter(obj =>
Object.values(obj).some(value =>
value != null && value.toString().toLowerCase().includes(lowerSearchText)
)
);
if(filtered.length > 0){
setInterViewerStatusArray(filtered);
}
if(lowerSearchText === ""){
interViewerStatus();
}
};
const capiProjectClickStatus = () => {
if(props.projectCodeSearch === ""){
alert("프로젝트 코드를 입력해주세요");
return false
}
interViewerStatus();
setCapiProjectList(capiProjectList.filter((ele) => ele.project_code === props.projectCodeSearch));
}
return(
<React.Fragment>
<div className="mt-3 mb-3 ml-5" id="capiInterviewPage">
<Row>
<CapiProjectSetHeader setProjectCodeSearch={props.setProjectCodeSearch} projectCodeSearch={props.projectCodeSearch} capiProjectList={capiProjectList} capiProjectClickStatus={capiProjectClickStatus} />
</Row>
<div style={{borderBottom: '3px solid #F3F4F5'}}> </div>
<Row style={{float:"left"}}>
<CapiProjectSet interViewerArray={interViewerArray} projectCodeSearch={props.projectCodeSearch} interViewerStatusArray={interViewerStatusArray} setRefreshData={setRefreshData} setInterViewerArray={setInterViewerArray} searchUnsignInterViewer={searchUnsignInterViewer} searchSignInterViewer={searchSignInterViewer}/>
</Row>
</div>
</React.Fragment>
)
}

View File

@@ -0,0 +1,210 @@
import { CapiProjectType, getInterviewerSurveyType, headerInfoType, interViewerList } from "@modules/TypeModule";
import { Switch } from "@mui/material";
import React, { SetStateAction, useEffect, useState } from "react";
import { Button, Col, Container, Form, Pagination, Row, Table } from "react-bootstrap";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { ko } from "date-fns/esm/locale";
import axios from "axios";
import { URL_SEED, axiosPostSeed } from "@modules/AxiosModule";
import { useRecoilValue } from "recoil";
import { loginToken, projectInfo } from "@token/Token";
import { DownloadFiles } from "@modules/Function";
export const CapiInterviewSearch = (props:{
projectCodeSearch: string,
setStartDate?:React.Dispatch<SetStateAction<string|undefined>>,
setEndDate?:React.Dispatch<SetStateAction<string|undefined>>,
interviewerStatusArray:getInterviewerSurveyType[],
searchSignInterViewer:(text:string) => void,
capiListDownload:() => void,
}) => {
const [dateSearchBtn, setDateSearchBtn] = useState(false)
const now = new Date();
const newdate = new Date(now.setDate(now.getDate() + 7));
const [startOriDate, setStartOriDate] = useState<Date | null>(new Date());
const [endOriDate, setEndOriDate] = useState<Date | null>(newdate);
const [assignListArr, setAssignListArr] = useState([]);
const [listData, setListData] = useState([]);
const [searchText, setSearchText] = useState("");
const token = useRecoilValue(loginToken);
const dateSearchChange = () => {
setDateSearchBtn(!dateSearchBtn)
}
const searchClick = () => {
// props.setSearchText(serRef.current?.value.trim().toLowerCase() ?? "")
}
//날짜 형식 변환
const formatDate = (date: Date, type: 'start' | 'end') => {
if(dateSearchBtn){
const padZero = (num: number) => (num < 10 ? '0' + num : num);
const day = padZero(date.getDate());
const month = padZero(date.getMonth() + 1);
const year = date.getFullYear().toString();
const formattedDate = `${year}-${month}-${day}`;
if(type === "start" && props.setStartDate){
props.setStartDate(formattedDate)
}
else if(type === "end" && props.setEndDate){
props.setEndDate(formattedDate)
}
return formattedDate;
}
else{
if (props.setStartDate) props.setStartDate("");
if (props.setEndDate) props.setEndDate("");
}
};
useEffect(()=>{
if(startOriDate){
formatDate(startOriDate, "start")
}
},[startOriDate, dateSearchBtn])
useEffect(()=>{
if(endOriDate){
formatDate(endOriDate, "end")
}
},[endOriDate, dateSearchBtn])
return(
<React.Fragment>
<Container className="mb-2">
<Row lg='auto'>
<Col>
<Form>
<span style={{cursor:"pointer"}} onClick={() => { dateSearchChange(); }}>
<Switch name="dateSearch" checked={dateSearchBtn} onChange={() => { dateSearchChange();}} />
<span className='mb-3'>날짜별 조회</span>
</span>
</Form>
</Col>
<Col style={{ display: 'flex', alignItems: 'center' }}>
<Form className="mr-2">
<Button className='capiInterviewDownload' variant="secondary" onClick={() => props.capiListDownload()}>다운로드</Button>
</Form>
<Form.Control
id='capiInterviewId'
list='capiInterviewIdList'
placeholder="리스트"
aria-describedby="basic-addon2"
style={{maxWidth:"150px"}}
className='d-inline-block'
autoComplete="off"
onChange={(e) => props.searchSignInterViewer(e.currentTarget.value)}
// value={props.userId}
/>
{
// props.interViewerStatusArray !== "" ?
// <datalist id='capiInterviewIdList'>
// {
// props.interViewerStatusArray.map((ele) => {
// return(
// <option key={ele.answerId} value={ele.answerId}>{ele.answerId}</option>
// )
// })
// }
// </datalist>
// :
// null
}
<Button className='ml-1 capiInterviewBtn' variant="light" id="capiInterviewIdBtn" onClick={searchClick} >
검색
</Button>
</Col>
</Row>
</Container>
<Container className="capiInterviewSetCss">
{
dateSearchBtn === true ?
<Row className="surveyResponsePeriod" md={2} style={{width:"max-content"}}>
<Col>
<Row>
<div>시작 날짜</div>
</Row>
<Row>
<div>
<DatePicker
locale={ko} //한글로
selected={startOriDate}
onChange={(date) => setStartOriDate(date)}
onKeyDown={e => e.preventDefault()}
dateFormat="yyyy. MM. dd (eee)" // 표시 방법
id='startDate'
className='surveyOpenDay p-1'
/>
</div>
</Row>
</Col>
<Col>
<Row>
<div>종료 날짜</div>
</Row>
<Row>
<div>
<DatePicker
locale={ko}
selected={endOriDate}
onChange={(endDate) => setEndOriDate(endDate)}
onKeyDown={e => e.preventDefault()}
dateFormat="yyyy. MM. dd (eee)"
id='endDate'
className='surveyOpenDay p-1'
/>
</div>
</Row>
</Col>
</Row>
:
null
}
</Container>
<Container>
<div className="mt-3" id="interviewerStatusTable" style={{width: "100%", overflow:"auto", height:"80vh"}}>
<Table className="tbe-list text-center chk-tbe" style={{tableLayout:"fixed"}}>
<thead>
<tr >
<th>ID</th>
<th>완료</th>
<th>진행중</th>
<th>스크린아웃</th>
<th>쿼터아웃</th>
</tr>
</thead>
<tbody>
{
props.interviewerStatusArray.length === 0 ?
<tr>
<td style={{textAlign: "center"}} colSpan={5}>할당된 면접원이 없습니다.</td>
</tr>
: props.interviewerStatusArray.map((ele, idx) => (
<tr key={idx}>
<td>{ele.interviewerId}</td>
<td>{ele.successCount}</td>
<td>{ele.progressCount}</td>
<td>{ele.screenCount}</td>
<td>{ele.quotaCount}</td>
</tr>
))
}
</tbody>
</Table>
{/* <footer className='footer'>
<Pagination className='pageFooter'>
<Pagination.Item >{'<'}</Pagination.Item>
<Pagination.Item >{'>'}</Pagination.Item>
</Pagination>
</footer> */}
</div>
</Container>
</React.Fragment>
)
}

View File

@@ -0,0 +1,70 @@
import React, { useEffect, useState } from "react"
import { Row, Col, Button } from "react-bootstrap"
import { useRecoilState, useRecoilValue } from "recoil"
import { anywhereSkey, loginToken, memberInfo, projectInfo, tabValue } from "@token/Token"
import { Header } from "@includes/Header"
import { CapiNav, ListNav, MainLeftNav } from "@includes/LeftNav"
import { SetUpPageHeader } from "@sub/mainPage/MainToolBar"
import { useMediaQuery } from "@mui/material";
import { interViewerList, type headerInfoType } from "@modules/TypeModule"
import { CapiListUpdate } from "./CapiListUpdate"
import { CapiInterview } from "./CapiInterview"
import { CapiStatus } from "./CapiStatus"
import axios from "axios"
import { URL_SEED, axiosSessionSeed } from "@modules/AxiosModule"
import { useNavigate } from "react-router-dom"
export const CapiListSetup = () => {
/** HeaderDefault 값 */
let defaultHeaderInfo = {
idx: 0,
orderNo: 0,
headerName: "",
headerType: "",
}
const [memoriseTab, setMemoriseTab] = useRecoilState(tabValue);
const [subTab, setSubTab] = useState(memoriseTab.subtab);
const [headerArray, setHeaderArray] = useState<headerInfoType[]>([]);
const [projectCodeSearch, setProjectCodeSearch] = useState("");
const token = useRecoilValue(loginToken);
const isPc = useMediaQuery("(min-width: 1920px)");
const nav = useNavigate();
useEffect(() => {
setMemoriseTab({
subtab: subTab
})
setProjectCodeSearch("");
if (token.access === "") { // 3. token.access가 ""일 경우 /logout으로 이동합니다.
nav('/logout');
}
},[subTab, token.access])
return(
token.access === "" ? null
:
<React.Fragment>
<Header />
<SetUpPageHeader/>
<Row style={{height:"100vh",width:"100vw", margin:"0px"}} className='border border-top-1'>
{/* <MainLeftNav selTab={6}/> */}
<Col xs={2} className="bg-light">
<CapiNav subTab={subTab} upSubTabSet={setSubTab}/>
</Col>
{
subTab === 1 ? <CapiListUpdate subTab={subTab} headerArray={headerArray} />
:
subTab === 2 ? <CapiInterview subTab={subTab} headerArray={headerArray} projectCodeSearch={projectCodeSearch} setProjectCodeSearch={setProjectCodeSearch}/>
:
subTab === 3 ? <Col xs={10}>
<CapiStatus subTab={subTab} headerArray={headerArray} projectCodeSearch={projectCodeSearch} setProjectCodeSearch={setProjectCodeSearch}/>
</Col>
:
null
}
</Row>
</React.Fragment>
)
}

View File

@@ -0,0 +1,126 @@
import React, { useEffect, useState } from "react";
import { useRecoilValue } from "recoil";
import axios from "axios";
import { saveAs } from 'file-saver';
import ExcelJS from 'exceljs'
import { URL_SEED, axiosSessionSeed, axiosPostSeed } from "@modules/AxiosModule";
import { headerInfoType, interViewerList, listDataTable } from "@modules/TypeModule";
import { loginToken, projectInfo } from "@token/Token";
import { Button, Col, Form, Row } from "react-bootstrap"
import { CapiModal } from "@modals/CapiModal";
import { CapiViewTable } from "./CapiViewTable";
export const CapiListUpdate = (props:{
headerArray: headerInfoType[];
subTab:number;
}) => {
const [capiModal, setCapiModalShow] = useState(false);
const [originData, setOriginData] = useState<interViewerList[]>([]);
const [listData, setListData] = useState<interViewerList[]>([]);
const [searchText, setSearchText] = useState("");
const token = useRecoilValue(loginToken);
const listDownload = async () => {
const defaultHeader = ["면접원 이름(ID)", "면접원 전화번호(PW)", "정보"]
const wb = new ExcelJS.Workbook();
const sheet = wb.addWorksheet("면접원 리스트");
sheet.addRow(defaultHeader);
const fileData = await wb.xlsx.writeBuffer();
const blob = new Blob([fileData], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
})
saveAs(blob, `면접원 업로드 리스트`);
}
const enterPress = (e:React.KeyboardEvent<HTMLInputElement>) => {
if(e.key === "Enter"){
searchList();
setSearchText("");
}
}
const getInterViewerList = () => {
axiosPostSeed.post(URL_SEED+'/capi/getInterviewers', {},{
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
setListData(response.data);
setOriginData(response.data);
}
}).catch((error) => {
console.log("getInterviewers Error: ", error);
})
}
useEffect(() => {
getInterViewerList();
},[])
const searchList = () => {
if (!searchText) {
getInterViewerList();
}else {
const filtered = originData.filter((ele) =>
Object.values(ele).some((value) =>
value !== null && value.toString().toLowerCase().includes(searchText.toLowerCase())
)
);
setListData(filtered);
}
// setSearchText("");
}
return(
<div className="mt-3 ml-3" id="managementInterviewerBar">
<Row lg='auto'>
<Col style={{ display: 'flex'}}>
<Button
className='mr-auto mt-2 mt-lg-0'
size='sm'
variant='primary'
onClick={() => setCapiModalShow(true)}
style={{width:"10%", height:"35px"}}
>등록
</Button>
<Button className='listDownload mr-2' variant="secondary" onClick={listDownload} style={{height:"38px"}}>양식 다운로드</Button>
<Form.Control
id='listSearchForm'
list='searchList'
placeholder="면접원"
aria-describedby="basic-addon2"
style={{maxWidth:"150px"}}
className='d-inline-block boxColor'
autoComplete="off"
onKeyDown={enterPress}
onChange={(e) => setSearchText(e.currentTarget.value)}
value={ searchText }
/>
<datalist id='searchList'>
{/* {
props.answerUser.map((ele) => {
return(
<option key={ele.answerId} value={ele.answerId}>{ele.answerId}</option>
)
})
} */}
</datalist>
<Button className='ml-1 questionSetupHeaderBtn' variant="light" id="listSearchBtn" onClick={searchList}>
검색
</Button>
</Col>
</Row>
<Row style={{display:"flex", width:"100%"}}>
<CapiViewTable subTab={props.subTab} headerArray={props.headerArray} listData={listData} setListData={setListData} getInterViewerList={getInterViewerList}/>
</Row>
{
capiModal === true ?
<CapiModal show={capiModal} onHide={() => setCapiModalShow(false)} getInterViewerList={getInterViewerList}/>
:
null
}
</div>
)
}

View File

@@ -0,0 +1,116 @@
import type { CapiProjectType } from "@modules/TypeModule";
import React, { useEffect, useState } from "react";
import { Form, Button } from "react-bootstrap";
import { SetterOrUpdater, useRecoilValue } from "recoil";
import { loginToken, projectInfo } from "@token/Token";
export const CapiProjectSetHeader = (props:{
capiProjectList?:CapiProjectType[];
projectCodeSearch?:string;
setProjectCodeSearch?: SetterOrUpdater<string>;
capiProjectClickStatus?: () => void;
capiProjectListSelected?:CapiProjectType[];
}) => {
const prjInfo = useRecoilValue(projectInfo);
const token = useRecoilValue(loginToken);
useEffect(()=>{
// const temp:CapiProjectType[] | undefined = props.capiProjectList?.filter((ele) => ele.project_code === props.projectCodeSearch);
// if(temp && temp.length > 0){
// props.capiProjectClickStatus?.()
// console.log(props.capiProjectList)
// }
// else{
// props.setProjectCodeSearch("")
// }
},[props.projectCodeSearch]);
return(
<React.Fragment>
<Form.Control
list='projectCodeListSet'
placeholder="프로젝트 검색"
aria-describedby="basic-addon2"
style={{width:"200px"}}
className='d-inline-block boxColor mr-1'
autoComplete="on"
onChange={(e) => props.setProjectCodeSearch?.(e.currentTarget.value)}
/>
<datalist id="projectCodeListSet">
{
props.capiProjectList?.map((ele) => {
return(
<option key={ele.project_idx} value={ele.project_code}>{ele.project_title}</option>
)
})
}
</datalist>
<Button variant="secondary" id="pmsProject" onClick={props.capiProjectClickStatus}>검색</Button>
{
//면접원 배정
props.capiProjectList && props.capiProjectList.length === 1 ?
<span className="parameter ml-1" style={{padding: "6px 4px"}}>
[{props.capiProjectList[0]?.project_code}] {props.capiProjectList[0]?.project_title} ({props.capiProjectList[0]?.project_company === 1 ? 'KRI' : props.capiProjectList[0]?.project_company === 2 ? 'KRC' : 'KIWI'})
</span>
:
null
}
</React.Fragment>
)
}
export const CapiProjectStatusHeader = (props:{
capiProjectList?:CapiProjectType[];
projectCodeSearch?:string;
setProjectCodeSearch?: SetterOrUpdater<string>;
capiProjectClickStatus?: () => void;
capiProjectListSelected?:CapiProjectType[];
}) => {
const prjInfo = useRecoilValue(projectInfo);
const token = useRecoilValue(loginToken);
useEffect(()=>{
// const temp:CapiProjectType[] | undefined = props.capiProjectList?.filter((ele) => ele.project_code === props.projectCodeSearch);
// if(temp && temp.length > 0){
// props.capiProjectClickStatus?.()
// console.log(props.capiProjectList)
// }
// else{
// props.setProjectCodeSearch("")
// }
},[props.projectCodeSearch]);
return(
<React.Fragment>
<Form.Control
list='projectStatusCodeList'
placeholder="프로젝트 검색"
aria-describedby="basic-addon2"
style={{width:"200px"}}
className='d-inline-block boxColor mr-1'
autoComplete="on"
onChange={(e) => props.setProjectCodeSearch?.(e.currentTarget.value)}
/>
<datalist id="projectStatusCodeList">
{
props.capiProjectList?.map((ele) => {
return(
<option key={ele.project_idx} value={ele.project_code}>{ele.project_title}</option>
)
})
}
</datalist>
<Button variant="secondary" id="projectStatusCodeSearch" onClick={props.capiProjectClickStatus}>검색</Button>
{
//면접원 현황
props.capiProjectListSelected && props.capiProjectListSelected?.length > 0 ?
<span className="parameter ml-1" style={{padding: "6px 4px"}}>
[{props.capiProjectListSelected[0]?.project_code}] {props.capiProjectListSelected[0]?.project_title} ({props.capiProjectListSelected[0]?.project_company === 1 ? 'KRI' : props.capiProjectListSelected[0]?.project_company === 2 ? 'KRC' : 'KIWI'})
</span>
:
null
}
</React.Fragment>
)
}

View File

@@ -0,0 +1,232 @@
import { URL_SEED, axiosPostSeed } from "@modules/AxiosModule";
import type { interViewerInsert, interViewerList } from "@modules/TypeModule";
import { loginToken, memberInfo, projectInfo } from "@token/Token";
import axios from "axios";
import React, { useEffect, useState } from "react";
import { Button, Col, Container, Row } from "react-bootstrap";
import { SetterOrUpdater, useRecoilValue } from "recoil";
export const CapiProjectSet = (props:{
interViewerArray: interViewerList[];
interViewerStatusArray: interViewerList[];
projectCodeSearch: string;
setRefreshData: SetterOrUpdater<number | null>;
setInterViewerArray: SetterOrUpdater<interViewerList[]>;
searchUnsignInterViewer: (text:string) => void;
searchSignInterViewer: (text:string) => void;
}) => {
type interViewerStatus = {
interviewerCode: string;
projectCode: string;
regMember: number;
}
const regInfo = useRecoilValue(memberInfo);
const token = useRecoilValue(loginToken);
const [assignInterViewer, setAssignInterViewer] = useState<number[]>([]);
const [assigninterViewerCode, setAssignInterViewerCode] = useState<string[]>([]);
const [unAssignedInterViewer, setUnassignedInterViewer] = useState<number[]>([]);
const [unAssigninterViewerCode, setUnAssignInterViewerCode] = useState<string[]>([]);
// 배정 안 된 인원
const isUnUseInterviewer = (idx:number, code:string) => {
if(unAssignedInterViewer.length === 0){
// 배정 안 된 인원 idx
setAssignInterViewer(prevIdx => {
if (prevIdx.includes(idx)) {
// 이미 활성화된 row를 클릭한 경우, 해당 ID를 제거
return prevIdx.filter(userIdx => userIdx !== idx);
} else {
// 새로운 row를 활성화하는 경우, 해당 ID를 추가
return [...prevIdx, idx];
}
});
// 배정 안 된 인원 code
setAssignInterViewerCode(prevCode => {
if (prevCode.includes(code)) {
// 이미 활성화된 row를 클릭한 경우, 해당 ID를 제거
return prevCode.filter(userCode => userCode !== code);
} else {
// 새로운 row를 활성화하는 경우, 해당 ID를 추가
return [...prevCode, code];
}
});
}else{
alert("배정 안 된 인원만 선택 가능합니다.");
return false;
}
}
// 배정 된 인원
const isUseInterviewer = (idx:number, code:string) => {
if(assignInterViewer.length === 0){
// 배정 된 인원 idx
setUnassignedInterViewer(prevIdx => {
if (prevIdx.includes(idx)) {
// 이미 활성화된 row를 클릭한 경우, 해당 ID를 제거
return prevIdx.filter(userIdx => userIdx !== idx);
} else {
// 새로운 row를 활성화하는 경우, 해당 ID를 추가
return [...prevIdx, idx];
}
});
// 배정 된 인원 code
setUnAssignInterViewerCode(prevCode => {
if (prevCode.includes(code)) {
// 이미 활성화된 row를 클릭한 경우, 해당 ID를 제거
return prevCode.filter(userCode => userCode !== code);
} else {
// 새로운 row를 활성화하는 경우, 해당 ID를 추가
return [...prevCode, code];
}
});
}else{
alert("배정 된 인원만 선택 가능합니다.");
return false;
}
}
const inAndout = () => {
if(props.projectCodeSearch === ""){
alert("프로젝트를 선택해주세요.");
setAssignInterViewer([]);
setAssignInterViewerCode([]);
setUnassignedInterViewer([]);
setUnAssignInterViewerCode([]);
return false;
}
if(assignInterViewer.length === 0 && unAssignedInterViewer.length === 0){
alert("선택 된 면접원이 없습니다.");
return false;
}
if(assignInterViewer.length > 0){
if(window.confirm("선택한 면접원을 할당 해제 하시겠습니까?")){
const data = {
saveAllocationList: [],
deleteIdxList: assignInterViewer
}
axiosPostSeed.post(URL_SEED + '/capi/saveInterviewerAllocation', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
alert("할당 해제 되었습니다.");
setAssignInterViewer([]);
setAssignInterViewerCode([]);
setUnassignedInterViewer([]);
setUnAssignInterViewerCode([]);
props.setRefreshData(Date.now());
}
}).catch((error) => {
console.log("saveInterviewerAllocationError :", error)
})
}
}else{
if(window.confirm("선택한 면접원을 할당 하시겠습니까?")){
const assignList:interViewerStatus[] = [];
unAssigninterViewerCode.map((ele) => {
assignList.push({
interviewerCode: ele,
projectCode: props.projectCodeSearch,
regMember: regInfo.member_code
})
})
const data = {
saveAllocationList: assignList,
deleteIdxList: [0]
}
axiosPostSeed.post(URL_SEED + '/capi/saveInterviewerAllocation', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
alert("배정 되었습니다.");
setAssignInterViewer([]);
setAssignInterViewerCode([]);
setUnassignedInterViewer([]);
setUnAssignInterViewerCode([]);
props.setRefreshData(Date.now());
}
}).catch((error) => {
console.log("saveInterviewerAllocationError:", error)
})
}
}
}
const checkedFalse = () => {
// 선택 된 인원 체크 해제
setAssignInterViewer([]);
setAssignInterViewerCode([]);
setUnassignedInterViewer([]);
setUnAssignInterViewerCode([]);
}
return(
<React.Fragment>
<Container style={{width:"600px"}}>
<Row className="m-2">
<Button onClick={checkedFalse}>선택 해제</Button>
</Row>
<Row>
<Col>
<Row className="m-2">배정 된 면접원
<input type="text" onChange={(e) => props.searchSignInterViewer(e.currentTarget.value)} className="ml-1" placeholder="면접원 검색" style={{width:"45%"}} />
</Row>
<Row className="bg-light" style={{overflowY:"auto", height:"70vh"}}>
<Container className='bg-light h-100 border capiInterviewSetCss'>
{
props.interViewerStatusArray.map((ele) => {
return(
<Row
key={ele.idx}
onClick={ () => isUnUseInterviewer(ele.idx, ele.code) }
className={assignInterViewer.includes(ele.idx) ? 'm-1 capiInterviewSetList selected_redirectForm':'m-1 capiInterviewSetList'}
>
{ele.id +" / "+ ele.pwd}
</Row>
)
})
}
</Container>
</Row>
</Col>
<div className="m-2" style={{alignContent:"center"}} onClick={inAndout}>
<img src={'/public_img/arrow-double.svg'}/>
</div>
<Col>
<Row className="m-2">배정 안 된 면접원
<input type="text" onChange={(e) => props.searchUnsignInterViewer(e.currentTarget.value)} className="ml-1" placeholder="면접원 검색" style={{width:"45%"}}/>
</Row>
<Row className="bg-light" style={{overflowY:"auto", height:"70vh"}}>
<Container className='bg-light h-100 border capiInterviewSetCss'>
{
props.interViewerArray.map((ele) => {
return(
<Row
key={ele.idx}
onClick={ () => isUseInterviewer(ele.idx, ele.code) }
className={unAssignedInterViewer.includes(ele.idx) ? 'm-1 capiInterviewSetList selected_redirectForm':'m-1 capiInterviewSetList'}
>
{ele.id +" / "+ ele.pwd}
</Row>
)
})
}
</Container>
</Row>
</Col>
</Row>
</Container>
</React.Fragment>
)
}

View File

@@ -0,0 +1,225 @@
import { CapiProjectType, getInterviewerSurveyType, headerInfoType, interViewerList, surveyDataDeleteType } from "@modules/TypeModule";
import React, { useEffect, useState } from "react";
import { SetterOrUpdater, useRecoilValue } from "recoil";
import { loginToken, projectInfo } from "@token/Token";
import { CapiProjectStatusHeader } from "./CapiProjectHeader";
import { Col, Row } from "react-bootstrap";
import { CapiInterviewSearch } from "./CapiInterviewSearch";
import axios from "axios";
import { URL_SEED, axiosPostSeed, axiosSessionSeed } from "@modules/AxiosModule";
import { CapiDeleteTable } from "./CapiDeleteTable";
import { DownloadFiles } from "@modules/Function";
export const CapiStatus = (props:{
headerArray: headerInfoType[];
subTab:number;
projectCodeSearch: string;
setProjectCodeSearch: SetterOrUpdater<string>;
}) => {
const token = useRecoilValue(loginToken);
const [capiProjectList, setCapiProjectList] = useState<CapiProjectType[]>([]);
const [capiDelProjectList, setCapiDelProjectList] = useState<surveyDataDeleteType[]>([]);
const [interviewerStatusArray, setInterviewerStatusArray] = useState<getInterviewerSurveyType[]>([]);
const [startDate, setStartDate] = useState<string | undefined>(undefined);
const [endDate, setEndDate] = useState<string | undefined>(undefined);
const [surveyDelOkId, setSurveyDelOkId] = useState<number | null>(null);
const [surveyDelResult, setSurveyDelResult] = useState<number | null>(null);
const [capiProjectListSelected, setCapiProjectSelected] = useState<CapiProjectType[]>();
const capiProjectClickStatus = () => {
if(props.projectCodeSearch === ""){
alert("프로젝트 코드를 입력해주세요");
return false
}
// interViewerStatus();
const filteredProjects = capiProjectList.filter((ele) => ele.project_code === props.projectCodeSearch);
setCapiProjectList(filteredProjects);
setCapiProjectSelected(filteredProjects);
getProjectList();
getDelProjectList();
interViewerCurrentSituation();
}
const getProjectList = () => {
axiosSessionSeed.post(URL_SEED +'/capi/getProjectList', {}, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
setCapiProjectList(response.data);
}).catch((error) => {
console.log("getProjectList Error:", error);
})
}
//면접원 아이디 검색
const searchSignInterViewer = (text: string) => {
const lowerSearchText = text.toLowerCase(); // 대소문자 구분 없이 검색하기 위해 소문자로 변환
const copyData = [...interviewerStatusArray]
const filtered = copyData.filter(obj =>
Object.values(obj).some(value =>
value != null && value.toString().toLowerCase().includes(lowerSearchText)
)
);
if(filtered.length > 0){
setInterviewerStatusArray(filtered);
}
if(lowerSearchText === ""){
interViewerCurrentSituation();
}
};
const getDelProjectList = () => {
const data = {
projectCode: props.projectCodeSearch
}
axiosSessionSeed.post(URL_SEED +'/capi/surveyDataDeleteRequest', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
setCapiDelProjectList(response.data);
}).catch((error) => {
console.log("surveyDataDeleteRequestError :", error);
})
}
const surveyDelIdOK = () => {
if(surveyDelResult !== null){
const result = surveyDelResult === 1 ? "삭제" : "반려"
if(window.confirm(`해당 데이터를 ${result}하시겠습니까?`)){
const data = {
idx: surveyDelOkId,
result:surveyDelResult
}
axiosSessionSeed.post(URL_SEED +'/capi/surveyDataDeleteAccept', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
alert(`${result}처리 되었습니다.`)
setSurveyDelResult(null);
// getProjectList();
capiProjectClickStatus()
getDelProjectList();
// setCapiDelProjectList(response.data);
}).catch((error) => {
console.log("surveyDataDeleteAcceptError :", error);
})
}
else{
//취소시 null
setSurveyDelResult(null)
}
}
}
// const interViewerStatus = () => {
// const data = {
// projectCode: props.projectCodeSearch
// }
// axiosSessionSeed.post(URL_SEED + '/capi/getInterviewerAllocationStatus', data, {
// headers: {
// 'Authorization': `Bearer ${token.access}`,
// }
// }).then((response) => {
// if(response.status === 200){
// setInterViewerArray(response.data.interviewerList);
// setInterViewerStatusArray(response.data.assignList);
// }
// })
// }
const interViewerCurrentSituation = () => {
const data: { projectCode: string; startDate?: string; endDate?: string } = {
projectCode: props.projectCodeSearch
};
if (startDate !== "") {
data.startDate = startDate;
}
if (endDate !== "") {
data.endDate = endDate;
}
axiosSessionSeed.post(URL_SEED + '/capi/getInterviewerSurveyStatus', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
setInterviewerStatusArray(response.data)
}
}).catch((error) => {
console.log("getInterviewerSurveyStatusError :", error);
})
}
//면접원 현황 리스트 다운로드
const capiListDownload = () => {
if(interviewerStatusArray.length === 0){
alert("다운로드 가능한 면접원리스트가 없습니다");
return false
}
if(window.confirm("면접원리스트를 다운로드 하시겠습니까?")){
const data: { projectCode: string; startDate?: string; endDate?: string } = {
projectCode: props.projectCodeSearch
};
if (startDate !== "") {
data.startDate = startDate;
}
if (endDate !== "") {
data.endDate = endDate;
}
axiosPostSeed.post(URL_SEED + '/capi/interviewerDownloadList', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
responseType:'blob'
},
responseType: 'blob'
}).then((response) => {
if(response.status === 200){
DownloadFiles(`${props.projectCodeSearch}_CapiList.xlsx`, response.data);
}
}).catch((error) => {
console.log('interviewerDownloadList Error:', error);
})
}
}
useEffect(() => {
getProjectList();
interViewerCurrentSituation();
getDelProjectList();
if(props.projectCodeSearch !== "" && capiProjectList.filter((ele) => ele.project_code === props.projectCodeSearch)){
capiProjectClickStatus()
}
else{
setCapiProjectSelected(undefined)
}
},[props.projectCodeSearch, startDate, endDate])
return(
<React.Fragment>
<div className="mt-3 mb-3 ml-5" id="capiStatusPage">
<Row lg='auto' >
<CapiProjectStatusHeader setProjectCodeSearch={props.setProjectCodeSearch} projectCodeSearch={props.projectCodeSearch} capiProjectList={capiProjectList} capiProjectClickStatus={capiProjectClickStatus} capiProjectListSelected={capiProjectListSelected}/>
</Row>
<div style={{borderBottom: '3px solid #F3F4F5'}}> </div>
<Row className="mt-3 mb-3" style={{width:"100%"}}>
<Col style={{maxWidth:"50%"}}>
<CapiInterviewSearch projectCodeSearch={props.projectCodeSearch} setStartDate={setStartDate} setEndDate={setEndDate} interviewerStatusArray={interviewerStatusArray} searchSignInterViewer={searchSignInterViewer} capiListDownload={capiListDownload}/>
</Col>
<Col style={{maxWidth:"50%"}}>
<CapiDeleteTable projectCodeSearch={props.projectCodeSearch} capiDelProjectList={capiDelProjectList} setSurveyDelOkId={setSurveyDelOkId} surveyDelIdOK={surveyDelIdOK} setSurveyDelResult={setSurveyDelResult}/>
</Col>
</Row>
</div>
</React.Fragment>
)
}

View File

@@ -0,0 +1,154 @@
import { URL_SEED, axiosSessionSeed, axiosPostSeed } from "@modules/AxiosModule";
import type { headerInfoType, listDataTable, interViewerList } from "@modules/TypeModule";
import { loginToken, projectInfo } from "@token/Token";
import axios from "axios";
import React, { useState } from "react";
import { Button, Pagination, Table } from "react-bootstrap"
import { SetterOrUpdater, useRecoilValue } from "recoil";
interface totalType {
subTab:number;
listData: interViewerList[];
headerArray: headerInfoType[];
setListData: SetterOrUpdater<interViewerList[]>;
getInterViewerList: () => void;
}
export const CapiViewTable = (props:totalType) => {
const [isUpdateIdx, setIsUpdateIdx] = useState<number | null>(null); // 초기 상태를 null로 변경
const token = useRecoilValue(loginToken);
const listModify = (num: number) => {
if (isUpdateIdx === num) {
if(window.confirm("수정 하시겠습니까?")){
const data = props.listData.filter((ele) => ele.idx === num);
axiosPostSeed.post(URL_SEED + '/capi/saveInterviewer', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
alert("변경 되었습니다.");
props.getInterViewerList();
setIsUpdateIdx(null);
}
}).catch((error) => {
console.log("saveInterviewerError : ", error);
if(error.response.status === 409){
alert(error.response.data.errorMessage);
return false;
}
})
}
}else{
setIsUpdateIdx(num);
}
};
const handleInputChange = (idx: number, key:string, value: string) => {
// listData 상태 업데이트
props.setListData(currentListData =>
currentListData.map((item:interViewerList) => {
if (item.idx === idx) {
// 특정 idx를 가진 객체의 listContent 업데이트
return {
...item,
[key]: value // 입력된 key에 해당하는 필드만 업데이트
};
}
return item;
})
);
};
const deleteListIdx = (idxNum:number) => {
if(window.confirm("해당 면접원 아이디를 삭제하시겠습니까?")){
let idx = {
deleteIdxList:[idxNum]
}
axiosPostSeed.post(URL_SEED + '/capi/deleteInterviewers', idx, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
})
.then((response) => {
if(response.status === 200){
alert("삭제 되었습니다");
props.getInterViewerList();
}
})
.catch((error) => {
console.log("deleteInterviewers: ", error);
})
}
}
return(
<div className="mt-3 ml-3" id="listSearchBar" style={{width: "75vw", overflow:"auto", height:"80vh"}}>
<Table className="tbe-list text-center chk-tbe">
<thead>
<tr className="tbe-tr" style={{borderRadius: "4px 4px 0 0"}}>
<th style={{borderRight: "2px solid #fff", borderRadius:"4px 0 0 0 "}}>면접원 코드</th>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>면접원 이름(ID)</th>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>면접원 전화번호(PW)</th>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>정보</th>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>수정</th>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>삭제</th>
</tr>
</thead>
<tbody>
{
props.listData?.map((listEle:interViewerList, listIdx:number) => {
return(
<tr key={listEle.idx}>
{
listEle.idx !== isUpdateIdx ?
<React.Fragment>
<td>{listEle.code}</td>
<td>{listEle.id}</td>
<td>{listEle.pwd}</td>
<td>{listEle.info}</td>
</React.Fragment>
:
<React.Fragment>
<td>
<input type="text" style={{width:"100%"}} onChange={(e) => handleInputChange(listEle.idx, "code", e.currentTarget.value)} value={listEle.code} />
</td>
<td>
<input type="text" style={{width:"100%"}} onChange={(e) => handleInputChange(listEle.idx, "id", e.currentTarget.value)} value={listEle.id} />
</td>
<td>
<input type="text" style={{width:"100%"}} onChange={(e) => handleInputChange(listEle.idx, "pwd", e.currentTarget.value)} value={listEle.pwd} />
</td>
<td>
<input type="text" style={{width:"100%"}} onChange={(e) => handleInputChange(listEle.idx, "info", e.currentTarget.value)} value={listEle.info} />
</td>
</React.Fragment>
}
<td style={{width:"7%"}}>
<Button variant="primary" onClick={() => listModify(listEle.idx)} >
{
listEle.idx !== isUpdateIdx ? "수정" : "적용"
}
</Button>
</td>
<td style={{width:"7%"}}>
<Button variant="danger" onClick={ () => deleteListIdx(listEle.idx)}>삭제</Button>
</td>
</tr>
)
})
}
</tbody>
</Table>
{/* <footer className='footer'>
<Pagination className='pageFooter'>
<Pagination.Item >{'<'}</Pagination.Item>
<Pagination.Item >{'>'}</Pagination.Item>
</Pagination>
</footer> */}
</div>
)
}

View File

@@ -0,0 +1,98 @@
import { interViewerProgressSurveyType } from "@modules/TypeModule";
import React, { useEffect, useState } from "react";
import { Button, Table } from "react-bootstrap";
import { URL_SEED, URL_SUN, axiosSessionSeed } from "@modules/AxiosModule";
import { InterviewerSurveyDel } from "@modals/InterviewerSurveyDel";
import axios from "axios";
export const InterviewerDataList = (props:{
projectCodeSearch: string;
capiProgressSurveyList: interViewerProgressSurveyType[];
anySkey:any;
capiLoginInfo:any;
getProjectList:() => void;
capiProjectClickStatus:() => void;
goCapiSurvey:(id:string) => void;
interViewerDeleteCancel:(id:string) => void;
}) => {
const [interviewerSurveyDelModal, setInterviewerSurveyDelModal] = useState(false);
const [selectSurveyId, setSelectSurveyId] = useState<interViewerProgressSurveyType | undefined>(undefined);
//삭제버튼 클릭시 id 넘김
const handleDeleteClick = (id: string) => {
const selectedSurvey = props.capiProgressSurveyList.find(survey => survey.answerId.toString() === id);
setSelectSurveyId(selectedSurvey);
setInterviewerSurveyDelModal(true);
};
//이어서 진행
useEffect(()=>{
props.getProjectList();
},[props.projectCodeSearch])
//모달 닫으면 비워줌
useEffect(()=>{
if(interviewerSurveyDelModal === false){
setSelectSurveyId(undefined);
}
},[interviewerSurveyDelModal])
return(
<React.Fragment>
<div style={{ display: 'flex', justifyContent: 'center', maxHeight:"60%", overflowY:"auto"}}>
<Table className="tbe-list text-center chk-tbe" style={{width:"80%"}}>
<thead>
<tr style={{borderRadius: "4px 4px 0 0"}}>
<th style={{width:"16%"}}>ID</th>
<th style={{width:"16%"}}>진행 문항</th>
<th style={{width:"16%"}}>최종 입력 시간</th>
{/* <th style={{width:"16%"}}>쿼터 정보</th> */}
<th style={{width:"16%"}}>상태</th>
<th style={{width:"16%"}}>삭제</th>
</tr>
</thead>
<tbody>
{ props.capiProgressSurveyList.length === 0 ?
<tr>
<td style={{textAlign: "center"}} colSpan={5}>응답데이터가 없습니다.</td>
</tr>
: props.capiProgressSurveyList?.map((pele, idx) => (
<tr key={idx}>
<td>{pele.answerId}</td>
<td>{pele.answerEndQuestionId}</td>
<td>{pele.answerEndDate}</td>
{/* <td>쿼터</td> */}
<td>
{ pele.answerState === 1 ? <Button onClick={() => props.goCapiSurvey(pele.answerId)}> 진행 </Button>
: pele.answerState === 10 ? "완료"
: pele.answerState === 98 ? "쿼터아웃"
: pele.answerState === 99 ? "스크린"
: null
}
</td>
<td>
{
pele.deleteRequest === 0 ?
<Button variant="danger" id={pele.answerId.toString()} onClick={() => props.interViewerDeleteCancel(pele.answerId.toString())}> 삭제 취소 </Button>
: <Button variant="danger" id={pele.answerId.toString()} onClick={() => handleDeleteClick(pele.answerId.toString())}> 삭제 </Button>
}
</td>
</tr>
))
}
</tbody>
</Table>
</div>
{
interviewerSurveyDelModal === true ?
<InterviewerSurveyDel show={interviewerSurveyDelModal} onHide={() => setInterviewerSurveyDelModal(false)} selectSurveyId={selectSurveyId} capiLoginInfo={props.capiLoginInfo} getProjectList={props.getProjectList} capiProjectClickStatus={props.capiProjectClickStatus}/>
:
null
}
</React.Fragment>
)
}

View File

@@ -0,0 +1,21 @@
import { headerInfoType } from "@modules/TypeModule";
import React from "react";
import { useRecoilValue } from "recoil";
import { Row } from "react-bootstrap";
import { CapiInterviewSearch } from "./CapiInterviewSearch";
import { CapiHeader, Header } from "@includes/Header";
import { SetUpPageHeader } from "@sub/mainPage/MainToolBar";
import { InterviewerStatus } from "./InterviewerStatus";
export const InterviewerPageSetup = (props:{
}) => {
return(
<React.Fragment>
<CapiHeader />
<SetUpPageHeader/>
<InterviewerStatus/>
</React.Fragment>
)
}

View File

@@ -0,0 +1,74 @@
import { CapiProjectType, headerInfoType, interViewerList, quotaCellType, quotaLabelInfoType, quotaLabelType, quotaSetInfoType } from "@modules/TypeModule";
import React, { ChangeEvent, useEffect, useState } from "react";
import { useRecoilState, useRecoilValue } from "recoil";
import { anywhereSkey, loginToken, memberInfo, projectInfo } from "@token/Token";
import { Button, Form, Row, Table } from "react-bootstrap";
import { CapiInterviewSearch } from "./CapiInterviewSearch";
import { Header } from "@includes/Header";
import { SetUpPageHeader } from "@sub/mainPage/MainToolBar";
import { URL_SEED, axiosSessionSeed } from "@modules/AxiosModule";
import { useQuery } from "@tanstack/react-query";
import { InterviewerSurveyDel } from "@modals/InterviewerSurveyDel";
import axios from "axios";
// import { CheckQuota } from "@sub/quotaSetup/CheckQuota";
export const InterviewerProjectQuota = (props:{
projectCodeSearch: string;
capiStatusCount:any;
}) => {
const [quotaInfoList, setQuotaInfoList] = useState<quotaSetInfoType[]>([]);
const [quotaId, setQuotaId] = useState<string | null>(null);
return(
<React.Fragment>
<div style={{ display: 'flex', justifyContent: 'center' }}>
<Table className="tbe-list text-center chk-tbe" style={{width:"80%",tableLayout:"fixed"}}>
<thead>
<tr style={{borderRadius: "4px 4px 0 0"}}>
<th>완료</th>
<th>진행중</th>
<th>스크린아웃</th>
<th>쿼터아웃</th>
</tr>
</thead>
<tbody>
<tr>
{/* <td>{props.capiStatusCount.totalCount}</td> */}
<td>{props.capiStatusCount.successCount}</td>
<td>{props.capiStatusCount.progressCount}</td>
<td>{props.capiStatusCount.screenCount}</td>
<td>{props.capiStatusCount.quotaCount}</td>
</tr>
</tbody>
</Table>
</div>
{/* <Table className="tbe-list text-center chk-tbe">
<thead>
<tr style={{borderRadius: "4px 4px 0 0"}}>
<th>ex</th>
<th>남</th>
<th>여</th>
</tr>
</thead>
<tbody>
<tr>
<td>20</td>
<td>2</td>
<td>2</td>
</tr>
<tr>
<td>30</td>
<td>3</td>
<td>3</td>
</tr>
<tr>
<td>40</td>
<td>4</td>
<td>4</td>
</tr>
</tbody>
</Table> */}
</React.Fragment>
)
}

View File

@@ -0,0 +1,186 @@
import {CapiProjectType, interViewerList, interViewerProgressSurveyType} from "@modules/TypeModule";
import React, {useEffect, useState} from "react";
import {useRecoilState, useRecoilValue} from "recoil";
import {anywhereSkey, capiInfo, capiLoginToken, loginToken} from "@token/Token";
import {Button, Form} from "react-bootstrap";
import {axiosSessionSeed, URL_SEED, URL_SUN} from "@modules/AxiosModule";
import {useQuery} from "@tanstack/react-query";
import axios from "axios";
import {InterviewerDataList} from "./InterviewerDataList";
import {InterviewerProjectQuota} from "./InterviewerProjectQuota";
// import { CheckQuota } from "@sub/quotaSetup/CheckQuota";
export const InterviewerStatus = (props:{
}) => {
const token = useRecoilValue(loginToken);
const [capiLoginInfo, setCapiLoginInfo] = useRecoilState(capiInfo);
const skeyQuery = useQuery({ queryKey:["skey"], queryFn:() => makeSkey() });
const skey = skeyQuery.data || ''
const [anySkey, setAnySkey] = useRecoilState(anywhereSkey);
const [capiProjectList, setCapiProjectList] = useState<CapiProjectType[]>([]);
const [projectCodeSearch, setProjectCodeSearch] = useState("");
const [interViewerCode, setInterViewerCode] = useState("");
const [capiProgressSurveyList, setCapiProgressSurveyList] = useState<interViewerProgressSurveyType[]>([]);
const [capiStatusCount, setCapiStatusCount] = useState([]);
const [capiProjectSelected, setCapiProjectSelected] = useState<CapiProjectType[]>();
const makeSkey = async () => {
try{
const response = await axiosSessionSeed.get(URL_SUN+'/project/skey', {
params: {
project_code : projectCodeSearch,
},
headers: {
'Authorization': `Bearer ${token.access}`,
}
})
setAnySkey(response.data)
return response.data
} catch (error) {
console.log("SKEY API Error:", error);
}
}
//면접원 신규 진행 시 클릭 시간 아이디로 들어감.
const formatDate = (date: Date) => {
const padZero = (num: number) => (num < 10 ? '0' + num : num);
const day = padZero(date.getDate());
const month = padZero(date.getMonth() + 1);
const year = date.getFullYear().toString().slice(2);
const hour = padZero(date.getHours());
const minute = padZero(date.getMinutes());
const second = padZero(date.getMilliseconds());
return `${year}${month}${day}${hour}${minute}${second}`;
};
//신규 진행
const goNewCapiSurvey = () => {
const currentDate = new Date();
const currentRandomId = formatDate(currentDate);
if(projectCodeSearch !== ""){
window.open(`https://newssak.kric.com/survey/cp/${anySkey}?SID=${capiLoginInfo.code}_${currentRandomId}`, "_blank");
}else{
alert("프로젝트를 선택해주세요.");
}
}
const interViewerStatus = () => {
const data = {
projectCode: projectCodeSearch,
interviewerId: interViewerCode
}
axios.post(URL_SUN +'/capi/getInterviewerSurveyDetail', data, {
}).then((response) => {
setCapiProgressSurveyList(response.data.progressSurveyList);
setCapiStatusCount(response.data.statusCount);
}).catch((error) => {
console.log("getInterviewerSurveyDetailError :", error);
})
}
const getProjectList = () => {
const data = {
interviewerCode: capiLoginInfo.code
}
axios.post(URL_SUN +'/capi/getProjectList', data, {
}).then((response) => {
setCapiProjectList(response.data);
}).catch((error) => {
console.log("getProjectListError :", error);
})
}
const capiProjectClickStatus = () => {
if(projectCodeSearch === ""){
alert("프로젝트 코드를 입력해주세요");
return false
}
interViewerStatus();
setCapiProjectSelected(capiProjectList.filter((ele) => ele.project_code === projectCodeSearch));
}
const goCapiSurvey = (id: string) => {
window.open(`https://newssak.kric.com/survey/cp/${anySkey}?SID=${id}`, "_blank");
}
const interViewerDeleteCancel = (id: string) => {
if(window.confirm("해당 데이터를 삭제 취소하시겠습니까?")){
const data = {
projectCode: projectCodeSearch,
answerId: id,
}
axios.post(URL_SUN +'/capi/surveyDataDeleteCancel', data, {
}).then((response) => {
alert("삭제 취소 되었습니다.");
capiProjectClickStatus();
}).catch((error) => {
console.log("surveyDataDeleteCancel Error:", error);
})
}
}
useEffect(() => {
makeSkey();
interViewerStatus();
if(projectCodeSearch !== ""){
capiProjectClickStatus()
}else{
setCapiProjectSelected(undefined);
}
},[projectCodeSearch])
useEffect(() => {
setInterViewerCode(capiLoginInfo.code)
},[])
return(
<React.Fragment>
<div className="m-2" style={{textAlign:"center"}}>
<Form.Control
list='projectCodeList'
placeholder="프로젝트 리스트"
aria-describedby="basic-addon2"
style={{width:"200px"}}
className='d-inline-block boxColor mr-1'
autoComplete="on"
onChange={(e) => setProjectCodeSearch?.(e.currentTarget.value)}
/>
<datalist id="projectCodeList">
{
capiProjectList?.map((ele) => {
return(
<option key={ele.project_idx} value={ele.project_code}>{ele.project_title}</option>
)
})
}
</datalist>
<Button variant="secondary" id="pmsProject" onClick={capiProjectClickStatus}>검색</Button>
<div className="m-2">
{
capiProjectSelected && capiProjectSelected.length > 0 ?
<span className="parameter ml-1" style={{padding: "6px 4px"}}>
[{capiProjectSelected[0]?.project_code}] {capiProjectSelected[0]?.project_title} ({capiProjectSelected[0]?.project_company === 1 ? 'KRI' : capiProjectSelected[0]?.project_company === 2 ? 'KRC' : 'KIWI'})
</span>
:
null
}
</div>
</div>
<InterviewerProjectQuota projectCodeSearch={projectCodeSearch} capiStatusCount={capiStatusCount}/>
{ projectCodeSearch === "" ? null
:<div className="mb-3" id="capiSurvey" style={{textAlign:"center"}}>
<Button onClick={goNewCapiSurvey}>신규 진행</Button>
</div>
}
<InterviewerDataList projectCodeSearch={projectCodeSearch} capiProgressSurveyList={capiProgressSurveyList} anySkey={anySkey.skey} capiLoginInfo={capiLoginInfo} getProjectList={getProjectList} capiProjectClickStatus={capiProjectClickStatus} goCapiSurvey={goCapiSurvey} interViewerDeleteCancel={interViewerDeleteCancel}/>
</React.Fragment>
)
}

View File

@@ -0,0 +1,134 @@
import { useEffect, useRef, useState } from "react";
import axios from "axios";
import { Button, Modal, Table } from "react-bootstrap";
import React from "react";
import * as XLSX from 'xlsx';
import ExcelJS from 'exceljs'
import { saveAs } from 'file-saver';
import { TableDataRow } from "@modules/TypeModule";
import { URL_SEED } from "@modules/AxiosModule";
import { useRecoilValue } from "recoil";
import { loginToken, memberInfo } from "@token/Token";
export const CapiModal = (props:{
show:boolean,
onHide:() => void,
getInterViewerList: () => void
}) => {
const info = useRecoilValue(memberInfo);
const token = useRecoilValue(loginToken);
const [tableData, setTableData] = useState<TableDataRow[]>([]);
const hiddenInput = useRef<HTMLInputElement>(null);
const readFile = (file:any) => {
const reader = new FileReader();
reader.onload = (e: ProgressEvent<FileReader>) => {
const arrayBuffer: ArrayBuffer = e.target!.result as ArrayBuffer;
const data = new Uint8Array(arrayBuffer);
const workbook = XLSX.read(data, {type: "array"});
const worksheet = workbook.Sheets[workbook.SheetNames[0]];
const dataJson: TableDataRow[] = XLSX.utils.sheet_to_json(worksheet);
setTableData(dataJson);
};
reader.readAsArrayBuffer(file);
}
const uploadFile = () => {
if(hiddenInput.current){
hiddenInput.current.click();
}
}
const readToFile = (e:React.ChangeEvent<HTMLInputElement>) => {
const file = e.currentTarget.files;
if(file){
readFile(file[0]);
}
}
const insertInterViewer = () => {
if(window.confirm("업로드 하시겠습니까?")){
const interViewerArray:any[] = [];
tableData.map((ele) => {
interViewerArray.push({
id: Object.values(ele)[0],
pwd: Object.values(ele)[1],
info: Object.values(ele)[2] ?? "",
regMember: info.member_code
})
})
axios.post(URL_SEED+'/capi/saveInterviewer', interViewerArray, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
alert("성공적으로 업로드됐습니다");
setTableData([]);
props.getInterViewerList();
props.onHide();
}
}).catch((error) => {
console.log("saveInterviewer Error: ", error);
if(error.response.status === 409){
alert(error.response.data.errorMessage);
return false
}
})
}
}
return(
<Modal show={props.show} size="xl" backdrop='static'>
<Modal.Header>
<Modal.Title className="text-center">
면접원 업로드
</Modal.Title>
</Modal.Header>
<Modal.Body className="logicForm" style={{maxHeight:"600px!important", height:"600px", overflowY:"auto"}}>
<div className="mb-2">
<Button className="mr-2" variant="primary" onClick={uploadFile}>파일 선택</Button>
<input type="file" name="capi_list" ref={hiddenInput} style={{display:"none"}} onChange={readToFile} accept=".xlsx, .xls, .csv"/>
</div>
<React.Fragment>
<Table className="tbe-wrap quota-tbl text-center mt-2" style={{tableLayout:"fixed"}}>
<thead>
<tr className="tbe-tr" style={{borderRadius: "4px 4px 0 0"}}>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>면접원 이름(ID)</th>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>면접원 전화번호(PW)</th>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>정보</th>
</tr>
</thead>
<tbody>
{
tableData && tableData.map((ele, idx) => {
return(
<tr key={idx}>
{
Object.values(ele).map((objEle, objIdx) => {
return(
<td key={objIdx} style={{backgroundColor: "#fff"}}>{objEle}</td>
)
})
}
</tr>
)
})
}
</tbody>
</Table>
</React.Fragment>
</Modal.Body>
<Modal.Footer>
<div className='mt-2 mr-1 float-right'>
<Button className='project-save-btn mr-2' variant="primary" onClick={insertInterViewer}>저장</Button>
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</Modal>
)
}

View File

@@ -0,0 +1,178 @@
import { useEffect, useState } from "react";
import { useRecoilValue } from "recoil";
import axios from "axios";
import { Button, Modal, Form, Table, InputGroup } from "react-bootstrap";
import { questionInfoType } from "@modules/TypeModule";
import Editor from "@monaco-editor/react";
import { URL_SEED } from "@modules/AxiosModule";
import { loginToken, memberInfo } from "@token/Token";
import { useQuery } from "@tanstack/react-query";
export const CodeBoardModal = (props:{
show:boolean,
onHide:() => void,
// modalQidTitle:string,
// projectCode:string,
questionInfo:questionInfoType[],
// questionUniqueKey:number
}) => {
const [modalShow, setModalShow] = useState(false);
const [codeList, setCodeList] = useState<number>(1);
const listTab = () => {
setCodeList(1)
}
const writeTab = () => {
setCodeList(2)
}
return(
<Modal show={props.show} size="xl" backdrop='static'>
<Modal.Header>
<Modal.Title className="text-center">
코드 게시판
</Modal.Title>
</Modal.Header>
<Modal.Body className="logicForm" style={{maxHeight:"600px!important", height:"600px", overflowY:"auto"}}>
<div className="mb-2">
<Button className="mr-2" value="1" variant={codeList === 1 ? "primary":"secondary"} onClick={listTab}>목록</Button>
<Button value="2" variant={codeList === 2 ? "primary":"secondary"} onClick={writeTab}>작성</Button>
</div>
{
codeList === 1 ?
<>
<div className="mb-2">
<Form.Control
id='codeListSearch'
list='searchCodeList'
placeholder="리스트"
aria-describedby="basic-addon2"
style={{width:"90%"}}
className='d-inline-block'
autoComplete="off"
// onKeyDown={enterPress}
// onChange={(e) => setSearchText(e.currentTarget.value)}
// value={ searchText }
/>
<datalist id='searchCodeList'>
{/* {
props.answerUser.map((ele) => {
return(
<option key={ele.answerId} value={ele.answerId}>{ele.answerId}</option>
)
})
} */}
</datalist>
<Button className='ml-1 codeBoardListBtn' variant="light" id="codeListSearchBtn">
검색
</Button>
</div>
<Table className="tbe-wrap quota-tbl text-center mt-2" style={{tableLayout:"fixed"}}>
<thead>
<tr className="tbe-tr" style={{borderRadius: "4px 4px 0 0"}}>
<th className="codeBoardHeader" style={{borderRight: "2px solid #fff", borderRadius:"4px 0 0 0 "}}>제목 & 태그</th>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>등록자</th>
</tr>
</thead>
<tbody>
<tr className="tbe-tr">
<td style={{backgroundColor:"#f3f4f5", border:"3px solid #fff"}}>
<span style={{color:"#1CAE81"}}>dd</span><br/>
<span className='codeHashtag mr-1'>
{ "#태그"} { "#태그"}
</span>
</td>
<td style={{backgroundColor:"#f3f4f5", border:"3px solid #fff"}}>aaa</td>
</tr>
<tr className="tbe-tr">
<td style={{backgroundColor:"#f3f4f5", border:"3px solid #fff"}}>
<span style={{color:"#1CAE81"}}>dd</span><br/>
<span className='codeHashtag mr-1'>
{ "#태그"} { "#태그"}
</span>
</td>
<td style={{backgroundColor:"#f3f4f5", border:"3px solid #fff"}}>aaa</td>
</tr>
<tr className="tbe-tr">
<td style={{backgroundColor:"#f3f4f5", border:"3px solid #fff"}}>
<span style={{color:"#1CAE81"}}>dd</span><br/>
<span className='codeHashtag mr-1'>
{ "#태그"} { "#태그"}
</span>
</td>
<td style={{backgroundColor:"#f3f4f5", border:"3px solid #fff"}}>aaa</td>
</tr>
</tbody>
</Table>
</> //코드 게시판 - 목록 end
:
<>
<div className="mb-2">
<input
id="codeHeader"
type="text"
className="mr-2"
style={{width:"90%"}}
placeholder=' 하드코딩 제목'
// value={ numericOpenPrefix }
// onChange={(e) => setNumericOpenPrefix(e.currentTarget.value)}
//onKeyUp={(e) => setNumericOpenPrefix(e.currentTarget.value)}
/>
<Button className='ml-1 codeBoardWriteBtn' variant="primary" id="saveCodeBtn">
저장
</Button>
</div>
{
<div className="input-group input-group-sm mt-3 mb-3" style={{height:"98%"}}>
<Editor
height="100%"
language="javascript"
theme="vs-dark"
// value={ onLoadCode }
// onChange={ (value) => setOnLoadCode(String(value)) }
options={{
fontSize: 16,
formatOnType: true,
autoClosingBrackets: "always",
minimap: { enabled: false },
}}
/>
</div>
}
{/* <Row> */}
<div className='mt-3'> 태그 입력
<InputGroup className="mb-3 w-50" id="hashtagInput">
<Form.Control
id='hashtagInput'
// ref={hashText}
placeholder="입력해 주세요."
aria-describedby="basic-addon2"
// onKeyDown={handleOnKeyPressHashTag}
// onClick={addHashTag}
/>
<Button className='ml-1' variant="outline-secondary" id="tagButton" >
추가
</Button>
</InputGroup>
</div>
{/* </Row> */}
<div>
코드설명
</div>
<textarea style={{width:"100%"}}/>
</>
}
</Modal.Body>
<Modal.Footer>
<div className='mt-2 mr-1 float-right'>
{codeList === 2 ? <Button className='project-save-btn mr-2' variant="primary" >저장</Button> : ""}
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</Modal>
)
}

View File

@@ -0,0 +1,142 @@
import { useEffect, useRef, useState } from "react";
import { useRecoilValue } from "recoil";
import axios from "axios";
import { Button, Modal, Row, Col } from "react-bootstrap";
import { memberInfo } from "@token/Token";
import { URL_FLOWER } from "@modules/AxiosModule";
import { blobToFile } from "@modules/Function";
import FilePondPluginImageExifOrientation from "filepond-plugin-image-exif-orientation";
import FilePondPluginImagePreview from "filepond-plugin-image-preview";
import { FilePond, registerPlugin } from "react-filepond";
import "filepond/dist/filepond.min.css";
import "filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css";
registerPlugin(FilePondPluginImageExifOrientation, FilePondPluginImagePreview);
export const FileUploadModal = (props:{
skey: string,
show :boolean,
onHide: () => void
}) => {
const info = useRecoilValue(memberInfo);
const fileRef = useRef<FilePond>(null);
const [uploadedFiles, setUploadedFiles] = useState<any[]>([])
// eslint-disable-next-line react-hooks/exhaustive-deps
const uploadFiles = () => {
const fileData = fileRef.current?.getFiles()
.filter((fileItem)=>fileItem.file.name !== undefined)
.map((fileItem) => fileItem.file) || [];
let uploadData = new FormData();
uploadData.append("security_code", props.skey );
uploadData.append("member_code", String(info.member_code));
if(fileData.length > 0){
fileData.map((fileEle) => {
if(!(fileEle instanceof File)){
let newFile = blobToFile(fileEle, fileEle.name);
uploadData.append("upload_file", newFile);
}
else{
uploadData.append("upload_file", fileEle);
}
})
axios.post(URL_FLOWER+'/files/projectFilesUpload', uploadData, {headers: {"Content-Type": "multipart/form-data"}})
.then((response) => {
if(response.status === 200){
alert('저장 되었습니다');
props.onHide();
}
})
.catch((error)=>{
console.log("projectFilesUpload Error:", error)
});
}
else{
axios.post(URL_FLOWER+'/files/projectFilesEmpty', uploadData, {headers: {}})
.then((response) => {
if(response.status === 200){
alert('저장 되었습니다');
props.onHide();
}
})
.catch((error)=>{
console.log("projectFilesEmpty Error:", error)
});
}
}
useEffect(() => {
if(props.show){
fetch(URL_FLOWER+'/files/projectFiles?sc='+props.skey)
.then(response => response.json())
.then(fileUrls => {
const fileItems = fileUrls.map((url:string) => ({
source: url,
options: { type: 'server' }
}));
setUploadedFiles(fileItems);
});
}
}, [props.show]);
useEffect(() => {
const handleKeySave = (e: { key: string; ctrlKey: boolean; preventDefault: () => void; }) => {
if(props.show && e.ctrlKey && e.key?.toLowerCase() === "s"){
e.preventDefault();
uploadFiles();
}
}
window.addEventListener('keydown', handleKeySave);
return () => {
window.removeEventListener('keydown', handleKeySave);
};
},[props.show, uploadFiles])
return (
<Modal show={props.show} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title className="text-center">
{"파일 업로드"}
</Modal.Title>
</Modal.Header>
<Modal.Body className="fileUpload">
<Row className='p-3'>
<Col md={12}>
<ul className="file-ul mb-2" >
<li className="file-li">
<div className="file-wrap">
<FilePond
ref={fileRef}
credits={false}
allowReorder={true}
allowMultiple={true}
maxFiles={50}
files={uploadedFiles}
styleButtonRemoveItemPosition='right'
iconRemove='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 20px; transform:translate(-4.5px, -1px);">
<g id="icon_close">
<path id="Vector" d="M6.96967 6.96967C7.26256 6.67678 7.73744 6.67678 8.03033 6.96967L12 10.9393L15.9697 6.96967C16.2626 6.67678 16.7374 6.67678 17.0303 6.96967C17.3232 7.26256 17.3232 7.73744 17.0303 8.03033L13.0607 12L17.0303 15.9697C17.3232 16.2626 17.3232 16.7374 17.0303 17.0303C16.7374 17.3232 16.2626 17.3232 15.9697 17.0303L12 13.0607L8.03033 17.0303C7.73744 17.3232 7.26256 17.3232 6.96967 17.0303C6.67678 16.7374 6.67678 16.2626 6.96967 15.9697L10.9393 12L6.96967 8.03033C6.67678 7.73744 6.67678 7.26256 6.96967 6.96967Z" fill="#ffffff"/>
</g>
</svg>
'// <-- 리무브 아이콘 넣기
labelIdle='파일 업로드'
/>
</div>
</li>
</ul>
</Col>
</Row>
</Modal.Body>
<Modal.Footer>
<div className='mt-2 mr-1 float-right'>
<Button className='project-save-btn mr-2' variant="primary" onClick={uploadFiles} >저장</Button>
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</Modal>
)
}

View File

@@ -0,0 +1,229 @@
import { useEffect, useState } from "react";
import { useRecoilValue } from "recoil";
import axios from "axios";
import { Button, Modal, Form } from "react-bootstrap";
import { questionInfoType } from "@modules/TypeModule";
import Editor, { loader } from "@monaco-editor/react";
import { URL_SEED } from "@modules/AxiosModule";
import { loginToken, memberInfo } from "@token/Token";
import { useQuery } from "@tanstack/react-query";
import { CodeBoardModal } from "./CodeBoardModal";
export const SetHardcodeModal = (props:{
show:boolean,
onHide:() => void,
modalQidTitle:string,
projectCode:string,
questionInfo:questionInfoType[],
questionUniqueKey:number
}) => {
type historyCodeDto = {
id: string;
questionUniqueKey: number;
projectCode: string;
hardCodeType: number;
content: string;
regMember: number;
}
type historyCodeType = {
content: string;
hardCodeType: number;
projectCode: string;
questionUniqurKey: number;
regDate: string;
regMember: number;
}
const token = useRecoilValue(loginToken);
const member = useRecoilValue(memberInfo);
const [selectTab, setSelectTab] = useState<number>(1);
const [totalHistoryCode, setTotalHistoryCode] = useState<historyCodeDto[]>([]);
const [onLoadCode, setOnLoadCode] = useState<string>("");
const [onNextCode, setOnNextCode] = useState<string>("");
const [historyArray, setHistoryArray] = useState([]);
const [codeBoardModal, setCodeBoardModal] = useState(false);
loader.config({
paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.31.1/min/vs' } });
//vs: 'https://www.unpkg.com/monaco-editor/min/vs',
/** 코드게시판 */
const codeLib = () => {
setCodeBoardModal(true)
}
const historyChange = (e:React.ChangeEvent<HTMLInputElement>) => {
let historySelect:historyCodeType[] = historyArray.filter((ele:historyCodeType) => ele.regDate === e.currentTarget.value);
if(historySelect.length > 0 && selectTab === 1){
setOnLoadCode(historySelect[0]?.content);
}else{
setOnNextCode(historySelect[0]?.content);
}
if(e.currentTarget.value === ""){
hardCodeHistory();
}
}
const hardCodingInsert = () => {
// hardcode document. 입력 방지
let notInWord = /document\.\w*/gi;
if(notInWord.test(onLoadCode) || notInWord.test(onNextCode)){
alert("'document.'은 사용할 수 없는 예약어 입니다.");
return false;
}
let data = {
id: historyArray.length === 0 ? "0" : totalHistoryCode[0]?.id,
questionUniqueKey: props.questionUniqueKey,
projectCode: props.projectCode,
hardCodeType: selectTab,
content: selectTab === 1 ? onLoadCode : onNextCode,
regMember: member.member_code
}
axios.post(URL_SEED+'/hardcode/saveHardCode', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
alert("저장되었습니다.");
props.onHide();
}
}).catch((error) => {
console.log("saveHardCode Error :",error);
})
}
const hardCodeHistory = async () => {
try {
const response = await axios.get(URL_SEED+'/hardcode/getHardCode', {
headers: {
'Authorization': `Bearer ${token.access}`,
},
params: {
projectCode: props.projectCode,
questionUniqueKey: props.questionUniqueKey,
type: selectTab
}
})
if(response.data.hardCodeDto){
if(selectTab === 1){
setOnLoadCode(response.data.hardCodeDto.content);
}else{
setOnNextCode(response.data.hardCodeDto.content);
}
setHistoryArray(response.data.hardCodeHistoryDtoList);
setTotalHistoryCode([response.data.hardCodeDto]);
}else{
setOnLoadCode("//설문 진입 시 동작하는 하드코드");
setOnNextCode("//다음 버튼 클릭 시 동작하는 하드코드");
}
} catch(error) {
console.log("getHardCodeError:", error);
}
}
useEffect(() => {
setSelectTab(1);
},[props.questionUniqueKey])
useEffect(() => {
hardCodeHistory();
},[props.questionUniqueKey, selectTab])
useEffect(() => {
const handleKeySave = (e: { key: string; ctrlKey: boolean; preventDefault: () => void; }) => {
if(props.show && e.ctrlKey && e.key?.toLowerCase() === "s"){
e.preventDefault();
hardCodingInsert();
}
}
window.addEventListener('keydown', handleKeySave);
return () => {
window.removeEventListener('keydown', handleKeySave);
};
},[props.show, props.questionUniqueKey, onLoadCode, onNextCode])
return (
<Modal show={props.show} size="xl" backdrop='static'>
<Modal.Header>
<Modal.Title className="text-center">
{props.modalQidTitle} 하드코딩 설정
</Modal.Title>
</Modal.Header>
<Modal.Body className="harcodeForm" style={{height:"750px"}}>
<div style={{height:"100%"}}>
<div className="w-15 mb-1" style={{ float:"left"}}>
<Button value={1} onClick={ (e) => {setSelectTab(Number(e.currentTarget.value))} } className={selectTab === 1 ? 'btn btn-primary mr-1' : 'btn btn-secondary mr-1'}>onLoad</Button>
<Button value={2} onClick={ (e) => {setSelectTab(Number(e.currentTarget.value))} } className={selectTab === 2 ? 'btn btn-primary' : 'btn btn-secondary'} >nextClick</Button>
</div>
<div className="w-15 mb-1">
<div className='custom-sel'>
<Button onClick={ codeLib } className='btn btn-secondary float-right'>코드 게시판</Button>
{
<CodeBoardModal show={codeBoardModal} onHide={() => setCodeBoardModal(false)} questionInfo={props.questionInfo}/>
}
<Form.Control style={{cursor:"pointer", width:"18vh", height:"3vh"}} onChange={ historyChange } className='ml-1 mr-1 float-right sel-box' as='select'>
<option value=''>{'Code History'}</option>
{
historyArray.map((ele:historyCodeType, index:number) => {
return(
<option key={index} value={ele.regDate}>{ele.regDate}</option>
)
})
}
</Form.Control>
</div>
</div>
<div style={{maxHeight:"95%",height:"95%"}}>
{
selectTab === 1 ?
<div className="input-group input-group-sm mt-3 mb-3" style={{height:"98%"}}>
<Editor
height="100%"
language="javascript"
theme="vs-dark"
value={ onLoadCode }
onChange={ (value) => setOnLoadCode(String(value)) }
options={{
fontSize: 16,
formatOnType: true,
autoClosingBrackets: "always",
minimap: { enabled: false },
}}
/>
</div>
:
<div className="input-group input-group-sm mt-3 mb-3" style={{height:"98%"}}>
<Editor
height="100%"
language="javascript"
theme="vs-dark"
value={ onNextCode }
onChange={ (value) => setOnNextCode(String(value)) }
options={{
fontSize: 16,
formatOnType: true,
autoClosingBrackets: "always",
minimap: { enabled: false },
}}
/>
</div>
}
</div>
</div>
</Modal.Body>
<Modal.Footer>
<div className='mt-2 mr-1 float-right'>
<Button className='project-save-btn mr-2' variant="primary" onClick={ hardCodingInsert }>저장</Button>
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</Modal>
);
}

View File

@@ -0,0 +1,107 @@
import { useEffect, useRef, useState } from "react";
import axios from "axios";
import { Button, Form, Modal, Table } from "react-bootstrap";
import React from "react";
import * as XLSX from 'xlsx';
import ExcelJS from 'exceljs'
import { saveAs } from 'file-saver';
import { TableDataRow } from "@modules/TypeModule";
import { URL_SEED, URL_SUN } from "@modules/AxiosModule";
import { useRecoilValue } from "recoil";
import { loginToken, memberInfo } from "@token/Token";
export const InterviewerSurveyDel = (props:{
show:boolean,
onHide:() => void,
selectSurveyId:any,
capiLoginInfo:any
getProjectList:() => void;
capiProjectClickStatus:() => void;
}) => {
const [deleteReason, setDeleteReason] = useState("");
const interViewersurveyDataDeleteRequest = () => {
if(deleteReason.length === 0){
alert("삭제 이유를 기입하여주세요.");
return false;
}
if(window.confirm("해당 데이터를 삭제하시겠습니까?")){
const data = {
interviewerId: props.capiLoginInfo.code,
projectCode: props.selectSurveyId.projectCode,
answerId: props.selectSurveyId.answerId,
reason: deleteReason,
result: 0
}
axios.post(URL_SUN +'/capi/surveyDataDeleteRequest', data, {
}).then((response) => {
alert("삭제 되었습니다.");
props.onHide()
props.getProjectList();
props.capiProjectClickStatus();
}).catch((error) => {
console.log("surveyDataDeleteRequest Error:", error);
})
}
}
return(
<Modal show={props.show} size="xl" backdrop='static'>
<Modal.Header>
<Modal.Title className="text-center">
샘플 삭제
</Modal.Title>
</Modal.Header>
<Modal.Body className="logicForm" style={{maxHeight:"450px!important", height:"450px", overflowY:"auto"}}>
<React.Fragment>
<Table className="tbe-list text-center mt-2" style={{tableLayout:"fixed", textAlign:"center"}}>
<thead>
<tr style={{borderRadius: "4px 4px 0 0"}}>
<th style={{borderRight: "2px solid #fff", borderRadius:"4px 0 0 0 "}}>ID</th>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>진행 문항</th>
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>최종입력</th>
{/* <th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>쿼터 정보</th> */}
<th style={{borderRight: "2px solid #fff", borderRadius:"0 4px 0 0 "}}>상태</th>
</tr>
</thead>
<tbody>
<tr >
<td>{props.selectSurveyId.answerId}</td>
<td>{props.selectSurveyId.answerEndQuestionId}</td>
<td>{props.selectSurveyId.answerEndDate}</td>
{/* <td>쿼터</td> */}
<td>
{ props.selectSurveyId.answerState === 1 ? "진행"
: props.selectSurveyId.answerState === 10 ? "완료"
: props.selectSurveyId.answerState === 98 ? "쿼터아웃"
: props.selectSurveyId.answerState === 99 ? "스크린"
: null
}
</td>
</tr>
</tbody>
</Table>
<Form.Label>삭제 사유</Form.Label>
<div>
<textarea style={{width:"100%", height:"200px"}}
onChange={(e) => setDeleteReason(e.target.value)}
value={deleteReason}
placeholder="삭제 사유를 적어주세요."
/>
</div>
</React.Fragment>
</Modal.Body>
<Modal.Footer>
<div className='mt-2 mr-1 float-right'>
<Button className='project-save-btn mr-2' variant="danger" onClick={interViewersurveyDataDeleteRequest}>삭제</Button>
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</Modal>
)
}

View File

@@ -0,0 +1,245 @@
import { useRef, useState, useEffect } from "react";
import { Button, Modal } from "react-bootstrap";
import { SetterOrUpdater, useRecoilState } from "recoil";
import { modalProcessStatus } from "@token/Token";
import type { questionInfoType, labelInfoType } from "@modules/TypeModule";
import SunEditor from "suneditor-react";
import SunEditorCore from "suneditor/src/lib/core";
import "suneditor/dist/css/suneditor.min.css";
export const LabelModal = (props:{
show:boolean,
onHide: () => void,
dimesionText:string,
labelDimension:number,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>
}) => {
const editor = useRef<SunEditorCore>();
const [labelValue, setLabelValue] = useState('');
const [labelTextArray, setLabelTextArray] = useState<labelInfoType[] | undefined>([])
const [modalProcess, setModalProcess] = useRecoilState(modalProcessStatus);
const getSunEditorInstance = (SunEditor: SunEditorCore) => {
editor.current = SunEditor
}
const makeLabelString = (context:labelInfoType[]) => {
let editorArea = "";
context.forEach((ele) => {
editorArea += "<div>" + ele.value + "|" + ele.label + "</div>";
})
setLabelValue(editorArea);
}
useEffect(() => {
if(props.show === true){
if(props.labelDimension === 1){
setLabelTextArray([...props.questionUpdate.scalar_label!.label_info]);
}
if(props.labelDimension === 2){
setLabelTextArray([...props.questionUpdate.matrix_label!.label_info]);
}
if(props.labelDimension === 3){
setLabelTextArray([...props.questionUpdate.tensor_label!.label_info]);
}
}
},[props.questionUpdate.question_unique_key, props.show, props.labelDimension, props.questionUpdate.question_type])
useEffect(() => {
if(labelTextArray !== undefined){
makeLabelString(labelTextArray);
}
}, [labelTextArray]);
const makeLabelContent = (content:string) => {
content = content.replace(/<br>/g,"<\/div><div>")
.replace(/<p[^>]*>(.*?)<\/p>/g, "<div>$1</div>")
.replace(/<\/?(table|tbody|tr|td)[^>]*>/g, "");
const pattern = /<div>[\s\S]*?<\/div>/g;
const matches = content.match(pattern);
const filteredMatches = matches?.filter(match => {
const contentWithoutTags = match.replace(/<[^>]+>/g, '');
return contentWithoutTags
});
return filteredMatches;
}
const onHide = () => {
setLabelValue('');
setLabelTextArray([]);
props.onHide(); // 모달 닫기
}
// eslint-disable-next-line react-hooks/exhaustive-deps
const mackContent = (content:string) => {
let tempContent = content !== '' ? content : labelValue;
const addQuestionInfo = makeLabelContent(tempContent);
let infoArray:labelInfoType[] = [];
addQuestionInfo?.map((ele:string, index:number) => {
let setValue = index+1;
let setLabel = ele;
let valuePattern = /(\d+\|)/gi;
let isNotPattern = /{n}/gi;
let isEtcPattern = /{T(?!N)(\|?.)*}/gi;
let isEtcNumberPattern = /{TN(\|?.)*}/gi;
const isEtc = isEtcPattern.test(ele);
const isEtcNumber = isEtcNumberPattern.test(ele);
const isNot = isNotPattern.test(ele);
const regexValue = ele.match(valuePattern);
if(regexValue){
setLabel = setLabel.replace(regexValue[0], "");
setValue = Number(regexValue[0].replace("|",""));
}
setLabel = setLabel.replace(/<div>/g, "").replace(/<\/div>/g, "");
infoArray.push(
{
order: index + 1,
value: setValue,
label: setLabel,
open_type: 0,
decimal_point: 0,
not_duplicate: 0,
prefix: "",
suffix: "",
placeholder:"",
range: "",
is_etc: isEtc === true ? 1 : isEtcNumber === true ? 2 : 0,
is_not: isNot === true ? 1 : 0
}
)
})
if(verifyLabelInfo(infoArray)){
setLabelInfo(infoArray)
}
}
const setLabelInfo = (infoArray:labelInfoType[]) => {
let tempQuestionUpdate = {...props.questionUpdate};
switch (props.labelDimension){
case 1:
tempQuestionUpdate.scalar_label!.label_info = infoArray;
break;
case 2:
tempQuestionUpdate.matrix_label!.label_info = infoArray;
break;
case 3:
tempQuestionUpdate.tensor_label!.label_info = infoArray;
break;
}
props.setQuestionUpdate(tempQuestionUpdate)
setLabelValue('');
setLabelTextArray([]);
alert('등록되었습니다');
setModalProcess({
modalProcessStatus: true
});
props.onHide();
}
const verifyLabelInfo = (infoArray:labelInfoType[]) : boolean => {
const duplicateValue = infoArray.filter((item, i) => {
return (
infoArray.findIndex((item2, j) => {
return item.value === item2.value;
}) !== i
);
});
if(duplicateValue.length > 0){
alert('중복된 값이 있습니다.');
return false;
}
if(infoArray.filter((ele) => ele.label === '').length > 0){
if(!window.confirm('빈 보기가 있습니다. 그래도 저장하시겠습니까?')){
return false;
}
}
return true;
}
useEffect(() => {
const handleKeySave = (e: { key: string; ctrlKey: boolean; preventDefault: () => void; }) => {
if(props.show && e.ctrlKey && e.key?.toLowerCase() === "s"){
e.preventDefault();
mackContent('');
}
}
window.addEventListener('keydown', handleKeySave);
return () => {
window.removeEventListener('keydown', handleKeySave);
};
},[props.show, mackContent, labelValue])
return (
<Modal show={props.show} onHide={props.onHide} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title>
{
props.dimesionText +' 보기 설정'
}
</Modal.Title>
</Modal.Header>
<Modal.Body>
{
props.show ?
<SunEditor
getSunEditorInstance={getSunEditorInstance}
setOptions={{
buttonList: [
["undo", "redo"],
// ['paragraphStyle', 'blockquote'],
["bold", "underline", "italic"],
["fontColor", "hiliteColor"],
// ['math'] //You must add the 'katex' library at options to use the 'math' plugin.
//['imageGallery'], // You must add the "imageGalleryUrl".
// ["fullScreen", "showBlocks", "codeView"],
["removeFormat"],
["align"],
["fontSize"]
//['save'],
// '/', Line break
], // Or Array of button list, eg. [['font', 'align'], ['image']]
fontSize : [
8, 10, 14, 18, 24, 36
],
defaultTag: "div",
minHeight: "300px",
showPathLabel: false,
callBackSave: function (contents) {
mackContent(contents) //안에
}
}}
lang={'ko'}
onChange={(e) => setLabelValue(e)}
// onKeyUp={handleKeyUp}
setContents={labelValue}
autoFocus={true}
/>
: null
}
</Modal.Body>
<span className='explain ml-3 mb-1' style={{"marginTop":"-10px"}}>
이미지 태그 예시: {'{IMG|파일명|100px|100px}'}<br/>
PDF 태그 예시: {'{PDF|파일명|하이퍼링크 텍스트}'}<br/>
비디오 태그 예시: {'{VID|파일명 or 링크|100%|100%}'}
</span>
<Modal.Footer>
<Button className='project-save-btn' variant="primary" onClick={()=> {mackContent('')}}>등록</Button>
<Button variant="secondary" onClick={onHide}>닫기</Button>
</Modal.Footer>
</Modal>
)
}

View File

@@ -0,0 +1,312 @@
import { useCallback, useEffect, useState } from "react";
import { Button, Modal } from "react-bootstrap";
import {useRecoilState } from "recoil";
import axios from "axios";
import type { logicType, questionInfoType } from "@modules/TypeModule";
import { URL_SEED } from "@modules/AxiosModule";
import { loginToken, memberInfo } from "@token/Token";
import { LogicChild} from "@componentsQuestionSetup/LogicChild";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import update from "immutability-helper";
export const SetLogicModal = (props:{
show:boolean,
onHide:()=>void,
modalQidTitle:string,
projectCode:string,
questionInfo:questionInfoType[],
questionUniqueKey:number
}) => {
interface logicDataType {
project_code:string
question_unique_key:number
before_logic:logicType[]
after_logic:logicType[]
reg_member:number
}
const [info, setInfo] = useRecoilState(memberInfo);
const [token, setToken] = useRecoilState(loginToken);
const [logicData, setLogicData] = useState<logicDataType|null>(null)
const [beforeLogicArray, setBeforeLogicArray] = useState<logicType[]>([]);
const [afterLogicArray, setAfterLogicArray] = useState<logicType[]>([]);
const getLogicInfo = () => {
axios.get(URL_SEED+'/question/getQuestionLogic', {
params: {
project_code : props.projectCode,
question_unique_key: props.questionUniqueKey
},
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
if(response.data.before_logic !== null){
setBeforeLogicArray(response.data.before_logic);
}else{
setBeforeLogicArray([]);
}
if(response.data.after_logic !== null){
setAfterLogicArray(response.data.after_logic);
}else{
setAfterLogicArray([]);
}
}
}).catch(error => {
console.log("getQuestionLogic", error);
})
}
const verifyLogic = async () => {
setLogicData(null);
let qidCondition = /\b([A-Za-z]\w+)+(?![^\[]*\])/g
let valueCondition = /[=<>!]+\s*(?:[\d\/\,]*(\"\")*)/g
if(beforeLogicArray.length === 0){
setBeforeLogicArray([]);
}
if(afterLogicArray.length === 0){
setAfterLogicArray([]);
}
/** 사전로직에 빈값 확인 */
if(beforeLogicArray.filter((ele) => ele.logic === "" || ele.page === "").length > 0){
alert("빈값이 있습니다.");
return false;
}
/** 사후로직에 빈값 확인 */
if(afterLogicArray.filter((ele) => ele.logic === "" || ele.page === "").length > 0){
alert("빈값이 있습니다.");
return false;
}
let errorBeforeString = "";
beforeLogicArray.some((ele, idx) => {
let beforeLogicText = ele.logic?.toUpperCase().trim(); // 모든 공백 제거
let leftCount = [...beforeLogicText.matchAll(/\(/g)].length
let rightCount = [...beforeLogicText.matchAll(/\)/g)].length
if(leftCount !== rightCount){
errorBeforeString = `사전로직 ${(idx+1)}번째의 괄호를 확인해 주세요`;
return true;
}
let qidArray = [...beforeLogicText.matchAll(qidCondition)].filter((fele)=> !["AND","OR"].includes(fele[0]));
qidArray.some((mele) => {
if(props.questionInfo.filter((fele) => fele.question_id === mele[0]).length === 0){
errorBeforeString = `사전로직 ${(idx+1)}번째의 QID를 확인해 주세요`;
return true;
}
})
if(errorBeforeString){
return true;
}
})
if(errorBeforeString){
alert(errorBeforeString);
return false;
}
/** 사후로직에 빈값 확인 */
let errorAfterString = "";
afterLogicArray.some((ele, idx) => {
let afterLogicText = ele.logic.toUpperCase().trim(); // 모든 공백 제거
let leftCount = [...afterLogicText.matchAll(/\(/g)].length
let rightCount = [...afterLogicText.matchAll(/\)/g)].length
if(leftCount !== rightCount){
errorAfterString = `사후로직 ${(idx+1)}번째의 괄호를 확인해 주세요`;
return true;
}
let qidArray = [...afterLogicText.matchAll(qidCondition)].filter((fele)=> !["AND","OR"].includes(fele[0]));
qidArray.some((mele) => {
if(props.questionInfo.filter((fele) => fele.question_id === mele[0]).length === 0){
errorAfterString = `사후로직 ${(idx+1)}번째의 QID를 확인해 주세요`;
return true;
}
})
if(errorAfterString){
return true;
}
})
if(errorAfterString){
alert(errorAfterString);
return false;
}
/** 로직 검증 */
const data = {
project_code: props.projectCode,
question_unique_key: props.questionUniqueKey,
before_logic: beforeLogicArray,
after_logic: afterLogicArray,
reg_member: info.member_code
}
axios.post(URL_SEED+'/question/doLogicVerify', data , {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
setLogicData({...data})
}
}).catch((error) => {
alert(error.response.data.errorMessage);
console.log("doLogicVerifyError:", error)
})
}
useEffect(()=>{
if(logicData){
//////insert logic
axios.post(URL_SEED+'/question/setQuestionLogic', logicData , {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response)=>{
if(response.status === 200){
alert("저장되었습니다.");
setBeforeLogicArray([]);
setAfterLogicArray([]);
setLogicData(null);
props.onHide();
}
}).catch((error)=>{
console.log("setQuestionLogicError ", error);
})
}
},[logicData])
const addBeforeLogicBtn = () => {
setBeforeLogicArray([...beforeLogicArray, {"logic":"","page":""}]);
}
const addAfterLogicBtn = () => {
setAfterLogicArray([...afterLogicArray, {"logic":"","page":""}]);
}
const moveBeforeLogicChild = useCallback((dragIndex:number, hoverIndex:number) => {
setBeforeLogicArray((prevValues) =>
update(prevValues, {
$splice: [
[dragIndex, 1],
[hoverIndex, 0, prevValues[dragIndex]]
]
})
);
}, []);
const renderBeforeLogicChild = useCallback((logicData:logicType, logicArray:logicType[], questionInfo:questionInfoType[], eleIndex:number, questionUK:number) => {
return (
<LogicChild
key={eleIndex}
logicGroup={"before"}
logicData={logicData}
questionInfo={questionInfo}
eleIndex={eleIndex}
logicArray = {logicArray}
questionUK={questionUK}
setLogicArray = {setBeforeLogicArray}
moveLogicChild = {moveBeforeLogicChild}
/>
)
}, []);
const moveAfterLogicChild = useCallback((dragIndex:number, hoverIndex:number) => {
setAfterLogicArray((prevValues) =>
update(prevValues, {
$splice: [
[dragIndex, 1],
[hoverIndex, 0, prevValues[dragIndex]]
]
})
);
}, []);
const renderAfterLogicChild = useCallback((logicData:logicType, logicArray:logicType[], questionInfo:questionInfoType[], eleIndex:number, questiuonUK:number) => {
return (
<LogicChild
key={eleIndex}
logicGroup={"after"}
logicData={logicData}
questionInfo={questionInfo}
eleIndex={eleIndex}
logicArray = {logicArray}
questionUK={questiuonUK}
setLogicArray = {setAfterLogicArray}
moveLogicChild = {moveAfterLogicChild}
/>
)
}, []);
useEffect(() => {
if(props.show){
getLogicInfo();
}
},[props.show])
//s단축키
useEffect(() => {
const logicSaveCtrl = (e: { key: string; ctrlKey: boolean; preventDefault: () => void; }) => {
if(props.show && e.ctrlKey && e.key?.toLowerCase() === "s"){
e.preventDefault();
verifyLogic();
}
}
window.addEventListener('keydown', logicSaveCtrl);
return () => {
window.removeEventListener('keydown', logicSaveCtrl);
};
},[props.show, verifyLogic])
return (
<Modal show={props.show} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title className="text-center">
{props.modalQidTitle} 로직설정
</Modal.Title>
</Modal.Header>
<Modal.Body className="logicForm" style={{maxHeight: "600px!important",height:"600px"}}>
<div style={{height:"50%"}}>
<div className="mb-2 logic-title">사전 로직</div>
<div>
<Button onClick={ addBeforeLogicBtn }>사전 로직추가</Button>
</div>
<DndProvider backend={HTML5Backend}>
<div style={{overflowY:"auto",maxHeight:"75%",height:"75%"}}>
{
beforeLogicArray?.map((ele, index) => renderBeforeLogicChild( ele, beforeLogicArray, props.questionInfo, index, props.questionUniqueKey))
}
</div>
</DndProvider>
</div>
<div className="logicForm" style={{height:"50%"}}>
<div className="mb-2 logic-title" >사후 로직</div>
<div>
<Button onClick={ addAfterLogicBtn }>사후 로직추가</Button>
</div>
<DndProvider backend={HTML5Backend}>
<div style={{overflowY:"auto",maxHeight:"75%",height:"75%"}}>
{
afterLogicArray?.map((ele, index) => renderAfterLogicChild( ele, afterLogicArray, props.questionInfo, index, props.questionUniqueKey))
}
</div>
</DndProvider>
</div>
</Modal.Body>
<Modal.Footer>
<div className='mt-2 mr-1 float-right'>
<Button className='project-save-btn mr-2' variant="primary" onClick={ verifyLogic }>저장</Button>
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</Modal>
);
}

View File

@@ -0,0 +1,998 @@
import React, { useEffect, useState } from "react"
import { SetterOrUpdater, useRecoilState, useRecoilValue } from "recoil"
import { Button, Form, Modal } from "react-bootstrap"
import type { autoRecodeArray, labelInfoType, questionInfoType } from "@modules/TypeModule"
import { regexPureNum, regexNumRange, regexSetNumRange, regexDateRange, regexSetDateRange, regexAuto } from "@modules/Function";
import { loginToken, memberInfo, modalProcessStatus, projectInfo } from "@token/Token"
import { Switch } from "@mui/material"
import axios from "axios";
import { URL_SEED } from "@modules/AxiosModule";
export const ScalarNumericModal = (props:{
show:boolean,
onHide: () => void,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>
}) => {
const [modalProcess, setModalProcess] = useRecoilState(modalProcessStatus);
const [numericOpenType, setNumericOpenType] = useState<number | undefined>(1);
const [numericDecimalPoint, setNumericDecimalPoint] = useState<number | undefined>(0);
const [numericOpenPrefix, setNumericOpenPrefix] = useState<string | undefined>("");
const [numericOpenRange, setNumericOpenRange] = useState<string | undefined>("");
const [numericOpenPostfix, setNumericOpenPostfix] = useState<string | undefined>("");
// useEffect(() => {
// setNumericDecimalPoint(0);
// if(props.questionUpdate.scalar_label?.label_info[0].open_type !== numericOpenType){
// setNumericOpenRange("");
// }
// else{
// setNumericOpenRange(props.questionUpdate.scalar_label?.label_info[0]?.range);
// }
// },[numericOpenType])
useEffect(() => {
if(props.questionUpdate.scalar_label){
setNumericOpenType(props.questionUpdate.scalar_label?.label_info[0]?.open_type);
setNumericDecimalPoint(props.questionUpdate.scalar_label?.label_info[0]?.decimal_point);
setNumericOpenPrefix(props.questionUpdate.scalar_label?.label_info[0]?.prefix);
setNumericOpenRange(props.questionUpdate.scalar_label?.label_info[0]?.range);
setNumericOpenPostfix(props.questionUpdate.scalar_label?.label_info[0]?.suffix);
}
},[props.questionUpdate.scalar_label])
const rangeChange = (e:React.ChangeEvent<HTMLInputElement>) => {
if(numericOpenType === 3){
setNumericOpenRange(regexDateRange(e.currentTarget.value))
}else{
setNumericOpenRange(regexNumRange(e.currentTarget.value))
}
}
const setRangeText = (e:React.ChangeEvent<HTMLInputElement>) => {
if(numericOpenType === 3){
setNumericOpenRange(regexSetDateRange(e.currentTarget.value))
}else{
setNumericOpenRange(regexSetNumRange(e.currentTarget.value))
}
}
const mackContent = () => {
let infoArray:labelInfoType[] = [];
infoArray.push(
{
order: 1,
value: 1,
label: '',
open_type: numericOpenType,
decimal_point: numericDecimalPoint,
not_duplicate: 0,
prefix: numericOpenPrefix,
range: numericOpenRange,
placeholder:"",
suffix: numericOpenPostfix,
is_etc: 0,
is_not: 0
}
)
setModalProcess({
modalProcessStatus: true
});
props.onHide();
let tempQuestionUpdate = {...props.questionUpdate}
tempQuestionUpdate.scalar_label!.label_info = infoArray;
props.setQuestionUpdate(tempQuestionUpdate);
alert('등록되었습니다');
}
//s단축키
useEffect(() => {
const handleKeySave = (e: { key: string; ctrlKey: boolean; preventDefault: () => void; }) => {
if(props.show && e.ctrlKey && e.key?.toLowerCase() === "s"){
e.preventDefault();
mackContent();
}
}
window.addEventListener('keydown', handleKeySave);
return () => {
window.removeEventListener('keydown', handleKeySave);
};
},[props.show, mackContent])
return(
<Modal show={props.show} onHide={props.onHide} size="xl" backdrop='static'>
<Modal.Header>
<Modal.Title>
{ "Numeric Open 설정" }
</Modal.Title>
</Modal.Header>
<Modal.Body>
{
props.show ?
<div className="input-group input-group-sm mt-1 mb-3">
<div className='custom-sel mr-2' style={{"width":"15%"}}>
<Form.Control as='select' className='sel-box' value={ numericOpenType } onChange={ (e) => setNumericOpenType(Number(e.currentTarget.value)) }>
<option value={1}>일반</option>
<option value={2}>소수점</option>
<option value={3}>날짜</option>
</Form.Control>
</div>
{ numericOpenType === 2 ?
<input
type="text"
className="mr-2"
style={{"width":"15%"}}
placeholder='소수점 자리'
value={ numericDecimalPoint }
onChange={(e) => setNumericDecimalPoint(Number(regexPureNum(e.currentTarget.value)))}
//onKeyUp={(e) => setNumericDecimalPoint(Number(regexPureNum(e.currentTarget.value)))}
/>
:
null}
<input
type="text"
className="mr-2"
style={{"width":"20%"}}
placeholder='Pre Text'
value={ numericOpenPrefix }
onChange={(e) => setNumericOpenPrefix(e.currentTarget.value)}
//onKeyUp={(e) => setNumericOpenPrefix(e.currentTarget.value)}
/>
<input
type="text"
className="mr-2"
style={numericOpenType !== 2 ? {"width":"40%"} : {"width":"20%"}}
placeholder={ numericOpenType === 3 ? '범위 지정 ex) 2024/01/31~2024/12/31' : "범위 지정 ex) 1~99" }
value={ numericOpenRange }
onChange={ rangeChange }
onBlur={ setRangeText }
/>
<input
type="text"
className="mr-2"
style={{"width":"20%"}}
placeholder='Post Text'
value={ numericOpenPostfix }
onChange={(e) => setNumericOpenPostfix(e.currentTarget.value)}
//onKeyUp={(e) => setNumericOpenPostfix(e.currentTarget.value)}
/>
</div>
: null
}
</Modal.Body>
<Modal.Footer>
<Button className='project-save-btn' variant="primary" onClick={ mackContent }>등록</Button>
<Button variant="secondary" onClick={props.onHide}>닫기</Button>
</Modal.Footer>
</Modal>
)
}
export const ScalarStringModal = (props:{
show:boolean,
onHide: () => void,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>
}) => {
const [modalProcess, setModalProcess] = useRecoilState(modalProcessStatus);
const [stringOpenType, setStringOpenType] = useState<number | undefined>(1);
const [stringOpenPrefix, setStringOpenPrefix] = useState<string | undefined>("");
// 복수제출 버튼 Toggle
const [stringScalarToggle, setStringScalarToggle] = useState<boolean | undefined>(false);
const [stringOpenPlaceHolder, setStringOpenPlaceHolder] = useState<string | undefined>("");
const [stringOpenPostfix, setStringOpenPostfix] = useState<string | undefined>("");
useEffect(() => {
if(stringOpenType !== 4 && stringOpenType !== 5){
setStringScalarToggle(false);
}
},[stringOpenType])
useEffect(() => {
if(props.questionUpdate.scalar_label){
setStringOpenType(props.questionUpdate.scalar_label?.label_info[0]?.open_type);
setStringOpenPrefix(props.questionUpdate.scalar_label?.label_info[0]?.prefix);
setStringScalarToggle(props.questionUpdate.scalar_label?.label_info[0]?.not_duplicate === 0 ? false : true);
setStringOpenPlaceHolder(props.questionUpdate.scalar_label?.label_info[0]?.placeholder);
setStringOpenPostfix(props.questionUpdate.scalar_label?.label_info[0]?.suffix);
}
},[props.questionUpdate.scalar_label])
const mackContent = () => {
let infoArray:labelInfoType[] = [];
infoArray.push(
{
order: 1,
value: 1,
label: '',
open_type: stringOpenType,
decimal_point: 0,
not_duplicate: stringScalarToggle === false ? 0 : 1,
prefix: stringOpenPrefix,
range: "",
placeholder: stringOpenPlaceHolder,
suffix: stringOpenPostfix,
is_etc: 0,
is_not: 0
}
)
setModalProcess({
modalProcessStatus: true
});
props.onHide();
let tempQuestionUpdate = {...props.questionUpdate}
tempQuestionUpdate.scalar_label!.label_info = infoArray;
props.setQuestionUpdate(tempQuestionUpdate);
alert('등록되었습니다');
}
//s단축키
useEffect(() => {
const handleKeySave = (e: { key: string; ctrlKey: boolean; preventDefault: () => void; }) => {
if(props.show && e.ctrlKey && e.key?.toLowerCase() === "s"){
e.preventDefault();
mackContent();
}
}
window.addEventListener('keydown', handleKeySave);
return () => {
window.removeEventListener('keydown', handleKeySave);
};
},[props.show, mackContent])
return(
<Modal show={props.show} onHide={props.onHide} size="xl" backdrop='static'>
<Modal.Header>
<Modal.Title>
{ "String Open 설정" }
</Modal.Title>
</Modal.Header>
<Modal.Body>
{
props.show ?
<div className="input-group input-group-sm mt-1 mb-3">
<div className='custom-sel mr-2' style={{"width":"15%"}}>
<Form.Control as='select' className='sel-box'
value={ stringOpenType }
onChange={(e) => setStringOpenType(Number(e.currentTarget.value))}
>
<option value={1}>일반</option>
<option value={2}>한글</option>
<option value={3}>영어</option>
<option value={4}>이메일</option>
<option value={5}>전화번호</option>
<option value={6}>장문</option>
</Form.Control>
</div>
{
stringOpenType === 4 || stringOpenType === 5 ?
<Form>
<div>
<span style={{cursor:"pointer"}} onClick={ () => {setStringScalarToggle(!stringScalarToggle)}}>
<Switch
name="stringMulti"
checked={ stringScalarToggle }
onChange={() => { setStringScalarToggle(!stringScalarToggle)}}
/>
<span className='mb-1 mr-3' style={{"fontSize":"15px"}}>중복 막기</span>
</span>
</div>
</Form>
:
<Form style={{"width":"12%"}} />
}
{ stringOpenType !== 6 ?
<input
type="text"
className="mr-2"
style={{"width":"20%"}}
placeholder='Pre Text'
value={ stringOpenPrefix }
onChange={(e) => setStringOpenPrefix(e.currentTarget.value)}
onKeyUp={(e) => setStringOpenPrefix(e.currentTarget.value)}
/> :null
}
<input
type="text"
className="mr-2"
style={stringOpenType !== 6 ? {"width":"25%"} : {"width":"65%"}}
placeholder='Placeholder 지정'
value={ stringOpenPlaceHolder }
onChange={(e) => setStringOpenPlaceHolder(e.currentTarget.value)}
onKeyUp={(e) => setStringOpenPlaceHolder(e.currentTarget.value)}
/>
{ stringOpenType !== 6 ?
<input
type="text"
className="mr-2"
style={{"width":"20%"}}
placeholder='Post Text'
value={ stringOpenPostfix }
onChange={(e) => setStringOpenPostfix(e.currentTarget.value)}
onKeyUp={(e) => setStringOpenPostfix(e.currentTarget.value)}
/>
:null
}
</div>
: null
}
</Modal.Body>
<Modal.Footer>
<Button className='project-save-btn' variant="primary" onClick={ mackContent }>등록</Button>
<Button variant="secondary" onClick={props.onHide}>닫기</Button>
</Modal.Footer>
</Modal>
)
}
export const MatrixNumericModal = (props:{
show:boolean,
onHide: () => void,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>
}) => {
const [modalProcess, setModalProcess] = useRecoilState(modalProcessStatus);
const [selectedOption, setSelectedOption] = useState(1);
const [matrixOpenArray, setMatrixOpenArray] = useState<labelInfoType[]>([]);
const addMatrixOpen = () => {
setMatrixOpenArray([...matrixOpenArray, {
order: 1,
value: 1,
label: '',
open_type: 1,
decimal_point: 0,
not_duplicate: 0,
prefix: "",
range: "",
placeholder:"",
suffix: "",
is_etc: 0,
is_not: 0
}])
}
useEffect(() => {
setMatrixOpenArray(props.questionUpdate.matrix_label!.label_info);
},[props.questionUpdate.matrix_label?.label_info])
const changeOption = (e:any, index:number) => {
changeOpenType(e, index);
setSelectedOption(e.currentTarget.value);
}
const changeAttrText = (e:React.ChangeEvent<HTMLInputElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
newArray[index].label = e.target.value;
setMatrixOpenArray(newArray);
}
const changeOpenType = (e:any, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
let logicData = Number(e.target.value);
newArray[index].open_type = logicData
setMatrixOpenArray(newArray);
}
const changePrefixText = (e:React.ChangeEvent<HTMLInputElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
newArray[index].prefix = e.target.value;
setMatrixOpenArray(newArray);
}
const changeRangeText = (e:React.ChangeEvent<HTMLInputElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
if(matrixOpenArray[index]?.open_type === 3){
newArray[index].range = regexDateRange(e.target.value);
}else{
newArray[index].range = regexNumRange(e.target.value);
}
setMatrixOpenArray(newArray);
}
const changeDecimalPointText = (e:React.ChangeEvent<HTMLInputElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
newArray[index].decimal_point = Number(regexPureNum(e.target.value));
setMatrixOpenArray(newArray);
}
const setRangeText = (e:React.ChangeEvent<HTMLInputElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
if(matrixOpenArray[index]?.open_type === 2){
newArray[index].range = regexSetDateRange(e.target.value);
}else{
newArray[index].range = regexSetNumRange(e.target.value);
}
setMatrixOpenArray(newArray);
}
const changePostfixText = (e:React.ChangeEvent<HTMLInputElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
newArray[index].suffix = e.target.value;
setMatrixOpenArray(newArray);
}
const mackContent = () => {
let emptyFlag = false;
let infoArray:labelInfoType[] = [];
matrixOpenArray.map((matrixEle, matrixIdx) => {
let setValue = matrixIdx+1;
let setLabel = matrixEle;
let valuePattern = /(\d+\|)/gi;
const regexValue = matrixEle.label?.match(valuePattern);
if(regexValue){
setLabel.label = setLabel.label?.split("|")[1];
setValue = Number(regexValue[0].replace("|",""));
}
if(matrixEle.label?.trim()===""){
emptyFlag=true;
}
infoArray.push(
{
order: matrixIdx + 1,
value: setValue,
label: matrixEle.label,
open_type: matrixEle.open_type,
decimal_point: matrixEle.decimal_point,
prefix: matrixEle.prefix,
range: matrixEle.range,
placeholder: matrixEle.placeholder,
suffix: matrixEle.suffix,
is_etc: 0,
is_not: 0
}
)
})
if(emptyFlag){
alert('속성은 공백으로 설정할 수 없습니다.');
}
else{
setModalProcess({
modalProcessStatus: true
});
props.onHide();
let tempQuestionUpdate = {...props.questionUpdate}
tempQuestionUpdate.matrix_label!.label_info = infoArray;
props.setQuestionUpdate(tempQuestionUpdate);
alert('등록되었습니다');
}
}
const removeMatrixOpen = (e:React.MouseEvent<HTMLImageElement>, index:number) =>{
let newArray = [...matrixOpenArray].filter((ele, arrIdx) => index !== arrIdx );
setMatrixOpenArray(newArray);
}
const matrixOpenChild = (index:number) => {
return (
<div key={index} className="input-group input-group-sm mt-3">
<input
type="text"
className="mr-2"
style={{"width":"15%"}}
placeholder='속성'
value={ matrixOpenArray[index]?.label }
onChange={(e) => changeAttrText(e, index)}
/>
<div className='custom-sel mr-2' style={{"width":"15%"}}>
<Form.Control as='select' className='sel-box'
value={ matrixOpenArray[index]?.open_type }
onChange={ (e) => changeOption(e, index) }
>
<option value={1}>일반</option>
<option value={2}>소수점</option>
<option value={3}>날짜</option>
</Form.Control>
</div>
{matrixOpenArray[index]?.open_type === 2 ?
<input
type="text"
className="mr-2"
style={{"width":"10%"}}
placeholder='소수점 자리'
value={ matrixOpenArray[index]?.decimal_point }
onChange={(e) => changeDecimalPointText(e, index)}
/>
:null}
<input
type="text"
className="mr-2"
style={{"width":"15%"}}
placeholder='Pre Text'
value={ matrixOpenArray[index]?.prefix }
onChange={(e) => changePrefixText(e, index)}
/>
<input
type="text"
className="mr-2"
style={{"width":"20%"}}
placeholder={matrixOpenArray[index]?.open_type === 3 ? '범위 지정 ex) 2024/01/31~2024/12/31' : '범위 지정 ex) 1~99'}
value={ matrixOpenArray[index]?.range }
onChange={(e) => changeRangeText(e, index)}
onBlur={(e) => setRangeText(e, index)}
/>
<input
type="text"
className="mr-2"
style={{"width":"15%"}}
placeholder='Post Text'
value={ matrixOpenArray[index]?.suffix }
onChange={(e) => changePostfixText(e, index)}
/>
<img className="mr-2" src={'/public_img/Intersect.svg'} onClick={ (e) => removeMatrixOpen(e, index) }/>
</div>
)
}
//s단축키
useEffect(() => {
const handleKeySave = (e: { key: string; ctrlKey: boolean; preventDefault: () => void; }) => {
if(props.show && e.ctrlKey && e.key.toLowerCase() === "s"){
e.preventDefault();
mackContent();
}
}
window.addEventListener('keydown', handleKeySave);
return () => {
window.removeEventListener('keydown', handleKeySave);
};
},[props.show, mackContent])
return(
<Modal show={props.show} onHide={props.onHide} size="xl" backdrop='static'>
<Modal.Header>
<Modal.Title>
{ "Matrix Numeric 설정" }
</Modal.Title>
</Modal.Header>
<Modal.Body style={{"overflowY":"scroll"}}>
{
props.show ?
<React.Fragment>
<div>
<Button onClick={ addMatrixOpen } >Open 문항 추가</Button>
</div>
{
matrixOpenArray?.map((ele, index) => matrixOpenChild(index))
}
</React.Fragment>
: null
}
</Modal.Body>
<Modal.Footer>
<Button className='project-save-btn' variant="primary" onClick={ mackContent }>등록</Button>
<Button variant="secondary" onClick={props.onHide}>닫기</Button>
</Modal.Footer>
</Modal>
)
}
export const MatrixStringModal = (props:{
show:boolean,
onHide: () => void,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>
}) => {
const [modalProcess, setModalProcess] = useRecoilState(modalProcessStatus);
const [matrixOpenArray, setMatrixOpenArray] = useState<labelInfoType[]>([]);
// 복수제출 버튼 Toggle
const [stringMulti, setStringMulti] = useState(false);
const addMatrixOpen = () => {
setMatrixOpenArray([...matrixOpenArray, {
order: 1,
value: 1,
label: '',
open_type: 1,
decimal_point: 0,
not_duplicate: 0,
prefix: "",
range: "",
placeholder:"",
suffix: "",
is_etc: 0,
is_not: 0
}])
}
useEffect(() => {
setMatrixOpenArray(props.questionUpdate.matrix_label!.label_info);
},[props.questionUpdate.matrix_label?.label_info])
const changeAttrText = (e:React.ChangeEvent<HTMLInputElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
newArray[index].label = e.target.value;
setMatrixOpenArray(newArray);
}
const changeDupulicate = (e:React.MouseEvent<HTMLElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
newArray[index].not_duplicate = stringMulti === false ? 0 : 1;
setMatrixOpenArray(newArray);
}
const changeOpenType = (e:any, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
let logicData = Number(e.target.value);
newArray[index].open_type = logicData
if(logicData !== 4 && logicData !== 5){
newArray[index].not_duplicate = 0;
}
setMatrixOpenArray(newArray);
}
const changePrefixText = (e:React.ChangeEvent<HTMLInputElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
newArray[index].prefix = e.target.value;
setMatrixOpenArray(newArray);
}
const changePalaceHolderText = (e:React.ChangeEvent<HTMLInputElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
newArray[index].placeholder = e.target.value;
setMatrixOpenArray(newArray);
}
const changePostfixText = (e:React.ChangeEvent<HTMLInputElement>, index:number) => {
e.preventDefault();
let newArray = [...matrixOpenArray];
newArray[index].suffix = e.target.value;
setMatrixOpenArray(newArray);
}
const mackContent = () => {
let emptyFlag = false;
let infoArray:labelInfoType[] = [];
matrixOpenArray.map((matrixEle, matrixIdx) => {
let setValue = matrixIdx+1;
let setLabel = matrixEle;
let valuePattern = /(\d+\|)/gi;
const regexValue = matrixEle.label?.match(valuePattern);
if(regexValue){
setLabel.label = setLabel.label?.split("|")[1];
setValue = Number(regexValue[0].replace("|",""));
}
if(matrixEle.label?.trim() === ""){
emptyFlag = true;
}
infoArray.push(
{
order: matrixIdx + 1,
value: setValue,
label: matrixEle.label,
open_type: matrixEle.open_type,
decimal_point: 0,
not_duplicate: matrixEle.not_duplicate,
prefix: matrixEle.prefix,
range: "",
placeholder:matrixEle.placeholder,
suffix: matrixEle.suffix,
is_etc: 0,
is_not: 0
}
)
})
if(emptyFlag){
alert('속성은 공백으로 설정할 수 없습니다.');
}
else{
setModalProcess({
modalProcessStatus: true
});
props.onHide();
let tempQuestionUpdate = {...props.questionUpdate}
tempQuestionUpdate.matrix_label!.label_info = infoArray;
props.setQuestionUpdate(tempQuestionUpdate);
alert('등록되었습니다');
}
}
const removeMatrixOpen = (e:React.MouseEvent<HTMLImageElement>, index:number) =>{
let newArray = [...matrixOpenArray].filter((ele, arrIdx) => index !== arrIdx );
setMatrixOpenArray(newArray);
}
const matrixOpenChild = (index:number) => {
return (
<div key={index} className="input-group input-group-sm mt-1 mb-3">
<input
type="text"
className="mr-2"
style={{"width":"15%"}}
placeholder='속성'
value={ matrixOpenArray[index]?.label }
onChange={(e) => changeAttrText(e, index)}
/>
<div className='custom-sel mr-2' style={{"width":"10%"}}>
<Form.Control as='select' className='sel-box'
value={ matrixOpenArray[index]?.open_type }
onChange={(e) => changeOpenType(e, index)}
>
<option value={1}>일반</option>
<option value={2}>한글</option>
<option value={3}>영어</option>
<option value={4}>이메일</option>
<option value={5}>전화번호</option>
{
props.questionUpdate.question_dimension === 3? null//tensor일 경우 장문 지우기
:
<option value={6}>장문</option>
}
</Form.Control>
</div>
{
matrixOpenArray[index]?.open_type === 4 || matrixOpenArray[index]?.open_type === 5 ?
<Form>
<div>
<span style={{cursor:"pointer"}} onClick={ (e) => { changeDupulicate (e, index); setStringMulti(!stringMulti) } }>
<Switch name="stringMulti" checked={ matrixOpenArray[index].not_duplicate === 0 ? false : true } onChange={ () => setStringMulti(!stringMulti) } />
<span className='mb-1 mr-3' style={{"fontSize":"15px"}}>중복 막기</span>
</span>
</div>
</Form>
:
<Form style={{"width":"12%"}} />
}
<input
type="text"
className="mr-2"
style={{"width":"15%"}}
placeholder='Pre Text'
value={ matrixOpenArray[index]?.prefix }
onChange={(e) => changePrefixText(e, index)}
/>
<input
type="text"
className="mr-2"
style={{"width":"15%"}}
placeholder='Placeholder 지정'
value={ matrixOpenArray[index]?.placeholder }
onChange={(e) => changePalaceHolderText(e, index)}
/>
<input
type="text"
className="mr-2"
style={{"width":"15%"}}
placeholder='Post Text'
value={ matrixOpenArray[index]?.suffix }
onChange={(e) => changePostfixText(e, index)}
/>
<img className="mr-2" src={'/public_img/Intersect.svg'} onClick={ (e) => removeMatrixOpen(e, index) }/>
</div>
)
}
//s단축키
useEffect(() => {
const handleKeySave = (e: { key: string; ctrlKey: boolean; preventDefault: () => void; }) => {
if(props.show && e.ctrlKey && e.key.toLowerCase() === "s"){
e.preventDefault();
mackContent();
}
}
window.addEventListener('keydown', handleKeySave);
return () => {
window.removeEventListener('keydown', handleKeySave);
};
},[props.show, mackContent])
return(
<Modal show={props.show} onHide={props.onHide} size="xl" backdrop='static'>
<Modal.Header>
<Modal.Title>
{ "Matrix String Open 설정" }
</Modal.Title>
</Modal.Header>
<Modal.Body style={{"overflowY":"scroll"}}>
{
props.show ?
<React.Fragment>
<div>
<Button onClick={ addMatrixOpen }>Open 문항 추가</Button>
</div>
{
matrixOpenArray?.map((ele, index) => matrixOpenChild(index))
}
</React.Fragment>
: null
}
</Modal.Body>
<Modal.Footer>
<Button className='project-save-btn' variant="primary" onClick={ mackContent }>등록</Button>
<Button variant="secondary" onClick={props.onHide}>닫기</Button>
</Modal.Footer>
</Modal>
)
}
export const AutoRecodeModal = (props:{
show:boolean,
onHide: () => void,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>,
setAutoRecodeArray:SetterOrUpdater<autoRecodeArray[]>
}) => {
const [autoArray, setAutoArray] = useState<autoRecodeArray[]>([]);
const info = useRecoilValue(memberInfo);
const project = useRecoilValue(projectInfo);
const token = useRecoilValue(loginToken);
let defaultAuto = {
idx: 0,
projectCode: project.prjcode,
questionUniqueKey: props.questionUpdate.question_unique_key,
recodeValue: 0,
recodeCondition: "",
regMember: info.member_code
}
useEffect(() => {
let autoEmptyArray:autoRecodeArray[] = [...autoArray];
if(autoEmptyArray.length > 0){
props.questionUpdate.scalar_label?.label_info.map((ele, idx) => {
if(ele.value !== autoEmptyArray[idx]?.recodeValue){
autoEmptyArray.push({...defaultAuto, recodeValue: Number(ele.value)});
}
})
}else{
props.questionUpdate.scalar_label?.label_info.map((ele:labelInfoType, idx:number) => {
autoEmptyArray.push({...defaultAuto, recodeValue: Number(ele.value)});
})
}
if(props.questionUpdate.question_dimension !== 9){
autoEmptyArray = [];
}
setAutoArray(autoEmptyArray);
},[props.questionUpdate.question_dimension, props.questionUpdate.scalar_label?.label_info])
useEffect(() => {
let autoData = {
projectCode: project.prjcode,
questionUniqueKey:props.questionUpdate.question_unique_key
}
axios.post(URL_SEED+'/question/getAutoRecode', autoData, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
setAutoArray(response.data);
}
}).catch((error) => {
console.log("getAutoRecode :", error);
})
},[props.questionUpdate.question_unique_key])
//s단축키
useEffect(() => {
const handleKeySave = (e: { key: string; ctrlKey: boolean; preventDefault: () => void; }) => {
if(props.show && e.ctrlKey && e.key.toLowerCase() === "s"){
e.preventDefault();
autoSave();
}
}
window.addEventListener('keydown', handleKeySave);
return () => {
window.removeEventListener('keydown', handleKeySave);
};
},[props.show])
const autoValueChange = (e:React.ChangeEvent<HTMLInputElement>, value:number) => {
let copyArray:autoRecodeArray[] = [...autoArray];
if(copyArray.length > 0){
props.questionUpdate.scalar_label?.label_info.map((ele, idx) => {
if(ele.value !== copyArray[idx]?.recodeValue){
copyArray.push({...defaultAuto, recodeValue: Number(ele.value)});
}
})
}else{
props.questionUpdate.scalar_label?.label_info.map((ele, idx) => {
copyArray.push({...defaultAuto, recodeValue: Number(ele.value)});
})
}
copyArray.filter((ele) => {
if (ele.recodeValue === value) {
ele.recodeCondition = regexAuto(e.currentTarget.value);
}
});
if (props.questionUpdate.question_type === 41 && copyArray.length > 0) {
copyArray[0].recodeCondition = regexAuto(e.currentTarget.value);
}
setAutoArray(copyArray);
}
const autoSave = () => {
props.setAutoRecodeArray(autoArray);
alert("저장되었습니다.");
props.onHide();
}
return(
<div>
{ props.questionUpdate.question_dimension === 9 ?
<Modal show={props.show} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title className="text-center">
{
props.questionUpdate.auto_type === 1 ? "Auto Recode" : "Brand Recode"
}
</Modal.Title>
</Modal.Header>
<Modal.Body className="AutoRecodeForm" style={{maxHeight:"600px!important", height:"600px", overflowY:"auto",textAlign:"center"}} >
{
props.questionUpdate.scalar_label?.label_info.length === 0 && props.questionUpdate.question_type !== 41?
"보기를 입력해주세요."
:
props.questionUpdate.question_type === 41 ?
<div className="txt-list lbl-wrap">
<span className="tbe-pre">{"1"}</span>
<div className="txt-list txt-list-post">
<input
type="text"
style={{width:"100%"}}
value={autoArray[0]?.recodeCondition}
onChange={(e) => autoValueChange(e, Number(1))}
/>
</div>
</div>
:
props.questionUpdate.scalar_label?.label_info.map((ele, index) => (
<div key={index} className="txt-list lbl-wrap">
<span className="tbe-pre" style={{width: "20%"}}>{ele.label?.replace(/(<([^>]+)>)/ig, "")}</span>
<div className="txt-list txt-list-post">
<input
type="text"
style={{width:"100%"}}
value={autoArray[index]?.recodeCondition}
onChange={(e) => autoValueChange(e, Number(ele.value))}
/>
</div>
</div>
))
}
</Modal.Body>
<Modal.Footer>
<div className='mt-2 mr-1 float-right'>
<Button className='project-save-btn mr-2' variant="primary" onClick={autoSave}>저장</Button>
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</Modal>
:
null
}
</div>
)
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,60 @@
import React, { useEffect, useState } from "react"
import { Modal, Nav } from "react-bootstrap"
import { MoveQuestion } from "@componentsQuestionSetup/MoveQuestion";
import { DeleteQuestion } from "@componentsQuestionSetup/DeleteQuestion";
import { BlockQuestion } from "@componentsQuestionSetup/BlockQuestion";
import { CopyQuestion } from "@componentsQuestionSetup/CopyQuestion";
import { questionInfoType } from "@modules/TypeModule";
import { SetterOrUpdater } from "recoil";
export const QuestionManagement = (props:{
show: boolean,
questionInfo: questionInfoType[],
setDeleteFlag: SetterOrUpdater<boolean>,
setCopyFlag: SetterOrUpdater<boolean>,
setQuestionRefresh: SetterOrUpdater<number | null>,
onHide: () => void
}) => {
type ComponentMap = {
[key: number]: JSX.Element;
}
const [activeNav, setActiveNav] = useState(1);
const componentMap:ComponentMap = {
1: <MoveQuestion onHide={props.onHide} questionInfo={props.questionInfo} setQuestionRefresh={props.setQuestionRefresh}/>,
2: <DeleteQuestion onHide={props.onHide} setDeleteFlag={props.setDeleteFlag} questionInfo={props.questionInfo} setQuestionRefresh={props.setQuestionRefresh}/>,
3: <CopyQuestion onHide={props.onHide} setCopyFlag={props.setCopyFlag} questionInfo={props.questionInfo} setQuestionRefresh={props.setQuestionRefresh}/>,
4: <BlockQuestion onHide={props.onHide} setQuestionRefresh={props.setQuestionRefresh} questionInfo={props.questionInfo} />
};
useEffect(() => {
setActiveNav(1);
},[props.show])
return(
<Modal show={props.show} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title className="text-center">
문항 관리
</Modal.Title>
</Modal.Header>
<div className="d-inline-flex text-center border-bottom">
<Nav.Item className="w-25" style={{borderBottom: activeNav === 1 ? '2px solid #6C757D' : '0px solid black' }}>
<Nav.Link onClick={() => setActiveNav(1)}>순서 변경</Nav.Link>
</Nav.Item>
<Nav.Item className="w-25" style={{borderBottom: activeNav === 2 ? '2px solid #6C757D' : '0px solid black' }}>
<Nav.Link onClick={() => setActiveNav(2)}>일괄 / 선택 삭제</Nav.Link>
</Nav.Item>
<Nav.Item className="w-25" style={{borderBottom: activeNav === 3 ? '2px solid #6C757D' : '0px solid black' }}>
<Nav.Link onClick={() => setActiveNav(3)}>문항 복사</Nav.Link>
</Nav.Item>
<Nav.Item className="w-25" style={{borderBottom: activeNav === 4 ? '2px solid #6C757D' : '0px solid black' }}>
<Nav.Link onClick={() => setActiveNav(4)}>블록 설정</Nav.Link>
</Nav.Item>
</div>
{
componentMap[activeNav] || null
}
</Modal>
)
}

View File

@@ -0,0 +1,470 @@
import { useEffect, useRef } from "react";
import { SetterOrUpdater } from "recoil";
import { Button, Modal } from "react-bootstrap";
import { changeInequalitySign, changeLTGT } from "@modules/Function";
import type {questionInfoType} from "@modules/TypeModule";
import SunEditor from "suneditor-react";
import SunEditorCore from "suneditor/src/lib/core";
export const QuestionTitleModal = (props:{
titleOpen:boolean,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>,
saveBtn: () => void,
closeBtn: () => void,
}) =>{
const editor = useRef<SunEditorCore>();
const getSunEditorInstance = (SunEditor: SunEditorCore) => {
editor.current = SunEditor
}
//테이블 있을 시 border 추가
const applyTableStyle = (htmlContent: string) => {
const parser = new DOMParser();
const doc = parser.parseFromString(htmlContent, 'text/html');
// 모든 테이블 요소 찾기
const tables = doc.querySelectorAll('table');
tables.forEach(table => {
// 테이블에 스타일 추가
(table as HTMLElement).style.border = 'solid 1px black';
// 모든 셀에도 동일한 스타일 적용
const cells = table.querySelectorAll('td, th');
cells.forEach(cell => {
(cell as HTMLElement).style.border = 'solid 1px black';
});
});
return doc.body.innerHTML;
}
return(
<Modal show={props.titleOpen} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title>
제목 입력
</Modal.Title>
</Modal.Header>
<Modal.Body>
{
props.titleOpen ?
<SunEditor
getSunEditorInstance={getSunEditorInstance}
setOptions={{
buttonList: [
["undo", "redo"],
// ['paragraphStyle', 'blockquote'],
[ "bold", "underline", "italic" ],
["fontColor", "hiliteColor"],
['lineHeight'],
// ['math'] //You must add the 'katex' library at options to use the 'math' plugin.
//['imageGallery'], // You must add the "imageGalleryUrl".
["table"],
["removeFormat"],
["align"],
["fontSize"]
// ['save', 'template'],
// '/', Line break
], // Or Array of button list, eg. [['font', 'align'], ['image']]
fontSize : [
8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 24, 36
],
minHeight: "300px",
showPathLabel: false,
callBackSave: props.saveBtn,
}}
lang={'ko'}
onChange={() => {
let tempQuestionUpdate = {...props.questionUpdate}
const updatedContent = editor.current?.getContents(false) || "";
const cleanContent = updatedContent.replace(/<!--.*?-->/gs, "").replace(/style="[^"]*margin-left:[^"]*"/gi, ""); // 메타데이터 제거
const styledContent = applyTableStyle(cleanContent);
tempQuestionUpdate.question_title = changeLTGT(styledContent);
props.setQuestionUpdate(tempQuestionUpdate)
}}
onKeyUp={() => {
let tempQuestionUpdate = {...props.questionUpdate}
const updatedContent = editor.current?.getContents(false) || "";
const cleanContent = updatedContent.replace(/<!--.*?-->/gs, "").replace(/style="[^"]*margin-left:[^"]*"/gi, ""); // 메타데이터 제거
const styledContent = applyTableStyle(cleanContent);
tempQuestionUpdate.question_title = changeLTGT(styledContent);
props.setQuestionUpdate(tempQuestionUpdate)
}}
setContents={ changeInequalitySign(String(props.questionUpdate.question_title)) }
autoFocus={true}
/>
: null
}
</Modal.Body>
<span className='explain ml-3 mb-1' style={{"marginTop":"-10px"}}>
이미지 태그 예시: {'{IMG|파일명|100px|100px}'}<br/>
PDF 태그 예시: {'{PDF|파일명|하이퍼링크 텍스트}'}<br/>
비디오 태그 예시: {'{VID|파일명 or 링크|100%|100%}'}
</span>
<Modal.Footer>
<Button className='project-save-btn' variant="primary" onClick={ props.saveBtn }>등록</Button>
<Button variant="secondary" onClick={props.closeBtn}>닫기</Button>
</Modal.Footer>
</Modal>
)
}
export const QuestionDescriptionModal = (props:{
descriptionOpen:boolean,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>
saveBtn: () => void,
closeBtn: () => void,
})=>{
const editor = useRef<SunEditorCore>();
const getSunEditorInstance = (SunEditor: SunEditorCore) => {
editor.current = SunEditor
}
//테이블 있을 시 border 추가
const applyTableStyle = (htmlContent: string) => {
const parser = new DOMParser();
const doc = parser.parseFromString(htmlContent, 'text/html');
// 모든 테이블 요소 찾기
const tables = doc.querySelectorAll('table');
tables.forEach(table => {
// 테이블에 스타일 추가
(table as HTMLElement).style.border = 'solid 1px black';
// 모든 셀에도 동일한 스타일 적용
const cells = table.querySelectorAll('td, th');
cells.forEach(cell => {
(cell as HTMLElement).style.border = 'solid 1px black';
});
});
return doc.body.innerHTML;
}
return(
<Modal show={props.descriptionOpen} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title>
안내문 입력
</Modal.Title>
</Modal.Header>
<Modal.Body>
{
props.descriptionOpen ?
<SunEditor
getSunEditorInstance={getSunEditorInstance}
setOptions={{
buttonList: [
["undo", "redo"],
// ['paragraphStyle', 'blockquote'],
[ "bold", "underline", "italic" ],
["fontColor", "hiliteColor"],
// ['math'] //You must add the 'katex' library at options to use the 'math' plugin.
//['imageGallery'], // You must add the "imageGalleryUrl".
["table"],
["removeFormat"],
["align"],
["fontSize"]
// ['save', 'template'],
// '/', Line break
], // Or Array of button list, eg. [['font', 'align'], ['image']]
fontSize : [
8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 24, 36
],
minHeight: "300px",
showPathLabel: false,
callBackSave: props.saveBtn,
}}
lang={'ko'}
onChange={() => {
let tempQuestionUpdate = {...props.questionUpdate}
const updatedContent = editor.current?.getContents(false) || "";
const cleanContent = updatedContent.replace(/<!--.*?-->/gs, "").replace(/style="[^"]*margin-left:[^"]*"/gi, ""); // 메타데이터 제거
const styledContent = applyTableStyle(cleanContent);
tempQuestionUpdate.question_description = changeLTGT(styledContent);
props.setQuestionUpdate(tempQuestionUpdate)
}}
onKeyUp={() => {
let tempQuestionUpdate = {...props.questionUpdate}
const updatedContent = editor.current?.getContents(false) || "";
const cleanContent = updatedContent.replace(/<!--.*?-->/gs, "").replace(/style="[^"]*margin-left:[^"]*"/gi, ""); // 메타데이터 제거
const styledContent = applyTableStyle(cleanContent);
tempQuestionUpdate.question_description = changeLTGT(styledContent);
props.setQuestionUpdate(tempQuestionUpdate)
}}
setContents={ changeInequalitySign(String(props.questionUpdate.question_description)) }
autoFocus={true}
/>
: null
}
</Modal.Body>
<span className='explain ml-3 mb-1' style={{"marginTop":"-10px"}}>
이미지 태그 예시: {'{IMG|파일명|100px|100px}'}<br/>
PDF 태그 예시: {'{PDF|파일명|하이퍼링크 텍스트}'}<br/>
비디오 태그 예시: {'{VID|파일명 or 링크|100%|100%}'}
</span>
<Modal.Footer>
<Button className='project-save-btn' variant="primary" onClick={ props.saveBtn }>등록</Button>
<Button variant="secondary" onClick={props.closeBtn}>닫기</Button>
</Modal.Footer>
</Modal>
)
}
export const SetSurveyIndexModal = (props:{
indexOpen:boolean,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>,
originQuestion:questionInfoType,
saveBtn: () => void,
closeBtn: () => void,
}) => {
const editor = useRef<SunEditorCore>();
const getSunEditorInstance = (SunEditor: SunEditorCore) => {
editor.current = SunEditor
}
//테이블 있을 시 border 추가
const applyTableStyle = (htmlContent: string) => {
const parser = new DOMParser();
const doc = parser.parseFromString(htmlContent, 'text/html');
// 모든 테이블 요소 찾기
const tables = doc.querySelectorAll('table');
tables.forEach(table => {
// 테이블에 스타일 추가
(table as HTMLElement).style.border = 'solid 1px black';
// 모든 셀에도 동일한 스타일 적용
const cells = table.querySelectorAll('td, th');
cells.forEach(cell => {
(cell as HTMLElement).style.border = 'solid 1px black';
});
});
return doc.body.innerHTML;
}
return (
<Modal show={props.indexOpen} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title>
안내문 입력
</Modal.Title>
</Modal.Header>
<Modal.Body>
{
props.indexOpen ?
<SunEditor
getSunEditorInstance={getSunEditorInstance}
setOptions={{
buttonList: [
["undo", "redo"],
// ['paragraphStyle', 'blockquote'],
[ "bold", "underline", "italic" ],
["fontColor", "hiliteColor"],
['lineHeight'],
// ['math'] //You must add the 'katex' library at options to use the 'math' plugin.
//['imageGallery'], // You must add the "imageGalleryUrl".
// ["fullScreen", "showBlocks", "codeView"],
["removeFormat"],
["align"],
["fontSize"],
["table"],
// ['save', 'template'],
// '/', Line break
], // Or Array of button list, eg. [['font', 'align'], ['image']]
fontSize : [
8, 10, 14, 18, 24, 36
],
minHeight: "300px",
showPathLabel: false,
callBackSave: props.saveBtn
}}
lang={'ko'}
onChange={() => {
let tempQuestionUpdate = {...props.questionUpdate}
const updatedContent = editor.current?.getContents(false) || "";
const cleanContent = updatedContent.replace(/<!--.*?-->/gs, "").replace(/style="[^"]*margin-left:[^"]*"/gi, ""); // 메타데이터 제거
const styledContent = applyTableStyle(cleanContent);
tempQuestionUpdate.question_title = changeLTGT(styledContent);
props.setQuestionUpdate(tempQuestionUpdate)
}}
onKeyUp={() => {
let tempQuestionUpdate = {...props.questionUpdate}
const updatedContent = editor.current?.getContents(false) || "";
const cleanContent = updatedContent.replace(/<!--.*?-->/gs, "").replace(/style="[^"]*margin-left:[^"]*"/gi, ""); // 메타데이터 제거
const styledContent = applyTableStyle(cleanContent);
tempQuestionUpdate.question_title = changeLTGT(styledContent);
props.setQuestionUpdate(tempQuestionUpdate)
}}
setContents={ changeInequalitySign(String(props.questionUpdate.question_title)) }
autoFocus={true}
/>
: null
}
</Modal.Body>
<span className='explain ml-3 mb-1' style={{"marginTop":"-10px"}}>
이미지 태그 예시: {'{IMG|파일명|100px|100px}'}<br/>
PDF 태그 예시: {'{PDF|파일명|하이퍼링크 텍스트}'}<br/>
비디오 태그 예시: {'{VID|파일명 or 링크|100%|100%}'}
</span>
<Modal.Footer>
<Button className='project-save-btn' variant="primary" onClick={ props.saveBtn }>등록</Button>
<Button variant="secondary" onClick={ props.closeBtn }>닫기</Button>
</Modal.Footer>
</Modal>
)
}
export const SetSurveyEndTitleModal = (props:{
question_name: string|null
titleOpen:boolean,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>,
originQuestion:questionInfoType,
saveBtn: () => void,
closeBtn: () => void,
}) => {
const editor = useRef<SunEditorCore>();
const getSunEditorInstance = (SunEditor: SunEditorCore) => {
editor.current = SunEditor
}
return(
<Modal show={props.titleOpen} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title>
{props.question_name} 페이지 문구 입력
</Modal.Title>
</Modal.Header>
<Modal.Body>
{
props.titleOpen ?
<SunEditor
getSunEditorInstance={getSunEditorInstance}
setOptions={{
buttonList: [
["undo", "redo"],
["bold","underline","italic"],
["fontColor", "hiliteColor"],
["removeFormat"],
["align"],
["fontSize"]
],
fontSize : [
8, 10, 14, 18, 24, 36
],
minHeight: "300px",
showPathLabel: false,
defaultTag: "p",
callBackSave: props.saveBtn
}}
lang={'ko'}
onChange={(event) => {
let tempQuestionUpdate = {...props.questionUpdate}
const updatedContent = editor.current?.getContents(false) || "";
const cleanContent = updatedContent.replace(/<!--.*?-->/gs, "").replace(/style="[^"]*margin-left:[^"]*"/gi, ""); // 메타데이터 제거
tempQuestionUpdate.question_title = changeLTGT(cleanContent);
props.setQuestionUpdate(tempQuestionUpdate)
}}
onKeyUp={(event) => {
let tempQuestionUpdate = {...props.questionUpdate}
const updatedContent = editor.current?.getContents(false) || "";
const cleanContent = updatedContent.replace(/<!--.*?-->/gs, "").replace(/style="[^"]*margin-left:[^"]*"/gi, ""); // 메타데이터 제거
tempQuestionUpdate.question_title = changeLTGT(cleanContent);
props.setQuestionUpdate(tempQuestionUpdate)
}}
setContents={ changeInequalitySign(String(props.questionUpdate.question_title)) }
autoFocus={true}
/>
: null
}
</Modal.Body>
<span className='explain ml-3 mb-1' style={{"marginTop":"-10px"}}>
이미지 태그 예시: {'{IMG|파일명|100px|100px}'}<br/>
PDF 태그 예시: {'{PDF|파일명|하이퍼링크 텍스트}'}<br/>
비디오 태그 예시: {'{VID|파일명 or 링크|100%|100%}'}
</span>
<Modal.Footer>
<Button className='project-save-btn' variant="primary" onClick={ props.saveBtn }>등록</Button>
<Button variant="secondary" onClick={ props.closeBtn }>닫기</Button>
</Modal.Footer>
</Modal>
)
}
export const SetSurveyEndDescriptionModal = (props:{
descriptionOpen:boolean,
//changeDescription:string|null,
//setChangeDescription:SetterOrUpdater<string|null>,
question_name: string|null,
questionUpdate:questionInfoType,
setQuestionUpdate:SetterOrUpdater<questionInfoType>,
originQuestion:questionInfoType,
saveBtn: () => void,
closeBtn: () => void,
}) => {
const editor = useRef<SunEditorCore>();
const getSunEditorInstance = (SunEditor: SunEditorCore) => {
editor.current = SunEditor
}
return(
<Modal show={props.descriptionOpen} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title>
{props.question_name} 안내문 입력
</Modal.Title>
</Modal.Header>
<Modal.Body>
{
props.descriptionOpen ?
<SunEditor
getSunEditorInstance={getSunEditorInstance}
setOptions={{
buttonList: [
["undo", "redo"],
["bold","underline","italic"],
["fontColor", "hiliteColor"],
["removeFormat"],
["align"],
["fontSize"]
],
fontSize : [
8, 10, 14, 18, 24, 36
],
minHeight: "300px",
showPathLabel: false,
callBackSave: props.saveBtn
}}
lang={'ko'}
onChange={() => {
let tempQuestionUpdate = {...props.questionUpdate}
const updatedContent = editor.current?.getContents(false) || "";
const cleanContent = updatedContent.replace(/<!--.*?-->/gs, "").replace(/style="[^"]*margin-left:[^"]*"/gi, ""); // 메타데이터 제거
tempQuestionUpdate.question_description = changeLTGT(cleanContent);
props.setQuestionUpdate(tempQuestionUpdate)
}}
onKeyUp={() => {
let tempQuestionUpdate = {...props.questionUpdate}
const updatedContent = editor.current?.getContents(false) || "";
const cleanContent = updatedContent.replace(/<!--.*?-->/gs, "").replace(/style="[^"]*margin-left:[^"]*"/gi, ""); // 메타데이터 제거
tempQuestionUpdate.question_description = changeLTGT(cleanContent);
props.setQuestionUpdate(tempQuestionUpdate)
}}
setContents={ changeInequalitySign(String(props.questionUpdate.question_description)) }
autoFocus={true}
/>
: null
}
</Modal.Body>
<span className='explain ml-3 mb-1' style={{"marginTop":"-10px"}}>
이미지 태그 예시: {'{IMG|파일명|100px|100px}'}<br/>
PDF 태그 예시: {'{PDF|파일명|하이퍼링크 텍스트}'}<br/>
비디오 태그 예시: {'{VID|파일명 or 링크|100%|100%}'}
</span>
<Modal.Footer>
<Button className='project-save-btn' variant="primary" onClick={ props.saveBtn }>등록</Button>
<Button variant="secondary" onClick={ props.closeBtn }>닫기</Button>
</Modal.Footer>
</Modal>
)
}

View File

@@ -0,0 +1,185 @@
import { useState, useEffect, useCallback } from "react";
import { Button, Col, Modal, Row } from "react-bootstrap";
import type { logicType, questionInfoType } from "@modules/TypeModule";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import { LogicChild } from "@componentsQuestionSetup/LogicChild";
import axios from "axios";
import { URL_SEED } from "@modules/AxiosModule";
import { useRecoilState, useRecoilValue } from "recoil";
import { loginToken, projectInfo } from "@token/Token";
export const TotalLogicModal = (props:{
skey: string,
show :boolean,
onHide: () => void,
questionInfo: questionInfoType[],
}) => {
const [filterInfo, setFilterInfo] = useState<questionInfoType[]>([]);
const [deleteQuestionArray, setDeleteQuestionArray] = useState<number[]>([]);
const [allSelected, setAllSelected] = useState(false);
const [totalLogicArray, setTotalLogicArray] = useState<{ uk: number; before: any; after: any; }[]>([]);
const projectState = useRecoilValue(projectInfo);
const [token, setToken] = useRecoilState(loginToken);
const [beforeLogicArray, setBeforeLogicArray] = useState<logicType[]>([]);
const [afterLogicArray, setAfterLogicArray] = useState<logicType[]>([]);
const addTotalLogicBtn = () => {
// setTotalLogicArray([...totalLogicArray, {"logic":"","page":""}]);
}
const deleteQuestionClick = (uk:number) => {
setDeleteQuestionArray(prevUniqueKey => {
if (prevUniqueKey.includes(uk)) {
// 이미 활성화된 row를 클릭한 경우, 해당 ID를 제거
return prevUniqueKey.filter(questionUK => questionUK !== uk);
} else {
// 새로운 row를 활성화하는 경우, 해당 ID를 추가
return [...prevUniqueKey, uk];
}
});
}
//전체 선택
const allCheck = () => {
if (!allSelected) {
const newDeleteQuestionArray = filterInfo.map(ele => ele.question_unique_key);
setDeleteQuestionArray(newDeleteQuestionArray);
} else {
setDeleteQuestionArray([]);
}
setAllSelected(!allSelected);
}
//문항리스트
const infoFilterArray = () => {
const infoFilter = props.questionInfo.filter((ele) => ele.question_order > 0).sort((a, b) => a.question_order - b.question_order);
setFilterInfo(infoFilter);
}
// const renderTotalLogicChild = useCallback((logicData:logicType, logicArray:logicType[], questionInfo:questionInfoType[], eleIndex:number, questionUK:number) => {
// return (
// <LogicChild
// key={eleIndex}
// logicGroup={"total"}
// logicData={logicData}
// questionInfo={questionInfo}
// eleIndex={eleIndex}
// logicArray = {logicArray}
// questionUK={questionUK}
// setLogicArray = {setTotalLogicArray}
// moveLogicChild = {moveBeforeLogicChild}
// />
// )
// }, []);
const logicListShow = () => {
deleteQuestionArray.map((ele, idx) => {
axios.get(URL_SEED + '/question/getQuestionLogic', {
params: {
project_code: projectState.prjcode,
question_unique_key: ele
},
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if (response.status === 200) {
const newLogic = {
uk: ele,
before: response.data.before_logic || [],
after: response.data.after_logic || []
};
setTotalLogicArray(prevArray => [...prevArray, newLogic]);
if (response.data.before_logic !== null) {
setBeforeLogicArray(response.data.before_logic);
} else {
setBeforeLogicArray([]);
}
if (response.data.after_logic !== null) {
setAfterLogicArray(response.data.after_logic);
} else {
setAfterLogicArray([]);
}
}
}).catch(error => {
console.log("getQuestionLogic", error);
});
});
};
useEffect(() => {
infoFilterArray();
},[props.questionInfo])
useEffect(() => {
logicListShow();
},[deleteQuestionArray])
return(
<Modal show={props.show} size="lg" backdrop='static'>
<Modal.Header>
<Modal.Title className="text-center">
전체 로직
</Modal.Title>
</Modal.Header>
<Modal.Body className="logicForm" style={{maxHeight:"600px!important", height:"600px", paddingTop:"0px", paddingBottom:"0px"}}>
<Row>
<Col md={3} style={{ overflowY:"auto", height:"600px", background:"#F3F4F5", paddingTop:"10px", borderRight:"1px solid #DEE2E6"}}>
<div className="custom-chk all-chcek mb-3">
<input type="checkbox" id="chk-all" checked={ allSelected } onChange={allCheck}/>
<label htmlFor="chk-all">전체 선택</label>
</div>
{
filterInfo.map((ele, index) => {
return(
<div key={ele.question_unique_key} className='d-flex list-item justify-content-center management'>
<div className="custom-chk">
<input type="checkbox" id={"chkDelete_" + ele.question_unique_key} value={ele.question_unique_key} onChange={() => deleteQuestionClick(ele.question_unique_key)} checked={deleteQuestionArray.includes(ele.question_unique_key)} />
<label htmlFor={"chkDelete_" + ele.question_unique_key} onChange={() => deleteQuestionClick(ele.question_unique_key)} />
</div>
<label className="w-100" htmlFor={"chkDelete_" + ele.question_unique_key} onChange={() => deleteQuestionClick(ele.question_unique_key)}>
<div className="file-li border mb-1" id={"chkDelete_" + ele.question_unique_key}
style={{
cursor: "pointer",
backgroundColor: deleteQuestionArray.includes(ele.question_unique_key) ? "#B1DFBC" : "white"
}}
>
{ele.question_id}
</div>
</label>
</div>
)
})
}
</Col>
<Col style={{paddingTop:"10px"}}>
{/* <div style={{height:"50%", }}>
<div>
<Button onClick={ addTotalLogicBtn }>전체 로직추가</Button>
</div>
<DndProvider backend={HTML5Backend}>
<div style={{overflowY:"auto", maxHeight:"75%", height:"75%"}}>
{
// totalLogicArray?.map((ele, index) => renderTotalLogicChild( ele, totalLogicArray, props.questionInfo, index, props.questionUniqueKey))
}
</div>
</DndProvider>
</div> */}
</Col>
</Row>
</Modal.Body>
<Modal.Footer>
<div className='mt-2 mr-1 float-right'>
<Button className='project-save-btn mr-2' variant="primary" >저장</Button>
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</Modal>
)
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,733 @@
import React, { useState, useEffect, useRef } from "react";
import { SetterOrUpdater, useRecoilValue } from "recoil";
import { Row, Col } from "react-bootstrap";
import { getEtcPlaceholder, transFormBr } from "@modules/Function";
import type { labelType, labelInfoType, answerDataType, fileDataType, isNotType, OptionInfoType, questionInfoType } from "@modules/TypeModule";
import {
getOpenText, insertNumeric, insertLongOpen, insertOpen, isCheckValue,
singleCheckedValue, multiCheckedValue, setFiles, getRankValue, rankCheckedValue, getIsNot, blurOpen,
autoCheckFilter
} from "@modules/AnswerFunction";
import FilePondPluginImageExifOrientation from "filepond-plugin-image-exif-orientation";
import FilePondPluginImagePreview from "filepond-plugin-image-preview";
import { FilePond, registerPlugin } from "react-filepond";
import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type';
import "filepond/dist/filepond.min.css";
import "filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css";
import '@resources/css/main.css'
import { anywhereSkey } from "@token/Token";
const setLabelColumn = (orignArray:labelInfoType[], columnValue?:number) => {
let columnCount:number = 1;
if(columnValue){
if(columnValue > 1) columnCount = columnValue
}
let parentArray : labelInfoType[][] = [];
let childArray : labelInfoType[] = [];
orignArray.map((scalarEle,scalarIdx) => {
if(scalarIdx % columnCount === 0 && childArray.length > 0){
parentArray.push(childArray);
childArray = [];
}
childArray.push(scalarEle)
})
parentArray.push(childArray);
return parentArray;
}
export const ScalarSingle = (props:{
styleInfo?:any,
skey: string,
surveyType?: string | undefined
scalar_label:labelType | null,
qid:string | null,
answerData:answerDataType[],
setAnswerData:SetterOrUpdater<answerDataType[]>,
question_option:OptionInfoType[] | null,
}) => {
const skey = useRecoilValue(anywhereSkey);
const [columnArray, setColumnArray] = useState<labelInfoType[][]>([]);
// 컬럼 개수
let colCnt = props.question_option?.filter((ele) => {if(ele.type_code === "01" && ele.detail_code === "01") return ele.value})
const customRdoElements = document.querySelectorAll('.custom-rdo');
const customInputElements = document.querySelectorAll('.custom-input');
customRdoElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customInputElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
useEffect(() => {
if(props.scalar_label?.label_info){
setColumnArray(setLabelColumn(props.scalar_label?.label_info, Number(colCnt?.[0]?.value)));
}
},[props.scalar_label, props.question_option]);
return(
<Row className='p-1'>
<Col md={12}>
<ul className="list-grp">
{
columnArray?.map((scalarArray, scalarIdx) => (
<li key={scalarIdx}>
{
scalarArray.map((scalarEle:labelInfoType, scalarIdx) => {
return (
<div key={scalarIdx}
className={isCheckValue(props.answerData,0,0,Number(scalarEle.value)) ? "list-item active checked" : "list-item"}
onMouseUp={() => singleCheckedValue(props.answerData, props.setAnswerData,0,0,Number(scalarEle.value)) }
style={{backgroundColor: isCheckValue(props.answerData,0,0,Number(scalarEle.value)) ? `${props.styleInfo?.shadowColor}` : '#fff'}}
>
<div className="custom-rdo">
<input
type="radio"
id={`${props.qid}_${scalarEle.value}`}
name={`${props.qid}`}
data-s={`${scalarEle.value}`}
value={scalarEle.value}
checked={isCheckValue(props.answerData,0,0,Number(scalarEle.value))}
onChange={()=>{}}
/>
<label
htmlFor={`${props.qid}_${scalarEle.value}`}
dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>[" + String(scalarEle.value)+"]</span>" + transFormBr(String(scalarEle.label), String(skey))
:
transFormBr(String(scalarEle.label), String(skey))
}}
/>
</div>
{ scalarEle.is_etc === 1 || scalarEle.is_etc === 2 ?
<div className="custom-input">
<input type="text"
id={
scalarEle.is_etc === 1 ? `T${props.qid}_${scalarEle.value}`
:`TN${props.qid}_${scalarEle.value}`
}
data-s={`${scalarEle.value}`}
placeholder={getEtcPlaceholder(String(scalarEle.label))}
value={getOpenText(props.answerData, 0, 0, Number(scalarEle.value))}
onChange={(e) => {
if(scalarEle.is_etc === 1){
insertOpen(e, props.answerData, props.setAnswerData, 0, 0, Number(scalarEle.value))
}
else{
insertNumeric(e, props.answerData, props.setAnswerData, 0, 0, Number(scalarEle.value), 0)
}
}}
disabled={!isCheckValue(props.answerData, 0, 0, Number(scalarEle.value))}
/>
</div>
: null }
</div>
)
})
}
</li>
))
}
</ul>
</Col>
</Row>
)
}
export const ScalarMulti = (props:{
styleInfo?:any,
skey: string,
surveyType?: string | undefined
scalar_label:labelType | null,
qid:string | null,
answerData:answerDataType[],
setAnswerData:SetterOrUpdater<answerDataType[]>,
question_option:OptionInfoType[] | null,
autoCheckValue?: answerDataType[]
}) => {
const [isNot, setIsNot] = useState<isNotType[]>([{m:0, is_not:false}]);
const [columnArray, setColumnArray] = useState<labelInfoType[][]>([]);
// 컬럼 개수
let colCnt = props.question_option?.filter((ele) => {if(ele.type_code === "01" && ele.detail_code === "01") return ele.value})
// 최대 응답 개수
let rankMax = props.question_option?.filter((ele) => {if(ele.type_code === "02" && ele.detail_code === "01") return ele.value})
useEffect(() => {
if(props.scalar_label?.label_info){
setColumnArray(setLabelColumn(props.scalar_label?.label_info, Number(colCnt?.[0]?.value)));
}
},[props.scalar_label, props.question_option]);
const customMulElements = document.querySelectorAll('.custom-chk');
const customInputElements = document.querySelectorAll('.custom-input');
customMulElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customInputElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
return(
<Row className='p-1'>
<Col md={12}>
<ul className="list-grp">
{
columnArray?.map((scalarArray,scalarIdx) => (
<li key={scalarIdx}>
{
scalarArray.map((scalarEle, scalarIdx) => (
<div key={scalarIdx}
className={isCheckValue(props.answerData,0,0,Number(scalarEle.value)) ? "list-item active" : "list-item"}
onMouseUp={ () => {
multiCheckedValue(document.activeElement, props.answerData, props.setAnswerData, isNot, setIsNot, 0, 0, Number(scalarEle.value), Number(scalarEle.is_not), Number(rankMax?.[0]?.value))
}}
style={{pointerEvents: autoCheckFilter(scalarEle?.value, 0, props.autoCheckValue), backgroundColor: isCheckValue(props.answerData,0,0,Number(scalarEle.value)) ? `${props.styleInfo?.shadowColor}` : '#fff'}}
>
<div className="custom-chk">
<input
type="checkbox"
id={`${props.qid}_${scalarEle.value}`}
name={`${props.qid}`}
value={scalarEle.value}
data-s={scalarEle.value}
onChange={()=>{}}
checked={isCheckValue(props.answerData,0,0,Number(scalarEle.value))}
disabled={getIsNot(isNot,0) && !isCheckValue(props.answerData,0,0,Number(scalarEle.value))}
/>
<label htmlFor={`${props.qid}_${scalarEle.value}`}
dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(scalarEle.value)+"]</span> "+ transFormBr(String(scalarEle.label), String(props.skey))
:
transFormBr(String(scalarEle.label), String(props.skey))
}}
/>
</div>
{ scalarEle.is_etc === 1 || scalarEle.is_etc === 2 ?
<div className="custom-input">
<input type="text"
id={
scalarEle.is_etc === 1?`T${props.qid}_${scalarEle.value}`
: `TN${props.qid}_${scalarEle.value}`
}
data-s={`${scalarEle.value}`}
placeholder={getEtcPlaceholder(String(scalarEle.label))}
value={getOpenText(props.answerData, 0, 0, Number(scalarEle.value))}
onChange={(e) => {
if(scalarEle.is_etc === 1){
insertOpen(e, props.answerData, props.setAnswerData, 0, 0, Number(scalarEle.value))
}
else{
insertNumeric(e, props.answerData, props.setAnswerData, 0, 0, Number(scalarEle.value), 0)
}
}}
disabled={!isCheckValue(props.answerData, 0, 0, Number(scalarEle.value))}
/>
</div>
: null }
</div>
))
}
</li>
))
}
</ul>
</Col>
</Row>
)
}
export const ScalarRank = (props:{
styleInfo?:any,
skey: string,
surveyType?: string | undefined,
scalar_label:labelType | null,
qid:string | null,
answerData:answerDataType[],
setAnswerData:SetterOrUpdater<answerDataType[]>,
question_option:OptionInfoType[] | null,
}) => {
const [isNot, setIsNot] = useState<isNotType[]>([{m:0, is_not:false}]);
const [columnArray, setColumnArray] = useState<labelInfoType[][]>([]);
const customRankElements = document.querySelectorAll('.custom-chk.rank');
const customInputElements = document.querySelectorAll('.custom-input');
customRankElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customInputElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
// 컬럼 개수
let colCnt = props.question_option?.filter((ele) => {if(ele.type_code === "01" && ele.detail_code === "01") return ele.value})
// 최대 응답 개수
let rankMax = props.question_option?.filter((ele) => {if(ele.type_code === "02" && ele.detail_code === "01") return ele.value})
// 필수 응답 개수
let rankEssentialAnswer = props.question_option?.filter((ele) => {if(ele.type_code === "03" && ele.detail_code === "01") return ele.value})
useEffect(() => {
if(props.scalar_label?.label_info){
setColumnArray(setLabelColumn(props.scalar_label?.label_info, Number(colCnt?.[0]?.value)));
}
},[props.scalar_label, props.question_option]);
return(
<React.Fragment>
{/* // <!-- reset 버튼 --> */}
<Row>
<Col md={12}>
<ul className="btn-box btn-box-left ml-1">
<li>
<button className="btn reset-md" onClick={() => {setIsNot([{m:0, is_not:false}]); props.setAnswerData([]);}}>Reset</button>
</li>
</ul>
</Col>
</Row>
<Row className='p-1'>
<Col md={12}>
<ul className="list-grp">
{
columnArray.map((scalarArray, scalarIdx:number) => (
<li key={scalarIdx}>
{
scalarArray.map((scalarEle, scalarIdx:number) => (
<div key={scalarIdx}
className={isCheckValue(props.answerData,0,0,Number(scalarEle.value)) ? "list-item active" : "list-item"}
onMouseUp={ () => {
rankCheckedValue(document.activeElement, props.answerData, props.setAnswerData, isNot, setIsNot, 0, 0, Number(scalarEle.value), Number(scalarEle.is_not), Number(rankMax?.[0]?.value))
}}
style={{backgroundColor: isCheckValue(props.answerData,0,0,Number(scalarEle.value)) ? `${props.styleInfo?.shadowColor}` : '#fff'}}
>
<div className="custom-chk rank">
<input
type="checkbox"
id={`${props.qid}_${scalarEle.value}`}
name={`${props.qid}`}
value={scalarEle.value}
data-s={scalarEle.value}
onChange={()=>{}}
checked={isCheckValue(props.answerData,0,0,Number(scalarEle.value))}
disabled={getIsNot(isNot,0) && !isCheckValue(props.answerData,0,0,Number(scalarEle.value))}
/>
<label htmlFor={`${props.qid}_${scalarEle.value}`}
dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(scalarEle.value)+"]</span> "+ transFormBr(String(scalarEle.label), String(props.skey))
:
transFormBr(String(scalarEle.label), String(props.skey))
}}
/>
<span className="rank-num">
{
getRankValue(props.answerData,0,0,Number(scalarEle.value))
}
</span>
</div>
{ scalarEle.is_etc === 1 || scalarEle.is_etc === 2 ?
<div className="custom-input">
<input type="text"
id={
scalarEle.is_etc === 1?`T${props.qid}_${scalarEle.value}`
:`TN${props.qid}_${scalarEle.value}`
}
data-s={`${scalarEle.value}`}
placeholder={getEtcPlaceholder(String(scalarEle.label))}
value={getOpenText(props.answerData, 0, 0, Number(scalarEle.value))}
onChange={(e) => {
if(scalarEle.is_etc === 1){
insertOpen(e, props.answerData, props.setAnswerData, 0, 0, Number(scalarEle.value))
}
else{
insertNumeric(e, props.answerData, props.setAnswerData, 0, 0, Number(scalarEle.value), 0)
}
}}
disabled={!isCheckValue(props.answerData, 0, 0, Number(scalarEle.value))}
/>
</div>
: null }
</div>
))
}
</li>
))
}
</ul>
</Col>
</Row>
</React.Fragment>
)
}
export const ScalarScale = (props:{
styleInfo?:any,
skey: string,
surveyType?: string | undefined
scalar_label:labelType | null,
qid:string | null,
answerData:answerDataType[],
question_option:OptionInfoType[] | null,
setAnswerData:SetterOrUpdater<answerDataType[]>
}) => {
const [arrowValue, setArrowValue] = useState(0);
const [arrowWidth, setArrowWidth] = useState("50%");
let scaleNum = props.question_option?.filter((ele) => {if(ele.type_code === "04" && ele.detail_code === "02") return ele.value});
const customRdoElements = document.querySelectorAll('.list-item.scale');
const customInputElements = document.querySelectorAll('.custom-input');
customRdoElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customInputElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
useEffect(() => {
let scaleArrow = props.question_option?.filter((ele) => {if(ele.type_code === "04" && ele.detail_code === "01") return ele.value});
if(scaleArrow && scaleArrow?.length > 0){
setArrowValue(Number(scaleArrow[0]?.value))
}
},[props.question_option])
useEffect(() => {
if(props.scalar_label?.label_info){
if(props.scalar_label?.label_info.length < 3){
setArrowWidth("55%");
}else if(props.scalar_label?.label_info.length > 3 && props.scalar_label?.label_info.length < 6){
setArrowWidth("80%");
}else if(props.scalar_label?.label_info.length > 6){
setArrowWidth("95%");
}
}
},[props.scalar_label?.label_info])
return(
<Row className="scale-row">
<Col md={12}>
{
arrowValue === 1 ?
<div className="mb-4" style={{display:"flex", justifyContent:"center", width:"100%"}}>
<img style={{width: arrowWidth}} src="/public_img/scale_both.png" />
</div>
:
arrowValue === 2 ?
<div className="mb-4" style={{display:"flex", justifyContent:"center", width:"100%"}}>
<img style={{width: arrowWidth}} src="/public_img/scale_right.png" />
</div>
:
arrowValue === 3 ?
<div className="mb-4" style={{display:"flex", justifyContent:"center", width:"100%"}}>
<img style={{width: arrowWidth}} src="/public_img/scale_left.png" />
</div>
:
null
}
<ul className="list-grp scale-ul scale-ul-10">
{
props.scalar_label?.label_info.map((scalarEle, scalarIdx) => (
<li key={scalarIdx} className="scale-li">
{
scaleNum?.[0]?.value === "1" ? <div className="scale-num" > {scalarEle.value} </div>
: null
}
<div className="list-item scale">
<div className="custom-rdo">
<input
type="radio"
id={`${props.qid}_${scalarEle.value}`}
data-s={scalarEle.value}
name={`${props.qid}`}
value={scalarEle.value}
checked={isCheckValue(props.answerData,0,0,Number(scalarEle.value))}
onChange={(e) => singleCheckedValue(props.answerData, props.setAnswerData,0,0,Number(scalarEle.value)) }
/>
<label htmlFor={`${props.qid}_${scalarEle.value}`} ></label>
</div>
</div>
</li>
))
}
</ul>
<div className="scale-table">
<table>
<tbody>
<tr>
{
props.scalar_label?.label_info.map((scalarEle, scalarIdx) => (
<td key={scalarIdx} dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(scalarEle.value)+"]</span> "+ transFormBr(String(scalarEle.label), String(props.skey))
:
transFormBr(String(scalarEle.label), String(props.skey))
}}
onClick={()=>{singleCheckedValue(props.answerData, props.setAnswerData,0,0,Number(scalarEle.value))}}
style={{wordWrap:"break-word", maxWidth:"10px"}}
/>
))
}
</tr>
</tbody>
</table>
</div>
</Col>
</Row>
)
}
export const ScalarNumeric = (props:{
styleInfo?: any,
skey: string,
surveyType?: string | undefined
scalar_label:labelType | null,
qid:string | null,
answerData:answerDataType[],
question_option:OptionInfoType[] | null,
setAnswerData:SetterOrUpdater<answerDataType[]>
}) => {
const customNumberElements = document.querySelectorAll('.txt-list');
const customInputElements = document.querySelectorAll('.input-lbl');
customNumberElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customInputElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
return(
<Row className='p-1'>
<Col md={12}>
{
props.scalar_label?.label_info.map((scalarEle, scalarIdx) => {
return(
<div key={scalarIdx} className="txt-list lbl-wrap">
{
scalarEle.prefix === "" || scalarEle.prefix === undefined ? null
:
<div className="lbl border-l" dangerouslySetInnerHTML={{__html: String(scalarEle.prefix)}} />
}
<input id={`${props.qid}_${scalarEle.value}`} type="text"
value={getOpenText(props.answerData,0,0,Number(scalarEle.value))}
onChange={(e) => insertNumeric(e, props.answerData, props.setAnswerData,0,0,Number(scalarEle.value), Number(scalarEle.decimal_point), Number(scalarEle.open_type))}
className="input-lbl"
style={ scalarEle.prefix === "" && scalarEle.suffix === "" ? {borderRadius:"4px"}
: scalarEle.prefix !== "" && scalarEle.suffix === "" ? {borderRadius:"0 4px 4px 0"}
: scalarEle.prefix === "" && scalarEle.suffix !== "" ? {borderRadius:"4px 0 0 4px"}
: {borderRadius:"0px"} }
/>
{
scalarEle.suffix === "" || scalarEle.suffix === undefined ? null
:
<div className="lbl border-r" dangerouslySetInnerHTML={{__html: String(scalarEle.suffix)}} />
}
</div>
)
})
}
</Col>
</Row>
)
}
export const ScalarString = (props:{
styleInfo?:any,
skey: string,
surveyType?: string | undefined
scalar_label:labelType | null,
qid:string | null,
answerData:answerDataType[],
question_option:OptionInfoType[] | null,
setAnswerData:SetterOrUpdater<answerDataType[]>
}) => {
const customStringElements = document.querySelectorAll('.txt-list');
const customInputElements = document.querySelectorAll('.input-lbl');
const customTextAreaElements = document.querySelectorAll('.txtarea-box');
customStringElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customInputElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customTextAreaElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
return(
<Row className='p-1'>
<Col md={12}>
{
props.scalar_label?.label_info.map((scalarEle, scalarIdx) => {
return(
scalarEle.open_type === 1 ?
<div key={scalarEle.order} className="txt-list lbl-wrap">
{
scalarEle.prefix === "" || scalarEle.prefix === undefined ? null
:
<div className="lbl border-l" dangerouslySetInnerHTML={{__html: String(scalarEle.prefix)}} />
}
<input id={`${props.qid}_${scalarEle.value}`} type="text"
placeholder={scalarEle.placeholder || ""}
onChange={(e) =>
insertOpen(e, props.answerData, props.setAnswerData, 0, 0, Number(scalarEle.value))
}
value={getOpenText(props.answerData, 0, 0, Number(scalarEle.value))}
style={ scalarEle.prefix === "" && scalarEle.suffix === "" ? {borderRadius:"4px"}
: scalarEle.prefix !== "" && scalarEle.suffix === "" ? {borderRadius:"0 4px 4px 0"}
: scalarEle.prefix === "" && scalarEle.suffix !== "" ? {borderRadius:"4px 0 0 4px"}
: {borderRadius:"0px"} }
/>
{
scalarEle.suffix === "" || scalarEle.suffix === undefined ? null
:
<div className="lbl border-r" dangerouslySetInnerHTML={{__html: String(scalarEle.suffix)}} />
}
</div>
:
scalarEle.open_type === 6 ?
<div key={scalarEle.order} className="txtarea-box p-1">{/*장문 옵션이 선택된 경우*/}
<textarea id={`${props.qid}_${scalarEle.value}`}
onChange={(e) =>
insertLongOpen(e, props.answerData, props.setAnswerData, 0, 0, Number(scalarEle.value))
}
value={getOpenText(props.answerData, 0, 0, Number(scalarEle.value))}
placeholder={scalarEle.placeholder||""}
/>
</div>
:
<div key={scalarEle.order} className="txt-list lbl-wrap">
{
scalarEle.prefix === "" || scalarEle.prefix === undefined ? null
:
<div className="lbl border-l" dangerouslySetInnerHTML={{__html: String(scalarEle.prefix)}} />
}
<input id={`${props.qid}_${scalarEle.value}`} type="text"
placeholder={scalarEle.placeholder||""}
onChange={(e) =>
insertOpen(e, props.answerData, props.setAnswerData, 0, 0, Number(scalarEle.value), Number(scalarEle.open_type))
}
onBlur={(e) =>
blurOpen(e, props.answerData, props.setAnswerData, 0, 0, Number(scalarEle.value), Number(scalarEle.open_type))
}
value={getOpenText(props.answerData, 0, 0, Number(scalarEle.value))}
maxLength={ scalarEle.open_type === 5 ? 13 : 9999}
style={ scalarEle.prefix === "" && scalarEle.suffix === "" ? {borderRadius:"4px"}
: scalarEle.prefix !== "" && scalarEle.suffix === "" ? {borderRadius:"0 4px 4px 0"}
: scalarEle.prefix === "" && scalarEle.suffix !== "" ? {borderRadius:"4px 0 0 4px"}
: {borderRadius:"0px"} }
/>
{
scalarEle.suffix === "" || scalarEle.suffix === undefined ? null
:
<div className="lbl border-r" dangerouslySetInnerHTML={{__html: String(scalarEle.suffix)}} />
}
</div>
)
})
}
</Col>
</Row>
)
}
registerPlugin(FilePondPluginImageExifOrientation, FilePondPluginImagePreview, FilePondPluginFileValidateType);
export const ScalarFile = (props:{
skey: string,
question_option: OptionInfoType[] | null,
surveyType?: string | undefined
scalar_label:labelType | null,
qid:string | null,
answerData:answerDataType[],
fileData:fileDataType[],
setAnswerData:SetterOrUpdater<answerDataType[]>
setFileData:SetterOrUpdater<fileDataType[]>
}) => {
const fileRef = useRef<FilePond>(null);
const answerDataRef = useRef(props.answerData);
const fileDataRef = useRef(props.fileData);
const [typeArray, setTypeArray] = useState<string[]>([]);
let extensionSelect = props.question_option?.filter((ele) => {if(ele.type_code === "07" && ele.detail_code === "03") return ele.value})
const fileExtensionMap:{ [key: string]: string[]} = {
'0': ['*'],
'1': ['image/*'],
'2': ['video/*'],
'3': ['audio/*'],
'4': ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv'],
};
useEffect(() => {
if(extensionSelect?.[0]?.value !== undefined){
setTypeArray(fileExtensionMap[extensionSelect[0].value])
}
},[])
useEffect(() => {
answerDataRef.current = props.answerData;
}, [props.answerData]);
useEffect(() => {
fileDataRef.current = props.fileData;
}, [props.fileData]);
return(
<Row className='p-1'>
<Col md={12}>
<ul className="file-ul mb-2">
<li className="file-li">
<div className="file-wrap">
<FilePond
ref={fileRef}
credits={false}
allowReorder={true}
allowMultiple={true}
files={props.fileData[0]?.files}
acceptedFileTypes={typeArray}
//maxFiles={3} 최대개수
onupdatefiles={(fileItems) => {
const currentAnswerData = answerDataRef.current;
const currentFileData = fileDataRef.current;
setFiles(fileItems, currentAnswerData, props.setAnswerData, currentFileData, props.setFileData,0);
}}
styleButtonRemoveItemPosition='right'
iconRemove='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 20px; transform:translate(-4.5px, -1px);">
<g id="icon_close">
<path id="Vector" d="M6.96967 6.96967C7.26256 6.67678 7.73744 6.67678 8.03033 6.96967L12 10.9393L15.9697 6.96967C16.2626 6.67678 16.7374 6.67678 17.0303 6.96967C17.3232 7.26256 17.3232 7.73744 17.0303 8.03033L13.0607 12L17.0303 15.9697C17.3232 16.2626 17.3232 16.7374 17.0303 17.0303C16.7374 17.3232 16.2626 17.3232 15.9697 17.0303L12 13.0607L8.03033 17.0303C7.73744 17.3232 7.26256 17.3232 6.96967 17.0303C6.67678 16.7374 6.67678 16.2626 6.96967 15.9697L10.9393 12L6.96967 8.03033C6.67678 7.73744 6.67678 7.26256 6.96967 6.96967Z" fill="#ffffff"/>
</g>
</svg>
'// <-- 리무브 아이콘 넣기
labelIdle='파일 업로드'
/>
</div>
</li>
</ul>
</Col>
</Row>
)
}

View File

@@ -0,0 +1,791 @@
import React, { useState, useEffect } from "react";
import { SetterOrUpdater } from "recoil";
import { Row, Col, Table, Form } from "react-bootstrap";
import type { OptionInfoType, answerDataType, labelType, tdEmpcatType } from '@modules/TypeModule';
import { getEtcPlaceholder, getOption, transFormBr } from '@modules/Function';
import {
getOpenText,
getSelectOption,
insertNumeric,
insertOpen,
isCheckValue,
isClickTd,
singleCheckedValue
} from "@modules/AnswerFunction";
interface labelInfoType {
order: number,
value: number,
label: string,
is_etc: number,
is_not: number,
image_json: null|{
src: string,
width: string,
height: string
}
}
export const TensorTableSelect = (props:{
styleInfo:any,
skey:string,
surveyType?: string | undefined,
scalar_label:labelType | null,
matrix_label:labelType | null,
tensor_label: labelType | null,
qid:string | null
answerData:answerDataType[],
setAnswerData:SetterOrUpdater<answerDataType[]>,
question_option?:OptionInfoType[]|null,
}) => {
const [tdEmpact, setTdEmpact] = useState<tdEmpcatType>({t:0,m:0})
const [etcLabel, setEtcLabel] = useState<labelInfoType[]>([]);
const [widthArray, setWidthArray] = useState<string[]>([]);
let widthNum = props.question_option?.filter((ele) => {if(ele.type_code === "01" && ele.detail_code === "04") return ele.value})
let temWidth = widthNum?.[0]?.value
const customStringElements = document.querySelectorAll('.tensor');
const customInputElements = document.querySelectorAll('.input-lbl');
const customTextAreaElements = document.querySelectorAll('.txtarea-box');
customStringElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customInputElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customTextAreaElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
useEffect(() => {
const widthArr = temWidth?.split(',');
if(widthArr){
setWidthArray(widthArr)
}
},[temWidth])
useEffect(()=>{
if(props.scalar_label !== null){
const tempLabel = [...props.scalar_label.label_info].filter((ele) => ele.is_etc !== 0);
//@ts-ignore
setEtcLabel(tempLabel);
}
},[props.scalar_label])
useEffect(() => {
setTdEmpact({t:0,m:0});
}, [props.qid]);
return (
<Row className='p-1'>
<Col md={12}>
<div className="tbe-area mb-0 p-1">
<Table className="tbe-wrap text-center chk-tbe">
<thead>
<tr className="tbe-tr">
<th style={{width: widthArray[0] + "%"}} />
{
props.tensor_label?.label_info.map((tensorEle, tensorIdx) => (
<th key={ tensorIdx} style={{width: widthArray[tensorIdx + 1] + "%"}}
dangerouslySetInnerHTML={{__html:
props.surveyType === "t" ?
"<span class='value-color'>["+String(tensorEle.value)+"]</span> " + transFormBr(String(tensorEle.label), String(props.skey))
: transFormBr(String(tensorEle.label), String(props.skey))
}}
/>
))
}
</tr>
</thead>
<tbody>
{
props.matrix_label?.label_info.map((matrixEle, matrixIdx) => (
<tr key={matrixIdx} className="tbe-tr">
<td className="tbe-td"
dangerouslySetInnerHTML={{__html:
props.surveyType === "t" ?
"<span class='value-color'>["+String(matrixEle.value)+"]</span> " + transFormBr(String(matrixEle.label), String(props.skey))
: transFormBr(String(matrixEle.label), String(props.skey))
}}
/>
{
props.tensor_label?.label_info.map((tensorEle, tensorIdx) => (
<td key={tensorIdx} className={isClickTd(tdEmpact, Number(tensorEle.value), Number(matrixEle.value)) ? "list-item active p-1"
: "list-item p-1"}
style={{backgroundColor: isClickTd(tdEmpact, Number(tensorEle.value), Number(matrixEle.value)) ? `${props.styleInfo?.shadowColor}` : '#fff'}}
onClick={(e) => {
e.stopPropagation();
setTdEmpact({t:Number(tensorEle.value), m:Number(matrixEle.value)});
}}>
<div>
<div className="custom-sel">
<div className="sel-wrap" style={{border: props.styleInfo?.mainColor}}>
<Form.Control as="select" className="sel-box tensor"
id={`${props.qid}_${tensorEle.value}_${matrixEle.value}`}
value={getSelectOption(props.answerData, Number(tensorEle.value), Number(matrixEle.value))}
onChange={(e) => singleCheckedValue(props.answerData, props.setAnswerData,Number(tensorEle.value), Number(matrixEle.value), Number(e.currentTarget.value))}
>
<option key={999} value={-1} id={`${props.qid}_N_N_N`} data-s={-1} data-m={-1} data-t={-1}>선택</option>
{
props.scalar_label?.label_info.map((scalarEle, scalarIdx) => (
<option key={scalarIdx}
value={scalarEle.value}
id={`${props.qid}_${tensorEle.value}_${matrixEle.value}_${scalarEle.value}`}
data-s={scalarEle.value}
data-m={matrixEle.value}
data-t={tensorEle.value}
dangerouslySetInnerHTML={{__html:
props.surveyType === "t" ?
"["+String(scalarEle.value)+"] " +transFormBr(String(scalarEle.label), String(props.skey))
: transFormBr(String(scalarEle.label), String(props.skey))
}}
/>
))
}
</Form.Control>
</div>
{
etcLabel.filter((etcEle) => etcEle.value === getSelectOption(props.answerData, Number(tensorEle.value), Number(matrixEle.value))).map((scalarEle) => {
return (
<div className="mb0 input-lbl">
<input type="text"
id={
scalarEle.is_etc === 1?`T${props.qid}_${matrixEle.value}_${scalarEle.value}`
:`TN${props.qid}_${matrixEle.value}_${scalarEle.value}`
}
data-s={`${scalarEle.value}`}
data-m={`${matrixEle.value}`}
data-t={`${tensorEle.value}`}
placeholder={getEtcPlaceholder(String(scalarEle.label))}
value={getOpenText(props.answerData, Number(tensorEle.value), Number(matrixEle.value), Number(scalarEle.value))}
onChange={(e) => {
if(scalarEle.is_etc === 1){
insertOpen(e, props.answerData, props.setAnswerData,Number(tensorEle.value),Number(matrixEle.value),Number(scalarEle.value))
}
else{
insertNumeric(e, props.answerData, props.setAnswerData,Number(tensorEle.value),Number(matrixEle.value),Number(scalarEle.value), 0)
}
}}
disabled={!isCheckValue(props.answerData, Number(tensorEle.value),Number(matrixEle.value),Number(scalarEle.value))}
/>
</div>
)
})
}
</div>
</div>
</td>
))
}
</tr>
))
}
</tbody>
</Table>
</div>
</Col>
</Row>
)
}
export const TensorMobileSelect = (props:{
styleInfo:any,
skey:string,
surveyType?: string | undefined,
scalar_label:labelType | null,
matrix_label:labelType | null,
tensor_label: labelType | null,
qid:string | null,
answerData:answerDataType[],
setAnswerData:SetterOrUpdater<answerDataType[]>,
question_option?:OptionInfoType[] | null,
}) => {
const [etcLabel, setEtcLabel] = useState<labelInfoType[]>([]);
const customStringElements = document.querySelectorAll('.tensor');
const customInputElements = document.querySelectorAll('.input-lbl');
const customTextAreaElements = document.querySelectorAll('.txtarea-box');
customStringElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customInputElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customTextAreaElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
useEffect(()=>{
if(props.scalar_label !== null){
const tempLabel = [...props.scalar_label.label_info].filter((ele) => ele.is_etc !== 0);
//@ts-ignore
setEtcLabel(tempLabel);
}
},[props.scalar_label])
return (<React.Fragment>{props.tensor_label?.label_info.map((tensorEle, tensorIdx) => (
<Row key={tensorIdx} className='p-1'>
<Col md={12}>
<ul className="tbe-ul tbe-mob tensor">
<li>
<div className="mob-th" dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(tensorEle.value)+"]</span> "+ transFormBr(String(tensorEle.label), String(props.skey))
:
transFormBr(String(tensorEle.label), String(props.skey))
}}>
{/* <span className="btn-down"></span> */}
</div>
{ props.matrix_label?.label_info.map((matrixEle, matrixIdx) => (
<ul key={matrixIdx} className="list-grp">
<li>
<div className="list-item" style={{cursor:"default"}}>
<div className="custom-sel">
<div className="sel-wrap mob">
<span dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(matrixEle.value)+"]</span> "+ transFormBr(String(matrixEle.label), String(props.skey))
:
transFormBr(String(matrixEle.label), String(props.skey))
}}/>
<Form.Control as="select" className="sel-box tensor"
id={`${props.qid}_${tensorEle.value}_${matrixEle.value}`}
value={getSelectOption(props.answerData, Number(tensorEle.value), Number(matrixEle.value))}
onChange={(e) => {singleCheckedValue(props.answerData, props.setAnswerData, Number(tensorEle.value), Number(matrixEle.value), Number(e.currentTarget.value))}}
>
<option key={999} value={-1} id={`${props.qid}_N_N_N`} data-s={-1} data-m={-1} data-t={-1}>선택</option>
{
props.scalar_label?.label_info.map((scalarEle, scalarIdx) => (
<option key={scalarIdx}
id={`${props.qid}_${tensorEle.value}_${matrixEle.value}_${scalarEle.value}`}
value={scalarEle.value}
data-s={scalarEle.value}
data-m={matrixEle.value}
data-t={tensorEle.value}
dangerouslySetInnerHTML={{__html:
props.surveyType === "t" ?
"["+String(scalarEle.value)+"] " + transFormBr(String(scalarEle.label), String(props.skey))
: transFormBr(String(scalarEle.label), String(props.skey))
}}
/>
))
}
</Form.Control>
{etcLabel.filter((etcEle) => etcEle.value === getSelectOption(props.answerData, Number(tensorEle.value), Number(matrixEle.value))).map((scalarEle) => {
return (
<div className="mb0 input-lbl">
<input type="text"
id={
scalarEle.is_etc === 1?`T${props.qid}_${matrixEle.value}_${scalarEle.value}`
:`TN${props.qid}_${matrixEle.value}_${scalarEle.value}`
}
data-s={`${scalarEle.value}`}
data-m={`${matrixEle.value}`}
data-t={`${tensorEle.value}`}
placeholder={getEtcPlaceholder(String(scalarEle.label))}
value={getOpenText(props.answerData, Number(tensorEle.value), Number(matrixEle.value), Number(scalarEle.value))}
onChange={(e) => {
if(scalarEle.is_etc === 1){
insertOpen(e, props.answerData, props.setAnswerData,Number(tensorEle.value),Number(matrixEle.value),Number(scalarEle.value))
}
else{
insertNumeric(e, props.answerData, props.setAnswerData,Number(tensorEle.value),Number(matrixEle.value),Number(scalarEle.value), 0)
}
}}
disabled={!isCheckValue(props.answerData, Number(tensorEle.value),Number(matrixEle.value),Number(scalarEle.value))}
/>
</div>
)
})}
</div>
</div>
</div>
</li>
</ul>
))}
</li>
</ul>
</Col>
</Row>
))}</React.Fragment>)
}
export const TensorTableNumeric = (props:{
styleInfo:any,
skey:string,
surveyType?: string | undefined,
scalar_label:labelType | null,
matrix_label:labelType | null,
tensor_label: labelType | null,
qid:string | null
answerData:answerDataType[],
setAnswerData:SetterOrUpdater<answerDataType[]>,
question_option?:OptionInfoType[]|null,
setTotalState:SetterOrUpdater<boolean>,
}) => {
const [tdEmpact, setTdEmpact] = useState<tdEmpcatType>({t:0,m:0})
const [widthArray, setWidthArray] = useState<string[]>([]);
const [totalSumArray, setTotalSumArray] = useState<number[]>([]);
const [columnSums, setColumnSums] = useState<number[]>([]);
let widthNum = props.question_option?.filter((ele) => {if(ele.type_code === "01" && ele.detail_code === "04") return ele.value})
let temWidth = widthNum?.[0]?.value
const isCheckedTotal = () => {
return (getOption(props.question_option||[],"30","06","01")[0]?.value||"0") === "1";
}
let totalNum = getOption(props.question_option||[],"30","06","02")[0]?.value||""
const customNumericElements = document.querySelectorAll('.list-item');
const customInputElements = document.querySelectorAll('.input-lbl');
const customTextAreaElements = document.querySelectorAll('.txtarea-box');
customNumericElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customInputElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customTextAreaElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
useEffect(() => {
const widthArr = temWidth?.split(',');
if(widthArr){
setWidthArray(widthArr)
}
},[temWidth])
useEffect(() => {
if (props.tensor_label?.label_info) {
let columnSums: { [key: number]: number } = {};
props.tensor_label?.label_info.forEach(tEle => {
props.answerData.forEach(aEle => {
if (aEle.t === tEle.value) {
if (!columnSums[tEle.value]) {
columnSums[tEle.value] = 0;
}
columnSums[tEle.value] += parseFloat(aEle.o || '0');
}
});
});
const sumsArray = Object.values(columnSums);
setTotalSumArray(sumsArray);
}
}, [props.answerData, props.tensor_label]);
//2열 이상일 때 합계 체크
useEffect(() => {
const allMatch = totalSumArray.every(ele => ele === Number(totalNum));
// 모든 요소가 일치하면 props.setTotalState(true), 아니면 false
props.setTotalState(allMatch);
},[totalSumArray])
return (
<Row className='p-1'>
<Col md={12}>
<div className="tbe-area mb-0">
<Table className="tbe-wrap text-center chk-tbe ts">
<thead>
<tr className="tbe-tr">
<th style={{width: widthArray[0] + "%"}} />
{
props.tensor_label?.label_info.map((tensorEle, tensorIdx) => (
<th key={ tensorIdx} style={{width: widthArray[tensorIdx + 1] + "%"}}
dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(tensorEle.value)+"]</span> "+ transFormBr(String(tensorEle.label), String(props.skey))
: transFormBr(String(tensorEle.label), String(props.skey))
}}>
</th>
))
}
</tr>
</thead>
<tbody>
{
props.matrix_label?.label_info.map((matrixEle, matrixIdx) => (
<tr key={matrixIdx} className="tbe-tr">
<td className="tbe-td" dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(matrixEle.value)+"]</span> "+ transFormBr(String(matrixEle.label), String(props.skey))
: transFormBr(String(matrixEle.label), String(props.skey))
}} />
{
props.tensor_label?.label_info.map((tensorEle, tensorIdx) => (
<td key={tensorIdx}
className={isClickTd(tdEmpact, Number(tensorEle.value), Number(matrixEle.value)) ? "list-item active" : "list-item"}
style={{backgroundColor: isClickTd(tdEmpact, Number(tensorEle.value), Number(matrixEle.value)) ? `${props.styleInfo?.shadowColor}` : '#fff'}}
onClick={(e) => {
e.stopPropagation();
setTdEmpact({t:Number(tensorEle.value), m:Number(matrixEle.value)});
}}>
<div className="list-item">
<div className="tbe-txt">
{
matrixEle.prefix === "" || matrixEle.prefix === undefined ? null
: <span className="txt-pre">{matrixEle.prefix}</span>
}
<div className="txt-list txt-list-post">
<input type="text" id={`${props.qid}_${tensorEle.value}_${matrixEle.value}_1`}
data-s={0}
data-m={matrixEle.value}
data-t={tensorEle.value}
onFocus={(e) => {
e.stopPropagation();
setTdEmpact({t:Number(tensorEle.value), m:Number(matrixEle.value)});
}}
onChange={(e) =>
insertNumeric(e, props.answerData, props.setAnswerData, Number(tensorEle.value), Number(matrixEle.value), 1, Number(matrixEle.decimal_point))
}
value={getOpenText(props.answerData, Number(tensorEle.value), Number(matrixEle.value),1)}
style={ matrixEle.prefix === "" && matrixEle.suffix === "" ? {borderRadius:"4px"}
: matrixEle.prefix !== "" && matrixEle.suffix === "" ? {borderRadius:"0 4px 4px 0"}
: matrixEle.prefix === "" && matrixEle.suffix !== "" ? {borderRadius:"4px 0 0 4px"}
: {borderRadius:"0px"} }
/>
</div>
{
matrixEle.suffix === "" || matrixEle.suffix === undefined ? null
: <span className="txt-post">{matrixEle.suffix}</span>
}
</div>
</div>
</td>
))
}
</tr>
))
}
{
isCheckedTotal() ?
<tr>
<td>합계</td>
{
props.tensor_label?.label_info.map((tensorEle, tensorIdx) => {
return (<td key={tensorIdx}>
<div className="list-item ">
<div className="tbe-txt">
<div className="txt-list txt-list-post">
<input type="text" value={ totalSumArray[tensorIdx] || 0 } readOnly/>
</div>
</div>
</div>
</td>)
})
}
</tr>
: null
}
</tbody>
</Table>
</div>
</Col>
</Row>
)
}
export const TensorTableString = (props:{
styleInfo:any,
skey:string,
surveyType?: string | undefined,
scalar_label:labelType | null,
matrix_label:labelType | null,
tensor_label: labelType | null,
qid:string | null
answerData:answerDataType[],
setAnswerData:SetterOrUpdater<answerDataType[]>,
question_option?:OptionInfoType[]|null,
}) => {
const [tdEmpact, setTdEmpact] = useState<tdEmpcatType>({t:0,m:0})
const [widthArray, setWidthArray] = useState<string[]>([]);
let widthNum = props.question_option?.filter((ele) => {if(ele.type_code === "01" && ele.detail_code === "04") return ele.value})
let temWidth = widthNum?.[0]?.value
const customNumericElements = document.querySelectorAll('.list-item');
const customInputElements = document.querySelectorAll('.input-lbl');
const customTextAreaElements = document.querySelectorAll('.txtarea-box');
customNumericElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customInputElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
customTextAreaElements.forEach((element:any) => {
// CSS 변수 --custom-bg-color에 새로운 값 설정
element.style.setProperty('--custom-bg-color', props.styleInfo?.mainColor);
});
useEffect(() => {
const widthArr = temWidth?.split(',');
if(widthArr){
setWidthArray(widthArr)
}
},[temWidth])
return (
<Row className='p-1'>
<Col md={12}>
<div className="tbe-area mb-0">
<Table className="tbe-wrap text-center chk-tbe ts">
<thead>
<tr className="tbe-tr">
<th style={{width: widthArray[0] + "%"}} />
{
props.tensor_label?.label_info.map((tensorEle, tensorIdx) => (
<th key={ tensorIdx} style={{width: widthArray[tensorIdx + 1] + "%"}}
dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(tensorEle.value)+"]</span> "+ transFormBr(String(tensorEle.label), String(props.skey))
: transFormBr(String(tensorEle.label), String(props.skey))
}}>
</th>
))
}
</tr>
</thead>
<tbody>
{
props.matrix_label?.label_info.map((matrixEle, matrixIdx) => (
<tr key={matrixIdx} className="tbe-tr">
<td className="tbe-td" dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(matrixEle.value)+"]</span> "+ transFormBr(String(matrixEle.label), String(props.skey))
: transFormBr(String(matrixEle.label), String(props.skey))
}} />
{
props.tensor_label?.label_info.map((tensorEle, tensorIdx) => (
<td key={tensorIdx}
className={isClickTd(tdEmpact, Number(tensorEle.value), Number(matrixEle.value)) ? "list-item active" : "list-item"}
style={{backgroundColor: isClickTd(tdEmpact, Number(tensorEle.value), Number(matrixEle.value)) ? `${props.styleInfo?.shadowColor}` : '#fff'}}
onClick={(e) => {
e.stopPropagation();
setTdEmpact({t:Number(tensorEle.value), m:Number(matrixEle.value)});
}}>
<div className="list-item">
<div className="tbe-txt">
{
matrixEle.prefix === "" || matrixEle.prefix === undefined ? null
: <span className="txt-pre">{matrixEle.prefix}</span>
}
<div className="txt-list txt-list-post">
<input type="text" id={`${props.qid}_${tensorEle.value}_${matrixEle.value}_1`}
data-s={0}
data-m={matrixEle.value}
data-t={tensorEle.value}
onFocus={(e) => {
e.stopPropagation();
setTdEmpact({t:Number(tensorEle.value), m:Number(matrixEle.value)});
}}
onChange={(e) =>
insertOpen(e, props.answerData, props.setAnswerData,Number(tensorEle.value), Number(matrixEle.value), 1)
}
style={ matrixEle.prefix === "" && matrixEle.suffix === "" ? {borderRadius:"4px"}
: matrixEle.prefix !== "" && matrixEle.suffix === "" ? {borderRadius:"0 4px 4px 0"}
: matrixEle.prefix === "" && matrixEle.suffix !== "" ? {borderRadius:"4px 0 0 4px"}
: {borderRadius:"0px"} }
/>
</div>
{
matrixEle.suffix === "" || matrixEle.suffix === undefined ? null
: <span className="txt-post">{matrixEle.suffix}</span>
}
</div>
</div>
</td>
))
}
</tr>
))
}
</tbody>
</Table>
</div>
</Col>
</Row>
)
}
export const TensorMobileNumeric = (props:{
styleInfo:any,
skey:string,
surveyType?: string | undefined,
scalar_label:labelType | null,
matrix_label:labelType | null,
tensor_label: labelType | null,
qid:string | null
answerData:answerDataType[],
setAnswerData:SetterOrUpdater<answerDataType[]>,
question_option?:OptionInfoType[] | null,
setTotalState:SetterOrUpdater<boolean>,
}) => {
const [totalSumArray, setTotalSumArray] = useState<number[]>([]);
let totalNum = getOption(props.question_option||[],"30","06","02")[0]?.value||""
//2열 이상일 때 합계 체크
useEffect(() => {
const allMatch = totalSumArray.every(ele => ele === Number(totalNum));
// 모든 요소가 일치하면 props.setTotalState(true), 아니면 false
props.setTotalState(allMatch);
},[totalSumArray])
return (
<React.Fragment>
{
props.tensor_label?.label_info.map((tensorEle, tensorIdx) => (
<Row key={tensorIdx} className='p-1'>
<Col md={12}>
<ul className="tbe-ul tbe-mob ts">
<li>
<div className="mob-th" dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(tensorEle.value)+"]</span> "+ transFormBr(String(tensorEle.label), String(props.skey))
: transFormBr(String(tensorEle.label), String(props.skey))
}} />
{
props.matrix_label?.label_info.map((matrixEle, matrixIdx) => (
<ul key={matrixIdx} className="list-grp">
<li>
<div className="list-item">
<div className="custom-sel">
<div className="sel-wrap mob">
<span dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(matrixEle.value)+"]</span> "+ transFormBr(String(matrixEle.label), String(props.skey))
: transFormBr(String(matrixEle.label), String(props.skey))
}} />
<div className="tbe-txt">
{
matrixEle.prefix === "" || matrixEle.prefix === undefined ? null
: <span className="txt-pre">{matrixEle.prefix}</span>
}
<div className="txt-list txt-list-post">
<input type="text" id={`${props.qid}_${tensorEle.value}_${matrixEle.value}_1`}
data-s={0}
data-m={matrixEle.value}
data-t={tensorEle.value}
onChange={(e) =>
insertNumeric(e, props.answerData, props.setAnswerData, Number(tensorEle.value), Number(matrixEle.value), 1, Number(matrixEle.decimal_point))
}
value={getOpenText(props.answerData, Number(tensorEle.value), Number(matrixEle.value),1)}
style={ matrixEle.prefix === "" && matrixEle.suffix === "" ? {borderRadius:"4px"}
: matrixEle.prefix !== "" && matrixEle.suffix === "" ? {borderRadius:"0 4px 4px 0"}
: matrixEle.prefix === "" && matrixEle.suffix !== "" ? {borderRadius:"4px 0 0 4px"}
: {borderRadius:"0"} }
/>
</div>
{
matrixEle.suffix === "" || matrixEle.suffix === undefined ? null
: <span className="txt-post">{matrixEle.suffix}</span>
}
</div>
</div>
</div>
</div>
</li>
</ul>
))}
</li>
</ul>
</Col>
</Row>
))
}
</React.Fragment>
)
}
export const TensorMobileString = (props:{
styleInfo:any,
skey:string,
surveyType?: string | undefined,
scalar_label:labelType | null,
matrix_label:labelType | null,
tensor_label: labelType | null,
qid:string | null
answerData:answerDataType[],
setAnswerData:SetterOrUpdater<answerDataType[]>,
question_option?:OptionInfoType[] | null,
}) => {
return (
<React.Fragment>
{
props.tensor_label?.label_info.map((tensorEle, tensorIdx) => (
<Row key={tensorIdx} className='p-1'>
<Col md={12}>
<ul className="tbe-ul tbe-mob ts">
<li>
<div className="mob-th" dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(tensorEle.value)+"]</span> "+ transFormBr(String(tensorEle.label), String(props.skey))
: transFormBr(String(tensorEle.label), String(props.skey))
}} />
{
props.matrix_label?.label_info.map((matrixEle, matrixIdx) => (
<ul key={matrixIdx} className="list-grp">
<li>
<div className="list-item">
<div className="custom-sel">
<div className="sel-wrap mob">
<span dangerouslySetInnerHTML={{__html: props.surveyType === "t" ?
"<span class='value-color'>["+String(matrixEle.value)+"]</span> "+ transFormBr(String(matrixEle.label), String(props.skey))
: transFormBr(String(matrixEle.label), String(props.skey))
}} />
<div className="tbe-txt">
{
matrixEle.prefix === "" || matrixEle.prefix === undefined ? null
: <span className="txt-pre">{matrixEle.prefix}</span>
}
<div className="txt-list txt-list-post">
<input type="text" id={`${props.qid}_${tensorEle.value}_${matrixEle.value}_1`}
data-s={0}
data-m={matrixEle.value}
data-t={tensorEle.value}
onChange={(e) =>
insertOpen(e, props.answerData, props.setAnswerData,Number(tensorEle.value), Number(matrixEle.value), 1)
}
style={ matrixEle.prefix === "" && matrixEle.suffix === "" ? {borderRadius:"4px"}
: matrixEle.prefix !== "" && matrixEle.suffix === "" ? {borderRadius:"0 4px 4px 0"}
: matrixEle.prefix === "" && matrixEle.suffix !== "" ? {borderRadius:"4px 0 0 4px"}
: {borderRadius:"0 4px 4px 0"} }
/>
{
matrixEle.suffix === "" || matrixEle.suffix === undefined ? null
: <span className="txt-post">{matrixEle.suffix}</span>
}
</div>
</div>
</div>
</div>
</div>
</li>
</ul>
))}
</li>
</ul>
</Col>
</Row>
))
}
</React.Fragment>
)
}

View File

@@ -0,0 +1,251 @@
import React, { useState, useEffect, ImgHTMLAttributes } from 'react'
import { SetterOrUpdater, useRecoilValue } from 'recoil'
import axios from 'axios'
import { Button, Modal, Row } from 'react-bootstrap'
import type { questionInfoType, blockArrayType } from "@modules/TypeModule"
import { URL_SEED } from '@modules/AxiosModule'
import { memberInfo, projectInfo, loginToken } from '@token/Token'
export const BlockQuestion = (props:{
questionInfo: questionInfoType[],
setQuestionRefresh: SetterOrUpdater<number | null>,
onHide: () => void
}) => {
const [refreshBlock, setRefreshBlock] = useState<number | null>(null);
const [filterInfo, setFilterInfo] = useState<questionInfoType[]>([]);
// block마다 선택 된 QID
const [isActive, setIsActive] = useState<number[]>([]);
const [orderArray, setOrderArray] = useState<number[]>([]);
// 선택된 block
const [blockIsActive, setBlockIsActive] = useState<number | null>(null);
const [blockArray, setBlockArray] = useState<blockArrayType[]>([]);
const [disabledQuestion, setDisabledQuestion] = useState<number[]>([]);
const info = useRecoilValue(memberInfo);
const prjInfo = useRecoilValue(projectInfo);
const token = useRecoilValue(loginToken)
useEffect(() => {
const infoFilter = props.questionInfo.filter((ele) => ele.question_order > 0 && ele.question_dimension !== 9).sort((a, b) => a.question_order - b.question_order);
setFilterInfo(infoFilter);
},[])
useEffect(() => {
axios.get(URL_SEED+'/question/getBlockQuestion', {
params: {
project_code : prjInfo.prjcode,
},
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
setBlockArray(response.data);
}
}).catch(error => {
console.log("getBlockQuestion Error : ", error);
})
},[refreshBlock])
const questionListClick = (questionUK:number, orderId:number) => {
if(blockArray.length === 0 && orderArray.length === 0){
alert("블록을 생성해 주세요");
return false;
}else{
setIsActive(prevActiveRows => {
if(prevActiveRows.includes(questionUK)){
// 이미 활성화된 row를 클릭한 경우, 해당 ID를 제거
return prevActiveRows.filter(rowId => rowId !== questionUK);
}else{
// 새로운 row를 활성화하는 경우, 해당 ID를 추가
return [...prevActiveRows, questionUK];
}
});
setOrderArray(prevActiveRows => {
if (prevActiveRows.includes(orderId)) {
// 이미 활성화된 row를 클릭한 경우, 해당 ID를 제거
return prevActiveRows.filter(rowId => rowId !== orderId);
} else {
// 새로운 row를 활성화하는 경우, 해당 ID를 추가
return [...prevActiveRows, orderId];
}
});
}
}
const blockClick = (blockIndex:number) => {
let blockFilter:blockArrayType[] = blockArray.filter((ele) => ele.blockCode === blockIndex);
const matchedQuestions = filterInfo.filter(ele =>
blockFilter[0]?.blockCollectList.includes(ele.question_unique_key)
)
const orderActive = matchedQuestions.filter((ele) => ele.question_order !== undefined).map((ele => ele.question_order));
setOrderArray(orderActive);
setIsActive(blockFilter[0]?.blockCollectList);
setBlockIsActive(blockIndex);
}
const blockAdd = () => {
setIsActive([]);
setOrderArray([]);
setBlockArray([...blockArray, {blockCode: 0, blockName: "Add Block...", blockType:0, blockCollectList:[]}]);
}
const saveBlock = () => {
let questionOrderArray = filterInfo.map((e) => e.question_order);
let chkOrder = orderArray.sort((a, b) => a - b);
if(isActive.length === 0){
alert("문항을 선택해주세요");
return false;
}
for (let i = 1; i < chkOrder.length; i++) {
if (questionOrderArray.indexOf(chkOrder[i]) !== questionOrderArray.indexOf(chkOrder[i - 1]) + 1) {
alert("순서대로 선택해 주세요.");
return false;
}
}
let data = {
project_code: prjInfo.prjcode,
block_code: blockIsActive,
block_type: 1,
block_list: isActive,
reg_member: info.member_code
}
axios.post(URL_SEED+'/question/setBlockQuestion', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
setIsActive([]);
setRefreshBlock(Date.now());
props.setQuestionRefresh(Date.now());
alert("저장 되었습니다.");
}
}).catch((error) => {
console.log("setBlockQuestion Error:", error)
})
}
const deleteBlock = (e:React.MouseEvent<HTMLImageElement>) => {
if(window.confirm("해당 블록을 삭제하시겠습니까?")){
let data = {
project_code: prjInfo.prjcode,
block_code: Number(e.currentTarget.id),
}
axios.post(URL_SEED+'/question/deleteBlockQuestion', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
setIsActive([]);
setRefreshBlock(Date.now());
props.setQuestionRefresh(Date.now());
}
}).catch((error) => {
console.log("deleteBlockQuestion Error:", error)
})
}else{
return false;
}
}
useEffect(() => {
if(blockArray.length >= 1) {
if(blockArray[0]?.blockCode === 0){
blockClick(0);
}else{
blockClick(1);
}
}
},[blockArray])
useEffect(() => {
let notInQuestion = blockArray.filter((ele) => ele.blockCode !== blockIsActive);
// 제외한 block중에서 blockCollect 배열만 합친 후 블록에서 제외
const combinedBlockCollectList = notInQuestion.reduce((acc:number[], block) => acc.concat(block.blockCollectList), []);
// 중복 제거 및 새로운 배열로 생성
const duplicateArray:number[] = [...new Set(combinedBlockCollectList)];
setDisabledQuestion(duplicateArray);
},[blockIsActive])
return(
<React.Fragment>
<Modal.Body className="logicForm" style={{maxHeight:"600px!important", height:"600px", overflowY:"auto"}}>
<div className='d-flex'>
<div className='w-25 p-3'>
{
blockArray.length > 0 ?
blockArray.map((ele, index) => {
return(
<Row
key={index}
className={ blockIsActive === ele.blockCode ? 'selected_redirectForm border font-weight-bold justify-content-between' : 'border font-weight-bold justify-content-between'}
style={{height:"5vh", alignItems:"center", paddingLeft:"10px",borderBottom:"1px solid #dee2e6 !important", backgroundColor:"white", cursor:"pointer"}}
onClick={ () => blockClick(ele.blockCode) }
>
{ele.blockName}
<div className='mr-1'>
<img src={'/public_img/minusBtn.svg'} style={{cursor:"pointer", width:"20px",height:"20px"}} onClick={ deleteBlock } id={String(ele.blockCode)} alt="minus"/>
</div>
</Row>
)
})
:
<Row
className={'border font-weight-bold'}
style={{height:"5vh", alignItems:"center", justifyContent:"center", paddingLeft:"10px", borderBottom:"1px solid #dee2e6 !important", backgroundColor:"white", cursor:"pointer"}}
>
{'Add Block'}
</Row>
}
<div style={{"textAlign":"center"}}>
<img src={'/public_img/plusBtnGreen.svg'} style={{"cursor":"pointer"}} onClick={ blockAdd } alt="plus"/>
</div>
</div>
<div className='w-75 p-3 align-item-center'>
{
filterInfo.map((ele:questionInfoType, index:number) => {
return(
<Row
key={ele.question_unique_key}
className={ isActive?.includes(ele.question_unique_key) ? 'border block-active' : 'border'}
aria-disabled={disabledQuestion.includes(ele.question_unique_key)}
style={
!disabledQuestion.includes(ele.question_unique_key) ?
{height:"5vh", alignItems:"center", paddingLeft:"10px",borderBottom:"1px solid #dee2e6 !important", backgroundColor:"white", cursor:"pointer"}
:
{height:"5vh", alignItems:"center", paddingLeft:"10px",borderBottom:"1px solid #dee2e6 !important", backgroundColor:"#E9ECEF", cursor:"pointer", pointerEvents:"none"}
}
onClick={() => questionListClick(ele.question_unique_key, ele.question_order)}
id={ele.question_id}
>
{
!disabledQuestion.includes(ele.question_unique_key) ?
ele.question_id
:
ele.question_id + " / 사용 중"
}
</Row>
)
})
}
</div>
</div>
</Modal.Body>
<Modal.Footer>
<div className='mt-2 mr-1 float-right'>
<Button className='project-save-btn mr-2' variant="primary" onClick={saveBlock}>저장</Button>
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</React.Fragment>
)
}

View File

@@ -0,0 +1,128 @@
import { useEffect, useState, useRef } from "react";
import { Button, Modal } from "react-bootstrap"
import { questionInfoType } from "@modules/TypeModule"
import { URL_SEED } from "@modules/AxiosModule";
import { SetterOrUpdater, useRecoilValue } from "recoil";
import { loginToken, projectInfo } from "@token/Token";
import axios from "axios";
export const CopyQuestion = (props:{
questionInfo: questionInfoType[];
setQuestionRefresh: SetterOrUpdater<number | null>;
setCopyFlag: SetterOrUpdater<boolean>;
onHide: () => void;
}) => {
const token = useRecoilValue(loginToken);
const project = useRecoilValue(projectInfo);
const [filterInfo, setFilterInfo] = useState<questionInfoType[]>([]);
const [copyCount, setCopyCount] = useState("");
const [copyQuestionArray, setCopyQuestionArray] = useState<number[]>([]);
const [allSelected, setAllSelected] = useState(false);
const focusCopy = useRef<HTMLInputElement>(null);
const copyQuestionClick = (uk:number) => {
setCopyQuestionArray(prevUniqueKey => {
if (prevUniqueKey.includes(uk)) {
// 이미 활성화된 row를 클릭한 경우, 해당 ID를 제거
return prevUniqueKey.filter(questionUK => questionUK !== uk);
} else {
// 새로운 row를 활성화하는 경우, 해당 ID를 추가
return [...prevUniqueKey, uk];
}
});
}
console.log(filterInfo, copyQuestionArray)
const copyQuestion = () => {
if(copyQuestionArray.length === 0){
alert("복사 문항을 선택해주세요.");
return false;
}
if(copyCount === ""){
alert("복사 세트 수를 입력해주세요.");
focusCopy.current?.focus();
return false;
}
if(window.confirm("해당 문항을 복사하시겠습니까?")){
const data = {
project_code: project.prjcode,
question_unique_key: copyQuestionArray,
copy_set_count: copyCount
}
axios.post(URL_SEED + '/question/copyQuestionInfo', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
alert("복사 되었습니다");
props.setQuestionRefresh(Date.now());
props.setCopyFlag(true);
setCopyCount("");
setCopyQuestionArray([]);
}
}).catch((error) => {
console.log("copyQuestionInfo : ", error)
})
}else{
return false;
}
}
const allCheck = () => {
if (!allSelected) {
const newCopyQuestionArray = filterInfo.map(ele => ele.question_unique_key);
setCopyQuestionArray(newCopyQuestionArray);
} else {
setCopyQuestionArray([]);
}
setAllSelected(!allSelected);
}
const infoFilterArray = () => {
const infoFilter = props.questionInfo.filter((ele) => ele.question_order > 0).sort((a, b) => a.question_order - b.question_order);
setFilterInfo(infoFilter);
}
useEffect(() => {
infoFilterArray();
},[props.questionInfo])
return(
<div>
<Modal.Body className="logicForm" style={{maxHeight: "600px!important",height:"600px", overflowY:"auto"}}>
{
filterInfo.map((ele, index) => {
return(
<div key={ele.question_unique_key} className='d-flex list-item justify-content-center management'>
<div className="custom-chk">
<input type="checkbox" id={"chkCopy_" + ele.question_unique_key} value={ele.question_unique_key} onChange={() => copyQuestionClick(ele.question_unique_key)} checked={copyQuestionArray.includes(ele.question_unique_key)}/>
<label htmlFor={"chkCopy_" + ele.question_unique_key} onChange={() => copyQuestionClick(ele.question_unique_key)}/>
</div>
<label className="w-100" htmlFor={"chkCopy_" + ele.question_unique_key} onChange={() => copyQuestionClick(ele.question_unique_key)}>
<div className="file-li border mb-1" id={"chkCopy_" + ele.question_unique_key}
style={{
cursor: "pointer",
backgroundColor: copyQuestionArray.includes(ele.question_unique_key) ? "#B1DFBC" : "white"
}}
>
{ele.question_id}
</div>
</label>
</div>
)
})
}
</Modal.Body>
<Modal.Footer>
<div style={{display: 'flex', justifyContent: 'space-between', flexWrap: 'wrap', marginTop: '8px', marginRight: '4px'}}>
<input ref={focusCopy} type='number' style={{flexGrow: 1, marginRight: '8px', width:'100px'}} placeholder="복사 세트 수" value={copyCount} onChange={(e) => setCopyCount(e.currentTarget.value)}/>
<Button className='project-save-btn mr-2' variant="primary" onClick={copyQuestion}>복사</Button>
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</div>
)
}

View File

@@ -0,0 +1,119 @@
import React, { useEffect, useState } from "react"
import axios from "axios";
import { SetterOrUpdater, useRecoilValue } from "recoil";
import { Button, Modal } from "react-bootstrap";
import type { questionInfoType } from "@modules/TypeModule"
import { URL_SEED } from "@modules/AxiosModule";
import { loginToken, projectInfo } from "@token/Token";
export const DeleteQuestion = (props:{
questionInfo:questionInfoType[];
setDeleteFlag: SetterOrUpdater<boolean>;
setQuestionRefresh: SetterOrUpdater<number | null>;
onHide: () => void;
}) => {
const [filterInfo, setFilterInfo] = useState<questionInfoType[]>([]);
const [deleteQuestionArray, setDeleteQuestionArray] = useState<number[]>([]);
const [allSelected, setAllSelected] = useState(false);
const token = useRecoilValue(loginToken);
const projectState = useRecoilValue(projectInfo);
const deleteQuestionClick = (uk:number) => {
setDeleteQuestionArray(prevUniqueKey => {
if (prevUniqueKey.includes(uk)) {
// 이미 활성화된 row를 클릭한 경우, 해당 ID를 제거
return prevUniqueKey.filter(questionUK => questionUK !== uk);
} else {
// 새로운 row를 활성화하는 경우, 해당 ID를 추가
return [...prevUniqueKey, uk];
}
});
}
const deleteQuestion = () => {
if(window.confirm("해당 문항을 삭제하시겠습니까?")){
const data = {
project_code: projectState.prjcode,
question_unique_key: deleteQuestionArray
}
axios.post(URL_SEED+'/question/deleteQuestionInfo', data, {
headers: {
'Authorization': `Bearer ${token.access}`,
}
}).then((response) => {
if(response.status === 200){
alert("삭제 되었습니다");
props.setQuestionRefresh(Date.now());
props.setDeleteFlag(true);
setAllSelected(false);
setDeleteQuestionArray([]);
}
}).catch((error) => {
console.log("deleteQuestionInfo: ", error)
})
}else{
return false;
}
}
const allCheck = () => {
if (!allSelected) {
const newDeleteQuestionArray = filterInfo.map(ele => ele.question_unique_key);
setDeleteQuestionArray(newDeleteQuestionArray);
} else {
setDeleteQuestionArray([]);
}
setAllSelected(!allSelected);
}
const infoFilterArray = () => {
const infoFilter = props.questionInfo.filter((ele) => ele.question_order > 0).sort((a, b) => a.question_order - b.question_order);
setFilterInfo(infoFilter);
}
useEffect(() => {
infoFilterArray();
},[props.questionInfo])
return (
<div>
<Modal.Body className="logicForm" style={{maxHeight: "600px!important",height:"600px", overflowY:"auto"}}>
<div className="custom-chk all-chcek w-25 mb-3">
<input type="checkbox" id="chk-all" checked={ allSelected } onChange={allCheck}/>
<label htmlFor="chk-all">전체 선택</label>
</div>
{
filterInfo.map((ele, index) => {
return(
<div key={ele.question_unique_key} className='d-flex list-item justify-content-center management'>
<div className="custom-chk">
<input type="checkbox" id={"chkDelete_" + ele.question_unique_key} value={ele.question_unique_key} onChange={() => deleteQuestionClick(ele.question_unique_key)} checked={deleteQuestionArray.includes(ele.question_unique_key)}/>
<label htmlFor={"chkDelete_" + ele.question_unique_key} onChange={() => deleteQuestionClick(ele.question_unique_key)}/>
</div>
<label className="w-100" htmlFor={"chkDelete_" + ele.question_unique_key} onChange={() => deleteQuestionClick(ele.question_unique_key)}>
<div className="file-li border mb-1"
id={"chkDelete_" + ele.question_unique_key}
style={{
cursor: "pointer",
backgroundColor: deleteQuestionArray.includes(ele.question_unique_key) ? "#B1DFBC" : "white"
}}
>
{ele.question_id}
</div>
</label>
</div>
)
})
}
</Modal.Body>
<Modal.Footer>
<div className='mt-2 mr-1 float-right'>
<Button className='project-save-btn mr-2' variant="primary" onClick={deleteQuestion}>삭제</Button>
<Button variant="secondary" onClick={()=>{props.onHide()}}>닫기</Button>
</div>
</Modal.Footer>
</div>
)
}

View File

@@ -0,0 +1,419 @@
/* eslint-disable jsx-a11y/alt-text */
import React, { useState, useEffect } from "react";
import { SetterOrUpdater } from "recoil";
import { Form, Container } from "react-bootstrap";
import { LabelModal } from "@modals/LabelModal";
import { AutoRecodeModal, MatrixNumericModal, MatrixStringModal, ScalarNumericModal, ScalarStringModal } from "@modals/OpenLabelModal";
import {
regexEngNumUnderBar,
regexNumComma,
regexNumCommaRange,
regexSetNumComma,
regexSetNumCommaRange
} from "@modules/Function";
import type { ProjectState, autoRecodeArray, headerInfoType, labelOptionType, questionInfoType } from "@modules/TypeModule";
import { labelOptionDefault } from "@main/QuestionSetup";
import { BrandSelectOption } from "./QuestionOption";
export const LabelSection = (props:{
projectdata:ProjectState,
questionInfo:questionInfoType[],
questionUpdate:questionInfoType,
setAutoRecodeArray: SetterOrUpdater<autoRecodeArray[]>,
setQuestionUpdate:SetterOrUpdater<questionInfoType>,
labelDimension:number,
listHeaderArray:headerInfoType[],
listAutoValue: number,
setBrandAutoValue: SetterOrUpdater<number>,
brandAutoValue: number,
setListAutoValue: SetterOrUpdater<number>
}) => {
const textArray = ['Scalar', 'Matrix', 'Tensor'];
const dimesionText = textArray[props.labelDimension - 1];
const [startFlag, setStartFlag] = useState(false);
const [fixedRotationChecked, setFixedRotationChecked] = useState(false);
const [groupRotationChecked, setGroupRotationChecked] = useState(false);
const [modalShow, setModalShow] = useState(false);
const [autoRecodeModalShow, setAutoRecodeModalShow] = useState(false);
const [showLabel, setShowLabel] = useState(false);
const [acceptQid, setAcceptQid] = useState('');
const [exceptQid, setExceptQid] = useState('');
const [fixedTop, setFixedTop] = useState('');
const [fixedBottom, setFixedBottom] = useState('');
const [groupRota, setGroupRota] = useState('');
const ModalShow = () => {
closeBtn();
setModalShow(!modalShow)
}
const AutoRecodeModalShow = () => {
closeBtn();
setAutoRecodeModalShow(!autoRecodeModalShow)
}
const closeBtn = () => {
setModalShow(false)
setAutoRecodeModalShow(false)
}
useEffect(() => {
if(startFlag){
let tempQuestionUpdate = {...props.questionUpdate}
const labelOption:labelOptionType = {
accept_question: acceptQid,
except_question: exceptQid,
use_rotation: fixedRotationChecked === false ? 0 : 1,
rotation_info: {
fixed_top: fixedTop,
fixed_bottom: fixedBottom,
use_group: groupRotationChecked === false ? 0 : 1,
group: groupRota
}
}
switch (props.labelDimension){
case 1:
tempQuestionUpdate.scalar_label!.label_option = labelOption;
break;
case 2:
tempQuestionUpdate.matrix_label!.label_option = labelOption;
break;
case 3:
tempQuestionUpdate.tensor_label!.label_option = labelOption;
break;
}
props.setQuestionUpdate(tempQuestionUpdate);
}
},[acceptQid, exceptQid, fixedRotationChecked, fixedTop, fixedBottom, groupRotationChecked, groupRota])
useEffect(() => {
if(fixedRotationChecked === false){
setFixedTop('');
setFixedBottom('');
setGroupRota('');
setGroupRotationChecked(false);
}
if(groupRotationChecked === false){
setGroupRota('')
}
},[fixedRotationChecked,groupRotationChecked])
useEffect(() => {
if (props.questionUpdate.question_unique_key !== 0) {
let originQuestion = [...props.questionInfo].filter((ele, arrIdx) => ele.question_unique_key === props.questionUpdate.question_unique_key);
let qTypeOriNum = Math.floor(originQuestion[0]?.question_type / 10) //기존문항 차원 십의자리 타입
let qTypeUpdateNum = Math.floor(props.questionUpdate.question_type / 10) //변경 문항차원 십의자리 타입
if ((props.questionUpdate.question_dimension === 1 || props.questionUpdate.question_dimension === 9) && ([21, 22, 31, 32].includes(originQuestion[0]?.question_type) && [41, 42].includes(props.questionUpdate.question_type) || [41, 42].includes(originQuestion[0]?.question_type) && [21, 22, 31, 32].includes(props.questionUpdate.question_type))) {
if (props.questionUpdate.scalar_label) {
props.questionUpdate.scalar_label.label_info = [{ decimal_point: 0, is_etc: 0, is_not: 0, label: "", not_duplicate: 0, open_type: 0, order: 1, placeholder: "", prefix: "", range: "", suffix: "", value: 1 }];
}
}
}
}, [props.questionUpdate.question_unique_key, props.questionUpdate.question_type, props.questionUpdate.question_dimension]);
useEffect(() => {
let targetLabelOption:labelOptionType = labelOptionDefault;
switch (props.labelDimension){
case 1:
targetLabelOption = props.questionUpdate.scalar_label!.label_option;
break;
case 2:
targetLabelOption = props.questionUpdate.matrix_label!.label_option;
break;
case 3:
targetLabelOption = props.questionUpdate.tensor_label!.label_option;
break;
}
if(targetLabelOption.accept_question){
setAcceptQid(targetLabelOption.accept_question);
}else{
setAcceptQid('');
}
if(targetLabelOption.except_question){
setExceptQid(targetLabelOption.except_question);
}else{
setExceptQid('');
}
if(targetLabelOption.use_rotation === 1){
setFixedRotationChecked(true);
}else{
setFixedRotationChecked(false);
}
if(targetLabelOption.rotation_info !== undefined){
setFixedTop(targetLabelOption.rotation_info?.fixed_top);
}else{
setFixedTop('')
}
if(targetLabelOption.rotation_info !== undefined){
setFixedBottom(targetLabelOption.rotation_info?.fixed_bottom);
}else{
setFixedBottom('')
}
if(targetLabelOption.rotation_info?.use_group === 1){
setGroupRotationChecked(true);
}else{
setGroupRotationChecked(false);
}
if(targetLabelOption.rotation_info){
setGroupRota(targetLabelOption.rotation_info?.group);
}else{
setGroupRota('')
}
setStartFlag(true);
},[props.questionUpdate.question_unique_key])
// s단축키 설정
useEffect(() => {
const scalarKeyDown = (event: { key: string; altKey: any; preventDefault: () => void; }) => {
if (props.questionUpdate.question_unique_key !== null && props.labelDimension === 1 && event.key?.toLowerCase() === 's' && event.altKey) {
event.preventDefault();
ModalShow();
}
};
document.addEventListener('keydown', scalarKeyDown);
return () => {
document.removeEventListener('keydown', scalarKeyDown);
};
}, [props.questionUpdate.question_unique_key, modalShow]);
useEffect(() => {
const matrixKeyDown = (event: { key: string; altKey: any; preventDefault: () => void; }) => {
if (props.questionUpdate.question_unique_key !== null && props.labelDimension === 2 && event.key?.toLowerCase() === 'm' && event.altKey) {
event.preventDefault();
ModalShow();
}
};
document.addEventListener('keydown', matrixKeyDown);
return () => {
document.removeEventListener('keydown', matrixKeyDown);
};
}, [props.questionUpdate.question_unique_key, modalShow]);
useEffect(() => {
const tensorKeyDown = (event: { key: string; altKey: any; preventDefault: () => void; }) => {
if (props.questionUpdate.question_unique_key !== null && props.labelDimension === 3 && event.key?.toLowerCase() === 't' && event.altKey) {
event.preventDefault();
ModalShow();
}
};
document.addEventListener('keydown', tensorKeyDown);
return () => {
document.removeEventListener('keydown', tensorKeyDown);
};
}, [props.questionUpdate.question_unique_key, modalShow]);
return (
<React.Fragment>
<Container className='mt-3'>
<span className='mb-1'>
{ dimesionText + " " }
<img
style={{cursor:"pointer", verticalAlign:"-0.1em"}}
src={'/public_img/Tools_Icon.png'}
onClick={() => ModalShow()}
alt={String(props.labelDimension)}
/>
{
props.labelDimension > 1 || props.questionUpdate.question_type !== 41 && props.questionUpdate.question_type !== 42 && props.questionUpdate.question_dimension !== 9 ?
<img
style={{cursor:"pointer", float:"right"}}
src={!showLabel ? '/public_img/arrow_up.svg' : '/public_img/arrow_down.svg'}
onClick={() => setShowLabel(!showLabel)}
/>
: null
}
</span><br/>
{
!showLabel && (props.labelDimension > 1 || props.questionUpdate.question_type !== 41 && props.questionUpdate.question_type !== 42 && props.questionUpdate.question_dimension !== 9) ?
<React.Fragment>
<Form.Control className='mt-1' list='acceptQid' value={ acceptQid } onChange={(e) => setAcceptQid(regexEngNumUnderBar(e.currentTarget.value))} placeholder='문항값 가져오기' />
<datalist id='acceptQid'>
{
props.questionInfo.filter((ele) => ele.question_dimension > 0 && ele.question_dimension === 1 && [21,22,31,32].includes(ele.question_type) && ele.question_order < props.questionUpdate.question_order).map((ele) => {
return(
<option key={ele.question_unique_key} value={ ele.question_id }>{ ele.question_id }</option>
)
})
}
</datalist>
<Form.Control className='mt-1 mb-1' list='exceptQid'
value={ exceptQid }
onChange={(e) => setExceptQid(regexEngNumUnderBar(e.currentTarget.value))}
placeholder='문항값 제외하기'
/>
<datalist id='exceptQid'>
{
props.questionInfo.filter((ele) => ele.question_dimension > 0 && ele.question_dimension === 1 && [21,22,31,32].includes(ele.question_type) && ele.question_order < props.questionUpdate.question_order).map((ele) => {
return(
<option key={ele.question_unique_key} value={ ele.question_id }>{ ele.question_id }</option>
)
})
}
</datalist>
<Form.Check type="checkbox" id={`inline-checkbox-`+props.labelDimension+'1'} style={{"paddingLeft":"0rem"}}>
<Form.Check.Input checked={ fixedRotationChecked === true ? true : false } onChange={() => setFixedRotationChecked(!fixedRotationChecked)} type={"checkbox"} isValid />
<Form.Check.Label><Form.Check.Label/>{`로테이션`}</Form.Check.Label>
</Form.Check>
{
fixedRotationChecked === true ?
<React.Fragment>
<Form.Control value={ fixedTop }
onChange={ (e) => setFixedTop(regexNumComma(e.currentTarget.value)) }
onBlur={(e)=>setFixedTop(regexSetNumComma(e.currentTarget.value))}
className='mt-1' placeholder='상단 고정 (ex 1,2)'
/>
<Form.Control value={ fixedBottom }
onChange={ (e) => setFixedBottom(regexNumComma(e.currentTarget.value)) }
onBlur={(e)=>setFixedBottom(regexSetNumComma(e.currentTarget.value))}
className='mt-1 mb-1' placeholder='하단 고정 (ex 98,99)'
/>
<Form.Check type="checkbox" id={`inline-checkbox-`+props.labelDimension+'2'} style={{"paddingLeft":"0rem"}}>
<Form.Check.Input checked={ groupRotationChecked === true ? true : false } onChange={() => setGroupRotationChecked(!groupRotationChecked) } type={"checkbox"} isValid />
<Form.Check.Label><Form.Check.Label/>{`그룹 로테이션`}</Form.Check.Label>
</Form.Check>
</React.Fragment>
:
null
}
{
groupRotationChecked === true ?
<React.Fragment>
<Form.Control value={ groupRota }
onChange={ (e) => setGroupRota(regexNumCommaRange(e.currentTarget.value))}
onBlur={(e) => setGroupRota(regexSetNumCommaRange(e.currentTarget.value))}
className='mt-1' placeholder='(ex 1~3,4~6,96~99)'
/>
</React.Fragment>
:
null
}
</React.Fragment>
:null
}
{
props.labelDimension === 1 && props.questionUpdate.question_type === 41 ?
<ScalarNumericModal
show={modalShow}
onHide={closeBtn}
questionUpdate={props.questionUpdate}
setQuestionUpdate={props.setQuestionUpdate}
/>
:
props.labelDimension === 1 && props.questionUpdate.question_type === 42 ?
<ScalarStringModal
show={modalShow}
onHide={closeBtn}
questionUpdate={props.questionUpdate}
setQuestionUpdate={props.setQuestionUpdate}
/>
:
props.labelDimension === 2 && props.questionUpdate.question_type === 41 ?
<MatrixNumericModal
show={modalShow}
onHide={closeBtn}
questionUpdate={props.questionUpdate}
setQuestionUpdate={props.setQuestionUpdate}
/>
:
props.labelDimension === 2 && props.questionUpdate.question_type === 42 ?
<MatrixStringModal
show={modalShow}
onHide={closeBtn}
questionUpdate={props.questionUpdate}
setQuestionUpdate={props.setQuestionUpdate}
/>
:
<LabelModal
show={modalShow}
onHide={closeBtn}
dimesionText={dimesionText}
labelDimension={props.labelDimension}
questionUpdate={props.questionUpdate}
setQuestionUpdate={props.setQuestionUpdate}
/>
}
</Container>
<Container className='mt-3'>
{
props.questionUpdate.question_dimension === 9 &&
props.questionUpdate.auto_type === 1 ?
<React.Fragment>
<span>
{"Auto Recode " }
<img
style={{cursor:"pointer", verticalAlign:"-0.1em"}}
src={'/public_img/Tools_Icon.png'}
onClick={() => AutoRecodeModalShow()}
// alt={String(props.labelDimension)}
/>
</span><br/>
</React.Fragment>
:
props.questionUpdate.auto_type === 2 ?
<React.Fragment>
<Form.Label>List 타입</Form.Label>
<div className='custom-sel'>
<Form.Control
className='sel-box w-75'
as='select'
onChange={(e) => props.setListAutoValue(Number(e.currentTarget.value))}
value={props.listAutoValue}
>
{
props.listHeaderArray.map((ele) => {
return(
<option key={ele.idx} value={ele.orderNo}>{ele.headerName}</option>
)
})
}
</Form.Control>
</div>
</React.Fragment>
:
props.questionUpdate.auto_type === 3 ?
<React.Fragment>
<span>
{"Brand Recode " }
<img
style={{cursor:"pointer", verticalAlign:"-0.1em"}}
src={'/public_img/Tools_Icon.png'}
onClick={() => AutoRecodeModalShow()}
// alt={String(props.labelDimension)}
/>
</span><br/>
<BrandSelectOption questionInfo={props.questionInfo} questionUpdate={props.questionUpdate} setQuestionUpdate={props.setQuestionUpdate} setBrandAutoValue={props.setBrandAutoValue} brandAutoValue={props.brandAutoValue}/>
</React.Fragment>
:
null
}
</Container>
<div>
{/* { props.questionUpdate.question_dimension === 9 ? */}
<AutoRecodeModal
show={autoRecodeModalShow}
onHide={closeBtn}
questionUpdate={props.questionUpdate}
setQuestionUpdate={props.setQuestionUpdate}
setAutoRecodeArray={props.setAutoRecodeArray}
/>
</div>
</React.Fragment>
)
}

Some files were not shown because too many files have changed in this diff Show More