Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-editor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
劳工
zeroing-editor
Commits
e667fb72
Commit
e667fb72
authored
Nov 23, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发布自动保存
parent
c81bbbaa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
30 deletions
+34
-30
Editor.vue
src/views/Editor.vue
+34
-30
No files found.
src/views/Editor.vue
View file @
e667fb72
...
...
@@ -155,11 +155,43 @@
this
.
$refs
.
dialogsDialog
.
show
();
break
;
case
'pack'
:
await
this
.
pack
();
break
;
case
'undo'
:
this
.
$store
.
commit
(
'undoRedo'
,
1
);
break
;
case
'redo'
:
this
.
$store
.
commit
(
'undoRedo'
,
-
1
);
break
;
case
'exit'
:
const
{
projectID
}
=
this
.
$route
.
params
;
if
(
await
this
.
localVersionExist
(
projectID
))
{
this
.
$confirm
(
this
.
$t
(
'Unsaved Alert'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Save'
),
cancelButtonText
:
this
.
$t
(
'Exit'
),
type
:
'warning'
}).
then
(()
=>
{
try
{
this
.
saveProject
();
this
.
backToHome
();
}
catch
(
e
)
{
}
}).
catch
((
e
)
=>
{
this
.
backToHome
();
});
}
else
{
this
.
backToHome
();
}
break
;
}
},
async
pack
(){
const
loading
=
this
.
$loading
({
lock
:
true
,
text
:
this
.
$t
(
'Packing'
),
});
try
{
await
this
.
saveProject
();
const
{
tplUrl
}
=
await
this
.
packProject
();
this
.
$message
({
message
:
this
.
$t
(
'Pack project successfully'
),
...
...
@@ -185,34 +217,6 @@
});
}
loading
.
close
();
break
;
case
'undo'
:
this
.
$store
.
commit
(
'undoRedo'
,
1
);
break
;
case
'redo'
:
this
.
$store
.
commit
(
'undoRedo'
,
-
1
);
break
;
case
'exit'
:
const
{
projectID
}
=
this
.
$route
.
params
;
if
(
await
this
.
localVersionExist
(
projectID
))
{
this
.
$confirm
(
this
.
$t
(
'Unsaved Alert'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Save'
),
cancelButtonText
:
this
.
$t
(
'Exit'
),
type
:
'warning'
}).
then
(()
=>
{
try
{
this
.
saveProject
();
this
.
backToHome
();
}
catch
(
e
)
{
}
}).
catch
((
e
)
=>
{
this
.
backToHome
();
});
}
else
{
this
.
backToHome
();
}
break
;
}
},
backToHome
()
{
this
.
$router
.
replace
({
name
:
'home'
});
...
...
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