2023-10-30-语言适配 en
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
<div class="collection_modal_item">
|
||||
<div class="switch_type_list">
|
||||
<div class="switch_type_item select_swtich">
|
||||
<span>Upload</span>
|
||||
<span>{{ $t('MarketingSketchUpload.Upload') }}</span>
|
||||
</div>
|
||||
<div @click="openLibrary()" class="switch_type_item">
|
||||
<span>My Library</span>
|
||||
<span>{{ $t('MarketingSketchUpload.MyLibrary') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</div>
|
||||
<div class="upload_max_tip">
|
||||
<span class="icon iconfont icon-zhuyi"></span>
|
||||
<span>Maximum 15 images can be uploaded, Maximum 2M per image</span>
|
||||
<span>{{ $t('MarketingSketchUpload.maximumLength') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -61,12 +61,15 @@ import {getUploadUrl} from '@/tool/util'
|
||||
import {useStore} from 'vuex'
|
||||
import { message,Upload} from 'ant-design-vue';
|
||||
import Material from '@/component/HomePage/Material.vue'
|
||||
import { useI18n } from 'vue-i18n';
|
||||
export default defineComponent({
|
||||
components:{Material},
|
||||
setup(){
|
||||
let fileList:any = ref([])
|
||||
let {t} = useI18n()
|
||||
return {
|
||||
fileList
|
||||
fileList,
|
||||
t,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
@@ -115,18 +118,18 @@ export default defineComponent({
|
||||
if(index > -1){
|
||||
this.fileList.splice(index, 1)
|
||||
}
|
||||
message.error(file.name + 'upload failed')
|
||||
message.error(file.name + this.t('MarketingSketchUpload.jsContent1'))
|
||||
}
|
||||
},
|
||||
|
||||
beforeUpload(file:any){
|
||||
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg' || file.type === 'image/bmp';
|
||||
if (!isJpgOrPng) {
|
||||
message.warning('You can only upload Image file!');
|
||||
message.warning(this.t('MarketingSketchUpload.jsContent2'));
|
||||
}
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
message.warning('Image must smaller than 2MB!');
|
||||
message.warning(this.t('MarketingSketchUpload.jsContent3'));
|
||||
}
|
||||
return (isJpgOrPng && isLt2M) || Upload.LIST_IGNORE;
|
||||
},
|
||||
@@ -149,7 +152,7 @@ export default defineComponent({
|
||||
status:'done',
|
||||
}
|
||||
if(this.fileList.length == 15){
|
||||
message.warning('Maximum number of allowable file uploads has been exceeded')
|
||||
message.warning(this.t('MarketingSketchUpload.jsContent5'))
|
||||
break
|
||||
}
|
||||
this.fileList.push(data)
|
||||
|
||||
Reference in New Issue
Block a user