refactor: ♻️ 文件上传功能调整

This commit is contained in:
tk
2025-03-19 16:29:25 +08:00
committed by nsnail
parent 6fed7ec752
commit e0a4a40314
25 changed files with 77 additions and 40 deletions

View File

@ -10,12 +10,12 @@
},
"dependencies": {
"@element-plus/icons-vue": "2.3.1",
"ace-builds": "1.38.0",
"ace-builds": "1.39.0",
"aieditor": "1.3.5",
"axios": "1.7.9",
"axios": "1.8.1",
"crypto-js": "4.2.0",
"echarts": "5.6.0",
"element-plus": "2.9.4",
"element-plus": "2.9.5",
"json-bigint": "1.0.0",
"markdown-it": "14.1.0",
"markdown-it-emoji": "3.0.0",
@ -23,7 +23,7 @@
"sortablejs": "1.15.6",
"vkbeautify": "0.99.3",
"vue": "3.5.13",
"vue-i18n": "11.1.1",
"vue-i18n": "11.1.2",
"vue-router": "4.5.0",
"vue3-ace-editor": "2.2.4",
"vue3-json-viewer": "2.2.2",
@ -32,11 +32,11 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "5.2.1",
"prettier": "3.5.0",
"prettier": "3.5.3",
"prettier-plugin-organize-attributes": "1.0.0",
"sass": "1.84.0",
"terser": "5.38.2",
"vite": "6.1.0"
"sass": "1.85.1",
"terser": "5.39.0",
"vite": "6.2.1"
},
"browserslist": [
"> 1%",

View File

@ -27,6 +27,17 @@ export default {
},
},
/**
* 示例分组计数
*/
countBy: {
url: `${config.API_URL}/api/tpl/example/count.by`,
name: `示例分组计数`,
post: async function (data = {}, config = {}) {
return await http.post(this.url, data, config)
},
},
/**
* 创建示例
*/

View File

@ -19,7 +19,7 @@
:on-success="success"
:show-file-list="showFileList">
<slot>
<el-button :disabled="disabled" type="primary">Click to upload</el-button>
<el-button :disabled="disabled" type="primary">点击上传</el-button>
</slot>
<template #tip>
<div v-if="tip" class="el-upload__tip">{{ tip }}</div>

View File

@ -134,8 +134,8 @@ export default {
//默认值转换为数组
toArr(str) {
const _arr = []
const arr = str.split(',')
arr.forEach((item) => {
const arr = str?.split(',')
arr?.forEach((item) => {
if (item) {
const urlArr = item.split('/')
const fileName = urlArr[urlArr.length - 1]

View File

@ -10,8 +10,8 @@ export default {
parseData: function (res) {
return {
code: res.code, //分析状态字段结构
// fileName: null, //分析文件名称
src: res.data, //分析图片远程地址结构
fileName: res.data.fileName, //分析文件名称
src: res.data.url, //分析图片远程地址结构
msg: res.msg, //分析描述字段结构
}
},