diff --git a/components.d.ts b/components.d.ts index 27d9abac..fb059677 100644 --- a/components.d.ts +++ b/components.d.ts @@ -9,8 +9,10 @@ export {} declare module 'vue' { export interface GlobalComponents { ABadge: typeof import('ant-design-vue/es')['Badge'] + ABreadcrumb: typeof import('ant-design-vue/es')['Breadcrumb'] ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider'] + ADatePicker: typeof import('ant-design-vue/es')['DatePicker'] ADrawer: typeof import('ant-design-vue/es')['Drawer'] ADropdown: typeof import('ant-design-vue/es')['Dropdown'] AImage: typeof import('ant-design-vue/es')['Image'] @@ -24,9 +26,13 @@ declare module 'vue' { ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASlider: typeof import('ant-design-vue/es')['Slider'] + ASpace: typeof import('ant-design-vue/es')['Space'] ASpin: typeof import('ant-design-vue/es')['Spin'] + ASubMenu: typeof import('ant-design-vue/es')['SubMenu'] ASwitch: typeof import('ant-design-vue/es')['Switch'] 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'] ElCascader: typeof import('element-plus/es')['ElCascader'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/src/component/Detail/DesignDetail.vue b/src/component/Detail/DesignDetail.vue index 4c18d58e..a91eb2e8 100644 --- a/src/component/Detail/DesignDetail.vue +++ b/src/component/Detail/DesignDetail.vue @@ -299,7 +299,6 @@ export default defineComponent({ // 0.35822305 // ] let isCurrent = list[i].id == detailData?.selectDetail?.id - console.log(isCurrent,newData) let color = (detailData.currentDetailType == 'color' && isCurrent && !detailData.isEditPattern.value)? (newData?.rgba?.r?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''): (list[i].color?.rgba?.r? @@ -380,6 +379,7 @@ export default defineComponent({ delete detailData.designDetail.newModel store.commit('DesignDetail/setPraeview',value) detailData.loadingShow = false + canvasReload() // setRevocation() }).catch(res=>{ detailData.loadingShow = false diff --git a/src/component/Detail/canvas/index.vue b/src/component/Detail/canvas/index.vue index 44cc1bbc..8a09142e 100644 --- a/src/component/Detail/canvas/index.vue +++ b/src/component/Detail/canvas/index.vue @@ -255,7 +255,6 @@ export default defineComponent({ detailData.isShowMark = true } const index = detailData.designDetail.clothes.findIndex(item => item.id === detailData.selectDetail.id); - console.log(index,detailData.selectDetail.id) await new Promise((resolve, reject) => { if(!detailDom?.editCanvas)return resolve() let canvasJSON = detailDom?.editCanvas?.getJSON() @@ -299,8 +298,7 @@ export default defineComponent({ if(front?.oldImageUrl)front.imageUrl = front.oldImageUrl if(front?.oldMaskUrl)front.maskUrl = front.oldMaskUrl if(back?.oldImageUrl)back.imageUrl = back.oldImageUrl - console.log(front) - if(front?.oldMaskUrl)store.commit('DesignDetail/updataDetailItem',{maskUrl:front.oldMaskUrl}) + if(front?.oldMaskUrl)store.commit('DesignDetail/updataDetailItem',{maskUrl:front.maskUrl}) sessionStorage.removeItem('frontBackEdit'); sessionStorage.removeItem('sketchEdit'); diff --git a/src/component/Detail/detailRight/editPrintElement.vue b/src/component/Detail/detailRight/editPrintElement.vue index 23ffa117..3f776923 100644 --- a/src/component/Detail/detailRight/editPrintElement.vue +++ b/src/component/Detail/detailRight/editPrintElement.vue @@ -334,7 +334,7 @@ export default defineComponent({ } if(!editPrintElementData.selectDetail.printObject.prints)return let state = true - editPrintElementData.stateOverallSingle = 'single' + // editPrintElementData.stateOverallSingle = 'single' let arr:any = editPrintElementData.selectDetail.printObject.prints if(props.type == 'element'){ arr = editPrintElementData.selectDetail.trims.prints @@ -344,7 +344,7 @@ export default defineComponent({ } if(arr && arr.length > 0){ arr.forEach((item:any)=>{ - if(!item.ifSingle){ + if(!item.ifSingle && arr.length == 1){ editPrintElementData.stateOverallSingle = 'overall', state = false } diff --git a/src/component/Detail/model/modelNav.vue b/src/component/Detail/model/modelNav.vue index 4c565ffe..3e924ebf 100644 --- a/src/component/Detail/model/modelNav.vue +++ b/src/component/Detail/model/modelNav.vue @@ -71,31 +71,31 @@ export default defineComponent({ },{immediate:true}) const selectDetailItem = (item:any,index:number)=>{ new Promise((resolve, reject) => { - // if(detailData.isEditPattern.value && - // detailData.selectDetail?.id && - // detailData?.getCanvasIfEdit?.fun&&detailData?.getCanvasIfEdit?.fun() > 0 - // ){ - // Modal.confirm({ - // title: t('collectionModal.jsContent2'), - // icon: createVNode(ExclamationCircleOutlined), - // okText: 'Yes', - // cancelText: 'No', - // mask:false, - // centered:true, - // onOk() { - // resolve(true) - // emit('canvasReload') - // }, - // onCancel(){ - // resolve(false) - // } - // }); - // }else{ + if(detailData.isEditPattern.value && + detailData.selectDetail?.id && + detailData?.getCanvasIfEdit?.fun&&detailData?.getCanvasIfEdit?.fun() > 0 + ){ + Modal.confirm({ + title: t('collectionModal.jsContent6'), + icon: createVNode(ExclamationCircleOutlined), + okText: 'Yes', + cancelText: 'No', + mask:false, + centered:true, + onOk() { + resolve(true) + emit('canvasReload') + }, + onCancel(){ + resolve(false) + } + }); + }else{ resolve(true) if(detailData.selectDetail.id !== item.id){ emit('canvasReload') } - // } + } }).then((rv)=>{ if(rv)store.commit('DesignDetail/setDesignColthes',item.id) }) diff --git a/src/component/Detail/model/modelPosition.vue b/src/component/Detail/model/modelPosition.vue index e57e5df3..7f69a63b 100644 --- a/src/component/Detail/model/modelPosition.vue +++ b/src/component/Detail/model/modelPosition.vue @@ -239,38 +239,41 @@ export default defineComponent({ // } } const itemMoveMousedown = async (index:any,e:any)=>{ + if(detailData.selectDetail.id != detailData.frontBack.front[index].id)return let isOpen = false let isModal = false await new Promise((resolve, reject) => { - if( - detailData.isEditPattern.value && - selectItem.selectDetail?.id && - (detailData.frontBack.front[index].id != selectItem.selectDetail.id) - ){ - isModal = true - Modal.confirm({ - title: t('collectionModal.jsContent2'), - icon: createVNode(ExclamationCircleOutlined), - okText: 'Yes', - cancelText: 'No', - mask:false, - centered:true, - onOk() { - resolve(true) - isOpen = true - }, - onCancel(){ - resolve(false) - isOpen = false - } - }); - }else{ - if(detailData.frontBack.front[index].id != selectItem.selectDetail.id){ - isOpen = true - } - resolve(true) - isModal = false - } + // if( + // detailData.isEditPattern.value && + // selectItem.selectDetail?.id && + // (detailData.frontBack.front[index].id != selectItem.selectDetail.id) + // ){ + // isModal = true + // Modal.confirm({ + // title: t('collectionModal.jsContent2'), + // icon: createVNode(ExclamationCircleOutlined), + // okText: 'Yes', + // cancelText: 'No', + // mask:false, + // centered:true, + // onOk() { + // resolve(true) + // isOpen = true + // }, + // onCancel(){ + // resolve(false) + // isOpen = false + // } + // }); + // }else{ + // if(detailData.frontBack.front[index].id != selectItem.selectDetail.id){ + // isOpen = true + // } + // resolve(true) + // isModal = false + // } + resolve(true) + isOpen = true }).then((rv)=>{ }) if(isOpen){ diff --git a/src/component/HomePage/bindEmail.vue b/src/component/HomePage/bindEmail.vue index 7ffd5464..409e5fe6 100644 --- a/src/component/HomePage/bindEmail.vue +++ b/src/component/HomePage/bindEmail.vue @@ -365,7 +365,7 @@ export default defineComponent({ title:this.selectSex, surname:this.surname, givenName:this.givenName, - userId:this.userDetail.userId, + userId:this.userDetail?.userId, }; if(this.loginTime){ this.loginTime = false diff --git a/src/lang/cn.ts b/src/lang/cn.ts index 16463cb9..28913e24 100644 --- a/src/lang/cn.ts +++ b/src/lang/cn.ts @@ -583,6 +583,7 @@ export default { jsContent2: "上传的文件不会保存,是否继续? ", jsContent3: "您必须选择一种或多种颜色进行下一步。", jsContent5: "我们检测到您的({str})上的PIN数量超过了八个,这可能会导致一些已钉住的项目未被使用。您是否仍要继续?", + jsContent6: "画布内容没有保存,请点击预保存后继续。", }, DesignDetail: { Details: "详情", diff --git a/src/lang/en.ts b/src/lang/en.ts index 720d4f63..3d374a36 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -583,6 +583,7 @@ export default { jsContent2: "The uploaded files will not be saved, being sure to continue? ", 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?", + jsContent6: 'The content on the canvas has not been saved. Please click "Preview" to continue.', }, DesignDetail: { Details: "Details", diff --git a/src/store/Detail/designDetail.ts b/src/store/Detail/designDetail.ts index 23f7b844..2cad4b89 100644 --- a/src/store/Detail/designDetail.ts +++ b/src/store/Detail/designDetail.ts @@ -74,6 +74,7 @@ const DesignDetail : Module = { state.frontBack.back = back }, updataDetailItem(state,data){ + console.log(data) state.designDetail.clothes.forEach((item:any) => { if(item.id == state.selectDetail.id){ for (const key in data) { @@ -255,7 +256,7 @@ const DesignDetail : Module = { }) if(state.currentDetailType != 'models'){ 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.newDetail.color = null } @@ -272,12 +273,20 @@ const DesignDetail : Module = { state.selectDetail.printObject = item.printObject state.selectDetail.trims = item.trims 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 if(state.selectDetail.newDetail?.sketch?.id && !state.selectDetail.id){ state.designDetail.clothes.push(state.selectDetail) } 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() diff --git a/src/tool/https.js b/src/tool/https.js index e9844967..c74f825a 100644 --- a/src/tool/https.js +++ b/src/tool/https.js @@ -38,20 +38,6 @@ const CancelToken = axios.CancelToken; const source = CancelToken.source(); // console.log(import.meta.env.VITE_APP_BASE_URL); 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传参序列化(添加请求拦截器) axios.interceptors.request.use((config) => { //在发送请求之前做某件事 @@ -64,23 +50,7 @@ axios.interceptors.request.use((config) => { // config.data = JSON.stringify(config.data); } // config.headers.Authorization = 'Bearer-eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyIiwic3ViIjoie1wiaWRcIjoyLFwidXNlcm5hbWVcIjpcImxpcnNcIn0iLCJpYXQiOjE2NjU3NDEwODcsImlzcyI6IkRXSiIsImF1dGhvcml0aWVzIjoiW10iLCJleHAiOjE2NzQzODEwODd9.ShM9R_NNFD7oo1OvxrEgg7PFeWinOuAKkuInUCMQupp66s64Hhv8tN0Wwr83nIN4rHPqtn95wmd4msWcvaFYJA'; - if(filterHttpsUrl.indexOf(config.url) == -1){ - 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 = ''; - } + config.headers.Authorization = getCookie('token'); return config; },(error) =>{ return Promise.reject(error); diff --git a/src/views/HomeMain.vue b/src/views/HomeMain.vue index 28fe6c47..ca3e155f 100644 --- a/src/views/HomeMain.vue +++ b/src/views/HomeMain.vue @@ -403,12 +403,10 @@ export default defineComponent({ homeMainData.openType = Object.keys(query)[0] homeMainData.openTypeChild = query[Object.keys(query)[0]] } - console.log('homeMainData.openType',homeMainData.openType,'route.path',route.path) - if (homeMainData.openType == 'history' && route.path !== '/home/history') { - homeMainData.openType = '' - homeMainData.openTypeChild = '' + if((query?.id || query?.history) && !await getIdExistToHistory()){ + router.push('/home') + return } - }else{ homeMainData.openType = '' homeMainData.openTypeChild = ''