(self.webpackChunksite_front=self.webpackChunksite_front||[]).push([[123],{3776:function(t,e,r){"use strict";r.d(e,{V:function(){return f}});var n=r(67294),o=r(77136);function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function c(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var f=function(){var t,e,r=(t=n.useState({loading:!1}),e=2,function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}}(t,e)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=r[0],c=r[1];return{state:i,request:function(t){return c((function(t){return a(a({},t),{},{loading:!0})})),new Promise((function(e,r){o.Z.instance.post("/v1/upload",t,{headers:{"Content-type":"multipart/form-data"}}).then((function(t){e(t)})).catch((function(t){r(t)})).finally((function(){c((function(t){return a(a({},t),{},{loading:!1})}))}))}))}}}},70123:function(t,e,r){"use strict";r.r(e);var n=r(85893),o=(r(869),r(28465)),i=(r(52262),r(65400)),a=(r(17435),r(55673)),c=(r(38414),r(5789)),u=(r(45950),r(91633)),f=(r(74263),r(29297)),l=(r(19373),r(11187)),s=r(67294),p=r(93263),d=r(84391),y=r(3776),b=r(47821);e.default=function(){var t=s.useContext(p.Z),e=(0,y.V)(),r=e.state,h=e.request,j=(0,b.No)(),g=(j.state,j.request);return(0,n.jsxs)("div",{children:[(0,n.jsx)(f.Z,{style:{paddingLeft:0},title:"施工平面图"}),(0,n.jsx)(a.Z,{children:(0,n.jsx)(c.Z,{span:12,children:(0,n.jsx)(u.Z,{src:t.projectInfo.project_plan})})}),(0,n.jsx)(o.Z,{beforeUpload:function(e){var r=new FormData;return r.append("file",e),h(r).then((function(e){g({picType:0,picUrl:[e]}).then((function(){t.changeProjectInfo({project_plan:e})})).catch((function(t){l.default.error(t.message)}))})).catch((function(t){l.default.error(t.message)})),!1},accept:"image/*",showUploadList:!1,children:(0,n.jsx)(i.default,{loading:r.loading,type:"primary",style:{marginTop:8},icon:(0,n.jsx)(d.Z,{}),children:"点击上传"})})]})}}}]);