@opendesign-plus-test/components 0.0.1-rc.60 → 0.0.1-rc.62
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 +150 -150
- package/dist/components/activity/OActivityApproval.vue.d.ts +8 -8
- package/dist/components/activity/OActivityForm.vue.d.ts +6 -6
- package/dist/components/activity/OActivityMyCalendar.vue.d.ts +2 -2
- package/dist/components/activity/index.d.ts +14 -14
- package/dist/components/banner/OBanner.vue.d.ts +13 -0
- package/dist/components/banner/OBannerContent.vue.d.ts +7 -0
- package/dist/components/banner/index.d.ts +68 -0
- package/dist/components/banner/types.d.ts +31 -0
- package/dist/components/{OPlusConfigProvider.vue.d.ts → config-provider/OPlusConfigProvider.vue.d.ts} +2 -2
- package/dist/components/config-provider/index.d.ts +27 -0
- package/dist/components/cookie-notice/OCookieNotice.vue.d.ts +17 -0
- package/dist/components/cookie-notice/index.d.ts +53 -0
- package/dist/components/{OFooter.vue.d.ts → footer/OFooter.vue.d.ts} +3 -3
- package/dist/components/footer/index.d.ts +89 -0
- package/dist/components/header/OHeaderLanguageSwitcher.vue.d.ts +49 -0
- package/dist/components/{OHeaderSearch.vue.d.ts → header/OHeaderSearch.vue.d.ts} +145 -145
- package/dist/components/header/OHeaderSourceCode.vue.d.ts +18 -0
- package/dist/components/header/OHeaderTheme.vue.d.ts +25 -0
- package/dist/components/{OHeaderUser.vue.d.ts → header/OHeaderUser.vue.d.ts} +6 -6
- package/dist/components/header/index.d.ts +805 -1
- package/dist/components/header/types.d.ts +1 -0
- package/dist/components/meeting/OMeetingForm.vue.d.ts +4 -6
- package/dist/components/meeting/OMeetingMyCalendar.vue.d.ts +2 -2
- package/dist/components/meeting/OMeetingPlayback.vue.d.ts +4 -4
- package/dist/components/meeting/components/OMeetingCalendarSelector.vue.d.ts +1 -1
- package/dist/components/meeting/components/OMeetingPlaybackVideo.vue.d.ts +1 -1
- package/dist/components/meeting/index.d.ts +7 -13
- package/dist/components/meeting/types.d.ts +2 -4
- package/dist/components/search/OSearchInput.vue.d.ts +34 -34
- package/dist/components/search/index.d.ts +22 -22
- package/dist/components/search/internal/SearchImageInput.vue.d.ts +21 -21
- package/dist/components/search/internal/SearchPanel.vue.d.ts +1 -1
- package/dist/components/{OSection.vue.d.ts → section/OSection.vue.d.ts} +4 -4
- package/dist/components/section/index.d.ts +47 -0
- package/dist/components.cjs.js +38 -38
- package/dist/components.css +1 -1
- package/dist/components.es.js +16822 -16615
- package/dist/index.d.ts +5 -14
- package/docs/design.md +2 -2
- package/package.json +3 -3
- package/scripts/generate-components-index.js +2 -44
- package/src/components/activity/OActivityMyCalendar.vue +1 -1
- package/src/components/banner/OBanner.vue +288 -0
- package/src/components/banner/OBannerContent.vue +175 -0
- package/src/components/banner/index.ts +18 -0
- package/src/components/banner/types.ts +39 -0
- package/src/components/common/ClientOnly.vue +13 -0
- package/src/components/{OPlusConfigProvider.vue → config-provider/OPlusConfigProvider.vue} +2 -2
- package/src/components/config-provider/index.ts +10 -0
- package/src/components/{OCookieNotice.vue → cookie-notice/OCookieNotice.vue} +1 -1
- package/src/components/cookie-notice/index.ts +10 -0
- package/src/components/element-plus/OElCookieNotice.vue +1 -1
- package/src/components/events/OEventsApply.vue +87 -1
- package/src/components/events/OEventsList.vue +47 -2
- package/src/components/{OFooter.vue → footer/OFooter.vue} +4 -4
- package/src/components/footer/index.ts +10 -0
- package/src/components/header/OHeaderLanguageSwitcher.vue +211 -0
- package/src/components/{OHeaderSearch.vue → header/OHeaderSearch.vue} +5 -5
- package/src/components/{OSourceCode.vue → header/OHeaderSourceCode.vue} +2 -2
- package/src/components/{OThemeSwitcher.vue → header/OHeaderTheme.vue} +4 -4
- package/src/components/{OHeaderUser.vue → header/OHeaderUser.vue} +4 -4
- package/src/components/header/index.ts +38 -1
- package/src/components/header/types.ts +1 -0
- package/src/components/meeting/OMeetingCalendar.vue +23 -4
- package/src/components/meeting/OMeetingForm.vue +21 -13
- package/src/components/meeting/OMeetingMyCalendar.vue +3 -9
- package/src/components/meeting/components/OMeetingCalendarList.vue +7 -2
- package/src/components/meeting/components/OMeetingDetail.vue +17 -3
- package/src/components/meeting/types.ts +2 -4
- package/src/components/search/OSearchInput.vue +1 -1
- package/src/components/{OSection.vue → section/OSection.vue} +1 -1
- package/src/components/section/index.ts +10 -0
- package/src/i18n/en.ts +1 -1
- package/src/i18n/zh.ts +3 -1
- package/src/index.ts +5 -38
- package/dist/components/OBanner.vue.d.ts +0 -11
- package/dist/components/OCookieNotice.vue.d.ts +0 -17
- package/dist/components/OSourceCode.vue.d.ts +0 -18
- package/dist/components/OThemeSwitcher.vue.d.ts +0 -25
- package/src/components/OBanner.vue +0 -398
- package/src/components/common/ClientOnlyWrapper.ts +0 -21
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import { default as OBanner } from './components/OBanner.vue';
|
|
2
|
-
import { default as OCookieNotice } from './components/OCookieNotice.vue';
|
|
3
|
-
import { default as OFooter } from './components/OFooter.vue';
|
|
4
|
-
import { default as OHeaderSearch } from './components/OHeaderSearch.vue';
|
|
5
|
-
import { default as OHeaderUser } from './components/OHeaderUser.vue';
|
|
6
|
-
import { default as OPlusConfigProvider } from './components/OPlusConfigProvider.vue';
|
|
7
|
-
import { default as OSection } from './components/OSection.vue';
|
|
8
|
-
import { default as OSourceCode } from './components/OSourceCode.vue';
|
|
9
|
-
import { default as OThemeSwitcher } from './components/OThemeSwitcher.vue';
|
|
10
|
-
export { OBanner, OCookieNotice, OFooter, OHeaderSearch, OHeaderUser, OPlusConfigProvider, OSection, OSourceCode, OThemeSwitcher };
|
|
11
1
|
export * from './components/activity';
|
|
2
|
+
export * from './components/banner';
|
|
3
|
+
export * from './components/config-provider';
|
|
4
|
+
export * from './components/cookie-notice';
|
|
12
5
|
export * from './components/element-plus';
|
|
13
6
|
export * from './components/events';
|
|
7
|
+
export * from './components/footer';
|
|
14
8
|
export * from './components/header';
|
|
15
9
|
export * from './components/meeting';
|
|
16
10
|
export * from './components/search';
|
|
17
|
-
|
|
18
|
-
install: (app: any) => void;
|
|
19
|
-
};
|
|
20
|
-
export default _default;
|
|
11
|
+
export * from './components/section';
|
package/docs/design.md
CHANGED
|
@@ -21,7 +21,7 @@ components
|
|
|
21
21
|
| openEuler社区页头| OHeader_openEuler.vue | 11月完成 ||
|
|
22
22
|
| openEuler社区页脚| OFooter_openEuler.vue | 11月完成 ||
|
|
23
23
|
| 悬浮按钮| OFloatingButton.vue | 11月完成 ||
|
|
24
|
-
| 语言切换|
|
|
25
|
-
| 风格切换|
|
|
24
|
+
| 语言切换| OHeaderLanguageSwitcher.vue | 11月完成 |调用useLocale的能力|
|
|
25
|
+
| 风格切换| OHeaderTheme.vue | 11月完成 |调用useTheme的能力|
|
|
26
26
|
| 导航用户信息| OUserInfo.vue | 11月完成 |调用useLogin的能力|
|
|
27
27
|
| 隐私管理| OCookieNotice.vue | 11月完成 ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opendesign-plus-test/components",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.62",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"dayjs": "^1.11.13",
|
|
33
33
|
"video.js": "^8.23.7",
|
|
34
34
|
"vue-dompurify-html": "^3.1.2",
|
|
35
|
-
"@opendesign-plus/
|
|
36
|
-
"@opendesign-plus/
|
|
35
|
+
"@opendesign-plus/composables": "0.0.1-rc.8",
|
|
36
|
+
"@opendesign-plus/styles": "0.0.1-rc.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@vitejs/plugin-vue": "^5.1.0",
|
|
@@ -17,11 +17,6 @@ function generateComponentsIndex() {
|
|
|
17
17
|
// 读取组件目录
|
|
18
18
|
const files = fs.readdirSync(componentsDir);
|
|
19
19
|
|
|
20
|
-
// 过滤出.vue文件(不包含子目录)
|
|
21
|
-
const vueFiles = files.filter(file =>
|
|
22
|
-
file.endsWith('.vue') && !fs.statSync(path.join(componentsDir, file)).isDirectory()
|
|
23
|
-
);
|
|
24
|
-
|
|
25
20
|
// 扫描子目录,查找包含 index.ts 的目录
|
|
26
21
|
const subDirs = files.filter(file => {
|
|
27
22
|
const fullPath = path.join(componentsDir, file)
|
|
@@ -29,59 +24,22 @@ function generateComponentsIndex() {
|
|
|
29
24
|
fs.existsSync(path.join(fullPath, 'index.ts'))
|
|
30
25
|
})
|
|
31
26
|
|
|
32
|
-
console.log(`发现 ${ vueFiles.length } 个组件文件`)
|
|
33
27
|
console.log(`发现 ${ subDirs.length } 个子目录: ${ subDirs.join(', ') }`)
|
|
34
28
|
|
|
35
|
-
// 生成 .vue 文件的导入语句
|
|
36
|
-
const vueImportStatements = vueFiles.map(file => {
|
|
37
|
-
const componentName = file.replace('.vue', '');
|
|
38
|
-
return `import ${componentName} from './components/${file}';`;
|
|
39
|
-
}).join('\n');
|
|
40
|
-
|
|
41
29
|
// 生成子目录的重新导出语句
|
|
42
30
|
const subDirExportStatements = subDirs.map(dir => {
|
|
43
31
|
return `export * from './components/${ dir }';`
|
|
44
32
|
}).join('\n')
|
|
45
33
|
|
|
46
|
-
// 生成组件列表
|
|
47
|
-
const componentNames = vueFiles.map(file => file.replace('.vue', ''));
|
|
48
|
-
const componentsObject = componentNames.map(name => ` ${name}`).join(',\n');
|
|
49
|
-
|
|
50
|
-
// 生成导出语句
|
|
51
|
-
const exportStatement = componentNames.length > 0
|
|
52
|
-
? `export { ${ componentNames.join(', ') } };`
|
|
53
|
-
: ''
|
|
54
|
-
|
|
55
34
|
// 生成完整的index.ts内容
|
|
56
35
|
const indexContent = `// OpenDesignPlus Components 库入口文件
|
|
57
36
|
// 此文件由 scripts/generate-components-index.js 自动生成
|
|
37
|
+
${ subDirExportStatements }
|
|
38
|
+
`.trim();
|
|
58
39
|
|
|
59
|
-
${ vueImportStatements }
|
|
60
|
-
|
|
61
|
-
${ componentsObject.length > 0 ? `// 导出组件
|
|
62
|
-
const components = {
|
|
63
|
-
${componentsObject}
|
|
64
|
-
};` : '' }
|
|
65
|
-
|
|
66
|
-
${ exportStatement ? `// 导出单个组件\n${ exportStatement }` : '' }
|
|
67
|
-
|
|
68
|
-
${ subDirExportStatements ? `// 重新导出子目录中的组件\n${ subDirExportStatements }` : '' }
|
|
69
|
-
|
|
70
|
-
// 默认导出(用于Vue插件安装)
|
|
71
|
-
export default {
|
|
72
|
-
install: (app: any) => {
|
|
73
|
-
${ componentsObject.length > 0 ? `// 注册所有组件
|
|
74
|
-
Object.entries(components).forEach(([name, component]) => {
|
|
75
|
-
app.component(name, component);
|
|
76
|
-
});` : '' }
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
`;
|
|
80
|
-
|
|
81
40
|
// 写入文件
|
|
82
41
|
fs.writeFileSync(indexFilePath, indexContent, 'utf-8');
|
|
83
42
|
console.log(`组件索引文件已生成: ${indexFilePath}`);
|
|
84
|
-
console.log(`成功导出 ${ componentNames.length } 个 .vue 组件`)
|
|
85
43
|
if (subDirs.length > 0) {
|
|
86
44
|
console.log(`成功重新导出 ${ subDirs.length } 个子目录: ${ subDirs.join(', ') }`)
|
|
87
45
|
}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { OCarousel, OCarouselItem, OFigure } from '@opensig/opendesign';
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
|
|
5
|
+
import { useScreen, useTheme } from '@opendesign-plus/composables';
|
|
6
|
+
import ContentWrapper from '../common/ContentWrapper.vue';
|
|
7
|
+
import BannerContent from './OBannerContent.vue';
|
|
8
|
+
import type { BannerItem } from './types';
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
options?: BannerItem | BannerItem[];
|
|
12
|
+
size?: 'large' | 'medium' | 'small' | 'tiny';
|
|
13
|
+
contentJustifyCenter?: boolean;
|
|
14
|
+
autoPlay?: boolean;
|
|
15
|
+
}>();
|
|
16
|
+
|
|
17
|
+
const emit = defineEmits<{
|
|
18
|
+
(e: 'click', href: string | undefined): void;
|
|
19
|
+
}>();
|
|
20
|
+
|
|
21
|
+
const { isLight } = useTheme();
|
|
22
|
+
const { isPhone } = useScreen();
|
|
23
|
+
|
|
24
|
+
// 单个 Banner(非数组,或仅含一项的数组)
|
|
25
|
+
const singleBanner = computed((): BannerItem | undefined => {
|
|
26
|
+
if (!props.options) return undefined;
|
|
27
|
+
if (Array.isArray(props.options)) {
|
|
28
|
+
return props.options.length === 1 ? props.options[0] : undefined;
|
|
29
|
+
}
|
|
30
|
+
return props.options;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// 多个 Banner(数组且超过一项)
|
|
34
|
+
const multiBanner = computed((): BannerItem[] | undefined => {
|
|
35
|
+
if (!Array.isArray(props.options) || props.options.length <= 1) return undefined;
|
|
36
|
+
return props.options;
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<div :class="['home-banner', size]">
|
|
42
|
+
<!-- 单个 Banner 的情况 -->
|
|
43
|
+
<div v-if="singleBanner" class="content-height">
|
|
44
|
+
<div v-if="size === 'tiny'">
|
|
45
|
+
{{ singleBanner.title }}
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<BannerContent
|
|
49
|
+
v-else-if="!isPhone"
|
|
50
|
+
:info="singleBanner"
|
|
51
|
+
:size="size"
|
|
52
|
+
:content-justify-center="contentJustifyCenter"
|
|
53
|
+
:is-phone="isPhone"
|
|
54
|
+
:is-light="isLight"
|
|
55
|
+
@click="emit('click', $event)"
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
<ContentWrapper v-else class="banner-wrapper">
|
|
59
|
+
<OFigure
|
|
60
|
+
class="banner-bg"
|
|
61
|
+
:src="singleBanner.bg"
|
|
62
|
+
fit="cover"
|
|
63
|
+
/>
|
|
64
|
+
</ContentWrapper>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<!-- 多个 Banner 轮播的情况 -->
|
|
68
|
+
<div v-else-if="multiBanner" class="content-height">
|
|
69
|
+
<OCarousel
|
|
70
|
+
v-if="!isPhone"
|
|
71
|
+
class="banner-carousel"
|
|
72
|
+
effect="toggle"
|
|
73
|
+
active-class="current-slide"
|
|
74
|
+
indicator-click
|
|
75
|
+
:auto-play="autoPlay"
|
|
76
|
+
>
|
|
77
|
+
<OCarouselItem
|
|
78
|
+
v-for="(info, index) in multiBanner"
|
|
79
|
+
:key="index"
|
|
80
|
+
class="banner-item"
|
|
81
|
+
:class="`banner-item${index}`"
|
|
82
|
+
>
|
|
83
|
+
<BannerContent
|
|
84
|
+
:info="info"
|
|
85
|
+
:size="size"
|
|
86
|
+
:content-justify-center="contentJustifyCenter"
|
|
87
|
+
:is-phone="isPhone"
|
|
88
|
+
:is-light="isLight"
|
|
89
|
+
@click="emit('click', $event)"
|
|
90
|
+
/>
|
|
91
|
+
</OCarouselItem>
|
|
92
|
+
</OCarousel>
|
|
93
|
+
|
|
94
|
+
<OCarousel
|
|
95
|
+
v-else
|
|
96
|
+
class="banner-carousel"
|
|
97
|
+
effect="gallery"
|
|
98
|
+
indicator-click
|
|
99
|
+
arrow="never"
|
|
100
|
+
:auto-play="autoPlay"
|
|
101
|
+
>
|
|
102
|
+
<OCarouselItem
|
|
103
|
+
v-for="(info, index) in multiBanner"
|
|
104
|
+
:key="index"
|
|
105
|
+
class="banner-item"
|
|
106
|
+
:class="`banner-item${index}`"
|
|
107
|
+
>
|
|
108
|
+
<ContentWrapper class="banner-wrapper">
|
|
109
|
+
<OFigure
|
|
110
|
+
class="banner-bg"
|
|
111
|
+
:src="info.bg"
|
|
112
|
+
@click="emit('click', info.href)"
|
|
113
|
+
/>
|
|
114
|
+
</ContentWrapper>
|
|
115
|
+
</OCarouselItem>
|
|
116
|
+
</OCarousel>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
<!-- 没有 Banner 数据的情况 -->
|
|
120
|
+
<div v-else class="content-height">
|
|
121
|
+
<p>No data.</p>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</template>
|
|
125
|
+
|
|
126
|
+
<style lang="scss" scoped>
|
|
127
|
+
.home-banner {
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
position: relative;
|
|
130
|
+
|
|
131
|
+
&.tiny {
|
|
132
|
+
@include display2;
|
|
133
|
+
font-weight: 500;
|
|
134
|
+
margin: var(--o-gap-8) 0;
|
|
135
|
+
color: var(--o-color-info1);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.content-height {
|
|
139
|
+
height: 100%;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&.large {
|
|
143
|
+
--banner-height: 460px;
|
|
144
|
+
height: var(--banner-height);
|
|
145
|
+
|
|
146
|
+
@include respond-to('laptop-pc_s') {
|
|
147
|
+
--banner-height: 400px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@include respond-to('pad_h') {
|
|
151
|
+
--banner-height: 360px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@include respond-to('<=pad_v') {
|
|
155
|
+
--banner-height: 184px;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&.medium {
|
|
160
|
+
--banner-height: 360px;
|
|
161
|
+
height: var(--banner-height);
|
|
162
|
+
|
|
163
|
+
@include respond-to('laptop-pc_s') {
|
|
164
|
+
--banner-height: 280px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@include respond-to('pad_h') {
|
|
168
|
+
--banner-height: 220px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@include respond-to('<=pad_v') {
|
|
172
|
+
--banner-height: 120px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&.small {
|
|
177
|
+
--banner-height: 280px;
|
|
178
|
+
height: var(--banner-height);
|
|
179
|
+
|
|
180
|
+
@include respond-to('laptop-pc_s') {
|
|
181
|
+
--banner-height: 220px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@include respond-to('pad_h') {
|
|
185
|
+
--banner-height: 180px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@include respond-to('<=pad_v') {
|
|
189
|
+
display: none;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:deep(.o-btn) {
|
|
194
|
+
border-radius: var(--btn-height);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.banner-carousel {
|
|
199
|
+
width: 100%;
|
|
200
|
+
height: 100%;
|
|
201
|
+
@include respond-to('>pad_v') {
|
|
202
|
+
--carousel-indicator-offset: 53px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@include respond-to('<=pad_v') {
|
|
206
|
+
--carousel-indicator-offset: 1px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
:deep(.o-carousel-indicator-bar) {
|
|
210
|
+
height: 24px;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.banner-item {
|
|
215
|
+
width: 100%;
|
|
216
|
+
height: 100%;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@keyframes fade-up {
|
|
220
|
+
from {
|
|
221
|
+
transform: translateY(var(--d));
|
|
222
|
+
opacity: 0;
|
|
223
|
+
}
|
|
224
|
+
to {
|
|
225
|
+
transform: translateY(0);
|
|
226
|
+
opacity: 1;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.current-slide {
|
|
231
|
+
.banner-title {
|
|
232
|
+
animation: fade-up 400ms ease-in;
|
|
233
|
+
}
|
|
234
|
+
.banner-subtitle {
|
|
235
|
+
animation: fade-up 400ms ease-in;
|
|
236
|
+
}
|
|
237
|
+
.banner-text {
|
|
238
|
+
animation: fade-up 400ms ease-in;
|
|
239
|
+
}
|
|
240
|
+
.banner-opts {
|
|
241
|
+
animation: fade-up 400ms ease-in;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
</style>
|
|
245
|
+
|
|
246
|
+
<style lang="scss" scoped>
|
|
247
|
+
// 定制修改item1
|
|
248
|
+
.banner-item0 {
|
|
249
|
+
.banner-attach {
|
|
250
|
+
height: 120px;
|
|
251
|
+
|
|
252
|
+
@include respond-to('pad') {
|
|
253
|
+
height: 80px;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.banner-item1 {
|
|
259
|
+
.banner-attach {
|
|
260
|
+
height: 156px;
|
|
261
|
+
|
|
262
|
+
@include respond-to('pad') {
|
|
263
|
+
height: 120px;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// 定制修改item2
|
|
269
|
+
.banner-item2 {
|
|
270
|
+
.banner-content {
|
|
271
|
+
width: 100%;
|
|
272
|
+
justify-content: center;
|
|
273
|
+
}
|
|
274
|
+
.banner-attach {
|
|
275
|
+
height: 38%;
|
|
276
|
+
margin-top: -60px;
|
|
277
|
+
object-fit: contain;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.banner-wrapper {
|
|
282
|
+
height: 100%;
|
|
283
|
+
|
|
284
|
+
.banner-bg {
|
|
285
|
+
height: 100%;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
</style>
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { OButton, OFigure } from '@opensig/opendesign';
|
|
3
|
+
import ContentWrapper from '../common/ContentWrapper.vue';
|
|
4
|
+
import type { BannerContentProps } from './types';
|
|
5
|
+
|
|
6
|
+
defineProps<BannerContentProps>();
|
|
7
|
+
|
|
8
|
+
// 内联定义 emits 类型
|
|
9
|
+
const emit = defineEmits<{
|
|
10
|
+
(e: 'click', href: string | undefined): void;
|
|
11
|
+
}>();
|
|
12
|
+
|
|
13
|
+
const onClick = (href: string | undefined, hasBtn: string | undefined) => {
|
|
14
|
+
if (href && !hasBtn) {
|
|
15
|
+
window.open(href);
|
|
16
|
+
emit('click', href);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<OFigure
|
|
23
|
+
class="banner-bg"
|
|
24
|
+
:src="info.bg"
|
|
25
|
+
:class="{
|
|
26
|
+
'with-sticky-bg': info.withStickyBg,
|
|
27
|
+
'cursor-pointer': info.href && !info.btn,
|
|
28
|
+
}"
|
|
29
|
+
:style="{
|
|
30
|
+
'--pad-offset': info.pad_offset,
|
|
31
|
+
}"
|
|
32
|
+
@click="onClick(info.href, info.btn)"
|
|
33
|
+
>
|
|
34
|
+
<ContentWrapper class="banner-wrapper" :class="['banner-wrapper', contentJustifyCenter ? 'content-center' : '']">
|
|
35
|
+
<div class="banner-content">
|
|
36
|
+
<img v-if="!isPhone && info.attach" :src="info.attach" class="banner-attach" />
|
|
37
|
+
|
|
38
|
+
<!-- 标题 -->
|
|
39
|
+
<div
|
|
40
|
+
:class="{
|
|
41
|
+
'banner-title': true,
|
|
42
|
+
'text-dark': info.text_theme === 'dark'
|
|
43
|
+
}"
|
|
44
|
+
v-if="info.title"
|
|
45
|
+
>
|
|
46
|
+
{{ info.title }}
|
|
47
|
+
</div>
|
|
48
|
+
<!-- 副标题 -->
|
|
49
|
+
<div
|
|
50
|
+
:class="{
|
|
51
|
+
'banner-subtitle': true,
|
|
52
|
+
'text-dark': info.text_theme === 'dark'
|
|
53
|
+
}"
|
|
54
|
+
v-if="info.subtitle"
|
|
55
|
+
>
|
|
56
|
+
{{ info.subtitle }}
|
|
57
|
+
</div>
|
|
58
|
+
<div
|
|
59
|
+
class="banner-text"
|
|
60
|
+
v-if="info.bg_text"
|
|
61
|
+
:style="{
|
|
62
|
+
backgroundImage: `url(${info.bg_text})`,
|
|
63
|
+
'--pc-width': info.pc_text_width,
|
|
64
|
+
'--pc-height': info.pc_text_height,
|
|
65
|
+
'--pad-width': info.pad_text_width,
|
|
66
|
+
'--pad-height': info.pad_text_height,
|
|
67
|
+
}"
|
|
68
|
+
></div>
|
|
69
|
+
<!-- 操作按钮 -->
|
|
70
|
+
<div v-if="info.btn" class="banner-opts">
|
|
71
|
+
<OButton
|
|
72
|
+
:href="info.href"
|
|
73
|
+
target="_blank"
|
|
74
|
+
variant="solid"
|
|
75
|
+
color="primary"
|
|
76
|
+
:size="size === 'tiny' ? undefined : size"
|
|
77
|
+
>
|
|
78
|
+
{{ info.btn }}
|
|
79
|
+
</OButton>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</ContentWrapper>
|
|
83
|
+
</OFigure>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<style lang="scss" scoped>
|
|
87
|
+
.banner-bg {
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 100%;
|
|
90
|
+
|
|
91
|
+
:deep(.o-figure-img) {
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 100%;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@include respond-to('pad') {
|
|
97
|
+
:deep(.o-figure-img) {
|
|
98
|
+
transition: object-position 0.3s ease;
|
|
99
|
+
object-position: var(--pad-offset);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@include respond-to('phone') {
|
|
104
|
+
--figure-radius: 4px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.banner-wrapper {
|
|
109
|
+
height: 100%;
|
|
110
|
+
|
|
111
|
+
&.content-center {
|
|
112
|
+
display: flex;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
|
|
115
|
+
& .banner-content {
|
|
116
|
+
align-items: center;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.banner-content {
|
|
122
|
+
height: 100%;
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
position: relative;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.banner-title {
|
|
130
|
+
@include display1;
|
|
131
|
+
color: var(--o-color-info1);
|
|
132
|
+
font-weight: 500;
|
|
133
|
+
margin-bottom: 8px;
|
|
134
|
+
|
|
135
|
+
&.text-dark {
|
|
136
|
+
color: var(--o-color-info1-inverse);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@include respond-to('<=pad_v') {
|
|
140
|
+
font-size: 22px;
|
|
141
|
+
line-height: 30px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.banner-subtitle {
|
|
146
|
+
color: var(--o-color-info1);
|
|
147
|
+
margin-top: 8px;
|
|
148
|
+
font-size: 16px;
|
|
149
|
+
|
|
150
|
+
&.text-dark {
|
|
151
|
+
color: var(--o-color-info1-inverse);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.banner-text {
|
|
156
|
+
height: var(--pc-height);
|
|
157
|
+
width: var(--pc-width);
|
|
158
|
+
background-size: contain;
|
|
159
|
+
background-repeat: no-repeat;
|
|
160
|
+
|
|
161
|
+
@include respond-to('pad') {
|
|
162
|
+
height: var(--pad-height);
|
|
163
|
+
width: var(--pad-width);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.banner-opts {
|
|
168
|
+
margin-top: 24px;
|
|
169
|
+
--d: 20px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.cursor-pointer {
|
|
173
|
+
cursor: pointer;
|
|
174
|
+
}
|
|
175
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _OBanner from './OBanner.vue';
|
|
2
|
+
import _OBannerContent from './OBannerContent.vue';
|
|
3
|
+
import type { App } from 'vue';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const OBanner = Object.assign(_OBanner, {
|
|
7
|
+
install(app: App) {
|
|
8
|
+
app.component('OBanner', _OBanner);
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const OBannerContent = Object.assign(_OBannerContent, {
|
|
12
|
+
install(app: App) {
|
|
13
|
+
app.component('OBannerContent', _OBannerContent);
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export { OBanner, OBannerContent };
|
|
18
|
+
export * from './types';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Banner 项的类型定义
|
|
2
|
+
export interface BannerItem {
|
|
3
|
+
title?: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
bg: string;
|
|
6
|
+
text_theme?: 'light' | 'dark';
|
|
7
|
+
bg_text?: string;
|
|
8
|
+
pc_text_width?: string;
|
|
9
|
+
pc_text_height?: string;
|
|
10
|
+
pad_text_width?: string;
|
|
11
|
+
pad_text_height?: string;
|
|
12
|
+
attach?: string;
|
|
13
|
+
href?: string;
|
|
14
|
+
btn?: string;
|
|
15
|
+
withStickyBg?: boolean;
|
|
16
|
+
pad_offset?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// BannerContent 组件的 Props 类型
|
|
20
|
+
export interface BannerContentProps {
|
|
21
|
+
info: BannerItem;
|
|
22
|
+
size?: 'large' | 'medium' | 'small' | 'tiny';
|
|
23
|
+
contentJustifyCenter?: boolean;
|
|
24
|
+
isPhone?: boolean;
|
|
25
|
+
isLight?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Emits 事件类型
|
|
29
|
+
export interface HomeBannerEmits {
|
|
30
|
+
(e: 'before-change', index: number): void;
|
|
31
|
+
(e: 'click', href: string | undefined): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface BannerContentEmits {
|
|
35
|
+
(e: 'click', href: string | undefined): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// 组件尺寸类型
|
|
39
|
+
export type ComponentSize = 'large' | 'medium' | 'small' | 'tiny';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { computed, provide, reactive } from 'vue';
|
|
3
3
|
|
|
4
4
|
import { OConfigProvider } from '@opensig/opendesign';
|
|
5
|
-
import zhCN from '@opensig/opendesign/es/locale/lang/zh-cn
|
|
6
|
-
import enUS from '@opensig/opendesign/es/locale/lang/en-us
|
|
5
|
+
import zhCN from '@opensig/opendesign/es/locale/lang/zh-cn';
|
|
6
|
+
import enUS from '@opensig/opendesign/es/locale/lang/en-us';
|
|
7
7
|
|
|
8
8
|
import { configProviderInjectKey } from '@/shared/provide';
|
|
9
9
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _OPlusConfigProvider from './OPlusConfigProvider.vue';
|
|
2
|
+
import type { App } from 'vue';
|
|
3
|
+
|
|
4
|
+
const OPlusConfigProvider = Object.assign(_OPlusConfigProvider, {
|
|
5
|
+
install(app: App) {
|
|
6
|
+
app.component('OPlusConfigProvider', _OPlusConfigProvider);
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { OPlusConfigProvider };
|