This commit is contained in:
X1627315083
2025-09-18 10:39:35 +08:00
parent a151b712ca
commit fc8a62c9fb
3 changed files with 23 additions and 21 deletions

6
components.d.ts vendored
View File

@@ -24,14 +24,8 @@ declare module 'vue' {
ASpin: typeof import('ant-design-vue/es')['Spin'] ASpin: typeof import('ant-design-vue/es')['Spin']
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']
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'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
} }

View File

@@ -327,22 +327,24 @@ const handleToolClick = (tool) => {
@change="fillColorChange" @change="fillColorChange"
style="width: 0; height: 0; opacity: 0" style="width: 0; height: 0; opacity: 0"
/> />
<div class="tools-list">
<slot name="customToolsTop" :tool-button-props="{ activeTool, canUndo, canRedo }" /> <slot name="customToolsTop" :tool-button-props="{ activeTool, canUndo, canRedo }" />
<ToolButton <ToolButton
v-for="tool in toolsList" v-for="tool in toolsList"
:key="tool.id" :key="tool.id"
:tool="tool" :tool="tool"
:active-tool="activeTool" :active-tool="activeTool"
:can-undo="canUndo" :can-undo="canUndo"
:can-redo="canRedo" :can-redo="canRedo"
@click="handleToolClick" @click="handleToolClick"
/> />
<!-- 自定义工具栏按钮插槽 -->
<slot name="customToolsBottom" :tool-button-props="{ activeTool, canUndo, canRedo }" />
</div>
<!-- 自定义工具栏按钮插槽 -->
<slot name="customToolsBottom" :tool-button-props="{ activeTool, canUndo, canRedo }" />
</div> </div>
</template> </template>
@@ -350,17 +352,22 @@ const handleToolClick = (tool) => {
.tools-sidebar { .tools-sidebar {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.0rem;
padding: 1.5rem 1.0rem; padding: 1.5rem 1.0rem;
border-right: .1rem solid #e0e0e0; border-right: .1rem solid #e0e0e0;
background-color: #ffffff; background-color: #ffffff;
user-select: none; user-select: none;
min-width: 5.8rem; min-width: 5.8rem;
height: 100%; height: 100%;
padding-top: .5rem;
/* overflow-y: auto; */ /* overflow-y: auto; */
/* overflow-x: hidden; */ /* overflow-x: hidden; */
} }
.tools-list{
display: flex;
flex-direction: column;
gap: 1.0rem;
flex: 1;
}
.red-green-mode { .red-green-mode {
background-color: #fff4f4; background-color: #fff4f4;
} }

View File

@@ -806,6 +806,7 @@ const changeCanvas = async (command) => {
setTimeout(async ()=>{ setTimeout(async ()=>{
const imageData = await canvasManager.exportImage({ const imageData = await canvasManager.exportImage({
restoreOpacityInRedGreen: true, // 恢复红绿图模式下的透明度 restoreOpacityInRedGreen: true, // 恢复红绿图模式下的透明度
isCropByBg:true,
}); });
emit("trigger-red-green-mouseup", imageData); emit("trigger-red-green-mouseup", imageData);
},100) },100)