forgeplus/public/react/build/static/js/67.00b324ef.chunk.js

1 line
17 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[67],{"2nZx":function(e,t,n){},AySf:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=p(n("CtXQ")),a=p(n("2/Rp")),r=p(n("8z0m")),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();n("2oDE"),n("L/Qf"),n("7W5+");var c=n("q1tI"),s=p(c),u=n("sYIF"),f=p(n("vDqi"));function p(e){return e&&e.__esModule?e:{default:e}}var d=r.default.Dragger,m=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.componentDidMount=function(){n.checkInitFile()},n.componentDidUpdate=function(e){e&&e.fileList!==n.props.fileList&&n.checkInitFile()},n.checkInitFile=function(){var e=n.props.fileList;e&&e.length>0&&n.setState({fileList:(0,u.appendFileSizeToUploadFileAll)(e)})},n.onAttachmentRemove=function(e){if(!e.percent||100===e.percent)return n.deleteAttachment(e),!1},n.deleteAttachment=function(e){var t="/attachments/"+(e.response?e.response.id:e.uid)+".json";f.default.delete(t,{}).then((function(t){t.data&&(0===t.data.status?(n.setState((function(t){var n=t.fileList.indexOf(e),o=t.fileList.slice();return o.splice(n,1),{fileList:o}})),n.fileIdList(n.state.fileList)):n.props.showNotification(t.data.message))})).catch((function(e){console.log(e)}))},n.handleChange=function(e){var t=n.props.changeIsComplete;if(t&&t(!0),"uploading"===e.file.status||"done"===e.file.status||"removed"===e.file.status){var o=e.fileList;n.setState({fileList:(0,u.appendFileSizeToUploadFileAll)(o)}),n.fileIdList(o)}},n.fileIdList=function(e){var t=[];e&&e.length>0&&e.map((function(e){return t.push(e.response&&(e.response.id||e.response.data&&e.response.data.id))})),t&&n.props.load&&n.props.load(t)},n.beforeUpload=function(e){var t=n.props.size,o=e.size/1024/1024<t;return o||n.props.showNotification("文件大小必须小于"+t+"MB!"),o},n.state={fileList:void 0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.isComplete,n=e.icon,l=e.btn,c=e.className,f=e.size,p=e.actionUrl,m=this.state.fileList,h={name:"file",fileList:!0===t?m:void 0,action:p||""+(0,u.getUploadActionUrl)(),onChange:this.handleChange,onRemove:this.onAttachmentRemove,beforeUpload:this.beforeUpload};return l?s.default.createElement(r.default,i({},h,{className:c}),s.default.createElement(a.default,{type:"default"},"上传文件"),s.default.createElement("span",{className:"ml10 color-grey-9"},"(你可以上传小于",s.default.createElement("span",{className:"color-red"},f,"MB"),"的文件)")):s.default.createElement(d,i({},h,{className:c}),n||s.default.createElement(o.default,{type:"inbox"}),s.default.createElement("p",{className:"ant-upload-text font-16 color-grey-3"},"拖动文件或点击此处上传"))}}]),t}(c.Component);t.default=m},B3S4:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=m(n("2/Rp")),a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,a=!1,r=void 0;try{for(var i,l=e[Symbol.iterator]();!(o=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(e){a=!0,r=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("L/Qf");var r=n("q1tI"),i=m(r);n("2nZx");var l=m(n("AySf")),c=m(n("bIax")),s=m(n("p7gc")),u=n("spEH"),f=m(n("vDqi")),p=m(n("bjH3")),d=m(n("LZ3y"));function m(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=(0,r.useState)(void 0),n=a(t,2),m=n[0],h=n[1],v=(0,r.useState)(void 0),y=a(v,2),b=y[0],g=y[1],E=(0,r.useState)(!1),w=a(E,2),O=w[0],_=w[1],N=(0,r.useState)(void 0),C=a(N,2),S=C[0],j=C[1],x=(0,r.useState)(!1),A=a(x,2),k=A[0],D=A[1],P=e.match.params,L=P.owner,V=P.projectsId,T=e.isManager,H=e.isDeveloper,M=e.current_user;function R(){var e="/"+L+"/"+V+"/about.json";f.default.get(e).then((function(e){e&&(g(e.data.content),h(e.data.attachments))})).catch((function(e){}))}return(0,r.useEffect)((function(){L&&V&&R()}),[L,V]),(0,r.useEffect)((function(){M&&M.login&&(!0===T||!0===H)&&D(!0)}),[T,H]),i.default.createElement("div",{className:"aboutPanels"},i.default.createElement("div",{className:"aboutContent"},i.default.createElement(u.AlignCenterBetween,{style:{padding:"14px 20px"}},i.default.createElement("span",{className:"font-16"},i.default.createElement("i",{className:"iconfont icon-xiangmujianjie mr5 font-16 color-blue"}),"项目概览"),k&&!O&&i.default.createElement("a",{onClick:function(){_(!0)},className:"color-blue"},"编辑")),O?i.default.createElement("div",{className:"padding20"},i.default.createElement(s.default,{placeholder:"请输入描述信息",height:500,mdID:"order-new-description",initValue:b,onChange:function(e){g(e)},className:"mt20"}),i.default.createElement("div",{className:"pb20"},i.default.createElement(l.default,{className:"commentStyle mt20",isComplete:!0,load:function(e){j(e)},icon:i.default.createElement("img",{src:c.default,width:"58",alt:"",style:{marginBottom:15}}),size:100,showNotification:e.showNotification}),m&&m.length>0&&i.default.createElement(d.default,{attachments:m,showNotification:e.showNotification,canDelete:!0})),i.default.createElement("div",{className:"pb30"},i.default.createElement(o.default,{type:"primary",onClick:function(){var t="/"+L+"/"+V+"/about.json";f.default.post(t,{content:b,attachment_ids:S}).then((function(t){t&&(e.showNotification("项目主页编辑成功!"),R(),_(!1))})).catch((function(e){}))}},"确定"),i.default.createElement(o.default,{className:"ml30",onClick:function(){return _(!1)}},"取消"))):i.default.createElement("div",{className:"padding20"},b?i.default.createElement(p.default,{className:"break_word_comments imageLayerParent",value:b,url:e.history.location}):i.default.createElement("div",null,"暂无概览~"),m&&m.length>0&&i.default.createElement(d.default,{attachments:m,showNotification:e.showNotification}))))}},LZ3y:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=p(n("kLXV")),a=p(n("W9HT")),r=p(n("NJEC")),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();n("k3Gp"),n("04bd"),n("k994");var l=n("q1tI"),c=p(l),s=n("eO8H"),u=p(n("vDqi")),f=p(n("UQ5L"));function p(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.componentDidMount=function(){n.getDetail()},n.getDetail=function(){n.setState({canDelete:n.props.canDelete})},n.show_video_modal=function(e){n.setState({video_title:e.title,move_spin:!0,video_id:e.id}),n.move_attachment(e.id,"preview")},n.hide_video_modal=function(){var e=n.state.video_id;n.setState({video_title:void 0}),n.move_attachment(e,"close")},n.move_attachment=function(e,t){u.default.post("/attachments/"+e+"/preview_attachment",{status:t}).then((function(e){e?n.setState({show_video:"preview"===t,video_url:"preview"===t?"https://forgeplus.trustie.net"+e.data.url:void 0,move_spin:!1}):n.setState({move_spin:!1})})).catch((function(e){n.setState({move_spin:!1}),console.log(e)}))},n.is_video=function(e){return["mp4","flv","mkv","3gp"].indexOf(e.split(".").pop())>-1},n.deleteAttachment=function(e){var t="/attachments/"+e+".json";u.default.delete(t,{}).then((function(t){t.data&&(0===t.data.status?(n.setState({Deleted:n.state.Deleted.concat(e)}),n.props.showNotification("附件删除成功")):n.props.showNotification(t.data.message))})).catch((function(e){console.log(e)}))},n.state={canDelete:!1,show_video:!1,video_url:void 0,video_title:void 0,video_id:void 0,move_spin:!1,Deleted:[]},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this,t=this.state,n=t.Deleted,i=t.canDelete,l=t.show_video,u=t.video_url,p=t.video_title,d=t.move_spin,m=this.props.attachments;return c.default.createElement("div",null,m?c.default.createElement("div",{className:"attachmentsList mt5"},m.map((function(t,o){return c.default.createElement("div",{key:o,style:{display:n.length>0&&-1!==n.indexOf(t.id)?"none":"block",padding:"4px"},className:"attachment-list-div"},c.default.createElement(a.default,{spinning:d},e.is_video(t.title)?c.default.createElement("a",{onClick:function(){return e.show_video_modal(t)},className:"attachment-list-a"},c.default.createElement("i",{className:"iconfont icon-fujian mr8 paper-clip-color font-12"}),c.default.createElement("span",null,t.title),c.default.createElement("span",{className:"ml20"},t.filesize)):c.default.createElement(s.Link,{to:""+t.url,target:"_blank",className:"attachment-list-a"},c.default.createElement("i",{className:"iconfont icon-fujian mr8 paper-clip-color font-12"}),c.default.createElement("span",null,t.title),c.default.createElement("span",{className:"ml20"},t.filesize)),i?c.default.createElement(r.default,{placement:"bottom",title:"您确定要删除附件吗",okText:"是",cancelText:"否",onConfirm:function(){return e.deleteAttachment(t.id)}},c.default.createElement("span",{className:"attachment-list-delete fr"},c.default.createElement("i",{className:"iconfont icon-lajitong mr10 color-grey-9 font-14"}))):""))}))):"",l?c.default.createElement(o.default,{title:p,visible:!0,width:690,footer:null,onCancel:this.hide_video_modal},c.default.createElement(f.default,{video_url:u})):"")}}]),t}(l.Component);t.default=d},NJEC:function(e,t,n){"use strict";n.r(t);var o=n("q1tI"),a=n("VCL8"),r=n("3S7+"),i=n("CtXQ"),l=n("2/Rp"),c=n("YMnH"),s=n("ZvpZ"),u=n("H84U");function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function d(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b(e);if(t){var a=b(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return v(this,n)}}function v(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n},E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(f,e);var t,n,a,i=h(f);function f(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(t=i.call(this,e)).onConfirm=function(e){t.setVisible(!1,e);var n=t.props.onConfirm;n&&n.call(y(t),e)},t.onCancel=function(e){t.setVisible(!1,e);var n=t.props.onCancel;n&&n.call(y(t),e)},t.onVisibleChange=function(e){t.props.disabled||t.setVisible(e)},t.saveTooltip=function(e){t.tooltip=e},t.renderOverlay=function(e,n){var a=t.props,r=a.okButtonProps,i=a.cancelButtonProps,c=a.title,s=a.cancelText,u=a.okText,f=a.okType,d=a.icon;return o.createElement("div",null,o.createElement("div",{className:"".concat(e,"-inner-content")},o.createElement("div",{className:"".concat(e,"-message")},d,o.createElement("div",{className:"".concat(e,"-message-title")},c)),o.createElement("div",{className:"".concat(e,"-buttons")},o.createElement(l.default,p({onClick:t.onCancel,size:"small"},i),s||n.cancelText),o.createElement(l.default,p({onClick:t.onConfirm,type:f,size:"small"},r),u||n.okText))))},t.renderConfirm=function(e){var n=e.getPrefixCls,a=t.props,i=a.prefixCls,l=a.placement,u=g(a,["prefixCls","placement"]),f=n("popover",i),d=o.createElement(c.a,{componentName:"Popconfirm",defaultLocale:s.a.Popconfirm},(function(e){return t.renderOverlay(f,e)}));return o.createElement(r.default,p({},u,{prefixCls:f,placement:l,onVisibleChange:t.onVisibleChange,visible:t.state.visible,overlay:d,ref:t.saveTooltip}))},t.state={visible:e.visible},t}return t=f,a=[{key:"getDerivedStateFromProps",value:function(e){return"visible"in e?{visible:e.visible}:"defaultVisible"in e?{visible:e.defaultVisible}:null}}],(n=[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"setVisible",value:function(e,t){var n=this.props;"visible"in n||this.setState({visible:e});var o=n.onVisibleChange;o&&o(e,t)}},{key:"render",value:function(){return o.createElement(u.a,null,this.renderConfirm)}}])&&d(t.prototype,n),a&&d(t,a),f}(o.Component);E.defaultProps={transitionName:"zoom-big",placement:"top",trigger:"click",okType:"primary",icon:o.createElement(i.default,{type:"exclamation-circle",theme:"filled"}),disabled:!1},Object(a.polyfill)(E),t.default=E},UQ5L:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,a=!1,r=void 0;try{for(var i,l=e[Symbol.iterator]();!(o=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(e){a=!0,r=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=n("q1tI"),r=l(a),i=l(n("6tYh"));function l(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=(0,a.useState)(null),n=o(t,2),l=n[0],c=n[1];return(0,a.useEffect)((function(){c(e.video_url)}),[]),r.default.createElement(i.default,{url:l,controls:!0,playing:!1})}},bIax:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAAmCAYAAACVr4jIAAAEiklEQVRoQ9WZbWxTZRTHf+feDlAJQhUIftBAUDEaDVG/gHEzEQ3GsVtMWTBGo0QxsLUJRvHDQtmMMRoyaAeJ+O4HCWzZ2rFkghpfQmZMNGqMgiwiJH6YStjmG2Treo+5ZZtDuvXerncrz8c+/3PO/9fbe3uec4VpWqsTOmeWElK4G+VOYCHCPGBAoEeFH4DP1KS1fbP8MlmbMtk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