n20-common-lib 1.3.8 → 1.3.11

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 (263) hide show
  1. package/nstc-g6/assets/svg/404.svg +1 -0
  2. package/nstc-g6/assets/svg/addFile.svg +32 -0
  3. package/nstc-g6/assets/svg/bug.svg +1 -0
  4. package/nstc-g6/assets/svg/chart.svg +1 -0
  5. package/nstc-g6/assets/svg/clipboard.svg +1 -0
  6. package/nstc-g6/assets/svg/component.svg +1 -0
  7. package/nstc-g6/assets/svg/dashboard.svg +1 -0
  8. package/nstc-g6/assets/svg/deleteFile.svg +28 -0
  9. package/nstc-g6/assets/svg/documentation.svg +1 -0
  10. package/nstc-g6/assets/svg/drag.svg +1 -0
  11. package/nstc-g6/assets/svg/edit.svg +1 -0
  12. package/nstc-g6/assets/svg/education.svg +1 -0
  13. package/nstc-g6/assets/svg/email.svg +1 -0
  14. package/nstc-g6/assets/svg/example.svg +1 -0
  15. package/nstc-g6/assets/svg/excel.svg +1 -0
  16. package/nstc-g6/assets/svg/exit-fullscreen.svg +1 -0
  17. package/nstc-g6/assets/svg/eye-open.svg +1 -0
  18. package/nstc-g6/assets/svg/eye.svg +1 -0
  19. package/nstc-g6/assets/svg/favorite.svg +1 -0
  20. package/nstc-g6/assets/svg/favorite_active.svg +1 -0
  21. package/nstc-g6/assets/svg/favorite_x400.svg +1 -0
  22. package/nstc-g6/assets/svg/favorite_x400_active.svg +1 -0
  23. package/nstc-g6/assets/svg/favorite_x400_blank.svg +1 -0
  24. package/nstc-g6/assets/svg/filter.svg +16 -0
  25. package/nstc-g6/assets/svg/filter@2x.png +0 -0
  26. package/nstc-g6/assets/svg/filterActive.svg +16 -0
  27. package/nstc-g6/assets/svg/filterClose@2x.png +0 -0
  28. package/nstc-g6/assets/svg/form.svg +1 -0
  29. package/nstc-g6/assets/svg/fullscreen.svg +1 -0
  30. package/nstc-g6/assets/svg/guide.svg +1 -0
  31. package/nstc-g6/assets/svg/hourglass.svg +19 -0
  32. package/nstc-g6/assets/svg/icon.svg +1 -0
  33. package/nstc-g6/assets/svg/international.svg +1 -0
  34. package/nstc-g6/assets/svg/language.svg +1 -0
  35. package/nstc-g6/assets/svg/left-dis.svg +1 -0
  36. package/nstc-g6/assets/svg/left.svg +1 -0
  37. package/nstc-g6/assets/svg/link.svg +1 -0
  38. package/nstc-g6/assets/svg/list.svg +1 -0
  39. package/nstc-g6/assets/svg/lock.svg +1 -0
  40. package/nstc-g6/assets/svg/message-t.svg +1 -0
  41. package/nstc-g6/assets/svg/money.svg +1 -0
  42. package/nstc-g6/assets/svg/money3.svg +1 -0
  43. package/nstc-g6/assets/svg/money4.svg +1 -0
  44. package/nstc-g6/assets/svg/moneyTwo.svg +1 -0
  45. package/nstc-g6/assets/svg/msg_white.svg +1 -0
  46. package/nstc-g6/assets/svg/nested.svg +1 -0
  47. package/nstc-g6/assets/svg/newsearch.svg +19 -0
  48. package/nstc-g6/assets/svg/password.svg +1 -0
  49. package/nstc-g6/assets/svg/pdf.svg +1 -0
  50. package/nstc-g6/assets/svg/people.svg +1 -0
  51. package/nstc-g6/assets/svg/peoples.svg +1 -0
  52. package/nstc-g6/assets/svg/phone.svg +1 -0
  53. package/nstc-g6/assets/svg/phone_msg.svg +1 -0
  54. package/nstc-g6/assets/svg/qq.svg +1 -0
  55. package/nstc-g6/assets/svg/right-dis.svg +1 -0
  56. package/nstc-g6/assets/svg/right.svg +1 -0
  57. package/nstc-g6/assets/svg/search.svg +1 -0
  58. package/nstc-g6/assets/svg/searchActive.svg +19 -0
  59. package/nstc-g6/assets/svg/shopping.svg +1 -0
  60. package/nstc-g6/assets/svg/size.svg +1 -0
  61. package/nstc-g6/assets/svg/skill.svg +1 -0
  62. package/nstc-g6/assets/svg/star.svg +1 -0
  63. package/nstc-g6/assets/svg/steam.svg +1 -0
  64. package/nstc-g6/assets/svg/tab.svg +1 -0
  65. package/nstc-g6/assets/svg/table.svg +1 -0
  66. package/nstc-g6/assets/svg/theme.svg +1 -0
  67. package/nstc-g6/assets/svg/tree-table.svg +1 -0
  68. package/nstc-g6/assets/svg/tree.svg +1 -0
  69. package/nstc-g6/assets/svg/user.svg +1 -0
  70. package/nstc-g6/assets/svg/wechat.svg +1 -0
  71. package/nstc-g6/assets/svg/z-left-2-dis.svg +1 -0
  72. package/nstc-g6/assets/svg/z-left-2.svg +1 -0
  73. package/nstc-g6/assets/svg/z-right-2-dis.svg +1 -0
  74. package/nstc-g6/assets/svg/z-right-2.svg +1 -0
  75. package/nstc-g6/assets/svg/z-right.svg +1 -0
  76. package/nstc-g6/assets/svg/zip.svg +1 -0
  77. package/nstc-g6/components/Calendar/index.js +8 -0
  78. package/nstc-g6/components/Calendar/src/basic/month-table.vue +129 -0
  79. package/nstc-g6/components/Calendar/src/basic/year-table.vue +126 -0
  80. package/nstc-g6/components/Calendar/src/main.vue +442 -0
  81. package/nstc-g6/components/DialogForm/index.js +8 -0
  82. package/nstc-g6/components/DialogForm/src/demo/index.vue +56 -0
  83. package/nstc-g6/components/DialogForm/src/main.vue +189 -0
  84. package/nstc-g6/components/Form/A_DEMO/component/originalForm.vue +281 -0
  85. package/nstc-g6/components/Form/A_DEMO/config/config_3.js +1222 -0
  86. package/nstc-g6/components/Form/A_DEMO/index.vue +803 -0
  87. package/nstc-g6/components/Form/AutocompleteCustom/index.vue +72 -0
  88. package/nstc-g6/components/Form/BusinessSpecific/InputMultiple.vue +191 -0
  89. package/nstc-g6/components/Form/BusinessSpecific/InputWithUnit.vue +128 -0
  90. package/nstc-g6/components/Form/BusinessSpecific/SelectTreeDialog.vue +233 -0
  91. package/nstc-g6/components/Form/BusinessSpecific/readme.md +7 -0
  92. package/nstc-g6/components/Form/CascaderCustom/index.vue +101 -0
  93. package/nstc-g6/components/Form/CheckboxCustom/index.vue +84 -0
  94. package/nstc-g6/components/Form/Component.vue +661 -0
  95. package/nstc-g6/components/Form/ComponentSecond.vue +650 -0
  96. package/nstc-g6/components/Form/DatepickerCustom/index.vue +130 -0
  97. package/nstc-g6/components/Form/InputAndDialog/index.js +15 -0
  98. package/nstc-g6/components/Form/InputAndDialog/src/main.vue +395 -0
  99. package/nstc-g6/components/Form/InputCustom/demo/index.vue +65 -0
  100. package/nstc-g6/components/Form/InputCustom/index.vue +307 -0
  101. package/nstc-g6/components/Form/IntervalinputCustom/demo/index.vue +31 -0
  102. package/nstc-g6/components/Form/IntervalinputCustom/index.vue +118 -0
  103. package/nstc-g6/components/Form/Item.vue +330 -0
  104. package/nstc-g6/components/Form/ItemSecond.vue +269 -0
  105. package/nstc-g6/components/Form/List.vue +146 -0
  106. package/nstc-g6/components/Form/ListSecond.vue +130 -0
  107. package/nstc-g6/components/Form/RadioCustom/index.vue +73 -0
  108. package/nstc-g6/components/Form/SelectAccount/index.js +15 -0
  109. package/nstc-g6/components/Form/SelectAccount/src/demo/index.vue +58 -0
  110. package/nstc-g6/components/Form/SelectAccount/src/main.vue +283 -0
  111. package/nstc-g6/components/Form/SelectAndDialog/index.js +15 -0
  112. package/nstc-g6/components/Form/SelectAndDialog/src/main.vue +384 -0
  113. package/nstc-g6/components/Form/SelectCashFlow/index.js +15 -0
  114. package/nstc-g6/components/Form/SelectCashFlow/src/demo/index.vue +42 -0
  115. package/nstc-g6/components/Form/SelectCashFlow/src/main.vue +126 -0
  116. package/nstc-g6/components/Form/SelectCustom/demo/index.vue +82 -0
  117. package/nstc-g6/components/Form/SelectCustom/index.vue +488 -0
  118. package/nstc-g6/components/Form/SelectSubject/index.js +15 -0
  119. package/nstc-g6/components/Form/SelectSubject/src/demo/index.vue +85 -0
  120. package/nstc-g6/components/Form/SelectSubject/src/main.vue +182 -0
  121. package/nstc-g6/components/Form/SelectindialogCustom/demo/index.vue +188 -0
  122. package/nstc-g6/components/Form/SelectindialogCustom/index.vue +650 -0
  123. package/nstc-g6/components/Form/SelectindialogCustom/install.js +7 -0
  124. package/nstc-g6/components/Form/TableRadioCustom/demo/index.vue +53 -0
  125. package/nstc-g6/components/Form/TableRadioCustom/index.vue +183 -0
  126. package/nstc-g6/components/Form/TextCustom/index.vue +38 -0
  127. package/nstc-g6/components/Form/UploadCustom/demo/index.vue +31 -0
  128. package/nstc-g6/components/Form/UploadCustom/iconxitongshezhi-yichu.png +0 -0
  129. package/nstc-g6/components/Form/UploadCustom/index.vue +506 -0
  130. package/nstc-g6/components/Form/configs.js +191 -0
  131. package/nstc-g6/components/Form/configsSecond.js +161 -0
  132. package/nstc-g6/components/Form/index.js +8 -0
  133. package/nstc-g6/components/Form/index.scss +29 -0
  134. package/nstc-g6/components/Form/payeePersonSelect/index.js +15 -0
  135. package/nstc-g6/components/Form/payeePersonSelect/src/demo/index.vue +164 -0
  136. package/nstc-g6/components/Form/payeePersonSelect/src/main.vue +185 -0
  137. package/nstc-g6/components/Form/readme.txt +4 -0
  138. package/nstc-g6/components/FormGroup/index.js +8 -0
  139. package/nstc-g6/components/FormGroup/src/demo/config.js +23 -0
  140. package/nstc-g6/components/FormGroup/src/demo/index.vue +85 -0
  141. package/nstc-g6/components/FormGroup/src/main.vue +639 -0
  142. package/nstc-g6/components/FormGroup/src/validate.js +23 -0
  143. package/nstc-g6/components/InputTag/InputTag.vue +270 -0
  144. package/nstc-g6/components/NstcApprovel/NstcApprovel.vue +24 -0
  145. package/nstc-g6/components/NstcBackToTop/NstcBackToTop.vue +150 -0
  146. package/nstc-g6/components/NstcBranchLazyLoad/NstcBranchLazyLoad.vue +123 -0
  147. package/nstc-g6/components/NstcCharts/NstcCharts.vue +162 -0
  148. package/nstc-g6/components/NstcCharts/define.js +74 -0
  149. package/nstc-g6/components/NstcCharts/mixins/resize.js +56 -0
  150. package/nstc-g6/components/NstcConfirm/NstcConfirm.vue +152 -0
  151. package/nstc-g6/components/NstcConfirm/index.js +25 -0
  152. package/nstc-g6/components/NstcDialog/NstcDialog.vue +185 -0
  153. package/nstc-g6/components/NstcDialogForm/NstcDialogForm.vue +176 -0
  154. package/nstc-g6/components/NstcDialogTable/NstcDialogTable.vue +280 -0
  155. package/nstc-g6/components/NstcDropdown/NstcDropdown.vue +52 -0
  156. package/nstc-g6/components/NstcDropdownTree/NstcDropdownTree.vue +396 -0
  157. package/nstc-g6/components/NstcElectronicFile/NstcElectronicFile.vue +591 -0
  158. package/nstc-g6/components/NstcExcelCustomImport/NstcExcelCustomImport.vue +475 -0
  159. package/nstc-g6/components/NstcExcelCustomImport/img/upload@2x.png +0 -0
  160. package/nstc-g6/components/NstcExcelExport/NstcExcelExport.vue +145 -0
  161. package/nstc-g6/components/NstcExcelImport/NstcExcelImport.vue +1074 -0
  162. package/nstc-g6/components/NstcExcelImport/img/upload@2x.png +0 -0
  163. package/nstc-g6/components/NstcExcelImportN/NstcExcelImportN.vue +1166 -0
  164. package/nstc-g6/components/NstcExpandCollapse/NstcExpandCollapse.vue +130 -0
  165. package/nstc-g6/components/NstcExpandCollapse/index.scss +77 -0
  166. package/nstc-g6/components/NstcFileUpload/NstcFileUpload.vue +989 -0
  167. package/nstc-g6/components/NstcFileUpload/img/addFile.svg +32 -0
  168. package/nstc-g6/components/NstcFileUpload/img/delete.svg +24 -0
  169. package/nstc-g6/components/NstcFileUpload/img/deleteFile.svg +28 -0
  170. package/nstc-g6/components/NstcFileUpload/img/download.svg +24 -0
  171. package/nstc-g6/components/NstcFileUpload/img/inputUpload.svg +30 -0
  172. package/nstc-g6/components/NstcFileUpload/img/look-diabled.svg +24 -0
  173. package/nstc-g6/components/NstcFileUpload/img/look.svg +24 -0
  174. package/nstc-g6/components/NstcForm/A_DEMO/component/originalForm.vue +281 -0
  175. package/nstc-g6/components/NstcForm/A_DEMO/config/config_3.js +1222 -0
  176. package/nstc-g6/components/NstcForm/A_DEMO/index.vue +796 -0
  177. package/nstc-g6/components/NstcForm/AutocompleteCustom/index.vue +68 -0
  178. package/nstc-g6/components/NstcForm/BusinessSpecific/InputMultiple.vue +189 -0
  179. package/nstc-g6/components/NstcForm/BusinessSpecific/InputWithUnit.vue +128 -0
  180. package/nstc-g6/components/NstcForm/BusinessSpecific/SelectTreeDialog.vue +233 -0
  181. package/nstc-g6/components/NstcForm/BusinessSpecific/readme.md +7 -0
  182. package/nstc-g6/components/NstcForm/CascaderCustom/index.vue +101 -0
  183. package/nstc-g6/components/NstcForm/CheckboxCustom/index.vue +84 -0
  184. package/nstc-g6/components/NstcForm/Component.vue +684 -0
  185. package/nstc-g6/components/NstcForm/ComponentSecond.vue +650 -0
  186. package/nstc-g6/components/NstcForm/DatepickerCustom/index.vue +130 -0
  187. package/nstc-g6/components/NstcForm/InputAndDialog/NstcInputAndDialog.vue +389 -0
  188. package/nstc-g6/components/NstcForm/InputCustom/index.vue +314 -0
  189. package/nstc-g6/components/NstcForm/IntervalInputCustom/index.vue +116 -0
  190. package/nstc-g6/components/NstcForm/Item.vue +327 -0
  191. package/nstc-g6/components/NstcForm/ItemSecond.vue +269 -0
  192. package/nstc-g6/components/NstcForm/List.vue +146 -0
  193. package/nstc-g6/components/NstcForm/ListSecond.vue +130 -0
  194. package/nstc-g6/components/NstcForm/RadioCustom/index.vue +73 -0
  195. package/nstc-g6/components/NstcForm/SelectAccount/NstcSelectAccount.vue +334 -0
  196. package/nstc-g6/components/NstcForm/SelectAndDialog/NstcSelectAndDialog.vue +377 -0
  197. package/nstc-g6/components/NstcForm/SelectCashFlow/NstcSelectCashFlow.vue +123 -0
  198. package/nstc-g6/components/NstcForm/SelectCustom/index.vue +460 -0
  199. package/nstc-g6/components/NstcForm/SelectSubject/NstcSelectSubject.vue +185 -0
  200. package/nstc-g6/components/NstcForm/SelectindialogCustom/index.vue +648 -0
  201. package/nstc-g6/components/NstcForm/TableRadioCustom/index.vue +183 -0
  202. package/nstc-g6/components/NstcForm/TextCustom/index.vue +38 -0
  203. package/nstc-g6/components/NstcForm/UploadCustom/iconxitongshezhi-yichu.png +0 -0
  204. package/nstc-g6/components/NstcForm/UploadCustom/index.vue +500 -0
  205. package/nstc-g6/components/NstcForm/configs.js +191 -0
  206. package/nstc-g6/components/NstcForm/configsSecond.js +161 -0
  207. package/nstc-g6/components/NstcForm/index.js +8 -0
  208. package/nstc-g6/components/NstcForm/index.scss +29 -0
  209. package/nstc-g6/components/NstcForm/payeePersonSelect/NstcPayeePerson.vue +188 -0
  210. package/nstc-g6/components/NstcForm/readme.txt +4 -0
  211. package/nstc-g6/components/NstcPagination/NstcPagination.vue +428 -0
  212. package/nstc-g6/components/NstcPagination/setPageNum.png +0 -0
  213. package/nstc-g6/components/NstcPagination/setpagedefault.png +0 -0
  214. package/nstc-g6/components/NstcScreenFull/NstcScreenFull.vue +70 -0
  215. package/nstc-g6/components/NstcSelectTree/NstcSelectTree.vue +729 -0
  216. package/nstc-g6/components/NstcSelectTreeList/NstcSelectTreeList.vue +676 -0
  217. package/nstc-g6/components/NstcSticky/NstcSticky.vue +97 -0
  218. package/nstc-g6/components/NstcSvgIcon/NstcSvgIcon.vue +72 -0
  219. package/nstc-g6/components/NstcTab/NstcTab.vue +80 -0
  220. package/nstc-g6/components/NstcTabWithBadge/NstcTabWithBadge.vue +45 -0
  221. package/nstc-g6/components/NstcTabWithBadge/index.scss +31 -0
  222. package/nstc-g6/components/NstcTable/ElTableColumnCustom/index.vue +292 -0
  223. package/nstc-g6/components/NstcTable/NstcTable.vue +460 -0
  224. package/nstc-g6/components/NstcTableSet/NstcTableSet.vue +801 -0
  225. package/nstc-g6/components/NstcThemePicker/NstcThemePicker.vue +186 -0
  226. package/nstc-g6/components/NstcUploadCustomExcel/NstcUploadCustomExcel.vue +330 -0
  227. package/nstc-g6/components/NstcUploadExcel/NstcUploadExcel.vue +145 -0
  228. package/nstc-g6/components/NstcWorkBench/NstcWorkBench.vue +176 -0
  229. package/nstc-g6/components/Search/NstcSearch.vue +583 -0
  230. package/nstc-g6/components/Search/src/demo/index copy.vue +101 -0
  231. package/nstc-g6/components/Search/src/demo/index.vue +103 -0
  232. package/nstc-g6/components/Search/src/main copy.vue +607 -0
  233. package/nstc-g6/components/approvelTwo/main.vue +220 -0
  234. package/nstc-g6/components/approvelTwo/progress.vue +154 -0
  235. package/nstc-g6/directives/VCopy/index.js +60 -0
  236. package/nstc-g6/directives/VNstcNumber/index.js +14 -0
  237. package/nstc-g6/directives/VNstcNumber/temp.js +446 -0
  238. package/nstc-g6/index.js +193 -0
  239. package/nstc-g6/utils/auth.js +2 -0
  240. package/nstc-g6/utils/axios.js +2 -0
  241. package/nstc-g6/utils/dateAndValidator.js +649 -0
  242. package/nstc-g6/utils/debounce.js +40 -0
  243. package/nstc-g6/utils/parseTime.js +48 -0
  244. package/nstc-g6/utils/validate/index.js +7 -0
  245. package/nstc-g6/utils/vendor/Export2Excel.js +229 -0
  246. package/nstc-g6/utils/vendor/Export2Zip.js +24 -0
  247. package/nstc-g6/utils/vue-bus.js +5 -0
  248. package/package.json +8 -2
  249. package/src/assets/css/_coreLib.scss +9 -1
  250. package/src/components/ChildRange/index.vue +28 -64
  251. package/src/components/ChildRange/style.scss +34 -0
  252. package/src/components/FileImport/index.vue +3 -1
  253. package/src/components/PageHeader/index.vue +3 -47
  254. package/src/components/PageHeader/style.scss +39 -0
  255. package/src/components/Search/index.vue +1 -97
  256. package/src/components/Search/style.scss +93 -0
  257. package/src/components/Table/ThSelectHeader.vue +28 -33
  258. package/src/components/Table/index.vue +4 -2
  259. package/src/directives/VTitle/index.js +14 -17
  260. package/style/css/normalize.scss +6 -6
  261. package/style/index.css +3 -3
  262. package/style/index.css.map +1 -1
  263. package/style/server-config.jsonc +527 -410
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Parse the time to string
3
+ * @param {(Object|string|number)} time
4
+ * @param {string} cFormat
5
+ * @returns {string | null}
6
+ */
7
+ export function parseTime(time, cFormat = '{y}-{m}-{d} {h}:{i}:{s}') {
8
+ if (arguments.length === 0 || !time) {
9
+ return null
10
+ }
11
+ const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
12
+ let date
13
+ if (typeof time === 'object') {
14
+ date = time
15
+ } else {
16
+ if ((typeof time === 'string')) {
17
+ if ((/^[0-9]+$/.test(time))) {
18
+ // support "1548221490638"
19
+ time = parseInt(time)
20
+ } else {
21
+ // support safari
22
+ // https://stackoverflow.com/questions/4310953/invalid-date-in-safari
23
+ time = time.replace(new RegExp(/-/gm), '/')
24
+ }
25
+ }
26
+
27
+ if ((typeof time === 'number') && (time.toString().length === 10)) {
28
+ time = time * 1000
29
+ }
30
+ date = new Date(time)
31
+ }
32
+ const formatObj = {
33
+ y: date.getFullYear(),
34
+ m: date.getMonth() + 1,
35
+ d: date.getDate(),
36
+ h: date.getHours(),
37
+ i: date.getMinutes(),
38
+ s: date.getSeconds(),
39
+ a: date.getDay()
40
+ }
41
+ const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
42
+ const value = formatObj[key]
43
+ // Note: getDay() returns 0 on Sunday
44
+ if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
45
+ return value.toString().padStart(2, '0')
46
+ })
47
+ return time_str
48
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @param {string} path
3
+ * @returns {Boolean}
4
+ */
5
+ export function isExternal(path) {
6
+ return /^(https?:|mailto:|tel:)/.test(path)
7
+ }
@@ -0,0 +1,229 @@
1
+ /* eslint-disable */
2
+ import { saveAs } from 'file-saver'
3
+ import XLSX from 'xlsx'
4
+ import XLSXS from 'xlsx-style'
5
+ function generateArray(table) {
6
+ var out = [];
7
+ var rows = table.querySelectorAll('tr');
8
+ var ranges = [];
9
+ for (var R = 0; R < rows.length; ++R) {
10
+ var outRow = [];
11
+ var row = rows[R];
12
+ var columns = row.querySelectorAll('td');
13
+ for (var C = 0; C < columns.length; ++C) {
14
+ var cell = columns[C];
15
+ var colspan = cell.getAttribute('colspan');
16
+ var rowspan = cell.getAttribute('rowspan');
17
+ var cellValue = cell.innerText;
18
+ if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
19
+
20
+ //Skip ranges
21
+ ranges.forEach(function (range) {
22
+ if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
23
+ for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
24
+ }
25
+ });
26
+
27
+ //Handle Row Span
28
+ if (rowspan || colspan) {
29
+ rowspan = rowspan || 1;
30
+ colspan = colspan || 1;
31
+ ranges.push({
32
+ s: {
33
+ r: R,
34
+ c: outRow.length
35
+ },
36
+ e: {
37
+ r: R + rowspan - 1,
38
+ c: outRow.length + colspan - 1
39
+ }
40
+ });
41
+ };
42
+
43
+ //Handle Value
44
+ outRow.push(cellValue !== "" ? cellValue : null);
45
+
46
+ //Handle Colspan
47
+ if (colspan)
48
+ for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
49
+ }
50
+ out.push(outRow);
51
+ }
52
+ return [out, ranges];
53
+ };
54
+
55
+ function datenum(v, date1904) {
56
+ if (date1904) v += 1462;
57
+ var epoch = Date.parse(v);
58
+ return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
59
+ }
60
+
61
+ export function sheet_from_array_of_arrays(data, opts) {
62
+ var ws = {};
63
+ var range = {
64
+ s: {
65
+ c: 10000000,
66
+ r: 10000000
67
+ },
68
+ e: {
69
+ c: 0,
70
+ r: 0
71
+ }
72
+ };
73
+ for (var R = 0; R != data.length; ++R) {
74
+ for (var C = 0; C != data[R].length; ++C) {
75
+ if (range.s.r > R) range.s.r = R;
76
+ if (range.s.c > C) range.s.c = C;
77
+ if (range.e.r < R) range.e.r = R;
78
+ if (range.e.c < C) range.e.c = C;
79
+ var cell = {
80
+ v: data[R][C]
81
+ };
82
+ if (cell.v == null) continue;
83
+ var cell_ref = XLSX.utils.encode_cell({
84
+ c: C,
85
+ r: R
86
+ });
87
+
88
+ if (typeof cell.v === 'number') cell.t = 'n';
89
+ else if (typeof cell.v === 'boolean') cell.t = 'b';
90
+ else if (cell.v instanceof Date) {
91
+ cell.t = 'n';
92
+ cell.z = XLSX.SSF._table[14];
93
+ cell.v = datenum(cell.v);
94
+ } else cell.t = 's';
95
+
96
+ ws[cell_ref] = cell;
97
+ }
98
+ }
99
+ if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
100
+ return ws;
101
+ }
102
+
103
+ function Workbook() {
104
+ if (!(this instanceof Workbook)) return new Workbook();
105
+ this.SheetNames = [];
106
+ this.Sheets = {};
107
+ }
108
+
109
+ function s2ab(s) {
110
+ var buf = new ArrayBuffer(s.length);
111
+ var view = new Uint8Array(buf);
112
+ for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
113
+ return buf;
114
+ }
115
+
116
+ export function export_table_to_excel(id) {
117
+ var theTable = document.getElementById(id);
118
+ var oo = generateArray(theTable);
119
+ var ranges = oo[1];
120
+
121
+ /* original data */
122
+ var data = oo[0];
123
+ var ws_name = "SheetJS";
124
+
125
+ var wb = new Workbook(),
126
+ ws = sheet_from_array_of_arrays(data);
127
+
128
+ /* add ranges to worksheet */
129
+ // ws['!cols'] = ['apple', 'banan'];
130
+ ws['!merges'] = ranges;
131
+
132
+ /* add worksheet to workbook */
133
+ wb.SheetNames.push(ws_name);
134
+ wb.Sheets[ws_name] = ws;
135
+
136
+ var wbout = XLSX.write(wb, {
137
+ bookType: 'xlsx',
138
+ bookSST: false,
139
+ type: 'binary'
140
+ });
141
+
142
+ saveAs(new Blob([s2ab(wbout)], {
143
+ type: "application/octet-stream"
144
+ }), "test.xlsx")
145
+ }
146
+
147
+ export function export_json_to_excel({
148
+ multiHeader = [],
149
+ header,
150
+ data,
151
+ filename,
152
+ merges = [],
153
+ autoWidth = true,
154
+ bookType = 'xlsx'
155
+ } = {}, cellStyle = {}) {
156
+ /* original data */
157
+ filename = filename || 'excel-list'
158
+ data = [...data]
159
+ data.unshift(header);
160
+
161
+ for (let i = multiHeader.length - 1; i > -1; i--) {
162
+ data.unshift(multiHeader[i])
163
+ }
164
+
165
+ var ws_name = "SheetJS";
166
+ var wb = new Workbook(),
167
+ ws = sheet_from_array_of_arrays(data);
168
+
169
+ if (merges.length > 0) {
170
+ if (!ws['!merges']) ws['!merges'] = [];
171
+ merges.forEach(item => {
172
+ ws['!merges'].push(XLSX.utils.decode_range(item))
173
+ })
174
+ }
175
+
176
+ if (autoWidth) {
177
+ /*设置worksheet每列的最大宽度*/
178
+ const colWidth = data.map(row => row.map(val => {
179
+ /*先判断是否为null/undefined*/
180
+ if (val == null) {
181
+ return {
182
+ 'wch': 10
183
+ };
184
+ }
185
+ /*再判断是否为中文*/
186
+ else if (val.toString().charCodeAt(0) > 255) {
187
+ return {
188
+ 'wch': val.toString().length * 2 < 20 ? 20 : val.toString().length * 2
189
+ };
190
+ } else {
191
+ return {
192
+ 'wch': val.toString().length * 2 < 20 ? 20 : val.toString().length * 2
193
+ };
194
+ }
195
+ }))
196
+ /*以第一行为初始值*/
197
+ let result = colWidth[0];
198
+ for (let i = 1; i < colWidth.length; i++) {
199
+ for (let j = 0; j < colWidth[i].length; j++) {
200
+ if (result[j]['wch'] < colWidth[i][j]['wch']) {
201
+ result[j]['wch'] = colWidth[i][j]['wch'];
202
+ }
203
+ }
204
+ }
205
+ ws['!cols'] = result;
206
+ }
207
+
208
+ /* add worksheet to workbook */
209
+ wb.SheetNames.push(ws_name);
210
+ wb.Sheets[ws_name] = ws;
211
+ // 设置某一列的单元格样式
212
+ for(let key in ws) {
213
+ for(let colName in cellStyle) {
214
+ if(key.startsWith(colName)) {
215
+ ws[key].s = cellStyle[colName]
216
+
217
+ }
218
+ }
219
+
220
+ }
221
+ var wbout = XLSXS.write(wb, {
222
+ bookType: bookType,
223
+ bookSST: false,
224
+ type: 'binary'
225
+ });
226
+ saveAs(new Blob([s2ab(wbout)], {
227
+ type: "application/octet-stream"
228
+ }), `${filename}.${bookType}`);
229
+ }
@@ -0,0 +1,24 @@
1
+ /* eslint-disable */
2
+ import { saveAs } from 'file-saver'
3
+ import JSZip from 'jszip'
4
+
5
+ export function export_txt_to_zip(th, jsonData, txtName, zipName) {
6
+ const zip = new JSZip()
7
+ const txt_name = txtName || 'file'
8
+ const zip_name = zipName || 'file'
9
+ const data = jsonData
10
+ let txtData = `${th}\r\n`
11
+ data.forEach((row) => {
12
+ let tempStr = ''
13
+ tempStr = row.toString()
14
+ txtData += `${tempStr}\r\n`
15
+ })
16
+ zip.file(`${txt_name}.txt`, txtData)
17
+ zip.generateAsync({
18
+ type: "blob"
19
+ }).then((blob) => {
20
+ saveAs(blob, `${zip_name}.zip`)
21
+ }, (err) => {
22
+ alert('导出失败')
23
+ })
24
+ }
@@ -0,0 +1,5 @@
1
+ import Vue from 'vue'
2
+
3
+ const VueBus = new Vue()
4
+
5
+ export default VueBus
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "1.3.8",
3
+ "version": "1.3.11",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -25,7 +25,12 @@
25
25
  "src/plugins",
26
26
  "src/index.js",
27
27
  "style",
28
- "g6.js"
28
+ "g6.js",
29
+ "nstc-g6/index.js",
30
+ "nstc-g6/assets",
31
+ "nstc-g6/components",
32
+ "nstc-g6/directives",
33
+ "nstc-g6/utils"
29
34
  ],
30
35
  "dependencies": {
31
36
  "axios": "*",
@@ -55,6 +60,7 @@
55
60
  "element-ui": "^2.15.6",
56
61
  "eslint": "^6.7.2",
57
62
  "eslint-plugin-vue": "^6.2.2",
63
+ "exceljs": "^4.3.0",
58
64
  "file-saver": "^2.0.5",
59
65
  "fuse.js": "^6.6.2",
60
66
  "jszip": "^3.10.0",
@@ -33,4 +33,12 @@
33
33
 
34
34
  @import '../../plugins/Print/print.scss';
35
35
  @import './select.scss';
36
- @import "./plain-text.scss";
36
+ @import './plain-text.scss';
37
+
38
+ /* 临时引入 */
39
+ @import '../../components/ChildRange/style.scss';
40
+ @import '../../components/PageHeader/style.scss';
41
+ @import '../../components/Search/style.scss';
42
+ .table-header-popover.el-popover {
43
+ padding: 16px;
44
+ }
@@ -1,33 +1,33 @@
1
1
  <template>
2
- <div>
2
+ <div class="n20-subticket-interval">
3
3
  <div class="input-child-range" :class="{ 'is-disabled': disabled }">
4
4
  <div class="flex">
5
5
  <div class="from">
6
6
  <el-input
7
- ref="input_left"
8
- v-model="value1"
9
- :disabled="disabled"
10
- placeholder="子票区间起"
11
- @blur="handleBlurleft"
12
- @focus="handleFocusLeft"
13
- @input="handleInputleft"
14
- @change="handleInputChangeLeft"
15
- ></el-input>
7
+ ref="input_left"
8
+ v-model="value1"
9
+ :disabled="disabled"
10
+ placeholder="子票区间起"
11
+ @blur="handleBlurleft"
12
+ @focus="handleFocusLeft"
13
+ @input="handleInputleft"
14
+ @change="handleInputChangeLeft"
15
+ />
16
16
  </div>
17
17
  <div class="center">
18
18
  <span> - </span>
19
19
  </div>
20
20
  <div class="to">
21
21
  <el-input
22
- ref="input_right"
23
- v-model="value2"
24
- :disabled="disabled"
25
- placeholder="子票区间止"
26
- @blur="handleBlurRight"
27
- @focus="handleFocusRight"
28
- @input="handleInputRight"
29
- @change="handleInputChangeRight"
30
- ></el-input>
22
+ ref="input_right"
23
+ v-model="value2"
24
+ :disabled="disabled"
25
+ placeholder="子票区间止"
26
+ @blur="handleBlurRight"
27
+ @focus="handleFocusRight"
28
+ @input="handleInputRight"
29
+ @change="handleInputChangeRight"
30
+ />
31
31
  </div>
32
32
  </div>
33
33
  </div>
@@ -36,7 +36,7 @@
36
36
 
37
37
  <script>
38
38
  export default {
39
- name: "ChildRange",
39
+ name: 'ChildRange',
40
40
  props: {
41
41
  // 初始化范围
42
42
  value: { required: true },
@@ -79,7 +79,7 @@ export default {
79
79
  toPrecision(num, precision) {
80
80
  if (precision === undefined) precision = 0
81
81
  return parseFloat(
82
- Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision)
82
+ Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision)
83
83
  )
84
84
  },
85
85
 
@@ -122,9 +122,9 @@ export default {
122
122
  // 如果from > to 将from值替换成to
123
123
  if (typeof this.value2 === 'number') {
124
124
  this.value1 =
125
- parseFloat(this.value1) <= parseFloat(this.value2)
126
- ? this.value1
127
- : this.value2
125
+ parseFloat(this.value1) <= parseFloat(this.value2)
126
+ ? this.value1
127
+ : this.value2
128
128
  }
129
129
  this.$emit('input', [this.value1, this.value2])
130
130
  this.$emit('changefrom', this.value1)
@@ -145,9 +145,9 @@ export default {
145
145
  // 如果to < tfrom 将to值替换成from
146
146
  if (typeof this.value1 === 'number') {
147
147
  this.value2 =
148
- parseFloat(this.value2) >= parseFloat(this.value1)
149
- ? this.value2
150
- : this.value1
148
+ parseFloat(this.value2) >= parseFloat(this.value1)
149
+ ? this.value2
150
+ : this.value1
151
151
  }
152
152
  this.$emit('input', [this.value1, this.value2])
153
153
  this.$emit('changeright', this.value2)
@@ -163,40 +163,4 @@ export default {
163
163
  }
164
164
  }
165
165
  }
166
- </script>
167
-
168
- <style lang="scss" scoped>
169
-
170
- .input-child-range {
171
- background-color: #fff;
172
- border: 1px solid #dcdfe6;
173
- border-radius: 4px;
174
- // 取消element原有的input框样式
175
- ::v-deep .el-input--small .el-input__inner {
176
- border: 0px;
177
- margin: 0;
178
- padding: 0 5px;
179
- background-color: transparent;
180
- }
181
- ::v-deep .el-input__inner:focus {
182
- box-shadow: none;
183
- }
184
- }
185
- .flex {
186
- display: flex;
187
- flex-direction: row;
188
- width: 100%;
189
- justify-content: center;
190
- align-items: center;
191
- .center {
192
- color: #cccccc;
193
- margin: 0 1px;
194
- }
195
- }
196
- .is-disabled {
197
- background-color: #eef0f6;
198
- border-color: #e4e7ed;
199
- color: #c0c4cc;
200
- cursor: not-allowed;
201
- }
202
- </style>
166
+ </script>
@@ -0,0 +1,34 @@
1
+ .n20-subticket-interval {
2
+ .input-child-range {
3
+ background-color: #fff;
4
+ border: 1px solid #dcdfe6;
5
+ border-radius: 4px;
6
+ // 取消element原有的input框样式
7
+ ::v-deep .el-input--small .el-input__inner {
8
+ border: 0px;
9
+ margin: 0;
10
+ padding: 0 5px;
11
+ background-color: transparent;
12
+ }
13
+ ::v-deep .el-input__inner:focus {
14
+ box-shadow: none;
15
+ }
16
+ }
17
+ .flex {
18
+ display: flex;
19
+ flex-direction: row;
20
+ width: 100%;
21
+ justify-content: center;
22
+ align-items: center;
23
+ .center {
24
+ color: #cccccc;
25
+ margin: 0 1px;
26
+ }
27
+ }
28
+ .is-disabled {
29
+ background-color: #eef0f6;
30
+ border-color: #e4e7ed;
31
+ color: #c0c4cc;
32
+ cursor: not-allowed;
33
+ }
34
+ }
@@ -3,5 +3,7 @@
3
3
  </template>
4
4
 
5
5
  <script>
6
- export default {}
6
+ export default {
7
+ name: 'FileImport'
8
+ }
7
9
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="page-header">
2
+ <div class="n20-page-header">
3
3
  <div v-if="!disable" class="page-header__left" @click="$emit('back')">
4
4
  <i :class="icon"></i>
5
5
  <div class="page-header__title">
@@ -24,7 +24,7 @@ export default {
24
24
  },
25
25
  content: String,
26
26
  disable: {
27
- type:Boolean,
27
+ type: Boolean,
28
28
  default: false
29
29
  },
30
30
  icon: {
@@ -32,49 +32,5 @@ export default {
32
32
  default: 'n20-icon-yuefenqiehuan-zuoce'
33
33
  }
34
34
  }
35
- };
36
- </script>
37
-
38
-
39
- <style lang="scss" scoped>
40
- .page-header {
41
- display: flex;
42
- line-height: 20px;
43
- padding-bottom: 2px;
44
- border-bottom: 1px solid rgba(0,0,0,0.10);
45
- .page-header__left {
46
- display: flex;
47
- align-items: center;
48
- cursor: pointer;
49
- margin-right: 16px;
50
- position: relative;
51
-
52
- }
53
- .page-header__left:hover {
54
- color: var(--color-primary);
55
- .page-header__title {
56
- color: var(--color-primary);
57
- }
58
- }
59
- .page-header__left:after {
60
- content: "";
61
- position: absolute;
62
- width: 1px;
63
- height: 16px;
64
- right: -8px;
65
- top: 50%;
66
- transform: translateY(-50%);
67
- background-color: #dcdfe6;
68
- }
69
- .page-header__title {
70
- font-size: 14px;
71
- line-height: 20px;
72
- color: #3D4A57;
73
- }
74
- .page-header__content {
75
- font-size: 14px;
76
- line-height: 20px;
77
- color: #3D4A57;
78
- }
79
35
  }
80
- </style>
36
+ </script>
@@ -0,0 +1,39 @@
1
+ .page-header {
2
+ display: flex;
3
+ line-height: 20px;
4
+ padding-bottom: 2px;
5
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
6
+ .page-header__left {
7
+ display: flex;
8
+ align-items: center;
9
+ cursor: pointer;
10
+ margin-right: 16px;
11
+ position: relative;
12
+ }
13
+ .page-header__left:hover {
14
+ color: var(--color-primary);
15
+ .page-header__title {
16
+ color: var(--color-primary);
17
+ }
18
+ }
19
+ .page-header__left:after {
20
+ content: '';
21
+ position: absolute;
22
+ width: 1px;
23
+ height: 16px;
24
+ right: -8px;
25
+ top: 50%;
26
+ transform: translateY(-50%);
27
+ background-color: #dcdfe6;
28
+ }
29
+ .page-header__title {
30
+ font-size: 14px;
31
+ line-height: 20px;
32
+ color: #3d4a57;
33
+ }
34
+ .page-header__content {
35
+ font-size: 14px;
36
+ line-height: 20px;
37
+ color: #3d4a57;
38
+ }
39
+ }