Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
fab93ace8a
@ -274,7 +274,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="标题" v-if="type == 'customNode'">
|
<el-form-item label="标题" v-if="type == 'customNode'">
|
||||||
<el-input
|
<el-input
|
||||||
type="textarea"
|
class="bold-input"
|
||||||
v-model="nodeAttributeForm.labeltitle"
|
v-model="nodeAttributeForm.labeltitle"
|
||||||
@change="saveNodeAttribute"
|
@change="saveNodeAttribute"
|
||||||
></el-input>
|
></el-input>
|
||||||
@ -522,14 +522,13 @@
|
|||||||
if (newVal.labeltitle || newVal.labelconcent) {
|
if (newVal.labeltitle || newVal.labelconcent) {
|
||||||
this.$set(this.nodeAttributeForm, 'labelconcent', newVal.labelconcent)
|
this.$set(this.nodeAttributeForm, 'labelconcent', newVal.labelconcent)
|
||||||
this.$set(this.nodeAttributeForm, 'labeltitle', newVal.labeltitle)
|
this.$set(this.nodeAttributeForm, 'labeltitle', newVal.labeltitle)
|
||||||
// this.nodeAttributeForm.labelconcent=newVal.labelconcent
|
|
||||||
// this.nodeAttributeForm.labeltitle=newVal.labeltitle
|
|
||||||
this.nodeAttributeForm.label = newVal.labeltitle + '\n' + newVal.labelconcent;
|
this.nodeAttributeForm.label = newVal.labeltitle + '\n' + newVal.labelconcent;
|
||||||
} else {
|
} else {
|
||||||
this.nodeAttributeForm.label = newVal.label
|
this.nodeAttributeForm.label = newVal.label
|
||||||
}
|
}
|
||||||
console.log('obj发生了变化', newVal, oldVal)
|
// console.log('obj发生了变化', newVal, oldVal)
|
||||||
},
|
},
|
||||||
|
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -553,14 +552,32 @@
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
getlist() {
|
getlist() {
|
||||||
selectScriptEdgeNode(Cookies.get('id')).then(res => {
|
selectScriptEdgeNode(Cookies.get('id')).then(res => {
|
||||||
this.form = JSON.parse(res.data.flowScheme)
|
this.form = JSON.parse(res.data.flowScheme)
|
||||||
|
this.form = JSON.parse(res.data.flowScheme)
|
||||||
|
console.log(this.form)
|
||||||
|
this.form.nodes.forEach(e => {
|
||||||
|
if (e.label) {
|
||||||
|
if (e.label.split('\n').shift() && e.label.split('\n').slice(1).join('\n')) {
|
||||||
|
// e.labeltitle = e.label .split('\n').shift()
|
||||||
|
// e.labelconcent = e.label.split('\n').slice(1).join('\n')
|
||||||
|
// e.label= `<p>${e.label.split('\n').shift()}</p>`+'\n'+ e.label.split('\n').slice(1).join('\n')
|
||||||
|
// console.log(e.label, 'e.la')
|
||||||
|
// e.label={ // 关键形样式(优先级高于color)
|
||||||
|
// fontSize: 14,
|
||||||
|
// fontWeight:800,
|
||||||
|
// text:e.label,
|
||||||
|
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
this.editor.getCurrentPage().read(this.form);
|
this.editor.getCurrentPage().read(this.form);
|
||||||
// console.log(this.form,'this.form')
|
console.log(this.form, 'this.form')
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -599,14 +616,8 @@
|
|||||||
delete e.id
|
delete e.id
|
||||||
})
|
})
|
||||||
console.log(newObj, 'newObj');
|
console.log(newObj, 'newObj');
|
||||||
// this.form.nodes=newObj.nodes
|
|
||||||
// this.form.edges=newObj.edges
|
// return
|
||||||
// newObj.edges.forEach(e => {
|
|
||||||
// if (e.keyword) {
|
|
||||||
// // e.label=e.label
|
|
||||||
// e.label = e.label.text
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
insertScriptEdgeNode(newObj).then(res => {
|
insertScriptEdgeNode(newObj).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
_this.$message.success("数据保存成功");
|
_this.$message.success("数据保存成功");
|
||||||
@ -616,15 +627,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
// newObj.nodes.forEach(e => {
|
|
||||||
// var text = e.label.replace(/\n/g, ",");
|
|
||||||
// var concet = text.split(',')
|
|
||||||
// console.log(concet, 'text')
|
|
||||||
// e.labeltitle = concet[0]
|
|
||||||
// e.labelconcent = concet[1]
|
|
||||||
|
|
||||||
|
|
||||||
// })
|
|
||||||
|
|
||||||
let testcs = JSON.stringify(needSaveData)
|
let testcs = JSON.stringify(needSaveData)
|
||||||
let test = JSON.parse(testcs)
|
let test = JSON.parse(testcs)
|
||||||
@ -710,7 +712,6 @@
|
|||||||
editor.add(contextmenu);
|
editor.add(contextmenu);
|
||||||
// 挂载到window,方便调试
|
// 挂载到window,方便调试
|
||||||
window.editor = editor;
|
window.editor = editor;
|
||||||
|
|
||||||
// 获取当前画布
|
// 获取当前画布
|
||||||
const currentPage = editor.getCurrentPage();
|
const currentPage = editor.getCurrentPage();
|
||||||
currentPage.on("afterchange", (e) => {
|
currentPage.on("afterchange", (e) => {
|
||||||
@ -734,17 +735,13 @@
|
|||||||
// 如果选择的对象是节点
|
// 如果选择的对象是节点
|
||||||
if (ev.item.isNode) {
|
if (ev.item.isNode) {
|
||||||
this.type = selectedItemDataModel.shape
|
this.type = selectedItemDataModel.shape
|
||||||
|
|
||||||
if (selectedItemDataModel.label && selectedItemDataModel.labelconcent == '' && selectedItemDataModel.labeltitle == '') {
|
if (selectedItemDataModel.label && selectedItemDataModel.labelconcent == '' && selectedItemDataModel.labeltitle == '') {
|
||||||
var text = selectedItemDataModel.label.replace(/\n/g, ",");
|
if (selectedItemDataModel.label.split('\n').shift() && selectedItemDataModel.label.split('\n').slice(1).join('\n')) {
|
||||||
var concet = text.split(',')
|
// this.nodeAttributeForm.labeltitle = `<h2>${selectedItemDataModel.label.split('\n').shift()}</h2>`
|
||||||
console.log(concet, 'text')
|
this.nodeAttributeForm.labeltitle = selectedItemDataModel.label.split('\n').shift()
|
||||||
if (concet.length == 2) {
|
this.nodeAttributeForm.labelconcent = selectedItemDataModel.label.split('\n').slice(1).join('\n')
|
||||||
this.nodeAttributeForm.labeltitle = concet[0]
|
} else if (selectedItemDataModel.label.split('\n').shift()) {
|
||||||
this.nodeAttributeForm.labelconcent = concet[1]
|
this.nodeAttributeForm.label = selectedItemDataModel.label.split('\n').shift();
|
||||||
|
|
||||||
} else if (concet.length == 1) {
|
|
||||||
this.nodeAttributeForm.label = concet[0];
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.nodeAttributeForm.labelconcent = selectedItemDataModel.labelconcent;
|
this.nodeAttributeForm.labelconcent = selectedItemDataModel.labelconcent;
|
||||||
@ -767,14 +764,12 @@
|
|||||||
});
|
});
|
||||||
let newObj = JSON.parse(JSON.stringify(selectedItemDataModel))
|
let newObj = JSON.parse(JSON.stringify(selectedItemDataModel))
|
||||||
if (newObj.keyword) {
|
if (newObj.keyword) {
|
||||||
console.log(newObj, '1111111')
|
|
||||||
this.edgeAttributeForm.label = newObj.label.text;
|
this.edgeAttributeForm.label = newObj.label.text;
|
||||||
} else {
|
} else {
|
||||||
this.edgeAttributeForm.label = selectedItemDataModel.label;
|
this.edgeAttributeForm.label = selectedItemDataModel.label;
|
||||||
}
|
}
|
||||||
this.edgeAttributeForm.shape = selectedItemDataModel.shape;
|
this.edgeAttributeForm.shape = selectedItemDataModel.shape;
|
||||||
this.edgeAttributeForm.keyword = selectedItemDataModel.keyword;
|
this.edgeAttributeForm.keyword = selectedItemDataModel.keyword;
|
||||||
// this.edgeAttributeForm.keyword = '00';
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 监听(删除后)事件
|
// 监听(删除后)事件
|
||||||
@ -817,16 +812,7 @@
|
|||||||
document.body.removeChild(downloadLink);
|
document.body.removeChild(downloadLink);
|
||||||
this.saveAsImageDialogVisible = false;
|
this.saveAsImageDialogVisible = false;
|
||||||
},
|
},
|
||||||
// 保存
|
|
||||||
// submitForm() {
|
|
||||||
// const _this = this;
|
|
||||||
// let needSaveData = editor.getCurrentPage().save();
|
|
||||||
// console.log(needSaveData, 'needSaveData');
|
|
||||||
// localStorage.setItem("flowData", JSON.stringify(needSaveData));
|
|
||||||
// _this.save(needSaveData);
|
|
||||||
// _this.$message.success("数据已保存");
|
|
||||||
|
|
||||||
// },
|
|
||||||
// 保存为文件
|
// 保存为文件
|
||||||
saveAsFile() {
|
saveAsFile() {
|
||||||
let sub = this.editor.getCurrentPage().save()
|
let sub = this.editor.getCurrentPage().save()
|
||||||
@ -883,7 +869,9 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less" scoped>
|
||||||
|
.bold-input ::v-deep .el-input__inner {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
@import url("../mianview/index.less");
|
@import url("../mianview/index.less");
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user