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.
Files changed (196) hide show
  1. package/README.md +27 -0
  2. package/package.json +87 -0
  3. package/src/_qiankun/index.js +113 -0
  4. package/src/_qiankun/postMessage.js +48 -0
  5. package/src/assets/css/_coreLib.scss +35 -0
  6. package/src/assets/css/cl-anchor.scss +24 -0
  7. package/src/assets/css/cl-approve-card.scss +58 -0
  8. package/src/assets/css/cl-dialog.scss +99 -0
  9. package/src/assets/css/cl-drag-list.scss +22 -0
  10. package/src/assets/css/cl-empty.scss +10 -0
  11. package/src/assets/css/cl-expandable-pane.scss +25 -0
  12. package/src/assets/css/cl-expandable.scss +23 -0
  13. package/src/assets/css/cl-file-upload-table.scss +11 -0
  14. package/src/assets/css/cl-filter.scss +4 -0
  15. package/src/assets/css/cl-flow-step.scss +186 -0
  16. package/src/assets/css/cl-footer-box.scss +10 -0
  17. package/src/assets/css/cl-form-item.scss +322 -0
  18. package/src/assets/css/cl-general-card.scss +12 -0
  19. package/src/assets/css/cl-layout-aside.scss +88 -0
  20. package/src/assets/css/cl-layout-content.scss +16 -0
  21. package/src/assets/css/cl-layout-header.scss +73 -0
  22. package/src/assets/css/cl-layout-tabs.scss +87 -0
  23. package/src/assets/css/cl-layout.scss +97 -0
  24. package/src/assets/css/cl-login-temporary.scss +37 -0
  25. package/src/assets/css/cl-message.scss +75 -0
  26. package/src/assets/css/cl-more-tab.scss +98 -0
  27. package/src/assets/css/cl-nav-menu.scss +5 -0
  28. package/src/assets/css/cl-pagination.scss +65 -0
  29. package/src/assets/css/cl-secondary-tab.scss +39 -0
  30. package/src/assets/css/cl-showcolumn.scss +23 -0
  31. package/src/assets/css/cl-sifting.scss +51 -0
  32. package/src/assets/css/cl-statis.scss +42 -0
  33. package/src/assets/css/cl-step.scss +73 -0
  34. package/src/assets/css/cl-suspend.scss +19 -0
  35. package/src/assets/css/cl-tertiary-tab.scss +9 -0
  36. package/src/assets/css/cl-upload.scss +41 -0
  37. package/src/assets/css/cl-worn-pagination.scss +50 -0
  38. package/src/assets/css/el-button.scss +169 -0
  39. package/src/assets/css/el-table.scss +79 -0
  40. package/src/assets/css/element-variables.scss +1061 -0
  41. package/src/assets/css/element.dev.scss +21 -0
  42. package/src/assets/css/font-icon.scss +26 -0
  43. package/src/assets/css/index.dev.scss +4 -0
  44. package/src/assets/css/index.scss +11 -0
  45. package/src/assets/css/normalize.scss +723 -0
  46. package/src/assets/css/rootvar.scss +139 -0
  47. package/src/assets/css/select.scss +26 -0
  48. package/src/assets/css/title-pop.scss +4 -0
  49. package/src/assets/getJsonc.js +50 -0
  50. package/src/assets/realUrl.js +12 -0
  51. package/src/components/Anchor/AnchorItem.vue +30 -0
  52. package/src/components/Anchor/index.vue +185 -0
  53. package/src/components/ApprovalButtons/index.vue +232 -0
  54. package/src/components/ApprovalCard/index.vue +128 -0
  55. package/src/components/ApprovalRecord/approvalImg.vue +39 -0
  56. package/src/components/ApprovalRecord/index.vue +59 -0
  57. package/src/components/Button/button-group.vue +150 -0
  58. package/src/components/Button/icon-group-button.vue +61 -0
  59. package/src/components/Button/index.vue +56 -0
  60. package/src/components/ContentLoading/index.vue +41 -0
  61. package/src/components/ContentNull/index.vue +19 -0
  62. package/src/components/DatePicker/index.vue +27 -0
  63. package/src/components/DatePicker/por.vue +169 -0
  64. package/src/components/Dialog/index.vue +26 -0
  65. package/src/components/Dialog/indexO.vue +116 -0
  66. package/src/components/DragList/index.vue +68 -0
  67. package/src/components/Empty/img/404.png +0 -0
  68. package/src/components/Empty/img/abnormal.svg +109 -0
  69. package/src/components/Empty/img/dispose.svg +72 -0
  70. package/src/components/Empty/img/empty.svg +58 -0
  71. package/src/components/Empty/img/general.svg +59 -0
  72. package/src/components/Empty/img/lock.svg +58 -0
  73. package/src/components/Empty/img/network.svg +60 -0
  74. package/src/components/Empty/img/relevant.svg +69 -0
  75. package/src/components/Empty/img/search.svg +73 -0
  76. package/src/components/Empty/index.vue +92 -0
  77. package/src/components/Expandable/index.vue +49 -0
  78. package/src/components/Expandable/main.vue +52 -0
  79. package/src/components/FileUploadTable/index.vue +484 -0
  80. package/src/components/Filters/index.vue +358 -0
  81. package/src/components/Filters/indexO.vue +104 -0
  82. package/src/components/FlowStep/index.vue +69 -0
  83. package/src/components/FooterBox/index.vue +21 -0
  84. package/src/components/GeneralCard/index.vue +15 -0
  85. package/src/components/InputNumber/index.vue +153 -0
  86. package/src/components/InputNumber/numberRange.vue +47 -0
  87. package/src/components/InputSearch/index.vue +75 -0
  88. package/src/components/Layout/AsideNav/index.vue +144 -0
  89. package/src/components/Layout/HeaderWrap/changePwd.vue +215 -0
  90. package/src/components/Layout/HeaderWrap/index.vue +336 -0
  91. package/src/components/Layout/HeaderWrap/noticePop.vue +300 -0
  92. package/src/components/Layout/SubContent/index.vue +131 -0
  93. package/src/components/Layout/TabsNav/index.vue +170 -0
  94. package/src/components/Layout/index.vue +529 -0
  95. package/src/components/Layout/utils.js +12 -0
  96. package/src/components/LoginTemporary/form.vue +511 -0
  97. package/src/components/LoginTemporary/index.vue +122 -0
  98. package/src/components/LoginTemporary/qr.png +0 -0
  99. package/src/components/LoginTemporary/qrcode.vue +90 -0
  100. package/src/components/LoginTemporary/qrt.png +0 -0
  101. package/src/components/LoginTemporary/retrievePw.vue +28 -0
  102. package/src/components/LoginTemporary/utils.js +73 -0
  103. package/src/components/MicroApp/index.js +67 -0
  104. package/src/components/MicroFrame/index.vue +95 -0
  105. package/src/components/MoreTab/index.vue +232 -0
  106. package/src/components/NavMenu/index.vue +60 -0
  107. package/src/components/NstcG6Components/NstcApprovel/NstcApprovel.vue +13 -0
  108. package/src/components/NstcG6Components/NstcDialog/NstcDialog.vue +185 -0
  109. package/src/components/NstcG6Components/Progress/progress.vue +134 -0
  110. package/src/components/PageLayout/page.vue +15 -0
  111. package/src/components/Pagination/index.vue +96 -0
  112. package/src/components/SecondaryTab/index.vue +58 -0
  113. package/src/components/SelectLazy/index.vue +75 -0
  114. package/src/components/SelectTree/SelectTreeLazy.vue +241 -0
  115. package/src/components/SelectTree/index.vue +208 -0
  116. package/src/components/ShowColumn/index.vue +188 -0
  117. package/src/components/Sifting/index.vue +99 -0
  118. package/src/components/Statis/index.vue +97 -0
  119. package/src/components/Statis/statisItem.vue +54 -0
  120. package/src/components/Statis/statisPopover.vue +55 -0
  121. package/src/components/Step/index.vue +38 -0
  122. package/src/components/Suspend/index.vue +72 -0
  123. package/src/components/Table/index.vue +131 -0
  124. package/src/components/Table/indexO.vue +149 -0
  125. package/src/components/Task/index.vue +26 -0
  126. package/src/components/TertiaryTab/index.vue +53 -0
  127. package/src/components/TimePicker/index.vue +28 -0
  128. package/src/components/Upload/index.vue +242 -0
  129. package/src/components/WornPagination/index.vue +73 -0
  130. package/src/directives/VClickOutside/index.js +19 -0
  131. package/src/directives/VDrag/index.js +72 -0
  132. package/src/directives/VHas/index.js +27 -0
  133. package/src/directives/VMove/index.js +42 -0
  134. package/src/directives/VTitle/index.js +56 -0
  135. package/src/directives/VTitle/tooltip.vue +21 -0
  136. package/src/index.js +225 -0
  137. package/src/plugins/CompatibleOld/index.js +57 -0
  138. package/src/plugins/Print/index.js +4 -0
  139. package/src/plugins/Print/print-js/.babelrc +12 -0
  140. package/src/plugins/Print/print-js/LICENSE +21 -0
  141. package/src/plugins/Print/print-js/README.md +98 -0
  142. package/src/plugins/Print/print-js/dist/print.css +97 -0
  143. package/src/plugins/Print/print-js/dist/print.js +991 -0
  144. package/src/plugins/Print/print-js/dist/print.map +1 -0
  145. package/src/plugins/Print/print-js/package.json +60 -0
  146. package/src/plugins/Print/print-js/src/index.d.ts +45 -0
  147. package/src/plugins/Print/print-js/src/index.js +10 -0
  148. package/src/plugins/Print/print-js/src/js/browser.js +33 -0
  149. package/src/plugins/Print/print-js/src/js/functions.js +103 -0
  150. package/src/plugins/Print/print-js/src/js/html.js +70 -0
  151. package/src/plugins/Print/print-js/src/js/image.js +48 -0
  152. package/src/plugins/Print/print-js/src/js/init.js +168 -0
  153. package/src/plugins/Print/print-js/src/js/json.js +109 -0
  154. package/src/plugins/Print/print-js/src/js/modal.js +62 -0
  155. package/src/plugins/Print/print-js/src/js/pdf.js +62 -0
  156. package/src/plugins/Print/print-js/src/js/print.js +102 -0
  157. package/src/plugins/Print/print-js/src/js/raw-html.js +15 -0
  158. package/src/plugins/Print/print-js/src/sass/index.scss +14 -0
  159. package/src/plugins/Print/print-js/src/sass/modules/_colors.scss +10 -0
  160. package/src/plugins/Print/print-js/src/sass/partials/_modal.scss +41 -0
  161. package/src/plugins/Print/print-js/src/sass/partials/_spinner.scss +46 -0
  162. package/src/plugins/Print/print.js +2 -0
  163. package/src/plugins/Print/print.scss +1 -0
  164. package/src/plugins/SetMenuTree/index.vue +41 -0
  165. package/src/plugins/SetMenuTree/logoIcon.vue +37 -0
  166. package/src/plugins/SetMenuTree/setmenutree.vue +427 -0
  167. package/src/plugins/SetMenuTree/utils.js +74 -0
  168. package/src/plugins/Sign/InfosecNetSignCNGAgent.min.js +2000 -0
  169. package/src/plugins/Sign/index.js +65 -0
  170. package/src/plugins/Sign/sign.js +1 -0
  171. package/src/plugins/setTabsForSub.js +2 -0
  172. package/src/utils/auth.js +53 -0
  173. package/src/utils/axios.js +203 -0
  174. package/src/utils/downloadBlob.js +19 -0
  175. package/src/utils/forEachs.js +16 -0
  176. package/src/utils/getScrollContainer.js +43 -0
  177. package/src/utils/i18n/cn2hk.json +1270 -0
  178. package/src/utils/i18n/index.js +54 -0
  179. package/src/utils/list2tree.js +36 -0
  180. package/src/utils/msgboxPor.js +26 -0
  181. package/src/utils/print.js +161 -0
  182. package/src/utils/relaNo.js +35 -0
  183. package/src/utils/repairElementUI.js +66 -0
  184. package/src/utils/urlToGo.js +82 -0
  185. package/style/css/normalize.scss +723 -0
  186. package/style/fonts/element-icons.535877f5.woff +0 -0
  187. package/style/fonts/element-icons.732389de.ttf +0 -0
  188. package/style/index.css +3 -0
  189. package/style/index.css.map +1 -0
  190. package/style/index.umd.min.js +2 -0
  191. package/style/index.umd.min.js.map +1 -0
  192. package/style/pageDemo/demo-1.vue +130 -0
  193. package/style/pageDemo/demo-2.vue +35 -0
  194. package/style/pageDemo/demo-3.vue +22 -0
  195. package/style/pageDemo/seeCode.js +20 -0
  196. package/style/server-config.jsonc +663 -0
@@ -0,0 +1,185 @@
1
+ <template>
2
+ <el-dialog
3
+ class="Nstc-dialog"
4
+ v-drag
5
+ :visible.sync="dialogVisible"
6
+ v-bind="$attrs"
7
+ :center="center"
8
+ :show-close="showClose"
9
+ :custom-class="customClass"
10
+ :append-to-body="toBody"
11
+ :close-on-click-modal="closeOnClickModal"
12
+ :close-on-press-escape="closeOnPressEscape"
13
+ :before-close="()=>{handleClose()}"
14
+ v-on="$listeners"
15
+ >
16
+ <template slot="title">
17
+ <span class="el-dialog__title">{{ title }}</span>
18
+ <button class="el-dialog__headerbtn" @click="handleClose">
19
+ <i class="el-dialog__close el-icon-close"></i>
20
+ </button>
21
+ </template>
22
+ <slot></slot>
23
+
24
+ <slot name="after"></slot>
25
+ <div
26
+ v-if="showFooter"
27
+ slot="footer"
28
+ class="dialog-footer"
29
+ >
30
+ <el-button
31
+ v-if="footerHandlers.confirm"
32
+ type="primary"
33
+ :disabled="footerHandlers.confirm.disabled || confirmDisabledFlag"
34
+ :class="footerHandlers.confirm.className"
35
+ @click="handleConfirm"
36
+ >
37
+ {{ footerHandlers.confirm.text || '确认' }}
38
+ </el-button>
39
+ <el-button
40
+ v-if="footerHandlers.cancel"
41
+ plain
42
+ :class="footerHandlers.cancel.className"
43
+ @click="handleClose"
44
+ >
45
+ {{ footerHandlers.cancel.text || '取消' }}
46
+ </el-button>
47
+ </div>
48
+ </el-dialog>
49
+ </template>
50
+
51
+ <script>
52
+ export default {
53
+ name: 'NstcDialog',
54
+ props: {
55
+ value: {
56
+ type: Boolean,
57
+ default: false
58
+ },
59
+
60
+ title: {
61
+ type: String,
62
+ default: ''
63
+ },
64
+
65
+ center: {
66
+ type: Boolean,
67
+ default: false
68
+ },
69
+
70
+ footerHandlers: {
71
+ type: Object,
72
+ default: () => {
73
+ return {
74
+ confirm: {
75
+ text: '', //this.$t('common_w_0002')
76
+ className: '',
77
+ disabled: false
78
+ },
79
+ cancel: {
80
+ text: '', // this.t('common_w_0003')
81
+ className: '',
82
+ disabled: false
83
+ }
84
+ }
85
+ },
86
+
87
+ },
88
+ toBody: {
89
+ type: Boolean,
90
+ default: true
91
+ },
92
+ customClass: {
93
+ type: String,
94
+ default: ''
95
+ },
96
+
97
+ showFooter: {
98
+ type: Boolean,
99
+ default: true
100
+ },
101
+
102
+ showClose: {
103
+ type: Boolean,
104
+ default: false
105
+ },
106
+
107
+ /** 是否在点击确认按钮后关闭弹窗 */
108
+ closeAfterConfirm: {
109
+ type: Boolean,
110
+ default: true
111
+ },
112
+
113
+ /** 是否在点击确认按钮后立即关闭弹窗 */
114
+ immediateCloseAfterHandler: {
115
+ type: Boolean,
116
+ default: false
117
+ },
118
+
119
+ closeOnClickModal: {
120
+ type: Boolean,
121
+ default: false
122
+ },
123
+
124
+ closeOnPressEscape: {
125
+ type: Boolean,
126
+ default: false
127
+ },
128
+
129
+ confirmDisabledFlag: {
130
+ type: Boolean,
131
+ default: false
132
+ }
133
+ },
134
+ computed: {
135
+ dialogVisible: {
136
+ get() {
137
+ return this.value
138
+ },
139
+ set(val) {
140
+ this.$emit('input', val)
141
+ }
142
+ }
143
+ },
144
+ methods: {
145
+ handleConfirm() {
146
+ this.handleListeners('confirm')
147
+ },
148
+
149
+ handleClose() {
150
+ this.handleListeners('cancel')
151
+ },
152
+
153
+ async handleListeners(type) {
154
+ this.loading = true
155
+ try {
156
+ const listener = this.$listeners[type]
157
+ const closeAfterListener = this.closeAfterConfirm || type === 'cancel'
158
+
159
+ if (this.immediateCloseAfterHandler) {
160
+ if (closeAfterListener) {
161
+ this.dialogVisible = false
162
+ }
163
+
164
+ listener && await listener()
165
+ } else {
166
+ listener && await listener()
167
+
168
+ if (closeAfterListener) {
169
+ this.dialogVisible = false
170
+ }
171
+ }
172
+ } catch (err) {
173
+ console.error(err)
174
+
175
+ err && err.type === 'VALIDATE_ERROR' && this.$message({
176
+ type: 'warning',
177
+ message: err.msg
178
+ })
179
+ } finally {
180
+ this.loading = false
181
+ }
182
+ }
183
+ }
184
+ }
185
+ </script>
@@ -0,0 +1,134 @@
1
+ <template>
2
+ <div class="nstc-approvel-examination">
3
+ <div slot="title">
4
+ <div
5
+ style="
6
+ height: 36px;
7
+ display: flex;
8
+ justify-content: flex-end;
9
+ align-items: center;
10
+ position: absolute;
11
+ top: 0;
12
+ right: 100px;
13
+ z-index: 999;
14
+ "
15
+ >
16
+ </div>
17
+ </div>
18
+ <div>
19
+ <div style="margin: auto">
20
+ <div v-for="(item, index) in approvalTable" :key="index">
21
+ <div style="display: flex; align-items: center;">
22
+ <div style="width: 200px; color: #bec8d2">{{ item.endTime }}</div>
23
+ <div
24
+ style="
25
+ width: 19px;
26
+ height: 19px;
27
+ line-height: 17px;
28
+ background: #fff;
29
+ border-radius: 10px;
30
+ color: #ccc;
31
+ text-align: center;
32
+ border: 1px solid #ccc;
33
+ font-size: 8px;
34
+ "
35
+ :style="item.endTime ? 'background:#1677FF' : ''"
36
+ ></div>
37
+ <img
38
+ src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAACa0lEQVQ4T5WTW0hTcRzHv7+/O25RMYUk6AIGXQyUeeqEwo7Fwh3p4oNQIvWUD0bPUURUUAlFbz2F0EvRSyuigpTtmAN3ll1Wm7pQEV+6QUlkkbLbOb/Yyphr6vo//n7f3+f/uxIWeQOhuMsU6YvM2A3AAjBggzi/V3VNFAuhYsZ+Y7jJgvWQQN3pdOKeZFslgMwRhnUSgryaW44VxhUBMfmN2JgAXfCq9b78AP1ZrJMt7tJUuXFZkD40up3NjK6p8oZCsc/nK6tYv/ULVjjqtB01n/L9/2SkG68bGeKGpspysbID4egkQ7S1uF3xpUGRiJMTtg/CVra5ubHuc764LxitLpMwmnSYa1sVZW5JUNYZCMWuA9gmZWyHPJ7an1mbHplycuLHY4J44VVdp5ftUVbQ2ztpl5yzt8DYw8x9IAgA+wkIVDrMY4qipEsCZUXByMSaTDJx2GKrhQCLCH1kSz1obmj4WtIe9YeHOxjmKbDYAvB7BlK5QIKdmDYyeEyQuNbsdt0v2qN4PF7+cSZ1myBqhcCZqfKM/3hBCb54vLxyJnmQSVwlxsv8Mv+OXw9He5ipOvkt09baunAihaUYxvjqWcw9IYi3mlp/4nfCAPxDww1k8iNpJdd4ZHlmsfvLtw8OvqlKCBonWAe86s7nOVDAiN0E8E5T6y+VApnX+EPRbgLWaU1y5x9QNATgiqbKvf8DemqM7Muwea6lSXbnQHo4dhlgGXbzqFdRvpcCC0ajFelZ3AEwoqny2RwoGAw6UlJFDxF1gFkqBQSi7FLelVLOLo9nU2LB0Wavu6pqV0mg6elX6fb2dnP+01+5XvET5hOqAQAAAABJRU5ErkJggg=="
39
+ style="
40
+ vertical-align: bottom;
41
+ width: 18px;
42
+ height: 18px;
43
+ margin-right: 10px;
44
+ "
45
+ />
46
+ <span
47
+ style="margin-left: 10px; max-width: 300px; color: #434f5c"
48
+ :title="item.more"
49
+ >
50
+ {{ item.assignee }}
51
+ </span>
52
+ <span
53
+ style="margin-left: 10px; color: #434f5c"
54
+ v-if="item.optResult"
55
+ >{{ item.optResult }}</span
56
+ >
57
+ <el-tooltip
58
+ v-if="item.suggestion && item.suggestion.length > 40"
59
+ effect="dark"
60
+ :content="item.suggestion"
61
+ placement="top"
62
+ >
63
+ <span
64
+ style="margin-left: 10px; color: #434f5c"
65
+ :class="(item.suggestion && item.suggestion.length > 40 ) ? 'hidden': ''"
66
+ v-if="item.suggestion"
67
+ >审批意见:{{ item.suggestion }}</span
68
+ >
69
+ </el-tooltip>
70
+
71
+
72
+ </div>
73
+ <div
74
+ v-if="approvalTable.length !== index + 1"
75
+ style="
76
+ width: 2px;
77
+ height: 20px;
78
+ background: #ccc;
79
+ margin: 2px 9px;
80
+ margin-left: 209px;
81
+ "
82
+ :style="item.endTime ? 'background:#1677FF' : ''"
83
+ ></div>
84
+ </div>
85
+ </div>
86
+ </div>
87
+ <el-dialog title="查看流程" :visible.sync="dialogVisible" width="1200px">
88
+ <div v-html="svgHtml"></div>
89
+ </el-dialog>
90
+ </div>
91
+ </template>
92
+
93
+ <script>
94
+ import axios from '../../../utils/axios'
95
+ export default {
96
+ name: "progress",
97
+ mounted() {
98
+ this.bizFlowId =
99
+ this.$route.query.processInstanceId || this.$route.params.processInstanceId || "0cf3ec79c7b048c9add24dd03c95332a";
100
+ this.intData(this.bizFlowId);
101
+ },
102
+ methods: {
103
+ intData(bizFlowId) {
104
+ axios.get(`/bems/activiti/sample/Q003`,{procInstId:bizFlowId}).then((res) => {
105
+ if (res) {
106
+ this.approvalTable = res.map((item) => {
107
+ item.more = item.assignee;
108
+ if (item.assignee && item.assignee.length > 20) {
109
+ item.assignee = item.assignee.substring(1, 20) + "...";
110
+ }
111
+ return item;
112
+ });
113
+ }
114
+ });
115
+ axios.get(`/bems/activiti/sample/Q004`,{procInstId:bizFlowId}).then((res) => {
116
+ if (res) {
117
+ this.svgHtml = res;
118
+ }
119
+ });
120
+ },
121
+ },
122
+ watch: {
123
+ bizFlowId() {
124
+ if (this.bizFlowId.length > 0) {
125
+ this.intData(this.bizFlowId);
126
+ }
127
+ },
128
+ },
129
+ }
130
+ </script>
131
+
132
+ <style scoped>
133
+
134
+ </style>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <div class="flex-column">
3
+ <slot name="header"></slot>
4
+ <div class="n20-page-content flex-item">
5
+ <slot></slot>
6
+ </div>
7
+ <slot name="footer"></slot>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ export default {
13
+ name: 'Page'
14
+ }
15
+ </script>
@@ -0,0 +1,96 @@
1
+ <template>
2
+ <div class="n20-pagination">
3
+ <el-pagination
4
+ layout="prev,next,slot,jumper"
5
+ :current-page.sync="pageObj[pageKey.no]"
6
+ :page-size="pageObj[pageKey.size]"
7
+ :total="pageObj[pageKey.total]"
8
+ :size="size"
9
+ @current-change="setnoOrsize"
10
+ >
11
+ <span class="n20-pagination-total"
12
+ ><span class="n20-pagination-no">{{ pageObj[pageKey.no] }}</span
13
+ >/{{ max }}</span
14
+ >
15
+ <span class="el-pagination__sizes">
16
+ <el-select
17
+ v-model="pageObj[pageKey.size]"
18
+ size="mini"
19
+ popper-class="el-pagination__sizes-popper"
20
+ @change="setnoOrsize"
21
+ >
22
+ <el-option
23
+ v-for="item in pageSizes"
24
+ :key="item"
25
+ :value="item"
26
+ :label="item + '条/页'"
27
+ />
28
+ <el-option
29
+ :value="pageObj[pageKey.size]"
30
+ :label="pageObj[pageKey.size] + '条/页'"
31
+ style="display: none"
32
+ />
33
+ </el-select>
34
+ </span>
35
+ </el-pagination>
36
+ </div>
37
+ </template>
38
+
39
+ <script>
40
+ export default {
41
+ name: 'Pagination',
42
+ props: {
43
+ size: {
44
+ type: String,
45
+ default: 'mini'
46
+ },
47
+ pageObj: {
48
+ type: Object,
49
+ default: () => ({
50
+ no: 1,
51
+ size: 20,
52
+ total: 0
53
+ })
54
+ },
55
+ pageKey: {
56
+ type: Object,
57
+ default: () => ({
58
+ no: 'no',
59
+ size: 'size',
60
+ total: 'total'
61
+ })
62
+ },
63
+ pageSizes: {
64
+ type: Array,
65
+ default: () => [20, 50, 100, 300, 500]
66
+ }
67
+ },
68
+ data() {
69
+ return {
70
+ noOrsize: ''
71
+ }
72
+ },
73
+ computed: {
74
+ max() {
75
+ let total = this.pageObj[this.pageKey.total]
76
+ let size = this.pageObj[this.pageKey.size]
77
+
78
+ return Math.ceil(total / size)
79
+ }
80
+ },
81
+ watch: {
82
+ noOrsize() {
83
+ this.$emit('change', this.pageObj)
84
+ }
85
+ },
86
+ methods: {
87
+ setnoOrsize() {
88
+ this.$nextTick(() => {
89
+ let no = this.pageObj[this.pageKey.no]
90
+ let size = this.pageObj[this.pageKey.size]
91
+ this.noOrsize = no + ',' + size
92
+ })
93
+ }
94
+ }
95
+ }
96
+ </script>
@@ -0,0 +1,58 @@
1
+
2
+ <template>
3
+ <el-tabs
4
+ :value="init"
5
+ class="n20-secondary-tab m-b"
6
+ :before-leave="beforeFn"
7
+ @tab-click="clickFn"
8
+ >
9
+ <el-tab-pane
10
+ v-for="item of data"
11
+ :key="item.name"
12
+ :tab-info="item"
13
+ :name="item.name"
14
+ :icon="item.icon"
15
+ :disabled="item.disabled"
16
+ >
17
+ <template slot="label">
18
+ <span v-if="item.icon" :class="item.icon"></span>
19
+ <sup v-if="item.badge" class="el-tabs__item-badge"></sup>
20
+ {{ item.name }}
21
+ </template>
22
+ </el-tab-pane>
23
+ </el-tabs>
24
+ </template>
25
+
26
+ <script>
27
+ export default {
28
+ name: 'SecondaryTab',
29
+ props: {
30
+ data: {
31
+ type: Array,
32
+ default: () => []
33
+ },
34
+ init: {
35
+ type: String,
36
+ default: ''
37
+ },
38
+ stop: {
39
+ type: Boolean,
40
+ default: false
41
+ }
42
+ },
43
+ methods: {
44
+ clickFn(C) {
45
+ let item = C.$attrs['tab-info']
46
+ if (this.$listeners['update:init']) {
47
+ !item.disabled && this.$emit('update:init', item.name)
48
+ }
49
+ if (this.$listeners['click']) {
50
+ this.$emit('click', item)
51
+ }
52
+ },
53
+ beforeFn(name) {
54
+ return !this.stop
55
+ }
56
+ }
57
+ }
58
+ </script>
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <el-select
3
+ v-select-lazy="lazyGet"
4
+ :value="value"
5
+ v-bind="attrs"
6
+ v-on="listeners"
7
+ >
8
+ <slot></slot>
9
+ </el-select>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: 'SelectLazy',
15
+ directives: {
16
+ 'select-lazy': {
17
+ bind(el, binding) {
18
+ let maxMoveY = 0
19
+ el.querySelector('.el-select-dropdown__wrap').addEventListener(
20
+ 'scroll',
21
+ function () {
22
+ if (this.scrollTop <= 20) {
23
+ maxMoveY = 0
24
+ }
25
+ if (
26
+ this.scrollTop > maxMoveY + 60 &&
27
+ this.scrollTop + this.clientHeight > this.scrollHeight - 60
28
+ ) {
29
+ maxMoveY = this.scrollTop
30
+ binding.value()
31
+ }
32
+ }
33
+ )
34
+ }
35
+ }
36
+ },
37
+ props: {
38
+ value: {
39
+ type: [String, Number, Array, Object],
40
+ default: undefined
41
+ },
42
+ filterMethod: {
43
+ type: Function,
44
+ default: undefined
45
+ }
46
+ },
47
+ data() {
48
+ this.attrs = Object.assign(
49
+ { filterable: true, clearable: true, filterMethod: this.filterMethod },
50
+ this.$attrs
51
+ )
52
+
53
+ this.listeners = Object.assign(
54
+ { clear: this.filterMethod },
55
+ this.$listeners,
56
+ {
57
+ change: this.change
58
+ }
59
+ )
60
+
61
+ return {}
62
+ },
63
+ methods: {
64
+ change(val) {
65
+ this.$emit('input', val)
66
+ },
67
+ lazyGet() {
68
+ this.$emit('scroll-bottom')
69
+ }
70
+ }
71
+ }
72
+ </script>
73
+
74
+ <style>
75
+ </style>