NEZ-3231 fix:software asset 查看二级页面开发

This commit is contained in:
zhangyu
2023-10-17 09:58:16 +08:00
parent 72f2f52af7
commit 08ca55a0d1
7 changed files with 24 additions and 4 deletions

View File

@@ -82,6 +82,10 @@
<discovery-tab v-if="from === fromRoute.assetDiscovery && targetTab === 'assetDiscoveryTab'" :from="from" :obj="obj" :tabs="tabs.discovery" @changeTab="changeTab" :targetTab.sync="targetTab"></discovery-tab>
<!-- notebook Tab -->
<notebook-tab @getTableData="getTableData" v-if="from === fromRoute.notebook && targetTab === 'notebookTab'" :from="from" :obj="obj" :tabs="tabs.notebook" @changeTab="changeTab" :targetTab.sync="targetTab"></notebook-tab>
<!--softwareAsset列表的tab-->
<endpointTabNew v-if="from === fromRoute.softwareAsset && targetTab === 'endpoint'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.softwareAssetTabTitle" :targetTab="targetTab" @changeTab="changeTab"></endpointTabNew>
<!--model 下滑-->
<asset-tab v-if="(from === fromRoute.softwareType) && targetTab === 'asset'" :tabs="tabs.softwareType" ref="assetTab" :from="from" :obj="obj" @changeTab="changeTab" @exit="closeSubList" :targetTab.sync="targetTab"></asset-tab>
</div>
</div>
</div>
@@ -241,6 +245,11 @@ export default {
{ prop: 'moduleAlertMessage', name: this.$t('overall.alert') }
]
},
softwareAsset: {
softwareAssetTabTitle: [
{ prop: 'endpoint', name: this.$t('asset.endpoint') },
]
},
endpoint: {
endpointTabTitle: [
{ prop: 'dashboardTab', name: this.$t('overall.dashboard') },
@@ -268,6 +277,9 @@ export default {
model: [
{ prop: 'asset', name: this.$t('asset.asset'), active: true }
],
softwareType: [
{ prop: 'asset', name: this.$t('asset.asset'), active: true }
],
dc: {
cabinet: [
{ prop: 'cabinet', name: this.$t('asset.cabinet'), active: true },

View File

@@ -233,6 +233,7 @@ export default {
// this.$store.commit('addConsole', consoleParam)
},
getTableData (params) {
let url = this.url
if (params && Object.keys(params).length > 0) {
for (const key in params) {
this.$set(this.searchLabel, key, params[key])
@@ -249,9 +250,12 @@ export default {
this.$set(this.searchLabel, 'modelIds', this.obj.id)
} else if (this.from === fromRoute.dc) {
this.$set(this.searchLabel, 'dcIds', this.obj.id)
} else if (this.from === fromRoute.softwareType) {
url = '/asset/software'
this.$set(this.searchLabel, 'typeIds', this.obj.id)
}
this.tools.loading = true
this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then(response => {
this.$get(url, { ...this.searchLabel, ...this.searchCheckBox }).then(response => {
this.tools.loading = false
if (response.code === 200) {
for (let i = 0; i < response.data.list.length; i++) {

View File

@@ -138,6 +138,8 @@ export default {
params.moduleIds = this.obj.id
} else if (this.from === fromRoute.asset) {
params.assetIds = this.obj.id
} else if (this.from === fromRoute.softwareAsset) {
params.softwareAssetIds = this.obj.id
}
this.$get(this.url, params).then(response => {
this.tools.loading = false

View File

@@ -424,6 +424,8 @@ export const fromRoute = {
assetType: 'assetType',
assetState: 'assetState',
assetLabel: 'assetLabel',
softwareAsset: 'softwareAsset',
softwareType: 'softwareType',
assetDiscovery: 'assetDiscovery',
user: 'user',
agent: 'agent',

View File

@@ -92,7 +92,7 @@
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
<div slot-scope="scope" class="table-operation-items">
<!-- <button class="table-operation-item" v-has="'softwareAsset_edit'" @click="$emit('edit', scope.row)" :title="$t('overall.edit')"><i class="nz-icon nz-icon-edit"></i></button> -->
<button class="table-operation-item" @click="showBottomBox('asset', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<button class="table-operation-item" @click="showBottomBox('endpoint', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<el-dropdown size="medium" v-has="['softwareAsset_delete','main_edit','softwareAsset_edit']" trigger="click" @command="tableOperation">
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
<i class="nz-icon nz-icon-more3"></i>

View File

@@ -4,7 +4,7 @@
ref="dataList"
:api="url"
:custom-table-title.sync="tools.customTableTitle"
:from="fromRoute.model"
:from="fromRoute.softwareAsset"
:layout="['searchInput', 'elementSet', 'pagination']"
:search-msg="searchMsg"
@search="search"

View File

@@ -4,7 +4,7 @@
ref="dataList"
:api="url"
:custom-table-title.sync="tools.customTableTitle"
:from="fromRoute.model"
:from="fromRoute.softwareType"
:layout="['searchInput', 'elementSet', 'pagination']"
:search-msg="searchMsg"
@search="search"