Commit a9e5c74f by 李耀琨

可以回显

parent aaf8e4ab
<template> <template>
<div class="tableInput"> <div class="tableInput">
<el-form ref="stepName" :model="stepName" label-width="120px"> <el-form ref="stepName" :model="form" label-width="120px">
<el-form-item label="步骤名称:"> <el-form-item label="步骤名称:">
<el-input v-model="stepName.name" @change="tableInputName"></el-input> <el-input v-model="form.name" @change="tableInputName"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<div id="ExcelInputDialog"></div> <div id="ExcelInputDialog"></div>
<el-form ref="form" :model="form" label-width="120px"> <el-form ref="form" :model="form" label-width="120px">
<el-form-item label="步骤名称:"> <el-form-item label="步骤名称:">
<el-input v-model="form.label"></el-input> <el-input v-model="form.title"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
<el-tab-pane label="文件" name="file"> <el-tab-pane label="文件" name="file">
<el-form ref="form" :model="form" label-width="120px"> <el-form ref="form" :model="form" label-width="120px">
<el-form-item label="表格类(引擎):"> <el-form-item label="表格类(引擎):">
<el-select v-model="form.engine" style="width: 100%"> <el-select v-model="form.spreadsheet_type" style="width: 100%">
<el-option <el-option
v-for="item in engine" v-for="item in engine"
:key="item.code" :key="item.code"
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
>选择文件</el-button >选择文件</el-button
> >
<el-card class="box-card"> <el-card class="box-card">
<el-table :data="ileListData" style="width: 100%"> <el-table :data="file" style="width: 100%">
<el-table-column prop="name" label="文件/目录" width="120"> <el-table-column prop="name" label="文件/目录" width="120">
</el-table-column> </el-table-column>
<el-table-column prop="filemask" label="通配符"> <el-table-column prop="filemask" label="通配符">
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click="deleteFile(scope.$index, ileListData)" @click="deleteFile(scope.$index, file)"
>删除</el-button >删除</el-button
> >
</template> </template>
...@@ -164,16 +164,18 @@ ...@@ -164,16 +164,18 @@
<el-form ref="form" :model="form" label-width="200px"> <el-form ref="form" :model="form" label-width="200px">
<el-form-item label="从前面的步骤获取文件名:"> <el-form-item label="从前面的步骤获取文件名:">
<el-checkbox <el-checkbox
v-model="form.checked" v-model="form.accept_filenames"
true-label="Y" true-label="Y"
false-label="N" false-label="N"
></el-checkbox> ></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="从哪个步骤读文件名:"> <el-form-item label="从哪个步骤读文件名:">
<el-select <el-select
v-model="form.wAccStep" v-model="form.accept_stepname"
style="width: 100%" style="width: 100%"
:disabled="!form.checked || form.checked == 'N'" :disabled="
!form.accept_filenames || form.accept_filenames == 'N'
"
> >
<el-option <el-option
v-for="item in connectionNode" v-for="item in connectionNode"
...@@ -186,9 +188,11 @@ ...@@ -186,9 +188,11 @@
<el-form-item label="保存文件的字段:"> <el-form-item label="保存文件的字段:">
<el-select <el-select
v-model="form.wAccField" v-model="form.accept_field"
style="width: 100%" style="width: 100%"
:disabled="!form.checked || form.checked == 'N'" :disabled="
!form.accept_filenames || form.accept_filenames == 'N'
"
> >
<el-option label="区域一" value="shanghai"></el-option> <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> <el-option label="区域二" value="beijing"></el-option>
...@@ -206,7 +210,7 @@ ...@@ -206,7 +210,7 @@
<br /> <br />
<el-card class="box-card"> <el-card class="box-card">
<el-table :data="worksheetList" style="width: 100%"> <el-table :data="sheets" style="width: 100%">
<el-table-column prop="name" label="工作表名称" width="120"> <el-table-column prop="name" label="工作表名称" width="120">
</el-table-column> </el-table-column>
<el-table-column prop="startrow" label="起始行"> <el-table-column prop="startrow" label="起始行">
...@@ -225,7 +229,7 @@ ...@@ -225,7 +229,7 @@
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click="deleteRow(scope.$index, worksheetList)" @click="deleteRow(scope.$index, sheets)"
>删除</el-button >删除</el-button
> >
</template> </template>
...@@ -293,15 +297,17 @@ ...@@ -293,15 +297,17 @@
</el-form-item> </el-form-item>
<el-form-item label="忽略错误:"> <el-form-item label="忽略错误:">
<el-checkbox <el-checkbox
v-model="form.ignore" v-model="form.error_ignored"
true-label="Y" true-label="Y"
false-label="N" false-label="N"
></el-checkbox> ></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="跳过错误行:"> <el-form-item label="跳过错误行:">
<el-checkbox <el-checkbox
v-model="form.errorLineSkipped" v-model="form.error_line_skipped"
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
true-label="Y" true-label="Y"
false-label="N" false-label="N"
></el-checkbox> ></el-checkbox>
...@@ -312,26 +318,34 @@ ...@@ -312,26 +318,34 @@
<el-col :span="8"> <el-col :span="8">
<el-input <el-input
v-model="form.bad_line_files_destination_directory" v-model="form.bad_line_files_destination_directory"
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
></el-input> ></el-input>
</el-col> </el-col>
<el-col class="line" :span="2.5">扩展名</el-col> <el-col class="line" :span="2.5">扩展名</el-col>
<el-col :span="8"> <el-col :span="8">
<el-input <el-input
v-model="form.warningFilesExtension" v-model="form.bad_line_files_extension"
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
></el-input> ></el-input>
</el-col> </el-col>
<el-col class="line" :span="2.5"> <el-col class="line" :span="2.5">
<el-button <el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
size="mini" size="mini"
>变量</el-button >变量</el-button
></el-col ></el-col
> >
<el-col class="line" :span="2.5"> <el-col class="line" :span="2.5">
<el-button <el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
size="mini" size="mini"
@click="selectFilePath(2)" @click="selectFilePath(2)"
>浏览</el-button >浏览</el-button
...@@ -344,27 +358,35 @@ ...@@ -344,27 +358,35 @@
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="8"> <el-col :span="8">
<el-input <el-input
v-model="form.errorFilesDestinationDirectory" v-model="form.error_line_files_destination_directory"
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
></el-input> ></el-input>
</el-col> </el-col>
<el-col class="line" :span="2.5">扩展名</el-col> <el-col class="line" :span="2.5">扩展名</el-col>
<el-col :span="8"> <el-col :span="8">
<el-input <el-input
v-model="form.errorFilesExtension" v-model="form.error_line_files_extension"
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
></el-input> ></el-input>
</el-col> </el-col>
<el-col class="line" :span="2.5"> <el-col class="line" :span="2.5">
<el-button <el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
size="mini" size="mini"
>变量</el-button >变量</el-button
></el-col ></el-col
> >
<el-col class="line" :span="2.5"> <el-col class="line" :span="2.5">
<el-button <el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
size="mini" size="mini"
@click="selectFilePath(3)" @click="selectFilePath(3)"
>浏览</el-button >浏览</el-button
...@@ -377,27 +399,35 @@ ...@@ -377,27 +399,35 @@
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="8"> <el-col :span="8">
<el-input <el-input
v-model="form.lineNumberFilesDestinationDirectory" v-model="form.line_number_files_destination_directory"
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
></el-input> ></el-input>
</el-col> </el-col>
<el-col class="line" :span="2.5">扩展名</el-col> <el-col class="line" :span="2.5">扩展名</el-col>
<el-col :span="8"> <el-col :span="8">
<el-input <el-input
v-model="form.lineNumberFilesExtension" v-model="form.line_number_files_extension"
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
></el-input> ></el-input>
</el-col> </el-col>
<el-col class="line" :span="2.5"> <el-col class="line" :span="2.5">
<el-button <el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
size="mini" size="mini"
>变量</el-button >变量</el-button
></el-col ></el-col
> >
<el-col class="line" :span="2.5"> <el-col class="line" :span="2.5">
<el-button <el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'" :disabled="
!this.form.error_ignored || this.form.error_ignored == 'N'
"
size="mini" size="mini"
@click="selectFilePath(4)" @click="selectFilePath(4)"
>浏览</el-button >浏览</el-button
...@@ -413,7 +443,7 @@ ...@@ -413,7 +443,7 @@
>添加字段</el-button >添加字段</el-button
> >
<el-table :data="tableData" style="width: 100%"> <el-table :data="fields" style="width: 100%">
<el-table-column prop="name" label="名称"> </el-table-column> <el-table-column prop="name" label="名称"> </el-table-column>
<el-table-column prop="type" label="类型"> </el-table-column> <el-table-column prop="type" label="类型"> </el-table-column>
...@@ -446,7 +476,7 @@ ...@@ -446,7 +476,7 @@
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click="deletefield(scope.$index, tableData)" @click="deletefield(scope.$index, fields)"
>删除</el-button >删除</el-button
> >
</template> </template>
...@@ -874,11 +904,12 @@ export default { ...@@ -874,11 +904,12 @@ export default {
data() { data() {
return { return {
monitorCanvas: "", //监听画布 monitorCanvas: "", //监听画布
getXmlVal:"",//获取上一个xml getXmlVal: "", //获取上一个xml
keyHandler: null, keyHandler: null,
palettes: {}, palettes: {},
graphXml: "", graphXml: "",
xmlDocuments: "", //获取解码的xml xmlDocuments: "", //获取解码的xml
boxInformation: "", //弹框信息
// mxl================================= // mxl=================================
InsertOrUpdateVisible: false, InsertOrUpdateVisible: false,
...@@ -893,8 +924,8 @@ export default { ...@@ -893,8 +924,8 @@ export default {
// mxl================================= // mxl=================================
// 输入模块 // 输入模块
ileListData: [], file: [],
worksheetList: [], sheets: [],
publicData: [], //全部连接 publicData: [], //全部连接
connectionNode: {}, connectionNode: {},
codingType: [], codingType: [],
...@@ -916,7 +947,7 @@ export default { ...@@ -916,7 +947,7 @@ export default {
activeName: "file", activeName: "file",
fieldType: [], fieldType: [],
fieldFormat: [], fieldFormat: [],
tableData: [ fields: [
{ {
filemask: "", filemask: "",
name: "王小虎", name: "王小虎",
...@@ -1034,8 +1065,11 @@ export default { ...@@ -1034,8 +1065,11 @@ export default {
this.graph.getModel().beginUpdate(); this.graph.getModel().beginUpdate();
try { try {
var doc = mxUtils.parseXml(decodeURIComponent(this.blankCanvas)); var doc = mxUtils.parseXml(decodeURIComponent(this.blankCanvas));
console.log(doc,77777777777777);
var codec = new mxCodec(doc); var codec = new mxCodec(doc);
codec.decode(doc.documentElement, this.graph.getModel()); codec.decode(doc.documentElement, this.graph.getModel());
console.log(codec.decode(doc.documentElement),222222222222222222);
} finally { } finally {
this.graph.getModel().endUpdate(); this.graph.getModel().endUpdate();
} }
...@@ -1044,6 +1078,7 @@ export default { ...@@ -1044,6 +1078,7 @@ export default {
excelLnputDetermine() { excelLnputDetermine() {
this.excelLnput = !this.excelLnput; this.excelLnput = !this.excelLnput;
let val = this.form; let val = this.form;
console.log(this.form,4654564);
console.log(val); console.log(val);
}, },
// 子组件发射回来的弹窗变量变为true // 子组件发射回来的弹窗变量变为true
...@@ -1077,7 +1112,7 @@ export default { ...@@ -1077,7 +1112,7 @@ export default {
addField() { addField() {
this.field = !this.field; this.field = !this.field;
if (this.dataState) { if (this.dataState) {
this.tableData.push(this.fieldForm); this.fields.push(this.fieldForm);
} else { } else {
} }
}, },
...@@ -1105,7 +1140,7 @@ export default { ...@@ -1105,7 +1140,7 @@ export default {
addWork() { addWork() {
this.work = !this.work; this.work = !this.work;
if (this.dataState) { if (this.dataState) {
this.worksheetList.push(this.workForm); this.sheets.push(this.workForm);
} else { } else {
} }
}, },
...@@ -1121,7 +1156,7 @@ export default { ...@@ -1121,7 +1156,7 @@ export default {
addFilePathSelection() { addFilePathSelection() {
this.filePathSelection = !this.filePathSelection; this.filePathSelection = !this.filePathSelection;
if (this.routeState == 1) { if (this.routeState == 1) {
this.ileListData.push(this.localPath); this.file.push(this.localPath);
} else if (this.routeState == 2) { } else if (this.routeState == 2) {
this.form.bad_line_files_destination_directory = this.localPath.name; this.form.bad_line_files_destination_directory = this.localPath.name;
} else if (this.routeState == 3) { } else if (this.routeState == 3) {
...@@ -1191,7 +1226,50 @@ export default { ...@@ -1191,7 +1226,50 @@ export default {
this.graph.setDisconnectOnMove(false); this.graph.setDisconnectOnMove(false);
this.graph.convertValueToString = (cell) => { this.graph.convertValueToString = (cell) => {
// 根据cell生成显示的标签
console.log(cell.value.attributes,99999999999999);
cell.title = cell.value.attributes.label.value;
cell.ctype = cell.value.attributes.ctype.value;
// let height = cell.geometry.height;
// let width = cell.geometry.width;
// let x = cell.geometry.x;
// let y = cell.geometry.y;
// const styleObj = {
// title: cell.title,
// fillColor: "transparent",
// strokeColor: "#000000",
// strokeWidth: "1",
// shape: mxConstants.SHAPE_LABEL,
// align: mxConstants.ALIGN_CENTER,
// verticalAlign: mxConstants.ALIGN_BOTTOM,
// imageAlign: mxConstants.ALIGN_CENTER,
// imageVerticalAlign: mxConstants.ALIGN_TOP,
// };
// const style = Object.keys(styleObj)
// .map((attr) => `${attr}=${styleObj[attr]}`)
// .join(";");
// var doc = mxUtils.parseXml(this.blankCanvas);
// cell = this.graph.insertVertex(
// this.graph.getDefaultParent(),
// null,
// doc.documentElement,
// x,
// y,
// width,
// height,
// style
// );
// console.log(this.R.prop("title", cell),132132);
return this.R.prop("title", cell); return this.R.prop("title", cell);
}; };
...@@ -1199,7 +1277,12 @@ export default { ...@@ -1199,7 +1277,12 @@ export default {
console.log(evt); console.log(evt);
// this.xmlDocuments = mxUtils.parseXml(decodeURIComponent(this.blankCanvas)); // this.xmlDocuments = mxUtils.parseXml(decodeURIComponent(this.blankCanvas));
this.graphXml = this.encode(this.graph); this.graphXml = this.encode(this.graph);
console.log(this.graphXml, this.xmlDocuments); console.log(this.graphXml, 11111111111111111111111);
// 监听双击事件
const cell = this.R.pathOr([], ["properties", "cell"], evt);
console.info(cell); // 在控制台输出双击的cell
// 获取接口数据 // 获取接口数据
availableCharsets(pamer).then((res) => { availableCharsets(pamer).then((res) => {
...@@ -1217,33 +1300,42 @@ export default { ...@@ -1217,33 +1300,42 @@ export default {
}); });
let pamer2 = new FormData(); // 创建form对象 let pamer2 = new FormData(); // 创建form对象
pamer2.append("valueType", "all"); pamer2.append("stepName", "all");
valueFormat(pamer2).then((res) => { valueFormat(pamer2).then((res) => {
this.fieldFormat = res; this.fieldFormat = res;
}); });
// 监听双击事件 let pamerSteps = new FormData(); // 创建form对象
const cell = this.R.pathOr([], ["properties", "cell"], evt); pamerSteps.append("stepName", cell.title);
console.info(cell); // 在控制台输出双击的cell pamerSteps.append("graphXml", this.getXmlVal);
if (cell.ids == "step1") { pamerSteps.append("query", "");
previousSteps(pamerSteps).then((res) => {
console.log(res, 7777777777777);
});
let pamerFields = new FormData(); // 创建form对象
pamerFields.append("valueType", "all");
inputOutputFields().then((res) => {});
if (cell.ids == "step1" || cell.ctype == "ExcelInput") {
this.excelLnput = !this.excelLnput; this.excelLnput = !this.excelLnput;
return; return;
} else if (cell.ids == "step7") { } else if (cell.ids == "step7" || cell.ctype == "TableInput") {
this.TableInputDialog = !this.TableInputDialog; this.TableInputDialog = !this.TableInputDialog;
return; return;
} else if (cell.ids == "step6") { } else if (cell.ids == "step6" || cell.ctype == "SystemInfo") {
this.SystemInfoDialog = !this.SystemInfoDialog; this.SystemInfoDialog = !this.SystemInfoDialog;
return; return;
} else if (cell.ids == "step5") { } else if (cell.ids == "step5" || cell.ctype == "DataGrid") {
this.ConstantDialog = !this.ConstantDialog; this.ConstantDialog = !this.ConstantDialog;
return; return;
} else if (cell.ids == "step4") { } else if (cell.ids == "step4" || cell.ctype == "RandomValue") {
this.RandomValueDialog = !this.RandomValueDialog; this.RandomValueDialog = !this.RandomValueDialog;
return; return;
} else if (cell.ids == "step3") { } else if (cell.ids == "step3" || cell.ctype == "RowGenerator") {
this.RowGeneratorDialog = !this.RowGeneratorDialog; this.RowGeneratorDialog = !this.RowGeneratorDialog;
return; return;
} else if (cell.ids == "step2") { } else if (cell.ids == "step2" || cell.ctype == "TextFileInput") {
this.TextFileInputDialog = !this.TextFileInputDialog; this.TextFileInputDialog = !this.TextFileInputDialog;
return; return;
} else if (cell.ids == "step16") { } else if (cell.ids == "step16") {
...@@ -1294,71 +1386,49 @@ export default { ...@@ -1294,71 +1386,49 @@ export default {
// const parent = this.graph.getDefaultParent(); // const parent = this.graph.getDefaultParent();
this.graph.getModel().beginUpdate(); this.graph.getModel().beginUpdate();
const styleObj = { const styleObj = {
title: toolItem["title"],
fillColor: 'transparent', fillColor: "transparent",
strokeColor: '#000000', strokeColor: "#000000",
strokeWidth: '1', strokeWidth: "1",
shape: mxConstants.SHAPE_LABEL, shape: mxConstants.SHAPE_LABEL,
align: mxConstants.ALIGN_CENTER, align: mxConstants.ALIGN_CENTER,
verticalAlign: mxConstants.ALIGN_BOTTOM, verticalAlign: mxConstants.ALIGN_BOTTOM,
imageAlign: mxConstants.ALIGN_CENTER, imageAlign: mxConstants.ALIGN_CENTER,
imageVerticalAlign: mxConstants.ALIGN_TOP, imageVerticalAlign: mxConstants.ALIGN_TOP,
image:toolItem['icon'] image: toolItem["icon"],
} };
const style = Object.keys(styleObj).map((attr) => `${attr}=${styleObj[attr]}`).join(';') const style = Object.keys(styleObj)
.map((attr) => `${attr}=${styleObj[attr]}`)
.join(";");
try { try {
// let vertex = this.graph.insertVertex(
// parent,
// null,
// null,
// x,
// y,
// width,
// height
// );
// vertex.title = toolItem["title"];
// vertex.ids = toolItem["id"];
// vertex.pluginId = toolItem["pluginId"];
// vertex.icon = toolItem["icon"];
// console.log(toolItem,888888888888);
// var oSerializer = new XMLSerializer();
// console.log(oSerializer.serializeToString(this.xmlDocuments));
     
let pameStep = new FormData(); // 创建form对象 let pameStep = new FormData(); // 创建form对象
pameStep.append( pameStep.append("graphXml", this.getXmlVal);
"graphXml", this.getXmlVal
// oSerializer.serializeToString(this.xmlDocuments)
);
pameStep.append("pluginId", toolItem.pluginId); pameStep.append("pluginId", toolItem.pluginId);
pameStep.append("name", toolItem.title); pameStep.append("name", toolItem.title);
newStep(pameStep).then((res) => { newStep(pameStep).then((res) => {
// console.log(res, 4564564564566456); this.boxInformation = res;
var doc = mxUtils.parseXml(res);
this.graph.getModel().beginUpdate();
try {
this.graph.getModel().beginUpdate(); var cell = this.graph.insertVertex(
try this.graph.getDefaultParent(),
{ null,
var cell = this.graph.insertVertex(this.graph.getDefaultParent(), null, res.documentElement, x, y, width, height,style doc.documentElement,
x,
y,
width,
height,
style
); );
console.log(res, 111111111111111111);
cell.title = toolItem["title"]; cell.title = toolItem["title"];
// cell.ids = toolItem["id"]; cell.ids = toolItem["id"];
// cell.pluginId = toolItem["pluginId"]; // cell.pluginId = toolItem["pluginId"];
// cell.icon = toolItem["icon"]; // cell.icon = toolItem["icon"];
this.graph.setSelectionCells([cell]); this.graph.setSelectionCells([cell]);
} finally } finally {
{
this.graph.getModel().endUpdate(); this.graph.getModel().endUpdate();
} }
this.getXml(); this.getXml();
}); });
} finally { } finally {
...@@ -1366,12 +1436,12 @@ this.graph.getModel().beginUpdate(); ...@@ -1366,12 +1436,12 @@ this.graph.getModel().beginUpdate();
} }
}, },
// 获取上一个xml // 获取上一个xml
getXml(){ getXml() {
 const codec = new mxCodec(); const codec = new mxCodec();
      const encodedModel = codec.encode(this.graph.getModel()); const encodedModel = codec.encode(this.graph.getModel());
      this.getXmlVal = mxUtils.getXml(encodedModel); this.getXmlVal = mxUtils.getXml(encodedModel);
console.log(this.getXmlVal, 8888888888888);
}, },
//选择 //选择
initToolbar() { initToolbar() {
...@@ -1386,11 +1456,9 @@ this.graph.getModel().beginUpdate(); ...@@ -1386,11 +1456,9 @@ this.graph.getModel().beginUpdate();
id: dom.id, id: dom.id,
width: 50, width: 50,
height: 50, height: 50,
icon:dom.attributes["icon"].nodeValue, icon: dom.attributes["icon"].nodeValue,
// value: dom.pluginId, // value: dom.pluginId,
pluginId: dom.getAttribute("pluginId"), pluginId: dom.getAttribute("pluginId"),
}; };
const { width, height } = toolItemObj; const { width, height } = toolItemObj;
...@@ -1610,21 +1678,21 @@ this.graph.getModel().beginUpdate(); ...@@ -1610,21 +1678,21 @@ this.graph.getModel().beginUpdate();
var enc = new mxCodec(mxUtils.createXmlDocument()); var enc = new mxCodec(mxUtils.createXmlDocument());
var node = enc.encode(this.graph.getModel()); var node = enc.encode(this.graph.getModel());
this.graphXml = mxUtils.getPrettyXml(node); this.graphXml = mxUtils.getPrettyXml(node);
console.log(this.graphXml, 1111111111111);
console.log(this.graphXml); // console.log(this.graphXml);
const that = this; // const that = this;
let flowObj = Object.assign({}, that.flowData); // let flowObj = Object.assign({}, that.flowData);
// localStorage.setItem("data_test", JSON.stringify(flowObj)) // // localStorage.setItem("data_test", JSON.stringify(flowObj))
console.log("保存流程图", flowObj); // console.log("保存流程图", flowObj);
// 保存 // 保存
let pamers = new FormData(); // 创建form对象 let pamers = new FormData(); // 创建form对象
pamers.append("graphXml", this.graphXml); pamers.append("graphXml", encodeURIComponent(this.graphXml));
save(pamers).then((res) => { save(pamers).then((res) => {
console.log(res); console.log(res);
if (res.success) { if (res.success) {
that.$message.success("保存流程成功!暂时请查先看控制台。"); that.$message.success("保存流程成功!暂时请查先看控制台。");
this.createGraph(); this.createGraph();
console.log(this.gr);
} else { } else {
that.$message.error(res.errMsg); that.$message.error(res.errMsg);
} }
......
...@@ -1208,9 +1208,12 @@ props: ["dragItem"], ...@@ -1208,9 +1208,12 @@ props: ["dragItem"],
pamer.append("path", this.nodePath); pamer.append("path", this.nodePath);
pamer.append("type", "transformation"); pamer.append("type", "transformation");
open(pamer).then(res=>{ open(pamer).then(res=>{
console.log(res,'返回空白画布xml'); // console.log(res,'返回画布xml');
this.blankCanvas = res this.blankCanvas = res
// var xmlDocument = mxUtils.parseXml(res); // var xmlDocument = mxUtils.parseXml(res);
// var decoder = new mxCodec(xmlDocument); // var decoder = new mxCodec(xmlDocument);
// var node = xmlDocument.documentElement; // var node = xmlDocument.documentElement;
......
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