Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite

This commit is contained in:
李志鹏
2026-01-23 15:24:42 +08:00
9 changed files with 811 additions and 66 deletions

View File

@@ -314,6 +314,7 @@ export default defineComponent({
str:props.type,
id:id,
}
console.log('data',value)
store.commit('DesignDetail/setNewDetail',value)
}
const sort = (list:any)=>{
@@ -473,6 +474,7 @@ export default defineComponent({
setPosition()
},{immediate: true,})
watch(()=>editPrintElementData.stateOverallSingle,(newVal)=>{
previewDetailPrintData()
let arr:any = editPrintElementData.selectDetail.newDetail?.print || editPrintElementData.selectDetail.printObject.prints
if(props.type == 'element'){
arr = editPrintElementData.selectDetail.newDetail?.element || editPrintElementData.selectDetail.trims.prints
@@ -482,9 +484,8 @@ export default defineComponent({
}
if(arr.length > 0){
editPrintElementData.imgDomIndex = 0
editPrintElementData.printStyleList[props.type][newVal] = []
// editPrintElementData.printStyleList[props.type].single = []
// editPrintElementData.printStyleList[props.type].overall = []
editPrintElementData.printStyleList[props.type].single = []
editPrintElementData.printStyleList[props.type].overall = []
arr.forEach((item:any,index:number) => {
getItemPosition(item)
});

View File

@@ -1,6 +1,5 @@
<template>
<div class="repeat-setting">
{{ }}
<div class="repeat-setting" v-if="!mask">
<div class="repeat-setting-item">
<span class="label">{{ t("Canvas.angle") }}</span>
<angle-tool
@@ -87,6 +86,13 @@
// return props.object?.scale/10;
return props.object?.scale[0] * 100;
});
const scalePrint = computed(() => {
let index = sketchWH.value[0] > sketchWH.value[1]?0:1;
return sketchWH.value[index] / printWH.value[index] * scale.value / 5;
});
const printWH = ref([0,0])
const sketchWH = ref([0,0])
const mask = ref(false)
const offset = ref([0,0])
const sketchSize:any = async ()=>{
let img = new Image();
@@ -102,10 +108,27 @@
});
return size
}
const printSize:any = async ()=>{
let img = new Image();
let size = [0,0];
img.src = props.sketchPath;
console.log(props.sketchPath)
await new Promise((resolve, reject) => {
img.onload = () => {
size = [img.width, img.height]
resolve([img.width, img.height]);
}
img.onerror = reject;
});
return size
}
watch (() => props.object.path || props.object.location, async () => {
let size = await sketchSize();
offset.value[0] = props.object.location[0] / size[0] * 100;
offset.value[1] = props.object.location[1] / size[1] * 100;
mask.value = true
sketchWH.value = await sketchSize();
printWH.value = await printSize();
offset.value[0] = props.object.location[0] / sketchWH.value[0] * 100;
offset.value[1] = props.object.location[1] / sketchWH.value[1] * 100;
mask.value = false
},{immediate: true})
const gapX = computed(() => props.object.object?.gapX || 0);
const gapY = computed(() => props.object.object?.gapY || 0);
@@ -121,7 +144,6 @@
]);
const inputFillScale = (e) => {
const scale = e / 100;
console.log(scale.toFixed(2))
emit("inputFillScale", scale.toFixed(2));
};
const inputOffset = async (e:any)=>{