Commit 629a3b65 by 李耀琨

导出xml

parent 582d0eb8
......@@ -409,3 +409,24 @@ export function locale(data){
method: 'post'
})
}
// 从文件获取字段
export function mappingFields(data){
return request({
url:'etlweb/trans/mappingFields',
data,
method: 'post'
})
}
// 获取日期格式
export function datetimeformat(data){
return request({
url:'etlweb/system/datetimeformat',
data,
method: 'post'
})
}
......@@ -62,9 +62,11 @@
</el-tab-pane>
<el-tab-pane label="命名参数">
<el-button type="text">添加字段</el-button>
<el-button type="text" @click="addParameters(true)"
>添加字段</el-button
>
<el-table :data="fields" style="width: 100%">
<el-table :data="parameters" style="width: 100%">
<el-table-column prop="name" label="命名参数"> </el-table-column>
<el-table-column prop="default_value" label="默认值">
......@@ -75,7 +77,7 @@
<el-table-column label="操作" width="100px">
<template slot-scope="scope">
<el-button
@click="fieldClick(false, scope.row)"
@click="addParameters(false, scope.row)"
type="text"
size="small"
>编辑</el-button
......@@ -83,7 +85,7 @@
<el-button
type="text"
size="small"
@click="deletefield(scope.$index, fields)"
@click="deleteField(scope.$index, parameters)"
>删除</el-button
>
</template>
......@@ -116,12 +118,23 @@
<el-form-item label="日志数据库连接:">
<el-row :gutter="10">
<el-col :span="18">
<el-input v-model="logEntry.connection"></el-input>
<el-select
v-model="logEntry.connection"
style="width: 100%"
@focus="getGraphDataBases"
clearable
>
<el-option
v-for="(item, index) in namesList"
:key="index"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-col>
<el-col class="line" :span="2">
<el-button type="primary" @click="metadata(true)"
>浏览</el-button
>
<el-button size="mini" @click.native="dialogVisibleFourthNew"
>新建</el-button>
</el-col>
</el-row>
</el-form-item>
......@@ -159,7 +172,7 @@
>
<el-table-column prop="enabled" label="启用">
<template slot-scope="scope">
{{ scope.row.enabled? "true" : "false" }}
{{ scope.row.enabled ? "true" : "false" }}
</template>
</el-table-column>
<el-table-column column prop="name" label="字段名称">
......@@ -189,38 +202,51 @@
</div>
</el-tab-pane>
<el-tab-pane label="日期">
<el-form :model="form" label-width="160px">
<el-form :model="maxdate" label-width="160px">
<el-form-item label="最大日期数据库连接:">
<el-input v-model="form.table"></el-input>
<el-select
v-model="maxdate.connection"
style="width: 100%"
@focus="getGraphDataBases"
clearable
>
<el-option
v-for="(item, index) in namesList"
:key="index"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
<el-form-item label="最大日期表:">
<el-input v-model="form.field"></el-input>
<el-input v-model="maxdate.table"></el-input>
</el-form-item>
<el-form-item label="最大日期字段:">
<el-input v-model="form.offset"></el-input>
<el-input v-model="maxdate.field"></el-input>
</el-form-item>
<el-form-item label="最大日期偏移(秒):">
<el-input v-model="form.maxdiff"></el-input>
<el-input v-model="maxdate.offset"></el-input>
</el-form-item>
<el-form-item label="最大日期区别(秒):">
<el-input v-model="form.maxdate"></el-input>
<el-input v-model="maxdate.maxdiff"></el-input>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="依赖">
<el-button type="text">添加字段</el-button>
<el-button type="text" @click="relyOn(true)">添加字段</el-button>
<el-table :data="fields" style="width: 100%">
<el-table-column prop="name" label="数据库连接"> </el-table-column>
<el-table :data=" dependencies" style="width: 100%">
<el-table-column prop="connection" label="数据库连接">
</el-table-column>
<el-table-column prop="default_value" label="表"> </el-table-column>
<el-table-column prop="table" label="表"> </el-table-column>
<el-table-column prop="description" label="字段"> </el-table-column>
<el-table-column prop="field" label="字段"> </el-table-column>
<el-table-column label="操作" width="100px">
<template slot-scope="scope">
<el-button
@click="fieldClick(false, scope.row)"
@click="relyOn(false, scope.row)"
type="text"
size="small"
>编辑</el-button
......@@ -228,7 +254,7 @@
<el-button
type="text"
size="small"
@click="deletefield(scope.$index, fields)"
@click="deleteField(scope.$index,dependencies)"
>删除</el-button
>
</template>
......@@ -307,17 +333,15 @@
</span>
</el-dialog>
<el-dialog
title="编辑"
:visible.sync="dialogVisible"
width="500px"
:before-close="handleCloseFun">
:before-close="handleCloseFun"
>
<el-form :model="determination" label-width="80px">
<el-form-item label="启用">
<el-select v-model="determination.enabled" >
<el-select v-model="determination.enabled">
<el-option label="true" :value="ree"></el-option>
<el-option label="false" :value="err"></el-option>
</el-select>
......@@ -327,32 +351,122 @@
<el-input v-model="determination.name"></el-input>
</el-form-item>
<el-form-item label="步骤名称">
<el-input v-model="determination.subject"></el-input>
<el-form-item label="步骤名称" v-if="this.switchState == 1">
<el-input v-model="determination.subject" ></el-input>
</el-form-item>
<el-form-item label="字段描述">
<el-input v-model="determination.description"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisibleFun">确 定</el-button>
</span>
</el-dialog>
</el-dialog>
<el-dialog
:title="this.addState? '添加' : '编辑'"
:visible.sync="parametersBox"
width="500px"
:before-close="ParametersCloseFun"
>
<el-form :model="parametersFise" label-width="80px">
<el-form-item label="字段名称">
<el-input v-model="parametersFise.name"></el-input>
</el-form-item>
<el-form-item label="步骤名称">
<el-input v-model="parametersFise.default_value"></el-input>
</el-form-item>
<el-form-item label="字段描述">
<el-input v-model="parametersFise.description"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="parametersBox = false">取 消</el-button>
<el-button type="primary" @click="ParametersBoxFun">确 定</el-button>
</span>
</el-dialog>
<el-dialog
:title="this.addState? '添加' : '编辑'"
:visible.sync="relyOnBox"
width="500px"
:before-close="relyOnCloseFun"
>
<el-form :model="relyOnFise" label-width="80px">
<el-form-item label="字段名称">
<el-select
v-model="relyOnFise.connection"
style="width: 100%"
@focus="getGraphDataBases"
clearable
>
<el-option
v-for="(item, index) in namesList"
:key="index"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
<el-form-item label="步骤名称">
<el-input v-model="relyOnFise.table"></el-input>
</el-form-item>
<el-form-item label="字段描述">
<el-input v-model="relyOnFise.field"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="relyOnBox = false">取 消</el-button>
<el-button type="primary" @click="PrelyOnBoxFun">确 定</el-button>
</span>
</el-dialog>
<estab-dialog
ref="establishDia"
:dialogVisibleFourth.sync="dialogVisibleFourth"
@getSonValue="getSonValue"
:listNames="listNames"
:scanDialogVisible.sync="scanDialogVisible"
:chooseType="chooseType"
:chooseFlag.sync="chooseFlag"
:form.sync="form"
:getXmlVal="getXmlVal"
:noneRespository="noneRespository"
:graph.sync="newGraph"
></estab-dialog>
</div>
</template>
<script>
import main from "../../../mykettle/main";
export default {
props: ["conversionSettingsDialog", "doubleClickCell", "form"],
components: {
main,
},
props: ["conversionSettingsDialog","getXmlVal", "form","saveOutputDialog1"],
data() {
return {
namesList: [],
fields: [],
liList: [
{
......@@ -378,11 +492,30 @@ export default {
],
logEntry: {},
tableData: [],
transLogTable:[],
stepLogTable:[],
performanceLogTable:[],
channelLogTable:[],
metricsLogTable:[],
switchState: 1,
dialogVisible:false,
determination:{},
err:false,
ree:true,
parametersBox:false,
dialogVisible: false,
parametersFise:{},
relyOnFise:{},
relyOnBox:false,
determination: {},
err: false,
ree: true,
maxdate: {},
parameters: [],
dependencies: [],
newGraph: {},
dialogVisibleFourth:false,
scanDialogVisible: false,
chooseType: "表",
chooseFlag: false,
noneRespository: 1, //判断是保存画布还是传后台
addState:false,
};
},
created() {},
......@@ -390,63 +523,183 @@ export default {
clickFun(graph, val) {
this.newGraph = graph;
console.log(val);
this.maxdate = JSON.parse(val.maxdate);
this.parameters = JSON.parse(val.parameters);
// this.dependencies = JSON.parse(val.dependencies);
this.transLogTable = JSON.parse(this.form.transLogTable).fields;
for (let i = 0; i < this.transLogTable.length; i++) {
this.transLogTable[i].description = decodeURIComponent(
this.transLogTable[i].description
);
}
this.stepLogTable = JSON.parse(this.form.stepLogTable).fields;
for (let i = 0; i < this.stepLogTable.length; i++) {
this.stepLogTable[i].description = decodeURIComponent(
this.stepLogTable[i].description
);
}
this.performanceLogTable = JSON.parse(this.form.performanceLogTable).fields;
for (let i = 0; i < this.performanceLogTable.length; i++) {
this.performanceLogTable[i].description = decodeURIComponent(
this.performanceLogTable[i].description
);
}
this.channelLogTable = JSON.parse(this.form.channelLogTable).fields;
for (let i = 0; i < this.channelLogTable.length; i++) {
this.channelLogTable[i].description = decodeURIComponent(
this.channelLogTable[i].description
);
}
this.metricsLogTable = JSON.parse(this.form.metricsLogTable).fields;
for (let i = 0; i < this.metricsLogTable.length; i++) {
this.metricsLogTable[i].description = decodeURIComponent(
this.metricsLogTable[i].description
);
}
console.log(this.form);
},
//删除
deleteField(index, rows){
rows.splice(index, 1);
},
handleCloseFun(){
this.dialogVisible = !this.dialogVisible
if (this.dialogVisible) {
getGraphDataBases() {
var root = this.newGraph.getDefaultParent(),
data = [];
if (root.getAttribute("databases") != null)
data = JSON.parse(root.getAttribute("databases"));
console.log("获取到画布上的databases====", data);
this.namesList = data;
},
// 查询已经建立的所有数据库列表
listNames() {
listNames().then((res) => {
if (res) {
console.log("获取所有已经创建的数据库列表:", res);
this.namesList = res;
} else {
this.$message.error(res.errMsg);
}
});
},
dialogVisibleFourthNew() {
this.dialogVisibleFourth = true;
// this.$refs.establishDia.database();
// this.$refs.establishDia.accessMethod(); //获取连接方式
this.$refs.establishDia.clickFun(this.newGraph); //先把画布传过去
this.$refs.establishDia.getTransDatabase();
this.$refs.establishDia.accessMethod(); //获取连接方式
},
getSonValue(res) {
if (typeof res == "string") {
this.formDataBaseName = res;
console.log("接收子组件的值1111111----", this.formDataBaseName);
} else if (typeof res == "object") {
console.log("接收子组件的值55555----", 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;
//         this.$set(this.newForm,'text',this.curNode.data.text)
//         this.$forceUpdate()
console.log("chuanhuo=====", this.newForm);
} else if (typeof res == "boolean") {
this.dialogVisibleFourth = res;
console.log("接收子组件的值2222222----", this.dialogVisibleFourth);
}
},
dialogVisibleFun(){
this.dialogVisible = !this.dialogVisible
handleCloseFun() {
this.dialogVisible = !this.dialogVisible;
if (this.dialogVisible) {
}
},
ParametersCloseFun(){
this.parametersBox = !this.parametersBox
if (this.parametersBox) {
}
},
relyOnCloseFun(){
this.relyOnBox = !this.relyOnBox
if (this.relyOnBox) {
}
},
ParametersBoxFun(){
this.parametersBox = !this.parametersBox
console.log(this.addState);
if (this.addState) {
this.parameters.push(this.parametersFise)
}else{
}
},
PrelyOnBoxFun(){
this.relyOnBox = !this.relyOnBox
if (this.addState) {
this.dependencies.push(this.relyOnFise)
}
},
dialogVisibleFun() {
this.dialogVisible = !this.dialogVisible;
if (this.switchState == 1) {
this.transLogTable.push(this.determination)
} else if (this.switchState == 2) {
this.stepLogTable.push(this.determination)
} else if (this.switchState == 3) {
this.performanceLogTable .push(this.determination)
} else if (this.switchState == 4) {
this.channelLogTable.push(this.determination)
} else if (this.switchState == 5) {
this.metricsLogTable.push(this.determination)
}
},
liListClick(val){
this.dialogVisible = !this.dialogVisible
liListClick(val) {
this.dialogVisible = !this.dialogVisible;
console.log(val);
this.determination = val
this.determination = val;
},
addParameters(state,val){
this.parametersBox = !this.parametersBox
this.addState = state
if (this.addState) {
this.parametersFise = {}
}else{
this.parametersFise = val
}
},
relyOn(state,val){
this.relyOnBox = !this.relyOnBox
this.addState = state
if (this.addState) {
this.relyOnFise = {}
}else{
this.relyOnFise = val
}
},
switchJournal(val) {
this.switchState = val.id;
console.log(val);
if (this.switchState == 1) {
console.log(JSON.parse(this.form.transLogTable).fields);
this.tableData = JSON.parse(this.form.transLogTable).fields;
for (let i = 0; i < this.tableData.length; i++) {
this.tableData[i].description = decodeURIComponent(this.tableData[i].description)
console.log(this.tableData[i].description);
}
this.tableData = this.transLogTable
} else if (this.switchState == 2) {
console.log(JSON.parse(this.form.stepLogTable));
this.tableData = JSON.parse(this.form.stepLogTable).fields;
for (let i = 0; i < this.tableData.length; i++) {
this.tableData[i].description = decodeURIComponent(this.tableData[i].description)
console.log(this.tableData[i].description);
}
this.tableData = this.stepLogTable
} else if (this.switchState == 3) {
console.log(JSON.parse(this.form.performanceLogTable));
this.tableData = JSON.parse(this.form.performanceLogTable).fields;
for (let i = 0; i < this.tableData.length; i++) {
this.tableData[i].description = decodeURIComponent(this.tableData[i].description)
console.log(this.tableData[i].description);
}
this.tableData = this.performanceLogTable
} else if (this.switchState == 4) {
console.log(JSON.parse(this.form.channelLogTable));
this.tableData = JSON.parse(this.form.channelLogTable).fields;
for (let i = 0; i < this.tableData.length; i++) {
this.tableData[i].description = decodeURIComponent(this.tableData[i].description)
console.log(this.tableData[i].description);
}
this.tableData = this.channelLogTable
} else if (this.switchState == 5) {
console.log(JSON.parse(this.form.metricsLogTable));
this.tableData = JSON.parse(this.form.metricsLogTable).fields;
for (let i = 0; i < this.tableData.length; i++) {
this.tableData[i].description = decodeURIComponent(this.tableData[i].description)
console.log(this.tableData[i].description);
}
this.tableData = this.metricsLogTable
}
},
handleClose() {
......@@ -454,7 +707,44 @@ export default {
},
conversionSettingsDialogFun() {
this.form.maxdate = JSON.stringify(this.maxdate)
this.form.parameters = JSON.stringify(this.parameters)
this.form.transLogTable = JSON.parse(this.form.transLogTable)
this.form.stepLogTable = JSON.parse(this.form.stepLogTable)
this.form.performanceLogTable = JSON.parse(this.form.performanceLogTable)
this.form.channelLogTable = JSON.parse(this.form.channelLogTable)
this.form.metricsLogTable = JSON.parse(this.form.metricsLogTable)
this.form.transLogTable.fields = this.transLogTable
this.form.stepLogTable.fields = this.stepLogTable
this.form.performanceLogTable.fields = this.performanceLogTable
this.form.channelLogTable.fields = this.channelLogTable
this.form.metricsLogTable.fields = this.metricsLogTable
this.form.transLogTable = JSON.stringify(this.form.transLogTable)
this.form.stepLogTable = JSON.stringify(this.form.stepLogTable)
this.form.performanceLogTable = JSON.stringify(this.form.performanceLogTable)
this.form.channelLogTable = JSON.stringify(this.form.channelLogTable)
this.form.metricsLogTable = JSON.stringify(this.form.metricsLogTable)
// this.form.transLogTable = JSON.stringify(this.transLogTable)
// this.form.stepLogTable = JSON.stringify(this.stepLogTable)
// this.form.performanceLogTable = JSON.stringify(this.performanceLogTable)
// this.form.channelLogTable = JSON.stringify(this.channelLogTable)
// this.form.metricsLogTable = JSON.stringify(this.metricsLogTable)
this.handleClose();
console.log(this.form);
this.saveOutputDialog1(this.form)
},
},
};
......
......@@ -10,34 +10,36 @@
<el-form-item label="步骤名称:">
<el-input v-model="form.label"></el-input>
</el-form-item>
</el-form>
<el-tabs type="border-card">
<el-tab-pane label="一般">
<el-card class="box-card">
<el-form :model="logEntry" label-width="160px">
<el-form :model="form" label-width="160px">
<el-form-item label="资源库"> </el-form-item>
<el-form-item label="资源库名称">
<el-row :gutter="10">
<el-col :span="20">
<el-input v-model="logEntry.connection"></el-input>
</el-col>
<el-col class="line" :span="2">
<el-button type="primary" @click="metadata(true)"
>资源库</el-button
<el-select
v-model="form.repositoryname"
style="width: 100%"
@focus="getGraphDataBases"
clearable
>
</el-col>
</el-row>
<el-option
v-for="(item, index) in namesList"
:key="index"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
<el-form-item label="资源库有户名">
<el-input v-model="logEntry.name"></el-input>
<el-input v-model="form.username"></el-input>
</el-form-item>
<el-form-item label="资源库密码">
<el-input v-model="logEntry.name"></el-input>
<el-input v-model="form.password"></el-input>
</el-form-item>
<el-row :gutter="10">
<el-col class="line" :span="4" :offset="20">
......@@ -51,26 +53,49 @@
<br />
<el-card class="box-card">
<el-form :model="logEntry" label-width="160px">
<el-form :model="form" label-width="160px">
<el-form-item label="设置"> </el-form-item>
<el-form-item label="导出类型">
<el-select
v-model="logEntry.trans_status"
style="width: 100%"
>
<el-option label="草案" value="shanghai"></el-option>
<el-option label="产品" value="beijing"></el-option>
<el-select v-model="form.export_type" style="width: 100%">
<el-option label="导出所有" value="export_all"></el-option>
<el-option label="只导出作业" value="export_jobs"></el-option>
<el-option
label="只导出转换"
value="export_trans"
></el-option>
<el-option
label="按目录导出"
value="export_by_folder"
></el-option>
<el-option
label="导出第一个目录"
value="export_one_folder"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="文件夹名称">
<el-row :gutter="10">
<el-col :span="20">
<el-input v-model="logEntry.connection"></el-input>
<el-input
v-model="form.directoryPath"
:disabled="
form.export_type === 'export_by_folder' ||
form.export_type === 'export_all' ||
form.export_type === 'export_jobs' ||
form.export_type === 'export_trans'
"
></el-input>
</el-col>
<el-col class="line" :span="2">
<el-button type="primary" @click="metadata(true)"
:disabled="
form.export_type === 'export_by_folder' ||
form.export_type === 'export_all' ||
form.export_type === 'export_jobs' ||
form.export_type === 'export_trans'
"
>浏览</el-button
>
</el-col>
......@@ -79,9 +104,15 @@
<el-form-item label="新建文件夹">
<el-checkbox
v-model="conversionForm.capture_step_performance"
v-model="form.newfolder"
true-label="Y"
false-label="N"
:disabled="
form.export_type === 'export_one_folder' ||
form.export_type === 'export_all' ||
form.export_type === 'export_jobs' ||
form.export_type === 'export_trans'
"
></el-checkbox>
</el-form-item>
</el-form>
......@@ -89,30 +120,25 @@
<br />
<el-card class="box-card">
<el-form :model="logEntry" label-width="160px">
<el-form :model="form" label-width="160px">
<el-form-item label="目标"> </el-form-item>
<el-form-item label="文件夹名称">
<el-form-item label="目标文件夹/文件名">
<el-row :gutter="10">
<el-col :span="17">
<el-input v-model="logEntry.connection"></el-input>
<el-col :span="20">
<el-input v-model="form.targetfilename"></el-input>
</el-col>
<el-col class="line" :span="3">
<el-button type="primary" @click="metadata(true)"
<el-button type="primary" @click="selectFilePath()"
>文件</el-button
>
</el-col>
<el-col class="line" :span="3">
<el-button type="primary" @click="metadata(true)"
>文件夹</el-button
>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="新建文件夹">
<el-checkbox
v-model="conversionForm.capture_step_performance"
v-model="form.createfolder"
true-label="Y"
false-label="N"
></el-checkbox>
......@@ -120,23 +146,25 @@
<el-form-item label="添加日期到文件夹">
<el-checkbox
v-model="conversionForm.capture_step_performance"
v-model="form.add_date"
true-label="Y"
false-label="N"
:disabled="form.SpecifyFormat == 'Y'"
></el-checkbox>
</el-form-item>
<el-form-item label="添加时间到文件夹">
<el-checkbox
v-model="conversionForm.capture_step_performance"
v-model="form.add_time"
true-label="Y"
false-label="N"
:disabled="form.SpecifyFormat == 'Y'"
></el-checkbox>
</el-form-item>
<el-form-item label="指定日期时间格式">
<el-checkbox
v-model="conversionForm.capture_step_performance"
v-model="form.SpecifyFormat"
true-label="Y"
false-label="N"
></el-checkbox>
......@@ -144,27 +172,43 @@
<el-form-item label="日期时间格式">
<el-select
v-model="logEntry.trans_status"
v-model="form.date_time_format"
style="width: 100%"
:disabled="form.SpecifyFormat == 'N'"
>
<el-option label="草案" value="shanghai"></el-option>
<el-option label="产品" value="beijing"></el-option>
<el-option
v-for="item in dateFormat"
:key="item.index"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="如果目标文件存在">
<el-select
v-model="logEntry.trans_status"
style="width: 100%"
>
<el-option label="草案" value="shanghai"></el-option>
<el-option label="产品" value="beijing"></el-option>
<el-select v-model="form.iffileexists" style="width: 100%">
<el-option
label="跳过"
value="if_file_exists_skip"
></el-option>
<el-option
label="替换文件"
value="success_if_errors_less"
></el-option>
<el-option
label="create file with unique name"
value="if_file_exists_uniquename"
></el-option>
<el-option
label="失败"
value="success_if_no_errors"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="添加文件名到结果">
<el-checkbox
v-model="conversionForm.capture_step_performance"
v-model="form.add_result_filesname"
true-label="Y"
false-label="N"
></el-checkbox>
......@@ -174,20 +218,24 @@
</el-tab-pane>
<el-tab-pane label="高级">
<el-form :model="conversionForm" label-width="180px">
<el-form :model="form" label-width="180px">
<el-form-item label="成功条件"> </el-form-item>
<el-form-item label="成功调解">
<el-select
v-model="conversionForm.trans_status"
style="width: 100%"
>
<el-option label="草案" value="shanghai"></el-option>
<el-option label="产品" value="beijing"></el-option>
<el-select v-model="form.success_condition" style="width: 100%">
<el-option
label="一切正常"
value="success_if_no_errors"
></el-option>
<el-option
label="当错误不大于"
value="success_if_errors_less"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="阈值">
<el-input
v-model="conversionForm.step_performance_capturing_delay"
v-model="form.nr_errors_less_than"
:disabled="form.success_condition == 'success_if_no_errors'"
></el-input>
</el-form-item>
</el-form>
......@@ -201,81 +249,116 @@
>
</span>
</el-dialog>
<!-- 文件浏览器-->
<el-dialog
title="文件浏览器"
:visible.sync="filePathSelection"
width="500px"
:before-close="handleCloseFun"
:modal="false"
>
<browseFiles :disabed="true" v-on:route="route"></browseFiles>
<span slot="footer" class="dialog-footer">
<el-button @click="filePathSelection = false">取 消</el-button>
<el-button type="primary" @click="addFilePathSelection"
>确 定</el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
import main from "../../../mykettle/main";
import browseFiles from "../appBulletFrame/browseFiles";
import { datetimeformat, listNames } from "@/api/kettle/link";
export default {
props: ["importXmlFileDialog"],
components: {
main,
browseFiles,
},
props: [
"importXmlFileDialog",
"form",
"nodeData",
"doubleClickCell",
"saveOutputDialog",
],
data() {
return {
form: {
},
conversionForm: {},
fields: [],
liList: [
{
id: 1,
name: "作业日志表",
},
{
id: 2,
name: "作业项日志表",
},
{
id: 3,
name: "日志通道日志表",
},
],
logEntry: {},
tableData: [
{
date: "2016-05-03",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-02",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
tableData: [],
switchState: 1,
dateFormat: [],
namesList: [],
filePathSelection:false,
localPath:{},
};
},
{
date: "2016-05-04",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
created() {},
methods: {
listNames() {
listNames().then((res) => {
if (res) {
console.log("获取所有已经创建的数据库列表:", res);
this.namesList = res;
} else {
this.$message.error(res.errMsg);
}
});
},
{
date: "2016-05-01",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
datetimeformatFun() {
datetimeformat().then((res) => {
this.dateFormat = res;
});
},
{
date: "2016-05-08",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
clickFun(graph, val) {
this.datetimeformatFun();
this.listNames();
this.newGraph = graph;
console.log(val);
},
{
date: "2016-05-06",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
getGraphDataBases() {
// var graph = this.getGraph();
var root = this.newGraph.getDefaultParent(),
data = [];
if (root.getAttribute("databases") != null)
data = JSON.parse(root.getAttribute("databases"));
console.log("获取到画布上的databases====", data);
this.namesList = data;
},
{
date: "2016-05-07",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
selectFilePath(){
this.filePathSelection = !this.filePathSelection
},
],
switchState: 1,
};
addFilePathSelection(){
this.filePathSelection = !this.filePathSelection
this.form.targetfilename = this.localPath.fileName
},
created() {
route(flowData){
this.localPath.fileName = flowData.name
console.log(this.localPath);
},
methods: {
clickFun(graph, val) {
this.newGraph = graph;
// 关闭弹框
handleCloseFun(done) {
this.$confirm("确认关闭?")
.then((_) => {
done();
})
.catch((_) => {});
},
switchJournal(val) {
this.switchState = val.id;
console.log(val);
......@@ -285,6 +368,7 @@ export default {
},
importXmlFileDialogFun() {
this.saveOutputDialog(this.form);
this.handleClose();
},
},
......
......@@ -202,7 +202,7 @@
输出时字段名再重新映射回原来输入时的名字?
</el-col>
<el-col :span="4">
<el-button>字段映射...</el-button>
<el-button @click="fieldMapping">字段映射...</el-button>
</el-col>
......@@ -465,6 +465,7 @@ import {
availableCharsets,
previousSteps,
inputOutputFields,
mappingFields
} from "@/api/kettle/link";
export default {
props: ["form", "nodeData", "saveOutputDialog", "mappingDialog"], //从父组件传过来的值
......@@ -574,6 +575,22 @@ export default {
}
},
fieldMapping(){
var enc = new mxCodec(mxUtils.createXmlDocument());
var node = enc.encode(this.newGraph.getModel());
this.graphXml = mxUtils.getPrettyXml(node);
let pamerFields = new FormData(); // 创建form对象
pamerFields.append(
"stepName",
this.nodeData.value.attributes.label.value
);
pamerFields.append("graphXml", this.graphXml);
pamerFields.append("before", true);
mappingFields(pamerFields).then(res=>{
console.log(res);
})
},
route(flowData){
this.localPath.fileName = flowData.name
......
......@@ -303,7 +303,6 @@ export default {
getGraphDataBases() {
// var graph = this.getGraph();
var root = this.newGraph.getDefaultParent(),
data = [];
if (root.getAttribute("databases") != null)
......
......@@ -18,32 +18,52 @@
<el-form-item label="文件名称:">
<el-row :gutter="10">
<el-col :span="17">
<el-input v-model="fileSelection.fileName" :disabled="form.acceptingFilenames == 'Y' "></el-input>
<el-input
v-model="fileSelection.fileName"
:disabled="form.acceptingFilenames == 'Y'"
></el-input>
</el-col>
<el-col class="line" :span="3">
<el-button size="mini" @click="addFile" :disabled="form.acceptingFilenames == 'Y' ">增加</el-button></el-col
<el-button
size="mini"
@click="addFile"
:disabled="form.acceptingFilenames == 'Y'"
>增加</el-button
></el-col
>
<el-col class="line" :span="3">
<el-button size="mini" @click="selectFilePath(1)" :disabled="form.acceptingFilenames == 'Y' ">浏览</el-button></el-col
<el-button
size="mini"
@click="selectFilePath(1)"
:disabled="form.acceptingFilenames == 'Y'"
>浏览</el-button
></el-col
>
</el-row>
</el-form-item>
<el-form-item label="规则表达式:">
<el-input v-model="fileSelection.fileMask" :disabled="form.acceptingFilenames == 'Y' "></el-input>
<el-input
v-model="fileSelection.fileMask"
:disabled="form.acceptingFilenames == 'Y'"
></el-input>
</el-form-item>
<el-form-item label="正则表达式(排除):">
<el-input v-model="fileSelection.excludeFileMask" :disabled="form.acceptingFilenames == 'Y' "></el-input>
<el-input
v-model="fileSelection.excludeFileMask"
:disabled="form.acceptingFilenames == 'Y'"
></el-input>
</el-form-item>
<el-form-item label="选中的文件:">
<el-card class="box-card">
<el-table :data="fileNameStore" style="width: 100%">
<el-table-column prop="fileName" label="文件/目录" width="120">
<el-table-column
prop="fileName"
label="文件/目录"
width="120"
>
</el-table-column>
<el-table-column prop="filemask" label="通配符">
</el-table-column>
......@@ -81,19 +101,33 @@
<el-form ref="form" :model="form" label-width="200px">
<el-card class="box-card">
<el-form-item label="从以前步骤接受文件名:">
<el-checkbox v-model="form.acceptingFilenames" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.acceptingFilenames"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="从以前步骤接受字段名:">
<el-checkbox
v-model="form.passingThruFields"
:disabled="form.acceptingFilenames == 'N' || !form.acceptingFilenames"
true-label="Y" false-label="N"
:disabled="
form.acceptingFilenames == 'N' || !form.acceptingFilenames
"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="步骤读取的文件名来自:">
<el-select v-model="form.acceptingField" style="width: 100%" :disabled="form.acceptingFilenames == 'N' || !form.acceptingFilenames" clearable>
<el-select
v-model="form.acceptingField"
style="width: 100%"
:disabled="
form.acceptingFilenames == 'N' || !form.acceptingFilenames
"
clearable
>
<el-option
v-for="item in connectionNode"
:key="item.id"
......@@ -106,7 +140,9 @@
<el-form-item label="在输入里的字段被当做文件名:">
<el-input
v-model="form.acceptingStepName"
:disabled="form.acceptingFilenames == 'N' || !form.acceptingFilenames"
:disabled="
form.acceptingFilenames == 'N' || !form.acceptingFilenames
"
></el-input>
</el-form-item>
</el-card>
......@@ -138,7 +174,11 @@
</el-form-item>
<el-form-item label="在文本里允许换行:">
<el-checkbox v-model="form.breakInEnclosureAllowed" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.breakInEnclosureAllowed"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="逃逸字符:">
......@@ -148,7 +188,11 @@
<el-form-item label="头部:">
<el-row :gutter="10">
<el-col :span="2">
<el-checkbox v-model="form.header" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.header"
true-label="Y"
false-label="N"
></el-checkbox>
</el-col>
<el-col class="line" :span="4">头部行数:</el-col>
<el-col :span="17">
......@@ -163,7 +207,11 @@
<el-form-item label="尾部:">
<el-row :gutter="10">
<el-col :span="2">
<el-checkbox v-model="form.footer" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.footer"
true-label="Y"
false-label="N"
></el-checkbox>
</el-col>
<el-col class="line" :span="4">尾部行数:</el-col>
<el-col :span="17">
......@@ -178,7 +226,11 @@
<el-form-item label="包装行:">
<el-row :gutter="10">
<el-col :span="2">
<el-checkbox v-model="form.lineWrapped" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.lineWrapped"
true-label="Y"
false-label="N"
></el-checkbox>
</el-col>
<el-col class="line" :span="6">以时间包装的行数:</el-col>
<el-col :span="15">
......@@ -193,7 +245,11 @@
<el-form-item label="分页布局(pointout):">
<el-row :gutter="10">
<el-col :span="2">
<el-checkbox v-model="form.layoutPaged" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.layoutPaged"
true-label="Y"
false-label="N"
></el-checkbox>
</el-col>
<el-col class="line" :span="5">每页记录行数:</el-col>
<el-col :span="16">
......@@ -215,32 +271,43 @@
</el-form-item>
<el-form-item label="压缩:">
<el-select v-model="form.fileCompression" style="width: 100%" clearable>
<el-select
v-model="form.fileCompression"
style="width: 100%"
clearable
>
<el-option
v-for="item in fieldCompress"
:key="item.index"
:label="item.name"
:value="item.name"
/></el-select>
</el-form-item>
<el-form-item label="没有空行:">
<el-checkbox v-model="form.noEmptyLines" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.noEmptyLines"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="在输出包括字段名:">
<el-row :gutter="10">
<el-col :span="2">
<el-checkbox v-model="form.includeFilename" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.includeFilename"
true-label="Y"
false-label="N"
></el-checkbox>
</el-col>
<el-col class="line" :span="5">包含字段名名称:</el-col>
<el-col :span="16">
<el-input
v-model="form.filenameField"
:disabled="form.includeFilename == 'N' || !form.includeFilename"
:disabled="
form.includeFilename == 'N' || !form.includeFilename
"
></el-input>
</el-col>
</el-row>
......@@ -249,30 +316,45 @@
<el-form-item label="输出包含行数:">
<el-row :gutter="10">
<el-col :span="2">
<el-checkbox v-model="form.includeRowNumber" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.includeRowNumber"
true-label="Y"
false-label="N"
></el-checkbox>
</el-col>
<el-col class="line" :span="5">行数字段名称:</el-col>
<el-col :span="16">
<el-input
v-model="form.rowNumberField"
:disabled="form.includeRowNumber == 'N' || !form.includeFilename"
:disabled="
form.includeRowNumber == 'N' || !form.includeFilename
"
></el-input>
</el-col>
</el-row>
<el-row :gutter="10" style="margin-top: 5px">
<el-col class="line" :span="5" :offset="2">按文件取行号:</el-col>
<el-col class="line" :span="5" :offset="2"
>按文件取行号:</el-col
>
<el-col :span="1">
<el-checkbox
v-model="form.rowNumberByFile"
:disabled="form.includeRowNumber == 'N' || !form.includeFilename"
true-label="Y" false-label="N"
:disabled="
form.includeRowNumber == 'N' || !form.includeFilename
"
true-label="Y"
false-label="N"
></el-checkbox>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="格式:">
<el-select v-model="form.fileFormat" style="width: 100%" clearable>
<el-select
v-model="form.fileFormat"
style="width: 100%"
clearable
>
<el-option
v-for="item in fileType"
:key="item.index"
......@@ -283,17 +365,19 @@
</el-form-item>
<el-form-item label="编码:">
<el-select v-model="form.encoding" filterable style="width: 100%" clearable>
<el-select
v-model="form.encoding"
filterable
style="width: 100%"
clearable
>
<el-option
v-for="item in codingType"
:key="item.index"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="记录数量限制:">
......@@ -301,72 +385,104 @@
</el-form-item>
<el-form-item label="解析日期的时候是否严格要求:">
<el-checkbox v-model="form.dateFormatLenient" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.dateFormatLenient"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="本地日期格式:">
<el-input v-model="form.dateFormatLocale" true-label="Y" false-label="N"></el-input>
<el-input
v-model="form.dateFormatLocale"
true-label="Y"
false-label="N"
></el-input>
</el-form-item>
<el-form-item label="添加文件名:">
<el-checkbox v-model="form.addresult" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.addresult"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="错误处理">
<el-form ref="form" :model="form" label-width="160px">
<el-form-item label="忽略错误:">
<el-checkbox v-model="form.errorIgnored" true-label="Y" false-label="N"></el-checkbox>
<el-checkbox
v-model="form.errorIgnored"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="忽略错误文件:">
<el-checkbox
v-model="form.skipBadFiles"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
true-label="Y" false-label="N"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="错误文件字段名:">
<el-input
v-model="form.fileErrorField"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored "
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-form-item>
<el-form-item label="文件错误信息字段名:">
<el-input
v-model="form.fileErrorMessageField"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-form-item>
<el-form-item label="跳过错误行:">
<el-checkbox
v-model="form.errorLineSkipped"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
true-label="Y" false-label="N"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="错误计数制度:">
<el-input
v-model="form.errorCountField "
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
v-model="form.errorCountField"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-form-item>
<el-form-item label="错误字段文件名:">
<el-input
v-model="form.errorFieldsField"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-form-item>
<el-form-item label="错误文本字段:">
<el-input
v-model="form.errorTextField"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-form-item>
......@@ -375,19 +491,30 @@
<el-col :span="10">
<el-input
v-model="form.warningFilesDestinationDirectory"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-col>
<el-col class="line" :span="3">扩展名:</el-col>
<el-col :span="8">
<el-input
v-model="form.warningFilesExtension"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-col>
<el-col class="line" :span="2">
<el-button :disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored" size="mini" @click="selectFilePath(2)">浏览</el-button></el-col
<el-button
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
size="mini"
@click="selectFilePath(2)"
>浏览</el-button
></el-col
>
</el-row>
</el-form-item>
......@@ -397,19 +524,30 @@
<el-col :span="10">
<el-input
v-model="form.errorFilesDestinationDirectory"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-col>
<el-col class="line" :span="3">扩展名:</el-col>
<el-col :span="8">
<el-input
v-model="form.errorFilesExtension"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-col>
<el-col class="line" :span="2">
<el-button :disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored" size="mini" @click="selectFilePath(3)">浏览</el-button></el-col
<el-button
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
size="mini"
@click="selectFilePath(3)"
>浏览</el-button
></el-col
>
</el-row>
</el-form-item>
......@@ -419,19 +557,30 @@
<el-col :span="10">
<el-input
v-model="form.lineNumberFilesDestinationDirectory"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-col>
<el-col class="line" :span="3">扩展名:</el-col>
<el-col :span="8">
<el-input
v-model="form.lineNumberFilesExtension"
:disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored"
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
></el-input>
</el-col>
<el-col class="line" :span="2">
<el-button :disabled="this.form.errorIgnored == 'N' || !this.form.errorIgnored" size="mini" @click="selectFilePath(4)">浏览</el-button></el-col
<el-button
:disabled="
this.form.errorIgnored == 'N' || !this.form.errorIgnored
"
size="mini"
@click="selectFilePath(4)"
>浏览</el-button
></el-col
>
</el-row>
</el-form-item>
......@@ -450,7 +599,6 @@
</el-table-column>
<el-table-column prop="filterLastLine" label="停止在过滤器">
</el-table-column>
<el-table-column prop="filterPositive" label="积极匹配">
......@@ -509,7 +657,10 @@
<el-table-column label="操作" width="100px">
<template slot-scope="scope">
<el-button @click="fieldClick(false,scope.row)" type="text" size="small"
<el-button
@click="fieldClick(false, scope.row)"
type="text"
size="small"
>编辑</el-button
>
<el-button
......@@ -560,8 +711,7 @@
</el-tab-pane>
</el-tabs>
<span slot="footer" class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="handleCloseFun">取 消</el-button>
<el-button type="primary" @click="TextFileInputDialogFun"
......@@ -570,8 +720,6 @@
</span>
</el-dialog>
<el-dialog
title="修改文件内容"
:visible.sync="fileBox"
......@@ -613,9 +761,6 @@
</span>
</el-dialog>
<el-dialog
title="添加字段"
:visible.sync="fieldBox"
......@@ -640,7 +785,11 @@
</el-form-item>
<el-form-item label="格式:">
<el-select v-model="metadataForm.format" style="width: 100%" clearable>
<el-select
v-model="metadataForm.format"
style="width: 100%"
clearable
>
<el-option
v-for="item in fieldFormat"
:key="item.index"
......@@ -686,7 +835,11 @@
</el-form-item>
<el-form-item label="去除空格类型:">
<el-select v-model="metadataForm.trim_type" style="width: 100%" clearable>
<el-select
v-model="metadataForm.trim_type"
style="width: 100%"
clearable
>
<el-option label="不去掉空格" value="none"></el-option>
<el-option label="去掉左空格" value="left"></el-option>
<el-option label="去掉右空格" value="right"></el-option>
......@@ -718,7 +871,11 @@
</el-form-item>
<el-form-item label="过滤器位置:">
<el-select v-model="filterForm.filterPosition" style="width: 100%" clearable>
<el-select
v-model="filterForm.filterPosition"
style="width: 100%"
clearable
>
<el-option
v-for="item in fieldFormat"
:key="item.index"
......@@ -743,8 +900,6 @@
</span>
</el-dialog>
<!-- 文件浏览器-->
<el-dialog
title="文件浏览器"
......@@ -753,7 +908,6 @@
:before-close="handleClose"
:modal="false"
>
<browseFiles :disabed="true" v-on:route="route"></browseFiles>
<span slot="footer" class="dialog-footer">
......@@ -763,13 +917,11 @@
>
</span>
</el-dialog>
</div>
</template>
<script>
import browseFiles from "../appBulletFrame/browseFiles";
import mxgraph from "@/utils/mxgraph";
const {
mxGraph,
......@@ -785,38 +937,48 @@ const {
mxGeometry,
} = mxgraph;
import { valueFormat, valueMeta,formatMapperLineTerminator,availableCharsets,compressionProviderNames,inputOutputFields } from "@/api/kettle/link";
import {
valueFormat,
valueMeta,
formatMapperLineTerminator,
availableCharsets,
compressionProviderNames,
inputOutputFields,
} from "@/api/kettle/link";
export default {
props: ["connectionNode","form","nodeData","TextFileInputDialog","saveOutputDialog"], //从父组件传过来的值
props: [
"connectionNode",
"form",
"nodeData",
"TextFileInputDialog",
"saveOutputDialog",
], //从父组件传过来的值
components: {
browseFiles,
},
data() {
return {
newGraph:[],
fileBox:false,
newGraph: [],
fileBox: false,
filterBox: false,
fieldBox: false,
fileNameStore:[],
fileNameStore: [],
filter: [],
inputFields: [],
metadataForm: {},
filterForm: {},
fieldFormat: {},
fieldCompress:{},
fieldCompress: {},
fieldType: {},
dataState: false,
fileType:[],
codingType:[],
routeState:0,
filePathSelection:false,
localPath:{},
fileSelection:{},
fielForm:{},
fileType: [],
codingType: [],
routeState: 0,
filePathSelection: false,
localPath: {},
fileSelection: {},
fielForm: {},
};
},
......@@ -829,88 +991,76 @@ export default {
},
methods: {
clickFun(graph,val) {
clickFun(graph, val) {
console.log(graph, 1);
this.newGraph = graph;
this.fileNameStore=JSON.parse(val.fileNameStore)
this.filter=JSON.parse(val.filter)
this.inputFields=JSON.parse(val.inputFields)
this.fileNameStore = JSON.parse(val.fileNameStore);
this.filter = JSON.parse(val.filter);
this.inputFields = JSON.parse(val.inputFields);
},
handleCloseFun(){
handleCloseFun() {
this.$emit("update:TextFileInputDialog", false);
},
TextFileInputDialogFun() {
this.handleCloseFun()
this.handleCloseFun();
this.form.filter = JSON.stringify(this.filter);
this.form.inputFields = JSON.stringify(
this.inputFields
);
this.form.fileNameStore = JSON.stringify(
this.fileNameStore
);
this.saveOutputDialog(this.form)
this.form.inputFields = JSON.stringify(this.inputFields);
this.form.fileNameStore = JSON.stringify(this.fileNameStore);
this.saveOutputDialog(this.form);
},
getTheField(){
getTheField() {
var enc = new mxCodec(mxUtils.createXmlDocument());
var node = enc.encode(this.newGraph.getModel());
this.graphXml = mxUtils.getPrettyXml(node);
let pamerFields = new FormData(); // 创建form对象
pamerFields.append("stepName", this.nodeData.value.attributes.label.value)
pamerFields.append(
"stepName",
this.nodeData.value.attributes.label.value
);
pamerFields.append("graphXml", this.graphXml);
pamerFields.append("before", true);
pamerFields.append("query", "");
inputOutputFields(pamerFields).then((res) => {
this.inputFields = res
this.inputFields = res;
});
},
addFile(){
this.fileNameStore.push(this.fileSelection)
console.log(this.fileNameStore,789787987987987);
this.fileSelection = {}
addFile() {
this.fileNameStore.push(this.fileSelection);
console.log(this.fileNameStore, 789787987987987);
this.fileSelection = {};
},
addFilePathSelection(){
this.filePathSelection = !this.filePathSelection
if (this.routeState == 1 ) {
this.fileSelection.fileName = this.localPath.fileName
}else if (this.routeState == 2 ) {
this.form.warningFilesDestinationDirectory = this.localPath.fileName
}else if (this.routeState == 3) {
this.form.errorFilesDestinationDirectory = this.localPath.fileName
}else if (this.routeState == 4) {
this.form.lineNumberFilesDestinationDirectory = this.localPath.fileName
addFilePathSelection() {
this.filePathSelection = !this.filePathSelection;
if (this.routeState == 1) {
this.fileSelection.fileName = this.localPath.fileName;
} else if (this.routeState == 2) {
this.form.warningFilesDestinationDirectory = this.localPath.fileName;
} else if (this.routeState == 3) {
this.form.errorFilesDestinationDirectory = this.localPath.fileName;
} else if (this.routeState == 4) {
this.form.lineNumberFilesDestinationDirectory = this.localPath.fileName;
}
},
route(flowData){
this.localPath.fileName = flowData.name
route(flowData) {
this.localPath.fileName = flowData.name;
console.log(this.localPath);
},
selectFilePath(tsate){
this.routeState = tsate
this.filePathSelection = !this.filePathSelection
selectFilePath(tsate) {
this.routeState = tsate;
this.filePathSelection = !this.filePathSelection;
},
compressionProviderNamesFun(){
compressionProviderNames().then(res=>{
this.fieldCompress = res
})
compressionProviderNamesFun() {
compressionProviderNames().then((res) => {
this.fieldCompress = res;
});
},
// 关闭弹框
......@@ -922,14 +1072,14 @@ handleCloseFun(){
.catch((_) => {});
},
formatMapperLineTerminatorFun(){
formatMapperLineTerminatorFun() {
let pamer = new FormData(); // 创建form对象
pamer.append("query", "");
formatMapperLineTerminator(pamer).then(res=>{
this.fileType = res
})
formatMapperLineTerminator(pamer).then((res) => {
this.fileType = res;
});
},
availableCharsetsFun(){
availableCharsetsFun() {
let pamer = new FormData(); // 创建form对象
pamer.append("query", "");
availableCharsets(pamer).then((res) => {
......@@ -937,26 +1087,24 @@ handleCloseFun(){
});
},
fileBoxFun(){
this.fileBox = !this.fileBox
fileBoxFun() {
this.fileBox = !this.fileBox;
this.fileNameStore.push(this.fielForm);
this.$emit('fileNameStore', this.fileNameStore)
},
this.$emit("fileNameStore", this.fileNameStore);
},
addFilterBox() {
this.filterBox = !this.filterBox;
if (this.dataState) {
this.filter.push(this.filterForm);
this.$emit('filter', this.filter)
this.$emit("filter", this.filter);
} else {
}
},
handleClick(val){
this.fileBox = !this.fileBox
this.fielForm = val
handleClick(val) {
this.fileBox = !this.fileBox;
this.fielForm = val;
},
deleteRow(index, rows) {
......@@ -976,29 +1124,26 @@ fileBoxFun(){
rows.splice(index, 1);
},
deleteField(index, rows){
deleteField(index, rows) {
rows.splice(index, 1);
},
fieldClick(state,val) {
fieldClick(state, val) {
this.fieldBox = !this.fieldBox;
this.dataState = state
this.dataState = state;
if (state) {
this.metadataForm = {};
}else{
} else {
this.metadataForm = val;
}
},
addFieldBox(){
this.fieldBox = !this.fieldBox
addFieldBox() {
this.fieldBox = !this.fieldBox;
if (this.dataState) {
this.inputFields.push(this.metadataForm)
this.$emit('inputFields', this.inputFields)
}else{
this.inputFields.push(this.metadataForm);
this.$emit("inputFields", this.inputFields);
} else {
}
},
......
......@@ -934,8 +934,10 @@
<conversionSettings
ref="conversionSettings"
:form="form"
:getXmlVal="getXmlVal"
:conversionSettingsDialog.sync="conversionSettingsDialog"
:doubleClickCell="doubleClickCell"
:saveOutputDialog1="saveOutputDialog1"
></conversionSettings>
<!-- 作业属性设置 -->
<jobSettings
......@@ -949,7 +951,10 @@
<importXmlFile
ref="importXmlFile"
:importXmlFileDialog.sync="importXmlFileDialog"
:form="form"
:nodeData="nodeData"
:doubleClickCell="doubleClickCell"
:saveOutputDialog="saveOutputDialog"
></importXmlFile>
<!-- 分组 -->
......@@ -2165,7 +2170,21 @@ export default {
valueFormat(pamer2).then((res) => {
this.fieldFormat = res;
});
// if (this.curFileType == "transformation" && cell.dis == "step98") ||
// cell.value.attributes.ctype.value == "Dummy" ) {
// }else
if (
(this.curFileType == "transformation" && cell.dis == "srep98") ||
cell.value.attributes.ctype.value == "Dummy"
) {
this.nullOperationDialog = !this.nullOperationDialog;
this.form = this.showDataFunc();
setTimeout(() => {
this.$refs.nullOperation.clickFun(this.graph, this.form);
}, 500);
} else if (
(this.curFileType == "transformation" && cell.dis == "step79") ||
cell.value.attributes.ctype.value == "Mail"
) {
......@@ -2174,8 +2193,7 @@ export default {
setTimeout(() => {
this.$refs.sendMail.clickFun(this.graph, this.form);
}, 500);
}
if (
} else if (
(this.curFileType == "transformation" && cell.dis == "step126") ||
cell.value.attributes.ctype.value == "StreamLookup"
) {
......@@ -2184,8 +2202,7 @@ export default {
setTimeout(() => {
this.$refs.streamQuery.clickFun(this.graph, this.form);
}, 500);
}
if (
} else if (
(this.curFileType == "transformation" && cell.dis == "step143") ||
cell.value.attributes.ctype.value == "GroupBy"
) {
......@@ -2261,8 +2278,7 @@ export default {
this.$refs.setVariable.clickFun(this.graph, this.form);
}, 500);
return;
}
if (
} else if (
(this.curFileType == "transformation" && cell.dis == "step66") ||
cell.value.attributes.ctype.value == "SortRows"
) {
......@@ -2548,7 +2564,8 @@ export default {
this.graph.popupMenuHandler.autoExpand = true;
this.graph.popupMenuHandler.factoryMethod = (menu, cell, evt) => {
let root = this.graph.getDefaultParent();
console.log("root-", root);
// this.doubleClickCell = cell;
console.log("root-", root, "cell", cell);
let channelLogTable = JSON.parse(root.getAttribute("channelLogTable"));
console.log("channelLogTable-", channelLogTable);
......@@ -2566,9 +2583,8 @@ export default {
this.conversionSettingsDialog = !this.conversionSettingsDialog;
this.form = q;
setTimeout(() => {
this.$refs.conversionSettings.clickFun(this.graph,this.form); //向子组件传递画布
this.$refs.conversionSettings.clickFun(this.graph, this.form); //向子组件传递画布
}, 500);
});
menu.addItem("映射输入规范", null, () => {
console.log(cell, "当前节点");
......@@ -2578,10 +2594,10 @@ export default {
console.log(cell, "当前节点");
this.mappingOutputDialog = !this.mappingOutputDialog;
});
menu.addItem("空操作", null, () => {
console.log(cell, "当前节点");
this.nullOperationDialog = !this.nullOperationDialog;
});
// menu.addItem("空操作", null, () => {
// console.log(cell, "当前节点");
// this.nullOperationDialog = !this.nullOperationDialog;
// });
menu.addSeparator();
} else {
//画布右键
......@@ -3114,7 +3130,28 @@ export default {
// .catch(() => {});
},
//输出组件保存************************
//画布属性保存*************
saveOutputDialog1(params) {
var outPutForm = params;
console.log("子组件传回来的弹窗参数===", outPutForm);
this.graph.getModel().beginUpdate();
try {
let root = this.graph.getDefaultParent();
for (var name in outPutForm) {
// var edit = new mxCellAttributeChange(
// this.doubleClickCell,
// name,
// outPutForm[name]
// );
// this.graph.getModel().execute(edit);
root.setAttribute(name, outPutForm[name]);
}
} finally {
this.graph.getModel().endUpdate();
}
},
// 组件数据保存***********
saveOutputDialog(params) {
var outPutForm = params;
console.log("子组件传回来的弹窗参数===", outPutForm);
......@@ -3127,6 +3164,7 @@ export default {
this.graph.getModel().execute(edit);
}
},
//输出组件保存******************/
},
};
......
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