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