Files
FBSAdminTool/build/static/js/7.78cc85c5.chunk.js
2021-11-17 14:03:27 +05:30

2 lines
5.5 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),j=c(639),u=c(638),b=c(717),h=c.n(b),d=(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],b=Object(i.useState)(""),O=Object(a.a)(b,2),x=O[0],m=O[1],p=Object(i.useState)(""),f=Object(a.a)(p,2),v=f[0],g=f[1],k=Object(i.useState)(!1),y=Object(a.a)(k,2),S=y[0],w=y[1],C=Object(i.useState)(null),_=Object(a.a)(C,2),D=_[0],M=_[1],z=Object(i.useState)([]),F=Object(a.a)(z,2),L=F[0],H=F[1],B=Object(i.useState)(""),E=Object(a.a)(B,2),N=E[0],T=E[1];function J(e){var t=String(e.getDate()).padStart(2,"0"),c=String(e.getMonth()+1).padStart(2,"0");return e.getFullYear()+"-"+c+"-"+t}function R(){if(""!=x&&""!=v){var t="";null!==D?(t=S?e+"/generate"+x+"?construction_id="+v+"&construction_date="+J(D)+"&graph=true":e+"/generate"+x+"?construction_id="+v+"&construction_date="+J(D),T(t),U(t)):(T(t=S?e+"/generate"+x+"?construction_id="+v+"&graph=true":e+"/generate"+x+"?construction_id="+v),U(t))}else alert("\u5efa\u8a2d\u3068\u30ec\u30dd\u30fc\u30c8\u306e\u4e21\u65b9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044")}function U(e){fetch(e).then((function(e){console.log(e);var t=e.headers.get("Content-Disposition").split("filename=")[1];e.blob().then((function(e){var c=window.URL.createObjectURL(e),n=document.createElement("a");n.href=c,n.download=t,n.click()}))}))}function I(){return"BoxDisplacement"===x||"MachineControl"===x||"MachineSheet"===x}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||""===x||1!=I()){e.next=5;break}return e.next=3,l()("https://fbssso.ts.bizside.biz/getDateToHaveData?construction_id="+v+"&sheetname="+x);case 3:t=e.sent,H(t.data.record);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[x,v]),Object(d.jsxs)(j.K,{children:[Object(d.jsx)(j.k,{xs:"12",sm:"12",md:"12",children:Object(d.jsxs)(j.f,{children:[Object(d.jsx)(j.j,{children:"\u30ec\u30dd\u30fc\u30c8"}),Object(d.jsxs)(j.g,{children:[Object(d.jsxs)(j.L,{custom:!0,name:"cons_select",id:"cons_select",onChange:function(e){g(e.target.value),M(null)},children:['" ',Object(d.jsx)("option",{value:"",children:"-- \u5de5\u4e8b\u540d --"}),'"+',n.map((function(e,t){return Object(d.jsx)("option",{value:e.construction_id,children:e.construction_name},e.construction_id)}))]}),Object(d.jsxs)(j.f,{children:[Object(d.jsx)(j.g,{children:Object(d.jsxs)(j.s,{action:"",method:"post",encType:"multipart/form-data",className:"form-horizontal",children:[Object(d.jsxs)(j.t,{row:!0,children:[Object(d.jsx)(j.k,{md:"3",children:Object(d.jsx)(j.H,{htmlFor:"select",children:"\u30ec\u30dd\u30fc\u30c8\u7a2e\u985e"})}),Object(d.jsx)(j.k,{xs:"12",md:"9",children:Object(d.jsxs)(j.L,{custom:!0,name:"select",id:"select",onChange:function(e){m(e.target.value),M(null)},value:x,children:[Object(d.jsx)("option",{value:"",children:"-- \u30ec\u30dd\u30fc\u30c8\u7a2e\u985e --"}),Object(d.jsx)("option",{value:"BoxDisplacement",children:"\u51fd\u4f53\u5909\u4f4d\u8868"}),Object(d.jsx)("option",{value:"MachineControl",children:"\u30aa\u30fc\u30d7\u30f3\u30b7\u30fc\u30eb\u30c9\u30de\u30b7\u30f3\u7ba1\u7406\u65e5\u5831"}),Object(d.jsx)("option",{value:"Measurement",children:"\u51fd\u5e95\u9ad8\u30fb\u504f\u4f4d\u91cf\u6e2c\u5b9a\u4e00\u89a7\u8868"}),Object(d.jsx)("option",{value:"CheckSheet",children:"\u5de5\u7a0b\u5185\u691c\u67fb\u8868"}),Object(d.jsx)("option",{value:"Injection",children:"\u88cf\u8fbc\u6ce8\u5165\u6750\u6599\u53d7\u6255\u3044\u7c3f"})]})})]}),!0===I()?Object(d.jsxs)(j.t,{row:!0,children:[Object(d.jsx)(j.k,{md:"3",children:Object(d.jsx)(j.H,{htmlFor:"select",children:"\u5831\u544a\u65e5"})}),Object(d.jsx)(j.k,{xs:"12",md:"9",children:Object(d.jsx)(h.a,{dateFormat:"yyyy/MM/dd",selected:D,onChange:function(e){return M(e)},filterDate:function(e){if(void 0===L)return!1;var t=J(e);return!!L.includes(t)},placeholderText:"\u65e5\u4ed8\u3092\u9078\u629e"})})]}):Object(d.jsx)("div",{}),"MachineControl"==x?Object(d.jsxs)(j.t,{variant:"checkbox",className:"checkbox",children:[Object(d.jsx)(j.B,{id:"checkbox1",name:"checkbox1",checked:S,value:"graph",onChange:function(e){w(e.target.checked)}}),Object(d.jsx)(j.H,{variant:"checkbox",className:"form-check-label",htmlFor:"checkbox1",children:"\u30b0\u30e9\u30d5\u306e\u6709\u7121"})]}):""]})}),Object(d.jsx)(j.h,{children:!0===(!1===I()&&""!==x&&""!==v||null!==D)?Object(d.jsxs)("p",{children:[Object(d.jsxs)(j.e,{type:"submit",size:"sm",color:"primary",onClick:R,children:[Object(d.jsx)(u.a,{name:"cil-scrubber"})," \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9"]}),Object(d.jsx)("br",{}),""===N?Object(d.jsx)("p",{}):Object(d.jsx)("a",{href:N,children:"Download"})]}):Object(d.jsxs)(j.e,{disabled:!0,type:"submit",size:"sm",color:"primary",onClick:R,children:[Object(d.jsx)(u.a,{name:"cil-scrubber"})," \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9"]})})]})]})]})}),Object(d.jsx)(j.k,{xs:"1",sm:"1",md:"1"})]})}}}]);
//# sourceMappingURL=7.78cc85c5.chunk.js.map