1 line
5.7 KiB
JavaScript
1 line
5.7 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[140],{"6JOy":function(e,t,a){},s4sY:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=E(a("W9HT")),n=E(a("JBPa")),r=E(a("BMrR")),o=E(a("kPKH")),u=E(a("2fM7")),s=E(a("Vl3Y")),i=E(a("PArb")),c=E(a("9yH6")),f=E(a("5rEg")),d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},m=function(){function e(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}return function(t,a,l){return a&&e(t.prototype,a),l&&e(t,l),t}}();a("04bd"),a("CF58"),a("Jmwx"),a("rO+z"),a("8QGh"),a("tULf"),a("qNb/"),a("K4yd"),a("1vPl");var p=a("q1tI"),h=E(p),v=E(a("vDqi")),y=E(a("wd/R"));function E(e){return e&&e.__esModule?e:{default:e}}a("6JOy");var g=f.default.TextArea,b=c.default.Group,w=c.default.Button,S=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 a=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 a.componentDidUpdate=function(e){e&&a.props&&!a.props.checkIfLogin()&&a.props.history.push("/403")},a.onPanelChange=function(e,t){a.setState({value:e})},a.onSelect=function(e){a.setState({value:e,selectedValue:e})},a.submit=function(){a.setState({isSpin:!0}),a.props.form.validateFieldsAndScroll((function(e,t){if(e)a.setState({isSpin:!1});else{var l=a.props.match.params,n=l.projectsId,r=l.owner,o="/"+r+"/"+n+"/milestones.json",u=void 0;a.state.selectedValue&&(u=a.state.selectedValue.format("YYYY-MM-DD")),v.default.post(o,d({},t,{project_id:n,effective_date:u,status:"open"})).then((function(e){if(e){a.setState({isSpin:!1}),a.props.history.push("/"+r+"/"+n+"/milestones");var t=a.props.getDetail;t&&t()}})).catch((function(e){a.setState({isSpin:!1})}))}}))},a.cleartime=function(){a.setState({selectedValue:void 0})},a.state={data:void 0,value:(0,y.default)("2017-01-25"),selectedValue:void 0,isSpin:!1},a}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),m(t,[{key:"render",value:function(){var e=this.props.form.getFieldDecorator,t=this.state.isSpin;return h.default.createElement("div",{className:"main"},h.default.createElement(s.default,null,h.default.createElement("div",{style:{marginLeft:15,marginTop:24}},h.default.createElement("h1",null,"新的里程碑"),h.default.createElement("h5",{className:"mt-5 color-grey-9"},"里程碑可以组织任务和合并请求,并跟踪进度.")),h.default.createElement(i.default,null),h.default.createElement("div",{style:{display:"flex"}},h.default.createElement("div",{className:"newmilepostleft"},"标题",h.default.createElement("div",null,h.default.createElement(s.default.Item,null,e("name",{rules:[{required:!0,message:"请输入标题"}]})(h.default.createElement(f.default,{placeholder:"标题",autoComplete:"off",maxLength:"30"})))),"描述",h.default.createElement(s.default.Item,null,e("description",{rules:[{required:!0,message:"请输入描述内容"}]})(h.default.createElement(g,{placeholder:"请输入描述内容...",style:{height:"150px"},maxLength:500})))),h.default.createElement("div",{className:"newmilepostrighe"},h.default.createElement("a",{style:{color:"black"}},"截止日期(可选)")," ",h.default.createElement("a",{style:{color:"red"},onClick:this.cleartime},"清除"),h.default.createElement("div",null,h.default.createElement(f.default,{style:{width:"120px"},value:this.state.selectedValue&&this.state.selectedValue.format("YYYY-MM-DD")})),h.default.createElement("div",{style:{width:300,border:"1px solid #d9d9d9",borderRadius:4,marginTop:25}},h.default.createElement(n.default,{fullscreen:!1,headerRender:function(e){for(var t=e.value,a=e.type,l=e.onChange,n=e.onTypeChange,s=[],i=t.clone(),c=t.localeData(),f=[],d=0;d<12;d++)i.month(d),f.push(c.monthsShort(i));for(var m=0;m<12;m++)s.push(h.default.createElement(u.default.Option,{className:"month-item",key:""+m},f[m]));for(var p=t.month(),v=t.year(),y=[],E=v-10;E<v+10;E+=1)y.push(h.default.createElement(u.default.Option,{key:E,value:E,className:"year-item"},E));return h.default.createElement("div",{style:{padding:10}},h.default.createElement(r.default,{type:"flex",justify:"space-between"},h.default.createElement(o.default,null,h.default.createElement(b,{size:"small",onChange:function(e){return n(e.target.value)},value:a},h.default.createElement(w,{value:"month"},"日期"),h.default.createElement(w,{value:"year"},"月份"))),h.default.createElement(o.default,null,h.default.createElement(u.default,{size:"small",dropdownMatchSelectWidth:!1,className:"my-year-select",style:{width:80},onChange:function(e){var a=t.clone().year(e);l(a)},value:String(v)},y)),h.default.createElement(o.default,null,h.default.createElement(u.default,{size:"small",dropdownMatchSelectWidth:!1,value:String(p),style:{width:75},onChange:function(e){var a=t.clone();a.month(parseInt(e,10)),l(a)}},s))))},onPanelChange:this.onPanelChange,onSelect:this.onSelect})))),h.default.createElement(i.default,null),h.default.createElement("div",{className:"clearfix mt15",onClick:this.submit},h.default.createElement(l.default,{spinning:t},h.default.createElement("a",{className:"topWrapper_btn fr"},"创建里程碑")))))}}]),t}(p.Component),O=s.default.create({name:"NewMilepostFrom"})(S);t.default=O}}]); |