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.
- package/package.json +1 -1
- package/src/base-client/components/common/XCalendar/XCalendar.vue +351 -0
- package/src/base-client/components/common/XCollapse/XCollapse.vue +223 -237
- package/src/base-client/components/common/XReportGrid/XReport.vue +1018 -1014
- package/src/base-client/components/common/XReportGrid/XReportDesign.vue +620 -616
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +708 -708
- package/src/base-client/components/his/XList/XList.vue +90 -90
- package/src/base-client/components/his/XRadio/XRadio.vue +66 -50
- package/src/base-client/components/his/XRadio/index.md +106 -0
- package/src/pages/userInfoDetailManage/uploadFilesHistory/index.vue +130 -0
- package/src/pages/userInfoDetailManage/userInfoDetailQueryTabs.vue +3 -0
package/package.json
CHANGED
|
@@ -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>
|