Commit d5093a79 by 李耀琨

解决冲突

parents f0cb22fa 4febc18a
<template>
<div class="ef-flow-box" v-if="easyFlowVisible">
<div class="ef-flow-header">
<el-row>
<!--顶部工具菜单-->
<el-col :span="24">
<div class="ef-tooltar">
<el-link type="primary" :underline="false">{{
flowData.name
}}</el-link>
<el-divider direction="vertical"></el-divider>
<el-tooltip
class="item"
effect="dark"
:open-delay="300"
content="保存流程图"
placement="bottom"
>
<el-button
type="text"
icon="el-icon-receiving"
size="large"
></el-button>
</el-tooltip>
<el-divider direction="vertical"></el-divider>
<el-tooltip
class="item"
effect="dark"
:open-delay="300"
content="生产流程图片"
placement="bottom"
>
<el-button
type="text"
icon="el-icon-picture"
size="large"
></el-button>
</el-tooltip>
<el-divider direction="vertical"></el-divider>
<el-tooltip
class="item"
effect="dark"
content="重新绘制"
placement="bottom"
>
<el-button
type="text"
icon="el-icon-refresh"
size="large"
></el-button>
</el-tooltip>
<el-divider direction="vertical"></el-divider>
<el-tooltip
class="item"
effect="dark"
content="点击删除"
placement="bottom"
>
<el-button
type="text"
icon="el-icon-delete"
size="large"
@click="deleteFlow"
></el-button>
</el-tooltip>
<el-divider direction="vertical"></el-divider>
<el-tooltip
class="item"
effect="dark"
content="设置"
placement="bottom"
>
<el-button
type="text"
icon="el-icon-setting"
size="large"
></el-button>
</el-tooltip>
</div>
</el-col>
</el-row>
</div>
<div class="ef-flow-main">
<!-- 画布start -->
<div class="mxgraphClass">
<div id="mxgraph" ref="container"></div>
</div>
</div>
<!-- 输入工具弹框 -->
<el-dialog
title="Excelt输入"
:visible.sync="excelLnput"
width="800px"
:before-close="handleClose"
>
<div id="ExcelInputDialog"></div>
<el-form ref="stepName" :model="stepName" label-width="120px">
<el-form-item label="步骤名称:">
<el-input v-model="stepName.name"></el-input>
</el-form-item>
</el-form>
<el-tabs v-model="activeName" type="border-card" @tab-click="tapClick">
<el-tab-pane label="文件" name="file">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="表格类(引擎):">
<el-select v-model="form.engine" style="width: 100%">
<el-option
v-for="item in engine"
:key="item.code"
:label="item.desc"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="选中的文件:">
<el-button size="small" type="primary" @click="selectFilePath(1)"
>选择文件</el-button
>
<el-card class="box-card">
<el-table :data="ileListData" style="width: 100%">
<el-table-column prop="name" label="文件/目录" width="120">
</el-table-column>
<el-table-column prop="filemask" label="通配符">
</el-table-column>
<el-table-column
prop="exclude_filemask"
label="通配符号(排除)"
width="120"
>
</el-table-column>
<el-table-column prop="file_required" label="要求">
</el-table-column>
<el-table-column prop="include_subfolders" label="包含子目录">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
@click="handleClick(scope.row)"
type="text"
size="small"
>编辑</el-button
>
<el-button
type="text"
size="small"
@click="deleteFile(scope.$index, ileListData)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
</el-form-item>
</el-form>
<el-card class="box-card">
<el-form ref="form" :model="form" label-width="200px">
<el-form-item label="从前面的步骤获取文件名:">
<el-checkbox
v-model="form.checked"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="从哪个步骤读文件名:">
<el-select
v-model="form.wAccStep"
style="width: 100%"
:disabled="!form.checked || form.checked == 'N'"
>
<el-option
v-for="item in connectionNode"
:key="item.id"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="保存文件的字段:">
<el-select
v-model="form.wAccField"
style="width: 100%"
:disabled="!form.checked || form.checked == 'N'"
>
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
</el-form>
</el-card>
</el-tab-pane>
<el-tab-pane label="工作表" name="worksheet">
<h3>要读取的工作表列表</h3>
<el-button type="primary" @click="workClick(true)"
>添加工作表</el-button
>
<br />
<el-card class="box-card">
<el-table :data="worksheetList" style="width: 100%">
<el-table-column prop="name" label="工作表名称" width="120">
</el-table-column>
<el-table-column prop="startrow" label="起始行">
</el-table-column>
<el-table-column prop="startcol" label="起始列">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
@click="workClick(false, scope.row)"
type="text"
size="small"
>编辑</el-button
>
<el-button
type="text"
size="small"
@click="deleteRow(scope.$index, worksheetList)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
<el-tab-pane label="内容" name="content">
<el-form ref="form" :model="form" label-width="200px">
<el-form-item label="头部:">
<el-checkbox
v-model="form.header"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="没有空行:">
<el-checkbox
v-model="form.noempty"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="停在空白记录:">
<el-checkbox
v-model="form.stoponempty"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="限制:">
<el-input v-model="form.limit"></el-input>
</el-form-item>
<el-form-item label="编码:">
<el-select v-model="form.encoding" filterable style="width: 100%">
<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="添加文件名">
<el-checkbox
v-model="form.add_to_result_filenames"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="错误处理" name="handling">
<el-form ref="form" :model="form" label-width="130px">
<el-form-item label="严格类型:">
<el-checkbox
v-model="form.strict_types"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="忽略错误:">
<el-checkbox
v-model="form.ignore"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="跳过错误行:">
<el-checkbox
v-model="form.errorLineSkipped"
:disabled="!this.form.ignore || this.form.ignore == 'N'"
true-label="Y"
false-label="N"
></el-checkbox>
</el-form-item>
<el-form-item label="告警文件目录:">
<el-row :gutter="10">
<el-col :span="8">
<el-input
v-model="form.bad_line_files_destination_directory"
:disabled="!this.form.ignore || this.form.ignore == 'N'"
></el-input>
</el-col>
<el-col class="line" :span="2.5">扩展名</el-col>
<el-col :span="8">
<el-input
v-model="form.warningFilesExtension"
:disabled="!this.form.ignore || this.form.ignore == 'N'"
></el-input>
</el-col>
<el-col class="line" :span="2.5">
<el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'"
size="mini"
>变量</el-button
></el-col
>
<el-col class="line" :span="2.5">
<el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'"
size="mini"
@click="selectFilePath(2)"
>浏览</el-button
></el-col
>
</el-row>
</el-form-item>
<el-form-item label="错误件目录:">
<el-row :gutter="10">
<el-col :span="8">
<el-input
v-model="form.errorFilesDestinationDirectory"
:disabled="!this.form.ignore || this.form.ignore == 'N'"
></el-input>
</el-col>
<el-col class="line" :span="2.5">扩展名</el-col>
<el-col :span="8">
<el-input
v-model="form.errorFilesExtension"
:disabled="!this.form.ignore || this.form.ignore == 'N'"
></el-input>
</el-col>
<el-col class="line" :span="2.5">
<el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'"
size="mini"
>变量</el-button
></el-col
>
<el-col class="line" :span="2.5">
<el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'"
size="mini"
@click="selectFilePath(3)"
>浏览</el-button
></el-col
>
</el-row>
</el-form-item>
<el-form-item label="失败行数文件目录:">
<el-row :gutter="10">
<el-col :span="8">
<el-input
v-model="form.lineNumberFilesDestinationDirectory"
:disabled="!this.form.ignore || this.form.ignore == 'N'"
></el-input>
</el-col>
<el-col class="line" :span="2.5">扩展名</el-col>
<el-col :span="8">
<el-input
v-model="form.lineNumberFilesExtension"
:disabled="!this.form.ignore || this.form.ignore == 'N'"
></el-input>
</el-col>
<el-col class="line" :span="2.5">
<el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'"
size="mini"
>变量</el-button
></el-col
>
<el-col class="line" :span="2.5">
<el-button
:disabled="!this.form.ignore || this.form.ignore == 'N'"
size="mini"
@click="selectFilePath(4)"
>浏览</el-button
></el-col
>
</el-row>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="字段" name="field">
<el-button type="primary" @click="fieldClick(true)"
>添加字段</el-button
>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="name" label="名称"> </el-table-column>
<el-table-column prop="type" label="类型"> </el-table-column>
<el-table-column prop="length" label="长度"> </el-table-column>
<el-table-column prop="precision" label="精度"> </el-table-column>
<el-table-column prop="trim_type" label="去除空格类型">
</el-table-column>
<el-table-column prop="repeat" label="重复"> </el-table-column>
<el-table-column prop="format" label="格式"> </el-table-column>
<el-table-column prop="currency" label="货币"> </el-table-column>
<el-table-column prop="decimal" label="小数"> </el-table-column>
<el-table-column prop="group" label="分组"> </el-table-column>
<el-table-column label="操作" width="100px">
<template slot-scope="scope">
<el-button
@click="fieldClick(false, scope.row)"
type="text"
size="small"
>编辑</el-button
>
<el-button
type="text"
size="small"
@click="deletefield(scope.$index, tableData)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="其他输出字段" name="oher ">
<el-form ref="form" :model="form" label-width="150px">
<el-form-item label="文件名称字段:">
<el-input v-model="form.filefield"></el-input>
</el-form-item>
<el-form-item label="Sheet名称字段:">
<el-input v-model="form.sheetfield"></el-input>
</el-form-item>
<el-form-item label="Sheet的行号列:">
<el-input v-model="form.sheetrownumfield"></el-input>
</el-form-item>
<el-form-item label="行号列:">
<el-input v-model="form.rownumfield"></el-input>
</el-form-item>
<el-form-item label="文件名字段:">
<el-input v-model="form.shortFileFieldName"></el-input>
</el-form-item>
<el-form-item label="扩展名字段:">
<el-input v-model="form.extensionFieldName"></el-input>
</el-form-item>
<el-form-item label="路径字段:">
<el-input v-model="form.pathFieldName"></el-input>
</el-form-item>
<el-form-item label="文件大小字段:">
<el-input v-model="form.sizeFieldName"></el-input>
</el-form-item>
<el-form-item label="是否为隐藏文件字段:">
<el-input v-model="form.hiddenFieldName"></el-input>
</el-form-item>
<el-form-item label="最后修改时间字段:">
<el-input v-model="form.lastModificationTimeFieldName"></el-input>
</el-form-item>
<el-form-item label="Uri字段:">
<el-input v-model="form.uriNameFieldName"></el-input>
</el-form-item>
<el-form-item label="Root uri字段:">
<el-input v-model="form.rootUriNameFieldName"></el-input>
</el-form-item>
</el-form>
</el-tab-pane>
</el-tabs>
<span slot="footer" class="dialog-footer">
<el-button @click="excelLnput = false">取 消</el-button>
<el-button type="primary" @click="excelLnput = false">确 定</el-button>
</span>
</el-dialog>
<!-- 修改-->
<el-dialog
title="编辑"
:visible.sync="edit"
width="500px"
:before-close="handleClose"
>
<el-form ref="form" :model="formFile" label-width="150px">
<el-form-item label="文件/目录:">
<el-input v-model="formFile.name" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="通配符:">
<el-input v-model="formFile.filemask"></el-input>
</el-form-item>
<el-form-item label="通配符号(排除):">
<el-input v-model="formFile.exclude_filemask"></el-input>
</el-form-item>
<el-form-item label="要求:">
<el-select v-model="formFile.file_required" style="width: 100%">
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="包含子目录:">
<el-select v-model="formFile.include_subfolders" style="width: 100%">
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="edit = false">取 消</el-button>
<el-button type="primary" @click="edit = false">确 定</el-button>
</span>
</el-dialog>
<!-- 工作添加/修改-->
<el-dialog
title="编辑"
:visible.sync="work"
width="500px"
:before-close="handleClose"
>
<el-form ref="form" :model="workForm" label-width="150px">
<el-form-item label="工作表名称:">
<el-input v-model="workForm.name"></el-input>
</el-form-item>
<el-form-item label="起始行:">
<el-input v-model="workForm.startLine"></el-input>
</el-form-item>
<el-form-item label="起始列:">
<el-input v-model="workForm.startColumn"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="work = false">取 消</el-button>
<el-button type="primary" @click="addWork">确 定</el-button>
</span>
</el-dialog>
<!-- 字段添加/修改-->
<el-dialog
title="编辑"
:visible.sync="field"
width="500px"
:before-close="handleClose"
>
<el-form ref="form" :model="fieldForm" label-width="120px">
<el-form-item label="名称:">
<el-input v-model="fieldForm.name"></el-input>
</el-form-item>
<el-form-item label="类型:">
<el-select v-model="fieldForm.type" style="width: 100%">
<el-option
v-for="item in fieldType"
:key="item.id"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
<el-form-item label="长度:">
<el-input v-model="fieldForm.length"></el-input>
</el-form-item>
<el-form-item label="精度:">
<el-input v-model="fieldForm.accuracy"></el-input>
</el-form-item>
<el-form-item label="去除空格类型:">
<el-select v-model="fieldForm.space" style="width: 100%">
<el-option label="不去掉空格" value="none"></el-option>
<el-option label="去掉左空格" value="left"></el-option>
<el-option label="去掉右空格" value="right"></el-option>
<el-option label="去掉左右两端空格" value="both"></el-option>
</el-select>
</el-form-item>
<el-form-item label="重复:">
<el-input v-model="fieldForm.repeat"></el-input>
</el-form-item>
<el-form-item label="格式:">
<el-select v-model="fieldForm.format" style="width: 100%">
<el-option
v-for="item in fieldFormat"
:key="item.index"
:label="item.name"
:value="item.name"
/></el-select>
</el-form-item>
<el-form-item label="货币:">
<el-input v-model="fieldForm.currency"></el-input>
</el-form-item>
<el-form-item label="小数:">
<el-input v-model="fieldForm.decimal"></el-input>
</el-form-item>
<el-form-item label="分组:">
<el-input v-model="fieldForm.grouping"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="field = false">取 消</el-button>
<el-button type="primary" @click="addField">确 定</el-button>
</span>
</el-dialog>
<!-- 表输入-->
<el-dialog
title="表输入"
:visible.sync="TableInputDialog"
width="800px"
:before-close="handleClose"
>
<tableInput
:disabled="true"
:connectionNode="connectionNode"
:stepName="stepName"
>
</tableInput>
<span slot="footer" class="dialog-footer">
<el-button @click="TableInputDialog = false">取 消</el-button>
<el-button type="primary" @click="TableInputDialog = false"
>确 定</el-button
>
</span>
</el-dialog>
<!-- 获取系统信息-->
<el-dialog
title="获取系统信息"
:visible.sync="SystemInfoDialog"
width="800px"
:before-close="handleClose"
>
<getSystemInformation :disabled="true"> </getSystemInformation>
<span slot="footer" class="dialog-footer">
<el-button @click="SystemInfoDialog = false">取 消</el-button>
<el-button type="primary" @click="SystemInfoDialog = false"
>确 定</el-button
>
</span>
</el-dialog>
<!-- 自定义常量数据-->
<el-dialog
title="自定义常量数据"
:visible.sync="ConstantDialog"
width="800px"
:before-close="handleClose"
>
<customConstant :disabled="true"> </customConstant>
<span slot="footer" class="dialog-footer">
<el-button @click="ConstantDialog = false">取 消</el-button>
<el-button type="primary" @click="ConstantDialog = false"
>确 定</el-button
>
</span>
</el-dialog>
<!-- 生成随机数-->
<el-dialog
title="生成随机数"
:visible.sync="RandomValueDialog"
width="800px"
:before-close="handleClose"
>
<randomNumber :disabled="true"> </randomNumber>
<span slot="footer" class="dialog-footer">
<el-button @click="RandomValueDialog = false">取 消</el-button>
<el-button type="primary" @click="RandomValueDialog = false"
>确 定</el-button
>
</span>
</el-dialog>
<!-- 生成记录-->
<el-dialog
title="生成记录"
:visible.sync="RowGeneratorDialog"
width="800px"
:before-close="handleClose"
>
<generatingRecords :disabed="true"></generatingRecords>
<span slot="footer" class="dialog-footer">
<el-button @click="RowGeneratorDialog = false">取 消</el-button>
<el-button type="primary" @click="RowGeneratorDialog = false"
>确 定</el-button
>
</span>
</el-dialog>
<!-- 文本文件输入-->
<el-dialog
title="文本文件输入"
:visible.sync="TextFileInputDialog"
width="800px"
:before-close="handleClose"
>
<textFileInput
:disabed="true"
:connectionNode="connectionNode"
></textFileInput>
<span slot="footer" class="dialog-footer">
<el-button @click="TextFileInputDialog = false">取 消</el-button>
<el-button type="primary" @click="TextFileInputDialog = false"
>确 定</el-button
>
</span>
</el-dialog>
<!-- 文件浏览器-->
<el-dialog
title="文件浏览器"
:visible.sync="filePathSelection"
width="500px"
:before-close="handleClose"
>
<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>
<!-- 输出弹窗start=============== -->
<outDialog
ref="tableOutPut"
:tableOutPutVisible.sync="tableOutPutVisible"
@fathertrans="fathertrans"
></outDialog>
<insertOrUpdate
ref="insertOrdate"
:InsertOrUpdateVisible.sync="InsertOrUpdateVisible"
></insertOrUpdate>
<excelOutPutDialog
ref="excelOut"
:excelOutPutVisible.sync="excelOutPutVisible"
></excelOutPutDialog>
<updateDialog
ref="update"
:updateVisible.sync="updateVisible"
></updateDialog>
<synDialog ref="syn" :synVisible.sync="synVisible"></synDialog>
<delDialog ref="del" :deleteVisible.sync="deleteVisible"></delDialog>
<sqlDialog ref="sql" :sqlVisible.sync="sqlVisible"></sqlDialog>
<textFileDialog
ref="textFile"
:fileVisible.sync="fileVisible"
></textFileDialog>
<microDialog ref="mic" :microVisible.sync="microVisible"></microDialog>
<!-- 输出弹窗end================== -->
</div>
</template>
<script>
import draggable from "vuedraggable";
// 使用修改后的jsplumb
import lodash from "lodash"; //JavaScript 实用工具库
import {
excelSheetType,
previousSteps,
inputOutputFields,
availableCharsets,
valueFormat,
valueMeta,
save,
newStep
} from "@/api/kettle/link";
// 输入弹窗
import tableInput from "../appBulletFrame/tableInput";
import getSystemInformation from "../appBulletFrame/getSystemInformation";
import customConstant from "../appBulletFrame/customConstant";
import randomNumber from "../appBulletFrame/randomNumber";
import generatingRecords from "../appBulletFrame/generatingRecords";
import textFileInput from "../appBulletFrame/textFileInput";
import browseFiles from "../appBulletFrame/browseFiles";
// 输出弹窗start******************************************
import outDialog from "../../../output-dialog/table-out";
import insertOrUpdate from "../../../output-dialog/insertOrUpdate";
import excelOutPutDialog from "../../../output-dialog/Excel-output";
import updateDialog from "../../../output-dialog/update";
import synDialog from "../../../output-dialog/synchronize";
import delDialog from "../../../output-dialog/delete";
import sqlDialog from "../../../output-dialog/sqlFileOutput";
import textFileDialog from "../../../output-dialog/text-file-output";
import microDialog from "../../../output-dialog/micro-excel";
// 输出弹窗end********************************************
import {
mxGraph,
mxUtils,
mxEvent,
mxCell,
mxKeyHandler,
mxRubberband,
mxConstants,
mxStencilRegistry,
mxStencil,
mxCodec,
mxGraphModel,
mxGeometry,
} from "mxgraph-js";
// XML
// import {
// mxUtils as mxUtils,
// mxGraph as mxGraph,
// mxEvent as mxEvent,
// mxKeyHandler as mxKeyHandler,
// mxRubberband as mxRubberband,
// mxConstants as mxConstants,
// mxStencilRegistry as mxStencilRegistry,
// mxStencil as mxStencil,
// mxCodec as mxCodec,
// mxGraphModel as mxGraphModel,
// mxGeometry as mxGeometry,
// } from "mxgraph/javascript/mxClient";
export default {
// props: {
// dialogVisibleFourth: {
// type: Boolean,
// default: false,
// },
// },
props: ["blankCanvas"], //从父组件传过来的值
data() {
return {
keyHandler: null,
palettes: {},
graphXml: "",
xmlDocuments:"",//获取解码的xml
// mxl=================================
InsertOrUpdateVisible: false,
tableOutPutVisible: false,
excelOutPutVisible: false,
updateVisible: false,
synVisible: false,
deleteVisible: false,
sqlVisible: false,
fileVisible: false,
microVisible: false,
// mxl=================================
// 输入模块
ileListData: [],
worksheetList: [],
publicData: [], //全部连接
connectionNode: {},
codingType: [],
routeState: 0,
filePathSelection: false,
TextFileInputDialog: false,
RowGeneratorDialog: false,
TableInputDialog: false,
SystemInfoDialog: false,
ConstantDialog: false,
RandomValueDialog: false,
excelLnput: false,
dataState: false,
edit: false,
work: false,
field: false,
form: {},
formFile: {},
activeName: "file",
fieldType: [],
fieldFormat: [],
stepName: {},
tableData: [
{
filemask: "",
name: "王小虎",
exclude_filemask: "",
file_required: "0",
include_subfolders: "1",
},
],
engine: [],
// 画布模块
isShowIcon: false,
isLeftMenu: true,
isShowR: false,
// graph 实例
graph: null,
// 控制画布销毁
easyFlowVisible: true,
// 是否加载完毕标志位
loadEasyFlowFinish: false,
// 数据
flowData: {},
// 激活的元素、可能是节点、可能是连线
activeElement: {
// 可选值 node 、line
type: undefined,
// 节点ID
nodeId: undefined,
// 连线ID
sourceId: undefined,
targetId: undefined,
},
zoom: 0.5,
workForm: {},
fieldForm: {},
};
},
// 一些基础配置移动该文件中
// mixins: [easyFlowMixin],
components: {
tableInput,
draggable,
getSystemInformation,
generatingRecords,
customConstant,
randomNumber,
textFileInput,
browseFiles,
// FlowNodeForm
// 弹窗组件start***********************
outDialog, //表输出
insertOrUpdate, //插入或更新
excelOutPutDialog,
updateDialog,
synDialog,
delDialog,
sqlDialog,
textFileDialog,
microDialog,
// 弹窗组件end***********************
},
//自定义指令 https://www.jb51.net/article/108047.htm
directives: {
flowDrag: {
// bind(el, binding, vnode, oldNode) {
// if (!binding) {
// return;
// }
// el.onmousedown = (e) => {
// if (e.button == 2) {
// // 右键不管
// return;
// }
// // 鼠标按下,计算当前原始距离可视区的高度
// let disX = e.clientX;
// let disY = e.clientY;
// el.style.cursor = "move";
// document.onmousemove = function (e) {
// // 移动时禁止默认事件
// e.preventDefault();
// const left = e.clientX - disX;
// disX = e.clientX;
// el.scrollLeft += -left;
// const top = e.clientY - disY;
// disY = e.clientY;
// el.scrollTop += -top;
// };
// document.onmouseup = function (e) {
// el.style.cursor = "auto";
// document.onmousemove = null;
// document.onmouseup = null;
// };
// };
// },
},
},
mounted() {
this.createGraph();
this.initToolbar();
this.initGraph();
this.$refs.container.style.background = 'url("./mxgraph/images/grid.gif")';
},
methods: {
// 子组件发射回来的弹窗变量变为true
fathertrans(res) {
// this.dialogVisibleFourth=res;
this.$emit("update:dialogVisibleFourth", res);
console.log("发射回父组件====");
},
fileChnageInput(e) {
console.log(e);
},
deleteRow(index, rows) {
rows.splice(index, 1);
},
deletefield(index, rows) {
rows.splice(index, 1);
},
deleteFile(index, rows) {
rows.splice(index, 1);
},
tapClick() {},
// 文件
handleClick(val) {
this.edit = !this.edit;
this.formFile = val;
},
// 字段
addField() {
this.field = !this.field;
if (this.dataState) {
this.tableData.push(this.fieldForm);
} else {
}
},
fieldClick(state, val) {
this.field = !this.field;
this.dataState = state;
if (state) {
this.fieldForm = {};
} else {
this.fieldForm = val;
}
},
// 工作表
workClick(state, val) {
this.work = !this.work;
this.dataState = state;
if (state) {
this.workForm = {};
} else {
this.workForm = val;
}
},
addWork() {
this.work = !this.work;
if (this.dataState) {
this.worksheetList.push(this.workForm);
} else {
}
},
// 关闭弹框
handleClose(done) {
this.$confirm("确认关闭?")
.then((_) => {
done();
})
.catch((_) => {});
},
addFilePathSelection() {
this.filePathSelection = !this.filePathSelection;
if (this.routeState == 1) {
this.ileListData.push(this.localPath);
} else if (this.routeState == 2) {
this.form.bad_line_files_destination_directory = this.localPath.name;
} else if (this.routeState == 3) {
this.form.errorFilesDestinationDirectory = this.localPath.name;
} else if (this.routeState == 4) {
this.form.lineNumberFilesDestinationDirectory = this.localPath.name;
}
},
route(flowData) {
this.localPath = flowData;
console.log(this.localPath);
},
selectFilePath(tsate) {
this.routeState = tsate;
this.filePathSelection = !this.filePathSelection;
},
task() {
let domArr = document.querySelectorAll('[key-id="123"]');
this.createGraph();
this.initToolbar();
},
handleNodeClick(e, node, i) {
this.$forceUpdate();
},
//生成画布
createGraph() {
this.graph = new mxGraph(this.$refs.container);
},
// 转xml
encode(graph) {
const encoder = new mxCodec();
const result = encoder.encode(graph.getModel());
return mxUtils.getPrettyXml(result);
},
decode(graphXml, graph) {
window["mxGraphModel"] = mxGraphModel;
window["mxGeometry"] = mxGeometry;
// const xmlDocument = mxUtils.parseXml(graphXml);
// const decoder = new mxCodec(xmlDocument);
// const node = xmlDocument.documentElement;
// decoder.decode(node, graph.getModel());
var enc = new mxCodec(mxUtils.createXmlDocument(graphXml));
var node = enc.encode(graph.getModel());
console.log(mxUtils.getPrettyXml(node));
return mxUtils.getPrettyXml(node);
},
//初始化画布
initGraph() {
if (this.R.isNil(this.graph)) {
return;
}
this.graph.setConnectable(true); // 允许连线
this.graph.setCellsEditable(false); // 不可修改
this.graph.setTooltips(true);
this.graph.setPanning(true);
this.graph.setDropEnabled(true);
this.graph.setAllowDanglingEdges(false);
this.graph.setDisconnectOnMove(false);
this.graph.convertValueToString = (cell) => {
// 根据cell生成显示的标签
return this.R.prop("title", cell);
};
this.graph.addListener(mxEvent.DOUBLE_CLICK, (graph, evt) => {
console.log(evt);
// this.xmlDocuments = mxUtils.parseXml(decodeURIComponent(this.blankCanvas));
this.graphXml = this.encode(this.graph);
console.log(this.graphXml,this.xmlDocuments);
// 监听双击事件
const cell = this.R.pathOr([], ["properties", "cell"], evt);
console.info(cell); // 在控制台输出双击的cell
if (cell.ids == "step1") {
this.excelLnput = !this.excelLnput;
return;
} else if (cell.ids == "step7") {
this.TableInputDialog = !this.TableInputDialog;
return;
} else if (cell.ids == "step6") {
this.SystemInfoDialog = !this.SystemInfoDialog;
return;
} else if (cell.ids == "step5") {
this.ConstantDialog = !this.ConstantDialog;
return;
} else if (cell.ids == "step4") {
this.RandomValueDialog = !this.RandomValueDialog;
return;
} else if (cell.ids == "step3") {
this.RowGeneratorDialog = !this.RowGeneratorDialog;
return;
} else if (cell.ids == "step2") {
this.TextFileInputDialog = !this.TextFileInputDialog;
return;
} else if (cell.ids == "step16") {
//表输出
this.tableOutPutVisible = !this.tableOutPutVisible;
return;
} else if (cell.ids == "step15") {
//更新
this.updateVisible = !this.updateVisible;
return;
} else if (cell.ids == "step14") {
//文本文件输出
this.fileVisible = !this.fileVisible;
return;
} else if (cell.ids == "step13") {
//数据同步
this.synVisible = !this.synVisible;
return;
} else if (cell.ids == "step12") {
//插入、更新
this.InsertOrUpdateVisible = !this.InsertOrUpdateVisible;
return;
} else if (cell.ids == "step11") {
//删除
this.deleteVisible = !this.deleteVisible;
return;
} else if (cell.ids == "step10") {
//SQL文件输出
this.sqlVisible = !this.sqlVisible;
return;
} else if (cell.ids == "step9") {
//Excel输出
this.excelOutPutVisible = !this.excelOutPutVisible;
return;
}
});
this.graph.addListener(mxEvent.CLICK, (graph, evt) => {
// console.log(evt);
// 监听单击事件
const cell = this.R.pathOr([], ["properties", "cell"], evt);
// console.info(cell); // 在控制台输出单击的cell
});
},
addCell(toolItem, x, y) {
const { width, height } = toolItem;
const parent = this.graph.getDefaultParent();
this.graph.getModel().beginUpdate();
const styleObj = {
fillColor: 'transparent',
strokeColor: '#000000',
strokeWidth: '1',
shape: mxConstants.SHAPE_LABEL,
align: mxConstants.ALIGN_CENTER,
verticalAlign: mxConstants.ALIGN_BOTTOM,
imageAlign: mxConstants.ALIGN_CENTER,
imageVerticalAlign: mxConstants.ALIGN_TOP,
image:toolItem['icon']
}
const style = Object.keys(styleObj).map((attr) => `${attr}=${styleObj[attr]}`).join(';')
try {
let vertex = this.graph.insertVertex(
parent,
null,
null,
x,
y,
width,
height,
style
);
vertex.title = toolItem["title"];
vertex.ids = toolItem["id"];
vertex.pluginId = toolItem["pluginId"];
this.xmlDocuments = mxUtils.parseXml(decodeURIComponent(this.blankCanvas));
console.log(this.xmlDocuments,'拖拽');
var oSerializer = new XMLSerializer();
console.log(oSerializer.serializeToString(this.xmlDocuments));
let pameStep = new FormData(); // 创建form对象
pameStep.append("graphXml", oSerializer.serializeToString(this.xmlDocuments));
pameStep.append("pluginId", vertex.pluginId);
pameStep.append("name", vertex.title);
newStep(pameStep).then(res=>{
console.log(res,4564564564566456);
// this.graph.getModel().beginUpdate();
// try
// {
// var cell = this.graph.insertVertex(this.graph.getDefaultParent(), null, res.documentElement, x, y, width, height, "icon;image=" + node.attributes.dragIcon);
// this.graph.setSelectionCells([cell]);
// } finally
// {
// this.graph.getModel().endUpdate();
// }
// this.graph.container.focus();
})
} finally {
this.graph.getModel().endUpdate();
}
},
//选择
initToolbar() {
let domArr = document.querySelectorAll('[key-id="123"]');
domArr.forEach((dom, index) => {
let toolItemObj = {
title: dom.innerText,
id: dom.id,
width: 50,
height: 50,
icon:dom.attributes["icon"].nodeValue,
// value: dom.pluginId,
pluginId:dom.getAttribute("pluginId"),
};
const { width, height } = toolItemObj;
const dropHandler = (graph, evt, cell, x, y) => {
this.addCell(toolItemObj, x, y);
};
const createDragPreview = () => {
const elt = document.createElement("div");
elt.style.border = "1px dotted black";
elt.style.width = `${width}px`;
elt.style.height = `${height}px`;
return elt;
};
mxUtils.makeDraggable(
dom,
this.graph,
dropHandler,
createDragPreview(),
0,
0,
false,
true
);
});
},
// //设置
settingFlow() {
// console.log("按钮给我测试其他的功能--1", );
},
// // 删除激活的元素
deleteFlow() {
this.graph.removeCells(this.graph.getSelectionCells(), false); //删除选中节点
// if (this.activeElement.type === "node") {
// this.deleteNode(this.activeElement.nodeId);
// } else if (this.activeElement.type === "line") {
// this.$confirm("确定删除所点击的线吗?", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning",
// })
// .then(() => {
// var conn = this.graph.getConnections({
// source: this.activeElement.sourceId,
// target: this.activeElement.targetId,
// })[0];
// this.graph.deleteConnection(conn);
// })
// .catch(() => {});
// }
},
// // 删除线
// deleteLine(from, to) {
// delete this.publicData[to];
// this.flowData.lineList = this.flowData.lineList.filter(function (line) {
// if (line.from == from && line.to == to) {
// return false;
// }
// return true;
// });
// },
// // 改变连线
// changeLine(oldFrom, oldTo) {
// this.deleteLine(oldFrom, oldTo);
// },
// // 改变节点的位置
// changeNodeSite(flowData) {
// for (var i = 0; i < this.flowData.nodeList.length; i++) {
// let node = this.flowData.nodeList[i];
// if (node.id === flowData.nodeId) {
// node.left = flowData.left;
// node.top = flowData.top;
// }
// }
// },
// /**
// * 删除节点
// * @param nodeId 被删除节点的ID
// */
// deleteNode(nodeId) {
// this.$confirm("确定要删除节点" + nodeId + "?", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning",
// closeOnClickModal: false,
// })
// .then(() => {
// /**
// * 这里需要进行业务判断,是否可以删除
// */
// this.flowData.nodeList = this.flowData.nodeList.filter(function (
// node
// ) {
// if (node.id === nodeId) {
// // 伪删除,将节点隐藏,否则会导致位置错位
// // node.show = false
// return false;
// }
// return true;
// });
// this.$nextTick(function () {
// this.graph.removeAllEndpoints(nodeId);
// });
// })
// .catch(() => {});
// return true;
// },
// console.log("点击节点操作", node);
// // this.$emit("dialogVisibleFourth",true);
// // this.$emit('updata:dialogVisibleFourth',true); //触发showbox方法,true为向父组件传递的数据
// this.stepName = node;
// this.connectionNode = this.publicData[node.id];
// console.log(this.connectionNode);
// this.isShowR = true;
// this.activeElement.type = "node";
// this.activeElement.nodeId = node.id;
// // this.$refs.nodeForm.nodeInit(this.flowData, nodeId)
// let pamer = new FormData(); // 创建form对象
// pamer.append("query", "");
// excelSheetType(pamer).then((res) => {
// this.engine = res;
// });
// availableCharsets(pamer).then((res) => {
// this.codingType = res;
// });
// let pamer2 = new FormData(); // 创建form对象
// pamer2.append("valueType", "all");
// valueFormat(pamer2).then((res) => {
// this.fieldFormat = res;
// });
// valueMeta().then((res) => {
// this.fieldType = res;
// });
// previousSteps().then((res) => {});
// inputOutputFields().then((res) => {});
// if (node.ids == "step1") {
// this.excelLnput = !this.excelLnput;
// return;
// } else if (node.ids == "step7") {
// this.TableInputDialog = !this.TableInputDialog;
// return;
// } else if (node.ids == "step6") {
// this.SystemInfoDialog = !this.SystemInfoDialog;
// return;
// } else if (node.ids == "step5") {
// this.ConstantDialog = !this.ConstantDialog;
// return;
// } else if (node.ids == "step4") {
// this.RandomValueDialog = !this.RandomValueDialog;
// return;
// } else if (node.ids == "step3") {
// this.RowGeneratorDialog = !this.RowGeneratorDialog;
// return;
// } else if (node.ids == "step2") {
// this.TextFileInputDialog = !this.TextFileInputDialog;
// return;
// }
// if (node.ids == "step16") {
// this.tableOutPutVisible = !this.tableOutPutVisible;
// return;
// }
// // 是否具有该线
// hasLine(from, to) {
// for (var i = 0; i < this.flowData.lineList.length; i++) {
// var line = this.flowData.lineList[i];
// if (line.from === from && line.to === to) {
// return true;
// }
// }
// return false;
// },
// // 是否含有相反的线
// hashOppositeLine(from, to) {
// return this.hasLine(to, from);
// },
// nodeRightMenu(nodeId, evt) {
// console.log(88);
// this.menu.show = true;
// this.menu.curNodeId = nodeId;
// this.menu.left = evt.x + "px";
// this.menu.top = evt.y + "px";
// },
// repaintEverything() {
// this.graph.repaint();
// },
// // 加载流程图-不能删
// dataReload(flowData) {
// this.easyFlowVisible = false;
// this.flowData.nodeList = [];
// this.flowData.lineList = [];
// this.$nextTick(() => {
// flowData = lodash.cloneDeep(flowData);
// this.easyFlowVisible = true;
// this.flowData = flowData;
// // console.log(flowData, '渲染数据');
// this.$nextTick(() => {
// this.graph = graph.getInstance();
// this.$nextTick(() => {
// this.jsPlumbInit();
// });
// });
// });
// },
// // 保存流程图
saveFlow() {
// this.graphXml = this.encode(this.graph);
// console.log(this.graphXml);
// const that = this;
// let flowObj = Object.assign({}, that.flowData);
// // localStorage.setItem("data_test", JSON.stringify(flowObj))
// console.log("保存流程图", flowObj);
// // 保存
// let pamers = new FormData(); // 创建form对象
// pamers.append("graphXml", jsonxml);
// save(pamers).then((res) => {
// console.log(res);
// if (res.success) {
// that.$message.success("保存流程成功!暂时请查先看控制台。");
// } else {
// that.$message.error(res.errMsg);
// }
// });
// },
// // 转xml
// createGraph() {
// this.graph = new mxGraph(this.$refs.efContainer);
// },
// encode(graph) {
// const encoder = new mxCodec();
// const result = encoder.encode(graph.getModel());
// return mxUtils.getPrettyXml(result);
// },
// decode(graphXml, graph) {
// window["mxGraphModel"] = mxGraphModel;
// window["mxGeometry"] = mxGeometry;
// const xmlDocument = mxUtils.parseXml(graphXml);
// const decoder = new mxCodec(xmlDocument);
// const node = xmlDocument.documentElement;
// decoder.decode(node, graph.getModel());
},
// //重绘流程图
clearFlow() {
// let that = this;
// console.log("重绘流程图--1", that.flowData);
// that
// .$confirm("确定要重新绘制流程图吗?", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning",
// closeOnClickModal: false,
// })
// .then(() => {
// if (that.flowData.nodeList.length !== 0) {
// that.flowData.nodeList.forEach(function (node, index) {
// that.graph.remove(node.id);
// });
// that.flowData.nodeList = [];
// that.flowData.linkList = [];
// that.$message.success("设置成功");
// console.log("重绘流程图--002", that.flowData);
// }
// })
// .catch(() => {
// console.log("取消重绘流程图--1");
// that.$message.error("取消重制");
// });
// },
// //放小
// zoomSub() {
// let that = this;
// if (that.zoom <= 0) {
// return;
// }
// // setInterval(() => {
// that.zoom = that.zoom - 0.1;
// that.$refs.efContainer.style.transform = `scale(${that.zoom})`;
// that.graph.setZoom(that.zoom);
// // }, 1000)
// },
// //放大
// zoomAdd() {
// let that = this;
// if (that.zoom >= 1) {
// return;
// }
// // setInterval(() => {
// that.zoom = that.zoom + 0.1;
// // that.$refs.efContainer.style.transform = `scale(${that.zoom})`
// console.log(that.zoom);
// that.$refs.efContainer.style.transform = `scale(${that.zoom})`;
// that.graph.setZoom(that.zoom);
// // }, 1000)
},
// // 下载数据
downloadData() {
// this.$confirm("确定要下载该流程数据吗?", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning",
// closeOnClickModal: false,
// })
// .then(() => {
// var datastr =
// "data:text/json;charset=utf-8," +
// encodeURIComponent(JSON.stringify(this.flowData, null, "\t"));
// console.log(this.flowData);
// var downloadAnchorNode = document.createElement("a");
// downloadAnchorNode.setAttribute("href", datastr);
// downloadAnchorNode.setAttribute("download", "flowData.json");
// downloadAnchorNode.click();
// downloadAnchorNode.remove();
// this.$message.success("正在下载中,请稍后...");
// })
// .catch(() => {});
},
},
};
</script>
<style lang="scss" type="text/scss" scoped>
.mxgraphClass,
#mxgraph {
height: 100vh;
width: 100%;
}
.moveR-enter-active,
.moveR-leave-active {
transition: all 0.3s linear;
transform: translateX(0);
}
.moveR-enter,
.moveR-leave {
transform: translateX(100%);
}
.moveR-leave-to {
transform: translateX(100%);
}
.moveL-enter-active,
.moveL-leave-active {
transition: all 0.3s linear;
transform: translateX(0%);
}
.moveL-enter,
.moveL-leave {
transform: translateX(-100%);
}
.moveL-leave-to {
transform: translateX(-100%);
}
</style>
......@@ -218,6 +218,17 @@ export function imp(data) {
})
}
//获取表输出
export function inputOutputFields(data) {
return request({
url: 'etlweb/trans/inputOutputFields',
data,
method: 'post'
})
}
......
......@@ -581,7 +581,7 @@ aside {
//
$svgUrl:'http://192.168.0.2:9888/ETLWEB-SERVER/etlweb';
$svgUrl:'http://192.168.0.44:9888/ETLWEB-SERVER/etlweb';
// $svgUrl:'http://192.168.0.44:9888/ETLWEB-SERVER/etlweb';
// $svgUrl:'http://192.168.0.44:9882/ETLWEB-SERVER/etlweb';
// .schema { background-image: url($svgUrl/ui/images/schema.svg?scale=16) !important;}
......
......@@ -65,7 +65,7 @@ new Vue({
router,
store,
render: h => h(App)
})
......@@ -75,6 +75,8 @@ import * as R from 'ramda'
Vue.prototype.R = R
Vue.config.productionTip = false
const baseUrl = process.env.VUE_APP_BASE_API === '/' ? '' : process.env.VUE_APP_BASE_API
Vue.prototype.etlWeb = baseUrl+"ETLWEB-SERVER/etlweb/"
new Vue({
router,
......
......@@ -35,7 +35,7 @@
},
data() {
return {
prefix:'http://192.168.0.44:9882/etlweb/',
prefix:this.etlWeb,
}
},
computed: {
......
<template>
<div class="flow-menu" ref="tool">
<!-- <div v-for="menu in menuList" :key="menu.id"> -->
<!-- <span class="ef-node-pmenu" @click="menu.open = !menu.open">
<i :class="{'el-icon-caret-bottom': menu.open,'el-icon-caret-right': !menu.open}"></i>&nbsp;
{{menu.name}}
</span> -->
<!--
<!--
<ul v-show="menu.open" class="ef-node-menu-ul">
<draggable
@end="end"
......@@ -59,12 +59,11 @@
<!-- <span class="custom-tree-node" slot-scope="{node,data}">
<span>
<i :class="data.icon"></i>{{ node.label }}
</span>
</span>
</span> -->
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>
<span>
<img :src="prefix+data.icon" style="width:20px" width="" alt="">
{{ node.label }}
</span>
......@@ -88,7 +87,7 @@ export default {
data() {
return {
// prefix:'http://192.168.0.2:9700/etlweb/',
prefix:'http://192.168.0.44:9882/etlweb/',
prefix:this.etlWeb,
// 测试数据开始=====
jobTreeList: [
{
......@@ -172,12 +171,12 @@ export default {
type: "group",
name: "基础节点",
ico: "el-icon-video-play",
open: true,
open: true,
children: [
{
id: "01",
type: "start",
name: "没了",
name: "没了",
ico: "el-icon-caret-right",
// 自定义覆盖样式
style: {},
......@@ -301,15 +300,15 @@ export default {
},
stepsFun() {
let pamer = new FormData(); // 创建form对象
pamer.append("node", "xnode-12");
this.$forceUpdate();
steps(pamer).then((res) => {
this.jobTreeList = res
console.log(this.menuList,res[0]);
});
},
......@@ -400,7 +399,7 @@ export default {
console.log("树形拖拽开始2:===", event);
var type = Node.data.type;
this.nodeMenu = this.getMenuByType(type);
},
handleDragend(draggingNode, endNode, position, event) {
......
......@@ -11,10 +11,11 @@
class="custom-tree-node"
:key-id="data.children ? '' : 123"
:id="data.id"
:icon="data.icon"
:icon="prefix+data.icon"
:pluginId="data.pluginId"
>
{{ data.text }}
<img :src="prefix+data.icon" style="width:20px" width="" alt="">
{{ data.text }}
</div>
</div>
</el-tree>
......@@ -34,6 +35,7 @@ export default {
pluginId:"pluginId",
},
data: [],
prefix: this.etlWeb
};
},
components: {},
......@@ -41,7 +43,7 @@ export default {
this.stepsFun()
},
mounted() {
},
beforeUpdate(){
this.$emit('shooStatus',true)
......
......@@ -1293,6 +1293,18 @@ export default {
const { width, height } = toolItem;
// const parent = this.graph.getDefaultParent();
this.graph.getModel().beginUpdate();
const styleObj = {
fillColor: 'transparent',
strokeColor: '#000000',
strokeWidth: '1',
shape: mxConstants.SHAPE_LABEL,
align: mxConstants.ALIGN_CENTER,
verticalAlign: mxConstants.ALIGN_BOTTOM,
imageAlign: mxConstants.ALIGN_CENTER,
imageVerticalAlign: mxConstants.ALIGN_TOP,
image:toolItem['icon']
}
const style = Object.keys(styleObj).map((attr) => `${attr}=${styleObj[attr]}`).join(';')
try {
// let vertex = this.graph.insertVertex(
// parent,
......@@ -1311,10 +1323,6 @@ export default {
// this.xmlDocuments = mxUtils.parseXml(
// decodeURIComponent(this.blankCanvas)
// );
// console.log(this.xmlDocuments, "拖拽");
// var oSerializer = new XMLSerializer();
// console.log(oSerializer.serializeToString(this.xmlDocuments));
......@@ -1338,7 +1346,8 @@ export default {
this.graph.getModel().beginUpdate();
try
{
var cell = this.graph.insertVertex(this.graph.getDefaultParent(), null, res.documentElement, x, y, width, height,);
var cell = this.graph.insertVertex(this.graph.getDefaultParent(), null, res.documentElement, x, y, width, height,style
);
cell.title = toolItem["title"];
cell.ids = toolItem["id"];
cell.pluginId = toolItem["pluginId"];
......@@ -1366,20 +1375,21 @@ this.graph.getModel().beginUpdate();
//选择
initToolbar() {
let domArr = document.querySelectorAll('[key-id="123"]');
console.log(domArr);
domArr.forEach((dom, index) => {
// console.log(dom.pluginId);
// console.log(dom);
let toolItemObj = {
title: dom.innerHTML,
title: dom.innerText,
id: dom.id,
width: 60,
height: 60,
width: 50,
height: 50,
icon:dom.attributes["icon"].nodeValue,
// value: dom.pluginId,
pluginId: dom.getAttribute("pluginId"),
icon: dom.getAttribute("icon"),
};
const { width, height } = toolItemObj;
......
......@@ -3,7 +3,7 @@
<!-- 浏览 -->
<el-dialog
title="资源库导出"
:visible.sync="exportDialogVisible"
:visible.sync="exportDialogVisible"
width="650px"
top="15%"
:close-on-click-modal="false"
......@@ -44,7 +44,7 @@
<el-button type="primary" @click="expRespository()">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
......@@ -63,7 +63,7 @@ export default {
},
checkedArr:[]
}
},
props: {
exportDialogVisible: Boolean,
......@@ -102,7 +102,7 @@ export default {
});
this.checkedArr=checkArr;
console.log('当前选择文件====',this.checkedArr);
},
//导出资源库
expRespository() {
......@@ -110,7 +110,7 @@ export default {
this.$message.error('请先选择要导出文件');
}
let data = new FormData();
data.append("data",JSON.stringify(this.checkedArr) );
expRespository(data).then((res) => {
if (res) {
......@@ -123,7 +123,7 @@ export default {
// document.body.appendChild(link);
// link.click();
var url=`http://192.168.0.2:9888/ETLWEB-SERVER/etlweb/attachment/download?filePath=${res.message}&remove=true`
var url=this.etlWeb+`attachment/download?filePath=${res.message}&remove=true`
window.open(url);
} else {
......@@ -131,7 +131,7 @@ export default {
}
});
},
handleCloseScan() {
this.$emit("update:exportDialogVisible", false);
},
......@@ -143,4 +143,4 @@ export default {
background-color: #8888ff;
color: #fff;
}
</style>
\ No newline at end of file
</style>
......@@ -14,10 +14,10 @@
action="https://jsonplaceholder.typicode.com/posts/"
:file-list="fileList"
:auto-upload="false"
:on-change="handleChange">
:on-change="handleChange">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
<!-- 文件夹存放区域start-->
<el-tree
......@@ -74,7 +74,7 @@ export default {
checkedArr:[],
uploadPath:''
}
},
props: {
inputVisibility: Boolean,
......@@ -114,8 +114,8 @@ export default {
});
this.checkedArr=checkArr;
console.log('当前选择文件====',this.checkedArr);
},
// 导入资源库
imp(data){
......@@ -124,7 +124,7 @@ export default {
formData.append('data', JSON.stringify(data));
console.log('参数==',formData);
imp(formData).then(res=>{
if (res) {
if (res) {
this.$message.success('导入成功!');
this.explorer('');//刷新列表
this.$emit("update:inputVisibility", false);//关闭弹窗
......@@ -146,7 +146,7 @@ export default {
this.$message.error('请先选择要导出文件');
}
let data = new FormData();
data.append("data",JSON.stringify(this.checkedArr) );
expRespository(data).then((res) => {
if (res) {
......@@ -159,7 +159,7 @@ export default {
// document.body.appendChild(link);
// link.click();
var url=`http://192.168.0.2:9888/ETLWEB-SERVER/etlweb/attachment/download?filePath=${res.message}&remove=true`
var url=this.etlWeb+`attachment/download?filePath=${res.message}&remove=true`
window.open(url);
} else {
......@@ -167,7 +167,7 @@ export default {
}
});
},
handleClose() {
this.$emit("update:inputVisibility", false);
},
......@@ -177,9 +177,9 @@ export default {
// path='H:\\小曾发来的新项目\\kettle\\kettle-webapp\\file_trans1.zip';
path="D:\\file\\111.zip";
this.uploadPath=path;
this.Imptree(path);
},
// 导入资源库
Imptree(path){
......@@ -189,18 +189,18 @@ export default {
formData.append('node', 'root');
console.log('参数==',formData);
Imptree(formData).then(res=>{
if (res) {
if (res) {
// this.$message.success('成功!');
this.impFileList=res;
}else {
this.$message.error(res.errMsg)
}
})
},
},
};
......@@ -210,4 +210,4 @@ export default {
background-color: #8888ff;
color: #fff;
}
</style>
\ No newline at end of file
</style>
import main from './main.vue'
export default main
\ No newline at end of file
<template>
<div>
<el-table :data="tableData" style="width: 100%">
<template v-for="(item,index) in tableHead">
<el-table-column :prop="item.column_name" :label="item.column_comment" :key="index"></el-table-column>
</template>
<el-table-column label="操作" width="100px">
<template slot-scope="scope">
<el-button
@click="editField(false, scope.row)"
type="text"
size="small"
>编辑</el-button
>
<el-button
type="text"
size="small"
@click="deletefield(scope.$index, tableData)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { getFileexplorer,getFilextension } from "@/api/kettle/file";
export default {
name: "table-list",
data() {
return {
fieldForm: {},
// field: false,
dataState: false,
fieldFormat: [],
fieldType: [],
// 表头数据
// tableHead2:[
// {
// column_name: "column_name",column_comment:"表字段"
// },
// {
// column_name: "column_age",column_comment:"流字段"
// },
// ],
// // 表格数据
// tableData2: [{
// column_age: '3',
// column_name: '鞠婧祎',
// },
// {
// column_age: '25',
// column_name: '魏大勋',
// },
// {
// column_age: '18',
// column_name: '关晓彤',
// }],
}
},
props: {
tableHead:Array,
tableData:Array,
field:Boolean,
fieldClick:Function
},
created() {
},
methods: {
editField(state, val) {
// this.field = !this.field;
this.$emit("update:field", true);
this.fieldClick(state, val);
// this.dataState = state;
// if (state) {
// this.fieldForm = {};
// } else {
// this.fieldForm = val;
// }
},
// handleClose(){},
deletefield(index, rows) {
rows.splice(index, 1);
},
// 字段
// addField() {
// this.field = !this.field;
// if (this.dataState) {
// this.tableData.push(this.fieldForm);
// } else {
// }
// },
},
};
</script>
<style>
.type-checked {
background-color: #8888ff;
color: #fff;
}
</style>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<el-tab-pane label="资源库" name="first">
<div class="sel-content">
<div class="sel-menu-bar">
<el-dropdown
<el-dropdown
size="small"
placement="bottom"
>
......@@ -14,15 +14,15 @@
新建
<i class="el-icon-caret-bottom el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="password" @click.native="createTrans()">
<template>
<template>
<i style="color:red;font-weight:bold;font-size:15px;" class="el-icon-refresh"></i>
新建转换
</template>
</el-dropdown-item>
<el-dropdown-item command="logout" @click.native="createJob()">
<template>
<template>
<i style="color:#F99C1C;font-weight:bold;font-size:15px;" class="el-icon-refresh-left"></i>
新建任务
</template>
......@@ -31,14 +31,14 @@
<el-dropdown-item class="text-center">打开</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown
<el-dropdown
size="small"
placement="bottom">
<span class="sel-btn">
资源库管理
<i class="el-icon-caret-bottom el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="showModalOne()">连接资源库</el-dropdown-item>
<el-dropdown-item >管理资源库</el-dropdown-item>
<el-dropdown-item >断开资源库</el-dropdown-item>
......@@ -46,14 +46,14 @@
<el-dropdown-item>导入资源库</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown
<el-dropdown
size="small"
placement="bottom">
<span class="sel-btn">
帮组
<i class="el-icon-caret-bottom el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-menu slot="dropdown">
<el-dropdown-item> 语言切换</el-dropdown-item>
<el-dropdown-item >关于</el-dropdown-item>
</el-dropdown-menu>
......@@ -71,16 +71,16 @@
:highlight-current="true"
@node-click="handleNodeClick"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span style="display:flex;align:center;">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span style="display:flex;align:center;">
<div v-if="data.iconCls" :class="data.iconCls" style="display:inline-block;width:20px;height:20px;background-repeat:no-repeat;background-position:center;" width="" alt=""></div>
{{ node.label }}
{{ node.label }}
</span>
</span>
</el-tree>
<!-- 文件夹存放区域end -->
</div>
</div>
</el-tab-pane>
<el-tab-pane label="核心对象" name="second" v-if="tabShowFlag">
<div class="sel-content">
......@@ -88,21 +88,21 @@
<nodeMenu2 @shooStatus="shooStatus"></nodeMenu2>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-tabs>
</div>
<div class="resize" title="收缩侧边栏">...</div>
<div class="mid">
<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="数据库名称" >
<mxgraph-designer ref="pic" v-if="mxGraphShow" :blankCanvas="blankCanvas"></mxgraph-designer>
</el-tab-pane>
</el-tabs>
</div>
</el-tabs>
</div>
<!-- 弹窗1start -->
<el-dialog
......@@ -160,7 +160,7 @@
<li class="btn" @mouseenter="typeHoverIdx = idx" @mouseleave="typeHoverIdx = -1" @click="typeCheckedIdx=idx" :class="{'hover': typeHoverIdx == idx,'checked': typeCheckedIdx == idx}" v-for="(item,idx) in typesList" :key="idx" >
{{ item.type }}:{{ item.name }}
</li>
</ul>
</div>
......@@ -205,16 +205,16 @@
<el-button type="primary" @click="repositoryInfoConfirm('repositoryInfoForm')">确 定</el-button>
<el-button @click="createOrUpdate">创建或更新</el-button>
<el-button @click="dialogVisibleRemind = true">删 除</el-button>
<el-button @click="dialogVisibleThree = false">取 消</el-button>
<el-button @click="dialogVisibleThree = false">取 消</el-button>
<!-- <el-button type="primary" @click="dialogVisibleTwo = false">确 定</el-button> -->
</span>
</el-dialog>
<!-- 弹窗3end -->
<!-- 弹窗4start -->
<estab-dialog ref="establishDia" :dialogVisibleFourth.sync='dialogVisibleFourth' @getSonValue="getSonValue" :listNames="listNames"></estab-dialog>
<!-- 弹窗5start -->
......@@ -233,10 +233,10 @@
</span>
</div>
</el-form-item>
<el-form-item label="只读资源库?:" prop="checkPass">
<el-checkbox ></el-checkbox>
</el-form-item>
</el-form-item>
<el-form-item label="不显示隐藏文件:" prop="checkPass">
<el-checkbox ></el-checkbox>
......@@ -252,7 +252,7 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeFileModal()">取 消</el-button>
<el-button type="primary" @click="FileModal = false">确 定</el-button>
<el-button type="primary" @click="FileModal = false">确 定</el-button>
</span>
</el-dialog>
<!-- 弹窗5end -->
......@@ -277,28 +277,28 @@
ref="tree"
:props="defaultProps"
:highlight-current="true"> -->
<!-- el-icon-folder -->
<!-- <span class="custom-tree-node" slot-scope="{node,data}">
<span>
<i :class="data.icon"></i>{{ node.label }}
</span>
</span>
</span> -->
<!-- <span class="custom-tree-node" slot-scope="{node,data}">
<span>
<i class="el-icon-folder"></i>{{ node.label }}
</span>
</span>
</span>
</el-tree> -->
<!-- 文件夹存放区域end -->
</div>
<span slot="footer" class="dialog-footer" style="display:flex;">
<el-select style="flex:1;margin-right:25px;" v-model="ruleForm.region" placeholder="请选择选择数据库连接">
......@@ -306,7 +306,7 @@
<el-option label="区域二" value="beijing"></el-option>
</el-select>
<el-button @click="FileModalScan = false">取 消</el-button>
<el-button type="primary" @click="FileModalScan = false">确 定</el-button>
<el-button type="primary" @click="FileModalScan = false">确 定</el-button>
</span>
</el-dialog>
<!-- 弹窗6end -->
......@@ -373,7 +373,7 @@ export default {
feature,//特征列表
establishDialog,
// Establish,//新建转换,新建作业,新建目录弹窗
},
props: ["dragItem"],
......@@ -381,7 +381,7 @@ props: ["dragItem"],
return {
blankCanvas:"",//空白画布xml
graph:null,
flowData:[],
flowData:[],
exportDialogVisible:false,//导出资源库弹窗
curDataBase:null,//当前选择的资源库
......@@ -391,7 +391,7 @@ props: ["dragItem"],
estabTitle:'转换',//新建转换弹窗提示
featureDialogVisible:false,//特征列表弹窗
scanDialogVisible:false,//浏览弹窗
prefix:'http://192.168.0.2:9700/etlweb/',
prefix:this.etlWeb,
inputValue:'',// 密码
// dropFunction,//删除数据库表
deleteLink,//删除资源库模块的方法
......@@ -473,7 +473,7 @@ props: ["dragItem"],
// logLevel:[
// {required:true,message:'请选择日志级别',trigger:'change'}
// ],
},
checkModel:[],
visible:true,
......@@ -532,7 +532,7 @@ props: ["dragItem"],
fileTreeList:[
{ iconCls:"imageFolder",
path:"/",
childen:[]},
childen:[]},
// {
// "id":"f1e1928d205b49a8b4ceda97d51074c1",
// "text":"45",
......@@ -610,7 +610,7 @@ props: ["dragItem"],
childenTreeList:[],
// defaultProps: {
// label: 'path',
// children: 'children',
// children: 'children',
// },
defaultProps: {
label: "text",
......@@ -630,8 +630,8 @@ props: ["dragItem"],
dialogVisibleThree:false,//资源库信息弹窗
dialogVisibleFourth:false,
// linkType:[
// {value: 0, text: '一般'},
// {value: 1, text: '高级'},
// {value: 0, text: '一般'},
// {value: 1, text: '高级'},
// {value: 2, text: '选项'},
// {value: 3, text: '连接池'},
// {value: 4, text: '集群'}
......@@ -647,30 +647,30 @@ props: ["dragItem"],
mounted () {
this.dragControllerDiv();//左右窗体调整宽度
// this.treeRevert(this.jobTreeList);
// this.accessData();//页面一加载就获取连接类型
this.explorer('');//获取文件夹列表
// console.log(this.$refs.establishDia.linkType,'55555555555555555')
// this.$nextTick(function () {
// console.log(this.$refs.establishDia,'========')
// // this.$refs.establishDia.accessData();//页面一加载就获取连接类型
// this.$refs.establishDia.accessData();//页面一加载就获取连接类型
// })
// this.dialogVisibleFourth=true
// this.$refs.scanDialog.dataBaseScan(formData);
},
methods: {
......@@ -679,15 +679,15 @@ props: ["dragItem"],
//接收子组件显示画布
shooStatus(e){
console.log(e,'接收子组件显示画布')
this.$nextTick(()=>{
this.mxGraphShow = e
})
},
......@@ -699,11 +699,11 @@ props: ["dragItem"],
formData.append('path', path);
formData.append('node', 'xnode-14');
this.$forceUpdate();
explorer(formData).then(res=>{
if (res) {
explorer(formData).then(res=>{
if (res) {
if(path==''){
console.log('点击当前path==',path);
this.fileTreeList=res;
// this.fileTreeList=JSON.stringify(this.fileTreeList);
}else{
......@@ -711,17 +711,17 @@ props: ["dragItem"],
this.childenTreeList=res;
console.log('子节点2path==',this.childenTreeList);
}
}else {
this.$message.error(res.errMsg)
}
})
},
// 左边文件夹和右边画布的宽度可以拖拽调整
dragControllerDiv: function () {
var resize = document.getElementsByClassName('resize');
......@@ -772,7 +772,7 @@ props: ["dragItem"],
return {...pre, [cur['id']]: cur}
}, {});
console.log(formatObj);
let formatArray = arrayList.reduce((arr, cur) => {
// let pid = cur.pid ? cur.pid : 0;
let pid = cur.parent ? cur.parent : 0;
......@@ -786,11 +786,11 @@ props: ["dragItem"],
return arr;
}, []);
console.log('树形数据=============',formatArray);
// this.jobTreeList=formatArray;
},
// 打开关闭弹窗
showModalOne(){
console.log('打卡资源库连接:');
......@@ -802,7 +802,7 @@ props: ["dragItem"],
this.listHoverIdx=-1;//清空当前鼠标移动到的数据
this.listCheckedIdx=-2;//清空当前鼠标选中的数据
},
showModalTwo(){
this.dialogVisibleTwo=true;
this.types();
......@@ -810,7 +810,7 @@ props: ["dragItem"],
handleCloseTwo(){
this.dialogVisibleTwo=false;
},
showModalThree(typeCheckedIdx){
console.log('当前点击---',typeCheckedIdx);
if(typeCheckedIdx==0){
......@@ -819,7 +819,7 @@ props: ["dragItem"],
if(typeCheckedIdx==1){
this.FileModal=true;
}
},
handleCloseThree(){
this.dialogVisibleThree=false;
......@@ -829,11 +829,11 @@ props: ["dragItem"],
this.dialogVisibleFourth=true;
this.$refs.establishDia.database();
// this.accessData();//获取连接类型
this.$refs.establishDia.accessMethod();//获取连接方式
this.$refs.establishDia.accessMethod();//获取连接方式
// console.log('this.methodHoverIdx==',this.methodHoverIdx);
// console.log('this.methodCheckedIdx==',this.methodCheckedIdx);
},
//获取新建弹窗返回来的值
getSonValue(res){
......@@ -852,7 +852,7 @@ props: ["dragItem"],
// this.methodCheckedIdx=0;//关闭弹窗后初始化选择oracle数据对应第一条
// this.addFlag=true;//增减变量改为编辑变量
// },
closeFileModal(){
this.FileModal=false;
},
......@@ -868,7 +868,7 @@ props: ["dragItem"],
// 获取资源库连接类型
types(){
types().then(res=>{
if (res) {
if (res) {
console.log('获取类型成功!');
this.typesList=res;
}else {
......@@ -879,7 +879,7 @@ props: ["dragItem"],
// 获取历史建立的连接资源库列表
getLinkList(){
getLinkList().then(res=>{
if (res) {
if (res) {
console.log('获取历史连接资源库列表:');
this.linkList=res;
}else {
......@@ -892,7 +892,7 @@ props: ["dragItem"],
comfirmCreate(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
// JSON对象转成formData对象
var params=this.createModel;
// 由于高级选项连接池集群页面没有画完,保存默认参数
......@@ -921,24 +921,24 @@ props: ["dragItem"],
this.dialogVisibleFourth=false;//关闭弹窗
this.linkCheckedIdx=this.initlinkTypeIdx;//关闭弹窗后初始化选择的数据
this.listNames();//刷新已经创建的数据库列表
}else {
this.$message.error(res.message)
}
})
}else {
this.$message.error(res.message)
}
})
}
});
},
//查询已经建立的所有数据库列表
listNames(){
listNames().then(res=>{
if (res) {
if (res) {
console.log('获取所有已经创建的数据库列表:',res);
this.namesList=res;
}else {
......@@ -947,7 +947,7 @@ props: ["dragItem"],
})
},
//选择数据库编辑
selectNameFunc(e){
selectNameFunc(e){
console.log('当前选中的数',e);
console.log('当前选中的数-===',this.selectName);
},
......@@ -957,30 +957,30 @@ props: ["dragItem"],
},
editDataBaseModal(){
if(this.selectName){
this.dialogVisibleFourth=true;
this.dialogVisibleFourth=true;
// this.addFlag=false;//增减变量改为编辑变量
}
this.$refs.establishDia.database(this.selectName);
this.$refs.establishDia.accessMethod();//获取连接方式
// console.log('this.methodHoverIdx==',this.methodHoverIdx);
// console.log('this.methodCheckedIdx==',this.methodCheckedIdx);
},
// 资源库连接
loginRepository(formName){
console.log('进入登录==========');
this.$refs[formName].validate((valid) => {
if (valid) {
if (valid) {
// JSON对象转成formData对象
var params=this.loginModel;
params.atStartupShown=false;//在启动时显示此对话框默认为 false
console.log('登录提交参数==',params);
var formData = new FormData();
formData.append('loginInfo', JSON.stringify(params));
formData.append('loginInfo', JSON.stringify(params));
console.log('提交转换数据:',formData);
loginRepository(formData).then(res=>{
console.log('返回数据:',res);
......@@ -988,13 +988,13 @@ props: ["dragItem"],
this.$message.success('连接成功!');
this.explorer('');
this.handleCloseOne();//关闭弹窗
// this.linkCheckedIdx=this.initlinkTypeIdx;//关闭弹窗后初始化选择的数据
}else {
this.$message.error(res.errMsg)
}
})
} else {
console.log('error submit!!');
return false;
......@@ -1037,7 +1037,7 @@ props: ["dragItem"],
// 资源库信息确定新建
repositoryInfoConfirm(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
if (valid) {
// JSON对象转成formData对象
var params=this.repositoryInfoModel;
params.type='KettleDatabaseRepository';//写死
......@@ -1051,7 +1051,7 @@ props: ["dragItem"],
console.log('提交数据:',res);
if (res.success) {
this.$message.success('成功!');
this.handleCloseThree();// 关闭弹窗1
this.handleCloseTwo();//关闭弹窗2
this.getLinkList();//刷新列表
......@@ -1062,7 +1062,7 @@ props: ["dragItem"],
this.$message.error(res.errMsg)
}
})
} else {
console.log('error submit!!');
return false;
......@@ -1111,7 +1111,7 @@ props: ["dragItem"],
var formData = new FormData();
formData.append('databaseInfo', JSON.stringify(params));
console.log('表单提交参数==',params);
this.$refs.feature.feature(formData);
this.featureDialogVisible = true;
},
......@@ -1150,7 +1150,7 @@ props: ["dragItem"],
// formData.append('nodeId', '');
// formData.append('text', 'root');
// formData.append('node', 'xnode-2984');
// formData.append('node', 'xnode-2984');
this.$refs.scanDialog.dataBaseScan(formData);
this.scanDialogVisible = true;
},
......@@ -1160,7 +1160,7 @@ props: ["dragItem"],
formData.append('repositoryName', this.loginModel.reposityId);
console.log('参数==',formData);
remove(formData).then(res=>{
if (res) {
if (res) {
this.$message.success('成功!');
this.getLinkList();//打开资源库连接弹窗同时获取历史连接记录
......@@ -1176,7 +1176,7 @@ props: ["dragItem"],
this.estabTitle='转换';
}else{
this.$message.error('请选择资源库中的一个目录');
}
}
},
// 新建任务
createJob(){
......@@ -1185,8 +1185,8 @@ props: ["dragItem"],
this.estabTitle='任务';
}else{
this.$message.error('请选择资源库中的一个目录');
}
}
},
// 新建目录
createFile(){
......@@ -1195,8 +1195,8 @@ props: ["dragItem"],
this.estabTitle='目录';
}else{
this.$message.error('请选择资源库中的一个目录');
}
}
},
handleNodeClick(data,node){
console.log('点击当前节点===',node);
......@@ -1219,20 +1219,20 @@ props: ["dragItem"],
// decoder.decode(node, graph.getModel());
// console.log(esponse.responseText);
})
},
//修改资源库
editDataBase(){
if(this.curDataBase){
editDataBase(){
if(this.curDataBase){
this.repositoryInfoModel.name=this.curDataBase.name;
this.repositoryInfoModel.description=this.curDataBase.description;
this.selectName=this.curDataBase.extraOptions.database;
this.dialogVisibleThree=true;
}else{
this.$message.error('请选择一个资源库');
}
......@@ -1243,7 +1243,7 @@ props: ["dragItem"],
formData.append('connection', this.selectName);
console.log('参数==',formData);
checkInit(formData).then(res=>{
if (res) {
if (res) {
this.$message.success('成功!');
// this.getLinkList();//打开资源库连接弹窗同时获取历史连接记录
......@@ -1259,12 +1259,12 @@ props: ["dragItem"],
}
}
};
</script>
......@@ -1272,4 +1272,4 @@ props: ["dragItem"],
<style>
@import url(./kettle.css);
</style>
\ No newline at end of file
</style>
......@@ -2,7 +2,7 @@ import mxgraph from './mx.js'
import { steps } from '@/api/kettle/link'
const MxConstants = mxgraph.mxConstants
const prefix = '192.168.0.2:9700/etlweb/'
const prefix = this.etlWeb
const bar = []
const pamer = new FormData() // 创建form对象
......
......@@ -132,16 +132,58 @@
<el-tab-pane label="数据库字段" name="oher ">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-button style="padding: 3px 0" type="text">新增字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="fieldClick(true)">新增字段</el-button>
<el-button style="padding: 3px 0" type="text">删除字段</el-button>
<el-button style="padding: 3px 0" type="text">获取字段</el-button>
<el-button style="padding: 3px 0" type="text">输入字段映射</el-button>
</div>
<el-table style="width: 100%" border :data="tableData2">
<!-- <el-table style="width: 100%" border :data="tableData2">
<template v-for="(item,index) in tableHead2">
<el-table-column :prop="item.column_name" :label="item.column_comment" :key="index" v-if="item.column_name != 'id'"></el-table-column>
</template>
</el-table>
</el-table> -->
<table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list>
<!-- 编辑弹窗开始=========== -->
<el-dialog
title="编辑"
:visible.sync="field"
width="500px"
:before-close="handleCloseEdit"
append-to-body>
<el-form ref="form" :model="fieldForm" label-width="80px">
<!-- <el-checkbox-group v-model="checkedCities" style="width:100%;">
<el-checkbox > -->
<el-form-item label="表字段:">
<el-select v-model="fieldForm.column_name" style="width: 100%">
<el-option label="不去掉空格" value="none"></el-option>
<el-option label="去掉左空格" value="left"></el-option>
<el-option label="去掉右空格" value="right"></el-option>
<el-option label="去掉左右两端空格" value="both"></el-option>
</el-select>
</el-form-item>
<!-- </el-checkbox> -->
<!-- <el-checkbox > -->
<el-form-item label="流字段:">
<el-select v-model="fieldForm.stream_name" style="width: 100%">
<el-option label="不去掉空格" value="none"></el-option>
<el-option label="去掉左空格" value="left"></el-option>
<el-option label="去掉右空格" value="right"></el-option>
<el-option label="去掉左右两端空格" value="both"></el-option>
</el-select>
</el-form-item>
<!-- </el-checkbox>
</el-checkbox-group> -->
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="field = false">取 消</el-button>
<el-button type="primary" @click="addField">确 定</el-button>
</span>
</el-dialog>
<!-- 编辑弹窗结束============ -->
</el-card>
</el-tab-pane>
</el-tabs>
......@@ -155,9 +197,18 @@
</template>
<script>
import {
inputOutputFields,//获取表输出
} from "@/api/kettle/file";
export default ({
data(){
return{
field:false,//编辑弹窗
checkedCities: ['上海', '北京'],
editDia:false,//编辑表字段
fieldForm:{},//编辑弹窗
radioTreaty:'0',
tableOutForm:{
commit: "1000",
......@@ -191,6 +242,31 @@ export default ({
include_subfolders: "1",
},
],
// 表头数据
tableHead:[
{
column_name: "column_name",column_comment:"表字段"
},
{
column_name: "stream_name",column_comment:"流字段"
},
],
// 表格数据
tableData: [{
stream_name: '3',
column_name: '鞠婧祎',
},
{
stream_name: '25',
column_name: '魏大勋',
},
{
stream_name: '18',
column_name: '关晓彤',
}],
// 表头数据
tableHead2:[
{
......@@ -253,38 +329,48 @@ export default ({
handleClose(){
this.$emit("update:tableOutPutVisible", false);
},
//新建转换
createTrans(){
var formData = new FormData();
var formData = new FormData();
formData.append('dir', this.nodePath);
formData.append('transName', this.inputValue);
// console.log('新建提交参数==',params);
createTrans(formData).then(res=>{
if (res) {
this.$message.success('创建成功!');
this.explorer('');
this.$emit("update:estabDialogVisible", false);
}else {
this.$message.error(res.errMsg)
}
//获取表输出
inputOutputFields(){
// var enc = new mxCodec(mxUtils.createXmlDocument());
// var node = enc.encode(graph.getModel());
// store.baseParams.stepName = encodeURIComponent(cell.getAttribute('label'));
// store.baseParams.graphXml = mxUtils.getPrettyXml(node);
// store.baseParams.before = true
let pamer = new FormData(); // 创建form对象
pamer.append("stepName", this.nodePath);
pamer.append("graphXml", "transformation");
pamer.append("before", true);
pamer.append("query", '');
inputOutputFields(pamer).then(res=>{
console.log(res,'返回空白画布xml');
this.blankCanvas = res
})
},
// 上传
handleChange(file, fileList) {
// console.log(file);
this.fileList = fileList.slice(-3);
this.tableData.push({ name: file.name });
// console.log(this.tableData);
// this.getObjectURL(file.raw)
// console.log(this.getObjectURL(file.raw));
//新增或者编辑弹窗
fieldClick(state, val) {
this.field = !this.field;
this.dataState = state;
if (state) {
this.fieldForm = {};
} else {
this.fieldForm = val;
}
},
//关闭编辑的弹窗
handleCloseEdit(){
this.field = !this.field;
},
addSheet(){},
fileChnageInput(e) {
console.log(e);
// 字段
addField() {
this.field = !this.field;
console.log('添加的字段===',this.fieldForm);
if (this.dataState) {
this.tableData.push(this.fieldForm);
}
},
}
......
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