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

--

parent dcc36ebe
...@@ -779,10 +779,16 @@ export const projectStore = { ...@@ -779,10 +779,16 @@ export const projectStore = {
if (data) { //如果已经合并了冲突 if (data) { //如果已经合并了冲突
commit('updateProjectUpdateTime', {time: state.base_time}); commit('updateProjectUpdateTime', {time: state.base_time});
} }
getters.project.data=getters.project.data.replace(/editScroll/g,"scroll")
let project = Object.assign({}, getters.project); let project = Object.assign({}, getters.project);
if (data) { if (data) {
project.data = data; project.data = data;
} }
console.log("data",getters.project,project.data)
let resp = await projectApi.saveOne(project, remark); let resp = await projectApi.saveOne(project, remark);
if (resp.result) { if (resp.result) {
commit('updateProjectUpdateTime', {time: resp.project.update_time, dirty: false}); commit('updateProjectUpdateTime', {time: resp.project.update_time, dirty: false});
...@@ -806,7 +812,7 @@ export const projectStore = { ...@@ -806,7 +812,7 @@ export const projectStore = {
*/ */
activeComponent({state, commit}, data) { activeComponent({state, commit}, data) {
// debugger; // debugger;
console.log("resetScrollType",data)
resetScrollType(data.data) resetScrollType(data.data)
let getTopView = node => { let getTopView = node => {
......
...@@ -208,6 +208,7 @@ ...@@ -208,6 +208,7 @@
localStorage.panesConfig = JSON.stringify(this.panesConfig); localStorage.panesConfig = JSON.stringify(this.panesConfig);
}, },
async saveProject(closeLoading, data) { async saveProject(closeLoading, data) {
let remark, cancel; let remark, cancel;
await this.$prompt(this.$t('Input version remark'), this.$t('Alert'), { await this.$prompt(this.$t('Input version remark'), this.$t('Alert'), {
confirmButtonText: this.$t('Confirm'), confirmButtonText: this.$t('Confirm'),
...@@ -221,6 +222,7 @@ ...@@ -221,6 +222,7 @@
cancel = true; cancel = true;
}); });
if (!cancel) { if (!cancel) {
console.log("保存项目",data,remark)
let resp = await playWaiting(this.saveToRemote({remark, data}), this.$t('Saving'), closeLoading); let resp = await playWaiting(this.saveToRemote({remark, data}), this.$t('Saving'), closeLoading);
if (resp.result) { if (resp.result) {
this.$message({ this.$message({
...@@ -234,6 +236,7 @@ ...@@ -234,6 +236,7 @@
cancelButtonText: i18n.t('Cancel'), cancelButtonText: i18n.t('Cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$refs.projectConflictResolveDialog.show(resp.remoteData, resp.localData); this.$refs.projectConflictResolveDialog.show(resp.remoteData, resp.localData);
}).catch((e) => { }).catch((e) => {
this.$loading({}).close(); this.$loading({}).close();
......
...@@ -165,18 +165,18 @@ ...@@ -165,18 +165,18 @@
this.$store.dispatch('activeComponent', {data, node:nodeDom}); this.$store.dispatch('activeComponent', {data, node:nodeDom});
let styleCatch={ let styleCatch={
x:parseInt(node.x), x:node.x,
y:parseInt(node.y), y:node.y,
anchorX:parseInt(node.anchorX), anchorX:node.anchorX,
anchorY:parseInt(node.anchorY), anchorY:node.anchorY,
scaleX:parseInt(node.scaleX), scaleX:node.scaleX,
scaleY:parseInt(node.scaleY), scaleY:node.scaleY,
// imageWidth:parseInt(node.imageWidth), // imageWidth:parseInt(node.imageWidth),
// imageHeight:parseInt(node.imageHeight), // imageHeight:parseInt(node.imageHeight),
width:parseInt(node._width), width:node._width,
_width:parseInt(node._width), _width:node._width,
_height:parseInt(node._height), _height:node._height,
height:parseInt(node._height), height:node._height,
} }
this.$store.dispatch("modifyProperties", styleCatch); this.$store.dispatch("modifyProperties", styleCatch);
} }
......
...@@ -26,6 +26,7 @@ function getPackages(packages) { ...@@ -26,6 +26,7 @@ function getPackages(packages) {
export async function preprocess(project, packages) { export async function preprocess(project, packages) {
let data = JSON.parse(project.data); let data = JSON.parse(project.data);
resetScrollType(data.views[0])
const codes = await divideCode(data, { const codes = await divideCode(data, {
debug: true, debug: true,
getPackages: getPackages(packages), getPackages: getPackages(packages),
...@@ -62,6 +63,7 @@ export async function preprocess(project, packages) { ...@@ -62,6 +63,7 @@ export async function preprocess(project, packages) {
}); });
tpl = tpl.replace('//yun.duiba.com.cn/aurora/$VERSION$-data.json', dataUrl); tpl = tpl.replace('//yun.duiba.com.cn/aurora/$VERSION$-data.json', dataUrl);
console.log("塞入数据",storeName,data)
db.set(storeName, { db.set(storeName, {
id: project.id, id: project.id,
...@@ -69,4 +71,19 @@ export async function preprocess(project, packages) { ...@@ -69,4 +71,19 @@ export async function preprocess(project, packages) {
tpl, tpl,
}); });
localStorage.setItem('preview-ts', Date.now().toString()); 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: ...@@ -9199,7 +9199,9 @@ yeast@0.1.2:
"zeroing-code-divider@http://gitlab2.dui88.com/laoqifeng/zeroing-code-divider.git": "zeroing-code-divider@http://gitlab2.dui88.com/laoqifeng/zeroing-code-divider.git":
version "1.0.1" 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": "zeroing-template-fill@http://gitlab2.dui88.com/laoqifeng/zeroing-template-fill.git":
version "1.0.0" 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