vue2-client 1.14.27 → 1.14.28
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 +108 -108
- package/src/base-client/components/common/AmapMarker/index.js +3 -3
- package/src/base-client/components/common/XDetailsView/index.js +3 -3
- package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/utils/map-utils.js +47 -47
- package/src/utils/request.js +378 -377
package/package.json
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vue2-client",
|
|
3
|
-
"version": "1.14.
|
|
4
|
-
"private": false,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
7
|
-
"serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
|
|
8
|
-
"serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
|
|
9
|
-
"serve:liuli": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode liuli",
|
|
10
|
-
"serve:scada": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode scada",
|
|
11
|
-
"serve:iot": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode iot",
|
|
12
|
-
"serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
|
|
13
|
-
"serve:runtime": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode runtime",
|
|
14
|
-
"mac-serve": "vue-cli-service serve --no-eslint --mode his",
|
|
15
|
-
"build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
|
16
|
-
"test:unit": "vue-cli-service test:unit",
|
|
17
|
-
"lint": "vue-cli-service lint",
|
|
18
|
-
"build:preview": "vue-cli-service build --mode preview",
|
|
19
|
-
"lint:nofix": "vue-cli-service lint --no-fix",
|
|
20
|
-
"test": "jest"
|
|
21
|
-
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@afwenming123/vue-easy-tree": "^1.0.1",
|
|
24
|
-
"@afwenming123/vue-plugin-hiprint": "^0.0.70",
|
|
25
|
-
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
26
|
-
"@antv/data-set": "^0.11.8",
|
|
27
|
-
"@antv/g2plot": "^2.4.31",
|
|
28
|
-
"@hufe921/canvas-editor": "^0.9.49",
|
|
29
|
-
"@microsoft/fetch-event-source": "^2.0.1",
|
|
30
|
-
"@vue/babel-preset-jsx": "^1.4.0",
|
|
31
|
-
"animate.css": "^4.1.1",
|
|
32
|
-
"ant-design-vue": "^1.7.8",
|
|
33
|
-
"axios": "^0.27.2",
|
|
34
|
-
"clipboard": "^2.0.11",
|
|
35
|
-
"core-js": "^3.33.0",
|
|
36
|
-
"crypto-js": "^4.1.1",
|
|
37
|
-
"date-fns": "^2.29.3",
|
|
38
|
-
"default-passive-events": "^2.0.0",
|
|
39
|
-
"dotenv": "^16.3.1",
|
|
40
|
-
"echarts": "^5.5.0",
|
|
41
|
-
"enquire.js": "^2.1.6",
|
|
42
|
-
"file-saver": "^2.0.5",
|
|
43
|
-
"highlight.js": "^11.7.0",
|
|
44
|
-
"html2canvas": "^1.4.1",
|
|
45
|
-
"js-base64": "^3.7.5",
|
|
46
|
-
"js-cookie": "^2.2.1",
|
|
47
|
-
"jsencrypt": "^3.3.2",
|
|
48
|
-
"jspdf": "^2.5.1",
|
|
49
|
-
"lodash.clonedeep": "^4.5.0",
|
|
50
|
-
"lodash.debounce": "^4",
|
|
51
|
-
"lodash.get": "^4.4.2",
|
|
52
|
-
"marked": "^4",
|
|
53
|
-
"mockjs": "^1.1.0",
|
|
54
|
-
"nprogress": "^0.2.0",
|
|
55
|
-
"qs": "^6.11.2",
|
|
56
|
-
"regenerator-runtime": "^0.14.0",
|
|
57
|
-
"videojs-contrib-hls": "^5.15.0",
|
|
58
|
-
"viser-vue": "^2.4.8",
|
|
59
|
-
"vue": "^2.7.14",
|
|
60
|
-
"vue-codemirror": "4.0.6",
|
|
61
|
-
"vue-draggable-resizable": "^2",
|
|
62
|
-
"vue-i18n": "^8.28.2",
|
|
63
|
-
"vue-json-viewer": "^2.2.22",
|
|
64
|
-
"vue-router": "^3.6.5",
|
|
65
|
-
"vue-video-player": "^5.0.2",
|
|
66
|
-
"vue-virtual-scroller": "^1.1.2",
|
|
67
|
-
"vuedraggable": "^2.24.3",
|
|
68
|
-
"vuex": "^3.6.2",
|
|
69
|
-
"xlsx": "0.18.5"
|
|
70
|
-
},
|
|
71
|
-
"devDependencies": {
|
|
72
|
-
"@ant-design/colors": "^7.0.0",
|
|
73
|
-
"@babel/core": "^7.22.20",
|
|
74
|
-
"@babel/eslint-parser": "^7.22.15",
|
|
75
|
-
"@babel/preset-env": "^7.22.20",
|
|
76
|
-
"@vue/cli-plugin-babel": "^5.0.8",
|
|
77
|
-
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
78
|
-
"@vue/cli-service": "^5.0.8",
|
|
79
|
-
"@vue/eslint-config-standard": "^8.0.1",
|
|
80
|
-
"@vue/test-utils": "^1.3.6",
|
|
81
|
-
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
82
|
-
"compression-webpack-plugin": "^10.0.0",
|
|
83
|
-
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
84
|
-
"deepmerge": "^4.3.1",
|
|
85
|
-
"eslint": "^8.51.0",
|
|
86
|
-
"eslint-plugin-vue": "^9.17.0",
|
|
87
|
-
"fast-deep-equal": "^3.1.3",
|
|
88
|
-
"ignore-loader": "^0.1.2",
|
|
89
|
-
"jest": "^29.7.0",
|
|
90
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
91
|
-
"jest-transform-stub": "^2.0.0",
|
|
92
|
-
"less-loader": "^6.2.0",
|
|
93
|
-
"script-loader": "^0.7.2",
|
|
94
|
-
"style-resources-loader": "^1.5.0",
|
|
95
|
-
"vue-cli-plugin-style-resources-loader": "^0.1.5",
|
|
96
|
-
"vue-jest": "^4.0.1",
|
|
97
|
-
"vue-template-compiler": "^2.7.14",
|
|
98
|
-
"webpack": "^5.88.2",
|
|
99
|
-
"webpack-theme-color-replacer": "^1.4.7",
|
|
100
|
-
"whatwg-fetch": "^3.6.19"
|
|
101
|
-
},
|
|
102
|
-
"browserslist": [
|
|
103
|
-
"> 1%",
|
|
104
|
-
"last 2 versions",
|
|
105
|
-
"not dead",
|
|
106
|
-
"not ie 11"
|
|
107
|
-
]
|
|
108
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "vue2-client",
|
|
3
|
+
"version": "1.14.28",
|
|
4
|
+
"private": false,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
7
|
+
"serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
|
|
8
|
+
"serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
|
|
9
|
+
"serve:liuli": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode liuli",
|
|
10
|
+
"serve:scada": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode scada",
|
|
11
|
+
"serve:iot": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode iot",
|
|
12
|
+
"serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
|
|
13
|
+
"serve:runtime": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode runtime",
|
|
14
|
+
"mac-serve": "vue-cli-service serve --no-eslint --mode his",
|
|
15
|
+
"build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
|
16
|
+
"test:unit": "vue-cli-service test:unit",
|
|
17
|
+
"lint": "vue-cli-service lint",
|
|
18
|
+
"build:preview": "vue-cli-service build --mode preview",
|
|
19
|
+
"lint:nofix": "vue-cli-service lint --no-fix",
|
|
20
|
+
"test": "jest"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@afwenming123/vue-easy-tree": "^1.0.1",
|
|
24
|
+
"@afwenming123/vue-plugin-hiprint": "^0.0.70",
|
|
25
|
+
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
26
|
+
"@antv/data-set": "^0.11.8",
|
|
27
|
+
"@antv/g2plot": "^2.4.31",
|
|
28
|
+
"@hufe921/canvas-editor": "^0.9.49",
|
|
29
|
+
"@microsoft/fetch-event-source": "^2.0.1",
|
|
30
|
+
"@vue/babel-preset-jsx": "^1.4.0",
|
|
31
|
+
"animate.css": "^4.1.1",
|
|
32
|
+
"ant-design-vue": "^1.7.8",
|
|
33
|
+
"axios": "^0.27.2",
|
|
34
|
+
"clipboard": "^2.0.11",
|
|
35
|
+
"core-js": "^3.33.0",
|
|
36
|
+
"crypto-js": "^4.1.1",
|
|
37
|
+
"date-fns": "^2.29.3",
|
|
38
|
+
"default-passive-events": "^2.0.0",
|
|
39
|
+
"dotenv": "^16.3.1",
|
|
40
|
+
"echarts": "^5.5.0",
|
|
41
|
+
"enquire.js": "^2.1.6",
|
|
42
|
+
"file-saver": "^2.0.5",
|
|
43
|
+
"highlight.js": "^11.7.0",
|
|
44
|
+
"html2canvas": "^1.4.1",
|
|
45
|
+
"js-base64": "^3.7.5",
|
|
46
|
+
"js-cookie": "^2.2.1",
|
|
47
|
+
"jsencrypt": "^3.3.2",
|
|
48
|
+
"jspdf": "^2.5.1",
|
|
49
|
+
"lodash.clonedeep": "^4.5.0",
|
|
50
|
+
"lodash.debounce": "^4",
|
|
51
|
+
"lodash.get": "^4.4.2",
|
|
52
|
+
"marked": "^4",
|
|
53
|
+
"mockjs": "^1.1.0",
|
|
54
|
+
"nprogress": "^0.2.0",
|
|
55
|
+
"qs": "^6.11.2",
|
|
56
|
+
"regenerator-runtime": "^0.14.0",
|
|
57
|
+
"videojs-contrib-hls": "^5.15.0",
|
|
58
|
+
"viser-vue": "^2.4.8",
|
|
59
|
+
"vue": "^2.7.14",
|
|
60
|
+
"vue-codemirror": "4.0.6",
|
|
61
|
+
"vue-draggable-resizable": "^2",
|
|
62
|
+
"vue-i18n": "^8.28.2",
|
|
63
|
+
"vue-json-viewer": "^2.2.22",
|
|
64
|
+
"vue-router": "^3.6.5",
|
|
65
|
+
"vue-video-player": "^5.0.2",
|
|
66
|
+
"vue-virtual-scroller": "^1.1.2",
|
|
67
|
+
"vuedraggable": "^2.24.3",
|
|
68
|
+
"vuex": "^3.6.2",
|
|
69
|
+
"xlsx": "0.18.5"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@ant-design/colors": "^7.0.0",
|
|
73
|
+
"@babel/core": "^7.22.20",
|
|
74
|
+
"@babel/eslint-parser": "^7.22.15",
|
|
75
|
+
"@babel/preset-env": "^7.22.20",
|
|
76
|
+
"@vue/cli-plugin-babel": "^5.0.8",
|
|
77
|
+
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
78
|
+
"@vue/cli-service": "^5.0.8",
|
|
79
|
+
"@vue/eslint-config-standard": "^8.0.1",
|
|
80
|
+
"@vue/test-utils": "^1.3.6",
|
|
81
|
+
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
82
|
+
"compression-webpack-plugin": "^10.0.0",
|
|
83
|
+
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
84
|
+
"deepmerge": "^4.3.1",
|
|
85
|
+
"eslint": "^8.51.0",
|
|
86
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
87
|
+
"fast-deep-equal": "^3.1.3",
|
|
88
|
+
"ignore-loader": "^0.1.2",
|
|
89
|
+
"jest": "^29.7.0",
|
|
90
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
91
|
+
"jest-transform-stub": "^2.0.0",
|
|
92
|
+
"less-loader": "^6.2.0",
|
|
93
|
+
"script-loader": "^0.7.2",
|
|
94
|
+
"style-resources-loader": "^1.5.0",
|
|
95
|
+
"vue-cli-plugin-style-resources-loader": "^0.1.5",
|
|
96
|
+
"vue-jest": "^4.0.1",
|
|
97
|
+
"vue-template-compiler": "^2.7.14",
|
|
98
|
+
"webpack": "^5.88.2",
|
|
99
|
+
"webpack-theme-color-replacer": "^1.4.7",
|
|
100
|
+
"whatwg-fetch": "^3.6.19"
|
|
101
|
+
},
|
|
102
|
+
"browserslist": [
|
|
103
|
+
"> 1%",
|
|
104
|
+
"last 2 versions",
|
|
105
|
+
"not dead",
|
|
106
|
+
"not ie 11"
|
|
107
|
+
]
|
|
108
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import AmapPointRendering from './AmapPointRendering'
|
|
2
|
-
|
|
3
|
-
export default AmapPointRendering
|
|
1
|
+
import AmapPointRendering from './AmapPointRendering'
|
|
2
|
+
|
|
3
|
+
export default AmapPointRendering
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import XDetailsView from './XDetailsView'
|
|
2
|
-
|
|
3
|
-
export default XDetailsView
|
|
1
|
+
import XDetailsView from './XDetailsView'
|
|
2
|
+
|
|
3
|
+
export default XDetailsView
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import XFormGroupDetails from './XFormGroupDetails'
|
|
2
|
-
|
|
3
|
-
export default XFormGroupDetails
|
|
1
|
+
import XFormGroupDetails from './XFormGroupDetails'
|
|
2
|
+
|
|
3
|
+
export default XFormGroupDetails
|
|
@@ -1,186 +1,186 @@
|
|
|
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
|
-
padding: 15px;
|
|
37
|
-
border-radius: 8px;
|
|
38
|
-
|
|
39
|
-
.reportTitle {
|
|
40
|
-
font-weight: bold;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.subTitle {
|
|
44
|
-
display: flex;
|
|
45
|
-
justify-content: space-between;
|
|
46
|
-
margin-bottom: 1%;
|
|
47
|
-
|
|
48
|
-
.subTitleItems {
|
|
49
|
-
max-width: 30%;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.inputsDiv {
|
|
54
|
-
display: flex;
|
|
55
|
-
justify-content: space-between;
|
|
56
|
-
.inputsDivItem {
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
padding: 0 4px;
|
|
60
|
-
white-space: nowrap;
|
|
61
|
-
.inputsDivItemLabel {
|
|
62
|
-
padding: 0 4px;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.reportTable {
|
|
68
|
-
width: 100%;
|
|
69
|
-
border-collapse: collapse;
|
|
70
|
-
table-layout:fixed;
|
|
71
|
-
word-break:break-all;
|
|
72
|
-
text-align: center;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
.reportMainForDisplay {
|
|
76
|
-
text-align: center;
|
|
77
|
-
margin: 10% auto;
|
|
78
|
-
font-size: 16px;
|
|
79
|
-
color: #000;
|
|
80
|
-
background-color: #fff;
|
|
81
|
-
padding: 15px;
|
|
82
|
-
border-radius: 8px;
|
|
83
|
-
|
|
84
|
-
.reportTitle {
|
|
85
|
-
font-weight: bold;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.subTitle {
|
|
89
|
-
display: flex;
|
|
90
|
-
justify-content: space-between;
|
|
91
|
-
|
|
92
|
-
.subTitleItems {
|
|
93
|
-
max-width: 30%;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.inputsDiv {
|
|
98
|
-
display: flex;
|
|
99
|
-
justify-content: space-around;
|
|
100
|
-
.inputsDivItem {
|
|
101
|
-
display: flex;
|
|
102
|
-
align-items: center;
|
|
103
|
-
padding: 0 4px;
|
|
104
|
-
white-space: nowrap;
|
|
105
|
-
.inputsDivItemLabel {
|
|
106
|
-
padding: 0 4px;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.reportTable {
|
|
112
|
-
width: 100%;
|
|
113
|
-
border-collapse: collapse;
|
|
114
|
-
table-layout:fixed;
|
|
115
|
-
word-break:break-all;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
.reportMainNoPadding {
|
|
119
|
-
text-align: center;
|
|
120
|
-
margin: 0 auto;
|
|
121
|
-
font-size: 16px;
|
|
122
|
-
color: #000;
|
|
123
|
-
background-color: #fff;
|
|
124
|
-
border-radius: 8px;
|
|
125
|
-
|
|
126
|
-
.reportTitle {
|
|
127
|
-
font-weight: bold;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.subTitle {
|
|
131
|
-
display: flex;
|
|
132
|
-
justify-content: space-between;
|
|
133
|
-
|
|
134
|
-
.subTitleItems {
|
|
135
|
-
max-width: 30%;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.inputsDiv {
|
|
140
|
-
display: flex;
|
|
141
|
-
justify-content: space-between;
|
|
142
|
-
.inputsDivItem {
|
|
143
|
-
display: flex;
|
|
144
|
-
align-items: center;
|
|
145
|
-
padding: 0 4px;
|
|
146
|
-
white-space: nowrap;
|
|
147
|
-
.inputsDivItemLabel {
|
|
148
|
-
padding: 0 4px;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.reportTable {
|
|
154
|
-
width: 100%;
|
|
155
|
-
border-collapse: collapse;
|
|
156
|
-
table-layout:fixed;
|
|
157
|
-
word-break:break-all;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
.tools{
|
|
161
|
-
position: fixed;
|
|
162
|
-
right: 2%;
|
|
163
|
-
text-align: right;
|
|
164
|
-
width: 60%;
|
|
165
|
-
cursor: pointer;
|
|
166
|
-
.toolsItem{
|
|
167
|
-
width: 15%;
|
|
168
|
-
margin-right: 3%;
|
|
169
|
-
display: inline-block;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
</style>
|
|
173
|
-
</head>
|
|
174
|
-
<body>
|
|
175
|
-
<!-- 将需要打印的元素内容复制到新窗口中 -->
|
|
176
|
-
${elementToPrint.innerHTML}
|
|
177
|
-
</body>
|
|
178
|
-
</html>
|
|
179
|
-
`)
|
|
180
|
-
// 延迟执行打印,以确保新窗口的内容已加载完成
|
|
181
|
-
printWindow.document.close() // 关闭文档流,确保内容完全加载
|
|
182
|
-
setTimeout(() => {
|
|
183
|
-
printWindow.print() // 调用打印方法
|
|
184
|
-
printWindow.close()
|
|
185
|
-
}, 500) // 延迟500毫秒后执行打印
|
|
186
|
-
}
|
|
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
|
+
padding: 15px;
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
|
|
39
|
+
.reportTitle {
|
|
40
|
+
font-weight: bold;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.subTitle {
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
margin-bottom: 1%;
|
|
47
|
+
|
|
48
|
+
.subTitleItems {
|
|
49
|
+
max-width: 30%;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.inputsDiv {
|
|
54
|
+
display: flex;
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
.inputsDivItem {
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
padding: 0 4px;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
.inputsDivItemLabel {
|
|
62
|
+
padding: 0 4px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.reportTable {
|
|
68
|
+
width: 100%;
|
|
69
|
+
border-collapse: collapse;
|
|
70
|
+
table-layout:fixed;
|
|
71
|
+
word-break:break-all;
|
|
72
|
+
text-align: center;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
.reportMainForDisplay {
|
|
76
|
+
text-align: center;
|
|
77
|
+
margin: 10% auto;
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
color: #000;
|
|
80
|
+
background-color: #fff;
|
|
81
|
+
padding: 15px;
|
|
82
|
+
border-radius: 8px;
|
|
83
|
+
|
|
84
|
+
.reportTitle {
|
|
85
|
+
font-weight: bold;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.subTitle {
|
|
89
|
+
display: flex;
|
|
90
|
+
justify-content: space-between;
|
|
91
|
+
|
|
92
|
+
.subTitleItems {
|
|
93
|
+
max-width: 30%;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.inputsDiv {
|
|
98
|
+
display: flex;
|
|
99
|
+
justify-content: space-around;
|
|
100
|
+
.inputsDivItem {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
padding: 0 4px;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
.inputsDivItemLabel {
|
|
106
|
+
padding: 0 4px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.reportTable {
|
|
112
|
+
width: 100%;
|
|
113
|
+
border-collapse: collapse;
|
|
114
|
+
table-layout:fixed;
|
|
115
|
+
word-break:break-all;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
.reportMainNoPadding {
|
|
119
|
+
text-align: center;
|
|
120
|
+
margin: 0 auto;
|
|
121
|
+
font-size: 16px;
|
|
122
|
+
color: #000;
|
|
123
|
+
background-color: #fff;
|
|
124
|
+
border-radius: 8px;
|
|
125
|
+
|
|
126
|
+
.reportTitle {
|
|
127
|
+
font-weight: bold;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.subTitle {
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
|
|
134
|
+
.subTitleItems {
|
|
135
|
+
max-width: 30%;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.inputsDiv {
|
|
140
|
+
display: flex;
|
|
141
|
+
justify-content: space-between;
|
|
142
|
+
.inputsDivItem {
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
padding: 0 4px;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
.inputsDivItemLabel {
|
|
148
|
+
padding: 0 4px;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.reportTable {
|
|
154
|
+
width: 100%;
|
|
155
|
+
border-collapse: collapse;
|
|
156
|
+
table-layout:fixed;
|
|
157
|
+
word-break:break-all;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
.tools{
|
|
161
|
+
position: fixed;
|
|
162
|
+
right: 2%;
|
|
163
|
+
text-align: right;
|
|
164
|
+
width: 60%;
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
.toolsItem{
|
|
167
|
+
width: 15%;
|
|
168
|
+
margin-right: 3%;
|
|
169
|
+
display: inline-block;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
</style>
|
|
173
|
+
</head>
|
|
174
|
+
<body>
|
|
175
|
+
<!-- 将需要打印的元素内容复制到新窗口中 -->
|
|
176
|
+
${elementToPrint.innerHTML}
|
|
177
|
+
</body>
|
|
178
|
+
</html>
|
|
179
|
+
`)
|
|
180
|
+
// 延迟执行打印,以确保新窗口的内容已加载完成
|
|
181
|
+
printWindow.document.close() // 关闭文档流,确保内容完全加载
|
|
182
|
+
setTimeout(() => {
|
|
183
|
+
printWindow.print() // 调用打印方法
|
|
184
|
+
printWindow.close()
|
|
185
|
+
}, 500) // 延迟500毫秒后执行打印
|
|
186
|
+
}
|