2025-01-23 09:36:21 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="modelindex">
|
2025-02-17 09:34:28 +08:00
|
|
|
<div class="modelindex_left">
|
2025-08-26 10:14:34 +08:00
|
|
|
<div class="back" v-show="isEditPattern.value">
|
|
|
|
|
<i class="fi fi-br-angle-left" @click="setBack"></i>
|
|
|
|
|
</div>
|
2026-01-15 17:14:11 +08:00
|
|
|
<modelNav ref="modelNav" @addSketch="()=>$emit('addSketch')" @sketchSysToLibrary="()=>$emit('sketchSysToLibrary')" @deleteItem="deleteItem"></modelNav>
|
2025-01-24 13:41:13 +08:00
|
|
|
</div>
|
2026-01-13 14:07:51 +08:00
|
|
|
<div class="modelindex_right" ref="modelindexRight">
|
2025-02-17 09:34:28 +08:00
|
|
|
<div class="detail_btn">
|
|
|
|
|
<!-- 全屏 -->
|
2025-02-25 15:32:55 +08:00
|
|
|
<!-- <i class="fi fi-bs-expand-arrows-alt" @click="showDesignImgDetail('2')"></i> -->
|
|
|
|
|
|
2025-10-08 10:29:12 +08:00
|
|
|
<i class="icon iconfont icon-chehui" @click="revocation"></i>
|
|
|
|
|
<i class="icon iconfont icon-fanchehui" @click="oppositeRevocation"></i>
|
2025-02-17 09:34:28 +08:00
|
|
|
<!-- 编辑 -->
|
2026-01-13 14:07:51 +08:00
|
|
|
<i class="fi fi-rs-pencil-paintbrush" :title="$t('DesignDetail.editSketchTitle')" :class="{'pointerEventsNone':!selectDetail?.id,active:isEditPattern.value == 'editSketch'}" @click="showDesignImgDetail('editSketch')"></i>
|
2025-12-19 09:51:17 +08:00
|
|
|
<i class="fi fi-rr-edit" :title="$t('DesignDetail.editTitle')" :class="{active:isEditPattern.value == 'canvasEditor','pointerEventsNone':!selectDetail?.id}" @click="showDesignImgDetail('canvasEditor')"></i>
|
2025-09-15 13:33:42 +08:00
|
|
|
|
2025-10-08 10:47:17 +08:00
|
|
|
<i class="icon iconfont icon-clothes" :title="$t('Canvas.editFrontBack')" style="font-size: 3.2rem;" @click="showDesignImgDetail('redGreenExample')" :class="{active:isEditPattern.value == 'redGreenExample','pointerEventsNone':!selectDetail?.id}"></i>
|
2025-10-08 10:31:04 +08:00
|
|
|
<!-- <i @click="showDesignImgDetail('redGreenExample')" :class="{active:isEditPattern.value == 'redGreenExample','pointerEventsNone':!selectDetail?.id}">
|
2025-10-08 09:52:00 +08:00
|
|
|
<SvgIcon name="CClothes" size="30" />
|
2025-10-08 10:29:12 +08:00
|
|
|
</i> -->
|
2025-09-15 13:33:42 +08:00
|
|
|
|
2025-04-09 14:09:19 +08:00
|
|
|
<!-- <i class="fi fi-rr-copy" :title="$t('DesignDetail.compareTitle')" :class="{active:imgDesignImg}" @click="mousedownDesignImg"></i> -->
|
2025-02-17 09:34:28 +08:00
|
|
|
<!-- <i v-show="!body && !deleteShow" :title="$t('DesignDetail.DetailTitle')" class="fi fi-rr-trash" @click="deleteNav(0)"></i>
|
|
|
|
|
<i v-show="!body && deleteShow" class="fi fi-br-check" @click="deleteNav(1)"></i> -->
|
|
|
|
|
|
|
|
|
|
<!-- 层 -->
|
2025-11-14 10:07:21 +08:00
|
|
|
<i :title="$t('DesignDetail.compareTitle')" @mousedown="mousedownDesignImg" @mouseup="mousedownDesignImg" @touchstart.passive="mousedownDesignImg" @touchend.passive="mousedownDesignImg">
|
2025-10-09 10:15:40 +08:00
|
|
|
<SvgIcon name="DetailCompare" size="30" />
|
|
|
|
|
</i>
|
2025-03-03 14:52:05 +08:00
|
|
|
|
2025-02-17 09:34:28 +08:00
|
|
|
</div>
|
2026-01-15 17:14:11 +08:00
|
|
|
<position ref="position" @addSketch="()=>$emit('addSketch')" :imgDesignImg=imgDesignImg></position>
|
2025-01-23 09:36:21 +08:00
|
|
|
</div>
|
2025-02-17 09:34:28 +08:00
|
|
|
|
2025-01-23 09:36:21 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts">
|
2025-04-30 14:01:52 +08:00
|
|
|
import { defineComponent,computed,ref,inject,onBeforeUnmount,createVNode,toRefs, reactive, onMounted} from 'vue'
|
2025-01-23 09:36:21 +08:00
|
|
|
// import setDesignItem from '@/component/Detail/setDesignItem2.vue'
|
|
|
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
|
|
|
|
import { Https } from "@/tool/https";
|
|
|
|
|
import { useStore } from "vuex";
|
2025-04-09 14:09:19 +08:00
|
|
|
import { Modal,message } from 'ant-design-vue';
|
2025-01-23 09:36:21 +08:00
|
|
|
import { useI18n } from 'vue-i18n'
|
2025-01-24 13:41:13 +08:00
|
|
|
import position from './modelPosition.vue';
|
2025-02-17 09:34:28 +08:00
|
|
|
import modelNav from './modelNav.vue';
|
2025-01-23 09:36:21 +08:00
|
|
|
export default defineComponent({
|
|
|
|
|
components:{
|
2025-02-17 09:34:28 +08:00
|
|
|
position,modelNav
|
2025-01-23 09:36:21 +08:00
|
|
|
},
|
2026-01-15 17:14:11 +08:00
|
|
|
emits:['detailEdit','addSketch','revocation','oppositeRevocation','sketchSysToLibrary'],
|
2025-01-23 09:36:21 +08:00
|
|
|
setup(props,{emit}) {
|
2025-04-09 14:09:19 +08:00
|
|
|
const {t} = useI18n()
|
2025-01-23 09:36:21 +08:00
|
|
|
const store = useStore();
|
|
|
|
|
const detailData = reactive({
|
2025-04-09 14:09:19 +08:00
|
|
|
getCanvasIfEdit:inject('getCanvasIfEdit')as any,
|
2025-09-10 16:33:40 +08:00
|
|
|
selectDetail:computed(()=>store.state.DesignDetail.selectDetail),
|
2025-01-23 09:36:21 +08:00
|
|
|
})
|
2025-03-03 14:52:05 +08:00
|
|
|
const setRevocation:any = inject('setRevocation')
|
2025-01-23 09:36:21 +08:00
|
|
|
const getDetailListData = reactive({
|
2025-08-22 10:27:48 +08:00
|
|
|
designDetail:computed(()=>store.state.DesignDetail.designDetail),
|
2025-02-25 15:32:55 +08:00
|
|
|
isEditPattern:inject('isEditPattern') as any,
|
|
|
|
|
imgDesignImg:false,
|
2025-01-23 09:36:21 +08:00
|
|
|
})
|
|
|
|
|
const getDetailListDom = reactive({
|
|
|
|
|
libraryList:null as any,
|
2025-02-17 09:34:28 +08:00
|
|
|
position:null as any,
|
2026-01-13 14:07:51 +08:00
|
|
|
modelindexRight:null as any,
|
|
|
|
|
modelNav:null as any,
|
2025-01-23 09:36:21 +08:00
|
|
|
})
|
2026-01-15 17:14:11 +08:00
|
|
|
const getSubmitData = (value:any)=>{
|
|
|
|
|
return getDetailListDom.position.getSubmitData(value,)
|
2025-02-17 09:34:28 +08:00
|
|
|
}
|
2025-02-17 15:24:01 +08:00
|
|
|
const showDesignImgDetail = (str:any)=>{
|
2026-01-13 14:07:51 +08:00
|
|
|
emit('detailEdit',str)
|
|
|
|
|
|
|
|
|
|
// new Promise((resolve, reject) => {
|
|
|
|
|
// if(
|
|
|
|
|
// getDetailListData.isEditPattern.value&&
|
|
|
|
|
// detailData?.getCanvasIfEdit?.fun&&detailData?.getCanvasIfEdit?.fun() > 0
|
|
|
|
|
// ){
|
|
|
|
|
// Modal.confirm({
|
|
|
|
|
// title: t('collectionModal.jsContent2'),
|
|
|
|
|
// icon: createVNode(ExclamationCircleOutlined),
|
|
|
|
|
// okText: 'Yes',
|
|
|
|
|
// cancelText: 'No',
|
|
|
|
|
// mask:false,
|
|
|
|
|
// centered:true,
|
|
|
|
|
// onOk() {
|
|
|
|
|
// resolve(true)
|
|
|
|
|
// emit('detailEdit',str)
|
|
|
|
|
// },
|
|
|
|
|
// onCancel(){
|
|
|
|
|
// resolve(false)
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }else{
|
|
|
|
|
// resolve(true)
|
|
|
|
|
// emit('detailEdit',str)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
2025-01-23 09:36:21 +08:00
|
|
|
}
|
2025-03-03 14:52:05 +08:00
|
|
|
const deleteItem = ()=>{
|
|
|
|
|
setRevocation()
|
|
|
|
|
}
|
|
|
|
|
const revocation = ()=>{//撤回
|
|
|
|
|
emit('revocation')
|
2025-09-10 10:50:14 +08:00
|
|
|
// getDetailListDom.position.updataPosition()
|
2025-03-03 14:52:05 +08:00
|
|
|
}
|
|
|
|
|
const oppositeRevocation = ()=>{//反撤回
|
|
|
|
|
emit('oppositeRevocation')
|
2025-09-10 10:50:14 +08:00
|
|
|
// getDetailListDom.position.updataPosition()
|
2025-03-03 14:52:05 +08:00
|
|
|
}
|
2025-02-25 15:32:55 +08:00
|
|
|
|
|
|
|
|
//图片按下样子
|
|
|
|
|
const mousedownDesignImg = ()=>{
|
|
|
|
|
getDetailListData.imgDesignImg = !getDetailListData.imgDesignImg
|
2025-01-23 09:36:21 +08:00
|
|
|
}
|
2025-04-30 14:01:52 +08:00
|
|
|
let time = null as any
|
|
|
|
|
|
2026-01-13 14:07:51 +08:00
|
|
|
const handleResize = ()=>{
|
2025-04-30 14:01:52 +08:00
|
|
|
clearTimeout(time)
|
|
|
|
|
time = setTimeout(()=>{
|
2026-05-14 18:06:01 +08:00
|
|
|
let data = {
|
|
|
|
|
...getDetailListData.designDetail,
|
|
|
|
|
fromType:'resize',
|
|
|
|
|
}
|
|
|
|
|
store.commit('DesignDetail/setDesignDetail',data)
|
2026-01-13 14:07:51 +08:00
|
|
|
getDetailListDom.position?.updataPosition?.()
|
|
|
|
|
getDetailListDom.modelNav?.setItemPosition?.()
|
|
|
|
|
getDetailListDom.position?.updateRect?.()
|
2026-01-20 13:49:34 +08:00
|
|
|
},200)
|
|
|
|
|
}
|
|
|
|
|
const updateRect = ()=>{
|
|
|
|
|
getDetailListDom.position?.updateRect?.()
|
2025-04-30 14:01:52 +08:00
|
|
|
}
|
2025-08-26 10:14:34 +08:00
|
|
|
const setBack = ()=>{
|
2026-01-13 14:07:51 +08:00
|
|
|
showDesignImgDetail(getDetailListData.isEditPattern.value)
|
2025-08-26 10:14:34 +08:00
|
|
|
}
|
2026-01-13 14:07:51 +08:00
|
|
|
let observers = null as any
|
2025-04-30 14:01:52 +08:00
|
|
|
onMounted(()=>{
|
2026-01-13 14:07:51 +08:00
|
|
|
observers = new ResizeObserver(entries => {
|
|
|
|
|
for (let entry of entries) {
|
|
|
|
|
handleResize()
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
observers.observe(getDetailListDom.modelindexRight);
|
2025-04-30 14:01:52 +08:00
|
|
|
})
|
|
|
|
|
onBeforeUnmount(()=>{
|
2026-01-13 14:07:51 +08:00
|
|
|
observers.disconnect();
|
2025-04-30 14:01:52 +08:00
|
|
|
})
|
2025-01-23 09:36:21 +08:00
|
|
|
return{
|
|
|
|
|
...toRefs(detailData),
|
|
|
|
|
...toRefs(getDetailListData),
|
|
|
|
|
...toRefs(getDetailListDom),
|
2025-02-17 09:34:28 +08:00
|
|
|
getSubmitData,
|
2025-01-23 09:36:21 +08:00
|
|
|
showDesignImgDetail,
|
2025-03-03 14:52:05 +08:00
|
|
|
revocation,
|
|
|
|
|
deleteItem,
|
|
|
|
|
oppositeRevocation,
|
2025-02-25 15:32:55 +08:00
|
|
|
mousedownDesignImg,
|
2025-08-26 10:14:34 +08:00
|
|
|
setBack,
|
2026-01-20 13:49:34 +08:00
|
|
|
updateRect,
|
2025-01-23 09:36:21 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
provide() {
|
|
|
|
|
return {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.modelindex{
|
2025-02-17 09:34:28 +08:00
|
|
|
width: 100%;
|
2025-01-23 09:36:21 +08:00
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
2025-03-03 14:52:05 +08:00
|
|
|
// padding-top: 3rem;
|
2025-02-17 09:34:28 +08:00
|
|
|
flex: 1;
|
2025-02-03 13:22:34 +08:00
|
|
|
overflow: hidden;
|
2025-02-17 09:34:28 +08:00
|
|
|
.modelindex_right,.modelindex_left{
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
> .modelindex_right{
|
|
|
|
|
flex: 1;
|
|
|
|
|
overflow: hidden;
|
2025-03-03 14:52:05 +08:00
|
|
|
|
2025-02-17 09:34:28 +08:00
|
|
|
> .detail_btn{
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
2025-02-17 15:24:01 +08:00
|
|
|
border-radius: 1rem;
|
|
|
|
|
padding: .7rem ;
|
2025-03-03 14:52:05 +08:00
|
|
|
flex-shrink: 0;
|
2025-04-30 14:01:52 +08:00
|
|
|
overflow: hidden;
|
2025-05-28 10:28:07 +08:00
|
|
|
// max-height: 4rem;
|
2025-06-26 15:41:08 +08:00
|
|
|
position: relative;
|
|
|
|
|
z-index: 99;
|
2025-02-17 09:34:28 +08:00
|
|
|
> i{
|
|
|
|
|
font-size: 2rem;
|
2025-02-17 15:24:01 +08:00
|
|
|
cursor: pointer;
|
2025-05-28 10:28:07 +08:00
|
|
|
// padding: 1.5rem;
|
2025-02-17 15:24:01 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
border-radius: .6rem;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
transition: all .3s;
|
2025-05-28 10:28:07 +08:00
|
|
|
width: 4rem;
|
|
|
|
|
height: 4rem;
|
|
|
|
|
justify-content: center;
|
2025-09-10 16:33:40 +08:00
|
|
|
&.pointerEventsNone{
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
}
|
2025-07-19 14:04:48 +08:00
|
|
|
@media (min-width: 1024px) {
|
|
|
|
|
font-size: 2.4rem;
|
|
|
|
|
}
|
2025-09-15 13:33:42 +08:00
|
|
|
> img{
|
|
|
|
|
width: 80%;
|
|
|
|
|
color: #fff;
|
|
|
|
|
height: 80%;
|
|
|
|
|
}
|
2025-02-17 15:24:01 +08:00
|
|
|
}
|
|
|
|
|
> i:hover{
|
|
|
|
|
background: #000000;
|
|
|
|
|
color: #fff;
|
2025-02-17 09:34:28 +08:00
|
|
|
}
|
2025-02-17 15:24:01 +08:00
|
|
|
> .active{
|
|
|
|
|
background: #000000;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
2025-02-17 09:34:28 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.modelindex_left{
|
|
|
|
|
justify-content: center;
|
2025-08-26 10:14:34 +08:00
|
|
|
position: relative;
|
|
|
|
|
> .back{
|
|
|
|
|
position: absolute;
|
|
|
|
|
font-size: 3.6rem;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 1.2rem;
|
|
|
|
|
top: 8rem;
|
|
|
|
|
left: 0;
|
|
|
|
|
> i {
|
|
|
|
|
margin-right: 2.8rem;
|
|
|
|
|
font-size: 2rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
align-items: center;
|
|
|
|
|
width: 4.6rem;
|
|
|
|
|
height: 4.6rem;
|
|
|
|
|
border-radius: 1.2rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
border: 1px solid #D8DADC;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-02-17 09:34:28 +08:00
|
|
|
}
|
2025-02-17 15:24:01 +08:00
|
|
|
|
2025-01-23 09:36:21 +08:00
|
|
|
}
|
|
|
|
|
</style>
|