Files
aida_front/src/component/Detail/detailLeft/index.vue

88 lines
2.6 KiB
Vue
Raw Normal View History

2025-02-17 09:34:28 +08:00
<template>
<div class="detailLeft">
<sketch v-show="currentDetailType == 'sketch'" ref="sketch" @addDetail="addDetail"></sketch>
2025-02-17 09:34:28 +08:00
<print v-show="currentDetailType == 'print'"></print>
2025-04-09 14:09:19 +08:00
<color v-if="currentDetailType == 'color'"></color>
2025-03-03 14:52:05 +08:00
<element v-show="currentDetailType == 'element'"></element>
2025-11-04 10:44:11 +08:00
<accessory v-show="currentDetailType == 'accessory'"></accessory>
2025-05-28 10:28:07 +08:00
<models v-show="currentDetailType == 'models'"></models>
2025-02-25 15:32:55 +08:00
<addDetails ref="addDetails" @setSloganData="setSloganData"></addDetails>
2025-02-17 09:34:28 +08:00
</div>
</template>
<script lang="ts">
import { defineComponent,computed,ref,provide,nextTick,createVNode,toRefs, reactive} from 'vue'
// import setDesignItem from '@/component/Detail/setDesignItem2.vue'
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { Https } from "@/tool/https";
import { useStore } from "vuex";
import { useI18n } from 'vue-i18n'
import sketch from './sketch.vue'
import print from './print.vue'
2025-02-17 15:24:01 +08:00
import color from './colorBox/index.vue'
2025-03-03 14:52:05 +08:00
import element from './element.vue'
2025-11-04 10:44:11 +08:00
import accessory from './accessory.vue'
2025-05-28 10:28:07 +08:00
import models from './models.vue'
2025-02-25 15:32:55 +08:00
import addDetails from '@/component/Detail/addDetails.vue'
2025-02-17 09:34:28 +08:00
export default defineComponent({
components:{
2025-11-04 10:44:11 +08:00
sketch,print,color,addDetails,element,models,accessory
2025-02-17 09:34:28 +08:00
},
setup(props,{emit}) {
const store = useStore();
const detailData = reactive({
selectTitle:'upload',
2025-08-22 10:27:48 +08:00
selectDetail:computed(()=>store.state.DesignDetail.selectDetail),
currentDetailType:computed(()=>store.state.DesignDetail.currentDetailType),
2025-02-17 09:34:28 +08:00
})
const getDetailListData = reactive({
total:0,
pageSize:10,
currentPage:1,
})
const getDetailListDom = reactive({
2025-02-25 15:32:55 +08:00
addDetails:null as any,
sketch:null as any,
2025-02-17 09:34:28 +08:00
})
2025-02-25 15:32:55 +08:00
const addDetail = () =>{
let addDetails:any = getDetailListDom.addDetails
addDetails.init(detailData.selectDetail,'')
}
const setSloganData = (data:any)=>{
detailData.selectDetail.sketchString = data
2025-07-19 14:04:48 +08:00
if(detailData.currentDetailType == 'sketch' && detailData.selectDetail?.newDetail?.sketch){
detailData.selectDetail.newDetail.sketch = null
}
2025-02-25 15:32:55 +08:00
}
const sketchSysToLibrary = ()=>{//系统sketch添加到library更新library
getDetailListDom.sketch.sketchSysToLibrary()
}
2025-02-17 09:34:28 +08:00
return{
...toRefs(detailData),
...toRefs(getDetailListData),
...toRefs(getDetailListDom),
2025-02-25 15:32:55 +08:00
addDetail,
setSloganData,
sketchSysToLibrary,
2025-02-17 09:34:28 +08:00
}
},
provide() {
return {
}
},
})
</script>
<style lang="less" scoped>
.detailLeft{
// width: 34rem;
2025-02-17 09:34:28 +08:00
// width: 100%;
2025-09-24 16:00:25 +08:00
// height: 100%;
2025-10-03 16:31:42 +08:00
flex: 1;
2025-06-30 10:53:25 +08:00
display: flex;
2025-10-02 15:38:46 +08:00
overflow: hidden;
2025-06-30 10:53:25 +08:00
flex-direction: column;
2025-02-17 09:34:28 +08:00
}
</style>