vue2-client 1.12.84 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.12.84",
3
+ "version": "1.12.87",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -0,0 +1,351 @@
1
+ <template>
2
+ <div class="calendar-wrapper" :style="config.styles?.wrapper">
3
+ <!-- 顶部标题栏 -->
4
+ <div v-if="config.header.show" class="header-bar" :style="config.styles?.header">
5
+ <div class="left">
6
+ <i v-if="config.header.showIcon" class="icon-menu"></i>
7
+ <input type="text" :value="config.header.title" class="title-input" :style="config.styles?.titleInput"/>
8
+ </div>
9
+ <div class="right">
10
+ <a-button v-if="config.header.showBackToToday" type="link" @click="backToToday">{{
11
+ config.header.backToTodayText
12
+ }}
13
+ </a-button>
14
+ <a-button v-if="config.header.showMonth" type="link" :disabled="!config.header.monthClickable">{{
15
+ todayMonth
16
+ }}
17
+ </a-button>
18
+ <a-button v-if="config.header.showDay" type="link" :disabled="!config.header.dayClickable">{{
19
+ todayDay
20
+ }}
21
+ </a-button>
22
+ </div>
23
+ </div>
24
+
25
+ <!-- 子标题栏 -->
26
+ <div v-if="config.subHeader.show" class="sub-header" :style="config.styles?.subHeader">
27
+ <div class="title">
28
+ <span class="current-date" :style="config.styles?.currentDate">{{ currentDateText }}</span>
29
+ <span class="year" :style="config.styles?.year">{{ currentYearText }}</span>
30
+ </div>
31
+ <div class="actions">
32
+ <span
33
+ v-for="(action, index) in config.actions"
34
+ :key="index"
35
+ class="action-item"
36
+ :style="config.styles?.actionItem"
37
+ @click="handleAction(action)">
38
+ {{ action.text }}
39
+ </span>
40
+ <a-button v-if="config.subHeader.showNavigation" type="link" @click="prevMonth">
41
+ {{ config.subHeader.prevMonthText }}
42
+ </a-button>
43
+ <a-button v-if="config.subHeader.showNavigation" type="link" @click="nextMonth">
44
+ {{ config.subHeader.nextMonthText }}
45
+ </a-button>
46
+ </div>
47
+ </div>
48
+
49
+ <!-- 日历内容 -->
50
+ <div class="calendar-content" :style="config.styles?.calendarContent">
51
+ <a-calendar
52
+ ref="calendar"
53
+ :value="currentDate"
54
+ :fullscreen="config.calendar.fullscreen"
55
+ @select="handleSelect"
56
+ />
57
+ </div>
58
+ </div>
59
+ </template>
60
+
61
+ <script>
62
+ import { Calendar, Button } from 'ant-design-vue'
63
+ import moment from 'moment'
64
+ import 'moment/locale/zh-cn'
65
+
66
+ // 设置中文
67
+ moment.locale('zh-cn')
68
+
69
+ // 默认配置
70
+ const defaultConfig = {
71
+ header: {
72
+ show: true,
73
+ title: '我的日程',
74
+ showIcon: true,
75
+ showBackToToday: true,
76
+ backToTodayText: '返回当天',
77
+ showMonth: true,
78
+ showDay: true,
79
+ monthClickable: false,
80
+ dayClickable: false
81
+ },
82
+ subHeader: {
83
+ show: true,
84
+ showNavigation: true,
85
+ prevMonthText: '←',
86
+ nextMonthText: '→'
87
+ },
88
+ calendar: {
89
+ fullscreen: false,
90
+ locale: 'zh-cn'
91
+ },
92
+ // 操作按钮
93
+ actions: [
94
+ {
95
+ text: '+ 新增日程',
96
+ type: 'add',
97
+ handler: 'handleAdd'
98
+ }
99
+ ],
100
+ // 自定义样式
101
+ styles: {
102
+ wrapper: {},
103
+ header: {},
104
+ titleInput: {},
105
+ subHeader: {},
106
+ currentDate: {},
107
+ year: {},
108
+ actionItem: {},
109
+ calendarContent: {}
110
+ },
111
+ // 事件配置
112
+ events: {
113
+ select: 'select',
114
+ backToToday: 'back-to-today',
115
+ action: 'action',
116
+ add: 'add',
117
+ monthChange: 'month-change'
118
+ }
119
+ }
120
+
121
+ export default {
122
+ name: 'XCalendar',
123
+ components: {
124
+ ACalendar: Calendar,
125
+ AButton: Button
126
+ },
127
+ props: {
128
+ // 接收配置
129
+ config: {
130
+ type: Object,
131
+ default: () => ({})
132
+ }
133
+ },
134
+ data () {
135
+ const today = moment()
136
+ return {
137
+ currentDate: moment(),
138
+ todayMonth: today.month() + 1,
139
+ todayDay: today.date(),
140
+ // 合并默认配置和传入的配置
141
+ mergedConfig: {}
142
+ }
143
+ },
144
+ created () {
145
+ // 深度合并配置
146
+ this.mergedConfig = this.mergeConfig(defaultConfig, this.config)
147
+ },
148
+ computed: {
149
+ // 使用计算属性访问合并后的配置
150
+ // eslint-disable-next-line vue/no-dupe-keys
151
+ config () {
152
+ return this.mergedConfig
153
+ },
154
+ currentDateText () {
155
+ const month = this.currentDate.month() + 1
156
+ const day = this.currentDate.date()
157
+ return `${this.numberToChinese(month)}月${this.numberToChinese(day)}日`
158
+ },
159
+ currentYearText () {
160
+ return this.currentDate.format('YYYY')
161
+ }
162
+ },
163
+ methods: {
164
+ // 深度合并配置
165
+ mergeConfig (defaultConfig, userConfig) {
166
+ const result = { ...defaultConfig }
167
+
168
+ for (const key in userConfig) {
169
+ if (typeof userConfig[key] === 'object' && userConfig[key] !== null &&
170
+ typeof defaultConfig[key] === 'object' && defaultConfig[key] !== null) {
171
+ result[key] = this.mergeConfig(defaultConfig[key], userConfig[key])
172
+ } else if (userConfig[key] !== undefined) {
173
+ result[key] = userConfig[key]
174
+ }
175
+ }
176
+
177
+ return result
178
+ },
179
+ numberToChinese (num) {
180
+ const chineseNums = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
181
+ if (num <= 10) return chineseNums[num]
182
+ if (num < 20) return '十' + (num % 10 === 0 ? '' : chineseNums[num % 10])
183
+ return chineseNums[Math.floor(num / 10)] + '十' + (num % 10 === 0 ? '' : chineseNums[num % 10])
184
+ },
185
+ handleSelect (date) {
186
+ this.currentDate = date
187
+ // 触发选择事件,使用配置的事件名
188
+ this.$emit(this.config.events.select, date)
189
+ },
190
+ prevMonth () {
191
+ // 使用moment API直接操作日期
192
+ this.currentDate = moment(this.currentDate).subtract(1, 'month')
193
+ // 触发月份变化事件
194
+ this.$emit(this.config.events.monthChange, this.currentDate)
195
+ },
196
+ nextMonth () {
197
+ // 使用moment API直接操作日期
198
+ this.currentDate = moment(this.currentDate).add(1, 'month')
199
+ // 触发月份变化事件
200
+ this.$emit(this.config.events.monthChange, this.currentDate)
201
+ },
202
+ backToToday () {
203
+ // 返回当天
204
+ this.currentDate = moment()
205
+ // 触发返回今天事件
206
+ this.$emit(this.config.events.backToToday, this.currentDate)
207
+ },
208
+ // 处理操作按钮点击
209
+ handleAction (action) {
210
+ // 检查是否有注册的处理方法
211
+ if (action.type && typeof this[`handle${action.type.charAt(0).toUpperCase() + action.type.slice(1)}`] === 'function') {
212
+ // 调用对应的处理方法
213
+ this[`handle${action.type.charAt(0).toUpperCase() + action.type.slice(1)}`](action)
214
+ } else if (action.handler && typeof this.$parent[action.handler] === 'function') {
215
+ // 调用父组件的方法
216
+ this.$parent[action.handler](this.currentDate, action)
217
+ }
218
+ // 触发点击事件
219
+ this.$emit(this.config.events.action, this.currentDate)
220
+ },
221
+ // 默认的新增处理方法
222
+ handleAdd (action) {
223
+ this.$emit(this.config.events.add, this.currentDate)
224
+ }
225
+ }
226
+ }
227
+ </script>
228
+
229
+ <style scoped>
230
+ .calendar-wrapper {
231
+ background: #fff;
232
+ border-radius: 4px;
233
+ padding: 20px;
234
+ }
235
+
236
+ /* 顶部标题栏样式 */
237
+ .header-bar {
238
+ display: flex;
239
+ justify-content: space-between;
240
+ align-items: center;
241
+ padding-bottom: 16px;
242
+ border-bottom: 1px solid #f0f0f0;
243
+ margin-bottom: 16px;
244
+ }
245
+
246
+ .header-bar .left {
247
+ display: flex;
248
+ align-items: center;
249
+ }
250
+
251
+ .icon-menu {
252
+ display: inline-block;
253
+ width: 20px;
254
+ height: 20px;
255
+ background-color: #ccc;
256
+ margin-right: 8px;
257
+ }
258
+
259
+ .title-input {
260
+ border: none;
261
+ font-size: 16px;
262
+ font-weight: 500;
263
+ outline: none;
264
+ color: #000;
265
+ background-color: transparent;
266
+ width: 200px;
267
+ }
268
+
269
+ .header-bar .right {
270
+ display: flex;
271
+ }
272
+
273
+ .sub-header {
274
+ display: flex;
275
+ justify-content: space-between;
276
+ align-items: center;
277
+ margin-bottom: 20px;
278
+ }
279
+
280
+ .title {
281
+ display: flex;
282
+ gap: 8px;
283
+ align-items: baseline;
284
+ }
285
+
286
+ .current-date {
287
+ font-size: 24px;
288
+ font-weight: 500;
289
+ }
290
+
291
+ .year {
292
+ color: #999;
293
+ font-size: 16px;
294
+ }
295
+
296
+ .actions {
297
+ display: flex;
298
+ align-items: center;
299
+ gap: 16px;
300
+ }
301
+
302
+ .action-item {
303
+ color: #666;
304
+ cursor: pointer;
305
+ }
306
+
307
+ .calendar-content {
308
+ :deep(.ant-fullcalendar-header) {
309
+ display: none;
310
+ }
311
+
312
+ :deep(.ant-fullcalendar) {
313
+ border: 1px solid #f0f0f0;
314
+ border-radius: 2px;
315
+ }
316
+
317
+ :deep(.ant-fullcalendar-calendar-body) {
318
+ padding: 8px 12px;
319
+ }
320
+
321
+ :deep(.ant-fullcalendar-column-header) {
322
+ text-align: center;
323
+ padding: 12px 0;
324
+
325
+ .ant-fullcalendar-column-header-inner {
326
+ display: inline-block;
327
+ font-weight: normal;
328
+ }
329
+ }
330
+
331
+ :deep(.ant-fullcalendar-cell) {
332
+ padding: 4px 0;
333
+ }
334
+
335
+ :deep(.ant-fullcalendar-date) {
336
+ height: 24px;
337
+ margin: 0 4px;
338
+ padding: 4px;
339
+ border-radius: 2px;
340
+ border: none;
341
+ width: auto;
342
+ text-align: center;
343
+ }
344
+
345
+ :deep(.ant-fullcalendar-selected-day .ant-fullcalendar-value) {
346
+ background: #000;
347
+ color: #fff;
348
+ border-radius: 50%;
349
+ }
350
+ }
351
+ </style>
@@ -2,20 +2,17 @@
2
2
  <div>
3
3
  <a-collapse
4
4
  :activeKey="activeKey"
5
- @change="handleChange"
6
- >
5
+ @change="handleChange">
7
6
  <a-collapse-panel
8
7
  v-for="(panel, panelIndex) in config.showData"
9
8
  :key="panelIndex.toString()"
10
9
  :show-arrow="false"
11
- :disabled="config.collapsible"
12
- >
10
+ :disabled="config.collapsible">
13
11
  <template #header>
14
12
  <div class="header-content">
15
13
  <span
16
14
  class="header-text"
17
- :style="config.titleStyle"
18
- >
15
+ :style="config.titleStyle">
19
16
  {{ panel.title }}
20
17
  </span>
21
18
  <!-- 当有 title2 数据时显示信息项 -->
@@ -24,8 +21,7 @@
24
21
  v-for="(item, headerIndex) in panel.title2"
25
22
  :key="headerIndex"
26
23
  class="info-item"
27
- :style="config.title2Style"
28
- >
24
+ :style="config.title2Style">
29
25
  <!-- 根据showTitle是否显示键名 -->
30
26
  <span v-if="config.showTitle">{{ item.key }}:</span>
31
27
  <span>{{ item.value }}</span>
@@ -35,8 +31,7 @@
35
31
  <span
36
32
  v-if="panel.title3"
37
33
  class="time-item"
38
- :style="config.title3Style"
39
- >
34
+ :style="config.title3Style">
40
35
  {{ panel.title3 }}
41
36
  </span>
42
37
  <!-- 修改搜索框的显示条件 -->
@@ -46,26 +41,23 @@
46
41
  :placeholder="panel.searchPlace"
47
42
  class="search-input"
48
43
  @search="(value) => onSearch(value, panelIndex)"
49
- @click.stop
50
- />
44
+ @click.stop/>
51
45
  </div>
52
46
  </template>
53
47
  <!-- 根据类型显示不同内容 -->
54
48
  <template v-if="panel.type === 'picture'">
55
49
  <img :src="panel.configName" alt="图片" style="width: 100%; max-width: 500px;"/>
56
50
  </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>
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
+ />
69
61
  </template>
70
62
  </a-collapse-panel>
71
63
  </a-collapse>
@@ -73,15 +65,31 @@
73
65
  </template>
74
66
 
75
67
  <script>
76
- import XReport from '@vue2-client/base-client/components/common/XReportGrid'
77
68
  import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
78
69
 
79
70
  export default {
80
71
  name: 'XCollapse',
81
72
  components: {
82
- XReport
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')
83
92
  },
84
- inject: ['getConfigByName', 'getComponentByName'],
85
93
  data () {
86
94
  return {
87
95
  activeKey: [],
@@ -101,31 +109,12 @@ export default {
101
109
  }
102
110
  },
103
111
  created () {
104
- this.searchTexts = {} // 初始化对象
105
-
106
112
  this.getData(this.queryParamsName)
107
- window.addEventListener('setItem', (e) => {
108
- console.log('监听到sessionStorage的变化:', e)
109
- if (e.key === 'klcf_id') {
110
- this.newVal = sessionStorage.getItem('klcf_id')
111
- // 进行业务处理
112
- console.log('sessionStorage中的值发生了变化:', this.newVal)
113
- }
114
- })
115
113
  },
116
114
  beforeDestroy () {
117
- window.removeEventListener('setItem', this.handleStorageChange)
118
115
  },
119
116
  methods: {
120
- handleStorageChange (e) {
121
- console.log('监听到sessionStorage的变化:', e)
122
- if (e.key === 'klcf_id') {
123
- this.newVal = sessionStorage.getItem('klcf_id')
124
- // 进行业务处理
125
- console.log('sessionStorage中的值发生了变化:', this.newVal)
126
- }
127
- },
128
- async getData (config, parameter) {
117
+ async getData (config) {
129
118
  this.configName = config
130
119
  getConfigByName(config, 'af-his', res => {
131
120
  this.config = res
@@ -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>
@@ -17,6 +17,7 @@
17
17
  :server-name="serverName"
18
18
  :env="env"
19
19
  :show-title="showTitle"
20
+ @listClick="listClick"
20
21
  >
21
22
  </XReportDesign>
22
23
  <a-row
@@ -246,6 +247,9 @@ export default {
246
247
  }
247
248
  },
248
249
  methods: {
250
+ listClick (data) {
251
+ this.$emit('listClick', data)
252
+ },
249
253
  slotRendered () {
250
254
  if (this.config?.mountedFunction) {
251
255
  let func = this.config.mountedFunction
@@ -1,44 +1,44 @@
1
- <template>
2
- <div id="test">
3
- <a-card :bordered="false">
4
- <XReport
5
- ref="main"
6
- :use-oss-for-img="false"
7
- config-name="openPrescriptionCover"
8
- server-name="af-his"
9
- :show-img-in-cell="true"
10
- :display-only="true"
11
- :edit-mode="false"
12
- :dont-format="true"/>
13
- </a-card>
14
- </div>
15
- </template>
16
-
17
- <script>
18
- import XReport from './XReport'
19
- import XAddReport from '../XAddReport/XAddReport.vue'
20
- // eslint-disable-next-line no-unused-vars
21
-
22
- export default {
23
- name: 'XReportDemo',
24
- components: {
25
- XReport, XAddReport
26
- },
27
- mounted () {
28
- // this.$refs.xAddReport.init({
29
- // configName: 'skinTestExecuActionCover',
30
- // selectedId: '11111',
31
- // mixinData: {}
32
- // })
33
- },
34
- data () {
35
- return {
36
- }
37
- },
38
- methods: {
39
- }
40
- }
41
- </script>
42
- <style scoped>
43
-
44
- </style>
1
+ <template>
2
+ <div id="test">
3
+ <a-card :bordered="false">
4
+ <XReport
5
+ ref="main"
6
+ :use-oss-for-img="false"
7
+ config-name="openPrescriptionCover"
8
+ server-name="af-his"
9
+ :show-img-in-cell="true"
10
+ :display-only="true"
11
+ :edit-mode="false"
12
+ :dont-format="true"/>
13
+ </a-card>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ import XReport from './XReport'
19
+ import XAddReport from '../XAddReport/XAddReport.vue'
20
+ // eslint-disable-next-line no-unused-vars
21
+
22
+ export default {
23
+ name: 'XReportDemo',
24
+ components: {
25
+ XReport, XAddReport
26
+ },
27
+ mounted () {
28
+ // this.$refs.xAddReport.init({
29
+ // configName: 'skinTestExecuActionCover',
30
+ // selectedId: '11111',
31
+ // mixinData: {}
32
+ // })
33
+ },
34
+ data () {
35
+ return {
36
+ }
37
+ },
38
+ methods: {
39
+ }
40
+ }
41
+ </script>
42
+ <style scoped>
43
+
44
+ </style>
@@ -35,6 +35,7 @@
35
35
  :columns="row"
36
36
  :config-data="activatedConfig.data"
37
37
  :config="activatedConfig"
38
+ @listClick="listClick"
38
39
  :display="true">
39
40
  </x-report-tr-group>
40
41
  </tbody>
@@ -122,6 +123,9 @@ export default {
122
123
  }
123
124
  },
124
125
  methods: {
126
+ listClick (data) {
127
+ this.$emit('listClick', data)
128
+ },
125
129
  slotRendered () {
126
130
  this.$emit('slotRendered')
127
131
  },