Commit defd5d24 by 莫晓莉

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

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