Commit 72bc21ce by 李耀琨

数据回显

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