@opendesign-plus-test/components 0.0.1-rc.23 → 0.0.1-rc.24
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/components.cjs.js +38 -38
- package/dist/components.css +1 -1
- package/dist/components.es.js +5287 -5213
- package/package.json +3 -3
- package/src/components/activity/OActivityForm.vue +91 -16
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.24",
|
|
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.6",
|
|
36
|
+
"@opendesign-plus/styles": "0.0.1-rc.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@vitejs/plugin-vue": "^5.1.0",
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
OButton,
|
|
5
|
+
OForm,
|
|
6
|
+
OFormItem,
|
|
7
|
+
OInput,
|
|
8
|
+
OOption,
|
|
9
|
+
OSelect,
|
|
10
|
+
OTextarea,
|
|
11
|
+
RulesT, SelectValueT,
|
|
12
|
+
useMessage,
|
|
13
|
+
} from '@opensig/opendesign';
|
|
4
14
|
import { computed, ref, watch } from 'vue';
|
|
5
15
|
import { ActivityFormPropsT, ParamsItemT } from './types';
|
|
6
16
|
import { useScreen } from '@opendesign-plus/composables';
|
|
7
17
|
import { dayjs, ElDatePicker } from 'element-plus';
|
|
8
18
|
import { acticityTypeMap, WEBSITE_REGEXP } from './config';
|
|
19
|
+
import { EMAIL_REGEX } from '@/components/meeting/config.ts';
|
|
20
|
+
import { useI18n } from '@/i18n';
|
|
9
21
|
|
|
10
22
|
const emits = defineEmits(['confirm', 'close']);
|
|
11
23
|
|
|
12
24
|
const message = useMessage(null);
|
|
13
25
|
const { lePadV } = useScreen();
|
|
14
|
-
|
|
26
|
+
const { t } = useI18n();
|
|
27
|
+
const $t = t;
|
|
15
28
|
interface TypeOptionT {
|
|
16
29
|
label: string;
|
|
17
30
|
value: number;
|
|
@@ -21,6 +34,7 @@ const props = withDefaults(defineProps<ActivityFormPropsT>(), {});
|
|
|
21
34
|
const isEdit = computed(() => !!props.data);
|
|
22
35
|
const form = ref<ParamsItemT>({
|
|
23
36
|
title: '',
|
|
37
|
+
organizer: '',
|
|
24
38
|
start_date: '',
|
|
25
39
|
end_date: '',
|
|
26
40
|
register_end_date: '',
|
|
@@ -32,6 +46,8 @@ const form = ref<ParamsItemT>({
|
|
|
32
46
|
start: '',
|
|
33
47
|
end: '',
|
|
34
48
|
is_publish: 'true',
|
|
49
|
+
email_list: '',
|
|
50
|
+
content: '',
|
|
35
51
|
approver: '',
|
|
36
52
|
});
|
|
37
53
|
|
|
@@ -55,10 +71,11 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
55
71
|
},
|
|
56
72
|
],
|
|
57
73
|
activity_type: [{ required: true, message: '请选择活动类型' }],
|
|
74
|
+
organizer: [{ required: true, message: '请选择活动类型' }],
|
|
58
75
|
start_date: [
|
|
59
76
|
{ required: true, message: '请选择活动时间' },
|
|
60
77
|
{
|
|
61
|
-
validator: (
|
|
78
|
+
validator: () => {
|
|
62
79
|
const { start_date, end_date } = form.value;
|
|
63
80
|
const startDate = start_date.split(' ');
|
|
64
81
|
const endDate = end_date.split(' ');
|
|
@@ -109,7 +126,7 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
109
126
|
},
|
|
110
127
|
],
|
|
111
128
|
address: [
|
|
112
|
-
{ required: true, message: '
|
|
129
|
+
{ required: true, message: '请输入活动地点' },
|
|
113
130
|
{
|
|
114
131
|
validator: (value: string) => {
|
|
115
132
|
if (value.length > 255) {
|
|
@@ -122,7 +139,7 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
122
139
|
},
|
|
123
140
|
],
|
|
124
141
|
register_url: [
|
|
125
|
-
{ required: true, message: '
|
|
142
|
+
{ required: true, message: '请输入活动报名网址' },
|
|
126
143
|
{
|
|
127
144
|
validator: (value: string) => {
|
|
128
145
|
const str = value.replaceAll(' ', '') || '';
|
|
@@ -140,7 +157,7 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
140
157
|
},
|
|
141
158
|
],
|
|
142
159
|
content_url: [
|
|
143
|
-
{ required: true, message: '
|
|
160
|
+
{ required: true, message: '请输入活动详情介绍网址' },
|
|
144
161
|
{
|
|
145
162
|
validator: (value: string) => {
|
|
146
163
|
const str = value.replaceAll(' ', '') || '';
|
|
@@ -157,26 +174,69 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
157
174
|
triggers: ['blur', 'change'],
|
|
158
175
|
},
|
|
159
176
|
],
|
|
177
|
+
content: [{
|
|
178
|
+
validator: (value: string) => {
|
|
179
|
+
if (value.length > 1000) {
|
|
180
|
+
return {
|
|
181
|
+
type: 'danger',
|
|
182
|
+
message: '活动内容不能超过1000个字符',
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
}],
|
|
187
|
+
email_list: [{
|
|
188
|
+
validator: (value: string) => {
|
|
189
|
+
const str = value.replaceAll(' ', '') || '';
|
|
190
|
+
if (str.length) {
|
|
191
|
+
if (str.length > 1020) {
|
|
192
|
+
return {
|
|
193
|
+
type: 'danger',
|
|
194
|
+
message: t('meeting.emailTooLong'),
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const list = str.split(';') || [];
|
|
198
|
+
if (list.some((v) => !EMAIL_REGEX.test(v))) {
|
|
199
|
+
return {
|
|
200
|
+
type: 'danger',
|
|
201
|
+
message: t('meeting.emailInvalid'),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
if (list.some((v) => v.length > 50)) {
|
|
205
|
+
return {
|
|
206
|
+
type: 'danger',
|
|
207
|
+
message: t('meeting.singleEmailTooLong'),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
if (list.length > 20) {
|
|
211
|
+
return {
|
|
212
|
+
type: 'danger',
|
|
213
|
+
message: t('meeting.emailCountTooLong'),
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
triggers: ['blur', 'change'],
|
|
219
|
+
}],
|
|
160
220
|
approver: [{ required: true, message: '请选择活动审批人' }],
|
|
161
221
|
});
|
|
162
222
|
|
|
163
223
|
|
|
164
224
|
// -------------------- 活动管理员 ---------------------
|
|
165
225
|
const approverList = computed(() => {
|
|
166
|
-
return props.
|
|
226
|
+
return props.admins || [];
|
|
167
227
|
});
|
|
168
228
|
|
|
169
|
-
const typeValue = ref('');
|
|
229
|
+
const typeValue = ref<string>('');
|
|
170
230
|
const typeOptions = ref<TypeOptionT[]>([]); // 活动类型
|
|
171
231
|
acticityTypeMap.forEach((item) => {
|
|
172
232
|
typeOptions.value.push(item);
|
|
173
233
|
});
|
|
174
|
-
const changeType = (val:
|
|
234
|
+
const changeType = (val: SelectValueT) => {
|
|
175
235
|
const item = typeOptions.value.find((v) => v.label === val);
|
|
176
236
|
form.value.activity_type = item?.value as number;
|
|
177
237
|
};
|
|
178
238
|
|
|
179
|
-
const disabledDate = (date) => {
|
|
239
|
+
const disabledDate = (date: Date) => {
|
|
180
240
|
return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
|
|
181
241
|
};
|
|
182
242
|
|
|
@@ -280,8 +340,8 @@ defineExpose({
|
|
|
280
340
|
<OFormItem :rules="rules.title" label="活动名称" field="title">
|
|
281
341
|
<OInput size="large" placeholder="请输入活动名称" v-model="form.title" />
|
|
282
342
|
</OFormItem>
|
|
283
|
-
<OFormItem :rules="rules.
|
|
284
|
-
<OInput size="large" placeholder="
|
|
343
|
+
<OFormItem :rules="rules.organizer" label="活动主办方" field="organizer">
|
|
344
|
+
<OInput size="large" placeholder="请选择活动主办方" v-model="form.organizer" />
|
|
285
345
|
</OFormItem>
|
|
286
346
|
<OFormItem :rules="rules.activity_type" label="活动类型" field="activity_type">
|
|
287
347
|
<OSelect placeholder="请选择活动类型" size="large" v-model="typeValue" @change="changeType">
|
|
@@ -291,10 +351,10 @@ defineExpose({
|
|
|
291
351
|
<OFormItem
|
|
292
352
|
v-if="form.activity_type === 1 || form.activity_type === 3"
|
|
293
353
|
:rules="rules.address"
|
|
294
|
-
label="
|
|
354
|
+
label="活动地点"
|
|
295
355
|
field="address"
|
|
296
356
|
>
|
|
297
|
-
<OInput size="large" placeholder="
|
|
357
|
+
<OInput size="large" placeholder="请输入活动地点" v-model="form.address" />
|
|
298
358
|
</OFormItem>
|
|
299
359
|
<OFormItem :rules="rules.start_date" label="活动时间" field="start_date" required>
|
|
300
360
|
<div class="time-config">
|
|
@@ -339,10 +399,21 @@ defineExpose({
|
|
|
339
399
|
/>
|
|
340
400
|
</OFormItem>
|
|
341
401
|
<OFormItem :rules="rules.register_url" label="报名网址" field="register_url">
|
|
342
|
-
<OInput size="large" placeholder="
|
|
402
|
+
<OInput size="large" placeholder="请输入活动报名网址" v-model="form.register_url" />
|
|
343
403
|
</OFormItem>
|
|
344
404
|
<OFormItem :rules="rules.content_url" label="活动详情网址" field="content_url">
|
|
345
|
-
<OInput size="large" placeholder="
|
|
405
|
+
<OInput size="large" placeholder="请输入活动详情介绍网址" v-model="form.content_url" />
|
|
406
|
+
</OFormItem>
|
|
407
|
+
<OFormItem :rules="rules.content" label="活动内容" field="content">
|
|
408
|
+
<OTextarea size="large" placeholder="请输入活动内容" v-model="form.content" />
|
|
409
|
+
</OFormItem>
|
|
410
|
+
<OFormItem field="email_list" :rules="rules.email_list" label="邮件地址">
|
|
411
|
+
<OTextarea
|
|
412
|
+
:disabled="isEdit"
|
|
413
|
+
size="large"
|
|
414
|
+
:placeholder="$t('meeting.enterEmail')"
|
|
415
|
+
:rows="4"
|
|
416
|
+
v-model="form.email_list" />
|
|
346
417
|
</OFormItem>
|
|
347
418
|
<OFormItem :rules="rules.approver" label="活动审批人" field="approver">
|
|
348
419
|
<OSelect placeholder="请选择活动审批人" size="large" v-model="form.approver">
|
|
@@ -407,6 +478,10 @@ defineExpose({
|
|
|
407
478
|
width: 100%;
|
|
408
479
|
}
|
|
409
480
|
|
|
481
|
+
.o-textarea {
|
|
482
|
+
width: 100%;
|
|
483
|
+
}
|
|
484
|
+
|
|
410
485
|
.el-input {
|
|
411
486
|
width: 100%;
|
|
412
487
|
}
|