af-mobile-client-vue3 1.3.58 → 1.3.60
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/package.json +1 -1
- package/public/favicon.svg +4 -4
- package/scripts/verifyCommit.js +19 -19
- package/src/components/core/ImageUploader/index.vue +7 -3
- package/src/components/data/UserDetail/types.ts +1 -1
- package/src/components/data/XForm/index.vue +5 -1
- package/src/components/data/XFormGroup/doc/DeviceForm.vue +1 -1
- package/src/components/data/XFormGroup/doc/UserForm.vue +1 -1
- package/src/components/data/XFormItem/index.vue +12 -6
- package/src/components/data/XReportGrid/XAddReport/index.ts +1 -1
- package/src/components/data/XReportGrid/XReportDemo.vue +33 -33
- package/src/components/data/XReportGrid/XReportDrawer/index.ts +1 -1
- package/src/components/data/XReportGrid/print.js +184 -184
- package/src/components/data/XTag/index.vue +10 -10
- package/src/components/layout/TabBarLayout/index.vue +40 -40
- package/src/font-style/PingFangSC-Medium.subset.woff2 +0 -0
- package/src/font-style/PingFangSC-Semibold.subset.woff2 +0 -0
- package/src/hooks/useCommon.ts +9 -9
- package/src/plugins/AppData.ts +38 -38
- package/src/router/invoiceRoutes.ts +33 -33
- package/src/services/api/common.ts +109 -109
- package/src/services/api/manage.ts +8 -8
- package/src/services/api/search.ts +16 -16
- package/src/services/restTools.ts +56 -56
- package/src/services/v3Api.ts +11 -11
- package/src/stores/modules/homeApp/README.md +124 -0
- package/src/utils/authority-utils.ts +84 -84
- package/src/utils/crypto.ts +39 -39
- package/src/utils/runEvalFunction.ts +13 -13
- package/src/views/component/EvaluateRecordView/index.vue +40 -40
- package/src/views/component/XCellDetailView/index.vue +217 -217
- package/src/views/component/XCellListView/index.vue +133 -92
- package/src/views/component/XFormGroupView/index.vue +22 -8
- package/src/views/component/XFormView/index.vue +3 -2
- package/src/views/component/XReportFormIframeView/index.vue +47 -47
- package/src/views/component/XReportFormView/index.vue +13 -13
- package/src/views/component/XSignatureView/index.vue +50 -50
- package/src/views/component/notice.vue +46 -46
- package/src/views/component/topNav.vue +36 -36
- package/src/views/invoiceShow/index.vue +61 -61
- package/src/views/user/login/index.vue +22 -22
- package/vite.config.ts +1 -1
package/package.json
CHANGED
package/public/favicon.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg t="1709866807903" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4913" width="32" height="32">
|
|
2
|
-
<path d="M512 598.528a111.232 111.232 0 0 0-111.232 111.2064V870.4h222.464v-160.6656c0-61.44-49.792-111.232-111.232-111.232z m0 58.0608c-30.72 0-55.6032 24.9088-55.6032 55.6288v105.0368h111.2064v-105.0368c0-30.72-24.8832-55.6288-55.6032-55.6288z" fill="#FB4D31" p-id="4914"></path>
|
|
3
|
-
<path d="M542.08 270.208l45.2608-78.5408a24.5248 24.5248 0 0 0 0-25.6A26.4448 26.4448 0 0 0 564.1472 153.6a26.3424 26.3424 0 0 0-22.5792 13.44L512 217.6256l-29.5424-50.5344c-4.5824-8.192-13.184-13.312-22.5536-13.4912a26.4448 26.4448 0 0 0-23.2448 12.4928 24.5248 24.5248 0 0 0 0 25.6l45.2352 78.5152L156.928 832.768a24.4736 24.4736 0 0 0 0.3328 25.088c4.8384 7.8336 13.3888 12.544 22.5792 12.5184h664.3456c9.3184 0 17.92-4.7616 22.6304-12.4672a24.4736 24.4736 0 0 0 0.3072-25.088l-325.0176-562.688v0.0512zM619.52 816.64h-33.3568c-12.3648 0-9.6768 0.1024-65.0496 0H512c-55.3728 0.1024-24.704 0-61.7984 0H225.28L512 322.1248 798.72 816.64h-179.2z" fill="#000000" p-id="4915"></path>
|
|
4
|
-
</svg>
|
|
1
|
+
<svg t="1709866807903" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4913" width="32" height="32">
|
|
2
|
+
<path d="M512 598.528a111.232 111.232 0 0 0-111.232 111.2064V870.4h222.464v-160.6656c0-61.44-49.792-111.232-111.232-111.232z m0 58.0608c-30.72 0-55.6032 24.9088-55.6032 55.6288v105.0368h111.2064v-105.0368c0-30.72-24.8832-55.6288-55.6032-55.6288z" fill="#FB4D31" p-id="4914"></path>
|
|
3
|
+
<path d="M542.08 270.208l45.2608-78.5408a24.5248 24.5248 0 0 0 0-25.6A26.4448 26.4448 0 0 0 564.1472 153.6a26.3424 26.3424 0 0 0-22.5792 13.44L512 217.6256l-29.5424-50.5344c-4.5824-8.192-13.184-13.312-22.5536-13.4912a26.4448 26.4448 0 0 0-23.2448 12.4928 24.5248 24.5248 0 0 0 0 25.6l45.2352 78.5152L156.928 832.768a24.4736 24.4736 0 0 0 0.3328 25.088c4.8384 7.8336 13.3888 12.544 22.5792 12.5184h664.3456c9.3184 0 17.92-4.7616 22.6304-12.4672a24.4736 24.4736 0 0 0 0.3072-25.088l-325.0176-562.688v0.0512zM619.52 816.64h-33.3568c-12.3648 0-9.6768 0.1024-65.0496 0H512c-55.3728 0.1024-24.704 0-61.7984 0H225.28L512 322.1248 798.72 816.64h-179.2z" fill="#000000" p-id="4915"></path>
|
|
4
|
+
</svg>
|
package/scripts/verifyCommit.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
|
|
3
|
-
// import process from 'node:process'
|
|
4
|
-
|
|
5
|
-
const msg = fs.readFileSync('.git/COMMIT_EDITMSG', 'utf-8').trim()
|
|
6
|
-
|
|
7
|
-
const commitRE = /^(?:revert: )?(?:feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(?:\(.+\))?: .{1,50}/
|
|
8
|
-
// const mergeRe = /^(Merge pull request|Merge branch)/
|
|
9
|
-
|
|
10
|
-
if (!commitRE.test(msg)) {
|
|
11
|
-
// if (!mergeRe.test(msg)) {
|
|
12
|
-
// console.log('git commit unpass')
|
|
13
|
-
// console.error('git commit error, needs title(scope): desc')
|
|
14
|
-
// process.exit(1)
|
|
15
|
-
// }
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
console.log('git commit pass')
|
|
19
|
-
}
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
|
|
3
|
+
// import process from 'node:process'
|
|
4
|
+
|
|
5
|
+
const msg = fs.readFileSync('.git/COMMIT_EDITMSG', 'utf-8').trim()
|
|
6
|
+
|
|
7
|
+
const commitRE = /^(?:revert: )?(?:feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(?:\(.+\))?: .{1,50}/
|
|
8
|
+
// const mergeRe = /^(Merge pull request|Merge branch)/
|
|
9
|
+
|
|
10
|
+
if (!commitRE.test(msg)) {
|
|
11
|
+
// if (!mergeRe.test(msg)) {
|
|
12
|
+
// console.log('git commit unpass')
|
|
13
|
+
// console.error('git commit error, needs title(scope): desc')
|
|
14
|
+
// process.exit(1)
|
|
15
|
+
// }
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
console.log('git commit pass')
|
|
19
|
+
}
|
|
@@ -15,6 +15,8 @@ const props = defineProps({
|
|
|
15
15
|
uploadMode: { default: 'server' },
|
|
16
16
|
attr: { type: Object as () => { addOrEdit?: string, acceptCount?: number, uploadImage?: boolean }, default: () => ({}) },
|
|
17
17
|
mode: { default: '新增' }, // 预览
|
|
18
|
+
// 整体只读:只允许预览,禁止拍照/上传/删除
|
|
19
|
+
readonly: { type: Boolean, default: false },
|
|
18
20
|
})
|
|
19
21
|
const emit = defineEmits(['updateFileList', 'updateAllFileList'])
|
|
20
22
|
|
|
@@ -263,6 +265,8 @@ const actionOptions = [
|
|
|
263
265
|
]
|
|
264
266
|
|
|
265
267
|
function handleUploadAreaClick() {
|
|
268
|
+
if (props.readonly)
|
|
269
|
+
return
|
|
266
270
|
if (props.attr?.uploadImage) {
|
|
267
271
|
showActionSheet.value = true
|
|
268
272
|
}
|
|
@@ -333,10 +337,10 @@ function handleActionSelect(option: any) {
|
|
|
333
337
|
ref="uploaderRef"
|
|
334
338
|
v-model="imageList"
|
|
335
339
|
:show-upload="false"
|
|
336
|
-
:deletable="(props.attr?.addOrEdit !== 'readonly' && props.authority === 'admin') && props.mode !== '预览'"
|
|
337
|
-
:multiple="props.authority === 'admin'"
|
|
340
|
+
:deletable="!props.readonly && (props.attr?.addOrEdit !== 'readonly' && props.authority === 'admin') && props.mode !== '预览'"
|
|
341
|
+
:multiple="!props.readonly && props.authority === 'admin'"
|
|
338
342
|
:preview-image="true"
|
|
339
|
-
:before-delete="props.attr?.addOrEdit !== 'readonly' && props.authority === 'admin' ? deleteFileFunction : undefined"
|
|
343
|
+
:before-delete="!props.readonly && props.attr?.addOrEdit !== 'readonly' && props.authority === 'admin' ? deleteFileFunction : undefined"
|
|
340
344
|
/>
|
|
341
345
|
<ActionSheet
|
|
342
346
|
v-model:show="showActionSheet"
|
|
@@ -60,6 +60,8 @@ const props = withDefaults(defineProps<{
|
|
|
60
60
|
isHandleFormKey?: boolean
|
|
61
61
|
paramLogicNameParam?: any
|
|
62
62
|
isGroupForm?: boolean
|
|
63
|
+
// 整体表单只读:为 true 时,所有表单项不可交互
|
|
64
|
+
formReadonly?: boolean
|
|
63
65
|
}>(), {
|
|
64
66
|
configName: undefined,
|
|
65
67
|
groupTitle: undefined,
|
|
@@ -72,6 +74,7 @@ const props = withDefaults(defineProps<{
|
|
|
72
74
|
isHandleFormKey: true,
|
|
73
75
|
paramLogicNameParam: {},
|
|
74
76
|
isGroupForm: false,
|
|
77
|
+
formReadonly: false,
|
|
75
78
|
})
|
|
76
79
|
|
|
77
80
|
const emits = defineEmits(['onSubmit', 'xFormItemEmitFunc'])
|
|
@@ -608,6 +611,7 @@ defineExpose({ init, form, formGroupName, validate, asyncSubmit, setForm, getFor
|
|
|
608
611
|
:rules="rules"
|
|
609
612
|
:service-name="myServiceName"
|
|
610
613
|
:get-data-params="myGetDataParams"
|
|
614
|
+
:form-readonly="props.formReadonly"
|
|
611
615
|
@set-form="setForm"
|
|
612
616
|
@x-form-item-emit-func="emitFunc"
|
|
613
617
|
/>
|
|
@@ -624,7 +628,7 @@ defineExpose({ init, form, formGroupName, validate, asyncSubmit, setForm, getFor
|
|
|
624
628
|
<div class="map-mask" />
|
|
625
629
|
</div>
|
|
626
630
|
</div>
|
|
627
|
-
<div v-if="resolvedSubmitButton && props.mode !== '预览'" class="form-footer-fixed">
|
|
631
|
+
<div v-if="resolvedSubmitButton && props.mode !== '预览' && !props.formReadonly" class="form-footer-fixed">
|
|
628
632
|
<VanButton class="action-btn" round block type="primary" native-type="submit">
|
|
629
633
|
{{ props.groupFormItems?.btnName ? props.groupFormItems.btnName : '提交' }}
|
|
630
634
|
</VanButton>
|
|
@@ -44,6 +44,11 @@ const props = defineProps({
|
|
|
44
44
|
form: {
|
|
45
45
|
type: Object,
|
|
46
46
|
},
|
|
47
|
+
// 整表只读:来自 XForm,统一控制交互
|
|
48
|
+
formReadonly: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
47
52
|
datePickerFilter: {
|
|
48
53
|
type: Function,
|
|
49
54
|
default: () => true,
|
|
@@ -512,7 +517,7 @@ const labelAlign = computed(() => {
|
|
|
512
517
|
})
|
|
513
518
|
// 是否只读
|
|
514
519
|
const readonly = computed(() => {
|
|
515
|
-
return attr.addOrEdit === 'readonly' || mode === '预览'
|
|
520
|
+
return props.formReadonly || attr.addOrEdit === 'readonly' || mode === '预览'
|
|
516
521
|
})
|
|
517
522
|
// 提示内容
|
|
518
523
|
const placeholder = computed(() => {
|
|
@@ -982,6 +987,7 @@ function findOptionInTree(options, value) {
|
|
|
982
987
|
authority="admin"
|
|
983
988
|
:attr="attr"
|
|
984
989
|
:mode="props.mode"
|
|
990
|
+
:readonly="readonly"
|
|
985
991
|
@update-file-list="updateFile"
|
|
986
992
|
/>
|
|
987
993
|
</template>
|
|
@@ -1089,7 +1095,7 @@ function findOptionInTree(options, value) {
|
|
|
1089
1095
|
:is-link="true"
|
|
1090
1096
|
:placeholder="attr.placeholder ? attr.placeholder : `请选择${attr.name}`"
|
|
1091
1097
|
:rules="[{ required: attr.rule.required === 'true', message: `请选择${attr.name}` }]"
|
|
1092
|
-
@click="showDatePicker = true"
|
|
1098
|
+
@click="readonly ? null : (showDatePicker = true)"
|
|
1093
1099
|
/>
|
|
1094
1100
|
<VanPopup v-model:show="showDatePicker" position="bottom" teleport="body" overlay-class="date-picker-overlay">
|
|
1095
1101
|
<VanPickerGroup
|
|
@@ -1126,7 +1132,7 @@ function findOptionInTree(options, value) {
|
|
|
1126
1132
|
:label-align="labelAlign"
|
|
1127
1133
|
:input-align="attr.inputAlign ? attr.inputAlign : 'left'"
|
|
1128
1134
|
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
1129
|
-
@click="showTimePicker = true"
|
|
1135
|
+
@click="readonly ? null : (showTimePicker = true)"
|
|
1130
1136
|
/>
|
|
1131
1137
|
<VanPopup v-model:show="showTimePicker" position="bottom" teleport="body" overlay-class="date-picker-overlay">
|
|
1132
1138
|
<VanTimePicker
|
|
@@ -1154,7 +1160,7 @@ function findOptionInTree(options, value) {
|
|
|
1154
1160
|
:input-align="attr.inputAlign ? attr.inputAlign : 'left'"
|
|
1155
1161
|
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
1156
1162
|
:required="attr.rule.required === 'true'"
|
|
1157
|
-
@click="readonly ? null : showArea = true"
|
|
1163
|
+
@click="readonly ? null : (showArea = true)"
|
|
1158
1164
|
/>
|
|
1159
1165
|
<VanPopup v-model:show="showArea" position="bottom" teleport="body" overlay-class="date-picker-overlay">
|
|
1160
1166
|
<VanArea
|
|
@@ -1250,7 +1256,7 @@ function findOptionInTree(options, value) {
|
|
|
1250
1256
|
:placeholder="placeholder"
|
|
1251
1257
|
:rules="[{ required: attr.rule.required === 'true', message: '请选择地址' }]"
|
|
1252
1258
|
:required="attr.rule.required === 'true'"
|
|
1253
|
-
@click="readonly ? null : showAddressPicker = true"
|
|
1259
|
+
@click="readonly ? null : (showAddressPicker = true)"
|
|
1254
1260
|
/>
|
|
1255
1261
|
<VanPopup
|
|
1256
1262
|
v-model:show="showAddressPicker"
|
|
@@ -1279,7 +1285,7 @@ function findOptionInTree(options, value) {
|
|
|
1279
1285
|
:placeholder="attr.placeholder ? attr.placeholder : `请选择${attr.name}`"
|
|
1280
1286
|
:rules="[{ required: attr.rule.required === 'true', message: `请选择${attr.name}` }]"
|
|
1281
1287
|
:required="attr.rule.required === 'true'"
|
|
1282
|
-
@click="readonly ? null : showTreeSelect = true"
|
|
1288
|
+
@click="readonly ? null : (showTreeSelect = true)"
|
|
1283
1289
|
/>
|
|
1284
1290
|
<VanPopup
|
|
1285
1291
|
v-model:show="showTreeSelect"
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { onMounted, ref } from 'vue'
|
|
3
|
-
import XReport from './XReport.vue'
|
|
4
|
-
|
|
5
|
-
const mainRef = ref()
|
|
6
|
-
|
|
7
|
-
onMounted(() => {
|
|
8
|
-
// 初始化逻辑
|
|
9
|
-
})
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<div id="test">
|
|
14
|
-
<van-card :bordered="false">
|
|
15
|
-
<XReport
|
|
16
|
-
ref="mainRef"
|
|
17
|
-
:use-oss-for-img="false"
|
|
18
|
-
config-name="nurseWorkstationCover"
|
|
19
|
-
server-name="af-his"
|
|
20
|
-
:show-img-in-cell="true"
|
|
21
|
-
:display-only="true"
|
|
22
|
-
:edit-mode="false"
|
|
23
|
-
:show-save-button="false"
|
|
24
|
-
:no-padding="true"
|
|
25
|
-
:dont-format="true"
|
|
26
|
-
/>
|
|
27
|
-
</van-card>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<style scoped>
|
|
32
|
-
|
|
33
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted, ref } from 'vue'
|
|
3
|
+
import XReport from './XReport.vue'
|
|
4
|
+
|
|
5
|
+
const mainRef = ref()
|
|
6
|
+
|
|
7
|
+
onMounted(() => {
|
|
8
|
+
// 初始化逻辑
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div id="test">
|
|
14
|
+
<van-card :bordered="false">
|
|
15
|
+
<XReport
|
|
16
|
+
ref="mainRef"
|
|
17
|
+
:use-oss-for-img="false"
|
|
18
|
+
config-name="nurseWorkstationCover"
|
|
19
|
+
server-name="af-his"
|
|
20
|
+
:show-img-in-cell="true"
|
|
21
|
+
:display-only="true"
|
|
22
|
+
:edit-mode="false"
|
|
23
|
+
:show-save-button="false"
|
|
24
|
+
:no-padding="true"
|
|
25
|
+
:dont-format="true"
|
|
26
|
+
/>
|
|
27
|
+
</van-card>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
|
|
33
|
+
</style>
|
|
@@ -1,184 +1,184 @@
|
|
|
1
|
-
// print.js
|
|
2
|
-
|
|
3
|
-
export function printElement(elementToPrint) {
|
|
4
|
-
// 创建一个新的浏览器窗口
|
|
5
|
-
const printWindow = window.open('', '_blank', 'height=1024,width=768')
|
|
6
|
-
// 设置新窗口的文档内容
|
|
7
|
-
printWindow.document.write(`
|
|
8
|
-
<html>
|
|
9
|
-
<head>
|
|
10
|
-
<title>Print</title>
|
|
11
|
-
<style>
|
|
12
|
-
@page {
|
|
13
|
-
size: auto;
|
|
14
|
-
margin: 0mm;
|
|
15
|
-
}
|
|
16
|
-
html, body {
|
|
17
|
-
margin: 0;
|
|
18
|
-
padding: 0;
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 100%;
|
|
21
|
-
}
|
|
22
|
-
#print-container {
|
|
23
|
-
display: none
|
|
24
|
-
}
|
|
25
|
-
.img{
|
|
26
|
-
width: 95%;
|
|
27
|
-
height: 180px;
|
|
28
|
-
object-fit: cover;
|
|
29
|
-
}
|
|
30
|
-
.reportMain {
|
|
31
|
-
text-align: center;
|
|
32
|
-
margin: 0 auto;
|
|
33
|
-
font-size: 16px;
|
|
34
|
-
color: #000;
|
|
35
|
-
background-color: #fff;
|
|
36
|
-
border-radius: 8px;
|
|
37
|
-
|
|
38
|
-
.reportTitle {
|
|
39
|
-
font-weight: bold;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.subTitle {
|
|
43
|
-
display: flex;
|
|
44
|
-
justify-content: space-between;
|
|
45
|
-
margin-bottom: 1%;
|
|
46
|
-
|
|
47
|
-
.subTitleItems {
|
|
48
|
-
max-width: 30%;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.inputsDiv {
|
|
53
|
-
display: flex;
|
|
54
|
-
justify-content: space-between;
|
|
55
|
-
.inputsDivItem {
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
padding: 0 4px;
|
|
59
|
-
white-space: nowrap;
|
|
60
|
-
.inputsDivItemLabel {
|
|
61
|
-
padding: 0 4px;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.reportTable {
|
|
67
|
-
width: 100%;
|
|
68
|
-
border-collapse: collapse;
|
|
69
|
-
table-layout:fixed;
|
|
70
|
-
word-break:break-all;
|
|
71
|
-
text-align: center;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
.reportMainForDisplay {
|
|
75
|
-
text-align: center;
|
|
76
|
-
margin: 10% auto;
|
|
77
|
-
font-size: 16px;
|
|
78
|
-
color: #000;
|
|
79
|
-
background-color: #fff;
|
|
80
|
-
border-radius: 8px;
|
|
81
|
-
|
|
82
|
-
.reportTitle {
|
|
83
|
-
font-weight: bold;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.subTitle {
|
|
87
|
-
display: flex;
|
|
88
|
-
justify-content: space-between;
|
|
89
|
-
|
|
90
|
-
.subTitleItems {
|
|
91
|
-
max-width: 30%;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.inputsDiv {
|
|
96
|
-
display: flex;
|
|
97
|
-
justify-content: space-around;
|
|
98
|
-
.inputsDivItem {
|
|
99
|
-
display: flex;
|
|
100
|
-
align-items: center;
|
|
101
|
-
padding: 0 4px;
|
|
102
|
-
white-space: nowrap;
|
|
103
|
-
.inputsDivItemLabel {
|
|
104
|
-
padding: 0 4px;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.reportTable {
|
|
110
|
-
width: 100%;
|
|
111
|
-
border-collapse: collapse;
|
|
112
|
-
table-layout:fixed;
|
|
113
|
-
word-break:break-all;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
.reportMainNoPadding {
|
|
117
|
-
text-align: center;
|
|
118
|
-
margin: 0 auto;
|
|
119
|
-
font-size: 16px;
|
|
120
|
-
color: #000;
|
|
121
|
-
background-color: #fff;
|
|
122
|
-
border-radius: 8px;
|
|
123
|
-
|
|
124
|
-
.reportTitle {
|
|
125
|
-
font-weight: bold;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.subTitle {
|
|
129
|
-
display: flex;
|
|
130
|
-
justify-content: space-between;
|
|
131
|
-
|
|
132
|
-
.subTitleItems {
|
|
133
|
-
max-width: 30%;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.inputsDiv {
|
|
138
|
-
display: flex;
|
|
139
|
-
justify-content: space-between;
|
|
140
|
-
.inputsDivItem {
|
|
141
|
-
display: flex;
|
|
142
|
-
align-items: center;
|
|
143
|
-
padding: 0 4px;
|
|
144
|
-
white-space: nowrap;
|
|
145
|
-
.inputsDivItemLabel {
|
|
146
|
-
padding: 0 4px;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.reportTable {
|
|
152
|
-
width: 100%;
|
|
153
|
-
border-collapse: collapse;
|
|
154
|
-
table-layout:fixed;
|
|
155
|
-
word-break:break-all;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
.tools{
|
|
159
|
-
position: fixed;
|
|
160
|
-
right: 2%;
|
|
161
|
-
text-align: right;
|
|
162
|
-
width: 60%;
|
|
163
|
-
cursor: pointer;
|
|
164
|
-
.toolsItem{
|
|
165
|
-
width: 15%;
|
|
166
|
-
margin-right: 3%;
|
|
167
|
-
display: inline-block;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
</style>
|
|
171
|
-
</head>
|
|
172
|
-
<body>
|
|
173
|
-
<!-- 将需要打印的元素内容复制到新窗口中 -->
|
|
174
|
-
${elementToPrint.innerHTML}
|
|
175
|
-
</body>
|
|
176
|
-
</html>
|
|
177
|
-
`)
|
|
178
|
-
// 延迟执行打印,以确保新窗口的内容已加载完成
|
|
179
|
-
printWindow.document.close() // 关闭文档流,确保内容完全加载
|
|
180
|
-
setTimeout(() => {
|
|
181
|
-
printWindow.print() // 调用打印方法
|
|
182
|
-
printWindow.close()
|
|
183
|
-
}, 500) // 延迟500毫秒后执行打印
|
|
184
|
-
}
|
|
1
|
+
// print.js
|
|
2
|
+
|
|
3
|
+
export function printElement(elementToPrint) {
|
|
4
|
+
// 创建一个新的浏览器窗口
|
|
5
|
+
const printWindow = window.open('', '_blank', 'height=1024,width=768')
|
|
6
|
+
// 设置新窗口的文档内容
|
|
7
|
+
printWindow.document.write(`
|
|
8
|
+
<html>
|
|
9
|
+
<head>
|
|
10
|
+
<title>Print</title>
|
|
11
|
+
<style>
|
|
12
|
+
@page {
|
|
13
|
+
size: auto;
|
|
14
|
+
margin: 0mm;
|
|
15
|
+
}
|
|
16
|
+
html, body {
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
}
|
|
22
|
+
#print-container {
|
|
23
|
+
display: none
|
|
24
|
+
}
|
|
25
|
+
.img{
|
|
26
|
+
width: 95%;
|
|
27
|
+
height: 180px;
|
|
28
|
+
object-fit: cover;
|
|
29
|
+
}
|
|
30
|
+
.reportMain {
|
|
31
|
+
text-align: center;
|
|
32
|
+
margin: 0 auto;
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
color: #000;
|
|
35
|
+
background-color: #fff;
|
|
36
|
+
border-radius: 8px;
|
|
37
|
+
|
|
38
|
+
.reportTitle {
|
|
39
|
+
font-weight: bold;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.subTitle {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
margin-bottom: 1%;
|
|
46
|
+
|
|
47
|
+
.subTitleItems {
|
|
48
|
+
max-width: 30%;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.inputsDiv {
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: space-between;
|
|
55
|
+
.inputsDivItem {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
padding: 0 4px;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
.inputsDivItemLabel {
|
|
61
|
+
padding: 0 4px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.reportTable {
|
|
67
|
+
width: 100%;
|
|
68
|
+
border-collapse: collapse;
|
|
69
|
+
table-layout:fixed;
|
|
70
|
+
word-break:break-all;
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
.reportMainForDisplay {
|
|
75
|
+
text-align: center;
|
|
76
|
+
margin: 10% auto;
|
|
77
|
+
font-size: 16px;
|
|
78
|
+
color: #000;
|
|
79
|
+
background-color: #fff;
|
|
80
|
+
border-radius: 8px;
|
|
81
|
+
|
|
82
|
+
.reportTitle {
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.subTitle {
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
|
|
90
|
+
.subTitleItems {
|
|
91
|
+
max-width: 30%;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.inputsDiv {
|
|
96
|
+
display: flex;
|
|
97
|
+
justify-content: space-around;
|
|
98
|
+
.inputsDivItem {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
padding: 0 4px;
|
|
102
|
+
white-space: nowrap;
|
|
103
|
+
.inputsDivItemLabel {
|
|
104
|
+
padding: 0 4px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.reportTable {
|
|
110
|
+
width: 100%;
|
|
111
|
+
border-collapse: collapse;
|
|
112
|
+
table-layout:fixed;
|
|
113
|
+
word-break:break-all;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
.reportMainNoPadding {
|
|
117
|
+
text-align: center;
|
|
118
|
+
margin: 0 auto;
|
|
119
|
+
font-size: 16px;
|
|
120
|
+
color: #000;
|
|
121
|
+
background-color: #fff;
|
|
122
|
+
border-radius: 8px;
|
|
123
|
+
|
|
124
|
+
.reportTitle {
|
|
125
|
+
font-weight: bold;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.subTitle {
|
|
129
|
+
display: flex;
|
|
130
|
+
justify-content: space-between;
|
|
131
|
+
|
|
132
|
+
.subTitleItems {
|
|
133
|
+
max-width: 30%;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.inputsDiv {
|
|
138
|
+
display: flex;
|
|
139
|
+
justify-content: space-between;
|
|
140
|
+
.inputsDivItem {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
padding: 0 4px;
|
|
144
|
+
white-space: nowrap;
|
|
145
|
+
.inputsDivItemLabel {
|
|
146
|
+
padding: 0 4px;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.reportTable {
|
|
152
|
+
width: 100%;
|
|
153
|
+
border-collapse: collapse;
|
|
154
|
+
table-layout:fixed;
|
|
155
|
+
word-break:break-all;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
.tools{
|
|
159
|
+
position: fixed;
|
|
160
|
+
right: 2%;
|
|
161
|
+
text-align: right;
|
|
162
|
+
width: 60%;
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
.toolsItem{
|
|
165
|
+
width: 15%;
|
|
166
|
+
margin-right: 3%;
|
|
167
|
+
display: inline-block;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
171
|
+
</head>
|
|
172
|
+
<body>
|
|
173
|
+
<!-- 将需要打印的元素内容复制到新窗口中 -->
|
|
174
|
+
${elementToPrint.innerHTML}
|
|
175
|
+
</body>
|
|
176
|
+
</html>
|
|
177
|
+
`)
|
|
178
|
+
// 延迟执行打印,以确保新窗口的内容已加载完成
|
|
179
|
+
printWindow.document.close() // 关闭文档流,确保内容完全加载
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
printWindow.print() // 调用打印方法
|
|
182
|
+
printWindow.close()
|
|
183
|
+
}, 500) // 延迟500毫秒后执行打印
|
|
184
|
+
}
|