新功能

This commit is contained in:
2026-02-18 16:33:16 +08:00
parent e8089f60be
commit 765ae19fb2
47 changed files with 2881 additions and 172 deletions

View File

@ -60,7 +60,7 @@
>
<img
v-if="this.form.logo"
:src="imagePath + this.form.logo"
:src="getImageUrl(this.form.logo)"
class="list-img"
/>
<i v-if="!this.form.logo" class="el-icon-plus"></i>
@ -108,6 +108,7 @@
<script>
import { saveBookCate } from '@/api/book'
import { getToken } from '@/utils/auth'
import { getUploadFileName } from '@/utils/upload'
export default {
name: 'bookCateForm',
props: {
@ -179,6 +180,11 @@ export default {
}
},
methods: {
getImageUrl(path) {
if (!path) return ''
if (/^https?:\/\//i.test(path)) return path
return (this.imagePath || '') + path
},
// 提交
doSubmit() {
const app = this
@ -195,8 +201,10 @@ export default {
this.$emit('closeDialog', 'bookCateDialog')
},
// 上传成功回调
handleUploadSuccess(file) {
this.form.logo = file.data.fileName
handleUploadSuccess(res) {
const fileName = getUploadFileName(res)
if (!fileName) return
this.form.logo = fileName
},
},
}