Merge remote-tracking branch 'origin/StableVersion' into dev_vite

This commit is contained in:
X1627315083
2026-01-28 16:12:36 +08:00
7 changed files with 111 additions and 65 deletions

View File

@@ -331,6 +331,7 @@ export default defineComponent({
store.commit('DesignDetail/setCurrentDetailType',str) store.commit('DesignDetail/setCurrentDetailType',str)
} }
const setClothes = async (list:any,str:string)=>{ const setClothes = async (list:any,str:string)=>{
console.log(JSON.parse(JSON.stringify(list)))
let clothesList:any = [] let clothesList:any = []
if(detailData.isEditPattern.value == 'editSketch')await detailDom.canvasBox.submitBase64Data().then((rv)=>{ if(detailData.isEditPattern.value == 'editSketch')await detailDom.canvasBox.submitBase64Data().then((rv)=>{
detailData.selectDetail.sketchString = rv detailData.selectDetail.sketchString = rv
@@ -372,6 +373,7 @@ export default defineComponent({
gradient = list[i].gradient gradient = list[i].gradient
if((detailData.currentDetailType == 'sketch' && newData?.sketch) || detailData.isEditPattern.value == 'editSketch'){ if((detailData.currentDetailType == 'sketch' && newData?.sketch) || detailData.isEditPattern.value == 'editSketch'){
color = detailData.designDetail.clothes?.[0]?.color?.rgba?.r?`${detailData.designDetail.clothes?.[0].color.rgba.r} ${detailData.designDetail.clothes[0].color.rgba.g} ${detailData.designDetail.clothes[0].color.rgba.b}`:'' color = detailData.designDetail.clothes?.[0]?.color?.rgba?.r?`${detailData.designDetail.clothes?.[0].color.rgba.r} ${detailData.designDetail.clothes[0].color.rgba.g} ${detailData.designDetail.clothes[0].color.rgba.b}`:''
gradient = detailData.designDetail.clothes?.[0]?.gradient || null
detailData.selectDetail.maskUrl = '' detailData.selectDetail.maskUrl = ''
detailData.selectDetail.maskMinioUrl = '' detailData.selectDetail.maskMinioUrl = ''
} }
@@ -547,6 +549,7 @@ export default defineComponent({
if((detailData.currentDetailType == 'models' && !detailData.isEditPattern.value) || (detailData.currentDetailType == 'sketch' && !detailData.isEditPattern.value) || detailData.isEditPattern.value == 'editSketch'){ if((detailData.currentDetailType == 'models' && !detailData.isEditPattern.value) || (detailData.currentDetailType == 'sketch' && !detailData.isEditPattern.value) || detailData.isEditPattern.value == 'editSketch'){
await getSubmitData('preview') await getSubmitData('preview')
if(detailData.currentDetailType == 'models')return detailData.loadingShow = false if(detailData.currentDetailType == 'models')return detailData.loadingShow = false
detailData.imgDomIndex = detailData.frontBack.front.findIndex((item:any)=>item.id == detailData.selectDetail.id)
await getSketchSize() await getSketchSize()
detailDom.canvasBox.changeSketchUpdateFrontBack = async ()=>{ detailDom.canvasBox.changeSketchUpdateFrontBack = async ()=>{
await detailDom.canvasBox.privewDetail() await detailDom.canvasBox.privewDetail()

View File

@@ -11,8 +11,7 @@
@canvasInit="editSketchCanvasInit" @canvasInit="editSketchCanvasInit"
is-edit is-edit
:clothingImageUrl="selectDetail.path" :clothingImageUrl="selectDetail.path"
:clothingImageUrl2="selectDetail.layersObject[0].maskUrl" :clothingImageUrl2="selectDetail.maskUrl || selectDetail.layersObject[0].maskUrl"
:clothingMinIOPath="selectDetail.minIOPath"
showFixedLayer showFixedLayer
:canvasJSON="canvasJSON" :canvasJSON="canvasJSON"
@canvasLoadJsonSuccess="canvasLoadJsonSuccess" @canvasLoadJsonSuccess="canvasLoadJsonSuccess"
@@ -245,8 +244,11 @@ export default defineComponent({
} }
const frontBackChange = (value:any)=>{ const frontBackChange = async (value:any)=>{
let full = detailData.selectDetail.partialDesign.partialDesignBase64 || detailData.selectDetail.path if(!detailData.selectDetail.partialDesign.partialDesignPath && !detailData.selectDetail.partialDesign.partialDesignBase64){
await privewDetail()
}
let full = detailData.selectDetail.partialDesign.partialDesignBase64 || detailData.selectDetail.partialDesign.partialDesignPath || detailData.selectDetail.path
let size = { let size = {
...detailData.canvasConfig, ...detailData.canvasConfig,
} }

View File

@@ -222,25 +222,35 @@ export default defineComponent({
const currentTransform = element.style?.transform || ''; const currentTransform = element.style?.transform || '';
const currentRotates = (currentTransform.match(/rotate[XYZ]?\([^)]+\)/g) || []); const currentRotates = (currentTransform.match(/rotate[XYZ]?\([^)]+\)/g) || []);
let otherTransforms = currentTransform let otherTransforms = currentTransform
.replace(/scaleX\(-1\)|scaleY\(-1\)/g, '') .replace(/scaleX\([^)]*\)/g, '') // 移除所有 scaleX(...)
.replace(/scaleY\([^)]*\)/g, '') // 移除所有 scaleY(...)
.replace(/rotate[XYZ]?\([^)]+\)/g, '') .replace(/rotate[XYZ]?\([^)]+\)/g, '')
.replace(/\s+/g, ' ') .replace(/\s+/g, ' ')
.trim(); .trim();
const transforms = []; const transforms = [];
if (element.mirror.x) transforms.push('scaleX(-1)'); if (element.mirror && element.mirror.x) transforms.push('scaleX(-1)');
if (element.mirror.y) transforms.push('scaleY(-1)'); if (element.mirror && element.mirror.y) transforms.push('scaleY(-1)');
if (otherTransforms) transforms.push(otherTransforms); if (otherTransforms) transforms.push(otherTransforms);
if (rotateDeg !== null) { if (rotateDeg !== null) {
transforms.push(`rotate(${rotateDeg}deg)`); transforms.push(`rotate(${rotateDeg}deg)`);
} else if (currentRotates.length > 0) { } else if (currentRotates.length > 0) {
transforms.push(...currentRotates); transforms.push(...currentRotates);
} }
element.style.transform = transforms.join(' ').trim(); element.style.transform = transforms.join(' ').trim();
}; };
moveableInstance.value.on('scale', ({ target, delta, direction }) => { moveableInstance.value.on('scale', ({ target, delta, direction }) => {
const frontStyle = detailData.frontBack.front[selectItem.imgDomIndex]; const frontStyle = detailData.frontBack.front[selectItem.imgDomIndex];
if (!frontStyle.mirror) frontStyle.mirror = { x: false, y: false };
// 确保 mirror 对象存在并正确初始化
if (!frontStyle.mirror) {
frontStyle.mirror = { x: false, y: false };
}
// 清除可能存在的重复镜像变换
updateElementTransform(frontStyle);
let width = parseFloat(frontStyle.style.width); let width = parseFloat(frontStyle.style.width);
let height = parseFloat(frontStyle.style.height); let height = parseFloat(frontStyle.style.height);
@@ -249,6 +259,8 @@ export default defineComponent({
let rotation = 0; let rotation = 0;
const originalRatio = width / height; const originalRatio = width / height;
// 提取当前旋转角度
if (frontStyle.style.transform) { if (frontStyle.style.transform) {
const match = frontStyle.style.transform.match(/rotate\(([-\d.]+)deg\)/); const match = frontStyle.style.transform.match(/rotate\(([-\d.]+)deg\)/);
if (match) rotation = parseFloat(match[1]); if (match) rotation = parseFloat(match[1]);
@@ -259,8 +271,13 @@ export default defineComponent({
const x = corner.x * Math.cos(rad) - corner.y * Math.sin(rad); const x = corner.x * Math.cos(rad) - corner.y * Math.sin(rad);
const y = corner.x * Math.sin(rad) + corner.y * Math.cos(rad); const y = corner.x * Math.sin(rad) + corner.y * Math.cos(rad);
const threshold = 0.5; const threshold = 0.5;
return { x: Math.abs(x) > threshold ? (x > 0 ? 1 : -1) : 0, y: Math.abs(y) > threshold ? (y > 0 ? 1 : -1) : 0 }; return {
x: Math.abs(x) > threshold ? (x > 0 ? 1 : -1) : 0,
y: Math.abs(y) > threshold ? (y > 0 ? 1 : -1) : 0
}; };
};
// 根据旋转角度调整方向
if (rotation !== 0) { if (rotation !== 0) {
direction = getAdjustedCorner({ x: direction[0], y: direction[1] }, rotation); direction = getAdjustedCorner({ x: direction[0], y: direction[1] }, rotation);
direction = [direction.x, direction.y]; direction = [direction.x, direction.y];
@@ -274,25 +291,29 @@ export default defineComponent({
let newVal = val * deltaVal; let newVal = val * deltaVal;
// 翻转处理 // 翻转处理 - 只在值真正变为负值时触发镜像
if (newVal <= 0) { if (newVal < 0) {
frontStyle.mirror[mirrorKey] = !frontStyle.mirror[mirrorKey]; frontStyle.mirror[mirrorKey] = !frontStyle.mirror[mirrorKey];
newVal = Math.abs(newVal); newVal = Math.abs(newVal);
updateElementTransform(frontStyle); } else if (newVal === 0) {
// 防止值变为0
newVal = 1;
} }
// 位置调整 // 位置调整
const shouldMove = (!frontStyle.mirror[mirrorKey] && dir === -1) || (frontStyle.mirror[mirrorKey] && dir === 1); const shouldMove = (!frontStyle.mirror[mirrorKey] && dir === -1) || (frontStyle.mirror[mirrorKey] && dir === 1);
// 保持宽高比
if (keepRatio && otherAxisResult) { if (keepRatio && otherAxisResult) {
newVal = isWidth ? otherAxisResult.newVal * originalRatio : otherAxisResult.newVal / originalRatio; newVal = isWidth ? otherAxisResult.newVal * originalRatio : otherAxisResult.newVal / originalRatio;
} }
const adjustPos = shouldMove ? pos - (newVal - val) : pos; const adjustPos = shouldMove ? pos - (newVal - val) : pos;
return { newVal, adjustPos, shouldFlip: newVal !== val && newVal <= 0 }; return { newVal, adjustPos };
}; };
// 处理缩放
if (isDiagonal) { if (isDiagonal) {
const mainAxis = Math.abs(delta[0] - 1) > Math.abs(delta[1] - 1) ? 'width' : 'height'; const mainAxis = Math.abs(delta[0] - 1) > Math.abs(delta[1] - 1) ? 'width' : 'height';
const crossAxis = mainAxis === 'width' ? 'height' : 'width'; const crossAxis = mainAxis === 'width' ? 'height' : 'width';
@@ -318,37 +339,49 @@ export default defineComponent({
frontStyle.style.width = widthResult.newVal + 'px'; frontStyle.style.width = widthResult.newVal + 'px';
frontStyle.style.height = heightResult.newVal + 'px'; frontStyle.style.height = heightResult.newVal + 'px';
} }
// 更新变换,确保正确的顺序
updateElementTransform(frontStyle);
}); });
// 旋转
moveableInstance.value.on('rotate', ({ target, beforeRotate }) => { moveableInstance.value.on('rotate', ({ target, beforeRotate }) => {
let frontStyle = detailData.frontBack.front[selectItem.imgDomIndex]; let frontStyle = detailData.frontBack.front[selectItem.imgDomIndex];
// 确保镜像状态存在 if (!frontStyle.mirror) {
if (!frontStyle.mirror) frontStyle.mirror = { x: false, y: false }; frontStyle.mirror = { x: false, y: false };
}
const { x: isMirroredX, y: isMirroredY } = frontStyle.mirror; const { x: isMirroredX, y: isMirroredY } = frontStyle.mirror;
const currentTransform = frontStyle.style?.transform || '';
// 计算实际旋转角度 const rotateMatch = currentTransform.match(/rotate\(([-\d.]+)deg\)/);
let actualRotate = beforeRotate; let currentAngle = 0;
if (rotateMatch && rotateMatch[1]) {
// 关键逻辑当镜像状态不同时一个true一个false旋转方向反转 const parsed = parseFloat(rotateMatch[1]);
if (isMirroredX !== isMirroredY) { if (!isNaN(parsed)) {
actualRotate = -beforeRotate; currentAngle = parsed;
} }
// 确保角度在 0-360 度范围内
actualRotate = actualRotate % 360;
// 如果角度为负数,转换为正数
if (actualRotate < 0) {
actualRotate += 360;
} }
const newBeforeRotate = parseFloat(beforeRotate) || 0;
if (!window._lastRotateData) {
window._lastRotateData = {
beforeRotate: newBeforeRotate,
angle: currentAngle
};
}
const delta = newBeforeRotate - window._lastRotateData.beforeRotate;
const shouldReverse = (isMirroredX && !isMirroredY) || (!isMirroredX && isMirroredY);
let newAngle;
if (shouldReverse) {
newAngle = window._lastRotateData.angle - delta;
} else {
newAngle = window._lastRotateData.angle + delta;
}
newAngle = ((newAngle % 360) + 360) % 360;
window._lastRotateData.beforeRotate = newBeforeRotate;
window._lastRotateData.angle = newAngle;
updateElementTransform(frontStyle, newAngle);
});
// 确保角度在 [0, 360) 范围内 // 可选在rotateStart时重置
actualRotate = ((actualRotate % 360) + 360) % 360; moveableInstance.value.on('rotateStart', () => {
window._lastRotateData = null;
updateElementTransform(frontStyle, actualRotate.toFixed(2));
}); });
// 调整大小 // 调整大小
moveableInstance.value.on('resize', ({ target, width, height }) => { moveableInstance.value.on('resize', ({ target, width, height }) => {
@@ -370,12 +403,17 @@ export default defineComponent({
upDataDetail() upDataDetail()
}); });
}; };
watch(()=>selectItem.selectDetail,(newValue,oldValue)=>{ // watch(()=>selectItem.selectDetail,(newValue,oldValue)=>{
if(!newValue && newValue?.id == oldValue?.id)return // if(!newValue && newValue?.id == oldValue?.id)return
selectItem.imgDomIndex = detailData.frontBack.front.findIndex((item:any)=>item.id == newValue.id) // },{immediate: true,})
watch(()=>selectItem.selectDetail?.id,(newValue,oldValue)=>{
if(newValue){
selectItem.imgDomIndex = detailData.frontBack.front.findIndex((item:any)=>item.id == newValue)
setTimeout(()=>{
initMoveableForSelected() initMoveableForSelected()
},100)
}
},{immediate: true,}) },{immediate: true,})
const setRevocation = async ()=>{ const setRevocation = async ()=>{
let frontBack = JSON.parse(JSON.stringify(detailData.frontBack)) let frontBack = JSON.parse(JSON.stringify(detailData.frontBack))
let revocation:any = JSON.parse((await KeyValueDB.get("revocation") as any) || '[]') let revocation:any = JSON.parse((await KeyValueDB.get("revocation") as any) || '[]')
@@ -536,6 +574,7 @@ export default defineComponent({
getMousePosition, getMousePosition,
updataPosition, updataPosition,
updateRect, updateRect,
initMoveableForSelected,
} }
}, },

View File

@@ -790,7 +790,6 @@ export default defineComponent({
.login_form_content { .login_form_content {
margin-top: 4rem; margin-top: 4rem;
position: relative; position: relative;
&[state="2"] { &[state="2"] {
> * { > * {
opacity: 0; opacity: 0;

View File

@@ -826,7 +826,6 @@ export default defineComponent({
.login_form_content { .login_form_content {
margin-top: 4rem; margin-top: 4rem;
position: relative; position: relative;
&[state="2"] { &[state="2"] {
> * { > * {
opacity: 0; opacity: 0;

View File

@@ -916,10 +916,14 @@ export default defineComponent({
.login_form_content { .login_form_content {
margin-top: 4rem; margin-top: 4rem;
position: relative; position: relative;
min-height: 34rem;
@media (max-width: 768px) { @media (max-width: 768px) {
margin-top: 2.4rem; margin-top: 2.4rem;
min-height: auto;
&[state="2"] {
height: 20rem; height: 20rem;
} }
}
&[state="2"] { &[state="2"] {
> * { > * {
opacity: 0; opacity: 0;

View File

@@ -12,7 +12,7 @@
<!-- <div class="upgrade-content-textab">Due to the system server upgrade, we will start the upgrade from 9:30 am Hong Kong time on the weekend of October 20th until October 21st. During this time,<br> the AiDA system will be temporarily inaccessible. We apologize for any inconvenience this may cause and thank you for your understanding.</div> --> <!-- <div class="upgrade-content-textab">Due to the system server upgrade, we will start the upgrade from 9:30 am Hong Kong time on the weekend of October 20th until October 21st. During this time,<br> the AiDA system will be temporarily inaccessible. We apologize for any inconvenience this may cause and thank you for your understanding.</div> -->
<!-- 有截至时间 --> <!-- 有截至时间 -->
<div class="upgrade-content-textab"> <div class="upgrade-content-textab">
Due to system server upgrades, maintenance will be carried out from 21:00 to 22:00 on January 19, 2026 (today). Due to system server upgrades, maintenance will be carried out from 21:00 to 23:00 on January 19, 2026 (today).
<br> <br>
The AiDA system will be temporarily unavailable during this period. We sincerely apologize for any inconvenience caused and thank you for your understanding.</div> The AiDA system will be temporarily unavailable during this period. We sincerely apologize for any inconvenience caused and thank you for your understanding.</div>
<br> <br>
@@ -20,7 +20,7 @@
<br> <br>
<!-- <div class="upgrade-content-textab">由于系统服务器维护AiDA系统暂时无法访问对于由此造成的任何不便我们深表歉意并感谢您的理解</div> --> <!-- <div class="upgrade-content-textab">由于系统服务器维护AiDA系统暂时无法访问对于由此造成的任何不便我们深表歉意并感谢您的理解</div> -->
<div class="upgrade-content-textab"> <div class="upgrade-content-textab">
由于系统服务器升级我们将于1月23日21:00 至1月23日22:00进行升级 由于系统服务器升级我们将于1月23日21:00 至1月23日23:00进行升级
<br> <br>
在此期间AiDA系统将暂时无法访问给您带来的不便我们深表歉意并感谢您的理解</div> 在此期间AiDA系统将暂时无法访问给您带来的不便我们深表歉意并感谢您的理解</div>
</div> </div>