@opendesign-plus-test/components 0.0.1-rc.21 → 0.0.1-rc.23
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 +428 -137
- package/dist/components/OBanner.vue.d.ts +10 -1
- package/dist/components/OFooter.vue.d.ts +1 -1
- package/dist/components/OHeaderSearch.vue.d.ts +4 -4
- package/dist/components/activity/OActivityApproval.vue.d.ts +277 -0
- package/dist/components/activity/OActivityForm.vue.d.ts +140 -0
- package/dist/components/activity/OMyActivityCalendar.vue.d.ts +578 -0
- package/dist/components/activity/config.d.ts +15 -0
- package/dist/components/activity/data.d.ts +51 -0
- package/dist/components/activity/index.d.ts +623 -0
- package/dist/components/activity/types.d.ts +76 -0
- package/dist/components/meeting/OMeetingCalendar.vue.d.ts +309 -0
- package/dist/components/meeting/OMeetingForm.vue.d.ts +156 -0
- package/dist/components/meeting/OMyMeetingCalendar.vue.d.ts +582 -0
- package/dist/components/meeting/OSigMeetingCalendar.vue.d.ts +24 -0
- package/dist/components/meeting/components/OMeetingCalendarList.vue.d.ts +27 -0
- package/dist/components/meeting/components/OMeetingCalendarSelector.vue.d.ts +664 -0
- package/dist/components/meeting/components/OMeetingDetail.vue.d.ts +12 -0
- package/dist/components/meeting/components/OMeetingPlaybackSubtitles.vue.d.ts +5 -0
- package/dist/components/meeting/components/OMeetingPlaybackVideo.vue.d.ts +17 -0
- package/dist/components/meeting/components/OSigMeetingAside.vue.d.ts +16 -0
- package/dist/components/meeting/config.d.ts +27 -0
- package/dist/components/meeting/types.d.ts +140 -0
- package/dist/components/meeting/utils.d.ts +21 -0
- package/dist/components.cjs.js +224 -3
- package/dist/components.css +1 -1
- package/dist/components.es.js +43544 -2307
- package/dist/index.d.ts +2 -0
- package/package.json +6 -3
- package/scripts/generate-components-index.js +4 -0
- package/src/assets/meeting/svg-icons/icon-all.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-backward.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-calendar.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-cancel.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-captions.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-close-captions.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-close-fullscreen.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-copy.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-create.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-delete.svg +7 -0
- package/src/assets/meeting/svg-icons/icon-empty.svg +31 -0
- package/src/assets/meeting/svg-icons/icon-empty_dark.svg +49 -0
- package/src/assets/meeting/svg-icons/icon-event.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-export.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-forward.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-fullscreen.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-help.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-important.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-info.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-meet.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-meeting-message.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-meeting.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-play.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-playing-tip.svg +7 -0
- package/src/assets/meeting/svg-icons/icon-playing.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-question.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-sound.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-speaker.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-summit.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-telligent.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-tip.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-todo.svg +4 -0
- package/src/assets/meeting/transparent.png +0 -0
- package/src/assets/svg-icons/icon-chevron-up.svg +3 -0
- package/src/assets/svg-icons/icon-filter.svg +3 -0
- package/src/assets/svg-icons/icon-loading.svg +4 -0
- package/src/assets/svg-icons/icon-search.svg +3 -0
- package/src/assets/svg-icons/icon-tips.svg +3 -0
- package/src/components/OBanner.vue +11 -3
- package/src/components/OFooter.vue +1 -1
- package/src/components/activity/OActivityApproval.vue +775 -0
- package/src/components/activity/OActivityForm.vue +465 -0
- package/src/components/activity/OMyActivityCalendar.vue +1342 -0
- package/src/components/activity/config.ts +130 -0
- package/src/components/activity/data.ts +365 -0
- package/src/components/activity/index.ts +24 -0
- package/src/components/activity/types.ts +83 -0
- package/src/components/common/MoreText.vue +119 -0
- package/src/components/common/ThFilter.vue +326 -0
- package/src/components/events/OEventsApply.vue +2 -86
- package/src/components/events/OEventsCalendar.vue +0 -25
- package/src/components/events/OEventsList.vue +0 -51
- package/src/components/events/index.ts +1 -0
- package/src/components/meeting/OMeetingCalendar.vue +865 -0
- package/src/components/meeting/OMeetingForm.vue +1035 -0
- package/src/components/meeting/OMeetingPlayback.vue +439 -0
- package/src/components/meeting/OMyMeetingCalendar.vue +1501 -0
- package/src/components/meeting/OSigMeetingCalendar.vue +411 -0
- package/src/components/meeting/components/OMeetingCalendarList.vue +462 -0
- package/src/components/meeting/components/OMeetingCalendarSelector.vue +206 -0
- package/src/components/meeting/components/OMeetingDetail.vue +189 -0
- package/src/components/meeting/components/OMeetingPlaybackSubtitles.vue +611 -0
- package/src/components/meeting/components/OMeetingPlaybackVideo.vue +741 -0
- package/src/components/meeting/components/OMyCalendarWrapper.vue +160 -0
- package/src/components/meeting/components/OSigMeetingAside.vue +197 -0
- package/src/components/meeting/config.ts +110 -0
- package/src/components/meeting/index.ts +45 -0
- package/src/components/meeting/types.ts +167 -0
- package/src/components/meeting/utils.ts +106 -0
- package/src/draft/Footer.vue +4 -4
- package/src/env.d.ts +15 -0
- package/src/i18n/en.ts +140 -0
- package/src/i18n/index.ts +18 -4
- package/src/i18n/zh.ts +140 -0
- package/src/index.ts +2 -0
- package/tsconfig.json +6 -2
- package/vite.config.ts +25 -9
- package/npmcachae/_cacache/content-v2/sha512/05/f7/dd881de8b21208ea65cfce17c65f29964c3897505819f81151b9798a3a6ab1a1114324192354ead15cd2c8d93f76cc9929af168066ec9cc7878d0fd87578 +0 -1
- package/npmcachae/_cacache/content-v2/sha512/08/b7/879230f8c2f3765920a6fd6113f4687141f1f645f96af7d95a0dee9113d1095d000fb78a5dd55c1860bbfb9b698ef6281b3874b03b2384222f61fe055fc4 +0 -1
- package/npmcachae/_cacache/content-v2/sha512/10/a0/a6626613c03ee052925a762e8675878efdf83dac64fafea43beb2a875f7d7c3907bb0ee30761253cd16021fd58911449594e1d3358675cbb7c48e62f220a +0 -1
- package/npmcachae/_cacache/content-v2/sha512/2e/a6/7cbcf55a98bbe2ca881d10e982ebf59211a0ec051eaf46eb1914df66cc35ae502ed6888850e51d8f45cd92695bac16961a642bc41508f8d5160a9ab617ab +0 -1
- package/npmcachae/_cacache/content-v2/sha512/92/8d/e5259c5d5cc2a625247f3c4d809192ca9482467e23683d74924a11e91a7997ad890b3d26adaf34df66d5329cc7a5fbde6713110cad05107a0b504e4fd4e8 +0 -1
- package/npmcachae/_cacache/content-v2/sha512/e9/45/9597d870127c35681155cec5fe52fde4e1aa0f778b996ee371e856aca850ee4c13aba74b0c3d3a89ff0ea4c9e1d33e64e53c31dc9cede0b31012695ee659 +0 -1
- package/npmcachae/_cacache/index-v5/16/4a/7195fcc6857299c4ab7e26014a8ae6e3c396507a2c8db3da1b74b005d574 +0 -3
- package/npmcachae/_cacache/index-v5/58/f0/4fe556f104b09be642895a82afa463fe560d9a0dc8f507efeef825a6905e +0 -3
- package/npmcachae/_cacache/index-v5/67/7d/0b50dc4c09555fc922ccf43c46994f1a0a5ff47dc0a5d5cf41437ac2d3e6 +0 -3
- package/npmcachae/_cacache/index-v5/8f/28/353f8839e030ab11aab3e7d9f1b8c053403e9f593cf6d4aa6ec8fdd7610d +0 -3
- package/npmcachae/_cacache/index-v5/97/10/0fcf20eb29d0726bd820822f6729718464b591b0e6901217c956740e943c +0 -3
- package/npmcachae/_cacache/index-v5/db/89/a0a4f35f593105624ab39339962d9e9b5cc65ed0c346b0732fb8dd73721d +0 -3
- package/npmcachae/_logs/2026-03-26T14_10_35_885Z-debug-0.log +0 -171
- package/npmcachae/_logs/2026-03-26T14_10_38_617Z-debug-0.log +0 -4227
- package/npmcachae/_logs/2026-03-26T14_10_45_316Z-debug-0.log +0 -4228
- package/npmcachae/_logs/2026-03-26T14_10_48_169Z-debug-0.log +0 -4228
- package/npmcachae/_logs/2026-03-26T14_10_51_306Z-debug-0.log +0 -464
- package/npmcachae/_logs/2026-03-26T14_10_53_911Z-debug-0.log +0 -464
- package/npmcachae/_logs/2026-03-26T14_10_56_398Z-debug-0.log +0 -464
- package/npmcachae/_logs/2026-03-26T14_10_58_861Z-debug-0.log +0 -464
- package/npmcachae/_logs/2026-03-26T14_11_01_337Z-debug-0.log +0 -464
- package/npmcachae/_logs/2026-03-26T14_11_03_851Z-debug-0.log +0 -464
- package/npmcachae/_logs/2026-03-26T14_11_08_024Z-debug-0.log +0 -464
- package/npmcachae/_update-notifier-last-checked +0 -0
- package/src/components/meeting/npmcachae/_cacache/content-v2/sha512/3e/17/1865217b9acb9f4921c53a09b5c76587cd2ab748beb2699ff6cfb1341d73b1aa56ed91ffc5ab2c9c9b3fbe626103b35d9a79ff29ff6b8cbb8d89755fe1a2 +0 -1
- package/src/components/meeting/npmcachae/_cacache/content-v2/sha512/a6/15/47bb7552ec9248079e839a5feecc1742d4de19524fdf041cf581701cf4760a5025106036145e279ba193b07c8fa5b07ae3d75f1b6032f0cb2219115b6167 +0 -1
- package/src/components/meeting/npmcachae/_cacache/content-v2/sha512/d1/4c/133b32e09c97101a27a07cc4432f94e470cff02d120d21babcea77c3f5cd436793516dc1a8e282ee1a568f923c148b1a48f4a43233462a530d35e8b41c67 +0 -1
- package/src/components/meeting/npmcachae/_cacache/index-v5/54/0d/a4909047714a0a7198bb9bd37020992464e47c79a791889919b84d90aab0 +0 -3
- package/src/components/meeting/npmcachae/_cacache/index-v5/8e/2b/21a79778e2ac08cf5663baf83cb35f951995a496007eb2e2f7fba54021a4 +0 -3
- package/src/components/meeting/npmcachae/_cacache/index-v5/eb/a0/b70c8132e5b57a0f1e129b8cc941796420a9c147c0baa680710083740898 +0 -2
- package/src/components/meeting/npmcachae/_logs/2026-03-20T07_03_54_955Z-debug-0.log +0 -277
- package/src/components/meeting/npmcachae/_logs/2026-03-20T07_03_57_842Z-debug-0.log +0 -277
- package/src/components/meeting/npmcachae/_logs/2026-03-20T07_04_00_016Z-debug-0.log +0 -277
- package/src/components/meeting/npmcachae/_logs/2026-03-20T07_04_02_191Z-debug-0.log +0 -277
- package/src/components/meeting/npmcachae/_logs/2026-03-20T07_04_04_425Z-debug-0.log +0 -277
- package/src/components/meeting/npmcachae/_logs/2026-03-20T07_04_06_642Z-debug-0.log +0 -277
- package/src/components/meeting/npmcachae/_logs/2026-03-20T07_04_08_826Z-debug-0.log +0 -277
- package/src/components/meeting/npmcachae/_logs/2026-03-20T07_25_36_140Z-debug-0.log +0 -433
- package/src/components/meeting/npmcachae/_logs/2026-03-20T07_25_39_573Z-debug-0.log +0 -433
- package/src/components/meeting/npmcachae/_logs/2026-03-20T07_25_42_134Z-debug-0.log +0 -212
- package/src/components/meeting/npmcachae/_update-notifier-last-checked +0 -0
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
import { OButton, OForm, OFormItem, OInput, OOption, OSelect, RulesT, useMessage } from '@opensig/opendesign';
|
|
4
|
+
import { computed, ref, watch } from 'vue';
|
|
5
|
+
import { ActivityFormPropsT, ParamsItemT } from './types';
|
|
6
|
+
import { useScreen } from '@opendesign-plus/composables';
|
|
7
|
+
import { dayjs, ElDatePicker } from 'element-plus';
|
|
8
|
+
import { acticityTypeMap, WEBSITE_REGEXP } from './config';
|
|
9
|
+
|
|
10
|
+
const emits = defineEmits(['confirm', 'close']);
|
|
11
|
+
|
|
12
|
+
const message = useMessage(null);
|
|
13
|
+
const { lePadV } = useScreen();
|
|
14
|
+
|
|
15
|
+
interface TypeOptionT {
|
|
16
|
+
label: string;
|
|
17
|
+
value: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(defineProps<ActivityFormPropsT>(), {});
|
|
21
|
+
const isEdit = computed(() => !!props.data);
|
|
22
|
+
const form = ref<ParamsItemT>({
|
|
23
|
+
title: '',
|
|
24
|
+
start_date: '',
|
|
25
|
+
end_date: '',
|
|
26
|
+
register_end_date: '',
|
|
27
|
+
activity_type: '',
|
|
28
|
+
synopsis: '',
|
|
29
|
+
register_url: '',
|
|
30
|
+
content_url: '',
|
|
31
|
+
address: '',
|
|
32
|
+
start: '',
|
|
33
|
+
end: '',
|
|
34
|
+
is_publish: 'true',
|
|
35
|
+
approver: '',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const formRef = ref(); // 表单实例
|
|
39
|
+
const loading = ref(false); // 提交状态
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
// 表单校验规则
|
|
43
|
+
const rules = ref<Record<string, RulesT[]>>({
|
|
44
|
+
title: [
|
|
45
|
+
{ required: true, message: '请输入活动名称' },
|
|
46
|
+
{
|
|
47
|
+
validator: (value: string) => {
|
|
48
|
+
if (value.length > 50) {
|
|
49
|
+
return {
|
|
50
|
+
type: 'danger',
|
|
51
|
+
message: '活动名称不能超过50个字符',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
activity_type: [{ required: true, message: '请选择活动类型' }],
|
|
58
|
+
start_date: [
|
|
59
|
+
{ required: true, message: '请选择活动时间' },
|
|
60
|
+
{
|
|
61
|
+
validator: (value: string) => {
|
|
62
|
+
const { start_date, end_date } = form.value;
|
|
63
|
+
const startDate = start_date.split(' ');
|
|
64
|
+
const endDate = end_date.split(' ');
|
|
65
|
+
if (!start_date || !end_date) {
|
|
66
|
+
return {
|
|
67
|
+
type: 'danger',
|
|
68
|
+
message: '请选择活动日期',
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const startArr = startDate[1].split(':').map(Number);
|
|
73
|
+
const endArr = endDate[1].split(':').map(Number);
|
|
74
|
+
if (startArr[0] < 8 || startArr[0] > 21 || endArr[0] < 8 || endArr[0] > 21) {
|
|
75
|
+
return {
|
|
76
|
+
type: 'danger',
|
|
77
|
+
message: '开始和结束时间必须在8:00-22:00点之间',
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (dayjs(start_date).valueOf() > dayjs(end_date).valueOf()) {
|
|
82
|
+
return {
|
|
83
|
+
type: 'danger',
|
|
84
|
+
message: '结束日期必须大于起始日期',
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
form.value.start_date = startDate[0];
|
|
89
|
+
form.value.end_date = endDate[0];
|
|
90
|
+
form.value.start = startDate[1];
|
|
91
|
+
form.value.end = endDate[1];
|
|
92
|
+
},
|
|
93
|
+
triggers: ['blur', 'change'],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
register_end_date: [
|
|
97
|
+
{ required: true, message: '请选择报名截止时间' },
|
|
98
|
+
{
|
|
99
|
+
validator: () => {
|
|
100
|
+
const { register_end_date, end_date, end } = form.value;
|
|
101
|
+
if (dayjs(`${ end_date } ${ end }`).valueOf() < dayjs(register_end_date).valueOf()) {
|
|
102
|
+
return {
|
|
103
|
+
type: 'danger',
|
|
104
|
+
message: '报名截止日期必须小于结束日期',
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
triggers: ['blur', 'change'],
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
address: [
|
|
112
|
+
{ required: true, message: '请输入活动地址' },
|
|
113
|
+
{
|
|
114
|
+
validator: (value: string) => {
|
|
115
|
+
if (value.length > 255) {
|
|
116
|
+
return {
|
|
117
|
+
type: 'danger',
|
|
118
|
+
message: '活动名称不能超过255个字符',
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
register_url: [
|
|
125
|
+
{ required: true, message: '请输入报名网址' },
|
|
126
|
+
{
|
|
127
|
+
validator: (value: string) => {
|
|
128
|
+
const str = value.replaceAll(' ', '') || '';
|
|
129
|
+
if (str.length) {
|
|
130
|
+
const list = str.split(';') || [];
|
|
131
|
+
if (list.some((v) => !WEBSITE_REGEXP.test(v))) {
|
|
132
|
+
return {
|
|
133
|
+
type: 'danger',
|
|
134
|
+
message: '请输入正确的报名网址',
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
triggers: ['blur', 'change'],
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
content_url: [
|
|
143
|
+
{ required: true, message: '请输入活动详情网址' },
|
|
144
|
+
{
|
|
145
|
+
validator: (value: string) => {
|
|
146
|
+
const str = value.replaceAll(' ', '') || '';
|
|
147
|
+
if (str.length) {
|
|
148
|
+
const list = str.split(';') || [];
|
|
149
|
+
if (list.some((v) => !WEBSITE_REGEXP.test(v))) {
|
|
150
|
+
return {
|
|
151
|
+
type: 'danger',
|
|
152
|
+
message: '请输入正确的活动详情网址',
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
triggers: ['blur', 'change'],
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
approver: [{ required: true, message: '请选择活动审批人' }],
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
// -------------------- 活动管理员 ---------------------
|
|
165
|
+
const approverList = computed(() => {
|
|
166
|
+
return props.admin || [];
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
const typeValue = ref('');
|
|
170
|
+
const typeOptions = ref<TypeOptionT[]>([]); // 活动类型
|
|
171
|
+
acticityTypeMap.forEach((item) => {
|
|
172
|
+
typeOptions.value.push(item);
|
|
173
|
+
});
|
|
174
|
+
const changeType = (val: string) => {
|
|
175
|
+
const item = typeOptions.value.find((v) => v.label === val);
|
|
176
|
+
form.value.activity_type = item?.value as number;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const disabledDate = (date) => {
|
|
180
|
+
return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
watch(
|
|
184
|
+
() => props.data,
|
|
185
|
+
(val) => {
|
|
186
|
+
if (val) {
|
|
187
|
+
const {
|
|
188
|
+
title,
|
|
189
|
+
start_date,
|
|
190
|
+
end_date,
|
|
191
|
+
register_end_date,
|
|
192
|
+
activity_type,
|
|
193
|
+
register_url,
|
|
194
|
+
content_url,
|
|
195
|
+
address,
|
|
196
|
+
start,
|
|
197
|
+
end,
|
|
198
|
+
is_publish,
|
|
199
|
+
approver,
|
|
200
|
+
update_activity_id,
|
|
201
|
+
} = val;
|
|
202
|
+
let params = {
|
|
203
|
+
title,
|
|
204
|
+
start_date,
|
|
205
|
+
end_date,
|
|
206
|
+
register_end_date,
|
|
207
|
+
activity_type,
|
|
208
|
+
register_url,
|
|
209
|
+
content_url,
|
|
210
|
+
address,
|
|
211
|
+
start,
|
|
212
|
+
end,
|
|
213
|
+
is_publish,
|
|
214
|
+
approver,
|
|
215
|
+
update_activity_id,
|
|
216
|
+
} as ParamsItemT;
|
|
217
|
+
form.value = { ...params };
|
|
218
|
+
typeValue.value = acticityTypeMap.get(val.activity_type)?.label;
|
|
219
|
+
form.value.start_date = `${ form.value.start_date } ${ form.value.start }`;
|
|
220
|
+
form.value.end_date = `${ form.value.end_date } ${ form.value.end }`;
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
{ immediate: true, deep: true },
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
const confirm = async (val: boolean) => {
|
|
227
|
+
let type = isEdit.value ? '修改' : val ? '创建' : '保存草稿';
|
|
228
|
+
try {
|
|
229
|
+
const valid = await formRef.value?.validate();
|
|
230
|
+
if (valid.some((v) => !!v)) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
loading.value = true;
|
|
234
|
+
form.value.is_publish = `${ val }`;
|
|
235
|
+
if (isEdit.value && props.status === 3) {
|
|
236
|
+
form.value.update_activity_id = props.data?.id;
|
|
237
|
+
await props.creatActivity?.(form.value);
|
|
238
|
+
} else if (isEdit.value) {
|
|
239
|
+
await props.editActivity?.(props.data.id, form.value);
|
|
240
|
+
} else {
|
|
241
|
+
await props.creatActivity?.(form.value);
|
|
242
|
+
}
|
|
243
|
+
const msg = `“${ form.value.title }”活动${ type }成功`;
|
|
244
|
+
message.success({
|
|
245
|
+
content: msg,
|
|
246
|
+
});
|
|
247
|
+
close();
|
|
248
|
+
emits('confirm');
|
|
249
|
+
} catch {
|
|
250
|
+
loading.value = false;
|
|
251
|
+
form.value.start_date = `${ form.value.start_date } ${ form.value.start }`;
|
|
252
|
+
form.value.end_date = `${ form.value.end_date } ${ form.value.end }`;
|
|
253
|
+
const msg = `“${ form.value.title }”活动${ type }失败`;
|
|
254
|
+
message.danger({
|
|
255
|
+
content: msg,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
const close = () => {
|
|
260
|
+
form.value = {} as ParamsItemT;
|
|
261
|
+
emits('close');
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
defineExpose({
|
|
266
|
+
confirm,
|
|
267
|
+
});
|
|
268
|
+
</script>
|
|
269
|
+
|
|
270
|
+
<template>
|
|
271
|
+
<div class="o-activity-form">
|
|
272
|
+
<OForm
|
|
273
|
+
:model="form"
|
|
274
|
+
ref="formRef"
|
|
275
|
+
has-required
|
|
276
|
+
label-width="108px"
|
|
277
|
+
:layout="lePadV ? 'v' : 'h'"
|
|
278
|
+
class="form-wrapper"
|
|
279
|
+
>
|
|
280
|
+
<OFormItem :rules="rules.title" label="活动名称" field="title">
|
|
281
|
+
<OInput size="large" placeholder="请输入活动名称" v-model="form.title" />
|
|
282
|
+
</OFormItem>
|
|
283
|
+
<OFormItem :rules="rules.title" label="活动主办方" field="title">
|
|
284
|
+
<OInput size="large" placeholder="请输入活动名称" v-model="form.title" />
|
|
285
|
+
</OFormItem>
|
|
286
|
+
<OFormItem :rules="rules.activity_type" label="活动类型" field="activity_type">
|
|
287
|
+
<OSelect placeholder="请选择活动类型" size="large" v-model="typeValue" @change="changeType">
|
|
288
|
+
<OOption v-for="t in typeOptions" :key="t.value" :value="t.label">{{ t.label }}</OOption>
|
|
289
|
+
</OSelect>
|
|
290
|
+
</OFormItem>
|
|
291
|
+
<OFormItem
|
|
292
|
+
v-if="form.activity_type === 1 || form.activity_type === 3"
|
|
293
|
+
:rules="rules.address"
|
|
294
|
+
label="活动地址"
|
|
295
|
+
field="address"
|
|
296
|
+
>
|
|
297
|
+
<OInput size="large" placeholder="请输入活动地址" v-model="form.address" />
|
|
298
|
+
</OFormItem>
|
|
299
|
+
<OFormItem :rules="rules.start_date" label="活动时间" field="start_date" required>
|
|
300
|
+
<div class="time-config">
|
|
301
|
+
<OFormItem label="起始日期" field="start_date">
|
|
302
|
+
<ElDatePicker
|
|
303
|
+
size="large"
|
|
304
|
+
v-model="form.start_date"
|
|
305
|
+
type="datetime"
|
|
306
|
+
placeholder="请选择日期"
|
|
307
|
+
format="YYYY/MM/DD HH:mm"
|
|
308
|
+
value-format="YYYY-MM-DD HH:mm"
|
|
309
|
+
:disabled-date="disabledDate"
|
|
310
|
+
:clearable="false"
|
|
311
|
+
class="date-activity"
|
|
312
|
+
/>
|
|
313
|
+
</OFormItem>
|
|
314
|
+
<OFormItem label="结束日期" field="end_date">
|
|
315
|
+
<ElDatePicker
|
|
316
|
+
size="large"
|
|
317
|
+
v-model="form.end_date"
|
|
318
|
+
type="datetime"
|
|
319
|
+
placeholder="请选择日期"
|
|
320
|
+
format="YYYY/MM/DD HH:mm"
|
|
321
|
+
value-format="YYYY-MM-DD HH:mm"
|
|
322
|
+
:disabled-date="disabledDate"
|
|
323
|
+
:clearable="false"
|
|
324
|
+
class="date-activity"
|
|
325
|
+
/>
|
|
326
|
+
</OFormItem>
|
|
327
|
+
</div>
|
|
328
|
+
</OFormItem>
|
|
329
|
+
<OFormItem :rules="rules.register_end_date" label="报名截止时间" field="register_end_date">
|
|
330
|
+
<ElDatePicker
|
|
331
|
+
size="large"
|
|
332
|
+
v-model="form.register_end_date"
|
|
333
|
+
type="datetime"
|
|
334
|
+
placeholder="请选择报名截止时间"
|
|
335
|
+
format="YYYY/MM/DD HH:mm"
|
|
336
|
+
value-format="YYYY-MM-DD HH:mm"
|
|
337
|
+
:clearable="false"
|
|
338
|
+
class="date-activity"
|
|
339
|
+
/>
|
|
340
|
+
</OFormItem>
|
|
341
|
+
<OFormItem :rules="rules.register_url" label="报名网址" field="register_url">
|
|
342
|
+
<OInput size="large" placeholder="请输入报名网址" v-model="form.register_url" />
|
|
343
|
+
</OFormItem>
|
|
344
|
+
<OFormItem :rules="rules.content_url" label="活动详情网址" field="content_url">
|
|
345
|
+
<OInput size="large" placeholder="请输入活动详情网址" v-model="form.content_url" />
|
|
346
|
+
</OFormItem>
|
|
347
|
+
<OFormItem :rules="rules.approver" label="活动审批人" field="approver">
|
|
348
|
+
<OSelect placeholder="请选择活动审批人" size="large" v-model="form.approver">
|
|
349
|
+
<OOption v-for="t in approverList" :key="t" :value="t">{{ t }}</OOption>
|
|
350
|
+
</OSelect>
|
|
351
|
+
</OFormItem>
|
|
352
|
+
</OForm>
|
|
353
|
+
<div class="form-btns">
|
|
354
|
+
<OButton color="primary" variant="solid" size="large" round="pill" @click="confirm(true)" :loading="loading">
|
|
355
|
+
{{ isEdit ? '保存' : '创建' }}
|
|
356
|
+
</OButton>
|
|
357
|
+
<OButton
|
|
358
|
+
v-if="!isEdit"
|
|
359
|
+
color="primary"
|
|
360
|
+
variant="outline"
|
|
361
|
+
round="pill"
|
|
362
|
+
size="large"
|
|
363
|
+
@click="confirm(false)"
|
|
364
|
+
:loading="loading"
|
|
365
|
+
>
|
|
366
|
+
保存草稿
|
|
367
|
+
</OButton>
|
|
368
|
+
<OButton color="primary" variant="outline" size="large" round="pill" @click="close">取消</OButton>
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
</template>
|
|
372
|
+
|
|
373
|
+
<style lang="scss">
|
|
374
|
+
.o-activity-form {
|
|
375
|
+
.form-wrapper {
|
|
376
|
+
& > .o-form-item {
|
|
377
|
+
max-width: 620px;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.o-form {
|
|
382
|
+
--o-input-color: var(--o-color-info2);
|
|
383
|
+
--o-placeholder-color: var(--o-color-info4);
|
|
384
|
+
|
|
385
|
+
&.o-form-layout-h {
|
|
386
|
+
.o-form-item-label {
|
|
387
|
+
height: var(--o-control_size-l);
|
|
388
|
+
margin: 0;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
&.o-form-layout-v {
|
|
393
|
+
.o-form-item-label {
|
|
394
|
+
margin-bottom: var(--o-gap-2);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.o-form-item-main {
|
|
398
|
+
margin-left: 0;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.o-select {
|
|
403
|
+
width: 100%;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.o-input {
|
|
407
|
+
width: 100%;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.el-input {
|
|
411
|
+
width: 100%;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.el-input__wrapper {
|
|
415
|
+
border-radius: var(--o-radius-xs);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.time-config {
|
|
419
|
+
width: 100%;
|
|
420
|
+
background-color: var(--o-color-control2-light);
|
|
421
|
+
padding: var(--o-gap-5);
|
|
422
|
+
padding-right: calc(var(--o-gap-4) + var(--o-gap-5));
|
|
423
|
+
border-radius: var(--o-radius-xs);
|
|
424
|
+
@include respond-to('<=pad_v') {
|
|
425
|
+
padding: var(--o-gap-4);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.o-form-item {
|
|
429
|
+
align-items: center;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.o-form-item-label {
|
|
433
|
+
flex: 0 0 80px;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.form-btns {
|
|
440
|
+
margin-top: var(--o-gap-5);
|
|
441
|
+
display: flex;
|
|
442
|
+
align-items: center;
|
|
443
|
+
|
|
444
|
+
.o-btn + .o-btn {
|
|
445
|
+
margin-left: var(--o-gap-4);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
@include respond-to('<=pad_v') {
|
|
449
|
+
.o-btn {
|
|
450
|
+
--btn-min-width: 74px;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
</style>
|
|
455
|
+
<style lang="scss">
|
|
456
|
+
.date-activity {
|
|
457
|
+
.el-input__inner {
|
|
458
|
+
@include text1;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.el-input__inner::placeholder {
|
|
462
|
+
color: var(--o-color-info4);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
</style>
|