@imedx/ics-imedx-core
Advanced tools
Comparing version 0.0.1-beta.4 to 0.0.1-beta.5
@@ -1,2 +0,16 @@ | ||
var e=function(){function e(){this.cache={}}return e.prototype.set=function(e,t,n){var r=(new Date).getTime()+1e3*n;this.cache[e]={value:t,expireAt:r}},e.prototype.get=function(e){var t=this.cache[e];return t&&t.expireAt>(new Date).getTime()?t.value:null},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e}(),t=function(){function t(){this.__cache=new e}return t.prototype.get=function(e,t){var n=this,a=this.__cache.get(e);return a?Promise.resolve(a):r.request({url:"basic/param/value/list",method:"post",data:[{code:e}]}).then((function(r){return n.__cache.set(e,r.data[0],t),Promise.resolve(r.data[0])}))},t.prototype.getTradeChannel=function(e,t){var n=this,a="__TRADE_CHANNEL",o=this.__cache.get(a);return o?Promise.resolve(o):r.request({url:"/account/trade-channel/list?tradeType=".concat(e),method:"post"}).then((function(e){return n.__cache.set(a,e.data,t),Promise.resolve(e.data)}))},t}(),n=function(){this.param=new t},r=function(){function e(){}return e.use=function(e){var t=e.request;this.request=t},e.request={},e.system=new n,e}();export{r as default}; | ||
var t=function(){function t(){this.cache={}}return t.prototype.set=function(t,e,r){var n=(new Date).getTime()+1e3*r;this.cache[t]={value:e,expireAt:n}},t.prototype.get=function(t){var e=this.cache[t];return e&&e.expireAt>(new Date).getTime()?e.value:null},t.prototype.remove=function(t){delete this.cache[t]},t.prototype.clear=function(){this.cache={}},t}(),e=function(){return e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},e.apply(this,arguments)}; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */function r(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{p(n.next(t))}catch(t){i(t)}}function s(t){try{p(n.throw(t))}catch(t){i(t)}}function p(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(a,s)}p((n=n.apply(t,e||[])).next())}))}function n(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var o=function(){function t(){this.interceptors=[]}return t.prototype.use=function(t,e){return this.interceptors.push({resolved:t,rejected:e}),this.interceptors.length-1},t.prototype.reject=function(t){this.interceptors[t]&&(this.interceptors[t]=null)},t}(),i=new(function(){function t(t){var r=void 0===t?{}:t,n=r.headers,i=void 0===n?{}:n,a=r.fetch;this._baseAjaxUrl="http://icreate.com/",this.isChromely=!!window.CefSharp,this.headers=e({},i),this.fetch=a||window.fetch.bind(window),this.interceptors={request:new o,response:new o},this.interceptors.response.use((function(t){return 200===t.code?Promise.resolve(t.data):Promise.reject(t)}))}return t.prototype.command=function(t){return r(this,void 0,void 0,(function(){var e,r;return n(this,(function(n){switch(n.label){case 0:return this.isChromely?window.IMedxAsync?[3,2]:[4,window.CefSharp.BindObjectAsync("IMedxAsync")]:[3,4];case 1:n.sent(),n.label=2;case 2:for(r in e=[],t.data)e.push(r+"="+t.data[r]);return[4,IMedxAsync.command(t.url+(e.length>0?"?"+e.join("&"):""))];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},t.prototype.function=function(t){return r(this,void 0,void 0,(function(){var o,i,a,s,p,u=this;return n(this,(function(c){for(o=[{resolved:function(o){var i,a;if(!u.isChromely)return Promise.reject({code:500,message:"浏览器下暂时不支持,正在适配中...",data:null});var s=e(e({},o),t);if(s.headers?s.headers["Content-Type"]=s.headers["Content-Type"]||"application/json":s.headers={"Content-Type":"application/json"},"GET"===(null===(i=null==t?void 0:t.method)||void 0===i?void 0:i.toUpperCase())||"HEAD"===(null===(a=null==t?void 0:t.method)||void 0===a?void 0:a.toUpperCase())){var p=[];for(var c in t.data)p.push(c+"="+t.data[c]);t.url=t.url+(p.length>0?"?"+p.join("&"):"")}else"application/json"===s.headers["Content-Type"]?s.body=JSON.stringify(t.data):s.body=t.data;var h=o.fetch(""+o._baseAjaxUrl+t.url.replace(/^\/+/,""),s).then((function(t){return r(u,void 0,void 0,(function(){var e,r,o,i,a;return n(this,(function(n){switch(n.label){case 0:return t.ok?"application/json"!==t.headers.get("Content-Type")?[3,2]:(r=(e=JSON).parse,[4,t.text()]):[3,5];case 1:return[2,r.apply(e,[n.sent()])];case 2:return o={code:200,message:"ok"},[4,t.blob()];case 3:return[2,(o.data=n.sent(),o)];case 4:return[3,7];case 5:return i=null,[4,t.text()];case 6:a=n.sent();try{i=JSON.parse(a)}catch(t){i={message:a}}return[2,Promise.reject(i)];case 7:return[2]}}))}))}));return h},rejected:void 0}],this.interceptors.request.interceptors.forEach((function(t){null!==t&&o.unshift(t)})),this.interceptors.response.interceptors.forEach((function(t){null!==t&&o.push(t)})),i=Promise.resolve(e({},this));o.length;)a=o.shift(),s=a.resolved,p=a.rejected,i=i.then(s,p);return[2,i]}))}))},t}()),a=function(){return a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)},s=function(){function t(){this.instanceId=(new Date).getTime().toString()}return t.prototype.OperateEx=function(t,e,r){return void 0===r&&(r="GET"),i.function({url:"Report/".concat(t),method:r,data:a(a({},e),{instanceId:this.instanceId})})},t.prototype.clearData=function(){return this.OperateEx("ClearData")},t.prototype.registerData=function(t,e,r){return this.OperateEx("RegisterData",{name:t,data:JSON.stringify(e),field:JSON.stringify(r||{})},"POST")},t.prototype.doublePass=function(t){return this.OperateEx("DoublePass",{value:t})},t.prototype.load=function(t){return this.OperateEx("Load",{fileName:t})},t.prototype.loadFromId=function(t){return this.OperateEx("LoadFromId",{reportId:t})},t.prototype.ExportToPdf=function(t){return t?this.OperateEx("ExportToPdf",{fileName:t}):this.OperateEx("ExportToPdfStream",null,"GET")},t.prototype.exportToHtml=function(t){return this.OperateEx("ExportToHtml",{fileName:t})},t.prototype.prepare=function(t){return void 0===t&&(t=!1),this.OperateEx("Prepare",{append:t})},t.prototype.addParameter=function(t,e){return this.OperateEx("AddParameter",{name:t,value:e})},t.prototype.design=function(){return this.OperateEx("Design")},t.prototype.show=function(t){return this.OperateEx("Show",{printerName:null!=t?t:""})},t.prototype.showPrepared=function(t){return this.OperateEx("ShowPrepared",{printerName:null!=t?t:""})},t.prototype.print=function(t){return this.OperateEx("Print",{printerName:null!=t?t:""})},t.prototype.printPrepared=function(t){return this.OperateEx("PrintPrepared",{printerName:null!=t?t:""})},t.prototype.dispose=function(){return this.OperateEx("Dispose")},t}(),p=function(){function e(){this.__cache=new t,this.__reprot__=new s,this.printName=""}return e.prototype.getPrinterName=function(t,e){var r=this;if(void 0===e&&(e=43200),!t)return Promise.reject("打印报表名称不存在!");var n=this.__cache.get(t);return n?Promise.resolve(n):l.request({url:"interface-platform/frx/printer/get",method:"post",data:[{clientId:l.clientInfo.id,frxId:t}]}).then((function(n){return r.__cache.set(t,n.data.name,e),Promise.resolve(n.data.name)}))},e.prototype.clearData=function(){return this.__reprot__.clearData()},e.prototype.registerData=function(t,e,r){return this.__reprot__.registerData(t,e,r)},e.prototype.doublePass=function(t){return this.__reprot__.doublePass(t)},e.prototype.load=function(t){var e=this;return this.getPrinterName(t.replace(".frx","")).then((function(r){return e.printName=r,e.__reprot__.load(t)}))},e.prototype.loadFromId=function(t){var e=this;return this.getPrinterName(t).then((function(r){return e.printName=r,e.__reprot__.loadFromId(t)}))},e.prototype.ExportToPdf=function(t){return this.__reprot__.ExportToPdf(t)},e.prototype.exportToHtml=function(t){return this.__reprot__.exportToHtml(t)},e.prototype.prepare=function(t){return this.__reprot__.prepare(t)},e.prototype.addParameter=function(t,e){return this.__reprot__.addParameter(t,e)},e.prototype.design=function(){return this.__reprot__.design()},e.prototype.show=function(t){return this.__reprot__.show(t||this.printName)},e.prototype.showPrepared=function(t){return this.__reprot__.showPrepared(t||this.printName)},e.prototype.print=function(t){return this.__reprot__.print(t||this.printName)},e.prototype.printPrepared=function(t){return this.__reprot__.printPrepared(t||this.printName)},e.prototype.dispose=function(){return this.printName="",this.__reprot__.dispose()},e}(),u=function(){this.report=p},c=function(){function e(){this.__cache=new t}return e.prototype.get=function(t,e){var r=this;if(!t)return Promise.reject("参数代码不存在!");var n=this.__cache.get(t);return n?Promise.resolve(n):l.request({url:"basic/param/value/list",method:"post",data:[{code:t}]}).then((function(n){return r.__cache.set(t,n.data[0],e),Promise.resolve(n.data[0])}))},e.prototype.getTradeChannel=function(t,e){var r=this,n="__TRADE_CHANNEL",o=this.__cache.get(n);return o?Promise.resolve(o):l.request({url:"/account/trade-channel/list?tradeType=".concat(t),method:"post"}).then((function(t){return r.__cache.set(n,t.data,e),Promise.resolve(t.data)}))},e}(),h=function(){this.param=new c},l=function(){function t(){}return t.use=function(t){var e=t.request;this.request=e},t.setClient=function(t){this.clientInfo=t},t.request={},t.system=new h,t.client=new u,t}();export{l as default}; | ||
//# sourceMappingURL=ics-imedx-core.es5.js.map |
@@ -1,2 +0,16 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).icsImedxCore=t()}(this,(function(){"use strict";var e=function(){function e(){this.cache={}}return e.prototype.set=function(e,t,n){var o=(new Date).getTime()+1e3*n;this.cache[e]={value:t,expireAt:o}},e.prototype.get=function(e){var t=this.cache[e];return t&&t.expireAt>(new Date).getTime()?t.value:null},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e}(),t=function(){function t(){this.__cache=new e}return t.prototype.get=function(e,t){var n=this,r=this.__cache.get(e);return r?Promise.resolve(r):o.request({url:"basic/param/value/list",method:"post",data:[{code:e}]}).then((function(o){return n.__cache.set(e,o.data[0],t),Promise.resolve(o.data[0])}))},t.prototype.getTradeChannel=function(e,t){var n=this,r="__TRADE_CHANNEL",i=this.__cache.get(r);return i?Promise.resolve(i):o.request({url:"/account/trade-channel/list?tradeType=".concat(e),method:"post"}).then((function(e){return n.__cache.set(r,e.data,t),Promise.resolve(e.data)}))},t}(),n=function(){this.param=new t},o=function(){function e(){}return e.use=function(e){var t=e.request;this.request=t},e.request={},e.system=new n,e}();return o})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).icsImedxCore=e()}(this,(function(){"use strict";var t=function(){function t(){this.cache={}}return t.prototype.set=function(t,e,r){var n=(new Date).getTime()+1e3*r;this.cache[t]={value:e,expireAt:n}},t.prototype.get=function(t){var e=this.cache[t];return e&&e.expireAt>(new Date).getTime()?e.value:null},t.prototype.remove=function(t){delete this.cache[t]},t.prototype.clear=function(){this.cache={}},t}(),e=function(){return e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},e.apply(this,arguments)}; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */function r(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{p(n.next(t))}catch(t){i(t)}}function s(t){try{p(n.throw(t))}catch(t){i(t)}}function p(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(a,s)}p((n=n.apply(t,e||[])).next())}))}function n(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var o=function(){function t(){this.interceptors=[]}return t.prototype.use=function(t,e){return this.interceptors.push({resolved:t,rejected:e}),this.interceptors.length-1},t.prototype.reject=function(t){this.interceptors[t]&&(this.interceptors[t]=null)},t}(),i=new(function(){function t(t){var r=void 0===t?{}:t,n=r.headers,i=void 0===n?{}:n,a=r.fetch;this._baseAjaxUrl="http://icreate.com/",this.isChromely=!!window.CefSharp,this.headers=e({},i),this.fetch=a||window.fetch.bind(window),this.interceptors={request:new o,response:new o},this.interceptors.response.use((function(t){return 200===t.code?Promise.resolve(t.data):Promise.reject(t)}))}return t.prototype.command=function(t){return r(this,void 0,void 0,(function(){var e,r;return n(this,(function(n){switch(n.label){case 0:return this.isChromely?window.IMedxAsync?[3,2]:[4,window.CefSharp.BindObjectAsync("IMedxAsync")]:[3,4];case 1:n.sent(),n.label=2;case 2:for(r in e=[],t.data)e.push(r+"="+t.data[r]);return[4,IMedxAsync.command(t.url+(e.length>0?"?"+e.join("&"):""))];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},t.prototype.function=function(t){return r(this,void 0,void 0,(function(){var o,i,a,s,p,u=this;return n(this,(function(c){for(o=[{resolved:function(o){var i,a;if(!u.isChromely)return Promise.reject({code:500,message:"浏览器下暂时不支持,正在适配中...",data:null});var s=e(e({},o),t);if(s.headers?s.headers["Content-Type"]=s.headers["Content-Type"]||"application/json":s.headers={"Content-Type":"application/json"},"GET"===(null===(i=null==t?void 0:t.method)||void 0===i?void 0:i.toUpperCase())||"HEAD"===(null===(a=null==t?void 0:t.method)||void 0===a?void 0:a.toUpperCase())){var p=[];for(var c in t.data)p.push(c+"="+t.data[c]);t.url=t.url+(p.length>0?"?"+p.join("&"):"")}else"application/json"===s.headers["Content-Type"]?s.body=JSON.stringify(t.data):s.body=t.data;var h=o.fetch(""+o._baseAjaxUrl+t.url.replace(/^\/+/,""),s).then((function(t){return r(u,void 0,void 0,(function(){var e,r,o,i,a;return n(this,(function(n){switch(n.label){case 0:return t.ok?"application/json"!==t.headers.get("Content-Type")?[3,2]:(r=(e=JSON).parse,[4,t.text()]):[3,5];case 1:return[2,r.apply(e,[n.sent()])];case 2:return o={code:200,message:"ok"},[4,t.blob()];case 3:return[2,(o.data=n.sent(),o)];case 4:return[3,7];case 5:return i=null,[4,t.text()];case 6:a=n.sent();try{i=JSON.parse(a)}catch(t){i={message:a}}return[2,Promise.reject(i)];case 7:return[2]}}))}))}));return h},rejected:void 0}],this.interceptors.request.interceptors.forEach((function(t){null!==t&&o.unshift(t)})),this.interceptors.response.interceptors.forEach((function(t){null!==t&&o.push(t)})),i=Promise.resolve(e({},this));o.length;)a=o.shift(),s=a.resolved,p=a.rejected,i=i.then(s,p);return[2,i]}))}))},t}()),a=function(){return a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)},s=function(){function t(){this.instanceId=(new Date).getTime().toString()}return t.prototype.OperateEx=function(t,e,r){return void 0===r&&(r="GET"),i.function({url:"Report/".concat(t),method:r,data:a(a({},e),{instanceId:this.instanceId})})},t.prototype.clearData=function(){return this.OperateEx("ClearData")},t.prototype.registerData=function(t,e,r){return this.OperateEx("RegisterData",{name:t,data:JSON.stringify(e),field:JSON.stringify(r||{})},"POST")},t.prototype.doublePass=function(t){return this.OperateEx("DoublePass",{value:t})},t.prototype.load=function(t){return this.OperateEx("Load",{fileName:t})},t.prototype.loadFromId=function(t){return this.OperateEx("LoadFromId",{reportId:t})},t.prototype.ExportToPdf=function(t){return t?this.OperateEx("ExportToPdf",{fileName:t}):this.OperateEx("ExportToPdfStream",null,"GET")},t.prototype.exportToHtml=function(t){return this.OperateEx("ExportToHtml",{fileName:t})},t.prototype.prepare=function(t){return void 0===t&&(t=!1),this.OperateEx("Prepare",{append:t})},t.prototype.addParameter=function(t,e){return this.OperateEx("AddParameter",{name:t,value:e})},t.prototype.design=function(){return this.OperateEx("Design")},t.prototype.show=function(t){return this.OperateEx("Show",{printerName:null!=t?t:""})},t.prototype.showPrepared=function(t){return this.OperateEx("ShowPrepared",{printerName:null!=t?t:""})},t.prototype.print=function(t){return this.OperateEx("Print",{printerName:null!=t?t:""})},t.prototype.printPrepared=function(t){return this.OperateEx("PrintPrepared",{printerName:null!=t?t:""})},t.prototype.dispose=function(){return this.OperateEx("Dispose")},t}(),p=function(){function e(){this.__cache=new t,this.__reprot__=new s,this.printName=""}return e.prototype.getPrinterName=function(t,e){var r=this;if(void 0===e&&(e=43200),!t)return Promise.reject("打印报表名称不存在!");var n=this.__cache.get(t);return n?Promise.resolve(n):l.request({url:"interface-platform/frx/printer/get",method:"post",data:[{clientId:l.clientInfo.id,frxId:t}]}).then((function(n){return r.__cache.set(t,n.data.name,e),Promise.resolve(n.data.name)}))},e.prototype.clearData=function(){return this.__reprot__.clearData()},e.prototype.registerData=function(t,e,r){return this.__reprot__.registerData(t,e,r)},e.prototype.doublePass=function(t){return this.__reprot__.doublePass(t)},e.prototype.load=function(t){var e=this;return this.getPrinterName(t.replace(".frx","")).then((function(r){return e.printName=r,e.__reprot__.load(t)}))},e.prototype.loadFromId=function(t){var e=this;return this.getPrinterName(t).then((function(r){return e.printName=r,e.__reprot__.loadFromId(t)}))},e.prototype.ExportToPdf=function(t){return this.__reprot__.ExportToPdf(t)},e.prototype.exportToHtml=function(t){return this.__reprot__.exportToHtml(t)},e.prototype.prepare=function(t){return this.__reprot__.prepare(t)},e.prototype.addParameter=function(t,e){return this.__reprot__.addParameter(t,e)},e.prototype.design=function(){return this.__reprot__.design()},e.prototype.show=function(t){return this.__reprot__.show(t||this.printName)},e.prototype.showPrepared=function(t){return this.__reprot__.showPrepared(t||this.printName)},e.prototype.print=function(t){return this.__reprot__.print(t||this.printName)},e.prototype.printPrepared=function(t){return this.__reprot__.printPrepared(t||this.printName)},e.prototype.dispose=function(){return this.printName="",this.__reprot__.dispose()},e}(),u=function(){this.report=p},c=function(){function e(){this.__cache=new t}return e.prototype.get=function(t,e){var r=this;if(!t)return Promise.reject("参数代码不存在!");var n=this.__cache.get(t);return n?Promise.resolve(n):l.request({url:"basic/param/value/list",method:"post",data:[{code:t}]}).then((function(n){return r.__cache.set(t,n.data[0],e),Promise.resolve(n.data[0])}))},e.prototype.getTradeChannel=function(t,e){var r=this,n="__TRADE_CHANNEL",o=this.__cache.get(n);return o?Promise.resolve(o):l.request({url:"/account/trade-channel/list?tradeType=".concat(t),method:"post"}).then((function(t){return r.__cache.set(n,t.data,e),Promise.resolve(t.data)}))},e}(),h=function(){this.param=new c},l=function(){function t(){}return t.use=function(t){var e=t.request;this.request=e},t.setClient=function(t){this.clientInfo=t},t.request={},t.system=new h,t.client=new u,t}();return l})); | ||
//# sourceMappingURL=ics-imedx-core.umd.js.map |
@@ -17,2 +17,5 @@ "use strict"; | ||
var _this = this; | ||
if (!key) { | ||
return Promise.reject("参数代码不存在!"); | ||
} | ||
var value = this.__cache.get(key); | ||
@@ -19,0 +22,0 @@ if (!value) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var client_1 = require("./core/client"); | ||
var system_1 = require("./core/system"); | ||
@@ -15,2 +16,23 @@ var IMedx = /** @class */ (function () { | ||
/** | ||
* | ||
* @param clientInfo 设置客户端信息 | ||
* { | ||
* "hostName": "wenbei", | ||
* "spellCode": "YM", | ||
* "macAddress": "00:FF:12:A8:9F:33;80:38:FB:54:33:50", | ||
* "orgName": "淮南市第五人民医院", | ||
* "name": "文贝", | ||
* "clientInfo": "Windows 10 Home China\nwin10-x86\nMicrosoft Windows 10.0.19045", | ||
* "strokeCode": null, | ||
* "remark": null, | ||
* "id": "sedn2v7gjos0", | ||
* "orgId": "700340400001", | ||
* "ipAddr": "192.168.1.125", | ||
* "standardCode": "H34040600151" | ||
*} | ||
*/ | ||
IMedx.setClient = function (clientInfo) { | ||
this.clientInfo = clientInfo; | ||
}; | ||
/** | ||
* 传过来的axios实例 | ||
@@ -23,2 +45,6 @@ */ | ||
IMedx.system = new system_1.default(); | ||
/** | ||
* 客户端操作 | ||
*/ | ||
IMedx.client = new client_1.default(); | ||
return IMedx; | ||
@@ -25,0 +51,0 @@ }()); |
@@ -0,1 +1,3 @@ | ||
import Client from './core/client'; | ||
import ClientInfo from './core/client-info'; | ||
import System from './core/system'; | ||
@@ -8,2 +10,6 @@ export default class IMedx { | ||
/** | ||
* 传过来的client实例 | ||
*/ | ||
static clientInfo: ClientInfo; | ||
/** | ||
* 设置 request 请求 | ||
@@ -15,5 +21,28 @@ */ | ||
/** | ||
* | ||
* @param clientInfo 设置客户端信息 | ||
* { | ||
* "hostName": "wenbei", | ||
* "spellCode": "YM", | ||
* "macAddress": "00:FF:12:A8:9F:33;80:38:FB:54:33:50", | ||
* "orgName": "淮南市第五人民医院", | ||
* "name": "文贝", | ||
* "clientInfo": "Windows 10 Home China\nwin10-x86\nMicrosoft Windows 10.0.19045", | ||
* "strokeCode": null, | ||
* "remark": null, | ||
* "id": "sedn2v7gjos0", | ||
* "orgId": "700340400001", | ||
* "ipAddr": "192.168.1.125", | ||
* "standardCode": "H34040600151" | ||
*} | ||
*/ | ||
static setClient(clientInfo: ClientInfo): void; | ||
/** | ||
* 系统参数 | ||
*/ | ||
static system: System; | ||
/** | ||
* 客户端操作 | ||
*/ | ||
static client: Client; | ||
} |
@@ -6,3 +6,3 @@ { | ||
"title": "iMedx", | ||
"version": "0.0.1-beta.4", | ||
"version": "0.0.1-beta.5", | ||
"description": "iMedx核心功能js封装", | ||
@@ -96,2 +96,3 @@ "author": "文贝", | ||
"@rollup/plugin-commonjs": "^24.1.0", | ||
"@rollup/plugin-html": "^1.0.2", | ||
"@rollup/plugin-json": "^6.0.0", | ||
@@ -101,6 +102,2 @@ "@rollup/plugin-node-resolve": "^15.0.2", | ||
"@rollup/plugin-typescript": "^11.1.0", | ||
"@rollup/plugin-html": "^1.0.2", | ||
"rollup-plugin-livereload": "^2.0.5", | ||
"rollup-plugin-sass": "^1.12.19", | ||
"rollup-plugin-serve": "^2.0.2", | ||
"@types/jest": "^23.3.2", | ||
@@ -128,2 +125,5 @@ "@types/node": "^10.11.0", | ||
"rollup": "^3.20.6", | ||
"rollup-plugin-livereload": "^2.0.5", | ||
"rollup-plugin-sass": "^1.12.19", | ||
"rollup-plugin-serve": "^2.0.2", | ||
"rollup-plugin-sourcemaps": "^0.6.3", | ||
@@ -143,4 +143,6 @@ "semantic-release": "^15.9.16", | ||
"dependencies": { | ||
"@icreate/ics-chromely-js-sdk": "^0.0.7-beat.5", | ||
"@icreate/ics-chromely-plugin-report-js-sdk": "^0.0.9-beta.2", | ||
"vue": "^2.7.14" | ||
} | ||
} |
136
README.md
@@ -39,2 +39,7 @@ ### Usage | ||
public static system: System | ||
/** | ||
* 客户端操作 | ||
*/ | ||
public static client: Client | ||
@@ -54,2 +59,14 @@ ``` | ||
### Client 客户端操作类 | ||
```javascript | ||
/** | ||
* 客户端报表打印 | ||
*/ | ||
public report = Report | ||
``` | ||
### Param 参数类 | ||
@@ -77,1 +94,120 @@ | ||
``` | ||
### Report 参数类 | ||
```javascript | ||
/** | ||
* 获取打印机名称 | ||
* @param name 报表名称 | ||
* @param expirationTime 过期时间-秒 | ||
* @returns 打印机名称 | ||
*/ | ||
public getPrinterName(name: string, expirationTime: number = 12 * 60 * 60): Promise<any> | ||
/** | ||
* 清空数据源 | ||
* @returns void | ||
*/ | ||
public clearData(): Promise<any> | ||
/** | ||
* 注册数据源 | ||
* @param name 数据源名称 | ||
* @param data 数据 | ||
* @param field 指定字段对应类型 默认所有字段类型为string | ||
* 可指定 string|bool|date|datetime|decimal|double|float|int|long|object|short | ||
* 格式: {"id":"string","flag":"int","birthday":"date","total":"decimal"} | ||
* @returns | ||
*/ | ||
public registerData(name: string, data: Array<any>, field: object): Promise<any> | ||
/** | ||
* 设置双面打印 | ||
* @param value true双面打印 false非双面打印 | ||
* @returns | ||
*/ | ||
public doublePass(value: Boolean): Promise<any> | ||
/** | ||
* 指定文件加载报表 | ||
* @param fileName frx文件名称,默认程序根目录下report文件夹下面文件 | ||
* @returns | ||
*/ | ||
public load(fileName: string): Promise<any> | ||
/** | ||
* 根据Id加载报表,暂时没有启用 | ||
* @param reportId 报表Id | ||
* @returns | ||
*/ | ||
public loadFromId(reportId: string): Promise<any> | ||
/** | ||
* 导出pdf | ||
* @param fileName 文件名称,如果不传则返回流 | ||
* @returns 文件或者文件流 | ||
*/ | ||
public ExportToPdf(fileName: string): Promise<any> | ||
/** | ||
* 导出html | ||
* @param fileName 文件名称,如果不传则返回流 | ||
* @returns 文件或者文件流 | ||
*/ | ||
public exportToHtml(fileName: string): Promise<any> | ||
/** | ||
* 准备报表 | ||
* @param append 是否追加 | ||
* @returns | ||
*/ | ||
public prepare(append?: Boolean): Promise<any> | ||
/** | ||
* 添加报表参数 | ||
* @param name 参数名称 | ||
* @param value 参数值 | ||
* @returns | ||
*/ | ||
public addParameter(name: string, value: string): Promise<any> | ||
/** | ||
* 设计报表 | ||
* @returns | ||
*/ | ||
public design(): Promise<any> | ||
/** | ||
* 预览报表 | ||
* @returns | ||
*/ | ||
public show(printerName?: string): Promise<any> | ||
/** | ||
* 预览准备报表 | ||
* @returns | ||
*/ | ||
public showPrepared(printerName?: string): Promise<any> | ||
/** | ||
* 打印报表 | ||
* @param printerName | ||
* @returns | ||
*/ | ||
public print(printerName?: string): Promise<any> | ||
/** | ||
* 打印准备报表 | ||
* @param printerName | ||
* @returns | ||
*/ | ||
public printPrepared(printerName?: string): Promise<any> | ||
/** | ||
* 释放报表 | ||
* @returns | ||
*/ | ||
public dispose(): Promise<any> | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91977
38
771
211
3
1
+ Added@icreate/ics-chromely-plugin-report-js-sdk@^0.0.9-beta.2
+ Added@icreate/core@0.0.15(transitive)
+ Added@icreate/ics-chromely-js-sdk@0.0.7(transitive)
+ Added@icreate/ics-chromely-plugin-report-js-sdk@0.0.9(transitive)