部分页面添加隐藏画布
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
:clothing-image-opts="{
|
:clothing-image-opts="{
|
||||||
imageMode:'contains',
|
imageMode:'contains',
|
||||||
}"
|
}"
|
||||||
|
:hideCanvas="hideCanvas"
|
||||||
ref="editCanvas">
|
ref="editCanvas">
|
||||||
</editCanvas>
|
</editCanvas>
|
||||||
<!-- <canvasContent ref="canvasContent"></canvasContent> -->
|
<!-- <canvasContent ref="canvasContent"></canvasContent> -->
|
||||||
@@ -37,6 +38,7 @@
|
|||||||
:clothing-image-opts="{
|
:clothing-image-opts="{
|
||||||
imageMode:'contains',
|
imageMode:'contains',
|
||||||
}"
|
}"
|
||||||
|
:hideCanvas="hideCanvas"
|
||||||
ref="editCanvasBackFront">
|
ref="editCanvasBackFront">
|
||||||
</editCanvas>
|
</editCanvas>
|
||||||
</div>
|
</div>
|
||||||
@@ -63,6 +65,7 @@ import { useStore } from "vuex";
|
|||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import editCanvas from "@/component/Canvas/CanvasEditor/index.vue";
|
import editCanvas from "@/component/Canvas/CanvasEditor/index.vue";
|
||||||
import { formatTime,segmentImage,getMinioUrl } from "@/tool/util";
|
import { formatTime,segmentImage,getMinioUrl } from "@/tool/util";
|
||||||
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components:{
|
components:{
|
||||||
@@ -77,7 +80,7 @@ export default defineComponent({
|
|||||||
setup(props,{emit}) {
|
setup(props,{emit}) {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const {t} = useI18n();
|
const {t} = useI18n();
|
||||||
|
const route = useRoute()
|
||||||
const detailDom = reactive({
|
const detailDom = reactive({
|
||||||
editFrontBack:null as any,
|
editFrontBack:null as any,
|
||||||
model:null,
|
model:null,
|
||||||
@@ -104,6 +107,7 @@ export default defineComponent({
|
|||||||
getCanvasIfEdit:inject('getCanvasIfEdit')as any,
|
getCanvasIfEdit:inject('getCanvasIfEdit')as any,
|
||||||
canvasInstance:null as any,
|
canvasInstance:null as any,
|
||||||
canvasJSON:'',
|
canvasJSON:'',
|
||||||
|
hideCanvas: computed(()=>store.state.Workspace.projectPath !== route.fullPath),
|
||||||
})
|
})
|
||||||
watch(()=>detailData.selectDetail,(newValue,oldValue)=>{
|
watch(()=>detailData.selectDetail,(newValue,oldValue)=>{
|
||||||
detailData.imgDomIndex = detailData.frontBack.front.findIndex((item:any)=>item.id == newValue.id)
|
detailData.imgDomIndex = detailData.frontBack.front.findIndex((item:any)=>item.id == newValue.id)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
@canvasInit="canvasInit"
|
@canvasInit="canvasInit"
|
||||||
@changeCanvas="changeCanvas"
|
@changeCanvas="changeCanvas"
|
||||||
is-general
|
is-general
|
||||||
|
:hideCanvas="hideCanvas"
|
||||||
:isBackgroundChangeable="false"
|
:isBackgroundChangeable="false"
|
||||||
ref="editCanvas"></editCanvas>
|
ref="editCanvas"></editCanvas>
|
||||||
</div>
|
</div>
|
||||||
@@ -26,6 +27,7 @@ import { Https } from "@/tool/https";
|
|||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import editCanvas from "@/component/Canvas/CanvasEditor/index.vue";
|
import editCanvas from "@/component/Canvas/CanvasEditor/index.vue";
|
||||||
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -53,12 +55,14 @@ export default defineComponent({
|
|||||||
const isShowMark = ref(false)
|
const isShowMark = ref(false)
|
||||||
const component = reactive({
|
const component = reactive({
|
||||||
})
|
})
|
||||||
|
const route = useRoute()
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
canvasLoad:false,
|
canvasLoad:false,
|
||||||
canvasJSON:computed(()=>store.state.HomeStoreModule.canvasData.canvas),
|
canvasJSON:computed(()=>store.state.HomeStoreModule.canvasData.canvas),
|
||||||
canvasConfig:{
|
canvasConfig:{
|
||||||
|
|
||||||
},
|
},
|
||||||
|
hideCanvas: computed(()=>store.state.Workspace.projectPath !== route.fullPath),
|
||||||
})
|
})
|
||||||
watch(()=>data.canvasJSON,(newVal)=>{
|
watch(()=>data.canvasJSON,(newVal)=>{
|
||||||
dataDom.editCanvas.loadJSON(newVal)
|
dataDom.editCanvas.loadJSON(newVal)
|
||||||
|
|||||||
Reference in New Issue
Block a user