feat:表格添加搜素框
This commit is contained in:
@@ -256,6 +256,7 @@
|
||||
lineName:n.label,
|
||||
name:[],
|
||||
dashes:!n.dashes?n.dashes:JSON.stringify(n.dashes),
|
||||
// dashes:!n.dashes?n.dashes:JSON.stringify([n.dashes[2],n.dashes[2]]),
|
||||
};
|
||||
if( n.expressions){
|
||||
n.expressions.forEach((item,index)=>{
|
||||
|
||||
@@ -466,7 +466,10 @@
|
||||
float: right;
|
||||
}
|
||||
/deep/ .top-tools>div{
|
||||
margin-top: 3px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
/deep/.el-tooltip{
|
||||
display: inline-block;
|
||||
}
|
||||
/* end--table*/
|
||||
</style>
|
||||
|
||||
@@ -14,6 +14,21 @@
|
||||
<div class="right-box-title">Asset</div>
|
||||
<!-- end--标题-->
|
||||
|
||||
<!-- begin搜素框-->
|
||||
<div class="top-tools">
|
||||
<div class="top-tool-main-right" :class="{'top-tool-main-right-to-left': false}">
|
||||
<div class="top-tool-search">
|
||||
<search-input :searchMsg="searchMsg" @search="search" :bottomBox.inTransform="true"></search-input>
|
||||
</div>
|
||||
<!--<button type="button" @click="showExportDialog" :title="$t('overall.exportExcelLower')"-->
|
||||
<!--class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="alert-list-export">-->
|
||||
<!--<i class="el-icon-download"></i>-->
|
||||
<!--</button>-->
|
||||
</div>
|
||||
<div class="pagination-top pagination-top-hide display-none"></div>
|
||||
</div>
|
||||
<!-- end搜素框-->
|
||||
|
||||
<!-- begin--表格-->
|
||||
<el-scrollbar class="right-box-form-box">
|
||||
<el-table
|
||||
@@ -169,6 +184,40 @@
|
||||
show: true,
|
||||
width: 100
|
||||
},],
|
||||
searchMsg: { //给搜索框子组件传递的信息
|
||||
zheze_none: true,
|
||||
searchLabelList: [{
|
||||
id: 1,
|
||||
name: 'ID',
|
||||
type: 'input',
|
||||
label: 'id',
|
||||
disabled: false
|
||||
},{
|
||||
id: 20,
|
||||
name: 'SN',
|
||||
type: 'input',
|
||||
label: 'sn',
|
||||
disabled: false
|
||||
},{
|
||||
id: 21,
|
||||
name: 'Host',
|
||||
type: 'input',
|
||||
label: 'host',
|
||||
disabled: false
|
||||
},{
|
||||
id: 22,
|
||||
name: this.$t("asset.state"),
|
||||
type: 'select',
|
||||
label: 'assetState',
|
||||
disabled: false
|
||||
},{
|
||||
id: 23,
|
||||
name: "pingStatus",
|
||||
type: 'select',
|
||||
label: 'pingStatus',
|
||||
disabled: false
|
||||
}],
|
||||
},
|
||||
tableData:[],
|
||||
loading:false,
|
||||
tableHeight:'100%',
|
||||
@@ -264,6 +313,23 @@
|
||||
this.tableTitle=this.tableTitle.filter(item=>item.prop!=='pingStatus');
|
||||
}
|
||||
},
|
||||
search(searchObj) {
|
||||
let orderBy = '';
|
||||
if(this.searchLabel.orderBy){
|
||||
orderBy = this.searchLabel.orderBy
|
||||
}
|
||||
this.searchLabel = {};
|
||||
this.pageObj.pageNo = 1;
|
||||
for (let item in searchObj) {
|
||||
if (searchObj[item]) {
|
||||
this.$set(this.searchLabel, item, searchObj[item]);
|
||||
}
|
||||
}
|
||||
if(orderBy){
|
||||
this.$set(this.searchLabel, 'orderBy', orderBy);
|
||||
}
|
||||
this.getAssetList();
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
@@ -288,6 +354,12 @@
|
||||
/deep/.resize-box .danger{
|
||||
background-color: #f9f9f9 !important;
|
||||
}
|
||||
.top-tools{
|
||||
float: right;
|
||||
}
|
||||
/deep/ .top-tools>div{
|
||||
margin-top: 6px;
|
||||
}
|
||||
/* end--table*/
|
||||
</style>
|
||||
|
||||
|
||||
@@ -14,6 +14,21 @@
|
||||
<div class="right-box-title">Endpoint</div>
|
||||
<!-- end--标题-->
|
||||
|
||||
<!-- begin搜素框-->
|
||||
<div class="top-tools">
|
||||
<div class="top-tool-main-right" :class="{'top-tool-main-right-to-left': false}">
|
||||
<div class="top-tool-search">
|
||||
<search-input :searchMsg="searchMsg" @search="search" :bottomBox.inTransform="true"></search-input>
|
||||
</div>
|
||||
<!--<button type="button" @click="showExportDialog" :title="$t('overall.exportExcelLower')"-->
|
||||
<!--class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="alert-list-export">-->
|
||||
<!--<i class="el-icon-download"></i>-->
|
||||
<!--</button>-->
|
||||
</div>
|
||||
<div class="pagination-top pagination-top-hide display-none"></div>
|
||||
</div>
|
||||
<!-- end搜素框-->
|
||||
|
||||
<!-- begin--表格-->
|
||||
<el-scrollbar class="right-box-form-box">
|
||||
<el-table
|
||||
@@ -163,6 +178,22 @@
|
||||
// show: true,
|
||||
// },
|
||||
],
|
||||
searchMsg: { //给搜索框子组件传递的信息
|
||||
zheze_none: true,
|
||||
searchLabelList: [{
|
||||
id: 1,
|
||||
name: "ID",
|
||||
type: 'input',
|
||||
label: 'id',
|
||||
disabled: false
|
||||
}, {
|
||||
id: 11,
|
||||
name: this.$t('asset.asset'),
|
||||
type: 'asset',
|
||||
label: 'asset',
|
||||
disabled: false
|
||||
}],
|
||||
},
|
||||
tableData:[],
|
||||
loading:false,
|
||||
tableHeight:'100%',
|
||||
@@ -275,6 +306,27 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
search(searchObj) {
|
||||
let orderBy='';
|
||||
if(this.searchLabel.orderBy){
|
||||
orderBy=this.searchLabel.orderBy
|
||||
}
|
||||
this.searchLabel = {};
|
||||
this.pageObj.pageNo = 1;
|
||||
for (let item in searchObj) {
|
||||
if (searchObj[item]) {
|
||||
if (item == "alertMessageState") {
|
||||
this.$set(this.searchLabel, "state", searchObj[item]);
|
||||
} else{
|
||||
this.$set(this.searchLabel, item, searchObj[item]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(orderBy){
|
||||
this.$set(this.searchLabel, 'orderBy', orderBy);
|
||||
}
|
||||
this.getEndpointList();
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
@@ -299,6 +351,12 @@
|
||||
/deep/.resize-box .danger{
|
||||
background-color: #f9f9f9 !important;
|
||||
}
|
||||
.top-tools{
|
||||
float: right;
|
||||
}
|
||||
/deep/ .top-tools>div{
|
||||
margin-top: 6px;
|
||||
}
|
||||
/* end--table*/
|
||||
</style>
|
||||
|
||||
|
||||
@@ -265,14 +265,14 @@
|
||||
item.from=item.source;
|
||||
item.to=item.target;
|
||||
item.label=item.name;
|
||||
item.dashes=(item.dashes?(new Array(100).fill(item.dashes[0])):item.dashes);
|
||||
if(index%2==0&&item.dashes){
|
||||
item.dataFlow='left';
|
||||
item.dashes[0]=0;
|
||||
item.dashes[1]=0;
|
||||
} else if(index%2==1&&item.dashes){
|
||||
item.dataFlow='right'
|
||||
}
|
||||
// item.dashes=(item.dashes?(new Array(100).fill(item.dashes[0])):item.dashes);
|
||||
// if(index%2==0&&item.dashes){
|
||||
// item.dataFlow='left';
|
||||
// item.dashes[0]=0;
|
||||
// item.dashes[1]=0;
|
||||
// } else if(index%2==1&&item.dashes){
|
||||
// item.dataFlow='right'
|
||||
// }
|
||||
});
|
||||
return arr
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user