@lambo-design/shared 1.0.0-beta.31 → 1.0.0-beta.310
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/config.js +20 -3
- package/config/index.js +7 -2
- package/config/locale.js +61 -0
- package/config/themes/atrovirens/atrovirens.css +589 -0
- package/config/themes/atrovirens/atrovirens.css.map +1 -0
- package/config/themes/atrovirens/atrovirens.less +680 -0
- package/config/themes/atrovirens/var.less +688 -0
- package/config/themes/blue/blue.css +589 -0
- package/config/themes/blue/blue.css.map +1 -0
- package/config/themes/blue/blue.less +683 -0
- package/config/themes/blue/var.less +691 -0
- package/config/themes/blue-white/blue-white.css +589 -0
- package/config/themes/blue-white/blue-white.css.map +1 -0
- package/config/themes/blue-white/blue-white.less +684 -0
- package/config/themes/blue-white/var.less +690 -0
- package/config/themes/blue-white-big/blue-white-big.css +589 -0
- package/config/themes/blue-white-big/blue-white-big.css.map +1 -0
- package/config/themes/blue-white-big/blue-white-big.less +684 -0
- package/config/themes/blue-white-big/var.less +690 -0
- package/config/themes/blue-white-tight/blue-white-tight.css +590 -0
- package/config/themes/blue-white-tight/blue-white-tight.css.map +1 -0
- package/config/themes/blue-white-tight/blue-white-tight.less +684 -0
- package/config/themes/blue-white-tight/var.less +692 -0
- package/config/themes/canglan/canglan.css +588 -0
- package/config/themes/canglan/canglan.css.map +1 -0
- package/config/themes/canglan/canglan.less +681 -0
- package/config/themes/canglan/var.less +692 -0
- package/config/themes/cuiwei/cuiwei.css +589 -0
- package/config/themes/cuiwei/cuiwei.css.map +1 -0
- package/config/themes/cuiwei/cuiwei.less +681 -0
- package/config/themes/cuiwei/var.less +690 -0
- package/config/themes/danqing/danqing.css +589 -0
- package/config/themes/danqing/danqing.css.map +1 -0
- package/config/themes/danqing/danqing.less +681 -0
- package/config/themes/danqing/danqing.wxss +576 -0
- package/config/themes/danqing/var.less +695 -0
- package/config/themes/deep/deep.css +589 -0
- package/config/themes/deep/deep.css.map +1 -0
- package/config/themes/deep/deep.less +681 -0
- package/config/themes/deep/var.less +693 -0
- package/config/themes/default/default.css +403 -57
- package/config/themes/default/default.css.map +1 -1
- package/config/themes/default/default.less +380 -16
- package/config/themes/default/var.less +389 -11
- package/config/themes/eap/eap.css +589 -0
- package/config/themes/eap/eap.css.map +1 -0
- package/config/themes/eap/eap.less +684 -0
- package/config/themes/eap/var.less +692 -0
- package/config/themes/gold/gold.css +589 -0
- package/config/themes/gold/gold.css.map +1 -0
- package/config/themes/gold/gold.less +684 -0
- package/config/themes/gold/var.less +385 -5
- package/config/themes/index.js +26 -4
- package/config/themes/lime/lime.css +589 -0
- package/config/themes/lime/lime.css.map +1 -0
- package/config/themes/lime/lime.less +684 -0
- package/config/themes/lime/var.less +384 -5
- package/config/themes/orange/orange.css +353 -7
- package/config/themes/orange/orange.css.map +1 -1
- package/config/themes/orange/orange.less +365 -0
- package/config/themes/orange/var.less +385 -5
- package/config/themes/red/red.css +353 -7
- package/config/themes/red/red.css.map +1 -1
- package/config/themes/red/red.less +365 -0
- package/config/themes/red/var.less +385 -5
- package/config/themes/sichuan/sichuan.css +589 -0
- package/config/themes/sichuan/sichuan.css.map +1 -0
- package/config/themes/sichuan/sichuan.less +684 -0
- package/config/themes/sichuan/var.less +690 -0
- package/config/themes/theme-atrovirens.js +571 -0
- package/config/themes/theme-blue.js +571 -0
- package/config/themes/theme-bw.js +571 -0
- package/config/themes/theme-bwb.js +571 -0
- package/config/themes/theme-bwt.js +572 -0
- package/config/themes/theme-canglan.js +573 -0
- package/config/themes/theme-cuiwei.js +573 -0
- package/config/themes/theme-danqing.js +574 -0
- package/config/themes/theme-deep.js +571 -0
- package/config/themes/theme-default.js +378 -60
- package/config/themes/theme-eap.js +571 -0
- package/config/themes/theme-gold.js +326 -8
- package/config/themes/theme-lime.js +326 -8
- package/config/themes/theme-orange.js +560 -29
- package/config/themes/theme-red.js +563 -33
- package/config/themes/theme-sichuan.js +571 -0
- package/config/themes/theme-white.js +571 -0
- package/config/themes/white/var.less +691 -0
- package/config/themes/white/white.css +589 -0
- package/config/themes/white/white.css.map +1 -0
- package/config/themes/white/white.less +684 -0
- package/directives/module/print.js +1 -0
- package/directives/module/vue-print-nb/README.md +63 -0
- package/directives/module/vue-print-nb/print.js +94 -0
- package/directives/module/vue-print-nb/printarea.js +532 -0
- package/index.js +7 -1
- package/nstyles/common.less +197 -0
- package/nstyles/components/404.less +46 -0
- package/nstyles/components/button.less +34 -0
- package/nstyles/components/date-picker.less +41 -0
- package/nstyles/components/drawer.less +20 -0
- package/nstyles/components/dropdown.less +18 -0
- package/nstyles/components/excel-flow.less +72 -0
- package/nstyles/components/form.less +313 -0
- package/nstyles/components/index.less +23 -0
- package/nstyles/components/layout/collect.less +10 -0
- package/nstyles/components/layout/detail-view.less +107 -0
- package/nstyles/components/layout/full-screen.less +7 -0
- package/nstyles/components/layout/index.less +7 -0
- package/nstyles/components/layout/other-menu.less +142 -0
- package/nstyles/components/layout/page-view.less +101 -0
- package/nstyles/components/layout/sider-trigger.less +41 -0
- package/nstyles/components/layout/tags-nav.less +113 -0
- package/nstyles/components/modal.less +90 -0
- package/nstyles/components/n-button.less +131 -0
- package/nstyles/components/n-image-preview.less +131 -0
- package/nstyles/components/n-model/index.less +19 -0
- package/nstyles/components/n-model/report-index.less +43 -0
- package/nstyles/components/n-panel.less +41 -0
- package/nstyles/components/n-picker.less +37 -0
- package/nstyles/components/n-sign.less +17 -0
- package/nstyles/components/n-tooltip.less +10 -0
- package/nstyles/components/panel.less +31 -0
- package/nstyles/components/select.less +3 -0
- package/nstyles/components/sign.less +27 -0
- package/nstyles/components/table.less +412 -0
- package/nstyles/components/tree.less +166 -0
- package/nstyles/components/upload.less +174 -0
- package/nstyles/index.less +5 -0
- package/nstyles/reset.less +73 -0
- package/nstyles/third/ag.less +206 -0
- package/nstyles/third/icons/sort-desc.svg +1 -0
- package/nstyles/third/icons/sort-up.svg +1 -0
- package/nstyles/third/icons/sorting.svg +1 -0
- package/nstyles/third/index.less +11 -0
- package/nstyles/third/view-design.less +378 -0
- package/nstyles/variables/base.less +143 -0
- package/nstyles/variables/index.less +4 -0
- package/nstyles/variables/theme/default/button.less +7 -0
- package/nstyles/variables/theme/default/common.less +60 -0
- package/nstyles/variables/theme/default/index.less +7 -0
- package/nstyles/variables/theme/default/layout.less +40 -0
- package/nstyles/variables/theme/default/table.less +37 -0
- package/nstyles/variables/theme/default/tag.less +3 -0
- package/nstyles/variables/theme/default/upload.less +3 -0
- package/nstyles/variables/theme/index.less +13 -0
- package/nstyles/variables/theme/lsv/button.less +7 -0
- package/nstyles/variables/theme/lsv/common.less +39 -0
- package/nstyles/variables/theme/lsv/index.less +5 -0
- package/nstyles/variables/theme/lsv/layout.less +21 -0
- package/nstyles/variables/theme/lsv/table.less +20 -0
- package/nstyles/variables/theme/lsv/tag.less +3 -0
- package/nstyles/variables/theme/small/button.less +7 -0
- package/nstyles/variables/theme/small/common.less +41 -0
- package/nstyles/variables/theme/small/index.less +5 -0
- package/nstyles/variables/theme/small/layout.less +21 -0
- package/nstyles/variables/theme/small/table.less +17 -0
- package/nstyles/variables/theme/small/tag.less +3 -0
- package/package.json +28 -7
- package/plugin/index.js +12 -0
- package/plugin/module/date-format.js +30 -0
- package/plugin/module/loading.js +26 -0
- package/plugin/module/warn-handler.js +11 -0
- package/styles/image/indicator-card-header.png +0 -0
- package/styles/image/inspur.png +0 -0
- package/styles/image/lan_navigator.png +0 -0
- package/styles/image/layout-header-bg-canglan.png +0 -0
- package/styles/image/layout-header-bg-cuiwei.png +0 -0
- package/styles/image/lv_navigator.png +0 -0
- package/utils/ajax/abort-controller.js +68 -0
- package/utils/ajax/cancel-token.js +69 -0
- package/utils/ajax/content-type.js +30 -0
- package/utils/ajax/headers.js +11 -0
- package/utils/ajax/interceptors.js +30 -5
- package/utils/ajax/sseFetchUtil.js +118 -0
- package/utils/ajax/throttle.js +46 -0
- package/utils/assist.js +155 -27
- package/utils/base64.js +126 -0
- package/utils/blob.js +47 -0
- package/utils/context-menu.js +65 -0
- package/utils/crypto/aes.js +23 -0
- package/utils/crypto/index.js +10 -0
- package/utils/crypto/rsa.js +23 -0
- package/utils/date.js +334 -305
- package/utils/dict/built-in-dict.js +20 -0
- package/utils/dict/index.js +191 -0
- package/utils/event.js +72 -0
- package/utils/excel.js +373 -241
- package/utils/file.js +19 -0
- package/utils/form/validate.js +29 -0
- package/utils/half-year.js +68 -0
- package/utils/index.js +37 -0
- package/utils/json.js +44 -0
- package/utils/locale/en-US.js +172 -0
- package/utils/locale/zh-CN.js +172 -0
- package/utils/lodop.js +5 -0
- package/utils/menu/index.js +292 -15
- package/utils/mime_type.js +67 -0
- package/utils/modelerUtil.js +4 -1
- package/utils/n/api.js +38 -0
- package/utils/n/date.js +57 -0
- package/utils/n/index.js +10 -0
- package/utils/n/is-type.js +176 -0
- package/utils/n/number.js +144 -0
- package/utils/n/permission-cache.js +11 -0
- package/utils/n/reuqest/axiosN.js +17 -0
- package/utils/n/reuqest/content-type.js +19 -0
- package/utils/n/reuqest/interceptors.js +95 -0
- package/utils/n/reuqest/url-params.js +12 -0
- package/utils/n/storage.js +51 -0
- package/utils/n/token.js +51 -0
- package/utils/n/user-cache.js +11 -0
- package/utils/n/user.js +34 -0
- package/utils/n/uuid.js +16 -0
- package/utils/n-generator-routers.js +208 -0
- package/utils/n-router.js +205 -0
- package/utils/n-theme.js +30 -0
- package/utils/number.js +72 -15
- package/utils/oss.js +57 -0
- package/utils/platform.js +824 -33
- package/utils/quarter.js +58 -0
- package/utils/storage.js +198 -0
- package/utils/style.js +24 -0
- package/utils/theme.js +98 -3
- package/utils/transfer-queue.js +7 -0
- package/utils/transform.js +205 -0
- package/utils/type.js +102 -0
- package/utils/util.js +795 -0
- package/utils/vForm.js +349 -0
- package/utils/validator.js +181 -0
- package/config/themes/gold/default.css +0 -243
- package/config/themes/gold/default.css.map +0 -1
- package/config/themes/gold/default.less +0 -320
- package/config/themes/lime/default.css +0 -243
- package/config/themes/lime/default.css.map +0 -1
- package/config/themes/lime/default.less +0 -320
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
:root,.ind-lsv-theme {
|
|
2
|
+
--ind-menu-desc-margin-top: 0px;
|
|
3
|
+
--ind-sc-padding-top: 10px; // 值来自四川
|
|
4
|
+
|
|
5
|
+
// 压缩padding
|
|
6
|
+
// --ind-padding-xs: 4px;
|
|
7
|
+
--ind-padding-sm: 8px;
|
|
8
|
+
|
|
9
|
+
// card的样式
|
|
10
|
+
--ivu-card-head-padding: 6px 12px;
|
|
11
|
+
--ivu-card-head-line-height: 36px;
|
|
12
|
+
--ivu-card-head-height: 36px;
|
|
13
|
+
--ivu-card-body-padding: 6px;
|
|
14
|
+
|
|
15
|
+
// 表单的样式
|
|
16
|
+
--input-height: 26px; //30px; // 24px; // small 24px // 值来自四川 // 又改一版
|
|
17
|
+
--ivu-form-item-label-padding: 6px 8px 6px 0; // 6px 8px 6px 0; 值来自四川 // 又改一版
|
|
18
|
+
--ivu-form-v6stle-item-label-paddingleft: 12px;
|
|
19
|
+
--ivu-form-item-content-padding: 4px 6px;
|
|
20
|
+
--ivu-form-item-label-before-left: 4px;
|
|
21
|
+
--ivu-form-item-content-line-height: 26px; //30px; //24px; // 值来自四川 // 又改一版
|
|
22
|
+
|
|
23
|
+
// tree样式
|
|
24
|
+
--ind-tree-wrapper-width: 100%;
|
|
25
|
+
--tree-content-padding: var(--ind-padding-xs);
|
|
26
|
+
--ivu-tree-margin: var(--ind-padding-xs) 0;
|
|
27
|
+
|
|
28
|
+
// drawer样式
|
|
29
|
+
--ind-drawer-content-padding: 6px;
|
|
30
|
+
--ind-drawer-footer-padding: 10px 16px;
|
|
31
|
+
|
|
32
|
+
// 报表指标样式
|
|
33
|
+
--report-index-model-panel-padding: var(--tree-content-padding);
|
|
34
|
+
--report-index-options-padding-right: var(--tree-content-padding);
|
|
35
|
+
|
|
36
|
+
// 表格
|
|
37
|
+
--ind-table-button-padding: 6px; // var(--ind-padding-xs);
|
|
38
|
+
--input-height-table: 24px; // 表格输入框的高度
|
|
39
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:root,.ind-lsv-theme {
|
|
2
|
+
// basic layout 系统布局变量 -begin
|
|
3
|
+
--ivu-menu-item-font-size: var(--ind-font-size-md);
|
|
4
|
+
|
|
5
|
+
--menu-icon-margin-right: var(--ind-padding-xs);
|
|
6
|
+
// basic layout 系统布局变量 -end
|
|
7
|
+
|
|
8
|
+
// page-view layout 系统布局变量 -begin
|
|
9
|
+
--ind-panel-vertical-margin: var(--ind-padding-xs); // 12px;
|
|
10
|
+
--ind-panel-horizon-margin: var(--ind-padding-xs); // var(--ind-padding-sm);
|
|
11
|
+
// page-view layout 系统布局变量 -end
|
|
12
|
+
|
|
13
|
+
// --input-height: 30px; // 24px; // small 24px 挪common.less去了
|
|
14
|
+
--search-margin-bottom: var(--ind-padding-xs); // var(--ind-padding-sm); // 24px; // 6px;
|
|
15
|
+
--search-button-margin: var(--ind-padding-xs); // var(--ind-padding-sm);
|
|
16
|
+
|
|
17
|
+
--menu-name-padding: 0 14px 0 10px; // var(--ind-padding-xs) 14px var(--ind-padding-xs) 10px; // 标题行padding
|
|
18
|
+
--menu-title-font-size: 16px;
|
|
19
|
+
--menu-title-color: #17233d;
|
|
20
|
+
--page-content-padding: var(--ind-padding-xs); // 12px;
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
.ind-lsv-theme {
|
|
3
|
+
--ind-table-padding: var(--ind-padding-sm);
|
|
4
|
+
--ind-ag-cell-widget-spacing: 12px;
|
|
5
|
+
|
|
6
|
+
--ind-ag-grid-size: 4px;
|
|
7
|
+
--ind-ag-font-size: var(--ind-font-size-md); // var(--ind-font-size-sm);
|
|
8
|
+
--ind-ag-list-item-height: calc(var(--ag-grid-size) * 6);
|
|
9
|
+
--ind-ag-cell-horizontal-padding: 3px; // 0px
|
|
10
|
+
--ag-header-background-color: black;
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// 以下是 ag 没有的
|
|
14
|
+
--ind-ag-cell-icon-margin-left: 3px;
|
|
15
|
+
--ind-ag-cell-header-horizontal-padding: 0px;
|
|
16
|
+
--ind-ag-cell-line-height: 14px;
|
|
17
|
+
|
|
18
|
+
--ind-unit-switch-bottom: 10px;
|
|
19
|
+
--ind-other-button-top: 2px;
|
|
20
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
:root,.ind-small-theme {
|
|
2
|
+
--ind-menu-desc-margin-top: 0px;
|
|
3
|
+
--ind-sc-padding-top: 10px; // 值来自四川
|
|
4
|
+
|
|
5
|
+
// 压缩padding
|
|
6
|
+
// --ind-padding-xs: 4px;
|
|
7
|
+
--ind-padding-sm: 8px;
|
|
8
|
+
|
|
9
|
+
// card的样式
|
|
10
|
+
--ivu-card-head-padding: 6px 12px;
|
|
11
|
+
--ivu-card-head-line-height: 36px;
|
|
12
|
+
--ivu-card-head-height: 36px;
|
|
13
|
+
--ivu-card-body-padding: 6px;
|
|
14
|
+
|
|
15
|
+
// 表单的样式
|
|
16
|
+
--input-height: 26px; //30px; // 24px; // small 24px // 值来自四川 // 又改一版
|
|
17
|
+
--ivu-form-item-label-padding: 6px 8px 6px 0; // 6px 8px 6px 0; 值来自四川 // 又改一版
|
|
18
|
+
--ivu-form-v6stle-item-label-paddingleft: 12px;
|
|
19
|
+
--ivu-form-item-content-padding: 4px 6px;
|
|
20
|
+
--ivu-form-item-label-before-left: 4px;
|
|
21
|
+
--ivu-form-item-content-line-height: 26px; //30px; //24px; // 值来自四川 // 又改一版
|
|
22
|
+
|
|
23
|
+
// tree样式
|
|
24
|
+
--ind-tree-wrapper-width: 100%;
|
|
25
|
+
--tree-content-padding: var(--ind-padding-xs);
|
|
26
|
+
--ivu-tree-margin: var(--ind-padding-xs) 0;
|
|
27
|
+
|
|
28
|
+
// drawer样式
|
|
29
|
+
--ind-drawer-content-padding: 6px;
|
|
30
|
+
--ind-drawer-footer-padding: 10px 16px;
|
|
31
|
+
|
|
32
|
+
// 报表指标样式
|
|
33
|
+
--report-index-model-panel-padding: var(--tree-content-padding);
|
|
34
|
+
--report-index-options-padding-right: var(--tree-content-padding);
|
|
35
|
+
|
|
36
|
+
// 表格
|
|
37
|
+
--ind-table-button-padding: 6px; // var(--ind-padding-xs);
|
|
38
|
+
--input-height-table: 24px; // 表格输入框的高度
|
|
39
|
+
|
|
40
|
+
--ivu-tree-ul-padding: 0px 0px 0px 18px; // 树形左侧错落的间距
|
|
41
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:root,.ind-small-theme {
|
|
2
|
+
// basic layout 系统布局变量 -begin
|
|
3
|
+
--ivu-menu-item-font-size: var(--ind-font-size-md);
|
|
4
|
+
|
|
5
|
+
--menu-icon-margin-right: var(--ind-padding-xs);
|
|
6
|
+
// basic layout 系统布局变量 -end
|
|
7
|
+
|
|
8
|
+
// page-view layout 系统布局变量 -begin
|
|
9
|
+
--ind-panel-vertical-margin: var(--ind-padding-xs); // 12px;
|
|
10
|
+
--ind-panel-horizon-margin: var(--ind-padding-xs); // var(--ind-padding-sm);
|
|
11
|
+
// page-view layout 系统布局变量 -end
|
|
12
|
+
|
|
13
|
+
// --input-height: 30px; // 24px; // small 24px 挪common.less去了
|
|
14
|
+
--search-margin-bottom: var(--ind-padding-xs); // var(--ind-padding-sm); // 24px; // 6px;
|
|
15
|
+
--search-button-margin: var(--ind-padding-xs); // var(--ind-padding-sm);
|
|
16
|
+
|
|
17
|
+
--menu-name-padding: 0 14px 0 10px; // var(--ind-padding-xs) 14px var(--ind-padding-xs) 10px; // 标题行padding
|
|
18
|
+
--menu-title-font-size: 16px;
|
|
19
|
+
--menu-title-color: #17233d;
|
|
20
|
+
--page-content-padding: var(--ind-padding-xs); // 12px;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
:root,.ind-small-theme {
|
|
2
|
+
--ind-table-padding: var(--ind-padding-sm);
|
|
3
|
+
--ind-ag-cell-widget-spacing: 12px;
|
|
4
|
+
|
|
5
|
+
--ind-ag-grid-size: 4px;
|
|
6
|
+
--ind-ag-font-size: var(--ind-font-size-md); // var(--ind-font-size-sm);
|
|
7
|
+
--ind-ag-list-item-height: calc(var(--ag-grid-size) * 6);
|
|
8
|
+
--ind-ag-cell-horizontal-padding: 3px; // 0px
|
|
9
|
+
|
|
10
|
+
// 以下是 ag 没有的
|
|
11
|
+
--ind-ag-cell-icon-margin-left: 3px;
|
|
12
|
+
--ind-ag-cell-header-horizontal-padding: 0px;
|
|
13
|
+
--ind-ag-cell-line-height: 14px;
|
|
14
|
+
|
|
15
|
+
--ind-unit-switch-bottom: 10px;
|
|
16
|
+
--ind-other-button-top: 2px;
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambo-design/shared",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.310",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
7
7
|
"license": "ISC",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public",
|
|
10
|
-
"registry": "https://registry.npmjs.org/"
|
|
10
|
+
"registry": "https://registry.npmjs.org/",
|
|
11
|
+
"files": [
|
|
12
|
+
"!**/.*",
|
|
13
|
+
"!**/CHANGELOG.md",
|
|
14
|
+
"**/*"
|
|
15
|
+
]
|
|
11
16
|
},
|
|
12
17
|
"dependencies": {
|
|
13
18
|
"axios": "^0.24.0",
|
|
14
19
|
"axios-cache-plugin": "^0.1.0",
|
|
15
|
-
"qs": "^6.11.0",
|
|
16
|
-
"xlsx": "http://cicd.lambo.top/package/cdn/xlsx-0.19.1.tgz",
|
|
17
20
|
"classnames": "^2.3.1",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
21
|
+
"crypto-js": "^4.2.0",
|
|
22
|
+
"css-vars-ponyfill": "^2.4.8",
|
|
23
|
+
"dayjs": "^1.11.9",
|
|
24
|
+
"lodash": "^4.17.21",
|
|
25
|
+
"moment": "2.29.4",
|
|
26
|
+
"nanoid": "^3.3.7",
|
|
27
|
+
"node-rsa": "^1.1.1",
|
|
28
|
+
"qs": "^6.11.0",
|
|
29
|
+
"@lambo-design/xlsx": "^1.0.0-beta.2",
|
|
30
|
+
"@lambo-design/xlsx-style": "^1.0.0-beta.9"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"vue": "^2.6.12"
|
|
20
34
|
},
|
|
21
|
-
"scripts": {
|
|
35
|
+
"scripts": {
|
|
36
|
+
"release-shared": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
|
|
37
|
+
"release-major": "standard-version --release-as major",
|
|
38
|
+
"release-minor": "standard-version --release-as minor",
|
|
39
|
+
"release-patch": "standard-version --release-as patch",
|
|
40
|
+
"release-beta": "standard-version --prerelease beta",
|
|
41
|
+
"re-publish": "pnpm publish --access public --no-git-checks"
|
|
42
|
+
}
|
|
22
43
|
}
|
package/plugin/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import DateFormat from "./module/date-format";
|
|
2
|
+
import Loading from "./module/loading";
|
|
3
|
+
import WarnHandler from "./module/warn-handler";
|
|
4
|
+
export default {
|
|
5
|
+
install : function (Vue, options) {
|
|
6
|
+
DateFormat.install(Vue,options);
|
|
7
|
+
Loading.install(Vue,options);
|
|
8
|
+
WarnHandler.install(Vue,options);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
export { DateFormat , Loading , WarnHandler}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
/**
|
|
3
|
+
* 对Date的扩展,将 Date 转化为指定格式的String
|
|
4
|
+
* 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
|
5
|
+
* 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
|
6
|
+
* 例:
|
|
7
|
+
* (new Date()).Format("yyyy-MM-dd HH:mm:ss.S") ==> 2006-07-02 08:09:04.423
|
|
8
|
+
* (new Date()).Format("yyyy-M-d H:m:s.S") ==> 2006-7-2 8:9:4.18
|
|
9
|
+
*/
|
|
10
|
+
install: function (Vue, options) {
|
|
11
|
+
Date.prototype.Format = function (fmt) {
|
|
12
|
+
let o = {
|
|
13
|
+
"M+": this.getMonth() + 1, //月份
|
|
14
|
+
"d+": this.getDate(), //日
|
|
15
|
+
"H+": this.getHours(), //小时
|
|
16
|
+
"m+": this.getMinutes(), //分
|
|
17
|
+
"s+": this.getSeconds(), //秒
|
|
18
|
+
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
|
19
|
+
"S": this.getMilliseconds() //毫秒
|
|
20
|
+
};
|
|
21
|
+
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
22
|
+
for (let k in o)
|
|
23
|
+
if (new RegExp("(" + k + ")").test(fmt)) {
|
|
24
|
+
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)))
|
|
25
|
+
}
|
|
26
|
+
return fmt;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
install : function (Vue, options) {
|
|
3
|
+
//通用Loading
|
|
4
|
+
Vue.prototype.$ShowLoading = function(text){
|
|
5
|
+
this.$Spin.show({
|
|
6
|
+
render: (h) => {
|
|
7
|
+
return h('div', [
|
|
8
|
+
h('Icon', {
|
|
9
|
+
'class': 'demo-spin-icon-load',
|
|
10
|
+
props: {
|
|
11
|
+
type: 'ios-loading',
|
|
12
|
+
size: 24
|
|
13
|
+
}
|
|
14
|
+
}),
|
|
15
|
+
h('div', text||'Loading')
|
|
16
|
+
])
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
Vue.prototype.$CloseLoading = function(){
|
|
22
|
+
this.$Spin.hide();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
install : function (Vue, options) {
|
|
3
|
+
Vue.config.warnHandler = function (err, vm, info) {
|
|
4
|
+
if (err.toString().indexOf("Component names should conform to valid custom element name in html5 specification")>0){
|
|
5
|
+
console.warn("[Lambo warn]: " + err + info);
|
|
6
|
+
}else{
|
|
7
|
+
console.error("[Vue warn]: " + err + info);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// 用于存储每个请求的标识和取消函数
|
|
2
|
+
const pendingMap = new Map();
|
|
3
|
+
|
|
4
|
+
const getPendingUrl = (config) => {
|
|
5
|
+
const { url, method, data, headers } = config;
|
|
6
|
+
|
|
7
|
+
// 生成请求唯一标识
|
|
8
|
+
return headers['is-cancel-token']
|
|
9
|
+
? headers['is-cancel-token']
|
|
10
|
+
: [url, method].join('&');
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 添加请求
|
|
15
|
+
* @param config 请求配置
|
|
16
|
+
*/
|
|
17
|
+
function addPending(config) {
|
|
18
|
+
removePending(config);
|
|
19
|
+
const url = getPendingUrl(config);
|
|
20
|
+
const controller = new AbortController();
|
|
21
|
+
config.signal = config.signal || controller.signal;
|
|
22
|
+
if (!pendingMap.has(url)) {
|
|
23
|
+
// 如果当前请求不在等待中,将其添加到等待中
|
|
24
|
+
pendingMap.set(url, controller);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 移除请求
|
|
30
|
+
* @param config 请求配置
|
|
31
|
+
*/
|
|
32
|
+
function removePending(config) {
|
|
33
|
+
const url = getPendingUrl(config);
|
|
34
|
+
if (pendingMap.has(url)) {
|
|
35
|
+
// 如果当前请求在等待中,取消它并将其从等待中移除
|
|
36
|
+
const abortController = pendingMap.get(url);
|
|
37
|
+
if (abortController) {
|
|
38
|
+
abortController.abort(url);
|
|
39
|
+
}
|
|
40
|
+
pendingMap.delete(url);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 重置
|
|
46
|
+
*/
|
|
47
|
+
function reset() {
|
|
48
|
+
pendingMap.clear();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 清除所有等待中的请求
|
|
53
|
+
*/
|
|
54
|
+
function removeAllPending() {
|
|
55
|
+
pendingMap.forEach((abortController) => {
|
|
56
|
+
if (abortController) {
|
|
57
|
+
abortController.abort();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
reset();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
addPending,
|
|
66
|
+
removePending,
|
|
67
|
+
removeAllPending
|
|
68
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// axios 0.22.0 版本以后推荐使用abort-controller
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
|
|
4
|
+
// 存储所有请求的取消函数
|
|
5
|
+
const cancelTokenMap = {};
|
|
6
|
+
|
|
7
|
+
const getPendingUrl = (config) => {
|
|
8
|
+
const { url, method, data, headers } = config;
|
|
9
|
+
|
|
10
|
+
// 生成请求唯一标识
|
|
11
|
+
return headers['is-cancel-token']
|
|
12
|
+
? headers['is-cancel-token']
|
|
13
|
+
: [url, method, JSON.stringify(data), JSON.stringify(headers)].join('&');
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* 生成请求唯一标识并注册取消函数
|
|
17
|
+
* @param {Object} config - 请求配置
|
|
18
|
+
* @returns {Object} 增强后的请求配置
|
|
19
|
+
*/
|
|
20
|
+
function addPending(config) {
|
|
21
|
+
|
|
22
|
+
// 生成请求唯一标识
|
|
23
|
+
const requestId = getPendingUrl(config);
|
|
24
|
+
|
|
25
|
+
// 获取已存在的取消函数
|
|
26
|
+
const existingCancel = cancelTokenMap[requestId];
|
|
27
|
+
|
|
28
|
+
// 注册取消令牌
|
|
29
|
+
config.cancelToken = config.cancelToken || new axios.CancelToken(cancel => {
|
|
30
|
+
if (!existingCancel) {
|
|
31
|
+
cancelTokenMap[requestId] = cancel;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return config;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 取消指定请求
|
|
40
|
+
* @param {Object} config - 要取消的请求配置
|
|
41
|
+
*/
|
|
42
|
+
function removePending(config) {
|
|
43
|
+
const { url, method, data, headers } = config;
|
|
44
|
+
|
|
45
|
+
const requestId = getPendingUrl(config);
|
|
46
|
+
|
|
47
|
+
const cancelFn = cancelTokenMap[requestId];
|
|
48
|
+
|
|
49
|
+
if (cancelFn && typeof cancelFn === 'function') {
|
|
50
|
+
cancelFn(); // 执行取消
|
|
51
|
+
delete cancelTokenMap[requestId]; // 清理
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 取消所有未完成的请求
|
|
57
|
+
*/
|
|
58
|
+
function removeAllPending() {
|
|
59
|
+
Object.keys(cancelTokenMap).forEach(key => {
|
|
60
|
+
const cancelFn = cancelTokenMap[key];
|
|
61
|
+
cancelFn();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default {
|
|
66
|
+
addPending,
|
|
67
|
+
removePending,
|
|
68
|
+
removeAllPending
|
|
69
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const contentTypeKey = 'Content-Type'
|
|
2
|
+
|
|
3
|
+
export function getContentType(config) {
|
|
4
|
+
// let type = config?.[contentTypeKey] || config?.['content-type'] || ''
|
|
5
|
+
let type = '';
|
|
6
|
+
|
|
7
|
+
if (config && config[contentTypeKey]) {
|
|
8
|
+
type = config[contentTypeKey];
|
|
9
|
+
} else if (config && config['content-type']) {
|
|
10
|
+
type = config['content-type'];
|
|
11
|
+
}
|
|
12
|
+
const suffixIdx = type.indexOf(';')
|
|
13
|
+
if (suffixIdx !== -1) {
|
|
14
|
+
type = type.substring(0, suffixIdx)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return type
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function setContentType(headers, type) {
|
|
21
|
+
headers[contentTypeKey] = type
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const CONTENT_TYPE = {
|
|
25
|
+
form: 'application/x-www-form-urlencoded',
|
|
26
|
+
multiForm: 'multipart/form-data',
|
|
27
|
+
body: 'application/json',
|
|
28
|
+
os: 'application/octet-stream',
|
|
29
|
+
json: 'application/json',
|
|
30
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import qs from 'qs'
|
|
2
2
|
import cacheRules from "./cacheconf";
|
|
3
|
-
import {getToken,getUrlParams} from '../platform'
|
|
3
|
+
import {getLocalStorage, getToken, getUrlParams} from '../platform'
|
|
4
4
|
import Bus from '../bus';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import headers from './headers';
|
|
6
|
+
import {throttle} from "./throttle";
|
|
7
|
+
import abortController from "./abort-controller"
|
|
8
|
+
import cancelToken from "./cancel-token"
|
|
7
9
|
let timer1, timer2;
|
|
8
10
|
let hasDialog = false;
|
|
9
11
|
|
|
@@ -12,13 +14,21 @@ function requestInterceptors(config) {
|
|
|
12
14
|
|
|
13
15
|
let token = getToken();
|
|
14
16
|
if (token) {
|
|
15
|
-
config.headers.token = token;
|
|
17
|
+
config.headers[headers.auth.token] = token;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let systemType = getLocalStorage('systemType')
|
|
21
|
+
let tenantCode = getLocalStorage('tenantCode')
|
|
22
|
+
|
|
23
|
+
if(systemType && tenantCode){
|
|
24
|
+
config.headers[headers.tenant.tenantCode] = tenantCode;
|
|
25
|
+
config.headers[headers.tenant.systemType] = systemType;
|
|
16
26
|
}
|
|
17
27
|
|
|
18
28
|
//sso_token认证
|
|
19
29
|
if (params.hasOwnProperty('sso_token')||sessionStorage.getItem('sso_token')) {
|
|
20
30
|
config.params = Object.assign({
|
|
21
|
-
sso_token: params.sso_token||sessionStorage.getItem('sso_token')
|
|
31
|
+
sso_token: params.sso_token||sessionStorage.getItem('sso_token'),
|
|
22
32
|
sso_id: params.sso_id
|
|
23
33
|
}, config.params)
|
|
24
34
|
}
|
|
@@ -51,6 +61,20 @@ function requestInterceptors(config) {
|
|
|
51
61
|
config.url = config.url + "&t=" + new Date().getTime();
|
|
52
62
|
}
|
|
53
63
|
}
|
|
64
|
+
|
|
65
|
+
// 添加防止重复提交
|
|
66
|
+
if(process.env.IF_OPEN_NO_REPEAT_SUBMIT && process.env.IF_OPEN_NO_REPEAT_SUBMIT === "true"){
|
|
67
|
+
throttle(config);
|
|
68
|
+
// if(!config.ignoreCancelToken){
|
|
69
|
+
// abortController.addPending(config);
|
|
70
|
+
// }
|
|
71
|
+
// if(!config.isNotCancel){
|
|
72
|
+
// cancelToken.removePending(config)
|
|
73
|
+
// config = cancelToken.addPending(config)
|
|
74
|
+
// }
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
54
78
|
return config;
|
|
55
79
|
}
|
|
56
80
|
|
|
@@ -60,6 +84,7 @@ function requestError(error) {
|
|
|
60
84
|
}
|
|
61
85
|
|
|
62
86
|
function responseInterceptors(response) {
|
|
87
|
+
response && abortController.removePending(response.config)
|
|
63
88
|
const data = response.data;
|
|
64
89
|
if (data instanceof Object) {
|
|
65
90
|
const code = data["code"];
|