调整canvas笔触样式改为图片
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
BIN
public/image/brush/fur.jpg
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
BIN
public/image/brush/pen.jpg
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
BIN
public/image/brush/shaded.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/image/brush/spray.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -14,7 +14,8 @@
|
|||||||
@click="setBrushTypeWithCommand(brush.id)"
|
@click="setBrushTypeWithCommand(brush.id)"
|
||||||
:class="['brush-type-item', { active: brushStore.state.type === brush.id }]"
|
:class="['brush-type-item', { active: brushStore.state.type === brush.id }]"
|
||||||
>
|
>
|
||||||
<div class="brush-preview" :style="getBrushPreviewStyle(brush)"></div>
|
<!-- <div class="brush-preview" :style="getBrushPreviewStyle(brush)"></div> -->
|
||||||
|
<img class="brush-preview" :src="brush.imgUrl" :title="brush.name" alt="">
|
||||||
<span class="brush-name">{{ brush.name }}</span>
|
<span class="brush-name">{{ brush.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -886,6 +887,7 @@ onMounted(() => {
|
|||||||
const availableBrushes = toolManager.brushManager
|
const availableBrushes = toolManager.brushManager
|
||||||
.getBrushTypes()
|
.getBrushTypes()
|
||||||
?.filter((brush) => brush.id !== "eraser");
|
?.filter((brush) => brush.id !== "eraser");
|
||||||
|
console.log(availableBrushes)
|
||||||
BrushStore.setAvailableBrushes(availableBrushes);
|
BrushStore.setAvailableBrushes(availableBrushes);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1178,6 +1180,8 @@ const brushStore = BrushStore;
|
|||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: rgba(0, 0, 0, 0.02);
|
background-color: rgba(0, 0, 0, 0.02);
|
||||||
|
object-fit: contain;
|
||||||
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 保持笔刷预览内容样式一致 */
|
/* 保持笔刷预览内容样式一致 */
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ onMounted(async () => {
|
|||||||
props.redGreenImageUrl
|
props.redGreenImageUrl
|
||||||
) {
|
) {
|
||||||
canvasManager.canvas.fill = "#fff"; // 设置画布背景色为白色 // 初始化红绿图模式管理器
|
canvasManager.canvas.fill = "#fff"; // 设置画布背景色为白色 // 初始化红绿图模式管理器
|
||||||
redGreenModeManager = new RedGreenModeManager({
|
redGreenModeManager = new toolManagerRedGreenModeManager({
|
||||||
canvas: canvasManager.canvas,
|
canvas: canvasManager.canvas,
|
||||||
canvasManager,
|
canvasManager,
|
||||||
layerManager,
|
layerManager,
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ export class BrushManager {
|
|||||||
description: "基础铅笔工具,适合精细线条绘制",
|
description: "基础铅笔工具,适合精细线条绘制",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/pencil.jpg',
|
||||||
});
|
});
|
||||||
|
|
||||||
// 注册材质笔刷
|
// 注册材质笔刷
|
||||||
@@ -73,6 +74,7 @@ export class BrushManager {
|
|||||||
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/texture.jpg',
|
||||||
});
|
});
|
||||||
|
|
||||||
// 注册集成的笔刷类型
|
// 注册集成的笔刷类型
|
||||||
@@ -81,54 +83,63 @@ export class BrushManager {
|
|||||||
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/crayon.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("fur", FurBrush, {
|
brushRegistry.register("fur", FurBrush, {
|
||||||
name: this.t("Canvas.Fur"),
|
name: this.t("Canvas.Fur"),
|
||||||
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/fur.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("ink", InkBrush, {
|
brushRegistry.register("ink", InkBrush, {
|
||||||
name: this.t("Canvas.Ink"),
|
name: this.t("Canvas.Ink"),
|
||||||
description: "墨水笔刷,适合书写和绘图",
|
description: "墨水笔刷,适合书写和绘图",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/ink.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("", LongfurBrush, {
|
brushRegistry.register("", LongfurBrush, {
|
||||||
name: this.t("Canvas.Longfur"),
|
name: this.t("Canvas.Longfur"),
|
||||||
description: "长毛发笔刷,适合绘制动物毛皮、草或头发",
|
description: "长毛发笔刷,适合绘制动物毛皮、草或头发",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/longFur.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("writing", WritingBrush, {
|
brushRegistry.register("writing", WritingBrush, {
|
||||||
name: this.t("Canvas.Writing"),
|
name: this.t("Canvas.Writing"),
|
||||||
description: "书法笔刷,模拟中国传统书法毛笔效果,具有笔锋和墨色变化",
|
description: "书法笔刷,模拟中国传统书法毛笔效果,具有笔锋和墨色变化",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/writing.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("marker", MarkerBrush, {
|
brushRegistry.register("marker", MarkerBrush, {
|
||||||
name: this.t("Canvas.Marker"),
|
name: this.t("Canvas.Marker"),
|
||||||
description: "马克笔笔刷,适合粗线条和填充",
|
description: "马克笔笔刷,适合粗线条和填充",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/marker.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("pen", CustomPenBrush, {
|
brushRegistry.register("pen", CustomPenBrush, {
|
||||||
name: this.t("Canvas.Pen"),
|
name: this.t("Canvas.Pen"),
|
||||||
description: "自定义钢笔笔刷,适合书写和绘图",
|
description: "自定义钢笔笔刷,适合书写和绘图",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/pen.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("ribbon", RibbonBrush, {
|
brushRegistry.register("ribbon", RibbonBrush, {
|
||||||
name: this.t("Canvas.Ribbon"),
|
name: this.t("Canvas.Ribbon"),
|
||||||
description: "丝带笔刷,适合创建流动的丝带效果",
|
description: "丝带笔刷,适合创建流动的丝带效果",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/ribbon.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("shaded", ShadedBrush, {
|
brushRegistry.register("shaded", ShadedBrush, {
|
||||||
name: this.t("Canvas.Shaded"),
|
name: this.t("Canvas.Shaded"),
|
||||||
description: "阴影笔刷,适合创建渐变和阴影效果",
|
description: "阴影笔刷,适合创建渐变和阴影效果",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/shaded.jpg',
|
||||||
});
|
});
|
||||||
|
|
||||||
brushRegistry.register("spray", SprayBrush, {
|
brushRegistry.register("spray", SprayBrush, {
|
||||||
@@ -136,6 +147,7 @@ export class BrushManager {
|
|||||||
description: "模拟喷枪效果,创建散点效果",
|
description: "模拟喷枪效果,创建散点效果",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
|
imgUrl:'./image/brush/spray.jpg',
|
||||||
});
|
});
|
||||||
|
|
||||||
// brushRegistry.register("sketchy", SketchyBrush);
|
// brushRegistry.register("sketchy", SketchyBrush);
|
||||||
@@ -365,6 +377,7 @@ export class BrushManager {
|
|||||||
description: brushInfo.metadata.description || "",
|
description: brushInfo.metadata.description || "",
|
||||||
category: brushInfo.metadata.category || "默认",
|
category: brushInfo.metadata.category || "默认",
|
||||||
icon: brushInfo.metadata.icon || null,
|
icon: brushInfo.metadata.icon || null,
|
||||||
|
imgUrl: brushInfo.metadata.imgUrl || null,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="editPrintElement">
|
<div class="editPrintElement">
|
||||||
<div class="detailText" style="text-align: left; margin-bottom: 1rem;">
|
<div class="detailText" style="text-align: left; margin-bottom: 1rem;" v-if="type == 'print'">
|
||||||
{{ $t('DesignPrintOperation.ModifyPrint') }}
|
{{ $t('DesignPrintOperation.ModifyPrint') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="printOverallBtn" v-if="type == 'print'">
|
<div class="printOverallBtn" v-if="type == 'print'">
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ const projectList = {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
const openTypeList = (t)=>{
|
const navTypeList = (t)=>{
|
||||||
return {
|
return {
|
||||||
tools:{
|
tools:{
|
||||||
icon:'fi-rr-magic-wand',
|
icon:'fi-rr-magic-wand',
|
||||||
@@ -406,4 +406,4 @@ const openTypeList = (t)=>{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export {projectList,openTypeList}
|
export {projectList,navTypeList}
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<p>{{$t('Header.NewProject')}}</p>
|
<p>{{$t('Header.NewProject')}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="navList ">
|
<div class="navList ">
|
||||||
<div class="tools list" v-for="item in openTypeList" :class="{active:openType == item.value,history:item.value == 'history'}">
|
<div class="tools list" v-for="item in navTypeList" :class="{active:openType == item.value,history:item.value == 'history'}">
|
||||||
<div class="titleBox" @click="setOpenType(item.value,item.list)">
|
<div class="titleBox" @click="setOpenType(item.value,item.list)">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<i :class="['fi',item.icon]"></i>
|
<i :class="['fi',item.icon]"></i>
|
||||||
@@ -291,7 +291,7 @@ import { ScrollTrigger } from "gsap/ScrollTrigger";
|
|||||||
import MyWs from "@/tool/webSocket";
|
import MyWs from "@/tool/webSocket";
|
||||||
import MyEvent from "@/tool/myEvents";
|
import MyEvent from "@/tool/myEvents";
|
||||||
import { useRouter,useRoute } from 'vue-router'
|
import { useRouter,useRoute } from 'vue-router'
|
||||||
import {openTypeList} from "@/tool/listData.js";
|
import {navTypeList} from "@/tool/listData.js";
|
||||||
import home from "@/component/home/index.vue";
|
import home from "@/component/home/index.vue";
|
||||||
import projectSetting from '@/component/home/newProject/setting.vue'
|
import projectSetting from '@/component/home/newProject/setting.vue'
|
||||||
import bindEmail from "@/component/HomePage/bindEmail.vue";
|
import bindEmail from "@/component/HomePage/bindEmail.vue";
|
||||||
@@ -325,7 +325,7 @@ export default defineComponent({
|
|||||||
openTypeChild:'',
|
openTypeChild:'',
|
||||||
isLanguage:false,
|
isLanguage:false,
|
||||||
userDetailLanguage:computed(()=>store.state.UserHabit.userDetail.language),
|
userDetailLanguage:computed(()=>store.state.UserHabit.userDetail.language),
|
||||||
openTypeList:openTypeList(t),
|
navTypeList:navTypeList(t),
|
||||||
projectSetting:null,
|
projectSetting:null,
|
||||||
historyData:{
|
historyData:{
|
||||||
isNoData:false,
|
isNoData:false,
|
||||||
@@ -355,13 +355,13 @@ export default defineComponent({
|
|||||||
watch(()=>homeMainData.userDetailLanguage,(newVal)=>{
|
watch(()=>homeMainData.userDetailLanguage,(newVal)=>{
|
||||||
if(locale.value == newVal || !newVal)return
|
if(locale.value == newVal || !newVal)return
|
||||||
locale.value = newVal
|
locale.value = newVal
|
||||||
let opTypeList = openTypeList(t)
|
let navList = navTypeList(t)
|
||||||
for (const key in opTypeList) {
|
for (const key in navList) {
|
||||||
const element = opTypeList[key];
|
const element = navList[key];
|
||||||
homeMainData.openTypeList[key].label = element.label
|
homeMainData.navTypeList[key].label = element.label
|
||||||
if(element.list?.length > 0){
|
if(element.list?.length > 0){
|
||||||
element.list.forEach((item,index)=>{
|
element.list.forEach((item,index)=>{
|
||||||
homeMainData.openTypeList[key].list[index].label = item.label
|
homeMainData.navTypeList[key].list[index].label = item.label
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -369,7 +369,7 @@ export default defineComponent({
|
|||||||
// watch(()=>locale.value,(newVal,oldVal)=>{
|
// watch(()=>locale.value,(newVal,oldVal)=>{
|
||||||
// if(newVal == oldVal)return
|
// if(newVal == oldVal)return
|
||||||
// console.log(newVal , oldVal)
|
// console.log(newVal , oldVal)
|
||||||
// // homeMainData.openTypeList =
|
// // homeMainData.navTypeList =
|
||||||
// })
|
// })
|
||||||
|
|
||||||
const historyData = reactive({
|
const historyData = reactive({
|
||||||
@@ -420,7 +420,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
{ immediate: true } // 立即触发一次以处理初始参数
|
{ immediate: true } // 立即触发一次以处理初始参数
|
||||||
);
|
);
|
||||||
// watch(()=>homeMainData.openTypeList,()=>{
|
// watch(()=>homeMainData.navTypeList,()=>{
|
||||||
// homeMainData.historyData.page = 1
|
// homeMainData.historyData.page = 1
|
||||||
// })
|
// })
|
||||||
|
|
||||||
@@ -609,7 +609,7 @@ export default defineComponent({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
homeMainData.historyData.page = 1
|
homeMainData.historyData.page = 1
|
||||||
// homeMainData.openTypeList.history = {
|
// homeMainData.navTypeList.history = {
|
||||||
// icon:"fi-br-time-past",
|
// icon:"fi-br-time-past",
|
||||||
// label:"History",
|
// label:"History",
|
||||||
// value:"history",
|
// value:"history",
|
||||||
@@ -618,10 +618,10 @@ export default defineComponent({
|
|||||||
// WithinAWeeklist:[],
|
// WithinAWeeklist:[],
|
||||||
// Earlierlist:[],
|
// Earlierlist:[],
|
||||||
// }
|
// }
|
||||||
homeMainData.openTypeList.history.Todaylist = []
|
homeMainData.navTypeList.history.Todaylist = []
|
||||||
homeMainData.openTypeList.history.Yesterdaylist = []
|
homeMainData.navTypeList.history.Yesterdaylist = []
|
||||||
homeMainData.openTypeList.history.WithinAWeeklist = []
|
homeMainData.navTypeList.history.WithinAWeeklist = []
|
||||||
homeMainData.openTypeList.history.Earlierlist = []
|
homeMainData.navTypeList.history.Earlierlist = []
|
||||||
homeMainData.historyData.isShowLoading = false
|
homeMainData.historyData.isShowLoading = false
|
||||||
homeMainData.historyData.isNoData = false
|
homeMainData.historyData.isNoData = false
|
||||||
isFound = 0//表示是否找到当前id的记录,
|
isFound = 0//表示是否找到当前id的记录,
|
||||||
@@ -659,7 +659,7 @@ export default defineComponent({
|
|||||||
}else{
|
}else{
|
||||||
isFound++
|
isFound++
|
||||||
historyDateList.forEach((item,dateItemIndex)=>{
|
historyDateList.forEach((item,dateItemIndex)=>{
|
||||||
let length = homeMainData.openTypeList.history[item].length
|
let length = homeMainData.navTypeList.history[item].length
|
||||||
if(existToHistoryIndex > length + num){
|
if(existToHistoryIndex > length + num){
|
||||||
num += length
|
num += length
|
||||||
}else{
|
}else{
|
||||||
@@ -696,7 +696,7 @@ export default defineComponent({
|
|||||||
if (rv.content.length > 0) {
|
if (rv.content.length > 0) {
|
||||||
rv.content.forEach((item,index)=>{
|
rv.content.forEach((item,index)=>{
|
||||||
let str = categorizeDate(item.updateTime) + 'list'
|
let str = categorizeDate(item.updateTime) + 'list'
|
||||||
homeMainData.openTypeList.history[str].push(item)
|
homeMainData.navTypeList.history[str].push(item)
|
||||||
if(item.id == (route.query?.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
|
||||||
}
|
}
|
||||||
@@ -744,10 +744,10 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
const editName = (item)=>{
|
const editName = (item)=>{
|
||||||
homeMainData.historyData.selectHistoryId = -1
|
homeMainData.historyData.selectHistoryId = -1
|
||||||
for (const key in homeMainData.openTypeList.history) {
|
for (const key in homeMainData.navTypeList.history) {
|
||||||
let list = ['Earlierlist','Todaylist','WithinAWeeklist','Yesterdaylist']
|
let list = ['Earlierlist','Todaylist','WithinAWeeklist','Yesterdaylist']
|
||||||
if(list.indexOf(key) == -1)continue
|
if(list.indexOf(key) == -1)continue
|
||||||
homeMainData.openTypeList.history[key].forEach((item)=>{
|
homeMainData.navTypeList.history[key].forEach((item)=>{
|
||||||
item.editName = false
|
item.editName = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,6 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
const data = route.query;
|
const data = route.query;
|
||||||
console.log(data)
|
|
||||||
if (data?.state == "weiXin") {
|
if (data?.state == "weiXin") {
|
||||||
wechatLogin(data);
|
wechatLogin(data);
|
||||||
}
|
}
|
||||||
|
|||||||