调整generate-library-upload位置、生成后需要like才能保存的提示、detail的删除逻辑

This commit is contained in:
X1627315083
2025-10-20 15:45:13 +08:00
parent 550af61181
commit e1700cf85a
10 changed files with 50 additions and 36 deletions

View File

@@ -5,7 +5,7 @@
<div class="content_img_item" v-for="(file) in currentList[type]" :key="file.id">
<div class="content_img_item_block" :class="{active:file?.checked}">
<img :src="file.imgUrl?file.imgUrl:file.url" :key="file.imgUrl || file.url" :alt="file.name" @click.stop="selectImgItem(file)"/>
<sketchCategory v-if="type != 'models'" v-model:disignTypeList="catecoryList" :generateList="allBoardData.sketchboardFiles" :item="file" :isSpread="true"></sketchCategory>
<sketchCategory v-if="type != 'models'" v-model:disignTypeList="catecoryList" :generateList="allBoardData.sketchboardFiles" :allCategory="sketchCatecoryAllList" :item="file" :isSpread="true"></sketchCategory>
</div>
</div>
</div>
@@ -48,6 +48,9 @@ export default defineComponent({
color:computed(()=>store.state.UploadFilesModule.allBoardData.colorBoards),
models:computed(()=>store.state.Workspace.probjects.model),
},
sketchCatecoryAllList:computed(()=>{
return store.state.Workspace.workspaceAllPosition
}),
currentDetailType:computed(()=>store.state.DesignDetail.currentDetailType),
})

View File

@@ -7,7 +7,7 @@
@mousedown.stop="designMousedown(getMousePosition($event,false),item.uniqueId,'disLike')"
@touchstart.passive="designMousedown(getMousePosition($event,true),item.uniqueId,'disLike')"
@click="selectDetailItem(item,index)">
<i v-if="item?.id != selectDetail?.id" class="fi fi-rr-trash" @click.stop="deleteDetailItem(item?.id)"></i>
<i class="fi fi-rr-trash" @click.stop="deleteDetailItem(item?.id)"></i>
<img :src="item.path" alt="">
</div>
</div>
@@ -104,6 +104,17 @@ export default defineComponent({
detailData.designDetail.clothes = detailData.designDetail.clothes.filter((item:any)=>item.id != id)
detailData.frontBack_.back = detailData.frontBack_.back.filter((item:any)=>item.id != id)
detailData.frontBack_.front = detailData.frontBack_.front.filter((item:any)=>item.id != id)
console.log(detailData.designDetail.clothes)
//判断删除后是否还有服装
if(detailData.designDetail.clothes.length == 0){
addSketch()
}else{
//获取当前最大的priority值
const maxValue = Math.max(...detailData.designDetail.clothes.map(item => item.priority));
const maxObj = detailData.designDetail.clothes.find(item => item.priority === maxValue);
store.commit('DesignDetail/setDesignColthes',maxObj.id)
}
emit('deleteItem')
}
const addSketch = ()=>{

View File

@@ -67,6 +67,10 @@ export default defineComponent({
},
generateList:{
type:Array
},
allCategory:{
type:Array,
default:[]
},
isSetSketchCategory:{
type:Boolean,
@@ -117,10 +121,6 @@ export default defineComponent({
file.category = cate.name;
if(props.isSetSketchCategory){
setSketchLibrary(props.item)
}
if(props.driver__){
driverObj__.moveNext()
}
// this.store.commit("sketchGenerateFiles", this.fileList);
@@ -150,10 +150,14 @@ export default defineComponent({
).catch((res)=>{
});
}
}
const getCategory = (item)=>{
}
onMounted(()=>{
if(!props.item.category){
props.disignTypeList.forEach((item:any) => {
if(!props.item.category || !props.item.categoryValue){
let arr = props.allCategory || props.catecoryList
arr.forEach((item:any) => {
if(item.value == props.item.level2Type){
props.item.category = item.name
props.item.categoryValue = item.value

View File

@@ -2,12 +2,12 @@
<div class="collection_modal_item">
<div class="modal_left" >
<div class="switch_type_list" >
<div
<div
@click.stop="open(1)"
class="switch_type_item"
:class="[openClick == 1 ? 'select_swtich' : '']"
>
<span>{{ $t('MoodboardUpload.Upload') }}</span>
<span>{{ $t('MoodboardUpload.Generate') }}</span>
</div>
<div
@click.stop="open(2)"
@@ -21,10 +21,10 @@
class="switch_type_item"
:class="[openClick == 3 ? 'select_swtich' : '']"
>
<span>{{ $t('MoodboardUpload.Generate') }}</span>
<span>{{ $t('MoodboardUpload.Upload') }}</span>
</div>
</div>
<div v-show="openClick == 1" class="moodboard_body">
<div v-show="openClick == 3" class="moodboard_body">
<div class="upload_img_body scroll_style">
<div class="upload_item">
<div
@@ -103,7 +103,7 @@
msg="Moodboard"
></Material>
<Generate
v-show="openClick == 3"
v-show="openClick == 1"
ref="Generate"
msg="Moodboard"
></Generate>
@@ -274,7 +274,6 @@ export default defineComponent({
if(num ==2 ){
let material:any = this.$refs.Material
material.init('Moodboard')
}else if (num == 3){
}
},
fileUploadChange(data: any) {

View File

@@ -10,7 +10,7 @@
class="switch_type_item"
:class="[openClick == 1 ? 'select_swtich' : '']"
>
<span @click.stop="open(1)">{{ $t('PrintboardUpload.Upload') }}</span>
<span @click.stop="open(3)">{{ $t('PrintboardUpload.Generate') }}</span>
</div>
<div
@@ -24,13 +24,12 @@
class="switch_type_item Guide_1_2_1"
:class="[openClick == 3 ? 'select_swtich' : '',driver__.driver?'showEvents':'']"
>
<span @click.stop="open(3)">{{ $t('PrintboardUpload.Generate') }}</span>
<span @click.stop="open(1)">{{ $t('PrintboardUpload.Upload') }}</span>
</div>
</div>
</div>
</div>
<div v-show="openClick == 1" class="printboard_body">
<div v-show="openClick == 3" class="printboard_body">
<div class="upload_img_body">
<div class="upload_item">
<div :class="['upload_file_item']" v-for="(file, index) in fileList" :key="file">
@@ -94,7 +93,7 @@
@confirmSelect="confirmSelect"
:disignTypeList="printCatecoryList"
></Material>
<Generate v-show="openClick == 3" ref="Generate" :sketchCatecoryList="printCatecoryList" msg="Printboard"></Generate>
<Generate v-show="openClick == 1" ref="Generate" :sketchCatecoryList="printCatecoryList" msg="Printboard"></Generate>
</div>
<div class="modal_right">
<div class="modal_layout">
@@ -299,11 +298,6 @@ export default defineComponent({
}
if(num == 3){
this.scene = this.printCatecoryList[0]
nextTick().then(()=>{
if(this.driver__.driver){
driverObj__.moveNext()
}
})
}
},
fileUploadChange(data:any){

View File

@@ -7,7 +7,7 @@
class="switch_type_item"
:class="[openClick == 1 ? 'select_swtich' : '']"
>
<span>{{ $t('SketchboardUpload.Upload') }}</span>
<span>{{ $t('SketchboardUpload.Generate') }}</span>
</div>
<div
@click.stop="open(2)"
@@ -21,10 +21,10 @@
class="switch_type_item Guide_1_9"
:class="[openClick == 3 ? 'select_swtich' : '', driver__.driver?'showEvents':'']"
>
<span>{{ $t('SketchboardUpload.Generate') }}</span>
<span>{{ $t('SketchboardUpload.Upload') }}</span>
</div>
</div>
<div v-show="openClick == 1" class="sketchboard_body">
<div v-show="openClick == 3" class="sketchboard_body">
<div class="upload_img_body scroll_style">
<div class="upload_item">
<div
@@ -112,7 +112,7 @@
@setLibrary = setSetchboardGenerate
></Material>
<Generate
v-show="openClick == 3"
v-show="openClick == 1"
ref="Generate"
msg="Sketchboard"
:gender="workspace.sex"
@@ -352,14 +352,6 @@ export default defineComponent({
if (num == 2) {
let material: any = this.$refs.Material;
material.init("Sketchboard");
} else if (num == 3) {
// let Generate:any = this.$refs.Generate
// Generate.init('generate')
nextTick().then(()=>{
if(this.driver__.driver){
driverObj__.moveNext()
}
})
}
},
scaleImage(index:any){

View File

@@ -1610,6 +1610,12 @@ export default defineComponent({
this.startDesignType = "design";
// this.posiitonData.likeSelectIndex = 0
// this.posiitonData.likeElList = []
const firstDesign = sessionStorage.getItem('firstDesign');
if(!firstDesign && this.likeDesignCollectionList?.length == 0){
message.info(this.t('HomeView.jsContent13'))
}
sessionStorage.setItem('firstDesign','true');
}
this.isShowMark = false;
})

View File

@@ -89,6 +89,9 @@ export default defineComponent({
}
nextTick(()=>{
if(query.history || query.id){
//切换新项目需要清除首次design提示
sessionStorage.removeItem('firstDesign');
if(data.openType == 'tools')data.isShowMark = true
data.dataLoad = true
if(query?.source != 'batch'){

View File

@@ -240,6 +240,7 @@ export default {
jsContent10: "二次创作的作品不允许使用'设计',但是您可以使用'重新设计'",
jsContent11: "取消喜欢后相关联的元素会被删除,确认要删除吗",
jsContent12: "你确定要删除选中元素和相关元素吗?",
jsContent13: "生成的内容需要点击爱心才会储存到自己的库中",
},
ProductImg: {
productInput: "请输入关键词(例如款式、材质)",

View File

@@ -240,6 +240,7 @@ export default {
jsContent10: "Re-created works are not allowed to use 'design', but you can use 'redesign'",
jsContent11: "By unliking this, all connected posts will be deleted. Are you sure you want to continue?",
jsContent12: "Are you sure about deleting the current brand DNA?",
jsContent13: "The generated content can only be stored in your library by clicking on the heart icon.",
},
ProductImg: {
productInput: "Enter keyword(style,texture)",