ele-admin-plus 1.2.1-beta.1 → 1.2.1-beta.2

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 (277) hide show
  1. package/es/ele-admin-layout/index.d.ts +19 -10
  2. package/es/ele-admin-layout/props.d.ts +4 -1
  3. package/es/ele-admin-layout/props.js +4 -1
  4. package/es/ele-admin-layout/style/index.scss +7 -2
  5. package/es/ele-admin-layout/style/sidebar.scss +2 -0
  6. package/es/ele-alert/index.d.ts +1 -1
  7. package/es/ele-alert/index.js +3 -3
  8. package/es/ele-app/components/message-body.d.ts +1 -1
  9. package/es/ele-app/components/message-body.js +2 -2
  10. package/es/ele-app/plus.d.ts +3 -0
  11. package/es/ele-avatar-group/index.d.ts +4 -4
  12. package/es/ele-avatar-group/index.js +15 -15
  13. package/es/ele-basic-select/index.d.ts +5 -5
  14. package/es/ele-basic-select/index.js +16 -16
  15. package/es/ele-check-card/index.d.ts +1 -1
  16. package/es/ele-check-card/index.js +4 -4
  17. package/es/ele-copyable/index.d.ts +2 -2
  18. package/es/ele-copyable/index.js +6 -6
  19. package/es/ele-cropper/components/cropper-tools.d.ts +3 -3
  20. package/es/ele-cropper/components/cropper-tools.js +10 -10
  21. package/es/ele-cropper/index.d.ts +13 -13
  22. package/es/ele-cropper/index.js +39 -39
  23. package/es/ele-cropper-modal/index.d.ts +1 -1
  24. package/es/ele-cropper-modal/index.js +3 -3
  25. package/es/ele-data-table/util.js +1 -1
  26. package/es/ele-drawer/index.d.ts +8 -8
  27. package/es/ele-drawer/index.js +18 -18
  28. package/es/ele-dropdown/index.d.ts +3 -3
  29. package/es/ele-dropdown/index.js +9 -9
  30. package/es/ele-ellipsis/index.d.ts +1 -1
  31. package/es/ele-ellipsis/index.js +3 -3
  32. package/es/ele-file-list/components/file-grid-item.d.ts +5 -5
  33. package/es/ele-file-list/components/file-grid-item.js +15 -15
  34. package/es/ele-file-list/components/file-grid.d.ts +6 -6
  35. package/es/ele-file-list/components/file-grid.js +15 -15
  36. package/es/ele-file-list/components/file-table-item.d.ts +5 -5
  37. package/es/ele-file-list/components/file-table-item.js +15 -15
  38. package/es/ele-file-list/components/file-table.d.ts +7 -7
  39. package/es/ele-file-list/components/file-table.js +19 -19
  40. package/es/ele-file-list/index.d.ts +6 -6
  41. package/es/ele-file-list/index.js +22 -22
  42. package/es/ele-file-list-tool/index.d.ts +1 -1
  43. package/es/ele-file-list-tool/index.js +2 -2
  44. package/es/ele-icon-select/components/icon-grid.d.ts +2 -2
  45. package/es/ele-icon-select/components/icon-grid.js +6 -6
  46. package/es/ele-icon-select/index.d.ts +7 -7
  47. package/es/ele-icon-select/index.js +23 -23
  48. package/es/ele-menus/index.js +15 -15
  49. package/es/ele-menus/style/index.scss +1 -0
  50. package/es/ele-menus/util.d.ts +7 -0
  51. package/es/ele-menus/util.js +49 -26
  52. package/es/ele-modal/index.d.ts +6 -6
  53. package/es/ele-modal/index.js +18 -18
  54. package/es/ele-pagination/index.d.ts +2 -2
  55. package/es/ele-pagination/index.js +6 -6
  56. package/es/ele-popconfirm/index.d.ts +7 -17
  57. package/es/ele-popconfirm/index.js +15 -15
  58. package/es/ele-popconfirm/props.d.ts +2 -7
  59. package/es/ele-popover/index.d.ts +7 -17
  60. package/es/ele-popover/index.js +15 -15
  61. package/es/ele-popover/props.d.ts +1 -6
  62. package/es/ele-popover/props.js +1 -0
  63. package/es/ele-printer/index.d.ts +1 -1
  64. package/es/ele-printer/index.js +19 -22
  65. package/es/ele-printer/style/index.scss +2 -2
  66. package/es/ele-printer/types.d.ts +0 -2
  67. package/es/ele-printer/util.d.ts +9 -30
  68. package/es/ele-printer/util.js +118 -109
  69. package/es/ele-pro-layout/index.d.ts +19 -19
  70. package/es/ele-pro-layout/index.js +2 -2
  71. package/es/ele-pro-layout/props.d.ts +1 -1
  72. package/es/ele-pro-layout/props.js +1 -1
  73. package/es/ele-pro-table/components/table-tools.d.ts +3 -3
  74. package/es/ele-pro-table/components/table-tools.js +6 -13
  75. package/es/ele-pro-table/components/tool-column-list.d.ts +9 -9
  76. package/es/ele-pro-table/components/tool-column-list.js +33 -33
  77. package/es/ele-pro-table/components/tool-column.d.ts +24 -38
  78. package/es/ele-pro-table/components/tool-column.js +80 -102
  79. package/es/ele-pro-table/components/tool-export.d.ts +4 -4
  80. package/es/ele-pro-table/components/tool-export.js +28 -40
  81. package/es/ele-pro-table/components/tool-print.d.ts +10 -7
  82. package/es/ele-pro-table/components/tool-print.js +36 -46
  83. package/es/ele-pro-table/index.d.ts +16 -13
  84. package/es/ele-pro-table/index.js +41 -64
  85. package/es/ele-pro-table/props.d.ts +2 -2
  86. package/es/ele-pro-table/props.js +1 -1
  87. package/es/ele-pro-table/style/index.scss +1 -0
  88. package/es/ele-pro-table/util.d.ts +38 -30
  89. package/es/ele-pro-table/util.js +111 -80
  90. package/es/ele-segmented/index.d.ts +1 -1
  91. package/es/ele-segmented/index.js +3 -3
  92. package/es/ele-split-panel/index.d.ts +1 -1
  93. package/es/ele-split-panel/index.js +3 -3
  94. package/es/ele-tab-wrap/components/tab-dropdown.d.ts +1 -1
  95. package/es/ele-tab-wrap/components/tab-dropdown.js +3 -3
  96. package/es/ele-table-select/index.d.ts +19 -19
  97. package/es/ele-table-select/index.js +42 -37
  98. package/es/ele-tool/index.d.ts +6 -3
  99. package/es/ele-tool/index.js +35 -32
  100. package/es/ele-tool/style/index.js +0 -1
  101. package/es/ele-tool/style/index.scss +0 -13
  102. package/es/ele-toolbar/index.d.ts +3247 -1
  103. package/es/ele-toolbar/index.js +44 -5
  104. package/es/ele-toolbar/props.d.ts +6 -2
  105. package/es/ele-toolbar/props.js +2 -0
  106. package/es/ele-toolbar/style/index.js +1 -0
  107. package/es/ele-toolbar/types.d.ts +15 -0
  108. package/es/ele-tooltip/index.d.ts +9 -9
  109. package/es/ele-tooltip/index.js +25 -25
  110. package/es/ele-tour/index.d.ts +3 -3
  111. package/es/ele-tour/index.js +10 -10
  112. package/es/ele-tree-select/index.d.ts +9 -9
  113. package/es/ele-tree-select/index.js +28 -28
  114. package/es/ele-upload-list/components/list-item.d.ts +3 -3
  115. package/es/ele-upload-list/components/list-item.js +7 -7
  116. package/es/ele-upload-list/index.d.ts +4 -4
  117. package/es/ele-upload-list/index.js +13 -13
  118. package/es/ele-virtual-table/components/body-cell.d.ts +8 -8
  119. package/es/ele-virtual-table/components/body-cell.js +24 -24
  120. package/es/ele-virtual-table/components/body-row.d.ts +7 -7
  121. package/es/ele-virtual-table/components/body-row.js +21 -21
  122. package/es/ele-virtual-table/components/cell-checkbox.d.ts +1 -1
  123. package/es/ele-virtual-table/components/cell-checkbox.js +3 -3
  124. package/es/ele-virtual-table/components/cell-filter.d.ts +5 -5
  125. package/es/ele-virtual-table/components/cell-filter.js +18 -18
  126. package/es/ele-virtual-table/components/footer-row.d.ts +1 -1
  127. package/es/ele-virtual-table/components/footer-row.js +3 -3
  128. package/es/ele-virtual-table/components/header-cell.d.ts +5 -5
  129. package/es/ele-virtual-table/components/header-cell.js +15 -15
  130. package/es/ele-virtual-table/components/header-row.d.ts +5 -5
  131. package/es/ele-virtual-table/components/header-row.js +15 -15
  132. package/es/ele-virtual-table/index.d.ts +23 -21
  133. package/es/ele-virtual-table/index.js +50 -48
  134. package/es/ele-virtual-table/util.js +3 -3
  135. package/es/ele-watermark/index.js +1 -0
  136. package/es/style/themes/default.scss +8 -8
  137. package/es/style/themes/rounded.scss +1 -7
  138. package/es/utils/core.d.ts +7 -1
  139. package/lib/ele-admin-layout/index.d.ts +19 -10
  140. package/lib/ele-admin-layout/props.cjs +4 -1
  141. package/lib/ele-admin-layout/props.d.ts +4 -1
  142. package/lib/ele-admin-layout/style/index.scss +7 -2
  143. package/lib/ele-admin-layout/style/sidebar.scss +2 -0
  144. package/lib/ele-alert/index.cjs +3 -3
  145. package/lib/ele-alert/index.d.ts +1 -1
  146. package/lib/ele-app/components/message-body.cjs +2 -2
  147. package/lib/ele-app/components/message-body.d.ts +1 -1
  148. package/lib/ele-app/plus.d.ts +3 -0
  149. package/lib/ele-avatar-group/index.cjs +15 -15
  150. package/lib/ele-avatar-group/index.d.ts +4 -4
  151. package/lib/ele-basic-select/index.cjs +16 -16
  152. package/lib/ele-basic-select/index.d.ts +5 -5
  153. package/lib/ele-check-card/index.cjs +4 -4
  154. package/lib/ele-check-card/index.d.ts +1 -1
  155. package/lib/ele-copyable/index.cjs +6 -6
  156. package/lib/ele-copyable/index.d.ts +2 -2
  157. package/lib/ele-cropper/components/cropper-tools.cjs +10 -10
  158. package/lib/ele-cropper/components/cropper-tools.d.ts +3 -3
  159. package/lib/ele-cropper/index.cjs +39 -39
  160. package/lib/ele-cropper/index.d.ts +13 -13
  161. package/lib/ele-cropper-modal/index.cjs +3 -3
  162. package/lib/ele-cropper-modal/index.d.ts +1 -1
  163. package/lib/ele-data-table/util.cjs +1 -1
  164. package/lib/ele-drawer/index.cjs +18 -18
  165. package/lib/ele-drawer/index.d.ts +8 -8
  166. package/lib/ele-dropdown/index.cjs +9 -9
  167. package/lib/ele-dropdown/index.d.ts +3 -3
  168. package/lib/ele-ellipsis/index.cjs +3 -3
  169. package/lib/ele-ellipsis/index.d.ts +1 -1
  170. package/lib/ele-file-list/components/file-grid-item.cjs +15 -15
  171. package/lib/ele-file-list/components/file-grid-item.d.ts +5 -5
  172. package/lib/ele-file-list/components/file-grid.cjs +15 -15
  173. package/lib/ele-file-list/components/file-grid.d.ts +6 -6
  174. package/lib/ele-file-list/components/file-table-item.cjs +15 -15
  175. package/lib/ele-file-list/components/file-table-item.d.ts +5 -5
  176. package/lib/ele-file-list/components/file-table.cjs +19 -19
  177. package/lib/ele-file-list/components/file-table.d.ts +7 -7
  178. package/lib/ele-file-list/index.cjs +22 -22
  179. package/lib/ele-file-list/index.d.ts +6 -6
  180. package/lib/ele-file-list-tool/index.cjs +2 -2
  181. package/lib/ele-file-list-tool/index.d.ts +1 -1
  182. package/lib/ele-icon-select/components/icon-grid.cjs +6 -6
  183. package/lib/ele-icon-select/components/icon-grid.d.ts +2 -2
  184. package/lib/ele-icon-select/index.cjs +23 -23
  185. package/lib/ele-icon-select/index.d.ts +7 -7
  186. package/lib/ele-menus/index.cjs +15 -15
  187. package/lib/ele-menus/style/index.scss +1 -0
  188. package/lib/ele-menus/util.cjs +49 -26
  189. package/lib/ele-menus/util.d.ts +7 -0
  190. package/lib/ele-modal/index.cjs +18 -18
  191. package/lib/ele-modal/index.d.ts +6 -6
  192. package/lib/ele-pagination/index.cjs +6 -6
  193. package/lib/ele-pagination/index.d.ts +2 -2
  194. package/lib/ele-popconfirm/index.cjs +15 -15
  195. package/lib/ele-popconfirm/index.d.ts +7 -17
  196. package/lib/ele-popconfirm/props.d.ts +2 -7
  197. package/lib/ele-popover/index.cjs +15 -15
  198. package/lib/ele-popover/index.d.ts +7 -17
  199. package/lib/ele-popover/props.cjs +1 -0
  200. package/lib/ele-popover/props.d.ts +1 -6
  201. package/lib/ele-printer/index.cjs +17 -20
  202. package/lib/ele-printer/index.d.ts +1 -1
  203. package/lib/ele-printer/style/index.scss +2 -2
  204. package/lib/ele-printer/types.d.ts +0 -2
  205. package/lib/ele-printer/util.cjs +118 -109
  206. package/lib/ele-printer/util.d.ts +9 -30
  207. package/lib/ele-pro-layout/index.cjs +2 -2
  208. package/lib/ele-pro-layout/index.d.ts +19 -19
  209. package/lib/ele-pro-layout/props.cjs +1 -1
  210. package/lib/ele-pro-layout/props.d.ts +1 -1
  211. package/lib/ele-pro-table/components/table-tools.cjs +6 -13
  212. package/lib/ele-pro-table/components/table-tools.d.ts +3 -3
  213. package/lib/ele-pro-table/components/tool-column-list.cjs +33 -33
  214. package/lib/ele-pro-table/components/tool-column-list.d.ts +9 -9
  215. package/lib/ele-pro-table/components/tool-column.cjs +79 -101
  216. package/lib/ele-pro-table/components/tool-column.d.ts +24 -38
  217. package/lib/ele-pro-table/components/tool-export.cjs +28 -40
  218. package/lib/ele-pro-table/components/tool-export.d.ts +4 -4
  219. package/lib/ele-pro-table/components/tool-print.cjs +36 -46
  220. package/lib/ele-pro-table/components/tool-print.d.ts +10 -7
  221. package/lib/ele-pro-table/index.cjs +41 -64
  222. package/lib/ele-pro-table/index.d.ts +16 -13
  223. package/lib/ele-pro-table/props.cjs +1 -1
  224. package/lib/ele-pro-table/props.d.ts +2 -2
  225. package/lib/ele-pro-table/style/index.scss +1 -0
  226. package/lib/ele-pro-table/util.cjs +111 -80
  227. package/lib/ele-pro-table/util.d.ts +38 -30
  228. package/lib/ele-segmented/index.cjs +3 -3
  229. package/lib/ele-segmented/index.d.ts +1 -1
  230. package/lib/ele-split-panel/index.cjs +3 -3
  231. package/lib/ele-split-panel/index.d.ts +1 -1
  232. package/lib/ele-tab-wrap/components/tab-dropdown.cjs +3 -3
  233. package/lib/ele-tab-wrap/components/tab-dropdown.d.ts +1 -1
  234. package/lib/ele-table-select/index.cjs +42 -37
  235. package/lib/ele-table-select/index.d.ts +19 -19
  236. package/lib/ele-tool/index.cjs +34 -31
  237. package/lib/ele-tool/index.d.ts +6 -3
  238. package/lib/ele-tool/style/index.cjs +0 -1
  239. package/lib/ele-tool/style/index.scss +0 -13
  240. package/lib/ele-toolbar/index.cjs +42 -3
  241. package/lib/ele-toolbar/index.d.ts +3247 -1
  242. package/lib/ele-toolbar/props.cjs +2 -0
  243. package/lib/ele-toolbar/props.d.ts +6 -2
  244. package/lib/ele-toolbar/style/index.cjs +1 -0
  245. package/lib/ele-toolbar/types.d.ts +15 -0
  246. package/lib/ele-tooltip/index.cjs +25 -25
  247. package/lib/ele-tooltip/index.d.ts +9 -9
  248. package/lib/ele-tour/index.cjs +10 -10
  249. package/lib/ele-tour/index.d.ts +3 -3
  250. package/lib/ele-tree-select/index.cjs +28 -28
  251. package/lib/ele-tree-select/index.d.ts +9 -9
  252. package/lib/ele-upload-list/components/list-item.cjs +7 -7
  253. package/lib/ele-upload-list/components/list-item.d.ts +3 -3
  254. package/lib/ele-upload-list/index.cjs +13 -13
  255. package/lib/ele-upload-list/index.d.ts +4 -4
  256. package/lib/ele-virtual-table/components/body-cell.cjs +24 -24
  257. package/lib/ele-virtual-table/components/body-cell.d.ts +8 -8
  258. package/lib/ele-virtual-table/components/body-row.cjs +21 -21
  259. package/lib/ele-virtual-table/components/body-row.d.ts +7 -7
  260. package/lib/ele-virtual-table/components/cell-checkbox.cjs +3 -3
  261. package/lib/ele-virtual-table/components/cell-checkbox.d.ts +1 -1
  262. package/lib/ele-virtual-table/components/cell-filter.cjs +18 -18
  263. package/lib/ele-virtual-table/components/cell-filter.d.ts +5 -5
  264. package/lib/ele-virtual-table/components/footer-row.cjs +3 -3
  265. package/lib/ele-virtual-table/components/footer-row.d.ts +1 -1
  266. package/lib/ele-virtual-table/components/header-cell.cjs +15 -15
  267. package/lib/ele-virtual-table/components/header-cell.d.ts +5 -5
  268. package/lib/ele-virtual-table/components/header-row.cjs +15 -15
  269. package/lib/ele-virtual-table/components/header-row.d.ts +5 -5
  270. package/lib/ele-virtual-table/index.cjs +50 -48
  271. package/lib/ele-virtual-table/index.d.ts +23 -21
  272. package/lib/ele-virtual-table/util.cjs +3 -3
  273. package/lib/ele-watermark/index.cjs +1 -0
  274. package/lib/style/themes/default.scss +8 -8
  275. package/lib/style/themes/rounded.scss +1 -7
  276. package/lib/utils/core.d.ts +7 -1
  277. package/package.json +1 -1
@@ -46,10 +46,10 @@ html.ele-printing > body {
46
46
  background: #fff !important;
47
47
  height: auto !important;
48
48
  min-height: auto !important;
49
- max-height: auto !important;
49
+ max-height: none !important;
50
50
  width: auto !important;
51
51
  min-width: auto !important;
52
- max-width: auto !important;
52
+ max-width: none !important;
53
53
  overflow: visible !important;
54
54
  }
55
55
 
@@ -17,8 +17,6 @@ export type PrintTarget = '_self' | '_blank' | '_iframe';
17
17
  * 打印参数
18
18
  */
19
19
  export interface PrintOption {
20
- /** id */
21
- printId: string;
22
20
  /** 页面标题 */
23
21
  title?: string;
24
22
  /** 页间距 */
@@ -1,32 +1,13 @@
1
- import { PrintOption, PrintPdfOption } from './types';
1
+ import { PrintOption, PrintTarget, PrintPdfOption } from './types';
2
2
 
3
3
  export declare const printContainerId = "ele-printer-container";
4
4
  export declare const printFrameId = "ele-printer-iframe";
5
5
  export declare const printingClass = "ele-printing";
6
6
  /**
7
- * 创建并获取打印容器
8
- */
9
- export declare function getPrintContainer(): Element;
10
- /**
11
- * 打印
12
- */
13
- export declare function doPrint(option: PrintOption): void;
14
- /**
15
- * 在子窗口中打印
16
- */
17
- export declare function doPrintOnFrame(opt: PrintOption): Window | undefined;
18
- /**
19
- * 创建并获取打印子窗口
20
- */
21
- export declare function getPrintFrame(): HTMLIFrameElement;
22
- /**
23
- * 移除打印子窗口
24
- */
25
- export declare function removePrintFrame(): void;
26
- /**
27
- * 生成打印设置的样式
7
+ * 打印 pdf
8
+ * @param option 打印参数
28
9
  */
29
- export declare function getOptionCss(opt: PrintOption): string;
10
+ export declare function printPdf(option: PrintPdfOption): void;
30
11
  /**
31
12
  * 合并打印方法参数
32
13
  * @param options 参数
@@ -34,13 +15,11 @@ export declare function getOptionCss(opt: PrintOption): string;
34
15
  */
35
16
  export declare function mergeOptions(options?: any, userOptions?: any): any;
36
17
  /**
37
- * usePrinter
18
+ * 创建并获取打印容器
38
19
  */
39
- export declare function usePrinter(done: () => void): {
40
- printId: string;
41
- };
20
+ export declare function getPrintContainer(): Element;
42
21
  /**
43
- * 打印 pdf
44
- * @param option 打印参数
22
+ * usePrinter
23
+ * @param done 打印结束回调
45
24
  */
46
- export declare function printPdf(option: PrintPdfOption): void;
25
+ export declare function usePrinter(done: () => void): (option: PrintOption, target?: PrintTarget | null) => void;
@@ -1,8 +1,52 @@
1
1
  import { onBeforeUnmount } from "vue";
2
- import { uuid } from "../utils/core";
2
+ import { useTimer } from "../utils/hook";
3
3
  const printContainerId = "ele-printer-container";
4
4
  const printFrameId = "ele-printer-iframe";
5
5
  const printingClass = "ele-printing";
6
+ let printIdNum = 0;
7
+ function printPdf(option) {
8
+ const pFrame = getPrintFrame();
9
+ pFrame.onload = () => {
10
+ const url = pFrame.getAttribute("src");
11
+ if (!!url) {
12
+ pFrame.focus();
13
+ pFrame.contentWindow && pFrame.contentWindow.print(option.options);
14
+ option.done && option.done();
15
+ window.URL.revokeObjectURL(url);
16
+ }
17
+ };
18
+ const doPrint = (buffer) => {
19
+ const blob = new window.Blob([buffer], { type: "application/pdf" });
20
+ if (window.navigator && window.navigator["msSaveOrOpenBlob"]) {
21
+ window.navigator["msSaveOrOpenBlob"](blob, "print.pdf");
22
+ return;
23
+ }
24
+ pFrame.setAttribute("src", window.URL.createObjectURL(blob));
25
+ };
26
+ if (option.arraybuffer) {
27
+ doPrint(option.arraybuffer);
28
+ return;
29
+ }
30
+ if (option.url) {
31
+ const req = new window.XMLHttpRequest();
32
+ req.open("GET", option.url, true);
33
+ req.responseType = "arraybuffer";
34
+ req.onload = () => {
35
+ if ([200, 201].indexOf(req.status) !== -1) {
36
+ doPrint(req.response);
37
+ return;
38
+ }
39
+ option.error && option.error(req.status, req.statusText);
40
+ };
41
+ req.send();
42
+ }
43
+ }
44
+ function mergeOptions(options, userOptions) {
45
+ if (options == null) {
46
+ return userOptions;
47
+ }
48
+ return Object.assign({}, options, userOptions);
49
+ }
6
50
  function getPrintContainer() {
7
51
  const container = document.getElementById(printContainerId);
8
52
  if (container) {
@@ -13,28 +57,40 @@ function getPrintContainer() {
13
57
  document.body.appendChild(elem);
14
58
  return elem;
15
59
  }
16
- function doPrint(option) {
17
- const $html = document.querySelector("html");
18
- if ($html) {
19
- $html.classList.add(printingClass);
20
- const elem = document.createElement("style");
21
- elem.setAttribute("type", "text/css");
22
- elem.setAttribute("media", "print");
23
- elem.innerHTML = getOptionCss(option);
24
- document.body.appendChild(elem);
25
- const title = document.title;
26
- if (option.title != null && option.title !== "") {
27
- document.title = option.title;
28
- }
29
- window.print(option.options);
30
- $html.classList.remove(printingClass);
31
- document.body.removeChild(elem);
32
- if (option.title != null) {
33
- document.title = title;
34
- }
60
+ function getOptionCss(opt) {
61
+ const css = ["@page {"];
62
+ if (opt.margin != null && opt.margin !== "") {
63
+ const v = typeof opt.margin === "number" ? opt.margin + "px" : opt.margin;
64
+ css.push(`margin: ${v};`);
65
+ }
66
+ if (opt.direction != null && opt.direction !== "") {
67
+ css.push(`size: ${opt.direction};`);
35
68
  }
69
+ if (opt.orientation != null && opt.orientation !== "") {
70
+ css.push(`page-orientation: ${opt.orientation};`);
71
+ }
72
+ css.push("}");
73
+ return css.join(" ");
36
74
  }
37
- function doPrintOnFrame(opt) {
75
+ function removePrintFrame() {
76
+ const pFrame = document.getElementById(printFrameId);
77
+ if (pFrame && pFrame.parentNode) {
78
+ pFrame.parentNode.removeChild(pFrame);
79
+ }
80
+ }
81
+ function getPrintFrame() {
82
+ removePrintFrame();
83
+ const elem = document.createElement("iframe");
84
+ elem.id = printFrameId;
85
+ elem.style.width = "0px";
86
+ elem.style.height = "0px";
87
+ elem.style.position = "fixed";
88
+ elem.style.visibility = "hidden";
89
+ document.body.appendChild(elem);
90
+ elem.focus();
91
+ return elem;
92
+ }
93
+ function doPrintOnFrame(opt, printId) {
38
94
  var _a;
39
95
  const pFrame = getPrintFrame();
40
96
  const pWin = pFrame.contentWindow;
@@ -68,7 +124,7 @@ function doPrintOnFrame(opt) {
68
124
  document.title = '${opt.title}';
69
125
  }
70
126
  window.print(${printOption});
71
- window.parent.postMessage('elePrintDone_${opt.printId}', '*');
127
+ window.parent.postMessage('elePrintDone_${printId}', '*');
72
128
  };
73
129
  <\/script>
74
130
  `;
@@ -78,107 +134,60 @@ function doPrintOnFrame(opt) {
78
134
  pDoc.close();
79
135
  return pWin;
80
136
  }
81
- function getPrintFrame() {
82
- removePrintFrame();
83
- const elem = document.createElement("iframe");
84
- elem.id = printFrameId;
85
- elem.style.width = "0px";
86
- elem.style.height = "0px";
87
- elem.style.position = "fixed";
88
- elem.style.visibility = "hidden";
89
- document.body.appendChild(elem);
90
- elem.focus();
91
- return elem;
92
- }
93
- function removePrintFrame() {
94
- const pFrame = document.getElementById(printFrameId);
95
- if (pFrame && pFrame.parentNode) {
96
- pFrame.parentNode.removeChild(pFrame);
97
- }
98
- }
99
- function getOptionCss(opt) {
100
- const css = ["@page {"];
101
- if (opt.margin != null && opt.margin !== "") {
102
- const v = typeof opt.margin === "number" ? opt.margin + "px" : opt.margin;
103
- css.push(`margin: ${v};`);
104
- }
105
- if (opt.direction != null && opt.direction !== "") {
106
- css.push(`size: ${opt.direction};`);
107
- }
108
- if (opt.orientation != null && opt.orientation !== "") {
109
- css.push(`page-orientation: ${opt.orientation};`);
110
- }
111
- css.push("}");
112
- return css.join(" ");
113
- }
114
- function mergeOptions(options, userOptions) {
115
- if (options == null) {
116
- return userOptions;
117
- }
118
- return Object.assign({}, options, userOptions);
119
- }
120
137
  function usePrinter(done) {
121
- const printId = uuid(8);
122
- const onMessage = (e) => {
123
- if (e.data === `elePrintDone_${printId}`) {
124
- removePrintFrame();
138
+ printIdNum++;
139
+ const printId = printIdNum;
140
+ const [startPrintTimer] = useTimer(200);
141
+ const doPrint = (option, target) => {
142
+ if (target === "_iframe") {
143
+ doPrintOnFrame(option, printId);
144
+ return;
145
+ }
146
+ const $html = document.querySelector("html");
147
+ if (!$html) {
125
148
  done && done();
149
+ return;
126
150
  }
127
- };
128
- window.addEventListener("message", onMessage);
129
- onBeforeUnmount(() => {
130
- window.removeEventListener("message", onMessage);
131
- });
132
- return { printId };
133
- }
134
- function printPdf(option) {
135
- const pFrame = getPrintFrame();
136
- pFrame.onload = () => {
137
- const url = pFrame.getAttribute("src");
138
- if (!!url) {
139
- pFrame.focus();
140
- pFrame.contentWindow && pFrame.contentWindow.print(option.options);
141
- option.done && option.done();
142
- URL.revokeObjectURL(url);
151
+ $html.classList.add(printingClass);
152
+ const elem = document.createElement("style");
153
+ elem.setAttribute("type", "text/css");
154
+ elem.setAttribute("media", "print");
155
+ elem.innerHTML = getOptionCss(option);
156
+ document.body.appendChild(elem);
157
+ const title = document.title;
158
+ if (option.title != null && option.title !== "") {
159
+ document.title = option.title;
143
160
  }
161
+ window.print(option.options);
162
+ startPrintTimer(() => {
163
+ $html.classList.remove(printingClass);
164
+ document.body.removeChild(elem);
165
+ if (option.title != null) {
166
+ document.title = title;
167
+ }
168
+ done && done();
169
+ });
144
170
  };
145
- const doPrint2 = (buffer) => {
146
- const blob = new window.Blob([buffer], { type: "application/pdf" });
147
- if (window.navigator && window.navigator["msSaveOrOpenBlob"]) {
148
- window.navigator["msSaveOrOpenBlob"](blob, "print.pdf");
149
- return;
171
+ const handleMessage = (e) => {
172
+ if (e.data === `elePrintDone_${printId}`) {
173
+ startPrintTimer(() => {
174
+ removePrintFrame();
175
+ done && done();
176
+ });
150
177
  }
151
- pFrame.setAttribute("src", window.URL.createObjectURL(blob));
152
178
  };
153
- if (option.arraybuffer) {
154
- doPrint2(option.arraybuffer);
155
- return;
156
- }
157
- if (option.url) {
158
- const req = new window.XMLHttpRequest();
159
- req.open("GET", option.url, true);
160
- req.responseType = "arraybuffer";
161
- req.onload = () => {
162
- if ([200, 201].indexOf(req.status) !== -1) {
163
- doPrint2(req.response);
164
- return;
165
- }
166
- option.error && option.error(req.status, req.statusText);
167
- };
168
- req.send();
169
- }
179
+ onBeforeUnmount(() => {
180
+ window.removeEventListener("message", handleMessage);
181
+ });
182
+ window.addEventListener("message", handleMessage);
183
+ return doPrint;
170
184
  }
171
185
  export {
172
- doPrint,
173
- doPrintOnFrame,
174
- getOptionCss,
175
186
  getPrintContainer,
176
- getPrintFrame,
177
187
  mergeOptions,
178
188
  printContainerId,
179
189
  printFrameId,
180
190
  printPdf,
181
191
  printingClass,
182
- removePrintFrame,
183
192
  usePrinter
184
193
  };
@@ -8,7 +8,7 @@ import { Layout, SidebarLayout, TabBar, Maximized } from '../ele-admin-layout/ty
8
8
  declare const _default: import('vue').DefineComponent<{
9
9
  height: {
10
10
  type: (StringConstructor | NumberConstructor)[];
11
- default: string;
11
+ default: null;
12
12
  };
13
13
  menus: import('vue').PropType<MenuItem[] | null>;
14
14
  tabs: import('vue').PropType<TabItem[] | null>;
@@ -36,12 +36,12 @@ declare const _default: import('vue').DefineComponent<{
36
36
  };
37
37
  tabStyle: {
38
38
  type: import('vue').PropType<import('./types').TabStyle>;
39
- default: string;
39
+ default: string; /** 布局组件 */
40
40
  };
41
41
  fixedHeader: {
42
42
  type: BooleanConstructor;
43
43
  default: boolean; /** 菜单数据 */
44
- };
44
+ }; /** 菜单数据 */
45
45
  fixedSidebar: {
46
46
  type: BooleanConstructor;
47
47
  default: boolean;
@@ -50,11 +50,12 @@ declare const _default: import('vue').DefineComponent<{
50
50
  type: BooleanConstructor;
51
51
  default: boolean;
52
52
  };
53
- logoInHeader: BooleanConstructor; /** 侧栏菜单数据 */
53
+ logoInHeader: BooleanConstructor;
54
+ /** 侧栏菜单数据 */
54
55
  fixedHome: {
55
56
  type: BooleanConstructor;
56
57
  default: boolean; /** 侧栏菜单选中 */
57
- };
58
+ }; /** 侧栏菜单选中 */
58
59
  homePath: StringConstructor;
59
60
  redirectPath: {
60
61
  type: StringConstructor;
@@ -64,14 +65,12 @@ declare const _default: import('vue').DefineComponent<{
64
65
  type: BooleanConstructor;
65
66
  default: boolean;
66
67
  };
67
- /** 页签数据 */
68
68
  compressOnEsc: BooleanConstructor;
69
69
  autoScrollTop: {
70
70
  type: BooleanConstructor;
71
- default: boolean; /** 面包屑导航数据 */
71
+ default: boolean;
72
72
  }; /** 面包屑导航数据 */
73
73
  navTrigger: import('vue').PropType<import('./types').MenuItemTrigger>;
74
- /** 是否是移动端风格 */
75
74
  boxTrigger: import('vue').PropType<import('./types').MenuItemTrigger>; /** 主页地址 */
76
75
  itemTrigger: import('vue').PropType<import('./types').MenuItemTrigger>;
77
76
  menuHoverTimeout: {
@@ -79,7 +78,8 @@ declare const _default: import('vue').DefineComponent<{
79
78
  default: number;
80
79
  };
81
80
  beforeClick: import('vue').PropType<import('./types').BeforeClick>;
82
- keepAlive: BooleanConstructor; /** 当前路由是否隐藏双侧栏一级 */
81
+ keepAlive: BooleanConstructor;
82
+ /** 当前路由是否隐藏双侧栏一级 */
83
83
  transitionName: StringConstructor;
84
84
  transitionDelay: {
85
85
  type: NumberConstructor;
@@ -209,7 +209,7 @@ declare const _default: import('vue').DefineComponent<{
209
209
  tabContextMenu: (_option: TabItemEventOption) => boolean;
210
210
  tabSortChange: (_data: TabItem[]) => boolean;
211
211
  logoClick: (_isHome: boolean, _e: MouseEvent) => boolean;
212
- headMenuOpen: (_index: string, _indexPath: string[]) => boolean;
212
+ headMenuOpen: (_index: string, _indexPath: string[]) => boolean; /** 当前路由是否是仅双侧栏一级 */
213
213
  headMenuClose: (_index: string, _indexPath: string[]) => boolean;
214
214
  sideMenuOpen: (_index: string, _indexPath: string[]) => boolean;
215
215
  sideMenuClose: (_index: string, _indexPath: string[]) => boolean;
@@ -217,7 +217,7 @@ declare const _default: import('vue').DefineComponent<{
217
217
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
218
218
  height: {
219
219
  type: (StringConstructor | NumberConstructor)[];
220
- default: string;
220
+ default: null;
221
221
  };
222
222
  menus: import('vue').PropType<MenuItem[] | null>;
223
223
  tabs: import('vue').PropType<TabItem[] | null>;
@@ -245,12 +245,12 @@ declare const _default: import('vue').DefineComponent<{
245
245
  };
246
246
  tabStyle: {
247
247
  type: import('vue').PropType<import('./types').TabStyle>;
248
- default: string;
248
+ default: string; /** 布局组件 */
249
249
  };
250
250
  fixedHeader: {
251
251
  type: BooleanConstructor;
252
252
  default: boolean; /** 菜单数据 */
253
- };
253
+ }; /** 菜单数据 */
254
254
  fixedSidebar: {
255
255
  type: BooleanConstructor;
256
256
  default: boolean;
@@ -259,11 +259,12 @@ declare const _default: import('vue').DefineComponent<{
259
259
  type: BooleanConstructor;
260
260
  default: boolean;
261
261
  };
262
- logoInHeader: BooleanConstructor; /** 侧栏菜单数据 */
262
+ logoInHeader: BooleanConstructor;
263
+ /** 侧栏菜单数据 */
263
264
  fixedHome: {
264
265
  type: BooleanConstructor;
265
266
  default: boolean; /** 侧栏菜单选中 */
266
- };
267
+ }; /** 侧栏菜单选中 */
267
268
  homePath: StringConstructor;
268
269
  redirectPath: {
269
270
  type: StringConstructor;
@@ -273,14 +274,12 @@ declare const _default: import('vue').DefineComponent<{
273
274
  type: BooleanConstructor;
274
275
  default: boolean;
275
276
  };
276
- /** 页签数据 */
277
277
  compressOnEsc: BooleanConstructor;
278
278
  autoScrollTop: {
279
279
  type: BooleanConstructor;
280
- default: boolean; /** 面包屑导航数据 */
280
+ default: boolean;
281
281
  }; /** 面包屑导航数据 */
282
282
  navTrigger: import('vue').PropType<import('./types').MenuItemTrigger>;
283
- /** 是否是移动端风格 */
284
283
  boxTrigger: import('vue').PropType<import('./types').MenuItemTrigger>; /** 主页地址 */
285
284
  itemTrigger: import('vue').PropType<import('./types').MenuItemTrigger>;
286
285
  menuHoverTimeout: {
@@ -288,7 +287,8 @@ declare const _default: import('vue').DefineComponent<{
288
287
  default: number;
289
288
  };
290
289
  beforeClick: import('vue').PropType<import('./types').BeforeClick>;
291
- keepAlive: BooleanConstructor; /** 当前路由是否隐藏双侧栏一级 */
290
+ keepAlive: BooleanConstructor;
291
+ /** 当前路由是否隐藏双侧栏一级 */
292
292
  transitionName: StringConstructor;
293
293
  transitionDelay: {
294
294
  type: NumberConstructor;
@@ -510,7 +510,7 @@ const _sfc_main = defineComponent({
510
510
  }
511
511
  return layoutRef.value.getContentEl();
512
512
  };
513
- const onRouteChange = (route) => {
513
+ const handleRouteChange = (route) => {
514
514
  const { path, meta } = route;
515
515
  hideFooter.value = !!meta.hideFooter;
516
516
  const contentEl = getContentElem();
@@ -719,7 +719,7 @@ const _sfc_main = defineComponent({
719
719
  watch(
720
720
  currentRoute,
721
721
  (route) => {
722
- onRouteChange(unref(route));
722
+ handleRouteChange(unref(route));
723
723
  },
724
724
  { immediate: true }
725
725
  );
@@ -13,7 +13,7 @@ export declare const proLayoutProps: {
13
13
  /** 高度 */
14
14
  height: {
15
15
  type: (StringConstructor | NumberConstructor)[];
16
- default: string;
16
+ default: null;
17
17
  };
18
18
  /** 菜单数据 */
19
19
  menus: PropType<MenuItem[] | null>;
@@ -2,7 +2,7 @@ const proLayoutProps = {
2
2
  /** 高度 */
3
3
  height: {
4
4
  type: [String, Number],
5
- default: "100vh"
5
+ default: null
6
6
  },
7
7
  /** 菜单数据 */
8
8
  menus: Array,
@@ -73,12 +73,12 @@ declare const _default: import('vue').DefineComponent<{
73
73
  placement: import('vue').ComputedRef<"top" | "bottom">;
74
74
  reload: () => void;
75
75
  updateSize: (size: string) => void;
76
- updateColumns: (columns: Columns) => void;
76
+ updateColumns: (columns: Columns, tableColumns: Columns) => void;
77
77
  toggleMaximized: () => void;
78
78
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
79
79
  reload: () => true;
80
80
  'update:size': (_size: TableSize) => true;
81
- 'update:columns': (_columns: Columns) => true;
81
+ 'update:columns': (_columns: Columns, _tableColumns: Columns) => true;
82
82
  'update:maximized': (_maximized: boolean) => true;
83
83
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
84
84
  /** 工具按钮布局 */
@@ -147,7 +147,7 @@ declare const _default: import('vue').DefineComponent<{
147
147
  required: true;
148
148
  };
149
149
  }>> & {
150
- "onUpdate:columns"?: ((_columns: Columns) => any) | undefined;
150
+ "onUpdate:columns"?: ((_columns: Columns, _tableColumns: Columns) => any) | undefined;
151
151
  onReload?: (() => any) | undefined;
152
152
  "onUpdate:size"?: ((_size: "" | "small" | "default" | "large" | undefined) => any) | undefined;
153
153
  "onUpdate:maximized"?: ((_maximized: boolean) => any) | undefined;
@@ -84,14 +84,12 @@ const _sfc_main = defineComponent({
84
84
  emits: {
85
85
  reload: () => true,
86
86
  "update:size": (_size) => true,
87
- "update:columns": (_columns) => true,
87
+ "update:columns": (_columns, _tableColumns) => true,
88
88
  "update:maximized": (_maximized) => true
89
89
  },
90
90
  setup(props, { emit }) {
91
91
  const { lang } = useLocale("table", props);
92
- const placement = computed(() => {
93
- return props.maximized ? "bottom" : "top";
94
- });
92
+ const placement = computed(() => props.maximized ? "bottom" : "top");
95
93
  const reload = () => {
96
94
  emit("reload");
97
95
  };
@@ -101,8 +99,8 @@ const _sfc_main = defineComponent({
101
99
  }
102
100
  emit("update:size", size);
103
101
  };
104
- const updateColumns = (columns) => {
105
- emit("update:columns", columns);
102
+ const updateColumns = (columns, tableColumns) => {
103
+ emit("update:columns", columns, tableColumns);
106
104
  };
107
105
  const toggleMaximized = () => {
108
106
  emit("update:maximized", !props.maximized);
@@ -187,19 +185,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
187
185
  _: 2
188
186
  }, 1032, ["placement", "title"])) : tool === "columns" ? (openBlock(), createBlock(_component_ToolColumn, {
189
187
  key: index + "-columns",
190
- title: _ctx.lang.columns,
191
188
  placement: _ctx.placement,
192
- checkAllText: _ctx.lang.columnTitle,
193
- resetText: _ctx.lang.columnReset,
194
- untitledText: _ctx.lang.columnUntitled,
195
- fixedLeftText: _ctx.lang.columnFixedLeft,
196
- fixedRightText: _ctx.lang.columnFixedRight,
189
+ locale: _ctx.lang,
197
190
  columns: _ctx.columns,
198
191
  sortable: _ctx.columnSortable,
199
192
  allowFixed: _ctx.columnFixed,
200
193
  cacheKey: _ctx.cacheKey,
201
194
  "onUpdate:columns": _ctx.updateColumns
202
- }, null, 8, ["title", "placement", "checkAllText", "resetText", "untitledText", "fixedLeftText", "fixedRightText", "columns", "sortable", "allowFixed", "cacheKey", "onUpdate:columns"])) : tool === "maximized" ? (openBlock(), createBlock(_component_EleTool, {
195
+ }, null, 8, ["placement", "locale", "columns", "sortable", "allowFixed", "cacheKey", "onUpdate:columns"])) : tool === "maximized" ? (openBlock(), createBlock(_component_EleTool, {
203
196
  key: index + "-maximized",
204
197
  placement: _ctx.placement,
205
198
  title: _ctx.lang.maximized,
@@ -11,15 +11,15 @@ declare const _default: import('vue').DefineComponent<{
11
11
  /** 是否开启开关固定列 */
12
12
  allowFixed: BooleanConstructor;
13
13
  }, {
14
- onSortChange: (colItems: ColItem[]) => void;
15
- onCheckedChange: (colItem: ColItem, checked: boolean) => void;
16
- onFixedLeft: (colItem: ColItem) => void;
17
- onFixedRight: (colItem: ColItem) => void;
18
- onFixedLeftTooltip: (e: MouseEvent) => void;
19
- onFixedRightTooltip: (e: MouseEvent) => void;
20
- onChildSortChange: (colItems: ColItem[], parent?: ColItem) => void;
21
- onChildFixedLeftTooltip: (el: HTMLElement) => void;
22
- onChildFixedRightTooltip: (el: HTMLElement) => void;
14
+ handleSortChange: (colItems: ColItem[]) => void;
15
+ handleCheckedChange: (colItem: ColItem, checked: boolean) => void;
16
+ handleFixedLeft: (colItem: ColItem) => void;
17
+ handleFixedRight: (colItem: ColItem) => void;
18
+ handleFixedLeftTooltip: (e: MouseEvent) => void;
19
+ handleFixedRightTooltip: (e: MouseEvent) => void;
20
+ handleChildSortChange: (colItems: ColItem[], parent?: ColItem) => void;
21
+ handleChildFixedLeftTooltip: (el: HTMLElement) => void;
22
+ handleChildFixedRightTooltip: (el: HTMLElement) => void;
23
23
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
24
24
  sortChange: (_colItems: ColItem[], _parent?: ColItem) => true;
25
25
  checkedChange: (_item: ColItem, _checked: boolean) => true;