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
f0dcfd5d
Commit
f0dcfd5d
authored
Aug 20, 2021
by
李耀琨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数值范围
parent
09108f8e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
292 additions
and
9 deletions
+292
-9
src/views/dashboard-kettle/components/appBulletFrame/numericalRange.vue
+244
-0
src/views/dashboard-kettle/components/appBulletFrame/splitFields.vue
+26
-9
src/views/dashboard-kettle/components/designer/mxgraphDesigner.vue
+22
-0
No files found.
src/views/dashboard-kettle/components/appBulletFrame/numericalRange.vue
0 → 100644
View file @
f0dcfd5d
<
template
>
<div
class=
"getSystemInformation"
>
<el-dialog
title=
"数值范围"
:visible
.
sync=
"numericalRangeDialog"
width=
"800px"
:before-close=
"handleCloseFun"
>
<el-form
ref=
"form"
:model=
"form"
label-width=
"200px"
>
<el-form-item
label=
"步骤名称:"
>
<el-input
v-model=
"form.label"
></el-input>
</el-form-item>
<el-form-item
label=
"输入字段:"
>
<el-select
v-model=
"form.inputField"
style=
"width: 100%"
clearable
>
<el-option
v-for=
"item in fieName"
:key=
"item.index"
:label=
"item.name"
:value=
"item.name"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"输出字段::"
>
<el-input
v-model=
"form.outputField"
></el-input>
</el-form-item>
<el-form-item
label=
"缺省值(如果没有匹配到范围):"
>
<el-input
v-model=
"form.fallBackValue"
></el-input>
</el-form-item>
</el-form>
<el-form
ref=
"form"
:model=
"form"
label-width=
"0px"
>
{{
'范围(最小<= x<最大):'
}}
<br>
<el-button
type=
"text"
@
click=
"addSheet(true)"
style=
"margin: 10px"
>
添加
</el-button
>
<el-form-item>
<el-table
:data=
"rules"
style=
"width: 100%"
>
<el-table-column
prop=
"lower_bound"
label=
"下界"
>
</el-table-column>
<el-table-column
prop=
"upper_bound"
label=
"上界"
>
</el-table-column>
<el-table-column
prop=
"value"
label=
"值"
>
</el-table-column>
<el-table-column
label=
"操作"
>
<template
slot-scope=
"scope"
>
<el-button
@
click=
"addSheet(false, scope.row)"
type=
"text"
size=
"small"
>
编辑
</el-button
>
<el-button
type=
"text"
size=
"small"
@
click=
"deleteRow(scope.$index, rules)"
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleCloseFun"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"SystemInfoDialogFun"
>
确 定
</el-button>
</span>
</el-dialog>
<el-dialog
:title=
"dataStatus ? '新增' : '修改'"
:visible
.
sync=
"addField"
width=
"500px"
:before-close=
"handleClose"
:modal=
"false"
>
<el-form
ref=
"form"
:model=
"fiel"
label-width=
"160px"
>
<el-form-item
label=
"下界:"
>
<el-input
v-model=
"fiel.lower_bound"
></el-input>
</el-form-item>
<el-form-item
label=
"上界:"
>
<el-input
v-model=
"fiel.upper_bound"
></el-input>
</el-form-item>
<el-form-item
label=
"值"
>
<el-input
v-model=
"fiel.value"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"addField = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"addFieldDetermine"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
mxgraph
from
"@/utils/mxgraph"
;
const
{
mxGraph
,
mxUtils
,
mxEvent
,
mxKeyHandler
,
mxRubberband
,
mxConstants
,
mxStencilRegistry
,
mxStencil
,
mxCodec
,
mxGraphModel
,
mxGeometry
,
}
=
mxgraph
;
import
{
systemDataTypes
,
valueFormat
,
valueMeta
,
inputOutputFields
,
}
from
"@/api/kettle/link"
;
export
default
{
props
:
[
"form"
,
"numericalRangeDialog"
,
"saveOutputDialog"
,
"nodeData"
],
data
()
{
return
{
addField
:
false
,
rules
:
[],
type
:
{},
dataStatus
:
false
,
fiel
:
{},
fieldFormat
:
[],
fieldType
:
[],
fieName
:
[],
rue
:
[
{
name
:
"N"
,
state
:
false
},
{
name
:
"Y"
,
state
:
true
},
],
};
},
created
()
{
this
.
systemDataTypesFun
();
},
methods
:
{
inputFun
()
{
console
.
log
(
this
.
nodeData
);
var
enc
=
new
mxCodec
(
mxUtils
.
createXmlDocument
());
var
node
=
enc
.
encode
(
this
.
newGraph
.
getModel
());
this
.
graphXml
=
mxUtils
.
getPrettyXml
(
node
);
// console.log( this.graphXml,"看着了");
let
pamerFields
=
new
FormData
();
// 创建form对象
pamerFields
.
append
(
"stepName"
,
this
.
nodeData
.
value
.
attributes
.
label
.
value
);
pamerFields
.
append
(
"graphXml"
,
this
.
graphXml
);
pamerFields
.
append
(
"before"
,
true
);
pamerFields
.
append
(
"query"
,
""
);
inputOutputFields
(
pamerFields
).
then
((
res
)
=>
{
console
.
log
(
res
,
"yuiyuiyui"
);
this
.
fieName
=
res
;
});
},
clickFun
(
graph
,
val
)
{
console
.
log
(
graph
,
"双击获取值"
);
this
.
newGraph
=
graph
;
console
.
log
(
val
,
"拿到form"
);
this
.
rules
=
JSON
.
parse
(
val
.
rules
);
this
.
inputFun
();
},
handleCloseFun
()
{
this
.
$emit
(
"update:numericalRangeDialog"
,
false
);
},
SystemInfoDialogFun
()
{
this
.
handleCloseFun
();
this
.
form
.
rules
=
JSON
.
stringify
(
this
.
rules
);
this
.
saveOutputDialog
(
this
.
form
);
},
addFieldDetermine
()
{
this
.
addField
=
!
this
.
addField
;
if
(
this
.
dataStatus
)
{
this
.
rules
.
push
(
this
.
fiel
);
}
else
{
}
},
// 关闭弹框
handleClose
(
done
)
{
this
.
$confirm
(
"确认关闭?"
)
.
then
((
_
)
=>
{
done
();
})
.
catch
((
_
)
=>
{});
},
deleteRow
(
index
,
rows
)
{
rows
.
splice
(
index
,
1
);
},
addSheet
(
state
,
val
)
{
this
.
valueFormatFun
();
this
.
valueMetaFun
();
this
.
addField
=
!
this
.
addField
;
this
.
dataStatus
=
state
;
if
(
state
)
{
this
.
fiel
=
{};
}
else
{
this
.
fiel
=
val
;
}
},
systemDataTypesFun
()
{
systemDataTypes
().
then
((
res
)
=>
{
this
.
type
=
res
;
});
},
valueMetaFun
()
{
valueMeta
().
then
((
res
)
=>
{
this
.
fieldType
=
res
;
});
},
valueFormatFun
()
{
let
pamer2
=
new
FormData
();
// 创建form对象
pamer2
.
append
(
"valueType"
,
"all"
);
valueFormat
(
pamer2
).
then
((
res
)
=>
{
this
.
fieldFormat
=
res
;
});
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
*
{
outline
:
none
;
}
</
style
>
src/views/dashboard-kettle/components/appBulletFrame/splitFields.vue
View file @
f0dcfd5d
...
@@ -36,7 +36,11 @@
...
@@ -36,7 +36,11 @@
<el-table
:data=
"fields"
style=
"width: 100%"
>
<el-table
:data=
"fields"
style=
"width: 100%"
>
<el-table-column
prop=
"name"
label=
"新的字段"
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"新的字段"
>
</el-table-column>
<el-table-column
prop=
"id"
label=
"ID"
>
</el-table-column>
<el-table-column
prop=
"id"
label=
"ID"
>
</el-table-column>
<el-table-column
prop=
"idrem"
label=
"移除ID?"
>
</el-table-column>
<el-table-column
prop=
"idrem"
label=
"移除ID?"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
trimtype
==
true
?
"是"
:
"否"
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"type"
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=
"length"
label=
"长度"
>
</el-table-column>
<el-table-column
prop=
"precision"
label=
"精度"
>
</el-table-column>
<el-table-column
prop=
"precision"
label=
"精度"
>
</el-table-column>
...
@@ -49,8 +53,18 @@
...
@@ -49,8 +53,18 @@
<el-table-column
prop=
"nullif"
label=
"Nullif"
>
</el-table-column>
<el-table-column
prop=
"nullif"
label=
"Nullif"
>
</el-table-column>
<el-table-column
prop=
"ifnull"
label=
"缺省"
>
</el-table-column>
<el-table-column
prop=
"ifnull"
label=
"缺省"
>
</el-table-column>
<el-table-column
prop=
"trimtype"
label=
"去除空格类型"
>
<el-table-column
prop=
"trimtype"
label=
"去除空格类型"
>
<template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
trimtype
==
"none"
?
"不去掉空格"
:
scope
.
row
.
trimtype
==
"left"
?
"去掉左空格"
:
scope
.
row
.
trimtype
==
"right"
?
"去掉右空格"
:
scope
.
row
.
trimtype
==
"both"
?
"去掉左右两端空格"
:
""
}}
{{
scope
.
row
.
trimtype
==
0
?
"不去掉空格"
:
scope
.
row
.
trimtype
==
1
?
"去掉左空格"
:
scope
.
row
.
trimtype
==
2
?
"去掉右空格"
:
scope
.
row
.
trimtype
==
3
?
"去掉左右两端空格"
:
""
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -97,9 +111,8 @@
...
@@ -97,9 +111,8 @@
<el-form-item
label=
"移除ID?"
>
<el-form-item
label=
"移除ID?"
>
<el-select
v-model=
"fiel.idrem"
style=
"width: 100%"
>
<el-select
v-model=
"fiel.idrem"
style=
"width: 100%"
>
<el-option
label=
"N"
value=
"N"
></el-option>
<el-option
label=
"Y"
value=
"Y"
></el-option>
<el-option
label=
"Y"
value=
"Y"
></el-option>
<el-option
label=
"N"
value=
"N"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
@@ -147,10 +160,10 @@
...
@@ -147,10 +160,10 @@
<el-form-item
label=
"去除空格类型:"
>
<el-form-item
label=
"去除空格类型:"
>
<el-select
v-model=
"fiel.trimtype"
style=
"width: 100%"
>
<el-select
v-model=
"fiel.trimtype"
style=
"width: 100%"
>
<el-option
label=
"不去掉空格"
value=
"none
"
></el-option>
<el-option
label=
"不去掉空格"
:value=
"0
"
></el-option>
<el-option
label=
"去掉左空格"
value=
"left
"
></el-option>
<el-option
label=
"去掉左空格"
:value=
"1
"
></el-option>
<el-option
label=
"去掉右空格"
value=
"right
"
></el-option>
<el-option
label=
"去掉右空格"
:value=
"2
"
></el-option>
<el-option
label=
"去掉左右两端空格"
value=
"both
"
></el-option>
<el-option
label=
"去掉左右两端空格"
:value=
"3
"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -197,6 +210,10 @@ export default {
...
@@ -197,6 +210,10 @@ export default {
fieldFormat
:
[],
fieldFormat
:
[],
fieldType
:
[],
fieldType
:
[],
fieName
:
[],
fieName
:
[],
rue
:
[
{
name
:
"N"
,
state
:
false
},
{
name
:
"Y"
,
state
:
true
},
],
};
};
},
},
...
...
src/views/dashboard-kettle/components/designer/mxgraphDesigner.vue
View file @
f0dcfd5d
...
@@ -1020,6 +1020,16 @@
...
@@ -1020,6 +1020,16 @@
:saveOutputDialog=
"saveOutputDialog"
:saveOutputDialog=
"saveOutputDialog"
></splitFields>
></splitFields>
<!-- 数值范围 -->
<numericalRange
ref=
"numericalRange"
:form=
"form"
:nodeData=
"nodeData"
:numericalRangeDialog
.
sync=
"numericalRangeDialog"
:doubleClickCell=
"doubleClickCell"
:saveOutputDialog=
"saveOutputDialog"
></numericalRange>
<!-- 字符串操作 -->
<!-- 字符串操作 -->
<stringOperation
<stringOperation
ref=
"stringOperation"
ref=
"stringOperation"
...
@@ -1374,6 +1384,7 @@ import importXmlFile from "../appBulletFrame/importXmlFile"; //导出资源库
...
@@ -1374,6 +1384,7 @@ import importXmlFile from "../appBulletFrame/importXmlFile"; //导出资源库
import
grouping
from
"../appBulletFrame/grouping"
;
//分组
import
grouping
from
"../appBulletFrame/grouping"
;
//分组
import
addConstants
from
"../appBulletFrame/addConstants"
;
//增加常量
import
addConstants
from
"../appBulletFrame/addConstants"
;
//增加常量
import
splitFields
from
"../appBulletFrame/splitFields"
;
//拆分字符串
import
splitFields
from
"../appBulletFrame/splitFields"
;
//拆分字符串
import
numericalRange
from
"../appBulletFrame/numericalRange"
;
//数值范围
import
stringOperation
from
"../appBulletFrame/stringOperation"
//字符串操作
import
stringOperation
from
"../appBulletFrame/stringOperation"
//字符串操作
import
streamQuery
from
"../appBulletFrame/streamQuery"
;
//流查询
import
streamQuery
from
"../appBulletFrame/streamQuery"
;
//流查询
import
rowToColumn
from
"../appBulletFrame/rowToColumn"
;
//行转列
import
rowToColumn
from
"../appBulletFrame/rowToColumn"
;
//行转列
...
@@ -1516,6 +1527,7 @@ export default {
...
@@ -1516,6 +1527,7 @@ export default {
stringSubstitutionDialog
:
false
,
//字符串替换
stringSubstitutionDialog
:
false
,
//字符串替换
addConstantsDialog
:
false
,
//增加常量
addConstantsDialog
:
false
,
//增加常量
splitFieldsDialog
:
false
,
//拆分字符串
splitFieldsDialog
:
false
,
//拆分字符串
numericalRangeDialog
:
false
,
//数值范围
stringOperationDialog
:
false
,
//字符串操作
stringOperationDialog
:
false
,
//字符串操作
addSequenceDialog
:
false
,
//增加序列
addSequenceDialog
:
false
,
//增加序列
rowToColumnDialog
:
false
,
//行转列
rowToColumnDialog
:
false
,
//行转列
...
@@ -1638,6 +1650,7 @@ export default {
...
@@ -1638,6 +1650,7 @@ export default {
grouping
,
//分组
grouping
,
//分组
addConstants
,
//增加常量
addConstants
,
//增加常量
splitFields
,
//拆分字符串
splitFields
,
//拆分字符串
numericalRange
,
//数值范围
stringOperation
,
//字符串操作
stringOperation
,
//字符串操作
addSequence
,
//增加序列
addSequence
,
//增加序列
streamQuery
,
//流查询
streamQuery
,
//流查询
...
@@ -2334,6 +2347,15 @@ export default {
...
@@ -2334,6 +2347,15 @@ export default {
this
.
fieldFormat
=
res
;
this
.
fieldFormat
=
res
;
});
});
if
(
if
(
(
this
.
curFileType
==
"transformation"
&&
cell
.
dis
==
"step67"
)
||
cell
.
value
.
attributes
.
ctype
.
value
==
"NumberRange"
)
{
this
.
numericalRangeDialog
=
!
this
.
numericalRangeDialog
;
this
.
form
=
this
.
showDataFunc
();
setTimeout
(()
=>
{
this
.
$refs
.
numericalRange
.
clickFun
(
this
.
graph
,
this
.
form
);
},
500
);
}
else
if
(
(
this
.
curFileType
==
"transformation"
&&
cell
.
dis
==
"step65"
)
||
(
this
.
curFileType
==
"transformation"
&&
cell
.
dis
==
"step65"
)
||
cell
.
value
.
attributes
.
ctype
.
value
==
"FieldSplitter"
cell
.
value
.
attributes
.
ctype
.
value
==
"FieldSplitter"
)
{
)
{
...
...
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