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
8b4dcca9
authored
2025-12-05 18:03:01 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
数据使用接口联调
1 parent
d65fd3dc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
5 deletions
src/api/modules/dataDelivery.ts
src/views/data_asset/dataUsage.vue
src/views/data_asset/registerCatalogDetail.vue
src/api/modules/dataDelivery.ts
View file @
8b4dcca
...
...
@@ -46,3 +46,17 @@ export const deleteDataUse = (params) => request({
method
:
'delete'
,
data
:
params
});
/** 下载数据 */
export
const
downloadTableData
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_DIGITAL_CONTRACT_URL
}
/contract-use/download?userGuid=
${
params
.
userGuid
}
&subjectGuid=
${
params
.
subjectGuid
}
`
,
method
:
'get'
,
responseType
:
'blob'
});
/** 分发连接器 */
export
const
distributeContract
=
(
params
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_DIGITAL_CONTRACT_URL
}
/contract-use/distribute`
,
method
:
'post'
,
data
:
params
})
\ No newline at end of file
...
...
src/views/data_asset/dataUsage.vue
View file @
8b4dcca
...
...
@@ -4,6 +4,7 @@ import { commonPageConfig, TableColumnWidth } from '@/utils/enum';
import
{
getDataUsePageList
,
deleteDataUse
,
distributeContract
,
}
from
"@/api/modules/dataDelivery"
;
import
{
useValidator
}
from
"@/hooks/useValidator"
;
...
...
@@ -114,7 +115,7 @@ const btnHanldesMap = {
guid
:
scope
.
row
.
dataProductGuid
,
type
:
'detail'
,
foundMode
:
'read'
,
name
:
scope
.
row
.
dataProductName
,
name
:
scope
.
row
.
dataProductName
}
});
},
...
...
@@ -126,6 +127,7 @@ const btnHanldesMap = {
type
:
'detail'
,
foundMode
:
'download'
,
name
:
scope
.
row
.
dataProductName
,
useGuid
:
scope
.
row
.
guid
}
});
},
...
...
@@ -222,12 +224,14 @@ const templateFormItems = ref([{
},
filterable
:
true
,
multiple
:
true
,
collapse
:
true
,
tagsTooltip
:
true
,
clearable
:
true
,
required
:
true
}]);
const
templateFormRules
=
ref
({
tenantGuids
:
[
required
(
'请选择分发连接器'
)
]
tenantGuids
:
[
{
required
:
true
,
trigger
:
'change'
,
message
:
"请选择分发连接器"
}
]
});
const
tenantDialogInfo
=
ref
({
...
...
@@ -244,8 +248,18 @@ const tenantDialogInfo = ref({
btns
:
{
submit
:
(
btn
,
info
)
=>
{
tenantDialogInfo
.
value
.
submitBtnLoading
=
true
;
distributeContract
({
useGuid
:
currTableData
.
value
.
guid
,
nodeGuid
:
info
.
tenantGuids
}).
then
((
res
:
any
)
=>
{
tenantDialogInfo
.
value
.
submitBtnLoading
=
false
;
if
(
res
?.
code
==
proxy
.
$passCode
)
{
tenantDialogInfo
.
value
.
visible
=
false
;
proxy
.
$ElMessage
.
success
(
'分发连接器提交成功'
);
}
else
{
res
?.
msg
&&
proxy
.
$ElMessage
.
error
(
res
?.
msg
)
}
})
},
cancel
:
()
=>
{
tenantDialogInfo
.
value
.
visible
=
false
;
...
...
src/views/data_asset/registerCatalogDetail.vue
View file @
8b4dcca
...
...
@@ -22,13 +22,16 @@ import {
import
{
apiTypes
}
from
"@/api/modules/dataService"
;
import
{
changeNum
}
from
'@/utils/common'
import
{
changeNum
,
download
}
from
'@/utils/common'
import
{
ElMessage
,
ElMessageBox
}
from
"element-plus"
;
import
{
passFlowData
,
rejectFlowData
,
revokeFlowData
,
isMyFirstNode
}
from
"@/api/modules/workFlowService"
;
import
{
onUploadFilePreview
,
onUploadFileDownload
}
from
'@/api/modules/common'
;
import
{
CircleCloseFilled
}
from
'@element-plus/icons-vue'
import
useDataAssetStore
from
"@/store/modules/dataAsset"
;
import
{
TableColumnWidth
}
from
'@/utils/enum'
;
import
{
downloadTableData
}
from
"@/api/modules/dataDelivery"
;
const
router
=
useRouter
();
const
route
=
useRoute
();
...
...
@@ -447,7 +450,16 @@ const handleTableViewData = (scope) => {
/** 下载数据 */
const handleTableViewDataDown = (scope) => {
//TODO
downloadTableData({
userGuid: route.query.useGuid,
subjectGuid: scope.row.guid
}).then((res: any) => {
if (res && !res.msg) {
download(res, `
$
{
scope
.
row
.
tableChName
}.
xlsx
`, 'excel');
} else {
res?.msg && ElMessage.error(res?.msg);
}
})
}
const toolBtns: any = computed(() => {
...
...
@@ -1475,6 +1487,7 @@ const respParamsTableInfo = ref({
<el-table-column
label=
"操作"
v-if=
"!detailInfo?.nodeId || foundMode == 'download'"
minWidth=
"120px"
align=
"left"
fixed=
"right"
show-overflow-tooltip
>
<
template
#
default=
"scope"
>
<span
class=
"text_btn"
@
click=
"handleTableViewData(scope)"
>
查看样例数据
</span>
<el-divider
direction=
"vertical"
/>
<span
class=
"text_btn"
@
click=
"handleTableViewDataDown(scope)"
>
下载数据
</span>
</
template
>
</el-table-column>
...
...
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