n20-common-lib 1.1.98
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/README.md +27 -0
- package/package.json +87 -0
- package/src/_qiankun/index.js +113 -0
- package/src/_qiankun/postMessage.js +48 -0
- package/src/assets/css/_coreLib.scss +35 -0
- package/src/assets/css/cl-anchor.scss +24 -0
- package/src/assets/css/cl-approve-card.scss +58 -0
- package/src/assets/css/cl-dialog.scss +99 -0
- package/src/assets/css/cl-drag-list.scss +22 -0
- package/src/assets/css/cl-empty.scss +10 -0
- package/src/assets/css/cl-expandable-pane.scss +25 -0
- package/src/assets/css/cl-expandable.scss +23 -0
- package/src/assets/css/cl-file-upload-table.scss +11 -0
- package/src/assets/css/cl-filter.scss +4 -0
- package/src/assets/css/cl-flow-step.scss +186 -0
- package/src/assets/css/cl-footer-box.scss +10 -0
- package/src/assets/css/cl-form-item.scss +322 -0
- package/src/assets/css/cl-general-card.scss +12 -0
- package/src/assets/css/cl-layout-aside.scss +88 -0
- package/src/assets/css/cl-layout-content.scss +16 -0
- package/src/assets/css/cl-layout-header.scss +73 -0
- package/src/assets/css/cl-layout-tabs.scss +87 -0
- package/src/assets/css/cl-layout.scss +97 -0
- package/src/assets/css/cl-login-temporary.scss +37 -0
- package/src/assets/css/cl-message.scss +75 -0
- package/src/assets/css/cl-more-tab.scss +98 -0
- package/src/assets/css/cl-nav-menu.scss +5 -0
- package/src/assets/css/cl-pagination.scss +65 -0
- package/src/assets/css/cl-secondary-tab.scss +39 -0
- package/src/assets/css/cl-showcolumn.scss +23 -0
- package/src/assets/css/cl-sifting.scss +51 -0
- package/src/assets/css/cl-statis.scss +42 -0
- package/src/assets/css/cl-step.scss +73 -0
- package/src/assets/css/cl-suspend.scss +19 -0
- package/src/assets/css/cl-tertiary-tab.scss +9 -0
- package/src/assets/css/cl-upload.scss +41 -0
- package/src/assets/css/cl-worn-pagination.scss +50 -0
- package/src/assets/css/el-button.scss +169 -0
- package/src/assets/css/el-table.scss +79 -0
- package/src/assets/css/element-variables.scss +1061 -0
- package/src/assets/css/element.dev.scss +21 -0
- package/src/assets/css/font-icon.scss +26 -0
- package/src/assets/css/index.dev.scss +4 -0
- package/src/assets/css/index.scss +11 -0
- package/src/assets/css/normalize.scss +723 -0
- package/src/assets/css/rootvar.scss +139 -0
- package/src/assets/css/select.scss +26 -0
- package/src/assets/css/title-pop.scss +4 -0
- package/src/assets/getJsonc.js +50 -0
- package/src/assets/realUrl.js +12 -0
- package/src/components/Anchor/AnchorItem.vue +30 -0
- package/src/components/Anchor/index.vue +185 -0
- package/src/components/ApprovalButtons/index.vue +232 -0
- package/src/components/ApprovalCard/index.vue +128 -0
- package/src/components/ApprovalRecord/approvalImg.vue +39 -0
- package/src/components/ApprovalRecord/index.vue +59 -0
- package/src/components/Button/button-group.vue +150 -0
- package/src/components/Button/icon-group-button.vue +61 -0
- package/src/components/Button/index.vue +56 -0
- package/src/components/ContentLoading/index.vue +41 -0
- package/src/components/ContentNull/index.vue +19 -0
- package/src/components/DatePicker/index.vue +27 -0
- package/src/components/DatePicker/por.vue +169 -0
- package/src/components/Dialog/index.vue +26 -0
- package/src/components/Dialog/indexO.vue +116 -0
- package/src/components/DragList/index.vue +68 -0
- package/src/components/Empty/img/404.png +0 -0
- package/src/components/Empty/img/abnormal.svg +109 -0
- package/src/components/Empty/img/dispose.svg +72 -0
- package/src/components/Empty/img/empty.svg +58 -0
- package/src/components/Empty/img/general.svg +59 -0
- package/src/components/Empty/img/lock.svg +58 -0
- package/src/components/Empty/img/network.svg +60 -0
- package/src/components/Empty/img/relevant.svg +69 -0
- package/src/components/Empty/img/search.svg +73 -0
- package/src/components/Empty/index.vue +92 -0
- package/src/components/Expandable/index.vue +49 -0
- package/src/components/Expandable/main.vue +52 -0
- package/src/components/FileUploadTable/index.vue +484 -0
- package/src/components/Filters/index.vue +358 -0
- package/src/components/Filters/indexO.vue +104 -0
- package/src/components/FlowStep/index.vue +69 -0
- package/src/components/FooterBox/index.vue +21 -0
- package/src/components/GeneralCard/index.vue +15 -0
- package/src/components/InputNumber/index.vue +153 -0
- package/src/components/InputNumber/numberRange.vue +47 -0
- package/src/components/InputSearch/index.vue +75 -0
- package/src/components/Layout/AsideNav/index.vue +144 -0
- package/src/components/Layout/HeaderWrap/changePwd.vue +215 -0
- package/src/components/Layout/HeaderWrap/index.vue +336 -0
- package/src/components/Layout/HeaderWrap/noticePop.vue +300 -0
- package/src/components/Layout/SubContent/index.vue +131 -0
- package/src/components/Layout/TabsNav/index.vue +170 -0
- package/src/components/Layout/index.vue +529 -0
- package/src/components/Layout/utils.js +12 -0
- package/src/components/LoginTemporary/form.vue +511 -0
- package/src/components/LoginTemporary/index.vue +122 -0
- package/src/components/LoginTemporary/qr.png +0 -0
- package/src/components/LoginTemporary/qrcode.vue +90 -0
- package/src/components/LoginTemporary/qrt.png +0 -0
- package/src/components/LoginTemporary/retrievePw.vue +28 -0
- package/src/components/LoginTemporary/utils.js +73 -0
- package/src/components/MicroApp/index.js +67 -0
- package/src/components/MicroFrame/index.vue +95 -0
- package/src/components/MoreTab/index.vue +232 -0
- package/src/components/NavMenu/index.vue +60 -0
- package/src/components/NstcG6Components/NstcApprovel/NstcApprovel.vue +13 -0
- package/src/components/NstcG6Components/NstcDialog/NstcDialog.vue +185 -0
- package/src/components/NstcG6Components/Progress/progress.vue +134 -0
- package/src/components/PageLayout/page.vue +15 -0
- package/src/components/Pagination/index.vue +96 -0
- package/src/components/SecondaryTab/index.vue +58 -0
- package/src/components/SelectLazy/index.vue +75 -0
- package/src/components/SelectTree/SelectTreeLazy.vue +241 -0
- package/src/components/SelectTree/index.vue +208 -0
- package/src/components/ShowColumn/index.vue +188 -0
- package/src/components/Sifting/index.vue +99 -0
- package/src/components/Statis/index.vue +97 -0
- package/src/components/Statis/statisItem.vue +54 -0
- package/src/components/Statis/statisPopover.vue +55 -0
- package/src/components/Step/index.vue +38 -0
- package/src/components/Suspend/index.vue +72 -0
- package/src/components/Table/index.vue +131 -0
- package/src/components/Table/indexO.vue +149 -0
- package/src/components/Task/index.vue +26 -0
- package/src/components/TertiaryTab/index.vue +53 -0
- package/src/components/TimePicker/index.vue +28 -0
- package/src/components/Upload/index.vue +242 -0
- package/src/components/WornPagination/index.vue +73 -0
- package/src/directives/VClickOutside/index.js +19 -0
- package/src/directives/VDrag/index.js +72 -0
- package/src/directives/VHas/index.js +27 -0
- package/src/directives/VMove/index.js +42 -0
- package/src/directives/VTitle/index.js +56 -0
- package/src/directives/VTitle/tooltip.vue +21 -0
- package/src/index.js +225 -0
- package/src/plugins/CompatibleOld/index.js +57 -0
- package/src/plugins/Print/index.js +4 -0
- package/src/plugins/Print/print-js/.babelrc +12 -0
- package/src/plugins/Print/print-js/LICENSE +21 -0
- package/src/plugins/Print/print-js/README.md +98 -0
- package/src/plugins/Print/print-js/dist/print.css +97 -0
- package/src/plugins/Print/print-js/dist/print.js +991 -0
- package/src/plugins/Print/print-js/dist/print.map +1 -0
- package/src/plugins/Print/print-js/package.json +60 -0
- package/src/plugins/Print/print-js/src/index.d.ts +45 -0
- package/src/plugins/Print/print-js/src/index.js +10 -0
- package/src/plugins/Print/print-js/src/js/browser.js +33 -0
- package/src/plugins/Print/print-js/src/js/functions.js +103 -0
- package/src/plugins/Print/print-js/src/js/html.js +70 -0
- package/src/plugins/Print/print-js/src/js/image.js +48 -0
- package/src/plugins/Print/print-js/src/js/init.js +168 -0
- package/src/plugins/Print/print-js/src/js/json.js +109 -0
- package/src/plugins/Print/print-js/src/js/modal.js +62 -0
- package/src/plugins/Print/print-js/src/js/pdf.js +62 -0
- package/src/plugins/Print/print-js/src/js/print.js +102 -0
- package/src/plugins/Print/print-js/src/js/raw-html.js +15 -0
- package/src/plugins/Print/print-js/src/sass/index.scss +14 -0
- package/src/plugins/Print/print-js/src/sass/modules/_colors.scss +10 -0
- package/src/plugins/Print/print-js/src/sass/partials/_modal.scss +41 -0
- package/src/plugins/Print/print-js/src/sass/partials/_spinner.scss +46 -0
- package/src/plugins/Print/print.js +2 -0
- package/src/plugins/Print/print.scss +1 -0
- package/src/plugins/SetMenuTree/index.vue +41 -0
- package/src/plugins/SetMenuTree/logoIcon.vue +37 -0
- package/src/plugins/SetMenuTree/setmenutree.vue +427 -0
- package/src/plugins/SetMenuTree/utils.js +74 -0
- package/src/plugins/Sign/InfosecNetSignCNGAgent.min.js +2000 -0
- package/src/plugins/Sign/index.js +65 -0
- package/src/plugins/Sign/sign.js +1 -0
- package/src/plugins/setTabsForSub.js +2 -0
- package/src/utils/auth.js +53 -0
- package/src/utils/axios.js +203 -0
- package/src/utils/downloadBlob.js +19 -0
- package/src/utils/forEachs.js +16 -0
- package/src/utils/getScrollContainer.js +43 -0
- package/src/utils/i18n/cn2hk.json +1270 -0
- package/src/utils/i18n/index.js +54 -0
- package/src/utils/list2tree.js +36 -0
- package/src/utils/msgboxPor.js +26 -0
- package/src/utils/print.js +161 -0
- package/src/utils/relaNo.js +35 -0
- package/src/utils/repairElementUI.js +66 -0
- package/src/utils/urlToGo.js +82 -0
- package/style/css/normalize.scss +723 -0
- package/style/fonts/element-icons.535877f5.woff +0 -0
- package/style/fonts/element-icons.732389de.ttf +0 -0
- package/style/index.css +3 -0
- package/style/index.css.map +1 -0
- package/style/index.umd.min.js +2 -0
- package/style/index.umd.min.js.map +1 -0
- package/style/pageDemo/demo-1.vue +130 -0
- package/style/pageDemo/demo-2.vue +35 -0
- package/style/pageDemo/demo-3.vue +22 -0
- package/style/pageDemo/seeCode.js +20 -0
- package/style/server-config.jsonc +663 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
@import './element-variables.scss';
|
|
2
|
+
$--color-FFBF00: #ffbf00;
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
// Color
|
|
6
|
+
--color-primary: #{$--color-primary};
|
|
7
|
+
--color-white: #{$--color-white};
|
|
8
|
+
--color-black: #{$--color-black};
|
|
9
|
+
--color-primary-light-1: #{$--color-primary-light-1};
|
|
10
|
+
--color-primary-light-2: #{$--color-primary-light-2};
|
|
11
|
+
--color-primary-light-3: #{$--color-primary-light-3};
|
|
12
|
+
--color-primary-light-4: #{$--color-primary-light-4};
|
|
13
|
+
--color-primary-light-5: #{$--color-primary-light-5};
|
|
14
|
+
--color-primary-light-6: #{$--color-primary-light-6};
|
|
15
|
+
--color-primary-light-7: #{$--color-primary-light-7};
|
|
16
|
+
--color-primary-light-8: #{$--color-primary-light-8};
|
|
17
|
+
--color-primary-light-9: #{$--color-primary-light-9};
|
|
18
|
+
--color-success: #{$--color-success};
|
|
19
|
+
--color-warning: #{$--color-warning};
|
|
20
|
+
--color-danger: #{$--color-danger};
|
|
21
|
+
--color-info: #{$--color-info};
|
|
22
|
+
--color-success-light: #{$--color-success-light};
|
|
23
|
+
--color-warning-light: #{$--color-warning-light};
|
|
24
|
+
--color-danger-light: #{$--color-danger-light};
|
|
25
|
+
--color-info-light: #{$--color-info-light};
|
|
26
|
+
--color-success-lighter: #{$--color-success-lighter};
|
|
27
|
+
--color-warning-lighter: #{$--color-warning-lighter};
|
|
28
|
+
--color-danger-lighter: #{$--color-danger-lighter};
|
|
29
|
+
--color-info-lighter: #{$--color-info-lighter};
|
|
30
|
+
--button-disabled-background-color: #{$--button-disabled-background-color};
|
|
31
|
+
|
|
32
|
+
--color-mask: #{rgba($--color-black, 0.45)};
|
|
33
|
+
|
|
34
|
+
--color-primary-hover: #{$--color-primary-hover};
|
|
35
|
+
--color-success-hover: #{$--color-success-hover};
|
|
36
|
+
--color-warning-hover: #{$--color-warning-hover};
|
|
37
|
+
--color-danger-hover: #{$--color-danger-hover};
|
|
38
|
+
--color-info-hover: #{$--color-info-hover};
|
|
39
|
+
|
|
40
|
+
--color-primary-01: #{rgba($--color-primary, 0.1)};
|
|
41
|
+
--color-primary-04: #{rgba($--color-primary, 0.4)};
|
|
42
|
+
|
|
43
|
+
--color-warning-01: #{rgba($--color-warning, 0.1)};
|
|
44
|
+
--color-warning-04: #{rgba($--color-warning, 0.4)};
|
|
45
|
+
|
|
46
|
+
--color-FFBF00: #{$--color-FFBF00};
|
|
47
|
+
--color-FFBF00-hover: #{mix($--color-black, $--color-FFBF00, 10%)};
|
|
48
|
+
--color-FFBF00-01: #{rgba($--color-FFBF00, 0.1)};
|
|
49
|
+
--color-FFBF00-04: #{rgba($--color-FFBF00, 0.4)};
|
|
50
|
+
|
|
51
|
+
--color-success-01: #{rgba($--color-success, 0.1)};
|
|
52
|
+
--color-success-04: #{rgba($--color-success, 0.4)};
|
|
53
|
+
|
|
54
|
+
// Text
|
|
55
|
+
--color-text-primary: #{$--color-text-primary};
|
|
56
|
+
--color-text-regular: #{$--color-text-regular};
|
|
57
|
+
--color-text-secondary: #{$--color-text-secondary};
|
|
58
|
+
--color-text-placeholder: #{$--color-text-placeholder};
|
|
59
|
+
// Border
|
|
60
|
+
--border-color-base: #{$--border-color-base};
|
|
61
|
+
--border-color-light: #{$--border-color-light};
|
|
62
|
+
--table-row-hover-background-color: #{$--table-row-hover-background-color};
|
|
63
|
+
--border-color-lighter: #{$--border-color-lighter};
|
|
64
|
+
--border-color-extra-light: #{$--border-color-extra-light};
|
|
65
|
+
// Background
|
|
66
|
+
--background-color-base: #{$--background-color-base};
|
|
67
|
+
--button-default-border-color: #{$--button-default-border-color};
|
|
68
|
+
// Link
|
|
69
|
+
--link-color: #{$--link-color};
|
|
70
|
+
--link-hover-color: #{$--link-hover-color};
|
|
71
|
+
// fontSize
|
|
72
|
+
--font-family-pingfang: 'Pingfang SC';
|
|
73
|
+
--font-family-yahei: 'Microsoft YaHe';
|
|
74
|
+
--font-size-extra-large: #{$--font-size-extra-large};
|
|
75
|
+
--font-size-large: #{$--font-size-large};
|
|
76
|
+
--font-size-medium: #{$--font-size-medium};
|
|
77
|
+
--font-size-base: #{$--font-size-base};
|
|
78
|
+
--font-size-small: #{$--font-size-small};
|
|
79
|
+
--font-size-extra-small: #{$--font-size-extra-small};
|
|
80
|
+
// fontWeight
|
|
81
|
+
--font-weight-bold: #{$--font-weight-bold};
|
|
82
|
+
--font-weight-primary: #{$--font-weight-primary};
|
|
83
|
+
--font-weight-secondary: #{$--font-weight-secondary};
|
|
84
|
+
// fontLineHeight
|
|
85
|
+
--font-line-height-primary: #{$--font-line-height-primary};
|
|
86
|
+
--font-line-height-secondary: #{$--font-line-height-secondary};
|
|
87
|
+
--font-color-disabled-base: #{$--font-color-disabled-base};
|
|
88
|
+
// Size
|
|
89
|
+
--size-base: #{$--size-base};
|
|
90
|
+
// Icon
|
|
91
|
+
--icon-color: #{$--icon-color};
|
|
92
|
+
--icon-color-base: #{$--icon-color-base};
|
|
93
|
+
// Radius
|
|
94
|
+
--border-radius-base: #{$--border-radius-base};
|
|
95
|
+
|
|
96
|
+
// line-height
|
|
97
|
+
--line-height-16: 16px;
|
|
98
|
+
--line-height-18: 18px;
|
|
99
|
+
--line-height-22: 22px;
|
|
100
|
+
--line-height-24: 24px;
|
|
101
|
+
--line-height-28: 28px;
|
|
102
|
+
--line-height-32: 32px;
|
|
103
|
+
|
|
104
|
+
--background-linear-gradient: linear-gradient(
|
|
105
|
+
to bottom right,
|
|
106
|
+
#{mix($--color-white, $--color-primary, 8.5%)},
|
|
107
|
+
#{$--color-primary}
|
|
108
|
+
);
|
|
109
|
+
--color-success-linear-gradient: linear-gradient(
|
|
110
|
+
to bottom right,
|
|
111
|
+
#{mix($--color-white, $--color-success, 8.5%)},
|
|
112
|
+
#{$--color-success}
|
|
113
|
+
);
|
|
114
|
+
--color-FFBF00-linear-gradient: linear-gradient(
|
|
115
|
+
to bottom right,
|
|
116
|
+
#{mix($--color-white, $--color-FFBF00, 8.5%)},
|
|
117
|
+
#{$--color-FFBF00}
|
|
118
|
+
);
|
|
119
|
+
--color-warning-linear-gradient: linear-gradient(
|
|
120
|
+
to bottom right,
|
|
121
|
+
#{mix($--color-white, $--color-warning, 8.5%)},
|
|
122
|
+
#{$--color-warning}
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
--color-F48393: #f48393;
|
|
126
|
+
--color-F4CC7A: #f4cc7a;
|
|
127
|
+
--color-63D9AE: #63d9ae;
|
|
128
|
+
--color-73A0FA: #73a0fa;
|
|
129
|
+
--color-83D0EF: #83d0ef;
|
|
130
|
+
--color-BEE56F: #bee56f;
|
|
131
|
+
--color-EADF72: #eadf72;
|
|
132
|
+
--color-F1B688: #f1b688;
|
|
133
|
+
--color-F9C0B5: #f9c0b5;
|
|
134
|
+
--color-F49583: #f49583;
|
|
135
|
+
--color-EC5E5E: #ec5e5e;
|
|
136
|
+
--color-AE89E0: #ae89e0;
|
|
137
|
+
--color-5F5CD2: #5f5cd2;
|
|
138
|
+
--color-7585A2: #7585a2;
|
|
139
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.el-select.remote-icon-auto {
|
|
2
|
+
.el-select__caret {
|
|
3
|
+
&::before {
|
|
4
|
+
content: '\E6E1';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
.is-focus {
|
|
8
|
+
.el-select__caret {
|
|
9
|
+
transform: rotate(0deg);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
.el-select.remote-icon {
|
|
14
|
+
.el-select__caret {
|
|
15
|
+
&::before {
|
|
16
|
+
content: '\E6E1';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&.remote-icon-expand {
|
|
20
|
+
.is-focus {
|
|
21
|
+
.el-select__caret {
|
|
22
|
+
transform: rotate(0deg);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* 引入不被打包的配置文件 */
|
|
2
|
+
import stripJsonc from 'strip-json-comments'
|
|
3
|
+
import realUrl from './realUrl'
|
|
4
|
+
/* 前端(内存)缓存 */
|
|
5
|
+
const jsoncs = {}
|
|
6
|
+
|
|
7
|
+
export default function getJsonc(url, sync) {
|
|
8
|
+
const _url = realUrl(url)
|
|
9
|
+
if (sync) {
|
|
10
|
+
if (jsoncs[url + '?sync']) {
|
|
11
|
+
return jsoncs[url + '?sync']
|
|
12
|
+
} else {
|
|
13
|
+
const oAjax = new XMLHttpRequest()
|
|
14
|
+
oAjax.open('GET', _url, false)
|
|
15
|
+
oAjax.send()
|
|
16
|
+
if (oAjax.readyState === 4 && oAjax.status === 200) {
|
|
17
|
+
try {
|
|
18
|
+
const _data = JSON.parse(stripJsonc(oAjax.responseText))
|
|
19
|
+
jsoncs[url + '?sync'] = _data
|
|
20
|
+
jsoncs[url] = Promise.resolve(_data)
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw { error: url + ' illegal file', content: oAjax.responseText }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return jsoncs[url + '?sync']
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
if (jsoncs[url]) {
|
|
29
|
+
return jsoncs[url]
|
|
30
|
+
} else {
|
|
31
|
+
const oAjax = new XMLHttpRequest()
|
|
32
|
+
oAjax.open('GET', _url, true)
|
|
33
|
+
oAjax.send()
|
|
34
|
+
jsoncs[url] = new Promise((resolve, reject) => {
|
|
35
|
+
oAjax.onreadystatechange = () => {
|
|
36
|
+
if (oAjax.readyState === 4 && oAjax.status === 200) {
|
|
37
|
+
try {
|
|
38
|
+
const _data = JSON.parse(stripJsonc(oAjax.responseText))
|
|
39
|
+
jsoncs[url + '?sync'] = _data
|
|
40
|
+
resolve(_data)
|
|
41
|
+
} catch (error) {
|
|
42
|
+
throw { error: url + ' illegal file', content: oAjax.responseText }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
return jsoncs[url]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* 前缀,针对乾坤做了处理 */
|
|
2
|
+
const prefix = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ || process.env.BASE_URL || '/'
|
|
3
|
+
|
|
4
|
+
export default function realUrl(url) {
|
|
5
|
+
if (/^http(s)?:|\/\//.test(url)) {
|
|
6
|
+
return url
|
|
7
|
+
} else if (/^\//.test(url)) {
|
|
8
|
+
return prefix + url.replace(/^\//, '')
|
|
9
|
+
} else {
|
|
10
|
+
return url
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ExpandablePane :id="id" :default-expand.sync="show" :title="title"
|
|
3
|
+
><slot></slot
|
|
4
|
+
></ExpandablePane>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import ExpandablePane from '../Expandable/main.vue'
|
|
9
|
+
export default {
|
|
10
|
+
name: 'AnchorItem',
|
|
11
|
+
components: {
|
|
12
|
+
ExpandablePane
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
title: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: undefined
|
|
18
|
+
},
|
|
19
|
+
id: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ''
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
show: true
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-scrollbar id="page-scrollbar" style="height: 100%">
|
|
3
|
+
<div ref="Anchor">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
<ul class="n20-anchor">
|
|
6
|
+
<li
|
|
7
|
+
v-for="(item, index) in AnchorNavList"
|
|
8
|
+
:key="index"
|
|
9
|
+
:class="[
|
|
10
|
+
'n20-anchor-item',
|
|
11
|
+
value === item.id ? 'n20-anchor-activit' : ''
|
|
12
|
+
]"
|
|
13
|
+
@click="getAnchorItem(item.id, index)"
|
|
14
|
+
>
|
|
15
|
+
{{ item.title }}
|
|
16
|
+
</li>
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
</el-scrollbar>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import {
|
|
24
|
+
getScrollContainer,
|
|
25
|
+
vueDebounce
|
|
26
|
+
} from '../../utils/getScrollContainer.js'
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: 'Anchor',
|
|
30
|
+
props: {
|
|
31
|
+
scrollDom: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: ''
|
|
34
|
+
},
|
|
35
|
+
// 默认选中tab按钮
|
|
36
|
+
value: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: ''
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
AnchorNavList: [], // 按钮数据
|
|
44
|
+
AnchorNavMap: {}, // 楼层高度的映射
|
|
45
|
+
scrollDisabled: false, //禁止滚动函数执行
|
|
46
|
+
valueType: 1, //当前楼层改变的类型,1是组件传递、按钮直达改变,2是通过滚动监听自动改变
|
|
47
|
+
scrollFunDebounceFun: vueDebounce('scrollFun', 100)
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
scrollWrap() {
|
|
52
|
+
if (this.scrollDom) {
|
|
53
|
+
return document.querySelector(this.scrollDom)
|
|
54
|
+
} else {
|
|
55
|
+
return getScrollContainer(this.$refs.Anchor, true)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
watch: {
|
|
60
|
+
// 监听楼层变化,当为父组件传递,或者按钮直达时,手动滚动到当前楼层
|
|
61
|
+
value: function (val) {
|
|
62
|
+
this.valueType === 1 && this.scrollDomFun(this.AnchorNavMap[val])
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
async mounted() {
|
|
66
|
+
await this.init()
|
|
67
|
+
// 如果传了当前楼层,直接到达对应的高度
|
|
68
|
+
if (this.value) {
|
|
69
|
+
this.scrollWrap.scrollTop = this.AnchorNavMap[this.value]
|
|
70
|
+
} else {
|
|
71
|
+
//没有传楼层,则根据当前高度自动获取
|
|
72
|
+
this.getAnchorValue(this.scrollWrap.scrollTop)
|
|
73
|
+
}
|
|
74
|
+
this.scrollWrap.addEventListener('scroll', this.scrollFunDebounce)
|
|
75
|
+
},
|
|
76
|
+
beforeDestroy() {
|
|
77
|
+
this.scrollWrap.removeEventListener('scroll', this.scrollFunDebounce)
|
|
78
|
+
},
|
|
79
|
+
methods: {
|
|
80
|
+
// 初始化,获取电梯按钮数据,获取楼层高度映射
|
|
81
|
+
init() {
|
|
82
|
+
let parentTop =
|
|
83
|
+
this.$refs.Anchor.getBoundingClientRect().top -
|
|
84
|
+
this.scrollWrap.getBoundingClientRect().top
|
|
85
|
+
let list = this.$children[0].$children.map((item) => {
|
|
86
|
+
let rect = item.$el.getBoundingClientRect()
|
|
87
|
+
let itemScrollTop = item.$el.offsetTop
|
|
88
|
+
this.AnchorNavMap[item.id] = itemScrollTop
|
|
89
|
+
return {
|
|
90
|
+
scrollTop: itemScrollTop,
|
|
91
|
+
top: rect.top - parentTop,
|
|
92
|
+
bottom: rect.bottom - parentTop,
|
|
93
|
+
height: rect.height,
|
|
94
|
+
title: item.title,
|
|
95
|
+
id: item.id
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
// 去掉多余的节点
|
|
99
|
+
this.AnchorNavList = list.filter(
|
|
100
|
+
(val) => val.id !== undefined && val.title !== undefined
|
|
101
|
+
)
|
|
102
|
+
},
|
|
103
|
+
//滚动的函数
|
|
104
|
+
scrollFun(e) {
|
|
105
|
+
this.getAnchorValue(e.target.scrollTop)
|
|
106
|
+
},
|
|
107
|
+
scrollFunDebounce(e) {
|
|
108
|
+
!this.scrollDisabled && this.scrollFunDebounceFun(e)
|
|
109
|
+
},
|
|
110
|
+
// 根据当前高度获取楼层位置
|
|
111
|
+
getAnchorValue(scrollTop) {
|
|
112
|
+
let arr = []
|
|
113
|
+
for (let i = 0; i < this.AnchorNavList.length; i++) {
|
|
114
|
+
let item = this.AnchorNavList[i]
|
|
115
|
+
let height = this.scrollWrap.getBoundingClientRect().height + scrollTop
|
|
116
|
+
let value = 0
|
|
117
|
+
if (scrollTop <= item.top) {
|
|
118
|
+
value = height - item.top
|
|
119
|
+
if (value > item.height) {
|
|
120
|
+
value = item.height
|
|
121
|
+
} else if (value < 0) {
|
|
122
|
+
value = 0
|
|
123
|
+
}
|
|
124
|
+
} else if (scrollTop > item.top && scrollTop <= item.bottom) {
|
|
125
|
+
value = item.bottom - scrollTop
|
|
126
|
+
}
|
|
127
|
+
value = value / item.height
|
|
128
|
+
arr.push(value)
|
|
129
|
+
}
|
|
130
|
+
let max = Math.max(...arr)
|
|
131
|
+
for (let i = 0; i < arr.length; i++) {
|
|
132
|
+
if (arr[i] === max) {
|
|
133
|
+
this.valueType = 2
|
|
134
|
+
this.$emit('input', this.AnchorNavList[i].id)
|
|
135
|
+
break
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
getAnchorItem(id, i) {
|
|
140
|
+
//直达楼层
|
|
141
|
+
if (id === this.value || this.scrollDisabled) {
|
|
142
|
+
return
|
|
143
|
+
}
|
|
144
|
+
this.$children[0].$children[i].show = true
|
|
145
|
+
this.valueType = 1
|
|
146
|
+
this.$emit('input', id)
|
|
147
|
+
},
|
|
148
|
+
// 模拟滚动
|
|
149
|
+
scrollDomFun(itemScrollTop) {
|
|
150
|
+
this.scrollDisabled = true //模拟滚动过程中,禁用直达楼层和监听的滚动事件
|
|
151
|
+
let speed = 50
|
|
152
|
+
let scrollTop = this.scrollWrap.scrollTop
|
|
153
|
+
if (itemScrollTop > scrollTop) {
|
|
154
|
+
// 向下滚动
|
|
155
|
+
let timer = setInterval(() => {
|
|
156
|
+
scrollTop += speed
|
|
157
|
+
if (scrollTop < itemScrollTop) {
|
|
158
|
+
this.scrollWrap.scrollTop = scrollTop
|
|
159
|
+
} else {
|
|
160
|
+
this.scrollWrap.scrollTop = itemScrollTop
|
|
161
|
+
clearInterval(timer)
|
|
162
|
+
setTimeout(() => {
|
|
163
|
+
this.scrollDisabled = false
|
|
164
|
+
}, 100)
|
|
165
|
+
}
|
|
166
|
+
}, 20)
|
|
167
|
+
} else {
|
|
168
|
+
// 向上滚动
|
|
169
|
+
let timer = setInterval(() => {
|
|
170
|
+
scrollTop -= speed
|
|
171
|
+
if (scrollTop >= itemScrollTop) {
|
|
172
|
+
this.scrollWrap.scrollTop = scrollTop
|
|
173
|
+
} else {
|
|
174
|
+
this.scrollWrap.scrollTop = itemScrollTop
|
|
175
|
+
clearInterval(timer)
|
|
176
|
+
setTimeout(() => {
|
|
177
|
+
this.scrollDisabled = false
|
|
178
|
+
}, 100)
|
|
179
|
+
}
|
|
180
|
+
}, 20)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
</script>
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/* 审批按钮组 */
|
|
2
|
+
<template>
|
|
3
|
+
<div>
|
|
4
|
+
<el-form label-position="left" label-width="5em">
|
|
5
|
+
<el-form-item label="审批意见" :error="errMsg">
|
|
6
|
+
<el-input
|
|
7
|
+
ref="msg-input"
|
|
8
|
+
v-model="messageC"
|
|
9
|
+
type="textarea"
|
|
10
|
+
placeholder="请输入操作意见(50字以内),批准该意见为非必填,驳回/作废该意见为必填!"
|
|
11
|
+
:maxlength="50"
|
|
12
|
+
:autosize="{ minRows: 1 }"
|
|
13
|
+
/>
|
|
14
|
+
</el-form-item>
|
|
15
|
+
</el-form>
|
|
16
|
+
|
|
17
|
+
<div class="text-c">
|
|
18
|
+
<el-button plain @click="goFrom">返 回</el-button>
|
|
19
|
+
<el-button v-if="authList.includes('reject')" plain @click="rejectFn"
|
|
20
|
+
>驳回至发起人</el-button
|
|
21
|
+
>
|
|
22
|
+
<el-button
|
|
23
|
+
v-if="authList.includes('rejectPre')"
|
|
24
|
+
plain
|
|
25
|
+
@click="rejectPreFn"
|
|
26
|
+
>驳回至上一节点</el-button
|
|
27
|
+
>
|
|
28
|
+
<el-button
|
|
29
|
+
v-if="authList.includes('approval')"
|
|
30
|
+
type="primary"
|
|
31
|
+
@click="approvalFn"
|
|
32
|
+
>批 准</el-button
|
|
33
|
+
>
|
|
34
|
+
<el-button
|
|
35
|
+
v-if="authList.includes('discard')"
|
|
36
|
+
type="danger"
|
|
37
|
+
plain
|
|
38
|
+
@click="discardFn"
|
|
39
|
+
>作 废</el-button
|
|
40
|
+
>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
import axios from '../../utils/axios'
|
|
47
|
+
import { linkGo } from '../../utils/urlToGo'
|
|
48
|
+
import { closeTagsForBackPage } from '../../plugins/CompatibleOld'
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
name: 'ApprovalButtons',
|
|
52
|
+
props: {
|
|
53
|
+
message: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: ''
|
|
56
|
+
},
|
|
57
|
+
formData: {
|
|
58
|
+
type: Object,
|
|
59
|
+
default: () => ({})
|
|
60
|
+
},
|
|
61
|
+
signText: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: undefined
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
data() {
|
|
67
|
+
this.msgisSync = !!this.$listeners['update:message']
|
|
68
|
+
return {
|
|
69
|
+
messageIn: '',
|
|
70
|
+
errMsg: undefined,
|
|
71
|
+
taskId: '',
|
|
72
|
+
taskDefKey: '',
|
|
73
|
+
authList: []
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
computed: {
|
|
77
|
+
messageC: {
|
|
78
|
+
get() {
|
|
79
|
+
return this.msgisSync ? this.message : this.messageIn
|
|
80
|
+
},
|
|
81
|
+
set(val) {
|
|
82
|
+
if (this.msgisSync) {
|
|
83
|
+
this.$emit('update:message', val)
|
|
84
|
+
} else {
|
|
85
|
+
this.messageIn = val
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
created() {
|
|
91
|
+
this.taskId = this.$route.query.taskId
|
|
92
|
+
this.getBtns()
|
|
93
|
+
},
|
|
94
|
+
methods: {
|
|
95
|
+
// 换回到发起页
|
|
96
|
+
goFrom() {
|
|
97
|
+
let pathname = location.pathname
|
|
98
|
+
linkGo()
|
|
99
|
+
this.$nextTick(() => {
|
|
100
|
+
closeTagsForBackPage(pathname)
|
|
101
|
+
})
|
|
102
|
+
},
|
|
103
|
+
// 动态获取按钮
|
|
104
|
+
getBtns() {
|
|
105
|
+
if (!this.taskId) return false
|
|
106
|
+
|
|
107
|
+
axios
|
|
108
|
+
.get('/bems/activiti/admin/todo/authList/' + this.taskId, null, {
|
|
109
|
+
loading: false,
|
|
110
|
+
noMsg: true
|
|
111
|
+
})
|
|
112
|
+
.then(({ data = {} }) => {
|
|
113
|
+
let { taskDefKey, menuAuthority } = data
|
|
114
|
+
|
|
115
|
+
this.taskDefKey = taskDefKey
|
|
116
|
+
|
|
117
|
+
if (menuAuthority) {
|
|
118
|
+
this.authList = menuAuthority.split('|')
|
|
119
|
+
} else {
|
|
120
|
+
this.authList = ['reject', 'rejectPre', 'approval', 'discard']
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
.catch(() => {
|
|
124
|
+
this.authList = ['reject', 'rejectPre', 'approval', 'discard']
|
|
125
|
+
})
|
|
126
|
+
},
|
|
127
|
+
// 获取提交参数
|
|
128
|
+
getParam() {
|
|
129
|
+
let { typeCode, taskId, groupNo } = this.$route.query
|
|
130
|
+
return [
|
|
131
|
+
{
|
|
132
|
+
typeCode,
|
|
133
|
+
taskId,
|
|
134
|
+
groupNo,
|
|
135
|
+
taskDefKey: this.taskDefKey,
|
|
136
|
+
message: this.messageC,
|
|
137
|
+
formData: JSON.stringify(this.formData),
|
|
138
|
+
signText: this.signText
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
// 提交后的提示
|
|
143
|
+
thenMsg(data = {}, str = '操作') {
|
|
144
|
+
let { failCount, failList = {} } = data
|
|
145
|
+
if (failCount > 0) {
|
|
146
|
+
if (Array.isArray(failList)) {
|
|
147
|
+
let _failList = {}
|
|
148
|
+
failList.forEach((f = {}) => {
|
|
149
|
+
Object.assign(_failList, f)
|
|
150
|
+
})
|
|
151
|
+
failList = _failList
|
|
152
|
+
}
|
|
153
|
+
let errArr = Object.values(failList)
|
|
154
|
+
if (errArr.length > 0) {
|
|
155
|
+
this.$message.error(errArr.join('、'))
|
|
156
|
+
} else {
|
|
157
|
+
this.$message.error(str + '失败')
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
this.$message.success(str + '成功')
|
|
161
|
+
this.goFrom()
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
errMsgFn(str = '') {
|
|
165
|
+
this.$refs['msg-input'].focus()
|
|
166
|
+
this.errMsg = str + '操作,意见不能为空'
|
|
167
|
+
setTimeout(() => {
|
|
168
|
+
this.errMsg = undefined
|
|
169
|
+
}, 1000)
|
|
170
|
+
},
|
|
171
|
+
// 如果有前置处理,先执行前置处理
|
|
172
|
+
beforeFn(bFn, callFn) {
|
|
173
|
+
if (!bFn) {
|
|
174
|
+
callFn()
|
|
175
|
+
} else if (bFn instanceof Promise) {
|
|
176
|
+
bFn().then(callFn)
|
|
177
|
+
} else if (bFn instanceof Function) {
|
|
178
|
+
bFn(callFn)
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
// 驳回
|
|
182
|
+
rejectFn() {
|
|
183
|
+
if (!this.messageC) {
|
|
184
|
+
return this.errMsgFn('驳回')
|
|
185
|
+
}
|
|
186
|
+
this.beforeFn(this.$attrs.beforeReject, () => {
|
|
187
|
+
axios
|
|
188
|
+
.post('/bems/activiti/admin/todo/reject', this.getParam())
|
|
189
|
+
.then(({ data }) => {
|
|
190
|
+
this.thenMsg(data, '驳回至发起人')
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
},
|
|
194
|
+
// 驳回到上一步
|
|
195
|
+
rejectPreFn() {
|
|
196
|
+
if (!this.messageC) {
|
|
197
|
+
return this.errMsgFn('驳回')
|
|
198
|
+
}
|
|
199
|
+
this.beforeFn(this.$attrs.beforeRejectPre, () => {
|
|
200
|
+
axios
|
|
201
|
+
.post('/bems/activiti/admin/todo/rejectpre', this.getParam())
|
|
202
|
+
.then(({ data }) => {
|
|
203
|
+
this.thenMsg(data, '驳回至上一节')
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
},
|
|
207
|
+
// 审批
|
|
208
|
+
approvalFn() {
|
|
209
|
+
this.beforeFn(this.$attrs.beforeRatify, () => {
|
|
210
|
+
axios
|
|
211
|
+
.post('/bems/activiti/admin/todo/advance', this.getParam())
|
|
212
|
+
.then(({ data }) => {
|
|
213
|
+
this.thenMsg(data, '批准')
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
},
|
|
217
|
+
// 作废
|
|
218
|
+
discardFn() {
|
|
219
|
+
if (!this.messageC) {
|
|
220
|
+
return this.errMsgFn('作废')
|
|
221
|
+
}
|
|
222
|
+
this.beforeFn(this.$attrs.beforeDiscard, () => {
|
|
223
|
+
axios
|
|
224
|
+
.post('/bems/activiti/admin/todo/cancle', this.getParam())
|
|
225
|
+
.then(({ data }) => {
|
|
226
|
+
this.thenMsg(data, '作废')
|
|
227
|
+
})
|
|
228
|
+
})
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
</script>
|