feat:修改查询asset的参数为query 以及修改aseet列的显示
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
export-file-name="endpoint"
|
export-file-name="endpoint"
|
||||||
export-url="/endpoint/export"
|
export-url="/endpoint/export"
|
||||||
import-url="/endpoint/import"
|
import-url="/endpoint/import"
|
||||||
:params="searchLabel"
|
:params="endpointSearchLabel"
|
||||||
@afterImport="getTableData"
|
@afterImport="getTableData"
|
||||||
class="margin-l-20"
|
class="margin-l-20"
|
||||||
>
|
>
|
||||||
@@ -57,13 +57,16 @@
|
|||||||
:width="item.width"
|
:width="item.width"
|
||||||
:key="`col-${index}`"
|
:key="`col-${index}`"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
min-width="110px"
|
:min-width="(item.minWidth?item.minWidth+'px':'110px')"
|
||||||
:sortable="$tableSet.sortableShow(item.prop,'endpointTab')"
|
:sortable="$tableSet.sortableShow(item.prop,'endpointTab')"
|
||||||
:prop="$tableSet.propTitle(item.prop,'endpointTab')"
|
:prop="$tableSet.propTitle(item.prop,'endpointTab')"
|
||||||
:sort-orders="['ascending', 'descending']"
|
:sort-orders="['ascending', 'descending']"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope" :column="item">
|
<template slot-scope="scope" :column="item">
|
||||||
<span v-if="item.prop == 'asset' && scope.row[item.prop]" class="link" @click="">{{scope.row[item.prop].host}}</span>
|
<span v-if="item.prop == 'asset' && scope.row[item.prop]" class="link" @click="">
|
||||||
|
{{scope.row[item.prop].sn}} :
|
||||||
|
({{scope.row[item.prop].host}})
|
||||||
|
</span>
|
||||||
<span v-else-if="item.prop == 'project' && scope.row[item.prop]">{{scope.row.project.name}}</span>
|
<span v-else-if="item.prop == 'project' && scope.row[item.prop]">{{scope.row.project.name}}</span>
|
||||||
<span v-else-if="item.prop == 'module' && scope.row[item.prop]">{{scope.row.module.name}}</span>
|
<span v-else-if="item.prop == 'module' && scope.row[item.prop]">{{scope.row.module.name}}</span>
|
||||||
<span v-else-if="item.prop == 'param'">
|
<span v-else-if="item.prop == 'param'">
|
||||||
@@ -175,6 +178,7 @@
|
|||||||
label: this.$t("project.endpoint.asset"),
|
label: this.$t("project.endpoint.asset"),
|
||||||
prop: 'asset',
|
prop: 'asset',
|
||||||
show: true,
|
show: true,
|
||||||
|
minWidth:'400',
|
||||||
},{
|
},{
|
||||||
label: this.$t("project.endpoint.host"),
|
label: this.$t("project.endpoint.host"),
|
||||||
prop: 'host',
|
prop: 'host',
|
||||||
@@ -183,6 +187,7 @@
|
|||||||
label: this.$t("project.endpoint.port"),
|
label: this.$t("project.endpoint.port"),
|
||||||
prop: 'port',
|
prop: 'port',
|
||||||
show: true,
|
show: true,
|
||||||
|
width:'120'
|
||||||
},{
|
},{
|
||||||
label: this.$t("overall.type"),
|
label: this.$t("overall.type"),
|
||||||
prop: 'type',
|
prop: 'type',
|
||||||
@@ -199,6 +204,7 @@
|
|||||||
label: this.$t("alert.list.state"),
|
label: this.$t("alert.list.state"),
|
||||||
prop: 'state',
|
prop: 'state',
|
||||||
show: true,
|
show: true,
|
||||||
|
width:'80'
|
||||||
},{
|
},{
|
||||||
label: this.$t("project.endpoint.alerts"),
|
label: this.$t("project.endpoint.alerts"),
|
||||||
prop: 'alerts',
|
prop: 'alerts',
|
||||||
@@ -231,12 +237,12 @@
|
|||||||
}, {
|
}, {
|
||||||
id: 11,
|
id: 11,
|
||||||
name: this.$t('asset.asset'),
|
name: this.$t('asset.asset'),
|
||||||
type: 'asset',
|
type: 'query',
|
||||||
label: 'asset',
|
label: 'query',
|
||||||
disabled: false
|
disabled: false
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
searchLabel: { //搜索参数
|
endpointSearchLabel: { //搜索参数
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [],
|
||||||
}
|
}
|
||||||
@@ -309,18 +315,18 @@
|
|||||||
},
|
},
|
||||||
search(searchObj) {
|
search(searchObj) {
|
||||||
let orderBy = '';
|
let orderBy = '';
|
||||||
if(this.searchLabel.orderBy){
|
if(this.endpointSearchLabel.orderBy){
|
||||||
orderBy=this.searchLabel.orderBy
|
orderBy=this.endpointSearchLabel.orderBy
|
||||||
}
|
}
|
||||||
this.searchLabel = {};
|
this.endpointSearchLabel = {};
|
||||||
this.pageObj.pageNo = 1;
|
// this.pageObj.pageNo = 1;
|
||||||
for (let item in searchObj) {
|
for (let item in searchObj) {
|
||||||
if (searchObj[item]) {
|
if (searchObj[item]) {
|
||||||
this.$set(this.searchLabel, item, searchObj[item]);
|
this.$set(this.endpointSearchLabel, item, searchObj[item]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(orderBy){
|
if(orderBy){
|
||||||
this.$set(this.searchLabel, 'orderBy', orderBy);
|
this.$set(this.endpointSearchLabel, 'orderBy', orderBy);
|
||||||
}
|
}
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -80,7 +80,10 @@
|
|||||||
:sort-orders="['ascending', 'descending']"
|
:sort-orders="['ascending', 'descending']"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope" :column="item" >
|
<template slot-scope="scope" :column="item" >
|
||||||
<span v-if="item.prop == 'asset' && scope.row[item.prop]" class="link" @click="detailEndpoint(scope.row)">{{scope.row[item.prop].host}}</span>
|
<span v-if="item.prop == 'asset' && scope.row[item.prop]" class="link" @click="detailEndpoint(scope.row)">
|
||||||
|
{{scope.row[item.prop].sn}} :
|
||||||
|
({{scope.row[item.prop].host}})
|
||||||
|
</span>
|
||||||
<span v-else-if="item.prop == 'param'">
|
<span v-else-if="item.prop == 'param'">
|
||||||
<template v-if="scope.row.paramObj">
|
<template v-if="scope.row.paramObj">
|
||||||
<span v-for="(p,i) in scope.row.paramObj">{{p.key}}={{p.value}}<span v-if="i < scope.row.paramObj.length-1">,</span></span>
|
<span v-for="(p,i) in scope.row.paramObj">{{p.key}}={{p.value}}<span v-if="i < scope.row.paramObj.length-1">,</span></span>
|
||||||
@@ -234,6 +237,7 @@
|
|||||||
label: this.$t("project.endpoint.port"),
|
label: this.$t("project.endpoint.port"),
|
||||||
prop: 'port',
|
prop: 'port',
|
||||||
show: true,
|
show: true,
|
||||||
|
width:100,
|
||||||
},{
|
},{
|
||||||
label: this.$t("overall.type"),
|
label: this.$t("overall.type"),
|
||||||
prop: 'type',
|
prop: 'type',
|
||||||
@@ -250,6 +254,7 @@
|
|||||||
label: this.$t("alert.list.state"),
|
label: this.$t("alert.list.state"),
|
||||||
prop: 'state',
|
prop: 'state',
|
||||||
show: true,
|
show: true,
|
||||||
|
width:80,
|
||||||
},{
|
},{
|
||||||
label: this.$t("project.endpoint.alerts"),
|
label: this.$t("project.endpoint.alerts"),
|
||||||
prop: 'alerts',
|
prop: 'alerts',
|
||||||
@@ -294,8 +299,9 @@
|
|||||||
}, {
|
}, {
|
||||||
id: 11,
|
id: 11,
|
||||||
name: this.$t('asset.asset'),
|
name: this.$t('asset.asset'),
|
||||||
type: 'asset',
|
// name: this.$t('asset.asset'),
|
||||||
label: 'asset',
|
type: 'query',
|
||||||
|
label: 'query',
|
||||||
disabled: false
|
disabled: false
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user