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
9eaaa709
authored
2025-06-25 16:14:17 +0800
by
fanguang
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
元数据标准
1 parent
0d6d9f78
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
8 deletions
src/api/modules/dataMetaService.ts
src/router/modules/dataMeta.ts
src/views/data_meta/components/standardFieldsDialog.vue
src/views/data_meta/standard-codetable.vue
src/views/data_meta/standard-meta-import.vue
src/views/data_meta/standard.vue
src/api/modules/dataMetaService.ts
View file @
9eaaa70
...
...
@@ -365,6 +365,13 @@ export const deleteMetaStandardDataFields = (params) => request({
method
:
'delete'
,
data
:
params
})
/** 元数据标准-导出 */
export
const
exportMetaStandardData
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/meta-standard/data/data-export`
,
method
:
'post'
,
data
:
params
,
responseType
:
'blob'
})
/** 标准代码-树形表 */
export
const
getStandardCodeTree
=
()
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_STANDARD_URL
}
/standard-code/code-tree`
,
...
...
src/router/modules/dataMeta.ts
View file @
9eaaa70
...
...
@@ -240,6 +240,17 @@ const routes: RouteRecordRaw[] = [
cache
:
true
,
activeMenu
:
'/data-meta/metadata-standard/standard-codetable'
}
},
{
path
:
'standard-meta-import'
,
name
:
'standardMetaImport'
,
component
:
()
=>
import
(
'@/views/data_meta/standard-meta-import.vue'
),
meta
:
{
title
:
'元数据标准导入'
,
breadcrumb
:
false
,
cache
:
true
,
activeMenu
:
'/data-meta/metadata-standard'
}
}
]
}
...
...
src/views/data_meta/components/standardFieldsDialog.vue
View file @
9eaaa70
...
...
@@ -7,7 +7,7 @@
>
<el-form
:model=
"form"
:rules=
"formRules"
ref=
"formEl"
style=
"min-height: 200px;"
>
<el-row>
<el-col
v-for=
"item,index in fields"
:key=
"index"
:span=
"12"
style=
"padding-right:10px"
>
<el-col
v-for=
"item,index in fields"
:key=
"index"
:span=
"12"
style=
"padding-right:10px
;margin-bottom:10px;
"
>
<el-form-item
:label=
"item.fileNameCodeName"
:prop=
"item.fileNameCode"
>
<el-input
v-if=
"item.inputTypeCode == '1' || item.inputTypeCode == '3'"
...
...
@@ -20,10 +20,17 @@
filterable
clearable
placeholder=
"请选择"
size=
"small"
>
<el-option
v-for=
"op in formOptions[item.fileNameCode]"
:label=
"op.label"
:value=
"op.value"
:key=
"op.value"
></el-option>
</el-select>
<el-tree-select
v-else-if=
"item.inputTypeCode == '4'"
v-model=
"form[item.fileNameCode]"
:data=
"standardCodeTree"
:props=
"treeSelectProps"
placeholder=
"请选择"
/>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -39,7 +46,7 @@
import
{
watch
}
from
'vue'
import
{
ElMessage
}
from
"element-plus"
;
import
{
getParamsList
}
from
'@/api/modules/dataAsset'
import
{
saveMetaStandardDataFields
,
getMetaStandardFieldDetail
}
from
'@/api/modules/dataMetaService'
import
{
saveMetaStandardDataFields
,
getMetaStandardFieldDetail
,
getStandardCodeTree
}
from
'@/api/modules/dataMetaService'
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
props
=
defineProps
({
...
...
@@ -152,6 +159,30 @@ function confirm () {
})
}
const
standardCodeTree
=
ref
([])
const
treeSelectProps
=
{
label
:
'name'
,
value
:
'guid'
,
isLeaf
:
'isCode'
}
function
getStandardCodeTreeList
()
{
getStandardCodeTree
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
const
data
=
res
.
data
data
.
forEach
(
item
=>
{
if
(
item
.
children
)
{
item
.
children
.
forEach
(
subItem
=>
{
// 二级的标准名字作为key
subItem
.
guid
=
subItem
.
name
// subItem.value = subItem.name
})
}
})
standardCodeTree
.
value
=
data
}
})
}
watch
(
()
=>
visible
.
value
,
(
v
)
=>
{
...
...
@@ -159,6 +190,10 @@ watch(
initForm
()
}
)
onBeforeMount
(()
=>
{
getStandardCodeTreeList
()
})
</
script
>
<
style
lang=
"scss"
>
...
...
src/views/data_meta/standard-codetable.vue
View file @
9eaaa70
...
...
@@ -16,7 +16,7 @@ import { getParamsList } from '@/api/modules/dataAsset'
import
{
getStandardCodeList
,
saveStandardCode
,
updateStandardCode
,
getStandardCodeDetail
,
deleteStandardCode
,
getStandardCodeStandard
,
exportStandardCodeData
,
getStandardCodeDataList
getStandardCodeDataList
,
getStandardCodeTree
}
from
'@/api/modules/dataMetaService'
import
{
addDictionary
,
...
...
@@ -1440,8 +1440,30 @@ const radioGroupChange = async (val, info) => {
}
}
function
initTree
()
{
Promise
.
all
([
getParamsList
({
dictType
:
'标准类型'
}),
getStandardCodeTree
()]).
then
((
resList
:
any
)
=>
{
let
treeRoot
=
resList
[
0
].
data
||
[]
let
treeData
=
resList
[
1
].
data
||
[]
console
.
log
(
'treeRoot'
,
treeRoot
)
console
.
log
(
'treeData'
,
treeData
)
let
tree
=
treeRoot
.
map
(
item
=>
{
let
obj
:
any
=
{}
obj
.
treeLevel
=
1
obj
.
guid
=
item
.
value
obj
.
name
=
item
.
label
let
target
=
treeData
.
find
(
v
=>
v
.
guid
===
item
.
value
)
obj
.
children
=
target
?
target
.
children
:
null
return
obj
})
// standardOptions.value = treeRoot
// treeInfo.value.data = tree
// nodeClick(tree[0])
})
}
onBeforeMount
(()
=>
{
// getDataType()
// initTree()
getTreeData
().
then
(()
=>
{
// 默认展开第一个
let
data
=
treeInfo
.
value
.
data
...
...
src/views/data_meta/standard-meta-import.vue
0 → 100644
View file @
9eaaa70
This diff is collapsed.
Click to expand it.
src/views/data_meta/standard.vue
View file @
9eaaa70
...
...
@@ -15,7 +15,7 @@ import { download } from '@/utils/common'
import
{
getParamsList
}
from
'@/api/modules/dataAsset'
import
{
getMetaStandardTree
,
deleteMetaStandard
,
getMetaStandardDataList
,
getMetaStandardDataFields
,
deleteMetaStandardDataFields
deleteMetaStandardDataFields
,
exportMetaStandardData
}
from
'@/api/modules/dataMetaService'
import
router
from
'@/router'
import
{
TableColumnWidth
}
from
'@/utils/enum'
;
...
...
@@ -52,8 +52,9 @@ const treeInfo = ref({
function
nodeClick
(
data
)
{
console
.
log
(
'nodeData'
,
data
)
treeInfo
.
value
.
currentObj
=
data
getFirstPageData
()
if
(
data
.
level
==
1
)
return
getTableFields
()
getFirstPageData
()
}
function
treeCustomClick
(
node
,
type
)
{
console
.
log
(
node
,
type
)
...
...
@@ -79,6 +80,7 @@ function getTree () {
let
data
=
res
.
data
||
[]
data
.
forEach
(
item
=>
{
item
.
showEdit
=
true
item
.
level
=
1
})
treeInfo
.
value
.
data
=
data
treeInfo
.
value
.
expandedKey
=
[
data
[
0
].
guid
]
...
...
@@ -377,6 +379,40 @@ function openStandardFieldsDialog (type, data = {}) {
standardFieldsDialog
.
visible
=
true
}
function
importData
()
{
let
currentTreeObj
:
any
=
treeInfo
.
value
.
currentObj
console
.
log
(
'currentTree'
,
currentTreeObj
)
let
uploadSetting
:
any
=
[]
if
(
currentTreeObj
.
children
)
{
uploadSetting
=
currentTreeObj
.
children
.
map
((
item
:
any
)
=>
{
return
{
standardName
:
item
.
standardName
,
standardGuid
:
item
.
guid
}
})
}
else
{
uploadSetting
=
[{
standardName
:
currentTreeObj
.
standardName
,
standardGuid
:
currentTreeObj
.
guid
}]
}
cacheStore
.
setCatch
(
'uploadSetting'
,
uploadSetting
)
router
.
push
({
path
:
'/data-meta/metadata-standard/standard-meta-import'
,
});
}
function
exportData
()
{
let
body
=
[
treeInfo
.
value
.
currentObj
.
guid
]
exportMetaStandardData
(
body
).
then
((
res
:
any
)
=>
{
if
(
res
&&
!
res
.
msg
)
{
download
(
res
,
'元数据标准表.xlsx'
,
'excel'
)
}
else
{
res
?.
msg
&&
ElMessage
.
error
(
res
?.
msg
);
}
})
}
onBeforeMount
(()
=>
{
getTree
()
})
...
...
@@ -412,8 +448,8 @@ const viewGraph = () => {
<div
class=
"table_tool_wrap"
>
<div
class=
"tools_btns"
>
<el-button
type=
"primary"
@
click=
"() => openStandardFieldsDialog('add')"
v-preReClick
>
新建
</el-button>
<el-button
@
click=
"
batching('export')
"
v-preReClick
>
导入
</el-button>
<el-button
@
click=
"
batching('delete')
"
v-preReClick
>
导出
</el-button>
<el-button
@
click=
"
importData
"
v-preReClick
>
导入
</el-button>
<el-button
@
click=
"
exportData
"
v-preReClick
>
导出
</el-button>
<el-button
@
click=
"viewGraph"
v-preReClick
>
查看
</el-button>
</div>
<el-input
class=
"table_search_input"
v-model
.
trim=
"tableSearchInput"
placeholder=
"请输入关键字搜索"
...
...
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