Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite
This commit is contained in:
6
components.d.ts
vendored
6
components.d.ts
vendored
@@ -9,8 +9,10 @@ export {}
|
|||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
ABadge: typeof import('ant-design-vue/es')['Badge']
|
ABadge: typeof import('ant-design-vue/es')['Badge']
|
||||||
|
ABreadcrumb: typeof import('ant-design-vue/es')['Breadcrumb']
|
||||||
ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
|
ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
|
||||||
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
|
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
|
||||||
|
ADatePicker: typeof import('ant-design-vue/es')['DatePicker']
|
||||||
ADrawer: typeof import('ant-design-vue/es')['Drawer']
|
ADrawer: typeof import('ant-design-vue/es')['Drawer']
|
||||||
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
|
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
|
||||||
AImage: typeof import('ant-design-vue/es')['Image']
|
AImage: typeof import('ant-design-vue/es')['Image']
|
||||||
@@ -24,9 +26,13 @@ declare module 'vue' {
|
|||||||
ASelect: typeof import('ant-design-vue/es')['Select']
|
ASelect: typeof import('ant-design-vue/es')['Select']
|
||||||
ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
|
ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
|
||||||
ASlider: typeof import('ant-design-vue/es')['Slider']
|
ASlider: typeof import('ant-design-vue/es')['Slider']
|
||||||
|
ASpace: typeof import('ant-design-vue/es')['Space']
|
||||||
ASpin: typeof import('ant-design-vue/es')['Spin']
|
ASpin: typeof import('ant-design-vue/es')['Spin']
|
||||||
|
ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
|
||||||
ASwitch: typeof import('ant-design-vue/es')['Switch']
|
ASwitch: typeof import('ant-design-vue/es')['Switch']
|
||||||
ATable: typeof import('ant-design-vue/es')['Table']
|
ATable: typeof import('ant-design-vue/es')['Table']
|
||||||
|
ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
||||||
|
ATabs: typeof import('ant-design-vue/es')['Tabs']
|
||||||
AUpload: typeof import('ant-design-vue/es')['Upload']
|
AUpload: typeof import('ant-design-vue/es')['Upload']
|
||||||
ElCascader: typeof import('element-plus/es')['ElCascader']
|
ElCascader: typeof import('element-plus/es')['ElCascader']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<div v-if="userDetail.accountExtendList?.Google" class="gallery_btn" @click="ungroupGoogleModel">{{ $t('frontPage.Unbind') }}</div>
|
<div v-if="userDetail.accountExtendList?.Google" class="gallery_btn" @click="ungroupGoogleModel">{{ $t('frontPage.Unbind') }}</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="gmail_btn">
|
<div class="gmail_btn">
|
||||||
<div v-if="!userDetail.accountExtendList?.Google" class="gallery_btn">{{ $t('frontPage.BindNow') }}</div>
|
<div v-if="!userDetail.accountExtendList?.Google" class="gallery_btn" style="pointer-events: none;">{{ $t('frontPage.BindNow') }}</div>
|
||||||
<div v-show="!userDetail.accountExtendList?.Google" id="g_id_bind"></div>
|
<div v-show="!userDetail.accountExtendList?.Google" id="g_id_bind"></div>
|
||||||
<div v-if="userDetail.accountExtendList?.Google" class="gallery_btn" @click="ungroupGoogleModel">{{ $t('frontPage.Unbind') }}</div>
|
<div v-if="userDetail.accountExtendList?.Google" class="gallery_btn" @click="ungroupGoogleModel">{{ $t('frontPage.Unbind') }}</div>
|
||||||
<!-- <div v-if="userDetail.accountExtendList?.Google" class="gallery_btn" @click="ungroupGoogleModel">{{ $t('frontPage.Unbind') }}</div> -->
|
<!-- <div v-if="userDetail.accountExtendList?.Google" class="gallery_btn" @click="ungroupGoogleModel">{{ $t('frontPage.Unbind') }}</div> -->
|
||||||
@@ -276,7 +276,7 @@ export default defineComponent({
|
|||||||
> .gallery_btn{
|
> .gallery_btn{
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
pointer-events: none;
|
|
||||||
}
|
}
|
||||||
#g_id_bind{
|
#g_id_bind{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -468,13 +468,14 @@ onMounted(async () => {
|
|||||||
// 使用window的resize事件代替ResizeObserver
|
// 使用window的resize事件代替ResizeObserver
|
||||||
// 只有当窗口大小变化时才更新画布尺寸
|
// 只有当窗口大小变化时才更新画布尺寸
|
||||||
// window.addEventListener("resize", handleWindowResize);
|
// window.addEventListener("resize", handleWindowResize);
|
||||||
|
|
||||||
if(props.config.initZoom) {
|
if(props.config.initZoom) {
|
||||||
const width = canvasManager.width;
|
const width = canvasManager.width;
|
||||||
const height = canvasManager.height;
|
const height = canvasManager.height;
|
||||||
const cwidth = props.config.width;
|
const cwidth = props.config.width;
|
||||||
const cheight = props.config.height;
|
const cheight = props.config.height;
|
||||||
setZoom(Math.min(width/cwidth,height/cheight)); // 设置画布缩放
|
let zoom = Math.min(1,width/cwidth,height/cheight);
|
||||||
|
if(zoom < 1) zoom -= 0.05;
|
||||||
|
setZoom(zoom); // 设置画布缩放
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -540,20 +541,20 @@ function handleWindowResize() {
|
|||||||
function resetZoom() {
|
function resetZoom() {
|
||||||
canvasManager.resetZoom();
|
canvasManager.resetZoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setZoom(zoom) {
|
function setZoom(zoom) {
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
if (!canvasManager) return;
|
if (!canvasManager) return;
|
||||||
const newZoom = Math.max(zoom / 1.1, 0.1); // 减少10%,最小0.1倍
|
const newZoom = Math.max(zoom, 0.1); // 减少10%,最小0.1倍
|
||||||
|
|
||||||
// 使用画布中心作为缩放点
|
// 使用画布中心作为缩放点
|
||||||
const centerPoint = {
|
const centerPoint = {
|
||||||
x: canvasManager.canvas.width / 2,
|
x: canvasManager.canvas.width / 2,
|
||||||
y: canvasManager.canvas.height / 2,
|
y: canvasManager.canvas.height / 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
canvasManager.animateZoom(centerPoint, newZoom);
|
canvasManager.animateZoom(centerPoint, newZoom);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function zoomIn() {
|
function zoomIn() {
|
||||||
if (!canvasManager) return;
|
if (!canvasManager) return;
|
||||||
|
|
||||||
|
|||||||
@@ -811,7 +811,7 @@ export class CanvasManager {
|
|||||||
* @param {Array} options.layerIdArray 导出多个图层ID数组
|
* @param {Array} options.layerIdArray 导出多个图层ID数组
|
||||||
* @param {String} options.expPicType 导出图片类型 (png/jpg/svg)
|
* @param {String} options.expPicType 导出图片类型 (png/jpg/svg)
|
||||||
* @param {Boolean} options.restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1
|
* @param {Boolean} options.restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1
|
||||||
* @param {Boolean} options.isEnhanceImg 是否是增强图片
|
* @param {Boolean} options.isEnhanceImg 是否是增强图片
|
||||||
* @returns {String} 导出的图片数据URL
|
* @returns {String} 导出的图片数据URL
|
||||||
*/
|
*/
|
||||||
async exportImage(options = {}) {
|
async exportImage(options = {}) {
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ export class ExportManager {
|
|||||||
* @param {Object} options 导出选项
|
* @param {Object} options 导出选项
|
||||||
* @param {Boolean} options.isContainBg 是否包含背景图层
|
* @param {Boolean} options.isContainBg 是否包含背景图层
|
||||||
* @param {Boolean} options.isContainFixed 是否包含固定图层
|
* @param {Boolean} options.isContainFixed 是否包含固定图层
|
||||||
* @param {Boolean} options.isCropByBg 是否使用背景大小裁剪
|
* @param {Boolean} options.isCropByBg 是否使用背景大小裁剪
|
||||||
* @param {String} options.layerId 导出具体图层ID
|
* @param {String} options.layerId 导出具体图层ID
|
||||||
* @param {Array} options.layerIdArray 导出多个图层ID数组
|
* @param {Array} options.layerIdArray 导出多个图层ID数组
|
||||||
* @param {String} options.expPicType 导出图片类型 (png/jpg/svg)
|
* @param {String} options.expPicType 导出图片类型 (png/jpg/svg)
|
||||||
* @param {Boolean} options.restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1
|
* @param {Boolean} options.restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1
|
||||||
* @param {Boolean} options.isEnhanceImg 是否是增强图片
|
* @param {Boolean} options.isEnhanceImg 是否是增强图片
|
||||||
* @returns {String} 导出的图片数据URL
|
* @returns {String} 导出的图片数据URL
|
||||||
*/
|
*/
|
||||||
exportImage(options = {}) {
|
exportImage(options = {}) {
|
||||||
@@ -48,7 +48,7 @@ export class ExportManager {
|
|||||||
isRedGreenMode,
|
isRedGreenMode,
|
||||||
restoreOpacityInRedGreen,
|
restoreOpacityInRedGreen,
|
||||||
isCropByBg,
|
isCropByBg,
|
||||||
isEnhanceImg,
|
isEnhanceImg, // 是否是增强图片
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ export class ExportManager {
|
|||||||
isRedGreenMode,
|
isRedGreenMode,
|
||||||
restoreOpacityInRedGreen,
|
restoreOpacityInRedGreen,
|
||||||
isCropByBg,
|
isCropByBg,
|
||||||
isEnhanceImg
|
isEnhanceImg, // 是否是增强图片
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ export class ExportManager {
|
|||||||
isRedGreenMode,
|
isRedGreenMode,
|
||||||
restoreOpacityInRedGreen,
|
restoreOpacityInRedGreen,
|
||||||
isCropByBg,
|
isCropByBg,
|
||||||
isEnhanceImg
|
isEnhanceImg, // 是否是增强图片
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("导出图片失败:", error);
|
console.error("导出图片失败:", error);
|
||||||
@@ -98,7 +98,7 @@ export class ExportManager {
|
|||||||
expPicType,
|
expPicType,
|
||||||
isRedGreenMode,
|
isRedGreenMode,
|
||||||
restoreOpacityInRedGreen,
|
restoreOpacityInRedGreen,
|
||||||
isCropByBg,
|
isCropByBg, // 是否使用背景大小裁剪
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
) {
|
) {
|
||||||
if (!this.layerManager) {
|
if (!this.layerManager) {
|
||||||
@@ -127,7 +127,9 @@ export class ExportManager {
|
|||||||
return this._exportWithRedGreenMode(
|
return this._exportWithRedGreenMode(
|
||||||
objectsToExport,
|
objectsToExport,
|
||||||
expPicType,
|
expPicType,
|
||||||
restoreOpacityInRedGreen
|
restoreOpacityInRedGreen,
|
||||||
|
isCropByBg, // 是否使用背景大小裁剪
|
||||||
|
isEnhanceImg, // 是否是增强图片
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +151,7 @@ export class ExportManager {
|
|||||||
* @param {Boolean} isContainFixed 是否包含固定图层
|
* @param {Boolean} isContainFixed 是否包含固定图层
|
||||||
* @param {Boolean} isRedGreenMode 是否为红绿图模式
|
* @param {Boolean} isRedGreenMode 是否为红绿图模式
|
||||||
* @param {Boolean} restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1
|
* @param {Boolean} restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1
|
||||||
* @param {Boolean} isCropByBg 是否根据背景裁剪
|
* @param {Boolean} isCropByBg 是否使用背景大小裁剪
|
||||||
* @param {Boolean} isEnhanceImg 是否是增强图片
|
* @param {Boolean} isEnhanceImg 是否是增强图片
|
||||||
* @returns {String} 图片数据URL
|
* @returns {String} 图片数据URL
|
||||||
* @private
|
* @private
|
||||||
@@ -161,7 +163,7 @@ export class ExportManager {
|
|||||||
isContainFixed,
|
isContainFixed,
|
||||||
isRedGreenMode,
|
isRedGreenMode,
|
||||||
restoreOpacityInRedGreen,
|
restoreOpacityInRedGreen,
|
||||||
isCropByBg, // 是否根据背景裁剪
|
isCropByBg, // 是否使用背景大小裁剪
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
) {
|
) {
|
||||||
if (!this.layerManager) {
|
if (!this.layerManager) {
|
||||||
@@ -194,7 +196,7 @@ export class ExportManager {
|
|||||||
objectsToExport,
|
objectsToExport,
|
||||||
expPicType,
|
expPicType,
|
||||||
restoreOpacityInRedGreen,
|
restoreOpacityInRedGreen,
|
||||||
isCropByBg, // 是否根据背景裁剪
|
isCropByBg, // 是否使用背景大小裁剪
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -206,7 +208,7 @@ export class ExportManager {
|
|||||||
* @param {Boolean} isContainFixed 是否包含固定图层
|
* @param {Boolean} isContainFixed 是否包含固定图层
|
||||||
* @param {Boolean} isRedGreenMode 是否为红绿图模式
|
* @param {Boolean} isRedGreenMode 是否为红绿图模式
|
||||||
* @param {Boolean} restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1
|
* @param {Boolean} restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1
|
||||||
* @param {Boolean} isCropByBg 是否根据背景裁剪
|
* @param {Boolean} isCropByBg 是否使用背景大小裁剪
|
||||||
* @param {Boolean} isEnhanceImg 是否是增强图片
|
* @param {Boolean} isEnhanceImg 是否是增强图片
|
||||||
* @returns {String} 图片数据URL
|
* @returns {String} 图片数据URL
|
||||||
* @private
|
* @private
|
||||||
@@ -217,8 +219,8 @@ export class ExportManager {
|
|||||||
isContainFixed,
|
isContainFixed,
|
||||||
isRedGreenMode,
|
isRedGreenMode,
|
||||||
restoreOpacityInRedGreen,
|
restoreOpacityInRedGreen,
|
||||||
isCropByBg,
|
isCropByBg, // 是否使用背景大小裁剪
|
||||||
isEnhanceImg
|
isEnhanceImg, // 是否是增强图片
|
||||||
) {
|
) {
|
||||||
// 按图层顺序收集对象(从底到顶)
|
// 按图层顺序收集对象(从底到顶)
|
||||||
const objectsToExport = this._collectObjectsByLayerOrder(
|
const objectsToExport = this._collectObjectsByLayerOrder(
|
||||||
@@ -272,7 +274,7 @@ export class ExportManager {
|
|||||||
expPicType,
|
expPicType,
|
||||||
restoreOpacityInRedGreen,
|
restoreOpacityInRedGreen,
|
||||||
canvasClipPath,
|
canvasClipPath,
|
||||||
isCropByBg, // 是否根据背景裁剪
|
isCropByBg, // 是否使用背景大小裁剪
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -635,7 +637,7 @@ export class ExportManager {
|
|||||||
objectsToExport,
|
objectsToExport,
|
||||||
expPicType,
|
expPicType,
|
||||||
restoreOpacityInRedGreen,
|
restoreOpacityInRedGreen,
|
||||||
maskObject,
|
maskObject, // 裁剪对象
|
||||||
isCropByBg, // 是否使用背景大小裁剪
|
isCropByBg, // 是否使用背景大小裁剪
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
) {
|
) {
|
||||||
@@ -656,7 +658,7 @@ export class ExportManager {
|
|||||||
trimWhitespace: true, // 裁剪空白
|
trimWhitespace: true, // 裁剪空白
|
||||||
trimPadding: 0, // 裁剪边距
|
trimPadding: 0, // 裁剪边距
|
||||||
restoreOpacityInRedGreen,
|
restoreOpacityInRedGreen,
|
||||||
isCropByBg, // 是否根据背景裁剪
|
isCropByBg, // 是否使用背景大小裁剪
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export const createRasterizedImage = async ({
|
|||||||
clippingObject,
|
clippingObject,
|
||||||
isReturenDataURL,
|
isReturenDataURL,
|
||||||
selectionManager, // 传递选区管理器
|
selectionManager, // 传递选区管理器
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ const createClippedObjects = async ({
|
|||||||
clippingObject,
|
clippingObject,
|
||||||
isReturenDataURL,
|
isReturenDataURL,
|
||||||
selectionManager = null, // 新增选区管理器参数
|
selectionManager = null, // 新增选区管理器参数
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
}) => {
|
}) => {
|
||||||
try {
|
try {
|
||||||
console.log("🎯 使用新的图像遮罩裁剪方法创建对象");
|
console.log("🎯 使用新的图像遮罩裁剪方法创建对象");
|
||||||
@@ -113,7 +113,7 @@ const createClippedObjects = async ({
|
|||||||
clippingObject,
|
clippingObject,
|
||||||
selectionBounds: optimizedBounds, // 使用优化后的边界框
|
selectionBounds: optimizedBounds, // 使用优化后的边界框
|
||||||
featherAmount,
|
featherAmount,
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ const createClippedObjects = async ({
|
|||||||
clippingObject,
|
clippingObject,
|
||||||
selectionBounds: optimizedBounds, // 使用优化后的边界框
|
selectionBounds: optimizedBounds, // 使用优化后的边界框
|
||||||
featherAmount,
|
featherAmount,
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
});
|
});
|
||||||
|
|
||||||
// 将DataURL转换为fabric.Image对象
|
// 将DataURL转换为fabric.Image对象
|
||||||
@@ -178,7 +178,7 @@ const createClippedDataURLByCanvas = async ({
|
|||||||
clippingObject,
|
clippingObject,
|
||||||
selectionBounds,
|
selectionBounds,
|
||||||
featherAmount = 0,
|
featherAmount = 0,
|
||||||
isEnhanceImg = false, // 是否是增强图片
|
isEnhanceImg = false, // 是否是增强图片
|
||||||
}) => {
|
}) => {
|
||||||
try {
|
try {
|
||||||
console.log("🖼️ 使用图像遮罩裁剪方法生成DataURL");
|
console.log("🖼️ 使用图像遮罩裁剪方法生成DataURL");
|
||||||
@@ -463,7 +463,7 @@ const createLegacyRasterization = async ({
|
|||||||
quality,
|
quality,
|
||||||
format,
|
format,
|
||||||
isReturenDataURL,
|
isReturenDataURL,
|
||||||
isCropByBg, // 是否根据背景裁剪
|
isCropByBg, // 是否根据背景裁剪
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
}) => {
|
}) => {
|
||||||
console.log("⚠️ 使用兼容的离屏渲染方法");
|
console.log("⚠️ 使用兼容的离屏渲染方法");
|
||||||
@@ -491,7 +491,7 @@ const createLegacyRasterization = async ({
|
|||||||
format,
|
format,
|
||||||
currentZoom,
|
currentZoom,
|
||||||
isReturenDataURL,
|
isReturenDataURL,
|
||||||
isCropByBg, // 是否根据背景裁剪
|
isCropByBg, // 是否根据背景裁剪
|
||||||
isEnhanceImg, // 是否是增强图片
|
isEnhanceImg, // 是否是增强图片
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -167,61 +167,64 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const showDesignDetailModal = (data:any,str:any)=>{
|
const showDesignDetailModal = (data:any,str:any)=>{
|
||||||
// let url = Https.httpUrls.getDesignDetail + `?designItemId=${77770}&designPythonOutfitId=${77423}`
|
return new Promise<void>((resolve, reject) => {
|
||||||
let url = Https.httpUrls.getDesignDetail + `?designItemId=${data.design.designItemId}&designPythonOutfitId=${data.design.designOutfitId}`
|
store.commit('DesignDetail/clearDetailData')
|
||||||
detailData.loadingShow = true
|
// let url = Https.httpUrls.getDesignDetail + `?designItemId=${77770}&designPythonOutfitId=${77423}`
|
||||||
Https.axiosGet(url).then(
|
let url = Https.httpUrls.getDesignDetail + `?designItemId=${data.design.designItemId}&designPythonOutfitId=${data.design.designOutfitId}`
|
||||||
async (rv: any) => {
|
detailData.loadingShow = true
|
||||||
store.commit('DesignDetail/setDesignDetail',rv)
|
Https.axiosGet(url).then(
|
||||||
rv.clothes.forEach((item:any)=>{
|
async (rv: any) => {
|
||||||
let a
|
store.commit('DesignDetail/setDesignDetail',rv)
|
||||||
item.designType='Library'
|
rv.clothes.forEach((item:any)=>{
|
||||||
if(item.layersObject[0].imageCategory.indexOf("back") == -1){
|
let a
|
||||||
a = item.layersObject[0]
|
item.designType='Library'
|
||||||
item.layersObject[0] = item.layersObject[1]
|
if(item.layersObject[0].imageCategory.indexOf("back") == -1){
|
||||||
item.layersObject[1] = a
|
a = item.layersObject[0]
|
||||||
}
|
item.layersObject[0] = item.layersObject[1]
|
||||||
if(item.color){
|
item.layersObject[1] = a
|
||||||
item.color.rgba = {
|
|
||||||
r:item.color.r,
|
|
||||||
g:item.color.g,
|
|
||||||
b:item.color.b,
|
|
||||||
}
|
}
|
||||||
}else{
|
if(item.color){
|
||||||
item.color = {
|
item.color.rgba = {
|
||||||
// rgba:{
|
r:item.color.r,
|
||||||
// r:undefined,
|
g:item.color.g,
|
||||||
// g:undefined,
|
b:item.color.b,
|
||||||
// b:undefined,
|
}
|
||||||
// }
|
}else{
|
||||||
|
item.color = {
|
||||||
|
// rgba:{
|
||||||
|
// r:undefined,
|
||||||
|
// g:undefined,
|
||||||
|
// b:undefined,
|
||||||
|
// }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if(item.gradient){
|
||||||
if(item.gradient){
|
item.color.gradient = item.gradient
|
||||||
item.color.gradient = item.gradient
|
|
||||||
}
|
|
||||||
if(item.printObject.prints == null)item.printObject.prints = []
|
|
||||||
item.printObject.prints.forEach((element:any) => {
|
|
||||||
if(!element.designType){
|
|
||||||
element.designType = 'Library'
|
|
||||||
}
|
}
|
||||||
});
|
if(item.printObject.prints == null)item.printObject.prints = []
|
||||||
})
|
item.printObject.prints.forEach((element:any) => {
|
||||||
detailData.singleOveral.value = rv.singleOverall
|
if(!element.designType){
|
||||||
detailData.designDetailShow = true
|
element.designType = 'Library'
|
||||||
// this.deleteShow = false
|
}
|
||||||
initialize()
|
});
|
||||||
setRevocation()
|
})
|
||||||
detailData.loadingShow = false
|
detailData.singleOveral.value = rv.singleOverall
|
||||||
if(rv.singleOverall == "single"){
|
detailData.designDetailShow = true
|
||||||
console.log(rv.clothes)
|
// this.deleteShow = false
|
||||||
store.commit('DesignDetail/setDesignColthes',rv.clothes[0].id)
|
initialize()
|
||||||
|
setRevocation()
|
||||||
|
detailData.loadingShow = false
|
||||||
|
if(rv.singleOverall == "single"){
|
||||||
|
store.commit('DesignDetail/setDesignColthes',rv.clothes[0].id)
|
||||||
|
}
|
||||||
|
resolve(rv)
|
||||||
}
|
}
|
||||||
|
).catch(rv=>{
|
||||||
|
detailData.loadingShow = false
|
||||||
|
resolve(rv)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
).catch(rv=>{
|
|
||||||
detailData.loadingShow = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const initialize = ()=>{//design后初始化
|
const initialize = ()=>{//design后初始化
|
||||||
|
|
||||||
@@ -299,7 +302,6 @@ export default defineComponent({
|
|||||||
// 0.35822305
|
// 0.35822305
|
||||||
// ]
|
// ]
|
||||||
let isCurrent = list[i].id == detailData?.selectDetail?.id
|
let isCurrent = list[i].id == detailData?.selectDetail?.id
|
||||||
console.log(isCurrent,newData)
|
|
||||||
let color = (detailData.currentDetailType == 'color' && isCurrent && !detailData.isEditPattern.value)?
|
let color = (detailData.currentDetailType == 'color' && isCurrent && !detailData.isEditPattern.value)?
|
||||||
(newData?.rgba?.r?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''):
|
(newData?.rgba?.r?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''):
|
||||||
(list[i].color?.rgba?.r?
|
(list[i].color?.rgba?.r?
|
||||||
@@ -380,6 +382,7 @@ export default defineComponent({
|
|||||||
delete detailData.designDetail.newModel
|
delete detailData.designDetail.newModel
|
||||||
store.commit('DesignDetail/setPraeview',value)
|
store.commit('DesignDetail/setPraeview',value)
|
||||||
detailData.loadingShow = false
|
detailData.loadingShow = false
|
||||||
|
canvasReload()
|
||||||
// setRevocation()
|
// setRevocation()
|
||||||
}).catch(res=>{
|
}).catch(res=>{
|
||||||
detailData.loadingShow = false
|
detailData.loadingShow = false
|
||||||
|
|||||||
@@ -257,7 +257,6 @@ export default defineComponent({
|
|||||||
detailData.isShowMark = true
|
detailData.isShowMark = true
|
||||||
}
|
}
|
||||||
const index = detailData.designDetail.clothes.findIndex(item => item.id === detailData.selectDetail.id);
|
const index = detailData.designDetail.clothes.findIndex(item => item.id === detailData.selectDetail.id);
|
||||||
console.log(index,detailData.selectDetail.id)
|
|
||||||
await new Promise<void>((resolve, reject) => {
|
await new Promise<void>((resolve, reject) => {
|
||||||
if(!detailDom?.editCanvas)return resolve()
|
if(!detailDom?.editCanvas)return resolve()
|
||||||
let canvasJSON = detailDom?.editCanvas?.getJSON()
|
let canvasJSON = detailDom?.editCanvas?.getJSON()
|
||||||
@@ -302,8 +301,7 @@ export default defineComponent({
|
|||||||
if(front?.oldImageUrl)front.imageUrl = front.oldImageUrl
|
if(front?.oldImageUrl)front.imageUrl = front.oldImageUrl
|
||||||
if(front?.oldMaskUrl)front.maskUrl = front.oldMaskUrl
|
if(front?.oldMaskUrl)front.maskUrl = front.oldMaskUrl
|
||||||
if(back?.oldImageUrl)back.imageUrl = back.oldImageUrl
|
if(back?.oldImageUrl)back.imageUrl = back.oldImageUrl
|
||||||
console.log(front)
|
if(front?.oldMaskUrl)store.commit('DesignDetail/updataDetailItem',{maskUrl:front.maskUrl})
|
||||||
if(front?.oldMaskUrl)store.commit('DesignDetail/updataDetailItem',{maskUrl:front.oldMaskUrl})
|
|
||||||
|
|
||||||
sessionStorage.removeItem('frontBackEdit');
|
sessionStorage.removeItem('frontBackEdit');
|
||||||
sessionStorage.removeItem('sketchEdit');
|
sessionStorage.removeItem('sketchEdit');
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
if(!editPrintElementData.selectDetail.printObject.prints)return
|
if(!editPrintElementData.selectDetail.printObject.prints)return
|
||||||
let state = true
|
let state = true
|
||||||
editPrintElementData.stateOverallSingle = 'single'
|
// editPrintElementData.stateOverallSingle = 'single'
|
||||||
let arr:any = editPrintElementData.selectDetail.printObject.prints
|
let arr:any = editPrintElementData.selectDetail.printObject.prints
|
||||||
if(props.type == 'element'){
|
if(props.type == 'element'){
|
||||||
arr = editPrintElementData.selectDetail.trims.prints
|
arr = editPrintElementData.selectDetail.trims.prints
|
||||||
@@ -344,7 +344,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
if(arr && arr.length > 0){
|
if(arr && arr.length > 0){
|
||||||
arr.forEach((item:any)=>{
|
arr.forEach((item:any)=>{
|
||||||
if(!item.ifSingle){
|
if(!item.ifSingle && arr.length == 1){
|
||||||
editPrintElementData.stateOverallSingle = 'overall',
|
editPrintElementData.stateOverallSingle = 'overall',
|
||||||
state = false
|
state = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,31 +71,31 @@ export default defineComponent({
|
|||||||
},{immediate:true})
|
},{immediate:true})
|
||||||
const selectDetailItem = (item:any,index:number)=>{
|
const selectDetailItem = (item:any,index:number)=>{
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
// if(detailData.isEditPattern.value &&
|
if(detailData.isEditPattern.value &&
|
||||||
// detailData.selectDetail?.id &&
|
detailData.selectDetail?.id &&
|
||||||
// detailData?.getCanvasIfEdit?.fun&&detailData?.getCanvasIfEdit?.fun() > 0
|
detailData?.getCanvasIfEdit?.fun&&detailData?.getCanvasIfEdit?.fun() > 0
|
||||||
// ){
|
){
|
||||||
// Modal.confirm({
|
Modal.confirm({
|
||||||
// title: t('collectionModal.jsContent2'),
|
title: t('collectionModal.jsContent6'),
|
||||||
// icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
// okText: 'Yes',
|
okText: 'Yes',
|
||||||
// cancelText: 'No',
|
cancelText: 'No',
|
||||||
// mask:false,
|
mask:false,
|
||||||
// centered:true,
|
centered:true,
|
||||||
// onOk() {
|
onOk() {
|
||||||
// resolve(true)
|
resolve(true)
|
||||||
// emit('canvasReload')
|
emit('canvasReload')
|
||||||
// },
|
},
|
||||||
// onCancel(){
|
onCancel(){
|
||||||
// resolve(false)
|
resolve(false)
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }else{
|
}else{
|
||||||
resolve(true)
|
resolve(true)
|
||||||
if(detailData.selectDetail.id !== item.id){
|
if(detailData.selectDetail.id !== item.id){
|
||||||
emit('canvasReload')
|
emit('canvasReload')
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
}).then((rv)=>{
|
}).then((rv)=>{
|
||||||
if(rv)store.commit('DesignDetail/setDesignColthes',item.id)
|
if(rv)store.commit('DesignDetail/setDesignColthes',item.id)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="designOpenrtion_print" v-for="item,index in frontBack.back" @mousedown.stop="itemMoveMousedown(index,getMousePosition($event,false))" @touchstart.passive="itemMoveMousedown(index,getMousePosition($event,true))" @click="setpitch(item,index)" :style="frontBack.front[index].style">
|
<div class="designOpenrtion_print" v-for="item,index in frontBack.back" @mousedown.stop="itemMoveMousedown(index,getMousePosition($event,false))" @touchstart.passive="itemMoveMousedown(index,getMousePosition($event,true))" @click="setpitch(item,index)" :style="frontBack.front[index].style">
|
||||||
<img :style="item.imageUrl?'':'display:none;'" :src="item.imageUrl" alt="">
|
<img :style="item.imageUrl?'':'display:none;'" :src="item.imageUrl" alt="">
|
||||||
</div>
|
</div>
|
||||||
<img class="perview_img" @load="setPrintSize()" ref="detailBody" :src="frontBack?.body?.path" :style="'width:'+ frontBack?.body?.layersObject?.[0].imageSize?.[0] +';height:' + frontBack?.body?.layersObject?.[0].imageSize?.[0] +';'">
|
<img class="perview_img" @load="setPrintSize()" ref="detailBody" :key="designDetail.designItemId" :src="frontBack?.body?.path" :style="'width:'+ frontBack?.body?.layersObject?.[0].imageSize?.[0] +';height:' + frontBack?.body?.layersObject?.[0].imageSize?.[0] +';'">
|
||||||
<div class="detail_modal_item_front" v-for="item,index in frontBack.front" @mousedown.stop="itemMoveMousedown(index,getMousePosition($event,false))" @touchstart.passive="itemMoveMousedown(index,getMousePosition($event,true))" @click="setpitch(item,index)" :style="item.style">
|
<div class="detail_modal_item_front" v-for="item,index in frontBack.front" @mousedown.stop="itemMoveMousedown(index,getMousePosition($event,false))" @touchstart.passive="itemMoveMousedown(index,getMousePosition($event,true))" @click="setpitch(item,index)" :style="item.style">
|
||||||
<img :src="item.imageUrl" alt="">
|
<img :src="item.imageUrl" alt="">
|
||||||
</div>
|
</div>
|
||||||
@@ -239,38 +239,41 @@ export default defineComponent({
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
const itemMoveMousedown = async (index:any,e:any)=>{
|
const itemMoveMousedown = async (index:any,e:any)=>{
|
||||||
|
if(detailData.selectDetail.id != detailData.frontBack.front[index].id)return
|
||||||
let isOpen = false
|
let isOpen = false
|
||||||
let isModal = false
|
let isModal = false
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
if(
|
// if(
|
||||||
detailData.isEditPattern.value &&
|
// detailData.isEditPattern.value &&
|
||||||
selectItem.selectDetail?.id &&
|
// selectItem.selectDetail?.id &&
|
||||||
(detailData.frontBack.front[index].id != selectItem.selectDetail.id)
|
// (detailData.frontBack.front[index].id != selectItem.selectDetail.id)
|
||||||
){
|
// ){
|
||||||
isModal = true
|
// isModal = true
|
||||||
Modal.confirm({
|
// Modal.confirm({
|
||||||
title: t('collectionModal.jsContent2'),
|
// title: t('collectionModal.jsContent2'),
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
// icon: createVNode(ExclamationCircleOutlined),
|
||||||
okText: 'Yes',
|
// okText: 'Yes',
|
||||||
cancelText: 'No',
|
// cancelText: 'No',
|
||||||
mask:false,
|
// mask:false,
|
||||||
centered:true,
|
// centered:true,
|
||||||
onOk() {
|
// onOk() {
|
||||||
resolve(true)
|
// resolve(true)
|
||||||
isOpen = true
|
// isOpen = true
|
||||||
},
|
// },
|
||||||
onCancel(){
|
// onCancel(){
|
||||||
resolve(false)
|
// resolve(false)
|
||||||
isOpen = false
|
// isOpen = false
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}else{
|
// }else{
|
||||||
if(detailData.frontBack.front[index].id != selectItem.selectDetail.id){
|
// if(detailData.frontBack.front[index].id != selectItem.selectDetail.id){
|
||||||
isOpen = true
|
// isOpen = true
|
||||||
}
|
// }
|
||||||
resolve(true)
|
// resolve(true)
|
||||||
isModal = false
|
// isModal = false
|
||||||
}
|
// }
|
||||||
|
resolve(true)
|
||||||
|
isOpen = true
|
||||||
}).then((rv)=>{
|
}).then((rv)=>{
|
||||||
})
|
})
|
||||||
if(isOpen){
|
if(isOpen){
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ export default defineComponent({
|
|||||||
title:this.selectSex,
|
title:this.selectSex,
|
||||||
surname:this.surname,
|
surname:this.surname,
|
||||||
givenName:this.givenName,
|
givenName:this.givenName,
|
||||||
userId:this.userDetail.userId,
|
userId:this.userDetail?.userId,
|
||||||
};
|
};
|
||||||
if(this.loginTime){
|
if(this.loginTime){
|
||||||
this.loginTime = false
|
this.loginTime = false
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
deleteFile(item: any) {
|
deleteFile(item: any) {
|
||||||
if(item.type_.type1 == 'generate' || item.type_.type1 == 'material'){
|
if(item?.type_?.type1 == 'generate' || item?.type_?.type1 == 'material'){
|
||||||
item.jsContent1 = this.t('uploadFile.jsContent1',{maxImg:8})
|
item.jsContent1 = this.t('uploadFile.jsContent1',{maxImg:8})
|
||||||
item.state = 'delete'
|
item.state = 'delete'
|
||||||
this.store.commit("addGenerateMaterialFils", item);
|
this.store.commit("addGenerateMaterialFils", item);
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ export default defineComponent({
|
|||||||
deleteFile(item:any){
|
deleteFile(item:any){
|
||||||
// this.fileList.splice(item, 1)
|
// this.fileList.splice(item, 1)
|
||||||
// this.store.commit('setPrintboardFile',this.fileList)
|
// this.store.commit('setPrintboardFile',this.fileList)
|
||||||
if(item.type_.type1 == 'generate' || item.type_.type1 == 'material'){
|
if(item?.type_?.type1 == 'generate' || item?.type_?.type1 == 'material'){
|
||||||
item.jsContent1 = this.t('uploadFile.jsContent1',{maxImg:16})
|
item.jsContent1 = this.t('uploadFile.jsContent1',{maxImg:16})
|
||||||
item.state = 'delete'
|
item.state = 'delete'
|
||||||
this.store.commit("addGenerateMaterialFils", item);
|
this.store.commit("addGenerateMaterialFils", item);
|
||||||
@@ -610,7 +610,6 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
this.fileList.push(data)
|
this.fileList.push(data)
|
||||||
}
|
}
|
||||||
console.log(this.fileList)
|
|
||||||
this.store.commit('setPrintboardFile',this.fileList)
|
this.store.commit('setPrintboardFile',this.fileList)
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -124,6 +124,14 @@ export default defineComponent({
|
|||||||
designType:props.item.resData.designType,
|
designType:props.item.resData.designType,
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
rv.imgUrl = rv.url
|
||||||
|
rv.category = props.item.category
|
||||||
|
rv.categoryValue = props.item.categoryValue
|
||||||
|
rv.resData = {
|
||||||
|
id:rv.id,
|
||||||
|
url:rv.url,
|
||||||
|
designType:props.item.resData.designType,
|
||||||
|
}
|
||||||
props.list.unshift(rv)
|
props.list.unshift(rv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2129,13 +2129,14 @@ export default defineComponent({
|
|||||||
type: string
|
type: string
|
||||||
) {
|
) {
|
||||||
// if()
|
// if()
|
||||||
if(this.isMove)return
|
if(this.isMove || this.isShowMark)return
|
||||||
this.store.commit('setOpenChatStatus',false)
|
this.store.commit('setOpenChatStatus',false)
|
||||||
if(design.resultType != "Design"){
|
if(design.resultType != "Design"){
|
||||||
this.selectEditBtn = design
|
this.selectEditBtn = design
|
||||||
this.setEditDesignType(collectionList,index,design.resultType,'edit',type)
|
this.setEditDesignType(collectionList,index,design.resultType,'edit',type)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.isShowMark = true
|
||||||
design.designOutfitId = design.designPythonOutfitId?design.designPythonOutfitId:design.designOutfitId
|
design.designOutfitId = design.designPythonOutfitId?design.designPythonOutfitId:design.designOutfitId
|
||||||
let data = {
|
let data = {
|
||||||
design: design,
|
design: design,
|
||||||
@@ -2146,7 +2147,9 @@ export default defineComponent({
|
|||||||
this.detailDestroy = true
|
this.detailDestroy = true
|
||||||
nextTick(()=>{
|
nextTick(()=>{
|
||||||
let designDetail: any = this.$refs.designDetail;
|
let designDetail: any = this.$refs.designDetail;
|
||||||
designDetail.showDesignDetailModal(data);
|
designDetail.showDesignDetailModal(data).then(()=>{
|
||||||
|
this.isShowMark = false
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -583,6 +583,7 @@ export default {
|
|||||||
jsContent2: "上传的文件不会保存,是否继续? ",
|
jsContent2: "上传的文件不会保存,是否继续? ",
|
||||||
jsContent3: "您必须选择一种或多种颜色进行下一步。",
|
jsContent3: "您必须选择一种或多种颜色进行下一步。",
|
||||||
jsContent5: "我们检测到您的({str})上的PIN数量超过了八个,这可能会导致一些已钉住的项目未被使用。您是否仍要继续?",
|
jsContent5: "我们检测到您的({str})上的PIN数量超过了八个,这可能会导致一些已钉住的项目未被使用。您是否仍要继续?",
|
||||||
|
jsContent6: "画布内容没有保存,请点击预保存后继续。",
|
||||||
},
|
},
|
||||||
DesignDetail: {
|
DesignDetail: {
|
||||||
Details: "详情",
|
Details: "详情",
|
||||||
|
|||||||
@@ -583,6 +583,7 @@ export default {
|
|||||||
jsContent2: "The uploaded files will not be saved, being sure to continue? ",
|
jsContent2: "The uploaded files will not be saved, being sure to continue? ",
|
||||||
jsContent3: "You must choose one or more colors for further process.",
|
jsContent3: "You must choose one or more colors for further process.",
|
||||||
jsContent5: "We've detected that the number of pins on your ({str}) exceeds eight, which may result in some pinned items not being used. Would you like to continue anyway?",
|
jsContent5: "We've detected that the number of pins on your ({str}) exceeds eight, which may result in some pinned items not being used. Would you like to continue anyway?",
|
||||||
|
jsContent6: 'The content on the canvas has not been saved. Please click "Preview" to continue.',
|
||||||
},
|
},
|
||||||
DesignDetail: {
|
DesignDetail: {
|
||||||
Details: "Details",
|
Details: "Details",
|
||||||
|
|||||||
@@ -28,7 +28,21 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
|||||||
currentPrintElement:null,
|
currentPrintElement:null,
|
||||||
},
|
},
|
||||||
mutations:{
|
mutations:{
|
||||||
|
clearDetailData(state){
|
||||||
|
state.designDetail = null
|
||||||
|
state.designPreviewData = {}
|
||||||
|
state.frontBack = {
|
||||||
|
front:[],
|
||||||
|
back:[],
|
||||||
|
body:{},
|
||||||
|
}
|
||||||
|
state.selectDetail = null
|
||||||
|
state.printZIndex = -1
|
||||||
|
state.currentDetailType = ''
|
||||||
|
state.currentPrintElement = null
|
||||||
|
},
|
||||||
setDesignDetail(state,data){
|
setDesignDetail(state,data){
|
||||||
|
console.log(data)
|
||||||
if(data.others.length > 0 && data.others[0].type == "Body"){
|
if(data.others.length > 0 && data.others[0].type == "Body"){
|
||||||
state.frontBack.body = data.others[0]
|
state.frontBack.body = data.others[0]
|
||||||
}
|
}
|
||||||
@@ -255,7 +269,7 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
|||||||
})
|
})
|
||||||
if(state.currentDetailType != 'models'){
|
if(state.currentDetailType != 'models'){
|
||||||
state.selectDetail.change = item.change
|
state.selectDetail.change = item.change
|
||||||
if(state.selectDetail?.newDetail?.color){
|
if(state.selectDetail?.newDetail?.color && currentType != 'color'){
|
||||||
state.selectDetail.color = state.selectDetail?.newDetail?.color
|
state.selectDetail.color = state.selectDetail?.newDetail?.color
|
||||||
state.selectDetail.newDetail.color = null
|
state.selectDetail.newDetail.color = null
|
||||||
}
|
}
|
||||||
@@ -272,12 +286,20 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
|||||||
state.selectDetail.printObject = item.printObject
|
state.selectDetail.printObject = item.printObject
|
||||||
state.selectDetail.trims = item.trims
|
state.selectDetail.trims = item.trims
|
||||||
state.selectDetail.type = item.type
|
state.selectDetail.type = item.type
|
||||||
|
state.selectDetail.color = {
|
||||||
|
...item.color,
|
||||||
|
rgba:{
|
||||||
|
r:item.color?.r,
|
||||||
|
g:item.color?.g,
|
||||||
|
b:item.color?.b,
|
||||||
|
}
|
||||||
|
}
|
||||||
state.selectDetail.undividedLayer = item.undividedLayer
|
state.selectDetail.undividedLayer = item.undividedLayer
|
||||||
if(state.selectDetail.newDetail?.sketch?.id && !state.selectDetail.id){
|
if(state.selectDetail.newDetail?.sketch?.id && !state.selectDetail.id){
|
||||||
state.designDetail.clothes.push(state.selectDetail)
|
state.designDetail.clothes.push(state.selectDetail)
|
||||||
}
|
}
|
||||||
state.selectDetail.id = item.id
|
state.selectDetail.id = item.id
|
||||||
if(currentType)if(state.selectDetail.newDetail?.[currentType])delete state.selectDetail.newDetail[currentType]
|
if(currentType)if(state.selectDetail.newDetail?.[currentType] && currentType != 'color')delete state.selectDetail.newDetail[currentType]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(value.fun)value.fun()
|
if(value.fun)value.fun()
|
||||||
|
|||||||
@@ -38,20 +38,6 @@ const CancelToken = axios.CancelToken;
|
|||||||
const source = CancelToken.source();
|
const source = CancelToken.source();
|
||||||
// console.log(import.meta.env.VITE_APP_BASE_URL);
|
// console.log(import.meta.env.VITE_APP_BASE_URL);
|
||||||
let isLoginTime = false
|
let isLoginTime = false
|
||||||
const filterHttpsUrl = [
|
|
||||||
// '/api/portfolio/page',
|
|
||||||
'/api/third/party/parseGoogleCredential',
|
|
||||||
'/api/account/resetPwd',
|
|
||||||
'/api/portfolio/detail',
|
|
||||||
'/api/account/preLogin',
|
|
||||||
'/api/account/designWorksRegister',
|
|
||||||
'/api/account/schoolLogin',
|
|
||||||
'/api/account/enterpriseLogin',
|
|
||||||
'/api/account/login',
|
|
||||||
'/api/account/organizationNameSearch',
|
|
||||||
'/api/account/designWorksRegisterCode',
|
|
||||||
'/api/third/party/parseWeChatCode',
|
|
||||||
'/api/account/sendEmail']
|
|
||||||
//POST传参序列化(添加请求拦截器)
|
//POST传参序列化(添加请求拦截器)
|
||||||
axios.interceptors.request.use((config) => {
|
axios.interceptors.request.use((config) => {
|
||||||
//在发送请求之前做某件事
|
//在发送请求之前做某件事
|
||||||
@@ -64,23 +50,7 @@ axios.interceptors.request.use((config) => {
|
|||||||
// config.data = JSON.stringify(config.data);
|
// config.data = JSON.stringify(config.data);
|
||||||
}
|
}
|
||||||
// config.headers.Authorization = 'Bearer-eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyIiwic3ViIjoie1wiaWRcIjoyLFwidXNlcm5hbWVcIjpcImxpcnNcIn0iLCJpYXQiOjE2NjU3NDEwODcsImlzcyI6IkRXSiIsImF1dGhvcml0aWVzIjoiW10iLCJleHAiOjE2NzQzODEwODd9.ShM9R_NNFD7oo1OvxrEgg7PFeWinOuAKkuInUCMQupp66s64Hhv8tN0Wwr83nIN4rHPqtn95wmd4msWcvaFYJA';
|
// config.headers.Authorization = 'Bearer-eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyIiwic3ViIjoie1wiaWRcIjoyLFwidXNlcm5hbWVcIjpcImxpcnNcIn0iLCJpYXQiOjE2NjU3NDEwODcsImlzcyI6IkRXSiIsImF1dGhvcml0aWVzIjoiW10iLCJleHAiOjE2NzQzODEwODd9.ShM9R_NNFD7oo1OvxrEgg7PFeWinOuAKkuInUCMQupp66s64Hhv8tN0Wwr83nIN4rHPqtn95wmd4msWcvaFYJA';
|
||||||
if(filterHttpsUrl.indexOf(config.url) == -1){
|
config.headers.Authorization = getCookie('token');
|
||||||
if (!getCookie('token')) {
|
|
||||||
console.log('无Token,取消请求');
|
|
||||||
if(!isLoginTime){
|
|
||||||
isLoginTime = true
|
|
||||||
router.replace('/')
|
|
||||||
message.warning('Please login and try again~')
|
|
||||||
setTimeout(()=>[
|
|
||||||
isLoginTime = false
|
|
||||||
],2000)
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error('缺少Token,请求被拦截')); // 阻止请求
|
|
||||||
}
|
|
||||||
config.headers.Authorization = getCookie('token');
|
|
||||||
}else{
|
|
||||||
config.headers.Authorization = '';
|
|
||||||
}
|
|
||||||
return config;
|
return config;
|
||||||
},(error) =>{
|
},(error) =>{
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
|
|||||||
@@ -403,12 +403,10 @@ export default defineComponent({
|
|||||||
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]]
|
||||||
}
|
}
|
||||||
console.log('homeMainData.openType',homeMainData.openType,'route.path',route.path)
|
if((query?.id || query?.history) && !await getIdExistToHistory()){
|
||||||
if (homeMainData.openType == 'history' && route.path !== '/home/history') {
|
router.push('/home')
|
||||||
homeMainData.openType = ''
|
return
|
||||||
homeMainData.openTypeChild = ''
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
homeMainData.openType = ''
|
homeMainData.openType = ''
|
||||||
homeMainData.openTypeChild = ''
|
homeMainData.openTypeChild = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user