detail 可以把系统sketch添加到个人libarry

This commit is contained in:
X1627315083
2025-11-14 10:07:21 +08:00
parent 3fab7b04dc
commit 79f0ecb2b4
7 changed files with 66 additions and 22 deletions

View File

@@ -7,7 +7,10 @@
@mousedown.stop="designMousedown(getMousePosition($event,false),item.uniqueId,'disLike')"
@touchstart.passive="designMousedown(getMousePosition($event,true),item.uniqueId,'disLike')"
@click="selectDetailItem(item,index)">
<i class="fi fi-rr-trash" @click.stop="deleteDetailItem(item?.id)"></i>
<div class="iconList">
<i class="fi fi-rr-add" :class="{ active:item.scope == 'sys'}" @click.stop="sketchSystemToLibrary(item)"></i>
<i class="fi fi-rr-trash" @click.stop="deleteDetailItem(item?.id)"></i>
</div>
<img :src="item.path" alt="">
</div>
</div>
@@ -30,7 +33,7 @@ export default defineComponent({
components:{
position,
},
emits:['canvasReload','addSketch','deleteItem'],
emits:['canvasReload','addSketch','deleteItem','sketchSysToLibrary'],
props:{
},
setup(props,{emit}) {
@@ -249,6 +252,17 @@ export default defineComponent({
collItemSize.prentHeight = (collItemSize.padding + remValue) * elArr.length + 'px'
moveItem()
}
const sketchSystemToLibrary = (item)=>{
let value = {
clothId:item.id,
path:item.minIOPath
}
Https.axiosGet(Https.httpUrls.addSysSketchToLibrary,{params:value})
.then((rv:any)=>{
item.scope = 'user'
emit('sketchSysToLibrary')
})
}
let observers = null as any
onMounted(()=>{
observers = new ResizeObserver(entries => {
@@ -269,6 +283,7 @@ export default defineComponent({
designMousedown,
addSketch,
getMousePosition,
sketchSystemToLibrary,
}
},
@@ -295,17 +310,35 @@ export default defineComponent({
position: absolute;
background: #fff;
transition: top .3s;
> i:not(.fi-bs-plus){
display: none;
> .iconList{
position: absolute;
right: 1rem;
top: 1rem;
cursor: pointer;
font-size: 2rem;
}
&:hover{
right: 1rem;
display: none;
flex-direction: column;
align-items: center;
> i{
display: block;
margin-bottom: .2rem;
font-size: 1.8rem;
}
> .fi-rr-add{
pointer-events: none;
color: #acacac;
&.active{
pointer-events: auto;
color: #000;
}
}
>i:not(.fi-rr-add){
font-size: 2rem;
}
}
i:not(.fi-bs-plus){
}
&:hover{
> .iconList{
display: flex;
}
}
&:last-child{