vue2-client 1.14.28 → 1.14.30

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.
@@ -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
+ }
@@ -58,6 +58,9 @@ export default {
58
58
  this.getData(this.queryParamsName, this.fixedQueryForm)
59
59
  },
60
60
  methods: {
61
+ click11 (val) {
62
+ Object.assign(this.fixedQueryForm, { condition: val })
63
+ },
61
64
  async getData (config, param) {
62
65
  const that = this
63
66
  getConfigByName(config, 'af-his', res => {
@@ -91,8 +94,11 @@ export default {
91
94
  }
92
95
  },
93
96
  watch: {
94
- 'fixedQueryForm' (val) {
95
- this.refreshList(val)
97
+ fixedQueryForm: {
98
+ deep: true,
99
+ handler (val) {
100
+ this.refreshList(val)
101
+ }
96
102
  }
97
103
  }
98
104
  }
@@ -8,7 +8,7 @@
8
8
  <div
9
9
  v-if="config.line === 'line'"
10
10
  class="underline"
11
- :style="getLineStyle()">
11
+ :style="lineStyle">
12
12
  </div>
13
13
  </div>
14
14
  <div v-else-if="config.type === 'button'" class="x-button-container">
@@ -17,134 +17,81 @@
17
17
  </div>
18
18
  </template>
19
19
 
20
- <script>
21
- export default {
22
- name: 'XTitle',
23
- props: {
24
- queryParamsName: {
25
- type: String,
26
- default: ''
27
- }
28
- },
29
- data () {
30
- return {
31
- config: {
32
- label: '',
33
- type: 'title',
34
- clickName: '',
35
- line: '',
36
- color: '',
37
- lineLength: ''
38
- }
39
- }
40
- },
41
- created () {
42
- this.getData(this.queryParamsName)
43
- },
44
- methods: {
45
- getData (data) {
46
- if (!data) return
47
-
48
- // 检查是否包含分隔符
49
- if (data.includes('-')) {
50
- const parts = data.split('-')
51
-
52
- // 根据部分数量设置配置
53
- if (parts.length >= 6) {
54
- // 包含颜色和线长度
55
- this.config = {
56
- label: parts[0],
57
- type: parts[1],
58
- clickName: parts[2],
59
- line: parts[3],
60
- color: parts[4],
61
- lineLength: parts[5]
62
- }
63
- } else if (parts.length === 5) {
64
- // 只包含颜色
65
- this.config = {
66
- label: parts[0],
67
- type: parts[1],
68
- clickName: parts[2],
69
- line: parts[3],
70
- color: parts[4],
71
- lineLength: ''
72
- }
73
- } else if (parts.length === 4) {
74
- this.config = {
75
- label: parts[0],
76
- type: parts[1],
77
- clickName: parts[2],
78
- line: parts[3],
79
- color: '',
80
- lineLength: ''
81
- }
82
- } else if (parts.length === 3) {
83
- this.config = {
84
- label: parts[0],
85
- type: parts[1],
86
- clickName: parts[2],
87
- line: '',
88
- color: '',
89
- lineLength: ''
90
- }
91
- } else if (parts.length === 2) {
92
- this.config = {
93
- label: parts[0],
94
- type: parts[1],
95
- clickName: '',
96
- line: '',
97
- color: '',
98
- lineLength: ''
99
- }
100
- } else {
101
- this.config = {
102
- label: data,
103
- type: 'title',
104
- clickName: '',
105
- line: '',
106
- color: '',
107
- lineLength: ''
108
- }
109
- }
110
- } else {
111
- // 没有分隔符,按原来的方式处理
112
- this.config = {
113
- label: data,
114
- type: 'title',
115
- clickName: '',
116
- line: '',
117
- color: '',
118
- lineLength: ''
119
- }
120
- }
121
- },
122
- handleClick () {
123
- if (this.config.clickName) {
124
- this.$emit(this.config.clickName)
125
- }
126
- },
127
- getLineStyle () {
128
- const style = {}
129
-
130
- // 设置线条颜色
131
- if (this.config.color) {
132
- style.backgroundColor = this.config.color
133
- } else {
134
- style.backgroundColor = '#5D5C5C'
135
- }
136
-
137
- // 设置线条宽度
138
- if (this.config.lineLength) {
139
- style.width = this.config.lineLength + 'px'
140
- } else {
141
- style.width = '800'
142
- }
143
-
144
- return style
145
- }
20
+ <script setup>
21
+ import { ref, computed, onMounted } from 'vue'
22
+
23
+ const props = defineProps({
24
+ queryParamsName: {
25
+ type: String,
26
+ default: ''
27
+ }
28
+ })
29
+
30
+ const emit = defineEmits([])
31
+
32
+ const config = ref({
33
+ label: '',
34
+ type: 'title',
35
+ clickName: '',
36
+ line: '',
37
+ color: '',
38
+ lineLength: ''
39
+ })
40
+
41
+ const lineStyle = computed(() => {
42
+ const style = {}
43
+
44
+ // 设置线条颜色
45
+ style.backgroundColor = config.value.color || '#5D5C5C'
46
+
47
+ // 设置线条宽度
48
+ style.width = config.value.lineLength ? `${config.value.lineLength}px` : '800px'
49
+
50
+ return style
51
+ })
52
+
53
+ const handleClick = () => {
54
+ if (config.value.clickName) {
55
+ emit(config.value.clickName)
56
+ }
57
+ }
58
+
59
+ const parseConfig = (data) => {
60
+ if (!data) return
61
+
62
+ const parts = data.includes('-') ? data.split('-') : [data]
63
+
64
+ // 基本设置 - 标签和类型
65
+ config.value.label = parts[0] || ''
66
+ config.value.type = parts[1] || 'title'
67
+
68
+ // 根据类型采用不同的参数格式解析
69
+ if (config.value.type === 'title') {
70
+ // 标题类型格式: aa-title-line-red-800
71
+ // parts[0]: 标签
72
+ // parts[1]: title
73
+ // parts[2]: line (下划线样式)
74
+ // parts[3]: 颜色
75
+ // parts[4]: 长度
76
+ config.value.line = parts[2] || ''
77
+ config.value.color = parts[3] || ''
78
+ config.value.lineLength = parts[4] || ''
79
+ config.value.clickName = '' // 标题类型不需要点击事件
80
+ } else if (config.value.type === 'button') {
81
+ // 按钮类型格式: aa-button-cc
82
+ // parts[0]: 标签
83
+ // parts[1]: button
84
+ // parts[2]: 点击事件名称
85
+ config.value.clickName = parts[2] || ''
86
+ config.value.line = ''
87
+ config.value.color = ''
88
+ config.value.lineLength = ''
146
89
  }
147
90
  }
91
+
92
+ onMounted(() => {
93
+ parseConfig(props.queryParamsName)
94
+ })
148
95
  </script>
149
96
 
150
97
  <style scoped>