Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
emport-web
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘泽志
emport-web
Commits
f9542c93
Commit
f9542c93
authored
Mar 05, 2023
by
刘泽志
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常字段检测
parent
222ed32b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
29 deletions
+112
-29
DataField.js
src/api/emport/DataField.js
+13
-0
StringUtil.js
src/utils/document/StringUtil.js
+12
-0
index.vue
src/views/emport/emport/index.vue
+63
-23
index.vue
src/views/emport/field/index.vue
+24
-6
No files found.
src/api/emport/DataField.js
View file @
f9542c93
...
@@ -16,6 +16,19 @@ export function queryField(params) {
...
@@ -16,6 +16,19 @@ export function queryField(params) {
}
}
/**
/**
* 查询匹配上个模板的字段字典
* @param params
* @returns {*}
*/
export
function
queryFieldDict
(
params
)
{
return
request
({
url
:
`
${
prefix
}
/dict`
,
method
:
'get'
,
params
})
}
/**
* 新增字段
* 新增字段
* @param data
* @param data
* @returns {*}
* @returns {*}
...
...
src/utils/document/StringUtil.js
View file @
f9542c93
...
@@ -32,6 +32,18 @@ export default class StringUtil {
...
@@ -32,6 +32,18 @@ export default class StringUtil {
}).
join
(
" - "
)
}).
join
(
" - "
)
}
}
/**
* 多字符串合并展示
* @param connector
* @param str
* @returns {string}
*/
static
merge
(
connector
,...
str
){
return
str
.
filter
(
item
=>
{
return
!
this
.
isEmpty
(
item
)
}).
join
(
connector
)
}
static
mergeRule
(
code
,
title
){
static
mergeRule
(
code
,
title
){
return
`
${
code
}
(
${
title
?
title
:
''
}
)`
return
`
${
code
}
(
${
title
?
title
:
''
}
)`
}
}
...
...
src/views/emport/emport/index.vue
View file @
f9542c93
...
@@ -62,12 +62,15 @@
...
@@ -62,12 +62,15 @@
>
>
<el-table-column
align=
"center"
type=
"index"
width=
"50"
/>
<el-table-column
align=
"center"
type=
"index"
width=
"50"
/>
<el-table-column
align=
"center"
label=
"机构类型"
prop=
"orgName"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"机构类型"
prop=
"orgName"
show-overflow-tooltip
/>
<el-table-column
:formatter=
"importStatusFormat"
align=
"center"
label=
"导入状态"
prop=
"importStatus"
<el-table-column
:formatter=
"yearFormat"
align=
"center"
label=
"数据年份"
prop=
"year"
show-overflow-tooltip
/>
<el-table-column
:formatter=
"templateStatusFormat"
align=
"center"
label=
"模板状态"
show-overflow-tooltip
/>
<el-table-column
:formatter=
"dataStatusFormat"
align=
"center"
label=
"数据状态"
prop=
"dataStatus"
show-overflow-tooltip
/>
<el-table-column
:formatter=
"importStatusFormat"
align=
"center"
label=
"正式库导入状态"
prop=
"importStatus"
show-overflow-tooltip
show-overflow-tooltip
/>
/>
<el-table-column
:formatter=
"yearFormat"
align=
"center"
label=
"数据年份"
prop=
"year"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"导入时间"
prop=
"importTime"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"导入时间"
prop=
"importTime"
show-overflow-tooltip
/>
<el-table-column
:formatter=
"templateStatusFormat"
align=
"center"
label=
"模板状态"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"操作"
width=
"190"
>
<el-table-column
align=
"center"
label=
"操作"
width=
"190"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-button
circle
icon=
"el-icon-edit"
plain
<el-button
circle
icon=
"el-icon-edit"
plain
...
@@ -229,7 +232,7 @@
...
@@ -229,7 +232,7 @@
<!-- 字段抽屉 -->
<!-- 字段抽屉 -->
<el-drawer
:visible
.
sync=
"fieldDrawer.show"
append-to-body
<el-drawer
:visible
.
sync=
"fieldDrawer.show"
append-to-body
destroy-on-close
direction=
"rtl"
destroy-on-close
direction=
"rtl"
size=
"
80
%"
title=
"字段信息"
size=
"
95
%"
title=
"字段信息"
>
>
<el-form
inline
label-width=
"110px"
size=
"small"
>
<el-form
inline
label-width=
"110px"
size=
"small"
>
<el-form-item
label=
"数据库字段名:"
>
<el-form-item
label=
"数据库字段名:"
>
...
@@ -270,12 +273,22 @@
...
@@ -270,12 +273,22 @@
>
>
<el-table-column
align=
"center"
label=
"代码"
prop=
"code"
show-overflow-tooltip
width=
"120"
/>
<el-table-column
align=
"center"
label=
"代码"
prop=
"code"
show-overflow-tooltip
width=
"120"
/>
<el-table-column
align=
"center"
label=
"指标名称"
min-width=
"200"
prop=
"title"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"指标名称"
min-width=
"200"
prop=
"title"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"数据坐标"
prop=
"coordinate"
show-overflow-tooltip
width=
"100"
/>
<el-table-column
align=
"center"
label=
"旧指标"
min-width=
"300"
>
<el-table-column
align=
"center"
label=
"数据库字段名"
min-width=
"150"
prop=
"fieldName"
<
template
slot-scope=
"scope"
>
<el-select
:value=
"scope.row.oldId"
clearable
filterable
style=
"width: 100%"
@
change=
"value=>changeFieldSelect(scope.row,value)"
>
<el-option
v-for=
"item in fieldDrawer.fieldDict"
:key=
"item.id"
:label=
"item.label"
:value=
"item.id"
/>
</el-select>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"字段名"
min-width=
"260"
prop=
"fieldName"
show-overflow-tooltip
show-overflow-tooltip
/>
/>
<el-table-column
align=
"center"
label=
"字段注释"
min-width=
"150"
prop=
"fieldComment"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"数据坐标"
prop=
"coordinate"
show-overflow-tooltip
width=
"100"
/>
<el-table-column
align=
"center"
label=
"计量单位"
prop=
"unit"
show-overflow-tooltip
width=
"90"
/>
<el-table-column
align=
"center"
label=
"计量单位"
prop=
"unit"
show-overflow-tooltip
width=
"90"
/>
<el-table-column
align=
"center"
label=
"操作"
width=
"150"
>
<el-table-column
align=
"center"
fixed=
"right"
label=
"操作"
width=
"150"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
plain
size=
"small"
@
click
.
stop=
"openRuleBindDialog(scope.row)"
>
规则
</el-button>
<el-button
plain
size=
"small"
@
click
.
stop=
"openRuleBindDialog(scope.row)"
>
规则
</el-button>
<el-button
circle
icon=
"el-icon-edit"
plain
<el-button
circle
icon=
"el-icon-edit"
plain
...
@@ -536,6 +549,11 @@ import ArraySelect from '@/views/emport/rule/ArraySelect.vue'
...
@@ -536,6 +549,11 @@ import ArraySelect from '@/views/emport/rule/ArraySelect.vue'
export
default
{
export
default
{
name
:
'Emport'
,
name
:
'Emport'
,
computed
:
{
StringUtil
()
{
return
StringUtil
}
},
components
:
{
ArraySelect
,
AutoLoading
,
AutoUpload
},
components
:
{
ArraySelect
,
AutoLoading
,
AutoUpload
},
data
()
{
data
()
{
return
{
return
{
...
@@ -592,7 +610,8 @@ export default {
...
@@ -592,7 +610,8 @@ export default {
pageSize
:
10
,
pageSize
:
10
,
total
:
0
total
:
0
},
},
queryFieldLoading
:
false
queryFieldLoading
:
false
,
fieldDict
:[],
// 匹配上个模板的字段字典
},
},
quicklyBindDialog
:
{
// 字段dialog
quicklyBindDialog
:
{
// 字段dialog
show
:
false
,
show
:
false
,
...
@@ -745,21 +764,17 @@ export default {
...
@@ -745,21 +764,17 @@ export default {
}
}
}).
finally
(
_
=>
this
.
queryTableLoading
=
false
)
}).
finally
(
_
=>
this
.
queryTableLoading
=
false
)
},
},
// 初始化
数据表
字段字典
// 初始化
匹配上个模板的
字段字典
initFieldDict
()
{
initFieldDict
()
{
if
(
this
.
fieldDrawer
.
template
&&
this
.
fieldDrawer
.
template
.
tableName
&&
this
.
fieldDrawer
.
template
.
dataSourceId
)
{
DataField
.
queryFieldDict
({
templateId
:
this
.
fieldDrawer
.
template
.
id
}).
then
(
res
=>
{
DataImport
.
queryDbField
(
this
.
fieldDrawer
.
template
.
dataSourceId
,
this
.
fieldDrawer
.
template
.
tableName
)
this
.
fieldDrawer
.
fieldDict
=
res
.
data
.
map
(
item
=>
{
.
then
(
res
=>
{
return
{
if
(
res
.
code
===
200
)
{
id
:
item
.
id
,
this
.
fieldDict
=
res
.
data
.
map
(
item
=>
{
label
:
StringUtil
.
merge
(
" "
,
item
.
code
,
item
.
title
),
return
{
field
:
item
.
field
value
:
item
.
VALUE
,
}
label
:
StringUtil
.
mergeStr
(
item
.
VALUE
,
item
.
LABEL
)
})
}
})
})
}
})
}
},
},
// 初始化模板列表
// 初始化模板列表
initTemplate
()
{
initTemplate
()
{
...
@@ -1035,6 +1050,24 @@ export default {
...
@@ -1035,6 +1050,24 @@ export default {
}
}
})
})
},
},
// 字段匹配选择
changeFieldSelect
(
row
,
id
){
this
.
fieldDrawer
.
queryFieldLoading
=
true
let
data
=
{
id
:
row
.
id
,
field
:
''
}
if
(
id
){
let
temp
=
this
.
fieldDrawer
.
fieldDict
.
find
(
item
=>
item
.
id
===
id
)
if
(
temp
){
data
.
field
=
temp
.
field
}
}
DataField
.
updateField
(
data
)
.
then
(
res
=>
{
this
.
queryFieldList
()
})
},
// 打开字段抽屉
// 打开字段抽屉
openFieldDrawer
(
row
)
{
openFieldDrawer
(
row
)
{
this
.
fieldDrawer
.
template
=
{
...
row
}
this
.
fieldDrawer
.
template
=
{
...
row
}
...
@@ -1050,8 +1083,8 @@ export default {
...
@@ -1050,8 +1083,8 @@ export default {
}
}
this
.
fieldDrawer
.
fieldList
=
[]
this
.
fieldDrawer
.
fieldList
=
[]
this
.
fieldDrawer
.
show
=
true
this
.
fieldDrawer
.
show
=
true
this
.
initFieldDict
()
this
.
queryFieldList
()
this
.
queryFieldList
()
//this.initFieldDict()
},
},
// 重置分页再查询字段列表
// 重置分页再查询字段列表
clearPageToSearch
()
{
clearPageToSearch
()
{
...
@@ -1154,6 +1187,13 @@ export default {
...
@@ -1154,6 +1187,13 @@ export default {
return
'未上传'
return
'未上传'
}
}
},
},
dataStatusFormat
(
row
){
if
(
row
.
dataStatus
){
return
'已上传'
}
else
{
return
'未上传'
}
},
// 打开上传初始模板
// 打开上传初始模板
openUploadTemplate
(
row
)
{
openUploadTemplate
(
row
)
{
this
.
initTemplateDialog
.
template
=
row
this
.
initTemplateDialog
.
template
=
row
...
...
src/views/emport/field/index.vue
View file @
f9542c93
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
size=
"small"
size=
"small"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
指标名称
"
>
<el-form-item
label=
"
字段注释
"
>
<el-input
v-model=
"queryParam.fieldComment"
class=
"mr input"
clearable
placeholder=
"输入名称搜索"
<el-input
v-model=
"queryParam.fieldComment"
class=
"mr input"
clearable
placeholder=
"输入名称搜索"
size=
"small"
size=
"small"
/>
/>
...
@@ -25,12 +25,15 @@
...
@@ -25,12 +25,15 @@
<el-button
class=
"mr"
size=
"mini"
type=
"success"
@
click=
"addMetaFieldDialog"
>
<el-button
class=
"mr"
size=
"mini"
type=
"success"
@
click=
"addMetaFieldDialog"
>
新增
新增
</el-button>
</el-button>
<el-button
class=
"mr"
size=
"mini"
type=
"success"
@
click=
"errFieldCheck"
>
异常字段检测
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-table
v-loading=
"queryLoading"
:data=
"metaFieldList"
border
max-height=
"500"
stripe
>
<el-table
v-loading=
"queryLoading"
:data=
"metaFieldList"
border
max-height=
"500"
stripe
>
<el-table-column
:show-overflow-tooltip=
"true"
align=
"center"
label=
"字段名"
prop=
"fieldName"
/>
<el-table-column
:show-overflow-tooltip=
"true"
align=
"center"
label=
"字段名"
prop=
"fieldName"
width=
"400"
/>
<el-table-column
:show-overflow-tooltip=
"true"
align=
"center"
label=
"字段类型"
prop=
"fieldType"
/>
<el-table-column
:show-overflow-tooltip=
"true"
align=
"center"
label=
"字段类型"
prop=
"fieldType"
/>
<el-table-column
:show-overflow-tooltip=
"true"
align=
"center"
label=
"
指标名称
"
prop=
"fieldComment"
/>
<el-table-column
:show-overflow-tooltip=
"true"
align=
"center"
label=
"
字段注释
"
prop=
"fieldComment"
/>
<el-table-column
:show-overflow-tooltip=
"true"
align=
"center"
label=
"备注"
prop=
"remarks"
/>
<el-table-column
:show-overflow-tooltip=
"true"
align=
"center"
label=
"备注"
prop=
"remarks"
/>
<el-table-column
align=
"center"
label=
"操作"
show-overflow-tooltip
width=
"150"
>
<el-table-column
align=
"center"
label=
"操作"
show-overflow-tooltip
width=
"150"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
...
@@ -52,7 +55,7 @@
...
@@ -52,7 +55,7 @@
>
>
<el-form
ref=
"metaFieldForm"
:model=
"metaFieldDialog.data"
label-width=
"80px"
>
<el-form
ref=
"metaFieldForm"
:model=
"metaFieldDialog.data"
label-width=
"80px"
>
<el-form-item
label=
"字段名"
prop=
"fieldName"
required
>
<el-form-item
label=
"字段名"
prop=
"fieldName"
required
>
<el-input
v-model=
"metaFieldDialog.data.fieldName"
size=
"small
"
/>
<el-input
v-model=
"metaFieldDialog.data.fieldName"
maxlength=
"30"
show-word-limit
size=
"small"
type=
"text
"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"字段类型"
prop=
"fieldType"
required
>
<el-form-item
label=
"字段类型"
prop=
"fieldType"
required
>
<el-input
v-model=
"metaFieldDialog.data.fieldType"
size=
"small"
placeholder=
"例如 VARCHAR2(64) ,NUMBER(8,1), DATE(7)等等"
/>
<el-input
v-model=
"metaFieldDialog.data.fieldType"
size=
"small"
placeholder=
"例如 VARCHAR2(64) ,NUMBER(8,1), DATE(7)等等"
/>
...
@@ -76,7 +79,6 @@
...
@@ -76,7 +79,6 @@
<
script
>
<
script
>
import
*
as
DataField
from
'@/api/emport/DataField'
import
*
as
DataField
from
'@/api/emport/DataField'
import
*
as
DataRule
from
'@/api/emport/DataRule'
export
default
{
export
default
{
name
:
'Field'
,
name
:
'Field'
,
...
@@ -119,6 +121,22 @@ export default {
...
@@ -119,6 +121,22 @@ export default {
this
.
queryParam
.
pageNum
=
1
this
.
queryParam
.
pageNum
=
1
this
.
queryMetaFieldList
()
this
.
queryMetaFieldList
()
},
},
// 异常字段检测
errFieldCheck
(){
this
.
queryParam
.
total
=
0
this
.
queryParam
.
pageNum
=
1
this
.
queryLoading
=
true
DataField
.
queryMetaField
({
total
:
0
,
pageNum
:
1
,
errorType
:
'length'
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
metaFieldList
=
res
.
rows
this
.
queryParam
.
total
=
res
.
total
}
}).
finally
(
_
=>
this
.
queryLoading
=
false
)
},
// 打开添加弹框
// 打开添加弹框
addMetaFieldDialog
()
{
addMetaFieldDialog
()
{
this
.
metaFieldDialog
.
title
=
'新增字段'
this
.
metaFieldDialog
.
title
=
'新增字段'
...
@@ -161,7 +179,7 @@ export default {
...
@@ -161,7 +179,7 @@ export default {
this
.
queryMetaFieldList
()
this
.
queryMetaFieldList
()
})
})
}
else
{
}
else
{
Data
Rule
.
updateRule
(
this
.
metaFieldDialog
.
data
).
then
(
res
=>
{
Data
Field
.
updateMetaField
(
this
.
metaFieldDialog
.
data
).
then
(
res
=>
{
this
.
metaFieldDialog
.
show
=
false
this
.
metaFieldDialog
.
show
=
false
this
.
queryMetaFieldList
()
this
.
queryMetaFieldList
()
})
})
...
...
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