@utogether/udp-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.ts +90 -0
- package/build/plugins.ts +26 -0
- package/dist/403-B1R-4vXw.js +64 -0
- package/dist/404-fXPl8csw.js +64 -0
- package/dist/500-eI5842YB.js +66 -0
- package/dist/AuthorityInfo-CfVH6PaB.js +4 -0
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-DbK-f8jH.js +102 -0
- package/dist/AuthorityPanel-BaLMwMgW.js +4 -0
- package/dist/AuthorityPanel.vue_vue_type_style_index_0_lang-C_bkqLD9.js +107 -0
- package/dist/Company-CYC9Avfz.js +25 -0
- package/dist/CompanyPanel-B4MzoqN_.js +206 -0
- package/dist/DataSet-DT-rGICv.js +147 -0
- package/dist/Department-B4BNSiYx.js +25 -0
- package/dist/DepartmentPanel-zJO89L2O.js +224 -0
- package/dist/DesignPanel-S8P0J97f.js +4 -0
- package/dist/DesignPanel.vue_vue_type_style_index_0_lang-DW-_Vqrr.js +1015 -0
- package/dist/DictView-bIS5-rK-.js +95 -0
- package/dist/InvOrganization-MuM2jtsG.js +66 -0
- package/dist/Org-kXHSjsgJ.js +35 -0
- package/dist/Preview-CRyiwUIR.js +48 -0
- package/dist/ReportDefine-WZYIx8Sm.js +10 -0
- package/dist/ReportDesign-D-7GKgpb.js +165 -0
- package/dist/ReportQuery-BIIJny6w.js +75 -0
- package/dist/ReportQueryFrom-OoUl7N2O.js +4 -0
- package/dist/ReportQueryFrom.vue_vue_type_style_index_0_lang-B878fgj8.js +177 -0
- package/dist/ReportTemplate-Cfeq9US-.js +161 -0
- package/dist/Role-BwTV2QMH.js +25 -0
- package/dist/RoleAssign-De1JjOun.js +26 -0
- package/dist/RolePanel-E3RcdByM.js +4 -0
- package/dist/RolePanel-pUBXsqCM.js +4 -0
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-B2pQwHb0.js +148 -0
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-CTIad9_Q.js +126 -0
- package/dist/ScrollPanel.vue_vue_type_style_index_0_lang-vMR1fBi0.js +100 -0
- package/dist/Staff-Czm7A8vI.js +25 -0
- package/dist/StaffInfo-DJzvBuxy.js +4 -0
- package/dist/StaffInfo.vue_vue_type_style_index_0_lang-DMTL7KCh.js +108 -0
- package/dist/StaffPanel-CHk60LEz.js +4 -0
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-iPKLb5wG.js +114 -0
- package/dist/SysUser-BGwbttRn.js +15 -0
- package/dist/SysUserPanel-BCbKoLKt.js +4 -0
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-0QUjnhjF.js +289 -0
- package/dist/SystemMenu-BkqZSDKl.js +151 -0
- package/dist/UserInfo-BsyAcT2d.js +4 -0
- package/dist/UserInfo.vue_vue_type_style_index_0_lang-D0-KDxAh.js +158 -0
- package/dist/await-to-js.es5-BtRbN2QH.js +10 -0
- package/dist/childView-CF83nhxb.js +4 -0
- package/dist/childView-CyuLTUqC.js +4 -0
- package/dist/childView.vue_vue_type_style_index_0_lang-CNSgGda3.js +187 -0
- package/dist/childView.vue_vue_type_style_index_0_lang-Cch4lE-i.js +144 -0
- package/dist/code-rule-Bz-gnktN.js +147 -0
- package/dist/core.es.js +13 -0
- package/dist/core.umd.js +173 -0
- package/dist/cron-task-CIifSUdW.js +135 -0
- package/dist/frameView-_d2mqjjQ.js +43 -0
- package/dist/img/l_img.svg +1 -0
- package/dist/img/minicolors.png +0 -0
- package/dist/img/v_img.svg +1 -0
- package/dist/index-BKIw8tSn.js +9195 -0
- package/dist/layoutView-DLKVepB8.js +3317 -0
- package/dist/log-in-e7D5Ss1P.js +110 -0
- package/dist/log-out--RRncZhN.js +120 -0
- package/dist/login-LREiDfFU.js +251 -0
- package/dist/login-log-CvVnyGi3.js +68 -0
- package/dist/lov-view-DDrIVILB.js +97 -0
- package/dist/menuInfo-B1FUV-Sk.js +4 -0
- package/dist/menuInfo.vue_vue_type_style_index_0_lang-Cnk3vdtD.js +338 -0
- package/dist/pda-app-CRhVGijN.js +2209 -0
- package/dist/redirect-DiaNDu8F.js +15 -0
- package/dist/resource-BCwx9fEv.js +97 -0
- package/dist/su-welcome-189A7N4r.js +526 -0
- package/dist/sys-config-BZ3sejow.js +277 -0
- package/dist/udp-core.css +9 -0
- package/dist/utogether-r08LNiIZ.js +182 -0
- package/index.ts +36 -0
- package/package.json +16 -0
- package/public/img/l_img.svg +1 -0
- package/public/img/minicolors.png +0 -0
- package/public/img/v_img.svg +1 -0
- package/src/App.vue +70 -0
- package/src/api/http.ts +50 -0
- package/src/api/index.ts +31 -0
- package/src/api/mock.ts +20 -0
- package/src/api/user.ts +43 -0
- package/src/assets/images/avatars.jpg +0 -0
- package/src/assets/images/empty.png +0 -0
- package/src/assets/images/login.png +0 -0
- package/src/assets/images/logo.png +0 -0
- package/src/assets/images/mask-text.jpg +0 -0
- package/src/assets/images/minicolors.png +0 -0
- package/src/assets/images/utogether.png +0 -0
- package/src/assets/images/welcome.png +0 -0
- package/src/assets/status/403.svg +1 -0
- package/src/assets/status/404.svg +1 -0
- package/src/assets/status/500.svg +1 -0
- package/src/assets/svg/back_top.svg +1 -0
- package/src/assets/svg/bg.svg +1 -0
- package/src/assets/svg/close.svg +1 -0
- package/src/assets/svg/close_all.svg +1 -0
- package/src/assets/svg/close_left.svg +1 -0
- package/src/assets/svg/close_other.svg +1 -0
- package/src/assets/svg/close_right.svg +1 -0
- package/src/assets/svg/dark.svg +1 -0
- package/src/assets/svg/day.svg +1 -0
- package/src/assets/svg/enter_outlined.svg +1 -0
- package/src/assets/svg/exit_screen.svg +1 -0
- package/src/assets/svg/full_screen.svg +1 -0
- package/src/assets/svg/globalization.svg +1 -0
- package/src/assets/svg/loading.svg +17 -0
- package/src/assets/svg/mdi_keyboard_esc.svg +1 -0
- package/src/assets/svg/refresh.svg +1 -0
- package/src/assets/svg/system.svg +1 -0
- package/src/components/ReCountTo/README.md +2 -0
- package/src/components/ReCountTo/index.ts +18 -0
- package/src/components/ReCountTo/src/normal/index.tsx +165 -0
- package/src/components/ReCountTo/src/normal/props.ts +37 -0
- package/src/components/ReCountTo/src/rebound/index.tsx +67 -0
- package/src/components/ReCountTo/src/rebound/props.ts +14 -0
- package/src/components/ReCountTo/src/rebound/rebound.css +77 -0
- package/src/components/ReCropper/index.ts +14 -0
- package/src/components/ReCropper/src/index.tsx +141 -0
- package/src/components/ReFlicker/index.css +39 -0
- package/src/components/ReFlicker/index.ts +50 -0
- package/src/components/ReFlop/index.ts +14 -0
- package/src/components/ReFlop/src/Filpper.tsx +99 -0
- package/src/components/ReFlop/src/filpper.css +184 -0
- package/src/components/ReFlop/src/index.vue +126 -0
- package/src/components/ReFlowChart/index.ts +24 -0
- package/src/components/ReFlowChart/src/Control.vue +139 -0
- package/src/components/ReFlowChart/src/DataDialog.vue +12 -0
- package/src/components/ReFlowChart/src/NodePanel.vue +151 -0
- package/src/components/ReFlowChart/src/adpterForTurbo.ts +160 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.css +49 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.eot +0 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.js +61 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.json +58 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.svg +47 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff +0 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff2 +0 -0
- package/src/components/ReFlowChart/src/config.ts +62 -0
- package/src/components/ReIcon/index.ts +12 -0
- package/src/components/ReIcon/src/Icon.vue +81 -0
- package/src/components/ReIcon/src/hooks.ts +63 -0
- package/src/components/ReIcon/src/iconfont.ts +45 -0
- package/src/components/ReIcon/src/iconifyIconOffline.ts +36 -0
- package/src/components/ReIcon/src/iconifyIconOnline.ts +28 -0
- package/src/components/ReIcon/src/offlineIcon.ts +64 -0
- package/src/components/ReIcon/src/types.ts +20 -0
- package/src/components/ReSplitPane/index.css +49 -0
- package/src/components/ReSplitPane/index.tsx +119 -0
- package/src/components/ReSplitPane/resizer.css +45 -0
- package/src/components/ReSplitPane/resizer.tsx +30 -0
- package/src/components/SuCharts/index.ts +36 -0
- package/src/components/SuCharts/src/EchartBar.vue +134 -0
- package/src/components/SuCharts/src/UserInfo.vue +78 -0
- package/src/components/SuCharts/src/echart-line.vue +85 -0
- package/src/components/SuCharts/src/echart-pie.vue +95 -0
- package/src/components/SuCommon/card/components/Card.vue +148 -0
- package/src/components/SuCommon/card/components/DialogForm.vue +127 -0
- package/src/components/SuCommon/card/index.vue +142 -0
- package/src/components/SuCommon/icon-select/index.vue +241 -0
- package/src/components/SuCommon/table/index.vue +208 -0
- package/src/components/SuCommon/utils/index.ts +103 -0
- package/src/components/SuCommon/utils/slot.tsx +50 -0
- package/src/components/SuFloatButton/index.vue +159 -0
- package/src/components/SuQrcode/index.ts +14 -0
- package/src/components/SuQrcode/src/index.scss +9 -0
- package/src/components/SuQrcode/src/index.tsx +236 -0
- package/src/components/SuScrollTree/ScrollPanel.vue +175 -0
- package/src/components/SuTable/SuTable.vue +334 -0
- package/src/components/SuTypeit/index.ts +51 -0
- package/src/config/index.ts +35 -0
- package/src/contant/index.ts +20 -0
- package/src/directives/elResizeDetector/index.ts +33 -0
- package/src/directives/index.ts +11 -0
- package/src/directives/permission/index.ts +29 -0
- package/src/layout/components/lay-chrome/index.vue +30 -0
- package/src/layout/components/lay-content/index.vue +143 -0
- package/src/layout/components/lay-navbar/index.vue +237 -0
- package/src/layout/components/lay-notice/data.ts +59 -0
- package/src/layout/components/lay-notice/index.vue +83 -0
- package/src/layout/components/lay-notice/noticeItem.vue +160 -0
- package/src/layout/components/lay-notice/noticeList.vue +19 -0
- package/src/layout/components/lay-panel/index.vue +150 -0
- package/src/layout/components/lay-search/components/SearchFooter.vue +67 -0
- package/src/layout/components/lay-search/components/SearchModal.vue +189 -0
- package/src/layout/components/lay-search/components/SearchResult.vue +132 -0
- package/src/layout/components/lay-search/components/index.ts +10 -0
- package/src/layout/components/lay-search/index.vue +25 -0
- package/src/layout/components/lay-select-org/index.vue +69 -0
- package/src/layout/components/lay-setting/index.vue +510 -0
- package/src/layout/components/lay-sidebar/breadCrumb.vue +131 -0
- package/src/layout/components/lay-sidebar/extraIcon.vue +25 -0
- package/src/layout/components/lay-sidebar/hamBurger.vue +72 -0
- package/src/layout/components/lay-sidebar/horizontal.vue +191 -0
- package/src/layout/components/lay-sidebar/mixNav.vue +258 -0
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +98 -0
- package/src/layout/components/lay-sidebar/sidebarItem.vue +205 -0
- package/src/layout/components/lay-sidebar/vertical.vue +94 -0
- package/src/layout/components/lay-tag/index.scss +375 -0
- package/src/layout/components/lay-tag/index.vue +625 -0
- package/src/layout/frameView.vue +71 -0
- package/src/layout/hooks/useBoolean.ts +33 -0
- package/src/layout/hooks/useDataThemeChange.ts +142 -0
- package/src/layout/hooks/useLayout.ts +65 -0
- package/src/layout/hooks/useNav.ts +173 -0
- package/src/layout/hooks/useTag.ts +233 -0
- package/src/layout/hooks/useTranslationLang.ts +51 -0
- package/src/layout/layoutView.vue +215 -0
- package/src/layout/redirect.vue +30 -0
- package/src/layout/routerView/parent.vue +23 -0
- package/src/layout/types.ts +92 -0
- package/src/main.ts +108 -0
- package/src/plugins/echarts/index.ts +58 -0
- package/src/plugins/echarts/theme.json +394 -0
- package/src/plugins/i18n/en.ts +289 -0
- package/src/plugins/i18n/index.ts +76 -0
- package/src/plugins/i18n/module/u-report.ts +64 -0
- package/src/plugins/i18n/module/u-workflow.ts +71 -0
- package/src/plugins/i18n/module/umsg.ts +28 -0
- package/src/plugins/i18n/zh.ts +337 -0
- package/src/plugins/vxe-table/index.ts +46 -0
- package/src/plugins/vxe-table/render.tsx +397 -0
- package/src/router/createComponent.tsx +25 -0
- package/src/router/index.ts +183 -0
- package/src/router/modules/error.ts +32 -0
- package/src/router/modules/home.ts +32 -0
- package/src/router/modules/nested.ts +93 -0
- package/src/router/modules/remaining.ts +83 -0
- package/src/router/modules/tabs.ts +55 -0
- package/src/router/utils.ts +377 -0
- package/src/store/index.ts +9 -0
- package/src/store/modules/app.ts +69 -0
- package/src/store/modules/epTheme.ts +49 -0
- package/src/store/modules/multiTags.ts +109 -0
- package/src/store/modules/permission.ts +103 -0
- package/src/store/modules/settings.ts +40 -0
- package/src/store/modules/system.ts +180 -0
- package/src/store/modules/types.ts +49 -0
- package/src/style/button.scss +78 -0
- package/src/style/clear-mixin.scss +28 -0
- package/src/style/dark.scss +218 -0
- package/src/style/element-plus.scss +206 -0
- package/src/style/index.scss +76 -0
- package/src/style/login.css +336 -0
- package/src/style/login2.css +106 -0
- package/src/style/print-lock.css +375 -0
- package/src/style/reset.scss +272 -0
- package/src/style/sidebar.scss +770 -0
- package/src/style/suprint.css +985 -0
- package/src/style/tailwind.css +68 -0
- package/src/style/theme.scss +143 -0
- package/src/style/transition.scss +42 -0
- package/src/style/vxetable.scss +256 -0
- package/src/utils/authority/index.ts +29 -0
- package/src/utils/browers.ts +59 -0
- package/src/utils/dataFormat/index.ts +223 -0
- package/src/utils/http/index.ts +297 -0
- package/src/utils/http/types.d.ts +46 -0
- package/src/utils/index.ts +47 -0
- package/src/utils/lifecycle.ts +20 -0
- package/src/utils/mitt.ts +19 -0
- package/src/utils/propTypes.ts +47 -0
- package/src/utils/storage/index.ts +51 -0
- package/src/views/components/contextmenu/basic.vue +74 -0
- package/src/views/components/contextmenu/context-menu.vue +40 -0
- package/src/views/components/contextmenu/menuDynamic.vue +99 -0
- package/src/views/components/contextmenu/menuGroup.vue +71 -0
- package/src/views/components/count-to/index.vue +43 -0
- package/src/views/components/cropping/index.vue +59 -0
- package/src/views/components/cropping/picture.jpeg +0 -0
- package/src/views/components/split-pane/index.vue +82 -0
- package/src/views/components/video/index.vue +57 -0
- package/src/views/error/403.vue +50 -0
- package/src/views/error/404.vue +50 -0
- package/src/views/error/500.vue +52 -0
- package/src/views/login/login-view.vue +314 -0
- package/src/views/login/utils/motion.ts +47 -0
- package/src/views/login/utils/rule.ts +70 -0
- package/src/views/login/utils/verifyCode.ts +52 -0
- package/src/views/organization/company/Company.vue +56 -0
- package/src/views/organization/company/CompanyPanel.vue +259 -0
- package/src/views/organization/department/Department.vue +58 -0
- package/src/views/organization/department/DepartmentPanel.vue +283 -0
- package/src/views/organization/inv-org/InvOrganization.vue +53 -0
- package/src/views/organization/org/Org.vue +43 -0
- package/src/views/organization/staff/Staff.vue +58 -0
- package/src/views/organization/staff/StaffInfo.vue +163 -0
- package/src/views/organization/staff/StaffPanel.vue +144 -0
- package/src/views/system/cron/cron-task.vue +157 -0
- package/src/views/system/menu/AuthorityPanel.vue +140 -0
- package/src/views/system/menu/SystemMenu.vue +191 -0
- package/src/views/system/menu/menuInfo.vue +368 -0
- package/src/views/system/role/AuthorityInfo.vue +147 -0
- package/src/views/system/role/Role.vue +57 -0
- package/src/views/system/role/RolePanel.vue +191 -0
- package/src/views/system/role/UserInfo.vue +193 -0
- package/src/views/system/role-assign/RoleAssign.vue +57 -0
- package/src/views/system/role-assign/RolePanel.vue +136 -0
- package/src/views/system/sys/sys-config.vue +291 -0
- package/src/views/system/sysUser/SysUser.vue +45 -0
- package/src/views/system/sysUser/SysUserPanel.vue +278 -0
- package/src/views/uapp/pda/pda-app.vue +176 -0
- package/src/views/udev/coderule/code-rule.vue +121 -0
- package/src/views/udev/dict/DictView.vue +106 -0
- package/src/views/udev/dict/childView.vue +222 -0
- package/src/views/udev/lov/childView.vue +180 -0
- package/src/views/udev/lov/lov-view.vue +91 -0
- package/src/views/ufile/aggregation/File.vue +87 -0
- package/src/views/ufile/file/water-mark.vue +103 -0
- package/src/views/uhome/components/menu-favorite.vue +331 -0
- package/src/views/uhome/su-welcome.vue +339 -0
- package/src/views/ulogin/login.vue +316 -0
- package/src/views/umsg/monitor/msg-monitor.vue +36 -0
- package/src/views/umsg/msg/TemplateContent.vue +103 -0
- package/src/views/umsg/msg/msg-template.vue +66 -0
- package/src/views/umsg/send/childView.vue +142 -0
- package/src/views/umsg/send/msg-send.vue +95 -0
- package/src/views/upms/interface/log-in.vue +106 -0
- package/src/views/upms/interface/log-out.vue +107 -0
- package/src/views/upms/user/login-log.vue +60 -0
- package/src/views/urpt/dataSet/DataSet.vue +139 -0
- package/src/views/urpt/design/DesignPanel.vue +526 -0
- package/src/views/urpt/design/Preview.vue +65 -0
- package/src/views/urpt/design/ReportDesign.vue +249 -0
- package/src/views/urpt/design/bg.png +0 -0
- package/src/views/urpt/design/panel.ts +841 -0
- package/src/views/urpt/design/print-data.ts +59 -0
- package/src/views/urpt/query/ReportQuery.vue +122 -0
- package/src/views/urpt/query/ReportQueryFrom.vue +252 -0
- package/src/views/urpt/report-request/ReportDefine.vue +10 -0
- package/src/views/urpt/static-resource/resource.vue +116 -0
- package/src/views/urpt/template/ReportTemplate.vue +198 -0
- package/tsconfig.json +30 -0
- package/types/env.d.ts +1 -0
- package/types/global-components.d.ts +12 -0
- package/types/global.d.ts +236 -0
- package/types/image.d.ts +7 -0
- package/types/index.d.ts +73 -0
- package/types/router.d.ts +107 -0
- package/types/shims-tsx.d.ts +22 -0
- package/types/shims-vue.d.ts +20 -0
- package/vite.config.ts +73 -0
|
@@ -0,0 +1,526 @@
|
|
|
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>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2022-03-22 16:09:36
|
|
4
|
+
* @LastEditors: wei.li
|
|
5
|
+
* @LastEditTime: 2022-04-08 09:14:23
|
|
6
|
+
* @Description: 打印预览
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<div class="ut-preview-contain">
|
|
10
|
+
<vxe-modal
|
|
11
|
+
v-model="showModal"
|
|
12
|
+
:loading="loading"
|
|
13
|
+
:width="paperWidth + 'mm'"
|
|
14
|
+
min-height="480"
|
|
15
|
+
:lock-scroll="false"
|
|
16
|
+
:show-footer="false"
|
|
17
|
+
>
|
|
18
|
+
<template #title>
|
|
19
|
+
<ut-button status="u-cyan" icon="ri-printer-line" content="print" @tap="handlePrint" />
|
|
20
|
+
</template>
|
|
21
|
+
<template #default>
|
|
22
|
+
<div id="preview_content" />
|
|
23
|
+
</template>
|
|
24
|
+
</vxe-modal>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
import { nextTick, ref } from 'vue';
|
|
30
|
+
|
|
31
|
+
const showModal = ref(false);
|
|
32
|
+
const loading = ref(false);
|
|
33
|
+
const printerTemplate = ref(null);
|
|
34
|
+
const printerData = ref(null);
|
|
35
|
+
const paperWidth = ref(220);
|
|
36
|
+
|
|
37
|
+
const hanldePreview = (template, data) => {
|
|
38
|
+
loading.value = true;
|
|
39
|
+
printerTemplate.value = template;
|
|
40
|
+
printerData.value = data;
|
|
41
|
+
nextTick(() => {
|
|
42
|
+
$('#preview_content').html(template.getHtml(data));
|
|
43
|
+
loading.value = false;
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const handlePrint = () => {
|
|
47
|
+
printerTemplate.value.print(printerData.value, {});
|
|
48
|
+
};
|
|
49
|
+
const show = (printerTemplate, printerData, width = 220) => {
|
|
50
|
+
showModal.value = true;
|
|
51
|
+
paperWidth.value = width;
|
|
52
|
+
hanldePreview(printerTemplate, printerData);
|
|
53
|
+
};
|
|
54
|
+
defineExpose({
|
|
55
|
+
show
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<style lang="scss" scoped>
|
|
60
|
+
.ut-preview-contain {
|
|
61
|
+
::v-deep(.vxe-modal--body) {
|
|
62
|
+
height: 85vh;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
</style>
|