Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks-h5
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
quantum-blocks-h5
Commits
f13ba138
Commit
f13ba138
authored
May 27, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 调试问题
parent
cc729e48
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
index.ts
app/web/page/store/modules/activity/index.ts
+13
-16
No files found.
app/web/page/store/modules/activity/index.ts
View file @
f13ba138
...
...
@@ -21,7 +21,10 @@ export default class EditorModule implements Module<EditorState, RootState> {
actions
:
ActionTree
<
EditorState
,
RootState
>
=
{
async
getPageDate
({
commit
},
condition
)
{
const
[
res
]
=
await
api
.
getPageById
(
condition
);
const
{
page
,
...
rest
}
=
res
as
PageInfo
;
let
{
page
,
...
rest
}
=
res
as
PageInfo
;
if
(
!
page
)
{
page
=
"
[]
"
;
}
commit
(
SET_PAGE_INFO
,
{
...
rest
,
page
:
JSON
.
parse
(
page
as
string
)
});
}
};
...
...
@@ -31,29 +34,23 @@ export default class EditorModule implements Module<EditorState, RootState> {
state
.
pageInfo
=
data
;
},
[
UPDATE_PAGE_INFO
](
state
,
{
containerIndex
,
childIndex
,
data
})
{
if
(
state
.
pageInfo
&&
state
.
pageInfo
.
page
)
{
const
page
=
(
state
.
pageInfo
.
page
as
Page
).
elements
;
if
(
childIndex
||
childIndex
===
0
)
{
const
page
=
(
state
.
pageInfo
.
page
as
Page
).
elements
||
[];
if
((
childIndex
||
childIndex
===
0
)
&&
page
[
containerIndex
].
child
)
{
page
[
containerIndex
].
child
.
splice
(
childIndex
,
1
,
data
);
}
else
{
page
.
splice
(
containerIndex
,
1
,
data
);
}
}
},
[
SET_PAGE_DATA
](
state
,
data
)
{
state
.
pageInfo
.
page
=
data
;
},
[
SET_PAGE_ELEMENTS
](
state
,
data
)
{
if
(
state
.
pageInfo
&&
state
.
pageInfo
.
page
)
{
if
(
data
)
{
(
state
.
pageInfo
.
page
as
Page
).
elements
=
data
;
}
}
},
[
SET_ELEMENT_POINT
](
state
,
{
id
,
data
})
{
if
(
state
.
pageInfo
&&
state
.
pageInfo
.
page
)
{
const
elements
=
(
state
.
pageInfo
.
page
as
Page
).
elements
;
const
element
=
elements
.
find
(
ele
=>
ele
.
id
===
id
);
if
(
element
&&
data
)
{
element
.
point
=
data
;
}
}
},
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment