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

@@ -8,15 +8,15 @@
<div class="page_content_body">
<HeaderComponent></HeaderComponent>
<div class="history_page_body">
<div class="history_header">History</div>
<div class="history_header">{{ $t('HistoryPage.History') }}History</div>
<div class="history_table_search">
<a-range-picker class="range_picker" v-model:value="rangePickerValue" :placeholder="['Start Date', 'End Date']" valueFormat="YYYY-MM-DD">
<a-range-picker class="range_picker" v-model:value="rangePickerValue" :placeholder="[$t('HistoryPage.StartDate'), $t('HistoryPage.EndDate')]" valueFormat="YYYY-MM-DD">
<template #suffixIcon>
<span class="icon iconfont range_picker_icon icon-rili"></span>
</template>
</a-range-picker>
<div class="content_search_block">
<input class="search_input" placeholder="Search by collection name" v-model="searchCollectionName" @keydown.enter="searchHistoryList()">
<input class="search_input" :placeholder="$t('HistoryPage.inputContent1')" v-model="searchCollectionName" @keydown.enter="searchHistoryList()">
<div class="search_icon_block" @click="searchHistoryList()"><span class="icon iconfont icon-sousuo"></span></div>
</div>
</div>
@@ -33,10 +33,10 @@
}">
<template #bodyCell="{ column, text, record ,index}">
<div class="operate_list" v-if="column.title === 'Operations'">
<div class="operate_item" @click="turnToDetail(record)">Detail</div>
<div class="operate_item" @click="renameCollection(record,index)">Rename</div>
<div class="operate_item" @click="retrieveHome(record)">Retrieve</div>
<div class="operate_item" @click="deleteGroup(record, index)">Delete</div>
<div class="operate_item" @click="turnToDetail(record)">{{ $t('HistoryPage.Detail') }}</div>
<div class="operate_item" @click="renameCollection(record,index)">{{ $t('HistoryPage.Rename') }}</div>
<div class="operate_item" @click="retrieveHome(record)">{{ $t('HistoryPage.Retrieve') }}</div>
<div class="operate_item" @click="deleteGroup(record, index)">{{ $t('HistoryPage.Delete') }}</div>
</div>
</template>
</a-table>
@@ -56,9 +56,9 @@
>
<div class="collection_rename_content">
<div class="rename_form_content">
<input class="rename_form_input" placeholder="Enter a new name" v-model="newCollectionName" @keydown.enter="confrimRename()">
<input class="rename_form_input" :placeholder="$t('HistoryPage.inputContent2')" v-model="newCollectionName" @keydown.enter="confrimRename()">
</div>
<div class="rename_submit_button" @click="confrimRename()">Submit</div>
<div class="rename_submit_button" @click="confrimRename()">{{ $t('HistoryPage.Submit') }}</div>
</div>
</a-modal>
<RobotAssist></RobotAssist>
@@ -73,6 +73,7 @@ import { formatTime } from "@/tool/util"
import { Modal,message } from 'ant-design-vue';
import RobotAssist from "@/component/HomePage/RobotAssist.vue";
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { useI18n } from 'vue-i18n';
export default defineComponent({
components: {
HeaderComponent,
@@ -83,14 +84,14 @@ export default defineComponent({
let rangePickerValue:any = ref([])
let renameData:any = ref({}) //修改名字选中的数据
const columns:any = ref([
{ title: 'Collections Name', align:'center', ellipsis: true, width: 150, dataIndex: 'name', key: 'collectionName' },
{ title: 'Uptate Time', align:'center', ellipsis: true,width: 150, dataIndex: 'updateDate', key: 'updateTime',customRender:(record:any)=>{
{ title: useI18n().t('HistoryPage.CollectionsName'), align:'center', ellipsis: true, width: 150, dataIndex: 'name', key: 'collectionName' },
{ title: useI18n().t('HistoryPage.UptateTime'), align:'center', ellipsis: true,width: 150, dataIndex: 'updateDate', key: 'updateTime',customRender:(record:any)=>{
let time = formatTime(record.text / 1000, 'YYYY-MM-DD hh:mm:ss')
return time
}},
{ title: 'Sketch Counts', align:'center', ellipsis: true, width: 150, dataIndex: 'sketchCount', key: 'sketchCounts' },
{ title: useI18n().t('HistoryPage.SketchCounts'), align:'center', ellipsis: true, width: 150, dataIndex: 'sketchCount', key: 'sketchCounts' },
{
title: 'Operations',
title: useI18n().t('HistoryPage.Operations'),
key: 'operation',
align:'center',
fixed: 'right',
@@ -99,11 +100,13 @@ export default defineComponent({
},
]);
let collectionList:any = ref([])
let {t} = useI18n()
return {
rangePickerValue,
columns,
collectionList,
renameData,
t,
}
},
data(){
@@ -172,16 +175,17 @@ export default defineComponent({
}
Https.axiosPost(Https.httpUrls.deleteUserGroup,data).then(
(rv: any) => {
message.success('Deleted successfully')
message.success(this.t('HistoryPage.jsContent1'))
this.collectionList.splice(index,1)
}
);
}
Modal.confirm({
title: 'Do you really want to delete this collection? ',
title: this.t('HistoryPage.jsContent2'),
icon: createVNode(ExclamationCircleOutlined),
okText: 'Yes',
cancelText: 'No',
mask:false,
onOk() {
deleteGroupFun(record.id,index)
}
@@ -206,7 +210,7 @@ export default defineComponent({
}
Https.axiosPost(Https.httpUrls.updateUserGroupName,data).then(
(rv: any) => {
message.success('Change successfully')
message.success(this.t('HistoryPage.jsContent3'))
this.collectionList[this.renameData.index].name = this.newCollectionName
this.collectionList[this.renameData.index].updateDate = rv.updateDate
this.renameVisivle = false

View File

@@ -15,7 +15,7 @@
src="@/assets/images/homePage/null_img.png"
/> -->
<div class="new_collection_button" @click="startNewCollection()">
Get Started
{{ $t('HomeView.GetStarted') }}
</div>
</div>
<div class="is_finish_loading" v-show="isFinishLoading">
@@ -28,10 +28,10 @@
<div class="home_left_info" v-show="isHaveReviewCollection">
<div class="left_info_top">
<div class="button_second" @click="startNewCollection()">
Start
{{ $t('HomeView.Start') }}
</div>
<div class="button_first button_margin" @click="recollection()">
Edit
{{ $t('HomeView.Edit') }}
</div>
</div>
<div class="left_info_content scroll_style">
@@ -48,11 +48,11 @@
<div class="right_top">
<div class="right_top_left">
<div class="button_second" @click="designNewCollection()">
Design
{{ $t('HomeView.Design') }}
</div>
<div class="button_first button_margin_14" v-show="designCollectionId"
@click="resDesignCollection()">
Redesign
{{ $t('HomeView.Redesign') }}
</div>
</div>
</div>
@@ -60,8 +60,9 @@
<div class="right_content_block">
<div class="right_content_header">
<div class="content_header_left">
<i class="fi fi-rs-comments"></i><span class="content_header_des">Generated
Design</span>
<i class="fi fi-rs-comments"></i><span class="content_header_des">
{{ $t('HomeView.GeneratedDesign') }}
</span>
</div>
</div>
@@ -98,10 +99,10 @@
<div class="right_content_header">
<div class="content_header_left">
<i class="fi fi-rs-comments"></i><span class="content_header_des">Selected Design</span>
<i class="fi fi-rs-comments"></i><span class="content_header_des">{{ $t('HomeView.SelectedDesign') }}</span>
</div>
<div class="button_second" v-show="likeDesignCollectionList.length" @click="exportCanvas()">
Export
{{ $t('HomeView.Export') }}
</div>
</div>
@@ -201,6 +202,8 @@ import { LoadingOutlined } from "@ant-design/icons-vue";
import draggable from 'vuedraggable'
import JSZip from "jszip";
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
import i18n from "@/lang";
import { useI18n } from "vue-i18n";
const FileSaver = require("file-saver");
export default defineComponent({
@@ -239,6 +242,7 @@ export default defineComponent({
height:'',
}
let userInfo:any = {}
let {t} = useI18n()
return {
store,
likeDesignCollectionList,
@@ -249,6 +253,7 @@ export default defineComponent({
contentImgMax,
contentImg,
userInfo,
t,
};
},
data() {
@@ -444,7 +449,7 @@ export default defineComponent({
this.store.state.UploadFilesModule.allBoardData;
if (!colorBoards || colorBoards?.length < 1) {
message.warning(
"You must choose one or more colors for further process."
this.t('HomeView.jsContent1')
);
return;
}
@@ -481,7 +486,7 @@ export default defineComponent({
this.store.state.UploadFilesModule.allBoardData;
if (!colorBoards || colorBoards?.length < 1) {
message.warning(
"You must choose one or more colors for further process."
this.t('HomeView.jsContent2')
);
return;
}
@@ -976,7 +981,7 @@ export default defineComponent({
});
})
.catch((res) => {
message.warning("Failed to export the file");
message.warning(this.t('HomeView.jsContent3'));
this.isShowMark = false;
});
},

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
}