fix bug of banner
This commit is contained in:
Vendored
-3
@@ -50,9 +50,6 @@ declare module '@vue/runtime-core' {
|
||||
ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
|
||||
ASwitch: typeof import('ant-design-vue/es')['Switch']
|
||||
ATable: typeof import('ant-design-vue/es')['Table']
|
||||
ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
||||
ATabs: typeof import('ant-design-vue/es')['Tabs']
|
||||
ATag: typeof import('ant-design-vue/es')['Tag']
|
||||
ATextarea: typeof import('ant-design-vue/es')['Textarea']
|
||||
ATimePicker: typeof import('ant-design-vue/es')['TimePicker']
|
||||
ATooltip: typeof import('ant-design-vue/es')['Tooltip']
|
||||
|
||||
@@ -68,7 +68,7 @@ import UploadPic from "@/components/UploadPic.vue"
|
||||
import {updateBannerConst, getHeaderBannerConst} from "@/api/consts"
|
||||
import '@vueup/vue-quill/dist/vue-quill.snow.css'
|
||||
import {QuillEditor} from '@vueup/vue-quill'
|
||||
import {baseURL} from "@root/config";
|
||||
import {normalizeUploadFileResponse} from '@/utils/file'
|
||||
|
||||
const benefitsList = ref<IBenefits[]>([])
|
||||
let id: number | null = null
|
||||
@@ -100,14 +100,19 @@ function removeRow(index: number) {
|
||||
benefitsList.value.splice(index, 1)
|
||||
}
|
||||
|
||||
async function handleUpload(file: any, index: number, size: string) {
|
||||
benefitsList.value[index][size] = `${baseURL}/${file.src}`
|
||||
function handleUpload(response: unknown, index: number, field: keyof IBenefits) {
|
||||
const fileResource = normalizeUploadFileResponse(response)
|
||||
|
||||
if (!fileResource?.full_src) {
|
||||
message.error('خطا در ساخت آدرس تصویر')
|
||||
return
|
||||
}
|
||||
|
||||
benefitsList.value[index][field] = fileResource.full_src
|
||||
}
|
||||
|
||||
function handelRemoveFile(index: number, size: string) {
|
||||
// console.log( benefitsList.value.splice(benefitsList?.value[index], 1))
|
||||
|
||||
benefitsList.value.splice(index, 1)
|
||||
function handelRemoveFile(index: number, field: keyof IBenefits) {
|
||||
benefitsList.value[index][field] = null
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
|
||||
Reference in New Issue
Block a user