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
Hide 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 @@
...
@@ -160,6 +160,7 @@
"Save project successfully"
:
"保存项目成功"
,
"Save project successfully"
:
"保存项目成功"
,
"There are conflicts in the project"
:
"项目有冲突,请先解决冲突"
,
"There are conflicts in the project"
:
"项目有冲突,请先解决冲突"
,
"Input version remark"
:
"请务必认真输入版本备注"
,
"Input version remark"
:
"请务必认真输入版本备注"
,
"Are you sure to discard the local modification"
:
"确定丢弃本地修改吗?"
,
"Input view name"
:
"输入视图名"
,
"Input view name"
:
"输入视图名"
,
"Invalid view name"
:
"无效的视图名"
,
"Invalid view name"
:
"无效的视图名"
,
"Unsaved version found locally"
:
"本地发现了未保存保本,请选择版本打开"
,
"Unsaved version found locally"
:
"本地发现了未保存保本,请选择版本打开"
,
...
@@ -252,7 +253,10 @@
...
@@ -252,7 +253,10 @@
},
},
"menu"
:
{
"menu"
:
{
"save"
:
{
"save"
:
{
"label"
:
"保存"
"label"
:
"保存"
,
"sub"
:
{
"drop-local-modification"
:
"丢弃本地修改"
}
},
},
"details"
:
{
"details"
:
{
"label"
:
"详情"
"label"
:
"详情"
...
...
src/views/Editor.vue
View file @
e55c563d
...
@@ -88,9 +88,9 @@
...
@@ -88,9 +88,9 @@
...
mapState
({
...
mapState
({
codeSyncServeConfig
(
state
)
{
codeSyncServeConfig
(
state
)
{
return
state
.
editor
.
codeSyncServeConfig
;
return
state
.
editor
.
codeSyncServeConfig
;
},
},
operators
:
(
state
)
=>
state
.
project
.
operators
,
operators
:
(
state
)
=>
state
.
project
.
operators
,
currentOperator
:
(
state
)
=>
state
.
editor
.
operator
,
currentOperator
:
(
state
)
=>
state
.
editor
.
operator
,
}),
}),
},
},
async
mounted
()
{
async
mounted
()
{
...
@@ -140,10 +140,10 @@
...
@@ -140,10 +140,10 @@
return
false
;
return
false
;
}
}
},
},
async
loadProject
()
{
async
loadProject
(
forceRemote
)
{
const
{
projectID
,
project
,
dataUrl
}
=
this
.
$route
.
params
;
const
{
projectID
,
project
,
dataUrl
}
=
this
.
$route
.
params
;
if
(
await
this
.
localVersionExist
(
projectID
))
{
if
(
!
forceRemote
&&
await
this
.
localVersionExist
(
projectID
))
{
this
.
$confirm
(
this
.
$t
(
'Unsaved version found locally'
),
this
.
$t
(
'Alert'
),
{
/*
this.$confirm(this.$t('Unsaved version found locally'), this.$t('Alert'), {
showClose: false,
showClose: false,
closeOnClickModal: false,
closeOnClickModal: false,
closeOnPressEscape: false,
closeOnPressEscape: false,
...
@@ -158,7 +158,8 @@
...
@@ -158,7 +158,8 @@
} else {
} else {
console.log(e);
console.log(e);
}
}
});
});*/
this
.
loadLocalVersion
(
projectID
);
}
else
{
}
else
{
this
.
loadRemoteVersion
(
projectID
,
project
,
dataUrl
);
this
.
loadRemoteVersion
(
projectID
,
project
,
dataUrl
);
}
}
...
@@ -173,7 +174,10 @@
...
@@ -173,7 +174,10 @@
async
loadRemoteVersion
(
projectID
,
project
,
dataUrl
,
projectData
)
{
async
loadRemoteVersion
(
projectID
,
project
,
dataUrl
,
projectData
)
{
if
(
projectID
)
{
if
(
projectID
)
{
this
.
ready
=
false
;
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
=>
{
await
playWaiting
(
p
,
this
.
$t
(
'Preparing'
)).
catch
(
e
=>
{
this
.
$alert
(
this
.
$t
(
'Project does not exist'
),
this
.
$t
(
'Alert'
),
{
this
.
$alert
(
this
.
$t
(
'Project does not exist'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Confirm'
),
confirmButtonText
:
this
.
$t
(
'Confirm'
),
...
@@ -236,7 +240,7 @@
...
@@ -236,7 +240,7 @@
},
},
checkAuth
()
{
checkAuth
()
{
let
checkStatus
=
this
.
operators
.
includes
(
this
.
currentOperator
);
let
checkStatus
=
this
.
operators
.
includes
(
this
.
currentOperator
);
if
(
!
checkStatus
)
{
if
(
!
checkStatus
)
{
this
.
$message
({
this
.
$message
({
message
:
this
.
$t
(
'No permission'
),
message
:
this
.
$t
(
'No permission'
),
type
:
'error'
,
type
:
'error'
,
...
@@ -253,6 +257,16 @@
...
@@ -253,6 +257,16 @@
}
catch
(
e
)
{
}
catch
(
e
)
{
}
}
break
;
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'
:
case
'details'
:
this
.
$refs
.
dialogsDialog
.
show
();
this
.
$refs
.
dialogsDialog
.
show
();
break
;
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