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 label="标题" v-if="type == 'customNode'">
|
||||
<el-input
|
||||
type="textarea"
|
||||
class="bold-input"
|
||||
v-model="nodeAttributeForm.labeltitle"
|
||||
@change="saveNodeAttribute"
|
||||
></el-input>
|
||||
@ -522,14 +522,13 @@
|
||||
if (newVal.labeltitle || newVal.labelconcent) {
|
||||
this.$set(this.nodeAttributeForm, 'labelconcent', newVal.labelconcent)
|
||||
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;
|
||||
} else {
|
||||
this.nodeAttributeForm.label = newVal.label
|
||||
}
|
||||
console.log('obj发生了变化', newVal, oldVal)
|
||||
// console.log('obj发生了变化', newVal, oldVal)
|
||||
},
|
||||
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
@ -553,14 +552,32 @@
|
||||
},
|
||||
created() {
|
||||
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
getlist() {
|
||||
selectScriptEdgeNode(Cookies.get('id')).then(res => {
|
||||
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);
|
||||
// console.log(this.form,'this.form')
|
||||
console.log(this.form, 'this.form')
|
||||
|
||||
})
|
||||
},
|
||||
@ -599,14 +616,8 @@
|
||||
delete e.id
|
||||
})
|
||||
console.log(newObj, 'newObj');
|
||||
// this.form.nodes=newObj.nodes
|
||||
// this.form.edges=newObj.edges
|
||||
// newObj.edges.forEach(e => {
|
||||
// if (e.keyword) {
|
||||
// // e.label=e.label
|
||||
// e.label = e.label.text
|
||||
// }
|
||||
// })
|
||||
|
||||
// return
|
||||
insertScriptEdgeNode(newObj).then(res => {
|
||||
if (res.code == 200) {
|
||||
_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 test = JSON.parse(testcs)
|
||||
@ -710,7 +712,6 @@
|
||||
editor.add(contextmenu);
|
||||
// 挂载到window,方便调试
|
||||
window.editor = editor;
|
||||
|
||||
// 获取当前画布
|
||||
const currentPage = editor.getCurrentPage();
|
||||
currentPage.on("afterchange", (e) => {
|
||||
@ -734,17 +735,13 @@
|
||||
// 如果选择的对象是节点
|
||||
if (ev.item.isNode) {
|
||||
this.type = selectedItemDataModel.shape
|
||||
|
||||
if (selectedItemDataModel.label && selectedItemDataModel.labelconcent == '' && selectedItemDataModel.labeltitle == '') {
|
||||
var text = selectedItemDataModel.label.replace(/\n/g, ",");
|
||||
var concet = text.split(',')
|
||||
console.log(concet, 'text')
|
||||
if (concet.length == 2) {
|
||||
this.nodeAttributeForm.labeltitle = concet[0]
|
||||
this.nodeAttributeForm.labelconcent = concet[1]
|
||||
|
||||
} else if (concet.length == 1) {
|
||||
this.nodeAttributeForm.label = concet[0];
|
||||
if (selectedItemDataModel.label.split('\n').shift() && selectedItemDataModel.label.split('\n').slice(1).join('\n')) {
|
||||
// this.nodeAttributeForm.labeltitle = `<h2>${selectedItemDataModel.label.split('\n').shift()}</h2>`
|
||||
this.nodeAttributeForm.labeltitle = selectedItemDataModel.label.split('\n').shift()
|
||||
this.nodeAttributeForm.labelconcent = selectedItemDataModel.label.split('\n').slice(1).join('\n')
|
||||
} else if (selectedItemDataModel.label.split('\n').shift()) {
|
||||
this.nodeAttributeForm.label = selectedItemDataModel.label.split('\n').shift();
|
||||
}
|
||||
} else {
|
||||
this.nodeAttributeForm.labelconcent = selectedItemDataModel.labelconcent;
|
||||
@ -767,14 +764,12 @@
|
||||
});
|
||||
let newObj = JSON.parse(JSON.stringify(selectedItemDataModel))
|
||||
if (newObj.keyword) {
|
||||
console.log(newObj, '1111111')
|
||||
this.edgeAttributeForm.label = newObj.label.text;
|
||||
} else {
|
||||
this.edgeAttributeForm.label = selectedItemDataModel.label;
|
||||
}
|
||||
this.edgeAttributeForm.shape = selectedItemDataModel.shape;
|
||||
this.edgeAttributeForm.keyword = selectedItemDataModel.keyword;
|
||||
// this.edgeAttributeForm.keyword = '00';
|
||||
}
|
||||
});
|
||||
// 监听(删除后)事件
|
||||
@ -817,16 +812,7 @@
|
||||
document.body.removeChild(downloadLink);
|
||||
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() {
|
||||
let sub = this.editor.getCurrentPage().save()
|
||||
@ -883,7 +869,9 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
<style lang="less" scoped>
|
||||
.bold-input ::v-deep .el-input__inner {
|
||||
font-weight: bold;
|
||||
}
|
||||
@import url("../mianview/index.less");
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user