Commit 02a0882f authored by 任建锋's avatar 任建锋

Merge branch 'dev' into publish_rjf

parents 99b050c1 2858b006
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"Still Close": "直接关闭", "Still Close": "直接关闭",
"Save": "保存", "Save": "保存",
"Pack": "打包", "Pack": "打包",
"Commit": "提交",
"Save And Preview": "保存并预览", "Save And Preview": "保存并预览",
"Save And Close": "保存并关闭", "Save And Close": "保存并关闭",
"Reset": "重置", "Reset": "重置",
...@@ -234,7 +235,8 @@ ...@@ -234,7 +235,8 @@
"Merge conflicts": "合并冲突", "Merge conflicts": "合并冲突",
"There are still unresolved conflicts": "还有冲突未解决,不能保存!", "There are still unresolved conflicts": "还有冲突未解决,不能保存!",
"The format of the JSON document is wrong": "JSON文档格式有误,请先更正!", "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": "更新权限列表失败", "Failed to update operator": "更新权限列表失败",
"Error delete self": "连自己都删? 不可以!", "Error delete self": "连自己都删? 不可以!",
"No permission": "没有权限喔!", "No permission": "没有权限喔!",
...@@ -354,15 +356,6 @@ ...@@ -354,15 +356,6 @@
"test": "测试环境", "test": "测试环境",
"prod": "线上环境" "prod": "线上环境"
}, },
"QAList":[
"崔立强",
"李培培",
"劳奇峰",
"任建锋",
"张婷婷",
"王炽",
"王鸿源"
],
"tplOperates": [ "tplOperates": [
"新增", "新增",
"修改", "修改",
...@@ -404,5 +397,45 @@ ...@@ -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
...@@ -640,7 +640,7 @@ export const projectStore = { ...@@ -640,7 +640,7 @@ export const projectStore = {
//localStorage.removeItem('project-' + projectID); //localStorage.removeItem('project-' + projectID);
commit('setDirty', false); commit('setDirty', false);
}, },
async loadFromRemote({commit, dispatch}, projectID) { async loadFromRemote({commit, dispatch}, {projectID}) {
await dispatch('loadPackageInfos'); await dispatch('loadPackageInfos');
const project = await projectApi.fetchOne(projectID); const project = await projectApi.fetchOne(projectID);
if (project) { if (project) {
...@@ -650,18 +650,21 @@ export const projectStore = { ...@@ -650,18 +650,21 @@ export const projectStore = {
throw new Error('Project does not exist') throw new Error('Project does not exist')
} }
}, },
async loadFromDataUrl({commit, dispatch}, {project, dataUrl}) { async loadFromDataUrl({commit, dispatch}, {projectID, dataUrl}) {
await dispatch('loadPackageInfos');
project = await projectApi.fetchOne(project.id, false);
const projectData = await projectApi.fetchOneFromDataUrl(dataUrl); const projectData = await projectApi.fetchOneFromDataUrl(dataUrl);
if (projectData) { if (projectData) {
project.data = projectData; await dispatch('loadFromData', {projectID, projectData})
commit('updateProject', project);
dispatch('saveToLocal'); dispatch('saveToLocal');
} else { } else {
throw new Error('Project does not exist') 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}) { async saveToRemote({state, dispatch, getters, commit}, {remark, data}) {
let project = Object.assign({}, getters.project); let project = Object.assign({}, getters.project);
if (data) { if (data) {
......
...@@ -527,7 +527,7 @@ ...@@ -527,7 +527,7 @@
width: 80vw !important; width: 80vw !important;
} }
.project-conflict-resolve-editor{ .code-conflict-resolve-editor{
.wrapper{ .wrapper{
height: 100%; height: 100%;
padding: 10px; padding: 10px;
...@@ -545,6 +545,27 @@ ...@@ -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 { .remote-change-class {
background-color: rgba(64, 200, 174, 0.2); background-color: rgba(64, 200, 174, 0.2);
} }
......
...@@ -427,5 +427,5 @@ export function deleteAssetsDepConfig(data) { ...@@ -427,5 +427,5 @@ export function deleteAssetsDepConfig(data) {
} }
export function formatJson(source){ 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 @@ ...@@ -170,10 +170,10 @@
this.ready = true; this.ready = true;
}); });
}, },
async loadRemoteVersion(projectID, project, dataUrl) { async loadRemoteVersion(projectID, project, dataUrl, projectData) {
if (projectID) { if (projectID) {
this.ready = false; 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 => { 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'),
...@@ -230,7 +230,9 @@ ...@@ -230,7 +230,9 @@
return cancel; return cancel;
}, },
async onConflictResolved(data) { 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() { checkAuth() {
let checkStatus = this.operators.includes(this.currentOperator); let checkStatus = this.operators.includes(this.currentOperator);
...@@ -377,6 +379,7 @@ ...@@ -377,6 +379,7 @@
'loadFromLocal', 'loadFromLocal',
'loadFromRemote', 'loadFromRemote',
'loadFromDataUrl', 'loadFromDataUrl',
'loadFromData',
"saveToLocal", "saveToLocal",
"saveToRemote", "saveToRemote",
'updateEnv', '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