Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b6de3bf9
authored
2025-01-08 16:28:03 +0800
by
xukangle
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
820266a3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
33 deletions
src/components/Form/index.vue
src/views/data_inventory/classifyGradeCatalogue.vue
src/views/data_inventory/configureRules.vue
src/views/data_inventory/tableCreateExisting.vue
src/components/Form/index.vue
View file @
b6de3bf
...
...
@@ -205,6 +205,10 @@ const inputChange = (val, row) => {
/** 输入框输入触发事件 */
const
inputEventChange
=
(
val
,
item
)
=>
{
if
(
val
===
''
&&
item
.
clearable
)
{
formInline
.
value
[
item
.
field
]
=
''
;
return
;
}
if
(
item
.
regexp
)
{
formInline
.
value
[
item
.
field
]
=
val
.
replace
(
item
.
regexp
,
''
);
if
(
item
.
min
!=
null
&&
(
formInline
.
value
[
item
.
field
]
<
item
.
min
))
{
...
...
@@ -566,7 +570,7 @@ const panelChange = (scope, row) => {
required_mark: item.required,
}">
{{
item
.
label
}}
</span>
}}
</span>
</span>
<div
class=
"header_title_tooltip"
style=
"width: auto"
v-if=
"item.tooltip"
>
...
...
@@ -659,7 +663,7 @@ const panelChange = (scope, row) => {
<div
class=
"item_panel"
:class=
"
{ is_block: panel.block }" v-for="panel in item.children">
<label
:class=
"
{ required_mark: panel.required }">
{{
panel
.
label
}}
</label>
}}
</label>
<el-checkbox
v-if=
"panel.type == 'checkbox'"
v-model=
"formInline[panel.field]"
:disabled=
"panel.disabled || readonly"
:true-label=
"panel.trueValue ?? true"
:false-label=
"panel.falseValue ?? false"
>
{{
panel
.
placeholder
}}
</el-checkbox>
...
...
@@ -742,7 +746,7 @@ const panelChange = (scope, row) => {
<span
class=
"item-label"
slot=
"label"
>
<span
v-if=
"child.label"
:class=
"{ required_mark: child.required }"
>
{{
child.label
}}
</span>
}}
</span>
</span>
<el-select
v-if=
"child.type == 'select'"
v-model=
"formInline[child.field]"
:placeholder=
"child.placeholder"
:disabled=
"child.disabled || readonly"
:filterable=
"child.filterable"
...
...
@@ -801,7 +805,7 @@ const panelChange = (scope, row) => {
<span
class=
"item-label"
slot=
"label"
>
<span
:class=
"
{ required_mark: child.required }">
{{
child
.
label
}}
</span>
}}
</span>
</span>
<el-cascader
v-if=
"child.type == 'cascader'"
v-model=
"formInline[child.field]"
:props=
"child.props"
:options=
"child.options"
:show-all-levels=
"child.showAllLevels ?? true"
...
...
@@ -844,7 +848,7 @@ const panelChange = (scope, row) => {
<div
class=
"item_panel"
v-for=
"child in item.children"
>
<label
:class=
"{ required_mark: child.required }"
>
{{
child.label
}}
</label>
}}
</label>
<div
class=
"tool_item"
>
<el-select
v-model=
"formInline[child.field]"
:class=
"{ is_block: child.block }"
:placeholder=
"child.placeholder"
:multiple=
"child.multiple"
:collapse-tags=
"child.collapse"
...
...
@@ -919,7 +923,7 @@ const panelChange = (scope, row) => {
<span
class=
"item-label"
slot=
"label"
>
<span
:class=
"
{ required_mark: child.required }">
{{
child
.
label
}}
</span>
}}
</span>
</span>
<el-input
:class=
"[child.col,
{ is_block: child.block }]" v-model="formInline[child.field]"
:rows="child.rows ?? 4" type="textarea" :placeholder="child.placeholder"
...
...
@@ -976,7 +980,7 @@ const panelChange = (scope, row) => {
<span
class=
"item-label"
slot=
"label"
>
<span
:class=
"
{ required_mark: child.required }">
{{
child
.
label
}}
</span>
}}
</span>
</span>
<div
class=
"input_group"
:class=
"[child.col]"
v-if=
"child.type == 'input-group'"
>
<template
v-for=
"(group, c) in child.children"
>
...
...
@@ -985,7 +989,7 @@ const panelChange = (scope, row) => {
<span
class=
"item-label"
slot=
"label"
>
<span
:class=
"
{ required_mark: group.required }">
{{
group
.
label
}}
</span>
}}
</span>
</span>
<el-select
v-if=
"group.type == 'select'"
v-model=
"formInline[group.field]"
:placeholder=
"group.placeholder"
:clearable=
"group.clearable"
...
...
@@ -1126,7 +1130,7 @@ const panelChange = (scope, row) => {
<span
class=
"item-label"
slot=
"label"
>
<span
:class=
"
{ required_mark: child.required }">
{{
child
.
label
}}
</span>
}}
</span>
</span>
<el-select
v-if=
"child.type == 'select'"
v-model=
"formInline[child.field]"
:placeholder=
"child.placeholder"
:clearable=
"child.clearable"
:disabled=
"child.disabled || readonly"
...
...
@@ -1177,7 +1181,7 @@ const panelChange = (scope, row) => {
<span
class=
"item-label"
slot=
"label"
:class=
"[child.col]"
>
<span
:class=
"
{ required_mark: child.required }">
{{
child
.
label
}}
</span>
}}
</span>
</span>
<div
class=
"input_popover_panel"
v-if=
"child.type == 'input-popover-panel'"
>
<el-popover
placement=
"bottom-start"
width=
"100%"
trigger=
"click"
:teleported=
"false"
>
...
...
@@ -1231,7 +1235,7 @@ const panelChange = (scope, row) => {
<span
class=
"item-label"
slot=
"label"
>
<span
:class=
"
{ required_mark: child.required }">
{{
child
.
label
}}
</span>
}}
</span>
</span>
<template
v-if=
"child.type == 'upload-image'"
>
<el-upload
:class=
"[child.col, 'avatar-uploader',
{ is_block: child.block }]" action="#"
...
...
src/views/data_inventory/classifyGradeCatalogue.vue
View file @
b6de3bf
...
...
@@ -511,6 +511,22 @@ const tableCheckboxAllSelectChange = (select) => {
// 批量配置业务规则
const
batchControlRules
=
()
=>
{
// 清空 classEditFormInfo.value.formInfo;
classEditFormItems
.
value
.
map
(
item
=>
{
if
(
item
.
field
==
'orderNum'
)
{
item
.
visible
=
true
;
}
if
(
item
.
field
==
'orderNum1'
)
{
item
.
visible
=
false
;
}
item
.
default
=
''
;
if
(
item
.
children
)
{
item
.
children
.
map
(
item
=>
{
item
.
default
=
''
;
})
}
});
// 判断是否选中数据
if
(
!
selectedRulesData
.
value
||
!
selectedRulesData
.
value
.
guids
||
selectedRulesData
.
value
.
guids
.
length
==
0
)
{
proxy
.
$ElMessage
.
warning
(
'请选择数据'
);
...
...
@@ -544,6 +560,7 @@ const batchControlRules = () => {
return
false
;
}
console
.
log
(
'isSingleInputField'
,
isSingleInputField
,
'isDoubleInputField'
,
isDoubleInputField
);
// 如果全都是单文本框或者全都是双文本框,则继续后续操作
if
(
isSingleInputField
)
{
classEditFormItems
.
value
[
4
].
visible
=
false
;
...
...
@@ -836,6 +853,7 @@ const classEditFormItems = ref<any>([{
field
:
'startNumber'
,
default
:
''
,
maxlength
:
6
,
min
:
1
,
regexp
:
/
\D
/g
,
clearable
:
true
,
required
:
false
,
...
...
@@ -847,6 +865,7 @@ const classEditFormItems = ref<any>([{
field
:
'endNumber'
,
default
:
''
,
maxlength
:
6
,
min
:
1
,
regexp
:
/
\D
/g
,
clearable
:
true
,
required
:
false
,
...
...
@@ -863,6 +882,7 @@ const classEditFormItems = ref<any>([{
field
:
'fieldPrecision'
,
maxlength
:
2
,
regexp
:
/
\D
/g
,
min
:
1
,
required
:
false
,
clearable
:
true
,
block
:
true
,
...
...
@@ -906,6 +926,7 @@ const classEditFormItems = ref<any>([{
field
:
'startValue'
,
clearable
:
true
,
required
:
false
,
min
:
1
,
regexp
:
/
\D
/g
,
},
{
...
...
@@ -913,6 +934,7 @@ const classEditFormItems = ref<any>([{
placeholder
:
'请输入'
,
field
:
'endValue'
,
clearable
:
true
,
min
:
1
,
required
:
false
,
regexp
:
/
\D
/g
,
},
...
...
@@ -1129,6 +1151,21 @@ const drawerSelectChange = (val, row, info) => {
}
});
}
if
(
val
===
'>'
||
val
===
'<'
||
val
===
'='
||
val
===
'>='
||
val
===
'<='
)
{
{
classEditFormItems
.
value
.
forEach
(
item
=>
{
if
(
item
.
field
===
'orderNum'
)
{
item
.
visible
=
true
;
}
if
(
item
.
field
===
'orderNum1'
)
{
item
.
visible
=
false
;
}
if
(
item
.
field
===
'orderNumLength'
)
{
item
.
default
=
val
;
}
});
}
}
}
// tab切换
...
...
@@ -1680,7 +1717,7 @@ const onAChange = async () => {
await
getDbDirTableSelectData
(
2
,
{
databaseGuid
:
selectedA
.
value
,
condition
:
"2"
});
// 数据库搜索
}
}
console
.
log
(
'selectedA'
,);
};
...
...
@@ -1741,7 +1778,12 @@ onActivated(async () => {
const
gradeTreeRef
=
ref
<
any
>
();
const
treeSelectNodeClick
=
(
node
,
item
)
=>
{
console
.
log
(
'treeSelectNodeClick'
,
gradeTreeRef
.
value
.
treeRef
);
nextTick
(()
=>
{
const
nodeElement
=
gradeTreeRef
.
value
.
treeRef
.
$el
.
querySelector
(
`[data-key="
${
String
(
node
.
classifyDetailGuid
)}
"]`
);
if
(
nodeElement
)
{
nodeElement
.
offsetTop
-
gradeTreeRef
.
value
.
treeRef
.
$el
.
clientHeight
>
0
&&
(
gradeTreeRef
.
value
.
treeRef
.
$el
.
scrollTop
=
nodeElement
.
offsetTop
-
gradeTreeRef
.
value
.
treeRef
.
$el
.
clientHeight
+
32
);
}
});
classifyDetailGuidInfo
.
value
=
node
.
classifyDetailGuid
;
treeInfo
.
value
.
expandedKey
=
[];
treeInfo
.
value
.
expandedKey
.
push
(
node
.
classifyDetailGuid
);
...
...
src/views/data_inventory/configureRules.vue
View file @
b6de3bf
...
...
@@ -221,12 +221,14 @@ const saveRow = (row) => {
row
.
fieldLengthCondition
=
''
}
if
(
row
.
lengthSymbol
&&
row
.
lengthValue
)
{
console
.
log
(
'row.lengthSymbol'
,
row
.
lengthSymbol
+
'#'
+
row
.
lengthValue
)
row
.
fieldLengthCondition
=
row
.
lengthSymbol
+
'#'
+
row
.
lengthValue
}
// 字段范围 双文本情况
if
(
!
isSingleInput
(
row
.
fieldType
))
{
row
.
fieldValueRange
=
(
row
.
startValue
?
row
.
startValue
:
''
)
+
'#'
+
(
row
.
endValue
?
row
.
endValue
:
''
)
}
row
.
isEdit
=
false
}
...
...
@@ -412,7 +414,48 @@ const validatePositiveInteger = (row: any, field: string) => {
row
[
field
]
=
''
;
}
};
function
parseFieldLengthCondition
(
condition
)
{
// 如果 condition 为 null 或 undefined,直接返回默认值
if
(
!
condition
)
{
return
'--'
;
}
if
(
condition
.
includes
(
'between'
))
{
const
parts
=
condition
.
split
(
'#'
).
filter
(
Boolean
);
// 按 '#' 分割并去掉空值
return
`
${
parts
[
1
]}
-
${
parts
[
2
]}
`
;
// 显示为 "10-20"
}
let
symbol
=
''
;
let
value
=
''
;
if
(
condition
.
startsWith
(
'>='
)
||
condition
.
startsWith
(
'<='
))
{
symbol
=
condition
.
slice
(
0
,
2
);
// 取前两个字符 '>=', '<='
value
=
condition
.
substring
(
2
);
// 取从第三个字符开始的部分 '10'
}
else
{
symbol
=
condition
[
0
];
value
=
condition
.
substring
(
1
);
}
value
=
value
.
replace
(
'#'
,
''
);
let
displayText
=
''
;
switch
(
symbol
)
{
case
'>'
:
displayText
=
`大于
${
value
}
`
;
break
;
case
'='
:
displayText
=
`等于
${
value
}
`
;
break
;
case
'<'
:
displayText
=
`小于
${
value
}
`
;
break
;
case
'>='
:
displayText
=
`大于等于
${
value
}
`
;
break
;
case
'<='
:
displayText
=
`小于等于
${
value
}
`
;
break
;
default
:
displayText
=
`--`
;
break
;
}
return
displayText
;
}
</
script
>
<
template
>
<div
class=
"configure-rules"
>
...
...
@@ -423,9 +466,9 @@ const validatePositiveInteger = (row: any, field: string) => {
'max-height': 'calc(100% - 16px)',
display: 'inline-block',
}">
<el-table-column
prop=
"databaseChName"
label=
"数据源"
width=
"180"
/>
<el-table-column
prop=
"tableName"
label=
"表名称"
width=
"180"
/>
<el-table-column
prop=
"tableChName"
label=
"数据库表"
width=
"280"
/>
<el-table-column
prop=
"databaseChName"
label=
"数据源"
width=
"180"
show-overflow-tooltip
/>
<el-table-column
prop=
"tableName"
label=
"表名称"
width=
"180"
show-overflow-tooltip
/>
<el-table-column
prop=
"tableChName"
label=
"数据库表"
width=
"280"
show-overflow-tooltip
/>
<el-table-column
prop=
"description"
label=
"描述"
width=
"180"
show-overflow-tooltip
/>
</el-table>
</div>
...
...
@@ -484,7 +527,7 @@ const validatePositiveInteger = (row: any, field: string) => {
<el-table-column
prop=
"fieldLengthCondition"
label=
"长度"
width=
"340"
align=
"center"
>
<
template
#
default=
"scope"
>
<span
v-if=
"!scope.row.isEdit"
>
{{
scope
.
row
.
fieldLengthCondition
?
scope
.
row
.
fieldLengthCondition
:
'--'
}}
{{
parseFieldLengthCondition
(
scope
.
row
.
fieldLengthCondition
)
||
'--'
}}
</span>
<div
v-else
>
<div
style=
"display: flex; align-items: center;"
>
...
...
src/views/data_inventory/tableCreateExisting.vue
View file @
b6de3bf
...
...
@@ -1019,11 +1019,11 @@ onActivated(() => {
<!-- 排序列(不可编辑) -->
<el-table-column
type=
"index"
label=
"排序"
width=
"80"
align=
"center"
/>
<!-- 字段中文名(可编辑)fieldChName -->
<el-table-column
prop=
"fieldChName"
label=
"
目标
字段中文名"
width=
"150"
show-overflow-tooltip
>
<el-table-column
prop=
"fieldChName"
label=
"字段中文名"
width=
"150"
show-overflow-tooltip
>
<!-- 可以编辑 -->
<
template
#
default=
"scope"
>
<span
v-if=
"!scope.row.isEdit || !editableFields.fieldChName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')"
>
{{
v-if=
"!scope.row.isEdit || !editableFields.fieldChName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1'
&& route.query.state != '0'
)"
>
{{
scope
.
row
.
fieldChName
?
scope
.
row
.
fieldChName
:
'--'
}}
</span>
...
...
@@ -1032,10 +1032,10 @@ onActivated(() => {
</el-table-column>
<!-- 字段英文名(可编辑) -->
<el-table-column
prop=
"fieldName"
label=
"
目标
字段英文名"
width=
"150"
show-overflow-tooltip
>
<el-table-column
prop=
"fieldName"
label=
"字段英文名"
width=
"150"
show-overflow-tooltip
>
<
template
#
default=
"scope"
>
<span
v-if=
"!scope.row.isEdit || !editableFields.fieldName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')"
>
{{
v-if=
"!scope.row.isEdit || !editableFields.fieldName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1'
&& route.query.state != '0'
)"
>
{{
scope
.
row
.
fieldName
?
scope
.
row
.
fieldName
:
'--'
}}
</span>
...
...
@@ -1045,28 +1045,28 @@ onActivated(() => {
</el-table-column>
<!-- 源数据库 -->
<el-table-column
prop=
"sourceDatabase"
label=
"源数据库"
width=
"150"
show-overflow-tooltip
v-if=
"route.query.
foundMode =
= '1'"
>
v-if=
"route.query.
editOpt !
= '1'"
>
<
template
#
default=
"scope"
>
{{
scope
.
row
.
sourceDatabase
?
scope
.
row
.
sourceDatabase
:
'--'
}}
</
template
>
</el-table-column>
<!-- 源数据表 -->
<el-table-column
prop=
"sourceTableName"
label=
"源数据表"
width=
"150"
show-overflow-tooltip
v-if=
"route.query.
foundMode ==
= '1'"
>
v-if=
"route.query.
editOpt !
= '1'"
>
<
template
#
default=
"scope"
>
{{
scope
.
row
.
sourceTableName
?
scope
.
row
.
sourceTableName
:
'--'
}}
</
template
>
</el-table-column>
<!-- 源字段中文 -->
<el-table-column
prop=
"sourceFieldName"
label=
"源字段中文"
width=
"150"
show-overflow-tooltip
v-if=
"route.query.
foundMode ==
= '1'"
>
v-if=
"route.query.
editOpt !
= '1'"
>
<
template
#
default=
"scope"
>
{{
scope
.
row
.
sourceFieldName
?
scope
.
row
.
sourceFieldName
:
'--'
}}
</
template
>
</el-table-column>
<!-- 源字段英文 -->
<el-table-column
prop=
"sourceFieldChName"
label=
"源字段英文"
width=
"120"
show-overflow-tooltip
v-if=
"route.query.
foundMode ==
= '1'"
>
v-if=
"route.query.
editOpt !
= '1'"
>
<
template
#
default=
"scope"
>
<!--
{{
scope
.
row
.
sourceFieldName
?
scope
.
row
.
sourceFieldName
:
'--'
}}
-->
...
...
@@ -1076,9 +1076,10 @@ onActivated(() => {
</
template
>
</el-table-column>
<!-- 源端字段 fieldType fieldTypeProps-->
<el-table-column
prop=
"fieldType"
label=
"
源端
字段类型"
width=
"120"
>
<el-table-column
prop=
"fieldType"
label=
"字段类型"
width=
"120"
>
<
template
#
default=
"scope"
>
<div
v-if=
"scope.row.isEdit && !(scope.row.isPrimary === 'Y' && $route.query.editOpt === '1')"
>
<div
v-if=
"scope.row.isEdit && !(scope.row.isPrimary === 'Y' && $route.query.editOpt === '1' && route.query.state != '0')"
>
<el-select
v-model=
"scope.row.fieldType"
placeholder=
"选择类型"
clearable
filterable
:props=
"fieldTypeProps"
>
<el-option
v-for=
"(item, index) in fieldData"
:key=
"index"
:label=
"item.label"
...
...
@@ -1140,7 +1141,7 @@ onActivated(() => {
<el-table-column
prop=
"isPrimary"
label=
"是否主键"
width=
"100"
align=
"left"
>
<
template
#
default=
"scope"
>
<span
v-if=
"!scope.row.isEdit || !editableFields.isPrimary || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')"
>
{{
v-if=
"!scope.row.isEdit || !editableFields.isPrimary || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1'
&& route.query.state != '0'
)"
>
{{
scope
.
row
.
isPrimary
||
'--'
}}
</span>
<el-select
v-else
v-model=
"scope.row.isPrimary"
placeholder=
"请选择"
>
<el-option
label=
"Y"
value=
"Y"
/>
...
...
@@ -1151,8 +1152,9 @@ onActivated(() => {
<!-- 是否必填(可编辑) -->
<el-table-column
prop=
"notNull"
label=
"是否必填"
width=
"100"
align=
"left"
>
<
template
#
default=
"scope"
>
<span
v-if=
"!scope.row.isEdit || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')"
>
{{
scope
.
row
.
notNull
||
'--'
}}
</span>
<span
v-if=
"!scope.row.isEdit || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')"
>
{{
scope
.
row
.
notNull
||
'--'
}}
</span>
<el-select
v-else
v-model=
"scope.row.notNull"
placeholder=
"请选择"
>
<el-option
label=
"Y"
value=
"Y"
/>
<el-option
label=
"N"
value=
"N"
/>
...
...
@@ -1199,8 +1201,10 @@ onActivated(() => {
<
template
#
default=
"scope"
>
<span
class=
"text_btn"
v-if=
"!scope.row.isEdit"
@
click=
"editRow(scope.row)"
>
编辑
</span>
<span
class=
"text_btn"
v-else
@
click=
"saveRow(scope.row)"
>
保存
</span>
<el-divider
direction=
"vertical"
v-if=
"scope.row.isPrimary != 'Y'"
/>
<span
class=
"text_btn"
@
click=
"deleteRow(scope.$index)"
v-if=
"scope.row.isPrimary != 'Y'"
>
删除
</span>
<el-divider
direction=
"vertical"
v-if=
"(route.query.state == '0' ? route.query.state == '0' : scope.row.isPrimary != 'Y')"
/>
<span
class=
"text_btn"
@
click=
"deleteRow(scope.$index)"
v-if=
"(route.query.state == '0' ? route.query.state == '0' : scope.row.isPrimary != 'Y')"
>
删除
</span>
</
template
>
</el-table-column>
</el-table>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment