2 lines
5.4 KiB
JavaScript
2 lines
5.4 KiB
JavaScript
(this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[]).push([[7],{774:function(e,t,c){"use strict";c.r(t);var n=c(659),r=c.n(n),s=c(660),a=c(657),i=c(1),o=c(644),l=c.n(o),u=c(639),j=c(638),d=c(717),h=c.n(d),b=(c(716),c(18));t.default=function(){var e="https://natnats.mobilous.com/",t=Object(i.useState)([]),c=Object(a.a)(t,2),n=c[0],o=c[1],d=Object(i.useState)(""),x=Object(a.a)(d,2),O=x[0],m=x[1],p=Object(i.useState)(""),f=Object(a.a)(p,2),v=f[0],k=f[1],g=Object(i.useState)(!1),y=Object(a.a)(g,2),S=y[0],w=y[1],C=Object(i.useState)(null),_=Object(a.a)(C,2),M=_[0],D=_[1],F=Object(i.useState)([]),L=Object(a.a)(F,2),T=L[0],B=L[1];function E(e){var t=String(e.getDate()).padStart(2,"0"),c=String(e.getMonth()+1).padStart(2,"0");return e.getFullYear()+"-"+c+"-"+t}function H(){if(""!=O&&""!=v){z(null!==M?S?e+"/generate"+O+"?construction_id="+v+"&construction_date="+E(M)+"&graph=true":e+"/generate"+O+"?construction_id="+v+"&construction_date="+E(M):S?e+"/generate"+O+"?construction_id="+v+"&graph=true":e+"/generate"+O+"?construction_id="+v)}else alert("\u5efa\u8a2d\u3068\u30ec\u30dd\u30fc\u30c8\u306e\u4e21\u65b9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044")}function z(e){l()({url:e,method:"GET",responseType:"blob"}).then((function(e){var t=window.URL.createObjectURL(new Blob([e.data])),c=document.createElement("a");c.href=t,c.setAttribute("download","file.xls"),document.body.appendChild(c),c.click()}))}function N(){return"BoxDisplacement"===O||"MachineControl"===O||"MachineSheet"===O}return Object(i.useEffect)((function(){function e(){return(e=Object(s.a)(r.a.mark((function e(){var t;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l()("https://natnats.mobilous.com/getConstructionList");case 2:t=e.sent,o(t.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]),Object(i.useEffect)((function(){function e(){return(e=Object(s.a)(r.a.mark((function e(){var t;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""===v||""===O||1!=N()){e.next=5;break}return e.next=3,l()("https://fsbsso.sumasen.net/getDateToHaveData?construction_id="+v+"&sheetname="+O);case 3:t=e.sent,B(t.data.record);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[O,v]),Object(b.jsxs)(u.K,{children:[Object(b.jsx)(u.k,{xs:"12",sm:"12",md:"12",children:Object(b.jsxs)(u.f,{children:[Object(b.jsx)(u.j,{children:"\u30ec\u30dd\u30fc\u30c8"}),Object(b.jsxs)(u.g,{children:[Object(b.jsxs)(u.L,{custom:!0,name:"cons_select",id:"cons_select",onChange:function(e){k(e.target.value),D(null)},children:['" ',Object(b.jsx)("option",{value:"",children:"-- \u5de5\u4e8b\u540d --"}),'"+',n.map((function(e,t){return Object(b.jsx)("option",{value:e.construction_id,children:e.construction_name},e.construction_id)}))]}),Object(b.jsxs)(u.f,{children:[Object(b.jsx)(u.g,{children:Object(b.jsxs)(u.s,{action:"",method:"post",encType:"multipart/form-data",className:"form-horizontal",children:[Object(b.jsxs)(u.t,{row:!0,children:[Object(b.jsx)(u.k,{md:"3",children:Object(b.jsx)(u.H,{htmlFor:"select",children:"\u30ec\u30dd\u30fc\u30c8\u7a2e\u985e"})}),Object(b.jsx)(u.k,{xs:"12",md:"9",children:Object(b.jsxs)(u.L,{custom:!0,name:"select",id:"select",onChange:function(e){m(e.target.value),D(null)},value:O,children:[Object(b.jsx)("option",{value:"",children:"-- \u30ec\u30dd\u30fc\u30c8\u7a2e\u985e --"}),Object(b.jsx)("option",{value:"BoxDisplacement",children:"\u51fd\u4f53\u5909\u4f4d\u8868"}),Object(b.jsx)("option",{value:"MachineControl",children:"\u30aa\u30fc\u30d7\u30f3\u30b7\u30fc\u30eb\u30c9\u30de\u30b7\u30f3\u7ba1\u7406\u65e5\u5831"}),Object(b.jsx)("option",{value:"MachineSheet",children:"\u30aa\u30fc\u30d7\u30f3\u30b7\u30fc\u30eb\u30c9\u6a5f\u5909\u4f4d\u8868"}),Object(b.jsx)("option",{value:"Measurement",children:"\u51fd\u5e95\u9ad8\u30fb\u504f\u4f4d\u91cf\u6e2c\u5b9a\u4e00\u89a7\u8868"}),Object(b.jsx)("option",{value:"CheckSheet",children:"\u5de5\u7a0b\u5185\u691c\u67fb\u8868"}),Object(b.jsx)("option",{value:"Injection",children:"\u88cf\u8fbc\u6ce8\u5165\u6750\u6599\u53d7\u6255\u3044\u7c3f"})]})})]}),!0===N()?Object(b.jsxs)(u.t,{row:!0,children:[Object(b.jsx)(u.k,{md:"3",children:Object(b.jsx)(u.H,{htmlFor:"select",children:"\u5831\u544a\u65e5"})}),Object(b.jsx)(u.k,{xs:"12",md:"9",children:Object(b.jsx)(h.a,{dateFormat:"yyyy/MM/dd",selected:M,onChange:function(e){return D(e)},filterDate:function(e){if(void 0===T)return!1;var t=E(e);return!!T.includes(t)},placeholderText:"\u65e5\u4ed8\u3092\u9078\u629e"})})]}):Object(b.jsx)("div",{}),"MachineControl"==O?Object(b.jsxs)(u.t,{variant:"checkbox",className:"checkbox",children:[Object(b.jsx)(u.B,{id:"checkbox1",name:"checkbox1",checked:S,value:"graph",onChange:function(e){w(e.target.checked)}}),Object(b.jsx)(u.H,{variant:"checkbox",className:"form-check-label",htmlFor:"checkbox1",children:"\u30b0\u30e9\u30d5\u306e\u6709\u7121"})]}):""]})}),Object(b.jsx)(u.h,{children:!0===(!1===N()&&""!==O&&""!==v||null!==M)?Object(b.jsxs)(u.e,{type:"submit",size:"sm",color:"primary",onClick:H,children:[Object(b.jsx)(j.a,{name:"cil-scrubber"})," \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9"]}):Object(b.jsxs)(u.e,{disabled:!0,type:"submit",size:"sm",color:"primary",onClick:H,children:[Object(b.jsx)(j.a,{name:"cil-scrubber"})," \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9"]})})]})]})]})}),Object(b.jsx)(u.k,{xs:"1",sm:"1",md:"1"})]})}}}]);
|
|
//# sourceMappingURL=7.39412144.chunk.js.map
|