vue2-client 1.12.83 → 1.12.87

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,237 +1,223 @@
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
- :disabled="config.collapsible"
12
- >
13
- <template #header>
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
- <!-- 根据showTitle是否显示键名 -->
30
- <span v-if="config.showTitle">{{ item.key }}:</span>
31
- <span>{{ item.value }}</span>
32
- </span>
33
- </template>
34
- <!-- 当有 title3 数据时显示时间项 -->
35
- <span
36
- v-if="panel.title3"
37
- class="time-item"
38
- :style="config.title3Style"
39
- >
40
- {{ panel.title3 }}
41
- </span>
42
- <!-- 修改搜索框的显示条件 -->
43
- <a-input-search
44
- v-if="panel.search"
45
- v-model="searchText[panelIndex]"
46
- :placeholder="panel.searchPlace"
47
- class="search-input"
48
- @search="(value) => onSearch(value, panelIndex)"
49
- @click.stop
50
- />
51
- </div>
52
- </template>
53
- <!-- 根据类型显示不同内容 -->
54
- <template v-if="panel.type === 'picture'">
55
- <img :src="panel.configName" alt="图片" style="width: 100%; max-width: 500px;"/>
56
- </template>
57
- <template v-else-if="panel.type === 'cover'">
58
- <x-report
59
- :use-oss-for-img="false"
60
- :config-name="panel.configName"
61
- server-name="af-his"
62
- :show-img-in-cell="true"
63
- :display-only="true"
64
- :edit-mode="false"
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
- }
92
- },
93
- props: {
94
- // json名
95
- queryParamsName: {
96
- type: Object,
97
- default: 'openPrescriptionConfig'
98
- },
99
- parameter: {
100
- type: Object,
101
- default: () => {
102
- return {}
103
- }
104
- }
105
- },
106
- created () {
107
- this.searchTexts = {} // 初始化对象
108
-
109
- this.getData(this.queryParamsName)
110
- window.addEventListener('setItem', (e) => {
111
- console.log('监听到sessionStorage的变化:', e)
112
- if (e.key === 'klcf_id') {
113
- this.newVal = sessionStorage.getItem('klcf_id')
114
- // 进行业务处理
115
- console.log('sessionStorage中的值发生了变化:', this.newVal)
116
- }
117
- })
118
- },
119
- beforeDestroy () {
120
- window.removeEventListener('setItem', this.handleStorageChange)
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) {
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
- // 更具timeType更改时间类型
139
- if (this.config.timeType && this.config.timeType === '.') {
140
- this.config.showData.forEach(panel => {
141
- if (panel.title3) {
142
- panel.title3 = this.convertToCustomFormat(panel.title3)
143
- }
144
- })
145
- this.$forceUpdate()
146
- }
147
- this.activeKey = this.config.showData.map((_, panelIndex) => panelIndex.toString())
148
- })
149
- })
150
- },
151
- refreshXCollapse () {
152
- this.getData(this.queryParamsName)
153
- },
154
- convertToCustomFormat (dateString) {
155
- // 创建一个新的 Date 对象
156
- const date = new Date(dateString)
157
- // 获取年、月、日
158
- const year = date.getFullYear()
159
- const month = date.getMonth() + 1 // 月份从0开始,所以需要加1
160
- const day = date.getDate()
161
- // 返回格式化后的字符串
162
- return `${year}.${month}.${day}`
163
- },
164
- handleChange (keys) {
165
- this.activeKey = keys
166
- },
167
- onSearch (value, panelIndex) {
168
- console.log('搜索内容:', value, '面板索引:', panelIndex)
169
- },
170
- },
171
- watch: {
172
- queryParamsName: {
173
- handler (newValue) {
174
- this.getData(newValue, null)
175
- },
176
- deep: true
177
- }
178
- }
179
- }
180
- </script>
181
-
182
- <style scoped>
183
- .header-content {
184
- display: flex;
185
- align-items: center;
186
- gap: 24px;
187
- white-space: nowrap;
188
- overflow: hidden;
189
- }
190
-
191
- .header-text {
192
- margin-right: 16px;
193
- font-size: 16px;
194
- font-weight: 800;
195
- flex-shrink: 0;
196
- }
197
-
198
- .info-item {
199
- display: inline-flex;
200
- align-items: center;
201
- gap: 4px;
202
- font-size: 12px;
203
- color: #888888;
204
- flex-shrink: 0;
205
- }
206
-
207
- .time-item {
208
- margin-left: auto;
209
- text-align: right;
210
- flex-shrink: 0;
211
- }
212
-
213
- :deep(.ant-collapse-header) {
214
- position: relative;
215
- border-bottom: v-bind('config.showLine ? "1px solid #000000" : "none"');
216
- align-items: center !important;
217
- }
218
-
219
- :deep(.ant-collapse-header-text) {
220
- flex: 1;
221
- }
222
-
223
- :deep(.ant-collapse-content > .ant-collapse-content-box) {
224
- padding: 0;
225
- }
226
-
227
- :deep(.ant-card-body) {
228
- padding: 8px;
229
- }
230
- .search-input {
231
- margin-left: auto;
232
- width: 100%;
233
- }
234
- :deep(.ant-collapse-item-disabled > .ant-collapse-header) {
235
- cursor: default !important;
236
- }
237
- </style>
1
+ <template>
2
+ <div>
3
+ <a-collapse
4
+ :activeKey="activeKey"
5
+ @change="handleChange">
6
+ <a-collapse-panel
7
+ v-for="(panel, panelIndex) in config.showData"
8
+ :key="panelIndex.toString()"
9
+ :show-arrow="false"
10
+ :disabled="config.collapsible">
11
+ <template #header>
12
+ <div class="header-content">
13
+ <span
14
+ class="header-text"
15
+ :style="config.titleStyle">
16
+ {{ panel.title }}
17
+ </span>
18
+ <!-- 当有 title2 数据时显示信息项 -->
19
+ <template v-if="panel.title2 && panel.title2.length">
20
+ <span
21
+ v-for="(item, headerIndex) in panel.title2"
22
+ :key="headerIndex"
23
+ class="info-item"
24
+ :style="config.title2Style">
25
+ <!-- 根据showTitle是否显示键名 -->
26
+ <span v-if="config.showTitle">{{ item.key }}:</span>
27
+ <span>{{ item.value }}</span>
28
+ </span>
29
+ </template>
30
+ <!-- 当有 title3 数据时显示时间项 -->
31
+ <span
32
+ v-if="panel.title3"
33
+ class="time-item"
34
+ :style="config.title3Style">
35
+ {{ panel.title3 }}
36
+ </span>
37
+ <!-- 修改搜索框的显示条件 -->
38
+ <a-input-search
39
+ v-if="panel.search"
40
+ v-model="searchText[panelIndex]"
41
+ :placeholder="panel.searchPlace"
42
+ class="search-input"
43
+ @search="(value) => onSearch(value, panelIndex)"
44
+ @click.stop/>
45
+ </div>
46
+ </template>
47
+ <!-- 根据类型显示不同内容 -->
48
+ <template v-if="panel.type === 'picture'">
49
+ <img :src="panel.configName" alt="图片" style="width: 100%; max-width: 500px;"/>
50
+ </template>
51
+ <template v-else-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line', 'x-radio'].includes(panel.type)">
52
+ <component
53
+ :is="getComponentName(panel.type)"
54
+ :ref="`dynamicComponent_${ panel.type }`"
55
+ serverName="af-his"
56
+ :queryParamsName="panel.configName"
57
+ :countVisible="false"
58
+ :env="env"
59
+ @listClick="listClick"
60
+ />
61
+ </template>
62
+ </a-collapse-panel>
63
+ </a-collapse>
64
+ </div>
65
+ </template>
66
+
67
+ <script>
68
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
69
+
70
+ export default {
71
+ name: 'XCollapse',
72
+ components: {
73
+ XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'),
74
+ XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'),
75
+ XFormGroup: () => import('@vue2-client/base-client/components/common/XFormGroup/XFormGroup.vue'),
76
+ XTreePro: () => import('@vue2-client/base-client/components/common/XTree/XTreePro.vue'),
77
+ XHisEditor: () => import('@vue2-client/base-client/components/his/XHisEditor/XHisEditor.vue'),
78
+ XTab: () => import('@vue2-client/base-client/components/common/XTab/XTab.vue'),
79
+ XReport: () => import('@vue2-client/base-client/components/common/XReport/XReport.vue'),
80
+ XButtons: () => import('@vue2-client/base-client/components/common/XButtons/XButtons.vue'),
81
+ XLabelSelect: () => import('@vue2-client/base-client/components/common/XLabelSelect/XLabelSelect.vue'),
82
+ XConversation: () => import('@vue2-client/base-client/components/common/XConversation/XConversation.vue'),
83
+ XCheckList: () => import('@vue2-client/base-client/components/common/XCheckList/XCheckList.vue'),
84
+ XCardSet: () => import('@vue2-client/base-client/components/common/XCardSet/XCardSet.vue'),
85
+ XCollapse: () => import('@vue2-client/base-client/components/common/XCollapse/XCollapse.vue'),
86
+ XHDescriptions: () => import('@vue2-client/base-client/components/his/XHDescriptions/XHDescriptions.vue'),
87
+ XSidebar: () => import('@vue2-client/base-client/components/his/XSidebar/XSidebar.vue'),
88
+ XList: () => import('@vue2-client/base-client/components/his/XList/XList.vue'),
89
+ XInput: () => import('@vue2-client/base-client/components/common/XInput/XInput.vue'),
90
+ XTimeLine: () => import('@vue2-client/base-client/components/common/XTimeline/XTimeline.vue'),
91
+ XRadio: () => import('@vue2-client/base-client/components/his/XRadio/XRadio.vue')
92
+ },
93
+ data () {
94
+ return {
95
+ activeKey: [],
96
+ config: {},
97
+ configName: '',
98
+ searchText: {}
99
+ }
100
+ },
101
+ props: {
102
+ // json名
103
+ queryParamsName: {
104
+ type: Object,
105
+ default: 'openPrescriptionConfig'
106
+ },
107
+ parameter: {
108
+ type: Object,
109
+ }
110
+ },
111
+ created () {
112
+ this.getData(this.queryParamsName)
113
+ },
114
+ beforeDestroy () {
115
+ },
116
+ methods: {
117
+ async getData (config) {
118
+ this.configName = config
119
+ getConfigByName(config, 'af-his', res => {
120
+ this.config = res
121
+ console.warn(this.config)
122
+ runLogic(res.mainLogic, this.parameter, 'af-his').then(result => {
123
+ this.config.showData = result
124
+ // 更具timeType更改时间类型
125
+ if (this.config.timeType && this.config.timeType === '.') {
126
+ this.config.showData.forEach(panel => {
127
+ if (panel.title3) {
128
+ panel.title3 = this.convertToCustomFormat(panel.title3)
129
+ }
130
+ })
131
+ this.$forceUpdate()
132
+ }
133
+ this.activeKey = this.config.showData.map((_, panelIndex) => panelIndex.toString())
134
+ })
135
+ })
136
+ },
137
+ refreshXCollapse () {
138
+ this.getData(this.queryParamsName)
139
+ },
140
+ convertToCustomFormat (dateString) {
141
+ // 创建一个新的 Date 对象
142
+ const date = new Date(dateString)
143
+ // 获取年、月、日
144
+ const year = date.getFullYear()
145
+ const month = date.getMonth() + 1 // 月份从0开始,所以需要加1
146
+ const day = date.getDate()
147
+ // 返回格式化后的字符串
148
+ return `${year}.${month}.${day}`
149
+ },
150
+ handleChange (keys) {
151
+ this.activeKey = keys
152
+ },
153
+ onSearch (value, panelIndex) {
154
+ console.log('搜索内容:', value, '面板索引:', panelIndex)
155
+ },
156
+ },
157
+ watch: {
158
+ queryParamsName: {
159
+ handler (newValue) {
160
+ this.getData(newValue, null)
161
+ },
162
+ deep: true
163
+ }
164
+ }
165
+ }
166
+ </script>
167
+
168
+ <style scoped>
169
+ .header-content {
170
+ display: flex;
171
+ align-items: center;
172
+ gap: 24px;
173
+ white-space: nowrap;
174
+ overflow: hidden;
175
+ }
176
+
177
+ .header-text {
178
+ margin-right: 16px;
179
+ font-size: 16px;
180
+ font-weight: 800;
181
+ flex-shrink: 0;
182
+ }
183
+
184
+ .info-item {
185
+ display: inline-flex;
186
+ align-items: center;
187
+ gap: 4px;
188
+ font-size: 12px;
189
+ color: #888888;
190
+ flex-shrink: 0;
191
+ }
192
+
193
+ .time-item {
194
+ margin-left: auto;
195
+ text-align: right;
196
+ flex-shrink: 0;
197
+ }
198
+
199
+ :deep(.ant-collapse-header) {
200
+ position: relative;
201
+ border-bottom: v-bind('config.showLine ? "1px solid #000000" : "none"');
202
+ align-items: center !important;
203
+ }
204
+
205
+ :deep(.ant-collapse-header-text) {
206
+ flex: 1;
207
+ }
208
+
209
+ :deep(.ant-collapse-content > .ant-collapse-content-box) {
210
+ padding: 0;
211
+ }
212
+
213
+ :deep(.ant-card-body) {
214
+ padding: 8px;
215
+ }
216
+ .search-input {
217
+ margin-left: auto;
218
+ width: 100%;
219
+ }
220
+ :deep(.ant-collapse-item-disabled > .ant-collapse-header) {
221
+ cursor: default !important;
222
+ }
223
+ </style>