Commit 964a99a9 authored by 任建锋's avatar 任建锋

--

parent dcc36ebe
......@@ -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 => {
......
......@@ -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();
......
......@@ -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);
}
......
......@@ -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,6 +63,7 @@ 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,
......@@ -69,4 +71,19 @@ export async function preprocess(project, packages) {
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)
}
}
}
}
......@@ -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"
......
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