tplus-components-touch 3.28.1 → 3.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/billSearch/index.js +17 -155
- package/dist/components/billSearch/index.js.map +1 -1
- package/dist/components/billSearch/index.less +3 -6
- package/dist/components/cloudPrint/api.js +43 -85
- package/dist/components/cloudPrint/api.js.map +1 -1
- package/dist/components/cloudPrint/index.js +57 -4
- package/dist/components/cloudPrint/index.js.map +1 -1
- package/dist/components/cloudPrint/printDispatch.js +108 -209
- package/dist/components/cloudPrint/printDispatch.js.map +1 -1
- package/dist/components/deliverySearch/index.js +12 -8
- package/dist/components/deliverySearch/index.js.map +1 -1
- package/dist/components/input/scanInput.js +98 -0
- package/dist/components/input/scanInput.js.map +1 -0
- package/dist/components/input/scanInput.less +28 -0
- package/dist/components/inventorySearch/store.js +31 -12
- package/dist/components/inventorySearch/store.js.map +1 -1
- package/dist/components/inventorySearch/tab.js +70 -80
- package/dist/components/inventorySearch/tab.js.map +1 -1
- package/dist/components/loading/loadingContent.js +13 -4
- package/dist/components/loading/loadingContent.js.map +1 -1
- package/dist/components/loading/style.less +17 -6
- package/dist/components/message/index.js +8 -5
- package/dist/components/message/index.js.map +1 -1
- package/dist/components/settlement/settlement.js +5 -8
- package/dist/components/settlement/settlement.js.map +1 -1
- package/dist/components/settlement/settlementStore.js +85 -96
- package/dist/components/settlement/settlementStore.js.map +1 -1
- package/dist/components/socket/index.js +6 -5
- package/dist/components/socket/index.js.map +1 -1
- package/dist/components/ticon/iconfont/demo_index.html +5202 -5202
- package/dist/components/ticon/iconfont/iconfont.css +887 -887
- package/dist/components/ticon/iconfont/iconfont.json +1535 -1535
- package/dist/index.js +7 -14
- package/dist/index.js.map +1 -1
- package/dist/util/tools.js +5 -7
- package/dist/util/tools.js.map +1 -1
- package/package.json +2 -2
|
@@ -170,22 +170,23 @@ var Socket = function () {
|
|
|
170
170
|
key: 'socketAuth',
|
|
171
171
|
value: function () {
|
|
172
172
|
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
|
|
173
|
-
var _ref3, orgId,
|
|
173
|
+
var _ref3, orgId, loginInfo, SignalRServerHost, CiaToken, accountId, token, PosId, storeID, appKey, params;
|
|
174
174
|
|
|
175
175
|
return _regenerator2.default.wrap(function _callee$(_context) {
|
|
176
176
|
while (1) {
|
|
177
177
|
switch (_context.prev = _context.next) {
|
|
178
178
|
case 0:
|
|
179
|
-
_ref3 = _mutantsMicrofx.
|
|
179
|
+
_ref3 = _mutantsMicrofx.stores.user || {}, orgId = _ref3.orgId;
|
|
180
|
+
loginInfo = _mutantsMicrofx.stores.user.options.get('loginInfo');
|
|
180
181
|
SignalRServerHost = loginInfo.SignalRServerHost, CiaToken = loginInfo.CiaToken, accountId = loginInfo.enterpriseUniqId, token = loginInfo.SignalRToken, PosId = loginInfo.PosId, storeID = loginInfo.storeID, appKey = loginInfo.CloudServerAppKey;
|
|
181
182
|
params = { accountId: accountId, token: token, PosId: PosId, storeID: storeID, orgId: orgId, appKey: appKey, CiaToken: CiaToken };
|
|
182
|
-
_context.next =
|
|
183
|
+
_context.next = 6;
|
|
183
184
|
return _axios2.default.get(SignalRServerHost + '/api/auth/GetAccessToken', { params: params });
|
|
184
185
|
|
|
185
|
-
case
|
|
186
|
+
case 6:
|
|
186
187
|
return _context.abrupt('return', _context.sent);
|
|
187
188
|
|
|
188
|
-
case
|
|
189
|
+
case 7:
|
|
189
190
|
case 'end':
|
|
190
191
|
return _context.stop();
|
|
191
192
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/socket/index.js"],"names":["signalR","Socket","host","path","connected","error","reconnect","token","connection","_init","on","stop","throttle","HubConnectionBuilder","withUrl","accessTokenFactory","configureLogging","LogLevel","Information","build","start","then","catch","_error","err","onclose","console","options","reInit","forEach","key","type","func","params","invoke","stoped","fn","gapTime","_lastTime","_nowTime","Date","
|
|
1
|
+
{"version":3,"sources":["tplus-components-touch/components/socket/index.js"],"names":["signalR","Socket","host","path","connected","error","reconnect","token","connection","_init","on","stop","throttle","HubConnectionBuilder","withUrl","accessTokenFactory","configureLogging","LogLevel","Information","build","start","then","catch","_error","err","onclose","console","options","reInit","forEach","key","type","func","params","invoke","stoped","fn","gapTime","_lastTime","_nowTime","Date","stores","user","orgId","loginInfo","get","SignalRServerHost","CiaToken","accountId","enterpriseUniqId","SignalRToken","PosId","storeID","appKey","CloudServerAppKey","axios"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;;IAAYA,O;;AACZ;;;;AACA;;;;;;IAEqBC,M;AACjB,0BAAgE;AAAA,YAAlDC,IAAkD,QAAlDA,IAAkD;AAAA,YAA5CC,IAA4C,QAA5CA,IAA4C;AAAA,YAAtCC,SAAsC,QAAtCA,SAAsC;AAAA,YAA3BC,KAA2B,QAA3BA,KAA2B;AAAA,YAApBC,SAAoB,QAApBA,SAAoB;AAAA,YAATC,KAAS,QAATA,KAAS;AAAA;;AAC5D,aAAKL,IAAL,GAAYA,IAAZ;AACA,aAAKC,IAAL,GAAYA,IAAZ;AACA,aAAKI,KAAL,GAAaA,KAAb;AACA,aAAKH,SAAL,GAAiBA,aAAc,YAAM,CAAG,CAAxC;AACA,aAAKE,SAAL,GAAiBA,aAAc,YAAM,CAAG,CAAxC;AACA,aAAKD,KAAL,GAAaA,SAAU,YAAM,CAAG,CAAhC;AACA,aAAKG,UAAL,GAAkB,KAAKC,KAAL,EAAlB;AACA,aAAKC,EAAL,GAAU,KAAKA,EAAf;AACA,aAAKC,IAAL,GAAY,KAAKA,IAAjB;AACA,aAAKC,QAAL,GAAgB,KAAKA,QAArB;AACH;;;;gCAEO;AAAA;;AACJ,gBAAMJ,aAAa,IAAIR,QAAQa,oBAAZ,GACdC,OADc,MACH,KAAKZ,IADF,GACS,KAAKC,IADd,EACsB;AACjCY,oCAAoB;AAAA,2BAAM,MAAKR,KAAX;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Ab,EAAoB4C,YAApB,EAA2BC,gBAA3B,EAAoCT,YAApC,EAA2CU,cAA3C,EAAmDN,kBAAnD,E;;uCACFQ,gBAAMV,GAAN,CAAaC,iBAAb,+BAA0D,EAAEb,cAAF,EAA1D,C;;;;;;;;;;;;;;;;;;;;;KApFM;AAb3B;;;;;;;;;;;;;;kBAgBqBhC,M","file":"index.js","sourcesContent":["/**\r\n * host 主机\r\n * path 地址\r\n * connected 连接成功后的回调\r\n * error 错误信息的回调\r\n * reconnect 触发重连的钩子\r\n * updateConfig 触发重连时候 需要在实例化时的reconnect钩子调用该方法,参数 options 为设置新的参数 reInit 为是否重新初始化连接\r\n * send 发送消息\r\n * on 监听推送消息\r\n * stop 停止连接\r\n *\r\n**/\r\nimport * as signalR from '@aspnet/signalr';\r\nimport axios from 'axios'; // cloud server消息推送接口单独使用 不走统一配置\r\nimport { stores, localStore } from 'mutants-microfx';\r\n\r\nexport default class Socket {\r\n constructor({ host, path, connected, error, reconnect, token }) {\r\n this.host = host;\r\n this.path = path;\r\n this.token = token;\r\n this.connected = connected || (() => { });\r\n this.reconnect = reconnect || (() => { });\r\n this.error = error || (() => { });\r\n this.connection = this._init();\r\n this.on = this.on;\r\n this.stop = this.stop;\r\n this.throttle = this.throttle;\r\n }\r\n\r\n _init() {\r\n const connection = new signalR.HubConnectionBuilder()\r\n .withUrl(`${this.host}${this.path}`, {\r\n accessTokenFactory: () => this.token\r\n })\r\n .configureLogging(signalR.LogLevel.Information)\r\n .build();\r\n\r\n connection.start().then(() => this.connected(connection)).catch(err => this._error(err));\r\n connection.onclose(() => this.reconnect(connection));\r\n\r\n return connection;\r\n }\r\n\r\n _error(err) {\r\n console.error('signalR:', err);\r\n this.error(err);\r\n this.throttle(() => {\r\n this.reconnect(this.connection);\r\n }, 3000);\r\n }\r\n\r\n updateConfig(options, reInit) {\r\n if (options && typeof options === 'object') {\r\n Object.keys(options).forEach(key => this[key] = options[key]);\r\n }\r\n if (reInit) {\r\n this.stop(() => {\r\n this.connection = this._init();\r\n });\r\n } else {\r\n this.connection.start().then(() => this.connected(this.connection)).catch(err => this._error(err));\r\n }\r\n }\r\n\r\n on(type, func) {\r\n this.connection.on(type, (...argument) => func(...argument));\r\n }\r\n\r\n send(type, params = [], error) {\r\n this.connection.invoke(type, ...params).catch(err => error && error(err));\r\n }\r\n\r\n stop(func) {\r\n const stoped = () => {\r\n this.connection = null;\r\n func && func();\r\n }\r\n this.connection.stop().then(stoped).catch(stoped);\r\n }\r\n\r\n throttle(fn, gapTime) {\r\n let _lastTime = null;\r\n return function () {\r\n const _nowTime = +new Date();\r\n if (_nowTime - _lastTime > gapTime || !_lastTime) {\r\n fn();\r\n _lastTime = _nowTime;\r\n }\r\n }\r\n }\r\n\r\n static async socketAuth() {\r\n const { orgId } = stores.user || {};\r\n const loginInfo = stores.user.options.get('loginInfo');\r\n const { SignalRServerHost, CiaToken, enterpriseUniqId: accountId, SignalRToken: token, PosId, storeID, CloudServerAppKey: appKey } = loginInfo;\r\n const params = { accountId, token, PosId, storeID, orgId, appKey, CiaToken };\r\n return await axios.get(`${SignalRServerHost}/api/auth/GetAccessToken`, { params });\r\n }\r\n}\r\n"]}
|