525e8f30 by lihua

修改产品详情策略按钮控制

1 parent adef202e
......@@ -105,12 +105,29 @@ const tableInfo = ref({
actionInfo: {
label: "操作",
type: "btn",
width: 230,
width: 200,
btns: (scope) => {
let actions = scope.row.actions || {};
let arrBtns: any = [];
if (scope.row.contractStatus != '06') {
for (let action in actions) {
if (action == 'download') {
let index = arrBtns.findIndex(a => a.value == 'read');
if (index > -1) {
arrBtns[index] = { label: '查看', value: 'readAndDown', click: btnHanldesMap[action] };
continue;
}
}
if (action == 'read') {
let index = arrBtns.findIndex(a => a.value == 'download');
if (index > -1) {
arrBtns[index] = { label: '查看', value: 'readAndDown', click: btnHanldesMap[action] };
continue;
}
}
if (action == 'distribute' && scope.row.isDistribute == 'Y') {
continue
}
arrBtns.push({ label: actions[action], value: action, click: btnHanldesMap[action] });
}
}
......@@ -146,6 +163,18 @@ const btnHanldesMap = {
}
});
},
readAndDown: (scope) => { //下载
router.push({
name: 'usageCatalogDetail',
query: {
guid: scope.row.dataProductGuid,
type: 'detail',
foundMode: 'readAndDown',
name: scope.row.dataProductName,
useGuid: scope.row.guid
}
});
},
distribute: (scope) => { //分发
currTableData.value = scope.row;
tenantDialogInfo.value.visible = true;
......
......@@ -33,6 +33,7 @@ import {
downloadTableData,
downloadTableDataCheck
} from "@/api/modules/dataDelivery";
import StrategyTable from '../data_smart_contract/components/strategyTable.vue';
const router = useRouter();
const route = useRoute();
......@@ -370,18 +371,24 @@ const productTableInfo = ref({
loading: false
});
/** ----- 服务信息 ----- */
const strategyDetail = ref([]);
const strategyContentLoading = ref(false);
onBeforeMount(() => {
if (!assetStore.isRefreshDamCatalog) {
getDetailInfo();
}
});
onActivated(() => {
if (fullPath === route.fullPath) {
document.title = foundMode.value == 'download' ? `下载详情-${route.query.name}` : (foundMode.value == 'read' ? `查看详情-${route.query.name}` : `详情-${route.query.name}`);
document.title = foundMode.value == 'download' ? `下载详情-${route.query.name}` : ((foundMode.value == 'read' || foundMode.value == 'readAndDown') ? `查看详情-${route.query.name}` : `详情-${route.query.name}`);
let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath);
if (tab) {
tab.meta.title = foundMode.value == 'download' ? `下载详情-${route.query.name}` : (foundMode.value == 'read' ? `查看详情-${route.query.name}` : `详情-${route.query.name}`);
tab.meta.title = foundMode.value == 'download' ? `下载详情-${route.query.name}` : ((foundMode.value == 'read' || foundMode.value == 'readAndDown') ? `查看详情-${route.query.name}` : `详情-${route.query.name}`);
}
}
if (assetStore.isRefreshDamCatalog) {
......@@ -1494,15 +1501,24 @@ const respParamsTableInfo = ref({
<span>{{ scope.row["updateTime"] || '--' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" v-if="!detailInfo?.nodeId || foundMode == 'download' || foundMode == 'read'" minWidth="120px" align="left" fixed="right" show-overflow-tooltip>
<el-table-column label="操作" v-if="!detailInfo.nodeId || foundMode == 'download' || foundMode == 'read' || foundMode == 'readAndDown'"
width="220px" align="left" fixed="right" show-overflow-tooltip>
<template #default="scope">
<span class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span>
<el-divider v-show="foundMode == 'download'" direction="vertical" />
<span v-show="foundMode == 'download'" class="text_btn" @click="handleTableViewDataDown(scope)">下载数据</span>
<!-- 如果是下载,就只显示下载,如果是查看和下载就都显示,就两个按钮都显示。仅查看,就仅查看 -->
<span v-show="foundMode != 'download'" class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span>
<el-divider v-show="foundMode == 'readAndDown'" direction="vertical" />
<span v-show="foundMode == 'download' || foundMode == 'readAndDown'" class="text_btn"
@click="handleTableViewDataDown(scope)">下载数据</span>
</template>
</el-table-column>
</el-table>
</ContentWrap>
<ContentWrap v-if="strategyDetail?.length" id="strategy-info" title="合约策略信息" style="margin: 16px 16px 16px">
<div v-loading="strategyContentLoading">
<StrategyTable ref="strategyTableDetailRef" :show-title="true" :is-look="true" :value="strategyDetail">
</StrategyTable>
</div>
</ContentWrap>
<ContentWrap
v-if="(route.query.type == 'qualityEvaluate' && evaDetailInfo?.qualityEvaluationFile?.length > 0) || (route.query.type == 'costAssess' && costAssessDetail?.costAssessmentFile?.length > 0)"
id="id-assetContent" title="附件信息" description="" style="margin: 16px 16px 16px">
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!