Merge branch 'master' of https://gitee.com/youlaiorg/vue3-element-admin
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
<h1>vue3-element-admin</h1>
|
<h1>vue3-element-admin</h1>
|
||||||
|
|
||||||
<img src="https://img.shields.io/badge/Vue-3.5.13-brightgreen.svg"/>
|
<img src="https://img.shields.io/badge/Vue-3.5.13-brightgreen.svg"/>
|
||||||
<img src="https://img.shields.io/badge/Vite-6.1.0-green.svg"/>
|
<img src="https://img.shields.io/badge/Vite-6.2.2-green.svg"/>
|
||||||
<img src="https://img.shields.io/badge/Element Plus-2.9.4-blue.svg"/>
|
<img src="https://img.shields.io/badge/Element Plus-2.9.7-blue.svg"/>
|
||||||
<img src="https://img.shields.io/badge/license-MIT-green.svg"/>
|
<img src="https://img.shields.io/badge/license-MIT-green.svg"/>
|
||||||
<a href="https://gitee.com/youlaiorg" target="_blank">
|
<a href="https://gitee.com/youlaiorg" target="_blank">
|
||||||
<img src="https://img.shields.io/badge/Author-有来开源组织-orange.svg"/>
|
<img src="https://img.shields.io/badge/Author-有来开源组织-orange.svg"/>
|
||||||
|
|||||||
30
package.json
30
package.json
@@ -45,17 +45,17 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"@stomp/stompjs": "^7.0.1",
|
"@stomp/stompjs": "^7.1.0",
|
||||||
"@vueuse/core": "^12.8.2",
|
"@vueuse/core": "^12.8.2",
|
||||||
"@wangeditor-next/editor": "^5.6.34",
|
"@wangeditor-next/editor": "^5.6.34",
|
||||||
"@wangeditor-next/editor-for-vue": "^5.1.14",
|
"@wangeditor-next/editor-for-vue": "^5.1.14",
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"axios": "^1.8.2",
|
"axios": "^1.8.4",
|
||||||
"codemirror": "^5.65.18",
|
"codemirror": "^5.65.19",
|
||||||
"codemirror-editor-vue3": "^2.8.0",
|
"codemirror-editor-vue3": "^2.8.0",
|
||||||
"default-passive-events": "^2.0.0",
|
"default-passive-events": "^2.0.0",
|
||||||
"echarts": "^5.6.0",
|
"echarts": "^5.6.0",
|
||||||
"element-plus": "^2.9.6",
|
"element-plus": "^2.9.7",
|
||||||
"exceljs": "^4.4.0",
|
"exceljs": "^4.4.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
@@ -71,34 +71,34 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^19.8.0",
|
"@commitlint/cli": "^19.8.0",
|
||||||
"@commitlint/config-conventional": "^19.8.0",
|
"@commitlint/config-conventional": "^19.8.0",
|
||||||
"@eslint/js": "^9.22.0",
|
"@eslint/js": "^9.23.0",
|
||||||
"@iconify/utils": "^2.3.0",
|
"@iconify/utils": "^2.3.0",
|
||||||
"@types/codemirror": "^5.60.15",
|
"@types/codemirror": "^5.60.15",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/node": "^22.13.10",
|
"@types/node": "^22.13.11",
|
||||||
"@types/nprogress": "^0.2.3",
|
"@types/nprogress": "^0.2.3",
|
||||||
"@types/path-browserify": "^1.0.3",
|
"@types/path-browserify": "^1.0.3",
|
||||||
"@types/qs": "^6.9.18",
|
"@types/qs": "^6.9.18",
|
||||||
"@types/sortablejs": "^1.15.8",
|
"@types/sortablejs": "^1.15.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
"@typescript-eslint/eslint-plugin": "^8.27.0",
|
||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.27.0",
|
||||||
"@vitejs/plugin-vue": "^5.2.1",
|
"@vitejs/plugin-vue": "^5.2.3",
|
||||||
"autoprefixer": "^10.4.21",
|
"autoprefixer": "^10.4.21",
|
||||||
"commitizen": "^4.3.1",
|
"commitizen": "^4.3.1",
|
||||||
"cz-git": "^1.11.1",
|
"cz-git": "^1.11.1",
|
||||||
"eslint": "^9.22.0",
|
"eslint": "^9.23.0",
|
||||||
"eslint-config-prettier": "^10.1.1",
|
"eslint-config-prettier": "^10.1.1",
|
||||||
"eslint-plugin-prettier": "^5.2.3",
|
"eslint-plugin-prettier": "^5.2.3",
|
||||||
"eslint-plugin-vue": "^10.0.0",
|
"eslint-plugin-vue": "^10.0.0",
|
||||||
"globals": "^15.15.0",
|
"globals": "^15.15.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"lint-staged": "^15.4.3",
|
"lint-staged": "^15.5.0",
|
||||||
"postcss": "^8.5.3",
|
"postcss": "^8.5.3",
|
||||||
"postcss-html": "^1.8.0",
|
"postcss-html": "^1.8.0",
|
||||||
"postcss-scss": "^4.0.9",
|
"postcss-scss": "^4.0.9",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"sass": "^1.85.1",
|
"sass": "^1.86.0",
|
||||||
"stylelint": "^16.15.0",
|
"stylelint": "^16.16.0",
|
||||||
"stylelint-config-html": "^1.1.0",
|
"stylelint-config-html": "^1.1.0",
|
||||||
"stylelint-config-recess-order": "^6.0.0",
|
"stylelint-config-recess-order": "^6.0.0",
|
||||||
"stylelint-config-recommended": "^15.0.0",
|
"stylelint-config-recommended": "^15.0.0",
|
||||||
@@ -107,11 +107,11 @@
|
|||||||
"stylelint-prettier": "^5.0.3",
|
"stylelint-prettier": "^5.0.3",
|
||||||
"terser": "^5.39.0",
|
"terser": "^5.39.0",
|
||||||
"typescript": "^5.8.2",
|
"typescript": "^5.8.2",
|
||||||
"typescript-eslint": "^8.26.1",
|
"typescript-eslint": "^8.27.0",
|
||||||
"unocss": "65.4.3",
|
"unocss": "65.4.3",
|
||||||
"unplugin-auto-import": "^19.1.1",
|
"unplugin-auto-import": "^19.1.1",
|
||||||
"unplugin-vue-components": "^28.4.1",
|
"unplugin-vue-components": "^28.4.1",
|
||||||
"vite": "^6.2.1",
|
"vite": "^6.2.2",
|
||||||
"vite-plugin-mock-dev-server": "^1.8.4",
|
"vite-plugin-mock-dev-server": "^1.8.4",
|
||||||
"vue-eslint-parser": "^10.1.1",
|
"vue-eslint-parser": "^10.1.1",
|
||||||
"vue-tsc": "^2.2.8"
|
"vue-tsc": "^2.2.8"
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import {
|
|||||||
UploadRawFile,
|
UploadRawFile,
|
||||||
UploadUserFile,
|
UploadUserFile,
|
||||||
UploadFile,
|
UploadFile,
|
||||||
|
UploadFiles,
|
||||||
UploadProgressEvent,
|
UploadProgressEvent,
|
||||||
UploadRequestOptions,
|
UploadRequestOptions,
|
||||||
} from "element-plus";
|
} from "element-plus";
|
||||||
@@ -147,7 +148,7 @@ watch(
|
|||||||
function handleBeforeUpload(file: UploadRawFile) {
|
function handleBeforeUpload(file: UploadRawFile) {
|
||||||
// 限制文件大小
|
// 限制文件大小
|
||||||
if (file.size > props.maxFileSize * 1024 * 1024) {
|
if (file.size > props.maxFileSize * 1024 * 1024) {
|
||||||
ElMessage.warning("上传图片不能大于" + props.maxFileSize + "M");
|
ElMessage.warning("上传文件不能大于" + props.maxFileSize + "M");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -190,10 +191,34 @@ const handleProgress = (event: UploadProgressEvent) => {
|
|||||||
/**
|
/**
|
||||||
* 上传成功
|
* 上传成功
|
||||||
*/
|
*/
|
||||||
const handleSuccess = (fileInfo: FileInfo) => {
|
const handleSuccess = (response: any, uploadFile: UploadFile, files: UploadFiles) => {
|
||||||
ElMessage.success("上传成功");
|
ElMessage.success("上传成功");
|
||||||
|
//只有当状态为success或者fail,代表文件上传全部完成了,失败也算完成
|
||||||
modelValue.value = [...modelValue.value, { name: fileInfo.name, url: fileInfo.url } as FileInfo];
|
if (
|
||||||
|
files.every((file: UploadFile) => {
|
||||||
|
return file.status === "success" || file.status === "fail";
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
let fileInfos = [] as FileInfo[];
|
||||||
|
files.map((file: UploadFile) => {
|
||||||
|
if (file.status === "success") {
|
||||||
|
//只取携带response的才是刚上传的
|
||||||
|
let res = file.response as FileInfo;
|
||||||
|
if (res) {
|
||||||
|
fileInfos.push({ name: res.name, url: res.url } as FileInfo);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//失败上传 从fileList删掉,不展示
|
||||||
|
fileList.value.splice(
|
||||||
|
fileList.value.findIndex((e) => e.uid === file.uid),
|
||||||
|
1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (fileInfos.length > 0) {
|
||||||
|
modelValue.value = [...modelValue.value, ...fileInfos];
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
:http-request="handleUpload"
|
:http-request="handleUpload"
|
||||||
:on-success="onSuccess"
|
:on-success="onSuccess"
|
||||||
:on-error="onError"
|
:on-error="onError"
|
||||||
multiple
|
|
||||||
>
|
>
|
||||||
<template #default>
|
<template #default>
|
||||||
<el-image v-if="modelValue" :src="modelValue" />
|
<el-image v-if="modelValue" :src="modelValue" />
|
||||||
|
|||||||
Reference in New Issue
Block a user