Commit defd5d24 by 莫晓莉

Merge branch 'master' of http://139.159.239.83:9093/mxl/ETL-admin

parents ba50106f b68b010e
......@@ -73,7 +73,8 @@
"vuedraggable": "2.20.0",
"vuex": "3.1.0",
"wangeditor": "^3.1.1",
"xlsx": "^0.14.1"
"xlsx": "^0.14.1",
"xml2js": "^0.4.23"
},
"devDependencies": {
"@babel/core": "7.0.0",
......
......@@ -255,6 +255,17 @@ export function formatMapperLineTerminator(data){
//保存
export function save(data){
return request({
url: 'etlweb/trans/save',
data,
method: 'post'
})
}
......@@ -181,6 +181,7 @@
</template>
<script>
import { valueFormat, valueMeta } from "@/api/kettle/link";
export default {
// props: [""],
......
......@@ -154,6 +154,7 @@
</template>
<script>
import { valueFormat, valueMeta } from "@/api/kettle/link";
export default {
props: ["custom"],
......
......@@ -72,6 +72,7 @@
</template>
<script>
import { systemDataTypes } from "@/api/kettle/link";
export default {
props: [],
......
......@@ -78,6 +78,7 @@
<script>
import { randomValueFunc } from "@/api/kettle/link";
export default {
props: [""],
data() {
......
<template>
<div class="tableInput">
<el-form ref="from" :model="form" label-width="120px">
<el-form ref="stepName" :model="stepName" label-width="120px">
<el-form-item label="步骤名称:">
<el-input v-model="form.name"></el-input>
<el-input v-model="stepName.name"></el-input>
</el-form-item>
</el-form>
......@@ -34,10 +34,10 @@
</el-select> -->
</el-col>
<el-col class="line" :span="2">
<el-button size="mini">编辑</el-button></el-col
<el-button size="mini" >编辑</el-button></el-col
>
<el-col class="line" :span="2">
<el-button size="mini">新建</el-button></el-col
<el-button size="mini" @click="dialogVisibleFourth = true">新建</el-button></el-col
>
<el-col class="line" :span="2">
<el-button size="mini">向导</el-button></el-col
......@@ -83,6 +83,7 @@
</el-form-item>
</el-form>
<el-dialog
title="数据库浏览"
:visible.sync="browsing"
......@@ -101,17 +102,28 @@
<el-button type="primary" @click="browsing = false">确 定</el-button>
</span>
</el-dialog>
<estab-dialog ref="establishDia" :dialogVisibleFourth.sync='dialogVisibleFourth' @getSonValue="getSonValue" :listNames="listNames"></estab-dialog>
</div>
</template>
<script>
import { tableFields, explorer, listDatabases } from "@/api/kettle/link";
export default {
props: ["connectionNode"], //从父组件传过来的值
import main from '../../../mykettle/main'
import { tableFields, explorer, listDatabases,listNames } from "@/api/kettle/link";
export default {
props: ["connectionNode","stepName"], //从父组件传过来的值
components: {
main
},
data() {
return {
browsing: false,
dialogVisibleFourth:false,
form: {
wLazyConversion: false,
......@@ -135,6 +147,28 @@ export default {
methods: {
//获取新建弹窗返回来的值
getSonValue(res){
this.dialogVisibleFourth=res;
this.linkCheckedIdx=this.initlinkTypeIdx;//关闭弹窗后初始化选择oracle数据
this.methodHoverIdx=0;//关闭弹窗后初始化选择oracle数据对应第一条
this.methodCheckedIdx=0;//关闭弹窗后初始化选择oracle数据对应第一条
// this.addFlag=true;//增减变量改为编辑变量
},
//查询已经建立的所有数据库列表
listNames(){
listNames().then(res=>{
if (res) {
console.log('获取所有已经创建的数据库列表:',res);
this.namesList=res;
}else {
this.$message.error(res.errMsg)
}
})
},
getField(val) {
......@@ -182,6 +216,7 @@ let pam = new FormData(); // 创建form对象
} else {
this.$message.error("请选择数据库");
console.log(this.stepName);
}
......@@ -209,7 +244,7 @@ let pam = new FormData(); // 创建form对象
}, 500);
},
// handleNodeClick(data) {
handleNodeClick(data) {
// console.log(data);
// let pam = new FormData(); // 创建form对象
// pam.append("databaseInfo", JSON.stringify(this.library));
......@@ -221,7 +256,7 @@ let pam = new FormData(); // 创建form对象
// })
// },
},
......
......@@ -684,6 +684,7 @@
</template>
<script>
import { valueFormat, valueMeta,formatMapperLineTerminator,availableCharsets } from "@/api/kettle/link";
export default {
props: [""],
......
......@@ -667,7 +667,7 @@
>
<tableInput :disabled="true" :connectionNode="connectionNode"> </tableInput>
<tableInput :disabled="true" :connectionNode="connectionNode" :stepName="stepName"> </tableInput>
<span slot="footer" class="dialog-footer">
<el-button @click="TableInputDialog = false">取 消</el-button>
......@@ -810,6 +810,7 @@ import {
availableCharsets,
valueFormat,
valueMeta,
save
} from "@/api/kettle/link";
// 输入弹窗
import tableInput from "../appBulletFrame/tableInput";
......@@ -995,6 +996,7 @@ export default {
},
mounted() {
this.jsPlumb = jsPlumb.getInstance();
this.$nextTick(() => {
// 默认加载流程A的数据、在这里可以根据具体的业务返回符合流程数据格式的数据即可
const data_test = `{
......@@ -1561,7 +1563,7 @@ rows.splice(index, 1);
console.log("点击节点操作", node);
// this.$emit("dialogVisibleFourth",true);
// this.$emit('updata:dialogVisibleFourth',true); //触发showbox方法,true为向父组件传递的数据
this.stepName.name = node.name
this.stepName = node
this.connectionNode = this.publicData[node.id]
console.log(this.connectionNode);
this.isShowR = true;
......@@ -1576,7 +1578,6 @@ rows.splice(index, 1);
});
availableCharsets(pamer).then((res) => {
console.log(res,'745648745637654');
this.codingType = res;
});
......@@ -1670,7 +1671,44 @@ rows.splice(index, 1);
// localStorage.setItem("data_test", JSON.stringify(flowObj))
console.log("保存流程图", flowObj);
// if (!that.checkFlow()) return;
// that.$message.success("保存流程成功!暂时请查先看控制台。");
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 pamers = new FormData(); // 创建form对象
pamers.append("graphXml", jsonxml);
save(pamers).then(res=>{
console.log(res);
that.$message.success("保存流程成功!暂时请查先看控制台。");
})
},
//重绘流程图
clearFlow() {
......
......@@ -251,6 +251,7 @@
:visible.sync="testDialogueFlag"
width="650px"
top="15%"
append-to-body
:close-on-click-modal="false"
:before-close="handleCloseTest"
append-to-body>
......@@ -271,6 +272,7 @@
:visible.sync="featureDialogVisible"
width="700px"
top="7%"
append-to-body
:close-on-click-modal="false"
:before-close="handleCloseFeature"
append-to-body>
......@@ -297,6 +299,7 @@
:visible.sync="scanDialogVisible"
width="650px"
top="15%"
append-to-body
:close-on-click-modal="false"
:before-close="handleCloseScan"
v-if="scanFlag"
......
......@@ -1033,7 +1033,7 @@ export default {
left: left + 'px', //坐标
top: top + 'px', //坐标
ico: nodeMenu.icon, //图标
ids:nodeMenu.id
ids: nodeMenu.id //工具固定类型id
}
console.log(node);
......
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