123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- import type { ModuleConfig } from "/@/cool";
- export default (): ModuleConfig => {
- return {
- label: "文件上传",
- description: "基于 el-upload 封装的文件上传组件",
- author: "COOL",
- version: "1.1.3",
- updateTime: "2024-03-13",
- demo: [
- {
- name: "基础用法",
- component: () => import("./demo/base.vue")
- },
- {
- name: "多图上传",
- component: () => import("./demo/multiple.vue")
- },
- {
- name: "文件上传",
- component: () => import("./demo/file.vue")
- },
- {
- name: "可拖拽",
- component: () => import("./demo/drag.vue")
- },
- {
- name: "自定义内容",
- component: () => import("./demo/custom.vue")
- },
- {
- name: "上传校验",
- component: () => import("./demo/check.vue")
- },
- {
- name: "文件空间",
- component: () => import("./demo/space.vue")
- }
- ],
- // 参数
- options: {
- // 尺寸
- size: 120,
- // 限制
- limit: {
- // 上传最大数量
- upload: 9,
- // 上传大小限制
- size: 100
- },
- // 云端上传路径前缀
- prefixPath: "app/base",
- // 规则
- rules: [
- {
- name: "图片",
- type: "image",
- color: "#67C23A",
- exts: ["bmp", "jpg", "jpeg", "png", "tif", "gif", "svg", "webp"]
- },
- {
- name: "视频",
- type: "video",
- color: "#826aec",
- exts: ["avi", "wmv", "mpg", "mpeg", "mov", "rm", "ram", "swf", "flv", "mp4"]
- },
- {
- name: "音频",
- type: "audio",
- color: "#826aec",
- exts: ["mp3", "wav", "wma", "mp2", "flac", "midi", "ra", "ape", "aac", "cda"]
- },
- {
- name: "文档",
- type: "word",
- color: "#53B7F4",
- exts: ["doc", "dot", "wps", "wpt", "docx", "dotx", "docm", "dotm"]
- },
- {
- name: "表格",
- type: "excel",
- color: "#53D39C",
- exts: ["xls", "xlt", "et", "xlsx", "xltx", "xlsm", "xltm"]
- },
- {
- name: "演示",
- type: "ppt",
- color: "#F56C6C",
- exts: [
- "ppt",
- "pptx",
- "pptm",
- "ppsx",
- "ppsm",
- "pps",
- "potx",
- "potm",
- "dpt",
- "dps"
- ]
- },
- {
- name: "PDF",
- type: "pdf",
- exts: ["pdf"],
- color: "#8f3500"
- },
- {
- name: "压缩文件夹",
- type: "rar",
- color: "#FFC757",
- exts: ["rar", "zip"]
- },
- {
- name: "文件",
- type: "file",
- color: "#909399",
- exts: []
- }
- ]
- },
- components: [
- () => import("./components/upload.vue"),
- () => import("./components/upload-item/index.vue")
- ]
- };
- };
|