ttk-app-core
Version:
enterprise develop framework
1 lines • 4.62 kB
JavaScript
{"source":"webpackJsonp([19],{824:function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=void 0;var a,o=p(n(0)),r=p(n(9)),i=p(n(7)),u=p(n(8)),c=p(n(10)),l=p(n(11)),d=n(1),s=(p(d),n(56)),f=p(n(284));function p(e){return e&&e.__esModule?e:{default:e}}var h=(0,s.wrapper)(f.default)(a=function(e){function t(){return(0,i.default)(this,t),(0,c.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,u.default)(t,[{key:\"render\",value:function(){return this.props.monkeyKing((0,o.default)({},this.props,{path:\"root\"}))}}]),t}(d.Component))||a;t.default=h,e.exports=t.default},825:function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var o=f(n(0)),r=f(n(35)),i=f(n(36)),u=f(n(7)),a=f(n(8));t.default=function(e){var t=new l.action(e),n=new h((0,o.default)({},e,{metaAction:t})),a=(0,o.default)({},t,n);return t.config({metaHandlers:a}),a};f(n(1));var c=f(n(16)),l=n(56),d=f(n(198)),s=(n(42),n(14),f(n(13)),f(n(2)));function f(e){return e&&e.__esModule?e:{default:e}}var p=[\"id\",\"name\",\"parentId\",\"dependentId\",\"isEndNode\"],h=function(){function t(e){var a=this;(0,u.default)(this,t),this.onInit=function(e){var t=e.component,n=e.injections;a.component=t,(a.injections=n).reduce(\"init\"),a.load()},this.load=(0,i.default)(r.default.mark(function e(){var t;return r.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.webapi.operation.query({});case 2:t=e.sent,a.injections.reduce(\"load\",t);case 4:case\"end\":return e.stop()}},e,a)})),this.save=(0,i.default)(r.default.mark(function e(){var t;return r.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.metaAction.gf(\"data.list\").toJS(),e.next=3,a.webapi.operation.save(t);case 3:a.metaAction.toast(\"success\",\"保存成功\"),a.load();case 5:case\"end\":return e.stop()}},e,a)})),this.addrow=function(e){a.injections.reduce(\"addEmptyRow\",e.rowIndex+1)},this.delrow=function(e){var t=a.metaAction.gf(\"data.list\").getIn([e.rowIndex,\"id\"]);a.injections.reduce(\"delrow\",t)},this.mousedown=function(e){var t=s.default.path.findPathByEvent(e);if(!a.metaAction.isFocus(t))if(-1!=t.indexOf(\"cell.cell\"))a.focusCell(a.getCellInfo(t));else{if(!a.metaAction.focusByEvent(e))return;setTimeout(a.cellAutoFocus,16)}},this.cellAutoFocus=function(){s.default.dom.gridCellAutoFocus(a.component,\".editable-cell\")},this.getCellClassName=function(e){return a.metaAction.isFocus(e)?\"ttk-edf-app-operation-cell editable-cell\":\"\"},this.isFocusCell=function(e,t){var n=a.metaAction.gf(\"data.other.focusCellInfo\");return!!n&&(n.columnKey==t&&n.rowIndex==e.rowIndex)},this.gridBirthdayOpenChange=function(e){if(!e){var t=c.default.findDOMNode(a.component).querySelector(\".editable-cell\");if(t)if(-1!=t.className.indexOf(\"datepicker\"))t.querySelector(\"input\").focus()}},this.metaAction=e.metaAction,this.config=d.default.current,this.webapi=this.config.webapi}return(0,a.default)(t,[{key:\"getCellInfo\",value:function(e){var t=s.default.path.parsePath(e),n=this.metaAction.gf(\"data.list\").size,a=t.path.replace(\"root.children.table.columns.\",\"\").replace(\".cell.cell\",\"\").replace(/\\s/g,\"\");return{x:p.findIndex(function(e){return e==a}),y:Number(t.vars[0]),colCount:4,rowCount:n}}},{key:\"focusCell\",value:function(e){this.metaAction.sfs({\"data.other.focusFieldPath\":\"root.children.table.columns.\"+p[e.x]+\".cell.cell,\"+e.y,\"data.other.scrollToRow\":e.y,\"data.other.scrollToColumn\":e.x}),setTimeout(this.cellAutoFocus,16)}}]),t}();e.exports=t.default},826:function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var a=l(n(0)),r=l(n(7));t.default=function(e){var t=new o.reducer(e),n=new d((0,a.default)({},e,{metaReducer:t}));return(0,a.default)({},t,n)};var i=n(14),o=n(56),u=l(n(198)),c=n(285);l(n(13));function l(e){return e&&e.__esModule?e:{default:e}}var d=function e(t){var o=this;(0,r.default)(this,e),this.init=function(e,t){var n=(0,c.getInitState)();return o.metaReducer.init(e,n)},this.load=function(e,t){return e=o.metaReducer.sf(e,\"data.list\",(0,i.fromJS)(t)),o.metaReducer.sf(e,\"data.other.focusCellInfo\",void 0)},this.addEmptyRow=function(e,t){var n=o.metaReducer.gf(e,\"data.list\");return n=n.insert(t,(0,i.Map)({id:n.size})),o.metaReducer.sf(e,\"data.list\",n)},this.delrow=function(e,t){var n=o.metaReducer.gf(e,\"data.list\"),a=n.findIndex(function(e){return e.get(\"id\")==t});return-1==a?e:(n=n.remove(a),o.metaReducer.sf(e,\"data.list\",n))},this.metaReducer=t.metaReducer,this.config=u.default.current};e.exports=t.default}});"}