Commit 72bc21ce by 李耀琨

数据回显

parent 82a2bb03
...@@ -49,9 +49,9 @@ ...@@ -49,9 +49,9 @@
type="text" type="text"
icon="el-icon-refresh" icon="el-icon-refresh"
size="large" size="large"
@click="doTrans"></el-button> @click="doTrans"
></el-button>
</el-tooltip> </el-tooltip>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-tooltip <el-tooltip
...@@ -812,7 +812,11 @@ ...@@ -812,7 +812,11 @@
<outDialog <outDialog
ref="tableOutPut" ref="tableOutPut"
:tableOutPutVisible.sync="tableOutPutVisible" :tableOutPutVisible.sync="tableOutPutVisible"
:graph.sync="graph" :doubleClickCell="doubleClickCell"  :getXmlVal="getXmlVal" @fathertrans="fathertrans" ></outDialog> :graph.sync="graph"
:doubleClickCell="doubleClickCell"
:getXmlVal="getXmlVal"
@fathertrans="fathertrans"
></outDialog>
<insertOrUpdate <insertOrUpdate
ref="insertOrdate" ref="insertOrdate"
:InsertOrUpdateVisible.sync="InsertOrUpdateVisible" :InsertOrUpdateVisible.sync="InsertOrUpdateVisible"
...@@ -835,12 +839,13 @@ ...@@ -835,12 +839,13 @@
<microDialog ref="mic" :microVisible.sync="microVisible"></microDialog> <microDialog ref="mic" :microVisible.sync="microVisible"></microDialog>
<!-- 输出弹窗end================== --> <!-- 输出弹窗end================== -->
<!-- 转换弹窗开始 --> <!-- 转换弹窗开始 -->
<trans-graph <trans-graph
ref="transGraph" ref="transGraph"
:transGraphVisible.sync="transGraphVisible" :transGraphVisible.sync="transGraphVisible"
:getXmlVal.sync="getXmlVal"></trans-graph> :getXmlVal.sync="getXmlVal"
<!-- 转换弹窗结束 --> ></trans-graph>
<!-- 转换弹窗结束 -->
</div> </div>
</template> </template>
...@@ -881,9 +886,6 @@ import microDialog from "../../../output-dialog/micro-excel"; ...@@ -881,9 +886,6 @@ import microDialog from "../../../output-dialog/micro-excel";
// 输出弹窗end******************************************** // 输出弹窗end********************************************
import mxgraph from "@/utils/mxgraph"; import mxgraph from "@/utils/mxgraph";
const { const {
mxGraph, mxGraph,
...@@ -897,7 +899,7 @@ const { ...@@ -897,7 +899,7 @@ const {
mxCodec, mxCodec,
mxGraphModel, mxGraphModel,
mxGeometry, mxGeometry,
mxCell mxCell,
} = mxgraph; } = mxgraph;
export default { export default {
...@@ -913,8 +915,8 @@ export default { ...@@ -913,8 +915,8 @@ export default {
data() { data() {
return { return {
transGraphVisible:false,//转换弹窗 transGraphVisible: false, //转换弹窗
doubleClickCell:{},//双击的cell doubleClickCell: {}, //双击的cell
monitorCanvas: "", //监听画布 monitorCanvas: "", //监听画布
getXmlVal: "", //获取上一个xml getXmlVal: "", //获取上一个xml
keyHandler: null, keyHandler: null,
...@@ -922,7 +924,8 @@ export default { ...@@ -922,7 +924,8 @@ export default {
graphXml: "", graphXml: "",
xmlDocuments: "", //获取解码的xml xmlDocuments: "", //获取解码的xml
boxInformation: "", //弹框信息 boxInformation: "", //弹框信息
nodeData:{},//节点数据 nodeData: {}, //节点数据
toolItemData:{},//新增节点时的值
// mxl================================= // mxl=================================
InsertOrUpdateVisible: false, InsertOrUpdateVisible: false,
...@@ -1078,27 +1081,27 @@ export default { ...@@ -1078,27 +1081,27 @@ 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); 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); console.log(codec.decode(doc.documentElement), 222222222222222222);
} finally { } finally {
this.graph.getModel().endUpdate(); this.graph.getModel().endUpdate();
} }
}, },
excelLnputDetermine() { excelLnputDetermine() {
this.excelLnput = !this.excelLnput; this.excelLnput = !this.excelLnput;
for(let name in this.form) { for (let name in this.form) {
var edit = new mxCellAttributeChange(
var edit = new mxCellAttributeChange(this.nodeData, name, this.form[name]); this.nodeData,
this.graph.getModel().execute(edit); name,
} this.form[name]
console.log(edit,4564564564654); );
this.graph.getModel().execute(edit);
}
console.log(edit, 4564564564654);
}, },
// 子组件发射回来的弹窗变量变为true // 子组件发射回来的弹窗变量变为true
fathertrans(res) { fathertrans(res) {
...@@ -1245,52 +1248,50 @@ export default { ...@@ -1245,52 +1248,50 @@ export default {
this.graph.setDisconnectOnMove(false); this.graph.setDisconnectOnMove(false);
this.graph.convertValueToString = (cell) => { this.graph.convertValueToString = (cell) => {
// console.log(cell.value.attributes,99999999999999);
// if (cell.title) {
// cell.title = cell.value.attributes.label.value;
// }else{
// console.log(cell.value.attributes,99999999999999); // }
// cell.ctype = cell.value.attributes.ctype.value;
// 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 height = cell.geometry.height; // let y = cell.geometry.y;
// let width = cell.geometry.width;
// let x = cell.geometry.x; // const styleObj = {
// let y = cell.geometry.y; // title: cell.title,
// fillColor: "transparent",
// strokeColor: "#000000",
// const styleObj = { // strokeWidth: "1",
// title: cell.title, // shape: mxConstants.SHAPE_LABEL,
// fillColor: "transparent", // align: mxConstants.ALIGN_CENTER,
// strokeColor: "#000000", // verticalAlign: mxConstants.ALIGN_BOTTOM,
// strokeWidth: "1", // imageAlign: mxConstants.ALIGN_CENTER,
// shape: mxConstants.SHAPE_LABEL, // imageVerticalAlign: mxConstants.ALIGN_TOP,
// align: mxConstants.ALIGN_CENTER, // };
// verticalAlign: mxConstants.ALIGN_BOTTOM, // const style = Object.keys(styleObj)
// imageAlign: mxConstants.ALIGN_CENTER, // .map((attr) => `${attr}=${styleObj[attr]}`)
// imageVerticalAlign: mxConstants.ALIGN_TOP, // .join(";");
// };
// const style = Object.keys(styleObj) // var doc = mxUtils.parseXml(this.blankCanvas);
// .map((attr) => `${attr}=${styleObj[attr]}`)
// .join(";"); // cell = this.graph.insertVertex(
// this.graph.getDefaultParent(),
// var doc = mxUtils.parseXml(this.blankCanvas); // null,
// doc.documentElement,
// cell = this.graph.insertVertex( // x,
// this.graph.getDefaultParent(), // y,
// null, // width,
// doc.documentElement, // height,
// x, // style
// y, // );
// width,
// height, // console.log(this.R.prop("title", cell),132132);
// style
// );
// console.log(this.R.prop("title", cell),132132);
return this.R.prop("title", cell); return this.R.prop("title", cell);
}; };
...@@ -1302,11 +1303,11 @@ export default { ...@@ -1302,11 +1303,11 @@ export default {
// 监听双击事件 // 监听双击事件
const cell = this.R.pathOr([], ["properties", "cell"], evt); const cell = this.R.pathOr([], ["properties", "cell"], evt);
console.info(cell); // 在控制台输出双击的cell console.info(cell); // 在控制台输出双击的cell
this.nodeData = cell this.nodeData = cell;
this.setXml(); // this.setXml();
this.doubleClickCell=cell; this.doubleClickCell = cell;
// 获取接口数据 // 获取接口数据
...@@ -1342,42 +1343,77 @@ export default { ...@@ -1342,42 +1343,77 @@ export default {
pamerFields.append("valueType", "all"); pamerFields.append("valueType", "all");
inputOutputFields().then((res) => {}); inputOutputFields().then((res) => {});
if (cell.ids == "step1" || cell.ctype == "ExcelInput") { if (cell.ids == "step1" || cell.value.attributes.ctype.value == "ExcelInput") {
this.excelLnput = !this.excelLnput; this.excelLnput = !this.excelLnput;
// console.log(cell.value.attributes,1111111);
// this.form = cell.value.attributes["name"].value
console.log(cell.value.attributes);
console.log(cell.value.attributes.uriNameFieldName.value);
let obj = cell.value.attributes
for(let vel in obj){
let key = obj[vel]
this.form = {
[key.name] : `${key.value}`
}
console.log(this.form,4564676354676);
}
let q = {};
let obj = cell.value.attributes;
for (let vel in obj) {
let key = obj[vel];
q[key.name] = key.value;
}
this.form = q
return; return;
} else if (cell.ids == "step7" || cell.ctype == "TableInput") { } else if (cell.ids == "step7" || cell.value.attributes.ctype.value == "TableInput") {
this.TableInputDialog = !this.TableInputDialog; this.TableInputDialog = !this.TableInputDialog;
let q = {};
let obj = cell.value.attributes;
for (let vel in obj) {
let key = obj[vel];
q[key.name] = key.value;
}
this.form = q
return; return;
} else if (cell.ids == "step6" || cell.ctype == "SystemInfo") { } else if (cell.ids == "step6" || cell.value.attributes.ctype.value == "SystemInfo") {
this.SystemInfoDialog = !this.SystemInfoDialog; this.SystemInfoDialog = !this.SystemInfoDialog;
let q = {};
let obj = cell.value.attributes;
for (let vel in obj) {
let key = obj[vel];
q[key.name] = key.value;
}
this.form = q
return; return;
} else if (cell.ids == "step5" || cell.ctype == "DataGrid") { } else if (cell.ids == "step5" || cell.value.attributes.ctype.value == "DataGrid") {
this.ConstantDialog = !this.ConstantDialog; this.ConstantDialog = !this.ConstantDialog;
let q = {};
let obj = cell.value.attributes;
for (let vel in obj) {
let key = obj[vel];
q[key.name] = key.value;
}
this.form = q
return; return;
} else if (cell.ids == "step4" || cell.ctype == "RandomValue") { } else if (cell.ids == "step4" || cell.value.attributes.ctype.value == "RandomValue") {
this.RandomValueDialog = !this.RandomValueDialog; this.RandomValueDialog = !this.RandomValueDialog;
let q = {};
let obj = cell.value.attributes;
for (let vel in obj) {
let key = obj[vel];
q[key.name] = key.value;
}
this.form = q
return; return;
} else if (cell.ids == "step3" || cell.ctype == "RowGenerator") { } else if (cell.ids == "step3" || cell.value.attributes.ctype.value == "RowGenerator") {
this.RowGeneratorDialog = !this.RowGeneratorDialog; this.RowGeneratorDialog = !this.RowGeneratorDialog;
let q = {};
let obj = cell.value.attributes;
for (let vel in obj) {
let key = obj[vel];
q[key.name] = key.value;
}
this.form = q
return; return;
} else if (cell.ids == "step2" || cell.ctype == "TextFileInput") { } else if (cell.ids == "step2" || cell.value.attributes.ctype.value == "TextFileInput") {
this.TextFileInputDialog = !this.TextFileInputDialog; this.TextFileInputDialog = !this.TextFileInputDialog;
let q = {};
let obj = cell.value.attributes;
for (let vel in obj) {
let key = obj[vel];
q[key.name] = key.value;
}
this.form = q
return; return;
} else if (cell.ids == "step17") { } else if (cell.ids == "step17") {
//表输出 //表输出
...@@ -1441,6 +1477,7 @@ export default { ...@@ -1441,6 +1477,7 @@ export default {
const style = Object.keys(styleObj) const style = Object.keys(styleObj)
.map((attr) => `${attr}=${styleObj[attr]}`) .map((attr) => `${attr}=${styleObj[attr]}`)
.join(";"); .join(";");
this.toolItemData = toolItem
try { try {
let pameStep = new FormData(); // 创建form对象 let pameStep = new FormData(); // 创建form对象
pameStep.append("graphXml", this.getXmlVal); pameStep.append("graphXml", this.getXmlVal);
...@@ -1745,11 +1782,10 @@ export default { ...@@ -1745,11 +1782,10 @@ export default {
}, },
// 执行转换 // 执行转换
doTrans(){ doTrans() {
this.transGraphVisible=!this.transGraphVisible; this.transGraphVisible = !this.transGraphVisible;
}, },
// //重绘流程图 // //重绘流程图
clearFlow() { clearFlow() {
// let that = this; // let that = this;
......
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