Commit 31fb4075 by 莫晓莉

作业通用组件的保存回显

parent 9b343e11
...@@ -294,6 +294,23 @@ export function getValueFormatStore(data) { ...@@ -294,6 +294,23 @@ export function getValueFormatStore(data) {
method: 'post' method: 'post'
}) })
} }
// 获取日志级别列表
export function getLogLevelList(data) {
return request({
url: 'etlweb/system/logLevel',
data,
method: 'post'
})
}
// 获取变量有效范围
export function getVariableType(data) {
return request({
url: 'etlweb/system/variableType',
data,
method: 'post'
})
}
......
...@@ -148,7 +148,14 @@ export function steps(data){ ...@@ -148,7 +148,14 @@ export function steps(data){
method: 'post' method: 'post'
}) })
} }
//etl工具列表--通用
export function jobentrys(data){
return request({
url: 'etlweb/system/jobentrys',
data,
method: 'post'
})
}
//表格类型 //表格类型
...@@ -290,7 +297,7 @@ export function compressionProviderNames(data){ ...@@ -290,7 +297,7 @@ export function compressionProviderNames(data){
//保存 //保存转换流程图
export function save(data){ export function save(data){
return request({ return request({
url: 'etlweb/trans/save', url: 'etlweb/trans/save',
...@@ -298,6 +305,16 @@ export function save(data){ ...@@ -298,6 +305,16 @@ export function save(data){
method: 'post' method: 'post'
}) })
} }
// 保存作业流程图
export function saveJob(data){
return request({
url: 'etlweb/job/save',
data,
method: 'post'
})
}
//文件绝对路径 //文件绝对路径
...@@ -327,6 +344,16 @@ export function newStep(data){ ...@@ -327,6 +344,16 @@ export function newStep(data){
method: 'post' method: 'post'
}) })
} }
//获取弹框作业xml
export function newJobEntry(data){
return request({
url: 'etlweb/job/newJobEntry',
data,
method: 'post'
})
}
......
...@@ -77,6 +77,7 @@ Vue.prototype.R = R ...@@ -77,6 +77,7 @@ Vue.prototype.R = R
Vue.config.productionTip = false Vue.config.productionTip = false
const baseUrl = process.env.VUE_APP_BASE_API === '/' ? '' : process.env.VUE_APP_BASE_API const baseUrl = process.env.VUE_APP_BASE_API === '/' ? '' : process.env.VUE_APP_BASE_API
Vue.prototype.etlWeb = "http://147.1.3.180:9888/ETLWEB-SERVER/etlweb/" Vue.prototype.etlWeb = "http://147.1.3.180:9888/ETLWEB-SERVER/etlweb/"
// Vue.prototype.etlWeb = "http://192.168.0.44:9888/ETLWEB-SERVER/etlweb/"
new Vue({ new Vue({
router, router,
......
...@@ -22,12 +22,13 @@ ...@@ -22,12 +22,13 @@
</div> </div>
</template> </template>
<script> <script>
import { steps } from "@/api/kettle/link"; import { steps,jobentrys } from "@/api/kettle/link";
export default { export default {
name: "nodeMenu2", name: "nodeMenu2",
data() { data() {
return { return {
curNodeType:"",
defaultProps: { defaultProps: {
children: "children", children: "children",
label: "text", label: "text",
...@@ -40,24 +41,33 @@ export default { ...@@ -40,24 +41,33 @@ export default {
}, },
components: {}, components: {},
created() { created() {
this.stepsFun() this.stepsFun();
console.log(this.etlWeb,"yghjhkjhsakjhgkjashgkjsh"); console.log(this.etlWeb,"yghjhkjhsakjhgkjashgkjsh");
}, },
mounted() { mounted() {
}, },
beforeUpdate(){ // beforeUpdate(){
this.$emit('shooStatus',true) // this.$emit('shooStatus',true)
}, // },
methods: { methods: {
stepsFun() { stepsFun() {
let pamer = new FormData(); // 创建form对象 let pamer = new FormData(); // 创建form对象
pamer.append("node", "xnode-12"); pamer.append("node", "xnode-12");
this.$forceUpdate(); // this.$forceUpdate();
steps(pamer).then((res) => { steps(pamer).then((res) => {
this.data = res; this.data = res;
}); });
}, },
jobentrysFun(){
let pamer = new FormData(); // 创建form对象
pamer.append("node", "xnode-13");
// this.$forceUpdate();
jobentrys(pamer).then((res) => {
this.data = res;
});
}
}, },
}; };
</script> </script>
import main from './main.vue'
export default main
\ No newline at end of file
<template>
<div>
<!-- 浏览 -->
<el-dialog
title="资源库导出"
:visible.sync="exportDialogVisible"
width="650px"
top="15%"
:close-on-click-modal="false"
:before-close="handleCloseScan"
>
<!-- 文件夹存放区域start-->
<el-tree
:data="exTreeList"
:auto-expand-parent="true"
:default-expand-all="false"
node-key="id"
ref="tree"
:props="defaultProps"
:highlight-current="true"
@node-click="handleNodeClick">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span style="display: flex; align: center">
<div
:class="data.iconCls"
style="
display: inline-block;
width: 20px;
height: 20px;
background-repeat: no-repeat;
background-position: center;
"
width=""
alt=""
></div>
{{ node.label }}
</span>
</span>
</el-tree>
<!-- 文件夹存放区域end -->
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="handleClose">取 消</el-button> -->
<el-button type="primary" @click="confirmChoose()">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { exptree,expRespository,download } from "@/api/kettle/file";
export default {
name: "export-tree-choose",
data() {
return {
exTreeList:[],
defaultProps: {
label: "text",
children: "children",
},
checkedArr:[],
curChooseNode:null,//当前选择的节点
}
},
props:["exportDialogVisible","path","formName","directoryPath","myForm"],
created() {
this.exptree();
},
methods: {
//获取导出资源库树
exptree() {
let data = new FormData();
data.append("loadElement", 3);
data.append("node", "root");
exptree(data).then((res) => {
if (res) {
console.log("导出资源库树列表:", res);
this.exTreeList = res;
} else {
this.$message.error(res.errMsg);
}
});
},
// getCheckedNodes() {
// console.log('当前勾选的所有数据',this.$refs.tree.getCheckedNodes());
// var allCheckedsNodes=this.$refs.tree.getCheckedNodes();
// var checkedNodes=allCheckedsNodes.filter((item)=>{
// return item.children==null
// });
// var checkArr=[];
// checkedNodes.forEach(element => {
// var myObj={};
// myObj.path=element.path;
// myObj.type=element.type;
// checkArr.push(myObj);
// });
// this.checkedArr=checkArr;
// console.log('当前选择文件====',this.checkedArr);
// },
// //导出资源库
// expRespository() {
// if(this.checkedArr.length==0){
// this.$message.error('请先选择要导出文件');
// }
// let data = new FormData();
// data.append("data",JSON.stringify(this.checkedArr) );
// expRespository(data).then((res) => {
// if (res) {
// console.log("导出资源库:", res);
// // var link = document.createElement("a");
// // link.style.display = "none";
// // link.href = url;
// // link.setAttribute("download", "下载名称");
// // document.body.appendChild(link);
// // link.click();
// var url=this.etlWeb+`attachment/download?filePath=${res.message}&remove=true`
// window.open(url);
// } else {
// this.$message.error(res.errMsg);
// }
// });
// },
handleCloseScan() {
this.$emit("update:exportDialogVisible", false);
},
// 点击选择当前节点
handleNodeClick(data,node){
console.log('点击当前节点node===',node);
console.log('点击当前节点data===',data);
// var arr=[{node:node}]
this.curChooseNode=node;
// this.$emit("getSonValue", this.curChooseNode); //组件要传回父组件的值,关闭弹窗
},
confirmChoose() {
if(this.curChooseNode.isLeaf){
console.log(this.formName,1);
var curName=this.formName;
this.myForm[curName]=this.curChooseNode.data.text;
var myname=this.curChooseNode.data.text;
var mypath=this.curChooseNode.data.path;
console.log(mypath,2);
console.log(mypath.length,3);
console.log(myname.length,4);
this.myForm[this.directoryPath]=mypath.substring(0,mypath.length-myname.length );
console.log(mypath.substring(0,mypath.lenth-myname.length ));
console.log(this.myForm);
this.$emit("myForm",this.myForm);
// this.$emit("update:fileDialogVisible", false);
this.handleCloseScan();
}else{
this.$message.error("请选择文件下的节点!");
}
},
},
};
</script>
<style>
.type-checked {
background-color: #8888ff;
color: #fff;
}
</style>
<template>
<div>
<el-dialog
title="作业定时调度"
:visible.sync="jobStartVisible"
width="800px"
:before-close="handleClose"
top="10%"
>
<el-form ref="delForm" :model="myForm" label-width="200px">
<el-form-item label="重复:">
<el-row :gutter="10">
<el-col :span="23">
<el-checkbox v-model="myForm.repeat" true-label='Y' false-label="N"></el-checkbox>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="类型:">
<el-row :gutter="10">
<el-col :span="23">
<el-select v-model="myForm.schedulerType" style="width: 100%">
<el-option v-for="(item,index) in typeList" :key="index" :label="item.text" :value="item.value"></el-option>
</el-select>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="以秒计算的间隔:">
<el-row :gutter="10">
<el-col :span="23">
<el-input v-model="myForm.intervalSeconds"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="以分钟计算的间隔:">
<el-row :gutter="10">
<el-col :span="23">
<el-input v-model="myForm.intervalMinutes"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="每天:">
<el-row :gutter="10">
<el-col :span="12">
<el-input v-model="myForm.hour"></el-input>
</el-col>
<el-col :span="11">
<el-input v-model="myForm.minutes"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="每周:">
<el-row :gutter="10">
<el-col :span="23">
<el-input v-model="myForm.weekDay"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="每周:">
<el-row :gutter="10">
<el-col :span="23">
<el-input v-model="myForm.dayOfMonth"></el-input>
</el-col>
</el-row>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="jobStartVisible = false">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import mxgraph from "@/utils/mxgraph";
const {
mxGraph,
mxUtils,
mxEvent,
mxKeyHandler,
mxRubberband,
mxConstants,
mxStencilRegistry,
mxStencil,
mxCodec,
mxGraphModel,
mxGeometry,
} = mxgraph
import {
tableFields,
inputOutputFields,//获取表输出
} from "@/api/kettle/file";
export default ({
data(){
return{
myForm:{},//解决子组件改变父组件传递props属性报错
typeList:[{value: '0', text: '不需要定时'},
{value: '1', text: '时间间隔'},
{value: '2', text: '天'},
{value: '3', text: '周'},
{value: '4', text: '月'}],//类型写死
newGraph:{},
}
},
watch:{
// 解决子组件改变父组件传进来的变量的属性不报错start------
startFormSend(val){
console.log("回显的表单数据===",val);
this.myForm=val;
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props:["jobStartVisible","doubleClickCell","saveOutputDialog","startFormSend"],
mounted(){
},
methods:{
clickFun(graph){
console.log(graph,'双击获取值')
this.newGraph = graph;
},
handleClose(){
this.$emit("update:jobStartVisible", false);
},
confirm(){
// this.deleteForm.key=JSON.stringify(this.tableData);//字段复值
console.log('弹窗数据:===',this.myForm);
this.saveOutputDialog(this.myForm);
this.handleClose();//关闭弹窗
},
}
})
</script>
\ No newline at end of file
...@@ -86,7 +86,8 @@ ...@@ -86,7 +86,8 @@
<el-tab-pane label="核心对象" name="second" v-if="tabShowFlag"> <el-tab-pane label="核心对象" name="second" v-if="tabShowFlag">
<div class="sel-content"> <div class="sel-content">
<!-- 核心对象 --> <!-- 核心对象 -->
<nodeMenu2 @shooStatus="shooStatus"></nodeMenu2> <!-- <nodeMenu2 ref="nodeMenu2" @shooStatus="shooStatus"></nodeMenu2> -->
<nodeMenu2 ref="nodeMenu2" ></nodeMenu2>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -96,7 +97,8 @@ ...@@ -96,7 +97,8 @@
<el-tabs v-if="tabShowFlag" style="margin-top:-5vh;margin-bottom:0;" v-model="picName" type="card" closable @tab-remove="removeTab"> <el-tabs v-if="tabShowFlag" style="margin-top:-5vh;margin-bottom:0;" v-model="picName" type="card" closable @tab-remove="removeTab">
<!-- <el-tab-pane label="数据库名称" > --> <!-- <el-tab-pane label="数据库名称" > -->
<el-tab-pane :label="curNodeText" > <el-tab-pane :label="curNodeText" >
<mxgraph-designer ref="pic" v-if="mxGraphShow" :blankCanvas="blankCanvas"></mxgraph-designer> <!-- <mxgraph-designer ref="pic" v-if="mxGraphShow" :blankCanvas="blankCanvas"></mxgraph-designer> -->
<mxgraph-designer ref="graphContainer" :blankCanvas="blankCanvas"></mxgraph-designer>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -382,7 +384,7 @@ export default { ...@@ -382,7 +384,7 @@ export default {
props: ["dragItem"], props: ["dragItem"],
data() { data() {
return { return {
noneRespository:0, noneRespository:0,
curNodeText:'数据库名称',//当前点击选中的资源库节点 curNodeText:'数据库名称',//当前点击选中的资源库节点
blankCanvas:"",//空白画布xml blankCanvas:"",//空白画布xml
graph:null, graph:null,
...@@ -1240,6 +1242,7 @@ props: ["dragItem"], ...@@ -1240,6 +1242,7 @@ props: ["dragItem"],
this.$message.success('删除成功'); this.$message.success('删除成功');
// 刷新 // 刷新
this.explorer(''); this.explorer('');
this.$refs.graphContainer.createGraph();//刷新画布
} }
}) })
...@@ -1256,11 +1259,28 @@ props: ["dragItem"], ...@@ -1256,11 +1259,28 @@ props: ["dragItem"],
this.curNodeText=node.data.text;//当前节点 this.curNodeText=node.data.text;//当前节点
let pamer = new FormData(); // 创建form对象 let pamer = new FormData(); // 创建form对象
pamer.append("path", this.nodePath); pamer.append("path", this.nodePath);
pamer.append("type", "transformation"); // pamer.append("type", "transformation");
pamer.append("type", node.data.type);
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;//核心对象显项卡显示
//mxl判断作业和转换----------------------
if(node.data.type=="transformation"){
this.$refs.nodeMenu2.stepsFun();
let that=this;
setTimeout(function(){
that.$refs.graphContainer.initGraphClick("transformation");
},500)
}else if(node.data.type=="job"){
this.$refs.nodeMenu2.jobentrysFun();
let that=this;
setTimeout(function(){
that.$refs.graphContainer.initGraphClick("job");
},500)
}
// mxl判断作业和转换---------------------------
this.activeName="second"; this.activeName="second";
// var xmlDocument = mxUtils.parseXml(res); // var xmlDocument = mxUtils.parseXml(res);
......
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