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
e86af82e
Commit
e86af82e
authored
Sep 20, 2023
by
guoxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物理表异常字段查询和同步
parent
9b970461
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
211 additions
and
65 deletions
+211
-65
DataTemplate.js
src/api/emport/DataTemplate.js
+24
-0
index.vue
src/views/emport/emport/index.vue
+187
-65
No files found.
src/api/emport/DataTemplate.js
View file @
e86af82e
...
@@ -68,6 +68,30 @@ export function getAllTemplateField(templateId) {
...
@@ -68,6 +68,30 @@ export function getAllTemplateField(templateId) {
}
}
/**
/**
* 查询模板异常字段
* @param templateId
* @returns {*}
*/
export
function
getTemplateErrorField
(
templateId
)
{
return
request
({
url
:
`
${
prefix
}
/fieldError`
,
method
:
'get'
,
params
:
{
templateId
}
})
}
/**
* 同步异常字段
*/
export
function
syncTemplateErrorField
(
data
)
{
return
request
({
url
:
`
${
prefix
}
/syncFieldError`
,
method
:
'post'
,
data
})
}
/**
* 查询模板的所有规则数据
* 查询模板的所有规则数据
* @param templateId
* @param templateId
* @returns {*}
* @returns {*}
...
...
src/views/emport/emport/index.vue
View file @
e86af82e
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</el-select>
</el-select>
<i
class=
"el-icon-circle-plus-outline form_icon"
@
click=
"openYearDialog"
></i>
<i
class=
"el-icon-circle-plus-outline form_icon"
@
click=
"openYearDialog"
></i>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
数据
类型:"
label-width=
"80px"
>
<el-form-item
label=
"
机构
类型:"
label-width=
"80px"
>
<el-select
v-model=
"queryForm.orgName"
:popper-append-to-body=
"false"
>
<el-select
v-model=
"queryForm.orgName"
:popper-append-to-body=
"false"
>
<el-option
v-for=
"item in orgDict"
:key=
"item.id"
:label=
"item.label"
:value=
"item.value"
>
<el-option
v-for=
"item in orgDict"
:key=
"item.id"
:label=
"item.label"
:value=
"item.value"
>
<span
style=
"float: left"
>
{{
item
.
label
}}
</span>
<span
style=
"float: left"
>
{{
item
.
label
}}
</span>
...
@@ -93,6 +93,9 @@
...
@@ -93,6 +93,9 @@
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-view"
@
click
.
native=
"openFieldDrawer(scope.row)"
>
查看字段
<el-dropdown-item
icon=
"el-icon-view"
@
click
.
native=
"openFieldDrawer(scope.row)"
>
查看字段
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-view"
@
click
.
native=
"openTemplateErrorDialog(scope.row)"
>
异常字段查询
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-view"
@
click
.
native=
"openTemplateRuleDialog(scope.row)"
>
模板规则
<el-dropdown-item
icon=
"el-icon-view"
@
click
.
native=
"openTemplateRuleDialog(scope.row)"
>
模板规则
</el-dropdown-item>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
...
@@ -275,8 +278,12 @@
...
@@ -275,8 +278,12 @@
<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=
"旧指标"
min-width=
"300"
>
<el-table-column
align=
"center"
label=
"旧指标"
min-width=
"300"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-select
:value=
"scope.row.oldId"
clearable
filterable
style=
"width: 100%"
@
change=
"value=>changeFieldSelect(scope.row,value)"
>
<el-select
:value=
"scope.row.oldId"
clearable
filterable
style=
"width: 100%"
<el-option
v-for=
"item in fieldDrawer.fieldDict"
:key=
"item.id"
:label=
"item.label"
:value=
"item.id"
/>
@
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>
</el-select>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -364,6 +371,46 @@
...
@@ -364,6 +371,46 @@
:content=
"analyzeData.content"
:content=
"analyzeData.content"
:loading=
"analyzeData.loading"
:loading=
"analyzeData.loading"
/>
/>
<!-- 异常字段查询对话框 -->
<el-dialog
:visible
.
sync=
"templateErrorDialog.show"
append-to-body
close-on-click-modal
title=
"错误字段查询"
width=
"80%"
>
<div
style=
"width: 100%"
>
<el-form
size=
"small"
>
<el-form-item>
<el-button
icon=
"el-icon-plus"
type=
"success"
:disabled=
"templateErrorDialog.multiple"
v-on:click=
"handleErrorFieldSync"
>
同步
</el-button>
</el-form-item>
</el-form>
<el-table
ref=
"errorFieldTable"
v-loading=
"templateErrorDialog.loading"
:data=
"templateErrorDialog.errorFieldList"
@
select=
"selectErrorField"
@
selection-change=
"handleErrorFieldSelectionChange"
border
height=
"500px"
max-height=
"500px"
stripe
style=
"width: 100%"
>
<el-table-column
type=
"selection"
min-width=
"55"
:selectable=
"errorFieldSelectable"
/>
<el-table-column
align=
"center"
label=
"字段标题"
prop=
"title"
show-overflow-tooltip
min-width=
"120"
/>
<el-table-column
align=
"center"
label=
"元字段名"
prop=
"fieldName"
show-overflow-tooltip
min-width=
"120"
/>
<el-table-column
align=
"center"
label=
"元字段类型"
prop=
"fieldType"
show-overflow-tooltip
min-width=
"120"
/>
<el-table-column
align=
"center"
label=
"物理表字段类型"
prop=
"columnType"
show-overflow-tooltip
min-width=
"120"
/>
<el-table-column
align=
"center"
label=
"物理表名"
prop=
"tableName"
show-overflow-tooltip
min-width=
"120"
/>
</el-table>
</div>
</el-dialog>
<!-- 模板规则 -->
<!-- 模板规则 -->
<el-dialog
:visible
.
sync=
"templateRuleDialog.show"
append-to-body
close-on-click-modal
title=
"模板规则"
<el-dialog
:visible
.
sync=
"templateRuleDialog.show"
append-to-body
close-on-click-modal
title=
"模板规则"
width=
"80%"
width=
"80%"
...
@@ -431,8 +478,11 @@
...
@@ -431,8 +478,11 @@
>
>
<el-form
inline
size=
"small"
>
<el-form
inline
size=
"small"
>
<el-form-item>
<el-form-item>
<el-button
v-if=
"false"
icon=
"el-icon-plus"
type=
"success"
@
click=
"openAddOrgListDialog"
>
添加
</el-button>
<el-button
v-if=
"false"
icon=
"el-icon-plus"
type=
"success"
@
click=
"openAddOrgListDialog"
>
添加
<el-button
:loading=
"orgDictDialog.loading"
icon=
"el-icon-plus"
type=
"success"
@
click=
"exportExcel"
>
导出
</el-button>
</el-button>
<el-button
:loading=
"orgDictDialog.loading"
icon=
"el-icon-plus"
type=
"success"
@
click=
"exportExcel"
>
导出
</el-button>
</el-form-item>
</el-form-item>
<el-form-item
label=
"查询全部"
>
<el-form-item
label=
"查询全部"
>
<el-switch
<el-switch
...
@@ -440,7 +490,8 @@
...
@@ -440,7 +490,8 @@
active-color=
"#13ce66"
active-color=
"#13ce66"
active-value=
"1"
active-value=
"1"
inactive-value=
"0"
inactive-value=
"0"
@
change=
"typeChange"
>
@
change=
"typeChange"
>
</el-switch>
</el-switch>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -454,7 +505,9 @@
...
@@ -454,7 +505,9 @@
<el-table-column
align=
"center"
label=
"机构地址"
prop=
"MAILING_ADDRESS"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"机构地址"
prop=
"MAILING_ADDRESS"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"行政区划代码"
prop=
"AREA_NUMBER_CODE"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"行政区划代码"
prop=
"AREA_NUMBER_CODE"
show-overflow-tooltip
/>
<el-table-column
v-if=
"false"
align=
"center"
label=
"所属市"
prop=
"CITY"
show-overflow-tooltip
/>
<el-table-column
v-if=
"false"
align=
"center"
label=
"所属市"
prop=
"CITY"
show-overflow-tooltip
/>
<el-table-column
:formatter=
"AREAFormatter"
align=
"center"
label=
"对应区名称"
prop=
"AREA"
show-overflow-tooltip
/>
<el-table-column
:formatter=
"AREAFormatter"
align=
"center"
label=
"对应区名称"
prop=
"AREA"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"操作"
width=
"80"
>
<el-table-column
align=
"center"
label=
"操作"
width=
"80"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
circle
icon=
"el-icon-edit"
plain
<el-button
circle
icon=
"el-icon-edit"
plain
...
@@ -482,12 +535,13 @@
...
@@ -482,12 +535,13 @@
<el-input
v-model=
"orgListDialog.data.MAILING_ADDRESS"
autosize
size=
"small"
type=
"textarea"
/>
<el-input
v-model=
"orgListDialog.data.MAILING_ADDRESS"
autosize
size=
"small"
type=
"textarea"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"行政区划代码"
prop=
"AREA_NUMBER_CODE"
>
<el-form-item
label=
"行政区划代码"
prop=
"AREA_NUMBER_CODE"
>
<!-- <el-input v-model="orgListDialog.data.AREA_NUMBER_CODE" size="small"/>-->
<!-- <el-input v-model="orgListDialog.data.AREA_NUMBER_CODE" size="small"/>-->
<el-autocomplete
v-model=
"orgListDialog.data.AREA_NUMBER_CODE"
<el-autocomplete
v-model=
"orgListDialog.data.AREA_NUMBER_CODE"
:fetch-suggestions=
"areaSearch"
:fetch-suggestions=
"areaSearch"
size=
"small"
>
size=
"small"
>
<
template
slot-scope=
"{ item }"
>
<
template
slot-scope=
"{ item }"
>
{{
item
.
suggestion
}}
{{
item
.
suggestion
}}
</
template
>
</
template
>
</el-autocomplete>
</el-autocomplete>
</el-form-item>
</el-form-item>
...
@@ -514,7 +568,9 @@
...
@@ -514,7 +568,9 @@
>
>
<el-form
size=
"small"
>
<el-form
size=
"small"
>
<el-form-item>
<el-form-item>
<el-button
:loading=
"syncFieldDialog.loading"
icon=
"el-icon-plus"
type=
"success"
@
click=
"syncField"
>
同步新增数据库字段
</el-button>
<el-button
:loading=
"syncFieldDialog.loading"
icon=
"el-icon-plus"
type=
"success"
@
click=
"syncField"
>
同步新增数据库字段
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-table
v-loading=
"syncFieldDialog.loading"
:data=
"syncFieldDialog.list"
<el-table
v-loading=
"syncFieldDialog.loading"
:data=
"syncFieldDialog.list"
...
@@ -547,10 +603,12 @@
...
@@ -547,10 +603,12 @@
>
>
<el-table
<el-table
:data=
"errorDialog.data"
:data=
"errorDialog.data"
style=
"width: 100%"
>
style=
"width: 100%"
>
<el-table-column
<el-table-column
prop=
"error"
prop=
"error"
label=
"错误信息"
>
label=
"错误信息"
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-dialog>
</el-dialog>
...
@@ -568,6 +626,7 @@ import StringUtil from '@/utils/document/StringUtil'
...
@@ -568,6 +626,7 @@ import StringUtil from '@/utils/document/StringUtil'
import
AutoUpload
from
'@/views/emport/emport/AutoUpload.vue'
import
AutoUpload
from
'@/views/emport/emport/AutoUpload.vue'
import
AutoLoading
from
'@/views/emport/emport/AutoLoading.vue'
import
AutoLoading
from
'@/views/emport/emport/AutoLoading.vue'
import
ArraySelect
from
'@/views/emport/rule/ArraySelect.vue'
import
ArraySelect
from
'@/views/emport/rule/ArraySelect.vue'
import
{
syncTemplateErrorField
}
from
'@/api/emport/DataTemplate'
export
default
{
export
default
{
name
:
'Emport'
,
name
:
'Emport'
,
...
@@ -592,8 +651,8 @@ export default {
...
@@ -592,8 +651,8 @@ export default {
tableList
:
[],
// 表列表
tableList
:
[],
// 表列表
fieldDict
:
[],
// 字段字典
fieldDict
:
[],
// 字段字典
metaFieldDict
:
[],
//
metaFieldDict
:
[],
//
errorDialog
:
{
// 错误列表dialog
errorDialog
:
{
// 错误列表dialog
show
:
false
,
show
:
false
,
data
:
[]
data
:
[]
},
},
yearDialog
:
{
// 年份dialog
yearDialog
:
{
// 年份dialog
...
@@ -637,7 +696,7 @@ export default {
...
@@ -637,7 +696,7 @@ export default {
total
:
0
total
:
0
},
},
queryFieldLoading
:
false
,
queryFieldLoading
:
false
,
fieldDict
:
[],
// 匹配上个模板的字段字典
fieldDict
:
[]
// 匹配上个模板的字段字典
},
},
quicklyBindDialog
:
{
// 字段dialog
quicklyBindDialog
:
{
// 字段dialog
show
:
false
,
show
:
false
,
...
@@ -649,6 +708,14 @@ export default {
...
@@ -649,6 +708,14 @@ export default {
show
:
false
,
show
:
false
,
loading
:
false
loading
:
false
},
},
templateErrorDialog
:
{
// 错误字段查询dialog
template
:
null
,
errorFieldList
:
[],
selectErrorFieldList
:
[],
show
:
false
,
loading
:
false
,
multiple
:
true
},
templateRuleDialog
:
{
// 模板规则dialog
templateRuleDialog
:
{
// 模板规则dialog
template
:
null
,
template
:
null
,
ruleList
:
[],
ruleList
:
[],
...
@@ -682,15 +749,15 @@ export default {
...
@@ -682,15 +749,15 @@ export default {
list
:
[],
list
:
[],
type
:
''
type
:
''
},
},
syncFieldDialog
:{
// 字段同步
syncFieldDialog
:
{
// 字段同步
show
:
false
,
show
:
false
,
loading
:
false
,
loading
:
false
,
list
:
[],
list
:
[],
checked
:[]
checked
:
[]
},
},
sameFieldDialog
:{
// 相同字段列表
sameFieldDialog
:
{
// 相同字段列表
show
:
false
,
show
:
false
,
list
:[],
list
:
[]
},
},
importLoading
:
false
,
// 导入数据loading
importLoading
:
false
,
// 导入数据loading
queryTemplateLoading
:
false
,
// 模板查询loading
queryTemplateLoading
:
false
,
// 模板查询loading
...
@@ -793,11 +860,11 @@ export default {
...
@@ -793,11 +860,11 @@ export default {
},
},
// 初始化匹配上个模板的字段字典
// 初始化匹配上个模板的字段字典
initFieldDict
()
{
initFieldDict
()
{
DataField
.
queryFieldDict
({
templateId
:
this
.
fieldDrawer
.
template
.
id
}).
then
(
res
=>
{
DataField
.
queryFieldDict
({
templateId
:
this
.
fieldDrawer
.
template
.
id
}).
then
(
res
=>
{
this
.
fieldDrawer
.
fieldDict
=
res
.
data
.
map
(
item
=>
{
this
.
fieldDrawer
.
fieldDict
=
res
.
data
.
map
(
item
=>
{
return
{
return
{
id
:
item
.
id
,
id
:
item
.
id
,
label
:
StringUtil
.
merge
(
" "
,
item
.
code
,
item
.
title
),
label
:
StringUtil
.
merge
(
' '
,
item
.
code
,
item
.
title
),
field
:
item
.
field
field
:
item
.
field
}
}
})
})
...
@@ -966,16 +1033,16 @@ export default {
...
@@ -966,16 +1033,16 @@ export default {
ExcelData
.
uploadExcel
(
formData
)
ExcelData
.
uploadExcel
(
formData
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
if
(
res
.
data
&&
res
.
data
.
length
>
0
){
if
(
res
.
data
&&
res
.
data
.
length
>
0
)
{
onError
()
onError
()
// 弹出数据导入异常
// 弹出数据导入异常
this
.
errorDialog
=
{
this
.
errorDialog
=
{
show
:
true
,
show
:
true
,
data
:
res
.
data
.
map
(
item
=>
{
data
:
res
.
data
.
map
(
item
=>
{
return
{
error
:
item
}
return
{
error
:
item
}
})
})
}
}
}
else
{
}
else
{
onSuccess
()
onSuccess
()
}
}
}
else
{
}
else
{
...
@@ -990,9 +1057,9 @@ export default {
...
@@ -990,9 +1057,9 @@ export default {
triggerImport
()
{
triggerImport
()
{
if
(
this
.
queryForm
.
file
)
{
if
(
this
.
queryForm
.
file
)
{
let
template
=
this
.
templateList
.
find
(
item
=>
item
.
orgName
===
this
.
queryForm
.
orgName
)
let
template
=
this
.
templateList
.
find
(
item
=>
item
.
orgName
===
this
.
queryForm
.
orgName
)
if
(
template
){
if
(
template
)
{
this
.
$refs
.
upload
.
submit
()
this
.
$refs
.
upload
.
submit
()
}
else
{
}
else
{
this
.
$message
.
warning
(
'没有此类型的模板,请选择其它的数据类型'
)
this
.
$message
.
warning
(
'没有此类型的模板,请选择其它的数据类型'
)
}
}
...
@@ -1095,15 +1162,15 @@ export default {
...
@@ -1095,15 +1162,15 @@ export default {
})
})
},
},
// 字段匹配选择
// 字段匹配选择
changeFieldSelect
(
row
,
id
)
{
changeFieldSelect
(
row
,
id
)
{
this
.
fieldDrawer
.
queryFieldLoading
=
true
this
.
fieldDrawer
.
queryFieldLoading
=
true
let
data
=
{
let
data
=
{
id
:
row
.
id
,
id
:
row
.
id
,
field
:
''
field
:
''
}
}
if
(
id
){
if
(
id
)
{
let
temp
=
this
.
fieldDrawer
.
fieldDict
.
find
(
item
=>
item
.
id
===
id
)
let
temp
=
this
.
fieldDrawer
.
fieldDict
.
find
(
item
=>
item
.
id
===
id
)
if
(
temp
)
{
if
(
temp
)
{
data
.
field
=
temp
.
field
data
.
field
=
temp
.
field
}
}
}
}
...
@@ -1231,10 +1298,10 @@ export default {
...
@@ -1231,10 +1298,10 @@ export default {
return
'未上传'
return
'未上传'
}
}
},
},
dataStatusFormat
(
row
){
dataStatusFormat
(
row
)
{
if
(
row
.
dataStatus
){
if
(
row
.
dataStatus
)
{
return
'已上传'
return
'已上传'
}
else
{
}
else
{
return
'未上传'
return
'未上传'
}
}
},
},
...
@@ -1392,13 +1459,68 @@ export default {
...
@@ -1392,13 +1459,68 @@ export default {
}
}
}).
finally
(
_
=>
this
.
syncDbLoading
=
false
)
}).
finally
(
_
=>
this
.
syncDbLoading
=
false
)
},
},
getErrorFieldList
(
row
)
{
this
.
templateErrorDialog
.
loading
=
true
DataTemplate
.
getTemplateErrorField
(
row
.
id
).
then
(
res
=>
{
this
.
templateErrorDialog
.
errorFieldList
=
res
.
data
this
.
templateErrorDialog
.
loading
=
false
})
},
// 异常字段查询弹窗
openTemplateErrorDialog
(
row
)
{
this
.
templateErrorDialog
.
template
=
{
...
row
}
this
.
templateErrorDialog
.
show
=
true
this
.
getErrorFieldList
(
row
)
},
handleErrorFieldSelectionChange
(
selection
)
{
this
.
templateErrorDialog
.
selectErrorFieldList
=
selection
this
.
templateErrorDialog
.
multiple
=
!
selection
.
length
},
selectErrorField
(
selection
,
row
)
{
//校验数据类型
let
fieldType
=
row
.
fieldType
.
substring
(
0
,
row
.
fieldType
.
indexOf
(
'('
))
let
columnType
=
row
.
columnType
.
substring
(
0
,
row
.
columnType
.
indexOf
(
'('
))
if
(
fieldType
!==
columnType
)
this
.
$message
.
warning
(
'字段类型不相同,强行同步可能会造成数据丢失!'
)
//校验长度
if
(
row
.
fieldType
.
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
(
columnPrecision
<
fieldPrecision
)
this
.
$message
.
warning
(
'字段长度减小可能会造成数据丢失!'
)
if
(
columnScale
<
fieldScale
)
this
.
$message
.
warning
(
'字段精度减小可能会造成数据丢失!'
)
}
else
{
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'
))
this
.
$message
.
warning
(
'长度减小可能会造成数据丢失!'
)
}
},
errorFieldSelectable
(
row
,
rowIndex
)
{
let
flag
=
false
let
fieldType
=
row
.
fieldType
.
substring
(
0
,
row
.
fieldType
.
indexOf
(
'('
))
let
columnType
=
row
.
columnType
.
substring
(
0
,
row
.
columnType
.
indexOf
(
'('
))
if
(
fieldType
===
columnType
)
{
flag
=
true
}
else
if
(
fieldType
.
search
(
'VARCHAR'
)
!==
-
1
&&
columnType
.
search
(
'VARCHAR'
)
!==
-
1
)
{
flag
=
true
}
return
flag
},
handleErrorFieldSync
()
{
console
.
log
(
'selection'
,
this
.
templateErrorDialog
.
selectErrorFieldList
)
DataTemplate
.
syncTemplateErrorField
(
this
.
templateErrorDialog
.
selectErrorFieldList
).
then
(
res
=>
{
this
.
getErrorFieldList
(
this
.
templateErrorDialog
.
template
)
this
.
$message
.
success
(
'同步成功'
)
})
},
// 打开模板规则弹框
// 打开模板规则弹框
openTemplateRuleDialog
(
row
)
{
openTemplateRuleDialog
(
row
)
{
this
.
templateRuleDialog
.
template
=
{
...
row
}
this
.
templateRuleDialog
.
template
=
{
...
row
}
this
.
queryTemplateRule
()
this
.
queryTemplateRule
()
this
.
templateRuleDialog
.
show
=
true
this
.
templateRuleDialog
.
show
=
true
DataTemplate
.
getAllTemplateField
(
row
.
id
).
then
(
res
=>
{
DataTemplate
.
getAllTemplateField
(
row
.
id
).
then
(
res
=>
{
console
.
log
(
'模板规则查询'
,
res
)
console
.
log
(
'模板规则查询'
,
res
)
this
.
templateRuleDialog
.
fieldList
=
res
.
data
.
map
(
item
=>
{
this
.
templateRuleDialog
.
fieldList
=
res
.
data
.
map
(
item
=>
{
return
{
return
{
value
:
item
.
field
,
value
:
item
.
field
,
...
@@ -1513,13 +1635,13 @@ export default {
...
@@ -1513,13 +1635,13 @@ export default {
this
.
orgDictDialog
.
type
=
'0'
this
.
orgDictDialog
.
type
=
'0'
// 查询机构字典
// 查询机构字典
DictData
.
queryDict
(
'area'
).
then
(
res
=>
{
DictData
.
queryDict
(
'area'
).
then
(
res
=>
{
this
.
orgDictDialog
.
areaDict
=
res
.
data
.
map
(
item
=>
{
this
.
orgDictDialog
.
areaDict
=
res
.
data
.
map
(
item
=>
{
return
{
return
{
...
item
,
...
item
,
suggestion
:
StringUtil
.
mergeStr
(
item
.
label
,
item
.
value
)
suggestion
:
StringUtil
.
mergeStr
(
item
.
label
,
item
.
value
)
}
}
})
})
ExcelData
.
queryArea
(
this
.
queryForm
.
orgName
,
this
.
queryForm
.
year
,
this
.
orgDictDialog
.
type
).
then
(
res
=>
{
ExcelData
.
queryArea
(
this
.
queryForm
.
orgName
,
this
.
queryForm
.
year
,
this
.
orgDictDialog
.
type
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
this
.
orgDictDialog
.
orgList
=
res
.
data
.
map
(
item
=>
{
this
.
orgDictDialog
.
orgList
=
res
.
data
.
map
(
item
=>
{
if
(
item
.
AREA_NUMBER_CODE
)
{
if
(
item
.
AREA_NUMBER_CODE
)
{
...
@@ -1534,16 +1656,16 @@ export default {
...
@@ -1534,16 +1656,16 @@ export default {
}).
finally
(
_
=>
this
.
orgDictDialog
.
loading
=
false
)
}).
finally
(
_
=>
this
.
orgDictDialog
.
loading
=
false
)
})
})
},
},
typeChange
(){
typeChange
()
{
this
.
orgDictDialog
.
loading
=
true
this
.
orgDictDialog
.
loading
=
true
ExcelData
.
queryArea
(
this
.
queryForm
.
orgName
,
this
.
queryForm
.
year
,
this
.
orgDictDialog
.
type
).
then
(
res
=>
{
ExcelData
.
queryArea
(
this
.
queryForm
.
orgName
,
this
.
queryForm
.
year
,
this
.
orgDictDialog
.
type
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
this
.
orgDictDialog
.
orgList
=
res
.
data
this
.
orgDictDialog
.
orgList
=
res
.
data
}
}
}).
finally
(
_
=>
this
.
orgDictDialog
.
loading
=
false
)
}).
finally
(
_
=>
this
.
orgDictDialog
.
loading
=
false
)
},
},
AREAFormatter
(
row
){
AREAFormatter
(
row
)
{
if
(
row
.
AREA_NUMBER_CODE
){
if
(
row
.
AREA_NUMBER_CODE
)
{
let
temp
=
this
.
orgDictDialog
.
areaDict
.
find
(
area
=>
area
.
value
===
row
.
AREA_NUMBER_CODE
)
let
temp
=
this
.
orgDictDialog
.
areaDict
.
find
(
area
=>
area
.
value
===
row
.
AREA_NUMBER_CODE
)
return
temp
?
temp
.
label
:
''
return
temp
?
temp
.
label
:
''
}
}
...
@@ -1639,36 +1761,36 @@ export default {
...
@@ -1639,36 +1761,36 @@ export default {
})
})
},
},
// 导出修改后的excel
// 导出修改后的excel
exportExcel
(){
exportExcel
()
{
this
.
orgDictDialog
.
loading
=
true
this
.
orgDictDialog
.
loading
=
true
ExcelData
.
exportExcel
(
this
.
queryForm
.
orgName
,
this
.
queryForm
.
year
).
then
(
async
res
=>
{
ExcelData
.
exportExcel
(
this
.
queryForm
.
orgName
,
this
.
queryForm
.
year
).
then
(
async
res
=>
{
const
isFile
=
await
ExcelData
.
blobValidate
(
res
)
const
isFile
=
await
ExcelData
.
blobValidate
(
res
)
if
(
isFile
)
{
if
(
isFile
)
{
saveAs
(
res
,
this
.
queryForm
.
orgName
+
this
.
queryForm
.
year
+
"年.xlsx"
)
saveAs
(
res
,
this
.
queryForm
.
orgName
+
this
.
queryForm
.
year
+
'年.xlsx'
)
}
}
}).
finally
(
_
=>
this
.
orgDictDialog
.
loading
=
false
)
}).
finally
(
_
=>
this
.
orgDictDialog
.
loading
=
false
)
},
},
// 字段同步
// 字段同步
querySyncField
(){
querySyncField
()
{
this
.
syncFieldDialog
.
show
=
true
this
.
syncFieldDialog
.
show
=
true
this
.
syncFieldDialog
.
loading
=
true
this
.
syncFieldDialog
.
loading
=
true
this
.
syncFieldDialog
.
checked
=
[]
this
.
syncFieldDialog
.
checked
=
[]
DataField
.
querySyncField
(
this
.
fieldDrawer
.
template
.
id
).
then
(
res
=>
{
DataField
.
querySyncField
(
this
.
fieldDrawer
.
template
.
id
).
then
(
res
=>
{
this
.
syncFieldDialog
.
list
=
res
.
data
this
.
syncFieldDialog
.
list
=
res
.
data
}).
finally
(
_
=>
this
.
syncFieldDialog
.
loading
=
false
)
}).
finally
(
_
=>
this
.
syncFieldDialog
.
loading
=
false
)
},
},
syncField
(){
syncField
()
{
if
(
this
.
syncFieldDialog
.
checked
&&
this
.
syncFieldDialog
.
checked
.
length
>
0
){
if
(
this
.
syncFieldDialog
.
checked
&&
this
.
syncFieldDialog
.
checked
.
length
>
0
)
{
this
.
syncFieldDialog
.
loading
=
true
this
.
syncFieldDialog
.
loading
=
true
DataField
.
syncField
(
this
.
syncFieldDialog
.
checked
).
then
(
res
=>
{
DataField
.
syncField
(
this
.
syncFieldDialog
.
checked
).
then
(
res
=>
{
if
(
res
.
code
===
200
){
if
(
res
.
code
===
200
)
{
this
.
$message
.
success
(
"新增字段成功"
)
this
.
$message
.
success
(
'新增字段成功'
)
this
.
syncFieldDialog
.
show
=
false
this
.
syncFieldDialog
.
show
=
false
}
}
}).
finally
(
_
=>
this
.
syncFieldDialog
.
loading
=
false
)
}).
finally
(
_
=>
this
.
syncFieldDialog
.
loading
=
false
)
}
}
},
},
handleSelectionChange
(
val
){
handleSelectionChange
(
val
)
{
this
.
syncFieldDialog
.
checked
=
val
this
.
syncFieldDialog
.
checked
=
val
},
},
areaSearch
(
qs
,
callback
)
{
areaSearch
(
qs
,
callback
)
{
...
@@ -1686,17 +1808,17 @@ export default {
...
@@ -1686,17 +1808,17 @@ export default {
callback
(
this
.
orgDictDialog
.
areaDict
)
callback
(
this
.
orgDictDialog
.
areaDict
)
}
}
},
},
sameFieldCheck
(){
sameFieldCheck
()
{
let
templateId
=
this
.
fieldDrawer
.
template
.
id
let
templateId
=
this
.
fieldDrawer
.
template
.
id
DataField
.
sameFieldCheck
(
templateId
).
then
(
res
=>
{
DataField
.
sameFieldCheck
(
templateId
).
then
(
res
=>
{
if
(
!
res
.
data
||
res
.
data
.
length
===
0
){
if
(
!
res
.
data
||
res
.
data
.
length
===
0
)
{
this
.
$message
.
success
(
"无重复字段,可建表"
)
this
.
$message
.
success
(
'无重复字段,可建表'
)
}
else
{
}
else
{
this
.
sameFieldDialog
.
list
=
res
.
data
this
.
sameFieldDialog
.
list
=
res
.
data
this
.
sameFieldDialog
.
show
=
true
this
.
sameFieldDialog
.
show
=
true
}
}
})
})
}
,
}
}
}
}
}
</
script
>
</
script
>
...
...
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