Merge branch 'dev_vite' of ssh://18.167.251.121:10002/aidlab/aida_front into dev_vite

This commit is contained in:
X1627315083
2025-09-30 16:02:42 +08:00
11 changed files with 2365 additions and 893 deletions

8
components.d.ts vendored
View File

@@ -10,23 +10,15 @@ declare module 'vue' {
export interface GlobalComponents {
ABadge: typeof import('ant-design-vue/es')['Badge']
ABreadcrumb: typeof import('ant-design-vue/es')['Breadcrumb']
ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
ADatePicker: typeof import('ant-design-vue/es')['DatePicker']
ADrawer: typeof import('ant-design-vue/es')['Drawer']
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
AImage: typeof import('ant-design-vue/es')['Image']
AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
AModal: typeof import('ant-design-vue/es')['Modal']
APagination: typeof import('ant-design-vue/es')['Pagination']
APopover: typeof import('ant-design-vue/es')['Popover']
ARangePicker: typeof import('ant-design-vue/es')['RangePicker']
ASelect: typeof import('ant-design-vue/es')['Select']
ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
ASlider: typeof import('ant-design-vue/es')['Slider']
ASpace: typeof import('ant-design-vue/es')['Space']
ASpin: typeof import('ant-design-vue/es')['Spin']
ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
ASwitch: typeof import('ant-design-vue/es')['Switch']

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="288.000000pt" height="288.000000pt" viewBox="0 0 288.000000 288.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,288.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M379 2446 c-101 -36 -179 -116 -209 -214 -19 -62 -20 -93 -20 -792 0
-701 1 -730 20 -793 26 -83 88 -155 168 -194 l57 -28 1045 0 1045 0 47 22
c101 46 170 138 188 250 6 32 10 329 10 668 0 659 -3 692 -54 774 -35 54 -101
108 -163 131 -52 19 -78 20 -626 20 l-572 0 -46 53 c-25 29 -70 66 -100 82
l-54 30 -350 2 c-269 2 -358 0 -386 -11z m710 -175 c20 -11 42 -25 48 -33 6
-7 48 -92 92 -188 85 -183 118 -229 196 -274 73 -43 119 -46 635 -46 l490 0 0
-517 c0 -496 -1 -519 -20 -547 -10 -17 -36 -40 -57 -53 l-38 -23 -993 0 c-968
0 -994 0 -1031 20 -22 11 -48 35 -60 53 -21 34 -21 40 -21 777 0 737 0 743 21
777 12 18 37 42 57 53 34 18 60 19 340 20 280 0 306 -1 341 -19z m1381 -174
c53 -28 80 -75 80 -139 l0 -48 -506 0 c-498 0 -507 0 -541 21 -31 19 -74 88
-103 165 l-10 24 519 0 518 0 43 -23z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

View File

@@ -111,6 +111,13 @@ export default defineComponent({
.catch((res) => {accountHomeData.loadingShow = false});
}
const ungroupWeiXinModel = ()=>{
Modal.confirm({
title: t('frontPage.UnbindTip'),
okText: t('Yes'),
cancelText: t('No'),
mask:false,
centered:true,
onOk() {
Https.axiosGet(Https.httpUrls.unbindWeChat,).then((rv)=>{
message.success(t('frontPage.jsContent1'));
let value = {
@@ -122,7 +129,16 @@ export default defineComponent({
store.commit("upUserDetail", value)
})
}
});
}
const ungroupGoogleModel = ()=>{
Modal.confirm({
title: t('frontPage.UnbindTip'),
okText: t('Yes'),
cancelText: t('No'),
mask:false,
centered:true,
onOk() {
Https.axiosGet(Https.httpUrls.unbindGoogle,).then((rv)=>{
let value = {
accountExtendList:{
@@ -134,6 +150,8 @@ export default defineComponent({
message.success(t('frontPage.jsContent1'));
})
}
});
}
const modifyEmail = ()=>{
bindPageDom.bindEmail.init('Modify')

File diff suppressed because it is too large Load Diff

View File

@@ -42,25 +42,31 @@
:action="uploadUrl + '/api/element/upload'"
list-type="picture-card"
:data="{
...upload,
...upload
}"
:maxCount='1'
:maxCount="1"
:headers="{ Authorization: token }"
v-model:file-list="sketchboardList"
:before-upload="beforeUpload"
accept=".jpg,.png,.jpeg,.bmp"
@change="(file) => fileUploadChange(file)"
@change="file => fileUploadChange(file)"
>
<div class="drop-container">
<i class="fi fi-br-upload" :class="{ Guide_1_2_6:type_.type2 == 'Printboard'}" :title="$t('Generate.uploadTitle')" v-show="!isTextarea && upload.level1Type !== 'Moodboard' && scene?.value != 'Slogan' && scene?.value != 'Logo'"></i>
<div>{{ $t('PrintboardUpload.Upload') }}</div>
<!-- <i class="fi fi-br-upload" :class="{ Guide_1_2_6:type_.type2 == 'Printboard'}" :title="$t('Generate.uploadTitle')" v-show="!isTextarea && upload.level1Type !== 'Moodboard' && scene?.value != 'Slogan' && scene?.value != 'Logo'"></i> -->
<SvgIcon
name="Folder"
class="upload-icon icon"
style="font-size: 2rem"
/>
<div style="font-size: 1.2rem;">{{ $t('PrintboardUpload.Upload') }}</div>
</div>
</a-upload>
</a-menu-item>
<a-menu-item>
<div class="drop-container" @click.stop="handleOpenLibrarySelect">
<i class="fi fi-rr-followcollection"></i>
<div style="font-size: 1.4rem;">{{ $t('PrintboardUpload.Library') }}</div>
<i class="fi fi-rr-followcollection library-icon icon"></i>
<div style="font-size: 1.2rem;">{{ $t('PrintboardUpload.Library') }}</div>
</div>
</a-menu-item>
</a-menu>
@@ -75,10 +81,14 @@
@click="inputFocus()"
v-model="searchPictureName"
@paste="onPaste"
></textarea>
<i v-show="scene?.value == 'Slogan'" :title="$t('Generate.sloganTitle')" @click.stop="setSlogan" class="fi fi-rr-poll-h"></i>
<i
v-show="scene?.value == 'Slogan'"
:title="$t('Generate.sloganTitle')"
@click.stop="setSlogan"
class="fi fi-rr-poll-h"
></i>
<!-- <i v-show="!isTextarea" class="fi fi-br-expand" @click.stop="setTextareaShow"></i>
<i v-show="isTextarea" class="fi fi-bs-compress" @click.stop="setTextareaShow"></i> -->
</div>
@@ -90,10 +100,7 @@
:key="file"
:class="[driver__.driver ? 'showEvents' : '']"
>
<div
class="upload_file_item_content"
v-show="file?.status === 'uploading'"
>
<div class="upload_file_item_content" v-show="file?.status === 'uploading'">
<a-spin size="small" :indicator="indicator" tip="Uploading..." />
</div>
<div
@@ -101,29 +108,39 @@
v-show="file?.status === 'done' || file?.base64"
>
<img :src="file?.imgUrl" class="upload_img" />
<div class="delete_like_file_block" :class="[driver__.driver?'hideEvents':'']">
<i class="icon iconfont icon-shanchu operate_icon" @click.stop="deleteFile(index)"></i>
<div
class="delete_like_file_block"
:class="[driver__.driver ? 'hideEvents' : '']"
>
<i
class="icon iconfont icon-shanchu operate_icon"
@click.stop="deleteFile(index)"
></i>
</div>
</div>
</div>
</div>
<i class="fi fi-br-upload" style="margin-left: 2rem;" v-show="sketchboardList.length == 0" :title="$t('Generate.uploadproduct')">
<i
class="fi fi-br-upload"
style="margin-left: 2rem"
v-show="sketchboardList.length == 0"
:title="$t('Generate.uploadproduct')"
>
<a-upload
class="search_upImg"
:capture="null"
:action="uploadUrl + '/api/element/upload'"
list-type="picture-card"
:data="{
...upload,
...upload
}"
:maxCount='1'
:maxCount="1"
:headers="{ Authorization: token }"
v-model:file-list="sketchboardList"
:before-upload="beforeUpload"
accept=".jpg,.png,.jpeg,.bmp"
@change="(file) => fileUploadChange(file)"
>
</a-upload>
@change="file => fileUploadChange(file)"
></a-upload>
</i>
<!-- <div :title="$t('Generate.style')">
<generalMenu :dataList="printModelList" :isCanvas="type_.type2 == 'Sketchboard'" @setprintModel="setprintModel" :item="printModel"></generalMenu>
@@ -133,35 +150,66 @@
v-show="isTextarea"
class="search_textarea"
@input="ifMaximumLength"
:maxlength='inputShow?0:9999'
:maxlength="inputShow ? 0 : 9999"
@keydown.enter="getgenerate()"
@click.stop=""
v-model="searchPictureName"
></textarea>
<div class="generage_btn_box">
<div class="generage_btn started_btn" v-show="!isGenerate">
<i class="fi fi-bs-magic-wand" style="background-color: #000; font-size: 2.3rem; flex: 1;margin: 0;" @click="getgenerate()"></i>
<div class="icon iconfont icon-xiala"
v-show="(type_.type2 == 'Sketchboard') ||
(type_.type2 == 'Printboard' && scene.value == 'Pattern') || type_.type2 == 'Moodboard'" :class="{active:speedState}" @click.stop="openSpeed"></div>
<i
class="fi fi-bs-magic-wand"
style="background-color: #000; font-size: 2.3rem; flex: 1; margin: 0"
@click="getgenerate()"
></i>
<div
class="icon iconfont icon-xiala"
v-show="
type_.type2 == 'Sketchboard' ||
(type_.type2 == 'Printboard' && scene.value == 'Pattern') ||
type_.type2 == 'Moodboard'
"
:class="{ active: speedState }"
@click.stop="openSpeed"
></div>
<div class="content" v-show="speedState && scene?.value != 'extract'">
<div v-for="item in speedList"
v-show="(type_.type2 == 'Moodboard') ||
<div
v-for="item in speedList"
v-show="
type_.type2 == 'Moodboard' ||
(type_.type2 == 'Sketchboard' && item?.value != 'high') ||
(type_.type2 == 'Printboard')"
:key="item.value" :class="{active:item.value == speedData.value}" @click="setSpeed(item)" :title="item.title">{{ item.label }}</div>
type_.type2 == 'Printboard'
"
:key="item.value"
:class="{ active: item.value == speedData.value }"
@click="setSpeed(item)"
:title="item.title"
>
{{ item.label }}
</div>
</div>
<div class="content" v-show="speedState && scene?.value == 'extract'">
<div v-for="item in extractList" :class="{active:item.value == speedData.value}" :key="item.value" @click.stop="setSpeed(item)" :title="item.title">{{ item.label }}</div>
<div
v-for="item in extractList"
:class="{ active: item.value == speedData.value }"
:key="item.value"
@click.stop="setSpeed(item)"
:title="item.title"
>
{{ item.label }}
</div>
</div>
</div>
<div class="generage_btn started_btn" v-show="isGenerate && !remGenerate">
<i class="fi fi-br-loading"></i>
</div>
<div class="generage_btn started_btn" v-show="remGenerate" @click.stop="removeGenerate">
<div
class="generage_btn started_btn"
v-show="remGenerate"
@click.stop="removeGenerate"
>
{{ $t('Generate.Close') }}
</div>
</div>
<!-- <div v-show="isGenerate && !remGenerate" class="generage_btn started_btn" :class="{Guide_1_2_8:type_.type2 == 'Printboard'}" @click="getgenerate">
<i class="fi fi-br-loading"></i>
@@ -171,11 +219,29 @@
</div> -->
<span class="inputShowText" ref="inputShowText"></span>
</div>
<div class="search_keyword" v-if="workspace?.allKeywordsByStyle" v-show="isInputFocus" @click.stop="">
<div
class="search_keyword"
v-if="workspace?.allKeywordsByStyle"
v-show="isInputFocus"
@click.stop=""
>
<div class="search_keyword_center">
<div class="search_keyword_center_left">
<div v-if="type_.type2 == 'Printboard'" v-for="item in styleRecommend" @click.stop="cliSetKeyword(item)" class="search_keyword_center_item"> {{item}} </div>
<div v-for="item in workspace?.allKeywordsByStyle?.[type_.type2]" @click.stop="cliSetKeyword(item)" class="search_keyword_center_item"> {{item}} </div>
<div
v-if="type_.type2 == 'Printboard'"
v-for="item in styleRecommend"
@click.stop="cliSetKeyword(item)"
class="search_keyword_center_item"
>
{{ item }}
</div>
<div
v-for="item in workspace?.allKeywordsByStyle?.[type_.type2]"
@click.stop="cliSetKeyword(item)"
class="search_keyword_center_item"
>
{{ item }}
</div>
</div>
</div>
</div>
@@ -186,24 +252,50 @@
v-for="(item, index) in fileList"
:key="item.imgUrl"
@click="generageAdd(item)"
:class="[item.status != 'Success'?'hideEvents':'',item?.checked?'active':'']"
:class="[
item.status != 'Success' ? 'hideEvents' : '',
item?.checked ? 'active' : ''
]"
>
<img v-if="item?.imgUrl" v-lazy="item.imgUrl" @click.stop="generageAdd(item)">
<img v-if="item?.imgUrl" v-lazy="item.imgUrl" @click.stop="generageAdd(item)" />
<div v-else class="loading">
<a-spin size="large"></a-spin>
</div>
<sketchCategory v-show="item?.imgUrl" v-if="type_.type2 == 'Sketchboard' || type_.type2 == 'Printboard'" :isSpread="type_.type2 == 'Printboard'" :disignTypeList="sketchCatecoryList" :generateList="fileList" :item="item" :driver__="driver__.driver" :driverClass="{'class1': type_.type2 == 'Sketchboard'?'Guide_1_13':'','class2':type_.type2 == 'Sketchboard'?'Guide_1_13_1':''}"></sketchCategory>
<div
<sketchCategory
v-show="item?.imgUrl"
class="delete_like_file_block left1"
>
<i v-if="!item.like" class="fi fi-rr-heart" @click.stop="likeFile(item,'like',index)"></i>
<i v-else class="fi fi-sr-heart" :adminLike="!!item.like" @click.stop="likeFile(item,'noLike',index)"></i>
v-if="type_.type2 == 'Sketchboard' || type_.type2 == 'Printboard'"
:isSpread="type_.type2 == 'Printboard'"
:disignTypeList="sketchCatecoryList"
:generateList="fileList"
:item="item"
:driver__="driver__.driver"
:driverClass="{
class1: type_.type2 == 'Sketchboard' ? 'Guide_1_13' : '',
class2: type_.type2 == 'Sketchboard' ? 'Guide_1_13_1' : ''
}"
></sketchCategory>
<div v-show="item?.imgUrl" class="delete_like_file_block left1">
<i
v-if="!item.like"
class="fi fi-rr-heart"
@click.stop="likeFile(item, 'like', index)"
></i>
<i
v-else
class="fi fi-sr-heart"
:adminLike="!!item.like"
@click.stop="likeFile(item, 'noLike', index)"
></i>
</div>
<div v-show="item?.imgUrl" class="delete_like_file_block left">
<i class="fi fi-bs-expand-arrows-alt" @click.stop="scaleImage(index)"></i>
</div>
<div v-show="item?.imgUrl" class="delete_like_file_block" :title="t('LibraryPage.Delete')" @click.stop="deleteGenerate(index)">
<div
v-show="item?.imgUrl"
class="delete_like_file_block"
:title="t('LibraryPage.Delete')"
@click.stop="deleteGenerate(index)"
>
<span class="icon iconfont icon-shanchu operate_icon"></span>
</div>
</div>
@@ -219,26 +311,41 @@
ref="selectImages"
@select="handleImageSelect"
:api="Https.httpUrls.queryLibraryPage"
isLibrary/>
isLibrary
/>
</div>
</template>
<script lang="ts">
import { LoadingOutlined } from "@ant-design/icons-vue";
import { message, Upload, Modal } from "ant-design-vue";
import { defineComponent, computed, reactive, createVNode, h, ref,watch, nextTick, inject, toRefs, getCurrentInstance, onMounted, onUnmounted, } from "vue";
import { Https } from "@/tool/https";
import { useStore } from "vuex";
import GO from "@/tool/GO";
import { getCookie } from "@/tool/cookie";
import { getUploadUrl } from "@/tool/util";
import { LoadingOutlined } from '@ant-design/icons-vue'
import { message, Upload, Modal } from 'ant-design-vue'
import {
defineComponent,
computed,
reactive,
createVNode,
h,
ref,
watch,
nextTick,
inject,
toRefs,
getCurrentInstance,
onMounted,
onUnmounted
} from 'vue'
import { Https } from '@/tool/https'
import { useStore } from 'vuex'
import GO from '@/tool/GO'
import { getCookie } from '@/tool/cookie'
import { getUploadUrl } from '@/tool/util'
// import { forEach } from "jszip";
import scaleImage from "@/component/HomePage/scaleImage.vue";
import generalMenu from "@/component/HomePage/generalMenu.vue";
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { openGuide,driverObj__,driverIndex__ } from "@/tool/guide";
import createSlogan from "@/component/HomePage/createSlogan.vue";
import { useI18n } from "vue-i18n";
import sketchCategory from "@/component/HomePage/sketchCategory.vue";
import scaleImage from '@/component/HomePage/scaleImage.vue'
import generalMenu from '@/component/HomePage/generalMenu.vue'
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'
import { openGuide, driverObj__, driverIndex__ } from '@/tool/guide'
import createSlogan from '@/component/HomePage/createSlogan.vue'
import { useI18n } from 'vue-i18n'
import sketchCategory from '@/component/HomePage/sketchCategory.vue'
import SelectImages from '@/component/common/SelectImages.vue'
export default defineComponent({
@@ -561,12 +668,12 @@ export default defineComponent({
}
return lable;
};
},
}
},
methods: {
generageAdd(data: any) {
if (!data?.imgUrl) return
data.type_ = this.type_;
data.type_ = this.type_
data.type_.type1 = data.designType ? data.designType : this.type_.type1
data.resData = JSON.parse(JSON.stringify(data))
let maxImg = 8
@@ -580,54 +687,60 @@ export default defineComponent({
return
}
data.jsContent1 = this.t('uploadFile.jsContent1', { maxImg: maxImg })
this.store.commit("addGenerateMaterialFils", data);
this.store.commit('addGenerateMaterialFils', data)
// console.log(this.fileList);
},
beforeUpload(file: any) {
const isJpgOrPng =
file.type === "image/jpeg" ||
file.type === "image/png" ||
file.type === "image/jpg" ||
file.type === "image/bmp";
file.type === 'image/jpeg' ||
file.type === 'image/png' ||
file.type === 'image/jpg' ||
file.type === 'image/bmp'
if (!isJpgOrPng) {
message.info(this.t('Generate.jsContent1'));
message.info(this.t('Generate.jsContent1'))
}
const isLt2M = file.size / 1024 / 1024 < 5;
const isLt2M = file.size / 1024 / 1024 < 5
if (!isLt2M) {
message.info(this.t('Generate.jsContent2'));
message.info(this.t('Generate.jsContent2'))
}
return (isJpgOrPng && isLt2M) || Upload.LIST_IGNORE;
return (isJpgOrPng && isLt2M) || Upload.LIST_IGNORE
},
setprintModel(value: any) {
this.printModel = value
},
imageToSketch() {
if((!this.printModel?.id && !this.printModel?.value) || !this.sketchboardList?.[0]?.id)return message.info(this.t('Generate.jsContent4'));
if (
(!this.printModel?.id && !this.printModel?.value) ||
!this.sketchboardList?.[0]?.id
)
return message.info(this.t('Generate.jsContent4'))
this.loadingShow = true
let data = {
"elementId": this.sketchboardList[0].id,
elementId: this.sketchboardList[0].id,
gender: this.workspace.sex,
"style": this.printModel.value,
"styleImageId": this.printModel?.id?this.printModel?.id:''
style: this.printModel.value,
styleImageId: this.printModel?.id ? this.printModel?.id : ''
}
Https.axiosPost(Https.httpUrls.imageToSketch, data).then((rv)=>{
Https.axiosPost(Https.httpUrls.imageToSketch, data)
.then(rv => {
if (rv) {
this.sketchCatecoryList.forEach((itemCategory: any) => {
if (itemCategory.value == rv.category) {
rv.categoryValue = itemCategory?.value
rv.category = itemCategory?.name
}
});
})
this.fileList.push({
imgUrl: rv.url,
categoryValue: rv.categoryValue,
category: rv.category,
id: rv.id,
status:'Success',
status: 'Success'
})
this.loadingShow = false
}
}).catch(()=>{
})
.catch(() => {
this.loadingShow = false
})
},
@@ -644,30 +757,29 @@ export default defineComponent({
let data
if (this.scene?.value == 'extract') {
httpsUrl = Https.httpUrls.imageToSketch
if((!this.printModel?.id && !this.printModel?.value) || !this.sketchboardList?.[0]?.id)return message.info(this.t('Generate.jsContent4'));
if (
(!this.printModel?.id && !this.printModel?.value) ||
!this.sketchboardList?.[0]?.id
)
return message.info(this.t('Generate.jsContent4'))
data = {
"elementId": this.sketchboardList[0].id,
elementId: this.sketchboardList[0].id,
gender: this.workspace.sex,
"style": this.printModel.value,
"styleImageId": this.printModel?.id?this.printModel?.id:'',
modelName:this.speedData.value,//为1就是Print
style: this.printModel.value,
styleImageId: this.printModel?.id ? this.printModel?.id : '',
modelName: this.speedData.value //为1就是Print
}
} else {
if (this.searchPictureName) {
let arr = this.searchPictureName.split(/\s+/).length
if (arr > 250) {
message.info(
this.t('Generate.jsContent4')
);
message.info(this.t('Generate.jsContent4'))
return
}
} else {
if (this.sketchboardList?.[0]?.imgUrl) {
} else {
message.info(
this.t('Generate.jsContent5')
);
message.info(this.t('Generate.jsContent5'))
return
}
}
@@ -682,12 +794,14 @@ export default defineComponent({
}
let sloganText = ''
sloganText = this.searchPictureName
if(this.upload.level1Type == "Sketchboard"){
level2Type = this.sketchboardList?.[0]?.categoryValue?this.sketchboardList[0].categoryValue:''
if (this.upload.level1Type == 'Sketchboard') {
level2Type = this.sketchboardList?.[0]?.categoryValue
? this.sketchboardList[0].categoryValue
: ''
if (this.workspace.styleName) {
sloganText = `${this.workspace.styleName},${sloganText}`
}
}else if(this.upload.level1Type == "Printboard"){
} else if (this.upload.level1Type == 'Printboard') {
level2Type = this.scene?.value
if (level2Type == 'Slogan' && this.searchPictureName == '') {
sloganText = this.isSloganHint
@@ -695,7 +809,7 @@ export default defineComponent({
sloganText = `${this.printModel.value},${sloganText}`
}
if (!base64 && level2Type == 'Slogan') {
message.info(this.t('Generate.jsContent10'));
message.info(this.t('Generate.jsContent10'))
return
}
}
@@ -718,12 +832,11 @@ export default defineComponent({
this.generateLevel2Type = data.level2Type
}
this.isGenerate = true
// this.remGenerateTime = setTimeout(()=>{
// },10000)
Https.axiosPost(httpsUrl, data).then(
(rv) => {
Https.axiosPost(httpsUrl, data)
.then(rv => {
if (this.scene?.value == 'extract') {
rv = {
uniqueId: [rv]
@@ -735,8 +848,8 @@ export default defineComponent({
this.remGenerate = true //出现取消按钮
this.fileList.unshift(...rvData)
this.setGenerate(rv.uniqueId)
}
).catch(res=>{
})
.catch(res => {
this.generateLevel2Type = ''
this.isGenerate = false
clearInterval(this.remGenerateTime)
@@ -753,14 +866,12 @@ export default defineComponent({
zIndex: 99999,
centered: true,
onOk() {
this_.store.commit("setUpgradePlan", true);
this_.store.commit('setUpgradePlan', true)
},
onCancel(){
onCancel() {}
})
}
});
}
});
})
},
setGenerate(dataList: any) {
let data = dataList
@@ -770,39 +881,53 @@ export default defineComponent({
if (!this.isGenerate) return
if (!state) return
state = false
Https.axiosPost(Https.httpUrls.generateResult, data).then(
(rv) => {
Https.axiosPost(Https.httpUrls.generateResult, data)
.then(rv => {
state = true
if(this.isGenerate){//防止取消后有正在执行的获取状态
this.generateProceedList = rv.filter((item:any)=>item.status != 'Success' && item.status != 'Fail' && item.status != 'Invalid')
if (this.isGenerate) {
//防止取消后有正在执行的获取状态
this.generateProceedList = rv.filter(
(item: any) =>
item.status != 'Success' &&
item.status != 'Fail' &&
item.status != 'Invalid'
)
rv.forEach((element: any) => {
if (element.status == 'Success') {
element.imgUrl = element.url
element.id_ = GO.id++
let index = this.fileList.findIndex((item:any)=>item.taskId == element.taskId)
let index = this.fileList.findIndex(
(item: any) => item.taskId == element.taskId
)
this.fileList[index] = element
// this.fileList.unshift(element)
data = data.filter((item:any) => item !== element.taskId);
data = data.filter((item: any) => item !== element.taskId)
if (this.type_.type2 == 'Sketchboard') {
this.sketchCatecoryList.forEach((itemCategory: any) => {
if (itemCategory.value == element.category) {
element.categoryValue = itemCategory?.value
element.category = itemCategory?.name
}
});
})
} else {
element.categoryValue = this.scene?.value
element.category = this.scene?.name
}
} else if (element.status == 'Fail' || element.status == 'Invalid') {
data = data.filter((item:any) => item !== element.taskId);
this.fileList = this.fileList.filter((item:any) => item.taskId !== element.taskId);
console.log(data)
data = data.filter((item: any) => item !== element.taskId)
console.log(data)
this.fileList = this.fileList.filter(
(item: any) => item.taskId !== element.taskId
)
// message.info(this.t('Generate.everyTimeEffectPoor'));
}
});
if((data.length == 0)){
if(rv.filter((item:any)=>item.status == 'Invalid').length ==dataNum){
message.info(this.t('Generate.effectPoor'));
})
if (data.length == 0) {
if (
rv.filter((item: any) => item.status == 'Invalid').length == dataNum
) {
message.info(this.t('Generate.effectPoor'))
} else {
}
@@ -814,14 +939,14 @@ export default defineComponent({
this.generateLevel2Type = ''
}
}
}
).catch(res=>{
})
.catch(res => {
clearInterval(this.generateTime)
clearInterval(this.remGenerateTime)
this.isGenerate = false
this.remGenerate = false
this.generateLevel2Type = ''
});
})
}, 5000)
},
removeGenerate() {
@@ -830,7 +955,7 @@ export default defineComponent({
this.remGenerate = false
clearInterval(this.generateTime)
if (this.generateProceedList) {
let str = this.generateProceedList.map((obj:any) => obj.taskId).join(',');
let str = this.generateProceedList.map((obj: any) => obj.taskId).join(',')
let type = 'Generate'
if (this.generateLevel2Type == 'Logo') {
type = 'Logo'
@@ -842,15 +967,16 @@ export default defineComponent({
type: type
}
Https.axiosGet(Https.httpUrls.generateStopWaiting, {params:data}).then(
(rv) => {
Https.axiosGet(Https.httpUrls.generateStopWaiting, { params: data })
.then(rv => {
this.generateProceedList.forEach((generateProceedListItem: any) => {
this.fileList = this.fileList.filter((item:any) => generateProceedListItem.taskId!== item.taskId);
this.fileList = this.fileList.filter(
(item: any) => generateProceedListItem.taskId !== item.taskId
)
})
this.generateProceedList = []
}
).catch(res=>{
});
})
.catch(res => {})
}
},
setTextareaShow() {
@@ -863,10 +989,13 @@ export default defineComponent({
},
cliSetKeyword(value: any) {
let str = ''
if(this.searchPictureName[this.searchPictureName.length-1] != ',' && this.searchPictureName.length != 0){
if (
this.searchPictureName[this.searchPictureName.length - 1] != ',' &&
this.searchPictureName.length != 0
) {
str = ','
}
if(this.upload.level1Type == "Moodboard"){
if (this.upload.level1Type == 'Moodboard') {
if (this.workspace?.allKeywordsByStyle['Printboard'].indexOf(value) == -1) {
this.styleRecommend.push(value)
this.styleRecommend = [...new Set(this.styleRecommend)]
@@ -881,28 +1010,30 @@ export default defineComponent({
},
ifMaximumLength(event: any) {
clearTimeout(this.inputTime)
let inputBox = document.getElementsByClassName('generate')[0].getElementsByClassName('input_box')[0]
let inputBox = document
.getElementsByClassName('generate')[0]
.getElementsByClassName('input_box')[0]
let input = inputBox.getElementsByClassName('search_input')[0]
let textarea = event.target as HTMLTextAreaElement;
const scrollTop = textarea.scrollTop;
let textarea = event.target as HTMLTextAreaElement
const scrollTop = textarea.scrollTop
// 2. 计算单行高度
const lineHeight = parseInt(getComputedStyle(textarea).lineHeight) || 20; // 默认20px
const lineHeight = parseInt(getComputedStyle(textarea).lineHeight) || 20 // 默认20px
// 3. 重置高度为1行
textarea.style.height = lineHeight + 'px';
textarea.style.height = lineHeight + 'px'
// 4. 计算实际需要的高度
const newHeight = Math.max(lineHeight, textarea.scrollHeight);
const newHeight = Math.max(lineHeight, textarea.scrollHeight)
// 5. 应用新高度并恢复滚动位置
textarea.style.height = newHeight + 'px';
textarea.scrollTop = scrollTop;
textarea.style.height = newHeight + 'px'
textarea.scrollTop = scrollTop
this.inputTime = setTimeout(() => {
// let num1 = ((input as HTMLInputElement).value.match(/ /g) || []).length
// let num2 = (input as HTMLInputElement).value.split(' ').length
if (this.searchPictureName?.split(/\s+/).length > 250) {
(this.$refs.inputShowText as any).innerHTML = this.t('Generate.maximumLength')
;(this.$refs.inputShowText as any).innerHTML = this.t('Generate.maximumLength')
this.inputShow = true
} else {
this.inputShow = false
@@ -921,14 +1052,14 @@ export default defineComponent({
}, 200)
},
fileUploadChange(data: any) {
let file = data.file;
let file = data.file
let bor = true
if (file.status === "done") {
let res = JSON.parse(file.xhr.response);
if (file.status === 'done') {
let res = JSON.parse(file.xhr.response)
if (res.errCode == 0) {
let category: any = {
value: '',
name:'',
name: ''
}
if (this.sketchCatecoryList && this.type_.type2 == 'Sketchboard') {
this.sketchCatecoryList.forEach((item: any) => {
@@ -936,19 +1067,22 @@ export default defineComponent({
category.value = item?.value
category.name = item?.name
}
});
})
}
file.id = res.data.id;
file.imgUrl = res.data.url;
file.resData = res.data;
file.type_ = "upload";
file.id_ = GO.id++;
file.categoryValue = category?.value;
file.category = category?.name;
file.id = res.data.id
file.imgUrl = res.data.url
file.resData = res.data
file.type_ = 'upload'
file.id_ = GO.id++
file.categoryValue = category?.value
file.category = category?.name
//判断是否粘贴来的图片
let paste = this.sketchboardList.filter((v: any) => v.id === file.id);
if(paste.length == 0)this.sketchboardList.push(file);
this.sketchboardList = this.sketchboardList.filter((v: any) => v.status === "done");
let paste = this.sketchboardList.filter((v: any) => v.id === file.id)
if (paste.length == 0) this.sketchboardList.push(file)
this.sketchboardList = this.sketchboardList.filter(
(v: any) => v.status === 'done'
)
console.log('插入图片', this.sketchboardList)
nextTick().then(() => {
if (this.driver__.driver && this.type_.type2 == 'Printboard') {
driverObj__.moveNext()
@@ -957,23 +1091,22 @@ export default defineComponent({
} else {
bor = false
}
} else if (file.status === "error") {
} else if (file.status === 'error') {
bor = false
}
if (!bor) {
let index = -1;
let res:any = JSON.parse(file.xhr.response);
let index = -1
let res: any = JSON.parse(file.xhr.response)
this.sketchboardList.forEach((ele: any, index1: any) => {
if (file.uid === ele.uid) {
index = index1;
index = index1
}
});
})
if (index > -1) {
this.sketchboardList.splice(index, 1);
this.sketchboardList.splice(index, 1)
}
// message.warning(file.name + this.t('SketchboardUpload.jsContent1'));
message.warning(res.errMsg);
message.warning(res.errMsg)
}
},
setSlogan() {
@@ -988,7 +1121,7 @@ export default defineComponent({
let createSlogan: any = this.$refs.createSlogan
createSlogan.isDeleteSlogan = true
}
this.sketchboardList.splice(item, 1);
this.sketchboardList.splice(item, 1)
// if((this.sketchboardList.length<2 && this.moodboarList.length == 0) || this.sketchboardList.length == 0){
// this.printModel = {
// num:'',
@@ -1001,9 +1134,9 @@ export default defineComponent({
likeFile(item: any, str: string, index: number) {
if (str == 'like') {
let level2Type = ''
if(this.upload.level1Type == "Sketchboard"){
if (this.upload.level1Type == 'Sketchboard') {
level2Type = item.categoryValue
}else if(this.upload.level1Type == "Printboard"){
} else if (this.upload.level1Type == 'Printboard') {
level2Type = this.scene?.value
}
let data = {
@@ -1013,13 +1146,11 @@ export default defineComponent({
gender: this.workspace.sex,
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
}
Https.axiosPost(Https.httpUrls.generateLike, data).then(
(rv) => {
Https.axiosPost(Https.httpUrls.generateLike, data)
.then(rv => {
item.like = true
}
).catch(res=>{
});
})
.catch(res => {})
this.fileList[index].state = ''
this.generageAdd(item)
} else {
@@ -1029,12 +1160,11 @@ export default defineComponent({
generateDetailId: item.id,
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
}
Https.axiosGet(Https.httpUrls.generateDislike, {params:data}).then(
(rv) => {
Https.axiosGet(Https.httpUrls.generateDislike, { params: data })
.then(rv => {
item.like = false
}
).catch(res=>{
});
})
.catch(res => {})
}
},
deleteGenerate(index: any) {
@@ -1052,7 +1182,7 @@ export default defineComponent({
let a = _this.fileList.length - num
_this.fileList.splice(index - a, 1)
}
});
})
},
scaleImage(index: any) {
let scaleImage: any = this.$refs.scaleImage
@@ -1060,20 +1190,28 @@ export default defineComponent({
},
closeModal() {
// this.myMaterialModalShow = false
this.searchPictureName = "";
this.searchPictureName = ''
},
onPaste(e: any) {
if (this.sketchboardList.length != 0) return
if(e.clipboardData.files[0] && !this.isTextarea && this.upload.level1Type !== 'Moodboard' && this.scene?.value != 'Slogan' && this.scene?.value != 'Logo'){
let param = new FormData();
if (
e.clipboardData.files[0] &&
!this.isTextarea &&
this.upload.level1Type !== 'Moodboard' &&
this.scene?.value != 'Slogan' &&
this.scene?.value != 'Logo'
) {
let param = new FormData()
param.append('inPin', '0')
param.append('gender', this.workspace.sex)
param.append('ageGroup', this.workspace.ageGroup)
param.append('level1Type', this.upload.level1Type)
param.append('timeZone', Intl.DateTimeFormat().resolvedOptions().timeZone)
param.append('file',e.clipboardData.files[0]);
let config:any = {headers:{'Content-Type':'multipart/form-data','Accept':'*/*' }}
Https.axiosPost(Https.httpUrls.elementUpload, param, config).then((v)=>{
param.append('file', e.clipboardData.files[0])
let config: any = {
headers: { 'Content-Type': 'multipart/form-data', 'Accept': '*/*' }
}
Https.axiosPost(Https.httpUrls.elementUpload, param, config).then(v => {
let value = { data: v, errCode: 0 }
v.status = 'done'
let data = {
@@ -1085,10 +1223,8 @@ export default defineComponent({
}
}
this.fileUploadChange(data)
})
}
},
handleOpenLibrarySelect() {
let selectImages: any = this.$refs.selectImages
@@ -1101,13 +1237,18 @@ export default defineComponent({
errCode: 0,
imgUrl: data.url,
xhr: {
response:JSON.stringify({...data,errCode:0,imgUrl:data.url,status:'done'})
response: JSON.stringify({
...data,
errCode: 0,
imgUrl: data.url,
status: 'done'
})
}
}
this.sketchboardList = [file]
}
},
});
}
})
</script>
<style lang="less" scoped>
.generate {
@@ -1119,9 +1260,9 @@ export default defineComponent({
flex-direction: column;
position: relative;
// padding-top: calc(2.5rem*1.2);
.input_border{//输入框
.input_border {
//输入框
padding-top: 1rem;
}
.mark_loading {
@@ -1191,7 +1332,6 @@ export default defineComponent({
// display: block;
opacity: 1;
}
}
.upload_item {
.upload_file_item {
@@ -1247,7 +1387,6 @@ export default defineComponent({
}
}
}
}
.search_upImg :deep(.ant-upload.ant-upload-select-picture-card) {
@@ -1261,8 +1400,33 @@ export default defineComponent({
.drop-container {
display: flex;
align-items: center;
column-gap: 1rem;
// column-gap: 1rem;
justify-content: space-between;
padding: 0.25rem 0.3rem 0.25rem;
width: 7rem;
box-sizing: border-box;
// &,
// i {
// font-size: 1.6rem;
// }
.upload-icon {
font-size: 1.6rem !important;
align-items: normal;
justify-content: start;
:deep(.svg-icon) {
font-size: inherit !important;
}
}
.library-icon {
font-size: 1.4rem;
display: flex;
}
}
.fi-br-upload {
&:hover {
background-color: #f5f5f5;
border-radius: 5px;
}
}
</style>

View File

@@ -45,8 +45,8 @@
}"
:headers="{ Authorization: token }"
:before-upload="beforeUpload"
:multiple="!!upload.projectId"
v-model:file-list="fileList[productimgMenu.value]"
:multiple="true"
accept=".jpg,.png,.jpeg,.bmp"
@change="(file) => fileUploadChange(file)"
>
@@ -323,6 +323,9 @@ export default defineComponent({
watch(()=>store.state.HomeStoreModule.uploadElement.length,(newVal,oldVal)=>{
if(props.isDesignPage)return
productImgData.fileList[props.productimgMenu.value] = store.state.HomeStoreModule.uploadElement
if(productImgData.fileList[props.productimgMenu.value][0]){
productImgData.fileList[props.productimgMenu.value][0].isChecked = true
}
})
const productImgDom = reactive({
generalDragLeft:null as any,
@@ -435,11 +438,14 @@ export default defineComponent({
// if(props.productimgMenu.value == 'Relight'){
// file.type = "ToProductImage"
// }
productImgData.fileList[props.productimgMenu.value].filter((v: any) => v.status === "done");
let storeData = {
str:'add',
list:[file]
}
store.commit('setUploadElement',storeData)
}else{
bor = false
}
// this.showFileList = productImgData.fileList
} else if (file.status === "error") {
bor = false
}
@@ -467,9 +473,6 @@ export default defineComponent({
}
}
return (isJpgOrPng && isLt2M) || Upload.LIST_IGNORE;
}
let deleteFile = (index:any)=>{
productImgData.fileList[props.productimgMenu.value].splice(index,1)
}
let setGenerate = (item:any)=>{
item.isChecked = !item.isChecked
@@ -893,7 +896,6 @@ export default defineComponent({
setproduct,
fileUploadChange,
beforeUpload,
deleteFile,
setGenerate,
setUploadDelete,
likeFile,

View File

@@ -825,6 +825,7 @@ export default {
Modify: "修改",
jsContent1: "取消绑定成功",
jsContent2: "当前网络无法加载谷歌",
UnbindTip: "确认取消绑定吗?",
},
Renew: {
title: "选择你的最佳计划",
@@ -1413,5 +1414,7 @@ export default {
ToProductImage:'产品图',
Relight:'打光',
ChatRobot:'对话生成',
Yes:'是',
No:'否',
},
};

View File

@@ -825,6 +825,7 @@ export default {
Modify: "Modify",
jsContent1: "Successful discharge",
jsContent2: "The current network cannot load Google",
UnbindTip: "Are you sure to cancel the binding?",
},
Renew: {
title: "Find Your Ideal Plan",
@@ -1413,5 +1414,7 @@ export default {
ToProductImage:'ToProductImage',
Relight:'Relight',
ChatRobot:'ChatRobot',
Yes:'Yes',
No:'No',
},
};