@utogether/udp-core 1.0.0 → 1.0.1-beta.10

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 (201) hide show
  1. package/build/plugins.ts +39 -26
  2. package/dist/{403-B1R-4vXw.js → 403-Ctxjn4q8.js} +9 -8
  3. package/dist/{404-fXPl8csw.js → 404-W5yzyiZ9.js} +15 -14
  4. package/dist/{500-eI5842YB.js → 500-DXuGEOm4.js} +11 -10
  5. package/dist/{AuthorityInfo-CfVH6PaB.js → AuthorityInfo-C2tflCt8.js} +1 -1
  6. package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-SVgy3HX7.js +100 -0
  7. package/dist/{AuthorityPanel-BaLMwMgW.js → AuthorityPanel-BeBNiwqc.js} +1 -1
  8. package/dist/{AuthorityPanel.vue_vue_type_style_index_0_lang-C_bkqLD9.js → AuthorityPanel.vue_vue_type_style_index_0_lang-CIYmnP9-.js} +6 -6
  9. package/dist/{Company-CYC9Avfz.js → Company-PLez5GoH.js} +3 -3
  10. package/dist/{CompanyPanel-B4MzoqN_.js → CompanyPanel-CIGaQooL.js} +20 -20
  11. package/dist/{Department-B4BNSiYx.js → Department-B9wLsXFm.js} +3 -3
  12. package/dist/{DepartmentPanel-zJO89L2O.js → DepartmentPanel-DSM4lTaz.js} +23 -23
  13. package/dist/{DesignPanel-S8P0J97f.js → DesignPanel-B6a9wW_A.js} +1 -1
  14. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-DW-_Vqrr.js → DesignPanel.vue_vue_type_style_index_0_lang-DtHfoDQk.js} +28 -30
  15. package/dist/DictView-DhFbQxdJ.js +110 -0
  16. package/dist/{InvOrganization-MuM2jtsG.js → InvOrganization-D90AbR3b.js} +2 -2
  17. package/dist/Org-DxBkYabD.js +39 -0
  18. package/dist/{Preview-CRyiwUIR.js → Preview-BFtRpBxw.js} +1 -1
  19. package/dist/{ReportDefine-WZYIx8Sm.js → ReportDefine-BIa2QryC.js} +1 -1
  20. package/dist/{ReportDesign-D-7GKgpb.js → ReportDesign-CnyjI-WD.js} +44 -44
  21. package/dist/{ReportQuery-BIIJny6w.js → ReportQuery-BiK7yEhV.js} +5 -5
  22. package/dist/{ReportQueryFrom-OoUl7N2O.js → ReportQueryFrom-C2rqdFTm.js} +1 -1
  23. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-B878fgj8.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-Ba9HLnXQ.js} +6 -5
  24. package/dist/{ReportTemplate-Cfeq9US-.js → ReportTemplate-DdkLscP3.js} +30 -30
  25. package/dist/{Role-BwTV2QMH.js → Role-BrsxgK8D.js} +6 -6
  26. package/dist/{RoleAssign-De1JjOun.js → RoleAssign-DiqwJqDa.js} +8 -8
  27. package/dist/{RolePanel-pUBXsqCM.js → RolePanel-BDusGyo7.js} +1 -1
  28. package/dist/{RolePanel-E3RcdByM.js → RolePanel-Dqx5dI3f.js} +1 -1
  29. package/dist/RolePanel.vue_vue_type_script_setup_true_lang-2Z1q_5uW.js +132 -0
  30. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-B2pQwHb0.js → RolePanel.vue_vue_type_script_setup_true_lang-B5lUnaMI.js} +40 -34
  31. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-vMR1fBi0.js → ScrollPanel.vue_vue_type_style_index_0_lang-vSP23fEq.js} +23 -23
  32. package/dist/{Staff-Czm7A8vI.js → Staff-Cwi9LQiZ.js} +3 -3
  33. package/dist/StaffInfo-XjVtyaMv.js +4 -0
  34. package/dist/{StaffInfo.vue_vue_type_style_index_0_lang-DMTL7KCh.js → StaffInfo.vue_vue_type_script_setup_true_lang-wSrAuyet.js} +16 -16
  35. package/dist/{StaffPanel-CHk60LEz.js → StaffPanel-C-wYcFdv.js} +1 -1
  36. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-iPKLb5wG.js → StaffPanel.vue_vue_type_script_setup_true_lang-DZNArmnC.js} +46 -49
  37. package/dist/{SysUser-BGwbttRn.js → SysUser-O4tvr-Ur.js} +2 -2
  38. package/dist/{SysUserPanel-BCbKoLKt.js → SysUserPanel-B853docZ.js} +1 -1
  39. package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-DhiYYC97.js +294 -0
  40. package/dist/{SystemMenu-BkqZSDKl.js → SystemMenu-CXR6mrXr.js} +52 -50
  41. package/dist/{UserInfo-BsyAcT2d.js → UserInfo-BkP8pE2a.js} +1 -1
  42. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-D0-KDxAh.js → UserInfo.vue_vue_type_style_index_0_lang-D4r_umjV.js} +38 -36
  43. package/dist/{childView-CyuLTUqC.js → childView-D0HwbgDT.js} +1 -1
  44. package/dist/{childView-CF83nhxb.js → childView-TRqUkSDC.js} +1 -1
  45. package/dist/{childView.vue_vue_type_style_index_0_lang-CNSgGda3.js → childView.vue_vue_type_style_index_0_lang-BzISq0Jf.js} +43 -43
  46. package/dist/{childView.vue_vue_type_style_index_0_lang-Cch4lE-i.js → childView.vue_vue_type_style_index_0_lang-DQRgNsJY.js} +1 -1
  47. package/dist/{code-rule-Bz-gnktN.js → code-rule-BV7PQWhK.js} +13 -14
  48. package/dist/core.es.js +13 -10
  49. package/dist/{cron-task-CIifSUdW.js → cron-task-9ZS9bi7K.js} +11 -11
  50. package/dist/{frameView-_d2mqjjQ.js → frameView-DE83AN50.js} +15 -14
  51. package/dist/img/l_img.svg +1 -1
  52. package/dist/img/minicolors.png +0 -0
  53. package/dist/img/v_img.svg +1 -1
  54. package/dist/index-DVARtten.js +2623 -0
  55. package/dist/{layoutView-DLKVepB8.js → layoutView-D1U-c4By.js} +730 -724
  56. package/dist/{login-log-CvVnyGi3.js → login-log-kqKzKTto.js} +1 -1
  57. package/dist/{login-LREiDfFU.js → login-sPCEiTGT.js} +107 -113
  58. package/dist/{lov-view-DDrIVILB.js → lov-view-76NcYTYl.js} +5 -5
  59. package/dist/{menuInfo-B1FUV-Sk.js → menuInfo-CxjfjFpm.js} +1 -1
  60. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-Cnk3vdtD.js → menuInfo.vue_vue_type_style_index_0_lang-C2qahH3r.js} +98 -95
  61. package/dist/pda-app-BUH16bLj.js +710 -0
  62. package/dist/redirect-BqegffKC.js +15 -0
  63. package/dist/{resource-BCwx9fEv.js → resource-CCuHzoA6.js} +18 -18
  64. package/dist/{su-welcome-189A7N4r.js → su-welcome-mRArONsd.js} +133 -133
  65. package/dist/{sys-config-BZ3sejow.js → sys-config-Cvt05yF6.js} +21 -21
  66. package/dist/udp-core.css +2 -2
  67. package/dist/{utogether-r08LNiIZ.js → utogether-Dm_VBQHR.js} +6 -6
  68. package/index.ts +40 -36
  69. package/package.json +4 -2
  70. package/src/App.vue +65 -70
  71. package/src/api/index.ts +1 -1
  72. package/src/components/SuCharts/src/UserInfo.vue +78 -78
  73. package/src/components/SuScrollTree/ScrollPanel.vue +3 -3
  74. package/src/components/udp/count-down.vue +536 -0
  75. package/src/components/udp/flip-down/FlipCard/flip-card.vue +251 -0
  76. package/src/components/udp/flip-down/FlipCard/interfaces.ts +4 -0
  77. package/src/components/udp/flip-down/FlipClock/flip-clock.vue +113 -0
  78. package/src/components/udp/form-upload.vue +482 -0
  79. package/src/components/udp/form.vue +112 -0
  80. package/src/components/udp/grid.vue +495 -0
  81. package/src/components/udp/index.ts +10 -0
  82. package/src/components/udp/lov.vue +388 -0
  83. package/src/components/udp/modal-form.vue +189 -0
  84. package/src/components/udp/modal-grid.vue +288 -0
  85. package/src/components/udp/upload.vue +423 -0
  86. package/src/components/udp/utils.ts +447 -0
  87. package/src/directives/permission/index.ts +1 -1
  88. package/src/layout/components/lay-navbar/index.vue +1 -1
  89. package/src/layout/components/lay-panel/index.vue +150 -150
  90. package/src/layout/components/lay-search/index.vue +25 -25
  91. package/src/layout/components/lay-sidebar/breadCrumb.vue +1 -1
  92. package/src/layout/components/lay-tag/index.vue +625 -625
  93. package/src/layout/layoutView.vue +215 -215
  94. package/src/main.ts +25 -14
  95. package/src/plugins/i18n/en.ts +302 -289
  96. package/src/plugins/i18n/zh.ts +348 -337
  97. package/src/plugins/vxe-table/index.ts +53 -46
  98. package/src/plugins/vxe-table/render.tsx +956 -397
  99. package/src/router/index.ts +187 -183
  100. package/src/router/modules/remaining.ts +58 -83
  101. package/src/style/button.scss +85 -78
  102. package/src/style/tailwind.css +1 -68
  103. package/src/style/vxetable.scss +44 -11
  104. package/src/utils/authority/index.ts +1 -1
  105. package/src/utils/{http → udp/http}/index.ts +8 -24
  106. package/src/utils/{http → udp/http}/types.d.ts +8 -5
  107. package/src/utils/udp/useRender.ts +431 -0
  108. package/src/views/login/login-view.vue +2 -2
  109. package/src/views/organization/company/CompanyPanel.vue +259 -259
  110. package/src/views/organization/inv-org/InvOrganization.vue +1 -1
  111. package/src/views/organization/org/Org.vue +9 -5
  112. package/src/views/organization/staff/StaffInfo.vue +0 -30
  113. package/src/views/organization/staff/StaffPanel.vue +4 -3
  114. package/src/views/system/menu/AuthorityPanel.vue +2 -2
  115. package/src/views/system/menu/SystemMenu.vue +183 -191
  116. package/src/views/system/menu/menuInfo.vue +363 -368
  117. package/src/views/system/role/AuthorityInfo.vue +19 -33
  118. package/src/views/system/role/Role.vue +1 -5
  119. package/src/views/system/role/RolePanel.vue +11 -2
  120. package/src/views/system/role/UserInfo.vue +195 -193
  121. package/src/views/system/role-assign/RoleAssign.vue +57 -57
  122. package/src/views/system/role-assign/RolePanel.vue +139 -136
  123. package/src/views/system/sys/sys-config.vue +1 -1
  124. package/src/views/system/sysUser/SysUserPanel.vue +278 -278
  125. package/src/views/uapp/pda/pda-app.vue +208 -176
  126. package/src/views/udev/dict/DictView.vue +118 -106
  127. package/src/views/udev/dict/childView.vue +7 -7
  128. package/src/views/udev/lov/lov-view.vue +91 -91
  129. package/src/views/ufile/aggregation/File.vue +5 -5
  130. package/src/views/ufile/file/water-mark.vue +14 -14
  131. package/src/views/uhome/components/menu-favorite.vue +1 -1
  132. package/src/views/uhome/su-welcome.vue +4 -4
  133. package/src/views/ulogin/login.vue +15 -10
  134. package/src/views/upms/user/login-log.vue +1 -1
  135. package/src/views/urpt/design/DesignPanel.vue +507 -526
  136. package/src/views/urpt/design/ReportDesign.vue +15 -19
  137. package/src/views/urpt/static-resource/resource.vue +3 -3
  138. package/src/views/urpt/template/ReportTemplate.vue +7 -7
  139. package/types/global.d.ts +2 -2
  140. package/vite.config.ts +13 -2
  141. package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-DbK-f8jH.js +0 -102
  142. package/dist/DictView-bIS5-rK-.js +0 -95
  143. package/dist/Org-kXHSjsgJ.js +0 -35
  144. package/dist/RolePanel.vue_vue_type_script_setup_true_lang-CTIad9_Q.js +0 -126
  145. package/dist/StaffInfo-DJzvBuxy.js +0 -4
  146. package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-0QUjnhjF.js +0 -289
  147. package/dist/core.umd.js +0 -173
  148. package/dist/index-BKIw8tSn.js +0 -9195
  149. package/dist/pda-app-CRhVGijN.js +0 -2209
  150. package/dist/redirect-DiaNDu8F.js +0 -15
  151. package/src/assets/images/empty.png +0 -0
  152. package/src/assets/images/logo.png +0 -0
  153. package/src/components/ReCountTo/README.md +0 -2
  154. package/src/components/ReCountTo/index.ts +0 -18
  155. package/src/components/ReCountTo/src/normal/index.tsx +0 -165
  156. package/src/components/ReCountTo/src/normal/props.ts +0 -37
  157. package/src/components/ReCountTo/src/rebound/index.tsx +0 -67
  158. package/src/components/ReCountTo/src/rebound/props.ts +0 -14
  159. package/src/components/ReCountTo/src/rebound/rebound.css +0 -77
  160. package/src/components/ReCropper/index.ts +0 -14
  161. package/src/components/ReCropper/src/index.tsx +0 -141
  162. package/src/components/ReFlicker/index.css +0 -39
  163. package/src/components/ReFlicker/index.ts +0 -50
  164. package/src/components/ReFlop/index.ts +0 -14
  165. package/src/components/ReFlop/src/Filpper.tsx +0 -99
  166. package/src/components/ReFlop/src/filpper.css +0 -184
  167. package/src/components/ReFlop/src/index.vue +0 -126
  168. package/src/components/ReFlowChart/index.ts +0 -24
  169. package/src/components/ReFlowChart/src/Control.vue +0 -139
  170. package/src/components/ReFlowChart/src/DataDialog.vue +0 -12
  171. package/src/components/ReFlowChart/src/NodePanel.vue +0 -151
  172. package/src/components/ReFlowChart/src/adpterForTurbo.ts +0 -160
  173. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.css +0 -49
  174. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.eot +0 -0
  175. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.js +0 -61
  176. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.json +0 -58
  177. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.svg +0 -47
  178. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.ttf +0 -0
  179. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff +0 -0
  180. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff2 +0 -0
  181. package/src/components/ReFlowChart/src/config.ts +0 -62
  182. package/src/components/ReSplitPane/index.css +0 -49
  183. package/src/components/ReSplitPane/index.tsx +0 -119
  184. package/src/components/ReSplitPane/resizer.css +0 -45
  185. package/src/components/ReSplitPane/resizer.tsx +0 -30
  186. package/src/components/SuCommon/card/components/Card.vue +0 -148
  187. package/src/components/SuCommon/card/components/DialogForm.vue +0 -127
  188. package/src/components/SuCommon/card/index.vue +0 -142
  189. package/src/components/SuCommon/icon-select/index.vue +0 -241
  190. package/src/components/SuCommon/table/index.vue +0 -208
  191. package/src/components/SuCommon/utils/index.ts +0 -103
  192. package/src/components/SuCommon/utils/slot.tsx +0 -50
  193. package/src/views/components/contextmenu/basic.vue +0 -74
  194. package/src/views/components/contextmenu/context-menu.vue +0 -40
  195. package/src/views/components/contextmenu/menuDynamic.vue +0 -99
  196. package/src/views/components/contextmenu/menuGroup.vue +0 -71
  197. package/src/views/components/count-to/index.vue +0 -43
  198. package/src/views/components/cropping/index.vue +0 -59
  199. package/src/views/components/cropping/picture.jpeg +0 -0
  200. package/src/views/components/split-pane/index.vue +0 -82
  201. package/src/views/components/video/index.vue +0 -57
@@ -1,526 +1,507 @@
1
- <!--
2
- * @Author: wei.li
3
- * @Date: 2022-03-21 10:36:15
4
- * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-04-08 15:38:16
6
- * @Description: 设计面板
7
- -->
8
- <template>
9
- <div v-spinning="loading" class="ut-design-panel">
10
- <el-card class="design-panel-contain">
11
- <el-space style="margin-bottom: 10px" fill>
12
- <div class="flex justify-between">
13
- <div>
14
- <ut-button icon="ri-eye-line ri-1x" content="preview" @tap="handlePreView" />
15
- <el-select
16
- v-model="currentRecord.paperType"
17
- size="small"
18
- placeholder="Select Paper"
19
- class="ml-1 mr-1"
20
- style="width: 100px !important"
21
- @change="handlePaperChange(currentRecord.paperType)"
22
- >
23
- <el-option
24
- v-for="item in dataDict['SU.PRINT.PAPER'].children"
25
- :key="item.dictCode"
26
- :label="item.dictName"
27
- :value="item.dictCode"
28
- >
29
- <span style="float: left">{{ item.dictName }}</span>
30
- <span style="float: right; font-size: 13px; color: var(--el-text-color-secondary)">{{
31
- item.dictDesc
32
- }}</span>
33
- </el-option>
34
- </el-select>
35
- <el-popover
36
- v-if="currentRecord.paperType === 'customize'"
37
- v-model:visible="paperPopVisible"
38
- title="设置纸张宽高(mm)"
39
- width="300"
40
- size="small"
41
- effect="light"
42
- trigger="click"
43
- >
44
- <div>
45
- <div class="flex justify-center mb-1" style="width: 100%">
46
- <vxe-input v-model="paperSize.width" type="number" class="w-40" placeholder="宽(mm)" />
47
- <div class="flex items-center justify-center w-8">~</div>
48
- <vxe-input
49
- v-model="paperSize.height"
50
- type="number"
51
- class="w-40"
52
- placeholder="高(mm)"
53
- />
54
- </div>
55
- <ut-button style="width: 100%" content="confirm" @tap="handleCustomSize" />
56
- </div>
57
- <template #reference>
58
- <ut-button
59
- icon="ri-font-size"
60
- content="customSize"
61
- @click.stop="paperPopVisible = true"
62
- />
63
- </template>
64
- </el-popover>
65
- <ut-button
66
- status="u-cyan"
67
- icon="ri-upload-2-line"
68
- content="importJSON"
69
- auth="import"
70
- @tap="handleShowImport()"
71
- />
72
- <vxe-button
73
- icon="ri-indeterminate-circle-line "
74
- class="design-custom-button"
75
- @click="handleScale('N')"
76
- />
77
- <vxe-input
78
- v-model="scale.ration"
79
- disabled
80
- align="center"
81
- style="width: 70px; margin-left: 10px"
82
- />
83
- <vxe-button
84
- icon="ri-add-circle-fill "
85
- class="design-custom-button"
86
- @click="handleScale('Y')"
87
- />
88
- <ut-button
89
- status="danger"
90
- icon="ri-delete-bin-5-fill"
91
- content="repaint"
92
- auth="repaint"
93
- @tap="handleClearPaper()"
94
- />
95
- </div>
96
- <div>
97
- <ut-button icon="ri-save-3-fill" content="save" @tap="handleSave()" />
98
- <ut-button status="info" icon="ri-reply-fill" content="back" @tap="handleClose" />
99
- </div>
100
- </div>
101
- <div style="font-size: 12px; color: red; text-align: center">
102
- 温馨提示:
103
- 蓝色线(页眉)以下,每张纸打印都会重复打印到页面底部;红色线(页尾)以下,每张纸打印都会重复打印到页面底部
104
- </div>
105
- </el-space>
106
- <el-row>
107
- <el-col :span="3">
108
- <el-card class="ut-design-item">
109
- <el-row>
110
- <el-col :span="24" class="rect-printElement-types hiprintEpContainer">
111
- <el-row class="drag_item_title">拖拽组件列表</el-row>
112
- <el-row style="height: 60px">
113
- <el-col :span="12" class="drag_item_box">
114
- <div>
115
- <a class="ep-draggable-item" tid="defaultModule.text">
116
- <span class="ri-text" ariel-hidden="true" />
117
- <p class="glyphicon-class">文本</p>
118
- </a>
119
- </div>
120
- </el-col>
121
- <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
122
- <div>
123
- <a class="ep-draggable-item" tid="defaultModule.image">
124
- <span class="ri-image-line" ariel-hidden="true" />
125
- <p class="glyphicon-class">图片</p>
126
- </a>
127
- </div>
128
- </el-col>
129
- </el-row>
130
- <el-row style="height: 60px">
131
- <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
132
- <div>
133
- <a class="ep-draggable-item" tid="defaultModule.longText">
134
- <span class="ri-line-height" ariel-hidden="true" />
135
- <p class="glyphicon-class">长文</p>
136
- </a>
137
- </div>
138
- </el-col>
139
- <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
140
- <div>
141
- <a class="ep-draggable-item" tid="defaultModule.table">
142
- <span class="ri-table-line" ariel-hidden="true" />
143
- <p class="glyphicon-class">表格</p>
144
- </a>
145
- </div>
146
- </el-col>
147
- </el-row>
148
- <el-row class="drag_item_title">辅助</el-row>
149
- <el-row style="height: 60px">
150
- <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
151
- <div>
152
- <a class="ep-draggable-item" tid="defaultModule.hline">
153
- <span class="ri-expand-horizontal-s-fill" ariel-hidden="true" />
154
- <p class="glyphicon-class">横线</p>
155
- </a>
156
- </div>
157
- </el-col>
158
- <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
159
- <div>
160
- <a class="ep-draggable-item" tid="defaultModule.vline">
161
- <span class="ri-expand-vertical-s-fill" ariel-hidden="true" />
162
- <p class="glyphicon-class">竖线</p>
163
- </a>
164
- </div>
165
- </el-col>
166
- </el-row>
167
- <el-row style="height: 60px">
168
- <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
169
- <div>
170
- <a class="ep-draggable-item" tid="defaultModule.rect">
171
- <span class="ri-square-line" ariel-hidden="true" />
172
- <p class="glyphicon-class">矩形</p>
173
- </a>
174
- </div>
175
- </el-col>
176
- <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
177
- <div>
178
- <a class="ep-draggable-item" tid="defaultModule.oval">
179
- <span class="ri-checkbox-blank-circle-line" ariel-hidden="true" />
180
- <p class="glyphicon-class">椭圆</p>
181
- </a>
182
- </div>
183
- </el-col>
184
- </el-row>
185
- </el-col>
186
- </el-row>
187
- </el-card>
188
- </el-col>
189
- <el-col :xs="15" :sm="15" :md="15" :lg="16" :xl="18">
190
- <el-card class="card-design">
191
- <div id="hiprint-printTemplate" class="hiprint-printTemplate" />
192
- </el-card>
193
- </el-col>
194
- <el-col :xs="6" :sm="6" :md="6" :lg="5" :xl="3">
195
- <el-card class="design-setting-panel">
196
- <el-row class="hinnn-layout-sider">
197
- <div id="PrintElementOptionSetting" />
198
- </el-row>
199
- </el-card>
200
- </el-col>
201
- </el-row>
202
- </el-card>
203
- <vxe-modal v-model="showImportView" title="导入模板JSON数据" height="320" width="450" show-footer>
204
- <template #default>
205
- <p style="color: red">切勿随意修改JSON数据,可能导致模板加载出错</p>
206
- <vxe-textarea v-model="templateContent" :rows="10" size="mini" />
207
- </template>
208
- <template #footer>
209
- <ut-button icon="ri-close-fill" content="cancel" @tap="showImportView = false" />
210
- <ut-button icon="ri-save-3-fill" status="u-cyan" content="confirm" @tap="handleImportJson" />
211
- </template>
212
- </vxe-modal>
213
- <preview v-if="showPreviewModal" ref="previewRef" />
214
- </div>
215
- </template>
216
-
217
- <script setup lang="ts">
218
- import { onMounted, reactive, ref, nextTick, onBeforeUnmount } from 'vue';
219
- import { VXETable } from 'vxe-table';
220
- import { useGlobal } from '@utogether/utils';
221
- import to from 'await-to-js';
222
- import { clone } from 'xe-utils';
223
- import { useSystemStoreHook } from '../../../store/modules/system';
224
- import panel from './panel';
225
- import Preview from './Preview.vue';
226
- // import printData from './print-data';
227
- import { getServiceApi } from '../../../api';
228
- // import { errorMessage } from '@utogether/utils';
229
-
230
- import '../../../style/suprint.css';
231
- import '../../../style/print-lock.css';
232
-
233
- interface IProps {
234
- record: IRecord;
235
- }
236
- const props = withDefaults(defineProps<IProps>(), {
237
- record: (): IRecord => {
238
- return {};
239
- }
240
- });
241
-
242
- let { $printPlugin } = useGlobal();
243
-
244
- const systemStoreHook = useSystemStoreHook();
245
- const dataDict = systemStoreHook.getDataDict;
246
-
247
- const serviceApi = getServiceApi();
248
- let hiprintTemplate = null;
249
- const showPreviewModal = ref(false);
250
- const paperPopVisible = ref(false);
251
- const showImportView = ref(false);
252
- const loading = ref(false);
253
- const previewRef = ref(null);
254
- const templateContent = ref('');
255
- const currentRecord = ref<IRecord>({});
256
- const paperSize = reactive<IRecord>({});
257
- const scale = reactive({ max: 5, min: 0.5, value: 1, ration: '100%' });
258
-
259
- const handleCustomSize = () => {
260
- paperPopVisible.value = false;
261
- hiprintTemplate.setPaper(paperSize.width || 210, paperSize.height || 296.6);
262
- };
263
- // 直接打印(静默打印)
264
- // const handlePictBridge = async () => {
265
- // if (window.hiwebSocket.opened) {
266
- // const data = await serviceApi('CUS003', {});
267
- // const printerList = hiprintTemplate.getPrinterList();
268
- // hiprintTemplate.print2(data, { printer: '', title: 'hiprint测试打印' });
269
- // return;
270
- // }
271
- // errorMessage('客户端未连接,无法直接打印');
272
- // };
273
-
274
- const handleSave = async (cb?) => {
275
- const body = currentRecord.value;
276
- let bt = templateContent.value;
277
- if (!bt) {
278
- const template = hiprintTemplate.getJson();
279
- bt = JSON.stringify(template);
280
- }
281
- body.templateContent = bt;
282
- loading.value = true;
283
- const [err, data] = await to(serviceApi.put('/urpt/v1/printTemplate', [body]));
284
- loading.value = false;
285
- if (!err) {
286
- templateContent.value = '';
287
- currentRecord.value = data[0];
288
- }
289
- cb && cb();
290
- };
291
-
292
- const handleClose = () => {
293
- // hiprint = null
294
- emit('onClose');
295
- };
296
-
297
- const emit = defineEmits<{ (e: 'onClose'): void }>();
298
-
299
- // 放大缩小值
300
- const handleScale = max => {
301
- let scaleValue = scale.value;
302
- if (max === 'Y') {
303
- scaleValue += 0.1;
304
- if (scaleValue > scale.max) scaleValue = 5;
305
- } else {
306
- scaleValue -= 0.1;
307
- if (scaleValue < scale.min) scaleValue = 0.5;
308
- }
309
- if (hiprintTemplate) {
310
- // scaleValue: 放大缩小值, false: 不保存(不传也一样), 如果传 true, 打印时也会放大
311
- hiprintTemplate.zoom(scaleValue);
312
- scale.value = scaleValue;
313
- scale.ration = `${(scaleValue * 100).toFixed(0)}%`;
314
- }
315
- };
316
-
317
- /**
318
- * @Author: liwei
319
- * @Date: 2021-09-01 11:21:05
320
- * @Desc: 参数设置drawer回调,将参数设置dom添加到弹出层中
321
- */
322
- const handleClearPaper = async () => {
323
- const type = await VXETable.modal.confirm('重绘操作不可逆,您确定继续吗?', '温馨提示');
324
- if (type === 'confirm') {
325
- hiprintTemplate.clear();
326
- }
327
- };
328
- const handleShowImport = async () => {
329
- showImportView.value = true;
330
- };
331
- const handleImportJson = async () => {
332
- const type = await VXETable.modal.confirm('导入后将覆盖原有的模板,您确定继续吗?', '温馨提示');
333
- if (type === 'confirm') {
334
- handleSave(handleClose);
335
- showImportView.value = false;
336
- }
337
- };
338
- const handlePreView = async () => {
339
- showPreviewModal.value = true;
340
- // const data = await serviceApi('CUS003', {});
341
- const data = {};
342
- // data.pageSize = 6789;
343
- nextTick(() => {
344
- previewRef.value.show(hiprintTemplate, data, paperSize.width || 220);
345
- });
346
- };
347
- // 纸张切换
348
- const handlePaperChange = code => {
349
- if ('customize' !== code) {
350
- const { width, height } = getPaperSize(code);
351
- paperSize.width = width;
352
- paperSize.height = height;
353
- hiprintTemplate.setPaper(paperSize.width, paperSize.height);
354
- } else {
355
- paperPopVisible.value = true;
356
- }
357
- };
358
- const getPaperSize = code => {
359
- const paper = {
360
- A3: { width: 420, height: 296.6 },
361
- A4: { width: 210, height: 296.6 },
362
- A5: { width: 210, height: 147.6 },
363
- bisect: { width: 241, height: 140 },
364
- trisection: { width: 241, height: 93 }
365
- };
366
- return paper[code];
367
- };
368
-
369
- onMounted(() => {
370
- const { record } = props;
371
- loading.value = true;
372
- currentRecord.value = clone(record, true);
373
- const template = record.templateContent ? JSON.parse(record.templateContent) : panel;
374
- $('#hiprint-printTemplate').empty();
375
- $printPlugin.print.init({
376
- providers: [new $printPlugin.provider()]
377
- });
378
- // 还原配置
379
- $printPlugin.print.setConfig();
380
- // 替换配置
381
- $printPlugin.print.setConfig({
382
- movingDistance: 2.5,
383
- text: {
384
- supportOptions: [
385
- { name: 'styler', hidden: true },
386
- { name: 'formatter', hidden: true }
387
- ]
388
- }
389
- });
390
-
391
- $printPlugin.print.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'));
392
- hiprintTemplate = new $printPlugin.print.PrintTemplate({
393
- template,
394
- settingContainer: '#PrintElementOptionSetting',
395
- paginationContainer: '.hiprint-printPagination',
396
- history: false // 是否需要 撤销重做功能
397
- });
398
- hiprintTemplate.design('#hiprint-printTemplate', { grid: true });
399
- scale.value = hiprintTemplate.editingPanel.scale || 1;
400
- loading.value = false;
401
- });
402
- onBeforeUnmount(() => {
403
- $printPlugin = null;
404
- hiprintTemplate = null;
405
- });
406
- </script>
407
-
408
- <style lang="scss">
409
- .ut-design-panel {
410
- // .design-panel-contain > .el-card__body {
411
- // height: 85vh;
412
- // padding: 3px !important;
413
- // }
414
-
415
- // .card-design {
416
- // display: flex;
417
- // justify-content: center;
418
- // background: url('./bg.png');
419
- // }
420
-
421
- // ::v-deep(.ut-design-item > .el-card__body) {
422
- // padding: 3px;
423
- // }
424
-
425
- // ::v-deep(.card-design > .el-card__body) {
426
- // height: 75vh;
427
- // overflow: auto;
428
- // }
429
-
430
- ::v-deep(.design-setting-panel > .el-card__body) {
431
- height: 75vh;
432
- padding: 3px;
433
- overflow: auto;
434
- }
435
-
436
- // .el-space {
437
- // width: 100%;
438
- // margin: 5px 0 0 !important;
439
- // }
440
-
441
- // ::v-deep(.el-space__item) {
442
- // width: 100%;
443
- // padding-right: 10px;
444
- // padding-bottom: 0 !important;
445
- // }
446
- }
447
- // 拖拽
448
- .drag_item_box {
449
- height: 100%;
450
- padding: 6px;
451
- }
452
-
453
- .drag_item_box > div {
454
- display: flex;
455
- align-items: center;
456
- justify-content: center;
457
- width: 100%;
458
- height: 100%;
459
- background-color: #fff;
460
- }
461
-
462
- .drag_item_box > div > a {
463
- text-align: center;
464
- text-decoration-line: none;
465
- }
466
-
467
- .drag_item_box > div > a > span {
468
- font-size: 28px;
469
- }
470
-
471
- .drag_item_box > div > a > p {
472
- margin: 0;
473
- }
474
-
475
- .drag_item_title {
476
- padding: 12px 6px 0;
477
- font-size: 14px;
478
- font-weight: bold;
479
- }
480
-
481
- // 默认图片
482
- .design-custom-button {
483
- font-size: 16px;
484
- }
485
-
486
- .el-card__body {
487
- padding: 16px;
488
- }
489
-
490
- .design-setting-panel > .el-card__body {
491
- height: 75vh;
492
- padding: 3px;
493
- overflow: auto;
494
- }
495
-
496
- .design-custom-button:not(.is--disabled):hover {
497
- color: inherit !important;
498
- }
499
-
500
- // 辅助线样式
501
- .toplineOfPosition {
502
- border: 0;
503
- border-top: 1px dashed purple;
504
- }
505
-
506
- .bottomlineOfPosition {
507
- border: 0;
508
- border-top: 1px dashed purple;
509
- }
510
-
511
- .leftlineOfPosition {
512
- border: 0;
513
- border-left: 1px dashed purple;
514
- }
515
-
516
- .rightlineOfPosition {
517
- border: 0;
518
- border-left: 1px dashed purple;
519
- }
520
-
521
- // 设计容器
522
- .card-design {
523
- overflow: hidden;
524
- overflow: auto;
525
- }
526
- </style>
1
+ <!--
2
+ * @Author: wei.li
3
+ * @Date: 2022-03-21 10:36:15
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-08-12 09:57:22
6
+ * @Description: 设计面板
7
+ -->
8
+ <template>
9
+ <div v-spinning="loading" class="ut-design-panel">
10
+ <el-card class="design-panel-contain">
11
+ <el-space style="margin-bottom: 10px" fill>
12
+ <div class="flex justify-between">
13
+ <div>
14
+ <ut-button icon="ri-eye-line ri-1x" content="preview" @tap="handlePreView" />
15
+ <el-select
16
+ v-model="currentRecord.paperType"
17
+ size="small"
18
+ placeholder="Select Paper"
19
+ class="ml-1 mr-1"
20
+ style="width: 100px !important"
21
+ @change="handlePaperChange(currentRecord.paperType)"
22
+ >
23
+ <el-option
24
+ v-for="item in dataDict['SU.PRINT.PAPER'].children"
25
+ :key="item.dictCode"
26
+ :label="item.dictName"
27
+ :value="item.dictCode"
28
+ >
29
+ <span style="float: left">{{ item.dictName }}</span>
30
+ <span style="float: right; font-size: 13px; color: var(--el-text-color-secondary)">{{
31
+ item.dictDesc
32
+ }}</span>
33
+ </el-option>
34
+ </el-select>
35
+ <el-popover
36
+ v-if="currentRecord.paperType === 'customize'"
37
+ v-model:visible="paperPopVisible"
38
+ title="设置纸张宽高(mm)"
39
+ width="300"
40
+ size="small"
41
+ effect="light"
42
+ trigger="click"
43
+ >
44
+ <div>
45
+ <div class="flex justify-center mb-1" style="width: 100%">
46
+ <vxe-input v-model="paperSize.width" type="number" class="w-40" placeholder="宽(mm)" />
47
+ <div class="flex items-center justify-center w-8">~</div>
48
+ <vxe-input v-model="paperSize.height" type="number" class="w-40" placeholder="高(mm)" />
49
+ </div>
50
+ <ut-button style="width: 100%" content="confirm" @tap="handleCustomSize" />
51
+ </div>
52
+ <template #reference>
53
+ <ut-button icon="ri-font-size" content="customSize" @tap.stop="paperPopVisible = true" />
54
+ </template>
55
+ </el-popover>
56
+ <ut-button
57
+ status="u-cyan"
58
+ icon="ri-upload-2-line"
59
+ content="importJSON"
60
+ auth="import"
61
+ @tap="handleShowImport()"
62
+ />
63
+ <vxe-button icon="ri-indeterminate-circle-line " class="design-custom-button" @click="handleScale('N')" />
64
+ <vxe-input v-model="scale.ration" disabled align="center" style="width: 70px; margin-left: 10px" />
65
+ <vxe-button icon="ri-add-circle-fill " class="design-custom-button" @click="handleScale('Y')" />
66
+ <ut-button
67
+ status="danger"
68
+ icon="ri-delete-bin-5-fill"
69
+ content="repaint"
70
+ auth="repaint"
71
+ @tap="handleClearPaper()"
72
+ />
73
+ </div>
74
+ <div>
75
+ <ut-button icon="ri-save-3-fill" content="save" @tap="handleSave()" />
76
+ <ut-button status="info" icon="ri-reply-fill" content="back" @tap="handleClose" />
77
+ </div>
78
+ </div>
79
+ <div style="font-size: 12px; color: red; text-align: center">
80
+ 温馨提示: 蓝色线(页眉)以下,每张纸打印都会重复打印到页面底部;红色线(页尾)以下,每张纸打印都会重复打印到页面底部
81
+ </div>
82
+ </el-space>
83
+ <el-row>
84
+ <el-col :span="3">
85
+ <el-card class="ut-design-item">
86
+ <el-row>
87
+ <el-col :span="24" class="rect-printElement-types hiprintEpContainer">
88
+ <el-row class="drag_item_title">拖拽组件列表</el-row>
89
+ <el-row style="height: 60px">
90
+ <el-col :span="12" class="drag_item_box">
91
+ <div>
92
+ <a class="ep-draggable-item" tid="defaultModule.text">
93
+ <span class="ri-text" ariel-hidden="true" />
94
+ <p class="glyphicon-class">文本</p>
95
+ </a>
96
+ </div>
97
+ </el-col>
98
+ <el-col :span="12" class="drag_item_box">
99
+ <div>
100
+ <a class="ep-draggable-item" tid="defaultModule.image">
101
+ <span class="ri-image-line" ariel-hidden="true" />
102
+ <p class="glyphicon-class">图片</p>
103
+ </a>
104
+ </div>
105
+ </el-col>
106
+ </el-row>
107
+ <el-row style="height: 60px">
108
+ <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
109
+ <div>
110
+ <a class="ep-draggable-item" tid="defaultModule.longText">
111
+ <span class="ri-line-height" ariel-hidden="true" />
112
+ <p class="glyphicon-class">长文</p>
113
+ </a>
114
+ </div>
115
+ </el-col>
116
+ <el-col :span="12" class="drag_item_box">
117
+ <div>
118
+ <a class="ep-draggable-item" tid="defaultModule.table">
119
+ <span class="ri-table-line" ariel-hidden="true" />
120
+ <p class="glyphicon-class">表格</p>
121
+ </a>
122
+ </div>
123
+ </el-col>
124
+ </el-row>
125
+ <el-row class="drag_item_title">辅助</el-row>
126
+ <el-row style="height: 60px">
127
+ <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
128
+ <div>
129
+ <a class="ep-draggable-item" tid="defaultModule.hline">
130
+ <span class="ri-expand-horizontal-s-fill" ariel-hidden="true" />
131
+ <p class="glyphicon-class">横线</p>
132
+ </a>
133
+ </div>
134
+ </el-col>
135
+ <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
136
+ <div>
137
+ <a class="ep-draggable-item" tid="defaultModule.vline">
138
+ <span class="ri-expand-vertical-s-fill" ariel-hidden="true" />
139
+ <p class="glyphicon-class">竖线</p>
140
+ </a>
141
+ </div>
142
+ </el-col>
143
+ </el-row>
144
+ <el-row style="height: 60px">
145
+ <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
146
+ <div>
147
+ <a class="ep-draggable-item" tid="defaultModule.rect">
148
+ <span class="ri-square-line" ariel-hidden="true" />
149
+ <p class="glyphicon-class">矩形</p>
150
+ </a>
151
+ </div>
152
+ </el-col>
153
+ <el-col :span="12" class="drag_item_box" tid="defaultModule.text">
154
+ <div>
155
+ <a class="ep-draggable-item" tid="defaultModule.oval">
156
+ <span class="ri-checkbox-blank-circle-line" ariel-hidden="true" />
157
+ <p class="glyphicon-class">椭圆</p>
158
+ </a>
159
+ </div>
160
+ </el-col>
161
+ </el-row>
162
+ </el-col>
163
+ </el-row>
164
+ </el-card>
165
+ </el-col>
166
+ <el-col :xs="15" :sm="15" :md="15" :lg="16" :xl="18">
167
+ <el-card class="card-design">
168
+ <div id="hiprint-printTemplate" class="hiprint-printTemplate" />
169
+ </el-card>
170
+ </el-col>
171
+ <el-col :xs="6" :sm="6" :md="6" :lg="5" :xl="3">
172
+ <el-card class="design-setting-panel">
173
+ <el-row class="hinnn-layout-sider">
174
+ <div id="PrintElementOptionSetting" />
175
+ </el-row>
176
+ </el-card>
177
+ </el-col>
178
+ </el-row>
179
+ </el-card>
180
+ <vxe-modal v-model="showImportView" title="导入模板JSON数据" height="320" width="450" show-footer>
181
+ <template #default>
182
+ <p style="color: red">切勿随意修改JSON数据,可能导致模板加载出错</p>
183
+ <vxe-textarea v-model="templateContent" :rows="10" size="mini" />
184
+ </template>
185
+ <template #footer>
186
+ <ut-button icon="ri-close-fill" content="cancel" @tap="showImportView = false" />
187
+ <ut-button icon="ri-save-3-fill" status="u-cyan" content="confirm" @tap="handleImportJson" />
188
+ </template>
189
+ </vxe-modal>
190
+ <preview v-if="showPreviewModal" ref="previewRef" />
191
+ </div>
192
+ </template>
193
+
194
+ <script setup lang="ts">
195
+ import { onMounted, reactive, ref, nextTick, onBeforeUnmount } from 'vue';
196
+ import { VxeUI } from 'vxe-pc-ui';
197
+ import { useGlobal } from '@utogether/utils';
198
+ import to from 'await-to-js';
199
+ import { clone } from 'xe-utils';
200
+ import { useSystemStoreHook } from '../../../store/modules/system';
201
+ import panel from './panel';
202
+ import Preview from './Preview.vue';
203
+ // import printData from './print-data';
204
+ import { getServiceApi } from '../../../api';
205
+ // import { errorMessage } from '@utogether/utils';
206
+
207
+ import '../../../style/suprint.css';
208
+ import '../../../style/print-lock.css';
209
+
210
+ interface IProps {
211
+ record: IRecord;
212
+ }
213
+ const props = withDefaults(defineProps<IProps>(), {
214
+ record: (): IRecord => {
215
+ return {};
216
+ }
217
+ });
218
+
219
+ let { $printPlugin } = useGlobal();
220
+
221
+ const systemStoreHook = useSystemStoreHook();
222
+ const dataDict = systemStoreHook.getDataDict;
223
+
224
+ const serviceApi = getServiceApi();
225
+ let hiprintTemplate = null;
226
+ const showPreviewModal = ref(false);
227
+ const paperPopVisible = ref(false);
228
+ const showImportView = ref(false);
229
+ const loading = ref(false);
230
+ const previewRef = ref(null);
231
+ const templateContent = ref('');
232
+ const currentRecord = ref<IRecord>({});
233
+ const paperSize = reactive<IRecord>({});
234
+ const scale = reactive({ max: 5, min: 0.5, value: 1, ration: '100%' });
235
+
236
+ const handleCustomSize = () => {
237
+ paperPopVisible.value = false;
238
+ hiprintTemplate.setPaper(paperSize.width || 210, paperSize.height || 296.6);
239
+ };
240
+ // 直接打印(静默打印)
241
+ // const handlePictBridge = async () => {
242
+ // if (window.hiwebSocket.opened) {
243
+ // const data = await serviceApi('CUS003', {});
244
+ // const printerList = hiprintTemplate.getPrinterList();
245
+ // hiprintTemplate.print2(data, { printer: '', title: 'hiprint测试打印' });
246
+ // return;
247
+ // }
248
+ // errorMessage('客户端未连接,无法直接打印');
249
+ // };
250
+
251
+ const handleSave = async (cb?) => {
252
+ const body = currentRecord.value;
253
+ let bt = templateContent.value;
254
+ if (!bt) {
255
+ const template = hiprintTemplate.getJson();
256
+ bt = JSON.stringify(template);
257
+ }
258
+ body.templateContent = bt;
259
+ loading.value = true;
260
+ const [err, data] = await to(serviceApi.put('/urpt/v1/printTemplate', [body]));
261
+ loading.value = false;
262
+ if (!err) {
263
+ templateContent.value = '';
264
+ currentRecord.value = data[0];
265
+ }
266
+ cb && cb();
267
+ };
268
+
269
+ const handleClose = () => {
270
+ // hiprint = null
271
+ emit('onClose');
272
+ };
273
+
274
+ const emit = defineEmits<{ (e: 'onClose'): void }>();
275
+
276
+ // 放大缩小值
277
+ const handleScale = max => {
278
+ let scaleValue = scale.value;
279
+ if (max === 'Y') {
280
+ scaleValue += 0.1;
281
+ if (scaleValue > scale.max) scaleValue = 5;
282
+ } else {
283
+ scaleValue -= 0.1;
284
+ if (scaleValue < scale.min) scaleValue = 0.5;
285
+ }
286
+ if (hiprintTemplate) {
287
+ // scaleValue: 放大缩小值, false: 不保存(不传也一样), 如果传 true, 打印时也会放大
288
+ hiprintTemplate.zoom(scaleValue);
289
+ scale.value = scaleValue;
290
+ scale.ration = `${(scaleValue * 100).toFixed(0)}%`;
291
+ }
292
+ };
293
+
294
+ /**
295
+ * @Author: liwei
296
+ * @Date: 2021-09-01 11:21:05
297
+ * @Desc: 参数设置drawer回调,将参数设置dom添加到弹出层中
298
+ */
299
+ const handleClearPaper = async () => {
300
+ const type = await VxeUI.modal.confirm('重绘操作不可逆,您确定继续吗?', '温馨提示');
301
+ if (type === 'confirm') {
302
+ hiprintTemplate.clear();
303
+ }
304
+ };
305
+ const handleShowImport = async () => {
306
+ showImportView.value = true;
307
+ };
308
+ const handleImportJson = async () => {
309
+ const type = await VxeUI.modal.confirm('导入后将覆盖原有的模板,您确定继续吗?', '温馨提示');
310
+ if (type === 'confirm') {
311
+ handleSave(handleClose);
312
+ showImportView.value = false;
313
+ }
314
+ };
315
+ const handlePreView = async () => {
316
+ showPreviewModal.value = true;
317
+ // const data = await serviceApi('CUS003', {});
318
+ const data = {};
319
+ // data.pageSize = 6789;
320
+ nextTick(() => {
321
+ previewRef.value.show(hiprintTemplate, data, paperSize.width || 220);
322
+ });
323
+ };
324
+ // 纸张切换
325
+ const handlePaperChange = code => {
326
+ if ('customize' !== code) {
327
+ const { width, height } = getPaperSize(code);
328
+ paperSize.width = width;
329
+ paperSize.height = height;
330
+ hiprintTemplate.setPaper(paperSize.width, paperSize.height);
331
+ } else {
332
+ paperPopVisible.value = true;
333
+ }
334
+ };
335
+ const getPaperSize = code => {
336
+ const paper = {
337
+ A3: { width: 420, height: 296.6 },
338
+ A4: { width: 210, height: 296.6 },
339
+ A5: { width: 210, height: 147.6 },
340
+ bisect: { width: 241, height: 140 },
341
+ trisection: { width: 241, height: 93 }
342
+ };
343
+ return paper[code];
344
+ };
345
+
346
+ onMounted(() => {
347
+ const { record } = props;
348
+ loading.value = true;
349
+ currentRecord.value = clone(record, true);
350
+ const template = record.templateContent ? JSON.parse(record.templateContent) : panel;
351
+ $('#hiprint-printTemplate').empty();
352
+ $printPlugin.print.init({
353
+ providers: [new $printPlugin.provider()]
354
+ });
355
+ // 还原配置
356
+ $printPlugin.print.setConfig();
357
+ // 替换配置
358
+ $printPlugin.print.setConfig({
359
+ movingDistance: 2.5,
360
+ text: {
361
+ supportOptions: [
362
+ { name: 'styler', hidden: true },
363
+ { name: 'formatter', hidden: true }
364
+ ]
365
+ }
366
+ });
367
+
368
+ $printPlugin.print.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'));
369
+ hiprintTemplate = new $printPlugin.print.PrintTemplate({
370
+ template,
371
+ settingContainer: '#PrintElementOptionSetting',
372
+ paginationContainer: '.hiprint-printPagination',
373
+ history: false // 是否需要 撤销重做功能
374
+ });
375
+ hiprintTemplate.design('#hiprint-printTemplate', { grid: true });
376
+ scale.value = hiprintTemplate.editingPanel.scale || 1;
377
+ loading.value = false;
378
+ });
379
+ onBeforeUnmount(() => {
380
+ $printPlugin = null;
381
+ hiprintTemplate = null;
382
+ });
383
+ </script>
384
+
385
+ <style lang="scss">
386
+ .ut-design-panel {
387
+ // .design-panel-contain > .el-card__body {
388
+ // height: 85vh;
389
+ // padding: 3px !important;
390
+ // }
391
+
392
+ // .card-design {
393
+ // display: flex;
394
+ // justify-content: center;
395
+ // background: url('./bg.png');
396
+ // }
397
+
398
+ // ::v-deep(.ut-design-item > .el-card__body) {
399
+ // padding: 3px;
400
+ // }
401
+
402
+ // ::v-deep(.card-design > .el-card__body) {
403
+ // height: 75vh;
404
+ // overflow: auto;
405
+ // }
406
+
407
+ ::v-deep(.design-setting-panel > .el-card__body) {
408
+ height: 75vh;
409
+ padding: 3px;
410
+ overflow: auto;
411
+ }
412
+
413
+ // .el-space {
414
+ // width: 100%;
415
+ // margin: 5px 0 0 !important;
416
+ // }
417
+
418
+ // ::v-deep(.el-space__item) {
419
+ // width: 100%;
420
+ // padding-right: 10px;
421
+ // padding-bottom: 0 !important;
422
+ // }
423
+ }
424
+ // 拖拽
425
+ .drag_item_box {
426
+ height: 100%;
427
+ padding: 6px;
428
+ }
429
+
430
+ .drag_item_box > div {
431
+ display: flex;
432
+ align-items: center;
433
+ justify-content: center;
434
+ width: 100%;
435
+ height: 100%;
436
+ background-color: #fff;
437
+ }
438
+
439
+ .drag_item_box > div > a {
440
+ text-align: center;
441
+ text-decoration-line: none;
442
+ }
443
+
444
+ .drag_item_box > div > a > span {
445
+ font-size: 28px;
446
+ }
447
+
448
+ .drag_item_box > div > a > p {
449
+ margin: 0;
450
+ }
451
+
452
+ .drag_item_title {
453
+ padding: 12px 6px 0;
454
+ font-size: 14px;
455
+ font-weight: bold;
456
+ }
457
+
458
+ // 默认图片
459
+ .design-custom-button {
460
+ font-size: 16px;
461
+ }
462
+
463
+ .el-card__body {
464
+ padding: 16px;
465
+ }
466
+
467
+ .design-setting-panel > .el-card__body {
468
+ height: 75vh;
469
+ padding: 3px;
470
+ overflow: auto;
471
+ }
472
+
473
+ .design-custom-button:not(.is--disabled):hover {
474
+ color: inherit !important;
475
+ }
476
+
477
+ // 辅助线样式
478
+ .toplineOfPosition {
479
+ border: 0;
480
+ border-top: 1px dashed purple;
481
+ }
482
+
483
+ .bottomlineOfPosition {
484
+ border: 0;
485
+ border-top: 1px dashed purple;
486
+ }
487
+
488
+ .leftlineOfPosition {
489
+ border: 0;
490
+ border-left: 1px dashed purple;
491
+ }
492
+
493
+ .rightlineOfPosition {
494
+ border: 0;
495
+ border-left: 1px dashed purple;
496
+ }
497
+
498
+ // 设计容器
499
+ .card-design {
500
+ overflow: hidden;
501
+ overflow: auto;
502
+ }
503
+
504
+ .hiprint-printElement-image-content img {
505
+ content: url('/logo.png');
506
+ }
507
+ </style>