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
e55c563d
Commit
e55c563d
authored
Apr 29, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打开项目直接使用本地
parent
2858b006
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
10 deletions
+28
-10
zh-CN.json
src/locales/zh-CN.json
+5
-1
Editor.vue
src/views/Editor.vue
+23
-9
No files found.
src/locales/zh-CN.json
View file @
e55c563d
...
...
@@ -160,6 +160,7 @@
"Save project successfully"
:
"保存项目成功"
,
"There are conflicts in the project"
:
"项目有冲突,请先解决冲突"
,
"Input version remark"
:
"请务必认真输入版本备注"
,
"Are you sure to discard the local modification"
:
"确定丢弃本地修改吗?"
,
"Input view name"
:
"输入视图名"
,
"Invalid view name"
:
"无效的视图名"
,
"Unsaved version found locally"
:
"本地发现了未保存保本,请选择版本打开"
,
...
...
@@ -252,7 +253,10 @@
},
"menu"
:
{
"save"
:
{
"label"
:
"保存"
"label"
:
"保存"
,
"sub"
:
{
"drop-local-modification"
:
"丢弃本地修改"
}
},
"details"
:
{
"label"
:
"详情"
...
...
src/views/Editor.vue
View file @
e55c563d
...
...
@@ -140,10 +140,10 @@
return
false
;
}
},
async
loadProject
()
{
async
loadProject
(
forceRemote
)
{
const
{
projectID
,
project
,
dataUrl
}
=
this
.
$route
.
params
;
if
(
await
this
.
localVersionExist
(
projectID
))
{
this
.
$confirm
(
this
.
$t
(
'Unsaved version found locally'
),
this
.
$t
(
'Alert'
),
{
if
(
!
forceRemote
&&
await
this
.
localVersionExist
(
projectID
))
{
/*
this.$confirm(this.$t('Unsaved version found locally'), this.$t('Alert'), {
showClose: false,
closeOnClickModal: false,
closeOnPressEscape: false,
...
...
@@ -158,7 +158,8 @@
} else {
console.log(e);
}
});
});*/
this
.
loadLocalVersion
(
projectID
);
}
else
{
this
.
loadRemoteVersion
(
projectID
,
project
,
dataUrl
);
}
...
...
@@ -173,7 +174,10 @@
async
loadRemoteVersion
(
projectID
,
project
,
dataUrl
,
projectData
)
{
if
(
projectID
)
{
this
.
ready
=
false
;
let
p
=
projectData
?
(
this
.
loadFromData
({
projectID
,
projectData
}))
:
dataUrl
?
this
.
loadFromDataUrl
({
projectID
,
dataUrl
})
:
this
.
loadFromRemote
({
projectID
});
let
p
=
projectData
?
(
this
.
loadFromData
({
projectID
,
projectData
}))
:
dataUrl
?
this
.
loadFromDataUrl
({
projectID
,
dataUrl
})
:
this
.
loadFromRemote
({
projectID
});
await
playWaiting
(
p
,
this
.
$t
(
'Preparing'
)).
catch
(
e
=>
{
this
.
$alert
(
this
.
$t
(
'Project does not exist'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Confirm'
),
...
...
@@ -236,7 +240,7 @@
},
checkAuth
()
{
let
checkStatus
=
this
.
operators
.
includes
(
this
.
currentOperator
);
if
(
!
checkStatus
)
{
if
(
!
checkStatus
)
{
this
.
$message
({
message
:
this
.
$t
(
'No permission'
),
type
:
'error'
,
...
...
@@ -253,6 +257,16 @@
}
catch
(
e
)
{
}
break
;
case
'drop-local-modification'
:
await
this
.
$confirm
(
i18n
.
t
(
'Are you sure to discard the local modification'
),
i18n
.
t
(
'Alert'
),
{
confirmButtonText
:
i18n
.
t
(
'Confirm'
),
cancelButtonText
:
i18n
.
t
(
'Cancel'
),
type
:
'warning'
}).
then
(()
=>
{
this
.
loadProject
(
true
);
}).
catch
((
e
)
=>
{
});
break
;
case
'details'
:
this
.
$refs
.
dialogsDialog
.
show
();
break
;
...
...
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