update upload file check
This commit is contained in:
@ -8,8 +8,8 @@
|
||||
"main.css": "./static/css/main.12e98d00.chunk.css",
|
||||
"main.js": "./static/js/main.c02dc652.chunk.js",
|
||||
"main.js.map": "./static/js/main.c02dc652.chunk.js.map",
|
||||
"runtime-main.js": "./static/js/runtime-main.18ec15f6.js",
|
||||
"runtime-main.js.map": "./static/js/runtime-main.18ec15f6.js.map",
|
||||
"runtime-main.js": "./static/js/runtime-main.62598ad5.js",
|
||||
"runtime-main.js.map": "./static/js/runtime-main.62598ad5.js.map",
|
||||
"static/js/4.2aecef49.chunk.js": "./static/js/4.2aecef49.chunk.js",
|
||||
"static/js/4.2aecef49.chunk.js.map": "./static/js/4.2aecef49.chunk.js.map",
|
||||
"static/css/5.ecdd39c8.chunk.css": "./static/css/5.ecdd39c8.chunk.css",
|
||||
@ -17,10 +17,10 @@
|
||||
"static/js/5.713b21d1.chunk.js.map": "./static/js/5.713b21d1.chunk.js.map",
|
||||
"static/js/6.bba51257.chunk.js": "./static/js/6.bba51257.chunk.js",
|
||||
"static/js/6.bba51257.chunk.js.map": "./static/js/6.bba51257.chunk.js.map",
|
||||
"static/js/7.24e41aee.chunk.js": "./static/js/7.24e41aee.chunk.js",
|
||||
"static/js/7.24e41aee.chunk.js.map": "./static/js/7.24e41aee.chunk.js.map",
|
||||
"static/js/8.40731ea8.chunk.js": "./static/js/8.40731ea8.chunk.js",
|
||||
"static/js/8.40731ea8.chunk.js.map": "./static/js/8.40731ea8.chunk.js.map",
|
||||
"static/js/7.7a5be647.chunk.js": "./static/js/7.7a5be647.chunk.js",
|
||||
"static/js/7.7a5be647.chunk.js.map": "./static/js/7.7a5be647.chunk.js.map",
|
||||
"static/js/8.5b8eaf50.chunk.js": "./static/js/8.5b8eaf50.chunk.js",
|
||||
"static/js/8.5b8eaf50.chunk.js.map": "./static/js/8.5b8eaf50.chunk.js.map",
|
||||
"static/js/9.311e2cfe.chunk.js": "./static/js/9.311e2cfe.chunk.js",
|
||||
"static/js/9.311e2cfe.chunk.js.map": "./static/js/9.311e2cfe.chunk.js.map",
|
||||
"static/js/10.1aee78b2.chunk.js": "./static/js/10.1aee78b2.chunk.js",
|
||||
@ -46,7 +46,7 @@
|
||||
"static/js/6.bba51257.chunk.js.LICENSE.txt": "./static/js/6.bba51257.chunk.js.LICENSE.txt"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/js/runtime-main.18ec15f6.js",
|
||||
"static/js/runtime-main.62598ad5.js",
|
||||
"static/js/4.2aecef49.chunk.js",
|
||||
"static/css/main.12e98d00.chunk.css",
|
||||
"static/js/main.c02dc652.chunk.js"
|
||||
|
||||
@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="description" content="CoreUI for React - Open Source Bootstrap Admin Template"><meta name="author" content="Łukasz Holeczek"><meta name="keyword" content="Bootstrap,Admin,Template,Open,Source,CSS,SCSS,HTML,RWD,Dashboard,React"><title>FBS Admin tool</title><link rel="manifest" href="./manifest.json"><link rel="shortcut icon" href="./favicon.ico"><link href="./static/css/main.12e98d00.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,o,u=t[0],i=t[1],f=t[2],d=0,s=[];d<u.length;d++)o=u[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&s.push(a[o][0]),a[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(l&&l(t);s.length;)s.shift()();return c.push.apply(c,f||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(c.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={3:0},a={3:0},c=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{0:1,5:1}[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="static/css/"+({}[e]||e)+"."+{0:"455ee148",1:"31d6cfe0",5:"ecdd39c8",6:"31d6cfe0",7:"31d6cfe0",8:"31d6cfe0",9:"31d6cfe0",10:"31d6cfe0",11:"31d6cfe0",12:"31d6cfe0",13:"31d6cfe0",14:"31d6cfe0",15:"31d6cfe0",16:"31d6cfe0"}[e]+".chunk.css",a=u.p+n,c=document.getElementsByTagName("link"),i=0;i<c.length;i++){var f=(l=c[i]).getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(f===n||f===a))return t()}var d=document.getElementsByTagName("style");for(i=0;i<d.length;i++){var l;if((f=(l=d[i]).getAttribute("data-href"))===n||f===a)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var n=t&&t.target&&t.target.src||a,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=n,delete o[e],s.parentNode.removeChild(s),r(c)},s.href=a,document.getElementsByTagName("head")[0].appendChild(s)})).then((function(){o[e]=0})));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=a[e]=[t,n]}));t.push(r[2]=n);var c,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+"static/js/"+({}[e]||e)+"."+{0:"e423db2b",1:"bd3709d0",5:"713b21d1",6:"bba51257",7:"24e41aee",8:"40731ea8",9:"311e2cfe",10:"1aee78b2",11:"d20ada69",12:"2c871bc8",13:"886a98ec",14:"ef6f2a9c",15:"e3d77fc1",16:"3fdf9cdf"}[e]+".chunk.js"}(e);var f=new Error;c=function(t){i.onerror=i.onload=null,clearTimeout(d);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;f.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",f.name="ChunkLoadError",f.type=n,f.request=o,r[1](f)}a[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:i})}),12e4);i.onerror=i.onload=c,document.head.appendChild(i)}return Promise.all(t)},u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="./",u.oe=function(e){throw console.error(e),e};var i=this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[],f=i.push.bind(i);i.push=t,i=i.slice();for(var d=0;d<i.length;d++)t(i[d]);var l=f;r()}([])</script><script src="./static/js/4.2aecef49.chunk.js"></script><script src="./static/js/main.c02dc652.chunk.js"></script></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="description" content="CoreUI for React - Open Source Bootstrap Admin Template"><meta name="author" content="Łukasz Holeczek"><meta name="keyword" content="Bootstrap,Admin,Template,Open,Source,CSS,SCSS,HTML,RWD,Dashboard,React"><title>FBS Admin tool</title><link rel="manifest" href="./manifest.json"><link rel="shortcut icon" href="./favicon.ico"><link href="./static/css/main.12e98d00.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,o,u=t[0],i=t[1],f=t[2],d=0,s=[];d<u.length;d++)o=u[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&s.push(a[o][0]),a[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(l&&l(t);s.length;)s.shift()();return c.push.apply(c,f||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(c.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={3:0},a={3:0},c=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{0:1,5:1}[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="static/css/"+({}[e]||e)+"."+{0:"455ee148",1:"31d6cfe0",5:"ecdd39c8",6:"31d6cfe0",7:"31d6cfe0",8:"31d6cfe0",9:"31d6cfe0",10:"31d6cfe0",11:"31d6cfe0",12:"31d6cfe0",13:"31d6cfe0",14:"31d6cfe0",15:"31d6cfe0",16:"31d6cfe0"}[e]+".chunk.css",a=u.p+n,c=document.getElementsByTagName("link"),i=0;i<c.length;i++){var f=(l=c[i]).getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(f===n||f===a))return t()}var d=document.getElementsByTagName("style");for(i=0;i<d.length;i++){var l;if((f=(l=d[i]).getAttribute("data-href"))===n||f===a)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var n=t&&t.target&&t.target.src||a,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=n,delete o[e],s.parentNode.removeChild(s),r(c)},s.href=a,document.getElementsByTagName("head")[0].appendChild(s)})).then((function(){o[e]=0})));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=a[e]=[t,n]}));t.push(r[2]=n);var c,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+"static/js/"+({}[e]||e)+"."+{0:"e423db2b",1:"bd3709d0",5:"713b21d1",6:"bba51257",7:"7a5be647",8:"5b8eaf50",9:"311e2cfe",10:"1aee78b2",11:"d20ada69",12:"2c871bc8",13:"886a98ec",14:"ef6f2a9c",15:"e3d77fc1",16:"3fdf9cdf"}[e]+".chunk.js"}(e);var f=new Error;c=function(t){i.onerror=i.onload=null,clearTimeout(d);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;f.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",f.name="ChunkLoadError",f.type=n,f.request=o,r[1](f)}a[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:i})}),12e4);i.onerror=i.onload=c,document.head.appendChild(i)}return Promise.all(t)},u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="./",u.oe=function(e){throw console.error(e),e};var i=this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[],f=i.push.bind(i);i.push=t,i=i.slice();for(var d=0;d<i.length;d++)t(i[d]);var l=f;r()}([])</script><script src="./static/js/4.2aecef49.chunk.js"></script><script src="./static/js/main.c02dc652.chunk.js"></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
build/static/js/7.7a5be647.chunk.js
Normal file
2
build/static/js/7.7a5be647.chunk.js
Normal file
File diff suppressed because one or more lines are too long
1
build/static/js/7.7a5be647.chunk.js.map
Normal file
1
build/static/js/7.7a5be647.chunk.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1,2 +0,0 @@
|
||||
(this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[]).push([[8],{773:function(e,t,c){"use strict";c.r(t);var n=c(655),s=c(1),i=c(642),r=c.n(i),a=c(637),l=c(636),j=c(18);t.default=function(){var e=Object(s.useState)(null),t=Object(n.a)(e,2),c=t[0],i=t[1];return Object(j.jsx)("div",{children:Object(j.jsxs)(a.f,{children:[Object(j.jsx)(a.j,{children:"\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 "})," ",Object(j.jsxs)(a.g,{children:[Object(j.jsxs)(a.t,{row:!0,children:[Object(j.jsxs)(a.k,{md:"3",children:[Object(j.jsx)(a.H,{htmlFor:"date-input",children:" \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044 "})," "]})," ",Object(j.jsx)(a.k,{xs:"12",md:"9",children:Object(j.jsx)(a.C,{type:"file",onChange:function(e){i(e.target.files[0])},id:"file-input",name:"file-input"})})," "]}),Object(j.jsxs)(a.h,{children:[Object(j.jsxs)(a.e,{type:"submit",onClick:function(e){var t=new FormData;t.append("file",c),console.log("calling upload"),r.a.post("https://fsbsso.sumasen.net/upload",t,{}).then((function(e){"OK"==e.statusText&&alert("\u6b63\u5e38\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3057\u305f")}))},size:"sm",color:"primary",children:[" ",Object(j.jsx)(l.a,{name:"cil-scrubber"})," \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 "]})," "]})]})]})})}}}]);
|
||||
//# sourceMappingURL=8.40731ea8.chunk.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["views/Uploader/index.js"],"names":["Uploader","useState","file","setFile","row","md","htmlFor","xs","type","onChange","e","target","files","id","name","onClick","data","FormData","append","console","log","axios","post","then","res","statusText","alert","size","color"],"mappings":"mPA8EeA,UA7Df,WAEI,MAAwBC,mBAAS,MAAjC,mBAAOC,EAAP,KAAaC,EAAb,KAqBA,OAAS,8BAEL,eACA,IADA,WAEA,cACA,IADA,oDAFA,IAKc,eACd,IADc,WAEd,eACA,IADA,CACWC,KAAG,EADd,UAEA,eACA,IADA,CACKC,GAAK,IADV,UAEA,cACA,IADA,CACOC,QAAU,aADjB,wIAFA,OAFA,IAMO,cACP,IADO,CACFC,GAAK,KACVF,GAAK,IAFE,SAGP,cACA,IADA,CACWG,KAAO,OAClBC,SAvCJ,SAAyBC,GACrBP,EAAQO,EAAEC,OAAOC,MAAM,KAuCvBC,GAAK,aACLC,KAAO,iBAbP,OAiBA,eAAC,IAAD,WACA,eAAC,IAAD,CAASN,KAAO,SAChBO,QA3CJ,SAAwBL,GACpB,IAAMM,EAAO,IAAIC,SACjBD,EAAKE,OAAO,OAAQhB,GAEpBiB,QAAQC,IAAI,kBACZC,IAAMC,KAAK,oCAAqCN,EAAM,IAEjDO,MAAK,SAAAC,GAEoB,MAAlBA,EAAIC,YACNC,MAAM,4FAkChBC,KAAO,KACPC,MAAQ,UAHR,cAGoB,cAAE,IAAF,CAAQd,KAAO,iBAHnC,4CADA","file":"static/js/8.40731ea8.chunk.js","sourcesContent":["import React, { useState } from 'react';\nimport axios from 'axios';\nimport {\n CCol,\n CFormGroup,\n CInput,\n CInputFile,\n CLabel,\n CButton,\n CCard,\n CCardHeader,\n CCardBody,\n CCardFooter,\n} from '@coreui/react'\nimport CIcon from '@coreui/icons-react'\n\n\nfunction Uploader() {\n\n const [file, setFile] = useState(null);\n\n function onChangeHandler(e) {\n setFile(e.target.files[0])\n }\n\n function onClickHandler(e) {\n const data = new FormData()\n data.append('file', file);\n //console.log(file);\n console.log('calling upload');\n axios.post(\"https://fsbsso.sumasen.net/upload\", data, { // receive two parameter endpoint url ,form data\n })\n .then(res => { // then print response status\n //console.log(res.statusText)\n if (res.statusText == 'OK') {\n alert(\"正常にアップロードされました\");\n }\n });\n }\n\n return ( <\n div >\n <\n CCard >\n <\n CCardHeader >\n アップロード <\n /CCardHeader> <\n CCardBody >\n <\n CFormGroup row >\n <\n CCol md = \"3\" >\n <\n CLabel htmlFor = \"date-input\" > アップロードするファイルを選んでください < /CLabel> < /\n CCol > <\n CCol xs = \"12\"\n md = \"9\" >\n <\n CInputFile type = \"file\"\n onChange = { onChangeHandler }\n id = \"file-input\"\n name = \"file-input\" / >\n <\n /CCol> < /\n CFormGroup >\n <CCardFooter >\n <CButton type = \"submit\"\n onClick = { onClickHandler }\n size = \"sm\"\n color = \"primary\" > < CIcon name = \"cil-scrubber\" / > アップロード < /CButton> < /\n CCardFooter>\n </CCardBody>\n </CCard>\n </div>\n )\n}\n\nexport default Uploader\n"],"sourceRoot":""}
|
||||
2
build/static/js/8.5b8eaf50.chunk.js
Normal file
2
build/static/js/8.5b8eaf50.chunk.js
Normal file
@ -0,0 +1,2 @@
|
||||
(this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[]).push([[8],{773:function(e,t,i){"use strict";i.r(t);var n=i(655),s=i(1),c=i(642),r=i.n(c),a=i(637),l=i(636),j=i(18);t.default=function(){var e=Object(s.useState)(null),t=Object(n.a)(e,2),i=t[0],c=t[1];return Object(j.jsx)("div",{children:Object(j.jsxs)(a.f,{children:[Object(j.jsx)(a.j,{children:"\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 "})," ",Object(j.jsxs)(a.g,{children:[Object(j.jsxs)(a.t,{row:!0,children:[Object(j.jsxs)(a.k,{md:"3",children:[Object(j.jsx)(a.H,{htmlFor:"date-input",children:" \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044 "})," "]})," ",Object(j.jsx)(a.k,{xs:"12",md:"9",children:Object(j.jsx)(a.C,{type:"file",onChange:function(e){c(e.target.files[0])},id:"file-input",name:"file-input"})})," "]}),Object(j.jsxs)(a.h,{children:[Object(j.jsxs)(a.e,{type:"submit",onClick:function(e){var t=new FormData;t.append("file",i),"ini_\u5de5\u7a0b\u5185\u691c\u67fb\u7968.xlsx"===i.name||"ini_\u30c7\u30fc\u30bf\u5165\u529b\u30b7\u30fc\u30c8.xlsx"===i.name?r.a.post("https://fsbsso.sumasen.net/upload",t,{}).then((function(e){"OK"==e.statusText&&alert("\u6b63\u5e38\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3057\u305f")})):alert("\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9"+i.name+"\u9593\u9055\u3063\u3066\u3044\u308b\u3002\u540d\u524d\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059 ini_\u5de5\u7a0b\u5185\u691c\u67fb\u7968.xlsx \u307e\u305f ini_\u30c7\u30fc\u30bf\u5165\u529b\u30b7\u30fc\u30c8.xlsx")},size:"sm",color:"primary",children:[" ",Object(j.jsx)(l.a,{name:"cil-scrubber"})," \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 "]})," "]})]})]})})}}}]);
|
||||
//# sourceMappingURL=8.5b8eaf50.chunk.js.map
|
||||
1
build/static/js/8.5b8eaf50.chunk.js.map
Normal file
1
build/static/js/8.5b8eaf50.chunk.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["views/Uploader/index.js"],"names":["Uploader","useState","file","setFile","row","md","htmlFor","xs","type","onChange","e","target","files","id","name","onClick","data","FormData","append","axios","post","then","res","statusText","alert","size","color"],"mappings":"mPAsFeA,UArEf,WAEI,MAAwBC,mBAAS,MAAjC,mBAAOC,EAAP,KAAaC,EAAb,KA6BA,OAAS,8BAEL,eACA,IADA,WAEA,cACA,IADA,oDAFA,IAKc,eACd,IADc,WAEd,eACA,IADA,CACWC,KAAG,EADd,UAEA,eACA,IADA,CACKC,GAAK,IADV,UAEA,cACA,IADA,CACOC,QAAU,aADjB,wIAFA,OAFA,IAMO,cACP,IADO,CACFC,GAAK,KACVF,GAAK,IAFE,SAGP,cACA,IADA,CACWG,KAAO,OAClBC,SA/CJ,SAAyBC,GACrBP,EAAQO,EAAEC,OAAOC,MAAM,KA+CvBC,GAAK,aACLC,KAAO,iBAbP,OAiBA,eAAC,IAAD,WACA,eAAC,IAAD,CAASN,KAAO,SAChBO,QAnDJ,SAAwBL,GACpB,IAAMM,EAAO,IAAIC,SACjBD,EAAKE,OAAO,OAAQhB,GACH,kDAAdA,EAAKY,MAA4C,8DAAdZ,EAAKY,KAEzCK,IAAMC,KAAK,oCAAqCJ,EAAM,IAEnDK,MAAK,SAAAC,GAEoB,MAAlBA,EAAIC,YACNC,MAAM,2FAKdA,MAAM,2EAAiBtB,EAAKY,KAAO,wPAqCrCW,KAAO,KACPC,MAAQ,UAHR,cAGoB,cAAE,IAAF,CAAQZ,KAAO,iBAHnC,4CADA","file":"static/js/8.5b8eaf50.chunk.js","sourcesContent":["import React, { useState } from 'react';\nimport axios from 'axios';\nimport {\n CCol,\n CFormGroup,\n CInput,\n CInputFile,\n CLabel,\n CButton,\n CCard,\n CCardHeader,\n CCardBody,\n CCardFooter,\n} from '@coreui/react'\nimport CIcon from '@coreui/icons-react'\n\n\nfunction Uploader() {\n\n const [file, setFile] = useState(null);\n\n function onChangeHandler(e) {\n setFile(e.target.files[0])\n }\n\n function onClickHandler(e) {\n const data = new FormData()\n data.append('file', file);\n if(file.name === 'ini_工程内検査票.xlsx' || file.name === 'ini_データ入力シート.xlsx')\n {\n axios.post(\"https://fsbsso.sumasen.net/upload\", data, { // receive two parameter endpoint url ,form data\n })\n .then(res => { // then print response status\n //console.log(res.statusText)\n if (res.statusText == 'OK') {\n alert(\"正常にアップロードされました\");\n }\n });\n }\n else {\n alert(\"ファイル名をアップロード\" + file.name + \"間違っている。名前を変更する必要があります ini_工程内検査票.xlsx また ini_データ入力シート.xlsx\");\n return\n }\n //console.log(file.name);\n //console.log('calling upload');\n\n }\n\n return ( <\n div >\n <\n CCard >\n <\n CCardHeader >\n アップロード <\n /CCardHeader> <\n CCardBody >\n <\n CFormGroup row >\n <\n CCol md = \"3\" >\n <\n CLabel htmlFor = \"date-input\" > アップロードするファイルを選んでください < /CLabel> < /\n CCol > <\n CCol xs = \"12\"\n md = \"9\" >\n <\n CInputFile type = \"file\"\n onChange = { onChangeHandler }\n id = \"file-input\"\n name = \"file-input\" / >\n <\n /CCol> < /\n CFormGroup >\n <CCardFooter >\n <CButton type = \"submit\"\n onClick = { onClickHandler }\n size = \"sm\"\n color = \"primary\" > < CIcon name = \"cil-scrubber\" / > アップロード < /CButton> < /\n CCardFooter>\n </CCardBody>\n </CCard>\n </div>\n )\n}\n\nexport default Uploader\n"],"sourceRoot":""}
|
||||
@ -1,2 +1,2 @@
|
||||
!function(e){function t(t){for(var n,o,u=t[0],i=t[1],f=t[2],d=0,s=[];d<u.length;d++)o=u[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&s.push(a[o][0]),a[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(l&&l(t);s.length;)s.shift()();return c.push.apply(c,f||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(c.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={3:0},a={3:0},c=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{0:1,5:1}[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="static/css/"+({}[e]||e)+"."+{0:"455ee148",1:"31d6cfe0",5:"ecdd39c8",6:"31d6cfe0",7:"31d6cfe0",8:"31d6cfe0",9:"31d6cfe0",10:"31d6cfe0",11:"31d6cfe0",12:"31d6cfe0",13:"31d6cfe0",14:"31d6cfe0",15:"31d6cfe0",16:"31d6cfe0"}[e]+".chunk.css",a=u.p+n,c=document.getElementsByTagName("link"),i=0;i<c.length;i++){var f=(l=c[i]).getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(f===n||f===a))return t()}var d=document.getElementsByTagName("style");for(i=0;i<d.length;i++){var l;if((f=(l=d[i]).getAttribute("data-href"))===n||f===a)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var n=t&&t.target&&t.target.src||a,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=n,delete o[e],s.parentNode.removeChild(s),r(c)},s.href=a,document.getElementsByTagName("head")[0].appendChild(s)})).then((function(){o[e]=0})));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=a[e]=[t,n]}));t.push(r[2]=n);var c,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+"static/js/"+({}[e]||e)+"."+{0:"e423db2b",1:"bd3709d0",5:"713b21d1",6:"bba51257",7:"24e41aee",8:"40731ea8",9:"311e2cfe",10:"1aee78b2",11:"d20ada69",12:"2c871bc8",13:"886a98ec",14:"ef6f2a9c",15:"e3d77fc1",16:"3fdf9cdf"}[e]+".chunk.js"}(e);var f=new Error;c=function(t){i.onerror=i.onload=null,clearTimeout(d);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;f.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",f.name="ChunkLoadError",f.type=n,f.request=o,r[1](f)}a[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:i})}),12e4);i.onerror=i.onload=c,document.head.appendChild(i)}return Promise.all(t)},u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="./",u.oe=function(e){throw console.error(e),e};var i=this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[],f=i.push.bind(i);i.push=t,i=i.slice();for(var d=0;d<i.length;d++)t(i[d]);var l=f;r()}([]);
|
||||
//# sourceMappingURL=runtime-main.18ec15f6.js.map
|
||||
!function(e){function t(t){for(var n,o,u=t[0],i=t[1],f=t[2],d=0,s=[];d<u.length;d++)o=u[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&s.push(a[o][0]),a[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(l&&l(t);s.length;)s.shift()();return c.push.apply(c,f||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(c.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={3:0},a={3:0},c=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{0:1,5:1}[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="static/css/"+({}[e]||e)+"."+{0:"455ee148",1:"31d6cfe0",5:"ecdd39c8",6:"31d6cfe0",7:"31d6cfe0",8:"31d6cfe0",9:"31d6cfe0",10:"31d6cfe0",11:"31d6cfe0",12:"31d6cfe0",13:"31d6cfe0",14:"31d6cfe0",15:"31d6cfe0",16:"31d6cfe0"}[e]+".chunk.css",a=u.p+n,c=document.getElementsByTagName("link"),i=0;i<c.length;i++){var f=(l=c[i]).getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(f===n||f===a))return t()}var d=document.getElementsByTagName("style");for(i=0;i<d.length;i++){var l;if((f=(l=d[i]).getAttribute("data-href"))===n||f===a)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var n=t&&t.target&&t.target.src||a,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=n,delete o[e],s.parentNode.removeChild(s),r(c)},s.href=a,document.getElementsByTagName("head")[0].appendChild(s)})).then((function(){o[e]=0})));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=a[e]=[t,n]}));t.push(r[2]=n);var c,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+"static/js/"+({}[e]||e)+"."+{0:"e423db2b",1:"bd3709d0",5:"713b21d1",6:"bba51257",7:"7a5be647",8:"5b8eaf50",9:"311e2cfe",10:"1aee78b2",11:"d20ada69",12:"2c871bc8",13:"886a98ec",14:"ef6f2a9c",15:"e3d77fc1",16:"3fdf9cdf"}[e]+".chunk.js"}(e);var f=new Error;c=function(t){i.onerror=i.onload=null,clearTimeout(d);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;f.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",f.name="ChunkLoadError",f.type=n,f.request=o,r[1](f)}a[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:i})}),12e4);i.onerror=i.onload=c,document.head.appendChild(i)}return Promise.all(t)},u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="./",u.oe=function(e){throw console.error(e),e};var i=this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[],f=i.push.bind(i);i.push=t,i=i.slice();for(var d=0;d<i.length;d++)t(i[d]);var l=f;r()}([]);
|
||||
//# sourceMappingURL=runtime-main.62598ad5.js.map
|
||||
File diff suppressed because one or more lines are too long
@ -1,31 +1,31 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import axios from 'axios';
|
||||
import {
|
||||
CCard,
|
||||
CCardBody,
|
||||
CCardHeader,
|
||||
CCol,
|
||||
CRow,
|
||||
CDropdown,
|
||||
CDropdownDivider,
|
||||
CDropdownItem,
|
||||
CDropdownMenu,
|
||||
CDropdownToggle,
|
||||
/////
|
||||
CButton,
|
||||
CCardFooter,
|
||||
CForm,
|
||||
CFormGroup,
|
||||
CFormText,
|
||||
CTextarea,
|
||||
CInput,
|
||||
CInputFile,
|
||||
CInputCheckbox,
|
||||
CInputRadio,
|
||||
CLabel,
|
||||
CSelect,
|
||||
CSwitch,
|
||||
} from '@coreui/react'
|
||||
CCard,
|
||||
CCardBody,
|
||||
CCardHeader,
|
||||
CCol,
|
||||
CRow,
|
||||
CDropdown,
|
||||
CDropdownDivider,
|
||||
CDropdownItem,
|
||||
CDropdownMenu,
|
||||
CDropdownToggle,
|
||||
/////
|
||||
CButton,
|
||||
CCardFooter,
|
||||
CForm,
|
||||
CFormGroup,
|
||||
CFormText,
|
||||
CTextarea,
|
||||
CInput,
|
||||
CInputFile,
|
||||
CInputCheckbox,
|
||||
CInputRadio,
|
||||
CLabel,
|
||||
CSelect,
|
||||
CSwitch,
|
||||
} from '@coreui/react'
|
||||
import CIcon from '@coreui/icons-react'
|
||||
|
||||
import DatePicker from "react-datepicker";
|
||||
@ -33,231 +33,188 @@ import "react-datepicker/dist/react-datepicker.css";
|
||||
|
||||
function Index() {
|
||||
|
||||
const baseUrl = "https://natnats.mobilous.com/";
|
||||
const baseUrl = "https://natnats.mobilous.com/";
|
||||
|
||||
|
||||
const [data, setData] = useState([]);
|
||||
const [report, setReport] = useState('');
|
||||
const [selectedcons, setSelectedCons] = useState('');
|
||||
const [graph, setGraph] = useState(false);
|
||||
const [data, setData] = useState([]);
|
||||
const [report, setReport] = useState('');
|
||||
const [selectedcons, setSelectedCons] = useState('');
|
||||
const [graph, setGraph] = useState(false);
|
||||
|
||||
const [startDate, setStartDate] = useState(null);
|
||||
const [validDates, setValidDates] = useState([]);
|
||||
const [startDate, setStartDate] = useState(null);
|
||||
const [validDates, setValidDates] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
async function fetchData() {
|
||||
// You can await here
|
||||
const result = await axios('https://natnats.mobilous.com/getConstructionList');
|
||||
setData(result.data);
|
||||
}
|
||||
fetchData();
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
async function fetchData() {
|
||||
// You can await here
|
||||
const result = await axios('https://natnats.mobilous.com/getConstructionList');
|
||||
setData(result.data);
|
||||
}
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
async function fetchData() {
|
||||
// You can await here
|
||||
if (selectedcons !== "" && report !== "") {
|
||||
const result = await axios('https://natnats.mobilous.com/getDateToHaveData?construction_id=' + selectedcons + '&sheetname=' + report);
|
||||
setValidDates(result.data.record);
|
||||
useEffect(() => {
|
||||
async function fetchData() {
|
||||
// You can await here
|
||||
if(selectedcons !== "" && report !== "") {
|
||||
const result = await axios('https://natnats.mobilous.com/getDateToHaveData?construction_id=' + selectedcons + '&sheetname=' + report);
|
||||
setValidDates(result.data.record);
|
||||
}
|
||||
}
|
||||
fetchData();
|
||||
}, [report, selectedcons]);
|
||||
|
||||
function getDateWithFormat(date) {
|
||||
var thisDate = date;
|
||||
var dd = String(date.getDate()).padStart(2, '0');
|
||||
var mm = String(date.getMonth() + 1).padStart(2, '0'); //January is 0!
|
||||
var yyyy = date.getFullYear();
|
||||
|
||||
thisDate = yyyy + '-' + mm + '-' + dd
|
||||
return thisDate;
|
||||
}
|
||||
|
||||
function setingReport(e){
|
||||
setReport(e.target.value);
|
||||
setStartDate(null);
|
||||
}
|
||||
|
||||
function setingSelectedCons(e) {
|
||||
setSelectedCons(e.target.value);
|
||||
setStartDate(null);
|
||||
}
|
||||
|
||||
function setingGraph(e){
|
||||
setGraph(e.target.checked);
|
||||
}
|
||||
|
||||
function doGetReport(){
|
||||
if(report == "" || selectedcons == ""){
|
||||
alert("建設とレポートの両方を選択してください");
|
||||
return;
|
||||
}
|
||||
var url = "";
|
||||
if(graph){
|
||||
url = baseUrl + "/generate" + report + "?construction_id=" +selectedcons+ "&construction_date="+getDateWithFormat(startDate)+"&graph=true";
|
||||
}
|
||||
else{
|
||||
url = baseUrl + "/generate" + report + "?construction_id=" +selectedcons+ "&construction_date="+getDateWithFormat(startDate);
|
||||
}
|
||||
downloadReport(url);
|
||||
}
|
||||
|
||||
function downloadReport(url) {
|
||||
axios({
|
||||
url: url, //your url
|
||||
method: 'GET',
|
||||
responseType: 'blob', // important
|
||||
}).then((response) => {
|
||||
const url = window.URL.createObjectURL(new Blob([response.data]));
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', 'file.xlsx'); //or any other extension
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
const checkAvilable = (date) => {
|
||||
var thisDate = getDateWithFormat(date);
|
||||
if(validDates.includes(thisDate)){
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<CRow>
|
||||
<CCol xs="12" sm="12" md="12">
|
||||
<CCard>
|
||||
<CCardHeader>
|
||||
レポート
|
||||
</CCardHeader>
|
||||
<CCardBody>
|
||||
|
||||
<CSelect custom name="cons_select" id="cons_select" onChange={setingSelectedCons}>
|
||||
" <option value=''>-- 工事名 --</option>"+
|
||||
{
|
||||
data.map((cc, index) => {
|
||||
return(
|
||||
<option key={cc.construction_id} value={cc.construction_id}>{cc.construction_name}</option>
|
||||
)
|
||||
})
|
||||
}
|
||||
</CSelect>
|
||||
|
||||
<CCard>
|
||||
<CCardBody>
|
||||
<CForm action="" method="post" encType="multipart/form-data" className="form-horizontal">
|
||||
<CFormGroup row>
|
||||
<CCol md="3">
|
||||
<CLabel htmlFor="select">レポート種類</CLabel>
|
||||
</CCol>
|
||||
<CCol xs="12" md="9">
|
||||
<CSelect custom name="select" id="select" onChange={setingReport} value={report}>
|
||||
<option value="">-- レポート種類 --</option>
|
||||
<option value="BoxDisplacement">函体変位表</option>
|
||||
<option value="MachineControl">オープンシールドマシン管理日報</option>
|
||||
<option value="MachineSheet">オープンシールド機変位表</option>
|
||||
<option value="Measurement">函底高・偏位量測定一覧表</option>
|
||||
<option value="CheckSheet">工程内検査表</option>
|
||||
<option value="Injection">裏込注入材料受払い簿</option>
|
||||
</CSelect>
|
||||
</CCol>
|
||||
</CFormGroup>
|
||||
<CFormGroup row>
|
||||
<CCol md="3">
|
||||
<CLabel htmlFor="select">報告日</CLabel>
|
||||
</CCol>
|
||||
<CCol xs="12" md="9">
|
||||
<DatePicker
|
||||
dateFormat="yyyy/MM/dd"
|
||||
selected={startDate}
|
||||
onChange={(date) => setStartDate(date)}
|
||||
filterDate={checkAvilable}
|
||||
placeholderText='日付を選択'
|
||||
/>
|
||||
</CCol>
|
||||
</CFormGroup>
|
||||
|
||||
|
||||
{report == 'MachineControl' ?
|
||||
<CFormGroup variant="checkbox" className="checkbox">
|
||||
<CInputCheckbox
|
||||
id="checkbox1"
|
||||
name="checkbox1"
|
||||
checked = {graph}
|
||||
value='graph'
|
||||
onChange={setingGraph}
|
||||
/>
|
||||
<CLabel variant="checkbox" className="form-check-label" htmlFor="checkbox1">グラフの有無</CLabel>
|
||||
</CFormGroup>
|
||||
:
|
||||
("")}
|
||||
|
||||
</CForm>
|
||||
</CCardBody>
|
||||
<CCardFooter>
|
||||
{startDate != null ?
|
||||
<CButton type="submit" size="sm" color="primary" onClick={doGetReport}><CIcon name="cil-scrubber" /> ダウンロード</CButton>
|
||||
:
|
||||
<CButton disabled type="submit" size="sm" color="primary" onClick={doGetReport}><CIcon name="cil-scrubber" /> ダウンロード</CButton>
|
||||
}
|
||||
}
|
||||
fetchData();
|
||||
}, [report, selectedcons]);
|
||||
|
||||
function getDateWithFormat(date) {
|
||||
var thisDate = date;
|
||||
var dd = String(date.getDate()).padStart(2, '0');
|
||||
var mm = String(date.getMonth() + 1).padStart(2, '0'); //January is 0!
|
||||
var yyyy = date.getFullYear();
|
||||
|
||||
thisDate = yyyy + '-' + mm + '-' + dd
|
||||
return thisDate;
|
||||
}
|
||||
|
||||
function setingReport(e) {
|
||||
setReport(e.target.value);
|
||||
setStartDate(null);
|
||||
}
|
||||
|
||||
function setingSelectedCons(e) {
|
||||
setSelectedCons(e.target.value);
|
||||
setStartDate(null);
|
||||
}
|
||||
|
||||
function setingGraph(e) {
|
||||
setGraph(e.target.checked);
|
||||
}
|
||||
|
||||
function doGetReport() {
|
||||
if (report == "" || selectedcons == "") {
|
||||
alert("建設とレポートの両方を選択してください");
|
||||
return;
|
||||
}
|
||||
var url = "";
|
||||
if (graph) {
|
||||
url = baseUrl + "/generate" + report + "?construction_id=" + selectedcons + "&construction_date=" + getDateWithFormat(startDate) + "&graph=true";
|
||||
} else {
|
||||
url = baseUrl + "/generate" + report + "?construction_id=" + selectedcons + "&construction_date=" + getDateWithFormat(startDate);
|
||||
}
|
||||
downloadReport(url);
|
||||
}
|
||||
|
||||
function downloadReport(url) {
|
||||
axios({
|
||||
url: url, //your url
|
||||
method: 'GET',
|
||||
responseType: 'blob', // important
|
||||
}).then((response) => {
|
||||
const url = window.URL.createObjectURL(new Blob([response.data]));
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', 'file.xlsx'); //or any other extension
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
const checkAvilable = (date) => {
|
||||
var thisDate = getDateWithFormat(date);
|
||||
if (validDates.includes(thisDate)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
return ( <
|
||||
CRow >
|
||||
<
|
||||
CCol xs = "12"
|
||||
sm = "12"
|
||||
md = "12" >
|
||||
<
|
||||
CCard >
|
||||
<
|
||||
CCardHeader >
|
||||
レポート <
|
||||
/CCardHeader> <
|
||||
CCardBody >
|
||||
|
||||
<
|
||||
CSelect custom name = "cons_select"
|
||||
id = "cons_select"
|
||||
onChange = { setingSelectedCons } >
|
||||
" <option value=''>-- レポート種類 --</option>" + {
|
||||
data.map((cc, index) => {
|
||||
return ( <
|
||||
option key = { cc.construction_id }
|
||||
value = { cc.construction_id } > { cc.construction_name } < /option>
|
||||
)
|
||||
})
|
||||
} <
|
||||
/CSelect>
|
||||
|
||||
<
|
||||
CCard >
|
||||
<
|
||||
CCardBody >
|
||||
<
|
||||
CForm action = ""
|
||||
method = "post"
|
||||
encType = "multipart/form-data"
|
||||
className = "form-horizontal" >
|
||||
<
|
||||
CFormGroup row >
|
||||
<
|
||||
CCol md = "3" >
|
||||
<
|
||||
CLabel htmlFor = "select" > レポート種類 < /CLabel> <
|
||||
/CCol> <
|
||||
CCol xs = "12"
|
||||
md = "9" >
|
||||
<
|
||||
CSelect custom name = "select"
|
||||
id = "select"
|
||||
onChange = { setingReport }
|
||||
value = { report } >
|
||||
<
|
||||
option value = "" > --レポート種類-- < /option> <
|
||||
option value = "BoxDisplacement" > 函体変位表 < /option> <
|
||||
option value = "MachineControl" > オープンシールドマシン管理日報 < /option> <
|
||||
option value = "MachineSheet" > オープンシールド機変位表 < /option> <
|
||||
option value = "Measurement" > 函底高・ 偏位量測定一覧表 < /option> <
|
||||
option value = "CheckSheet" > 工程内検査表 < /option> <
|
||||
option value = "Injection" > 裏込注入材料受払い簿 < /option> <
|
||||
/CSelect> <
|
||||
/CCol> <
|
||||
/CFormGroup> <
|
||||
CFormGroup row >
|
||||
<
|
||||
CCol md = "3" >
|
||||
<
|
||||
CLabel htmlFor = "select" > 報告日 < /CLabel> <
|
||||
/CCol> <
|
||||
CCol xs = "12"
|
||||
md = "9" >
|
||||
<
|
||||
DatePicker dateFormat = "yyyy/MM/dd"
|
||||
selected = { startDate }
|
||||
onChange = {
|
||||
(date) => setStartDate(date) }
|
||||
filterDate = { checkAvilable }
|
||||
placeholderText = '日付を選択' /
|
||||
>
|
||||
<
|
||||
/CCol> <
|
||||
/CFormGroup>
|
||||
|
||||
|
||||
{
|
||||
report == 'MachineControl' ?
|
||||
<
|
||||
CFormGroup variant = "checkbox"
|
||||
className = "checkbox" >
|
||||
<
|
||||
CInputCheckbox
|
||||
id = "checkbox1"
|
||||
name = "checkbox1"
|
||||
checked = { graph }
|
||||
value = 'graph'
|
||||
onChange = { setingGraph }
|
||||
/> <
|
||||
CLabel variant = "checkbox"
|
||||
className = "form-check-label"
|
||||
htmlFor = "checkbox1" > グラフの有無 < /CLabel> <
|
||||
/CFormGroup>:
|
||||
("")
|
||||
}
|
||||
|
||||
<
|
||||
/CForm> <
|
||||
/CCardBody> <
|
||||
CCardFooter > {
|
||||
startDate != null ?
|
||||
<
|
||||
CButton type = "submit"
|
||||
size = "sm"
|
||||
color = "primary"
|
||||
onClick = { doGetReport } > < CIcon name = "cil-scrubber" / > ダウンロード < /CButton> :
|
||||
<
|
||||
CButton disabled type = "submit"
|
||||
size = "sm"
|
||||
color = "primary"
|
||||
onClick = { doGetReport } > < CIcon name = "cil-scrubber" / > ダウンロード < /CButton>
|
||||
} <
|
||||
/CCardFooter> <
|
||||
/CCard> <
|
||||
/CCardBody> <
|
||||
/CCard> <
|
||||
/CCol> <
|
||||
CCol xs = "1"
|
||||
sm = "1"
|
||||
md = "1" >
|
||||
<
|
||||
/CCol> <
|
||||
/CRow>
|
||||
);
|
||||
</CCardFooter>
|
||||
</CCard>
|
||||
</CCardBody>
|
||||
</CCard>
|
||||
</CCol>
|
||||
<CCol xs="1" sm="1" md="1">
|
||||
</CCol>
|
||||
</CRow>
|
||||
);
|
||||
}
|
||||
|
||||
export default Index
|
||||
@ -26,9 +26,9 @@ function Uploader() {
|
||||
function onClickHandler(e) {
|
||||
const data = new FormData()
|
||||
data.append('file', file);
|
||||
//console.log(file);
|
||||
console.log('calling upload');
|
||||
axios.post("https://fsbsso.sumasen.net/upload", data, { // receive two parameter endpoint url ,form data
|
||||
if(file.name === 'ini_工程内検査票.xlsx' || file.name === 'ini_データ入力シート.xlsx')
|
||||
{
|
||||
axios.post("https://fsbsso.sumasen.net/upload", data, { // receive two parameter endpoint url ,form data
|
||||
})
|
||||
.then(res => { // then print response status
|
||||
//console.log(res.statusText)
|
||||
@ -36,6 +36,14 @@ function Uploader() {
|
||||
alert("正常にアップロードされました");
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
alert("ファイル名をアップロード" + file.name + "間違っている。名前を変更する必要があります ini_工程内検査票.xlsx また ini_データ入力シート.xlsx");
|
||||
return
|
||||
}
|
||||
//console.log(file.name);
|
||||
//console.log('calling upload');
|
||||
|
||||
}
|
||||
|
||||
return ( <
|
||||
|
||||
Reference in New Issue
Block a user