修改产品详情策略按钮控制
Showing
2 changed files
with
50 additions
and
7 deletions
| ... | @@ -105,12 +105,29 @@ const tableInfo = ref({ | ... | @@ -105,12 +105,29 @@ const tableInfo = ref({ |
| 105 | actionInfo: { | 105 | actionInfo: { |
| 106 | label: "操作", | 106 | label: "操作", |
| 107 | type: "btn", | 107 | type: "btn", |
| 108 | width: 230, | 108 | width: 200, |
| 109 | btns: (scope) => { | 109 | btns: (scope) => { |
| 110 | let actions = scope.row.actions || {}; | 110 | let actions = scope.row.actions || {}; |
| 111 | let arrBtns: any = []; | 111 | let arrBtns: any = []; |
| 112 | if (scope.row.contractStatus != '06') { | 112 | if (scope.row.contractStatus != '06') { |
| 113 | for (let action in actions) { | 113 | for (let action in actions) { |
| 114 | if (action == 'download') { | ||
| 115 | let index = arrBtns.findIndex(a => a.value == 'read'); | ||
| 116 | if (index > -1) { | ||
| 117 | arrBtns[index] = { label: '查看', value: 'readAndDown', click: btnHanldesMap[action] }; | ||
| 118 | continue; | ||
| 119 | } | ||
| 120 | } | ||
| 121 | if (action == 'read') { | ||
| 122 | let index = arrBtns.findIndex(a => a.value == 'download'); | ||
| 123 | if (index > -1) { | ||
| 124 | arrBtns[index] = { label: '查看', value: 'readAndDown', click: btnHanldesMap[action] }; | ||
| 125 | continue; | ||
| 126 | } | ||
| 127 | } | ||
| 128 | if (action == 'distribute' && scope.row.isDistribute == 'Y') { | ||
| 129 | continue | ||
| 130 | } | ||
| 114 | arrBtns.push({ label: actions[action], value: action, click: btnHanldesMap[action] }); | 131 | arrBtns.push({ label: actions[action], value: action, click: btnHanldesMap[action] }); |
| 115 | } | 132 | } |
| 116 | } | 133 | } |
| ... | @@ -146,6 +163,18 @@ const btnHanldesMap = { | ... | @@ -146,6 +163,18 @@ const btnHanldesMap = { |
| 146 | } | 163 | } |
| 147 | }); | 164 | }); |
| 148 | }, | 165 | }, |
| 166 | readAndDown: (scope) => { //下载 | ||
| 167 | router.push({ | ||
| 168 | name: 'usageCatalogDetail', | ||
| 169 | query: { | ||
| 170 | guid: scope.row.dataProductGuid, | ||
| 171 | type: 'detail', | ||
| 172 | foundMode: 'readAndDown', | ||
| 173 | name: scope.row.dataProductName, | ||
| 174 | useGuid: scope.row.guid | ||
| 175 | } | ||
| 176 | }); | ||
| 177 | }, | ||
| 149 | distribute: (scope) => { //分发 | 178 | distribute: (scope) => { //分发 |
| 150 | currTableData.value = scope.row; | 179 | currTableData.value = scope.row; |
| 151 | tenantDialogInfo.value.visible = true; | 180 | tenantDialogInfo.value.visible = true; | ... | ... |
| ... | @@ -32,6 +32,7 @@ import { | ... | @@ -32,6 +32,7 @@ import { |
| 32 | downloadTableData, | 32 | downloadTableData, |
| 33 | downloadTableDataCheck | 33 | downloadTableDataCheck |
| 34 | } from "@/api/modules/dataDelivery"; | 34 | } from "@/api/modules/dataDelivery"; |
| 35 | import StrategyTable from '../data_smart_contract/components/strategyTable.vue'; | ||
| 35 | 36 | ||
| 36 | const router = useRouter(); | 37 | const router = useRouter(); |
| 37 | const route = useRoute(); | 38 | const route = useRoute(); |
| ... | @@ -371,18 +372,24 @@ const productTableInfo = ref({ | ... | @@ -371,18 +372,24 @@ const productTableInfo = ref({ |
| 371 | loading: false | 372 | loading: false |
| 372 | }); | 373 | }); |
| 373 | 374 | ||
| 375 | /** ----- 服务信息 ----- */ | ||
| 376 | const strategyDetail = ref([]); | ||
| 377 | |||
| 378 | const strategyContentLoading = ref(false); | ||
| 379 | |||
| 374 | onBeforeMount(() => { | 380 | onBeforeMount(() => { |
| 375 | if (!assetStore.isRefreshDamCatalog) { | 381 | if (!assetStore.isRefreshDamCatalog) { |
| 376 | getDetailInfo(); | 382 | getDetailInfo(); |
| 377 | } | 383 | } |
| 384 | |||
| 378 | }); | 385 | }); |
| 379 | 386 | ||
| 380 | onActivated(() => { | 387 | onActivated(() => { |
| 381 | if (fullPath === route.fullPath) { | 388 | if (fullPath === route.fullPath) { |
| 382 | document.title = foundMode.value == 'download' ? `下载详情-${route.query.name}` : (foundMode.value == 'read' ? `查看详情-${route.query.name}` : `详情-${route.query.name}`); | 389 | document.title = foundMode.value == 'download' ? `下载详情-${route.query.name}` : ((foundMode.value == 'read' || foundMode.value == 'readAndDown') ? `查看详情-${route.query.name}` : `详情-${route.query.name}`); |
| 383 | let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath); | 390 | let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath); |
| 384 | if (tab) { | 391 | if (tab) { |
| 385 | tab.meta.title = foundMode.value == 'download' ? `下载详情-${route.query.name}` : (foundMode.value == 'read' ? `查看详情-${route.query.name}` : `详情-${route.query.name}`); | 392 | tab.meta.title = foundMode.value == 'download' ? `下载详情-${route.query.name}` : ((foundMode.value == 'read' || foundMode.value == 'readAndDown') ? `查看详情-${route.query.name}` : `详情-${route.query.name}`); |
| 386 | } | 393 | } |
| 387 | } | 394 | } |
| 388 | if (assetStore.isRefreshDamCatalog) { | 395 | if (assetStore.isRefreshDamCatalog) { |
| ... | @@ -1484,17 +1491,24 @@ const respParamsTableInfo = ref({ | ... | @@ -1484,17 +1491,24 @@ const respParamsTableInfo = ref({ |
| 1484 | <span>{{ scope.row["updateTime"] || '--' }}</span> | 1491 | <span>{{ scope.row["updateTime"] || '--' }}</span> |
| 1485 | </template> | 1492 | </template> |
| 1486 | </el-table-column> | 1493 | </el-table-column> |
| 1487 | <el-table-column label="操作" v-if="!detailInfo.nodeId || foundMode == 'download' || foundMode == 'read'" | 1494 | <el-table-column label="操作" v-if="!detailInfo.nodeId || foundMode == 'download' || foundMode == 'read' || foundMode == 'readAndDown'" |
| 1488 | width="220px" align="left" fixed="right" show-overflow-tooltip> | 1495 | width="220px" align="left" fixed="right" show-overflow-tooltip> |
| 1489 | <template #default="scope"> | 1496 | <template #default="scope"> |
| 1490 | <span class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span> | 1497 | <!-- 如果是下载,就只显示下载,如果是查看和下载就都显示,就两个按钮都显示。仅查看,就仅查看 --> |
| 1491 | <el-divider v-show="foundMode == 'download'" direction="vertical" /> | 1498 | <span v-show="foundMode != 'download'" class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span> |
| 1492 | <span v-show="foundMode == 'download'" class="text_btn" | 1499 | <el-divider v-show="foundMode == 'readAndDown'" direction="vertical" /> |
| 1500 | <span v-show="foundMode == 'download' || foundMode == 'readAndDown'" class="text_btn" | ||
| 1493 | @click="handleTableViewDataDown(scope)">下载数据</span> | 1501 | @click="handleTableViewDataDown(scope)">下载数据</span> |
| 1494 | </template> | 1502 | </template> |
| 1495 | </el-table-column> | 1503 | </el-table-column> |
| 1496 | </el-table> | 1504 | </el-table> |
| 1497 | </ContentWrap> | 1505 | </ContentWrap> |
| 1506 | <ContentWrap v-if="strategyDetail?.length" id="strategy-info" title="合约策略信息" style="margin: 16px 16px 16px"> | ||
| 1507 | <div v-loading="strategyContentLoading"> | ||
| 1508 | <StrategyTable ref="strategyTableDetailRef" :show-title="true" :is-look="true" :value="strategyDetail"> | ||
| 1509 | </StrategyTable> | ||
| 1510 | </div> | ||
| 1511 | </ContentWrap> | ||
| 1498 | <ContentWrap | 1512 | <ContentWrap |
| 1499 | v-if="(route.query.type == 'qualityEvaluate' && evaDetailInfo?.qualityEvaluationFile?.length > 0) || (route.query.type == 'costAssess' && costAssessDetail?.costAssessmentFile?.length > 0)" | 1513 | v-if="(route.query.type == 'qualityEvaluate' && evaDetailInfo?.qualityEvaluationFile?.length > 0) || (route.query.type == 'costAssess' && costAssessDetail?.costAssessmentFile?.length > 0)" |
| 1500 | id="id-assetContent" title="附件信息" description="" style="margin: 16px 16px 16px"> | 1514 | id="id-assetContent" title="附件信息" description="" style="margin: 16px 16px 16px"> | ... | ... |
-
Please register or sign in to post a comment