abd63db0 by lihua

数据申请接口联调

1 parent e3e4500b
......@@ -367,8 +367,8 @@ export const getRegisterCatalogDetailGuids = (params) => request({
})
/** 获取资产目录基本信息的详情 */
export const getRegisterCatalogDetail = (params) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/detail`,
export const getRegisterCatalogDetail = (params, isTds = false) => request({
url: isTds ? `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/tds-dam-detail?damGuid=${params.guid}` : `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/detail`,
method: 'get',
params
});
......@@ -626,4 +626,47 @@ export const getProductCategoryList = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/tds-grounding-page-list`,
method: 'post',
data: params
})
/** 获取产品目录中的产品基本信息的详情,包括其它连接器 */
export const getTdsRegisterCatalogDetail = (damGuid) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/tds-dam-detail?damGuid=${damGuid}`,
method: 'get'
});
/** ----------------------------- 提供方进行数据申请接口联调 ---------------------------------- */
export const getDataApplyPageList = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/page-list`,
method: 'post',
data: params
})
export const saveDataApply = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/save`,
method: 'post',
data: params
})
export const updateDataApply = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/update`,
method: 'put',
data: params
})
export const updateDataApplyState = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/update-state`,
method: 'post',
data: params
})
export const deleteDataApply = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/delete`,
method: 'delete',
data: params
})
export const getDataApplyDetail = (guid) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/detail?guid=${guid}`,
method: 'get'
})
\ No newline at end of file
......
<template>
<div class="container_wrap full" v-loading="fullscreenLoading">
<div class="content_main">
<ContentWrap id="id-baseInfo" title="数据申请信息" description="" :isExpand="baseInfoExpand" :expand-swicth="true"
class="mb16" @expand="(v) => baseInfoExpand = v">
<div v-if="detailInfo.bizApproveState"
:class="['panel_wrap', '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 == '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?.applicationApproveRSVO?.approveSuggest || '--' }}</span>
</div>
</div>
</div>
</div>
<ContentWrap id="id-baseInfo" title="数据申请信息" description="" :expand-swicth="false">
<div class="list_panel">
<div v-if="!isDataUse" class="list_item is_block" style="font-weight: 600;">
<span class="item_label">数据申请方:</span>
<span class="item_value">{{ detailInfo.tenantName || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">产品名称:</span>
<span class="item_value link" @click="viewProductDetail">
......@@ -13,7 +53,8 @@
</div>
<div class="list_item">
<span class="item_label">产品编号:</span>
<span class="item_value">{{ detailInfo.productCode || '--' }}</span>
<span class="item_value"><ellipsis-tooltip :content="detailInfo.productCode || '--'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'productCode'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">资产类型:</span>
......@@ -21,32 +62,34 @@
</div>
<div class="list_item">
<span class="item_label">预计使用期限:</span>
<span class="item_value">{{ detailInfo.damTypeName || '--' }}</span>
<span class="item_value">{{ detailInfo.expirationStartDate ?
(Moment(detailInfo.expirationStartDate).format('YYYY-MM-DD') + '至' +
Moment(detailInfo.expirationEndDate).format('YYYY-MM-DD')) : '--' }}</span>
</div>
<div class="list_item">
<div class="list_item">
<span class="item_label">数据范围:</span>
<span class="item_value">{{ detailInfo.damTypeName || '--' }}</span>
<span class="item_value">{{ detailInfo.startDataRange ?
(Moment(detailInfo.startDataRange).format('YYYY-MM-DD') + '至' +
Moment(detailInfo.endDataRange).format('YYYY-MM-DD')) : '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">产品发布机构:</span>
<span class="item_value">{{ detailInfo.productPublisherName || '--' }}</span>
<span class="item_value"><ellipsis-tooltip :content="detailInfo.issuingName || '--'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'issuingName'"></ellipsis-tooltip></span>
</div>
<div class="list_item is_block">
<div class="list_item is_block">
<span class="item_label">数据粒度说明:</span>
<span class="item_value">{{ detailInfo.description || '--' }}</span>
<span class="item_value">{{ detailInfo.dataGranularityDescription || '--' }}</span>
</div>
<div class="list_item is_block">
<div class="list_item is_block">
<span class="item_label">使用场景描述:</span>
<span class="item_value">{{ detailInfo.description || '--' }}</span>
<span class="item_value">{{ detailInfo.useScenarioDescription || '--' }}</span>
</div>
</div>
</ContentWrap>
<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 id="id-approveInfo" title="审批信息" :expandSwicth="false" style="margin-top: 15px" >
<Table :table-info="approveTableInfo"></Table>
</ContentWrap> -->
</div>
<div class="tool_btns">
<div class="btns">
......@@ -54,38 +97,73 @@
}}</el-button>
</div>
</div>
<Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" />
<Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
</div>
</template>
<script lang="ts" setup name="productApplicationEdit">
import useUserStore from "@/store/modules/user";
import { getDataApplyDetail, updateDataApplyState } from "@/api/modules/dataAsset";
import { CircleCloseFilled } from '@element-plus/icons-vue';
import Moment from 'moment';
import { USERROLE } from "@/utils/enum";
const { proxy } = getCurrentInstance() as any;
const userStore = useUserStore();
const route = useRoute();
const router = useRouter();
const fullPath = route.fullPath;
const userData = JSON.parse(userStore.userData);
const fullscreenLoading = ref(false);
const baseInfoExpand = ref(true);
const expandApprove = ref(true);
const deploymentId = ref('');
const processInstanceId = ref('');
const detailInfo: any = ref({});
const viewProductDetail = () => {
// TODO
router.push({
name: 'productSortCatalogDetail',
query: {
guid: detailInfo.value.damGuid, // 产品GUID
type: 'detail', // 查看类型
foundMode: 'tdsUse', // 发现模式
name: detailInfo.value.damName, // 产品名称
}
});
}
/** 是否是数据提供方 */
const isDataUse = computed(() => {
return localStorage.getItem('userRole') == USERROLE.USE;
})
const toolBtns: any = computed(() => {
let btnsArr: any = [{
label: "关闭", value: "cancel", plain: true
}];
// TODO,资产运营平台TODO
return btnsArr;
if (isDataUse.value) {
let btnsArr: any = [{
label: "关闭", value: "cancel", plain: true
}];
return btnsArr;
} else {
let btnsArr: any = [{
label: "关闭", value: "cancel", plain: true
}];
// 获取审批人。
const approveVO = detailInfo.value.applicationApproveRSVO || {}
let approveState = approveVO.approveState || null;
let approveStaffGuid = approveVO?.approveInstanceRSVOS?.[1]?.operator || '';
if (approveState == 'A' && approveStaffGuid == userData.tenantGuid) {
btnsArr.push(...[{
label: "通过", value: "pass", click: () => {
passDialogInfo.value.visible = true;
}
}, {
label: "驳回", value: "reject", click: () => {
rejectDialogInfo.value.visible = true;
}
}])
}
return btnsArr;
}
});
const btnClick = (btn: any) => {
......@@ -105,14 +183,168 @@ const cancel = () => {
});
}
onActivated(() => {
let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath == fullPath);
if (tab) {
tab.meta.title = '数据申请详情-' + route.query.damName;
document.title = tab.meta.title;
};
})
const getDetail = () => {
fullscreenLoading.value = true;
getDataApplyDetail(route.query.guid).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
detailInfo.value = res.data || {};
detailInfo.value.bizApproveState = detailInfo.value.applicationApproveRSVO?.approveState || detailInfo.value.approveState;
} else {
res?.msg && proxy.$ElMessage.error(res.msg);
}
})
}
onBeforeMount(() => {
getDetail();
})
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.guid,
approveState: 'A',
approveSuggest: info.approveSuggest,
}
updateDataApplyState(params).then((res: any) => {
passDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
proxy.$ElMessage.success('审批成功');
passDialogInfo.value.visible = false;
getDetail();
} 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.guid,
approveState: 'R',
approveSuggest: info.approveSuggest,
}
updateDataApplyState(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();
} 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;
}
};
</script>
<style lang="scss" scoped>
.content_main {
height: calc(100% - 44px);
padding: 16px;
......@@ -162,6 +394,138 @@ onBeforeMount(() => {
}
}
.panel_wrap {
margin-bottom: 12px;
.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;
}
}
}
}
}
}
.tool_btns {
display: flex;
justify-content: center;
......
<template>
<div class="container_wrap full" v-loading="fullscreenLoading">
<div class="content_main">
<ContentWrap id="id-baseInfo" title="数据申请信息" description="" :isExpand="baseInfoExpand" :expand-swicth="true"
class="mb16" @expand="(v) => baseInfoExpand = v">
<ContentWrap id="id-baseInfo" title="数据申请信息" description="" :expand-swicth="false">
<Form ref="baseInfoFormRef" :itemList="baseInfoFormItems" formId="base-info-form" :rules="baseInfoFormRules"
col="col3" />
</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>
......@@ -22,12 +22,13 @@
</template>
<script lang="ts" setup name="productApplicationEdit">
import { getCamundaDeploymentId } from "@/api/modules/workFlowService";
import {
getRegisterCatalogDetail
getTdsRegisterCatalogDetail,
updateDataApply
} from "@/api/modules/dataAsset";
import useUserStore from "@/store/modules/user";
import useDataProductApplicationStore from "@/store/modules/productApplication";
import { saveDataApply, getDataApplyDetail } from "@/api/modules/dataAsset";
import { useValidator } from '@/hooks/useValidator';
const { required } = useValidator();
......@@ -41,11 +42,6 @@ const userData = JSON.parse(localStorage.userData);
const fullPath = route.fullPath;
const fullscreenLoading = ref(false);
const baseInfoExpand = ref(true);
const expandApprove = ref(true);
const deploymentId = ref('');
const processInstanceId = ref('');
const baseInfoFormRef = ref();
......@@ -56,15 +52,15 @@ const baseInfoFormItems = ref([{
col: 'link',
default: '-',
click: () => {
//TODO
debugger
router.push({
name: 'productDetail',
name: 'productSortCatalogDetail',
query: {
id: route.query.id,
type: 'view'
guid: route.query.damGuid, // 产品GUID
type: 'detail', // 查看类型
foundMode: 'tdsUse', // 发现模式
name: route.query.damName, // 产品名称
}
})
});
}
},
{
......@@ -86,7 +82,9 @@ const baseInfoFormItems = ref([{
{
label: "预计使用期限",
type: "date-picker",
field: "useDateRange",
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
field: "expirationRange",
default: null,
placeholder: "开始时间~结束时间",
clearable: true,
......@@ -114,7 +112,9 @@ const baseInfoFormItems = ref([{
{
label: "数据范围",
type: "date-picker",
field: "useDataDateRange",
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
field: "dataRange",
default: null,
placeholder: "开始时间~结束时间",
clearable: true,
......@@ -124,7 +124,7 @@ const baseInfoFormItems = ref([{
label: '产品发布机构',
type: 'input',
placeholder: '请输入',
field: 'productPublisherName',
field: 'issuingName',
default: '',
disabled: true
},
......@@ -132,7 +132,7 @@ const baseInfoFormItems = ref([{
label: '数据粒度说明',
type: 'textarea',
placeholder: '请输入需要的需求字段',
field: 'dataDescription',
field: 'dataGranularityDescription',
default: '',
block: true,
maxlength: 500,
......@@ -143,7 +143,7 @@ const baseInfoFormItems = ref([{
label: '使用场景描述',
type: 'textarea',
placeholder: '请输入使用该数据产品的场景描述信息',
field: 'useDescription',
field: 'useScenarioDescription',
default: '',
block: true,
maxlength: 500,
......@@ -153,14 +153,14 @@ const baseInfoFormItems = ref([{
])
const baseInfoFormRules = ref({
useDateRange: [{
expirationRange: [{
type: 'array', required: true, message: '请选择预计使用期限', trigger: 'change',
}],
useDataDateRange: [{
dataRange: [{
type: 'array', required: true, message: '请选择数据范围', trigger: 'change',
}],
dataDescription: [required('请输入数据粒度说明')],
useDescription: [required('请输入使用场景描述')]
dataGranularityDescription: [required('请输入数据粒度说明')],
useScenarioDescription: [required('请输入使用场景描述')]
})
const cancel = () => {
......@@ -174,30 +174,103 @@ const cancel = () => {
});
}
const getSubmitParams = (isSubmit = false) => {
let formInline = baseInfoFormRef.value.formInline;
let params: any = {
...formInline,
isSubmit: isSubmit ? 'Y' : 'N',
damGuid: route.query.damGuid || detailInfo.value.damGuid,
damName: route.query.damName || detailInfo.value.damName,
productCode: productDetail.value.productCode || detailInfo.value.productCode,
damType: productDetail.value.damType || detailInfo.value.damType,
issuingGuid: productDetail.value.rightMain || detailInfo.value.issuingGuid,
}
if (params.expirationRange?.length) {
params.expirationStartDate = params.expirationRange[0];
params.expirationEndDate = params.expirationRange[1];
}
delete params.expirationRange;
if (params.dataRange?.length) {
params.startDataRange = params.dataRange[0];
params.endDataRange = params.dataRange[1];
}
delete params.dataRange;
return params;
}
const save = () => {
// 保存不检验。
let submitParams = getSubmitParams(false);
if (route.query.guid) {
fullscreenLoading.value = true;
submitParams.guid = route.query.guid;
updateDataApply(submitParams).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('编辑保存成功');
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
productApplicationStore.setIsRefresh(true);
router.push({
name: "productApplicationManage",
});
} else {
res?.msg && proxy.$ElMessage.error(res.msg);
}
})
} else {
fullscreenLoading.value = true;
saveDataApply(submitParams).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('保存成功');
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
productApplicationStore.setIsRefresh(true);
router.push({
name: "productApplicationManage",
});
} else {
res?.msg && proxy.$ElMessage.error(res.msg);
}
})
}
}
const submit = () => {
baseInfoFormRef.value?.ruleFormRef?.validate().then((valid, errorItem) => {
if (valid) {
let formInline = baseInfoFormRef.value.formInline;
// fullscreenLoading.value = true;
// listingSavePortal(params).then((res: any) => {
// fullscreenLoading.value = false;
// if (res?.code == proxy.$passCode) {
// proxy.$ElMessage.success('提交审批成功');
// userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
// productApplicationStore.setIsRefresh(true);
// router.push({
// name: "productApplicationManage",
// });
// } else {
// res?.msg && proxy.$ElMessage.error(res.msg);
// }
// }).catch((res) => {
// fullscreenLoading.value = false;
// });
let submitParams = getSubmitParams(true);
if (route.query.guid) {
fullscreenLoading.value = true;
submitParams.guid = route.query.guid;
updateDataApply(submitParams).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('编辑提交审批成功');
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
productApplicationStore.setIsRefresh(true);
router.push({
name: "productApplicationManage",
});
} else {
res?.msg && proxy.$ElMessage.error(res.msg);
}
})
} else {
fullscreenLoading.value = true;
saveDataApply(submitParams).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('提交审批成功');
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
productApplicationStore.setIsRefresh(true);
router.push({
name: "productApplicationManage",
});
} else {
res?.msg && proxy.$ElMessage.error(res.msg);
}
})
}
} else {
var obj = Object.keys(errorItem);
baseInfoFormRef.value.ruleFormRef.scrollToField(obj[0]);
......@@ -205,47 +278,70 @@ const submit = () => {
})
}
onMounted(() => {
})
onActivated(() => {
let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath == fullPath);
let detailType = route.query.type;
let name = route.query.name;
if (tab) {
switch (detailType) {
case 'edit':
tab.meta.title = `编辑-${name}`;
break;
case 'redit':
tab.meta.title = `编辑-${name}`;
break;
default:
tab.meta.title = '新增数据申请';
}
document.title = tab.meta.title;
};
let name = route.query.damName;
if (route.query.guid) {
tab.meta.title = `数据申请编辑-${name}`;
} else {
tab.meta.title = `新增数据申请-${name}`;
}
document.title = tab.meta.title;
})
/** 产品详情 */
const productDetail: any = ref({});
/** 数据申请详情 */
const detailInfo: any = ref({});
onBeforeMount(() => {
// getCamundaDeploymentId('10016', userData.tenantGuid, userData.staffGuid).then((res: any) => {
// if (res.code == proxy.$passCode) {
// deploymentId.value = res.data;
// } else {
// proxy.$ElMessage.error(res.msg);
// }
// })
fullscreenLoading.value = true;
getRegisterCatalogDetail({
guid: route.query.damGuid
}).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
let detail = res.data || {};
baseInfoFormItems.value[0].default = <string>route.query.damName;
baseInfoFormItems.value[1].default = detail.productCode;
baseInfoFormItems.value[2].default = detail.damTypeName;
} else {
res?.msg && proxy.$ElMessage.error(res.msg);
}
})
if (route.query.guid) {
fullscreenLoading.value = true;
getDataApplyDetail(route.query.guid).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
detailInfo.value = res.data || {};
baseInfoFormItems.value.forEach((item: any) => {
item.default = detailInfo.value[item.field];
if (item.field == 'expirationRange') {
item.default = detailInfo.value.expirationStartDate ? [detailInfo.value.expirationStartDate, detailInfo.value.expirationEndDate] : null;
} else if (item.field == 'dataRange') {
item.default = detailInfo.value.startDataRange ? [detailInfo.value.startDataRange, detailInfo.value.endDataRange] : null;
}
})
nextTick(() => {
const body = document.body;
const clickEvent = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window
});
body.dispatchEvent(clickEvent);
})
} else {
res?.msg && proxy.$ElMessage.error(res.msg);
}
})
} else {
fullscreenLoading.value = true;
getTdsRegisterCatalogDetail(route.query.damGuid).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
let detail = productDetail.value = res.data || {};
baseInfoFormItems.value[0].default = <string>route.query.damName;
baseInfoFormItems.value[1].default = detail.productCode;
baseInfoFormItems.value[2].default = detail.damTypeName;
let issuingNameItem = baseInfoFormItems.value.find(item => item.field == 'issuingName');
issuingNameItem && (issuingNameItem.default = detail.rightMainName || '--');
} else {
res?.msg && proxy.$ElMessage.error(res.msg);
}
})
}
})
</script>
......
......@@ -6,6 +6,8 @@
<div class="table_panel_wrap" :style="{ height: 'calc(100% - 48px)' }">
<Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" />
</div>
<Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" />
<Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
</div>
</template>
......@@ -13,14 +15,21 @@
import { commonPageConfig } from "@/components/PageNav";
import TableTools from "@/components/Tools/table_tools.vue";
import useUserStore from "@/store/modules/user";
import { TableColumnWidth } from "@/utils/enum";
import { getDamTypesList } from "@/api/modules/dataAsset";
import { TableColumnWidth, USERROLE } from "@/utils/enum";
import { deleteDataApply, getDamTypesList, getDataApplyPageList, updateDataApplyState } from "@/api/modules/dataAsset";
import useDataProductApplicationStore from "@/store/modules/productApplication";
const productApplicationStore = useDataProductApplicationStore();
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const userStore = useUserStore();
const userData = JSON.parse(userStore.userData);
/** 是否是数据提供方 */
const isDataUse = computed(() => {
return localStorage.getItem('userRole') == USERROLE.USE;
})
const damTypes: any = ref([]);
const searchItemList: any = ref([
{
......@@ -78,11 +87,41 @@ const tableInfo = ref({
label: "产品类型", field: "damTypeName", width: 100
},
{
label: "审批状态", field: "approveState", type: "tag", width: TableColumnWidth.STATE, align: 'center'
label: "审批状态", field: "approveState", type: "tag", width: TableColumnWidth.STATE, align: 'center', getName: (scope) => {
const approveVO = scope.row.applicationApproveRSVO || {}
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.applicationApproveRSVO || {}
switch (approveVO.approveState) {
case 'A':
return 'warning';
case 'Y':
return 'success';
case 'R':
return 'danger';
default:
return 'info';
}
}
},
{ label: "申请方", field: "tenantName", width: 240 },
{ label: "数据提供方", field: "dataProviderName", width: 240 },
{ label: "提交时间", field: "submitTime", width: 170 },
{ label: "申请方", field: "tenantName", width: 180 },
{ label: "数据提供方", field: "issuingName", width: 180 },
{ label: "提交时间", field: "createTime", width: 170 },
],
loading: false,
data: [],
......@@ -98,75 +137,121 @@ const tableInfo = ref({
btns: (scope) => {
const { row } = scope;
const bizApproveState = row.approveState;
const approveVO = scope.row.applicationApproveRSVO || {}
let approveState = approveVO.approveState || null;
let flowState;
if (bizApproveState == 'N') {
flowState = 1;
}
const currentStaffGuid = userData.userGuid
const staffGuid = row.createUserId || '';
let isShowCancel = false;
let list: any = [];
if (bizApproveState == 'N') {
if (approveState == 'N') {
flowState = 1;
}
if ((bizApproveState == 'D' || bizApproveState == 'C' || bizApproveState == 'R' || bizApproveState == 'E' || bizApproveState == 'R') && staffGuid == currentStaffGuid) {
flowState = 3;
}
if (bizApproveState == 'A' && staffGuid == currentStaffGuid) {
isShowCancel = true;
}
if (flowState === 1) {
list = [{ label: "编辑", value: "edit", click: btnHandlers.edit }, { label: "删除", value: "del", click: btnHandlers.del }]
if (isDataUse.value) {
let isShowCancel = false;
let list: any = [];
const staffGuid = row.createUserId || '';
const currentStaffGuid = userData.userGuid
if ((bizApproveState == 'D' || approveState == 'C' || approveState == 'R' || approveState == 'E') && staffGuid == currentStaffGuid) {
flowState = 3;
}
if (approveState == 'A' && staffGuid == currentStaffGuid) {
isShowCancel = true;
}
if (flowState === 1) {
list = [{ label: "编辑", value: "edit", click: btnHandlers.edit }, { label: "删除", value: "del", click: btnHandlers.del }]
}
if (flowState !== 1) {
list.push({ label: "详情", value: "detail", click: btnHandlers.detail })
}
if (flowState === 3 && bizApproveState !== 'D') { //重新提交过的不能再重新提交 && bizApproveState != 'D'
list.push({ label: "重新提交", value: "redit", click: btnHandlers.redit }) //已驳回
}
isShowCancel && list.push({ label: "撤销", value: "revoke", click: btnHandlers.revoke })
if (flowState === 3) {
list.push({ label: "删除", value: "del", click: btnHandlers.del })
}
return list
} else { //数据提供方需要进行审批驳回和通过。
let list: any = [];
list.push({ label: "详情", value: "detail", click: btnHandlers.detail });
// 获取审批人。
let approveStaffGuid = approveVO?.approveInstanceRSVOS?.[1]?.operator || '';
if (approveState == 'A' && approveStaffGuid == userData.tenantGuid) {
flowState = 2;
}
if (flowState === 2) {
list.push(...[{ label: "通过", value: "pass", click: btnHandlers.pass }, { label: "驳回", value: "reject", click: btnHandlers.reject }])
}
return list;
}
if (flowState === 3) {
list.push({ label: "删除", value: "del", click: btnHandlers.del })
}
if (flowState === 3) { //重新提交过的不能再重新提交 && bizApproveState != 'D'
list.push({ label: "重新提交", value: "redit", click: btnHandlers.redit }) //已驳回
}
if (flowState !== 1) {
list.push({ label: "详情", value: "detail", click: btnHandlers.detail })
}
return list
},
}
});
/** 当前操作的表格行数据 */
const currTableData: any = ref({});
const btnHandlers = {
edit: (scope) => {
let row = scope.row;
router.push({
// name: "data-product-edit",
// query: {
// id: scope.row.id,
// },
name: 'productApplicationEdit',
query: { guid: row.guid, damName: row.damName }
});
},
redit: (scope) => {
redit: (scope) => {
let row = scope.row;
router.push({
name: 'productApplicationEdit',
query: { guid: row.guid, damName: row.damName }
});
},
detail: (scope) => {
let row = scope.row;
router.push({
// name: "data-product-detail",
// query: {
// id: scope.row.id,
// },
})
name: 'productApplicationDetail',
query: { guid: row.guid, damName: row.damName }
});
},
del: (scope) => {
del: (scope) => {
proxy.$openMessageBox('数据申请删除后不可恢复,确定继续删除吗?', () => {
// delCertificate([row.guid]).then((res: any) => {
// if (res?.code == proxy.$passCode) {
// proxy.$ElMessage.success('删除资产登记证件成功');
// page.value.curr = 1;
// getTableData();
// } else {
// proxy.$ElMessage.error(res.msg);
// }
// })
deleteDataApply([scope.row.guid]).then((res: any) => {
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('删除数据申请成功');
page.value.curr = 1;
getTableData();
} else {
proxy.$ElMessage.error(res.msg);
}
})
}, () => {
proxy.$ElMessage.info("已取消删除");
});
},
revoke: (scope) => {
proxy.$openMessageBox('确定撤销该数据申请审批吗??', () => {
tableInfo.value.loading = true;
updateDataApplyState({
guid: scope.row.guid,
approveState: 'C'
}).then((res: any) => {
tableInfo.value.loading = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('该数据申请撤销成功');
getTableData();
} else {
res?.msg && proxy.$ElMessage.error(res.msg);
}
});
}, () => {
proxy.$ElMessage.info("已取消撤销");
});
},
pass: (scope) => {
passDialogInfo.value.visible = true;
currTableData.value = scope.row;
},
reject: (scope) => {
rejectDialogInfo.value.visible = true;
currTableData.value = scope.row;
}
}
const toSearch = (val: any, clear: boolean = false) => {
if (clear) {
......@@ -185,22 +270,26 @@ const toSearch = (val: any, clear: boolean = false) => {
};
const getTableData = () => {
// tableInfo.value.loading = true;
// getListingList({
// pageIndex: page.value.curr,
// pageSize: page.value.limit,
// damName: page.value.damName,
// damType: page.value.damType,
// approveState: page.value.approveState
// }).then((res: any) => {
// tableInfo.value.loading = false;
// tableInfo.value.data = res.data.records || [];
// tableInfo.value.page.curr = res.data.pageIndex;
// tableInfo.value.page.limit = res.data.pageSize;
// tableInfo.value.page.rows = res.data.totalRows;
// }).catch((res) => {
// tableInfo.value.loading = false;
// });
tableInfo.value.loading = true;
getDataApplyPageList({
pageIndex: page.value.curr,
pageSize: page.value.limit,
damName: page.value.damName,
damType: page.value.damType,
approveState: page.value.approveState
}).then((res: any) => {
tableInfo.value.loading = false;
if (res?.code == proxy.$passCode) {
tableInfo.value.data = res.data.records || [];
tableInfo.value.page.curr = res.data.pageIndex;
tableInfo.value.page.limit = res.data.pageSize;
tableInfo.value.page.rows = res.data.totalRows;
} else {
proxy.$ElMessage.error(res.msg);
}
}).catch((res) => {
tableInfo.value.loading = false;
});
};
const tablePageChange = (info) => {
......@@ -211,6 +300,14 @@ const tablePageChange = (info) => {
getTableData();
};
onActivated(() => {
if (productApplicationStore.isRefresh) {
page.value.curr = 1;
getTableData();
productApplicationStore.setIsRefresh(false);
}
})
onBeforeMount(() => {
getDamTypesList({
dictType: "资产类型",
......@@ -224,6 +321,140 @@ onBeforeMount(() => {
})
})
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.guid,
approveState: 'A',
approveSuggest: info.approveSuggest,
}
updateDataApplyState(params).then((res: any) => {
passDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
proxy.$ElMessage.success('审批成功');
passDialogInfo.value.visible = false;
getTableData();
} 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: currTableData.value.guid,
approveState: 'R',
approveSuggest: info.approveSuggest,
}
updateDataApplyState(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;
getTableData();
} 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;
}
};
</script>
<style lang="scss" scoped>
......
......@@ -29,6 +29,7 @@ import { USERROLE } from '@/utils/enum';
const router = useRouter();
const route = useRoute();
const { proxy } = getCurrentInstance() as any;
const userData = JSON.parse(localStorage.userData);
/**
* 数据源选项列表
......@@ -313,7 +314,7 @@ const tableInfo = ref({
query: {
guid: scope.row.guid, // 产品GUID
type: 'detail', // 查看类型
foundMode: 'use', // 发现模式
foundMode: 'tdsUse', // 发现模式
name: scope.row.damName, // 产品名称
}
});
......@@ -335,6 +336,7 @@ const tableInfo = ref({
{ label: "应用场景", field: "scenarioName", width: 120 },
{ label: "所属科室", field: "medDepartmentCodeName", width: 110 },
{ label: "所属主题", field: "subjectDomainName", width: 120 },
{ label: "发布机构", field: "rightMainName", width: 180 },
{ label: "上架时间", field: "groundingTime", width: 170 },
],
data: [], // 表格数据
......@@ -355,6 +357,7 @@ const tableInfo = ref({
return [{
value: 'approve',
label: "数据申请",
disabled: scope.row.rightMain === userData.tenantGuid,
// 点击申请数据
click: (scope) => {
// TODO,是否申请过的不能再申请?
......
......@@ -200,8 +200,8 @@ const registerDetailTableInfo = ref({
const getDetailInfo = () => {
fullscreenLoading.value = true;
getRegisterCatalogDetail({ guid: catalogGuid, serviceTenantGuid: route.query.tenantGuid }).then((res: any) => {
if (res.code == proxy.$passCode) {
getRegisterCatalogDetail({ guid: catalogGuid, serviceTenantGuid: route.query.tenantGuid }, foundMode.value === 'tdsUse').then((res: any) => {
if (res?.code == proxy.$passCode) {
const data = res.data || {};
detailInfo.value = data;
publicDataProductsMainRSVO.value = detailInfo.value.publicDataProductsMainRSVO || {};
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!