@opendesign-plus-test/components 0.0.1-rc.34 → 0.0.1-rc.36
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/dist/chunk-OElCookieNotice.cjs.js +1 -1
- package/dist/chunk-OElCookieNotice.es.js +60 -54
- package/dist/components/OHeaderUser.vue.d.ts +2 -0
- package/dist/components/activity/composables/useActivityConfig.d.ts +17 -0
- package/dist/components/activity/config.d.ts +0 -14
- package/dist/components/header/OHeader.vue.d.ts +8 -2
- package/dist/components/header/OHeaderMobile.vue.d.ts +171 -0
- package/dist/components/header/components/HeaderContent.vue.d.ts +8 -1
- package/dist/components/header/components/HeaderNav.vue.d.ts +13 -1
- package/dist/components/header/components/HeaderNavMobile.vue.d.ts +33 -0
- package/dist/components/header/index.d.ts +128 -5
- package/dist/components/header/types.d.ts +80 -0
- package/dist/components/meeting/OMeetingCalendar.vue.d.ts +1 -0
- package/dist/components/meeting/composables/useMeetingConfig.d.ts +14 -0
- package/dist/components/meeting/config.d.ts +1 -16
- package/dist/components/meeting/types.d.ts +2 -0
- package/dist/components/meeting/utils.d.ts +1 -15
- package/dist/components.cjs.js +39 -39
- package/dist/components.css +1 -1
- package/dist/components.es.js +10107 -10368
- package/package.json +2 -2
- package/src/components/OHeaderUser.vue +4 -4
- package/src/components/OSourceCode.vue +1 -1
- package/src/components/activity/OActivityApproval.vue +3 -4
- package/src/components/activity/OActivityForm.vue +7 -6
- package/src/components/activity/OMyActivityCalendar.vue +11 -12
- package/src/components/activity/composables/useActivityConfig.ts +143 -0
- package/src/components/activity/config.ts +1 -141
- package/src/components/header/OHeader.vue +6 -24
- package/src/components/header/OHeaderMobile.vue +177 -0
- package/src/components/header/components/HeaderContent.vue +190 -11
- package/src/components/header/components/HeaderNav.vue +3 -5
- package/src/components/header/components/HeaderNavMobile.vue +377 -0
- package/src/components/header/index.ts +5 -5
- package/src/components/header/types.ts +91 -0
- package/src/components/meeting/OMeetingCalendar.vue +41 -45
- package/src/components/meeting/OMeetingForm.vue +11 -18
- package/src/components/meeting/OMyMeetingCalendar.vue +9 -9
- package/src/components/meeting/OSigMeetingCalendar.vue +5 -6
- package/src/components/meeting/components/OMeetingCalendarList.vue +28 -37
- package/src/components/meeting/components/OMeetingDetail.vue +13 -12
- package/src/components/meeting/components/OSigMeetingAside.vue +4 -1
- package/src/components/meeting/composables/useMeetingConfig.ts +108 -0
- package/src/components/meeting/config.ts +13 -75
- package/src/components/meeting/index.ts +1 -1
- package/src/components/meeting/types.ts +2 -0
- package/src/components/meeting/utils.ts +3 -56
- package/src/i18n/en.ts +20 -17
- package/src/i18n/zh.ts +5 -2
- package/dist/components/header/OHeaderMoblie.vue.d.ts +0 -33
- package/dist/components/header/components/HeaderNavMoblie.vue.d.ts +0 -17
- package/dist/components/header/components/HeaderUbmcNav.vue.d.ts +0 -2
- package/src/components/header/OHeaderMoblie.vue +0 -152
- package/src/components/header/components/HeaderNavMoblie.vue +0 -346
- package/src/components/header/components/HeaderUbmcNav.vue +0 -540
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref, onMounted, watch } from 'vue';
|
|
3
|
+
import { OIcon, OTag } from '@opensig/opendesign';
|
|
4
|
+
|
|
5
|
+
import { type NavMobileItemT, NavType } from '../types.ts';
|
|
6
|
+
|
|
7
|
+
export interface OHeaderEmitsT {
|
|
8
|
+
(e: 'on-click'): void;
|
|
9
|
+
(e: 'handle-click', val: any): void;
|
|
10
|
+
}
|
|
11
|
+
const emit = defineEmits<OHeaderEmitsT>();
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(defineProps<NavMobileItemT>(), {
|
|
14
|
+
menuShow: false,
|
|
15
|
+
navData: () => [],
|
|
16
|
+
codeData: () => [],
|
|
17
|
+
langData: () => [],
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const navActive = ref('');
|
|
21
|
+
const navInfo = ref({});
|
|
22
|
+
|
|
23
|
+
const handleNavClick = (item: any, val?: string) => {
|
|
24
|
+
if (val === NavType.NAV) {
|
|
25
|
+
if (item?.children?.length) {
|
|
26
|
+
navActive.value = item.id;
|
|
27
|
+
navInfo.value = item;
|
|
28
|
+
} else {
|
|
29
|
+
emit('handle-click', item);
|
|
30
|
+
}
|
|
31
|
+
} else if (val === NavType.CODE) {
|
|
32
|
+
navActive.value = val;
|
|
33
|
+
navInfo.value = props.codeData.list;
|
|
34
|
+
} else if (val === NavType.LANG) {
|
|
35
|
+
navActive.value = val;
|
|
36
|
+
navInfo.value = props.langData.list;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const onClick = (url: string, target?: string) => {
|
|
41
|
+
window.open(url, target ? target : '_self');
|
|
42
|
+
emit('on-click');
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const onClickNav = (val: any) => {
|
|
46
|
+
if (navActive.value === NavType.CODE) {
|
|
47
|
+
onClick(val.href, val?.target);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
onMounted(() => {
|
|
52
|
+
navActive.value = props.navData[0].id;
|
|
53
|
+
navInfo.value = props.navData[0];
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
watch(
|
|
57
|
+
() => props.navData || props.codeData || props.langData,
|
|
58
|
+
() => {
|
|
59
|
+
if (navActive.value === NavType.CODE) {
|
|
60
|
+
navInfo.value = props.codeData.list;
|
|
61
|
+
} else if (navActive.value === NavType.LANG) {
|
|
62
|
+
navInfo.value = props.langData.list;
|
|
63
|
+
} else {
|
|
64
|
+
navInfo.value = props.navData.find((item) => item.id === navActive.value);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
deep: true,
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<template>
|
|
74
|
+
<div class="header-nav" :class="{ active: menuShow }">
|
|
75
|
+
<div class="o-nav">
|
|
76
|
+
<ul class="o-nav-list">
|
|
77
|
+
<li
|
|
78
|
+
v-for="item in navData"
|
|
79
|
+
:key="item.id"
|
|
80
|
+
:class="{
|
|
81
|
+
active: navActive === item.id,
|
|
82
|
+
}"
|
|
83
|
+
>
|
|
84
|
+
<span @click="handleNavClick(item, 'nav')">{{ item.label }}</span>
|
|
85
|
+
</li>
|
|
86
|
+
</ul>
|
|
87
|
+
<div class="nav-aside">
|
|
88
|
+
<ul v-if="navActive !== 'code' && navActive !== 'lang'" class="nav-aside-wrapper">
|
|
89
|
+
<li v-for="item in navInfo.children" :value="item.label" :key="item.label" class="nav-aside-content">
|
|
90
|
+
<template v-if="item?.children">
|
|
91
|
+
<p class="content-label">{{ item.label }}</p>
|
|
92
|
+
<div class="container-mobile">
|
|
93
|
+
<div v-for="subItem in item?.children" :key="subItem.label" class="content-container-mobile">
|
|
94
|
+
<a @click="onClick(subItem.href, subItem?.target)" rel="noopener noreferrer" class="content-subtitle">
|
|
95
|
+
<span class="item-label">{{ subItem.label }}</span>
|
|
96
|
+
<OIcon v-if="subItem.icon">
|
|
97
|
+
<component :is="subItem.icon" class="icon" />
|
|
98
|
+
</OIcon>
|
|
99
|
+
<OTag v-if="subItem.tag" round="pill" color="danger" size="small" class="content-tag">{{ subItem.tag }}</OTag>
|
|
100
|
+
</a>
|
|
101
|
+
<div class="desc-container">
|
|
102
|
+
<p class="item-desc">{{ subItem.description }}</p>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|
|
107
|
+
<template v-else>
|
|
108
|
+
<a @click="onClick(item.href, item?.target)" rel="noopener noreferrer" class="content-subtitle item-not-children">
|
|
109
|
+
<span class="item-label">{{ item.label }}</span>
|
|
110
|
+
<OIcon v-if="item.icon">
|
|
111
|
+
<component :is="item.icon" class="icon" />
|
|
112
|
+
</OIcon>
|
|
113
|
+
<OTag v-if="item.tag" round="pill" color="danger" size="small">{{ item.tag }}</OTag>
|
|
114
|
+
</a>
|
|
115
|
+
</template>
|
|
116
|
+
</li>
|
|
117
|
+
</ul>
|
|
118
|
+
<div v-else class="nav-aside-wrapper">
|
|
119
|
+
<a v-for="item in navInfo" :key="item.label" @click="onClickNav(item)" class="source-code-item">
|
|
120
|
+
<span>{{ item.label }}</span>
|
|
121
|
+
<OIcon v-if="item.icon">
|
|
122
|
+
<component :is="item.icon" class="icon" />
|
|
123
|
+
</OIcon>
|
|
124
|
+
</a>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
<!-- 移动端 tool -->
|
|
129
|
+
<div class="header-tool">
|
|
130
|
+
<!-- 源码 -->
|
|
131
|
+
<div
|
|
132
|
+
v-if="codeData"
|
|
133
|
+
class="header-tool-item"
|
|
134
|
+
@click="handleNavClick(null, 'code')"
|
|
135
|
+
:class="{
|
|
136
|
+
active: navActive === 'code',
|
|
137
|
+
}"
|
|
138
|
+
>
|
|
139
|
+
{{ codeData.label }}
|
|
140
|
+
</div>
|
|
141
|
+
<div
|
|
142
|
+
v-if="langData"
|
|
143
|
+
class="header-tool-item"
|
|
144
|
+
@click="handleNavClick(null, 'lang')"
|
|
145
|
+
:class="{
|
|
146
|
+
active: navActive === 'lang',
|
|
147
|
+
}"
|
|
148
|
+
>
|
|
149
|
+
{{ langData.label }}
|
|
150
|
+
</div>
|
|
151
|
+
<!-- 语言 -->
|
|
152
|
+
<div v-if="$slots.tool" class="other-tool">
|
|
153
|
+
<slot name="tool"></slot>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</template>
|
|
158
|
+
|
|
159
|
+
<style lang="scss" scoped>
|
|
160
|
+
@mixin nav-item {
|
|
161
|
+
display: flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
justify-content: center;
|
|
164
|
+
height: 48px;
|
|
165
|
+
color: var(--o-color-info1);
|
|
166
|
+
|
|
167
|
+
&.active {
|
|
168
|
+
color: var(--o-color-primary1);
|
|
169
|
+
background: var(--o-color-fill2);
|
|
170
|
+
font-weight: 500;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.header-nav {
|
|
175
|
+
flex: 1;
|
|
176
|
+
justify-content: space-between;
|
|
177
|
+
width: 100%;
|
|
178
|
+
overflow: hidden;
|
|
179
|
+
height: 100%;
|
|
180
|
+
background-color: var(--o-color-fill2);
|
|
181
|
+
transform: translateX(-130%);
|
|
182
|
+
|
|
183
|
+
transition-duration: 0.333s;
|
|
184
|
+
transition-property: all;
|
|
185
|
+
transition-timing-function: cubic-bezier(0.5, 0, 0.84, 0.25);
|
|
186
|
+
display: block;
|
|
187
|
+
opacity: 0;
|
|
188
|
+
|
|
189
|
+
&.active {
|
|
190
|
+
opacity: 1;
|
|
191
|
+
visibility: visible;
|
|
192
|
+
transform: translateX(0);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.o-nav {
|
|
197
|
+
height: 100%;
|
|
198
|
+
position: relative;
|
|
199
|
+
width: 99px;
|
|
200
|
+
background: var(--o-color-fill1);
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
203
|
+
justify-content: space-between;
|
|
204
|
+
|
|
205
|
+
.o-nav-list {
|
|
206
|
+
padding: 0;
|
|
207
|
+
margin: 0;
|
|
208
|
+
height: auto;
|
|
209
|
+
|
|
210
|
+
> li {
|
|
211
|
+
position: relative;
|
|
212
|
+
text-align: center;
|
|
213
|
+
@include text2;
|
|
214
|
+
@include nav-item;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.nav-aside {
|
|
220
|
+
position: fixed;
|
|
221
|
+
background-color: var(--o-color-fill2);
|
|
222
|
+
top: 0;
|
|
223
|
+
left: 0;
|
|
224
|
+
width: calc(100% - 99px);
|
|
225
|
+
transform: translateX(99px);
|
|
226
|
+
height: 100%;
|
|
227
|
+
z-index: 190;
|
|
228
|
+
.nav-aside-wrapper {
|
|
229
|
+
overflow-y: auto;
|
|
230
|
+
padding: 16px 12px 32px;
|
|
231
|
+
height: 100%;
|
|
232
|
+
.nav-aside-content {
|
|
233
|
+
display: block;
|
|
234
|
+
flex: 0 1 auto;
|
|
235
|
+
|
|
236
|
+
& + .nav-aside-content {
|
|
237
|
+
position: relative;
|
|
238
|
+
padding-top: var(--o-gap-3);
|
|
239
|
+
&::before {
|
|
240
|
+
content: '';
|
|
241
|
+
position: absolute;
|
|
242
|
+
top: 0;
|
|
243
|
+
width: 100%;
|
|
244
|
+
height: 1px;
|
|
245
|
+
background-color: rgba(var(--o-mixedgray-14), 0.1);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
.content-label {
|
|
249
|
+
color: var(--o-color-info3);
|
|
250
|
+
@include text2;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.item-not-children {
|
|
254
|
+
margin-bottom: 12px;
|
|
255
|
+
display: flex;
|
|
256
|
+
align-items: center;
|
|
257
|
+
.o-tag {
|
|
258
|
+
margin-left: var(--o-gap-2);
|
|
259
|
+
--layout-pkg-radius: 100vh;
|
|
260
|
+
}
|
|
261
|
+
.o-icon {
|
|
262
|
+
margin-left: var(--o-gap-2);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.source-code-item {
|
|
268
|
+
height: 40px;
|
|
269
|
+
display: flex;
|
|
270
|
+
align-items: center;
|
|
271
|
+
color: var(--o-color-info1);
|
|
272
|
+
|
|
273
|
+
&.active {
|
|
274
|
+
color: var(--o-color-primary1);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
& + .source-code-item {
|
|
278
|
+
border-top: 1px solid var(--o-color-control4);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.icon {
|
|
282
|
+
margin-left: var(--o-gap-2);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
&::-webkit-scrollbar-track {
|
|
287
|
+
border-radius: 3px;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&::-webkit-scrollbar {
|
|
291
|
+
width: 6px;
|
|
292
|
+
background-color: transparent;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&::-webkit-scrollbar-thumb {
|
|
296
|
+
border-radius: 3px;
|
|
297
|
+
background: var(--o-color-control1);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.container-mobile {
|
|
302
|
+
@include text2;
|
|
303
|
+
|
|
304
|
+
.o-icon {
|
|
305
|
+
--icon-size: 16px;
|
|
306
|
+
margin-left: var(--o-gap-2);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.content-container-mobile {
|
|
311
|
+
margin-top: var(--o-gap-3);
|
|
312
|
+
|
|
313
|
+
&:first-child {
|
|
314
|
+
margin-top: 8px;
|
|
315
|
+
}
|
|
316
|
+
&:last-child {
|
|
317
|
+
margin-bottom: 12px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.content-subtitle {
|
|
321
|
+
color: var(--o-color-info1);
|
|
322
|
+
display: flex;
|
|
323
|
+
align-items: center;
|
|
324
|
+
@include text2;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.content-tag {
|
|
328
|
+
margin-left: var(--o-gap-2);
|
|
329
|
+
--layout-pkg-radius: var(--o-radius-xs);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.desc-container {
|
|
333
|
+
overflow: hidden;
|
|
334
|
+
position: relative;
|
|
335
|
+
|
|
336
|
+
.item-desc {
|
|
337
|
+
color: var(--o-color-info2);
|
|
338
|
+
margin-top: var(--o-gap-1);
|
|
339
|
+
text-align: justify;
|
|
340
|
+
word-break: normal;
|
|
341
|
+
@include tip1;
|
|
342
|
+
@include text-truncate(2);
|
|
343
|
+
@include respond-to('phone') {
|
|
344
|
+
@include text1;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.header-tool {
|
|
352
|
+
position: absolute;
|
|
353
|
+
bottom: 36px;
|
|
354
|
+
left: 0;
|
|
355
|
+
width: 99px;
|
|
356
|
+
|
|
357
|
+
display: flex;
|
|
358
|
+
height: auto;
|
|
359
|
+
justify-content: center;
|
|
360
|
+
align-items: center;
|
|
361
|
+
flex-direction: column;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.header-tool-item {
|
|
365
|
+
width: 99px;
|
|
366
|
+
@include nav-item;
|
|
367
|
+
@include tip1;
|
|
368
|
+
@include respond-to('phone') {
|
|
369
|
+
@include text1;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
.other-tool {
|
|
373
|
+
width: 99px;
|
|
374
|
+
margin-top: 8px;
|
|
375
|
+
text-align: center;
|
|
376
|
+
}
|
|
377
|
+
</style>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import _OHeader from './OHeader.vue';
|
|
2
|
-
import
|
|
2
|
+
import _OHeaderMobile from './OHeaderMobile.vue';
|
|
3
3
|
import type { App } from 'vue';
|
|
4
4
|
|
|
5
5
|
const OHeader = Object.assign(_OHeader, {
|
|
6
6
|
install(app: App) {
|
|
7
|
-
app.component('
|
|
7
|
+
app.component('OHeader', _OHeader);
|
|
8
8
|
},
|
|
9
9
|
});
|
|
10
|
-
const
|
|
10
|
+
const OHeaderMobile = Object.assign(_OHeaderMobile, {
|
|
11
11
|
install(app: App) {
|
|
12
|
-
app.component('
|
|
12
|
+
app.component('OHeaderMobile', _OHeaderMobile);
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
export { OHeader,
|
|
16
|
+
export { OHeader, OHeaderMobile };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
type tagT = 'HOT' | 'NEW';
|
|
2
|
+
|
|
3
|
+
export enum NavType {
|
|
4
|
+
NAV = 'nav',
|
|
5
|
+
CODE = 'code',
|
|
6
|
+
LANG = 'lang',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ChildrenItemT {
|
|
10
|
+
label: string; // 标题
|
|
11
|
+
description?: string; // 描述
|
|
12
|
+
href?: string; // 链接
|
|
13
|
+
tag?: tagT; // 标签
|
|
14
|
+
children?: ChildrenItemT[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ShortcutItemT {
|
|
18
|
+
label: string; // 标题
|
|
19
|
+
description?: string; // 描述
|
|
20
|
+
picture?: string; // 缩略图
|
|
21
|
+
href?: string; // 链接
|
|
22
|
+
tag?: tagT; // 标签
|
|
23
|
+
remark?: string; // 时间
|
|
24
|
+
type?: string; // 类型
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface NavItemT {
|
|
28
|
+
label: string; // 标题
|
|
29
|
+
id: string; // id
|
|
30
|
+
href?: string; // 链接
|
|
31
|
+
withPicture: boolean; // 快捷链接是否显示缩略图
|
|
32
|
+
children: ChildrenItemT[]; // 导航子项
|
|
33
|
+
shortcut: ShortcutItemT[]; // 右侧快捷链接
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface CodeItemT {
|
|
37
|
+
label: string; // 标题
|
|
38
|
+
href: string; // 链接
|
|
39
|
+
icon?: string; // icon
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface LangItemT {
|
|
43
|
+
id: string; // id
|
|
44
|
+
label: string; // 全称
|
|
45
|
+
simple: string; // 简写
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface CodeT {
|
|
49
|
+
label: string; // 标题
|
|
50
|
+
list: CodeItemT[]; // 代码仓数据
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface LangT {
|
|
54
|
+
label: string; // 标题
|
|
55
|
+
list: LangItemT[]; // 语言数据
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface NavT {
|
|
59
|
+
logo: string; // 社区logo
|
|
60
|
+
community: string; // 社区 openEuler/openUBMC/mindspore
|
|
61
|
+
navData: NavItemT[];
|
|
62
|
+
bgLeft?: string; // 导航左侧背景插图
|
|
63
|
+
bgRight?: string; // 导航右侧背景插图
|
|
64
|
+
activeIndex: string | number; // 激活态
|
|
65
|
+
codeData?: CodeT[]; // 导航右侧代码仓数据
|
|
66
|
+
langData?: LangT[]; // 导航右侧语言数据
|
|
67
|
+
isSimpleHeader?: boolean; // 移动端二级导航
|
|
68
|
+
headerTitle?: string; // 移动端二级标题
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface NavLiT {
|
|
72
|
+
navData: NavItemT[];
|
|
73
|
+
activeIndex: string | number; // 激活态
|
|
74
|
+
hoverId: string | number; // hover态
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface NavLiItemT {
|
|
78
|
+
itemData: NavItemT;
|
|
79
|
+
itemVisible: boolean; // 下拉面板
|
|
80
|
+
community: string; // 社区 openEuler/openUBMC/mindspore
|
|
81
|
+
bgLeft?: string; // 导航左侧背景插图
|
|
82
|
+
bgRight?: string; // 导航右侧背景插图
|
|
83
|
+
hoverIndex: string | number; // hover态
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface NavMobileItemT {
|
|
87
|
+
menuShow: boolean; // 展开导航
|
|
88
|
+
navData: NavItemT[];
|
|
89
|
+
codeData?: CodeT[]; // 导航右侧代码仓数据
|
|
90
|
+
langData?: LangT[]; // 导航右侧语言数据
|
|
91
|
+
}
|
|
@@ -17,10 +17,10 @@ import OMeetingCalendarList from './components/OMeetingCalendarList.vue';
|
|
|
17
17
|
import IconEvent from '~icons/meeting/icon-event.svg';
|
|
18
18
|
import IconSummit from '~icons/meeting/icon-summit.svg';
|
|
19
19
|
import IconMeeting from '~icons/meeting/icon-meet.svg';
|
|
20
|
-
import { Locales
|
|
21
|
-
import {
|
|
22
|
-
import { CalendarDataType,
|
|
23
|
-
import { formatDate
|
|
20
|
+
import { Locales } from '@/i18n';
|
|
21
|
+
import { useMeetingConfig } from './composables/useMeetingConfig';
|
|
22
|
+
import { CalendarDataType, MeetingCalendarPropsT, MeetingGroupType } from './types.ts';
|
|
23
|
+
import { formatDate } from './utils.ts';
|
|
24
24
|
import { useDebounceFn } from '@vueuse/core';
|
|
25
25
|
|
|
26
26
|
const props = withDefaults(defineProps<MeetingCalendarPropsT>(), {
|
|
@@ -29,13 +29,13 @@ const props = withDefaults(defineProps<MeetingCalendarPropsT>(), {
|
|
|
29
29
|
hiddenEvents: false,
|
|
30
30
|
hiddenSummit: false,
|
|
31
31
|
groupType: MeetingGroupType.SIG,
|
|
32
|
+
groups: () => [],
|
|
32
33
|
});
|
|
33
|
-
|
|
34
|
-
const { t, locale } =
|
|
34
|
+
console.log(props);
|
|
35
|
+
const { t, locale, meetingTabs, getConfig } = useMeetingConfig();
|
|
35
36
|
const isEn = computed(() => locale.value === Locales.EN);
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
const latestDay = ref<string>(''); // 截止当天最新的活动日期
|
|
38
|
+
const latestDay = ref<string>('');
|
|
39
39
|
const dateList = ref([]);
|
|
40
40
|
const summitData = ref([]);
|
|
41
41
|
const summitDates = ref([]);
|
|
@@ -43,11 +43,10 @@ const eventsData = ref([]);
|
|
|
43
43
|
const eventsDates = ref([]);
|
|
44
44
|
const allDates = ref<string[]>([]);
|
|
45
45
|
const meetingData = ref([]);
|
|
46
|
-
// 日历展示时间限制
|
|
47
46
|
const limitTime = '2021-01-01';
|
|
48
|
-
const tabType = ref(
|
|
47
|
+
const tabType = ref(CalendarDataType.ALL);
|
|
49
48
|
const tabs = computed(() => {
|
|
50
|
-
let list =
|
|
49
|
+
let list = meetingTabs.value;
|
|
51
50
|
if (props.hiddenEvents) {
|
|
52
51
|
list = list.filter((item) => item.value !== CalendarDataType.EVENTS);
|
|
53
52
|
}
|
|
@@ -69,8 +68,7 @@ const isLimit = ref(false);
|
|
|
69
68
|
const currentDay = ref('');
|
|
70
69
|
const isAutoClick = ref(false);
|
|
71
70
|
// sig组列表
|
|
72
|
-
const
|
|
73
|
-
const sigOptions = ref<GroupItemT[]>([]);
|
|
71
|
+
const group = ref('');
|
|
74
72
|
const getSummitData = async (date) => {
|
|
75
73
|
if (props.getSummitListRequest) {
|
|
76
74
|
const list = await props.getSummitListRequest(date);
|
|
@@ -78,7 +76,7 @@ const getSummitData = async (date) => {
|
|
|
78
76
|
return {
|
|
79
77
|
|
|
80
78
|
...v,
|
|
81
|
-
type:
|
|
79
|
+
type: CalendarDataType.SUMMIT,
|
|
82
80
|
};
|
|
83
81
|
});
|
|
84
82
|
} else {
|
|
@@ -91,7 +89,7 @@ const getActivityData = async (date) => {
|
|
|
91
89
|
eventsData.value = (list || []).map(v => {
|
|
92
90
|
return {
|
|
93
91
|
...v,
|
|
94
|
-
type:
|
|
92
|
+
type: CalendarDataType.EVENTS,
|
|
95
93
|
start_date_time: `${ formatDate(v.start_date) } ${ v.start }`,
|
|
96
94
|
end_date_time: `${ formatDate(v.end_date) } ${ v.end }`,
|
|
97
95
|
};
|
|
@@ -127,7 +125,7 @@ const paramGetDaysData = async (params: { date: string; type: string }) => {
|
|
|
127
125
|
return;
|
|
128
126
|
}
|
|
129
127
|
try {
|
|
130
|
-
const res = await props.getMeetingListRequest(params.date,
|
|
128
|
+
const res = await props.getMeetingListRequest(params.date, group.value);
|
|
131
129
|
meetingData.value = res.map((v) => {
|
|
132
130
|
return {
|
|
133
131
|
...v,
|
|
@@ -138,11 +136,6 @@ const paramGetDaysData = async (params: { date: string; type: string }) => {
|
|
|
138
136
|
}).sort((a: any, b: any) => {
|
|
139
137
|
return parseInt((a.start || a.cycle_start)?.replace(':', '')) - parseInt(b.end || b.cycle_end?.replace(':', ''));
|
|
140
138
|
});
|
|
141
|
-
|
|
142
|
-
sigOptions.value = [...new Set(meetingData.value.map((v) => v.group_name))].map((v) => ({ group_name: v }));
|
|
143
|
-
if (!sigOptions.value.find((v) => v.group_name === sig.value)) {
|
|
144
|
-
sig.value = '';
|
|
145
|
-
}
|
|
146
139
|
} catch {
|
|
147
140
|
meetingData.value = [];
|
|
148
141
|
}
|
|
@@ -150,7 +143,7 @@ const paramGetDaysData = async (params: { date: string; type: string }) => {
|
|
|
150
143
|
|
|
151
144
|
const renderData = computed(() => {
|
|
152
145
|
return [
|
|
153
|
-
...meetingData.value
|
|
146
|
+
...meetingData.value,
|
|
154
147
|
...eventsData.value.filter(v => (!dayjs(v.start_date).isAfter(dayjs(currentDay.value)) && !dayjs(currentDay.value).isAfter(dayjs(v.end_date))) || v.dates?.includes(currentDay.value)),
|
|
155
148
|
...summitData.value.filter(v => v.dates?.includes(currentDay.value)),
|
|
156
149
|
].filter((v) => {
|
|
@@ -188,20 +181,6 @@ const getDateData = async (day?: string) => {
|
|
|
188
181
|
});
|
|
189
182
|
};
|
|
190
183
|
|
|
191
|
-
watch([() => tabType.value, () => tabs.value], () => {
|
|
192
|
-
selectTab();
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
// 活动会议筛选
|
|
196
|
-
function selectTab() {
|
|
197
|
-
nextTick(() => {
|
|
198
|
-
paramGetDaysData({
|
|
199
|
-
date: currentDay.value,
|
|
200
|
-
type: tabType.value,
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
|
|
205
184
|
const changeMeetingDay = useDebounceFn((day: string, event?: Event) => {
|
|
206
185
|
if (isAutoClick.value) {
|
|
207
186
|
isAutoClick.value = false;
|
|
@@ -224,6 +203,14 @@ const selectDate = (val: string, date: string) => {
|
|
|
224
203
|
calendar.value.selectDate(val);
|
|
225
204
|
changeMeetingDay(formatDate(calendar.value.selectedDay));
|
|
226
205
|
};
|
|
206
|
+
const changeGroup = () => {
|
|
207
|
+
nextTick(() => {
|
|
208
|
+
paramGetDaysData({
|
|
209
|
+
date: currentDay.value,
|
|
210
|
+
type: tabType.value,
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
};
|
|
227
214
|
|
|
228
215
|
const removeLeadingZero = (str: string) => {
|
|
229
216
|
// 使用正则表达式匹配以 0 开头的字符串,然后去除开头的 0
|
|
@@ -304,11 +291,12 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
|
|
|
304
291
|
</OIcon>
|
|
305
292
|
</div>
|
|
306
293
|
<OSelect
|
|
307
|
-
v-model="
|
|
308
|
-
:placeholder="groupType === MeetingGroupType.GROUP ?
|
|
294
|
+
v-model="group"
|
|
295
|
+
:placeholder="t(groupType === MeetingGroupType.GROUP ? 'meeting.allGroups' : 'meeting.allSigs')"
|
|
309
296
|
clearable
|
|
297
|
+
@change="changeGroup"
|
|
310
298
|
>
|
|
311
|
-
<OOption v-for="t in
|
|
299
|
+
<OOption v-for="t in groups" :value="t" :key="t">{{ t }}</OOption>
|
|
312
300
|
</OSelect>
|
|
313
301
|
</div>
|
|
314
302
|
|
|
@@ -364,8 +352,13 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
|
|
|
364
352
|
</div>
|
|
365
353
|
<div class="right-title">
|
|
366
354
|
<div class="title-list">
|
|
367
|
-
<OSelect
|
|
368
|
-
|
|
355
|
+
<OSelect
|
|
356
|
+
v-model="group"
|
|
357
|
+
:placeholder="t(groupType === MeetingGroupType.GROUP ? 'meeting.allGroups' : 'meeting.allSigs')"
|
|
358
|
+
clearable
|
|
359
|
+
@change="changeGroup"
|
|
360
|
+
>
|
|
361
|
+
<OOption v-for="t in groups" :value="t" :key="t">{{ t }}</OOption>
|
|
369
362
|
</OSelect>
|
|
370
363
|
<OTab v-model="tabType" :line="false">
|
|
371
364
|
<OTabPane v-for="item in tabs" :key="item.value" :value="item.value">
|
|
@@ -451,6 +444,7 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
|
|
|
451
444
|
padding: 0 var(--o-gap-6);
|
|
452
445
|
gap: var(--o-gap-6);
|
|
453
446
|
border-bottom: 1px solid var(--o-color-control4);
|
|
447
|
+
background: var(--o-color-fill2);
|
|
454
448
|
@include respond-to('<=pad_v') {
|
|
455
449
|
justify-content: center;
|
|
456
450
|
border-bottom: none;
|
|
@@ -475,7 +469,11 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
|
|
|
475
469
|
display: flex;
|
|
476
470
|
align-items: center;
|
|
477
471
|
flex-shrink: 0;
|
|
472
|
+
color: var(--o-color-info1);
|
|
478
473
|
@include text2;
|
|
474
|
+
@include respond-to('<=pad_v') {
|
|
475
|
+
@include h3;
|
|
476
|
+
}
|
|
479
477
|
|
|
480
478
|
.o-icon {
|
|
481
479
|
cursor: pointer;
|
|
@@ -504,6 +502,7 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
|
|
|
504
502
|
padding: 0 var(--o-gap-6) var(--o-gap-6);
|
|
505
503
|
border-right: 1px solid var(--o-color-control4);
|
|
506
504
|
margin-bottom: 0;
|
|
505
|
+
background: var(--o-color-fill2);
|
|
507
506
|
|
|
508
507
|
thead {
|
|
509
508
|
th {
|
|
@@ -778,13 +777,10 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
|
|
|
778
777
|
}
|
|
779
778
|
|
|
780
779
|
.current-day {
|
|
780
|
+
color: var(--o-color-info2);
|
|
781
781
|
@include respond-to('>pad_v') {
|
|
782
|
-
|
|
783
782
|
display: none;
|
|
784
783
|
}
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
.current-day {
|
|
788
784
|
@include respond-to('<=pad_v') {
|
|
789
785
|
display: flex;
|
|
790
786
|
margin: 16px 16px 12px;
|