Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ETL-admin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
莫晓莉
ETL-admin
Commits
96d15519
Commit
96d15519
authored
Apr 18, 2021
by
李耀锟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://139.159.239.83:9093/mxl/ETL-admin
into master
parents
91571fd0
504d8173
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
718 additions
and
256 deletions
+718
-256
src/views/dashboard-kettle/components/designer/mxgraphDesigner.vue
+8
-6
src/views/dialogs-components/global/database-choose/main.vue
+109
-70
src/views/dialogs-components/global/establish/main.vue
+42
-0
src/views/output-dialog/Excel-output.vue
+9
-0
src/views/output-dialog/delete.vue
+90
-31
src/views/output-dialog/insertOrUpdate.vue
+84
-15
src/views/output-dialog/micro-excel.vue
+73
-38
src/views/output-dialog/sqlFileOutput.vue
+37
-2
src/views/output-dialog/synchronize.vue
+115
-17
src/views/output-dialog/table-out.vue
+83
-59
src/views/output-dialog/text-file-output.vue
+22
-1
src/views/output-dialog/update.vue
+46
-17
No files found.
src/views/dashboard-kettle/components/designer/mxgraphDesigner.vue
View file @
96d15519
...
...
@@ -841,7 +841,7 @@
:getXmlVal=
"getXmlVal"
@
fathertrans=
"fathertrans"
:saveOutputDialog=
"saveOutputDialog"
:tableOutForm=
"outPutFormData1"
:tableOutForm
Send
=
"outPutFormData1"
></outDialog>
<insertOrUpdate
ref=
"insertOrdate"
...
...
@@ -849,7 +849,7 @@
:saveOutputDialog=
"saveOutputDialog"
:doubleClickCell=
"doubleClickCell"
:getXmlVal=
"getXmlVal"
:insertOrUpdateForm=
"outPutFormData2"
:insertOrUpdateForm
Send
=
"outPutFormData2"
></insertOrUpdate>
<excelOutPutDialog
ref=
"excelOut"
...
...
@@ -863,28 +863,28 @@
:updateVisible
.
sync=
"updateVisible"
:saveOutputDialog=
"saveOutputDialog"
:doubleClickCell=
"doubleClickCell"
:updateForm=
"outPutFormData4"
:updateForm
Send
=
"outPutFormData4"
:getXmlVal=
"getXmlVal"
></updateDialog>
<synDialog
ref=
"syn"
:synVisible
.
sync=
"synVisible"
:saveOutputDialog=
"saveOutputDialog"
:doubleClickCell=
"doubleClickCell"
:synForm=
"outPutFormData5"
:synForm
Send
=
"outPutFormData5"
:getXmlVal=
"getXmlVal"
></synDialog>
<delDialog
ref=
"del"
:deleteVisible
.
sync=
"deleteVisible"
:saveOutputDialog=
"saveOutputDialog"
:doubleClickCell=
"doubleClickCell"
:deleteForm=
"outPutFormData6"
:deleteForm
Send
=
"outPutFormData6"
:getXmlVal=
"getXmlVal"
></delDialog>
<sqlDialog
ref=
"sql"
:sqlVisible
.
sync=
"sqlVisible"
:saveOutputDialog=
"saveOutputDialog"
:doubleClickCell=
"doubleClickCell"
:sqlForm=
"outPutFormData7"
:sqlForm
Send
=
"outPutFormData7"
></sqlDialog>
<textFileDialog
ref=
"textFile"
...
...
@@ -1818,7 +1818,9 @@ previousField(){
//mico-Excel输出
this
.
microVisible
=
!
this
.
microVisible
;
this
.
outPutFormData9
=
this
.
showDataFunc
();
setTimeout
(()
=>
{
this
.
$refs
.
mic
.
clickFun
(
this
.
graph
);
//向子组件传递画布
},
500
);
return
;
}
else
if
(
cell
.
ids
==
"step9"
||
cell
.
value
.
attributes
.
ctype
.
value
==
"ExcelOutput"
)
{
//Excel输出
...
...
src/views/dialogs-components/global/database-choose/main.vue
View file @
96d15519
...
...
@@ -3,9 +3,7 @@
<el-form-item
label=
"数据库连接:"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"14"
>
<el-select
style=
"width: 100%"
v-model=
"form.connection"
placeholder=
"请选择选择数据库连接"
@
focus=
"getGraphDataBases"
>
<el-select
style=
"width: 100%"
v-model=
"newform.connection"
placeholder=
"请选择选择数据库连接"
@
focus=
"getGraphDataBases"
@
change=
"selectNameFunc"
>
<el-option
v-for=
"(item,index) in namesList"
:key=
"index"
:label=
"item.name"
:value=
"item.name"
></el-option>
</el-select>
...
...
@@ -24,7 +22,7 @@
<el-form-item
label=
"目的模式:"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"20"
>
<el-input
v-model=
"form.schema"
></el-input>
<el-input
v-model=
"
new
form.schema"
></el-input>
</el-col>
<el-col
class=
"line"
:span=
"3"
>
...
...
@@ -35,7 +33,7 @@
<el-form-item
label=
"目标表:"
prop=
"text"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"20"
>
<el-input
ref=
"goal"
v-model=
"form.table"
></el-input>
<el-input
ref=
"goal"
v-model=
"
new
form.table"
></el-input>
</el-col>
<el-col
class=
"line"
:span=
"3"
>
...
...
@@ -44,7 +42,7 @@
</el-row>
</el-form-item>
<estab-dialog
ref=
"establishDia"
:noneRespository=
"noneRespository"
:graph
.
sync=
"newGraph"
:getXmlVal=
"getXmlVal"
:form=
"form"
:dialogVisibleFourth
.
sync=
'dialogVisibleFourth'
@
getSonValue=
"getSonValue"
:listNames=
"listNames"
:chooseFlag
.
sync=
"chooseFlag"
:chooseType=
"chooseType"
></estab-dialog>
<estab-dialog
ref=
"establishDia"
:noneRespository=
"noneRespository"
:graph
.
sync=
"newGraph"
:getXmlVal=
"getXmlVal"
:form=
"
new
form"
:dialogVisibleFourth
.
sync=
'dialogVisibleFourth'
@
getSonValue=
"getSonValue"
:listNames=
"listNames"
:chooseFlag
.
sync=
"chooseFlag"
:chooseType=
"chooseType"
></estab-dialog>
</div>
</
template
>
...
...
@@ -81,25 +79,21 @@ export default {
connectionName
:
''
,
curNode
:[],
chooseFlag
:
false
,
//选择模式
// newF
orm:{},
newf
orm
:{},
chooseType
:
''
,
newGraph
:{}
}
},
// watch:{
// graph(n,o){
// console.log("表输出拿到的画布2222===",n);
// },
// },
props
:[
"form"
,
"getXmlVal"
,
"graph"
,
"fatherFun"
],
props
:[
"form"
,
"getXmlVal"
,
"graph"
],
created
()
{
this
.
listNames
();
// 深拷贝解决第一次不执行
this
.
newform
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
)),
console
.
log
(
this
.
newform
,
'ceate newform========='
);
console
.
log
(
this
.
form
,
'create--form========='
);
// this.newForm = this.form
},
methods
:
{
...
...
@@ -118,21 +112,61 @@ export default {
// this.$refs.goal.refreshData(this.from)
if
(
this
.
chooseType
==
'表'
){
console
.
log
(
'进入表----'
,
res
);
this
.
$set
(
this
.
form
,
'table'
,
this
.
curNode
.
data
.
text
);
this
.
$forceUpdate
()
this
.
$set
(
this
.
newform
,
'table'
,
this
.
curNode
.
data
.
text
);
this
.
$forceUpdate
();
// 传变量changeTable判断表有没有变start=========
// console.log(this.form.table==this.newform.table);
// console.log(this.form,'深拷贝表');
// console.log(this.newform,'选择后的表')
// if(this.form.table==this.newform.table){
// if(this.form.connection==this.newform.connection){
// this.newform= JSON.parse(JSON.stringify(this.form));
// this.newform.changeTable=false;
// }else{
// this.newform.changeTable=true;
// }
// }else{
// this.newform.changeTable=true;
// }
// this.newform.changeConnection=false;
// console.log(this.newform,'=========更改表')
this
.
$emit
(
'fatherFun'
,
this
.
newform
);
// 变量changeTable判断表有没有变end===========
}
console
.
log
(
'this.curNode.data.leaf=====:'
,
this
.
curNode
.
data
.
leaf
);
if
(
this
.
chooseType
==
'模式'
&&
this
.
curNode
.
data
.
leaf
&&
this
.
curNode
.
parent
.
data
.
text
==
this
.
chooseType
){
console
.
log
(
'进入模式----'
,
res
);
this
.
$set
(
this
.
form
,
'schema'
,
this
.
curNode
.
data
.
text
);
this
.
$forceUpdate
()
this
.
$set
(
this
.
newform
,
'schema'
,
this
.
curNode
.
data
.
text
);
this
.
$forceUpdate
();
// 变量changeSchema判断模式有没有变start=========
// console.log(this.form.schema==this.newform.schema);
// if(this.form.schema==this.newform.schema){
// if(this.form.connection==this.newform.connection){
// this.newform= JSON.parse(JSON.stringify(this.form));
// this.newform.changeSchema=false;
// }else{
// this.newform.changeSchema=true;
// }
// }else{
// this.newform.changeSchema=true;
// }
// this.newform.changeConnection=false;
// console.log(this.newform,'=========更改模式')
this
.
$emit
(
'fatherFun'
,
this
.
newform
);
// 变量changeSchema判断模式有没有变end===========
}
// this.$forceUpdate()
console
.
log
(
'chuanhuo====='
,
this
.
form
);
console
.
log
(
'chuanhuo====='
,
this
.
newform
);
// 发射回父组件
this
.
form
.
connection
=
this
.
form
.
connection
;
this
.
$emit
(
"update:form"
,
this
.
form
);
// this.$emit("update:form", this.newform);
}
else
if
(
typeof
(
res
)
==
'boolean'
){
this
.
dialogVisibleFourth
=
res
;
...
...
@@ -154,8 +188,6 @@ export default {
// 新增数据库
newAdd
(){
this
.
dialogVisibleFourth
=
true
;
// this.$refs.establishDia.database();
// this.$refs.establishDia.clickFun(this.newGraph);//先把画布传过去
this
.
$refs
.
establishDia
.
clickFun
(
this
.
graph
);
//先把画布传过去
this
.
$refs
.
establishDia
.
getTransDatabase
();
this
.
$refs
.
establishDia
.
accessMethod
();
//获取连接方式
...
...
@@ -166,9 +198,30 @@ export default {
//选择数据库编辑
selectNameFunc
(
e
){
console
.
log
(
'当前选中的数'
,
e
);
console
.
log
(
'当前选中的数-==='
,
this
.
form
.
connection
);
// this.selectName=this.se
// this.form.connection=this.form.connection;
console
.
log
(
'当前选中的数-==='
,
this
.
newform
.
connection
);
console
.
log
(
'原来深拷贝的数-==='
,
this
.
form
.
connection
);
console
.
log
(
this
.
form
.
connection
==
this
.
newform
.
connection
);
// 把选中保存到画布start======
// this.$refs.establishDia.clickFun(this.graph);//先把画布传过去
// this.$refs.establishDia.getTransDatabase(this.newform.connection);
// this.$refs.establishDia.saveDataBases();//保存到画布xml
// 把选中的保存到画布end=======
// 传变量changeConnection判断数据库有没有变start----------------------
if
(
this
.
form
.
connection
==
this
.
newform
.
connection
){
this
.
newform
.
changeConnection
=
false
;
this
.
newform
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
));
}
else
{
this
.
newform
.
schema
=
""
;
this
.
newform
.
table
=
""
;
this
.
newform
.
changeConnection
=
true
;
}
console
.
log
(
this
.
newform
,
'=========下拉'
)
this
.
$emit
(
'fatherFun'
,
this
.
newform
);
// 传变量changeConnection判断数据库有没有变start----------------------
},
//点击选择获取已经创建的数据库列表
clickFunc
(){
...
...
@@ -176,29 +229,30 @@ export default {
},
// 编辑
editDataBaseModal
(){
// this.$refs.establishDia.clickFun(this.newGraph);//先传画布
this
.
$refs
.
establishDia
.
clickFun
(
this
.
graph
);
//先把画布传过去
if
(
this
.
form
.
connection
){
if
(
this
.
new
form
.
connection
){
this
.
dialogVisibleFourth
=
true
;
}
// this.$refs.establishDia.database(this.selectName);
this
.
$refs
.
establishDia
.
getTransDatabase
(
this
.
form
.
connection
);
this
.
$refs
.
establishDia
.
getTransDatabase
(
this
.
newform
.
connection
);
this
.
$refs
.
establishDia
.
accessMethod
();
//获取连接方式
},
//浏览
scanTree
(
type
){
console
.
log
(
'当前选中链接***************'
,
this
.
form
.
connection
);
console
.
log
(
'当前选中链接***************'
,
this
.
new
form
.
connection
);
this
.
chooseType
=
type
;
if
(
this
.
form
.
connection
){
// this.$refs.establishDia.database(this.selectName);
this
.
$refs
.
establishDia
.
getTransDatabase
(
this
.
form
.
connection
);
if
(
this
.
newform
.
connection
){
this
.
$refs
.
establishDia
.
getTransDatabase
(
this
.
new
form
.
connection
);
console
.
log
(
'当前选中数据库***************'
,
this
.
connectionName
);
if
(
this
.
connectionName
){
//判断后台有数据发射回来后再调用弹窗不然不显示树数据或者加载数据延迟
// if(this.connectionName){//判断后台有数据发射回来后再调用弹窗不然不显示树数据或者加载数据延迟
setTimeout
(()
=>
{
this
.
$refs
.
establishDia
.
scanDialogOpen
();
this
.
chooseFlag
=
true
;
console
.
log
(
"浏览弹窗传过去的类型====="
,
type
);
},
500
);
// this.chooseType=type;
}
//
}
}
else
{
this
.
$message
.
error
(
'请选择数据库'
)
}
...
...
@@ -206,7 +260,6 @@ export default {
},
// 获取保存到画布的databases
getGraphDataBases
(){
// var graph = this.getGraph();
var
root
=
this
.
graph
.
getDefaultParent
(),
data
=
[];
if
(
root
.
getAttribute
(
'databases'
)
!=
null
)
data
=
JSON
.
parse
(
root
.
getAttribute
(
'databases'
));
...
...
@@ -220,38 +273,25 @@ export default {
},
// 监听编号好后获取选择的数据库的树形里列表
watch
:
{
connectionName
:{
handler
(
newValue
,
oldValue
)
{
console
.
log
(
'obj changed'
);
if
(
newValue
){
this
.
$refs
.
establishDia
.
scanDialogOpen
();
this
.
chooseFlag
=
true
;
}
},
deep
:
true
},
'form.connection'
:
{
handler
:
function
()
{
this
.
form
.
schema
=
""
,
this
.
form
.
table
=
""
},
}
},
// 监听如果改变数据库链接把目标表和模式初始化为空,之前设置好字段为空,该字段不是对应数据库链接下面表对应的字段--start---
// watch: {
// 'form.connection': {
// handler: function() {
// this.form.schema="",
// this.form.table=""
// },
// connectionName:{
// handler (newValue, oldValue) {
// console.log('obj changed');
// if(newValue){
// this.$refs.establishDia.scanDialogOpen();
// this.chooseFlag=true;
// }
// },
// 监听如果改变数据库链接把目标表和模式初始化为空,之前设置好字段为空,该字段不是对应数据库链接下面表对应的字段--end---
// deep: true
// },
form
(
n
,
o
){
this
.
newform
=
JSON
.
parse
(
JSON
.
stringify
(
n
))
console
.
log
(
this
.
newform
,
'监听newForm深拷贝'
);
},
},
};
</
script
>
<
style
>
/* .type-checked {
background-color: #8888ff;
color: #fff;
} */
</
style
>
\ No newline at end of file
src/views/dialogs-components/global/establish/main.vue
View file @
96d15519
...
...
@@ -1068,6 +1068,48 @@ export default {
},
// 封装把数据库保存到画布
// saveDataBases(){
// // JSON对象转成formData对象
// var params = this.createModel;
// // 由于高级选项连接池集群页面没有画完,保存默认参数
// params.supportBooleanDataType = true;
// params.supportTimestampDataType = true;
// params.preserveReservedCaseCheck = true;
// params.extraOptions = [];
// params.usingConnectionPool = "N";
// params.initialPoolSize = "5";
// params.maximumPoolSize = "10";
// params.partitioned = "N";
// params.partitionInfo = [];
// var root = this.newGraph.getDefaultParent();
// var databases = root.getAttribute('databases');
// var jsonArray = JSON.parse(databases);
// if(jsonArray.length == 0) {
// jsonArray.push(params);
// } else {
// jsonArray.forEach((item,index)=>{
// if(item.name == params.name) {
// jsonArray.splice(index, 1, params);
// } else {
// if(index == jsonArray.length - 1)
// jsonArray.push(params);
// }
// })
// }
// this.newGraph.getModel().beginUpdate();
// try{
// var edit = new mxCellAttributeChange(root, 'databases', JSON.stringify(jsonArray));
// this.newGraph.getModel().execute(edit);
// }
// finally{
// this.newGraph.getModel().endUpdate();
// }
// }
},
};
</
script
>
...
...
src/views/output-dialog/Excel-output.vue
View file @
96d15519
...
...
@@ -378,6 +378,7 @@
<div
slot=
"header"
class=
"clearfix"
>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"fieldClick(true)"
>
新增字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"inputOutputFields"
>
获取字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFields"
>
删除全部
</el-button>
</div>
<table-list
ref=
"tableDia"
:tableHead=
"tableHead"
:tableData=
"tableData"
:field
.
sync=
"editDia"
:fieldClick=
"fieldClick"
></table-list>
...
...
@@ -810,6 +811,14 @@ export default ({
this
.
tableData
=
res
;
})
},
//删除全部
deleteFields
(){
this
.
tableData
=
[];
},
//删除全部
// deleteFieldsUpdate(){
// this.tableDataUpdate=[];
// }
}
})
...
...
src/views/output-dialog/delete.vue
View file @
96d15519
...
...
@@ -9,15 +9,16 @@
>
<!--
<div
id=
"ExcelInputDialog"
></div>
-->
<el-form
ref=
"stepName"
:model=
"stepName"
label-width=
"120px"
>
<!--
<el-form
ref=
"stepName"
:model=
"stepName"
label-width=
"120px"
>
-->
<el-form
ref=
"delForm"
:model=
"deleteForm"
label-width=
"200px"
>
<el-form-item
label=
"步骤名称:"
>
<el-input
v-model=
"
stepName.name
"
></el-input>
<el-input
v-model=
"
deleteForm.label
"
></el-input>
</el-form-item>
<
/el-form
>
<
!--
</el-form>
--
>
<
el-form
ref=
"delForm"
:model=
"deleteForm"
label-width=
"200px"
>
<
!--
<el-form
ref=
"delForm"
:model=
"deleteForm"
label-width=
"200px"
>
--
>
<div
style=
"border:1px solid #99BBE8;padding:15px 15px;margin-bottom:15px;"
>
<database-choose
ref=
"databaseChoose"
:form
.
sync=
"deleteForm"
:getXmlVal=
"getXmlVal"
:graph=
"newGraph"
></database-choose>
<database-choose
ref=
"databaseChoose"
:form
.
sync=
"deleteForm"
@
fatherFun=
"fatherFun"
:getXmlVal=
"getXmlVal"
:graph=
"newGraph"
></database-choose>
<el-form-item
label=
"提交记录数量:"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"23"
>
...
...
@@ -32,6 +33,8 @@
<div
slot=
"header"
class=
"clearfix"
>
<span>
查询值所需的关键字
</span>
<el-button
style=
"padding: 3px 0;margin-left:50px;"
type=
"text"
@
click=
"fieldClick(true)"
>
新增字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"inputOutputFields('get')"
>
获取字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFields"
>
删除全部
</el-button>
</div>
<!--
<el-table
style=
"width: 100%"
border
:data=
"tableData"
>
<template
v-for=
"(item,index) in tableHead"
>
...
...
@@ -125,6 +128,7 @@ inputOutputFields,//获取表输出
export
default
({
data
(){
return
{
deleteForm
:{},
//解决子组件改变父组件传递props属性报错
newGraph
:{},
fieldsList1
:[],
fieldsList2
:[],
...
...
@@ -136,15 +140,6 @@ export default ({
// deleteForm:{
// commit: "100",
// connection: "",
// schema: "test",
// table: "",
// searchFields: "[]",
// updateFields: "[]",
// },
// deleteForm:{
// commit: "100",
// connection: "",
// key:"[]",
// label:"删除",
// schema: "",
...
...
@@ -206,30 +201,28 @@ export default ({
}
},
watch
:{
// deleteForm:{
// // deep:true,
// // immediate:true,
// handler:function(n,o){
// watch:{
// deleteForm(n,o){
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.key);
// this.tableData=ny;
// }
// }
// }
deleteForm
(
n
,
o
){
console
.
log
(
"回显的表单数据==="
,
n
);
if
(
n
){
var
ny
=
JSON
.
parse
(
n
.
key
);
// },
watch
:{
// 解决子组件改变父组件传进来的变量的属性不报错start------
deleteFormSend
(
val
){
console
.
log
(
"回显的表单数据==="
,
val
);
this
.
deleteForm
=
val
;
if
(
this
.
deleteForm
.
key
){
var
ny
=
JSON
.
parse
(
this
.
deleteForm
.
key
);
this
.
tableData
=
ny
;
}
}
},
props
:[
"title"
,
"nodePath"
,
"deleteVisible"
,
"doubleClickCell"
,
"saveOutputDialog"
,
"deleteForm"
,
"getXmlVal"
],
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props
:[
"title"
,
"nodePath"
,
"deleteVisible"
,
"doubleClickCell"
,
"saveOutputDialog"
,
"deleteFormSend"
,
"getXmlVal"
],
// props:{
// title:{
// type:String,
...
...
@@ -248,7 +241,55 @@ export default ({
mounted
(){
},
// created(){
// // 深拷贝解决第一次不执行
// this.newform=JSON.parse(JSON.stringify(this.form));
// },
methods
:{
// 数据库重置
fatherFun
(
param
){
console
.
log
(
"触发了父组件的方法=----"
,
param
);
//数据库
if
(
param
.
connection
==
this
.
deleteFormSend
.
connection
){
console
.
log
(
2
)
this
.
deleteForm
=
this
.
deleteFormSend
if
(
param
.
table
==
this
.
deleteFormSend
.
table
){
console
.
log
(
4
)
this
.
tableData
=
JSON
.
parse
(
this
.
deleteFormSend
.
fields
)
}
else
{
console
.
log
(
6
)
this
.
tableData
=
[]
}
}
else
{
console
.
log
(
3
)
this
.
deleteForm
=
param
this
.
tableData
=
[]
console
.
log
(
5
)
}
// 判断返回来有没有改变连接和表有就重置数据库start-------
// if(param.changeConnection ==true || param.changeConnection==="true"){
// this.tableData=[];
// console.log('触发了父组件的方法改变连接=----',this.tableData)
// }else{
// if(param.changeSchema){
// }else{
// var ny=JSON.parse(param.key);
// this.tableData=ny;
// }
// if(param.changeTable ==true || param.changeConnection==="true"){
// this.tableData=[];
// console.log('触发了父组件的方法改变表=----',this.tableData)
// }else{
// var ny=JSON.parse(param.key);
// this.tableData=ny;
// }
// }
// 判断返回来有没有改变连接和表有就重置数据库end-------
},
clickFun
(
graph
){
console
.
log
(
graph
,
'双击获取值'
)
this
.
newGraph
=
graph
;
...
...
@@ -260,7 +301,7 @@ export default ({
this
.
$emit
(
"update:deleteVisible"
,
false
);
},
confirm
(){
this
.
deleteForm
.
label
=
this
.
doubleClickCell
.
title
;
//
this.deleteForm.label=this.doubleClickCell.title;
this
.
deleteForm
.
key
=
JSON
.
stringify
(
this
.
tableData
);
//字段复值
console
.
log
(
'弹窗数据:==='
,
this
.
deleteForm
);
this
.
saveOutputDialog
(
this
.
deleteForm
);
...
...
@@ -321,7 +362,7 @@ export default ({
})
},
//获取表输出
inputOutputFields
(){
inputOutputFields
(
par
){
if
(
this
.
doubleClickCell
){
// var title=this.doubleClickCell.title;
var
title
=
this
.
doubleClickCell
.
value
.
attributes
.
label
.
value
...
...
@@ -341,9 +382,27 @@ export default ({
pamer
.
append
(
"query"
,
''
);
inputOutputFields
(
pamer
).
then
(
res
=>
{
console
.
log
(
'字段'
,
res
);
if
(
par
==
"get"
){
var
newArray
=
[];
res
.
forEach
(
item
=>
{
var
newObj
=
{};
newObj
.
field
=
item
.
name
;
newObj
.
condition
=
"="
;
newObj
.
name
=
item
.
name
;
newObj
.
name2
=
""
;
newArray
.
push
(
newObj
);
});
this
.
tableData
=
newArray
;
}
else
{
this
.
fieldsList2
=
res
;
}
})
},
//删除全部
deleteFields
(){
this
.
tableData
=
[];
},
...
...
src/views/output-dialog/insertOrUpdate.vue
View file @
96d15519
...
...
@@ -18,7 +18,7 @@
<!--
<el-form
:model=
"insertOrUpdateForm"
label-width=
"200px"
>
-->
<el-tabs
v-model=
"activeName"
type=
"border-card"
>
<el-tab-pane
label=
"基本配置"
name=
"content"
>
<database-choose
ref=
"databaseChoose"
:form
.
sync=
"insertOrUpdateForm"
:getXmlVal=
"getXmlVal"
:graph=
"newGraph"
></database-choose>
<database-choose
ref=
"databaseChoose"
:form
.
sync=
"insertOrUpdateForm"
@
fatherFun=
"fatherFun"
:getXmlVal=
"getXmlVal"
:graph=
"newGraph"
></database-choose>
<el-form-item
label=
"提交记录数量:"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"23"
>
...
...
@@ -43,6 +43,8 @@
<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"
@
click=
"getFields(0)"
>
获取字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFields"
>
删除全部
</el-button>
</div>
<!--
<el-table
style=
"width: 100%"
border
:data=
"tableData"
>
<template
v-for=
"(item,index) in tableHead"
>
...
...
@@ -109,6 +111,7 @@
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"fieldClickUpdate"
>
新增字段
</el-button>
<!-- <el-button style="padding: 3px 0" type="text">删除字段</el-button> -->
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"getFields(1)"
>
获取和更新字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFieldsUpdate"
>
删除全部
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
>
编辑映射
</el-button>
</div>
...
...
@@ -187,6 +190,7 @@ import {
export
default
({
data
(){
return
{
insertOrUpdateForm
:
{},
//解决子组件改变父组件传递props属性报错
newGraph
:{},
fieldsList1
:[],
fieldsList2
:[],
...
...
@@ -293,11 +297,8 @@ export default ({
}
},
watch
:{
// insertOrUpdateForm:{
// // deep:true,
// // immediate:true,
// handler:function(n,o){
// watch:{
// insertOrUpdateForm(n, o) {
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.searchFields);
...
...
@@ -305,21 +306,28 @@ export default ({
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// }
// }
insertOrUpdateForm
(
n
,
o
)
{
console
.
log
(
"回显的表单数据==="
,
n
);
if
(
n
){
var
ny
=
JSON
.
parse
(
n
.
searchFields
);
var
na
=
JSON
.
parse
(
n
.
updateFields
);
// },
// },
watch
:{
// 解决子组件改变父组件传进来的变量的属性不报错start------
insertOrUpdateFormSend
(
val
){
console
.
log
(
"回显的表单数据==="
,
val
);
this
.
insertOrUpdateForm
=
val
;
if
(
val
.
searchFields
){
var
ny
=
JSON
.
parse
(
val
.
searchFields
);
this
.
tableData
=
ny
;
}
if
(
val
.
updateFields
){
var
na
=
JSON
.
parse
(
val
.
updateFields
);
this
.
tableDataUpdate
=
na
;
}
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props
:[
"insertOrUpdateForm"
,
"InsertOrUpdateVisible"
,
"doubleClickCell"
,
"getXmlVal"
,
"saveOutputDialog"
],
props
:[
"insertOrUpdateForm
Send
"
,
"InsertOrUpdateVisible"
,
"doubleClickCell"
,
"getXmlVal"
,
"saveOutputDialog"
],
// props:{
// InsertOrUpdateVisible:{
...
...
@@ -331,6 +339,59 @@ export default ({
},
methods
:{
// 数据库重置
fatherFun
(
param
){
console
.
log
(
"触发了父组件的方法=----"
,
param
);
//数据库
if
(
param
.
connection
==
this
.
insertOrUpdateFormSend
.
connection
){
console
.
log
(
2
)
this
.
insertOrUpdateForm
=
this
.
insertOrUpdateFormSend
if
(
param
.
table
==
this
.
insertOrUpdateFormSend
.
table
){
console
.
log
(
4
)
this
.
tableData
=
JSON
.
parse
(
this
.
insertOrUpdateFormSend
.
searchFields
);
this
.
tableDataUpdate
=
JSON
.
parse
(
this
.
insertOrUpdateFormSend
.
updateFields
);
}
else
{
console
.
log
(
6
)
this
.
tableData
=
[];
this
.
tableDataUpdate
=
[];
}
}
else
{
console
.
log
(
3
)
this
.
insertOrUpdateForm
=
param
this
.
tableData
=
[];
this
.
tableDataUpdate
=
[];
console
.
log
(
5
)
}
// 判断返回来有没有改变连接和表有就重置数据库start-------
// if(param.changeConnection ==true || param.changeConnection==="true"){
// this.tableData=[];
// this.tableDataUpdate=[];
// }else{
// if(param.changeSchema){
// }else{
// // var ny=JSON.parse(param.key);
// // this.tableData=ny;
// }
// if(param.changeTable ==true || param.changeConnection==="true"){
// console.log("进入回显的999999=====");
// this.tableData=[];
// this.tableDataUpdate=[];
// // console.log('触发了父组件的方法改变表=----',this.tableData);
// }else{
// console.log("进入回显的999999=====");
// var ny=JSON.parse(param.searchFields);
// var na=JSON.parse(param.updateFields);
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// }
// 判断返回来有没有改变连接和表有就重置数据库end-------
},
clickFun
(
graph
){
console
.
log
(
graph
,
'双击获取值'
)
this
.
newGraph
=
graph
;
...
...
@@ -507,6 +568,14 @@ export default ({
this
.
fieldsList2
=
res
;
})
},
//删除字段
deleteFields
(){
this
.
tableData
=
[];
},
//删除字段
deleteFieldsUpdate
(){
this
.
tableDataUpdate
=
[];
}
...
...
src/views/output-dialog/micro-excel.vue
View file @
96d15519
...
...
@@ -298,6 +298,8 @@
<div
slot=
"header"
class=
"clearfix"
>
<span>
字段
</span>
<el-button
style=
"padding: 3px 0;margin-left:50px;"
type=
"text"
@
click=
"fieldClick(true)"
>
新增字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"inputOutputFields('get')"
>
获取字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFields"
>
删除全部
</el-button>
</div>
<table-list
ref=
"tableDia"
:tableHead=
"tableHead"
:tableData=
"tableData"
:field
.
sync=
"editDia"
:fieldClick=
"fieldClick"
></table-list>
<!-- 编辑弹窗开始=========== -->
...
...
@@ -490,45 +492,45 @@ export default ({
],
// 表格数据
tableData
:
[
{
name
:
'3'
,
type
:
'鞠婧祎'
,
format
:
'女'
,
styleCell
:
'1'
,
title
:
'2'
,
titleStyleCell
:
'2'
,
formula
:
'2'
,
hyperlinkField
:
'4'
,
commentField
:
'2'
,
commentAuthorField
:
'4'
//
{
//
name: '3',
//
type: '鞠婧祎',
//
format: '女',
//
styleCell:'1',
//
title:'2',
//
titleStyleCell:'2',
//
formula:'2',
//
hyperlinkField:'4',
//
commentField:'2',
//
commentAuthorField:'4'
},
{
name
:
'3'
,
type
:
'鞠婧祎'
,
format
:
'女'
,
styleCell
:
'1'
,
title
:
'2'
,
titleStyleCell
:
'2'
,
formula
:
'2'
,
hyperlinkField
:
'4'
,
commentField
:
'2'
,
commentAuthorField
:
'4'
//
},
//
{
//
name: '3',
//
type: '鞠婧祎',
//
format: '女',
//
styleCell:'1',
//
title:'2',
//
titleStyleCell:'2',
//
formula:'2',
//
hyperlinkField:'4',
//
commentField:'2',
//
commentAuthorField:'4'
},
{
name
:
'3'
,
type
:
'鞠婧祎'
,
format
:
'女'
,
styleCell
:
'1'
,
title
:
'2'
,
titleStyleCell
:
'2'
,
formula
:
'2'
,
hyperlinkField
:
'4'
,
commentField
:
'2'
,
commentAuthorField
:
'4'
//
},
//
{
//
name: '3',
//
type: '鞠婧祎',
//
format: '女',
//
styleCell:'1',
//
title:'2',
//
titleStyleCell:'2',
//
formula:'2',
//
hyperlinkField:'4',
//
commentField:'2',
//
commentAuthorField:'4'
}
//
}
],
}
...
...
@@ -652,20 +654,49 @@ export default ({
this
.
fileDialogVisible
=
true
;
},
//超链接
inputOutputFields
(){
inputOutputFields
(
par
){
if
(
this
.
doubleClickCell
){
// var title=this.doubleClickCell.title
var
title
=
this
.
doubleClickCell
.
value
.
attributes
.
label
.
value
}
// 画布xml转码
const
codec
=
new
mxCodec
();
const
encodedModel
=
codec
.
encode
(
this
.
newGraph
.
getModel
());
//xml对象
console
.
log
(
"获取字段的画布详情:"
,
encodedModel
);
// var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var
myXmlVal
=
mxUtils
.
getPrettyXml
(
encodedModel
);
//xml字符串
console
.
log
(
'获取cell888888==='
,
this
.
doubleClickCell
);
let
pamer
=
new
FormData
();
// 创建form对象
pamer
.
append
(
"stepName"
,
encodeURIComponent
(
title
));
pamer
.
append
(
"graphXml"
,
this
.
get
XmlVal
);
pamer
.
append
(
"graphXml"
,
my
XmlVal
);
pamer
.
append
(
"before"
,
true
);
pamer
.
append
(
"query"
,
''
);
inputOutputFields
(
pamer
).
then
(
res
=>
{
console
.
log
(
'字段'
,
res
);
if
(
par
==
"get"
){
var
newArray
=
[];
res
.
forEach
(
item
=>
{
var
newObj
=
{};
newObj
.
name
=
item
.
name
;
newObj
.
type
=
item
.
type
;
newObj
.
format
=
""
;
newObj
.
styleCell
=
""
;
newObj
.
title
=
item
.
name
;
newObj
.
titleStyleCell
=
""
;
newObj
.
formula
=
""
;
newObj
.
hyperlinkField
=
""
;
newObj
.
commentField
=
""
;
newObj
.
commentAuthorField
=
""
;
newArray
.
push
(
newObj
);
});
this
.
tableData
=
newArray
;
}
else
{
this
.
hyperlinkList
=
res
;
}
})
},
// 获取字段类型
...
...
@@ -694,6 +725,10 @@ export default ({
}
})
},
//删除全部
deleteFields
(){
this
.
tableData
=
[];
},
...
...
src/views/output-dialog/sqlFileOutput.vue
View file @
96d15519
...
...
@@ -20,7 +20,7 @@
<el-tab-pane
label=
"一般"
name=
"content"
>
<div
style=
"position:relative;border:1px solid #b5b8c8;padding:15px 0;"
>
<div
style=
"position:absolute;top:-15px;left:20px;color:#15428b;background-color:#fff;padding:5px 10px;"
>
连接
</div>
<database-choose
ref=
"databaseChoose"
:form
.
sync=
"sqlForm"
:graph=
"newGraph"
></database-choose>
<database-choose
ref=
"databaseChoose"
@
fatherFun=
"fatherFun"
:form
.
sync=
"sqlForm"
:graph=
"newGraph"
></database-choose>
</div>
<div
style=
"position:relative;border:1px solid #b5b8c8;padding:15px 0;margin-top:15px;"
>
...
...
@@ -190,6 +190,7 @@ import {
export
default
({
data
(){
return
{
sqlForm
:
this
.
sqlFormSend
,
newGraph
:{},
formName
:
''
,
fileDialogVisible
:
false
,
//选择文件夹弹窗
...
...
@@ -287,8 +288,16 @@ export default ({
}
},
watch
:{
// 解决子组件改变父组件传进来的变量的属性不报错start------
sqlFormSend
(
val
){
console
.
log
(
"回显的表单数据==="
,
val
);
this
.
sqlForm
=
val
;
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props
:[
"sqlForm"
,
"title"
,
"sqlVisible"
,
"saveOutputDialog"
,
"doubleClickCell"
],
props
:[
"sqlForm
Send
"
,
"title"
,
"sqlVisible"
,
"saveOutputDialog"
,
"doubleClickCell"
],
// props:{
// title:{
...
...
@@ -306,10 +315,36 @@ export default ({
this
.
getAvailableCharsets
();
//获取编码
},
methods
:{
// 数据库重置
fatherFun
(
param
){
console
.
log
(
"触发了父组件的方法=----"
,
param
);
//数据库
if
(
param
.
connection
==
this
.
sqlFormSend
.
connection
){
console
.
log
(
2
)
this
.
sqlForm
=
this
.
sqlFormSend
if
(
param
.
table
==
this
.
sqlFormSend
.
table
){
console
.
log
(
4
)
this
.
tableData
=
JSON
.
parse
(
this
.
sqlFormSend
.
fields
)
}
else
{
console
.
log
(
6
)
// this.tableData = []
}
}
else
{
console
.
log
(
3
)
this
.
sqlForm
=
param
// this.tableData = []
}
console
.
log
(
5
)
},
clickFun
(
graph
){
console
.
log
(
graph
,
'双击获取值'
)
this
.
newGraph
=
graph
;
setTimeout
(()
=>
{
this
.
$refs
.
databaseChoose
.
clickFun
(
this
.
newGraph
);
},
500
);
},
handleClose
(){
this
.
$emit
(
"update:sqlVisible"
,
false
);
...
...
src/views/output-dialog/synchronize.vue
View file @
96d15519
...
...
@@ -13,7 +13,7 @@
</el-form-item>
<el-tabs
v-model=
"activeName"
type=
"border-card"
>
<el-tab-pane
label=
"一般"
name=
"content"
>
<database-choose
ref=
"databaseChoose"
:form
.
sync=
"synForm"
:graph=
"newGraph"
></database-choose>
<database-choose
ref=
"databaseChoose"
:form
.
sync=
"synForm"
@
fatherFun=
"fatherFun"
:graph=
"newGraph"
></database-choose>
<el-form-item
label=
"提交的记录数量:"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"23"
>
...
...
@@ -49,6 +49,8 @@
<div
slot=
"header"
class=
"clearfix"
>
<span>
用来查询的关键字
</span>
<el-button
style=
"padding: 3px 0;margin-left:50px;"
type=
"text"
@
click=
"fieldClick(true)"
>
新增字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFields"
>
删除全部
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"inputOutputFields('get')"
>
获取字段
</el-button>
</div>
<table-list
ref=
"tableDia"
:tableHead=
"tableHead"
:tableData=
"tableData"
:field
.
sync=
"editDia"
:fieldClick=
"fieldClick"
></table-list>
...
...
@@ -113,6 +115,8 @@
<div
slot=
"header"
class=
"clearfix"
>
<span>
更新字段
</span>
<el-button
style=
"padding: 3px 0;margin-left:50px;"
type=
"text"
@
click=
"fieldClickUpdate"
>
新增字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFieldsUpdate"
>
删除全部
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"inputOutputFields('update')"
>
获取字段
</el-button>
</div>
<table-list
:tableHead=
"tableHeadUpdate"
:tableData=
"tableDataUpdate"
:field
.
sync=
"editDiaUpdate"
:fieldClick=
"fieldClickUpdate"
></table-list>
...
...
@@ -242,6 +246,7 @@ inputOutputFields,//获取表输出
export
default
({
data
(){
return
{
synForm
:{},
//解决子组件改变父组件传递props属性报错
newGraph
:{},
fieldsList1
:[],
fieldsList2
:[],
...
...
@@ -418,11 +423,8 @@ export default ({
}
},
watch
:{
// synForm:{
// // deep:true,
// // immediate:true,
// handler:function(n,o){
// watch:{
// synForm(n, o) {
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.searchFields);
...
...
@@ -430,23 +432,29 @@ export default ({
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// }
// }
synForm
(
n
,
o
)
{
console
.
log
(
"回显的表单数据==="
,
n
);
if
(
n
){
var
ny
=
JSON
.
parse
(
n
.
searchFields
);
var
na
=
JSON
.
parse
(
n
.
update
Fields
);
// },
// },
watch
:{
// 解决子组件改变父组件传进来的变量的属性不报错start------
synFormSend
(
val
)
{
console
.
log
(
"回显的表单数据==="
,
val
);
this
.
synForm
=
val
;
if
(
val
.
searchFields
){
var
ny
=
JSON
.
parse
(
val
.
search
Fields
);
this
.
tableData
=
ny
;
}
if
(
val
.
updateFields
){
var
na
=
JSON
.
parse
(
val
.
updateFields
);
this
.
tableDataUpdate
=
na
;
}
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props
:{
synForm
:
Object
,
synForm
Send
:
Object
,
title
:{
type
:
String
,
default
:
''
...
...
@@ -469,6 +477,60 @@ export default ({
},
methods
:{
// 数据库重置
fatherFun
(
param
){
console
.
log
(
"触发了父组件的方法=----"
,
param
);
console
.
log
(
"触发了父组件的方法=----"
,
param
);
//数据库
if
(
param
.
connection
==
this
.
synFormSend
.
connection
){
console
.
log
(
2
)
this
.
synForm
=
this
.
synFormSend
if
(
param
.
table
==
this
.
synFormSend
.
table
){
console
.
log
(
4
)
this
.
tableData
=
JSON
.
parse
(
this
.
synFormSend
.
searchFields
);
this
.
tableDataUpdate
=
JSON
.
parse
(
this
.
synFormSend
.
updateFields
);
}
else
{
console
.
log
(
6
)
this
.
tableData
=
[];
this
.
tableDataUpdate
=
[];
}
}
else
{
console
.
log
(
3
)
this
.
synForm
=
param
this
.
tableData
=
[];
this
.
tableDataUpdate
=
[];
console
.
log
(
5
)
}
// 判断返回来有没有改变连接和表有就重置数据库start-------
// if(param.changeConnection==true || param.changeConnection==="true"){
// this.tableData=[];
// this.tableDataUpdate=[];
// }else{
// if(param.changeSchema){
// }else{
// // var ny=JSON.parse(param.key);
// // this.tableData=ny;
// }
// if(param.changeTable==true || param.changeTable==="true"){
// console.log("进入回显的8888888=====");
// this.tableData=[];
// this.tableDataUpdate=[];
// // console.log('触发了父组件的方法改变表=----',this.tableData);
// }else{
// console.log("进入回显的999999=====");
// var ny=JSON.parse(param.searchFields);
// var na=JSON.parse(param.updateFields);
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// }
// 判断返回来有没有改变连接和表有就重置数据库end-------
},
clickFun
(
graph
){
console
.
log
(
graph
,
'双击获取值'
)
this
.
newGraph
=
graph
;
...
...
@@ -567,7 +629,7 @@ export default ({
})
},
//获取表输出
inputOutputFields
(){
inputOutputFields
(
par
){
if
(
this
.
doubleClickCell
){
// var title=this.doubleClickCell.title
var
title
=
this
.
doubleClickCell
.
value
.
attributes
.
label
.
value
;
...
...
@@ -589,9 +651,45 @@ export default ({
pamer
.
append
(
"query"
,
''
);
inputOutputFields
(
pamer
).
then
(
res
=>
{
console
.
log
(
'字段'
,
res
);
// 获取全部字段===
if
(
par
==
"get"
){
var
newArray
=
[];
res
.
forEach
(
item
=>
{
var
newObj
=
{};
newObj
.
field
=
item
.
name
;
newObj
.
condition
=
"="
;
newObj
.
name
=
item
.
name
;
newObj
.
name2
=
""
;
newArray
.
push
(
newObj
);
});
this
.
tableData
=
newArray
;
}
else
if
(
par
==
"update"
){
var
newArray
=
[];
res
.
forEach
(
item
=>
{
var
newObj
=
{};
newObj
.
name
=
item
.
name
;
newObj
.
rename
=
item
.
name
;
newObj
.
update
=
"Y"
;
newArray
.
push
(
newObj
);
});
this
.
tableDataUpdate
=
newArray
;
}
else
{
this
.
fieldsList2
=
res
;
}
// 获取全部字段===
// this.fieldsList2=res;
})
},
//删除字段
deleteFields
(){
this
.
tableData
=
[];
},
//删除字段
deleteFieldsUpdate
(){
this
.
tableDataUpdate
=
[];
}
}
...
...
src/views/output-dialog/table-out.vue
View file @
96d15519
...
...
@@ -16,7 +16,7 @@
<el-tabs
v-model=
"activeName"
type=
"border-card"
>
<el-tab-pane
label=
"基本配置"
name=
"content"
>
<database-choose
ref=
"databaseChoose"
:form
.
sync=
"tableOutForm"
:getXmlVal=
"getXmlVal"
:graph=
"newGraph"
></database-choose>
<database-choose
ref=
"databaseChoose"
@
fatherFun=
"fatherFun"
:form
.
sync=
"tableOutForm"
:getXmlVal=
"getXmlVal"
:graph=
"newGraph"
></database-choose>
<el-form-item
label=
"提交记录数量:"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"23"
>
...
...
@@ -205,7 +205,7 @@ import { mapGetters,mapMutations } from "vuex";
export
default
({
data
(){
return
{
newTableOutForm
:{}
,
tableOutForm
:
this
.
tableOutFormSend
,
field
:
false
,
//编辑弹窗
checkedCities
:
[
'上海'
,
'北京'
],
editDia
:
false
,
//编辑表字段
...
...
@@ -299,83 +299,107 @@ export default ({
}
},
props
:[
"tableOutForm"
,
"title"
,
"nodePath"
,
"tableOutPutVisible"
,
"explorer"
,
"graph"
,
"doubleClickCell"
,
"getXmlVal"
,
"saveOutputDialog"
],
props
:[
"tableOutForm
Send
"
,
"title"
,
"nodePath"
,
"tableOutPutVisible"
,
"explorer"
,
"graph"
,
"doubleClickCell"
,
"getXmlVal"
,
"saveOutputDialog"
],
mounted
(){
// this.tableOutForm=this.tableOutFormSend;
},
created
(){
// if(this.tableOutForm.connection!=''){
// this.tableData=JSON.parse(this.tableOutForm.fields);
// this.newTableOutForm=this.tableOutForm;
// }
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.fields);
// console.log("tableout回显数据===",this.tableOutForm);
// if(this.tableOutForm.fields){
// var ny=JSON.parse(this.tableOutForm.fields);
// this.tableData=ny;
// }
// },
// this.dialogOpen();
console
.
log
(
this
.
graph
,
'========='
);
},
watch
:{
// tableOutForm:{
// // deep:true,
// // immediate:true,
// handler:function(n,o){
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.fields);
// this.tableData=ny;
// }
// }
// },
tableOutForm
(
n
,
o
){
console
.
log
(
"回显的表单数据==="
,
n
);
if
(
n
){
var
ny
=
JSON
.
parse
(
n
.
fields
);
// 解决子组件改变父组件传进来的变量的属性不报错start------
tableOutFormSend
(
val
){
console
.
log
(
"回显的表单数据==="
,
val
);
this
.
tableOutForm
=
val
;
if
(
this
.
tableOutForm
.
fields
){
var
ny
=
JSON
.
parse
(
this
.
tableOutForm
.
fields
);
this
.
tableData
=
ny
;
}
},
//如果修改了数据库链接或者另选表字段为空需要重置start================
// 'tableOutForm.connection':{
// handler: function(a,b) {
// if(this.newTableOutForm){
// if(a!=this.newTableOutForm.conection){
// this.tableData=[];
// }
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
methods
:{
// 数据库重置
fatherFun
(
param
){
console
.
log
(
"触发了父组件的方法=----"
,
param
);
//数据库
if
(
param
.
connection
==
this
.
tableOutFormSend
.
connection
){
console
.
log
(
2
)
this
.
tableOutForm
=
this
.
tableOutFormSend
if
(
param
.
table
==
this
.
tableOutFormSend
.
table
){
console
.
log
(
4
)
this
.
tableData
=
JSON
.
parse
(
this
.
tableOutFormSend
.
fields
)
}
else
{
console
.
log
(
6
)
this
.
tableData
=
[]
}
}
else
{
console
.
log
(
3
)
this
.
tableOutForm
=
param
this
.
tableData
=
[]
// if(param.table == this.tableOutFormSend.table && param.connection == this.tableOutFormSend.connection){
// //数据库与表不变的情况
// console.log(3)
// this.tableOutForm = this.tableOutFormSend
// this.tableData = JSON.parse(this.tableOutFormSend.fields)
// }else{
// console.log(4)
// this.tableOutForm = param
// this.tableData = []
// }
}
//表change
console
.
log
(
5
)
return
// },
// },
// 'tableOutForm.table': {
// handler: function(a,b) {
// if(this.newTableOutForm){
// if(a!=this.newTableOutForm.table){
// this.tableData=[];
// }
// }
// },
// },
//如果修改了数据库链接或者另选表字段为空需要重置end================
// graph(n,o){
// console.log("表输出拿到的画布1111===",n);
// }
console
.
log
(
"触发了父组件的方法=----"
,
param
);
// 判断返回来有没有改变连接和表有就重置数据库start-------
if
(
param
.
changeConnection
==
true
||
param
.
changeConnection
===
"true"
){
this
.
tableData
=
[];
}
else
{
if
(
param
.
changeSchema
){
}
else
{
var
ny
=
JSON
.
parse
(
param
.
fields
);
this
.
tableData
=
ny
;
}
if
(
param
.
changeTable
==
true
||
param
.
changeConnection
===
"true"
){
this
.
tableData
=
[];
console
.
log
(
'触发了父组件的方法改变表=----'
,
this
.
tableData
)
}
else
{
var
ny
=
JSON
.
parse
(
param
.
fields
);
this
.
tableData
=
ny
;
}
}
console
.
log
(
'数据源'
,
this
.
tableOutFormSend
)
console
.
log
(
'自组件数据'
,
param
);
if
(
this
.
tableOutFormSend
.
connection
==
param
.
connection
){
this
.
tableOutForm
=
this
.
tableOutFormSend
}
else
{
this
.
tableOutForm
=
param
}
// 判断返回来有没有改变连接和表有就重置数据库end-------
},
methods
:{
clickFun
(
graph
){
console
.
log
(
graph
,
1
)
this
.
newGraph
=
graph
...
...
src/views/output-dialog/text-file-output.vue
View file @
96d15519
...
...
@@ -270,6 +270,8 @@
<el-card
class=
"box-card"
style=
"margin-top:15px;"
>
<div
slot=
"header"
class=
"clearfix"
>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"fieldClick(true)"
>
新增字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFields"
>
删除字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"inputOutputFields('get')"
>
获取字段
</el-button>
</div>
<table-list
ref=
"tableDia"
:tableHead=
"tableHead"
:tableData=
"tableData"
:field
.
sync=
"editDia"
:fieldClick=
"fieldClick"
></table-list>
<!-- 编辑弹窗开始=========== -->
...
...
@@ -687,7 +689,7 @@ export default ({
}
},
//获取表输出
inputOutputFields
(){
inputOutputFields
(
par
){
if
(
this
.
doubleClickCell
){
// var title=this.doubleClickCell.title;
var
title
=
this
.
doubleClickCell
.
value
.
attributes
.
label
.
value
...
...
@@ -710,7 +712,22 @@ export default ({
pamer
.
append
(
"query"
,
''
);
inputOutputFields
(
pamer
).
then
(
res
=>
{
console
.
log
(
'字段'
,
res
);
// 获取全部字段===
if
(
par
==
"get"
){
var
newArray
=
[];
res
.
forEach
(
item
=>
{
var
newObj
=
{};
newObj
.
name
=
item
.
name
;
newObj
.
type
=
item
.
type
;
newArray
.
push
(
newObj
);
});
this
.
tableData
=
newArray
;
}
else
{
this
.
fieldsList2
=
res
;
}
// 获取全部字段===
// this.fieldsList2=res;
})
},
// 获取字段类型
...
...
@@ -746,6 +763,10 @@ export default ({
this
.
textFileForm
.
separator
=
tab
;
console
.
log
(
'分隔符============'
,
this
.
textFileForm
.
separator
);
},
//删除字段
deleteFields
(){
this
.
tableData
=
[];
}
...
...
src/views/output-dialog/update.vue
View file @
96d15519
...
...
@@ -16,7 +16,7 @@
<el-tabs
v-model=
"activeName"
type=
"border-card"
>
<el-tab-pane
label=
"基本配置"
name=
"content"
>
<database-choose
ref=
"databaseChoose"
:form
.
sync=
"updateForm"
:graph=
"newGraph"
></database-choose>
<database-choose
ref=
"databaseChoose"
@
fatherFun=
"fatherFun"
:form
.
sync=
"updateForm"
:graph=
"newGraph"
></database-choose>
<el-form-item
label=
"提交记录数量:"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"23"
>
...
...
@@ -60,7 +60,7 @@
<el-card
class=
"box-card"
style=
"margin-top:15px;"
>
<div
slot=
"header"
class=
"clearfix"
>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"fieldClick(true)"
>
新增字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFields"
>
删除
字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFields"
>
删除
全部
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"inputOutputFields('get')"
>
获取字段
</el-button>
</div>
...
...
@@ -114,7 +114,7 @@
<el-card
class=
"box-card"
style=
"margin-top:15px;"
>
<div
slot=
"header"
class=
"clearfix"
>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"fieldClickUpdate"
>
新增字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFieldsUpdate"
>
删除
字段
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"deleteFieldsUpdate"
>
删除
全部
</el-button>
<el-button
style=
"padding: 3px 0"
type=
"text"
@
click=
"inputOutputFields('update')"
>
获取字段
</el-button>
</div>
...
...
@@ -183,6 +183,7 @@ inputOutputFields,//获取表输出
export
default
({
data
(){
return
{
updateForm
:
this
.
updateFormSend
,
//解决子组件改变父组件传递props属性报错
newGraph
:{},
fieldsList1
:[],
fieldsList2
:[],
...
...
@@ -288,11 +289,8 @@ export default ({
}
},
watch
:{
// synForm:{
// deep:true,
// immediate:true,
// handler:function(n,o){
// watch:{
// updateForm(n, o) {
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.searchFields);
...
...
@@ -300,21 +298,28 @@ export default ({
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// }
// }
updateForm
(
n
,
o
)
{
console
.
log
(
"回显的表单数据==="
,
n
);
if
(
n
){
var
ny
=
JSON
.
parse
(
n
.
searchFields
);
var
na
=
JSON
.
parse
(
n
.
updateFields
);
// },
// },
watch
:{
// 解决子组件改变父组件传进来的变量的属性不报错start------
updateFormSend
(
val
){
console
.
log
(
"回显的表单数据==="
,
val
);
this
.
updateForm
=
val
;
if
(
val
.
searchFields
){
var
ny
=
JSON
.
parse
(
val
.
searchFields
);
this
.
tableData
=
ny
;
}
if
(
val
.
updateFields
){
var
na
=
JSON
.
parse
(
val
.
updateFields
);
this
.
tableDataUpdate
=
na
;
}
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props
:{
updateForm
:
Object
,
updateForm
Send
:
Object
,
title
:{
type
:
String
,
default
:
''
...
...
@@ -337,6 +342,30 @@ export default ({
},
methods
:{
// 数据库重置
fatherFun
(
param
){
console
.
log
(
"触发了父组件的方法=----"
,
param
);
//数据库
if
(
param
.
connection
==
this
.
updateFormSend
.
connection
){
console
.
log
(
2
)
this
.
updateForm
=
this
.
updateFormSend
if
(
param
.
table
==
this
.
updateFormSend
.
table
){
console
.
log
(
4
)
this
.
tableData
=
JSON
.
parse
(
this
.
updateFormSend
.
searchFields
);
this
.
tableDataUpdate
=
JSON
.
parse
(
this
.
updateFormSend
.
updateFields
);
}
else
{
console
.
log
(
6
)
this
.
tableData
=
[];
this
.
tableDataUpdate
=
[];
}
}
else
{
console
.
log
(
3
)
this
.
updateForm
=
param
this
.
tableData
=
[];
this
.
tableDataUpdate
=
[];
console
.
log
(
5
)
}
},
clickFun
(
graph
){
console
.
log
(
graph
,
'双击获取值'
)
this
.
newGraph
=
graph
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment