diff --git a/components.d.ts b/components.d.ts index 1c57248a..cec5253a 100644 --- a/components.d.ts +++ b/components.d.ts @@ -9,14 +9,11 @@ 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'] - ADatePicker: typeof import('ant-design-vue/es')['DatePicker'] + AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider'] ADrawer: typeof import('ant-design-vue/es')['Drawer'] AImage: typeof import('ant-design-vue/es')['Image'] AInputNumber: typeof import('ant-design-vue/es')['InputNumber'] - AMenu: typeof import('ant-design-vue/es')['Menu'] - AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] AModal: typeof import('ant-design-vue/es')['Modal'] APagination: typeof import('ant-design-vue/es')['Pagination'] APopover: typeof import('ant-design-vue/es')['Popover'] @@ -24,16 +21,17 @@ 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'] - ATimeRangePicker: typeof import('ant-design-vue/es')['TimeRangePicker'] AUpload: typeof import('ant-design-vue/es')['Upload'] ElCascader: typeof import('element-plus/es')['ElCascader'] + ElLoading: typeof import('element-plus/es')['ElLoading'] + ElPagination: typeof import('element-plus/es')['ElPagination'] + ElTable: typeof import('element-plus/es')['ElTable'] + ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] } diff --git a/public/image/brush/PencilBrush-2.jpg b/public/image/brush/PencilBrush-2.jpg deleted file mode 100644 index 4ae64cd3..00000000 Binary files a/public/image/brush/PencilBrush-2.jpg and /dev/null differ diff --git a/public/image/brush/CrayonBrush.jpg b/public/image/brush/crayon.jpg similarity index 100% rename from public/image/brush/CrayonBrush.jpg rename to public/image/brush/crayon.jpg diff --git a/public/image/brush/fur.jpg b/public/image/brush/fur.jpg new file mode 100644 index 00000000..6c4563c9 Binary files /dev/null and b/public/image/brush/fur.jpg differ diff --git a/public/image/brush/InkBrush.jpg b/public/image/brush/ink.jpg similarity index 100% rename from public/image/brush/InkBrush.jpg rename to public/image/brush/ink.jpg diff --git a/public/image/brush/LongfurBrush.jpg b/public/image/brush/longFur.jpg similarity index 100% rename from public/image/brush/LongfurBrush.jpg rename to public/image/brush/longFur.jpg diff --git a/public/image/brush/MarkerBrush.jpg b/public/image/brush/marker.jpg similarity index 100% rename from public/image/brush/MarkerBrush.jpg rename to public/image/brush/marker.jpg diff --git a/public/image/brush/pen.jpg b/public/image/brush/pen.jpg new file mode 100644 index 00000000..450979ad Binary files /dev/null and b/public/image/brush/pen.jpg differ diff --git a/public/image/brush/PencilBrush.jpg b/public/image/brush/pencil.jpg similarity index 100% rename from public/image/brush/PencilBrush.jpg rename to public/image/brush/pencil.jpg diff --git a/public/image/brush/RibbonBrush.jpg b/public/image/brush/ribbon.jpg similarity index 100% rename from public/image/brush/RibbonBrush.jpg rename to public/image/brush/ribbon.jpg diff --git a/public/image/brush/shaded.jpg b/public/image/brush/shaded.jpg new file mode 100644 index 00000000..a60d35c0 Binary files /dev/null and b/public/image/brush/shaded.jpg differ diff --git a/public/image/brush/spray.jpg b/public/image/brush/spray.jpg new file mode 100644 index 00000000..a4ecd7e5 Binary files /dev/null and b/public/image/brush/spray.jpg differ diff --git a/public/image/brush/imgBrush.webp b/public/image/brush/texture.jpg similarity index 100% rename from public/image/brush/imgBrush.webp rename to public/image/brush/texture.jpg diff --git a/public/image/brush/WritingBrush.jpg b/public/image/brush/writing.jpg similarity index 100% rename from public/image/brush/WritingBrush.jpg rename to public/image/brush/writing.jpg diff --git a/src/component/Canvas/CanvasEditor/components/BrushPanel.vue b/src/component/Canvas/CanvasEditor/components/BrushPanel.vue index 0688d390..f78e5935 100644 --- a/src/component/Canvas/CanvasEditor/components/BrushPanel.vue +++ b/src/component/Canvas/CanvasEditor/components/BrushPanel.vue @@ -14,7 +14,8 @@ @click="setBrushTypeWithCommand(brush.id)" :class="['brush-type-item', { active: brushStore.state.type === brush.id }]" > -
+ + {{ brush.name }} @@ -886,6 +887,7 @@ onMounted(() => { const availableBrushes = toolManager.brushManager .getBrushTypes() ?.filter((brush) => brush.id !== "eraser"); + console.log(availableBrushes) BrushStore.setAvailableBrushes(availableBrushes); } }); @@ -1178,6 +1180,8 @@ const brushStore = BrushStore; margin-bottom: 8px; border-radius: 4px; background-color: rgba(0, 0, 0, 0.02); + object-fit: contain; + background-color: #fff; } /* 保持笔刷预览内容样式一致 */ diff --git a/src/component/Canvas/CanvasEditor/index.vue b/src/component/Canvas/CanvasEditor/index.vue index f72cee5a..7715ed39 100644 --- a/src/component/Canvas/CanvasEditor/index.vue +++ b/src/component/Canvas/CanvasEditor/index.vue @@ -340,7 +340,7 @@ onMounted(async () => { props.redGreenImageUrl ) { canvasManager.canvas.fill = "#fff"; // 设置画布背景色为白色 // 初始化红绿图模式管理器 - redGreenModeManager = new RedGreenModeManager({ + redGreenModeManager = new toolManagerRedGreenModeManager({ canvas: canvasManager.canvas, canvasManager, layerManager, diff --git a/src/component/Canvas/CanvasEditor/managers/brushes/brushManager.js b/src/component/Canvas/CanvasEditor/managers/brushes/brushManager.js index 051659ab..15ae7463 100644 --- a/src/component/Canvas/CanvasEditor/managers/brushes/brushManager.js +++ b/src/component/Canvas/CanvasEditor/managers/brushes/brushManager.js @@ -65,6 +65,7 @@ export class BrushManager { description: "基础铅笔工具,适合精细线条绘制", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/pencil.jpg', }); // 注册材质笔刷 @@ -73,6 +74,7 @@ export class BrushManager { description: "使用纹理图片作为笔刷,支持缩放和透明度", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/texture.jpg', }); // 注册集成的笔刷类型 @@ -81,54 +83,63 @@ export class BrushManager { description: "使用纹理图片作为笔刷,支持缩放和透明度", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/crayon.jpg', }); brushRegistry.register("fur", FurBrush, { name: this.t("Canvas.Fur"), description: "使用纹理图片作为笔刷,支持缩放和透明度", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/fur.jpg', }); brushRegistry.register("ink", InkBrush, { name: this.t("Canvas.Ink"), description: "墨水笔刷,适合书写和绘图", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/ink.jpg', }); brushRegistry.register("", LongfurBrush, { name: this.t("Canvas.Longfur"), description: "长毛发笔刷,适合绘制动物毛皮、草或头发", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/longFur.jpg', }); brushRegistry.register("writing", WritingBrush, { name: this.t("Canvas.Writing"), description: "书法笔刷,模拟中国传统书法毛笔效果,具有笔锋和墨色变化", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/writing.jpg', }); brushRegistry.register("marker", MarkerBrush, { name: this.t("Canvas.Marker"), description: "马克笔笔刷,适合粗线条和填充", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/marker.jpg', }); brushRegistry.register("pen", CustomPenBrush, { name: this.t("Canvas.Pen"), description: "自定义钢笔笔刷,适合书写和绘图", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/pen.jpg', }); brushRegistry.register("ribbon", RibbonBrush, { name: this.t("Canvas.Ribbon"), description: "丝带笔刷,适合创建流动的丝带效果", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/ribbon.jpg', }); brushRegistry.register("shaded", ShadedBrush, { name: this.t("Canvas.Shaded"), description: "阴影笔刷,适合创建渐变和阴影效果", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/shaded.jpg', }); brushRegistry.register("spray", SprayBrush, { @@ -136,6 +147,7 @@ export class BrushManager { description: "模拟喷枪效果,创建散点效果", t:this.t, category: this.t('Canvas.BasicBrushes'), + imgUrl:'./image/brush/spray.jpg', }); // brushRegistry.register("sketchy", SketchyBrush); @@ -365,6 +377,7 @@ export class BrushManager { description: brushInfo.metadata.description || "", category: brushInfo.metadata.category || "默认", icon: brushInfo.metadata.icon || null, + imgUrl: brushInfo.metadata.imgUrl || null, })); } diff --git a/src/component/Detail/DesignDetail.vue b/src/component/Detail/DesignDetail.vue index 1845a748..7f480dd0 100644 --- a/src/component/Detail/DesignDetail.vue +++ b/src/component/Detail/DesignDetail.vue @@ -302,14 +302,15 @@ export default defineComponent({ if(detailData.currentDetailType == 'sketch' && newData){ 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}`:'' } + console.log(list[i]) let data:any = { changed:false, color, designType:(newData && detailData.currentDetailType == 'sketch' && isCurrent)?newData.designType:list[i].designType, id:(newData && detailData.currentDetailType == 'sketch' && isCurrent)?newData.id:list[i].id, - maskMinioUrl:list[i]?.maskMinioUrl, + maskMinioUrl:(newData && detailData.currentDetailType == 'sketch')?'':list[i]?.maskMinioUrl, // maskUrl:'', - maskUrl:list[i].maskUrl, + maskUrl:(newData && detailData.currentDetailType == 'sketch')?'':list[i]?.maskUrl, // offset:[ // -233.13985, // 406.90964 diff --git a/src/component/Detail/canvas/index.vue b/src/component/Detail/canvas/index.vue index bed54f63..b4fa1534 100644 --- a/src/component/Detail/canvas/index.vue +++ b/src/component/Detail/canvas/index.vue @@ -190,7 +190,7 @@ export default defineComponent({ }) } const frontBackChange = (value:any)=>{ - let full = detailData.frontBack.front[detailData.imgDomIndex].undividedLayer || detailData.frontBack.front[detailData.imgDomIndex].imageUrl + let full = detailData.frontBack.front[detailData.imgDomIndex].undividedLayer || detailData.selectDetail.path let size = { ...detailData.canvasConfig, } diff --git a/src/component/Detail/detailLeft/module/currentList.vue b/src/component/Detail/detailLeft/module/currentList.vue index 4684d870..95143250 100644 --- a/src/component/Detail/detailLeft/module/currentList.vue +++ b/src/component/Detail/detailLeft/module/currentList.vue @@ -56,11 +56,13 @@ export default defineComponent({ }) const selectImgItem = (file:any)=>{ if(props.type != 'models'){ - if(!file.resData.minIOPath){ - file.minIOPath = getMinioUrl(file.imgUrl || file.resData.url) + if(!file.resData?.minIOPath){ + file.minIOPath = getMinioUrl(file?.imgUrl || file?.resData?.url) + }else{ + file.minIOPath = file.resData.minIOPath } if(!file.designType){ - file.designType = file.resData.designType + file.designType = file?.resData?.designType } } // store.commit('DesignDetail/setNewDetail',file.resData) diff --git a/src/component/Detail/detailLeft/sketch.vue b/src/component/Detail/detailLeft/sketch.vue index 8ecd33e9..a637ca17 100644 --- a/src/component/Detail/detailLeft/sketch.vue +++ b/src/component/Detail/detailLeft/sketch.vue @@ -76,10 +76,10 @@ export default defineComponent({ selectImgItem(data) return } - data.id = id if(data?.imgUrl)data.url = data.imgUrl let value = { data, + id, } if(detailData.currentDetailType == 'sketch'){ detailData.selectDetail.sketchString = '' diff --git a/src/component/Detail/detailRight/editPrintElement.vue b/src/component/Detail/detailRight/editPrintElement.vue index 8d445c33..6ee603d6 100644 --- a/src/component/Detail/detailRight/editPrintElement.vue +++ b/src/component/Detail/detailRight/editPrintElement.vue @@ -1,6 +1,6 @@