|
|
@@ -21,6 +21,9 @@ import XBarSpace from '@/components/layout/space/XBarSpace.vue';
|
|
|
import DynamicForm from '@/components/dynamic/DynamicForm.vue';
|
|
|
import type { IDynamicFormOptions, IDynamicFormRef } from '@/components/dynamic';
|
|
|
import type { FormProps } from '@/components/form/Form.vue';
|
|
|
+import type { PickerIdFieldProps } from '@/components/dynamic/wrappers/PickerIdField';
|
|
|
+import type { UploaderFieldProps } from '@/components/form/UploaderField.vue';
|
|
|
+import { useImageSimpleUploadCo } from '@/common/components/upload/ImageUploadCo';
|
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
|
@@ -76,13 +79,13 @@ const formDefine : IDynamicFormOptions = {
|
|
|
disabled: true,
|
|
|
loadData: async () => {
|
|
|
return [
|
|
|
- { id: 1, text: "文章" },
|
|
|
- { id: 2, text: "音频" },
|
|
|
- { id: 3, text: "视频" },
|
|
|
- { id: 4, text: "相册" },
|
|
|
+ { value: 1, text: "文章" },
|
|
|
+ { value: 2, text: "音频" },
|
|
|
+ { value: 3, text: "视频" },
|
|
|
+ { value: 4, text: "相册" },
|
|
|
]
|
|
|
- },
|
|
|
- },
|
|
|
+ } ,
|
|
|
+ } as PickerIdFieldProps,
|
|
|
defaultValue: 1,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
@@ -96,6 +99,21 @@ const formDefine : IDynamicFormOptions = {
|
|
|
type: 'flat-group',
|
|
|
children: [
|
|
|
{
|
|
|
+ label: `缩略图`,
|
|
|
+ name: 'image',
|
|
|
+ type: 'uploader',
|
|
|
+ defaultValue: '',
|
|
|
+ additionalProps: {
|
|
|
+ upload: useImageSimpleUploadCo(),
|
|
|
+ maxFileSize: 1024 * 1024 * 20,
|
|
|
+ single: true,
|
|
|
+ } as UploaderFieldProps,
|
|
|
+ rules: [],
|
|
|
+ formProps: {
|
|
|
+ extraMessage: '建议分辨率:1920*1080以上',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '内容',
|
|
|
name: 'intro',
|
|
|
type: 'richtext',
|
|
|
@@ -108,9 +126,103 @@ const formDefine : IDynamicFormOptions = {
|
|
|
required: true,
|
|
|
message: '请输入内容',
|
|
|
}]
|
|
|
- }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '来源(可选)',
|
|
|
+ name: 'source',
|
|
|
+ type: 'text',
|
|
|
+ defaultValue: '',
|
|
|
+ additionalProps: {
|
|
|
+ placeholder: '如果是转载文章可以输入来源',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: `组图`,
|
|
|
+ name: 'images',
|
|
|
+ type: 'uploader',
|
|
|
+ defaultValue: '',
|
|
|
+ show: { callback: (_, formModel) => formModel.type == 4 },
|
|
|
+ additionalProps: {
|
|
|
+ upload: useImageSimpleUploadCo(),
|
|
|
+ maxFileSize: 1024 * 1024 * 100,
|
|
|
+ maxUploadCount: 20,
|
|
|
+ } as UploaderFieldProps,
|
|
|
+ formProps: {
|
|
|
+ extraMessage: '建议分辨率:1920*1080以上',
|
|
|
+ },
|
|
|
+ rules: []
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: `音频`,
|
|
|
+ name: 'audio',
|
|
|
+ type: 'uploader',
|
|
|
+ defaultValue: '',
|
|
|
+ show: { callback: (_, formModel) => formModel.type == 2 },
|
|
|
+ additionalProps: {
|
|
|
+ upload: useImageSimpleUploadCo(),
|
|
|
+ maxFileSize: 1024 * 1024 * 100,
|
|
|
+ single: true,
|
|
|
+ chooseType: 'video',
|
|
|
+ } as UploaderFieldProps,
|
|
|
+ rules: []
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: `视频`,
|
|
|
+ name: 'video',
|
|
|
+ type: 'uploader',
|
|
|
+ defaultValue: '',
|
|
|
+ show: { callback: (_, formModel) => formModel.type == 3 },
|
|
|
+ additionalProps: {
|
|
|
+ upload: useImageSimpleUploadCo(),
|
|
|
+ maxFileSize: 1024 * 1024 * 100,
|
|
|
+ single: true,
|
|
|
+ chooseType: 'video',
|
|
|
+ } as UploaderFieldProps,
|
|
|
+ formProps: {
|
|
|
+ extraMessage: '建议使用MP4格式1080P分辨率',
|
|
|
+ },
|
|
|
+ rules: []
|
|
|
+ },
|
|
|
]
|
|
|
},
|
|
|
+ {
|
|
|
+ name: 'c',
|
|
|
+ type: 'flat-group',
|
|
|
+ label: '额外信息(可选)',
|
|
|
+ formProps: {
|
|
|
+ showLabel: false,
|
|
|
+ },
|
|
|
+ additionalProps: {
|
|
|
+ collapsible: true,
|
|
|
+ collapsed: true,
|
|
|
+ },
|
|
|
+ childrenColProps: { span: 24 },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ label: '',
|
|
|
+ name: 'extra',
|
|
|
+ type: 'static-text',
|
|
|
+ defaultValue: '',
|
|
|
+ additionalProps: {
|
|
|
+ text: '额外信息用于采集系统内部处理,可以不填写',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: `关键字`,
|
|
|
+ name: 'keywords',
|
|
|
+ type: 'text-tag',
|
|
|
+ defaultValue: '',
|
|
|
+ rules: [],
|
|
|
+ additionalProps: {
|
|
|
+ placeholder: '可以输入关键字',
|
|
|
+ tagJoinType: ';',
|
|
|
+ },
|
|
|
+ formProps: {
|
|
|
+ extraMessage: '用于系统优化关键字搜索',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }
|
|
|
]
|
|
|
}
|
|
|
|