Commit bd337c98 by 李耀琨

字段回显

parent 82fc879e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="tableInput"> <div class="tableInput">
<el-form ref="stepName" :model="form" label-width="120px"> <el-form ref="stepName" :model="form" label-width="120px">
<el-form-item label="步骤名称:"> <el-form-item label="步骤名称:">
<el-input v-model="form.name" @change="tableInputName"></el-input> <el-input v-model="form.label" @change="tableInputName"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -32,12 +32,12 @@ ...@@ -32,12 +32,12 @@
</el-select> --> </el-select> -->
</el-col> </el-col>
<el-col class="line" :span="2"> <el-col class="line" :span="2">
<el-button size="mini" @click="dialogVisibleFourth = true" <el-button size="mini" @click="dialogVisibleFourthFun"
>编辑</el-button >编辑</el-button
></el-col ></el-col
> >
<el-col class="line" :span="2"> <el-col class="line" :span="2">
<el-button size="mini" @click="dialogVisibleFourth = true" <el-button size="mini" @click="dialogVisibleFourthNew"
>新建</el-button >新建</el-button
></el-col ></el-col
> >
...@@ -52,17 +52,25 @@ ...@@ -52,17 +52,25 @@
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input type="textarea" v-model="form.desc" :rows="8"></el-input> <el-input type="textarea" v-model="form.sql" :rows="8"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form ref="form" :model="form" label-width="160px"> <el-form ref="form" :model="form" label-width="160px">
<el-form-item label="允许简易转换:"> <el-form-item label="允许简易转换:">
<el-checkbox v-model="form.lazy_conversion_active"></el-checkbox> <el-checkbox
v-model="form.lazy_conversion_active"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="替换SQL语句里的变量:"> <el-form-item label="替换SQL语句里的变量:">
<el-checkbox v-model="form.variables_active"></el-checkbox> <el-checkbox
v-model="form.variables_active"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="从步骤插入数据:"> <el-form-item label="从步骤插入数据:">
...@@ -77,7 +85,11 @@ ...@@ -77,7 +85,11 @@
</el-form-item> </el-form-item>
<el-form-item label="执行每一行:"> <el-form-item label="执行每一行:">
<el-checkbox v-model="form.execute_each_row"></el-checkbox> <el-checkbox
v-model="form.execute_each_row"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="记录数量限制:"> <el-form-item label="记录数量限制:">
...@@ -125,7 +137,15 @@ ...@@ -125,7 +137,15 @@
</span> </span>
</el-dialog> </el-dialog>
<estab-dialog ref="establishDia" :dialogVisibleFourth.sync='dialogVisibleFourth' @getSonValue="getSonValue" :listNames="listNames" :scanDialogVisible.sync='scanDialogVisible'  :form="newForm" :chooseType="chooseType" :chooseFlag.sync="chooseFlag"></estab-dialog> <estab-dialog
ref="establishDia2"
:dialogVisibleFourth.sync="dialogVisibleFourth"
@getSonValue="getSonValue"
:listNames="listNames"
:scanDialogVisible.sync="scanDialogVisible"
:chooseType="chooseType"
:chooseFlag.sync="chooseFlag"
></estab-dialog>
</div> </div>
</template> </template>
...@@ -139,21 +159,19 @@ import { ...@@ -139,21 +159,19 @@ import {
} from "@/api/kettle/link"; } from "@/api/kettle/link";
export default { export default {
props: ["connectionNode", "stepName"], //从父组件传过来的值 props: ["connectionNode", "stepName", "form", "graphXml"], //从父组件传过来的值
components: { components: {
main, main,
}, },
data() { data() {
return { return {
tableDetails:{},
connectionName: "",
browsing: false, browsing: false,
dialogVisibleFourth: false, dialogVisibleFourth: false,
scanDialogVisible: false, scanDialogVisible: false,
newForm: {}, newForm: {},
form: {
wLazyConversion: false,
wVariables: false,
wEachRow: false,
},
ComboBox: [], ComboBox: [],
library: [], library: [],
PopupFrom: {}, PopupFrom: {},
...@@ -187,51 +205,42 @@ export default { ...@@ -187,51 +205,42 @@ export default {
}, // form(newValue, oldValue){ //   this.form=newValue; // } }, // form(newValue, oldValue){ //   this.form=newValue; // }
}, },
methods: { methods: {
tableInputName() {
tableInputName(){ this.stepName;
this.stepName
}, },
//  //获取新建弹窗返回来的值 //  //获取新建弹窗返回来的值
getSonValue(res){ getSonValue(res) {
      if(typeof(res)=='string'){ if (typeof res == "string") {
        this.dataBaseName = res this.dataBaseName = res;
         console.log('接收子组件的值1111111----',this.dataBaseName); console.log("接收子组件的值1111111----", this.dataBaseName);
      }else if(typeof(res)=='object'){ } else if (typeof res == "object") {
        console.log('接收子组件的值55555----',res); console.log("接收子组件的值55555----", res);
        this.curNode=res; this.curNode = res; // DOM 更新后 // this.$nextTick(() => { //   this.form.text=this.curNode.data.text; //   // this.$refs.goal.values=this.curNode.data.text; //   // this.$refs.goal.refreshData(this.from) // }) // this.form.text=this.curNode.data.text;
         // DOM 更新后 //         this.$set(this.newForm,'text',this.curNode.data.text)
        // this.$nextTick(() => { //         this.$forceUpdate()
        //   this.form.text=this.curNode.data.text; console.log("chuanhuo=====", this.newForm);
        //   // this.$refs.goal.values=this.curNode.data.text; } else if (typeof res == "boolean") {
        //   // this.$refs.goal.refreshData(this.from) this.dialogVisibleFourth = res;
        // }) console.log("接收子组件的值2222222----", this.dialogVisibleFourth);
//         this.$set(this.newForm,'text',this.curNode.data.text) }
//         this.$forceUpdate() },
        // this.form.text=this.curNode.data.text;
        console.log('chuanhuo=====', this.newForm);
      }else if(typeof(res)=='boolean'){
         this.dialogVisibleFourth=res;
         console.log('接收子组件的值2222222----',this.dialogVisibleFourth);
      }
    },
//    //浏览 //    //浏览
scanTree(type){ // scanTree(type){
      if(this.form.connection){ //       if(this.form.connection){
        this.$refs.establishDia.database(this.form.connection); //         this.$refs.establishDia.database(this.form.connection);
        console.log('当前选中数据库***************',this.form.connection); //         console.log('当前选中数据库***************',this.form.connection);
        if(this.form.connection){ //         if(this.form.connection){
          this.$refs.establishDia.scanDialogOpen(); //           this.$refs.establishDia.scanDialogOpen();
          this.chooseFlag=true; //           this.chooseFlag=true;
          this.chooseType=type; //           this.chooseType=type;
        } //         }
      }else{ //       }else{
        this.$message.error('请选择数据库') //         this.$message.error('请选择数据库')
      } //       }
    }, //     },
//获取新建弹窗返回来的值 //获取新建弹窗返回来的值
// getSonValue(res){ // getSonValue(res){
...@@ -245,72 +254,45 @@ export default { ...@@ -245,72 +254,45 @@ export default {
//获取新建弹窗返回来的值 //获取新建弹窗返回来的值
// 查询已经建立的所有数据库列表 // 查询已经建立的所有数据库列表
listNames(){ listNames() {
listNames().then(res=>{ listNames().then((res) => {
if (res) { if (res) {
console.log('获取所有已经创建的数据库列表:',res); console.log("获取所有已经创建的数据库列表:", res);
this.namesList=res; this.namesList = res;
}else { } else {
this.$message.error(res.errMsg) this.$message.error(res.errMsg);
} }
}) });
}, },
dialogVisibleFourthNew() {
this.dialogVisibleFourth = true;
this.$refs.establishDia2.database();
this.$refs.establishDia2.accessMethod(); //获取连接方式
},
dialogVisibleFourthFun() {
this.dialogVisibleFourth = true;
this.$refs.establishDia2.database(this.connectionName);
},
getField(val) { getField(val) {
this.library = this.ComboBox.find((e) => { this.library = this.ComboBox.find((e) => {
return e.name == val; return e.name == val;
}); });
console.log(this.library); console.log(this.library);
this.connectionName = val;
}, },
addBrowsing() {
this.browsing = false;
addBrowsing(){ let mps = new FormData(); // 创建form对象
mps.append("graphXml", this.graphXml);
mps.append("databaseName", this.library.name);
mps.append("schema", "test");
mps.append("table", this.tableDetails.text);
tableFields(mps).then((res) => {
this.browsing = false
const that = this;
let flowObj = Object.assign({}, that.flowData);
var xml2js = require('xml2js');
//xml->json
//xml2js默认会把子子节点的值变为一个数组, explicitArray设置为false
var xmlParser = new xml2js.Parser({explicitArray : false, ignoreAttrs : true})
//json->xml
var jsonBuilder = new xml2js.Builder();
//测试用例
var xml = "<root>flowObj xml2js!</root>";
var obj = flowObj
console.log('----------');
// xml -> json
xmlParser.parseString(xml, function (err, result) {
//将返回的结果再次格式化
console.log(JSON.stringify(result));
});
console.log('----------');
//json --> xml
var builder = new xml2js.Builder();
var jsonxml = builder.buildObject(obj);
console.log(jsonxml);
console.log('----------');
let mps = new FormData(); // 创建form对象
mps.append("graphXml", flowObj);
mps.append("databaseName", "127");
mps.append("schema", "test");
mps.append("table", "R_CLUSTER");
tableFields(mps).then(res=>{
console.log(res); console.log(res);
}) });
}, },
SQLPopup() { SQLPopup() {
...@@ -392,10 +374,12 @@ export default { ...@@ -392,10 +374,12 @@ export default {
// if (node.level > this.PopupFrom.length) return resolve([]); // if (node.level > this.PopupFrom.length) return resolve([]);
}, },
handleNodeClick(data,node) { handleNodeClick(data, node) {
console.log('点击当前节点node===',node); console.log("点击当前节点node===", node);
console.log('点击当前节点data===',data); console.log("点击当前节点data===", data);
this.tableDetails = data
}, },
handleClose(done) { handleClose(done) {
......
...@@ -214,9 +214,9 @@ ...@@ -214,9 +214,9 @@
<el-table :data="sheets" 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="startcol" label="起始行">
</el-table-column> </el-table-column>
<el-table-column prop="startcol" label="起始列"> <el-table-column prop="startrow" label="起始列">
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
...@@ -598,11 +598,11 @@ ...@@ -598,11 +598,11 @@
</el-form-item> </el-form-item>
<el-form-item label="起始行:"> <el-form-item label="起始行:">
<el-input v-model="workForm.startLine"></el-input> <el-input v-model="workForm.startcol"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="起始列:"> <el-form-item label="起始列:">
<el-input v-model="workForm.startColumn"></el-input> <el-input v-model="workForm.startrow"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -692,7 +692,12 @@ ...@@ -692,7 +692,12 @@
width="800px" width="800px"
:before-close="handleClose" :before-close="handleClose"
> >
<tableInput :disabled="true" :connectionNode="connectionNode"> <tableInput
:disabled="true"
:connectionNode="connectionNode"
:form="form"
:graphXml="graphXml"
>
</tableInput> </tableInput>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -816,30 +821,70 @@ ...@@ -816,30 +821,70 @@
:doubleClickCell="doubleClickCell" :doubleClickCell="doubleClickCell"
:getXmlVal="getXmlVal" :getXmlVal="getXmlVal"
@fathertrans="fathertrans" @fathertrans="fathertrans"
:saveOutputDialog="saveOutputDialog" :tableOutForm="outPutFormData"></outDialog> :saveOutputDialog="saveOutputDialog"
:tableOutForm="outPutFormData"
></outDialog>
<insertOrUpdate <insertOrUpdate
ref="insertOrdate" ref="insertOrdate"
:InsertOrUpdateVisible.sync="InsertOrUpdateVisible" :InsertOrUpdateVisible.sync="InsertOrUpdateVisible"
:saveOutputDialog="saveOutputDialog" :doubleClickCell="doubleClickCell" :getXmlVal="getXmlVal" :insertOrUpdateForm="outPutFormData"></insertOrUpdate> :saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell"
:getXmlVal="getXmlVal"
:insertOrUpdateForm="outPutFormData"
></insertOrUpdate>
<excelOutPutDialog <excelOutPutDialog
ref="excelOut" ref="excelOut"
:excelOutPutVisible.sync="excelOutPutVisible" :excelOutPutVisible.sync="excelOutPutVisible"
:saveOutputDialog="saveOutputDialog" :doubleClickCell="doubleClickCell" :excelForm="outPutFormData"></excelOutPutDialog> :saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell"
:excelForm="outPutFormData"
></excelOutPutDialog>
<updateDialog <updateDialog
ref="update" ref="update"
:updateVisible.sync="updateVisible" :updateVisible.sync="updateVisible"
:saveOutputDialog="saveOutputDialog" :doubleClickCell="doubleClickCell" :updateForm="outPutFormData"></updateDialog> :saveOutputDialog="saveOutputDialog"
<synDialog ref="syn" :synVisible.sync="synVisible" :saveOutputDialog="saveOutputDialog" :doubleClickCell="doubleClickCell" :synForm="outPutFormData"></synDialog> :doubleClickCell="doubleClickCell"
<delDialog ref="del" :deleteVisible.sync="deleteVisible" :saveOutputDialog="saveOutputDialog" :doubleClickCell="doubleClickCell" :deleteForm="outPutFormData"></delDialog> :updateForm="outPutFormData"
<sqlDialog ref="sql" :sqlVisible.sync="sqlVisible" :saveOutputDialog="saveOutputDialog" :doubleClickCell="doubleClickCell" :sqlForm="outPutFormData"></sqlDialog> ></updateDialog>
<synDialog
ref="syn"
:synVisible.sync="synVisible"
:saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell"
:synForm="outPutFormData"
></synDialog>
<delDialog
ref="del"
:deleteVisible.sync="deleteVisible"
:saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell"
:deleteForm="outPutFormData"
></delDialog>
<sqlDialog
ref="sql"
:sqlVisible.sync="sqlVisible"
:saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell"
:sqlForm="outPutFormData"
></sqlDialog>
<textFileDialog <textFileDialog
ref="textFile" ref="textFile"
:fileVisible.sync="fileVisible" :fileVisible.sync="fileVisible"
:saveOutputDialog="saveOutputDialog" :textFileForm="outPutFormData"></textFileDialog> :saveOutputDialog="saveOutputDialog"
<microDialog ref="mic" :microVisible.sync="microVisible" :saveOutputDialog="saveOutputDialog" :tableOutForm="outPutFormData"></microDialog> :textFileForm="outPutFormData"
></textFileDialog>
<microDialog
ref="mic"
:microVisible.sync="microVisible"
:saveOutputDialog="saveOutputDialog"
:tableOutForm="outPutFormData"
></microDialog>
<!-- 输出弹窗end================== --> <!-- 输出弹窗end================== -->
<trans-graph :transGraphVisible.sync="transGraphVisible" :getXmlVal="getXmlVal"></trans-graph> <trans-graph
:transGraphVisible.sync="transGraphVisible"
:getXmlVal="getXmlVal"
></trans-graph>
</div> </div>
</template> </template>
...@@ -895,7 +940,6 @@ const { ...@@ -895,7 +940,6 @@ const {
mxGeometry, mxGeometry,
} = mxgraph; } = mxgraph;
export default { export default {
// props: { // props: {
// dialogVisibleFourth: { // dialogVisibleFourth: {
...@@ -909,9 +953,9 @@ export default { ...@@ -909,9 +953,9 @@ export default {
data() { data() {
return { return {
outPutFormData:{},//输出弹窗组件的表单值 outPutFormData: {}, //输出弹窗组件的表单值
doubleClickCell:{}, doubleClickCell: {},
transGraphVisible:false,//执行转换弹窗 transGraphVisible: false, //执行转换弹窗
monitorCanvas: "", //监听画布 monitorCanvas: "", //监听画布
getXmlVal: "", //获取上一个xml getXmlVal: "", //获取上一个xml
keyHandler: null, keyHandler: null,
...@@ -919,8 +963,8 @@ export default { ...@@ -919,8 +963,8 @@ export default {
graphXml: "", graphXml: "",
xmlDocuments: "", //获取解码的xml xmlDocuments: "", //获取解码的xml
boxInformation: "", //弹框信息 boxInformation: "", //弹框信息
toolItemData:{},//新增节点时的值 toolItemData: {}, //新增节点时的值
doubleClickCell:{},//双击节点 doubleClickCell: {}, //双击节点
// mxl================================= // mxl=================================
InsertOrUpdateVisible: false, InsertOrUpdateVisible: false,
...@@ -958,15 +1002,7 @@ export default { ...@@ -958,15 +1002,7 @@ export default {
activeName: "file", activeName: "file",
fieldType: [], fieldType: [],
fieldFormat: [], fieldFormat: [],
fields: [ fields: [],
{
filemask: "",
name: "王小虎",
exclude_filemask: "",
file_required: "0",
include_subfolders: "1",
},
],
engine: [], engine: [],
// 画布模块 // 画布模块
...@@ -1073,7 +1109,7 @@ export default { ...@@ -1073,7 +1109,7 @@ export default {
// this.setXml(); // this.setXml();
// this.getXml(); // this.getXml();
// } // }
// } // }
// } // }
}, },
...@@ -1081,6 +1117,8 @@ export default { ...@@ -1081,6 +1117,8 @@ export default {
this.createGraph(); this.createGraph();
this.initToolbar(); this.initToolbar();
this.initGraph(); this.initGraph();
console.log(this.blankCanvas, 7987987987);
this.$refs.container.style.background = 'url("./mxgraph/images/grid.gif")'; this.$refs.container.style.background = 'url("./mxgraph/images/grid.gif")';
}, },
...@@ -1106,8 +1144,18 @@ export default { ...@@ -1106,8 +1144,18 @@ export default {
excelLnputDetermine() { excelLnputDetermine() {
this.excelLnput = !this.excelLnput; this.excelLnput = !this.excelLnput;
for (let name in this.form) { console.log(this.fieldForm);
var edit = new mxCellAttributeChange(this.nodeData,name,this.form[name]); this.form.file = JSON.stringify(this.file);
this.form.sheets = JSON.stringify(this.sheets);
this.form.fields = JSON.stringify(this.fields);
console.log(this.form,456);
// this.fields()
for (let name in this.form) {
var edit = new mxCellAttributeChange(
this.nodeData,
name,
this.form[name]
);
this.graph.getModel().execute(edit); this.graph.getModel().execute(edit);
} }
console.log(edit, 4564564564654); console.log(edit, 4564564564654);
...@@ -1257,15 +1305,13 @@ export default { ...@@ -1257,15 +1305,13 @@ export default {
this.graph.setAllowDanglingEdges(false); this.graph.setAllowDanglingEdges(false);
this.graph.setDisconnectOnMove(false); this.graph.setDisconnectOnMove(false);
this.graph.setMultigraph(false); this.graph.setMultigraph(false);
this.graph.convertValueToString = (cell) => { this.graph.convertValueToString = (cell) => {
var label = cell.getAttribute("label");
var label = cell.getAttribute('label');
// var icon = cell.getAttribute(cell.style.split("image=")) // var icon = cell.getAttribute(cell.style.split("image="))
return label; return label;
// console.log(cell.value.attributes,99999999999999); // console.log(cell.value.attributes,99999999999999);
// if (!cell.title && cell.value) { // if (!cell.title && cell.value) {
// console.log("======11=",cell.value); // console.log("======11=",cell.value);
...@@ -1273,21 +1319,15 @@ export default { ...@@ -1273,21 +1319,15 @@ export default {
// if(cell.value.attributes["ctype"]){ // if(cell.value.attributes["ctype"]){
// cell.title = cell.value.attributes["ctype"]["value"]; // cell.title = cell.value.attributes["ctype"]["value"];
// } // }
// // cell.title = cell.value.attribllutes.label.value; // // cell.title = cell.value.attribllutes.label.value;
// } // }
// cell.ctype = cell.value.attributes.ctype.value;
// cell.ctype = cell.value.attributes.ctype.value;
// let imgs = img.split("="); // let imgs = img.split("=");
// // let d = imgs[1] // // let d = imgs[1]
// console.log(imgs); // console.log(imgs);
// const styleObj = { // const styleObj = {
...@@ -1306,12 +1346,9 @@ export default { ...@@ -1306,12 +1346,9 @@ export default {
// const style = Object.keys(styleObj) // const style = Object.keys(styleObj)
// .map((attr) => `${attr}=${styleObj[attr]}`) // .map((attr) => `${attr}=${styleObj[attr]}`)
// .join(";"); // .join(";");
// cell.style = style // cell.style = style
// console.log(this.R.prop("title", cell),132132); // console.log(this.R.prop("title", cell),132132);
// return this.R.prop("title", cell); // return this.R.prop("title", cell);
}; };
...@@ -1365,91 +1402,127 @@ export default { ...@@ -1365,91 +1402,127 @@ export default {
inputOutputFields().then((res) => {}); inputOutputFields().then((res) => {});
if (cell.ids == "step1" || cell.value.attributes.ctype.value == "ExcelInput") { if (
cell.ids == "step1" ||
cell.value.attributes.ctype.value == "ExcelInput"
) {
this.excelLnput = !this.excelLnput; this.excelLnput = !this.excelLnput;
this.form = {}; this.form = {};
let q = {}; let q = {};
let obj = cell.value.attributes; let obj = cell.value.attributes;
for (let vel in obj) { for (let vel in obj) {
let key = obj[vel]; let key = obj[vel];
q[key.name] = key.value; q[key.name] = key.value;
} }
this.form = q q.file = JSON.parse(q.file)
q.sheets = JSON.parse(q.sheets)
q.fields = JSON.parse(q.fields)
console.log(q,45646546464);
this.form = q;
this.sheets = q.sheets
this.fields = q.fields
this.file = q.file
return; return;
} else if (
} else if (cell.ids == "step7" || cell.value.attributes.ctype.value == "TableInput") { cell.ids == "step7" ||
cell.value.attributes.ctype.value == "TableInput"
) {
this.TableInputDialog = !this.TableInputDialog; this.TableInputDialog = !this.TableInputDialog;
var enc = new mxCodec(mxUtils.createXmlDocument());
var node = enc.encode(this.graph.getModel());
this.graphXml = mxUtils.getPrettyXml(node);
this.form = {}; this.form = {};
let q = {}; let q = {};
let obj = cell.value.attributes; let obj = cell.value.attributes;
for (let vel in obj) { for (let vel in obj) {
let key = obj[vel]; let key = obj[vel];
q[key.name] = key.value; q[key.name] = key.value;
} }
this.form = q
this.form = q;
this.form.sql = decodeURIComponent( this.form.sql)
console.log(this.form,456465465);
return; return;
} else if (
} else if (cell.ids == "step6" || cell.value.attributes.ctype.value == "SystemInfo") { cell.ids == "step6" ||
cell.value.attributes.ctype.value == "SystemInfo"
) {
this.SystemInfoDialog = !this.SystemInfoDialog; this.SystemInfoDialog = !this.SystemInfoDialog;
this.form = {}; this.form = {};
let q = {}; let q = {};
let obj = cell.value.attributes; let obj = cell.value.attributes;
for (let vel in obj) { for (let vel in obj) {
let key = obj[vel]; let key = obj[vel];
q[key.name] = key.value; q[key.name] = key.value;
} }
this.form = q this.form = q;
return; return;
} else if (
} else if (cell.ids == "step5" || cell.value.attributes.ctype.value == "DataGrid") { cell.ids == "step5" ||
cell.value.attributes.ctype.value == "DataGrid"
) {
this.ConstantDialog = !this.ConstantDialog; this.ConstantDialog = !this.ConstantDialog;
this.form = {}; this.form = {};
let q = {}; let q = {};
let obj = cell.value.attributes; let obj = cell.value.attributes;
for (let vel in obj) { for (let vel in obj) {
let key = obj[vel]; let key = obj[vel];
q[key.name] = key.value; q[key.name] = key.value;
} }
this.form = q this.form = q;
return; return;
} else if (
} else if (cell.ids == "step4" || cell.value.attributes.ctype.value == "RandomValue") { cell.ids == "step4" ||
cell.value.attributes.ctype.value == "RandomValue"
) {
this.RandomValueDialog = !this.RandomValueDialog; this.RandomValueDialog = !this.RandomValueDialog;
this.form = {}; this.form = {};
let q = {}; let q = {};
let obj = cell.value.attributes; let obj = cell.value.attributes;
for (let vel in obj) { for (let vel in obj) {
let key = obj[vel]; let key = obj[vel];
q[key.name] = key.value; q[key.name] = key.value;
} }
this.form = q this.form = q;
return; return;
} else if (
} else if (cell.ids == "step3" || cell.value.attributes.ctype.value == "RowGenerator") { cell.ids == "step3" ||
cell.value.attributes.ctype.value == "RowGenerator"
) {
this.RowGeneratorDialog = !this.RowGeneratorDialog; this.RowGeneratorDialog = !this.RowGeneratorDialog;
this.form = {}; this.form = {};
let q = {}; let q = {};
let obj = cell.value.attributes; let obj = cell.value.attributes;
for (let vel in obj) { for (let vel in obj) {
let key = obj[vel]; let key = obj[vel];
q[key.name] = key.value; q[key.name] = key.value;
} }
this.form = q this.form = q;
return; return;
} else if (
} else if (cell.ids == "step2" || cell.value.attributes.ctype.value == "TextFileInput") { cell.ids == "step2" ||
cell.value.attributes.ctype.value == "TextFileInput"
) {
this.TextFileInputDialog = !this.TextFileInputDialog; this.TextFileInputDialog = !this.TextFileInputDialog;
this.form = {}; this.form = {};
let q = {}; let q = {};
let obj = cell.value.attributes; let obj = cell.value.attributes;
for (let vel in obj) { for (let vel in obj) {
let key = obj[vel]; let key = obj[vel];
q[key.name] = key.value; q[key.name] = key.value;
} }
this.form = q this.form = q;
return; return;
} else if (cell.ids == "step17" || cell.value.attributes.ctype.value == "TableOutput" ) { } else if (
cell.ids == "step17" ||
cell.value.attributes.ctype.value == "TableOutput"
) {
//表输出 //表输出
this.tableOutPutVisible = !this.tableOutPutVisible; this.tableOutPutVisible = !this.tableOutPutVisible;
// let q = {}; // let q = {};
...@@ -1459,12 +1532,12 @@ this.form = {}; ...@@ -1459,12 +1532,12 @@ this.form = {};
// q[key.name] = key.value; // q[key.name] = key.value;
// } // }
this.outPutFormData = this.showDataFunc(); this.outPutFormData = this.showDataFunc();
return; return;
} else if (cell.ids == "step16") { } else if (cell.ids == "step16") {
//更新 //更新
this.updateVisible = !this.updateVisible; this.updateVisible = !this.updateVisible;
this.outPutFormData = this.showDataFunc(); this.outPutFormData = this.showDataFunc();
return; return;
} else if (cell.ids == "step15") { } else if (cell.ids == "step15") {
//文本文件输出 //文本文件输出
...@@ -1491,7 +1564,7 @@ this.form = {}; ...@@ -1491,7 +1564,7 @@ this.form = {};
this.sqlVisible = !this.sqlVisible; this.sqlVisible = !this.sqlVisible;
this.outPutFormData = this.showDataFunc(); this.outPutFormData = this.showDataFunc();
return; return;
}else if (cell.ids == "step10") { } else if (cell.ids == "step10") {
//mico-Excel输出 //mico-Excel输出
this.microVisible = !this.microVisible; this.microVisible = !this.microVisible;
// this.outPutFormData = this.showDataFunc(); // this.outPutFormData = this.showDataFunc();
...@@ -1512,15 +1585,14 @@ this.form = {}; ...@@ -1512,15 +1585,14 @@ this.form = {};
}); });
}, },
// 回显数据封装的方法 // 回显数据封装的方法
showDataFunc(){ showDataFunc() {
let q = {}; let q = {};
let obj = cell.value.attributes; let obj = cell.value.attributes;
for (let vel in obj) { for (let vel in obj) {
let key = obj[vel]; let key = obj[vel];
q[key.name] = key.value; q[key.name] = key.value;
} }
return q; return q;
}, },
...@@ -1543,8 +1615,8 @@ this.form = {}; ...@@ -1543,8 +1615,8 @@ this.form = {};
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 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);
...@@ -1566,7 +1638,7 @@ this.form = {}; ...@@ -1566,7 +1638,7 @@ this.form = {};
style style
); );
console.log(cell,4564564564); console.log(cell, 4564564564);
console.log(toolItem, 111111111111111111); console.log(toolItem, 111111111111111111);
cell.title = toolItem["title"]; cell.title = toolItem["title"];
cell.ids = toolItem["id"]; cell.ids = toolItem["id"];
...@@ -1839,16 +1911,11 @@ this.form = {}; ...@@ -1839,16 +1911,11 @@ this.form = {};
console.log(res); console.log(res);
if (res.success) { if (res.success) {
this.$message.success("保存流程成功!暂时请查先看控制台。"); this.$message.success("保存流程成功!暂时请查先看控制台。");
this.createGraph();
} else { } else {
this.$message.error(res.errMsg); this.$message.error(res.errMsg);
} }
}); });
}, },
// 转xml
createGraph() {
this.graph = new mxGraph(this.$refs.container);
},
// 执行转换 // 执行转换
doTrans() { doTrans() {
...@@ -1931,18 +1998,19 @@ this.form = {}; ...@@ -1931,18 +1998,19 @@ this.form = {};
// .catch(() => {}); // .catch(() => {});
}, },
//输出组件保存************************ //输出组件保存************************
saveOutputDialog(params){ saveOutputDialog(params) {
var outPutForm=params; var outPutForm = params;
console.log("子组件传回来的弹窗参数===",outPutForm); console.log("子组件传回来的弹窗参数===", outPutForm);
for(var name in outPutForm) { for (var name in outPutForm) {
var edit = new mxCellAttributeChange(this.doubleClickCell, name, outPutForm[name]); var edit = new mxCellAttributeChange(
this.graph.getModel().execute(edit); this.doubleClickCell,
name,
outPutForm[name]
);
this.graph.getModel().execute(edit);
} }
},
}
//输出组件保存******************/ //输出组件保存******************/
}, },
}; };
......
...@@ -1246,8 +1246,7 @@ props: ["dragItem"], ...@@ -1246,8 +1246,7 @@ props: ["dragItem"],
console.log('点击当前节点===',node); console.log('点击当前节点===',node);
this.curNode=node;//当前选中节点 this.curNode=node;//当前选中节点
this.nodePath=data.path;//当前选择数 this.nodePath=data.path;//当前选择数
this.curNodeIconCls=data.iconCls;//当前选中节点
this.nodePath=data.path;
console.log('当前节点的文件夹路径:',this.nodePath); console.log('当前节点的文件夹路径:',this.nodePath);
if(node.data.leaf){ if(node.data.leaf){
this.curNodeText=node.data.text;//当前节点 this.curNodeText=node.data.text;//当前节点
...@@ -1255,7 +1254,7 @@ props: ["dragItem"], ...@@ -1255,7 +1254,7 @@ 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;
// this.tabShowFlag=true;//核心对象显项卡显示 // this.tabShowFlag=true;//核心对象显项卡显示
this.activeName="second"; this.activeName="second";
......
...@@ -461,7 +461,8 @@ export default { ...@@ -461,7 +461,8 @@ export default {
linkCheckedIdx: -2 ,//当前选择连接类型列表 linkCheckedIdx: -2 ,//当前选择连接类型列表
methodHoverIdx:0,//鼠标移动到连接方式 methodHoverIdx:0,//鼠标移动到连接方式
methodCheckedIdx: 0,//当前选择连接方式列表 methodCheckedIdx: 0,//当前选择连接方式列表
createModel:{},//创建数据库 createModel:{
},//创建数据库
rulesOne:{ rulesOne:{
name:[ name:[
{required:true,message:'请输入名称',trigger:'blur'} {required:true,message:'请输入名称',trigger:'blur'}
...@@ -744,6 +745,7 @@ export default { ...@@ -744,6 +745,7 @@ export default {
this.methodHoverIdx=-1; this.methodHoverIdx=-1;
this.methodCheckedIdx=-2; this.methodCheckedIdx=-2;
this.createModel.type=item.value; this.createModel.type=item.value;
}, },
// 获取连接方式 // 获取连接方式
......
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