vue2-client 1.12.71 → 1.12.72

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.12.71",
3
+ "version": "1.12.72",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -1,214 +1,216 @@
1
- <template>
2
- <div>
3
- <a-collapse
4
- :activeKey="activeKey"
5
- @change="handleChange"
6
- >
7
- <a-collapse-panel
8
- v-for="(panel, panelIndex) in config.showData"
9
- :key="panelIndex.toString()"
10
- :show-arrow="false"
11
- >
12
- <template #header>
13
- <div class="header-content">
14
- <span
15
- class="header-text"
16
- :style="config.titleStyle"
17
- >
18
- {{ panel.title }}
19
- </span>
20
- <!-- 当有 title2 数据时显示信息项 -->
21
- <template v-if="panel.title2 && panel.title2.length">
22
- <span
23
- v-for="(item, headerIndex) in panel.title2"
24
- :key="headerIndex"
25
- class="info-item"
26
- :style="config.title2Style"
27
- >
28
- <span>{{ item.key }}:</span>
29
- <span>{{ item.value }}</span>
30
- </span>
31
- </template>
32
- <!-- 当有 title3 数据时显示时间项 -->
33
- <span
34
- v-if="panel.title3"
35
- class="time-item"
36
- :style="config.title3Style"
37
- >
38
- {{ panel.title3 }}
39
- </span>
40
- <!-- 修改搜索框的显示条件 -->
41
- <a-input-search
42
- v-if="panel.search"
43
- v-model="searchText[panelIndex]"
44
- placeholder="请输入搜索内容"
45
- class="search-input"
46
- @search="(value) => onSearch(value, panelIndex)"
47
- @click.stop
48
- />
49
- </div>
50
- </template>
51
- <!-- 根据类型显示不同内容 -->
52
- <template v-if="panel.type === 'picture'">
53
- <img :src="panel.configName" alt="图片" style="width: 100%; max-width: 500px;"/>
54
- </template>
55
- <template v-else-if="panel.type === 'cover'">
56
- <x-report
57
- :use-oss-for-img="false"
58
- :config-name="panel.configName"
59
- server-name="af-his"
60
- :show-img-in-cell="true"
61
- :display-only="true"
62
- :edit-mode="false"
63
- :show-save-button="false"
64
- :no-padding="true"
65
- :dont-format="true">
66
- </x-report>
67
- </template>
68
- </a-collapse-panel>
69
- </a-collapse>
70
- </div>
71
- </template>
72
-
73
- <script>
74
- import XReport from '@vue2-client/base-client/components/common/XReportGrid'
75
- import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
76
-
77
- export default {
78
- name: 'XCollapse',
79
- components: {
80
- XReport
81
- },
82
- inject: ['getConfigByName', 'getComponentByName'],
83
- data () {
84
- return {
85
- activeKey: [],
86
- config: {},
87
- configName: '',
88
- searchText: {}
89
- }
90
- },
91
- props: {
92
- // json名
93
- queryParamsName: {
94
- type: Object,
95
- default: 'openPrescriptionConfig'
96
- },
97
- parameter: {
98
- type: Object,
99
- }
100
- },
101
- created () {
102
- this.searchTexts = {} // 初始化对象
103
-
104
- this.getData(this.queryParamsName)
105
- window.addEventListener('setItem', (e) => {
106
- console.log('监听到sessionStorage的变化:', e)
107
- if (e.key === 'klcf_id') {
108
- this.newVal = sessionStorage.getItem('klcf_id')
109
- // 进行业务处理
110
- console.log('sessionStorage中的值发生了变化:', this.newVal)
111
- }
112
- })
113
- },
114
- beforeDestroy () {
115
- window.removeEventListener('setItem', this.handleStorageChange)
116
- },
117
- provide () {
118
- return {
119
- getComponentByName: this.getComponentByName
120
- }
121
- },
122
- methods: {
123
- handleStorageChange (e) {
124
- console.log('监听到sessionStorage的变化:', e)
125
- if (e.key === 'klcf_id') {
126
- this.newVal = sessionStorage.getItem('klcf_id')
127
- // 进行业务处理
128
- console.log('sessionStorage中的值发生了变化:', this.newVal)
129
- }
130
- },
131
- async getData (config, parameter) {
132
- this.configName = config
133
- getConfigByName(config, 'af-his', res => {
134
- this.config = res
135
- console.warn(this.config)
136
- runLogic(res.mainLogic, this.parameter, 'af-his').then(result => {
137
- this.config.showData = result
138
- this.activeKey = this.config.showData.map((_, panelIndex) => panelIndex.toString())
139
- })
140
- })
141
- },
142
- refreshXCollapse () {
143
- this.getData(this.queryParamsName)
144
- },
145
- handleChange (keys) {
146
- this.activeKey = keys
147
- },
148
- onSearch (value, panelIndex) {
149
- console.log('搜索内容:', value, '面板索引:', panelIndex)
150
- },
151
- },
152
- watch: {
153
- queryParamsName: {
154
- handler (newValue) {
155
- this.getData(newValue, null)
156
- },
157
- deep: true
158
- }
159
- }
160
- }
161
- </script>
162
-
163
- <style scoped>
164
- .header-content {
165
- display: flex;
166
- align-items: center;
167
- gap: 24px;
168
- white-space: nowrap;
169
- overflow: hidden;
170
- }
171
-
172
- .header-text {
173
- margin-right: 16px;
174
- font-size: 16px;
175
- font-weight: 800;
176
- flex-shrink: 0;
177
- }
178
-
179
- .info-item {
180
- display: inline-flex;
181
- align-items: center;
182
- gap: 4px;
183
- font-size: 12px;
184
- color: #888888;
185
- flex-shrink: 0;
186
- }
187
-
188
- .time-item {
189
- margin-left: auto;
190
- text-align: right;
191
- flex-shrink: 0;
192
- }
193
-
194
- /* 覆盖 ant-design-vue 的默认样式 */
195
- :deep(.ant-collapse-header) {
196
- align-items: center !important;
197
- }
198
-
199
- :deep(.ant-collapse-header-text) {
200
- flex: 1;
201
- }
202
-
203
- :deep(.ant-collapse-content > .ant-collapse-content-box) {
204
- padding: 0;
205
- }
206
-
207
- :deep(.ant-card-body) {
208
- padding: 8px;
209
- }
210
- .search-input {
211
- margin-left: auto;
212
- width: 100%;
213
- }
214
- </style>
1
+ <template>
2
+ <div>
3
+ <a-collapse
4
+ :activeKey="activeKey"
5
+ @change="handleChange"
6
+ >
7
+ <a-collapse-panel
8
+ v-for="(panel, panelIndex) in config.showData"
9
+ :key="panelIndex.toString()"
10
+ :show-arrow="false"
11
+ >
12
+ <template #header>
13
+ <a-button @click="handleClick">666</a-button>
14
+ <div class="header-content">
15
+ <span
16
+ class="header-text"
17
+ :style="config.titleStyle"
18
+ >
19
+ {{ panel.title }}
20
+ </span>
21
+ <!-- 当有 title2 数据时显示信息项 -->
22
+ <template v-if="panel.title2 && panel.title2.length">
23
+ <span
24
+ v-for="(item, headerIndex) in panel.title2"
25
+ :key="headerIndex"
26
+ class="info-item"
27
+ :style="config.title2Style"
28
+ >
29
+ <span>{{ item.key }}:</span>
30
+ <span>{{ item.value }}</span>
31
+ </span>
32
+ </template>
33
+ <!-- 当有 title3 数据时显示时间项 -->
34
+ <span
35
+ v-if="panel.title3"
36
+ class="time-item"
37
+ :style="config.title3Style"
38
+ >
39
+ {{ panel.title3 }}
40
+ </span>
41
+ <!-- 修改搜索框的显示条件 -->
42
+ <a-input-search
43
+ v-if="panel.search"
44
+ v-model="searchText[panelIndex]"
45
+ placeholder="请输入搜索内容"
46
+ class="search-input"
47
+ @search="(value) => onSearch(value, panelIndex)"
48
+ @click.stop
49
+ />
50
+ </div>
51
+ </template>
52
+ <!-- 根据类型显示不同内容 -->
53
+ <template v-if="panel.type === 'picture'">
54
+ <img :src="panel.configName" alt="图片" style="width: 100%; max-width: 500px;"/>
55
+ </template>
56
+ <template v-else-if="panel.type === 'cover'">
57
+ <x-report
58
+ :use-oss-for-img="false"
59
+ :config-name="panel.configName"
60
+ server-name="af-his"
61
+ :show-img-in-cell="true"
62
+ :display-only="true"
63
+ :edit-mode="false"
64
+ :parentContext="parentContext"
65
+ :show-save-button="false"
66
+ :no-padding="true"
67
+ :dont-format="true">
68
+ </x-report>
69
+ </template>
70
+ </a-collapse-panel>
71
+ </a-collapse>
72
+ </div>
73
+ </template>
74
+
75
+ <script>
76
+ import XReport from '@vue2-client/base-client/components/common/XReportGrid'
77
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
78
+
79
+ export default {
80
+ name: 'XCollapse',
81
+ components: {
82
+ XReport
83
+ },
84
+ inject: ['getConfigByName', 'getComponentByName'],
85
+ data () {
86
+ return {
87
+ activeKey: [],
88
+ config: {},
89
+ configName: '',
90
+ searchText: {},
91
+ parentContext: null
92
+ }
93
+ },
94
+ props: {
95
+ // json名
96
+ queryParamsName: {
97
+ type: Object,
98
+ default: 'openPrescriptionConfig'
99
+ },
100
+ parameter: {
101
+ type: Object,
102
+ }
103
+ },
104
+ created () {
105
+ this.searchTexts = {} // 初始化对象
106
+
107
+ this.getData(this.queryParamsName)
108
+ window.addEventListener('setItem', (e) => {
109
+ console.log('监听到sessionStorage的变化:', e)
110
+ if (e.key === 'klcf_id') {
111
+ this.newVal = sessionStorage.getItem('klcf_id')
112
+ // 进行业务处理
113
+ console.log('sessionStorage中的值发生了变化:', this.newVal)
114
+ }
115
+ })
116
+ },
117
+ beforeDestroy () {
118
+ window.removeEventListener('setItem', this.handleStorageChange)
119
+ },
120
+ methods: {
121
+ handleClick () {
122
+ console.log('xc按钮被点击了!')
123
+ console.warn(this.getComponentByName)
124
+ },
125
+ handleStorageChange (e) {
126
+ console.log('监听到sessionStorage的变化:', e)
127
+ if (e.key === 'klcf_id') {
128
+ this.newVal = sessionStorage.getItem('klcf_id')
129
+ // 进行业务处理
130
+ console.log('sessionStorage中的值发生了变化:', this.newVal)
131
+ }
132
+ },
133
+ async getData (config, parameter) {
134
+ this.configName = config
135
+ getConfigByName(config, 'af-his', res => {
136
+ this.config = res
137
+ console.warn(this.config)
138
+ runLogic(res.mainLogic, this.parameter, 'af-his').then(result => {
139
+ this.config.showData = result
140
+ this.activeKey = this.config.showData.map((_, panelIndex) => panelIndex.toString())
141
+ })
142
+ })
143
+ },
144
+ refreshXCollapse () {
145
+ this.getData(this.queryParamsName)
146
+ },
147
+ handleChange (keys) {
148
+ this.activeKey = keys
149
+ },
150
+ onSearch (value, panelIndex) {
151
+ console.log('搜索内容:', value, '面板索引:', panelIndex)
152
+ },
153
+ },
154
+ watch: {
155
+ queryParamsName: {
156
+ handler (newValue) {
157
+ this.getData(newValue, null)
158
+ },
159
+ deep: true
160
+ }
161
+ }
162
+ }
163
+ </script>
164
+
165
+ <style scoped>
166
+ .header-content {
167
+ display: flex;
168
+ align-items: center;
169
+ gap: 24px;
170
+ white-space: nowrap;
171
+ overflow: hidden;
172
+ }
173
+
174
+ .header-text {
175
+ margin-right: 16px;
176
+ font-size: 16px;
177
+ font-weight: 800;
178
+ flex-shrink: 0;
179
+ }
180
+
181
+ .info-item {
182
+ display: inline-flex;
183
+ align-items: center;
184
+ gap: 4px;
185
+ font-size: 12px;
186
+ color: #888888;
187
+ flex-shrink: 0;
188
+ }
189
+
190
+ .time-item {
191
+ margin-left: auto;
192
+ text-align: right;
193
+ flex-shrink: 0;
194
+ }
195
+
196
+ /* 覆盖 ant-design-vue 的默认样式 */
197
+ :deep(.ant-collapse-header) {
198
+ align-items: center !important;
199
+ }
200
+
201
+ :deep(.ant-collapse-header-text) {
202
+ flex: 1;
203
+ }
204
+
205
+ :deep(.ant-collapse-content > .ant-collapse-content-box) {
206
+ padding: 0;
207
+ }
208
+
209
+ :deep(.ant-card-body) {
210
+ padding: 8px;
211
+ }
212
+ .search-input {
213
+ margin-left: auto;
214
+ width: 100%;
215
+ }
216
+ </style>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <x-collapse :query-params-name="openPrescriptionConfig" />
3
+ </template>
4
+
5
+ <script>
6
+ import XCollapse from '@vue2-client/base-client/components/common/XCollapse/XCollapse.vue'
7
+ export default {
8
+ name: 'Demo',
9
+ components: { XCollapse }
10
+ }
11
+ </script>
12
+
13
+ <style scoped>
14
+
15
+ </style>