build/static/js/146.be636c0a.chunk.js

1 line
7.4 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[146,158],{"0fBl":function(e,t,a){"use strict";a("+L6B");var n=a("2/Rp"),c=a("cDcd"),l=a.n(c),r=a("spEH"),s=a("/k9T");t.a=function(e){var t=e.visible,a=e.onCancel,c=e.onSuccess,i=e.title,o=e.subTitle,m=e.content;return l.a.createElement(s.a,{title:i,btn:l.a.createElement("div",null,l.a.createElement(n.a,{size:"large",onClick:a},"取消"),l.a.createElement(n.a,{type:"danger",size:"large",onClick:c},"确认删除")),onCancel:a,visible:t},l.a.createElement("div",{className:"desc"},l.a.createElement(r.a,{className:"descMain"},l.a.createElement("i",{className:"iconfont icon-shanchu_tc_icon mr10 font-36",style:{color:"#ca0002"}}),m),l.a.createElement("p",{className:"task-hide-2",style:{WebkitLineClamp:5}},l.a.createElement("span",{title:o},o))))}},BOKS:function(e,t,a){},JpFW:function(e,t,a){"use strict";a.r(t),a("+L6B");var n=a("2/Rp"),c=(a("y8nQ"),a("Vl3Y")),l=(a("5NDa"),a("5rEg")),r=(a("sPJy"),a("bE4q")),s=a("04Ix"),i=a.n(s),o=a("zLi2"),m=a.n(o),p=a("o+MX"),u=a.n(p),f=a("+oHS"),d=a.n(f),h=a("OWCx"),v=a.n(h),E=a("5PDf"),j=a.n(E),b=a("fHi0"),y=a.n(b),N=a("RXMP"),C=a.n(N),w=a("qjzJ"),g=a.n(w),k=a("HnXd"),O=a.n(k),I=a("LYCE"),L=a.n(I),_=a("cDcd"),D=a.n(_),S=(a("Wxvy"),a("BOKS"),a("p7gc")),x=a("vDqi"),q=a.n(x),B=a("hj8q");function P(e,t){var a=d()(e);if(v.a){var n=v()(e);t&&(n=j()(n).call(n,(function(t){return y()(e,t).enumerable}))),a.push.apply(a,n)}return a}function T(e){for(var t=1;t<arguments.length;t++){var a,n,c=null!=arguments[t]?arguments[t]:{};t%2?C()(a=P(Object(c),!0)).call(a,(function(t){i()(e,t,c[t])})):g.a?O()(e,g()(c)):C()(n=P(Object(c))).call(n,(function(t){L()(e,t,y()(c,t))}))}return e}t.default=c.a.create({name:"Template"})((function(e){var t,a,s=e.form,i=s.validateFields,o=s.getFieldDecorator,p=s.setFieldsValue,f=e.match.params.owner,d=e.match.params.type,h=e.match.params.operate,v=e.match.params.projectsId,E=Object(_.useState)(void 0),j=m()(E,2),b=j[0],y=j[1],N=e.projectDetail;return Object(_.useEffect)((function(){var t;!N||""!==N.permission&&"Reporter"!==N.permission||e.history.push(u()(t="/".concat(f,"/")).call(t,v))}),[N]),Object(_.useEffect)((function(){var e,t,a;"new"!==h&&(a=u()(e=u()(t="/v1/".concat(f,"/")).call(t,v,"/project_templates/")).call(e,h),q.a.get(a).then((function(e){e&&e.data&&e.data.project_template&&(p(T({},e.data.project_template)),y(e.data.project_template.content))})).catch((function(e){})))}),[h]),D.a.createElement("div",{className:"pagebox"},D.a.createElement(r.a,{className:"mt30 mb20",separator:">"},D.a.createElement(r.a.Item,{href:u()(t=u()(a="/".concat(f,"/")).call(a,v,"/")).call(t,d,"/temp")},"issue"===d.toLowerCase()?"疑修模板":"合并请求模板"),D.a.createElement(r.a.Item,null,"new"===h?"新建模板":"编辑模板")),D.a.createElement(c.a,{form:s},D.a.createElement(c.a.Item,{label:"模板名称"},o("name",{rules:[{required:!0,message:"请输入模板名称"}]})(D.a.createElement(l.a,{placeholder:"请输入模板名称",maxLength:100,style:{width:"400px"}}))),D.a.createElement(c.a.Item,{label:"模板内容"},o("content",{rules:[{required:!0,message:"请输入模板内容"}]})(D.a.createElement(S.a,{placeholder:"请输入模板内容",height:400,initValue:b,mdID:"tempContent",onChange:function(e){y(e)},owner:f,projectsId:v})))),D.a.createElement("div",{className:"mt20 pb30"},D.a.createElement(n.a,{type:"primary",className:"mr20",style:{width:"90px"},onClick:function(){i((function(t,a){if(!t){var n={name:a.name,content:b,type:B.tempType[d]};if("new"===h){var c,l=u()(c="/v1/".concat(f,"/")).call(c,v,"/project_templates.json");q.a.post(l,T({},n)).then((function(t){var a,n;t&&t.data&&0===t.data.status&&(e.showNotification("模板保存成功!"),e.history.push(u()(a=u()(n="/".concat(f,"/")).call(n,v,"/")).call(a,d,"/temp")))})).catch((function(e){}))}else{var r,s,i=u()(r=u()(s="/v1/".concat(f,"/")).call(s,v,"/project_templates/")).call(r,h);q.a.put(i,T({},n)).then((function(t){var a,n;t&&t.data&&0===t.data.status&&(e.showNotification("模板更新成功!"),e.history.push(u()(a=u()(n="/".concat(f,"/")).call(n,v,"/")).call(a,d,"/temp")))})).catch((function(e){}))}}}))}},"确定"),D.a.createElement(n.a,{onClick:function(){return history.back(-1)},style:{width:"90px"}},"取消")))}))},Wxvy:function(e,t,a){},hj8q:function(e,t,a){"use strict";a.r(t),a.d(t,"tempType",(function(){return N})),a("+L6B");var n=a("2/Rp"),c=(a("2qtc"),a("kLXV")),l=a("zLi2"),r=a.n(l),s=a("o+MX"),i=a.n(s),o=a("5PDf"),m=a.n(o),p=a("FLGM"),u=a.n(p),f=a("cDcd"),d=a.n(f),h=(a("Wxvy"),a("BOKS"),a.p+"static/media/add.0a24714a.png"),v=a("2iEm"),E=a("bjH3"),j=a("vDqi"),b=a.n(j),y=a("0fBl"),N={issue:"ProjectTemplates::Issue",pull:"ProjectTemplates::PullRequest"};t.default=function(e){var t,a,l=e.match.params.owner,s=e.match.params.type,o=e.match.params.projectsId,p=Object(f.useState)(void 0),j=r()(p,2),C=j[0],w=j[1],g=Object(f.useState)(!1),k=r()(g,2),O=k[0],I=k[1],L=Object(f.useState)(!1),_=r()(L,2),D=_[0],S=_[1],x=Object(f.useState)(!1),q=r()(x,2),B=q[0],P=q[1],T=Object(f.useState)(void 0),R=r()(T,2),z=R[0],M=R[1],W=e.projectDetail;function F(){var e,t=i()(e="/v1/".concat(l,"/")).call(e,o,"/project_templates.json");b.a.get(t).then((function(e){if(e){var t=e.data.project_templates||[];w(m()(t).call(t,(function(e){return e.type===N[s]})))}})).catch((function(e){}))}return Object(f.useEffect)((function(){var t;!W||""!==W.permission&&"Reporter"!==W.permission||e.history.push(i()(t="/".concat(l,"/")).call(t,o))}),[W]),Object(f.useEffect)((function(){F()}),[s]),d.a.createElement("div",{className:"pagebox"},d.a.createElement(y.a,{visible:O,onCancel:function(){I(!1),M(void 0)},onSuccess:function(){var t,a,n=i()(t=i()(a="/v1/".concat(l,"/")).call(a,o,"/project_templates/")).call(t,z);b.a.delete(n).then((function(t){t&&t.data&&(e.showNotification("模板删除成功!"),M(void 0),I(!1),F())})).catch((function(e){}))},title:"删除模板",content:"您确定要删除此模板吗?"}),d.a.createElement(c.a,{wrapClassName:"skimModal",title:B.name,visible:D,onCancel:function(){S(!1)},width:800,footer:null},d.a.createElement("div",{className:"skimContent"},d.a.createElement(E.a,{value:B.content}))),d.a.createElement("ul",{className:"tempType"},d.a.createElement(v.a,{to:i()(t="/".concat(l,"/")).call(t,o,"/issue/temp"),className:"issue"===s?"active":""},"疑修模版"),d.a.createElement(v.a,{to:i()(a="/".concat(l,"/")).call(a,o,"/pull/temp"),className:"pull"===s?"active":""},"合并请求模版")),d.a.createElement("div",{className:"tempList"},d.a.createElement("div",{className:"tempItem tempCreateItem",onClick:function(){var t,a;e.history.push(i()(t=i()(a="/".concat(l,"/")).call(a,o,"/")).call(t,s,"/temp/new"))}},d.a.createElement("img",{src:h,width:69}),d.a.createElement("span",null,"创建模板")),C&&u()(C).call(C,(function(t,a){return d.a.createElement("div",{className:"tempItem"},d.a.createElement("a",{onClick:function(){M(t.id),I(!0)}},d.a.createElement("i",{className:"iconfont icon-fuzhi-shanchu1 font-15 deltemp"})),d.a.createElement("p",{className:"tempName task-hide",title:t.name},t.name),d.a.createElement("div",{className:"tempContent"},d.a.createElement(E.a,{className:"break_word_comments imageLayerParent",value:t.content,url:e.history.location})),d.a.createElement("div",{className:"tempOperate"},d.a.createElement(n.a,{type:"primary",onClick:function(){P(t),S(!0)}},"预览"),d.a.createElement(n.a,{onClick:function(){var a,n,c;return e.history.push(i()(a=i()(n=i()(c="/".concat(l,"/")).call(c,o,"/")).call(n,s,"/temp/")).call(a,t.id))}},"编辑")))}))))}}}]);