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
964a99a9
Commit
964a99a9
authored
Jun 01, 2020
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
dcc36ebe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
13 deletions
+41
-13
project.js
src/store/modules/project.js
+7
-1
Editor.vue
src/views/Editor.vue
+3
-0
Views.vue
src/views/Editor/Views.vue
+10
-10
preview-preprocess.js
src/views/Preview/preview-preprocess.js
+18
-1
yarn.lock
yarn.lock
+3
-1
No files found.
src/store/modules/project.js
View file @
964a99a9
...
...
@@ -779,10 +779,16 @@ export const projectStore = {
if
(
data
)
{
//如果已经合并了冲突
commit
(
'updateProjectUpdateTime'
,
{
time
:
state
.
base_time
});
}
getters
.
project
.
data
=
getters
.
project
.
data
.
replace
(
/editScroll/g
,
"scroll"
)
let
project
=
Object
.
assign
({},
getters
.
project
);
if
(
data
)
{
project
.
data
=
data
;
}
console
.
log
(
"data"
,
getters
.
project
,
project
.
data
)
let
resp
=
await
projectApi
.
saveOne
(
project
,
remark
);
if
(
resp
.
result
)
{
commit
(
'updateProjectUpdateTime'
,
{
time
:
resp
.
project
.
update_time
,
dirty
:
false
});
...
...
@@ -806,7 +812,7 @@ export const projectStore = {
*/
activeComponent
({
state
,
commit
},
data
)
{
// debugger;
console
.
log
(
"resetScrollType"
,
data
)
resetScrollType
(
data
.
data
)
let
getTopView
=
node
=>
{
...
...
src/views/Editor.vue
View file @
964a99a9
...
...
@@ -208,6 +208,7 @@
localStorage
.
panesConfig
=
JSON
.
stringify
(
this
.
panesConfig
);
},
async
saveProject
(
closeLoading
,
data
)
{
let
remark
,
cancel
;
await
this
.
$prompt
(
this
.
$t
(
'Input version remark'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Confirm'
),
...
...
@@ -221,6 +222,7 @@
cancel
=
true
;
});
if
(
!
cancel
)
{
console
.
log
(
"保存项目"
,
data
,
remark
)
let
resp
=
await
playWaiting
(
this
.
saveToRemote
({
remark
,
data
}),
this
.
$t
(
'Saving'
),
closeLoading
);
if
(
resp
.
result
)
{
this
.
$message
({
...
...
@@ -234,6 +236,7 @@
cancelButtonText
:
i18n
.
t
(
'Cancel'
),
type
:
'warning'
}).
then
(()
=>
{
this
.
$refs
.
projectConflictResolveDialog
.
show
(
resp
.
remoteData
,
resp
.
localData
);
}).
catch
((
e
)
=>
{
this
.
$loading
({}).
close
();
...
...
src/views/Editor/Views.vue
View file @
964a99a9
...
...
@@ -165,18 +165,18 @@
this
.
$store
.
dispatch
(
'activeComponent'
,
{
data
,
node
:
nodeDom
});
let
styleCatch
=
{
x
:
parseInt
(
node
.
x
)
,
y
:
parseInt
(
node
.
y
)
,
anchorX
:
parseInt
(
node
.
anchorX
)
,
anchorY
:
parseInt
(
node
.
anchorY
)
,
scaleX
:
parseInt
(
node
.
scaleX
)
,
scaleY
:
parseInt
(
node
.
scaleY
)
,
x
:
node
.
x
,
y
:
node
.
y
,
anchorX
:
node
.
anchorX
,
anchorY
:
node
.
anchorY
,
scaleX
:
node
.
scaleX
,
scaleY
:
node
.
scaleY
,
// imageWidth:parseInt(node.imageWidth),
// imageHeight:parseInt(node.imageHeight),
width
:
parseInt
(
node
.
_width
)
,
_width
:
parseInt
(
node
.
_width
)
,
_height
:
parseInt
(
node
.
_height
)
,
height
:
parseInt
(
node
.
_height
)
,
width
:
node
.
_width
,
_width
:
node
.
_width
,
_height
:
node
.
_height
,
height
:
node
.
_height
,
}
this
.
$store
.
dispatch
(
"modifyProperties"
,
styleCatch
);
}
...
...
src/views/Preview/preview-preprocess.js
View file @
964a99a9
...
...
@@ -26,6 +26,7 @@ function getPackages(packages) {
export
async
function
preprocess
(
project
,
packages
)
{
let
data
=
JSON
.
parse
(
project
.
data
);
resetScrollType
(
data
.
views
[
0
])
const
codes
=
await
divideCode
(
data
,
{
debug
:
true
,
getPackages
:
getPackages
(
packages
),
...
...
@@ -62,11 +63,27 @@ export async function preprocess(project, packages) {
});
tpl
=
tpl
.
replace
(
'//yun.duiba.com.cn/aurora/$VERSION$-data.json'
,
dataUrl
);
console
.
log
(
"塞入数据"
,
storeName
,
data
)
db
.
set
(
storeName
,
{
id
:
project
.
id
,
data
,
tpl
,
});
localStorage
.
setItem
(
'preview-ts'
,
Date
.
now
().
toString
());
//重置编辑视图数据为实际视图数据
function
resetScrollType
(
data
)
{
if
(
data
.
type
==
"editScrollList"
){
data
.
type
=
"scrollList"
}
if
(
data
.
type
==
"editScrollView"
){
data
.
type
=
"scrollView"
}
if
(
data
.
children
){
for
(
let
itme
of
data
.
children
){
resetScrollType
(
itme
)
}
}
}
}
yarn.lock
View file @
964a99a9
...
...
@@ -9199,7 +9199,9 @@ yeast@0.1.2:
"zeroing-code-divider@http://gitlab2.dui88.com/laoqifeng/zeroing-code-divider.git":
version "1.0.1"
resolved "http://gitlab2.dui88.com/laoqifeng/zeroing-code-divider.git#b2b6d191972fd597388795f249a09071db8f33eb"
resolved "http://gitlab2.dui88.com/laoqifeng/zeroing-code-divider.git#52485bd249c86902a524ea0324aa05a801813dd5"
dependencies:
props-compute "http://gitlab2.dui88.com/laoqifeng/props-compute.git"
"zeroing-template-fill@http://gitlab2.dui88.com/laoqifeng/zeroing-template-fill.git":
version "1.0.0"
...
...
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