Commit bb5c77fa by 莫晓莉

自定义常量的保存和回显,mico-excel保存和回显

parent ed06c877
...@@ -227,6 +227,15 @@ export function inputOutputFields(data) { ...@@ -227,6 +227,15 @@ export function inputOutputFields(data) {
}) })
} }
//获取表输出
export function tableFields(data) {
return request({
url: 'etlweb/trans/tableFields',
data,
method: 'post'
})
}
//启动 //启动
export function doRun(data) { export function doRun(data) {
...@@ -253,6 +262,39 @@ export function drop(data) { ...@@ -253,6 +262,39 @@ export function drop(data) {
method: 'post' method: 'post'
}) })
} }
// 获取扩展名
export function excelType(data) {
return request({
url: 'etlweb/system/excelType',
data,
method: 'post'
})
}
// 如果输出文件中已存在工作表
export function excelwritemethod(data) {
return request({
url: 'etlweb/system/excelwritemethod',
data,
method: 'post'
})
}
//获取字段类型
export function getValueMetaStore(data) {
return request({
url: 'etlweb/system/valueMeta',
data,
method: 'post'
})
}
//获取字段格式
export function getValueFormatStore(data) {
return request({
url: 'etlweb/system/valueFormat',
data,
method: 'post'
})
}
......
<template> <template>
<div class="customConstant"> <div class="customConstant">
<el-dialog
title="自定义常量数据777"
:visible.sync="ConstantDialog"
width="800px"
:before-close="handleClose"
>
<el-form ref="form" :model="form" label-width="120px"> <el-form ref="form" :model="form" label-width="120px">
<el-form-item label="步骤名称:"> <el-form-item label="步骤名称:">
<el-input v-model="form.name"></el-input> <el-input v-model="form.name"></el-input>
...@@ -177,6 +185,16 @@ ...@@ -177,6 +185,16 @@
<el-button type="primary" @click="addValuePush">确 定</el-button> <el-button type="primary" @click="addValuePush">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<span slot="footer" class="dialog-footer">
<el-button @click="ConstantDialog = false">取 消</el-button>
<el-button type="primary" @click="myConfirm"
>确 定</el-button
>
</span>
</el-dialog>
</div> </div>
</template> </template>
...@@ -217,6 +235,18 @@ export default { ...@@ -217,6 +235,18 @@ export default {
}; };
}, },
watch:{
myForm(n, o) {
console.log("回显的表单数据===",n);
if(n){
var ny=JSON.parse(n.data);
var na=JSON.parse(n.fields);
this.data=ny;
this.tableData=na;
}
},
},
props:["ConstantDialog","saveOutputDialog","doubleClickCell","myForm"],
created() { created() {
this.valueFormatFun(); this.valueFormatFun();
...@@ -243,7 +273,8 @@ export default { ...@@ -243,7 +273,8 @@ export default {
addValuePush(){ addValuePush(){
this.addValue = !this.addValue this.addValue = !this.addValue
if (this.dataStatus) { if (this.dataStatus) {
this.data.push(this.ValueForm) this.data.push(this.ValueForm);
}else{ }else{
} }
...@@ -308,6 +339,22 @@ this.addValue = !this.addValue ...@@ -308,6 +339,22 @@ this.addValue = !this.addValue
this.fieldType = res; this.fieldType = res;
}); });
}, },
// mxl=========================
myConfirm(){
this.myForm.fields=JSON.stringify(this.tableData);//查询字段
this.myForm.data=JSON.stringify(this.data);//更新字段
this.myForm.label=this.form.name;
console.log('弹窗数据===',this.myForm);
this.saveOutputDialog(this.myForm);
this.handleClose();//关闭弹窗
},
handleClose(){
this.$emit("update:ConstantDialog", false);
},
// mxl=========================
}, },
}; };
</script> </script>
......
...@@ -721,7 +721,7 @@ ...@@ -721,7 +721,7 @@
</el-dialog> </el-dialog>
<!-- 自定义常量数据--> <!-- 自定义常量数据-->
<el-dialog <!-- <el-dialog
title="自定义常量数据" title="自定义常量数据"
:visible.sync="ConstantDialog" :visible.sync="ConstantDialog"
width="800px" width="800px"
...@@ -735,7 +735,10 @@ ...@@ -735,7 +735,10 @@
>确 定</el-button >确 定</el-button
> >
</span> </span>
</el-dialog> </el-dialog> -->
<!-- 自定义常量数据弹窗 -->
<customConstant :ConstantDialog.sync="ConstantDialog" :saveOutputDialog="saveOutputDialog" :doubleClickCell="doubleClickCell" :myForm="myoutPutFormData" > </customConstant>
<!-- 生成随机数--> <!-- 生成随机数-->
<el-dialog <el-dialog
...@@ -836,7 +839,7 @@ ...@@ -836,7 +839,7 @@
ref="textFile" ref="textFile"
:fileVisible.sync="fileVisible" :fileVisible.sync="fileVisible"
:saveOutputDialog="saveOutputDialog" :textFileForm="outPutFormData8"></textFileDialog> :saveOutputDialog="saveOutputDialog" :textFileForm="outPutFormData8"></textFileDialog>
<microDialog ref="mic" :microVisible.sync="microVisible" :saveOutputDialog="saveOutputDialog" :tableOutForm="outPutFormData9"></microDialog> <microDialog ref="mic" :microVisible.sync="microVisible" :saveOutputDialog="saveOutputDialog" :microForm="outPutFormData9" :doubleClickCell="doubleClickCell"></microDialog>
<!-- 输出弹窗end================== --> <!-- 输出弹窗end================== -->
<trans-graph :transGraphVisible.sync="transGraphVisible" :getXmlVal="getXmlVal"></trans-graph> <trans-graph :transGraphVisible.sync="transGraphVisible" :getXmlVal="getXmlVal"></trans-graph>
...@@ -909,6 +912,7 @@ export default { ...@@ -909,6 +912,7 @@ export default {
data() { data() {
return { return {
myoutPutFormData:{},
outPutFormData1:{}, outPutFormData1:{},
outPutFormData2:{}, outPutFormData2:{},
outPutFormData3:{}, outPutFormData3:{},
...@@ -968,13 +972,7 @@ export default { ...@@ -968,13 +972,7 @@ export default {
fieldType: [], fieldType: [],
fieldFormat: [], fieldFormat: [],
fields: [ fields: [
{
filemask: "",
name: "王小虎",
exclude_filemask: "",
file_required: "0",
include_subfolders: "1",
},
], ],
engine: [], engine: [],
...@@ -1500,7 +1498,7 @@ this.form = {}; ...@@ -1500,7 +1498,7 @@ this.form = {};
this.sqlVisible = !this.sqlVisible; this.sqlVisible = !this.sqlVisible;
this.outPutFormData7 = this.showDataFunc(); this.outPutFormData7 = this.showDataFunc();
return; return;
}else if (cell.ids == "step10") { }else if (cell.ids == "step10" || cell.value.attributes.ctype.value == "TypeExitExcelWriterStep" ) {
//mico-Excel输出 //mico-Excel输出
this.microVisible = !this.microVisible; this.microVisible = !this.microVisible;
this.outPutFormData9 = this.showDataFunc(); this.outPutFormData9 = this.showDataFunc();
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
:visible.sync="tableOutPutVisible" :visible.sync="tableOutPutVisible"
width="800px" width="800px"
:before-close="handleClose" :before-close="handleClose"
@open="dialogOpen"
top="10%" top="10%"
append-to-body> append-to-body>
...@@ -62,7 +61,7 @@ ...@@ -62,7 +61,7 @@
<el-select v-model="tableOutForm.partitioning_field" style="width: 100%" :disabled="tableOutForm.partitioning_enabled=='Y'? false :true"> <el-select v-model="tableOutForm.partitioning_field" style="width: 100%" :disabled="tableOutForm.partitioning_enabled=='Y'? false :true">
<!-- <el-option label="区域一" value="shanghai"></el-option> <!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> --> <el-option label="区域二" value="beijing"></el-option> -->
<el-option v-for="(item,index) in fieldsList" :key="index" :label="item.name" :value="item.name"></el-option> <el-option v-for="(item,index) in fieldsList2" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
...@@ -103,7 +102,7 @@ ...@@ -103,7 +102,7 @@
<el-select v-model="tableOutForm.tablename_field" :disabled="tableOutForm.tablename_in_field=='Y'? false :true" style="width: 100%"> <el-select v-model="tableOutForm.tablename_field" :disabled="tableOutForm.tablename_in_field=='Y'? false :true" style="width: 100%">
<!-- <el-option label="区域一" value="shanghai"></el-option> <!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> --> <el-option label="区域二" value="beijing"></el-option> -->
<el-option v-for="(item,index) in fieldsList" :key="index" :label="item.name" :value="item.name"></el-option> <el-option v-for="(item,index) in fieldsList2" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select> </el-select>
</el-col> </el-col>
...@@ -160,8 +159,8 @@ ...@@ -160,8 +159,8 @@
<!-- <el-checkbox-group v-model="checkedCities" style="width:100%;"> <!-- <el-checkbox-group v-model="checkedCities" style="width:100%;">
<el-checkbox > --> <el-checkbox > -->
<el-form-item label="表字段:"> <el-form-item label="表字段:">
<el-select v-model="fieldForm.column_name" style="width: 100%"> <el-select v-model="fieldForm.column_name" style="width: 100%" @focus="tableFields">
<el-option v-for="(item,index) in fieldsList" :key="index" :label="item.name" :value="item.name"></el-option> <el-option v-for="(item,index) in fieldsList1" :key="index" :label="item.name" :value="item.name"></el-option>
<!-- <el-option label="不去掉空格" value="none"></el-option> <!-- <el-option label="不去掉空格" value="none"></el-option>
<el-option label="去掉左空格" value="left"></el-option> <el-option label="去掉左空格" value="left"></el-option>
<el-option label="去掉右空格" value="right"></el-option> <el-option label="去掉右空格" value="right"></el-option>
...@@ -172,9 +171,9 @@ ...@@ -172,9 +171,9 @@
<!-- <el-checkbox > --> <!-- <el-checkbox > -->
<el-form-item label="流字段:"> <el-form-item label="流字段:">
<el-select v-model="fieldForm.stream_name" style="width: 100%"> <el-select v-model="fieldForm.stream_name" style="width: 100%" @focus="inputOutputFields">
<el-option v-for="(item,index) in fieldsList" :key="index" :label="item.name" :value="item.name"></el-option> <el-option v-for="(item,index) in fieldsList2" :key="index" :label="item.name" :value="item.name"></el-option>
<!-- <el-option label="不去掉空格" value="none"></el-option> <!-- <el-option label="不去掉空格" value="none"></el-option>
<el-option label="去掉左空格" value="left"></el-option> <el-option label="去掉左空格" value="left"></el-option>
<el-option label="去掉右空格" value="right"></el-option> <el-option label="去掉右空格" value="right"></el-option>
...@@ -220,9 +219,8 @@ const { ...@@ -220,9 +219,8 @@ const {
mxGeometry, mxGeometry,
} = mxgraph } = mxgraph
import { import {
tableFields,
inputOutputFields,//获取表输出 inputOutputFields,//获取表输出
} from "@/api/kettle/file"; } from "@/api/kettle/file";
export default ({ export default ({
data(){ data(){
...@@ -254,7 +252,8 @@ export default ({ ...@@ -254,7 +252,8 @@ export default ({
// }, // },
stepName:{}, stepName:{},
activeName:'content', activeName:'content',
fieldsList:[],//字段获取 fieldsList1:[],//字段获取
fieldsList2:[],//字段获取
// engine:[], // engine:[],
// tableData: [ // tableData: [
// { // {
...@@ -357,8 +356,8 @@ export default ({ ...@@ -357,8 +356,8 @@ export default ({
handleClose(){ handleClose(){
this.$emit("update:tableOutPutVisible", false); this.$emit("update:tableOutPutVisible", false);
}, },
//获取表输出
dialogOpen(){ tableFields(){
// var enc = new mxCodec(mxUtils.createXmlDocument()); // var enc = new mxCodec(mxUtils.createXmlDocument());
// var node = enc.encode(graph.getModel()); // var node = enc.encode(graph.getModel());
// console.log('获取===',node); // console.log('获取===',node);
...@@ -372,12 +371,29 @@ export default ({ ...@@ -372,12 +371,29 @@ export default ({
pamer.append("graphXml", this.getXmlVal); pamer.append("graphXml", this.getXmlVal);
pamer.append("before", true); pamer.append("before", true);
pamer.append("query", ''); pamer.append("query", '');
inputOutputFields(pamer).then(res=>{ tableFields(pamer).then(res=>{
console.log('字段',res); console.log('字段',res);
// this.blankCanvas = res // this.blankCanvas = res
this.fieldsList=res; this.fieldsList1=res;
}) })
}, },
//获取表输出
inputOutputFields(){
if(this.doubleClickCell){
var title=this.doubleClickCell.title
}
console.log('获取cell888888===',this.doubleClickCell);
let pamer = new FormData(); // 创建form对象
pamer.append("stepName", encodeURIComponent(title));
pamer.append("graphXml", this.getXmlVal);
pamer.append("before", true);
pamer.append("query", '');
inputOutputFields(pamer).then(res=>{
console.log('字段',res);
this.fieldsList2=res;
})
},
//新增或者编辑弹窗 //新增或者编辑弹窗
fieldClick(state, val) { fieldClick(state, val) {
......
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