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
62a5c396
Commit
62a5c396
authored
Sep 21, 2023
by
guoxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物理表异常字段查询和同步
parent
23bf0023
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
index.vue
src/views/emport/emport/index.vue
+24
-7
No files found.
src/views/emport/emport/index.vue
View file @
62a5c396
...
@@ -390,7 +390,7 @@
...
@@ -390,7 +390,7 @@
:data=
"templateErrorDialog.errorFieldList"
:data=
"templateErrorDialog.errorFieldList"
@
select=
"selectErrorField"
@
select=
"selectErrorField"
@
selection-change=
"handleErrorFieldSelectionChange"
@
selection-change=
"handleErrorFieldSelectionChange"
border
height=
"500px"
max-height=
"500px"
stripe
style=
"width: 100%"
border
height=
"500px"
max-height=
"500px"
width=
"800"
stripe
style=
"width: 100%"
>
>
<el-table-column
type=
"selection"
min-width=
"55"
:selectable=
"errorFieldSelectable"
/>
<el-table-column
type=
"selection"
min-width=
"55"
:selectable=
"errorFieldSelectable"
/>
<el-table-column
align=
"center"
label=
"字段标题"
prop=
"title"
show-overflow-tooltip
<el-table-column
align=
"center"
label=
"字段标题"
prop=
"title"
show-overflow-tooltip
...
@@ -408,6 +408,7 @@
...
@@ -408,6 +408,7 @@
<el-table-column
align=
"center"
label=
"物理表名"
prop=
"tableName"
show-overflow-tooltip
<el-table-column
align=
"center"
label=
"物理表名"
prop=
"tableName"
show-overflow-tooltip
min-width=
"120"
min-width=
"120"
/>
/>
<el-table-column
align=
"center"
label=
"提示"
prop=
"tip"
show-overflow-tooltip
min-width=
"230"
/>
</el-table>
</el-table>
</div>
</div>
</el-dialog>
</el-dialog>
...
@@ -1482,30 +1483,46 @@ export default {
...
@@ -1482,30 +1483,46 @@ export default {
//校验数据类型
//校验数据类型
let
fieldType
=
row
.
fieldType
.
substring
(
0
,
row
.
fieldType
.
indexOf
(
'('
))
let
fieldType
=
row
.
fieldType
.
substring
(
0
,
row
.
fieldType
.
indexOf
(
'('
))
let
columnType
=
row
.
columnType
.
substring
(
0
,
row
.
columnType
.
indexOf
(
'('
))
let
columnType
=
row
.
columnType
.
substring
(
0
,
row
.
columnType
.
indexOf
(
'('
))
if
(
fieldType
!==
columnType
)
this
.
$message
.
warning
(
'字段类型不相同,强行同步可能会造成数据丢失!'
)
//校验长度
//校验长度
if
(
row
.
fieldType
.
search
(
'NUMBER'
)
!==
-
1
)
{
if
(
row
.
fieldType
.
search
(
'NUMBER'
)
!==
-
1
&&
columnType
.
search
(
'VARCHAR'
)
!==
-
1
)
{
let
fieldPrecision
=
row
.
fieldType
.
substring
(
row
.
fieldType
.
indexOf
(
'('
)
+
1
,
row
.
fieldType
.
indexOf
(
','
))
let
fieldPrecision
=
row
.
fieldType
.
substring
(
row
.
fieldType
.
indexOf
(
'('
)
+
1
,
row
.
fieldType
.
indexOf
(
','
))
let
fieldScale
=
row
.
fieldType
.
substring
(
row
.
fieldType
.
indexOf
(
','
)
+
1
,
row
.
fieldType
.
indexOf
(
')'
))
let
fieldScale
=
row
.
fieldType
.
substring
(
row
.
fieldType
.
indexOf
(
','
)
+
1
,
row
.
fieldType
.
indexOf
(
')'
))
let
columnPrecision
=
row
.
columnType
.
substring
(
row
.
columnType
.
indexOf
(
'('
)
+
1
,
row
.
columnType
.
indexOf
(
','
))
let
columnPrecision
=
row
.
columnType
.
substring
(
row
.
columnType
.
indexOf
(
'('
)
+
1
,
row
.
columnType
.
indexOf
(
','
))
let
columnScale
=
row
.
columnType
.
substring
(
row
.
columnType
.
indexOf
(
','
)
+
1
,
row
.
columnType
.
indexOf
(
')'
))
let
columnScale
=
row
.
columnType
.
substring
(
row
.
columnType
.
indexOf
(
','
)
+
1
,
row
.
columnType
.
indexOf
(
')'
))
if
(
columnPrecision
<
fieldPrecision
)
this
.
$message
.
warning
(
'字段长度减小可能会造成数据丢失!'
)
if
(
Number
(
fieldPrecision
)
<
Number
(
columnPrecision
))
this
.
$message
.
warning
(
'字段长度减小可能会造成数据丢失!'
)
if
(
columnScale
<
fieldScale
)
this
.
$message
.
warning
(
'字段精度减小可能会造成数据丢失!'
)
if
(
Number
(
fieldScale
)
<
Number
(
columnScale
))
this
.
$message
.
warning
(
'字段精度减小可能会造成数据丢失!'
)
}
else
{
return
}
else
if
(
fieldType
.
search
(
'VARCHAR'
)
!==
-
1
&&
columnType
.
search
(
'VARCHAR'
)
!==
-
1
)
{
let
fieldLength
=
row
.
fieldType
.
substring
(
row
.
fieldType
.
indexOf
(
'('
)
+
1
,
row
.
fieldType
.
indexOf
(
')'
))
let
fieldLength
=
row
.
fieldType
.
substring
(
row
.
fieldType
.
indexOf
(
'('
)
+
1
,
row
.
fieldType
.
indexOf
(
')'
))
let
columnLength
=
row
.
columnType
.
substring
(
row
.
columnType
.
indexOf
(
'('
)
+
1
,
row
.
columnType
.
indexOf
(
')'
))
let
columnLength
=
row
.
columnType
.
substring
(
row
.
columnType
.
indexOf
(
'('
)
+
1
,
row
.
columnType
.
indexOf
(
')'
))
if
(
Number
(
'columnLength'
)
>
Number
(
'fieldLength'
))
this
.
$message
.
warning
(
'长度减小可能会造成数据丢失!'
)
if
(
Number
(
'fieldLength'
)
<
Number
(
'columnLength'
)
)
this
.
$message
.
warning
(
'长度减小可能会造成数据丢失!'
)
return
}
}
if
(
fieldType
!==
columnType
)
this
.
$message
.
warning
(
'字段类型不相同,强行同步可能会造成数据丢失!'
)
},
},
errorFieldSelectable
(
row
,
rowIndex
)
{
errorFieldSelectable
(
row
,
rowIndex
)
{
let
flag
=
false
let
flag
=
false
let
fieldType
=
row
.
fieldType
.
substring
(
0
,
row
.
fieldType
.
indexOf
(
'('
))
let
fieldType
=
row
.
fieldType
.
substring
(
0
,
row
.
fieldType
.
indexOf
(
'('
))
let
columnType
=
row
.
columnType
.
substring
(
0
,
row
.
columnType
.
indexOf
(
'('
))
let
columnType
=
row
.
columnType
.
substring
(
0
,
row
.
columnType
.
indexOf
(
'('
))
if
(
fieldType
!==
columnType
)
row
.
tip
=
'字段类型不相同,强行同步可能会造成数据丢失!'
if
(
fieldType
===
columnType
)
{
if
(
fieldType
===
columnType
)
{
flag
=
true
flag
=
true
}
else
if
(
fieldType
.
search
(
'VARCHAR'
)
!==
-
1
&&
columnType
.
search
(
'VARCHAR'
)
!==
-
1
)
{
}
else
if
(
fieldType
.
search
(
'VARCHAR'
)
!==
-
1
&&
columnType
.
search
(
'VARCHAR'
)
!==
-
1
)
{
row
.
tip
=
''
flag
=
true
flag
=
true
let
fieldLength
=
row
.
fieldType
.
substring
(
row
.
fieldType
.
indexOf
(
'('
)
+
1
,
row
.
fieldType
.
indexOf
(
')'
))
let
columnLength
=
row
.
columnType
.
substring
(
row
.
columnType
.
indexOf
(
'('
)
+
1
,
row
.
columnType
.
indexOf
(
')'
))
if
(
Number
(
'columnLength'
)
>
Number
(
'fieldLength'
))
row
.
tip
=
'长度减小可能会造成数据丢失!'
}
if
(
fieldType
.
search
(
'NUMBER'
)
!==
-
1
&&
columnType
.
search
(
'NUMBER'
)
!==
-
1
)
{
let
fieldPrecision
=
row
.
fieldType
.
substring
(
row
.
fieldType
.
indexOf
(
'('
)
+
1
,
row
.
fieldType
.
indexOf
(
','
))
let
fieldScale
=
row
.
fieldType
.
substring
(
row
.
fieldType
.
indexOf
(
','
)
+
1
,
row
.
fieldType
.
indexOf
(
')'
))
let
columnPrecision
=
row
.
columnType
.
substring
(
row
.
columnType
.
indexOf
(
'('
)
+
1
,
row
.
columnType
.
indexOf
(
','
))
let
columnScale
=
row
.
columnType
.
substring
(
row
.
columnType
.
indexOf
(
','
)
+
1
,
row
.
columnType
.
indexOf
(
')'
))
if
(
Number
(
fieldPrecision
)
<
Number
(
columnPrecision
))
row
.
tip
=
'字段长度减小可能会造成数据丢失!'
if
(
Number
(
fieldScale
)
<
Number
(
columnScale
))
row
.
tip
=
'字段精度减小可能会造成数据丢失!'
}
}
return
flag
return
flag
},
},
...
...
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