2023-11-08 09:31:40 +08:00
|
|
|
<template>
|
2024-12-11 16:26:36 +08:00
|
|
|
<div ref="scaleImageModal">
|
2023-11-08 09:31:40 +08:00
|
|
|
<a-modal
|
2024-05-22 10:45:52 +08:00
|
|
|
class="scaleImage_modal generalModel"
|
2023-11-08 09:31:40 +08:00
|
|
|
v-model:visible="scaleImage"
|
|
|
|
|
:footer="null"
|
2024-12-11 16:26:36 +08:00
|
|
|
:get-container="() => $refs.scaleImageModal"
|
2024-01-10 14:09:44 +08:00
|
|
|
width="78%"
|
2023-11-08 09:31:40 +08:00
|
|
|
:maskClosable="false"
|
|
|
|
|
:centered="true"
|
|
|
|
|
:closable="false"
|
2023-12-15 11:10:32 +08:00
|
|
|
:mask="scaleImageMask"
|
2023-11-28 16:21:00 +08:00
|
|
|
:keyboard="false"
|
2023-11-08 09:31:40 +08:00
|
|
|
:destroyOnClose="true"
|
|
|
|
|
>
|
2024-05-22 10:45:52 +08:00
|
|
|
<div class="generalModel_btn">
|
2024-12-11 16:26:36 +08:00
|
|
|
<div class="generalModel_closeIcon" @click.stop="cancelDsign()">
|
|
|
|
|
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2025-01-07 17:15:28 +08:00
|
|
|
<circle cx="23" cy="23" r="23" fill="white" fill-opacity="0.3"/>
|
|
|
|
|
<rect x="32.5063" y="12" width="3" height="29" rx="1.5" transform="rotate(45 32.5063 12)" fill="white"/>
|
|
|
|
|
<rect x="34.6274" y="32.5059" width="3" height="29" rx="1.5" transform="rotate(135 34.6274 32.5059)" fill="white"/>
|
|
|
|
|
</svg>
|
|
|
|
|
|
2023-11-08 09:31:40 +08:00
|
|
|
</div>
|
2024-12-11 16:26:36 +08:00
|
|
|
<div class="generalModel_closeIcon download" @click.stop="download()">
|
2023-11-08 09:31:40 +08:00
|
|
|
<i class="fi fi-rr-down-to-line"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="scaleImage_content">
|
2024-07-03 11:39:01 +08:00
|
|
|
<div v-if="isProductimg" class="productImg_modal">
|
|
|
|
|
<div class="productImg_left">
|
|
|
|
|
<div class="productImg_content_item_title productImg_content_item_title_menu">
|
2025-02-04 16:40:00 +08:00
|
|
|
<span v-if="scaleImageList[scaleImageIndex]?.resultType == 'ToProductImage'">{{$t('ProductImg.MagicTools')}}</span>
|
|
|
|
|
<span v-if="scaleImageList[scaleImageIndex]?.resultType == 'Relight'">{{$t('ProductImg.relightingTool')}}</span>
|
2024-07-03 11:39:01 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="input_border productImg_content_item_generate">
|
|
|
|
|
<div class="input_box">
|
|
|
|
|
<div class="input_box_btnBox">
|
|
|
|
|
<input
|
|
|
|
|
class="search_input"
|
|
|
|
|
:placeholder="$t('Generate.inputContent1')"
|
|
|
|
|
v-model="productimgSearchName"
|
|
|
|
|
@keydown.enter="getPrductimg()"
|
|
|
|
|
/>
|
|
|
|
|
<i v-show="!productimgIsTextarea" class="fi fi-br-expand" @click.stop="()=>productimgIsTextarea = !productimgIsTextarea"></i>
|
|
|
|
|
<i v-show="productimgIsTextarea" class="fi fi-bs-compress" @click.stop="()=>productimgIsTextarea = !productimgIsTextarea"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<textarea
|
|
|
|
|
v-show="productimgIsTextarea"
|
|
|
|
|
class="search_textarea "
|
|
|
|
|
@keydown.enter="getPrductimg()"
|
|
|
|
|
v-model="productimgSearchName"
|
|
|
|
|
></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-show="scaleImageList[scaleImageIndex]?.resultType == 'ToProductImage'" class="productImg_content_item_title productImg_content_item_title_similarity">
|
|
|
|
|
<span>{{$t('ProductImg.Similarity')}}</span>
|
|
|
|
|
</div>
|
2024-07-09 15:13:17 +08:00
|
|
|
<div v-show="scaleImageList[scaleImageIndex]?.resultType == 'ToProductImage'" class="productImg_content_item_similarity ">
|
2024-07-03 11:39:01 +08:00
|
|
|
<a-slider class="system_silder"
|
|
|
|
|
v-model:value="productimgSimilarity"
|
|
|
|
|
:tooltipVisible="false"
|
|
|
|
|
:step="5"
|
|
|
|
|
@afterChange="()=>{}"
|
|
|
|
|
>
|
|
|
|
|
</a-slider>
|
|
|
|
|
<input type="number" readonly v-model="productimgSimilarity">
|
|
|
|
|
</div>
|
2024-07-03 17:32:06 +08:00
|
|
|
<div v-show="scaleImageList[scaleImageIndex]?.resultType == 'Relight'" class="productImg_content_item_title productImg_content_item_title_similarity">
|
|
|
|
|
<span>{{$t('ProductImg.RelightDirection')}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-show="scaleImageList[scaleImageIndex]?.resultType == 'Relight'" class="productImg_content_item_Direction">
|
|
|
|
|
<!-- <a-slider class="system_silder"
|
|
|
|
|
v-model:value="similarity"
|
|
|
|
|
@afterChange="setSimilarity"
|
|
|
|
|
:tooltipVisible="false"
|
|
|
|
|
:step="5"
|
|
|
|
|
>
|
|
|
|
|
</a-slider> -->
|
|
|
|
|
<a-select style="width: 100%;" v-model:value="productimgRelightDirection" :options="productimgRelightDirectionList"></a-select>
|
|
|
|
|
</div>
|
2024-09-03 16:39:06 +08:00
|
|
|
<div v-show="scaleImageList[scaleImageIndex]?.resultType == 'Relight'" class="productImg_content_item_title productImg_content_item_title_similarity">
|
|
|
|
|
<span>{{$t('ProductImg.Highlight')}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-show="scaleImageList[scaleImageIndex]?.resultType == 'Relight'" class="productImg_content_item_similarity">
|
|
|
|
|
<a-slider class="system_silder"
|
|
|
|
|
v-model:value="productimgBrightenValue"
|
|
|
|
|
:tooltipVisible="false"
|
2024-09-03 17:04:16 +08:00
|
|
|
:max="3"
|
2024-09-03 16:39:06 +08:00
|
|
|
:min="1"
|
|
|
|
|
:step="0.1"
|
|
|
|
|
>
|
|
|
|
|
</a-slider>
|
|
|
|
|
<input type="number" readonly v-model="productimgBrightenValue">
|
|
|
|
|
</div>
|
2024-07-03 11:39:01 +08:00
|
|
|
<div class="productImg_content_item_generate_btn input_border">
|
|
|
|
|
<div class="input_box">
|
|
|
|
|
<div v-show="!productimgIsProductimg" class="generage_btn started_btn" @click.stop="getPrductimg">
|
|
|
|
|
{{ $t('Generate.Generate') }}
|
|
|
|
|
</div>
|
|
|
|
|
<div v-show="productimgIsProductimg && !productimgRemProductimg" class="generage_btn started_btn" @click="getPrductimg">
|
|
|
|
|
<i class="fi fi-br-loading"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-show="productimgRemProductimg" @click="removeProductimg" class="generage_btn started_btn">
|
|
|
|
|
{{$t('Generate.Close')}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-07-08 09:42:21 +08:00
|
|
|
<div class="scaleImage_content_imgBox" :class="{active:isComparison}">
|
2024-07-03 11:39:01 +08:00
|
|
|
<img v-if="isComparison" :src="scaleImageList[scaleImageIndex]?.sourceUrl">
|
2025-02-06 11:10:04 +08:00
|
|
|
<generalMiniCanvas v-if="isCanvas" :imgUrl="scaleImageList[scaleImageIndex]?.imgUrl || scaleImageList[scaleImageIndex]?.url" @submitBase64Data="submitBase64Data"></generalMiniCanvas>
|
2024-12-27 14:38:21 +08:00
|
|
|
<img v-else :src="scaleImageList[scaleImageIndex]?.imgUrl || scaleImageList[scaleImageIndex]?.url">
|
2024-09-29 21:54:04 +08:00
|
|
|
|
2024-07-03 11:39:01 +08:00
|
|
|
<div class="img_operate_block" v-if="isLike">
|
|
|
|
|
<i v-if="!scaleImageList[scaleImageIndex]?.like" class="fi fi-rr-heart operate_icon" @click.stop="LikeFile(scaleImageList[scaleImageIndex],'like')"></i>
|
|
|
|
|
<i v-else class="fi fi-sr-heart operate_icon" :adminLike="!!scaleImageList[scaleImageIndex]?.like" @click.stop="LikeFile(scaleImageList[scaleImageIndex],'noLike')"></i>
|
|
|
|
|
</div>
|
2024-04-26 15:27:01 +08:00
|
|
|
</div>
|
2023-11-08 09:31:40 +08:00
|
|
|
</div>
|
2024-09-27 16:31:33 +08:00
|
|
|
<div class="scaleImage_nav">
|
2023-11-08 09:31:40 +08:00
|
|
|
<div class="nav_left">
|
|
|
|
|
<i class="fi fi-rr-arrow-small-left" @click="lastStep()"></i>
|
|
|
|
|
</div>
|
2024-01-02 13:04:57 +08:00
|
|
|
<div class="nav_list" v-mousewheel>
|
|
|
|
|
<div class="nav_centent">
|
2024-12-27 14:38:21 +08:00
|
|
|
<img v-for="item,index in scaleImageList" @click="setScaleImageIndex(index)" :class="{active:index == scaleImageIndex}" :src="item?.imgUrl || item?.url" :key="item.id">
|
2024-01-02 13:04:57 +08:00
|
|
|
</div>
|
2023-11-08 09:31:40 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="nav_right">
|
|
|
|
|
<i class="fi fi-rr-arrow-small-right" @click.stop="nextStep()"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-09-25 11:07:49 +08:00
|
|
|
<div class="mark_loading" v-show="loadingShow">
|
|
|
|
|
<a-spin size="large" />
|
|
|
|
|
</div>
|
2025-01-13 17:10:41 +08:00
|
|
|
<UpgradePlan ref="UpgradePlan"></UpgradePlan>
|
|
|
|
|
|
2023-11-08 09:31:40 +08:00
|
|
|
</a-modal>
|
2024-12-11 16:26:36 +08:00
|
|
|
</div>
|
2023-11-08 09:31:40 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
2024-12-18 17:38:43 +08:00
|
|
|
import { defineComponent, h, ref ,toRefs,createVNode,reactive, computed} from "vue";
|
2024-07-03 11:39:01 +08:00
|
|
|
import { Https } from "@/tool/https";
|
2024-09-26 15:43:27 +08:00
|
|
|
import { Modal } from "ant-design-vue";
|
|
|
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
2023-11-08 09:31:40 +08:00
|
|
|
import { downloadIamge } from "@/tool/util";
|
2024-09-26 15:43:27 +08:00
|
|
|
import { useI18n } from "vue-i18n";
|
2024-09-29 21:54:04 +08:00
|
|
|
import { useStore } from "vuex";
|
2024-09-25 11:07:49 +08:00
|
|
|
import generalMiniCanvas from "@/component/modules/generalMiniCanvas.vue";
|
2025-01-13 17:10:41 +08:00
|
|
|
import UpgradePlan from "@/component/HomePage/UpgradePlan.vue";
|
|
|
|
|
|
2023-11-08 09:31:40 +08:00
|
|
|
export default defineComponent({
|
2025-01-13 17:10:41 +08:00
|
|
|
components:{generalMiniCanvas,UpgradePlan},
|
2024-07-03 11:39:01 +08:00
|
|
|
props:{
|
|
|
|
|
productData:{
|
|
|
|
|
type:Object,
|
|
|
|
|
default:{
|
|
|
|
|
similarity:30,
|
2024-09-03 16:39:06 +08:00
|
|
|
brightenValue:1,
|
2024-07-03 11:39:01 +08:00
|
|
|
upload:'',
|
|
|
|
|
},
|
2024-09-25 11:07:49 +08:00
|
|
|
},
|
|
|
|
|
isCanvas:{
|
|
|
|
|
type:Boolean,
|
|
|
|
|
default:false,
|
|
|
|
|
},
|
|
|
|
|
workspace:{
|
|
|
|
|
type:Object,
|
2025-02-06 11:14:16 +08:00
|
|
|
default:{}
|
2024-09-25 11:07:49 +08:00
|
|
|
},
|
2024-07-03 11:39:01 +08:00
|
|
|
},
|
|
|
|
|
setup(props:any,{emit}) {
|
|
|
|
|
const store = useStore();
|
2024-12-18 17:38:43 +08:00
|
|
|
let userDetail:any= computed(()=>{
|
|
|
|
|
return store.state.UserHabit.userDetail
|
|
|
|
|
})
|
2024-09-27 16:31:33 +08:00
|
|
|
let {t} = useI18n()
|
2024-07-03 11:39:01 +08:00
|
|
|
let productimg = reactive({
|
2025-01-13 17:10:41 +08:00
|
|
|
UpgradePlan:null,
|
2024-07-03 11:39:01 +08:00
|
|
|
isProductimg:false,
|
|
|
|
|
productimgSearchName:'',
|
|
|
|
|
productimgIsTextarea:false,
|
|
|
|
|
productimgRemProductimg:false,
|
|
|
|
|
productimgIsProductimg:false,
|
|
|
|
|
productimgSimilarity:props.productData.similarity,
|
2024-09-03 16:39:06 +08:00
|
|
|
productimgBrightenValue:props.productData.brightenValue,
|
2024-07-03 11:39:01 +08:00
|
|
|
productimgUpload:props.productData.upload,
|
2024-07-03 17:32:06 +08:00
|
|
|
productimgRelightDirection:props.productData.RelightDirection,
|
|
|
|
|
productimgRelightDirectionList:props.productData.RelightDirectionList,
|
2024-07-03 11:39:01 +08:00
|
|
|
})
|
2023-11-08 09:31:40 +08:00
|
|
|
let scaleImage: any = ref(false);
|
2024-07-03 11:39:01 +08:00
|
|
|
let isShowMark = ref(false)
|
2023-11-08 09:31:40 +08:00
|
|
|
let loadingShow = ref(false)
|
2024-06-24 16:45:20 +08:00
|
|
|
let isComparison = ref(false)
|
2023-11-08 09:31:40 +08:00
|
|
|
const visible = ref<boolean>(false);
|
|
|
|
|
const setVisible = (value:any): void => {
|
|
|
|
|
visible.value = value;
|
|
|
|
|
};
|
|
|
|
|
let scaleImageList:any = ref([
|
|
|
|
|
|
|
|
|
|
])
|
2023-12-15 11:10:32 +08:00
|
|
|
let scaleImageMask:any = ref(false)
|
2023-11-08 09:31:40 +08:00
|
|
|
let scaleImageIndex:any = ref(0)
|
2024-06-17 09:39:01 +08:00
|
|
|
let isLike:any = ref(true)
|
2024-04-26 15:27:01 +08:00
|
|
|
let robotAssits:any = ref(0)
|
2024-07-03 11:39:01 +08:00
|
|
|
|
|
|
|
|
//procuctimg
|
|
|
|
|
let remPrductimgTime:any = null
|
|
|
|
|
let prductimgTime:any = null
|
|
|
|
|
let getPrductimg = ()=>{
|
|
|
|
|
let obj = {
|
|
|
|
|
elementId:scaleImageList.value[scaleImageIndex.value].elementId,
|
|
|
|
|
elementType:scaleImageList.value[scaleImageIndex.value].elementType,
|
|
|
|
|
}
|
|
|
|
|
let imageStrength = productimg.productimgSimilarity == 100? 95 :productimg.productimgSimilarity
|
|
|
|
|
let data:any ={
|
2024-07-08 09:42:21 +08:00
|
|
|
direction:productimg.productimgRelightDirection,
|
2024-07-03 11:39:01 +08:00
|
|
|
prompt:productimg.productimgSearchName,
|
|
|
|
|
toProductImageVOList:[obj],
|
2024-09-03 16:39:06 +08:00
|
|
|
brightenValue:productimg.productimgBrightenValue,
|
2024-07-03 11:39:01 +08:00
|
|
|
userLikeGroupId:productimg.productimgUpload.userlikeGroupId,
|
|
|
|
|
imageStrength:(100 - imageStrength)/100,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
productimg.productimgIsProductimg = true
|
|
|
|
|
remPrductimgTime = setTimeout(()=>{
|
|
|
|
|
productimg.productimgRemProductimg = true
|
|
|
|
|
},10000)
|
|
|
|
|
let url = Https.httpUrls.relight
|
|
|
|
|
if(scaleImageList.value[scaleImageIndex.value]?.resultType == 'ToProductImage'){
|
|
|
|
|
url = Https.httpUrls.toProduct
|
|
|
|
|
}
|
|
|
|
|
isShowMark.value = true
|
|
|
|
|
Https.axiosPost(url, data).then(
|
|
|
|
|
(rv) => {
|
|
|
|
|
isShowMark.value = false
|
2024-09-29 21:54:04 +08:00
|
|
|
scaleImageList.value[scaleImageIndex.value].imgUrl = '/image/loading.gif'
|
2024-07-03 11:39:01 +08:00
|
|
|
let arr:any = []
|
|
|
|
|
rv.forEach((item:any)=>{
|
|
|
|
|
arr.push(item.taskId)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// productimg.generateList.unshift(...rv)
|
|
|
|
|
setPrductimg(arr)
|
|
|
|
|
}
|
|
|
|
|
).catch(res=>{
|
|
|
|
|
isShowMark.value = false
|
|
|
|
|
productimg.productimgIsProductimg = false
|
|
|
|
|
clearInterval(remPrductimgTime)
|
|
|
|
|
productimg.productimgRemProductimg = false
|
2025-01-13 17:10:41 +08:00
|
|
|
if(res.errCode === 2){
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: res.errMsg,
|
|
|
|
|
icon: createVNode(ExclamationCircleOutlined),
|
|
|
|
|
okText: 'Yes',
|
|
|
|
|
cancelText: 'No',
|
|
|
|
|
mask:false,
|
|
|
|
|
zIndex:99999,
|
|
|
|
|
centered:true,
|
|
|
|
|
onOk() {
|
|
|
|
|
let UpgradePlan:any = productimg.UpgradePlan
|
|
|
|
|
UpgradePlan.init()
|
|
|
|
|
},
|
|
|
|
|
onCancel(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-03 11:39:01 +08:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
let generateProceedList:any = []
|
|
|
|
|
let setPrductimg = (dataList:any)=>{
|
|
|
|
|
let data = dataList
|
|
|
|
|
let dataNum = dataList.length
|
|
|
|
|
let state = true
|
|
|
|
|
let url = Https.httpUrls.relightResult
|
|
|
|
|
if(scaleImageList.value[scaleImageIndex.value]?.resultType == 'ToProductImage'){
|
|
|
|
|
url = Https.httpUrls.toProductImageResult
|
|
|
|
|
}
|
|
|
|
|
prductimgTime = setInterval(()=>{
|
|
|
|
|
if(!state)return
|
|
|
|
|
state = false
|
|
|
|
|
Https.axiosPost(url, data).then(
|
|
|
|
|
(rv) => {
|
|
|
|
|
state = true
|
|
|
|
|
if(productimg.productimgIsProductimg){//防止取消后有正在执行的获取状态
|
|
|
|
|
// generateProceedList = rv.filter((item:any)=>item.status != 'Success' && item.status != 'Fail' && item.status != 'Invalid')
|
|
|
|
|
let isEnd = false
|
|
|
|
|
if(rv[0].status == 'Success'){
|
|
|
|
|
rv[0].imgUrl = rv[0].url
|
|
|
|
|
scaleImageList.value[scaleImageIndex.value] = rv[0]
|
|
|
|
|
isEnd = true
|
|
|
|
|
}else if(rv[0].status == 'Fail'){
|
|
|
|
|
isEnd = true
|
|
|
|
|
}
|
|
|
|
|
generateProceedList = data
|
|
|
|
|
if(isEnd){
|
|
|
|
|
store.state.store.dispatch('getCredits')
|
|
|
|
|
clearInterval(prductimgTime)
|
|
|
|
|
clearInterval(remPrductimgTime)
|
|
|
|
|
productimg.productimgRemProductimg = false
|
|
|
|
|
productimg.productimgIsProductimg = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
).catch(res=>{
|
|
|
|
|
clearInterval(prductimgTime)
|
|
|
|
|
clearInterval(remPrductimgTime)
|
|
|
|
|
productimg.productimgIsProductimg = false
|
|
|
|
|
productimg.productimgRemProductimg= false
|
|
|
|
|
});
|
|
|
|
|
},1000)
|
|
|
|
|
}
|
|
|
|
|
let removeProductimg = ()=>{
|
|
|
|
|
productimg.productimgIsProductimg = false
|
|
|
|
|
productimg.productimgRemProductimg= false
|
|
|
|
|
clearInterval(prductimgTime)
|
|
|
|
|
if(generateProceedList){
|
|
|
|
|
// let str = generateProceedList.map((obj:any) => obj.taskId).join(',');
|
|
|
|
|
let str = generateProceedList.join(',')
|
2024-09-03 16:39:06 +08:00
|
|
|
let data = {
|
|
|
|
|
uniqueId:str,
|
2024-12-18 17:38:43 +08:00
|
|
|
userId:userDetail.value.userId,
|
2024-09-03 16:39:06 +08:00
|
|
|
type:scaleImageList.value[scaleImageIndex.value]?.resultType
|
|
|
|
|
}
|
2024-07-03 11:39:01 +08:00
|
|
|
Https.axiosGet(Https.httpUrls.generateStopWaiting, {params:data}).then(
|
|
|
|
|
(rv) => {
|
|
|
|
|
generateProceedList = []
|
|
|
|
|
}
|
|
|
|
|
).catch(res=>{
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-27 16:31:33 +08:00
|
|
|
let submitBase64Data = async (rv:any)=>{
|
2024-09-25 11:07:49 +08:00
|
|
|
loadingShow.value = true
|
2024-09-27 16:31:33 +08:00
|
|
|
let isOverlay = false
|
|
|
|
|
await new Promise<void>((resolve, reject) => {
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: t('scaleImage.overlayOrNot'),
|
|
|
|
|
icon: createVNode(ExclamationCircleOutlined),
|
|
|
|
|
okText: 'Yes',
|
|
|
|
|
cancelText: 'No',
|
|
|
|
|
mask:false,
|
|
|
|
|
centered:true,
|
|
|
|
|
onOk() {
|
|
|
|
|
resolve()
|
|
|
|
|
isOverlay = true
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onCancel(){
|
|
|
|
|
isOverlay = false
|
|
|
|
|
resolve()
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
2024-09-25 11:07:49 +08:00
|
|
|
let data = {
|
|
|
|
|
"base64": rv,
|
2025-02-06 11:10:04 +08:00
|
|
|
"category": scaleImageList.value[scaleImageIndex.value]?.categoryValue || scaleImageList.value[scaleImageIndex.value]?.level2Type,
|
2024-09-25 11:07:49 +08:00
|
|
|
"gender": props.workspace.sexEnum.value,
|
2024-09-27 16:31:33 +08:00
|
|
|
"originalId":scaleImageList.value[scaleImageIndex.value]?.id,
|
|
|
|
|
"isOverride":isOverlay,
|
2024-09-25 11:07:49 +08:00
|
|
|
}
|
|
|
|
|
Https.axiosPost(Https.httpUrls.modifySketch, data).then(
|
|
|
|
|
(rv) => {
|
|
|
|
|
rv.imgUrl = rv.url
|
|
|
|
|
rv.status = 'Success'
|
|
|
|
|
rv.category = scaleImageList.value[scaleImageIndex.value]?.category
|
|
|
|
|
rv.categoryValue = scaleImageList.value[scaleImageIndex.value]?.categoryValue
|
2024-09-27 16:31:33 +08:00
|
|
|
isOverlay?(scaleImageList.value[scaleImageIndex.value] = rv):(scaleImageList.value.unshift(rv))
|
|
|
|
|
loadingShow.value = false
|
|
|
|
|
scaleImage.value = false
|
2024-09-25 11:07:49 +08:00
|
|
|
}
|
|
|
|
|
).catch(res=>{
|
|
|
|
|
loadingShow.value = false
|
|
|
|
|
});
|
|
|
|
|
}
|
2023-11-08 09:31:40 +08:00
|
|
|
return {
|
2024-10-14 17:32:26 +08:00
|
|
|
t,
|
2024-07-03 11:39:01 +08:00
|
|
|
...toRefs(productimg),
|
2023-11-08 09:31:40 +08:00
|
|
|
scaleImage,
|
2024-07-03 11:39:01 +08:00
|
|
|
isShowMark,
|
2023-11-08 09:31:40 +08:00
|
|
|
loadingShow,
|
2024-06-24 16:45:20 +08:00
|
|
|
isComparison,
|
2023-11-08 09:31:40 +08:00
|
|
|
visible,
|
|
|
|
|
setVisible,
|
|
|
|
|
scaleImageList,
|
2023-12-15 11:10:32 +08:00
|
|
|
scaleImageMask,
|
2023-11-08 09:31:40 +08:00
|
|
|
scaleImageIndex,
|
2024-06-17 09:39:01 +08:00
|
|
|
isLike,
|
2024-04-26 15:27:01 +08:00
|
|
|
robotAssits,
|
2024-07-03 11:39:01 +08:00
|
|
|
getPrductimg,
|
|
|
|
|
removeProductimg,
|
2024-09-25 11:07:49 +08:00
|
|
|
submitBase64Data,
|
2023-11-08 09:31:40 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// moodTemplateId: "", //模板id
|
2024-10-14 17:32:26 +08:00
|
|
|
isNext:false
|
2023-11-08 09:31:40 +08:00
|
|
|
};
|
|
|
|
|
},
|
2024-01-02 13:04:57 +08:00
|
|
|
directives:{
|
|
|
|
|
mousewheel:{
|
|
|
|
|
mounted (el) {
|
|
|
|
|
el.addEventListener('wheel',(e:WheelEvent)=>{
|
|
|
|
|
let num = 0
|
|
|
|
|
if(e.deltaY > 0){
|
|
|
|
|
num = 25
|
|
|
|
|
}else{
|
|
|
|
|
num = -25
|
|
|
|
|
}
|
|
|
|
|
el.scrollBy(num, 0);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-11-08 09:31:40 +08:00
|
|
|
mounted() {
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-04-26 15:27:01 +08:00
|
|
|
init(list:any,index:any,dialogueIndex:any){
|
2023-11-08 09:31:40 +08:00
|
|
|
this.scaleImage = true
|
|
|
|
|
this.scaleImageList = list
|
2024-01-02 13:04:57 +08:00
|
|
|
this.scaleImageIndex = index
|
2024-04-26 15:27:01 +08:00
|
|
|
if(dialogueIndex)this.robotAssits = dialogueIndex
|
2023-11-08 09:31:40 +08:00
|
|
|
// let scaleImageList = this.store.state.UploadFilesModule.moodboard
|
2024-04-30 11:45:19 +08:00
|
|
|
document.addEventListener('keydown',this.setKeydown)
|
2023-11-08 09:31:40 +08:00
|
|
|
},
|
|
|
|
|
cancelDsign(){
|
|
|
|
|
this.scaleImage = false
|
|
|
|
|
this.scaleImageList = []
|
|
|
|
|
this.scaleImageIndex = 0
|
2024-10-14 17:32:26 +08:00
|
|
|
this.isNext = false
|
2024-04-30 11:45:19 +08:00
|
|
|
document.removeEventListener('keydown',this.setKeydown)
|
2023-11-08 09:31:40 +08:00
|
|
|
},
|
|
|
|
|
lastStep(){
|
2024-09-29 21:54:04 +08:00
|
|
|
if(this.productimgIsProductimg) return
|
2024-10-14 17:32:26 +08:00
|
|
|
if(this.isNext)return
|
|
|
|
|
let num = this.scaleImageIndex
|
2023-11-08 09:31:40 +08:00
|
|
|
if(this.scaleImageIndex <= 0){
|
|
|
|
|
}else{
|
2024-10-14 17:32:26 +08:00
|
|
|
num -=1
|
|
|
|
|
this.setImageIndex(num)
|
2023-11-08 09:31:40 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
nextStep(){
|
2024-09-29 21:54:04 +08:00
|
|
|
if(this.productimgIsProductimg) return
|
2024-10-14 17:32:26 +08:00
|
|
|
if(this.isNext)return
|
|
|
|
|
let num = this.scaleImageIndex
|
2023-11-08 09:31:40 +08:00
|
|
|
if(this.scaleImageIndex >= this.scaleImageList.length-1){
|
|
|
|
|
}else{
|
2024-10-14 17:32:26 +08:00
|
|
|
num += 1
|
|
|
|
|
this.setImageIndex(num)
|
2023-11-08 09:31:40 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
download(){
|
|
|
|
|
downloadIamge(this.scaleImageList[this.scaleImageIndex].imgUrl)
|
|
|
|
|
},
|
|
|
|
|
setScaleImageIndex(index:any){
|
2024-10-14 17:32:26 +08:00
|
|
|
// this.scaleImageIndex = index
|
|
|
|
|
this.setImageIndex(index)
|
|
|
|
|
},
|
|
|
|
|
setImageIndex(index:any){
|
|
|
|
|
if(this.isNext)return
|
|
|
|
|
let this_ = this
|
|
|
|
|
if(this.isCanvas){
|
|
|
|
|
this.isNext = true
|
|
|
|
|
new Promise((resolve,reject)=>{
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: this.t('scaleImage.submitCanvas'),
|
|
|
|
|
icon: createVNode(ExclamationCircleOutlined),
|
|
|
|
|
okText: 'Yes',
|
|
|
|
|
cancelText: 'No',
|
|
|
|
|
mask:false,
|
|
|
|
|
centered:true,
|
|
|
|
|
onOk() {
|
|
|
|
|
this_.scaleImageIndex = index
|
|
|
|
|
this_.isNext = false
|
|
|
|
|
resolve('')
|
|
|
|
|
},
|
|
|
|
|
onCancel(){
|
|
|
|
|
this_.isNext = false
|
|
|
|
|
resolve('')
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
2024-10-18 11:36:19 +08:00
|
|
|
}else{
|
|
|
|
|
this.scaleImageIndex = index
|
2024-10-14 17:32:26 +08:00
|
|
|
}
|
2023-11-08 09:31:40 +08:00
|
|
|
},
|
2024-04-26 15:27:01 +08:00
|
|
|
LikeFile(item:any,str:string){
|
|
|
|
|
let parent:any = this.$parent
|
|
|
|
|
if(this.robotAssits){
|
|
|
|
|
parent.likeFile(item,this.scaleImageIndex,this.robotAssits)
|
|
|
|
|
}else{
|
|
|
|
|
parent.likeFile(item,str)
|
|
|
|
|
}
|
2024-04-30 11:45:19 +08:00
|
|
|
},
|
|
|
|
|
setKeydown(event:any){
|
|
|
|
|
if(event.keyCode == 37){
|
|
|
|
|
this.lastStep()
|
|
|
|
|
}else if(event.keyCode == 39){
|
|
|
|
|
this.nextStep()
|
|
|
|
|
}
|
2024-07-03 11:39:01 +08:00
|
|
|
},
|
2023-11-08 09:31:40 +08:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2024-12-11 16:26:36 +08:00
|
|
|
<style scoped>
|
2024-10-10 11:32:49 +08:00
|
|
|
.scaleImage_modal{
|
2024-10-11 23:26:10 +08:00
|
|
|
overflow: visible !important;
|
2024-10-10 11:32:49 +08:00
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<style lang="less" scoped>
|
2023-11-08 09:31:40 +08:00
|
|
|
.scaleImage_modal {
|
|
|
|
|
.ant-modal-body {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
2024-12-11 16:26:36 +08:00
|
|
|
.productImg_content_item_title{
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
font-size: 1.6rem;
|
|
|
|
|
}
|
2023-11-08 09:31:40 +08:00
|
|
|
.scaleImage_content{
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
2024-10-10 11:32:49 +08:00
|
|
|
// margin-top: calc(5rem*1.2);
|
|
|
|
|
// height: 75%;
|
|
|
|
|
height: 100%;
|
2024-04-26 15:27:01 +08:00
|
|
|
position: relative;
|
2024-07-03 11:39:01 +08:00
|
|
|
.productImg_modal{
|
2024-12-11 16:26:36 +08:00
|
|
|
position: relative;
|
2024-07-03 11:39:01 +08:00
|
|
|
left: 0;
|
2024-10-20 15:58:29 +08:00
|
|
|
z-index: 9;
|
2024-07-03 11:39:01 +08:00
|
|
|
.productImg_left{
|
|
|
|
|
width: 100%;
|
2025-01-22 10:16:02 +08:00
|
|
|
display: flex;
|
|
|
|
|
height: 100%;
|
|
|
|
|
flex-direction: column;
|
2024-12-11 16:26:36 +08:00
|
|
|
.input_box_btnBox{
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
.input_box{
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
}
|
2024-07-03 11:39:01 +08:00
|
|
|
.productImg_content_item_generate_btn{
|
2025-01-22 10:16:02 +08:00
|
|
|
// transform: translateY(100%);
|
2024-12-11 16:26:36 +08:00
|
|
|
position: absolute;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
top: auto;
|
|
|
|
|
width: 100%;
|
|
|
|
|
justify-content: space-around;
|
2024-04-26 15:27:01 +08:00
|
|
|
}
|
2024-07-09 15:13:17 +08:00
|
|
|
.productImg_content_item_similarity{
|
|
|
|
|
padding-bottom: 2.4rem;
|
2024-12-11 16:26:36 +08:00
|
|
|
display: flex;
|
|
|
|
|
input{
|
|
|
|
|
width: 5rem;
|
|
|
|
|
height: 5rem;
|
|
|
|
|
text-align: center;
|
|
|
|
|
font-size: 1.8rem;
|
|
|
|
|
}
|
2024-07-09 15:13:17 +08:00
|
|
|
}
|
2024-04-26 15:27:01 +08:00
|
|
|
}
|
2024-07-03 11:39:01 +08:00
|
|
|
}
|
|
|
|
|
.scaleImage_content_imgBox{
|
|
|
|
|
position: relative;
|
2024-10-10 11:32:49 +08:00
|
|
|
// max-width: 70rem;
|
|
|
|
|
width: 100%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
justify-content: center;
|
2024-07-03 11:39:01 +08:00
|
|
|
img{
|
|
|
|
|
width: auto;
|
|
|
|
|
height: 100%;
|
2024-09-29 21:54:04 +08:00
|
|
|
max-width: 40rem;
|
2024-10-10 11:32:49 +08:00
|
|
|
object-fit: contain;
|
2024-07-03 11:39:01 +08:00
|
|
|
}
|
2024-07-08 09:42:21 +08:00
|
|
|
&.active{
|
|
|
|
|
display: flex;
|
|
|
|
|
img{
|
2024-07-09 15:13:17 +08:00
|
|
|
// width: 50%;
|
|
|
|
|
height: 100%;
|
2024-12-11 16:26:36 +08:00
|
|
|
object-fit: cover;
|
2024-07-08 09:42:21 +08:00
|
|
|
}
|
|
|
|
|
}
|
2024-07-03 11:39:01 +08:00
|
|
|
.img_operate_block{
|
|
|
|
|
width: 3.6rem;
|
|
|
|
|
height: 3.6rem;
|
|
|
|
|
background: rgba(0,0,0,0.6);
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height: 3.6rem;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
margin-bottom: 0.4rem;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 2rem;
|
|
|
|
|
top: 2rem;
|
|
|
|
|
opacity: 0;
|
2024-05-09 13:34:15 +08:00
|
|
|
display: flex;
|
2024-07-03 11:39:01 +08:00
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2024-09-25 11:07:49 +08:00
|
|
|
z-index: 2;
|
2024-07-03 11:39:01 +08:00
|
|
|
.operate_icon{
|
|
|
|
|
font-size: 1.8rem;
|
|
|
|
|
color: #fff;
|
|
|
|
|
&.fi-sr-heart{
|
|
|
|
|
color: red;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
i{
|
|
|
|
|
display: flex;
|
|
|
|
|
font-size: 1.8rem;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
2024-04-26 15:27:01 +08:00
|
|
|
}
|
|
|
|
|
}
|
2024-04-30 11:45:19 +08:00
|
|
|
|
2024-07-03 11:39:01 +08:00
|
|
|
|
2024-04-26 15:27:01 +08:00
|
|
|
}
|
2024-09-25 11:07:49 +08:00
|
|
|
.scaleImage_content_imgBox:hover{
|
2024-04-26 15:27:01 +08:00
|
|
|
.img_operate_block{
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
2023-11-08 09:31:40 +08:00
|
|
|
}
|
|
|
|
|
.scaleImage_nav{
|
|
|
|
|
flex: 1;
|
2024-01-10 14:09:44 +08:00
|
|
|
margin: calc(2.5rem*1.2) calc(0rem*1.2);
|
2023-11-08 09:31:40 +08:00
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
width: 100%;
|
2024-10-13 15:43:27 +08:00
|
|
|
top: 100%;
|
2024-10-10 11:32:49 +08:00
|
|
|
left: 0;
|
|
|
|
|
position: absolute;
|
2023-11-08 09:31:40 +08:00
|
|
|
.nav_left,.nav_right{
|
|
|
|
|
cursor: pointer;
|
2024-04-30 11:45:19 +08:00
|
|
|
top: 50%;
|
2023-11-08 09:31:40 +08:00
|
|
|
i{
|
2024-04-30 11:45:19 +08:00
|
|
|
display: flex;
|
|
|
|
|
font-size: 4rem;
|
2023-11-08 09:31:40 +08:00
|
|
|
transition: .3s all;
|
|
|
|
|
color: rgba(0, 0, 0, .5);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-30 11:45:19 +08:00
|
|
|
// .nav_left{
|
|
|
|
|
// left: 0;
|
|
|
|
|
// transform: translate(-200%,-50%);
|
|
|
|
|
// }
|
|
|
|
|
// .nav_right{
|
|
|
|
|
// right: 0;
|
|
|
|
|
// transform: translate(200%,-50%);
|
|
|
|
|
// }
|
2023-11-08 09:31:40 +08:00
|
|
|
.nav_left:hover,.nav_right:hover{
|
|
|
|
|
i{
|
|
|
|
|
color: rgba(0, 0, 0, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.nav_list{
|
2024-01-10 14:09:44 +08:00
|
|
|
margin: 0 calc(2rem*1.2);
|
|
|
|
|
max-width: calc(60rem*1.2);
|
2024-01-02 13:04:57 +08:00
|
|
|
overflow-y: hidden;
|
|
|
|
|
&.nav_list::-webkit-scrollbar {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
.nav_centent{
|
|
|
|
|
width: auto;
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
2023-11-08 09:31:40 +08:00
|
|
|
img{
|
2024-01-10 14:09:44 +08:00
|
|
|
max-width: calc(5rem*1.2);
|
|
|
|
|
max-height: calc(5rem*1.2);
|
2023-11-08 09:31:40 +08:00
|
|
|
object-fit: cover;
|
|
|
|
|
object-position: 50%,50%;
|
2024-01-10 14:09:44 +08:00
|
|
|
margin-left: calc(1rem*1.2);
|
|
|
|
|
border-radius: calc(1rem*1.2);
|
2023-11-08 09:31:40 +08:00
|
|
|
overflow: hidden;
|
|
|
|
|
cursor: pointer;
|
2024-01-10 14:09:44 +08:00
|
|
|
padding: calc(.1rem*1.2);
|
2024-01-02 13:04:57 +08:00
|
|
|
flex-shrink: 0;
|
2023-11-08 09:31:40 +08:00
|
|
|
&.active{
|
2024-01-02 13:04:57 +08:00
|
|
|
border: 2px solid #aaaaaa;
|
2023-11-08 09:31:40 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
img:nth-child(1){
|
2024-01-10 14:09:44 +08:00
|
|
|
margin-left: calc(0rem*1.2);
|
2023-11-08 09:31:40 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|