Files
FBSAdminTool/build/static/js/7.16b9fe58.chunk.js
2021-11-16 09:51:16 +05:30

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),h=c(717),b=c.n(h),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],h=Object(i.useState)(""),x=Object(a.a)(h,2),O=x[0],p=x[1],m=Object(i.useState)(""),f=Object(a.a)(m,2),v=f[0],g=f[1],k=Object(i.useState)(!1),y=Object(a.a)(k,2),S=y[0],_=y[1],w=Object(i.useState)(null),C=Object(a.a)(w,2),M=C[0],D=C[1],z=Object(i.useState)([]),F=Object(a.a)(z,2),L=F[0],T=F[1];function B(e){var t=String(e.getDate()).padStart(2,"0"),c=String(e.getMonth()+1).padStart(2,"0");return e.getFullYear()+"-"+c+"-"+t}function E(){if(""!=O&&""!=v){H(null!==M?S?e+"/generate"+O+"?construction_id="+v+"&construction_date="+B(M)+"&graph=true":e+"/generate"+O+"?construction_id="+v+"&construction_date="+B(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 H(e){l()({url:e,method:"GET",responseType:"blob"}).then((function(e){console.log(e.headers);var t=window.URL.createObjectURL(new Blob([e.data],{type:"application/vnd.ms-excel"})),c=document.createElement("a");c.href=t,c.target="_blank",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://fbssso.ts.bizside.biz/getDateToHaveData?construction_id="+v+"&sheetname="+O);case 3:t=e.sent,T(t.data.record);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[O,v]),Object(d.jsxs)(u.K,{children:[Object(d.jsx)(u.k,{xs:"12",sm:"12",md:"12",children:Object(d.jsxs)(u.f,{children:[Object(d.jsx)(u.j,{children:"\u30ec\u30dd\u30fc\u30c8"}),Object(d.jsxs)(u.g,{children:[Object(d.jsxs)(u.L,{custom:!0,name:"cons_select",id:"cons_select",onChange:function(e){g(e.target.value),D(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)(u.f,{children:[Object(d.jsx)(u.g,{children:Object(d.jsxs)(u.s,{action:"",method:"post",encType:"multipart/form-data",className:"form-horizontal",children:[Object(d.jsxs)(u.t,{row:!0,children:[Object(d.jsx)(u.k,{md:"3",children:Object(d.jsx)(u.H,{htmlFor:"select",children:"\u30ec\u30dd\u30fc\u30c8\u7a2e\u985e"})}),Object(d.jsx)(u.k,{xs:"12",md:"9",children:Object(d.jsxs)(u.L,{custom:!0,name:"select",id:"select",onChange:function(e){p(e.target.value),D(null)},value:O,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:"MachineSheet",children:"\u30aa\u30fc\u30d7\u30f3\u30b7\u30fc\u30eb\u30c9\u6a5f\u5909\u4f4d\u8868"}),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===N()?Object(d.jsxs)(u.t,{row:!0,children:[Object(d.jsx)(u.k,{md:"3",children:Object(d.jsx)(u.H,{htmlFor:"select",children:"\u5831\u544a\u65e5"})}),Object(d.jsx)(u.k,{xs:"12",md:"9",children:Object(d.jsx)(b.a,{dateFormat:"yyyy/MM/dd",selected:M,onChange:function(e){return D(e)},filterDate:function(e){if(void 0===L)return!1;var t=B(e);return!!L.includes(t)},placeholderText:"\u65e5\u4ed8\u3092\u9078\u629e"})})]}):Object(d.jsx)("div",{}),"MachineControl"==O?Object(d.jsxs)(u.t,{variant:"checkbox",className:"checkbox",children:[Object(d.jsx)(u.B,{id:"checkbox1",name:"checkbox1",checked:S,value:"graph",onChange:function(e){_(e.target.checked)}}),Object(d.jsx)(u.H,{variant:"checkbox",className:"form-check-label",htmlFor:"checkbox1",children:"\u30b0\u30e9\u30d5\u306e\u6709\u7121"})]}):""]})}),Object(d.jsx)(u.h,{children:!0===(!1===N()&&""!==O&&""!==v||null!==M)?Object(d.jsxs)(u.e,{type:"submit",size:"sm",color:"primary",onClick:E,children:[Object(d.jsx)(j.a,{name:"cil-scrubber"})," \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9"]}):Object(d.jsxs)(u.e,{disabled:!0,type:"submit",size:"sm",color:"primary",onClick:E,children:[Object(d.jsx)(j.a,{name:"cil-scrubber"})," \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9"]})})]})]})]})}),Object(d.jsx)(u.k,{xs:"1",sm:"1",md:"1"})]})}}}]);
//# sourceMappingURL=7.16b9fe58.chunk.js.map