Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
8413cf28
提交
8413cf28
authored
11月 03, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor:仪表板编辑时,可能出现的跳动问题
上级
5145b193
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
10 行删除
+17
-10
index.vue
frontend/src/components/DeDrag/index.vue
+1
-1
index.vue
frontend/src/components/canvas/components/Editor/index.vue
+11
-8
snapshot.js
frontend/src/components/canvas/store/snapshot.js
+5
-1
没有找到文件。
frontend/src/components/DeDrag/index.vue
浏览文件 @
8413cf28
...
@@ -1603,7 +1603,7 @@ export default {
...
@@ -1603,7 +1603,7 @@ export default {
style
.
height
=
height
style
.
height
=
height
style
.
rotate
=
this
.
rotate
style
.
rotate
=
this
.
rotate
// this.hasMove = true
// this.hasMove = true
console
.
log
(
'recordMatrixCurShadowStyle:t1:'
+
JSON
.
stringify
(
style
))
//
console.log('recordMatrixCurShadowStyle:t1:' + JSON.stringify(style))
this
.
$store
.
commit
(
'setShapeStyle'
,
style
)
this
.
$store
.
commit
(
'setShapeStyle'
,
style
)
...
...
frontend/src/components/canvas/components/Editor/index.vue
浏览文件 @
8413cf28
...
@@ -338,7 +338,7 @@ function recalcCellWidth() {
...
@@ -338,7 +338,7 @@ function recalcCellWidth() {
}
}
function
init
()
{
function
init
()
{
console
.
log
(
'init
'
)
// console.log('init-cellWidth
')
this
.
cellWidth
=
this
.
baseWidth
+
this
.
baseMarginLeft
this
.
cellWidth
=
this
.
baseWidth
+
this
.
baseMarginLeft
this
.
cellHeight
=
this
.
baseHeight
+
this
.
baseMarginTop
this
.
cellHeight
=
this
.
baseHeight
+
this
.
baseMarginTop
this
.
yourList
=
this
.
getList
()
this
.
yourList
=
this
.
getList
()
...
@@ -993,7 +993,7 @@ export default {
...
@@ -993,7 +993,7 @@ export default {
'editor'
,
'editor'
,
'linkageSettingStatus'
,
'linkageSettingStatus'
,
'curLinkageView'
,
'curLinkageView'
,
'
s
napshotIndex'
'
doS
napshotIndex'
])
])
},
},
watch
:
{
watch
:
{
...
@@ -1035,6 +1035,7 @@ export default {
...
@@ -1035,6 +1035,7 @@ export default {
// 初始化时componentData 加载可能出现慢的情况 此时重新初始化一下matrix
// 初始化时componentData 加载可能出现慢的情况 此时重新初始化一下matrix
if
(
newVal
.
length
!==
this
.
lastComponentDataLength
)
{
if
(
newVal
.
length
!==
this
.
lastComponentDataLength
)
{
this
.
lastComponentDataLength
=
newVal
.
length
this
.
lastComponentDataLength
=
newVal
.
length
console
.
log
(
'.initMatrix2'
)
this
.
initMatrix
()
this
.
initMatrix
()
}
}
},
},
...
@@ -1047,9 +1048,10 @@ export default {
...
@@ -1047,9 +1048,10 @@ export default {
deep
:
true
deep
:
true
},
},
// 镜像索引有变化 刷新一下矩阵(撤销重做等)
// 镜像索引有变化 刷新一下矩阵(撤销重做等)
s
napshotIndex
:
{
doS
napshotIndex
:
{
handler
(
newVal
,
oldVla
)
{
handler
(
newVal
,
oldVla
)
{
// console.log('snapshotIndexChange:' + newVal)
// console.log('snapshotIndexChange:' + newVal)
// console.log('.initMatrix3')
this
.
initMatrix
()
this
.
initMatrix
()
},
},
deep
:
true
deep
:
true
...
@@ -1061,11 +1063,11 @@ export default {
...
@@ -1061,11 +1063,11 @@ export default {
this
.
$store
.
commit
(
'getEditor'
)
this
.
$store
.
commit
(
'getEditor'
)
const
_this
=
this
const
_this
=
this
// bus.$on('auxiliaryMatrixChange', this.initMatrix)
// bus.$on('auxiliaryMatrixChange', this.initMatrix)
bus
.
$on
(
'auxiliaryMatrixChange'
,
()
=>
{
//
bus.$on('auxiliaryMatrixChange', () => {
_this
.
$nextTick
(()
=>
{
//
_this.$nextTick(() => {
_this
.
initMatrix
()
//
_this.initMatrix()
})
//
})
})
//
})
eventBus
.
$on
(
'hideArea'
,
()
=>
{
eventBus
.
$on
(
'hideArea'
,
()
=>
{
this
.
hideArea
()
this
.
hideArea
()
})
})
...
@@ -1300,6 +1302,7 @@ export default {
...
@@ -1300,6 +1302,7 @@ export default {
this
.
baseHeight
=
this
.
matrixStyle
.
height
this
.
baseHeight
=
this
.
matrixStyle
.
height
this
.
cellWidth
=
this
.
matrixStyle
.
width
this
.
cellWidth
=
this
.
matrixStyle
.
width
this
.
cellHeight
=
this
.
matrixStyle
.
height
this
.
cellHeight
=
this
.
matrixStyle
.
height
// console.log('.initMatrix1')
this
.
initMatrix
()
this
.
initMatrix
()
this
.
scaleWidth
=
this
.
outStyle
.
width
*
100
/
this
.
canvasStyleData
.
width
this
.
scaleWidth
=
this
.
outStyle
.
width
*
100
/
this
.
canvasStyleData
.
width
...
...
frontend/src/components/canvas/store/snapshot.js
浏览文件 @
8413cf28
...
@@ -8,13 +8,15 @@ export default {
...
@@ -8,13 +8,15 @@ export default {
snapshotIndex
:
-
1
,
// 快照索引
snapshotIndex
:
-
1
,
// 快照索引
changeTimes
:
-
1
,
// 修改次数
changeTimes
:
-
1
,
// 修改次数
lastSaveSnapshotIndex
:
0
,
// 最后保存是snapshotIndex的索引
lastSaveSnapshotIndex
:
0
,
// 最后保存是snapshotIndex的索引
styleChangeTimes
:
0
// 组件样式修改次数
styleChangeTimes
:
0
,
// 组件样式修改次数
doSnapshotIndex
:
-
1
// snapshot undo redo 时的索引记录
},
},
mutations
:
{
mutations
:
{
undo
(
state
)
{
undo
(
state
)
{
store
.
commit
(
'setCurComponent'
,
{
component
:
null
,
index
:
null
})
store
.
commit
(
'setCurComponent'
,
{
component
:
null
,
index
:
null
})
if
(
state
.
snapshotIndex
>
0
)
{
if
(
state
.
snapshotIndex
>
0
)
{
state
.
snapshotIndex
--
state
.
snapshotIndex
--
state
.
doSnapshotIndex
=
state
.
snapshotIndex
store
.
commit
(
'setComponentData'
,
deepCopy
(
state
.
snapshotData
[
state
.
snapshotIndex
]))
store
.
commit
(
'setComponentData'
,
deepCopy
(
state
.
snapshotData
[
state
.
snapshotIndex
]))
store
.
commit
(
'setCanvasStyle'
,
deepCopy
(
state
.
snapshotStyleData
[
state
.
snapshotIndex
]))
store
.
commit
(
'setCanvasStyle'
,
deepCopy
(
state
.
snapshotStyleData
[
state
.
snapshotIndex
]))
}
}
...
@@ -24,6 +26,7 @@ export default {
...
@@ -24,6 +26,7 @@ export default {
store
.
commit
(
'setCurComponent'
,
{
component
:
null
,
index
:
null
})
store
.
commit
(
'setCurComponent'
,
{
component
:
null
,
index
:
null
})
if
(
state
.
snapshotIndex
<
state
.
snapshotData
.
length
-
1
)
{
if
(
state
.
snapshotIndex
<
state
.
snapshotData
.
length
-
1
)
{
state
.
snapshotIndex
++
state
.
snapshotIndex
++
state
.
doSnapshotIndex
=
state
.
snapshotIndex
store
.
commit
(
'setComponentData'
,
deepCopy
(
state
.
snapshotData
[
state
.
snapshotIndex
]))
store
.
commit
(
'setComponentData'
,
deepCopy
(
state
.
snapshotData
[
state
.
snapshotIndex
]))
store
.
commit
(
'setCanvasStyle'
,
deepCopy
(
state
.
snapshotStyleData
[
state
.
snapshotIndex
]))
store
.
commit
(
'setCanvasStyle'
,
deepCopy
(
state
.
snapshotStyleData
[
state
.
snapshotIndex
]))
}
}
...
@@ -42,6 +45,7 @@ export default {
...
@@ -42,6 +45,7 @@ export default {
}
}
},
},
refreshSnapshot
(
state
)
{
refreshSnapshot
(
state
)
{
console
.
log
(
'refreshSnapshot'
)
// 刷新快照
// 刷新快照
state
.
snapshotData
=
[]
state
.
snapshotData
=
[]
state
.
snapshotStyleData
=
[]
state
.
snapshotStyleData
=
[]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论