nubomed-ui 2.0.49 → 2.0.50

Sign up to get free protection for your applications and to get access to all the features.
@@ -296,6 +296,145 @@ module.exports = function (i) {
296
296
 
297
297
  /***/ }),
298
298
 
299
+ /***/ 4820:
300
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
301
+
302
+ "use strict";
303
+
304
+ // EXPORTS
305
+ __webpack_require__.d(__webpack_exports__, {
306
+ Ay: function() { return /* binding */ locale; },
307
+ t: function() { return /* binding */ t; }
308
+ });
309
+
310
+ // UNUSED EXPORTS: i18n, use
311
+
312
+ ;// ./locale/lang/zh-CN.js
313
+ /*
314
+ * @Author: chenghuan.dong
315
+ * @Date: 2024-11-11 11:59:27
316
+ * @LastEditTime: 2024-11-11 12:00:24
317
+ * @LastEditors: chenghuan.dong
318
+ * @Description:
319
+ * @FilePath: \nubomed-ui\locale\lang\zh-CN.JS
320
+ */
321
+ /* harmony default export */ var zh_CN = ({
322
+ nbUI: {
323
+ name: '品名',
324
+ consumableInfo: '耗材信息',
325
+ spec: '规格',
326
+ model: '型号',
327
+ barcode: '唯一码',
328
+ combineCode: '品规码',
329
+ batch: '批号',
330
+ expiry: '效期',
331
+ count: '数量',
332
+ position: '位置',
333
+ curPosition: '当前位置',
334
+ lastPosition: '上次位置',
335
+ manufacturer: '生产厂家',
336
+ brand: '品牌',
337
+ supplier: '供应商',
338
+ unit: '单位',
339
+ price: '金额',
340
+ unitPrice: '单价',
341
+ // 用户相关
342
+ operation: '操作',
343
+ operator: '操作人',
344
+ operateTime: '操作时间',
345
+ operateType: '操作类型',
346
+ // 按钮相关
347
+ replyDelete: '回删',
348
+ search: '搜索',
349
+ detail: '详情',
350
+ cancel: '取消',
351
+ confirm: '确定',
352
+ known: '知道了',
353
+ refresh: '刷新',
354
+ retest: '重新检测',
355
+ copy: '复制',
356
+ copySuccess: '复制成功',
357
+ inventory: '盘点',
358
+ inventorying: '盘点中...',
359
+ inventorySurplus: '盘盈',
360
+ inventoryLoss: '盘亏',
361
+ inventoryAccount: '账盘',
362
+ inventoryActual: '机盘',
363
+ // 时间
364
+ yesterday: '昨天',
365
+ today: '今天',
366
+ tomorrow: '明天',
367
+ oneWeekAgo: '近一周',
368
+ oneMonthAgo: '近一月',
369
+ clear: '清空',
370
+ startDt: '开始日期',
371
+ endDt: '结束日期',
372
+ // 近效期
373
+ overdue: '过期',
374
+ oneMonth: '1个月',
375
+ threeMonth: '3个月',
376
+ sixMonth: '6个月',
377
+ // 柜
378
+ upCabinet: '上柜',
379
+ downCabinet: '下柜',
380
+ leftCabinet: '左柜',
381
+ rightCabinet: '右柜',
382
+ cabinetUnconnected: '未连接',
383
+ cabinetUnlock: '柜未锁',
384
+ cabinetLock: '柜已锁',
385
+ cabinetUnclosed: '柜未关',
386
+ cabinetClosed: '柜已关',
387
+ // 其它
388
+ temporaryStop: '临时停用',
389
+ loading: '加载中...',
390
+ release: '释放更新',
391
+ pullRefresh: '下拉刷新',
392
+ noMore: '没有更多了',
393
+ noneData: '暂无数据',
394
+ pleaseInputNumber: '请输入数字!'
395
+ }
396
+ });
397
+ ;// ./locale/index.js
398
+
399
+ let lang = zh_CN;
400
+ let i18nHandler = function () {
401
+ const vuei18n = Object.getPrototypeOf(this).$t;
402
+ if (typeof vuei18n === 'function') {
403
+ return vuei18n.apply(this, arguments);
404
+ }
405
+ };
406
+
407
+ // eslint-disable-next-line no-unused-vars
408
+ const t = function (path, options) {
409
+ let value = i18nHandler.apply(this, arguments);
410
+ if (value !== null && typeof value !== 'undefined') {
411
+ return value;
412
+ }
413
+ const array = path.split('.');
414
+ let current = lang;
415
+ for (let i = 0, j = array.length; i < j; i++) {
416
+ const property = array[i];
417
+ value = current[property];
418
+ if (i === j - 1) return value;
419
+ if (!value) return '';
420
+ current = value;
421
+ }
422
+ return '';
423
+ };
424
+ const use = function (l) {
425
+ lang = l || lang;
426
+ };
427
+ const i18n = function (fn) {
428
+ i18nHandler = fn || i18nHandler;
429
+ };
430
+ /* harmony default export */ var locale = ({
431
+ use,
432
+ t,
433
+ i18n
434
+ });
435
+
436
+ /***/ }),
437
+
299
438
  /***/ 3250:
300
439
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
301
440
 
@@ -768,65 +907,1339 @@ var staticRenderFns = []
768
907
  this.$emit('closed');
769
908
  }
770
909
  }
771
- });
772
- ;// ./packages/components/NBDialog/src/index.vue?vue&type=script&lang=js
773
- /* harmony default export */ var NBDialog_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
774
- // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
775
- var componentNormalizer = __webpack_require__(1656);
776
- ;// ./packages/components/NBDialog/src/index.vue
910
+ });
911
+ ;// ./packages/components/NBDialog/src/index.vue?vue&type=script&lang=js
912
+ /* harmony default export */ var NBDialog_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
913
+ // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
914
+ var componentNormalizer = __webpack_require__(1656);
915
+ ;// ./packages/components/NBDialog/src/index.vue
916
+
917
+
918
+
919
+
920
+
921
+ /* normalize component */
922
+ ;
923
+ var component = (0,componentNormalizer/* default */.A)(
924
+ NBDialog_srcvue_type_script_lang_js,
925
+ render,
926
+ staticRenderFns,
927
+ false,
928
+ null,
929
+ "c64765f8",
930
+ null
931
+
932
+ )
933
+
934
+ /* harmony default export */ var src = (component.exports);
935
+ ;// ./packages/components/NBDialog/index.js
936
+
937
+ src.install = function (Vue) {
938
+ Vue.component(src.name, src);
939
+ };
940
+ /* harmony default export */ var NBDialog = (src);
941
+
942
+ /***/ }),
943
+
944
+ /***/ 4400:
945
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
946
+
947
+ "use strict";
948
+ // ESM COMPAT FLAG
949
+ __webpack_require__.r(__webpack_exports__);
950
+
951
+ // EXPORTS
952
+ __webpack_require__.d(__webpack_exports__, {
953
+ "default": function() { return /* binding */ NBEmpty; }
954
+ });
955
+
956
+ ;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/components/NBEmpty/src/index.vue?vue&type=template&id=10fa1586
957
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"nb-empty",class:[("nb-empty--" + _vm.size), _vm.center ? 'nb-empty--center' : '']},[(_vm.icon)?_c('img',{staticClass:"nb-empty__icon",attrs:{"src":__webpack_require__(1603)("./empty-" + _vm.icon + ".png")}}):_vm._e(),(_vm.text)?_c('div',{staticClass:"nb-empty__text"},[_vm._v(_vm._s(_vm.text))]):_vm._e(),(_vm.tips)?_c('div',{staticClass:"nb-empty__tips"},[_vm._v(_vm._s(_vm.tips))]):_vm._e(),_vm._t("default")],2)}
958
+ var staticRenderFns = []
959
+
960
+
961
+ ;// ./packages/components/NBEmpty/src/index.vue?vue&type=template&id=10fa1586
962
+
963
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/components/NBEmpty/src/index.vue?vue&type=script&lang=js
964
+ //
965
+ //
966
+ //
967
+ //
968
+ //
969
+ //
970
+ //
971
+ //
972
+ //
973
+ //
974
+ //
975
+ //
976
+ //
977
+ //
978
+ //
979
+ //
980
+ //
981
+
982
+ /* harmony default export */ var srcvue_type_script_lang_js = ({
983
+ name: 'NBEmpty',
984
+ // 无数据
985
+ props: {
986
+ // 图标 none-无数据,search-搜索提示,error-异常,scan-扫码
987
+ icon: {
988
+ type: String,
989
+ default: 'none'
990
+ },
991
+ // 提示文字
992
+ text: {
993
+ type: String,
994
+ default: ''
995
+ },
996
+ // 提示语,绿色字体
997
+ tips: {
998
+ type: String,
999
+ default: ''
1000
+ },
1001
+ // 尺寸:默认大尺寸(图标500*500),small-小尺寸(图标300*300)
1002
+ size: {
1003
+ type: String,
1004
+ default: 'large'
1005
+ },
1006
+ // 是否居中
1007
+ center: {
1008
+ type: Boolean,
1009
+ default: true
1010
+ }
1011
+ }
1012
+ });
1013
+ ;// ./packages/components/NBEmpty/src/index.vue?vue&type=script&lang=js
1014
+ /* harmony default export */ var NBEmpty_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
1015
+ // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
1016
+ var componentNormalizer = __webpack_require__(1656);
1017
+ ;// ./packages/components/NBEmpty/src/index.vue
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+ /* normalize component */
1024
+ ;
1025
+ var component = (0,componentNormalizer/* default */.A)(
1026
+ NBEmpty_srcvue_type_script_lang_js,
1027
+ render,
1028
+ staticRenderFns,
1029
+ false,
1030
+ null,
1031
+ null,
1032
+ null
1033
+
1034
+ )
1035
+
1036
+ /* harmony default export */ var src = (component.exports);
1037
+ ;// ./packages/components/NBEmpty/index.js
1038
+
1039
+ src.install = function (Vue) {
1040
+ Vue.component(src.name, src);
1041
+ };
1042
+ /* harmony default export */ var NBEmpty = (src);
1043
+
1044
+ /***/ }),
1045
+
1046
+ /***/ 2416:
1047
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1048
+
1049
+ "use strict";
1050
+ // ESM COMPAT FLAG
1051
+ __webpack_require__.r(__webpack_exports__);
1052
+
1053
+ // EXPORTS
1054
+ __webpack_require__.d(__webpack_exports__, {
1055
+ "default": function() { return /* binding */ NBExpiryIcon; }
1056
+ });
1057
+
1058
+ ;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/components/NBExpiryIcon/src/index.vue?vue&type=template&id=39febcbf&scoped=true
1059
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.icon)?_c('span',{staticClass:"nb-expiry-icon",class:("nb-expiry-icon--" + _vm.value)},[_vm._v(_vm._s(_vm.icon))]):_vm._e()}
1060
+ var staticRenderFns = []
1061
+
1062
+
1063
+ ;// ./node_modules/vuex/dist/vuex.esm.js
1064
+ /*!
1065
+ * vuex v3.6.2
1066
+ * (c) 2021 Evan You
1067
+ * @license MIT
1068
+ */
1069
+ function applyMixin (Vue) {
1070
+ var version = Number(Vue.version.split('.')[0]);
1071
+
1072
+ if (version >= 2) {
1073
+ Vue.mixin({ beforeCreate: vuexInit });
1074
+ } else {
1075
+ // override init and inject vuex init procedure
1076
+ // for 1.x backwards compatibility.
1077
+ var _init = Vue.prototype._init;
1078
+ Vue.prototype._init = function (options) {
1079
+ if ( options === void 0 ) options = {};
1080
+
1081
+ options.init = options.init
1082
+ ? [vuexInit].concat(options.init)
1083
+ : vuexInit;
1084
+ _init.call(this, options);
1085
+ };
1086
+ }
1087
+
1088
+ /**
1089
+ * Vuex init hook, injected into each instances init hooks list.
1090
+ */
1091
+
1092
+ function vuexInit () {
1093
+ var options = this.$options;
1094
+ // store injection
1095
+ if (options.store) {
1096
+ this.$store = typeof options.store === 'function'
1097
+ ? options.store()
1098
+ : options.store;
1099
+ } else if (options.parent && options.parent.$store) {
1100
+ this.$store = options.parent.$store;
1101
+ }
1102
+ }
1103
+ }
1104
+
1105
+ var target = typeof window !== 'undefined'
1106
+ ? window
1107
+ : typeof __webpack_require__.g !== 'undefined'
1108
+ ? __webpack_require__.g
1109
+ : {};
1110
+ var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
1111
+
1112
+ function devtoolPlugin (store) {
1113
+ if (!devtoolHook) { return }
1114
+
1115
+ store._devtoolHook = devtoolHook;
1116
+
1117
+ devtoolHook.emit('vuex:init', store);
1118
+
1119
+ devtoolHook.on('vuex:travel-to-state', function (targetState) {
1120
+ store.replaceState(targetState);
1121
+ });
1122
+
1123
+ store.subscribe(function (mutation, state) {
1124
+ devtoolHook.emit('vuex:mutation', mutation, state);
1125
+ }, { prepend: true });
1126
+
1127
+ store.subscribeAction(function (action, state) {
1128
+ devtoolHook.emit('vuex:action', action, state);
1129
+ }, { prepend: true });
1130
+ }
1131
+
1132
+ /**
1133
+ * Get the first item that pass the test
1134
+ * by second argument function
1135
+ *
1136
+ * @param {Array} list
1137
+ * @param {Function} f
1138
+ * @return {*}
1139
+ */
1140
+ function find (list, f) {
1141
+ return list.filter(f)[0]
1142
+ }
1143
+
1144
+ /**
1145
+ * Deep copy the given object considering circular structure.
1146
+ * This function caches all nested objects and its copies.
1147
+ * If it detects circular structure, use cached copy to avoid infinite loop.
1148
+ *
1149
+ * @param {*} obj
1150
+ * @param {Array<Object>} cache
1151
+ * @return {*}
1152
+ */
1153
+ function deepCopy (obj, cache) {
1154
+ if ( cache === void 0 ) cache = [];
1155
+
1156
+ // just return if obj is immutable value
1157
+ if (obj === null || typeof obj !== 'object') {
1158
+ return obj
1159
+ }
1160
+
1161
+ // if obj is hit, it is in circular structure
1162
+ var hit = find(cache, function (c) { return c.original === obj; });
1163
+ if (hit) {
1164
+ return hit.copy
1165
+ }
1166
+
1167
+ var copy = Array.isArray(obj) ? [] : {};
1168
+ // put the copy into cache at first
1169
+ // because we want to refer it in recursive deepCopy
1170
+ cache.push({
1171
+ original: obj,
1172
+ copy: copy
1173
+ });
1174
+
1175
+ Object.keys(obj).forEach(function (key) {
1176
+ copy[key] = deepCopy(obj[key], cache);
1177
+ });
1178
+
1179
+ return copy
1180
+ }
1181
+
1182
+ /**
1183
+ * forEach for object
1184
+ */
1185
+ function forEachValue (obj, fn) {
1186
+ Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
1187
+ }
1188
+
1189
+ function isObject (obj) {
1190
+ return obj !== null && typeof obj === 'object'
1191
+ }
1192
+
1193
+ function isPromise (val) {
1194
+ return val && typeof val.then === 'function'
1195
+ }
1196
+
1197
+ function assert (condition, msg) {
1198
+ if (!condition) { throw new Error(("[vuex] " + msg)) }
1199
+ }
1200
+
1201
+ function partial (fn, arg) {
1202
+ return function () {
1203
+ return fn(arg)
1204
+ }
1205
+ }
1206
+
1207
+ // Base data struct for store's module, package with some attribute and method
1208
+ var Module = function Module (rawModule, runtime) {
1209
+ this.runtime = runtime;
1210
+ // Store some children item
1211
+ this._children = Object.create(null);
1212
+ // Store the origin module object which passed by programmer
1213
+ this._rawModule = rawModule;
1214
+ var rawState = rawModule.state;
1215
+
1216
+ // Store the origin module's state
1217
+ this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
1218
+ };
1219
+
1220
+ var prototypeAccessors = { namespaced: { configurable: true } };
1221
+
1222
+ prototypeAccessors.namespaced.get = function () {
1223
+ return !!this._rawModule.namespaced
1224
+ };
1225
+
1226
+ Module.prototype.addChild = function addChild (key, module) {
1227
+ this._children[key] = module;
1228
+ };
1229
+
1230
+ Module.prototype.removeChild = function removeChild (key) {
1231
+ delete this._children[key];
1232
+ };
1233
+
1234
+ Module.prototype.getChild = function getChild (key) {
1235
+ return this._children[key]
1236
+ };
1237
+
1238
+ Module.prototype.hasChild = function hasChild (key) {
1239
+ return key in this._children
1240
+ };
1241
+
1242
+ Module.prototype.update = function update (rawModule) {
1243
+ this._rawModule.namespaced = rawModule.namespaced;
1244
+ if (rawModule.actions) {
1245
+ this._rawModule.actions = rawModule.actions;
1246
+ }
1247
+ if (rawModule.mutations) {
1248
+ this._rawModule.mutations = rawModule.mutations;
1249
+ }
1250
+ if (rawModule.getters) {
1251
+ this._rawModule.getters = rawModule.getters;
1252
+ }
1253
+ };
1254
+
1255
+ Module.prototype.forEachChild = function forEachChild (fn) {
1256
+ forEachValue(this._children, fn);
1257
+ };
1258
+
1259
+ Module.prototype.forEachGetter = function forEachGetter (fn) {
1260
+ if (this._rawModule.getters) {
1261
+ forEachValue(this._rawModule.getters, fn);
1262
+ }
1263
+ };
1264
+
1265
+ Module.prototype.forEachAction = function forEachAction (fn) {
1266
+ if (this._rawModule.actions) {
1267
+ forEachValue(this._rawModule.actions, fn);
1268
+ }
1269
+ };
1270
+
1271
+ Module.prototype.forEachMutation = function forEachMutation (fn) {
1272
+ if (this._rawModule.mutations) {
1273
+ forEachValue(this._rawModule.mutations, fn);
1274
+ }
1275
+ };
1276
+
1277
+ Object.defineProperties( Module.prototype, prototypeAccessors );
1278
+
1279
+ var ModuleCollection = function ModuleCollection (rawRootModule) {
1280
+ // register root module (Vuex.Store options)
1281
+ this.register([], rawRootModule, false);
1282
+ };
1283
+
1284
+ ModuleCollection.prototype.get = function get (path) {
1285
+ return path.reduce(function (module, key) {
1286
+ return module.getChild(key)
1287
+ }, this.root)
1288
+ };
1289
+
1290
+ ModuleCollection.prototype.getNamespace = function getNamespace (path) {
1291
+ var module = this.root;
1292
+ return path.reduce(function (namespace, key) {
1293
+ module = module.getChild(key);
1294
+ return namespace + (module.namespaced ? key + '/' : '')
1295
+ }, '')
1296
+ };
1297
+
1298
+ ModuleCollection.prototype.update = function update$1 (rawRootModule) {
1299
+ update([], this.root, rawRootModule);
1300
+ };
1301
+
1302
+ ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
1303
+ var this$1 = this;
1304
+ if ( runtime === void 0 ) runtime = true;
1305
+
1306
+ if ((false)) {}
1307
+
1308
+ var newModule = new Module(rawModule, runtime);
1309
+ if (path.length === 0) {
1310
+ this.root = newModule;
1311
+ } else {
1312
+ var parent = this.get(path.slice(0, -1));
1313
+ parent.addChild(path[path.length - 1], newModule);
1314
+ }
1315
+
1316
+ // register nested modules
1317
+ if (rawModule.modules) {
1318
+ forEachValue(rawModule.modules, function (rawChildModule, key) {
1319
+ this$1.register(path.concat(key), rawChildModule, runtime);
1320
+ });
1321
+ }
1322
+ };
1323
+
1324
+ ModuleCollection.prototype.unregister = function unregister (path) {
1325
+ var parent = this.get(path.slice(0, -1));
1326
+ var key = path[path.length - 1];
1327
+ var child = parent.getChild(key);
1328
+
1329
+ if (!child) {
1330
+ if ((false)) {}
1331
+ return
1332
+ }
1333
+
1334
+ if (!child.runtime) {
1335
+ return
1336
+ }
1337
+
1338
+ parent.removeChild(key);
1339
+ };
1340
+
1341
+ ModuleCollection.prototype.isRegistered = function isRegistered (path) {
1342
+ var parent = this.get(path.slice(0, -1));
1343
+ var key = path[path.length - 1];
1344
+
1345
+ if (parent) {
1346
+ return parent.hasChild(key)
1347
+ }
1348
+
1349
+ return false
1350
+ };
1351
+
1352
+ function update (path, targetModule, newModule) {
1353
+ if ((false)) {}
1354
+
1355
+ // update target module
1356
+ targetModule.update(newModule);
1357
+
1358
+ // update nested modules
1359
+ if (newModule.modules) {
1360
+ for (var key in newModule.modules) {
1361
+ if (!targetModule.getChild(key)) {
1362
+ if ((false)) {}
1363
+ return
1364
+ }
1365
+ update(
1366
+ path.concat(key),
1367
+ targetModule.getChild(key),
1368
+ newModule.modules[key]
1369
+ );
1370
+ }
1371
+ }
1372
+ }
1373
+
1374
+ var functionAssert = {
1375
+ assert: function (value) { return typeof value === 'function'; },
1376
+ expected: 'function'
1377
+ };
1378
+
1379
+ var objectAssert = {
1380
+ assert: function (value) { return typeof value === 'function' ||
1381
+ (typeof value === 'object' && typeof value.handler === 'function'); },
1382
+ expected: 'function or object with "handler" function'
1383
+ };
1384
+
1385
+ var assertTypes = {
1386
+ getters: functionAssert,
1387
+ mutations: functionAssert,
1388
+ actions: objectAssert
1389
+ };
1390
+
1391
+ function assertRawModule (path, rawModule) {
1392
+ Object.keys(assertTypes).forEach(function (key) {
1393
+ if (!rawModule[key]) { return }
1394
+
1395
+ var assertOptions = assertTypes[key];
1396
+
1397
+ forEachValue(rawModule[key], function (value, type) {
1398
+ assert(
1399
+ assertOptions.assert(value),
1400
+ makeAssertionMessage(path, key, type, value, assertOptions.expected)
1401
+ );
1402
+ });
1403
+ });
1404
+ }
1405
+
1406
+ function makeAssertionMessage (path, key, type, value, expected) {
1407
+ var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
1408
+ if (path.length > 0) {
1409
+ buf += " in module \"" + (path.join('.')) + "\"";
1410
+ }
1411
+ buf += " is " + (JSON.stringify(value)) + ".";
1412
+ return buf
1413
+ }
1414
+
1415
+ var Vue; // bind on install
1416
+
1417
+ var Store = function Store (options) {
1418
+ var this$1 = this;
1419
+ if ( options === void 0 ) options = {};
1420
+
1421
+ // Auto install if it is not done yet and `window` has `Vue`.
1422
+ // To allow users to avoid auto-installation in some cases,
1423
+ // this code should be placed here. See #731
1424
+ if (!Vue && typeof window !== 'undefined' && window.Vue) {
1425
+ install(window.Vue);
1426
+ }
1427
+
1428
+ if ((false)) {}
1429
+
1430
+ var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
1431
+ var strict = options.strict; if ( strict === void 0 ) strict = false;
1432
+
1433
+ // store internal state
1434
+ this._committing = false;
1435
+ this._actions = Object.create(null);
1436
+ this._actionSubscribers = [];
1437
+ this._mutations = Object.create(null);
1438
+ this._wrappedGetters = Object.create(null);
1439
+ this._modules = new ModuleCollection(options);
1440
+ this._modulesNamespaceMap = Object.create(null);
1441
+ this._subscribers = [];
1442
+ this._watcherVM = new Vue();
1443
+ this._makeLocalGettersCache = Object.create(null);
1444
+
1445
+ // bind commit and dispatch to self
1446
+ var store = this;
1447
+ var ref = this;
1448
+ var dispatch = ref.dispatch;
1449
+ var commit = ref.commit;
1450
+ this.dispatch = function boundDispatch (type, payload) {
1451
+ return dispatch.call(store, type, payload)
1452
+ };
1453
+ this.commit = function boundCommit (type, payload, options) {
1454
+ return commit.call(store, type, payload, options)
1455
+ };
1456
+
1457
+ // strict mode
1458
+ this.strict = strict;
1459
+
1460
+ var state = this._modules.root.state;
1461
+
1462
+ // init root module.
1463
+ // this also recursively registers all sub-modules
1464
+ // and collects all module getters inside this._wrappedGetters
1465
+ installModule(this, state, [], this._modules.root);
1466
+
1467
+ // initialize the store vm, which is responsible for the reactivity
1468
+ // (also registers _wrappedGetters as computed properties)
1469
+ resetStoreVM(this, state);
1470
+
1471
+ // apply plugins
1472
+ plugins.forEach(function (plugin) { return plugin(this$1); });
1473
+
1474
+ var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
1475
+ if (useDevtools) {
1476
+ devtoolPlugin(this);
1477
+ }
1478
+ };
1479
+
1480
+ var prototypeAccessors$1 = { state: { configurable: true } };
1481
+
1482
+ prototypeAccessors$1.state.get = function () {
1483
+ return this._vm._data.$$state
1484
+ };
1485
+
1486
+ prototypeAccessors$1.state.set = function (v) {
1487
+ if ((false)) {}
1488
+ };
1489
+
1490
+ Store.prototype.commit = function commit (_type, _payload, _options) {
1491
+ var this$1 = this;
1492
+
1493
+ // check object-style commit
1494
+ var ref = unifyObjectStyle(_type, _payload, _options);
1495
+ var type = ref.type;
1496
+ var payload = ref.payload;
1497
+ var options = ref.options;
1498
+
1499
+ var mutation = { type: type, payload: payload };
1500
+ var entry = this._mutations[type];
1501
+ if (!entry) {
1502
+ if ((false)) {}
1503
+ return
1504
+ }
1505
+ this._withCommit(function () {
1506
+ entry.forEach(function commitIterator (handler) {
1507
+ handler(payload);
1508
+ });
1509
+ });
1510
+
1511
+ this._subscribers
1512
+ .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
1513
+ .forEach(function (sub) { return sub(mutation, this$1.state); });
1514
+
1515
+ if (
1516
+ false
1517
+ ) {}
1518
+ };
1519
+
1520
+ Store.prototype.dispatch = function dispatch (_type, _payload) {
1521
+ var this$1 = this;
1522
+
1523
+ // check object-style dispatch
1524
+ var ref = unifyObjectStyle(_type, _payload);
1525
+ var type = ref.type;
1526
+ var payload = ref.payload;
1527
+
1528
+ var action = { type: type, payload: payload };
1529
+ var entry = this._actions[type];
1530
+ if (!entry) {
1531
+ if ((false)) {}
1532
+ return
1533
+ }
1534
+
1535
+ try {
1536
+ this._actionSubscribers
1537
+ .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
1538
+ .filter(function (sub) { return sub.before; })
1539
+ .forEach(function (sub) { return sub.before(action, this$1.state); });
1540
+ } catch (e) {
1541
+ if ((false)) {}
1542
+ }
1543
+
1544
+ var result = entry.length > 1
1545
+ ? Promise.all(entry.map(function (handler) { return handler(payload); }))
1546
+ : entry[0](payload);
1547
+
1548
+ return new Promise(function (resolve, reject) {
1549
+ result.then(function (res) {
1550
+ try {
1551
+ this$1._actionSubscribers
1552
+ .filter(function (sub) { return sub.after; })
1553
+ .forEach(function (sub) { return sub.after(action, this$1.state); });
1554
+ } catch (e) {
1555
+ if ((false)) {}
1556
+ }
1557
+ resolve(res);
1558
+ }, function (error) {
1559
+ try {
1560
+ this$1._actionSubscribers
1561
+ .filter(function (sub) { return sub.error; })
1562
+ .forEach(function (sub) { return sub.error(action, this$1.state, error); });
1563
+ } catch (e) {
1564
+ if ((false)) {}
1565
+ }
1566
+ reject(error);
1567
+ });
1568
+ })
1569
+ };
1570
+
1571
+ Store.prototype.subscribe = function subscribe (fn, options) {
1572
+ return genericSubscribe(fn, this._subscribers, options)
1573
+ };
1574
+
1575
+ Store.prototype.subscribeAction = function subscribeAction (fn, options) {
1576
+ var subs = typeof fn === 'function' ? { before: fn } : fn;
1577
+ return genericSubscribe(subs, this._actionSubscribers, options)
1578
+ };
1579
+
1580
+ Store.prototype.watch = function watch (getter, cb, options) {
1581
+ var this$1 = this;
1582
+
1583
+ if ((false)) {}
1584
+ return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
1585
+ };
1586
+
1587
+ Store.prototype.replaceState = function replaceState (state) {
1588
+ var this$1 = this;
1589
+
1590
+ this._withCommit(function () {
1591
+ this$1._vm._data.$$state = state;
1592
+ });
1593
+ };
1594
+
1595
+ Store.prototype.registerModule = function registerModule (path, rawModule, options) {
1596
+ if ( options === void 0 ) options = {};
1597
+
1598
+ if (typeof path === 'string') { path = [path]; }
1599
+
1600
+ if ((false)) {}
1601
+
1602
+ this._modules.register(path, rawModule);
1603
+ installModule(this, this.state, path, this._modules.get(path), options.preserveState);
1604
+ // reset store to update getters...
1605
+ resetStoreVM(this, this.state);
1606
+ };
1607
+
1608
+ Store.prototype.unregisterModule = function unregisterModule (path) {
1609
+ var this$1 = this;
1610
+
1611
+ if (typeof path === 'string') { path = [path]; }
1612
+
1613
+ if ((false)) {}
1614
+
1615
+ this._modules.unregister(path);
1616
+ this._withCommit(function () {
1617
+ var parentState = getNestedState(this$1.state, path.slice(0, -1));
1618
+ Vue.delete(parentState, path[path.length - 1]);
1619
+ });
1620
+ resetStore(this);
1621
+ };
1622
+
1623
+ Store.prototype.hasModule = function hasModule (path) {
1624
+ if (typeof path === 'string') { path = [path]; }
1625
+
1626
+ if ((false)) {}
1627
+
1628
+ return this._modules.isRegistered(path)
1629
+ };
1630
+
1631
+ Store.prototype.hotUpdate = function hotUpdate (newOptions) {
1632
+ this._modules.update(newOptions);
1633
+ resetStore(this, true);
1634
+ };
1635
+
1636
+ Store.prototype._withCommit = function _withCommit (fn) {
1637
+ var committing = this._committing;
1638
+ this._committing = true;
1639
+ fn();
1640
+ this._committing = committing;
1641
+ };
1642
+
1643
+ Object.defineProperties( Store.prototype, prototypeAccessors$1 );
1644
+
1645
+ function genericSubscribe (fn, subs, options) {
1646
+ if (subs.indexOf(fn) < 0) {
1647
+ options && options.prepend
1648
+ ? subs.unshift(fn)
1649
+ : subs.push(fn);
1650
+ }
1651
+ return function () {
1652
+ var i = subs.indexOf(fn);
1653
+ if (i > -1) {
1654
+ subs.splice(i, 1);
1655
+ }
1656
+ }
1657
+ }
1658
+
1659
+ function resetStore (store, hot) {
1660
+ store._actions = Object.create(null);
1661
+ store._mutations = Object.create(null);
1662
+ store._wrappedGetters = Object.create(null);
1663
+ store._modulesNamespaceMap = Object.create(null);
1664
+ var state = store.state;
1665
+ // init all modules
1666
+ installModule(store, state, [], store._modules.root, true);
1667
+ // reset vm
1668
+ resetStoreVM(store, state, hot);
1669
+ }
1670
+
1671
+ function resetStoreVM (store, state, hot) {
1672
+ var oldVm = store._vm;
1673
+
1674
+ // bind store public getters
1675
+ store.getters = {};
1676
+ // reset local getters cache
1677
+ store._makeLocalGettersCache = Object.create(null);
1678
+ var wrappedGetters = store._wrappedGetters;
1679
+ var computed = {};
1680
+ forEachValue(wrappedGetters, function (fn, key) {
1681
+ // use computed to leverage its lazy-caching mechanism
1682
+ // direct inline function use will lead to closure preserving oldVm.
1683
+ // using partial to return function with only arguments preserved in closure environment.
1684
+ computed[key] = partial(fn, store);
1685
+ Object.defineProperty(store.getters, key, {
1686
+ get: function () { return store._vm[key]; },
1687
+ enumerable: true // for local getters
1688
+ });
1689
+ });
1690
+
1691
+ // use a Vue instance to store the state tree
1692
+ // suppress warnings just in case the user has added
1693
+ // some funky global mixins
1694
+ var silent = Vue.config.silent;
1695
+ Vue.config.silent = true;
1696
+ store._vm = new Vue({
1697
+ data: {
1698
+ $$state: state
1699
+ },
1700
+ computed: computed
1701
+ });
1702
+ Vue.config.silent = silent;
1703
+
1704
+ // enable strict mode for new vm
1705
+ if (store.strict) {
1706
+ enableStrictMode(store);
1707
+ }
1708
+
1709
+ if (oldVm) {
1710
+ if (hot) {
1711
+ // dispatch changes in all subscribed watchers
1712
+ // to force getter re-evaluation for hot reloading.
1713
+ store._withCommit(function () {
1714
+ oldVm._data.$$state = null;
1715
+ });
1716
+ }
1717
+ Vue.nextTick(function () { return oldVm.$destroy(); });
1718
+ }
1719
+ }
1720
+
1721
+ function installModule (store, rootState, path, module, hot) {
1722
+ var isRoot = !path.length;
1723
+ var namespace = store._modules.getNamespace(path);
1724
+
1725
+ // register in namespace map
1726
+ if (module.namespaced) {
1727
+ if (store._modulesNamespaceMap[namespace] && ("production" !== 'production')) {}
1728
+ store._modulesNamespaceMap[namespace] = module;
1729
+ }
1730
+
1731
+ // set state
1732
+ if (!isRoot && !hot) {
1733
+ var parentState = getNestedState(rootState, path.slice(0, -1));
1734
+ var moduleName = path[path.length - 1];
1735
+ store._withCommit(function () {
1736
+ if ((false)) {}
1737
+ Vue.set(parentState, moduleName, module.state);
1738
+ });
1739
+ }
1740
+
1741
+ var local = module.context = makeLocalContext(store, namespace, path);
1742
+
1743
+ module.forEachMutation(function (mutation, key) {
1744
+ var namespacedType = namespace + key;
1745
+ registerMutation(store, namespacedType, mutation, local);
1746
+ });
1747
+
1748
+ module.forEachAction(function (action, key) {
1749
+ var type = action.root ? key : namespace + key;
1750
+ var handler = action.handler || action;
1751
+ registerAction(store, type, handler, local);
1752
+ });
1753
+
1754
+ module.forEachGetter(function (getter, key) {
1755
+ var namespacedType = namespace + key;
1756
+ registerGetter(store, namespacedType, getter, local);
1757
+ });
1758
+
1759
+ module.forEachChild(function (child, key) {
1760
+ installModule(store, rootState, path.concat(key), child, hot);
1761
+ });
1762
+ }
1763
+
1764
+ /**
1765
+ * make localized dispatch, commit, getters and state
1766
+ * if there is no namespace, just use root ones
1767
+ */
1768
+ function makeLocalContext (store, namespace, path) {
1769
+ var noNamespace = namespace === '';
1770
+
1771
+ var local = {
1772
+ dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
1773
+ var args = unifyObjectStyle(_type, _payload, _options);
1774
+ var payload = args.payload;
1775
+ var options = args.options;
1776
+ var type = args.type;
1777
+
1778
+ if (!options || !options.root) {
1779
+ type = namespace + type;
1780
+ if (false) {}
1781
+ }
1782
+
1783
+ return store.dispatch(type, payload)
1784
+ },
1785
+
1786
+ commit: noNamespace ? store.commit : function (_type, _payload, _options) {
1787
+ var args = unifyObjectStyle(_type, _payload, _options);
1788
+ var payload = args.payload;
1789
+ var options = args.options;
1790
+ var type = args.type;
1791
+
1792
+ if (!options || !options.root) {
1793
+ type = namespace + type;
1794
+ if (false) {}
1795
+ }
1796
+
1797
+ store.commit(type, payload, options);
1798
+ }
1799
+ };
1800
+
1801
+ // getters and state object must be gotten lazily
1802
+ // because they will be changed by vm update
1803
+ Object.defineProperties(local, {
1804
+ getters: {
1805
+ get: noNamespace
1806
+ ? function () { return store.getters; }
1807
+ : function () { return makeLocalGetters(store, namespace); }
1808
+ },
1809
+ state: {
1810
+ get: function () { return getNestedState(store.state, path); }
1811
+ }
1812
+ });
1813
+
1814
+ return local
1815
+ }
1816
+
1817
+ function makeLocalGetters (store, namespace) {
1818
+ if (!store._makeLocalGettersCache[namespace]) {
1819
+ var gettersProxy = {};
1820
+ var splitPos = namespace.length;
1821
+ Object.keys(store.getters).forEach(function (type) {
1822
+ // skip if the target getter is not match this namespace
1823
+ if (type.slice(0, splitPos) !== namespace) { return }
1824
+
1825
+ // extract local getter type
1826
+ var localType = type.slice(splitPos);
1827
+
1828
+ // Add a port to the getters proxy.
1829
+ // Define as getter property because
1830
+ // we do not want to evaluate the getters in this time.
1831
+ Object.defineProperty(gettersProxy, localType, {
1832
+ get: function () { return store.getters[type]; },
1833
+ enumerable: true
1834
+ });
1835
+ });
1836
+ store._makeLocalGettersCache[namespace] = gettersProxy;
1837
+ }
1838
+
1839
+ return store._makeLocalGettersCache[namespace]
1840
+ }
1841
+
1842
+ function registerMutation (store, type, handler, local) {
1843
+ var entry = store._mutations[type] || (store._mutations[type] = []);
1844
+ entry.push(function wrappedMutationHandler (payload) {
1845
+ handler.call(store, local.state, payload);
1846
+ });
1847
+ }
1848
+
1849
+ function registerAction (store, type, handler, local) {
1850
+ var entry = store._actions[type] || (store._actions[type] = []);
1851
+ entry.push(function wrappedActionHandler (payload) {
1852
+ var res = handler.call(store, {
1853
+ dispatch: local.dispatch,
1854
+ commit: local.commit,
1855
+ getters: local.getters,
1856
+ state: local.state,
1857
+ rootGetters: store.getters,
1858
+ rootState: store.state
1859
+ }, payload);
1860
+ if (!isPromise(res)) {
1861
+ res = Promise.resolve(res);
1862
+ }
1863
+ if (store._devtoolHook) {
1864
+ return res.catch(function (err) {
1865
+ store._devtoolHook.emit('vuex:error', err);
1866
+ throw err
1867
+ })
1868
+ } else {
1869
+ return res
1870
+ }
1871
+ });
1872
+ }
1873
+
1874
+ function registerGetter (store, type, rawGetter, local) {
1875
+ if (store._wrappedGetters[type]) {
1876
+ if ((false)) {}
1877
+ return
1878
+ }
1879
+ store._wrappedGetters[type] = function wrappedGetter (store) {
1880
+ return rawGetter(
1881
+ local.state, // local state
1882
+ local.getters, // local getters
1883
+ store.state, // root state
1884
+ store.getters // root getters
1885
+ )
1886
+ };
1887
+ }
1888
+
1889
+ function enableStrictMode (store) {
1890
+ store._vm.$watch(function () { return this._data.$$state }, function () {
1891
+ if ((false)) {}
1892
+ }, { deep: true, sync: true });
1893
+ }
1894
+
1895
+ function getNestedState (state, path) {
1896
+ return path.reduce(function (state, key) { return state[key]; }, state)
1897
+ }
1898
+
1899
+ function unifyObjectStyle (type, payload, options) {
1900
+ if (isObject(type) && type.type) {
1901
+ options = payload;
1902
+ payload = type;
1903
+ type = type.type;
1904
+ }
1905
+
1906
+ if ((false)) {}
1907
+
1908
+ return { type: type, payload: payload, options: options }
1909
+ }
1910
+
1911
+ function install (_Vue) {
1912
+ if (Vue && _Vue === Vue) {
1913
+ if ((false)) {}
1914
+ return
1915
+ }
1916
+ Vue = _Vue;
1917
+ applyMixin(Vue);
1918
+ }
1919
+
1920
+ /**
1921
+ * Reduce the code which written in Vue.js for getting the state.
1922
+ * @param {String} [namespace] - Module's namespace
1923
+ * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
1924
+ * @param {Object}
1925
+ */
1926
+ var mapState = normalizeNamespace(function (namespace, states) {
1927
+ var res = {};
1928
+ if (false) {}
1929
+ normalizeMap(states).forEach(function (ref) {
1930
+ var key = ref.key;
1931
+ var val = ref.val;
1932
+
1933
+ res[key] = function mappedState () {
1934
+ var state = this.$store.state;
1935
+ var getters = this.$store.getters;
1936
+ if (namespace) {
1937
+ var module = getModuleByNamespace(this.$store, 'mapState', namespace);
1938
+ if (!module) {
1939
+ return
1940
+ }
1941
+ state = module.context.state;
1942
+ getters = module.context.getters;
1943
+ }
1944
+ return typeof val === 'function'
1945
+ ? val.call(this, state, getters)
1946
+ : state[val]
1947
+ };
1948
+ // mark vuex getter for devtools
1949
+ res[key].vuex = true;
1950
+ });
1951
+ return res
1952
+ });
1953
+
1954
+ /**
1955
+ * Reduce the code which written in Vue.js for committing the mutation
1956
+ * @param {String} [namespace] - Module's namespace
1957
+ * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
1958
+ * @return {Object}
1959
+ */
1960
+ var mapMutations = normalizeNamespace(function (namespace, mutations) {
1961
+ var res = {};
1962
+ if (false) {}
1963
+ normalizeMap(mutations).forEach(function (ref) {
1964
+ var key = ref.key;
1965
+ var val = ref.val;
1966
+
1967
+ res[key] = function mappedMutation () {
1968
+ var args = [], len = arguments.length;
1969
+ while ( len-- ) args[ len ] = arguments[ len ];
1970
+
1971
+ // Get the commit method from store
1972
+ var commit = this.$store.commit;
1973
+ if (namespace) {
1974
+ var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
1975
+ if (!module) {
1976
+ return
1977
+ }
1978
+ commit = module.context.commit;
1979
+ }
1980
+ return typeof val === 'function'
1981
+ ? val.apply(this, [commit].concat(args))
1982
+ : commit.apply(this.$store, [val].concat(args))
1983
+ };
1984
+ });
1985
+ return res
1986
+ });
1987
+
1988
+ /**
1989
+ * Reduce the code which written in Vue.js for getting the getters
1990
+ * @param {String} [namespace] - Module's namespace
1991
+ * @param {Object|Array} getters
1992
+ * @return {Object}
1993
+ */
1994
+ var mapGetters = normalizeNamespace(function (namespace, getters) {
1995
+ var res = {};
1996
+ if (false) {}
1997
+ normalizeMap(getters).forEach(function (ref) {
1998
+ var key = ref.key;
1999
+ var val = ref.val;
2000
+
2001
+ // The namespace has been mutated by normalizeNamespace
2002
+ val = namespace + val;
2003
+ res[key] = function mappedGetter () {
2004
+ if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
2005
+ return
2006
+ }
2007
+ if (false) {}
2008
+ return this.$store.getters[val]
2009
+ };
2010
+ // mark vuex getter for devtools
2011
+ res[key].vuex = true;
2012
+ });
2013
+ return res
2014
+ });
2015
+
2016
+ /**
2017
+ * Reduce the code which written in Vue.js for dispatch the action
2018
+ * @param {String} [namespace] - Module's namespace
2019
+ * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
2020
+ * @return {Object}
2021
+ */
2022
+ var mapActions = normalizeNamespace(function (namespace, actions) {
2023
+ var res = {};
2024
+ if (false) {}
2025
+ normalizeMap(actions).forEach(function (ref) {
2026
+ var key = ref.key;
2027
+ var val = ref.val;
2028
+
2029
+ res[key] = function mappedAction () {
2030
+ var args = [], len = arguments.length;
2031
+ while ( len-- ) args[ len ] = arguments[ len ];
2032
+
2033
+ // get dispatch function from store
2034
+ var dispatch = this.$store.dispatch;
2035
+ if (namespace) {
2036
+ var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
2037
+ if (!module) {
2038
+ return
2039
+ }
2040
+ dispatch = module.context.dispatch;
2041
+ }
2042
+ return typeof val === 'function'
2043
+ ? val.apply(this, [dispatch].concat(args))
2044
+ : dispatch.apply(this.$store, [val].concat(args))
2045
+ };
2046
+ });
2047
+ return res
2048
+ });
2049
+
2050
+ /**
2051
+ * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
2052
+ * @param {String} namespace
2053
+ * @return {Object}
2054
+ */
2055
+ var createNamespacedHelpers = function (namespace) { return ({
2056
+ mapState: mapState.bind(null, namespace),
2057
+ mapGetters: mapGetters.bind(null, namespace),
2058
+ mapMutations: mapMutations.bind(null, namespace),
2059
+ mapActions: mapActions.bind(null, namespace)
2060
+ }); };
2061
+
2062
+ /**
2063
+ * Normalize the map
2064
+ * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
2065
+ * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
2066
+ * @param {Array|Object} map
2067
+ * @return {Object}
2068
+ */
2069
+ function normalizeMap (map) {
2070
+ if (!isValidMap(map)) {
2071
+ return []
2072
+ }
2073
+ return Array.isArray(map)
2074
+ ? map.map(function (key) { return ({ key: key, val: key }); })
2075
+ : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
2076
+ }
2077
+
2078
+ /**
2079
+ * Validate whether given map is valid or not
2080
+ * @param {*} map
2081
+ * @return {Boolean}
2082
+ */
2083
+ function isValidMap (map) {
2084
+ return Array.isArray(map) || isObject(map)
2085
+ }
2086
+
2087
+ /**
2088
+ * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
2089
+ * @param {Function} fn
2090
+ * @return {Function}
2091
+ */
2092
+ function normalizeNamespace (fn) {
2093
+ return function (namespace, map) {
2094
+ if (typeof namespace !== 'string') {
2095
+ map = namespace;
2096
+ namespace = '';
2097
+ } else if (namespace.charAt(namespace.length - 1) !== '/') {
2098
+ namespace += '/';
2099
+ }
2100
+ return fn(namespace, map)
2101
+ }
2102
+ }
777
2103
 
2104
+ /**
2105
+ * Search a special module from store by namespace. if module not exist, print error message.
2106
+ * @param {Object} store
2107
+ * @param {String} helper
2108
+ * @param {String} namespace
2109
+ * @return {Object}
2110
+ */
2111
+ function getModuleByNamespace (store, helper, namespace) {
2112
+ var module = store._modulesNamespaceMap[namespace];
2113
+ if (false) {}
2114
+ return module
2115
+ }
778
2116
 
2117
+ // Credits: borrowed code from fcomb/redux-logger
2118
+
2119
+ function createLogger (ref) {
2120
+ if ( ref === void 0 ) ref = {};
2121
+ var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
2122
+ var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
2123
+ var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
2124
+ var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
2125
+ var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
2126
+ var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
2127
+ var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
2128
+ var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
2129
+ var logger = ref.logger; if ( logger === void 0 ) logger = console;
2130
+
2131
+ return function (store) {
2132
+ var prevState = deepCopy(store.state);
2133
+
2134
+ if (typeof logger === 'undefined') {
2135
+ return
2136
+ }
779
2137
 
2138
+ if (logMutations) {
2139
+ store.subscribe(function (mutation, state) {
2140
+ var nextState = deepCopy(state);
780
2141
 
2142
+ if (filter(mutation, prevState, nextState)) {
2143
+ var formattedTime = getFormattedTime();
2144
+ var formattedMutation = mutationTransformer(mutation);
2145
+ var message = "mutation " + (mutation.type) + formattedTime;
781
2146
 
782
- /* normalize component */
783
- ;
784
- var component = (0,componentNormalizer/* default */.A)(
785
- NBDialog_srcvue_type_script_lang_js,
786
- render,
787
- staticRenderFns,
788
- false,
789
- null,
790
- "c64765f8",
791
- null
792
-
793
- )
2147
+ startMessage(logger, message, collapsed);
2148
+ logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
2149
+ logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
2150
+ logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
2151
+ endMessage(logger);
2152
+ }
794
2153
 
795
- /* harmony default export */ var src = (component.exports);
796
- ;// ./packages/components/NBDialog/index.js
2154
+ prevState = nextState;
2155
+ });
2156
+ }
797
2157
 
798
- src.install = function (Vue) {
799
- Vue.component(src.name, src);
800
- };
801
- /* harmony default export */ var NBDialog = (src);
2158
+ if (logActions) {
2159
+ store.subscribeAction(function (action, state) {
2160
+ if (actionFilter(action, state)) {
2161
+ var formattedTime = getFormattedTime();
2162
+ var formattedAction = actionTransformer(action);
2163
+ var message = "action " + (action.type) + formattedTime;
802
2164
 
803
- /***/ }),
2165
+ startMessage(logger, message, collapsed);
2166
+ logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
2167
+ endMessage(logger);
2168
+ }
2169
+ });
2170
+ }
2171
+ }
2172
+ }
804
2173
 
805
- /***/ 4400:
806
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2174
+ function startMessage (logger, message, collapsed) {
2175
+ var startMessage = collapsed
2176
+ ? logger.groupCollapsed
2177
+ : logger.group;
807
2178
 
808
- "use strict";
809
- // ESM COMPAT FLAG
810
- __webpack_require__.r(__webpack_exports__);
2179
+ // render
2180
+ try {
2181
+ startMessage.call(logger, message);
2182
+ } catch (e) {
2183
+ logger.log(message);
2184
+ }
2185
+ }
811
2186
 
812
- // EXPORTS
813
- __webpack_require__.d(__webpack_exports__, {
814
- "default": function() { return /* binding */ NBEmpty; }
815
- });
2187
+ function endMessage (logger) {
2188
+ try {
2189
+ logger.groupEnd();
2190
+ } catch (e) {
2191
+ logger.log('—— log end ——');
2192
+ }
2193
+ }
816
2194
 
817
- ;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/components/NBEmpty/src/index.vue?vue&type=template&id=10fa1586
818
- var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"nb-empty",class:[("nb-empty--" + _vm.size), _vm.center ? 'nb-empty--center' : '']},[(_vm.icon)?_c('img',{staticClass:"nb-empty__icon",attrs:{"src":__webpack_require__(1603)("./empty-" + _vm.icon + ".png")}}):_vm._e(),(_vm.text)?_c('div',{staticClass:"nb-empty__text"},[_vm._v(_vm._s(_vm.text))]):_vm._e(),(_vm.tips)?_c('div',{staticClass:"nb-empty__tips"},[_vm._v(_vm._s(_vm.tips))]):_vm._e(),_vm._t("default")],2)}
819
- var staticRenderFns = []
2195
+ function getFormattedTime () {
2196
+ var time = new Date();
2197
+ return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
2198
+ }
820
2199
 
2200
+ function repeat (str, times) {
2201
+ return (new Array(times + 1)).join(str)
2202
+ }
821
2203
 
822
- ;// ./packages/components/NBEmpty/src/index.vue?vue&type=template&id=10fa1586
2204
+ function pad (num, maxLength) {
2205
+ return repeat('0', maxLength - num.toString().length) + num
2206
+ }
823
2207
 
824
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/components/NBEmpty/src/index.vue?vue&type=script&lang=js
825
- //
826
- //
827
- //
828
- //
829
- //
2208
+ var index = {
2209
+ Store: Store,
2210
+ install: install,
2211
+ version: '3.6.2',
2212
+ mapState: mapState,
2213
+ mapMutations: mapMutations,
2214
+ mapGetters: mapGetters,
2215
+ mapActions: mapActions,
2216
+ createNamespacedHelpers: createNamespacedHelpers,
2217
+ createLogger: createLogger
2218
+ };
2219
+
2220
+ /* harmony default export */ var vuex_esm = ((/* unused pure expression or super */ null && (index)));
2221
+
2222
+
2223
+ // EXTERNAL MODULE: ./locale/index.js + 1 modules
2224
+ var locale = __webpack_require__(4820);
2225
+ ;// ./packages/mixins/index.js
2226
+ /*
2227
+ * @Author: chenghuan.dong
2228
+ * @Date: 2024-11-18 11:19:51
2229
+ * @LastEditTime: 2024-11-18 11:21:28
2230
+ * @LastEditors: chenghuan.dong
2231
+ * @Description:
2232
+ * @FilePath: \nubomed-ui\packages\mixins\index.js
2233
+ */
2234
+
2235
+ /* harmony default export */ var mixins = ({
2236
+ methods: {
2237
+ $t(...args) {
2238
+ return locale.t.apply(this, args);
2239
+ }
2240
+ }
2241
+ });
2242
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/components/NBExpiryIcon/src/index.vue?vue&type=script&lang=js
830
2243
  //
831
2244
  //
832
2245
  //
@@ -840,42 +2253,73 @@ var staticRenderFns = []
840
2253
  //
841
2254
  //
842
2255
 
2256
+
2257
+
843
2258
  /* harmony default export */ var srcvue_type_script_lang_js = ({
844
- name: 'NBEmpty',
845
- // 无数据
2259
+ name: 'NBExpiryIcon',
2260
+ mixins: [mixins],
846
2261
  props: {
847
- // 图标 none-无数据,search-搜索提示,error-异常,scan-扫码
848
- icon: {
849
- type: String,
850
- default: 'none'
851
- },
852
- // 提示文字
853
- text: {
854
- type: String,
855
- default: ''
2262
+ // 效期值:-1正常 0:已过期, 1:1个月 3:3个月效期 6:6个月效期
2263
+ value: {
2264
+ type: [Number, String],
2265
+ default: null
856
2266
  },
857
- // 提示语,绿色字体
858
- tips: {
2267
+ // 语言
2268
+ language: {
859
2269
  type: String,
860
2270
  default: ''
2271
+ }
2272
+ },
2273
+ computed: {
2274
+ ...mapGetters([]),
2275
+ // 实际的语言
2276
+ factLocal() {
2277
+ return this.language || this.getters?.locale || 'zh-cn';
861
2278
  },
862
- // 尺寸:默认大尺寸(图标500*500),small-小尺寸(图标300*300)
863
- size: {
864
- type: String,
865
- default: 'large'
866
- },
867
- // 是否居中
868
- center: {
869
- type: Boolean,
870
- default: true
2279
+ icon() {
2280
+ if (![0, 1, 3, 6].includes(parseInt(this.value))) {
2281
+ return '';
2282
+ }
2283
+ if (['en', 'en-us'].includes(this.factLocal)) {
2284
+ switch (parseInt(this.value)) {
2285
+ case 0:
2286
+ return `Expired`;
2287
+ default:
2288
+ return `EXP ${this.value}M`;
2289
+ }
2290
+ } else if (this.factLocal === 'fr') {
2291
+ switch (parseInt(this.value)) {
2292
+ case 0:
2293
+ return `Périmé`;
2294
+ default:
2295
+ return `EXP ${this.value}M`;
2296
+ }
2297
+ } else {
2298
+ switch (parseInt(this.value)) {
2299
+ case 0:
2300
+ return this.$t('nbUI.overdue');
2301
+ // '过期'
2302
+ case 1:
2303
+ return this.$t('nbUI.oneMonth');
2304
+ // '1个月'
2305
+ case 3:
2306
+ return this.$t('nbUI.threeMonth');
2307
+ // '3个月'
2308
+ case 6:
2309
+ return this.$t('nbUI.sixMonth');
2310
+ // '6个月'
2311
+ default:
2312
+ return '';
2313
+ }
2314
+ }
871
2315
  }
872
2316
  }
873
2317
  });
874
- ;// ./packages/components/NBEmpty/src/index.vue?vue&type=script&lang=js
875
- /* harmony default export */ var NBEmpty_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
2318
+ ;// ./packages/components/NBExpiryIcon/src/index.vue?vue&type=script&lang=js
2319
+ /* harmony default export */ var NBExpiryIcon_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
876
2320
  // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
877
2321
  var componentNormalizer = __webpack_require__(1656);
878
- ;// ./packages/components/NBEmpty/src/index.vue
2322
+ ;// ./packages/components/NBExpiryIcon/src/index.vue
879
2323
 
880
2324
 
881
2325
 
@@ -884,23 +2328,23 @@ var componentNormalizer = __webpack_require__(1656);
884
2328
  /* normalize component */
885
2329
  ;
886
2330
  var component = (0,componentNormalizer/* default */.A)(
887
- NBEmpty_srcvue_type_script_lang_js,
2331
+ NBExpiryIcon_srcvue_type_script_lang_js,
888
2332
  render,
889
2333
  staticRenderFns,
890
2334
  false,
891
2335
  null,
892
- null,
2336
+ "39febcbf",
893
2337
  null
894
2338
 
895
2339
  )
896
2340
 
897
2341
  /* harmony default export */ var src = (component.exports);
898
- ;// ./packages/components/NBEmpty/index.js
2342
+ ;// ./packages/components/NBExpiryIcon/index.js
899
2343
 
900
2344
  src.install = function (Vue) {
901
2345
  Vue.component(src.name, src);
902
2346
  };
903
- /* harmony default export */ var NBEmpty = (src);
2347
+ /* harmony default export */ var NBExpiryIcon = (src);
904
2348
 
905
2349
  /***/ }),
906
2350
 
@@ -3122,6 +4566,7 @@ var map = {
3122
4566
  "./NBCheckboxGroup/index.js": 9070,
3123
4567
  "./NBDialog/index.js": 6571,
3124
4568
  "./NBEmpty/index.js": 4400,
4569
+ "./NBExpiryIcon/index.js": 2416,
3125
4570
  "./NBFullscreenDialog/index.js": 4531,
3126
4571
  "./NBHeader/index.js": 1001,
3127
4572
  "./NBIcon/index.js": 79,
@@ -6010,129 +7455,8 @@ var esnext_iterator_for_each = __webpack_require__(3949);
6010
7455
  function camelToKebab(camelCaseStr) {
6011
7456
  return camelCaseStr.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
6012
7457
  }
6013
- ;// ./locale/lang/zh-CN.js
6014
- /*
6015
- * @Author: chenghuan.dong
6016
- * @Date: 2024-11-11 11:59:27
6017
- * @LastEditTime: 2024-11-11 12:00:24
6018
- * @LastEditors: chenghuan.dong
6019
- * @Description:
6020
- * @FilePath: \nubomed-ui\locale\lang\zh-CN.JS
6021
- */
6022
- /* harmony default export */ var zh_CN = ({
6023
- nbUI: {
6024
- name: '品名',
6025
- consumableInfo: '耗材信息',
6026
- spec: '规格',
6027
- model: '型号',
6028
- barcode: '唯一码',
6029
- combineCode: '品规码',
6030
- batch: '批号',
6031
- expiry: '效期',
6032
- count: '数量',
6033
- position: '位置',
6034
- curPosition: '当前位置',
6035
- lastPosition: '上次位置',
6036
- manufacturer: '生产厂家',
6037
- brand: '品牌',
6038
- supplier: '供应商',
6039
- unit: '单位',
6040
- price: '金额',
6041
- unitPrice: '单价',
6042
- // 用户相关
6043
- operation: '操作',
6044
- operator: '操作人',
6045
- operateTime: '操作时间',
6046
- operateType: '操作类型',
6047
- // 按钮相关
6048
- replyDelete: '回删',
6049
- search: '搜索',
6050
- detail: '详情',
6051
- cancel: '取消',
6052
- confirm: '确定',
6053
- known: '知道了',
6054
- refresh: '刷新',
6055
- retest: '重新检测',
6056
- copy: '复制',
6057
- copySuccess: '复制成功',
6058
- inventory: '盘点',
6059
- inventorying: '盘点中...',
6060
- inventorySurplus: '盘盈',
6061
- inventoryLoss: '盘亏',
6062
- inventoryAccount: '账盘',
6063
- inventoryActual: '机盘',
6064
- // 时间
6065
- yesterday: '昨天',
6066
- today: '今天',
6067
- tomorrow: '明天',
6068
- oneWeekAgo: '近一周',
6069
- oneMonthAgo: '近一月',
6070
- clear: '清空',
6071
- startDt: '开始日期',
6072
- endDt: '结束日期',
6073
- // 近效期
6074
- overdue: '过期',
6075
- oneMonth: '1个月',
6076
- threeMonth: '3个月',
6077
- sixMonth: '6个月',
6078
- // 柜
6079
- upCabinet: '上柜',
6080
- downCabinet: '下柜',
6081
- leftCabinet: '左柜',
6082
- rightCabinet: '右柜',
6083
- cabinetUnconnected: '未连接',
6084
- cabinetUnlock: '柜未锁',
6085
- cabinetLock: '柜已锁',
6086
- cabinetUnclosed: '柜未关',
6087
- cabinetClosed: '柜已关',
6088
- // 其它
6089
- temporaryStop: '临时停用',
6090
- loading: '加载中...',
6091
- release: '释放更新',
6092
- pullRefresh: '下拉刷新',
6093
- noMore: '没有更多了',
6094
- noneData: '暂无数据',
6095
- pleaseInputNumber: '请输入数字!'
6096
- }
6097
- });
6098
- ;// ./locale/index.js
6099
-
6100
- let lang = zh_CN;
6101
- let i18nHandler = function () {
6102
- const vuei18n = Object.getPrototypeOf(this).$t;
6103
- if (typeof vuei18n === 'function') {
6104
- return vuei18n.apply(this, arguments);
6105
- }
6106
- };
6107
-
6108
- // eslint-disable-next-line no-unused-vars
6109
- const t = function (path, options) {
6110
- let value = i18nHandler.apply(this, arguments);
6111
- if (value !== null && typeof value !== 'undefined') {
6112
- return value;
6113
- }
6114
- const array = path.split('.');
6115
- let current = lang;
6116
- for (let i = 0, j = array.length; i < j; i++) {
6117
- const property = array[i];
6118
- value = current[property];
6119
- if (i === j - 1) return value;
6120
- if (!value) return '';
6121
- current = value;
6122
- }
6123
- return '';
6124
- };
6125
- const use = function (l) {
6126
- lang = l || lang;
6127
- };
6128
- const i18n = function (fn) {
6129
- i18nHandler = fn || i18nHandler;
6130
- };
6131
- /* harmony default export */ var locale = ({
6132
- use,
6133
- t,
6134
- i18n
6135
- });
7458
+ // EXTERNAL MODULE: ./locale/index.js + 1 modules
7459
+ var locale = __webpack_require__(4820);
6136
7460
  // EXTERNAL MODULE: ./packages/iconfont/iconfont.css
6137
7461
  var iconfont = __webpack_require__(1970);
6138
7462
  ;// ./packages/index.js
@@ -6142,7 +7466,7 @@ var iconfont = __webpack_require__(1970);
6142
7466
  /*
6143
7467
  * @Author: chenghuan.dong
6144
7468
  * @Date: 2024-11-08 17:23:47
6145
- * @LastEditTime: 2024-11-18 14:05:00
7469
+ * @LastEditTime: 2024-11-18 18:33:47
6146
7470
  * @LastEditors: chenghuan.dong
6147
7471
  * @Description: 主index.js导出全部组件
6148
7472
  * @FilePath: \nubomed-ui\packages\index.js
@@ -6163,14 +7487,14 @@ req.keys().forEach(v => {
6163
7487
  });
6164
7488
  const install = function (Vue, options = {}) {
6165
7489
  //设置多语言
6166
- locale.use(options.locale);
6167
- locale.i18n(options.i18n);
7490
+ locale/* default.use */.Ay.use(options.locale);
7491
+ locale/* default.i18n */.Ay.i18n(options.i18n);
6168
7492
 
6169
7493
  // 组件
6170
7494
  if (install.installed) return;
6171
7495
  components.forEach(component => {
6172
7496
  const name = 'nb-' + camelToKebab(component.name.slice(2));
6173
- const installNames = ['nb-icon', 'nb-tag', 'nb-badge', 'nb-empty', 'nb-radio-group', 'nb-checkbox-group', 'nb-header', 'nb-summary-bar', 'nb-header', 'nb-tabs', 'nb-pagination', 'nb-progress', 'nb-dialog', 'nb-fullscreen-dialog', 'nb-out-footer-dialog', 'nb-message-dialog', 'nb-sidebar-nav-group', 'nb-sidebar-nav'];
7497
+ const installNames = ['nb-icon', 'nb-tag', 'nb-badge', 'nb-empty', 'nb-radio-group', 'nb-checkbox-group', 'nb-header', 'nb-summary-bar', 'nb-header', 'nb-tabs', 'nb-pagination', 'nb-progress', 'nb-dialog', 'nb-fullscreen-dialog', 'nb-out-footer-dialog', 'nb-message-dialog', 'nb-sidebar-nav-group', 'nb-sidebar-nav', 'nb-expiry-icon'];
6174
7498
  if (installNames.includes(name)) {
6175
7499
  console.log('%c' + '√ ' + name, 'color: #00A572;');
6176
7500
  } else {
@@ -6184,12 +7508,12 @@ const install = function (Vue, options = {}) {
6184
7508
  // 全局
6185
7509
  // Vue.prototype.$nbNotify = nbNotify
6186
7510
  };
6187
- const packages_i18n = locale.i18n;
7511
+ const i18n = locale/* default.i18n */.Ay.i18n;
6188
7512
  /* harmony default export */ var packages_0 = ({
6189
7513
  install,
6190
7514
  ...components,
6191
- locale: locale,
6192
- i18n: packages_i18n
7515
+ locale: locale/* default */.Ay,
7516
+ i18n
6193
7517
  });
6194
7518
  ;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
6195
7519