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

This commit is contained in:
2025-12-18 13:29:34 +08:00
9 changed files with 79 additions and 29 deletions

53
prod_build_manual.yaml Normal file
View File

@@ -0,0 +1,53 @@
name: AiDA WEB-Node.js StableVersion 分支构建部署
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.18.0 ]
steps:
- name: 1.检出代码
uses: actions/checkout@v4
with:
ref: StableVersion
- name: 2.打印当前分支信息
run: |
echo "Current branch being deployed is: $(git rev-parse --abbrev-ref HEAD)"
echo "The code is from the 'main' branch, as specified in 'actions/checkout'."
- name: 3.设置 Node.js 环境 ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build
- run: ls -l
- name: 3.5. 手动安装 AWS CLI v2 # 新增步骤:确保 aws 命令可用
run: |
echo "安装 AWS CLI V2..."
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
aws --version
echo "AWS CLI V2 安装完成。"
- name: 4.配置 AWS 凭证
uses: aws-actions/configure-aws-credentials@main
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'ap-east-1'
- name: 5.同步 dist 目录到 S3
run: |
aws s3 sync dist/ s3://${{ secrets.S3_BUCKET_NAME }}/ --acl public-read
- name: 6.部署完成
run: echo "构建和部署到 S3 任务完成。"

View File

@@ -902,7 +902,7 @@ const changeCanvas = async (command) => {
...command, // 传递完整的命令数据 ...command, // 传递完整的命令数据
}; };
emit("changeCanvas", commandData); emit("changeCanvas", commandData);
if (command.canUndo || command.canRedo) { if ((command.canUndo || command.canRedo) && props.enabledRedGreenMode) {
setTimeout(async () => { setTimeout(async () => {
const imageData = await canvasManager.exportImage({ const imageData = await canvasManager.exportImage({
restoreOpacityInRedGreen: true, // 恢复红绿图模式下的透明度 restoreOpacityInRedGreen: true, // 恢复红绿图模式下的透明度

View File

@@ -555,23 +555,17 @@ export class ExportManager {
); );
} }
// 获取固定图层对象的边界矩形(包含位置、尺寸、缩放等信息)
const fixedBounds = fixedLayerObject?.getBoundingRect?.();
// 使用固定图层的实际显示尺寸作为导出画布尺寸 // 使用固定图层的实际显示尺寸作为导出画布尺寸
const canvasWidth = Math.round(fixedBounds.width); const canvasWidth = Math.round(fixedLayerObject.width * fixedLayerObject.scaleX);
const canvasHeight = Math.round(fixedBounds.height); const canvasHeight = Math.round(fixedLayerObject.height * fixedLayerObject.scaleY);
console.log(`红绿图模式导出,画布尺寸: ${canvasWidth}x${canvasHeight}`); console.log(`红绿图模式导出,画布尺寸: ${canvasWidth}x${canvasHeight}`);
console.log("固定图层边界:", fixedBounds);
// 创建固定尺寸的临时画布 // 创建固定尺寸的临时画布
const scaleFactor = 2; // 高清导出 const scaleFactor = 2; // 高清导出
const tempCanvas = document.createElement("canvas"); const tempCanvas = document.createElement("canvas");
tempCanvas.width = canvasWidth * scaleFactor; tempCanvas.width = canvasWidth * scaleFactor;
tempCanvas.height = canvasHeight * scaleFactor; tempCanvas.height = canvasHeight * scaleFactor;
tempCanvas.style.width = canvasWidth + "px";
tempCanvas.style.height = canvasHeight + "px";
const tempFabricCanvas = new fabric.StaticCanvas(tempCanvas, { const tempFabricCanvas = new fabric.StaticCanvas(tempCanvas, {
width: canvasWidth, width: canvasWidth,
@@ -584,8 +578,7 @@ export class ExportManager {
try { try {
// 获取裁剪路径对象(如果存在) // 获取裁剪路径对象(如果存在)
const clipPathObject = await this._getClipPathObject(fixedBounds); const clipPathObject = await this._getClipPathObject(fixedLayerObject);
// 克隆并添加所有对象到临时画布,需要调整位置相对于固定图层 // 克隆并添加所有对象到临时画布,需要调整位置相对于固定图层
for (let i = 0; i < objectsToExport.length; i++) { for (let i = 0; i < objectsToExport.length; i++) {
const obj = objectsToExport[i]; const obj = objectsToExport[i];
@@ -594,19 +587,20 @@ export class ExportManager {
restoreOpacityInRedGreen && true restoreOpacityInRedGreen && true
); );
if (cloned) { if (cloned) {
// 调整对象位置:将原画布坐标转换为以固定图层为原点的相对坐标
cloned.set({ cloned.set({
left: cloned.left - fixedBounds.left, left: 0,
top: cloned.top - fixedBounds.top, top: 0,
originX: "left",
originY: "top",
}); });
// 更新对象坐标 // 更新对象坐标
cloned.setCoords(); cloned.setCoords();
// 设置裁剪路径到对象 // 设置裁剪路径到对象
if (clipPathObject) { // if (clipPathObject) {
cloned.clipPath = clipPathObject; // cloned.clipPath = clipPathObject;
} // }
tempFabricCanvas.add(cloned); tempFabricCanvas.add(cloned);
} }

View File

@@ -230,7 +230,7 @@ export default defineComponent({
let size = { let size = {
...detailData.canvasConfig, ...detailData.canvasConfig,
} }
store.commit('DesignDetail/updataDetailItem',{maskUrl:value})
segmentImage(value,full,size).then(async (rv)=>{ segmentImage(value,full,size).then(async (rv)=>{
let front = detailData.frontBack.front[detailData.imgDomIndex] let front = detailData.frontBack.front[detailData.imgDomIndex]
let back = detailData.frontBack.back[detailData.imgDomIndex] let back = detailData.frontBack.back[detailData.imgDomIndex]
@@ -243,7 +243,7 @@ export default defineComponent({
let base64 = await resizeImageWithNativeCanvas(front.oldMaskUrl,value) let base64 = await resizeImageWithNativeCanvas(front.oldMaskUrl,value)
front.maskUrl = base64 front.maskUrl = base64
back.imageUrl = rv.targetBackUrl back.imageUrl = rv.targetBackUrl
store.commit('DesignDetail/updataDetailItem',{maskUrl:value}) // store.commit('DesignDetail/updataDetailItem',{maskUrl:value})
}) })
} }

View File

@@ -30,7 +30,7 @@
:outputSize="option.size" :outputSize="option.size"
:outputType="option.outputType" :outputType="option.outputType"
:auto-crop="option.autoCrop" :auto-crop="option.autoCrop"
:fixedBox="isRound" :fixedBox="!isRound"
:movable="true" :movable="true"
:fixed="isRound" :fixed="isRound"
:auto-crop-width="option.autoCropWidth" :auto-crop-width="option.autoCropWidth"
@@ -333,7 +333,6 @@ export default defineComponent({
.cut_picture_review_block{ .cut_picture_review_block{
width: 100%; width: 100%;
height: calc(100% - 6.8rem*1.2); height: calc(100% - 6.8rem*1.2);
min-height: calc(100% - 6.8rem*1.2);
margin: 0 auto; margin: 0 auto;
.next_step_button{ .next_step_button{
margin-top: 2rem; margin-top: 2rem;

View File

@@ -145,7 +145,7 @@
</div> </div>
<!-- 取消请求 --> <!-- 取消请求 -->
<scaleImage ref="scaleImage"></scaleImage> <scaleImage ref="scaleImage"></scaleImage>
<Cropper ref="Cropper" @handleCropperSuccess="handleCropperSuccess" @closeCropper="deletUploadFile()" :cropperFileData="cropperFileData" :isRound="false" :isUpload="isUpload"></Cropper> <Cropper ref="Cropper" @handleCropperSuccess="handleCropperSuccess" @closeCropper="deletUploadFile()" :cropperFileData="cropperFileData" :isUpload="isUpload"></Cropper>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">

View File

@@ -682,6 +682,7 @@ export default defineComponent({
store.commit("cancelDeleteDesignCollectionList",index); store.commit("cancelDeleteDesignCollectionList",index);
} }
const designMousedown = (e:any,design:any,str:string)=>{ const designMousedown = (e:any,design:any,str:string)=>{
collItemSize.isMove = false
if(str != 'disLike'){ if(str != 'disLike'){
if(design.resultType != 'Design' || designData.isUnfold)return if(design.resultType != 'Design' || designData.isUnfold)return
if(str != 'like' && showDesignMark.value) return if(str != 'like' && showDesignMark.value) return
@@ -695,7 +696,6 @@ export default defineComponent({
startY = e.clientY, startY = e.clientY,
left = item.el.offsetLeft, left = item.el.offsetLeft,
top = item.el.offsetTop; top = item.el.offsetTop;
collItemSize.isMove = false
let moveFun = (e:any) => { let moveFun = (e:any) => {
collItemSize.isMove = true collItemSize.isMove = true
let X = e.clientX - startX + left; let X = e.clientX - startX + left;

View File

@@ -583,7 +583,7 @@ export default defineComponent({
const getIdExistToHistory = async () => { const getIdExistToHistory = async () => {
return await new Promise((resolve, reject) => { return await new Promise((resolve, reject) => {
let value = { let value = {
id: Number(route.params?.id || route.query?.history) id: Number(route.query?.id || route.query?.history)
} }
Https.axiosPost(Https.httpUrls.historyProject, value) Https.axiosPost(Https.httpUrls.historyProject, value)
.then(rv => { .then(rv => {
@@ -604,9 +604,9 @@ export default defineComponent({
} }
const key = Object.keys(query)?.[0] const key = Object.keys(query)?.[0]
if (key) { if (key) {
if (route.params?.id && !query.tools) { if (query.id && !query.tools) {
homeMainData.openType = 'history' homeMainData.openType = 'history'
homeMainData.openTypeChild = route.params?.id homeMainData.openTypeChild = query.id
} else { } else {
homeMainData.openType = Object.keys(query)[0] homeMainData.openType = Object.keys(query)[0]
homeMainData.openTypeChild = query[Object.keys(query)[0]] homeMainData.openTypeChild = query[Object.keys(query)[0]]
@@ -615,6 +615,10 @@ export default defineComponent({
homeMainData.openTypeChild = '' homeMainData.openTypeChild = ''
homeMainData.openType = '' homeMainData.openType = ''
} }
if ((query?.id || query?.history) && !(await getIdExistToHistory())) {
router.push('/home')
return
}
} else { } else {
homeMainData.openType = '' homeMainData.openType = ''
homeMainData.openTypeChild = '' homeMainData.openTypeChild = ''
@@ -934,12 +938,12 @@ export default defineComponent({
rv.content.forEach((item, index) => { rv.content.forEach((item, index) => {
let str = categorizeDate(item.updateTime) + 'list' let str = categorizeDate(item.updateTime) + 'list'
homeMainData.navTypeList.history[str].push(item) homeMainData.navTypeList.history[str].push(item)
if (item.id == (route.params?.id || route.query?.history)) { if (item.id == (route.query?.id || route.query?.history)) {
existToHistoryIndex = rv.page * rv.size + index + 1 - rv.size existToHistoryIndex = rv.page * rv.size + index + 1 - rv.size
} }
}) })
homeMainData.historyData.isNull = false homeMainData.historyData.isNull = false
if ((route.params?.id || route.query?.history) && isFound < 1) setScrollTop() if ((route.query?.id || route.query?.history) && isFound < 1) setScrollTop()
} else { } else {
homeMainData.historyData.isNoData = true homeMainData.historyData.isNoData = true
} }

View File

@@ -857,7 +857,7 @@ export default defineComponent({
padding: 0 1rem; padding: 0 1rem;
.operate_item { .operate_item {
// font-size: 1.4rem; font-size: 1.6rem;
font-family: Roboto; font-family: Roboto;
font-weight: 400; font-weight: 400;
color: #007ee5; color: #007ee5;