布局修改 部分bug修复

This commit is contained in:
X1627315083
2025-08-22 10:27:48 +08:00
parent 141821a843
commit 594bf5ce0a
275 changed files with 5675 additions and 13049 deletions

View File

@@ -17,8 +17,7 @@
<div class="generalModel_btn">
<div class="generalModel_closeIcon" @click.stop="cancelDsign()">
<svg
width="46"
height="46"
width="100%" height="100%"
viewBox="0 0 46 46"
fill="none"
xmlns="http://www.w3.org/2000/svg"

View File

@@ -304,7 +304,6 @@ export default defineComponent({
router.push(`/home/tools?tools=${item.buildType}&id=${item.projectId}&source=batch`)
}
data.isGetContentList = false
return
Https.axiosPost(Https.httpUrls.getDesignCloudResult,value).then((rv)=>{
if(item.buildType == 'design'){
store.commit('addDesignCollectionList',rv.design)

View File

@@ -16,7 +16,7 @@
>
<div class="generalModel_btn">
<div class="generalModel_closeIcon" @click.stop="cleardata()">
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg width="100%" height="100%" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<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"/>

View File

@@ -943,7 +943,7 @@ export default defineComponent({
position: absolute;
right: 1rem;
top: 1rem;
opacity: 0;
// opacity: 0;
width: 3rem;
height: 3rem;
transition: all 0.2s ease-in-out;

View File

@@ -895,7 +895,7 @@ export default defineComponent({
position: absolute;
right: 1rem;
top: 1rem;
opacity: 0;
// opacity: 0;
width: 3rem;
height: 3rem;
transition: all 0.2s ease-in-out;

View File

@@ -107,17 +107,26 @@ export default defineComponent({
originalIdSource:props.item.resData.designType,
type:props.level1Type,
}
console.log(data)
Https.axiosPost(Https.httpUrls.modifySketch, data).then(
(rv) => {
rv.imgUrl = rv.url
rv.status = 'Success'
rv.resData = {
id:rv.id,
designType:props.item.resData.designType,
// rv.imgUrl = rv.url
// rv.status = 'Success'
// rv.resData = {
// id:rv.id,
// designType:props.item.resData.designType,
// }
// rv.category = props.item?.category
// rv.categoryValue = props.item?.categoryValue
if(isOverlay){
props.list[props.index].imgUrl = rv.url
props.list[props.index].resData = {
id:rv.id,
designType:props.item.resData.designType,
}
}else{
props.list.unshift(rv)
}
rv.category = props.item?.category
rv.categoryValue = props.item?.categoryValue
isOverlay?(props.list[props.index] = rv):(props.list.unshift(rv))
}
).catch(res=>{
});

View File

@@ -13,7 +13,7 @@
>
<div class="generalModel_btn">
<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">
<svg width="100%" height="100%" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<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"/>
@@ -259,11 +259,11 @@ setup(props:any,{emit}) {
poseTransfer:[
{
title:'',
label:t('speedList.High'),
label:t('speedList.toproductBasic'),
value:'',
},{
title:'',
label:t('speedList.wx'),
label:t('speedList.toproductFlus'),
value:'wx',
},
],
@@ -316,6 +316,7 @@ setup(props:any,{emit}) {
let remPrductimgTime:any = null
let prductimgTime:any = null
const getData = ()=>{
console.log(productimg.scaleImageList[productimg.scaleImageIndex])
let obj = null as any
if(productimg.scaleImageList[productimg.scaleImageIndex]?.resultType == 'ToProductImage'){
obj = {
@@ -420,11 +421,17 @@ setup(props:any,{emit}) {
})
productimg.generateCourse = {
...rv[0],
prompt:productimg.productimgSearchName,
parentId:productimg.selectGenerate?.parentId || productimg.selectGenerate.userLikeGroupId,
modelName:speed.speedData.value,
poseId:productimg.selectPose,
userLikeSortId:productimg.selectGenerate?.parentId || productimg.selectGenerate.userLikeGroupId,
sourceUrl:productimg.selectGenerate?.sourceUrl || productimg.selectGenerate?.productImage,
status:null,
oldId:productimg.openType == 'add'?null:productimg.selectGenerate.id,
resultType:productimg.selectGenerate?.resultType,
}
generateProceedList = rv.map(user => user.taskId);
setPrductimg(arr)
productimg.isGenerate = true
}
@@ -477,7 +484,13 @@ setup(props:any,{emit}) {
let isEnd = false
if(rv[0].status == 'Success'){
productimg.generateCourse.url = rv[0].url
productimg.generateCourse.status = rv[0].status
productimg.generateCourse.designOutfitUrl = rv[0].url
if(rv[0]?.videoUrl){
productimg.generateCourse.firstFrameUrl = rv[0].firstFrameUrl
productimg.generateCourse.videoUrl = rv[0].videoUrl
productimg.generateCourse.gifUrl = rv[0].gifUrl
}
isEnd = true
clearInterval(remPrductimgTime)
}else if(rv[0].status == 'Fail'){
@@ -501,7 +514,7 @@ setup(props:any,{emit}) {
productimg.productimgIsProductimg = false
productimg.productimgRemProductimg= false
});
},productimg.scaleImageList[productimg.scaleImageIndex]?.resultType == 'PoseTransfer'?20000:1000)
},productimg.scaleImageList[productimg.scaleImageIndex]?.resultType == 'PoseTransfer'?10000:1000)
}
let removeProductimg = ()=>{
productimg.productimgIsProductimg = false
@@ -532,8 +545,8 @@ setup(props:any,{emit}) {
}
}
const setUserData = (item:any)=>{
console.log(item)
productimg.productimgSearchName = item.prompt
productimg.productimgBrightenValue = item.brightenValue
productimg.productimgSimilarity = 100 - item.imageStrength * 100
productimg.productimgRelightDirection = item.direction
if(item.poseId){
@@ -602,10 +615,7 @@ setup(props:any,{emit}) {
productimg.productimgRelightDirection = JSON.parse(JSON.stringify(props.productData.RelightDirection))
productimg.selectGenerate.parentId = list[index].parentId || list[index].userLikeSortId
if(productimg.productimgSearchName){
await nextTick()
ifMaximumLength()
}
ifMaximumLength()
if(productimg.poseList.length == 0 && list[index].resultType == 'PoseTransfer'){
await getPoseList()
}
@@ -651,6 +661,9 @@ setup(props:any,{emit}) {
productimg.selectPose = item.id
}
const cancelDsign = async ()=>{
if(productimg.productimgIsProductimg){
if(!productimg.productimgRemProductimg)return
}
if(productimg.isGenerate){
if(productimg.productimgIsProductimg){
clearInterval(prductimgTime)
@@ -704,6 +717,7 @@ setup(props:any,{emit}) {
const ifMaximumLength = async ()=>{
await nextTick()
let textarea = productimg.textarea;
console.log(textarea)
const scrollTop = textarea.scrollTop;
// 2. 计算单行高度
const lineHeight = parseInt(getComputedStyle(textarea).lineHeight) || 20; // 默认20px
@@ -965,7 +979,8 @@ overflow: visible !important;
overflow-x: auto;
> .item{
margin-right: 1rem;
width: calc(100% / 1.2 - .5rem);
width: 15rem;
// width: calc(100% / 1.2 - .5rem);
cursor: pointer;
overflow: hidden;
display: flex;

View File

@@ -239,8 +239,8 @@
) in designCollectionList" :key="design?.designItemId" :style="collStyle">
<div class="content_img_flex"
:class="[(driver__.driver && driver__.index == 32)?'hideEvents':'']"
@mousedown.stop="designMousedown(getMousePosition($event,false),design.designItemId || design.id,'disLike')"
@touchstart.passive="designMousedown(getMousePosition($event,true),design.designItemId || design.id,'disLike')"
@mousedown.stop="designMousedown(getMousePosition($event,false),design,'disLike')"
@touchstart.passive="designMousedown(getMousePosition($event,true),design,'disLike')"
@click="
designDetail(
design,
@@ -331,7 +331,7 @@ import { defineComponent, h, ref, computed, toRefs, createVNode,provide,nextTick
import NewCollectionReview from "@/component/HomePage/NewCollectionReview.vue";
import generalCanvas from "@/component/modules/generalCanvas.vue";
import affiche from "@/component/HomePage/affiche.vue";
import DesignDetailcopy from "@/component/DetailCopy/designDetail.vue";
import DesignDetailcopy from "@/component/Detail/designDetail.vue";
import html2canvas from "html2canvas";
import { message,Modal } from "ant-design-vue";
import { useStore } from "vuex";
@@ -371,7 +371,7 @@ export default defineComponent({
},
props:['isState'],
setup(props,{emit}) {
const {t} = useI18n()
const {t,locale} = useI18n()
const store = useStore();
const editDesignType = reactive({
selectProbject:computed(()=>{
@@ -500,10 +500,10 @@ export default defineComponent({
speed.speedData = item
}
const openEditTools = ()=>{
dataDom.designTools.init(speed.speedData.value,likeDesignCollectionList.value)
dataDom.designTools.init(speed.speedData.value,likeDesignCollectionList.value,t,locale)
}
const openCanvas = ()=>{
dataDom.designTools.init('editCanvas')
dataDom.designTools.init('editCanvas','',t,locale)
}
const designData = reactive({
openEditBtnId:-1,
@@ -549,6 +549,7 @@ export default defineComponent({
watch(()=>likeDesignCollectionList.value.length,(val)=>{
if(val>0){
uploadLikeDom()
setPrductimgAll()
}else{
designData.selectLikeDesign = []
@@ -680,9 +681,12 @@ export default defineComponent({
if(design.resultType != 'Design' || designData.isUnfold)return
if(str != 'like' && showDesignMark.value) return
}
let Id = design.userLikeSortId || design.id
let Id = design.userLikeSortId || design.id || design.designItemId
console.log(design)
let arr = str == 'like'? posiitonData.value.likeElList:posiitonData.value.generateElList
console.log(arr)
let item:any = arr.filter((item:any)=>item.userLikeSortId == Id)[0]
console.log(item)
item.el.style.zIndex = 2;
item.el.style.transition = 'all 0s';
let startX = e.clientX,
@@ -897,6 +901,8 @@ export default defineComponent({
clearInterval(prductimgTime.ToProductImage)
clearInterval(prductimgTime.PoseTransfer)
clearInterval(prductimgTime.Relight)
arr[index].sort = arr[index].oldSort || arr[index].sort
console.log(JSON.parse(JSON.stringify(arr[index])))
dataDom.editDesignType.init(arr,index,null,status,listType)
dataDom.editDesignType.isLike = false
// dataDom.editDesignType.productimgRelightDirection = editDesignType.RelightDirection
@@ -966,19 +972,16 @@ export default defineComponent({
}
})
}else{
console.log(design)
likeDesignCollectionList.value.forEach((item:any)=>{
if(item.resultType == 'Design' && item.userLikeSortId == designData.selectDesign.userLikeSortId){
item.childList.forEach((childItem:any)=>{
if(childItem.sort > design.oldSort){
console.log(childItem)
childItem.sort -= 1
}
})
item.childList = item.childList.filter((childItem:any)=>{
return childItem.id != design.id
})
console.log(item)
}
})
}
@@ -986,7 +989,6 @@ export default defineComponent({
})
nextTick().then(()=>{
console.log(111)
designData.isUnfold = true
uploadLikeDom()
})
@@ -1025,7 +1027,6 @@ export default defineComponent({
}
const upDataSuccess = (element)=>{
console.log(JSON.parse(JSON.stringify(likeDesignCollectionList.value)))
if(designData.isUnfold){
designData.selectLikeDesign.forEach((item:any,index:any) => {
if(element.taskId == item.taskId){
@@ -1041,13 +1042,11 @@ export default defineComponent({
if(likeItem?.childList?.length > 0){
likeItem.childList.forEach((childItem:any,index:any)=>{
if(childItem.taskId == element.taskId){
console.log(childItem)
likeItem.childList[index].url = element.url
likeItem.childList[index].status = element.status
likeItem.childList[index].elementType = element.elementType
likeItem.childList[index].elementId = element.elementId
likeItem.childList[index].id = element.id
console.log(likeItem.childList)
}
})
}
@@ -1060,7 +1059,6 @@ export default defineComponent({
let list = likeDesignCollectionList.value
if(list[likeIndex].childList.length == 0)return
list[likeIndex].childList.forEach((likeItem:any,index:any)=>{
console.log(likeItem)
if(likeItem.sort >= generateCourseItem.sort){
likeItem.sort += 1
}
@@ -1068,10 +1066,8 @@ export default defineComponent({
}
const generateLoad = async (data:any)=>{
// return
console.log(data)
clearInterval(prductimgTime.ToProductImage)
clearInterval(prductimgTime.PoseTransfer)
clearInterval(prductimgTime.Relight)
console.log(JSON.parse(JSON.stringify(data)))
let list = likeDesignCollectionList.value
//添加元素
if(data.addList){
@@ -1080,6 +1076,7 @@ export default defineComponent({
if(oldData?.resultType == "Design"){
let index = list.findIndex((item:any)=>(item.userLikeSortId == generateCourseItem.parentId && item.resultType == "Design"))
if(!list[index]?.childList)list[index].childList = []
generateCourseItem.oldSort = generateCourseItem.sort
generateCourseItem.sort = list[index]?.childList.length + 1
if(data.status == 'add'){
upDataSort(generateCourseItem,index)
@@ -1095,8 +1092,11 @@ export default defineComponent({
upDataSort(generateCourseItem,index)
list[index]?.childList.push(generateCourseItem)
}else{
let childIndex = list[index].childList.findIndex((item:any)=>(item.id == generateCourseItem.id))
list[index].childList[childIndex] = generateCourseItem
upDataSuccess(generateCourseItem)
// let childIndex = list[index].childList.findIndex((item:any)=>(item.id == generateCourseItem?.oldId || generateCourseItem?.id))
// console.log(childIndex)
// console.log(list[index].childList)
// list[index].childList[childIndex] = generateCourseItem
}
}
}
@@ -1108,13 +1108,11 @@ export default defineComponent({
if(oldData?.resultType == "Design"){
}else{
let index = list.findIndex((item:any)=>(item.userLikeSortId == generateCourseItem.parentId))
console.log(index)
if(index != -1){
if(!list[index]?.childList){
list[index].childList = []
}
let childIndex = list[index].childList.findIndex((item:any)=>(item.id == generateCourseItem.id))
console.log(list[index].childList,list[index].childList[childIndex])
list[index].childList.forEach((childItem)=>{
if(childItem.sort > list[index].childList[childIndex].sort){
childItem.sort -= 1
@@ -1129,25 +1127,34 @@ export default defineComponent({
await nextTick().then(()=>{
designData.isUnfold = true
console.log('111s')
uploadLikeDom()
})
setPrductimgAll()
}
const setPrductimgAll = ()=>{
clearInterval(prductimgTime.ToProductImage)
clearInterval(prductimgTime.PoseTransfer)
clearInterval(prductimgTime.Relight)
let list = likeDesignCollectionList.value
let toProductImage = []
let poseTransfer = []
let relight = []
list.forEach((item:any)=>{
if(!item?.childList)item.childList = []
item.childList.forEach((childItem:any)=>{
console.log(childItem)
if(childItem.resultType == 'PoseTransfer'){
if(!childItem.status && !childItem?.firstFrameUrl){
if((!childItem.status || childItem.status != "Success") && !childItem?.firstFrameUrl){
poseTransfer.push(childItem.taskId)
}
}else if(childItem.resultType == 'ToProductImage'){
if(!childItem.status && (!childItem?.url || !childItem?.designOutfitUrl)){
if((!childItem.status || childItem.status != "Success") && (!childItem?.url)){
toProductImage.push(childItem.taskId)
}
}else if(childItem.resultType == 'Relight'){
if(!childItem.status && (!childItem?.url || !childItem?.designOutfitUrl)){
console.log(JSON.parse(JSON.stringify(childItem)))
console.log((!childItem.status || childItem.status != "Success"), (!childItem?.url))
if((!childItem.status || childItem.status != "Success") && (!childItem?.url)){
relight.push(childItem.taskId)
}
}
@@ -1220,7 +1227,7 @@ export default defineComponent({
clearInterval(prductimgTime[type])
setFail(data)
});
},type == 'PoseTransfer'?20000:3000)
},type == 'PoseTransfer'?10000:3000)
}
const gifPlay = (e:any,item:any)=>{
e.target.src = item.gif || item.gifUrl//使用gif图片
@@ -1248,6 +1255,8 @@ export default defineComponent({
item.oldSort = item.sort
if(item?.childList?.length > 0){
item.childList.forEach((childItem:any,childIndex:number)=>{
childItem.oldSort = childItem.sort
childItem.oldSort = childItem.sort
childItem.sort = childItem.sort + childLength + index
// childItem.sort = childIndex + item.sort + childLength

View File

@@ -14,7 +14,7 @@
<div class="generalModel_btn">
<div class="generalModel_closeIcon" @click.stop="closeModal()">
<!-- <i class="fi fi-rr-cross-small"></i> -->
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg width="100%" height="100%" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<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="#000"/>
<rect x="34.6274" y="32.5059" width="3" height="29" rx="1.5" transform="rotate(135 34.6274 32.5059)" fill="#000"/>
@@ -28,7 +28,7 @@
<div class="operate_item" v-show="locationList.length == 6" @click="setProportion(true)">
<!-- <div class="icon iconfont icon-fanhui1 operate_icon"></div> -->
<i class="fi fi-rr-comment-image operate_icon"></i>
<div class="operate_item_des">Proportion</div>
<div class="operate_item_des">{{ $t('ModelPlacement.Proportion') }}</div>
</div>
<div class="operate_item" @click="setProportion(false)">
<i class="fi fi-br-dot-circle operate_icon"></i>
@@ -169,7 +169,7 @@
</div>
<div class="input_blok" v-show="brushProportion">
<div class="label">
<div class="text">Resize</div>
<div class="text">{{ $t('ModelPlacement.Resize') }}</div>
<!-- 伸缩 -->
<a-slider class="slider" v-model:value="slider" :tooltipVisible="false" @change="sliderChange"/>
<!-- <div class="gallery_btn" @click="stretchOK">完成</div> -->

View File

@@ -5,7 +5,7 @@
<!-- <div class="text">Style</div>
<div class="text" style="margin: 0 9rem 0 4rem;">{{ selectObject?.styleName }}</div>
<div class="gallery_btn" style="line-height: 5rem;" @click="setStyle">{{ $t('Habit.Select') }}</div> -->
<div class="text" v-show="systemUser">{{ $t('Model.Style') }}</div>
<div class="text" v-show="systemUser">{{ $t('Model.Style') }}</div>
<div class="generalModel_state" style="width: 20rem;" v-show="systemUser">
<div class="generalModel_state_item" style="margin: 0; width: 100%;">
<a-select

View File

@@ -17,7 +17,7 @@
>
<div class="generalModel_btn">
<div class="generalModel_closeIcon" @click.stop="cleardata()">
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg width="100%" height="100%" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="23" cy="23" r="23" fill="#000" 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"/>
@@ -64,9 +64,9 @@
</div>
<div class="btn">
<div class="gallery_btn" @click="saveCanvas">Save</div>
<div class="gallery_btn" @click="share">Share</div>
<div class="gallery_btn" @click="exportElement">Export</div>
<div class="gallery_btn" @click="saveCanvas">{{ $t('exportModel.Save') }}</div>
<div class="gallery_btn" @click="share">{{ $t('exportModel.Share') }}</div>
<div class="gallery_btn" @click="exportElement">{{ $t('exportModel.Export') }}</div>
</div>
</div>
</div>
@@ -82,6 +82,7 @@ import { defineComponent,computed,ref,provide,nextTick,inject,toRefs, reactive,
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { Https } from "@/tool/https";
import { useStore } from "vuex";
import { Modal,message } from 'ant-design-vue';
import { downloadIamge,getMinioUrl } from "@/tool/util";
import { useI18n } from 'vue-i18n'
import toProductRelight from '../tools/toProduct/index.vue'
@@ -106,6 +107,8 @@ export default defineComponent({
emits:['editToolsSuccess'],
setup(props,{emit}) {
const store = useStore();
let locale = null as any;
let t = null as any;
const data = reactive({
designTools:false,
isShowMark:false,
@@ -117,6 +120,9 @@ export default defineComponent({
canvasSelectList:[] as any,
canvasDetailData:null as any,
unLikeList:[],
locale:null as any,
t:null as any,
})
const dataDom = reactive({
toProduct:null as any,
@@ -125,13 +131,18 @@ export default defineComponent({
editCanvas:null as any,
publish:null as any,
}) as any
const init = (value:any,list:any)=>{
const init = async (value:any,list:any,t:any,locale:any)=>{
store.commit('toolsClear')
data.t = t
data.locale = locale.value
data.designTools = true
if(value == 'editCanvas')await getCanvasData('canvas')
data.openType = value
if(value == 'editCanvas'){
getSelectCanvasImg()
return
nextTick(()=>{
getSelectCanvasImg()
return
})
}
data.likeDesignList = list
nextTick(()=>{
@@ -179,7 +190,7 @@ export default defineComponent({
console.log(likeData)
store.commit("setPoseTransfer", likeData);
}
dataDom[value].openSetData(fileList)
if(dataDom[value]?.openSetData)dataDom[value]?.openSetData(fileList)
})
}
const unLike = (item)=>{
@@ -194,9 +205,11 @@ export default defineComponent({
}else if(data.openType == 'poseTransfer'){
list = store.state.HomeStoreModule.poseTransfer.likedList
}
let generateCourse = list.filter((item)=>item.oldSort)
generateCourse = generateCourse.map(item => {
return item.oldSort ? { ...item, sort: item.oldSort } : item;
let generateCourse = list.filter((item) => item.newLike)
.map(item => {
// 删除 newLike 字段
const { newLike, ...rest } = item; // 解构赋值移除 newLike
return item.oldSort ? { ...rest, sort: item.oldSort } : rest;
});
let emitData = {
status:'add',
@@ -215,15 +228,30 @@ export default defineComponent({
//画布相关
const getCanvasData = (str:any)=>{
return new Promise((resolve, reject) => {
let value = {
module:str,
projectId:data.selectObject.id,
}
Https.axiosPost(Https.httpUrls.exportSearch, value)
.then((rv) => {
store.commit("setCanvasData", {type:str,file:rv});
resolve('')
})
.catch((rv) => {
resolve(null)
});
})
}
const getSelectCanvasImg = ()=>{
data.canvasSelectList = []
let allCollection = store.state.UploadFilesModule.allBoardData
console.log(allCollection)
let allCollectionStr = [
{value:'disposeMoodboard',name:'Entirety Moodboard'},
{value:'moodboardFiles',name:'Moodboard'},
{value:'printboardFiles',name:'Printboard'},
{value:'sketchboardFiles',name:'Sketchboard'},
{value:'disposeMoodboard',name:'Entirety Moodboard',nameCn:'整体情绪版'},
{value:'moodboardFiles',name:'Moodboard',nameCn:'情绪版'},
{value:'printboardFiles',name:'Printboard',nameCn:'印花板'},
{value:'sketchboardFiles',name:'Sketchboard',nameCn:'整体情绪版'},
]
allCollectionStr.forEach((itemStr:any)=>{
let list = [] as any
@@ -232,7 +260,7 @@ export default defineComponent({
})
let obj = {
value:itemStr.value,
type:itemStr.name,
type:data.locale == "ENGLISH"?itemStr.name:itemStr.nameCn,
imgList:list,
}
if(list.length > 0){
@@ -252,7 +280,7 @@ export default defineComponent({
})
let obj = {
value:'design',
type:'Design',
type:data.locale == "ENGLISH"?'Design':'设计',
imgList:list
}
if(list.length > 0){
@@ -284,7 +312,6 @@ export default defineComponent({
canvasData.canvas.objects.forEach((objectsItem:any) => {
if(objectsItem.type == 'image')objectsItem.minioUrl = getMinioUrl(objectsItem.src)
});
console.log(canvasData)
let blob = new Blob([JSON.stringify(canvasData)], { type: "application/json" });
let formData = new FormData();
formData.append("file", blob, "data.json");
@@ -295,7 +322,7 @@ export default defineComponent({
};
Https.axiosPost(Https.httpUrls.exportSave, formData, config).then(
(rv) => {
console.log(rv)
message.success(data.t('exportModel.jsContent7'))
}
);
}
@@ -485,7 +512,7 @@ export default defineComponent({
.fullScreen{
.generalModel_btn {
.generalModel_closeIcon{
transform: translate(-10%, 10%);
transform: translate(-100%, 50%);
}
}
}

View File

@@ -16,9 +16,12 @@
<div v-else class="function">
<newPorject ref="newPorject" @newProject=newProject></newPorject>
</div>
<!-- <iframe src="https://kaput-relative-4bb.notion.site/ebd/22a8f755cedd809e98a2c8c6366ee701" width="100%" height="100%" frameborder="0" allowfullscreen /> -->
</div>
</div>
<chat ref="chatDom" @chatChange="chatChange" v-show="openType == 'history'"></chat>
<!-- <chat ref="chatDom" @chatChange="chatChange" v-show="openType == 'history'"></chat> -->
</template>
<script lang="ts">
import { defineComponent,computed,inject,watch,nextTick,provide,toRefs, reactive, onMounted} from 'vue'
@@ -192,16 +195,11 @@ export default defineComponent({
}else{
position = store.state.UserHabit.MalePosition
}
// storeData.model = model
data.selectObject.positionList = position
storeData.positionList = position
store.commit('setProbject',storeData)
// let list:any = projectList
// store.commit('setProjectList',list[type.value])
// nextTick(()=>{
// dataDom.workflow.isUpdataPorject = true
// })
setChatData()
// setChatData()
if(route.name == 'tools'){
getCollection('tools',null)
}else{
@@ -269,7 +267,8 @@ export default defineComponent({
}
let allBoardData = ['sketchBoard','moodBoard','printBoard','colorBoard']
// let allBoardData = ['sketchBoard','moodBoard','printBoard','colorBoard','toProduct','relight','poseTransfer','mannequin']
let canvasData = ['canvas','deReconstruction']
let canvasData = ['deReconstruction']
// let canvasData = ['canvas','deReconstruction']
for (let index = 0; index < canvasData.length; index++) {
const item = canvasData[index];
await getCanvasData(item)

View File

@@ -1,50 +1,26 @@
<template>
<div class="newProject">
<div class="contentBox">
<div class="content">
<div class="title" v-show="chatOrSetting == 'chat'">{{$t('newProjectg.helpYou')}}</div>
<div class="selectFlow">
<div class="select">
<div class="item" @click="setFlow(item)" :class="{active:item.title == selectFlow.title}" v-for="item in flowList">{{ item.title }}</div>
<div class="select" v-show="!isCreateBox">
<div class="title">AiDA</div>
<div class="info">{{ $t('newProjectg.info') }}</div>
<div class="selectList">
<div :class="{active:selectFlow?.value == seiesDesign.value}" @click="selectSeiesOrSingle(seiesDesign)">
<img src="@/assets/images/homePage/icon/homeCreateSeriesDesign.svg" alt="">
<span>{{ seiesDesign.title }}</span>
</div>
<!-- <div class="describe">
<p v-for="item in selectFlow.describe">{{ item }}</p>
</div> -->
</div>
<div class="chatOrSetting">
<div class="select">
<div class="item" @click="setChatOrSetting('chat')" :class="{active:chatOrSetting == 'chat'}">{{$t('newProjectg.Chat')}}</div>
<div class="item" @click="setChatOrSetting('setting')" :class="{active:chatOrSetting == 'setting'}">{{$t('newProjectg.Setting')}}</div>
<div :class="{active:selectFlow?.value == singleDesign.value}" @click="selectSeiesOrSingle(singleDesign)">
<img src="@/assets/images/homePage/icon/homeCreateSingleDesign.svg" alt="">
<span>{{ singleDesign.title }}</span>
</div>
</div>
<div class="chatBox" v-show="chatOrSetting == 'chat'">
<textarea ref="textarea" @input="inputText($event)" @keydown.enter.prevent="sendChat" placeholder="Write your message"></textarea>
<div class="btn">
<div class="uploadBox">
<div class="filList">
<div class="item" v-for="item,index in filList">
<div>{{item.name}}</div>
<span class="icon iconfont icon-shanchu" @click="deleteFile(item,index)"></span>
</div>
</div>
<i class="fi fi-rs-paperclip-vertical">
<input type="file" @change="handleFileUpload($event)">
</i>
<div class="enableThinking" :class="{active:enableThinking}" @click="()=>enableThinking = !enableThinking">{{$t('newProjectg.DeepThinking')}}</div>
</div>
<div class="sendBox">
<div class="maxNum">{{ chatContent.length }}/10000</div>
<div class="send" @click="sendChat">
<i class="fi fi-ss-paper-plane-top"></i>
</div>
</div>
</div>
</div>
<div v-show="chatOrSetting != 'chat'" class="workspaceBox">
<workspace @setProject="setProject" :httpWorkflowType="selectFlow.value"></workspace>
</div>
<div class="hint" v-show="chatOrSetting == 'chat'">
<div class="item" v-for="item in hintList[selectFlow.value]" :title="item.value" @click="addChatContent(item)">{{ item }}</div>
<div class="gallery_btn gallery_btn_radius" @click="goCreate">{{ $t('newProjectg.CreateProject') }}</div>
</div>
<div class="content" v-show="isCreateBox">
<i class="fi fi-rr-arrow-small-left" @click="()=>isCreateBox = false"></i>
<div class="workspaceBox">
<workspace @setProject="setProject" :httpWorkflowType="selectFlow?.value"></workspace>
</div>
</div>
</div>
@@ -74,176 +50,44 @@ export default defineComponent({
const {t} = useI18n()
const store = useStore();
const data = reactive({
flowList:[
{
title:computed(()=>t('newProjectg.SeriesDesign')),
value:'SERIES_DESIGN',
describe:[
computed(()=>t('newProjectg.SeriesDesignInfo')),
]
},
{
title:computed(()=>t('newProjectg.SingleDesign')),
value:'SINGLE_DESIGN',
describe:[
computed(()=>t('newProjectg.SingleDesignInfo')),
]
},
],
selectFlow:{
title:computed(()=>t('newProjectg.SeriesDesign')),
seiesDesign:{
title:computed(()=>t('newProjectg.series')),
value:'SERIES_DESIGN',
describe:[
computed(()=>t('newProjectg.SeriesDesignInfo')),
]
},
chatContent:'',
hintList:{
SERIES_DESIGN:[
computed(()=>t('newProjectg.hintListSERIES1')),
computed(()=>t('newProjectg.hintListSERIES2')),
computed(()=>t('newProjectg.hintListSERIES3')),
],
SINGLE_DESIGN:[
computed(()=>t('newProjectg.hintListSIGNLE1')),
computed(()=>t('newProjectg.hintListSIGNLE2')),
computed(()=>t('newProjectg.hintListSIGNLE3')),
],
singleDesign:{
title:computed(()=>t('newProjectg.single')),
value:'SINGLE_DESIGN',
},
selectFlow:{
},
enableThinking:false,//深度思考
uploadFile:null as any,
isCreateBox:false,
loadingShow:false,
text:'',
filList:[] as any,
textarea:null as any,
chatOrSetting:'chat',
})
const dataDom = reactive({
})
const setFlow = (item:any)=>{
data.selectFlow = item
}
const inputText = (e:any)=>{
if(e.target.value.length <= 1000){
data.chatContent = e.target.value
}else{
e.target.value = data.chatContent
}
e.target.style.height = `${e.target.scrollHeight}px`;
}
const addChatContent = (item:any)=>{
let str = item.value
if((data.textarea.value?.length + str.length) > 10000)return
// data.chatContent += item
// data.textarea.value += item
data.chatContent = str
data.textarea.value = str
}
const sendChat = ()=>{
if(!data.chatContent)return
data.loadingShow = true
let fileList = JSON.parse(JSON.stringify(data.filList))
let fileUrl = (fileList.filter((item:any)=>item.type == 'file').length > 0) ? fileList.filter((item:any)=>item.type == 'file')[0].minioPath : ''
let imageUrlList = (fileList.filter((item:any)=>item.type == 'image').length > 0)? fileList.filter((item:any)=>item.type == 'image').map((item:any)=>item.minioPath).join(',') : ''
Https.axiosGet(Https.httpUrls.chatCreateProject, {params:{prompt:data.chatContent,process:data.selectFlow.value,fileUrl:fileUrl,imageUrlList}}).then((rv)=>{
if(rv){
data.loadingShow = false
let value = {
id:rv,
fileList:fileList,
chatContent:data.chatContent,
enableThinking:data.enableThinking,
newMode:'chat',
}
emit('newProject',value)
}
}).catch(()=>{
data.loadingShow = false
})
// let projectId = ''
// const eventSource = new EventSource(`${import.meta.env.VITE_APP_BASE_URL}${Https.httpUrls.llmStream}?token=${getCookie('token')}&prompt=${data.chatContent}&projectId=&fileUrl=${fileUrl}&imageUrlList=${imageUrlList}&enableThinking=${data.enableThinking}&process=${data.selectFlow.value}`);
// eventSource.onmessage = function(event) {
// let eventData = JSON.parse(event.data)
// if(eventData.status == "[PROJECT_CREATE_SIGNAL]"){
// projectId = JSON.parse(eventData.tools_data).projectId
// }
// };
// eventSource.onerror = function(error) {
// if (eventSource.readyState === EventSource.CLOSED) {
// // data.chatList[data.chatList.length-1].content.message='服务器繁忙,请稍后再试。'
// } else {
// if(projectId){
// emit('newProject',projectId)
// }
// eventSource.close()
// }
// data.loadingShow = false
// };
}
const handleFileUpload = (event:any)=>{
if (event.target.files[0].size > 5 * 1024 * 1024) { // 5MB
message.info(t('newProjectg.jsContent1'));
return
}
let type = event.target.files[0].type.startsWith('image/')
if(type){
if(data.filList.filter((item:any)=>item.type == 'image').length >= 5){
message.info(t('newProjectg.jsContent2'));
return
}
}else{
if(data.filList.filter((item:any)=>item.type == 'file').length >= 1){
message.info(t('newProjectg.jsContent3'));
return
}
}
data.loadingShow = true
const formData = new FormData();
formData.append('file', event.target.files[0]);
let config:any = {
headers:{'Content-Type':'multipart/form-data','Accept':'*/*' },
params:formData,
}
Https.axiosPost(Https.httpUrls.llmUploadFile,formData,config)
.then((rv: any) => {
let obj = {
name:event.target.files[0].name,
type:type?'image':'file',
minioPath:rv[0],
url:rv[1],
}
data.filList.push(obj)
data.loadingShow = false
}
).catch(rv=>{
data.loadingShow = false
})
}
const deleteFile = (item:any,index:number)=>{
data.filList.splice(index,1)
}
const setChatOrSetting = (str:any)=>{
data.chatOrSetting = str
}
const setProject = (item:any)=>{
emit('newProject',item)
// router.push(`home?history=${item.id}`)
}
const selectSeiesOrSingle = (type:any)=>{
data.selectFlow = type
}
const goCreate = ()=>{
if(!data.selectFlow?.value){
return message.info(t('newProjectg.selectDesignType'))
}
data.isCreateBox = true
}
onMounted(()=>{
store.commit('createProbject')
})
return{
...toRefs(dataDom),
...toRefs(data),
setFlow,
inputText,
addChatContent,
sendChat,
handleFileUpload,
deleteFile,
setChatOrSetting,
setProject,
selectSeiesOrSingle,
goCreate,
}
},
provide() {
@@ -264,211 +108,97 @@ export default defineComponent({
display: flex;
align-items: center;
justify-content: center;
> .content{
// background: red;
width: 88rem;
height: 100%;
> .select{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
> .title{
font-size: 4rem;
font-weight: 600;
}
> .info{
margin-top: 1.2rem;
font-weight: 600;
font-size: 2.4rem;
}
> .selectList{
margin-top: 4.8rem;
display: flex;
> div{
margin-right: 6rem;
border-radius: 3.2rem;
cursor: pointer;
border: 1px solid #D9D9D9;
background-color: #fff;
height: 6.5rem;
padding: 0 2.3rem;
display: flex;
align-items: center;
&.active{
background-color: #efeff1;
}
> img{
width: 2.7rem;
height: 2.7rem;
margin-right: 1rem;
}
> span{
font-weight: 600;
font-size: 2rem;
color: #3B3B3B;
}
&:last-child{
margin-right: 0;
}
}
}
.gallery_btn{
margin-top: 4rem;
}
}
> .content{
// background: red;
// width: 88rem;
height: 100%;
position: relative;
> i{
cursor: pointer;
position: absolute;
transform: translateX(-100%);
left: -2.6rem;
top: 1.8rem;
width: 5rem;
height: 5rem;
display: flex;
font-size: 4rem;
color: #fff;
background-color: #000;
border-radius: 50%;
align-items: center;
justify-content: center;
}
> .title{
font-size: 2rem;
font-weight: 600;
text-align: center;
}
> .workspaceBox{
flex: 1;
border-radius: 2.4rem;
padding: 1.2rem;
border: 1px solid #0000001a;
// height: 89rem;
height: 100%;
// flex: 1;
border-radius: 1.6rem;
padding: 3.2rem 0rem;
border: 2px solid #D0D0D0;
:deep(.workspace){
padding: 0;
height: auto;
}
}
> .selectFlow{
margin-top: 4.8rem;
width: 100%;
border-radius: 2.4rem;
// border: 1px solid #0000001a;
// padding: 1.2rem;
> .select{
border: 1px solid #0000001a;
border-radius: 2.4rem;
display: flex;
padding: .2rem;
border-radius: 2rem;
> div{
white-space: nowrap;
justify-content: space-between;
border-radius: 2.2rem;
font-size: 1.6rem;
padding: .6rem .8rem;
min-width: 25%;
text-align: center;
font-weight: 600;
color: #71717a;
cursor: pointer;
&.active{
background: #efeff1;
color: #3f3f46;
height: 100%;
> .workspaceBox{
> div{
padding: 0rem 2.1rem;
}
}
}
> .describe{
margin-top: 1.6rem;
margin-left: .8rem;
> p{
margin: 0;
color: #71717a;
font-weight: 400;
font-size: 1.2rem;
}
}
}
> .chatOrSetting{
margin-top: 2.4rem;
width: min-content;
margin-left: auto;
> .select{
border: 1px solid #0000001a;
border-radius: 2.4rem;
display: flex;
padding: .2rem;
border-radius: 2rem;
> div{
white-space: nowrap;
justify-content: space-between;
border-radius: 2.2rem;
font-size: 1.6rem;
padding: .6rem .8rem;
min-width: 10rem;
text-align: center;
font-weight: 600;
color: #71717a;
cursor: pointer;
&.active{
background: #efeff1;
color: #3f3f46;
}
}
}
}
> .chatBox{
margin-top: .4rem;
border-radius: 2.4rem;
position: relative;
background: #f5f5f5;
> textarea{
padding: 1.6rem 2rem 0;
background: #f5f5f5;
width: 100%;
min-height: 7.2rem;
border-radius: 2.4rem;
font-weight: 400;
line-height: 2rem;
font-size: 1.4rem;
resize: none;
border: none;
overflow-y: hidden;
}
> .btn{
padding: 0 1.2rem 1.2rem;
display: flex;
justify-content: space-between;
> .uploadBox{
display: flex;
align-items: center;
> .filList{
display: flex;
> .item{
height: 3rem;
padding: .5rem 1rem;
background: #efeff1;
border-radius: .5rem;
margin-right: 1rem;
font-size: 1.4rem;
line-height: 2rem;
display: flex;
> div{
white-space: nowrap;
overflow: hidden;
max-width: 10rem;
text-overflow: ellipsis;
}
> span{
cursor: pointer;
}
}
}
> .enableThinking{
width: 10rem;
padding: .2rem .4rem;
margin-left: 1rem;
text-align: center;
font-size: 1.4rem;
border: 1px solid #000;
border-radius: .4rem;
cursor: pointer;
&.active{
background: #000;
color: #fff;
}
}
}
i{
font-size: 2rem;
display: flex;
cursor: pointer;
position: relative;
> input{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
opacity: 0;
cursor: pointer;
&::-webkit-file-upload-button {
cursor: pointer;
}
}
}
> .sendBox{
display: flex;
align-items: center;
> .maxNum{
font-size: 1.2rem;
margin-right: .8rem;
font-weight: 400;
}
}
}
}
> .hint{
display: flex;
margin-top: 2.4rem;
> div{
background: #efeff1;
width: 25rem;
// height: 4.8rem;
margin-right: 1.2rem;
border-radius: 1.6rem;
font-size: 1.6rem;
cursor: pointer;
padding: 1.2rem;
white-space: nowrap; /* 文本不换行 */
overflow: hidden; /* 溢出部分隐藏 */
text-overflow: ellipsis; /* 显示省略号 */
&:hover{
background: #f5f5f5;
}
:first-child{
margin-right: 0;
}
}
}
}
}

View File

@@ -0,0 +1,477 @@
<template>
<div class="newProject">
<div class="contentBox">
<div class="content">
<div class="title" v-show="chatOrSetting == 'chat'">{{$t('newProjectg.helpYou')}}</div>
<div class="selectFlow">
<div class="select">
<div class="item" @click="setFlow(item)" :class="{active:item.title == selectFlow.title}" v-for="item in flowList">{{ item.title }}</div>
</div>
<!-- <div class="describe">
<p v-for="item in selectFlow.describe">{{ item }}</p>
</div> -->
</div>
<!-- <div class="chatOrSetting">
<div class="select">
<div class="item" @click="setChatOrSetting('chat')" :class="{active:chatOrSetting == 'chat'}">{{$t('newProjectg.Chat')}}</div>
<div class="item" @click="setChatOrSetting('setting')" :class="{active:chatOrSetting == 'setting'}">{{$t('newProjectg.Setting')}}</div>
</div>
</div> -->
<div class="chatBox" v-show="chatOrSetting == 'chat'">
<textarea ref="textarea" @input="inputText($event)" @keydown.enter.prevent="sendChat" placeholder="Write your message"></textarea>
<div class="btn">
<div class="uploadBox">
<div class="filList">
<div class="item" v-for="item,index in filList">
<div>{{item.name}}</div>
<span class="icon iconfont icon-shanchu" @click="deleteFile(item,index)"></span>
</div>
</div>
<i class="fi fi-rs-paperclip-vertical">
<input type="file" @change="handleFileUpload($event)">
</i>
<div class="enableThinking" :class="{active:enableThinking}" @click="()=>enableThinking = !enableThinking">{{$t('newProjectg.DeepThinking')}}</div>
</div>
<div class="sendBox">
<div class="maxNum">{{ chatContent.length }}/10000</div>
<div class="send" @click="sendChat">
<i class="fi fi-ss-paper-plane-top"></i>
</div>
</div>
</div>
</div>
<div v-show="chatOrSetting != 'chat'" class="workspaceBox">123
<workspace @setProject="setProject" :httpWorkflowType="selectFlow.value"></workspace>
</div>
<div class="hint" v-show="chatOrSetting == 'chat'">
<div class="item" v-for="item in hintList[selectFlow.value]" :title="item.value" @click="addChatContent(item)">{{ item }}</div>
</div>
</div>
</div>
<div class="mark_loading" v-show="loadingShow">
<a-spin size="large" />
</div>
</div>
</template>
<script lang="ts">
import { defineComponent,computed,ref,provide,nextTick,createVNode,toRefs, reactive, onMounted} from 'vue'
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { Https } from "@/tool/https";
import { useStore } from "vuex";
import { Modal,message,Upload,CascaderProps } from 'ant-design-vue';
import { useI18n } from 'vue-i18n'
import {getCookie,clonAllCookie} from '@/tool/cookie'
import router from '@/router';
import workspace from './workspace.vue'
export default defineComponent({
components:{
workspace,
},
props:{
},
emits:['newProject'],
setup(props,{emit}) {
const {t} = useI18n()
const store = useStore();
const data = reactive({
flowList:[
{
title:computed(()=>t('newProjectg.SeriesDesign')),
value:'SERIES_DESIGN',
describe:[
computed(()=>t('newProjectg.SeriesDesignInfo')),
]
},
{
title:computed(()=>t('newProjectg.SingleDesign')),
value:'SINGLE_DESIGN',
describe:[
computed(()=>t('newProjectg.SingleDesignInfo')),
]
},
],
selectFlow:{
title:computed(()=>t('newProjectg.SeriesDesign')),
value:'SERIES_DESIGN',
describe:[
computed(()=>t('newProjectg.SeriesDesignInfo')),
]
},
chatContent:'',
hintList:{
SERIES_DESIGN:[
computed(()=>t('newProjectg.hintListSERIES1')),
computed(()=>t('newProjectg.hintListSERIES2')),
computed(()=>t('newProjectg.hintListSERIES3')),
],
SINGLE_DESIGN:[
computed(()=>t('newProjectg.hintListSIGNLE1')),
computed(()=>t('newProjectg.hintListSIGNLE2')),
computed(()=>t('newProjectg.hintListSIGNLE3')),
],
},
enableThinking:false,//深度思考
uploadFile:null as any,
loadingShow:false,
text:'',
filList:[] as any,
textarea:null as any,
// chatOrSetting:'chat',
chatOrSetting:'setting',
})
const dataDom = reactive({
})
const setFlow = (item:any)=>{
data.selectFlow = item
}
const inputText = (e:any)=>{
if(e.target.value.length <= 1000){
data.chatContent = e.target.value
}else{
e.target.value = data.chatContent
}
e.target.style.height = `${e.target.scrollHeight}px`;
}
const addChatContent = (item:any)=>{
let str = item.value
if((data.textarea.value?.length + str.length) > 10000)return
// data.chatContent += item
// data.textarea.value += item
data.chatContent = str
data.textarea.value = str
}
const sendChat = ()=>{
if(!data.chatContent)return
data.loadingShow = true
let fileList = JSON.parse(JSON.stringify(data.filList))
let fileUrl = (fileList.filter((item:any)=>item.type == 'file').length > 0) ? fileList.filter((item:any)=>item.type == 'file')[0].minioPath : ''
let imageUrlList = (fileList.filter((item:any)=>item.type == 'image').length > 0)? fileList.filter((item:any)=>item.type == 'image').map((item:any)=>item.minioPath).join(',') : ''
Https.axiosGet(Https.httpUrls.chatCreateProject, {params:{prompt:data.chatContent,process:data.selectFlow.value,fileUrl:fileUrl,imageUrlList}}).then((rv)=>{
if(rv){
data.loadingShow = false
let value = {
id:rv,
fileList:fileList,
chatContent:data.chatContent,
enableThinking:data.enableThinking,
newMode:'chat',
}
emit('newProject',value)
}
}).catch(()=>{
data.loadingShow = false
})
// let projectId = ''
// const eventSource = new EventSource(`${import.meta.env.VITE_APP_BASE_URL}${Https.httpUrls.llmStream}?token=${getCookie('token')}&prompt=${data.chatContent}&projectId=&fileUrl=${fileUrl}&imageUrlList=${imageUrlList}&enableThinking=${data.enableThinking}&process=${data.selectFlow.value}`);
// eventSource.onmessage = function(event) {
// let eventData = JSON.parse(event.data)
// if(eventData.status == "[PROJECT_CREATE_SIGNAL]"){
// projectId = JSON.parse(eventData.tools_data).projectId
// }
// };
// eventSource.onerror = function(error) {
// if (eventSource.readyState === EventSource.CLOSED) {
// // data.chatList[data.chatList.length-1].content.message='服务器繁忙,请稍后再试。'
// } else {
// if(projectId){
// emit('newProject',projectId)
// }
// eventSource.close()
// }
// data.loadingShow = false
// };
}
const handleFileUpload = (event:any)=>{
if (event.target.files[0].size > 5 * 1024 * 1024) { // 5MB
message.info(t('newProjectg.jsContent1'));
return
}
let type = event.target.files[0].type.startsWith('image/')
if(type){
if(data.filList.filter((item:any)=>item.type == 'image').length >= 5){
message.info(t('newProjectg.jsContent2'));
return
}
}else{
if(data.filList.filter((item:any)=>item.type == 'file').length >= 1){
message.info(t('newProjectg.jsContent3'));
return
}
}
data.loadingShow = true
const formData = new FormData();
formData.append('file', event.target.files[0]);
let config:any = {
headers:{'Content-Type':'multipart/form-data','Accept':'*/*' },
params:formData,
}
Https.axiosPost(Https.httpUrls.llmUploadFile,formData,config)
.then((rv: any) => {
let obj = {
name:event.target.files[0].name,
type:type?'image':'file',
minioPath:rv[0],
url:rv[1],
}
data.filList.push(obj)
data.loadingShow = false
}
).catch(rv=>{
data.loadingShow = false
})
}
const deleteFile = (item:any,index:number)=>{
data.filList.splice(index,1)
}
const setChatOrSetting = (str:any)=>{
data.chatOrSetting = str
}
const setProject = (item:any)=>{
emit('newProject',item)
// router.push(`home?history=${item.id}`)
}
onMounted(()=>{
store.commit('createProbject')
})
return{
...toRefs(dataDom),
...toRefs(data),
setFlow,
inputText,
addChatContent,
sendChat,
handleFileUpload,
deleteFile,
setChatOrSetting,
setProject,
}
},
provide() {
return {
}
},
})
</script>
<style lang="less" scoped>
.newProject{
width: 100%;
height: 100%;
position: relative;
> .contentBox{
width: 100%;
// height: calc(100% - 3.9rem);
height: 100%;
display: flex;
align-items: center;
justify-content: center;
> .content{
width: auto;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
> .title{
font-size: 2rem;
font-weight: 600;
text-align: center;
}
> .workspaceBox{
flex: 1;
border-radius: 2.4rem;
padding: 1.2rem;
border: 1px solid #0000001a;
:deep(.workspace){
padding: 0;
height: auto;
}
}
> .selectFlow{
margin-top: 4.8rem;
width: 100%;
border-radius: 2.4rem;
// border: 1px solid #0000001a;
// padding: 1.2rem;
> .select{
border: 1px solid #0000001a;
border-radius: 2.4rem;
display: flex;
padding: .2rem;
border-radius: 2rem;
> div{
white-space: nowrap;
justify-content: space-between;
border-radius: 2.2rem;
font-size: 1.6rem;
padding: .6rem .8rem;
min-width: 25%;
text-align: center;
font-weight: 600;
color: #71717a;
cursor: pointer;
&.active{
background: #efeff1;
color: #3f3f46;
}
}
}
> .describe{
margin-top: 1.6rem;
margin-left: .8rem;
> p{
margin: 0;
color: #71717a;
font-weight: 400;
font-size: 1.2rem;
}
}
}
> .chatOrSetting{
margin-top: 2.4rem;
width: min-content;
margin-left: auto;
> .select{
border: 1px solid #0000001a;
border-radius: 2.4rem;
display: flex;
padding: .2rem;
border-radius: 2rem;
> div{
white-space: nowrap;
justify-content: space-between;
border-radius: 2.2rem;
font-size: 1.6rem;
padding: .6rem .8rem;
min-width: 10rem;
text-align: center;
font-weight: 600;
color: #71717a;
cursor: pointer;
&.active{
background: #efeff1;
color: #3f3f46;
}
}
}
}
> .chatBox{
margin-top: .4rem;
border-radius: 2.4rem;
position: relative;
background: #f5f5f5;
> textarea{
padding: 1.6rem 2rem 0;
background: #f5f5f5;
width: 100%;
min-height: 7.2rem;
border-radius: 2.4rem;
font-weight: 400;
line-height: 2rem;
font-size: 1.4rem;
resize: none;
border: none;
overflow-y: hidden;
}
> .btn{
padding: 0 1.2rem 1.2rem;
display: flex;
justify-content: space-between;
> .uploadBox{
display: flex;
align-items: center;
> .filList{
display: flex;
> .item{
height: 3rem;
padding: .5rem 1rem;
background: #efeff1;
border-radius: .5rem;
margin-right: 1rem;
font-size: 1.4rem;
line-height: 2rem;
display: flex;
> div{
white-space: nowrap;
overflow: hidden;
max-width: 10rem;
text-overflow: ellipsis;
}
> span{
cursor: pointer;
}
}
}
> .enableThinking{
width: 10rem;
padding: .2rem .4rem;
margin-left: 1rem;
text-align: center;
font-size: 1.4rem;
border: 1px solid #000;
border-radius: .4rem;
cursor: pointer;
&.active{
background: #000;
color: #fff;
}
}
}
i{
font-size: 2rem;
display: flex;
cursor: pointer;
position: relative;
> input{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
opacity: 0;
cursor: pointer;
&::-webkit-file-upload-button {
cursor: pointer;
}
}
}
> .sendBox{
display: flex;
align-items: center;
> .maxNum{
font-size: 1.2rem;
margin-right: .8rem;
font-weight: 400;
}
}
}
}
> .hint{
display: flex;
margin-top: 2.4rem;
> div{
background: #efeff1;
width: 25rem;
// height: 4.8rem;
margin-right: 1.2rem;
border-radius: 1.6rem;
font-size: 1.6rem;
cursor: pointer;
padding: 1.2rem;
white-space: nowrap; /* 文本不换行 */
overflow: hidden; /* 溢出部分隐藏 */
text-overflow: ellipsis; /* 显示省略号 */
&:hover{
background: #f5f5f5;
}
:first-child{
margin-right: 0;
}
}
}
}
}
}
</style>

View File

@@ -5,6 +5,7 @@
v-model:visible="habitSetStyle"
:footer="null"
width="50%"
height="auto"
:get-container="() => $refs.projectSettingModal"
:maskClosable="false"
:centered="true"
@@ -16,7 +17,7 @@
>
<div class="generalModel_btn">
<div class="generalModel_closeIcon" @click.stop="cleardata()">
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg width="100%" height="100%" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<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"/>
@@ -25,7 +26,7 @@
</div>
<div class="designOpenrtion_content">
<div class="modal_title_text">
<div>Setting</div>
<div>{{ $t('newProjectg.projectSetting') }}</div>
</div>
<div class="workspaceBox">
<workspace ref="workspace" :status="'edit'" @setProject="setProject" :httpWorkflowType="projectData.process"></workspace>
@@ -43,7 +44,6 @@ import { Https } from "@/tool/https";
import { useStore } from "vuex";
import { useI18n } from 'vue-i18n'
import workspace from './workspace.vue'
import { init } from 'echarts/core';
export default defineComponent({
components:{
workspace,
@@ -65,7 +65,6 @@ export default defineComponent({
data.isShowMark = boolean
}
const init = (value:any)=>{
console.log(value)
data.projectData = value
data.habitSetStyle = true
getHistory(value.id)

View File

@@ -1,6 +1,9 @@
<template>
<div class="workspace">
<div class="workspaceBox">
<div class="title marginBottom">
<div class="titleText">{{$t('Habit.generationSetting')}}</div>
</div>
<div class="projectName marginBottom" v-if="show.title">
<div class="text">{{$t('Habit.ProjectName')}}: <span style="color: red;">*</span></div>
<div class="input">
@@ -35,18 +38,19 @@
</div>
<div class="style marginBottom" v-if="show.style">
<div class="text">{{$t('Habit.Style')}}</div>
<div class="text">{{ selectObject?.styleName?selectObject?.styleName:'All' }}</div>
<div class="gallery_btn" style="line-height: 5rem;" @click="setStyle">{{ $t('Habit.Select') }}</div>
<div class="center">{{ selectObject?.styleName?selectObject?.styleName:'All' }}</div>
<div class="gallery_btn" @click="setStyle">{{ $t('Habit.Select') }}</div>
</div>
<div class="style marginBottom brand">
<div class="style brand marginBottom">
<div class="text">{{$t('Habit.Brand')}}:</div>
<div class="text"><img v-show="selectObject.userBrandDna" :src="selectObject.userBrandDnaImg"></div>
<!-- <div class="text"><img v-show="selectObject.userBrandDna" :src="selectObject.userBrandDnaImg">{{ selectObject.userBrandDnaName }}</div> -->
<div class="gallery_btn" style="line-height: 5rem;" @click="setBrandDNA">{{ $t('Habit.Select') }}</div>
<div class="gallery_btn" @click="setBrandDNA">{{ $t('Habit.Select') }}</div>
</div>
<div class="brandImg" v-if="selectObject.userBrandDna"><img :src="selectObject.userBrandDnaImg"></div>
<div class="brandDNAStrenght marginBottom" v-if="selectObject.userBrandDna">
<div class="text">
{{$t('Habit.BrandStrength')}}:
<div class="text" style="font-size: 1.6rem;">
{{$t('Habit.BrandStrength')}}: ({{ `${selectObject.brandPercentage || 0}%` }})
</div>
<a-slider class="system_silder"
v-model:value="selectObject.brandPercentage"
@@ -54,14 +58,23 @@
>
</a-slider>
</div>
<div class="position marginBottom" v-show="show.position" v-if="httpWorkflowType == 'SINGLE_DESIGN'">
<div class="text">
{{$t('Habit.Category')}}:
</div>
<generalMenu style="width:100%;" :ulStyle="{background: '#fff'}" :selectWidth="'100%'" :dataList="selectObject.positionList" @setprintModel="setprintModel" :item="selectObject.position"></generalMenu>
</div>
<div class="systemDesigner marginBottom" v-if="show.systemDesigner">
<div class="text" style="margin-bottom: 1rem;">
{{$t('Habit.GenerationParameters')}}:
</div>
<a-slider class="system_silder"
v-model:value="selectObject.systemDesignerPercentage"
:tip-formatter="formatter"
:tooltipVisible="false"
>
</a-slider>
<div class="text">
<div class="text" style="margin-top: 1rem; font-size: 1.6rem;">
<div class="left">
{{ $t('Habit.System') }}<span>({{systemDesigner.designer}}%)</span>
</div>
@@ -71,14 +84,8 @@
</div>
</div>
</div>
<div class="position marginBottom" style="display: flex; align-items: center;justify-content: space-between;" v-show="show.position" v-if="httpWorkflowType == 'SINGLE_DESIGN'">
<div class="text">
{{$t('Habit.Category')}}:
</div>
<generalMenu style="width:80%" :ulStyle="{background: '#fff'}" :selectWidth="'100%'" :dataList="selectObject.positionList" @setprintModel="setprintModel" :item="selectObject.position"></generalMenu>
</div>
<div class="complete">
<div class="gallery_btn" @click="complete">{{$t('HomeView.Start')}}</div>
<div class="gallery_btn" style="padding: 0rem 2.2rem; line-height: 4.5rem;font-weight: 500;" @click="complete">{{$t('HomeView.Start')}}</div>
</div>
</div>
<habitSetStyle ref="habitSetStyle" @setWorkspaceStyle="setWorkspaceStyle" :mannequinStyle="mannequinStyle"></habitSetStyle>
@@ -263,7 +270,9 @@ export default defineComponent({
}
onMounted(()=>{
store.commit('createProbject')
if(props.status != 'edit'){
store.commit('createProbject')
}
data.selectObject = JSON.parse(JSON.stringify(data.selectObject_))
data.selectObject.style = store.state.UserHabit?.mannequinStyle?.[0]?.value
data.selectObject.styleName = store.state.UserHabit?.mannequinStyle?.[0]?.name
@@ -315,17 +324,37 @@ export default defineComponent({
font-size: 1.8rem;
padding: 1.2rem;
> .workspaceBox{
width: 55rem;
width: 52rem;
height: 100%;
padding: 0 5rem;
width: 100%;
// width: 100%;
padding: 0;
overflow-y: auto;
display: flex;
flex-direction: column;
// display: flex;
// flex-wrap: wrap;
// justify-content: space-between;
// align-content: flex-start;
> div{
// padding: 0 5rem;
}
> .title{
display: flex;
font-weight: 500;
align-items: flex-end;
// height: 2.4rem;
> div{
font-size: 2.4rem;
margin-right: 1.2rem;
}
> span{
font-size: 1.4rem;
color: #999999;
}
}
> .marginBottom{
margin-bottom: 3rem;
margin-bottom: 2rem;
// width: 44%;
}
> .brand{
@@ -337,6 +366,16 @@ export default defineComponent({
}
}
}
> .brandImg{
width: 10rem;
height: 10rem;
margin: 1rem 0;
> img{
width: 100%;
height: 100%;
object-fit: contain;
}
}
> .title{
font-size: 2.7rem;
> span{
@@ -346,17 +385,17 @@ export default defineComponent({
}
> .projectName{
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: column;
> .text{
margin-right: 1rem;
margin-bottom: 1rem;
}
> .input{
// flex: 1;
width: 80%;
padding: 1rem 2rem;
width: 100%;
padding: calc(1.7rem - 2px * 2) 2.7rem;
// padding: 2rem 2.7rem;
font-size: 1.6rem;
font-size: 1.8rem;
border-radius: 1.6rem;
border: 2px solid #D0D0D0;
display: flex;
@@ -372,20 +411,29 @@ export default defineComponent({
}
}
}
.text{
font-size: 1.8rem;
font-weight: 500;
}
> .gender{
display: flex;
align-items: center;
> .text{
width: 8rem;
// width: 8rem;
}
> .radio{
display: flex;
margin-left: 4.5rem;
margin-left: 4.2rem;
> label{
display: flex;
margin-right: 4rem;
>input{
margin-right: 1.5rem;
transform: scale(1.2);
}
> span{
font-weight: 500;
font-size: 1.6rem;
}
}
}
@@ -395,6 +443,22 @@ export default defineComponent({
display: flex;
align-items: center;
justify-content: space-between;
.gallery_btn{
line-height: 3.6rem;
font-size: 1.4rem;
font-weight: 500;
border-radius: .8rem;
}
> .center{
margin-right: auto;
margin-left: 3rem;
min-width: 10rem;
font-size: 1.4rem;
border-radius: .8rem;
line-height: 3.6rem;
background-color: #ebebeb;
text-align: center;
}
}
> .systemDesigner{
> .text{
@@ -416,12 +480,16 @@ export default defineComponent({
}
}
> .position{
display: flex;
flex-direction: column;
> .text{
margin-right: 1rem;
margin-bottom: 1rem;
}
:deep(.generalMenu_printModel){
position: relative;
margin: 0;
height: 6rem;
font-weight: 500;
> div,> ul{
width: 100%;
border-radius: 1.6rem;
@@ -431,6 +499,7 @@ export default defineComponent({
}
> .complete{
width: 100%;
margin-top: auto;
text-align: right;
> div{
}

View File

@@ -63,7 +63,7 @@ import { Https } from "@/tool/https";
import { useStore } from "vuex";
import { downloadIamge,getMinioUrl } from "@/tool/util";
import { useI18n } from 'vue-i18n'
import selectList from '@/component/DetailCopy/detailLeft/module/selectList.vue'
import selectList from '@/component/Detail/detailLeft/module/selectList.vue'
import sketchCategory from "@/component/HomePage/sketchCategory.vue";
import canvasBox from "./canvas/index.vue";
import canvasUpload from "@/component/Canvas/CanvasEditor/index.vue";
@@ -204,6 +204,7 @@ export default defineComponent({
}
const setCanvasJSON = (canvasJSON)=>{
if(!canvasJSON)return
if(!store.state.Workspace.probjects?.id)return
let canvasData = JSON.parse(canvasJSON)
console.log(canvasData)
canvasData.canvas.objects.forEach((objectsItem:any) => {

View File

@@ -16,7 +16,7 @@
>
<div class="generalModel_btn">
<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">
<svg width="100%" height="100%" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<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="black"/>
<rect x="34.6274" y="32.5059" width="3" height="29" rx="1.5" transform="rotate(135 34.6274 32.5059)" fill="black"/>

View File

@@ -131,7 +131,6 @@ import { getUploadUrl,isMoible,getMinioUrl } from "@/tool/util";
import { getCookie,setCookie } from "@/tool/cookie";
import showViewVideo from "@/tool/mount";
// import selectList from '@/component/DetailCopy/module/selectList.vue';
export default defineComponent({
components:{
generalDrag,
@@ -178,18 +177,18 @@ export default defineComponent({
speedList:[
{
title:'',
label:t('speedList.High'),
label:t('speedList.toproductBasic'),
value:'',
},{
title:'',
label:t('speedList.wx'),
label:t('speedList.toproductFlus'),
value:'wx',
},
],
speedState:false,
speedData:{
title:'Generate high-quality content',
label:'High',
label:t('speedList.toproductBasic'),
value:'',
},
})
@@ -295,8 +294,7 @@ export default defineComponent({
Https.axiosPost(Https.httpUrls.poseTransform,value).then((rv)=>{
data.remGenerate = true
data.noLikeList.unshift({taskId:rv.taskId,parentId:data.selectImg.parentId})
console.log(data.noLikeList)
setGenerate([rv.taskId])
setGenerate(rv.taskId)
}).catch((res:any)=>{
data.isGenerate = false
clearInterval(data.remGenerateTime)
@@ -313,7 +311,6 @@ export default defineComponent({
state = false
Https.axiosPost(Https.httpUrls.poseTransformResult,list).then(
(rv) => {
rv=[rv]
state = true
if(data.isGenerate){//防止取消后有正在执行的获取状态
// data.waitList = rv.filter((item:any)=>item.status != 'Success' && item.status != 'Fail' && item.status != 'Invalid')
@@ -323,6 +320,8 @@ export default defineComponent({
let index = data.noLikeList.findIndex((obj:any) => obj.taskId === element.taskId);
data.noLikeList[index] = element
list = ''
clearInterval(data.generateTime)
clearInterval(data.remGenerateTime)
// if(list?.filter)list = list?.filter((item:any) => item !== element.taskId);
store.dispatch('getCredits')
}else if(element.status == 'Fail'){
@@ -346,7 +345,7 @@ export default defineComponent({
data.isGenerate = false
data.remGenerate = false
});
},20000)
},10000)
}
const removeGenerate = ()=>{
//取消操作
@@ -481,6 +480,7 @@ export default defineComponent({
Https.axiosPost(Https.httpUrls.poselikeOrDisike, {},{params:value}).then(
(rv) => {
if(str == 'like'){
item.newLike = true
let value = {
likedList:[item],
str:'add',
@@ -536,10 +536,11 @@ export default defineComponent({
if(props.isDesignPage)return
data.fileList = store.state.HomeStoreModule.uploadElement
})
watch(()=>store.state.Workspace.probjects.id,(newVal,oldVal)=>{
watch(()=>data.noLikeList.length,(newVal,oldVal)=>{
nextTick(()=>{
let list = store.state.HomeStoreModule.poseTransfer.list
let taskIdList = list.filter((item:any)=>!item.videoUrl)
console.log(taskIdList)
if(taskIdList.length > 0){
data.isGenerate = true
data.remGenerate = true
@@ -643,6 +644,7 @@ export default defineComponent({
overflow: hidden;
z-index: 3;
margin-top: .2rem;
>div{
background: #cccccc;
line-height: 2;
@@ -841,6 +843,7 @@ export default defineComponent({
}
> .content{
flex: 1;
overflow: hidden;
padding: 1.7rem 2rem;
border-radius: 3rem;
background: #f7f8fa;

View File

@@ -496,6 +496,7 @@ export default defineComponent({
if(str == 'like'){
if(rv?.sort)item.oldSort = rv.sort
if(rv?.id)item.userLikeSortId = rv.id
item.newLike = true
let value = {
likedList:[item],
str:'add',
@@ -686,14 +687,21 @@ export default defineComponent({
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
type:props.productimgMenu.value,
}
console.log(productImgData.generateList[props.productimgMenu.value].value,)
Https.axiosGet(Https.httpUrls.generateStopWaiting, {params:data}).then(
(rv) => {
generateProceedList = []
productImgData.generateList[props.productimgMenu.value] = productImgData.generateList[props.productimgMenu.value].filter((item:any)=>item.status == 'Success')
let aa = productImgData.generateList[props.productimgMenu.value].filter((item:any)=>item.status == 'Success')
}
).catch(res=>{
productImgData.generateList[props.productimgMenu.value] = productImgData.generateList[props.productimgMenu.value].filter((item:any)=>item.status == 'Success')
});
generateProceedList.forEach((item:any)=>{
const index = productImgData.generateList[props.productimgMenu.value].findIndex(item => (item.status != 'Success'));
if(props.productimgMenu == 'ToProductImage'){
}
})
}
}
let scaleImage = ref()
@@ -855,6 +863,9 @@ export default defineComponent({
setPrductimg(arr)
}
},{immediate: true })
onMounted(()=>{
ifMaximumLength()
})
return {
upload,
driver__,
@@ -1273,6 +1284,7 @@ export default defineComponent({
border-radius: 2rem;
position: relative;
flex: 1;
overflow: hidden;
}
> .btnLeft,> .btnRight{
position: absolute;