build/static/js/139.55e8b3c1.chunk.js

1 line
6.0 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[139],{"6JOy":function(e,t,a){},IxYK: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")),i=E(a("Vl3Y")),c=E(a("PArb")),s=E(a("9yH6")),d=E(a("5rEg")),f=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=d.default.TextArea,b=s.default.Group,S=s.default.Button,w=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.componentDidMount=function(){a.getmeil()},a.onPanelChange=function(e,t){a.setState({value:e})},a.onSelect=function(e){a.setState({value:e,selectedValue:e})},a.getmeil=function(){var e=a.props.match.params,t=e.projectsId,l=e.owner,n=a.props.match.params.meilid,r="/"+l+"/"+t+"/milestones/"+n+"/edit.json";v.default.get(r,{params:{projectsId:t,meilid:n}}).then((function(e){e&&(a.setState({data:e.data,selectedValue:e.data.effective_date&&(0,y.default)(e.data.effective_date)}),a.props.form.setFieldsValue({name:e.data.name,description:e.data.description}))})).catch((function(e){console.log(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=a.props.match.params.meilid,u="/"+r+"/"+n+"/milestones/"+o+".json",i=a.state.selectedValue&&a.state.selectedValue.format("YYYY-MM-DD");v.default.put(u,f({},t,{project_id:n,id:o,effective_date:i,status:"open"})).then((function(e){e&&(a.setState({isSpin:!1}),a.props.history.push("/"+r+"/"+n+"/milestones"))})).catch((function(e){a.setState({isSpin:!1}),console.log(e)}))}}))},a.claertime=function(){a.setState({selectedValue:void 0})},a.state={data:void 0,value:(0,y.default)("2017-01-25"),selectedValue:(0,y.default)("2020-2-12"),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,a=t.isSpin,s=t.selectedValue;return h.default.createElement("div",{className:"main"},h.default.createElement(i.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(c.default,null),h.default.createElement("div",{style:{display:"flex"}},h.default.createElement("div",{className:"newmilepostleft"},"标题",h.default.createElement("div",null,h.default.createElement(i.default.Item,null,e("name",{rules:[{required:!0,message:"请输入标题"}]})(h.default.createElement(d.default,{placeholder:"标题"})))),"描述",h.default.createElement(i.default.Item,null,e("description",{rules:[{required:!0,message:"请输入描述内容"}]})(h.default.createElement(g,{placeholder:"请输入描述内容...",style:{height:"150px"}})))),h.default.createElement("div",{className:"newmilepostrighe"},"截止日期(可选) ",h.default.createElement("a",{style:{color:"red"},onClick:this.claertime},"清除"),h.default.createElement("div",null,h.default.createElement(d.default,{style:{width:"120px"},value:s&&s.format("YYYY-MM-DD")})),h.default.createElement("div",{style:{width:300,border:"1px solid #d9d9d9",borderRadius:4,marginTop:5}},h.default.createElement(n.default,{fullscreen:!1,headerRender:function(e){for(var t=e.value,a=e.type,l=e.onChange,n=e.onTypeChange,i=[],c=t.clone(),s=t.localeData(),d=[],f=0;f<12;f++)c.month(f),d.push(s.monthsShort(c));for(var m=0;m<12;m++)i.push(h.default.createElement(u.default.Option,{className:"month-item",key:""+m},d[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(S,{value:"month"},"日期"),h.default.createElement(S,{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),onChange:function(e){var a=t.clone();a.month(parseInt(e,10)),l(a)}},i))))},onPanelChange:this.onPanelChange,onSelect:this.onSelect})))),h.default.createElement(c.default,null),h.default.createElement("div",{className:"clearfix mt15",onClick:this.submit},h.default.createElement(l.default,{spinning:a},h.default.createElement("a",{className:"topWrapper_btn fr"},"更新里程碑")))))}}]),t}(p.Component),O=i.default.create({name:"UpdatemileFrom"})(w);t.default=O}}]);