Browse Source

fix: 喷涂区域: 删除tab后区域没有更新

master
guoapeng 2 weeks ago
parent
commit
f0af81b920
  1. 3
      src/components/martixCraft/Edit/index.vue
  2. 2
      src/components/spray/sprayParams/index.vue
  3. 3
      src/components/spray/trayGraph/index.vue

3
src/components/martixCraft/Edit/index.vue

@ -128,6 +128,7 @@ const cancel = () => {
const sprayRefs = ref<any>([])
const activeTab = ref(0)
const swiperKey = ref(1)
const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | 'add') => {
if (action === 'add') {
if (form.value.times.length >= 10) {
@ -153,6 +154,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' |
}
form.value.times.splice(activeTab.value, 1)
}
swiperKey.value++
//
setTimeout(() => {
@ -220,6 +222,7 @@ const touchendHandle = () => {
<el-tab-pane v-for="(item, index) in form.times" :key="index" :label="`第${index + 1}次`" :name="index" />
</el-tabs>
<Swiper
:key="swiperKey"
:modules="[Pagination, Navigation]"
:pagination="{ clickable: true }"
:navigation="true"

2
src/components/spray/sprayParams/index.vue

@ -170,7 +170,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' |
}
form.value.times.splice(activeTab.value, 1)
}
swiperKey.value++
//
setTimeout(() => {
swiperInstance?.slideTo(activeTab.value)

3
src/components/spray/trayGraph/index.vue

@ -178,7 +178,6 @@ const addGuideLine = () => {
const getSelection = () => {
if (rect.value) {
const pos = rect.value.position()
console.log(newWidth, newHeight)
return {
x1: formatNum(pos.x / zoom),
y1: formatNum(pos.y / zoom),
@ -192,7 +191,6 @@ const getSelection = () => {
//
const updateSelection = (x: number, y: number, width: number, height: number) => {
if (rect.value) {
console.log(x, y, width, height)
rect.value.position({ x, y })
rect.value.width(width)
rect.value.height(height)
@ -229,7 +227,6 @@ const updateLine = (point: { x: number, y: number }, index: number, stroke: stri
}
nextTick(() => {
const currentLine = lines.value[index]
console.log(currentLine, currentLine.points())
currentLine.points([...currentLine.points(), point.x, point.y])
currentLine.getLayer()!.batchDraw() //
})

Loading…
Cancel
Save