Commit 5e7b8896 authored by rockyl's avatar rockyl

Merge branch 'dev' into res-group

parents b5e40cbb 2858b006
......@@ -9,6 +9,7 @@
"Still Close": "直接关闭",
"Save": "保存",
"Pack": "打包",
"Commit": "提交",
"Save And Preview": "保存并预览",
"Save And Close": "保存并关闭",
"Reset": "重置",
......@@ -235,7 +236,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": "没有权限喔!",
......@@ -355,15 +357,6 @@
"test": "测试环境",
"prod": "线上环境"
},
"QAList":[
"崔立强",
"李培培",
"劳奇峰",
"任建锋",
"张婷婷",
"王炽",
"王鸿源"
],
"tplOperates": [
"新增",
"修改",
......@@ -405,5 +398,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
......@@ -706,7 +706,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) {
......@@ -716,18 +716,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) {
......
......@@ -488,7 +488,7 @@
width: 80vw !important;
}
.project-conflict-resolve-editor{
.code-conflict-resolve-editor{
.wrapper{
height: 100%;
padding: 10px;
......@@ -506,6 +506,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);
}
......
......@@ -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') : '';
}
......@@ -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',
......
This diff is collapsed.
<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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment