publish: 发布2.7.4版本Beta (#1880)
* 媒体库增加批量导入URL * fix 描述错误 * feature: 自动化代码方法支持增加方法描述 * update: 更新依赖,升级为最新版本 * feature: 自动化代码预览部分支持黑夜模式 * fixed: 修复keepalive上线后失效的bug * feature: 增加自动化基础模板功能 * feature: 增加自动化基础模板功能 * 将用户配置保存到数据库,刷新或者异地登录配置不丢失 * update: 清除无用的userinfo配置信息 * fixed: 清理开发阶段页面无端进入404的bug * feature: 前端主题配置跟随用户,不再单独设置json编译生效。 * feature: 增加个人中心配置兼容性 * fix(package): 包名设置为中文会导致无法自动生成代码,禁止包名设置为中文 * feature: 格式化代码 * feature: 对严格模式新建根角色进行调整。 * feature: 版本变更为2.7.4 --------- Co-authored-by: sliboy <34034053+sliboy@users.noreply.github.com> Co-authored-by: ba0ch3ng <ba0ch3ng@foxmail.com> Co-authored-by: task <121913992@qq.com> Co-authored-by: task <ms.yangdan@gmail.com> Co-authored-by: 爱丽-黑子 <62006632+ailiheizi@users.noreply.github.com> Co-authored-by: sliboy <sliboy@hotmail.com>
This commit is contained in:
co-authored by
sliboy
ba0ch3ng
task
task
爱丽-黑子
sliboy
parent
df3fc0a9ef
commit
c20ea7e030
@@ -15,9 +15,16 @@
|
||||
:max-w-h="1080"
|
||||
@on-success="getTableData"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="upload"
|
||||
@click="importUrlFunc"
|
||||
>
|
||||
导入URL
|
||||
</el-button>
|
||||
<el-input
|
||||
v-model="search.keyword"
|
||||
class="keyword"
|
||||
class="w-72"
|
||||
placeholder="请输入文件名或备注"
|
||||
/>
|
||||
<el-button
|
||||
@@ -122,12 +129,12 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getFileList, deleteFile, editFileName } from '@/api/fileUploadAndDownload'
|
||||
import {getFileList, deleteFile, editFileName, importURL} from '@/api/fileUploadAndDownload'
|
||||
import { downloadImage } from '@/utils/downloadImg'
|
||||
import CustomPic from '@/components/customPic/index.vue'
|
||||
import UploadImage from '@/components/upload/image.vue'
|
||||
import UploadCommon from '@/components/upload/common.vue'
|
||||
import { formatDate } from '@/utils/format'
|
||||
import {CreateUUID, formatDate} from '@/utils/format'
|
||||
import WarningBar from '@/components/warningBar/warningBar.vue'
|
||||
|
||||
import { ref } from 'vue'
|
||||
@@ -228,7 +235,7 @@ const editFileNameFunc = async(row) => {
|
||||
type: 'success',
|
||||
message: '编辑成功!',
|
||||
})
|
||||
getTableData()
|
||||
await getTableData()
|
||||
}
|
||||
}).catch(() => {
|
||||
ElMessage({
|
||||
@@ -237,11 +244,61 @@ const editFileNameFunc = async(row) => {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入URL
|
||||
*/
|
||||
const importUrlFunc = () => {
|
||||
ElMessageBox.prompt('格式:文件名|链接或者仅链接。', '导入', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'textarea',
|
||||
inputPlaceholder: '我的图片|https://my-oss.com/my.png\nhttps://my-oss.com/my_1.png',
|
||||
inputPattern: /\S/,
|
||||
inputErrorMessage: '不能为空',
|
||||
}).then(async({ value }) => {
|
||||
let data = value.split('\n')
|
||||
let importData = []
|
||||
data.forEach(item => {
|
||||
let oneData = item.trim().split('|')
|
||||
let url, name
|
||||
if (oneData.length > 1) {
|
||||
name = oneData[0].trim()
|
||||
url = oneData[1]
|
||||
} else {
|
||||
url = oneData[0].trim()
|
||||
let str = url.substring(url.lastIndexOf('/') + 1)
|
||||
name = str.substring(0, str.lastIndexOf('.'))
|
||||
}
|
||||
if (url) {
|
||||
importData.push({
|
||||
name: name,
|
||||
url: url,
|
||||
tag: url.substring(url.lastIndexOf(".") + 1),
|
||||
key: CreateUUID()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const res = await importURL(importData)
|
||||
if (res.code === 0) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '导入成功!',
|
||||
})
|
||||
await getTableData()
|
||||
}
|
||||
}).catch(() => {
|
||||
ElMessage({
|
||||
type: 'info',
|
||||
message: '取消导入',
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.name {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user