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
f407bbb9
Commit
f407bbb9
authored
Sep 27, 2019
by
张晨辰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into feature/20190923-feature
parents
0edf8095
10674cff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
27 deletions
+51
-27
project.js
src/store/modules/project.js
+5
-1
editor.scss
src/themes/light/editor.scss
+1
-0
Editor.vue
src/views/Editor.vue
+45
-26
No files found.
src/store/modules/project.js
View file @
f407bbb9
...
...
@@ -32,8 +32,8 @@ export const projectStore = {
state
.
name
=
name
;
state
.
creator
=
creator
;
const
localData
=
state
.
data
;
if
(
data
)
{
const
localData
=
state
.
data
;
const
{
views
,
assets
,
dataMapping
}
=
JSON
.
parse
(
data
);
if
(
!
localData
.
views
||
localData
.
views
.
length
===
0
)
{
Vue
.
set
(
localData
,
'views'
,
views
||
[]);
...
...
@@ -44,6 +44,10 @@ export const projectStore = {
if
(
!
localData
.
dataMapping
||
localData
.
dataMapping
.
length
===
0
)
{
Vue
.
set
(
localData
,
'dataMapping'
,
dataMapping
||
[]);
}
}
else
{
Vue
.
set
(
localData
,
'views'
,
[]);
Vue
.
set
(
localData
,
'assets'
,
[]);
Vue
.
set
(
localData
,
'dataMapping'
,
[]);
}
// compoleteComponentData(state.data.views);
},
...
...
src/themes/light/editor.scss
View file @
f407bbb9
...
...
@@ -26,6 +26,7 @@
.right-part
{
color
:
$--color-text-regular
;
line-height
:
15px
;
.el-button
{
padding
:
2px
;
...
...
src/views/Editor.vue
View file @
f407bbb9
<
template
>
<div
class=
"editor"
>
<div
class=
"editor"
v-if=
"ready"
>
<tool-bar
@
click-menu=
"clickMenu"
/>
<split-panes
class=
"pane-container"
@
resized=
"onPanesReSized(0, $event)"
>
<split-panes
splitpanes-min=
"40"
:splitpanes-size=
"getSize(0, 0)"
horizontal
@
resized=
"onPanesReSized(1, $event)"
>
...
...
@@ -45,41 +45,59 @@
const
panesConfig
=
localStorage
.
panesConfig
?
JSON
.
parse
(
localStorage
.
panesConfig
)
:
[
0.8
,
0.8
,
0.3
];
return
{
panesConfig
,
ready
:
false
,
}
},
watch
:
{
$route
:
{
handler
:
function
(
val
,
oldVal
){
console
.
log
(
'router changed'
);
this
.
loadProject
();
},
deep
:
true
}
},
computed
:
{
...
mapGetters
([]),
},
async
mounted
()
{
const
{
projectID
}
=
this
.
$route
.
params
;
if
(
await
this
.
localVersionExist
(
projectID
))
{
this
.
$confirm
(
this
.
$t
(
'Unsaved version found locally'
),
this
.
$t
(
'Alert'
),
{
showClose
:
false
,
closeOnClickModal
:
false
,
closeOnPressEscape
:
false
,
confirmButtonText
:
this
.
$t
(
'Local Version'
),
cancelButtonText
:
this
.
$t
(
'Remote Version'
),
type
:
'warning'
}).
then
(()
=>
{
this
.
loadLocalVersion
(
projectID
);
}).
catch
((
e
)
=>
{
if
(
e
===
'cancel'
)
{
this
.
loadRemoteVersion
(
projectID
);
}
else
{
console
.
log
(
e
);
}
});
}
else
{
this
.
loadRemoteVersion
(
projectID
);
}
mounted
()
{
this
.
loadProject
();
},
methods
:
{
async
loadProject
(){
const
{
projectID
}
=
this
.
$route
.
params
;
if
(
await
this
.
localVersionExist
(
projectID
))
{
this
.
$confirm
(
this
.
$t
(
'Unsaved version found locally'
),
this
.
$t
(
'Alert'
),
{
showClose
:
false
,
closeOnClickModal
:
false
,
closeOnPressEscape
:
false
,
confirmButtonText
:
this
.
$t
(
'Local Version'
),
cancelButtonText
:
this
.
$t
(
'Remote Version'
),
type
:
'warning'
}).
then
(()
=>
{
this
.
loadLocalVersion
(
projectID
);
}).
catch
((
e
)
=>
{
if
(
e
===
'cancel'
)
{
this
.
loadRemoteVersion
(
projectID
);
}
else
{
console
.
log
(
e
);
}
});
}
else
{
this
.
loadRemoteVersion
(
projectID
);
}
},
loadLocalVersion
(
projectID
)
{
this
.
loadFromLocal
(
projectID
)
this
.
ready
=
false
;
this
.
loadFromLocal
(
projectID
);
this
.
$nextTick
(()
=>
{
this
.
ready
=
true
;
});
},
loadRemoteVersion
(
projectID
)
{
async
loadRemoteVersion
(
projectID
)
{
if
(
projectID
)
{
playWaiting
(
this
.
loadFromRemote
(
projectID
),
this
.
$t
(
'Preparing'
)).
catch
(
e
=>
{
this
.
ready
=
false
;
await
playWaiting
(
this
.
loadFromRemote
(
projectID
),
this
.
$t
(
'Preparing'
)).
catch
(
e
=>
{
this
.
$alert
(
this
.
$t
(
'Project does not exist'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Confirm'
),
callback
:
action
=>
{
...
...
@@ -87,6 +105,7 @@
}
});
});
this
.
ready
=
true
;
}
else
{
this
.
$router
.
push
({
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