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
ec743969
authored
2025-01-08 00:51:58 +0800
by
xukangle
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix : 修改分类分级
1 parent
3f73d0f0
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
832 additions
and
203 deletions
src/store/modules/user.ts
src/views/data_asset/registerCatalogCreate.vue
src/views/data_asset/registerCatalogManagement.vue
src/views/data_inventory/classifyGradeCatalogue.vue
src/views/data_inventory/configureRules.vue
src/views/data_inventory/dictionary.vue
src/views/data_inventory/existingTableSelect.vue
src/views/data_inventory/tableCreateFile.vue
src/views/data_product/productListing.vue
src/views/data_product/productListingDetail.vue
src/store/modules/user.ts
View file @
ec74396
...
...
@@ -4,7 +4,7 @@ import router from '@/router'
import
{
ElMessage
}
from
'element-plus'
import
apiUser
from
'@/api/modules/user'
import
{
getCurrentTime
}
from
'@/utils/common'
import
{
getSystemMenu
,
getUserInfo
,
getTokenByCode
,
loginOut
,
refreshToken
,
editPasswordInterface
}
from
'@/api/modules/queryService'
import
{
getSystemMenu
,
getUserInfo
,
getTokenByCode
,
loginOut
,
refreshToken
,
editPasswordInterface
,
getCurrentUserInfo
}
from
'@/api/modules/queryService'
const
useUserStore
=
defineStore
(
// 唯一ID
...
...
@@ -56,6 +56,14 @@ const useUserStore = defineStore(
currentTenantGuid
.
value
=
res
.
data
.
tenantInfoList
&&
res
.
data
.
tenantInfoList
.
length
?
res
.
data
.
tenantInfoList
[
0
].
guid
:
''
;
localStorage
.
setItem
(
'currentTenantGuid'
,
currentTenantGuid
.
value
);
let
currentTenant
=
res
.
data
.
tenantInfoList
?.[
0
];
getCurrentUserInfo
(
currentTenantGuid
.
value
).
then
((
res
:
any
)
=>
{
console
.
log
(
res
,
'getCurrentUserInfo'
);
if
(
res
.
code
==
'00000'
)
{
localStorage
.
setItem
(
'userData'
,
JSON
.
stringify
(
res
.
data
));
}
else
{
ElMessage
.
error
(
res
.
msg
)
}
})
return
getSystemMenu
({
tenantGuid
:
currentTenantGuid
.
value
}).
then
((
info
:
any
)
=>
{
if
(
info
.
code
==
'00000'
)
{
localStorage
.
setItem
(
'userName'
,
currentTenant
?.
name
)
...
...
src/views/data_asset/registerCatalogCreate.vue
View file @
ec74396
...
...
@@ -492,18 +492,17 @@ const importTableEditIndex: any = ref(null);
const
addAssetTable
=
()
=>
{
importTableFieldVisible
.
value
=
true
;
}
const
stuffInfo
=
ref
<
any
>
({});
onBeforeMount
(()
=>
{
const
currentTenantGuid
=
localStorage
.
getItem
(
'currentTenantGuid'
);
getCurrentUserInfo
(
currentTenantGuid
).
then
((
res
:
any
)
=>
{
console
.
log
(
res
,
'getCurrentUserInfo'
);
if
(
res
.
code
==
'00000'
)
{
localStorage
.
setItem
(
'userData'
,
JSON
.
stringify
(
res
.
data
));
stuffInfo
.
value
=
res
.
data
;
}
else
{
ElMessage
.
error
(
res
.
msg
)
}
})
// const currentTenantGuid = localStorage.getItem('currentTenantGuid');
// getCurrentUserInfo(currentTenantGuid).then((res: any) => {
// console.log(res, 'getCurrentUserInfo');
// if (res.code == '00000') {
// localStorage.setItem('userData', JSON.stringify(res.data));
// } else {
// ElMessage.error(res.msg)
// }
// })
getParentAreaPromise
.
value
=
getAreaData
({
parentId
:
null
}).
then
((
res
:
any
)
=>
{
if
(
res
?.
code
==
proxy
.
$passCode
)
{
parentAreaData
.
value
=
res
.
data
??
[];
...
...
@@ -662,10 +661,6 @@ const save = () => {
});
}
else
{
params
.
damCatalogTableInfo
=
assetDataTableInfo
.
value
.
data
;
params
.
damCatalogTableInfo
=
{
...
assetDataTableInfo
.
value
.
data
,
stuffGuid
:
stuffInfo
.
value
.
staffGuid
};
fullscreenLoading
.
value
=
true
;
registerCatalogSave
(
params
).
then
((
res
:
any
)
=>
{
fullscreenLoading
.
value
=
false
;
...
...
src/views/data_asset/registerCatalogManagement.vue
View file @
ec74396
...
...
@@ -26,7 +26,13 @@ const assetStore = useDataAssetStore();
const
router
=
useRouter
();
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
damTypes
:
any
=
ref
([]);
const
dataSources
:
any
=
ref
([]);
const
subjectDomainListData
:
any
=
ref
([])
// 登记状态 Y 已登记 N 未登记
const
isRegisterOptions
=
ref
<
any
>
([
{
label
:
"已登记"
,
value
:
"Y"
},
{
label
:
"未登记"
,
value
:
"N"
},
])
const
searchItemList
=
ref
([
{
type
:
"input"
,
...
...
@@ -73,23 +79,37 @@ const searchItemList = ref([
showCheckbox
:
true
},
{
type
:
"
inpu
t"
,
type
:
"
selec
t"
,
label
:
""
,
field
:
"da
mName
"
,
field
:
"da
taSources
"
,
default
:
""
,
placeholder
:
"来源"
,
placeholder
:
"
数据
来源"
,
clearable
:
true
,
filterable
:
true
,
options
:
dataSources
.
value
,
props
:
{
value
:
'value'
,
label
:
'label'
}
},
{
type
:
"
inpu
t"
,
type
:
"
selec
t"
,
label
:
""
,
field
:
"
damName
"
,
field
:
"
isRegister
"
,
default
:
""
,
placeholder
:
"登记状态"
,
clearable
:
true
,
filterable
:
true
,
options
:
isRegisterOptions
.
value
,
props
:
{
value
:
'value'
,
label
:
'label'
}
},
]);
const
pageInfo
=
ref
({
...
commonPageConfig
,
rows
:
0
,
...
...
@@ -218,6 +238,18 @@ onActivated(() => {
onBeforeMount
(()
=>
{
getDamTypesList
({
dictType
:
"数据来源"
,
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
dataSources
.
value
=
res
.
data
||
[];
let
item
=
searchItemList
.
value
.
find
(
item
=>
item
.
field
==
'dataSources'
);
item
&&
(
item
.
options
=
dataSources
.
value
);
}
else
{
proxy
.
$ElMessage
.
error
(
res
.
msg
);
}
})
getDamTypesList
({
dictType
:
"资产类型"
,
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
...
...
@@ -284,6 +316,8 @@ const handleCreate = () => {
<div
class=
"type-btn"
>
<div
class=
"type"
>
{{
item
.
subjectDomainName
||
item
.
subjectDomain
}}
</div>
<div
class=
"type"
>
{{
item
.
damTypeName
||
'--'
}}
</div>
<div
class=
"type"
>
{{
item
.
isRegister
==
'Y'
?
'已登记'
:
'未登记'
}}
</div>
<div
class=
"type"
>
{{
item
.
foundMode
==
'1'
?
'自建'
:
'加工交付'
}}
</div>
</div>
<div
class=
"desc"
>
{{
item
.
propertyDescription
}}
</div>
<el-popover
v-model=
"cardBtnVisible"
placement=
"bottom"
width=
"96"
trigger=
"click"
...
...
src/views/data_inventory/classifyGradeCatalogue.vue
View file @
ec74396
...
...
@@ -25,12 +25,13 @@ import {
getDbDirTableSelectList
,
getDbDirFieldSelectList
,
updateDataAsset
,
getDictionaryAll
getDictionaryAll
,
getNewDataTypeList
}
from
'@/api/modules/dataInventory'
;
import
{
TableColumnWidth
}
from
"@/utils/enum"
;
import
router
from
"@/router"
;
import
{
download
}
from
"@/utils/common"
;
import
{
vi
}
from
"element-plus/es/locale"
;
const
currentPath
=
ref
<
string
[]
>
([]);
const
currentDatabasePath
=
ref
<
string
[]
>
([]);
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
...
...
@@ -122,6 +123,22 @@ const getExecGuid = async () => {
}
}
// 获取字段类型
const
optionsD
=
ref
<
any
>
();
const
selectedD
=
ref
<
any
>
();
const
fieldData
=
ref
<
any
>
();
const
getFieldTypeData
=
async
()
=>
{
const
params
=
{
dictType
:
"字段类型"
}
const
res
:
any
=
await
getNewDataTypeList
(
params
);
if
(
res
.
code
==
proxy
.
$passCode
)
{
fieldData
.
value
=
res
.
data
;
optionsD
.
value
=
res
.
data
;
}
else
{
proxy
.
$ElMessage
.
error
(
res
.
msg
);
}
}
onMounted
(
async
()
=>
{
await
getExecGuid
();
...
...
@@ -134,6 +151,7 @@ onMounted(async () => {
getSearchTableList
();
// getLabelListData();
getGradeData
(
refGradeGuid
.
value
);
getFieldTypeData
();
})
...
...
@@ -213,23 +231,33 @@ const searchItemList = ref([
// 搜索
const
searchCount
=
ref
(
0
);
const
toSearch
=
(
val
:
any
,
clear
:
boolean
=
false
)
=>
{
console
.
log
(
'toSearch'
,
val
,
clear
);
if
(
clear
)
{
selectedA
.
value
=
null
;
selectedB
.
value
=
null
;
selectedC
.
value
=
null
;
levelGuidInfo
.
value
=
''
;
val
.
levelName
=
''
;
val
.
classfiyName
=
''
;
searchItemList
.
value
.
map
(
item
=>
item
.
default
=
''
)
if
(
activeName
.
value
===
'first'
)
{
treeInfo
.
value
.
expandedKey
=
[];
currentPath
.
value
=
[
CgDirTreeList
.
value
[
0
].
classifyName
];
treeInfo
.
value
.
expandedKey
.
push
(
CgDirTreeList
.
value
[
0
].
classifyDetailGuid
);
treeInfo
.
value
.
currentNodeKey
=
CgDirTreeList
.
value
[
0
].
classifyDetailGuid
;
console
.
log
(
'clear'
,
treeInfo
.
value
.
expandedKey
,
clear
);
getCgDirFieldPage
({
execGuid
:
execGuidInfo
.
value
.
execGuid
,
classifyDetail
:
CgDirTreeList
.
value
[
0
].
classifyDetailGuid
,
});
}
if
(
activeName
.
value
===
'second'
)
{
dataBaseTreeInfo
.
value
.
expandedKey
=
[];
dataBaseTreeInfo
.
value
.
expandedKey
.
push
(
dataBaseTreeData
.
value
[
0
].
guid
);
dataBaseTreeInfo
.
value
.
currentNodeKey
=
dataBaseTreeData
.
value
[
0
].
guid
;
dataBaseGuid
.
value
=
dataBaseTreeData
.
value
[
0
].
databaseGuid
;
currentDatabasePath
.
value
=
[
dataBaseTreeData
.
value
[
0
].
name
];
selectedA
.
value
=
dataBaseTreeData
.
value
[
0
].
databaseGuid
;
getDbDirTableSelectData
(
2
,
{
databaseGuid
:
selectedA
.
value
,
condition
:
"2"
})
getDataBaseTableData
({
pageIndex
:
1
,
pageSize
:
50
,
...
...
@@ -248,14 +276,15 @@ const toSearch = (val: any, clear: boolean = false) => {
tableGuid
:
selectedB
.
value
||
tableGuid
.
value
||
''
,
databaseGuid
:
selectedA
.
value
||
dataBaseGuid
.
value
||
''
,
fieldGuid
:
''
,
classifyDetailGuid
:
''
,
classifyDetailGuid
:
val
.
classifyName
,
gradeDetailGuid
:
''
,
labelGuid
:
''
,
});
}
return
;
}
console
.
log
(
'toSearch'
,
val
,
classifyDetailGuidInfo
.
value
);
if
(
activeName
.
value
===
'first'
&&
!
clear
)
{
getCgDirFieldPage
({
pageIndex
:
1
,
...
...
@@ -276,8 +305,8 @@ const toSearch = (val: any, clear: boolean = false) => {
execGuid
:
execGuidInfo
.
value
.
execGuid
,
tableGuid
:
selectedB
.
value
||
tableGuid
.
value
||
''
,
databaseGuid
:
selectedA
.
value
||
dataBaseGuid
.
value
||
''
,
classifyDetailGuid
:
val
.
classifyName
,
gradeDetailGuid
:
val
.
levelName
,
classifyDetailGuid
:
val
.
classifyName
||
''
,
gradeDetailGuid
:
val
.
levelName
||
''
,
labelGuid
:
val
.
labelName
,
});
}
...
...
@@ -289,8 +318,8 @@ const toSearch = (val: any, clear: boolean = false) => {
tableGuid
:
selectedB
.
value
||
tableGuid
.
value
||
''
,
databaseGuid
:
selectedA
.
value
||
dataBaseGuid
.
value
||
''
,
fieldGuid
:
selectedC
.
value
||
''
,
classifyDetailGuid
:
val
.
classifyName
,
gradeDetailGuid
:
val
.
levelName
,
classifyDetailGuid
:
val
.
classifyName
||
''
,
gradeDetailGuid
:
val
.
levelName
||
''
,
labelGuid
:
val
.
labelName
,
});
}
...
...
@@ -312,6 +341,9 @@ const nodeClick = async (data: any) => {
execGuid
:
execGuidInfo
.
value
.
execGuid
,
classifyDetail
:
classifyDetailGuid
,
gradeDetailGuid
:
levelGuidInfo
.
value
,
databaseGuid
:
selectedA
.
value
,
tableGuid
:
selectedB
.
value
,
fieldGuid
:
selectedC
.
value
,
});
// 递归tempData找到所有祖先元素的standardName,存入currentPath中
const
path
=
findPath
(
CgDirTreeList
.
value
,
guid
);
...
...
@@ -389,7 +421,8 @@ const tableInfo = ref({
fields
:
[
{
label
:
"序号"
,
type
:
"index"
,
width
:
56
,
align
:
"center"
},
{
label
:
"字段名"
,
field
:
"fieldName"
,
width
:
140
},
{
label
:
"字段中文名"
,
field
:
"fieldChName"
,
width
:
180
},
{
label
:
"字段中文名"
,
field
:
"fieldChName"
,
width
:
140
},
{
label
:
"字段类型"
,
field
:
"fieldTypeName"
,
width
:
120
},
{
label
:
"分类"
,
field
:
"classifyDetailNameRoutes"
,
width
:
120
,
getName
:
(
scope
)
=>
{
return
scope
.
row
.
classifyDetailNameRoutes
.
join
(
'/'
);
...
...
@@ -427,9 +460,25 @@ const tablePageChange = (info) => {
});
}
// 判断是否为单文本框
const
isSingleInput
=
(
fieldType
:
string
)
=>
{
// 定义单文本框的字段类型
const
singleInputTypes
=
[
'text'
,
'varchar'
,
'json'
,
'bit'
,
'char'
];
return
singleInputTypes
.
includes
(
fieldType
)
||
!
fieldType
;
// 如果fieldType为空,默认为单文本框
};
//time tinyint decimal timestamp datetime date int varchar text json bit char
//剩下判断是为单文本框
const
isDoubleInput
=
(
fieldType
:
string
)
=>
{
// 定义单文本框的字段类型
const
doubleInputTypes
=
[
'time'
,
'decimal'
,
'tinyint'
,
'timestamp'
,
'datetime'
,
'date'
,
'int'
];
return
doubleInputTypes
.
includes
(
fieldType
);
};
// 选中配置的业务规则
const
selectedRulesData
=
ref
();
const
selectedRulesDataList
=
ref
([]);
const
tableCheckboxSelectChange
=
(
select
,
row
)
=>
{
selectedRulesDataList
.
value
=
select
;
// 遍历选中的数据,存入selectedRulesData
let
rulesName
:
any
=
[];
let
rulesGuid
:
any
=
[];
...
...
@@ -443,6 +492,7 @@ const tableCheckboxSelectChange = (select, row) => {
};
}
const
tableCheckboxAllSelectChange
=
(
select
)
=>
{
selectedRulesDataList
.
value
=
select
;
// 遍历选中的数据,存入selectedRulesData
let
rulesName
:
any
=
[];
let
rulesGuid
:
any
=
[];
...
...
@@ -457,16 +507,51 @@ const tableCheckboxAllSelectChange = (select) => {
}
// 批量配置业务规则
const
batchControlRules
=
()
=>
{
console
.
log
(
'selectedRulesData'
,
selectedRulesData
.
value
);
// 判断是否选中数据
if
(
!
selectedRulesData
.
value
||
!
selectedRulesData
.
value
.
guids
||
selectedRulesData
.
value
.
guids
.
length
==
0
)
{
proxy
.
$ElMessage
.
warning
(
'请选择数据'
);
return
;
}
// 标志变量,分别用于存储单文本框和双文本框的字段
let
isSingleInputField
=
false
;
let
isDoubleInputField
=
false
;
let
isValid
=
true
;
// 遍历 selectedRulesDataList,检查每个 fieldType 是否符合单文本框或双文本框
selectedRulesDataList
.
value
.
forEach
((
item
:
any
)
=>
{
if
(
isSingleInput
(
item
.
fieldType
))
{
isSingleInputField
=
true
;
// 如果是单文本框,标记为单文本框
}
else
if
(
isDoubleInput
(
item
.
fieldType
))
{
isDoubleInputField
=
true
;
// 如果是双文本框,标记为双文本框
}
else
{
// 如果不是单文本框也不是双文本框,标记为无效
isValid
=
false
;
}
});
// 如果有无效的字段类型,则返回 false 并提示警告
if
(
!
isValid
)
{
proxy
.
$ElMessage
.
warning
(
'请选择单文本框或双文本框类型的字段'
);
return
false
;
}
drawerInfo
.
value
.
visible
=
true
;
// 判断字段类型是否一致
if
(
isSingleInputField
&&
isDoubleInputField
)
{
// 如果既有单文本框也有双文本框,提示错误
proxy
.
$ElMessage
.
warning
(
'请选择相同类型的字段'
);
return
false
;
}
// 如果全都是单文本框或者全都是双文本框,则继续后续操作
if
(
isSingleInputField
)
{
classEditFormItems
.
value
[
5
].
visible
=
true
;
classEditFormItems
.
value
[
6
].
visible
=
false
;
}
else
if
(
isDoubleInputField
)
{
classEditFormItems
.
value
[
5
].
visible
=
false
;
classEditFormItems
.
value
[
6
].
visible
=
true
;
}
classEditFormItems
.
value
[
0
].
default
=
selectedRulesData
.
value
.
rulesName
;
drawerInfo
.
value
.
visible
=
true
;
}
// 数据库目录
...
...
@@ -662,10 +747,13 @@ const selectLength = ref([
{
label
:
'大于'
,
value
:
'>'
,
},
{
label
:
'小于'
,
value
:
'<'
,
},
{
label
:
'等于'
,
value
:
'='
,
},
{
label
:
'大于等于'
,
value
:
'>='
,
},
{
label
:
'小于等于'
,
value
:
'<='
,
},
{
label
:
'介于'
,
value
:
'between'
,
},
]
)
const
classEditFormItems
=
ref
([{
const
classEditFormItems
=
ref
<
any
>
([{
label
:
'已选字段'
,
type
:
'input'
,
maxlength
:
50
,
...
...
@@ -695,7 +783,37 @@ const classEditFormItems = ref([{
required
:
false
,
clearable
:
true
,
col
:
'numberClass'
,
visable
:
true
,
},
// {
// label: '',
// type: 'input-group',
// placeholder: '请输入',
// field: 'orderNum1',
// default: '',
// children: [
// {
// type: 'input',
// placeholder: '请输入',
// field: 'startNumber',
// default: '',
// clearable: true,
// required: false,
// },
// {
// type: 'input',
// placeholder: '请输入',
// field: 'endNumber',
// default: '',
// clearable: true,
// required: false,
// },
// ],
// col: 'col2',
// clearable: true,
// visable: false,
// },
{
label
:
'精度'
,
type
:
'input'
,
...
...
@@ -723,6 +841,18 @@ const classEditFormItems = ref([{
},
{
label
:
'字段取值范围'
,
type
:
'input'
,
maxlength
:
20
,
placeholder
:
'请输入'
,
field
:
'fieldValueRange'
,
default
:
''
,
clearable
:
true
,
block
:
false
,
disabled
:
false
,
visable
:
true
,
},
{
label
:
'字段取值范围'
,
type
:
'input-group'
,
placeholder
:
'请输入'
,
field
:
'fieldValueRange'
,
...
...
@@ -731,7 +861,7 @@ const classEditFormItems = ref([{
{
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'
numberStart
'
,
field
:
'
startValue
'
,
default
:
''
,
clearable
:
true
,
required
:
true
,
...
...
@@ -739,7 +869,7 @@ const classEditFormItems = ref([{
{
type
:
'input'
,
placeholder
:
'请输入'
,
field
:
'
numberEnd
'
,
field
:
'
endValue
'
,
default
:
''
,
clearable
:
true
,
required
:
true
,
...
...
@@ -747,10 +877,12 @@ const classEditFormItems = ref([{
],
col
:
'col2'
,
clearable
:
true
,
visable
:
true
,
},
// 替换为下拉
{
label
:
'数据是否唯一'
,
type
:
"
radio-group
"
,
type
:
"
select
"
,
field
:
"isUnique"
,
disabled
:
false
,
default
:
'N'
,
...
...
@@ -758,10 +890,23 @@ const classEditFormItems = ref([{
{
label
:
"是"
,
value
:
"Y"
,
disabled
:
false
},
{
label
:
"否"
,
value
:
"N"
,
disabled
:
false
},
],
clearable
:
true
,
},
// {
// label: '数据是否唯一',
// type: "radio-group",
// field: "isUnique",
// disabled: false,
// default: 'N',
// options: [
// { label: "是", value: "Y", disabled: false },
// { label: "否", value: "N", disabled: false },
// ],
// },
{
label
:
'是否必填'
,
type
:
"
radio-group
"
,
type
:
"
select
"
,
field
:
"isNotNull"
,
disabled
:
false
,
default
:
'N'
,
...
...
@@ -769,7 +914,21 @@ const classEditFormItems = ref([{
{
label
:
"是"
,
value
:
"Y"
,
disabled
:
false
},
{
label
:
"否"
,
value
:
"N"
,
disabled
:
false
},
],
clearable
:
true
,
}
// ,
// {
// label: '是否必填',
// type: "radio-group",
// field: "isNotNull",
// disabled: false,
// default: 'N',
// options: [
// { label: "是", value: "Y", disabled: false },
// { label: "否", value: "N", disabled: false },
// ],
// }
]);
const
classEditFormRules
=
ref
({
// classifyName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }],
...
...
@@ -813,7 +972,8 @@ const drawerBtnClick = async (btn, info) => {
drawerInfo
.
value
.
visible
=
false
;
}
else
{
btn
.
loading
=
true
;
const
{
orderNumLength
,
orderNum
,
numberStart
,
numberEnd
,
fieldPrecision
,
dictionaryGuid
,
isUnique
,
isNotNull
}
=
info
;
console
.
log
(
'drawerBtnClick'
,
info
);
const
{
orderNumLength
,
orderNum
,
fieldValueRange
,
startValue
,
endValue
,
fieldPrecision
,
dictionaryGuid
,
isUnique
,
isNotNull
}
=
info
;
// 判断长度orderNumLength,orderNum 要么都有值,要么都没有值,不能只有一个有值,一个没有值精确提醒
if
(
orderNumLength
&&
!
orderNum
)
{
proxy
.
$ElMessage
.
error
(
'请填写长度'
);
...
...
@@ -825,30 +985,17 @@ const drawerBtnClick = async (btn, info) => {
btn
.
loading
=
false
;
return
;
}
let
fieldLengthCondition
=
orderNumLength
+
'#'
+
orderNum
;
let
fieldValueRange
:
any
=
[];
// 字段取值范围也是要么都有值,要么都没有值,不能只有一个有值,一个没有值精确提醒
if
(
numberStart
&&
!
numberEnd
)
{
proxy
.
$ElMessage
.
error
(
'请填写字段取值范围结束值'
);
btn
.
loading
=
false
;
return
;
}
if
(
!
numberStart
&&
numberEnd
)
{
proxy
.
$ElMessage
.
error
(
'请填写字段取值范围开始值'
);
btn
.
loading
=
false
;
return
;
}
if
(
numberStart
&&
numberEnd
)
{
if
(
Number
(
numberEnd
)
<
Number
(
numberStart
))
{
proxy
.
$ElMessage
.
error
(
'字段取值范围结束值不能小于开始值'
);
btn
.
loading
=
false
;
return
;
let
fieldLengthCondition
:
any
=
''
;
if
(
!
orderNumLength
&&
!
orderNum
)
{
fieldLengthCondition
=
''
;
}
fieldValueRange
=
numberStart
+
'#'
+
numberEnd
;
if
(
orderNumLength
&&
orderNum
)
{
fieldLengthCondition
=
orderNumLength
+
'#'
+
orderNum
;
}
const
params
:
any
=
[];
selectedRulesData
.
value
.
guids
.
forEach
((
item
:
any
)
=>
{
if
(
fieldValueRange
)
{
params
.
push
({
fieldPrecision
,
dictionaryGuid
,
...
...
@@ -859,6 +1006,19 @@ const drawerBtnClick = async (btn, info) => {
fieldGuid
:
item
,
execGuid
:
execGuidInfo
.
value
.
execGuid
})
}
else
{
params
.
push
({
fieldPrecision
,
dictionaryGuid
,
isUnique
,
isNotNull
,
fieldLengthCondition
,
fieldGuid
:
item
,
execGuid
:
execGuidInfo
.
value
.
execGuid
,
startValue
,
endValue
})
}
});
const
res
:
any
=
await
saveBizRuleConfig
(
params
);
if
(
res
.
code
==
proxy
.
$passCode
)
{
...
...
@@ -882,27 +1042,34 @@ const drawerBtnClick = async (btn, info) => {
}
}
const
handleTreeItemMenuClick
=
(
data
:
any
,
type
)
=>
{
console
.
log
(
'handleTreeItemMenuClick'
,
data
,
type
);
const
drawerSelectChange
=
(
val
,
row
,
info
)
=>
{
console
.
log
(
'drawerSelectChange'
,
val
,
row
,
info
);
if
(
val
===
'between'
)
{
classEditFormItems
.
value
.
forEach
(
item
=>
{
if
(
item
.
field
===
'orderNum'
)
{
item
.
visable
=
false
;
}
if
(
item
.
field
===
'orderNum1'
)
{
item
.
visable
=
true
;
}
});
}
}
// tab切换
const
activeName
=
ref
(
'first'
);
const
handleClick
=
async
(
tab
:
any
)
=>
{
// 切换时选中的配置业务规则清空
selectedRulesData
.
value
=
{};
console
.
log
(
tab
.
props
.
name
);
activeName
.
value
=
tab
.
props
.
name
;
if
(
tab
.
props
.
name
===
'second'
)
{
classifyDetailGuidInfo
.
value
=
''
;
if
(
activeTab
.
value
===
'table'
)
{
searchItemList
.
value
[
0
].
visible
=
false
;
searchItemList
.
value
[
1
].
visible
=
false
;
searchItemList
.
value
[
0
].
default
=
''
;
searchItemList
.
value
[
1
].
default
=
''
;
}
//
if (activeTab.value === 'table') {
//
searchItemList.value[0].visible = false;
//
searchItemList.value[1].visible = false;
//
searchItemList.value[0].default = '';
//
searchItemList.value[1].default = '';
//
}
selectedA
.
value
=
null
;
selectedB
.
value
=
null
;
selectedC
.
value
=
null
;
...
...
@@ -910,9 +1077,11 @@ const handleClick = async (tab: any) => {
optionsB
.
value
=
[];
optionsC
.
value
=
[];
await
getDataBaseTreeData
();
await
getDbDirTableSelectData
(
1
,
{});
await
getDataBaseTableData
();
await
getDataBaseFieldData
();
getDbDirTableSelectData
(
1
,
{});
await
getDbDirTableSelectData
(
2
,
{
databaseGuid
:
selectedA
.
value
,
condition
:
"2"
});
}
else
{
searchItemList
.
value
[
0
].
visible
=
true
;
searchItemList
.
value
[
1
].
visible
=
true
;
...
...
@@ -963,6 +1132,7 @@ const getDataBaseTreeData = async () => {
dataBaseTreeInfo
.
value
.
currentNodeKey
=
dataArray
[
0
].
guid
;
dataBaseGuid
.
value
=
dataArray
[
0
].
databaseGuid
;
currentDatabasePath
.
value
=
[
dataArray
[
0
].
name
];
selectedA
.
value
=
dataArray
[
0
].
databaseGuid
;
if
(
dataArray
[
0
].
dicType
===
1
)
{
isShowCreateBtn
.
value
=
true
;
}
...
...
@@ -1130,7 +1300,6 @@ const onActiveInfo = ref<any>({});
const
dataBasenodeClick
=
(
data
:
any
)
=>
{
isShowCreateBtn
.
value
=
false
;
console
.
log
(
'dataBasenodeClick'
,
data
.
databaseGuid
,
dataBaseTreeData
.
value
);
// 找到data.databaseGuid 在dataBaseTreeData.value 中的下标索引,普通数组遍历就行
const
dbindex
=
dataBaseTreeData
.
value
.
findIndex
((
item
)
=>
{
return
item
.
guid
===
data
.
databaseGuid
;
...
...
@@ -1144,8 +1313,6 @@ const dataBasenodeClick = (data: any) => {
if
(
path
)
{
currentDatabasePath
.
value
=
path
;
}
else
{
console
.
error
(
'未找到路径'
);
}
if
(
data
.
databaseGuid
)
{
dataBaseInfo
.
value
=
data
;
...
...
@@ -1160,10 +1327,13 @@ const dataBasenodeClick = (data: any) => {
getDataBaseFieldData
({
databaseGuid
:
data
.
databaseGuid
,
gradeDetailGuid
:
levelGuidInfo
.
value
,
tableGuid
:
tableGuid
.
value
||
selectedB
.
value
||
''
,
fieldGuid
:
selectedC
.
value
||
''
,
});
getDataBaseTableData
({
databaseGuid
:
data
.
databaseGuid
,
gradeDetailGuid
:
levelGuidInfo
.
value
,
databaseGuid
:
data
.
databaseGuid
||
selectedA
.
value
||
''
,
tableGuid
:
tableGuid
.
value
||
selectedB
.
value
||
''
,
});
}
if
(
data
.
tableGuid
)
{
...
...
@@ -1171,19 +1341,26 @@ const dataBasenodeClick = (data: any) => {
dataBaseGuid
.
value
=
''
;
getDataBaseFieldData
({
tableGuid
:
data
.
tableGuid
,
gradeDetailGuid
:
levelGuidInfo
.
value
,
gradeDetailGuid
:
levelGuidInfo
.
value
||
''
,
databaseGuid
:
data
.
databaseGuid
||
selectedA
.
value
||
''
,
fieldGuid
:
data
.
fieldGuid
||
selectedC
.
value
||
''
,
});
getDataBaseTableData
({
gradeDetailGuid
:
levelGuidInfo
.
value
||
''
,
databaseGuid
:
data
.
databaseGuid
||
selectedA
.
value
||
''
,
tableGuid
:
tableGuid
.
value
||
selectedB
.
value
||
''
,
});
}
if
(
data
.
databaseGuid
||
data
.
cgDirName
)
{
showTableOrDatabase
.
value
=
true
;
return
;
}
if
(
data
.
tableGuid
)
{
showTableOrDatabase
.
value
=
false
;
return
;
}
//
if (data.databaseGuid || data.cgDirName) {
//
showTableOrDatabase.value = true;
//
return;
//
}
//
if (data.tableGuid) {
//
showTableOrDatabase.value = false;
//
return;
//
}
}
...
...
@@ -1202,8 +1379,38 @@ const findDDatabasePath = (data: any[], targetGuid: string, path: string[] = [])
return
null
;
// 未找到目标节点
};
const
nodeSelectChange
=
(
data
:
any
)
=>
{
console
.
log
(
'nodeSelectChange'
,
data
);
const
nodeSelectChange
=
(
node
,
checked
,
checkedChildren
)
=>
{
console
.
log
(
'nodeSelectChange'
,
node
,
node
.
parent
.
data
,
checkedChildren
);
if
(
node
.
parent
.
data
.
databaseGuid
)
{
selectedA
.
value
=
node
.
parent
.
data
.
databaseGuid
;
selectedB
.
value
=
''
;
if
(
activeName
.
value
==
'second'
)
{
if
(
activeTab
.
value
===
'word'
)
{
getDbDirFieldSelectData
(
2
,
{
databaseGuid
:
selectedA
.
value
,
condition
:
"2"
});
}
else
{
getDbDirTableSelectData
(
2
,
{
databaseGuid
:
selectedA
.
value
,
condition
:
"2"
});
// 数据库搜索
}
}
// 选中的是数据库
}
if
(
node
.
data
.
databaseGuid
)
{
// 选中的是字段
selectedA
.
value
=
node
.
data
.
databaseGuid
;
selectedB
.
value
=
''
;
if
(
activeName
.
value
==
'second'
)
{
if
(
activeTab
.
value
===
'word'
)
{
getDbDirFieldSelectData
(
2
,
{
databaseGuid
:
selectedA
.
value
,
condition
:
"2"
});
}
else
{
getDbDirTableSelectData
(
2
,
{
databaseGuid
:
selectedA
.
value
,
condition
:
"2"
});
// 数据库搜索
}
}
}
if
(
node
.
data
.
tableGuid
)
{
// 选中的是表
selectedB
.
value
=
node
.
data
.
tableGuid
||
''
;
getDbDirFieldSelectData
(
3
,
{
tableGuid
:
selectedB
.
value
,
databaseGuid
:
selectedA
.
value
,
condition
:
"3"
});
}
}
const
handleSubjectTableCommand
=
(
command
:
string
)
=>
{
...
...
@@ -1258,27 +1465,16 @@ const activeTab = ref('table');
const
isShowWordSearch
=
ref
(
true
);
const
setActiveTab
=
(
tab
)
=>
{
activeTab
.
value
=
tab
;
if
(
tab
===
'word'
&&
activeName
.
value
===
'second'
)
{
searchItemList
.
value
[
0
].
visible
=
true
;
searchItemList
.
value
[
1
].
visible
=
true
;
searchItemList
.
value
[
0
].
default
=
''
;
searchItemList
.
value
[
1
].
default
=
''
;
isShowWordSearch
.
value
=
false
;
optionsA
.
value
=
[];
optionsB
.
value
=
[];
optionsC
.
value
=
[];
getDbDirFieldSelectData
(
1
);
}
else
{
searchItemList
.
value
[
0
].
visible
=
false
;
searchItemList
.
value
[
1
].
visible
=
false
;
searchItemList
.
value
[
0
].
default
=
''
;
searchItemList
.
value
[
1
].
default
=
''
;
isShowWordSearch
.
value
=
true
;
optionsA
.
value
=
[];
optionsB
.
value
=
[];
optionsC
.
value
=
[];
getDbDirTableSelectData
(
1
,
{});
}
// if (tab === 'word' && activeName.value === 'second') {
// searchItemList.value[0].visible = true;
// searchItemList.value[1].visible = true;
// searchItemList.value[0].default = '';
// searchItemList.value[1].default = '';
// isShowWordSearch.value = false;
// optionsA.value = [];
// optionsB.value = [];
// optionsC.value = [];
// }
};
// 数据库字段搜索联动 getDbDirFieldSelectList
...
...
@@ -1359,7 +1555,6 @@ const getDbDirTableSelectData = async (type, params = {}) => {
}
if
(
type
==
2
)
{
if
(
activeTab
.
value
===
'word'
)
{
console
.
log
(
'进来了吗'
,
res
.
data
);
optionsC
.
value
=
res
.
data
.
map
((
item
)
=>
({
dbGuid
:
item
.
fieldName
,
// 字段标识
name
:
item
.
fieldName
,
// 字段名称
...
...
@@ -1384,6 +1579,7 @@ const getDbDirTableSelectData = async (type, params = {}) => {
};
const
selectedA
=
ref
<
any
>
(
null
);
const
selectedB
=
ref
<
any
>
(
null
);
const
selectedC
=
ref
<
any
>
(
null
);
...
...
@@ -1453,7 +1649,6 @@ const exportDB = async () => {
const
levelGuidInfo
=
ref
(
''
);
// 标签选择
const
selectChange
=
(
val
,
row
,
info
)
=>
{
if
(
info
)
{
levelGuidInfo
.
value
=
info
.
levelName
;
}
...
...
@@ -1492,9 +1687,42 @@ const treeSelectNodeClick = (node, item) => {
}
else
{
console
.
error
(
'未找到路径'
);
}
console
.
log
(
'treeSelectNodeClick'
,
treeInfo
.
value
.
expandedKey
);
if
(
activeName
.
value
===
'second'
&&
activeTab
.
value
===
'word'
)
{
}
}
watchEffect
(()
=>
{
console
.
log
(
`count 的值是:
${
selectedA
.
value
}
`
);
if
(
activeName
.
value
===
'second'
)
{
dataBaseTreeInfo
.
value
.
expandedKey
=
[];
dataBaseTreeInfo
.
value
.
expandedKey
.
push
(
selectedA
.
value
);
dataBaseTreeInfo
.
value
.
currentNodeKey
=
selectedA
.
value
;
if
(
selectedB
.
value
)
{
dataBaseTreeInfo
.
value
.
currentNodeKey
=
selectedB
.
value
;
}
}
if
(
activeName
.
value
===
'second'
&&
activeTab
.
value
===
'table'
)
{
searchItemList
.
value
[
0
].
visible
=
false
;
searchItemList
.
value
[
1
].
visible
=
false
;
searchItemList
.
value
[
0
].
default
=
''
;
searchItemList
.
value
[
1
].
default
=
''
;
}
if
(
activeName
.
value
===
'first'
)
{
searchItemList
.
value
[
0
].
visible
=
true
;
searchItemList
.
value
[
1
].
visible
=
true
;
searchItemList
.
value
[
0
].
default
=
''
;
searchItemList
.
value
[
1
].
default
=
''
;
}
if
(
activeName
.
value
===
'second'
&&
activeTab
.
value
===
'word'
)
{
searchItemList
.
value
[
0
].
visible
=
true
;
searchItemList
.
value
[
1
].
visible
=
true
;
searchItemList
.
value
[
0
].
default
=
''
;
searchItemList
.
value
[
1
].
default
=
''
;
}
});
</
script
>
<
template
>
...
...
@@ -1512,6 +1740,10 @@ const treeSelectNodeClick = (node, item) => {
:clearable=
"true"
v-if=
"!(activeTab === 'table' && activeName === 'second')"
>
<el-option
v-for=
"item in optionsC"
:key=
"item.dbGuid"
:label=
"item.name"
:value=
"item.dbGuid"
/>
</el-select>
<!--
<el-select
v-model=
"selectedD"
placeholder=
"选择字段类型"
style=
"width: 140px;margin-right: 8px"
:clearable=
"true"
v-if=
"activeName === 'first'"
>
<el-option
v-for=
"item in optionsD"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
-->
<TableTools
:searchItems=
"searchItemList"
:init=
"false"
:searchId=
"'files-standard-search'"
@
search=
"toSearch"
@
selectChange=
"selectChange"
@
treeSelectNodeClick=
"treeSelectNodeClick"
/>
</div>
...
...
@@ -1594,8 +1826,8 @@ const treeSelectNodeClick = (node, item) => {
</div>
</div>
<div
class=
"btns-area"
v-if=
"
!tableGuid
&& activeTab === 'table'"
>
<!-- v-if="!tableGuid && activeTab === 'table'" -->
<div
class=
"btns-area"
v-if=
"
activeName === 'second'
&& activeTab === 'table'"
>
<div
class=
"left-btns"
>
<div
class=
"dropdown_btn"
v-if=
"isShowCreateBtn"
>
<el-dropdown
popper-class=
"table-create-menu"
@
command=
"handleSubjectTableCommand"
...
...
@@ -1636,16 +1868,16 @@ const treeSelectNodeClick = (node, item) => {
</div>
</div>
<div
class=
"table_panel_wrap_database"
:style=
"{ height: `calc(100% - ${tipHeight1}px)` }"
v-if=
"
!tableGuid &&
activeTab === 'table'"
>
v-if=
"activeTab === 'table'"
>
<Table
:tableInfo=
"dataBaseTableInfo"
@
tablePageChange=
"dataBaseTablePageChange"
@
tableSwitchBeforeChange=
"tableSwitchBeforeChange"
/>
</div>
<div
class=
"table_field"
:style=
"{ height: `calc(100% - ${tipHeight2}px)` }"
v-if=
"tableGuid || activeTab === 'word'"
>
<div
class=
"table_field"
:style=
"{ height: `calc(100% - ${tipHeight2}px)` }"
v-if=
"activeTab === 'word'"
>
<Table
:tableInfo=
"tableFieldsDataInfo"
@
tablePageChange=
"dataFieldTablePageChange"
/>
</div>
</div>
<Drawer
:drawerInfo=
"drawerInfo"
@
drawerBtnClick=
"drawerBtnClick"
class=
"v-drawer"
/>
<Drawer
:drawerInfo=
"drawerInfo"
@
drawerBtnClick=
"drawerBtnClick"
class=
"v-drawer"
@
drawerSelectChange=
"drawerSelectChange"
/>
</div>
</div>
...
...
src/views/data_inventory/configureRules.vue
View file @
ec74396
...
...
@@ -6,6 +6,7 @@
import
{
ref
}
from
"vue"
;
import
useUserStore
from
"@/store/modules/user"
;
import
{
getBizRuleConfigDetail
,
getDictionaryAll
,
getNewDataTypeList
,
saveBizRuleConfig
,
}
from
'@/api/modules/dataInventory'
import
{
el
,
ro
}
from
"element-plus/es/locale"
;
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
router
=
useRouter
();
const
route
=
useRoute
();
...
...
@@ -167,13 +168,22 @@ const editRow = (row) => {
}
if
(
row
.
fieldLengthCondition
)
{
const
arr
=
row
.
fieldLengthCondition
.
split
(
'#'
)
// 遍历找到arr中是否存在等于between
arr
.
forEach
((
item
)
=>
{
if
(
item
===
'between'
)
{
row
.
lengthSymbol
=
'between'
row
.
numberRangeStart
=
arr
[
1
]
row
.
numberRangeEnd
=
arr
[
2
]
}
else
{
row
.
lengthSymbol
=
arr
[
0
]
row
.
lengthValue
=
arr
[
1
]
}
if
(
row
.
fieldValueRange
)
{
})
}
if
(
row
.
fieldValueRange
&&
!
isSingleInput
(
row
.
fieldType
))
{
const
arr
=
row
.
fieldValueRange
.
split
(
'#'
)
row
.
rangeStart
=
arr
[
0
]
row
.
rangeEnd
=
arr
[
1
]
row
.
startValue
=
arr
[
0
]
row
.
endValue
=
arr
[
1
]
}
row
.
isEdit
=
true
;
// 进入编辑模式
...
...
@@ -181,40 +191,43 @@ const editRow = (row) => {
// 保存数据
const
saveRow
=
(
row
)
=>
{
if
(
row
.
lengthSymbol
&&
row
.
lengthValue
)
{
row
.
fieldLengthCondition
=
row
.
lengthSymbol
+
'#'
+
row
.
lengthValue
if
(
row
.
lengthSymbol
===
'between'
)
{
// 校验不能为空,其中一个为空则提示
if
(
!
row
.
numberRangeStart
||
!
row
.
numberRangeStart
)
{
proxy
.
$message
.
error
(
'请输入完整的长度范围'
);
return
;
}
if
(
row
.
lengthSymbol
&&
!
row
.
lengthValue
)
{
proxy
.
$ElMessage
.
error
(
'请填写字段长度值
'
);
if
(
row
.
numberRangeStart
&&
!
row
.
numberRangeStart
)
{
proxy
.
$ElMessage
.
error
(
'请输入完整的长度范围
'
);
return
}
if
(
!
row
.
lengthSymbol
&&
row
.
lengthValue
)
{
proxy
.
$ElMessage
.
error
(
'请选择字段长度符号
'
);
if
(
!
row
.
numberRangeStart
&&
row
.
numberRangeStart
)
{
proxy
.
$ElMessage
.
error
(
'请输入完整的长度范围
'
);
return
}
if
(
!
row
.
lengthSymbol
&&
!
row
.
lengthValue
)
{
row
.
fieldLengthCondition
=
''
}
if
(
row
.
rangeStart
&&
row
.
rangeEnd
)
{
row
.
fieldValueRange
=
row
.
rangeStart
+
'#'
+
row
.
rangeEnd
row
.
fieldLengthCondition
=
row
.
lengthSymbol
+
'#'
+
row
.
numberRangeStart
+
'#'
+
row
.
numberRangeEnd
}
else
{
if
(
!
row
.
lengthValue
&&
row
.
lengthSymbol
)
{
proxy
.
$message
.
error
(
'请输入完整的长度范围'
);
return
;
}
if
(
row
.
rangeStart
&&
!
row
.
rangeEnd
)
{
proxy
.
$ElMessage
.
error
(
'请填写字段取值范围结束值
'
);
return
if
(
!
row
.
lengthSymbol
&&
row
.
lengthValue
)
{
proxy
.
$message
.
error
(
'请输入完整的长度范围
'
);
return
;
}
if
(
!
row
.
rangeStart
&&
row
.
rangeEnd
)
{
proxy
.
$ElMessage
.
error
(
'请填写字段取值范围开始值'
);
return
}
if
(
!
row
.
rangeStart
&&
!
row
.
rangeEnd
)
{
row
.
fieldValueRange
=
''
if
(
!
row
.
lengthSymbol
&&
!
row
.
lengthValue
)
{
row
.
fieldLengthCondition
=
''
}
if
(
row
.
rangeStart
>
row
.
rangeEnd
)
{
proxy
.
$ElMessage
.
error
(
'字段取值范围开始值不能大于结束值'
);
return
if
(
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
}
const
data
=
[
...
...
@@ -291,19 +304,25 @@ const data = [
const
loading
=
ref
(
false
)
const
saveData
=
async
()
=>
{
loading
.
value
=
true
/**入参
* "guid": "string",
"fieldGuid": "string",
"fieldLengthCondition": "string",
"fieldPrecision": 0,
"dictionaryGuid": "string",
"isUnique": "string",
"isNotNull": "string",
"fieldValueRange": "string"
*/
const
inParams
=
[]
as
any
let
inParams
=
[]
as
any
tableData
.
value
.
forEach
((
item
:
any
)
=>
{
const
obj
=
{
if
(
item
.
startValue
||
item
.
endValue
)
{
inParams
.
push
(
{
fieldGuid
:
item
.
fieldGuid
,
execGuid
:
router
.
currentRoute
.
value
.
query
.
execGuid
,
fieldLengthCondition
:
item
.
fieldLengthCondition
,
fieldPrecision
:
item
.
fieldPrecision
,
dictionaryGuid
:
item
.
dictionaryGuid
,
isUnique
:
item
.
isUnique
,
notNull
:
item
.
notNull
,
startValue
:
item
.
startValue
,
endValue
:
item
.
endValue
}
)
}
else
{
inParams
.
push
(
{
fieldGuid
:
item
.
fieldGuid
,
execGuid
:
router
.
currentRoute
.
value
.
query
.
execGuid
,
fieldLengthCondition
:
item
.
fieldLengthCondition
,
...
...
@@ -313,10 +332,30 @@ const saveData = async () => {
notNull
:
item
.
notNull
,
fieldValueRange
:
item
.
fieldValueRange
}
inParams
.
push
(
obj
)
)
}
})
// 克隆一份 inParams,用于遍历
const
cloneInParams
=
JSON
.
parse
(
JSON
.
stringify
(
inParams
));
// 遍历 cloneInParams,检查每一项的字段
let
allFieldsEmpty
=
true
;
// 标记所有字段是否都为空
for
(
let
i
=
0
;
i
<
cloneInParams
.
length
;
i
++
)
{
// 判断每项中除 fieldGuid 和 execGuid 外的字段是否都为空
const
item
=
cloneInParams
[
i
];
const
isEmpty
=
!
item
.
notNull
&&
!
item
.
fieldValueRange
&&
!
item
.
isUnique
&&
!
item
.
dictionaryGuid
&&
!
item
.
fieldLengthCondition
&&
!
item
.
fieldPrecision
;
// 如果有有效的字段,则不清空 inParams
if
(
!
isEmpty
)
{
allFieldsEmpty
=
false
;
break
;
}
}
// 如果所有项的字段都为空,则清空 inParams
if
(
allFieldsEmpty
)
{
inParams
=
[];
}
// console.log('finalParams', inParams)
const
res
:
any
=
await
saveBizRuleConfig
(
inParams
)
if
(
res
.
code
===
proxy
.
$passCode
)
{
loading
.
value
=
false
...
...
@@ -353,6 +392,27 @@ const cancelEdit = (row) => {
row
.
isEdit
=
false
;
// 退出编辑状态
}
// 判断是否为单文本框
const
isSingleInput
=
(
fieldType
:
string
)
=>
{
// 定义单文本框的字段类型
const
singleInputTypes
=
[
'string'
,
'text'
,
'varchar'
,
'json'
,
'bit'
,
'char'
];
return
singleInputTypes
.
includes
(
fieldType
)
||
!
fieldType
;
// 如果fieldType为空,默认为单文本框
};
// 验证是否为大于0的整数
const
validatePositiveInteger
=
(
row
:
any
,
field
:
string
)
=>
{
const
value
=
row
[
field
];
// 将输入值转为整数并检查是否大于0
if
(
value
&&
!
/^
\d
+$/
.
test
(
value
))
{
// 如果不是整数或是负数,将值清空或者给出提示
row
[
field
]
=
''
;
}
else
if
(
value
&&
parseInt
(
value
)
<=
0
)
{
// 如果小于或等于0,也清空值
row
[
field
]
=
''
;
}
};
</
script
>
<
template
>
<div
class=
"configure-rules"
>
...
...
@@ -421,11 +481,13 @@ const cancelEdit = (row) => {
</el-table-column>
<!-- 长度列 fieldLengthCondition: '>#10',-->
<el-table-column
prop=
"fieldLengthCondition"
label=
"长度"
width=
"
2
40"
align=
"center"
>
<el-table-column
prop=
"fieldLengthCondition"
label=
"长度"
width=
"
3
40"
align=
"center"
>
<
template
#
default=
"scope"
>
<span
v-if=
"!scope.row.isEdit"
>
{{
scope
.
row
.
fieldLengthCondition
?
scope
.
row
.
fieldLengthCondition
.
replace
(
'#'
,
''
)
:
'--'
}}
</span>
<span
v-if=
"!scope.row.isEdit"
>
{{
scope
.
row
.
fieldLengthCondition
?
scope
.
row
.
fieldLengthCondition
:
'--'
}}
</span>
<div
v-else
>
<div
style=
"display: flex; align-items: center;"
>
<el-select
v-model=
"scope.row.lengthSymbol"
placeholder=
"请选择"
style=
"width: 50%;margin-right: 8px;"
clearable
>
<el-option
label=
"大于"
value=
">"
></el-option>
...
...
@@ -433,11 +495,29 @@ const cancelEdit = (row) => {
<el-option
label=
"小于"
value=
"
<
">
</el-option>
<el-option
label=
"大于等于"
value=
">="
></el-option>
<el-option
label=
"小于等于"
value=
"
<
=">
</el-option>
<!-- 介于 -->
<el-option
label=
"介于"
value=
"between"
></el-option>
</el-select>
<el-input
v-model=
"scope.row.lengthValue"
placeholder=
"请输入"
style=
"width: 45%;"
clearable
/>
<!-- 当选择"介于"时,显示两个输入框 -->
<div
v-if=
"scope.row.lengthSymbol === 'between'"
style=
"display: flex; gap: 5px; align-items: center;"
>
<el-input
v-model=
"scope.row.numberRangeStart"
placeholder=
"请输入"
style=
"width: 45%;"
type=
"number"
clearable
@
input=
"validatePositiveInteger(scope.row, 'rangeStart')"
/>
<span>
-
</span>
<el-input
v-model=
"scope.row.numberRangeEnd"
placeholder=
"请输入"
style=
"width: 45%;"
type=
"number"
clearable
@
input=
"validatePositiveInteger(scope.row, 'rangeEnd')"
/>
</div>
<!-- 其他符号时显示一个输入框 -->
<div
v-else
>
<el-input
v-model=
"scope.row.lengthValue"
placeholder=
"请输入"
style=
"width: 90%;"
clearable
@
input=
"validatePositiveInteger(scope.row, 'lengthValue')"
type=
"number"
/>
</div>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"fieldPrecision"
label=
"精度"
width=
"120"
align=
"center"
>
<
template
#
default=
"scope"
>
<span
v-if=
"!scope.row.isEdit || !editableFields.fieldPrecision"
>
{{
...
...
@@ -490,11 +570,19 @@ const cancelEdit = (row) => {
{{
scope
.
row
.
fieldValueRange
?
scope
.
row
.
fieldValueRange
.
replace
(
'#'
,
'-'
)
:
'--'
}}
</span>
<!-- 编辑模式,显示
两个
输入框 -->
<!-- 编辑模式,显示
不同的
输入框 -->
<div
v-else
style=
"display: flex; gap: 5px; align-items: center;"
>
<el-input
v-model=
"scope.row.rangeStart"
placeholder=
"最小值"
style=
"width: 45%;"
type=
"number"
clearable
/>
<!-- 判断字段类型并渲染对应的输入框 -->
<template
v-if=
"isSingleInput(scope.row.fieldType)"
>
<!-- 单文本框:字符型、大字段型、单字符型、JSON类型、布尔类型 -->
<el-input
v-model=
"scope.row.fieldValueRange"
placeholder=
"请输入"
clearable
/>
</
template
>
<
template
v-else
>
<!-- 双文本框:整型、日期型、日期时间型、时间戳、浮点型、一字节整型、时间类型 -->
<el-input
v-model=
"scope.row.startValue"
placeholder=
"请输入开始值"
style=
"width: 45%;"
clearable
/>
<span>
-
</span>
<el-input
v-model=
"scope.row.rangeEnd"
placeholder=
"最大值"
style=
"width: 45%;"
type=
"number"
clearable
/>
<el-input
v-model=
"scope.row.endValue"
placeholder=
"请输入结束值"
style=
"width: 45%;"
clearable
/>
</
template
>
</div>
</template>
</el-table-column>
...
...
src/views/data_inventory/dictionary.vue
View file @
ec74396
...
...
@@ -146,7 +146,7 @@ const orginItems = [
{
label
:
'字典中文名'
,
type
:
'input'
,
maxlength
:
5
0
,
maxlength
:
2
0
,
placeholder
:
'请输入'
,
field
:
'chName'
,
clearable
:
true
,
...
...
@@ -155,7 +155,7 @@ const orginItems = [
},
{
label
:
'字典英文名'
,
type
:
'input'
,
maxlength
:
5
0
,
maxlength
:
2
0
,
placeholder
:
'请输入'
,
field
:
'enName'
,
clearable
:
true
,
...
...
src/views/data_inventory/existingTableSelect.vue
View file @
ec74396
...
...
@@ -7,7 +7,7 @@ import Moment from 'moment';
import
{
getDsTableByDs
,
getDsData
,
getDsTableStructure
,
getDsTableStructure
s
,
}
from
"@/api/modules/dataInventory"
;
...
...
@@ -199,14 +199,14 @@ const getTableStructure = () => {
console
.
log
(
'tableName'
);
currDsTableStructureLoading
.
value
=
true
;
currDsTableStructure
.
value
=
[];
getDsTableStructure
(
{
getDsTableStructure
s
([
{
// tableName: tableName,
// dataSourceGuid: databaseInfo.value.guid,
// database: databaseInfo.value.databaseNameEn,
// databaseType: databaseInfo.value.databaseType,
tableGuid
:
currDatasourceSelect
.
value
.
tableGuid
,
execGuid
:
props
.
execGuid
}).
then
((
res
:
any
)
=>
{
}
]
).
then
((
res
:
any
)
=>
{
currDsTableStructureLoading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
currDsTableStructure
.
value
=
res
.
data
||
[];
...
...
@@ -438,6 +438,21 @@ const getTextAlign = (field) => {
<el-table-column
prop=
"fieldName"
label=
"字段英文名"
width=
"150px"
align=
"left"
header-align=
"left"
show-overflow-tooltip
>
</el-table-column>
<!-- 分类 -->
<el-table-column
prop=
"classifyDetailNameRoutes"
label=
"分类"
width=
"150px"
align=
"left"
header-align=
"left"
show-overflow-tooltip
>
<
template
#
default=
"scope"
>
{{
scope
.
row
[
'classifyDetailNameRoutes'
]
?
scope
.
row
[
'classifyDetailNameRoutes'
].
join
(
'/'
)
:
'--'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"gradeDetailName"
label=
"分级"
width=
"80px"
align=
"left"
header-align=
"left"
show-overflow-tooltip
>
<
template
#
default=
"scope"
>
<span>
{{
scope
.
row
[
'gradeDetailName'
]
??
'--'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"fieldChName"
label=
"字段名"
width=
"150px"
align=
"left"
header-align=
"left"
show-overflow-tooltip
>
<
template
#
default=
"scope"
>
...
...
@@ -472,9 +487,9 @@ const getTextAlign = (field) => {
<span>
{{
scope
.
row
[
'isPrimary'
]
??
'--'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"
isN
otNull"
label=
"是否必填"
width=
"100px"
align=
"left"
header-align=
"left"
<el-table-column
prop=
"
n
otNull"
label=
"是否必填"
width=
"100px"
align=
"left"
header-align=
"left"
show-overflow-tooltip
>
<
template
#
default=
"scope"
>
{{
scope
.
row
[
'
isNotNull'
]
===
'Y'
?
'N'
:
'Y
'
}}
</
template
>
<
template
#
default=
"scope"
>
{{
scope
.
row
[
'
notNull'
]
??
'--
'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"isFk"
label=
"是否外键"
width=
"100px"
align=
"left"
header-align=
"left"
show-overflow-tooltip
>
...
...
src/views/data_inventory/tableCreateFile.vue
View file @
ec74396
...
...
@@ -1459,7 +1459,7 @@ const saveTable = async () => {
gradeDetailName
:
item
.
gradeDetailName
,
guid
:
item
.
guid
,
isFk
:
item
.
isFk
,
notNull
:
item
.
isN
otNull
,
notNull
:
item
.
n
otNull
,
isPrimary
:
item
.
isPrimary
,
sortValue
:
item
.
sortValue
,
tableChName
:
addInfo
.
chName
,
...
...
@@ -1584,7 +1584,7 @@ const saveDraftTable = async () => {
gradeDetailName
:
item
.
gradeDetailName
,
guid
:
item
.
guid
,
isFk
:
item
.
isFk
,
isNotNull
:
item
.
isN
otNull
,
isNotNull
:
item
.
n
otNull
,
isPrimary
:
item
.
isPrimary
,
sortValue
:
item
.
sortValue
,
tableChName
:
addInfo
.
chName
,
...
...
src/views/data_product/productListing.vue
View file @
ec74396
...
...
@@ -16,6 +16,9 @@ import TableTools from "@/components/Tools/table_tools.vue";
import
Table
from
"@/components/Table/index.vue"
;
import
Dialog
from
"@/components/Dialog/index.vue"
;
import
{
getDamTypesList
}
from
"@/api/modules/dataAsset"
;
import
{
changeNum
,
}
from
"@/utils/common"
;
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
router
=
useRouter
();
...
...
@@ -226,6 +229,17 @@ const toPatn = (type) => {
});
}
}
const
toPatn1
=
(
type
,
type1
)
=>
{
if
(
type
==
'add'
)
{
router
.
push
({
name
:
"productListingDetail"
,
query
:
{
type
,
type1
},
});
}
}
const
tablePageChange
=
(
info
)
=>
{
page
.
value
.
curr
=
Number
(
info
.
curr
);
...
...
@@ -298,6 +312,16 @@ onBeforeMount(() => {
})
})
const
defaultItemLogo
=
new
URL
(
'@/assets/images/home-finance-product.png'
,
import
.
meta
.
url
).
href
const
demandListData
:
any
=
ref
([
{
companyName
:
'北数所'
,
listedNum
:
16
,
processNum
:
1235
},
{
companyName
:
'深数所'
,
listedNum
:
16
,
processNum
:
1235
},
{
companyName
:
'苏数所'
,
listedNum
:
16
,
processNum
:
1235
},
]);
const
btnClick
=
(
btn
)
=>
{
}
</
script
>
<
template
>
...
...
@@ -306,6 +330,32 @@ onBeforeMount(() => {
<TableTools
:searchItems=
"searchItemList"
:searchId=
"'data-source-search'"
@
search=
"toSearch"
/>
<div
class=
"tools_btns"
>
<el-button
type=
"primary"
@
click=
"toPatn('add')"
v-preReClick
>
新建
</el-button>
<el-button
type=
"primary"
@
click=
"toPatn1('add', 'add1')"
v-preReClick
>
新建
</el-button>
</div>
</div>
<div
class=
"list-content"
>
<div
class=
"card-content"
v-for=
"item in demandListData"
:key=
"item.guid"
>
<div
class=
"header"
>
<img
class=
"left-img"
:src=
"(item.picUrl && typeof item.picUrl == 'string') ? item.picUrl : defaultItemLogo"
alt=
""
/>
<div
class=
"right-main"
>
<div
class=
"title"
>
{{
item
.
companyName
??
'--'
}}
</div>
<div
class=
"count-group"
>
<div
class=
"count-item"
>
<div
class=
"item-label"
>
已上架产品数
</div>
<div
class=
"item-num"
>
{{
changeNum
(
item
.
listedNum
)
}}
</div>
</div>
<div
class=
"count-item"
>
<div
class=
"item-label"
>
审批中产品数
</div>
<div
class=
"item-num"
>
{{
changeNum
(
item
.
processNum
)
}}
</div>
</div>
</div>
</div>
</div>
<div
class=
"operator-btn"
>
<div
class=
"left-btn borderRight"
@
click=
"btnClick(item)"
>
更新模板
</div>
<div
class=
"left-btn"
@
click=
"btnClick(item)"
>
资产登记
</div>
</div>
</div>
</div>
<div
class=
"table_panel_wrap"
>
...
...
@@ -328,7 +378,87 @@ onBeforeMount(() => {
.table_panel_wrap
{
width
:
100%
;
height
:
calc
(
100%
-
84
px
);
height
:
calc
(
100%
-
270
px
);
padding
:
0px
8px
0
;
}
.list-content
{
display
:
flex
;
justify-content
:
space-between
;
flex-wrap
:
wrap
;
margin-bottom
:
8px
;
padding
:
0
8px
;
.card-content
{
width
:
calc
(
33.33%
-
10px
);
padding
:
16px
;
box-shadow
:
0
0
0
1px
#d9d9d9
;
.header
{
display
:
flex
;
margin-bottom
:
16px
;
img
{
width
:
80px
;
margin-right
:
16px
;
}
.title
{
font-size
:
16px
;
color
:
#212121
;
font-weight
:
600
;
margin-bottom
:
8px
;
}
.right-main
{
width
:
calc
(
100%
-
96px
);
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-between
;
.count-group
{
display
:
flex
;
justify-content
:
space-between
;
.item-num
{
font-size
:
20px
;
font-weight
:
600
;
color
:
#212121
;
margin-top
:
8px
;
}
}
}
}
.operator-btn
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
box-shadow
:
0
0
0
1px
#d9d9d9
;
position
:
relative
;
&::after
{
content
:
''
;
width
:
0
;
height
:
100%
;
border-left
:
1px
solid
#d9d9d9
;
position
:
absolute
;
left
:
50%
;
transform
:
translateX
(
-50%
);
}
>
.left-btn
{
width
:
50%
;
height
:
40px
;
line-height
:
40px
;
text-align
:
center
;
cursor
:
pointer
;
&:hover
{
color
:
#4fa1a4
;
}
}
}
}
}
</
style
>
...
...
src/views/data_product/productListingDetail.vue
View file @
ec74396
...
...
@@ -167,6 +167,17 @@ const formInfo = ref({
required
:
true
,
},
{
label
:
'证书编号'
,
type
:
'input'
,
maxlength
:
50
,
placeholder
:
'请输入'
,
field
:
'damCode'
,
default
:
''
,
disabled
:
true
,
required
:
true
,
visible
:
true
},
{
label
:
"数据时间范围"
,
type
:
"date-picker"
,
field
:
"dateRange"
,
...
...
@@ -194,16 +205,7 @@ const formInfo = ref({
// default: '',
// required: true
// },
// {
// label: '证书编号',
// type: 'input',
// maxlength: 50,
// placeholder: '请输入',
// field: 'damCode',
// default: '',
// disabled: true,
// required: true,
// },
{
label
:
'数据规模(条)'
,
type
:
'input'
,
...
...
@@ -360,25 +362,26 @@ const formInfo = ref({
// clearable: false,
// required: true,
// },
// {
// label: "上架交易所",
// type: "select",
// placeholder: "请选择",
// field: "exchangeGuids",
// default: [],
// options: exchangeList.value,
// props: {
// value: "guid",
// label: "tenantName",
// },
// filterable: true,
// clearable: true,
// multiple: true,
// tagsTooltip: true,
// collapse: true,
// disabled: false,
// required: true,
// },
{
label
:
"上架交易所"
,
type
:
"select"
,
placeholder
:
"请选择"
,
field
:
"exchangeGuids"
,
default
:
[],
options
:
exchangeList
.
value
,
props
:
{
value
:
"guid"
,
label
:
"tenantName"
,
},
filterable
:
true
,
clearable
:
true
,
multiple
:
true
,
tagsTooltip
:
true
,
collapse
:
true
,
disabled
:
false
,
required
:
true
,
visible
:
true
},
{
label
:
'产品描述'
,
type
:
'textarea-rich'
,
...
...
@@ -411,9 +414,125 @@ const formInfo = ref({
field
:
'productImg'
,
default
:
[],
limit
:
1
,
block
:
tru
e
,
block
:
fals
e
,
required
:
false
,
},
{
},
{
label
:
'登记证'
,
tip
:
'支持扩展名:.jpg .png .jpeg'
,
accept
:
'.jpg, .png, .jpeg '
,
type
:
'upload-file'
,
placeholder
:
'请选择'
,
field
:
'registerImg'
,
default
:
[],
limit
:
1
,
block
:
false
,
required
:
false
,
visible
:
true
},
{
label
:
'质量评估报告'
,
tip
:
'支持扩展名:.png .pdf'
,
accept
:
'.png, .pdf'
,
type
:
'upload-file'
,
placeholder
:
'请选择'
,
field
:
'qualityReport'
,
default
:
[],
limit
:
1
,
block
:
false
,
required
:
false
,
visible
:
true
},
{
label
:
"质量评估机构"
,
type
:
"select"
,
placeholder
:
"请选择"
,
field
:
"qualityOrg"
,
default
:
''
,
options
:
[],
props
:
{
value
:
'value'
,
label
:
'label'
},
filterable
:
true
,
clearable
:
true
,
disabled
:
false
,
required
:
true
,
visible
:
true
},
{
label
:
'价值评估报告'
,
tip
:
'支持扩展名:.png .pdf'
,
accept
:
'.png, .pdf'
,
type
:
'upload-file'
,
placeholder
:
'请选择'
,
field
:
'valueReport'
,
default
:
[],
limit
:
1
,
block
:
false
,
required
:
false
,
visible
:
true
},
{
label
:
"价值评估机构"
,
type
:
"select"
,
placeholder
:
"请选择"
,
field
:
"valueOrg"
,
default
:
''
,
options
:
[],
props
:
{
value
:
'value'
,
label
:
'label'
},
filterable
:
true
,
clearable
:
true
,
disabled
:
false
,
required
:
true
,
visible
:
true
},
{
label
:
'承诺函'
,
tip
:
'支持扩展名:.png .pdf'
,
accept
:
'.png, .pdf'
,
type
:
'upload-file'
,
placeholder
:
'请选择'
,
field
:
'commitment'
,
templateUrl
:
'http://www.baidu.com'
,
default
:
[],
limit
:
1
,
block
:
true
,
required
:
true
,
visible
:
true
},
{
label
:
'授权文件'
,
tip
:
'支持扩展名:.png .pdf'
,
accept
:
'.png, .pdf'
,
type
:
'upload-file'
,
placeholder
:
'请选择'
,
field
:
'authorization'
,
templateUrl
:
'http://www.baidu.com'
,
default
:
[],
limit
:
1
,
block
:
true
,
required
:
true
,
visible
:
true
},
{
label
:
'商品详细介绍(签章版)'
,
tip
:
'支持扩展名:.png .pdf'
,
accept
:
'.png, .pdf'
,
type
:
'upload-file'
,
placeholder
:
'请选择'
,
field
:
'productDetail'
,
templateUrl
:
'http://www.baidu.com'
,
default
:
[],
limit
:
1
,
block
:
true
,
required
:
true
,
visible
:
true
},
{
label
:
""
,
type
:
"input"
,
placeholder
:
"请输入"
,
...
...
@@ -996,6 +1115,14 @@ onActivated(() => {
};
})
onBeforeMount
(()
=>
{
if
(
route
.
query
.
type
==
'add'
&&
!
route
.
query
.
type1
)
{
formInfo
.
value
.
items
.
forEach
(
item
=>
{
if
(
item
.
field
==
'damCode'
||
item
.
field
==
'exchangeGuids'
||
item
.
field
==
'registerImg'
||
item
.
field
==
'qualityReport'
||
item
.
field
==
'qualityOrg'
||
item
.
field
==
'valueReport'
||
item
.
field
==
'valueOrg'
||
item
.
field
==
'commitment'
||
item
.
field
==
'authorization'
||
item
.
field
==
'productDetail'
)
{
item
.
visible
=
false
;
}
})
}
getParentAreaPromise
.
value
=
getAreaData
({
parentId
:
null
}).
then
((
res
:
any
)
=>
{
if
(
res
?.
code
==
proxy
.
$passCode
)
{
parentAreaData
.
value
=
res
.
data
??
[];
...
...
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