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
02a0882f
Commit
02a0882f
authored
Apr 29, 2020
by
任建锋
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into publish_rjf
parents
99b050c1
2858b006
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
727 additions
and
389 deletions
+727
-389
zh-CN.json
src/locales/zh-CN.json
+44
-11
project.js
src/store/modules/project.js
+9
-6
editor.scss
src/themes/light/editor.scss
+22
-1
index.js
src/utils/index.js
+1
-1
Editor.vue
src/views/Editor.vue
+6
-3
CodeConflictResolveDialog.vue
src/views/Editor/dialogs/CodeConflictResolveDialog.vue
+438
-0
ProjectConflictResolveDialog.vue
src/views/Editor/dialogs/ProjectConflictResolveDialog.vue
+148
-367
ListCompareView.vue
.../dialogs/ProjectConflictResolveDialog/ListCompareView.vue
+59
-0
No files found.
src/locales/zh-CN.json
View file @
02a0882f
...
...
@@ -9,6 +9,7 @@
"Still Close"
:
"直接关闭"
,
"Save"
:
"保存"
,
"Pack"
:
"打包"
,
"Commit"
:
"提交"
,
"Save And Preview"
:
"保存并预览"
,
"Save And Close"
:
"保存并关闭"
,
"Reset"
:
"重置"
,
...
...
@@ -234,7 +235,8 @@
"Merge conflicts"
:
"合并冲突"
,
"There are still unresolved conflicts"
:
"还有冲突未解决,不能保存!"
,
"The format of the JSON document is wrong"
:
"JSON文档格式有误,请先更正!"
,
"The conflict has been resolved"
:
"冲突已解决,确定保存吗?"
,
"The conflict has been resolved"
:
"冲突已解决,确定提交吗?"
,
"All conflict has been resolved"
:
"所有冲突已解决,确定保存吗?"
,
"Failed to update operator"
:
"更新权限列表失败"
,
"Error delete self"
:
"连自己都删? 不可以!"
,
"No permission"
:
"没有权限喔!"
,
...
...
@@ -354,15 +356,6 @@
"test"
:
"测试环境"
,
"prod"
:
"线上环境"
},
"QAList"
:[
"崔立强"
,
"李培培"
,
"劳奇峰"
,
"任建锋"
,
"张婷婷"
,
"王炽"
,
"王鸿源"
],
"tplOperates"
:
[
"新增"
,
"修改"
,
...
...
@@ -404,5 +397,45 @@
"查看冲突"
,
"手动合并"
,
"完成"
]
],
"categories"
:
{
"options"
:
{
"label"
:
"项目配置"
,
"simple"
:
true
},
"dependencies"
:
{
"label"
:
"依赖"
,
"simple"
:
true
},
"dataMapping"
:
{
"label"
:
"数据映射"
,
"key"
:
"name"
,
"name"
:
"name"
},
"customs"
:
{
"label"
:
"自定义模块"
,
"key"
:
"id"
,
"name"
:
"id"
},
"mock"
:
{
"label"
:
"Mock"
,
"key"
:
"path"
,
"name"
:
"path"
},
"views"
:
{
"label"
:
"视图"
,
"key"
:
"uuid"
,
"name"
:
"name"
},
"assets"
:
{
"label"
:
"素材"
,
"key"
:
"uuid"
,
"name"
:
"name"
},
"processes"
:
{
"label"
:
"过程"
,
"key"
:
"id"
,
"name"
:
"name"
}
}
}
\ No newline at end of file
src/store/modules/project.js
View file @
02a0882f
...
...
@@ -640,7 +640,7 @@ export const projectStore = {
//localStorage.removeItem('project-' + projectID);
commit
(
'setDirty'
,
false
);
},
async
loadFromRemote
({
commit
,
dispatch
},
projectID
)
{
async
loadFromRemote
({
commit
,
dispatch
},
{
projectID
}
)
{
await
dispatch
(
'loadPackageInfos'
);
const
project
=
await
projectApi
.
fetchOne
(
projectID
);
if
(
project
)
{
...
...
@@ -650,18 +650,21 @@ export const projectStore = {
throw
new
Error
(
'Project does not exist'
)
}
},
async
loadFromDataUrl
({
commit
,
dispatch
},
{
project
,
dataUrl
})
{
await
dispatch
(
'loadPackageInfos'
);
project
=
await
projectApi
.
fetchOne
(
project
.
id
,
false
);
async
loadFromDataUrl
({
commit
,
dispatch
},
{
projectID
,
dataUrl
})
{
const
projectData
=
await
projectApi
.
fetchOneFromDataUrl
(
dataUrl
);
if
(
projectData
)
{
project
.
data
=
projectData
;
commit
(
'updateProject'
,
project
);
await
dispatch
(
'loadFromData'
,
{
projectID
,
projectData
})
dispatch
(
'saveToLocal'
);
}
else
{
throw
new
Error
(
'Project does not exist'
)
}
},
async
loadFromData
({
commit
,
dispatch
},
{
projectID
,
projectData
})
{
await
dispatch
(
'loadPackageInfos'
);
let
project
=
await
projectApi
.
fetchOne
(
projectID
,
false
);
project
.
data
=
projectData
;
commit
(
'updateProject'
,
project
);
},
async
saveToRemote
({
state
,
dispatch
,
getters
,
commit
},
{
remark
,
data
})
{
let
project
=
Object
.
assign
({},
getters
.
project
);
if
(
data
)
{
...
...
src/themes/light/editor.scss
View file @
02a0882f
...
...
@@ -527,7 +527,7 @@
width
:
80vw
!
important
;
}
.
project
-conflict-resolve-editor
{
.
code
-conflict-resolve-editor
{
.wrapper
{
height
:
100%
;
padding
:
10px
;
...
...
@@ -545,6 +545,27 @@
}
}
.project-conflict-resolve-editor
{
.wrapper
{
height
:
50vh
;
padding
:
10px
;
display
:
flex
;
flex-direction
:
column
;
.category-tab
{
flex
:
1
;
.el-tabs__content
{
height
:
100%
;
}
}
.compare-view
{
}
}
}
.remote-change-class
{
background-color
:
rgba
(
64
,
200
,
174
,
0
.2
);
}
...
...
src/utils/index.js
View file @
02a0882f
...
...
@@ -427,5 +427,5 @@ export function deleteAssetsDepConfig(data) {
}
export
function
formatJson
(
source
){
return
JSON
.
stringify
(
JSON
.
parse
(
source
),
null
,
'
\
t'
)
return
source
?
JSON
.
stringify
(
JSON
.
parse
(
source
),
null
,
'
\
t'
)
:
''
;
}
src/views/Editor.vue
View file @
02a0882f
...
...
@@ -170,10 +170,10 @@
this
.
ready
=
true
;
});
},
async
loadRemoteVersion
(
projectID
,
project
,
dataUrl
)
{
async
loadRemoteVersion
(
projectID
,
project
,
dataUrl
,
projectData
)
{
if
(
projectID
)
{
this
.
ready
=
false
;
let
p
=
dataUrl
?
this
.
loadFromDataUrl
({
project
,
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'
),
...
...
@@ -230,7 +230,9 @@
return
cancel
;
},
async
onConflictResolved
(
data
)
{
this
.
saveProject
(
true
,
data
);
const
{
projectID
,
project
}
=
this
.
$route
.
params
;
await
this
.
saveProject
(
true
,
data
);
this
.
loadRemoteVersion
(
projectID
,
project
,
undefined
,
data
);
},
checkAuth
()
{
let
checkStatus
=
this
.
operators
.
includes
(
this
.
currentOperator
);
...
...
@@ -377,6 +379,7 @@
'loadFromLocal'
,
'loadFromRemote'
,
'loadFromDataUrl'
,
'loadFromData'
,
"saveToLocal"
,
"saveToRemote"
,
'updateEnv'
,
...
...
src/views/Editor/dialogs/CodeConflictResolveDialog.vue
0 → 100644
View file @
02a0882f
This diff is collapsed.
Click to expand it.
src/views/Editor/dialogs/ProjectConflictResolveDialog.vue
View file @
02a0882f
This diff is collapsed.
Click to expand it.
src/views/Editor/dialogs/ProjectConflictResolveDialog/ListCompareView.vue
0 → 100644
View file @
02a0882f
<
template
>
<el-table
:data=
"compares"
stripe
size=
"mini"
height=
"100%"
>
<el-table-column
prop=
"remote.name"
label=
"远程版本"
>
</el-table-column>
<el-table-column
prop=
"local.name"
label=
"本地版本"
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"280px"
>
<template
slot-scope=
"scope"
>
<template
v-if=
"!scope.row.resolved"
>
<el-button
size=
"mini"
type=
"success"
@
click=
"mergeConflict('remote', scope.row)"
>
接受远程
</el-button>
<el-button
size=
"mini"
type=
"success"
@
click=
"mergeConflict('local', scope.row)"
>
接受本地
</el-button>
<el-button
size=
"mini"
type=
"warning"
@
click=
"mergeConflict('manual', scope.row)"
>
手动合并
</el-button>
</
template
>
<span
v-else
>
无冲突
</span>
</template>
</el-table-column>
</el-table>
</template>
<
script
>
export
default
{
name
:
"ListCompareView"
,
props
:
[
'category'
,
'compares'
],
data
()
{
return
{}
},
mounted
()
{
this
.
update
();
},
watch
:
{
conflicts
()
{
this
.
update
();
},
},
methods
:
{
update
()
{
},
mergeConflict
(
action
,
conflict
)
{
this
.
$emit
(
'merge-conflict'
,
action
,
conflict
,
this
.
category
);
},
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
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