|
@@ -86,6 +86,7 @@ getDict({
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
const appStore = usePageStore()
|
|
const appStore = usePageStore()
|
|
const dialogVisible = ref(false)
|
|
const dialogVisible = ref(false)
|
|
|
|
+
|
|
// const fileList = ref([])
|
|
// const fileList = ref([])
|
|
const crudSchemas: CrudSchema[] = [
|
|
const crudSchemas: CrudSchema[] = [
|
|
{
|
|
{
|
|
@@ -135,11 +136,20 @@ const crudSchemas: CrudSchema[] = [
|
|
let file = data.file
|
|
let file = data.file
|
|
let formData = new FormData()
|
|
let formData = new FormData()
|
|
formData.append('file', file)
|
|
formData.append('file', file)
|
|
- uploadFile(formData).then((response) => {
|
|
|
|
- currentRow.value.bannerUrl = response.data.virtualPath
|
|
|
|
|
|
+ uploadFile(file.size <= 1024 * 1000 ? formData : file).then((response) => {
|
|
|
|
+ console.log(file)
|
|
|
|
+ console.log(response)
|
|
|
|
+ let resUrl = ''
|
|
|
|
+ if (file.size <= 1024 * 1000) {
|
|
|
|
+ resUrl = response.data.virtualPath
|
|
|
|
+ } else {
|
|
|
|
+ resUrl = response.url
|
|
|
|
+ }
|
|
|
|
+ console.log(resUrl)
|
|
|
|
+ currentRow.value.bannerUrl = resUrl
|
|
const write = unref(writeRef)
|
|
const write = unref(writeRef)
|
|
write?.setValues({
|
|
write?.setValues({
|
|
- bannerUrl: response.data.virtualPath
|
|
|
|
|
|
+ bannerUrl: resUrl
|
|
})
|
|
})
|
|
delLoading.value = false
|
|
delLoading.value = false
|
|
})
|
|
})
|
|
@@ -156,7 +166,7 @@ const crudSchemas: CrudSchema[] = [
|
|
token: getStorage('token')
|
|
token: getStorage('token')
|
|
},
|
|
},
|
|
onSuccess: (response) => {
|
|
onSuccess: (response) => {
|
|
- currentRow.value.bannerUrl = response.data.virtualPath
|
|
|
|
|
|
+ // currentRow.value.bannerUrl = response.url
|
|
},
|
|
},
|
|
slots: {
|
|
slots: {
|
|
default: () => <ElButton type="primary">上传文件</ElButton>
|
|
default: () => <ElButton type="primary">上传文件</ElButton>
|