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
3b595223
authored
2026-04-02 11:31:31 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
逻辑空间审批接口联调
1 parent
e3e635a4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
675 additions
and
205 deletions
src/router/modules/dataAsset.ts
src/views/data_asset/productSpaceDetail.vue
src/views/data_asset/productSpaceEdit.vue
src/views/data_asset/productSpaceManageList.vue
src/router/modules/dataAsset.ts
View file @
3b59522
...
...
@@ -456,7 +456,7 @@ const routes: RouteRecordRaw[] = [
{
path
:
''
,
name
:
'productSpaceManage'
,
component
:
()
=>
import
(
'@/views/data_asset/productSpaceManage.vue'
),
component
:
()
=>
import
(
'@/views/data_asset/productSpaceManage
List
.vue'
),
meta
:
{
title
:
''
,
sidebar
:
false
,
...
...
src/views/data_asset/productSpaceDetail.vue
View file @
3b59522
<
template
>
<div
class=
"container_wrap full"
v-loading=
"fullscreenLoading"
>
<div
class=
"content_main"
>
<div
v-if=
"detailInfo.bizApproveState"
:class=
"['panel_wrap', 'mb16', 'results_panel', detailInfo.bizApproveState == 'Y' ? 'success' : ((detailInfo.bizApproveState == 'R' || detailInfo.bizApproveState == 'E') ? 'reject' : (detailInfo.bizApproveState == 'C' ? 'revoke' : 'audit'))]"
>
<div
class=
"panel_header"
>
<div
class=
"header_title"
v-if=
"detailInfo.bizApproveState == 'Y'"
>
<el-icon
class=
"title-icon"
>
<svg-icon
name=
"icon-success"
/>
</el-icon>
<span
class=
"title_text"
>
审批通过
</span>
</div>
<div
class=
"header_title"
v-else-if=
"detailInfo.bizApproveState == 'R'"
>
<el-icon
class=
"title-icon"
>
<CircleCloseFilled
/>
</el-icon>
<span
class=
"title_text"
>
审批被驳回
</span>
</div>
<div
class=
"header_title"
v-else-if=
"detailInfo.bizApproveState == 'E'"
>
<el-icon
class=
"title-icon"
>
<CircleCloseFilled
/>
</el-icon>
<span
class=
"title_text"
>
审批发起失败
</span>
</div>
<div
class=
"header_title"
v-else-if=
"detailInfo.bizApproveState == 'A'"
>
<el-icon
class=
"title-icon"
>
<svg-icon
name=
"icon-audit"
/>
</el-icon>
<span
class=
"title_text"
>
审批中
</span>
</div>
<div
class=
"header_title"
v-else-if=
"detailInfo.bizApproveState == 'C'"
>
<el-icon
class=
"title-icon"
>
<svg-icon
name=
"icon-revoke"
/>
</el-icon>
<span
class=
"title_text"
>
已撤销
</span>
</div>
</div>
<div
class=
"panel_body"
v-if=
"detailInfo.bizApproveState == 'R'"
style=
"padding: 0px 16px 10px;"
>
<div
class=
"results_list"
>
<div
class=
"list_item"
>
<span
class=
"item_label"
>
平台审批意见:
</span>
<span
class=
"item_value"
>
{{
detailInfo
?.
tdsApproveSuggest
||
'--'
}}
</span>
</div>
</div>
</div>
<div
class=
"panel_body"
v-if=
"detailInfo.bizApproveState == 'E'"
style=
"padding: 0px 16px 10px;"
>
<div
class=
"results_list"
>
<div
class=
"list_item"
>
<span
class=
"item_label"
>
失败原因:
</span>
<span
class=
"item_value"
>
{{
detailInfo
?.
tdsApproveErrorMsg
||
'--'
}}
</span>
</div>
</div>
</div>
</div>
<ContentWrap
id=
"id-baseInfo"
title=
"逻辑空间信息"
description=
""
:isExpand=
"baseInfoExpand"
:expand-swicth=
"true"
class=
"mb16"
@
expand=
"(v) => baseInfoExpand = v"
>
<div
class=
"list_panel"
>
...
...
@@ -92,12 +41,12 @@
</el-tabs>
</ContentWrap>
<!-- 只有可信空间才有流程审批,连接器是提交给可信空间审批的 -->
<
!--
<
ContentWrap
id=
"id-approveInfo"
title=
"流程审批"
expandSwicth
style=
"margin-top: 15px"
:isExpand=
"expandApprove"
<ContentWrap
id=
"id-approveInfo"
title=
"流程审批"
expandSwicth
style=
"margin-top: 15px"
:isExpand=
"expandApprove"
@
expand=
"(v) => expandApprove = v"
>
<ApprovalProcess
ref=
"approvalProcessRef"
v-if=
"deploymentId"
:deploymentId=
"deploymentId"
:processInstanceId=
"processInstanceId"
>
</ApprovalProcess>
</ContentWrap>
-->
</ContentWrap>
</div>
<div
class=
"tool_btns"
>
<div
class=
"btns"
>
...
...
@@ -105,6 +54,8 @@
}}
</el-button>
</div>
</div>
<Dialog
:dialogInfo=
"passDialogInfo"
@
btnClick=
"passDialogBtnClick"
/>
<Dialog
:dialogInfo=
"rejectDialogInfo"
@
btnClick=
"rejectDialogBtnClick"
/>
</div>
</
template
>
...
...
@@ -114,13 +65,17 @@ import StrategyTable from "../data_smart_contract/components/strategyTable.vue";
import
{
TableColumnWidth
}
from
"@/utils/enum"
;
import
{
CircleCloseFilled
}
from
"@element-plus/icons-vue"
;
import
{
getLogicSpaceDetail
}
from
"@/api/modules/dataAsset"
;
import
{
ElMessage
,
ElMessageBox
}
from
"element-plus"
;
import
useDataProductSpaceStore
from
"@/store/modules/productSpace"
;
import
{
passFlowData
,
rejectFlowData
,
revokeFlowData
}
from
"@/api/modules/workFlowService"
;
const
productSpaceStore
=
useDataProductSpaceStore
();
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
userStore
=
useUserStore
();
const
route
=
useRoute
();
const
router
=
useRouter
();
const
fullPath
=
route
.
fullPath
;
const
userData
=
JSON
.
parse
(
localStorage
.
userData
)
const
fullscreenLoading
=
ref
(
false
);
const
baseInfoExpand
=
ref
(
true
);
...
...
@@ -133,22 +88,202 @@ const detailInfo: any = ref({});
/** 页签当前活跃的有成员权限和策略配置 */
const
activeTabName
=
ref
(
'member'
);
const
approvalProcessRef
=
ref
();
/** 调用更新详情状态,关闭之后,需要重新刷新列表 */
const
updateDetailStatus
=
ref
(
false
);
const
passDialogInfo
=
ref
({
visible
:
false
,
size
:
460
,
direction
:
"column"
,
header
:
{
title
:
"通过"
,
},
type
:
''
,
contents
:
[
{
type
:
'form'
,
title
:
''
,
formInfo
:
{
id
:
'batch-pass-form'
,
items
:
[
{
label
:
''
,
type
:
"textarea"
,
placeholder
:
"请填写通过理由(非必填)"
,
field
:
"approveSuggest"
,
clearable
:
true
,
block
:
true
,
col
:
'margin_b_0'
,
}
]
}
}
],
footer
:
{
btns
:
[
{
type
:
"default"
,
label
:
"取消"
,
value
:
"cancel"
},
{
type
:
"primary"
,
label
:
"确定"
,
value
:
"submit"
,
loading
:
false
},
],
},
});
const
passDialogBtnClick
=
(
btn
,
info
)
=>
{
if
(
btn
.
value
==
'submit'
)
{
passDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
true
;
let
params
=
{
guid
:
detailInfo
.
value
.
approveVO
.
approveGuid
,
flowType
:
detailInfo
.
value
.
approveVO
.
flowType
,
approveSuggest
:
info
.
approveSuggest
,
approveStaffGuid
:
userData
.
staffGuid
,
}
passFlowData
(
params
).
then
((
res
:
any
)
=>
{
passDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
false
;
if
(
res
?.
code
==
proxy
.
$passCode
)
{
if
(
res
.
data
)
{
passDialogInfo
.
value
.
visible
=
false
;
getDetail
();
updateDetailStatus
.
value
=
true
;
approvalProcessRef
.
value
?.
renderProcessNodes
();
}
else
{
proxy
.
$ElMessage
.
error
(
'审批失败'
);
}
}
else
{
proxy
.
$ElMessage
.
error
(
res
.
msg
);
}
}).
catch
(()
=>
{
passDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
false
;
});
}
else
if
(
btn
.
value
==
'cancel'
)
{
passDialogInfo
.
value
.
visible
=
false
;
}
};
const
rejectDialogInfo
=
ref
({
visible
:
false
,
size
:
460
,
direction
:
"column"
,
header
:
{
title
:
"驳回"
,
},
type
:
''
,
contents
:
[
{
type
:
'form'
,
title
:
''
,
formInfo
:
{
id
:
'batch-reject-form'
,
items
:
[
{
label
:
''
,
type
:
"textarea"
,
placeholder
:
"请填写驳回理由(必填)"
,
field
:
"approveSuggest"
,
clearable
:
true
,
block
:
true
,
col
:
'margin_b_0'
,
}
],
}
}
],
footer
:
{
btns
:
[
{
type
:
"default"
,
label
:
"取消"
,
value
:
"cancel"
},
{
type
:
"primary"
,
label
:
"确定"
,
value
:
"submit"
,
loading
:
false
},
],
},
});
const
rejectDialogBtnClick
=
(
btn
,
info
)
=>
{
if
(
btn
.
value
==
'submit'
)
{
if
(
info
.
approveSuggest
==
''
)
{
proxy
.
$ElMessage
.
error
(
'请填写驳回理由'
);
return
}
rejectDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
true
;
let
params
=
{
guid
:
detailInfo
.
value
.
approveVO
.
approveGuid
,
flowType
:
detailInfo
.
value
.
approveVO
.
flowType
,
approveSuggest
:
info
.
approveSuggest
,
approveStaffGuid
:
userData
.
staffGuid
,
}
rejectFlowData
(
params
).
then
((
res
:
any
)
=>
{
rejectDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
false
;
if
(
res
?.
code
==
proxy
.
$passCode
)
{
if
(
res
.
data
)
{
proxy
.
$ElMessage
.
success
(
'驳回成功'
);
rejectDialogInfo
.
value
.
visible
=
false
;
getDetail
();
updateDetailStatus
.
value
=
true
;
approvalProcessRef
.
value
?.
renderProcessNodes
();
}
else
{
proxy
.
$ElMessage
.
error
(
'驳回失败'
);
}
}
else
{
proxy
.
$ElMessage
.
error
(
res
.
msg
);
}
}).
catch
(()
=>
{
rejectDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
false
;
});
}
else
if
(
btn
.
value
==
'cancel'
)
{
rejectDialogInfo
.
value
.
visible
=
false
;
}
};
const
toolBtns
:
any
=
computed
(()
=>
{
let
btnsArr
:
any
=
[{
label
:
"关闭"
,
value
:
"cancel"
,
plain
:
true
}];
// TODO,资产运营平台TODO
let
approveVO
=
detailInfo
.
value
.
approveVO
;
let
staffGuid
=
userData
.
staffGuid
;
if
(
approveVO
&&
approveVO
.
approveState
==
'A'
&&
approveVO
.
approveStaffGuids
&&
approveVO
.
approveStaffGuids
.
indexOf
(
staffGuid
)
>
-
1
)
{
btnsArr
.
push
(...[{
label
:
"通过"
,
value
:
"pass"
,
type
:
'primary'
},
{
label
:
"驳回"
,
value
:
"reject"
,
type
:
'danger'
,
plain
:
true
}]);
}
if
(
approveVO
&&
approveVO
.
approveState
==
'A'
&&
approveVO
.
staffGuid
==
staffGuid
&&
!
detailInfo
.
value
.
nodeId
)
{
btnsArr
.
push
({
label
:
"撤销"
,
value
:
"revoke"
});
}
return
btnsArr
;
});
const
btnClick
=
(
btn
:
any
)
=>
{
switch
(
btn
.
value
)
{
case
'cancel'
:
cancel
();
break
;
default
:
break
;
const
type
=
btn
.
value
;
if
(
type
===
'pass'
)
{
passDialogInfo
.
value
.
visible
=
true
;
}
else
if
(
type
==
'reject'
)
{
rejectDialogInfo
.
value
.
visible
=
true
;
}
else
if
(
type
==
'cancel'
)
{
cancel
();
updateDetailStatus
.
value
&&
productSpaceStore
.
setIsRefresh
(
true
);
}
else
if
(
type
==
'revoke'
)
{
ElMessageBox
.
confirm
(
'确定撤销该连接器审批流程吗?'
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
'warning'
,
}).
then
(()
=>
{
let
params
=
{
guid
:
detailInfo
.
value
.
approveVO
.
approveGuid
,
flowType
:
detailInfo
.
value
.
approveVO
.
flowType
,
approveStaffGuid
:
userData
.
staffGuid
,
}
revokeFlowData
(
params
,
detailInfo
.
value
.
tenantGuid
).
then
((
res
:
any
)
=>
{
if
(
res
?.
code
==
proxy
.
$passCode
)
{
if
(
res
.
data
)
{
ElMessage
.
success
(
'该审批流程撤销成功!'
);
getDetail
();
updateDetailStatus
.
value
=
true
;
approvalProcessRef
.
value
?.
renderProcessNodes
();
}
else
{
ElMessage
.
error
(
'该审批流程撤销失败!'
);
}
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
}).
catch
(()
=>
{
});
}).
catch
(()
=>
{
ElMessage
.
info
(
'已取消撤销'
);
});
}
}
...
...
@@ -159,17 +294,23 @@ const cancel = () => {
});
}
onBeforeMount
(
()
=>
{
const
getDetail
=
()
=>
{
fullscreenLoading
.
value
=
true
;
getLogicSpaceDetail
({
guid
:
route
.
query
.
guid
}).
then
((
res
:
any
)
=>
{
fullscreenLoading
.
value
=
false
;
if
(
res
?.
code
==
proxy
.
$passCode
)
{
detailInfo
.
value
=
res
.
data
||
{};
deploymentId
.
value
=
res
.
data
?.
approveVO
?.
camundaDeploymentId
processInstanceId
.
value
=
res
.
data
?.
approveVO
?.
camundaInstanceId
memberTableInfo
.
value
.
data
=
detailInfo
.
value
.
permissionRSVOS
||
[];
}
else
{
res
?.
msg
&&
proxy
.
$ElMessage
.
error
(
res
.
msg
);
}
})
}
onBeforeMount
(()
=>
{
getDetail
();
})
const
memberTableInfo
=
ref
({
...
...
@@ -178,9 +319,11 @@ const memberTableInfo = ref({
fields
:
[
{
label
:
"序号"
,
type
:
"index"
,
width
:
TableColumnWidth
.
INDEX
,
align
:
"center"
},
{
label
:
"成员名称"
,
field
:
"memberName"
,
width
:
200
},
{
label
:
"角色类型"
,
field
:
"characterType"
,
width
:
160
,
getName
:
(
scope
)
=>
{
return
!
scope
.
row
.
characterType
?
'--'
:
(
scope
.
row
.
characterType
==
'1'
?
'数据使用方'
:
'数据提供方'
)
}
},
{
label
:
"角色类型"
,
field
:
"characterType"
,
width
:
160
,
getName
:
(
scope
)
=>
{
return
!
scope
.
row
.
characterType
?
'--'
:
(
scope
.
row
.
characterType
==
'1'
?
'数据使用方'
:
'数据提供方'
)
}
},
{
label
:
"描述"
,
field
:
"description"
,
width
:
300
},
],
data
:
[],
...
...
@@ -267,134 +410,4 @@ const memberTableInfo = ref({
}
}
.panel_wrap
{
.panel_header
{
.header_title
{
height
:
40px
;
padding
:
0
16px
;
background-color
:
#fafafa
;
box-shadow
:
0
0
0
1px
#e5e5e5
;
display
:
flex
;
align-items
:
center
;
}
.title_text
{
line-height
:
22px
;
font-size
:
14px
;
color
:
var
(
--el-color-regular
);
font-weight
:
600
;
display
:
flex
;
align-items
:
center
;
.title_icon
{
width
:
26px
;
height
:
21px
;
margin-right
:
4px
;
cursor
:
pointer
;
&.active
{
transform
:
rotate
(
90deg
);
}
}
}
}
&
.results_panel
{
box-shadow
:
0
0
0
1px
#d9d9d9
;
.panel_header
{
.header_title
{
background-color
:
transparent
;
box-shadow
:
none
;
.el-icon
{
margin-right
:
8px
;
width
:
20px
;
height
:
20px
;
svg
{
width
:
100%
;
height
:
100%
;
}
}
}
}
.panel_body
{
padding-top
:
0
;
margin-top
:
0
;
box-shadow
:
none
;
.results_list
{
display
:
flex
;
.list_item
{
display
:
flex
;
margin-bottom
:
8px
;
margin-right
:
60px
;
color
:
#666
;
.item_value
{
padding
:
0
8px
;
color
:
var
(
--el-color-regular
);
}
}
}
}
&
.success
{
background-color
:
#F4FEF6
;
box-shadow
:
0
0
0
1px
#4FA55D
;
.panel_header
{
.header_title
{
.el-icon
{
color
:
#4FA55D
;
}
}
}
}
&
.reject
{
background-color
:
#FDF2F4
;
box-shadow
:
0
0
0
1px
#E63E33
;
.panel_header
{
.header_title
{
.el-icon
{
color
:
#E63E33
;
}
}
}
}
&
.audit
{
background-color
:
#FEFBF3
;
box-shadow
:
0
0
0
1px
#F19E40
;
.panel_header
{
.header_title
{
.el-icon
{
color
:
#F19E40
;
}
}
}
}
&
.revoke
{
background-color
:
#F5F5F5
;
box-shadow
:
0
0
0
1px
#CCCCCC
;
.panel_header
{
.header_title
{
.el-icon
{
color
:
#666666
;
}
}
}
}
}
}
</
style
>
\ No newline at end of file
...
...
src/views/data_asset/productSpaceEdit.vue
View file @
3b59522
...
...
@@ -20,12 +20,12 @@
</el-tabs>
</ContentWrap>
<!-- 可信空间需要显示 -->
<
!--
<
ContentWrap
id=
"id-approveInfo"
title=
"流程审批"
expandSwicth
style=
"margin-top: 15px"
:isExpand=
"expandApprove"
<ContentWrap
id=
"id-approveInfo"
title=
"流程审批"
expandSwicth
style=
"margin-top: 15px"
:isExpand=
"expandApprove"
@
expand=
"(v) => expandApprove = v"
>
<ApprovalProcess
ref=
"approvalProcessRef"
v-if=
"deploymentId"
:deploymentId=
"deploymentId"
:processInstanceId=
"processInstanceId"
>
</ApprovalProcess>
</ContentWrap>
-->
</ContentWrap>
</div>
<div
class=
"bottom_tool_wrap"
>
<el-button
@
click=
"cancel"
>
取消
</el-button>
...
...
@@ -397,13 +397,13 @@ onActivated(() => {
onBeforeMount
(()
=>
{
// 可信空间需要
//
getCamundaDeploymentId('10034', userData.tenantGuid, userData.staffGuid).then((res: any) => {
//
if (res.code == proxy.$passCode) {
//
deploymentId.value = res.data;
//
} else {
//
proxy.$ElMessage.error(res.msg);
//
}
//
})
getCamundaDeploymentId
(
'10034'
,
userData
.
tenantGuid
,
userData
.
staffGuid
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
deploymentId
.
value
=
res
.
data
;
}
else
{
proxy
.
$ElMessage
.
error
(
res
.
msg
);
}
})
if
(
route
.
query
.
guid
)
{
fullscreenLoading
.
value
=
true
;
getLogicSpaceDetail
({
guid
:
route
.
query
.
guid
}).
then
((
res
:
any
)
=>
{
...
...
src/views/data_asset/productSpaceManageList.vue
0 → 100644
View file @
3b59522
<route
lang=
"yaml"
>
name: settleManagement
</route>
<
script
lang=
"ts"
setup
name=
"productSpaceManage"
>
import
{
ref
}
from
'vue'
;
import
TableTools
from
"@/components/Tools/table_tools.vue"
;
import
{
getLogicSpacePageList
,
deleteLogicSpace
}
from
'@/api/modules/dataAsset'
;
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
;
import
{
passFlowData
,
rejectFlowData
,
revokeFlowData
}
from
"@/api/modules/workFlowService"
;
import
useDataProductSpaceStore
from
"@/store/modules/productSpace"
;
const
productSpaceStore
=
useDataProductSpaceStore
();
const
router
=
useRouter
();
const
route
=
useRoute
();
const
userData
=
JSON
.
parse
(
localStorage
.
userData
)
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
searchItemList
=
ref
([
{
type
:
"input"
,
label
:
""
,
field
:
"spaceName"
,
default
:
""
,
placeholder
:
"空间名称"
,
maxlength
:
50
,
clearable
:
true
,
},
{
type
:
'select'
,
label
:
''
,
field
:
'approveState'
,
default
:
''
,
placeholder
:
'审核状态'
,
options
:
[
{
label
:
'草稿中'
,
value
:
'N'
},
{
label
:
'审批中'
,
value
:
'A'
},
{
label
:
'已通过'
,
value
:
'Y'
},
{
label
:
'已驳回'
,
value
:
'R'
},
{
label
:
'已撤销'
,
value
:
'C'
},
],
filterable
:
true
,
clearable
:
true
}
]);
const
tableFields
=
ref
([
{
label
:
"序号"
,
type
:
"index"
,
width
:
56
,
align
:
"center"
},
{
label
:
"空间名称"
,
field
:
"spaceName"
,
width
:
160
,
},
{
label
:
"产品数量"
,
field
:
"damCount"
,
width
:
120
,
align
:
'right'
,
type
:
'chnum'
},
{
label
:
"成员数量"
,
field
:
"memberCount"
,
width
:
120
,
align
:
'right'
,
type
:
'chnum'
},
{
label
:
"审批状态"
,
field
:
"approveVO"
,
type
:
"tag"
,
width
:
96
,
align
:
'center'
,
getName
:
(
scope
)
=>
{
const
approveVO
=
scope
.
row
.
approveVO
||
{}
switch
(
approveVO
.
approveState
)
{
case
'N'
:
return
'草稿中'
;
case
'A'
:
return
'审批中'
;
case
'Y'
:
return
'已通过'
;
case
'R'
:
return
'已驳回'
;
case
'C'
:
return
'已撤销'
;
case
'I'
:
return
'--'
;
default
:
return
'草稿中'
;
}
},
tagType
:
(
scope
)
=>
{
const
approveVO
=
scope
.
row
.
approveVO
||
{}
switch
(
approveVO
.
approveState
)
{
case
'A'
:
return
'warning'
;
case
'Y'
:
return
'success'
;
case
'R'
:
return
'danger'
;
default
:
return
'info'
;
}
}
},
{
label
:
"创建企业"
,
field
:
"tenantName"
,
width
:
200
},
{
label
:
"修改人"
,
field
:
"updateUserName"
,
width
:
130
},
{
label
:
"修改时间"
,
field
:
"updateTime"
,
width
:
170
},
]);
const
page
=
ref
({
limit
:
50
,
curr
:
1
,
sizes
:
[
{
label
:
"10"
,
value
:
10
},
{
label
:
"50"
,
value
:
50
},
{
label
:
"100"
,
value
:
100
},
{
label
:
"150"
,
value
:
150
},
{
label
:
"200"
,
value
:
200
},
],
spaceName
:
''
,
approveState
:
''
});
const
currTableData
:
any
=
ref
({});
const
tableInfo
=
ref
({
id
:
'value-asset-table'
,
rowKey
:
'guid'
,
loading
:
false
,
fields
:
tableFields
.
value
,
data
:
[],
page
:
{
type
:
"normal"
,
rows
:
0
,
...
page
.
value
,
},
actionInfo
:
{
label
:
"操作"
,
type
:
"btn"
,
width
:
180
,
btns
:
(
scope
)
=>
{
let
row
=
scope
.
row
;
return
getTableBtns
(
row
);
}
}
});
const
getTableBtns
=
(
row
)
=>
{
let
btnsArr
:
any
[]
=
[];
const
approveVO
=
row
.
approveVO
;
const
currentStaffGuid
=
userData
.
staffGuid
const
bizApproveState
=
row
.
bizApproveState
;
const
approveState
=
approveVO
?.
approveState
||
'N'
;
const
approveStaffGuids
=
approveVO
?.
approveStaffGuids
||
[];
const
staffGuid
=
approveVO
?.
staffGuid
||
''
;
let
isShowCancel
=
false
;
let
flowState
;
if
(
approveState
==
'N'
)
{
flowState
=
1
;
}
if
(
approveState
==
'A'
&&
approveStaffGuids
.
indexOf
(
currentStaffGuid
)
>
-
1
)
{
flowState
=
2
;
}
if
((
approveState
==
'C'
||
approveState
==
'R'
)
&&
staffGuid
==
currentStaffGuid
&&
!
row
.
nodeId
)
{
flowState
=
3
;
}
if
(
approveVO
&&
approveVO
.
approveState
==
'A'
&&
staffGuid
==
currentStaffGuid
&&
!
row
.
nodeId
)
{
isShowCancel
=
true
;
}
if
(
flowState
===
1
)
{
btnsArr
=
[{
label
:
"编辑"
,
value
:
"edit"
},
{
label
:
"删除"
,
value
:
"delete"
}]
}
else
{
btnsArr
.
push
({
label
:
"详情"
,
value
:
"detail"
})
if
(
flowState
===
2
)
{
btnsArr
.
push
(...[{
label
:
"通过"
,
value
:
"pass"
},
{
label
:
"驳回"
,
value
:
"reject"
}])
}
else
if
(
flowState
===
3
)
{
if
(
bizApproveState
!=
'D'
)
{
btnsArr
.
push
({
label
:
"重新提交"
,
value
:
"edit"
})
}
}
isShowCancel
&&
btnsArr
.
push
({
label
:
"撤销"
,
value
:
"revoke"
})
flowState
===
3
&&
btnsArr
.
push
({
label
:
"删除"
,
value
:
"delete"
})
}
return
btnsArr
}
const
toSearch
=
(
val
:
any
,
clear
:
boolean
=
false
)
=>
{
if
(
clear
)
{
searchItemList
.
value
.
map
((
item
)
=>
(
item
.
default
=
""
));
page
.
value
.
spaceName
=
''
;
page
.
value
.
approveState
=
""
;
}
else
{
page
.
value
.
spaceName
=
val
.
spaceName
;
page
.
value
.
approveState
=
val
.
approveState
;
}
getTableData
();
};
const
getTableData
=
()
=>
{
tableInfo
.
value
.
loading
=
true
getLogicSpacePageList
({
pageIndex
:
page
.
value
.
curr
,
pageSize
:
page
.
value
.
limit
,
spaceName
:
page
.
value
.
spaceName
,
approveState
:
page
.
value
.
approveState
,
currentStaffGuid
:
userData
.
staffGuid
}).
then
((
res
:
any
)
=>
{
if
(
res
?.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
{}
tableInfo
.
value
.
data
=
data
.
records
||
[]
tableInfo
.
value
.
page
.
limit
=
data
.
pageSize
tableInfo
.
value
.
page
.
curr
=
data
.
pageIndex
tableInfo
.
value
.
page
.
rows
=
data
.
totalRows
}
else
{
proxy
.
$ElMessage
({
type
:
'error'
,
message
:
res
.
msg
,
})
}
tableInfo
.
value
.
loading
=
false
}).
catch
(()
=>
{
tableInfo
.
value
.
loading
=
false
})
};
const
tableBtnClick
=
(
scope
,
btn
)
=>
{
const
type
=
btn
.
value
;
const
row
=
scope
.
row
;
currTableData
.
value
=
row
;
if
(
type
===
"edit"
)
{
//草稿中\已驳回\已撤销\已通过 状态,才可以编辑。
router
.
push
({
name
:
'productSpaceEdit'
,
query
:
{
guid
:
row
.
guid
,
name
:
row
.
spaceName
}
})
}
else
if
(
type
==
"delete"
)
{
proxy
.
$openMessageBox
(
"此操作将永久删除, 是否继续?"
,
()
=>
{
let
guids
=
[
scope
.
row
.
guid
];
deleteLogicSpace
(
guids
).
then
((
res
:
any
)
=>
{
if
(
res
?.
code
==
proxy
.
$passCode
)
{
page
.
value
.
curr
=
1
;
getTableData
();
proxy
.
$ElMessage
.
success
(
'删除成功'
);
}
else
{
proxy
.
$ElMessage
.
error
(
res
.
msg
);
}
});
})
}
else
if
(
type
===
'revoke'
)
{
// 撤销,状态为审批中时可以撤销。
ElMessageBox
.
confirm
(
'确定撤销该连接器审批流程吗?'
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
'warning'
,
}).
then
(()
=>
{
let
params
=
{
guid
:
row
.
approveVO
.
approveGuid
,
flowType
:
row
.
approveVO
.
flowType
,
approveStaffGuid
:
userData
.
staffGuid
,
}
revokeFlowData
(
params
,
currTableData
.
value
.
tenantGuid
).
then
((
res
:
any
)
=>
{
if
(
res
?.
code
==
proxy
.
$passCode
)
{
if
(
res
.
data
)
{
ElMessage
.
success
(
'该审批流程撤销成功!'
);
getTableData
();
}
else
{
ElMessage
.
error
(
'该审批流程撤销失败!'
);
}
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
});
}).
catch
(()
=>
{
ElMessage
.
info
(
'已取消撤销'
);
});
}
else
if
(
type
===
'detail'
)
{
// 详情, 若是草稿中,详情就是编辑,
router
.
push
({
name
:
'productSpaceDetail'
,
query
:
{
guid
:
row
.
guid
,
name
:
row
.
connectorName
}
});
}
else
if
(
type
===
'pass'
)
{
passDialogInfo
.
value
.
visible
=
true
;
}
else
if
(
type
==
'reject'
)
{
rejectDialogInfo
.
value
.
visible
=
true
;
}
};
const
tablePageChange
=
(
info
)
=>
{
page
.
value
.
curr
=
Number
(
info
.
curr
);
page
.
value
.
limit
=
Number
(
info
.
limit
);
tableInfo
.
value
.
page
.
curr
=
page
.
value
.
curr
;
tableInfo
.
value
.
page
.
limit
=
page
.
value
.
limit
;
getTableData
();
};
const
newCreate
=
()
=>
{
router
.
push
({
name
:
'productSpaceEdit'
})
}
onActivated
(()
=>
{
if
(
productSpaceStore
.
isRefresh
)
{
//如果是首次加载,则不需要调用
page
.
value
.
curr
=
1
;
getTableData
();
productSpaceStore
.
setIsRefresh
(
false
);
}
})
const
fullscreenloading
=
ref
(
false
);
onBeforeMount
(()
=>
{
toSearch
({});
})
const
passDialogInfo
=
ref
({
visible
:
false
,
size
:
460
,
direction
:
"column"
,
header
:
{
title
:
"通过"
,
},
type
:
''
,
contents
:
[
{
type
:
'form'
,
title
:
''
,
formInfo
:
{
id
:
'batch-pass-form'
,
items
:
[
{
label
:
''
,
type
:
"textarea"
,
placeholder
:
"请填写通过理由(非必填)"
,
field
:
"approveSuggest"
,
clearable
:
true
,
block
:
true
,
col
:
'margin_b_0'
,
}
]
}
}
],
footer
:
{
btns
:
[
{
type
:
"default"
,
label
:
"取消"
,
value
:
"cancel"
},
{
type
:
"primary"
,
label
:
"确定"
,
value
:
"submit"
,
loading
:
false
},
],
},
});
const
passDialogBtnClick
=
(
btn
,
info
)
=>
{
if
(
btn
.
value
==
'submit'
)
{
passDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
true
;
let
params
=
{
guid
:
currTableData
.
value
.
approveVO
.
approveGuid
,
flowType
:
currTableData
.
value
.
approveVO
.
flowType
,
approveSuggest
:
info
.
approveSuggest
,
approveStaffGuid
:
userData
.
staffGuid
,
}
passFlowData
(
params
,
currTableData
.
value
.
tenantGuid
).
then
((
res
:
any
)
=>
{
passDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
false
;
if
(
res
?.
code
==
proxy
.
$passCode
)
{
if
(
res
.
data
)
{
ElMessage
.
success
(
'审批成功'
);
passDialogInfo
.
value
.
visible
=
false
;
getTableData
();
}
else
{
ElMessage
.
error
(
'审批失败'
);
}
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
}).
catch
(()
=>
{
passDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
false
;
});
}
else
if
(
btn
.
value
==
'cancel'
)
{
passDialogInfo
.
value
.
visible
=
false
;
}
};
const
rejectDialogInfo
=
ref
({
visible
:
false
,
size
:
460
,
direction
:
"column"
,
header
:
{
title
:
"驳回"
,
},
type
:
''
,
contents
:
[
{
type
:
'form'
,
title
:
''
,
formInfo
:
{
id
:
'batch-reject-form'
,
items
:
[
{
label
:
''
,
type
:
"textarea"
,
placeholder
:
"请填写驳回理由(必填)"
,
field
:
"approveSuggest"
,
clearable
:
true
,
block
:
true
,
col
:
'margin_b_0'
,
}
],
}
}
],
footer
:
{
btns
:
[
{
type
:
"default"
,
label
:
"取消"
,
value
:
"cancel"
},
{
type
:
"primary"
,
label
:
"确定"
,
value
:
"submit"
,
loading
:
false
},
],
},
});
const
rejectDialogBtnClick
=
(
btn
,
info
)
=>
{
if
(
btn
.
value
==
'submit'
)
{
if
(
info
.
approveSuggest
==
''
)
{
ElMessage
.
error
(
'请填写驳回理由'
);
return
}
rejectDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
true
;
let
params
=
{
guid
:
currTableData
.
value
.
approveVO
.
approveGuid
,
flowType
:
currTableData
.
value
.
approveVO
.
flowType
,
approveSuggest
:
info
.
approveSuggest
,
approveStaffGuid
:
userData
.
staffGuid
,
}
rejectFlowData
(
params
,
currTableData
.
value
.
tenantGuid
).
then
((
res
:
any
)
=>
{
rejectDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
false
;
if
(
res
?.
code
==
proxy
.
$passCode
)
{
if
(
res
.
data
)
{
ElMessage
.
success
(
'驳回成功'
);
rejectDialogInfo
.
value
.
visible
=
false
;
getTableData
();
}
else
{
ElMessage
.
error
(
'驳回失败'
);
}
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
}).
catch
(()
=>
{
rejectDialogInfo
.
value
.
footer
.
btns
[
1
].
loading
=
false
;
});
}
else
if
(
btn
.
value
==
'cancel'
)
{
rejectDialogInfo
.
value
.
visible
=
false
;
}
};
</
script
>
<
template
>
<div
class=
"container_wrap"
v-loading=
"fullscreenloading"
>
<div
class=
"table_tool_wrap"
>
<TableTools
:searchItems=
"searchItemList"
:searchId=
"'settle-asset-search'"
@
search=
"toSearch"
:init=
"false"
/>
</div>
<div
class=
"tools_btns"
>
<el-button
type=
"primary"
@
click=
"newCreate()"
v-preReClick
>
新增
</el-button>
</div>
<div
class=
"table_panel_wrap"
:style=
"
{ height: 'calc(100% - 88px)' }">
<Table
:tableInfo=
"tableInfo"
@
tableBtnClick=
"tableBtnClick"
@
tablePageChange=
"tablePageChange"
/>
</div>
<Dialog
:dialogInfo=
"passDialogInfo"
@
btnClick=
"passDialogBtnClick"
/>
<Dialog
:dialogInfo=
"rejectDialogInfo"
@
btnClick=
"rejectDialogBtnClick"
/>
</div>
</
template
>
<
style
lang=
"scss"
scoped
>
.container_wrap
{
padding
:
0px
16px
;
}
</
style
>
\ No newline at end of file
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