2023-10-30-语言适配 en

This commit is contained in:
2023-10-30 17:26:36 +08:00
parent cec54c175b
commit 2bb795c05b
33 changed files with 969 additions and 2745 deletions

View File

@@ -40,11 +40,11 @@
accept=".jpg,.png,.jpeg,.bmp"
@change="fileUploadChange"
>
<div>Upload</div>
<div>{{ $t('LibraryPage.Upload') }}</div>
</a-upload>
<div v-show="uploadGenerate != 'Upload'">Upload</div>
<div v-show="uploadGenerate != 'Upload'">{{ $t('LibraryPage.Upload') }}</div>
</div>
<div v-show="selectCode != 'Models'" class='header_operate_item pointer' :class="{operate_select:uploadGenerate == 'Generate'}" @click="uploadGenerateOpen('Generate')">Generate</div>
<div v-show="selectCode != 'Models'" class='header_operate_item pointer' :class="{operate_select:uploadGenerate == 'Generate'}" @click="uploadGenerateOpen('Generate')">{{ $t('LibraryPage.Generate') }}</div>
</div>
<div class="librart_headr_right">
@@ -84,11 +84,11 @@
<div class="content_body_header">
<div class="content_body_header_left">
<div class="content_body_header_right">
<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="deleteBatchPic()">Delete</div>
<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="showRenameModal('','batch')">Rename</div>
<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="deleteBatchPic()">{{ $t('LibraryPage.Delete') }}</div>
<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="showRenameModal('','batch')">{{ $t('LibraryPage.Rename') }}</div>
</div>
<div class="content_search_block">
<input class="search_input" placeholder="Search by your style code" v-model="searchPictureName" @keydown.enter="getLibraryList()">
<input class="search_input" :placeholder="$t('LibraryPage.inputContent1')" v-model="searchPictureName" @keydown.enter="getLibraryList()">
<!-- <div class="search_icon_block" @click="getLibraryList()"><span class="icon iconfont icon-sousuo"></span></div> -->
<div class="generage_btn search_icon_block" @click="getLibraryList()"><span class="icon iconfont icon-sousuo"></span></div>
@@ -96,7 +96,7 @@
</div>
<div v-show="imgList.length" :class="['check_all_block',selectImgList.length == imgList.length ? 'check_all' : '']" @click="selectAllImg()">
<div class="check_block"><div class="check_block_body" v-show="selectImgList.length == imgList.length && imgList.length"></div></div>
<div>all</div>
<div>{{ $t('LibraryPage.all') }}</div>
</div>
</div>
@@ -147,7 +147,7 @@
v-model="checkbox[0].type"
@click="setKeyword(0)"
/>
<span>Image Only</span>
<span>{{ $t('LibraryPage.ImageOnly') }}</span>
</label>
</div>
<div class="checkboxItem">
@@ -157,7 +157,7 @@
v-model="checkbox[1].type"
@click="setKeyword(1)"
/>
<span>Text Only</span>
<span>{{ $t('LibraryPage.TextOnly') }}</span>
</label>
</div>
<div class="checkboxItem">
@@ -167,21 +167,21 @@
v-model="checkbox[2].type"
@click="setKeyword(2)"
/>
<span>Text-Image</span>
<span>{{ $t('LibraryPage.TextImage') }}</span>
</label>
</div>
</div>
<div class="input_box" :class="{active:inputShow}">
<input class="search_input" @input="ifMaximumLength" :maxlength='inputShow?0:9999' :class="{active:checkbox[0].type}" :readonly="checkbox[0].type" placeholder="Prompt input" v-model="captionGeneration">
<div class="generage_btn started_btn" @click.stop="getgenerate">Generate</div>
<span>The entered content exceeds the maximum length.</span>
<input class="search_input" @input="ifMaximumLength" :maxlength='inputShow?0:9999' :class="{active:checkbox[0].type}" :readonly="checkbox[0].type" :placeholder="$t('LibraryPage.inputContent2')" v-model="captionGeneration">
<div class="generage_btn started_btn" @click.stop="getgenerate">{{ $t('LibraryPage.Generate') }}</div>
<span>{{ $t('LibraryPage.maximumLength') }}</span>
</div>
<div v-show="selectCode == 'Printboard'" class="printModel">
<div @click.stop="PrintModel">{{ printModel.name }}</div>
<ul v-show="printModel.optype">
<li class="printModel_item" @click="setprintModel(1)">Model1</li>
<li class="printModel_item" @click="setprintModel(2)">Model2</li>
<li class="printModel_item" @click="setprintModel(1)">{{ $t('LibraryPage.Model1') }}</li>
<li class="printModel_item" @click="setprintModel(2)">{{ $t('LibraryPage.Model2') }}</li>
</ul>
</div>
<div class="upload_item">
@@ -287,11 +287,11 @@
>
<div class="collection_rename_content">
<div class="rename_form_content">
<input class="rename_form_input" placeholder="Enter a new name" v-model="newPicName" @keydown.enter="confrimRename()">
<input class="rename_form_input" :placeholder="$t('LibraryPage.inputContent3')" v-model="newPicName" @keydown.enter="confrimRename()">
</div>
<div class="rename_button_list">
<div class="rename_button_item rename_cancel_button" @click="closeRenameModal()">Cancel</div>
<div class="rename_button_item rename_submit_button" @click="confrimRename()">Sure</div>
<div class="rename_button_item rename_cancel_button" @click="closeRenameModal()">{{ $t('LibraryPage.Cancel') }}</div>
<div class="rename_button_item rename_submit_button" @click="confrimRename()">{{ $t('LibraryPage.Sure') }}</div>
</div>
</div>
</a-modal>
@@ -321,6 +321,7 @@ import {getUploadUrl,isMoible} from '@/tool/util'
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import { getCookie } from "@/tool/cookie";
import { useI18n } from "vue-i18n";
export default defineComponent({
components: {
HeaderComponent,
@@ -330,12 +331,12 @@ export default defineComponent({
},
setup() {
let menuList = ref([
{title:'Moodboard',code:'Moodboard',icon:'fi fi-rr-grid',showChildren:false,children:[]},
{title:'Prints',code:'Printboard',icon:'fi fi-rs-objects-column',showChildren:false,children:[]},
{title:useI18n().t('LibraryPage.Moodboard'),code:'Moodboard',icon:'fi fi-rr-grid',showChildren:false,children:[]},
{title:useI18n().t('LibraryPage.Prints'),code:'Printboard',icon:'fi fi-rs-objects-column',showChildren:false,children:[]},
// {title:'Sketches',code:'SketchboardFirst',icon:'fi icon iconfont icon-a-waitao_changkuanwaitao11x',showChildren:false,children:[{title:'Apparel',code:'Sketchboard'}]},
{title:'Sketches',code:'Sketchboard',icon:'fi icon iconfont icon-a-waitao_changkuanwaitao11x',showChildren:false,children:[]},
{title:useI18n().t('LibraryPage.Sketches'),code:'Sketchboard',icon:'fi icon iconfont icon-a-waitao_changkuanwaitao11x',showChildren:false,children:[]},
// {title:'Market Sketch',code:'MarketingSketch',icon:'icon-fuwushichang',showChildren:false,children:[]},
{title:'Mannequins',code:'Models',icon:'fi fi-rs-people',showChildren:false,children:[]},
{title:useI18n().t('LibraryPage.Mannequins'),code:'Models',icon:'fi fi-rs-people',showChildren:false,children:[]},
])
let selectImgList:any = ref([])
@@ -387,6 +388,9 @@ export default defineComponent({
optype:false,
name:'model1'
})
let {t} = useI18n()
console.log();
return {
menuList,
selectImgList,
@@ -416,7 +420,8 @@ export default defineComponent({
inputTime,
generateList,
selectGenerateList,
printModel
printModel,
t
}
},
data(this_) {
@@ -614,10 +619,11 @@ export default defineComponent({
deleteSinglePic(data:any,index:any){
let _this = this
Modal.confirm({
title: 'Are you sure to delete the picture?',
title: this.t('LibraryPage.jsContent1'),
icon: createVNode(ExclamationCircleOutlined),
okText: 'Yes',
cancelText: 'No',
mask:false,
// centered:true,
onOk() {
_this.confirmDeletePic(data,index)
@@ -632,7 +638,7 @@ export default defineComponent({
}
let _this = this
Modal.confirm({
title: 'Are you sure to delete the picture?',
title: this.t('LibraryPage.jsContent2'),
icon: createVNode(ExclamationCircleOutlined),
okText: 'Yes',
cancelText: 'No',
@@ -665,11 +671,11 @@ export default defineComponent({
beforeUpload(file:any,fileList: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('LibraryPage.jsContent3'));
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
message.warning('Image must smaller than 2MB!');
message.warning(this.t('LibraryPage.jsContent4'));
}
if(isJpgOrPng && isLt2M){
this.currentUploadFileNum = fileList.length
@@ -717,11 +723,12 @@ export default defineComponent({
affirmCstomRequest(data:any){
let _this = this
Modal.confirm({
title: 'This picture has been uploaded whether to continue uploading ',
title: this.t('LibraryPage.jsContent5'),
icon: createVNode(ExclamationCircleOutlined),
okText: 'Yes',
cancelText: 'No',
mask:false,
zIndex:99999,
// centered:true,
onOk() {
data.checkMd5 = 0
@@ -895,14 +902,14 @@ export default defineComponent({
let arr = this.captionGeneration.split(/\s+/).length
if(arr > 75){
message.warning(
"The entered content exceeds the maximum length."
this.t('LibraryPage.jsContent6')
);
return
}
}else{
message.warning(
"Please enter content"
this.t('LibraryPage.jsContent7')
);
return
}