NEZ-427 feat:所有列表页面添加多选删除

This commit is contained in:
wangwenrui
2020-10-29 19:11:46 +08:00
parent 530cf1aabb
commit e290b5761f
18 changed files with 267 additions and 37 deletions

View File

@@ -2254,3 +2254,10 @@ li{
.alert-level-P3{ .alert-level-P3{
background: #f7ba78; background: #f7ba78;
} }
.required-marker {
label:before{
content: '*';
color: #F56C6C;
margin-right: 4px;
}
}

View File

@@ -3,11 +3,6 @@
</style> </style>
<template> <template>
<div :class="{'contentTable':!projectAlertId,'relative-position':true,'contentProject':projectAlertId}"> <div :class="{'contentTable':!projectAlertId,'relative-position':true,'contentProject':projectAlertId}">
<transition name="el-zoom-in-bottom">
<div class="el-popover alert-clean-pop" @click="toDeleteMessage(false)" v-if="deleteBox.ids.length > 0">
<i style="cursor: pointer" class="nz-icon nz-icon-delete"></i>
</div>
</transition>
<!-- 自定义table列 --> <!-- 自定义table列 -->
<transition name="el-zoom-in-top"> <transition name="el-zoom-in-top">
<element-set <element-set
@@ -39,7 +34,7 @@
<el-table-column <el-table-column
:resizable="false" :resizable="false"
type="selection" type="selection"
width="38" width="40"
align="center" align="center"
> >
</el-table-column> </el-table-column>
@@ -187,7 +182,11 @@
<div class="export-xlsx"> <div class="export-xlsx">
<el-dialog :visible.sync="deleteBox.show" :title="$t('overall.delete')" :modal-append-to-body='false' :show-close="true" width="300px" @close="closeDialog" class="nz-message"> <el-dialog :visible.sync="deleteBox.show" :title="$t('overall.delete')" :modal-append-to-body='false' :show-close="true" width="300px" @close="closeDialog" class="nz-message">
<div class="upload-body"> <div class="upload-body">
<el-form ref="remarkForm" :model="deleteBox">
<el-form-item :rules="[{required: true, message: this.$t('validate.required'), trigger: 'blur'}]" prop="remark">
<el-input type="textarea" :placeholder="$t('alert.description')" v-model="deleteBox.remark"></el-input> <el-input type="textarea" :placeholder="$t('alert.description')" v-model="deleteBox.remark"></el-input>
</el-form-item>
</el-form>
<div style="text-align: right; margin-top: 10px;"> <div style="text-align: right; margin-top: 10px;">
<button @click="closeDialog" class="el-button el-button--default el-button--small"> <button @click="closeDialog" class="el-button el-button--default el-button--small">
<span>{{$t('tip.no')}}</span> <span>{{$t('tip.no')}}</span>
@@ -409,6 +408,7 @@
this.queryChartDate() this.queryChartDate()
}) })
}, },
formatThreshold:function(value,unit){ formatThreshold:function(value,unit){
let unitMethod=chartDataFormat.getUnit(unit) let unitMethod=chartDataFormat.getUnit(unit)
if(unitMethod&&value){ if(unitMethod&&value){
@@ -598,13 +598,19 @@
if (obj) { if (obj) {
this.deleteBox.ids = obj.id + ""; this.deleteBox.ids = obj.id + "";
} }
this.deleteBox.remark="";
this.deleteBox.show = true; this.deleteBox.show = true;
}, },
deleteMessage() { deleteMessage() {
this.$refs.remarkForm.validate(valid => {
console.log('valid',valid)
if (valid) {
this.$emit('deleteMessage',this.deleteBox,()=>{ this.$emit('deleteMessage',this.deleteBox,()=>{
this.deleteBox.ids=[]; this.deleteBox.ids=[];
}); });
this.deleteBox.show = false; this.deleteBox.show = false;
}
})
}, },
selectChange(s) { selectChange(s) {
let ids = []; let ids = [];
@@ -613,6 +619,7 @@
ids.push(item.id); ids.push(item.id);
}); });
this.deleteBox.ids = ids.join(","); this.deleteBox.ids = ids.join(",");
this.$emit('select-change',s)
}, },
showExportDialog() { showExportDialog() {
this.importBox.show = true; this.importBox.show = true;

View File

@@ -21,15 +21,18 @@
class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="alert-list-export"> class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="alert-list-export">
<i class="nz-icon nz-icon-download1"></i> <i class="nz-icon nz-icon-download1"></i>
</button> </button>
<delete-button :delete-objs="batchDeleteObjs" api="alert/message" @after="getAlertList" :clickFunction="openDelMessageBox"></delete-button>
</div> </div>
</div> </div>
<alertMessageTable <alertMessageTable
ref="alertMessageTable"
:tableData="tableData" :tableData="tableData"
:loading="loading" :loading="loading"
:tableHeight="$tableHeight.openSubList.subList" :tableHeight="$tableHeight.openSubList.subList"
:tableId="tableId" :tableId="tableId"
@tableDataSort="tableDataSort" @tableDataSort="tableDataSort"
@deleteMessage="deleteMessage" @deleteMessage="deleteMessage"
@select-change="(selection)=>{this.batchDeleteObjs=selection}"
></alertMessageTable> ></alertMessageTable>
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination> <Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
<!--导出--> <!--导出-->
@@ -85,12 +88,14 @@
import chart from '../../../page/dashboard/overview/chart' import chart from '../../../page/dashboard/overview/chart'
import bus from '../../../../libs/bus' import bus from '../../../../libs/bus'
import alertMessageTable from '@/components/common/alert/alertMessageTable.vue' import alertMessageTable from '@/components/common/alert/alertMessageTable.vue'
import deleteButton from "../../deleteButton";
export default { export default {
name: "alertMessageTab", name: "alertMessageTab",
components: { components: {
'nz-alert-tag': nzAlertTag, 'nz-alert-tag': nzAlertTag,
'chart': chart, 'chart': chart,
'alertMessageTable':alertMessageTable, 'alertMessageTable':alertMessageTable,
'delete-button':deleteButton,
}, },
props: { props: {
from: String, //来自哪个主页面,有:"asset"、"alertRule" from: String, //来自哪个主页面,有:"asset"、"alertRule"
@@ -109,6 +114,7 @@
requestIndex:0, requestIndex:0,
defaultSearchValue: this.obj.alertNum ? 1 : 0, defaultSearchValue: this.obj.alertNum ? 1 : 0,
showElementSet: false, showElementSet: false,
batchDeleteObjs:[],
tableId: 'alertListTable', //需要分页的table的id用于记录每页数量 tableId: 'alertListTable', //需要分页的table的id用于记录每页数量
showTopBtn: false, //top按钮是否显示 showTopBtn: false, //top按钮是否显示
loading: false, loading: false,
@@ -453,6 +459,12 @@
dialogClose() { dialogClose() {
this.graphShow = false; this.graphShow = false;
}, },
openDelMessageBox:function(){
if(this.batchDeleteObjs.length<1) return;
if(this.$refs.alertMessageTable){
this.$refs.alertMessageTable.toDeleteMessage(false);
}
},
del(u) { del(u) {
this.$confirm(this.$t("tip.confirmDelete"), { this.$confirm(this.$t("tip.confirmDelete"), {
confirmButtonText: this.$t("tip.yes"), confirmButtonText: this.$t("tip.yes"),

View File

@@ -13,6 +13,7 @@
class="nz-btn nz-btn-size-normal nz-btn-style-light float-right margin-l-20" id="cab-add"> class="nz-btn nz-btn-size-normal nz-btn-style-light float-right margin-l-20" id="cab-add">
<i class="nz-icon-create-square nz-icon"></i> <i class="nz-icon-create-square nz-icon"></i>
</button> </button>
<delete-button :delete-objs="batchDeleteObjs" api="cabinet" @after="getTableData"></delete-button>
</div> </div>
</div> </div>
<el-table <el-table
@@ -24,7 +25,15 @@
v-scrollBar:el-table="'large'" v-scrollBar:el-table="'large'"
:cell-class-name="assetStatClassName" :cell-class-name="assetStatClassName"
:height="$tableHeight.noPagination" :height="$tableHeight.noPagination"
style="width: 100%;"> style="width: 100%;"
@selection-change="(selection)=>{this.batchDeleteObjs=selection}"
>
<el-table-column
:resizable="false"
type="selection"
width="40"
align="center">
</el-table-column>
<el-table-column <el-table-column
:resizable="false" :resizable="false"
v-for="(item, index) in tableTitle" v-for="(item, index) in tableTitle"
@@ -80,10 +89,12 @@
<script> <script>
import cabinetBox from "../../rightBox/cabinetBox"; import cabinetBox from "../../rightBox/cabinetBox";
import deleteButton from "../../deleteButton";
export default { export default {
name: "cabinetTab", name: "cabinetTab",
components: { components: {
"cabinet-box": cabinetBox "cabinet-box": cabinetBox,
'delete-button':deleteButton,
}, },
props: { props: {
obj: Object, //关联的实体对象 obj: Object, //关联的实体对象
@@ -99,6 +110,7 @@
seq:'', seq:'',
uSize:1 uSize:1
}, },
batchDeleteObjs:[],
rightBox: {show: false}, rightBox: {show: false},
showTopBtn: false, //top按钮是否显示 showTopBtn: false, //top按钮是否显示
loading: false, loading: false,

View File

@@ -25,6 +25,7 @@
</button> </button>
</template> </template>
</export-excel> </export-excel>
<delete-button :delete-objs="batchDeleteObjs" api="endpoint" @after="getTableData"></delete-button>
</div> </div>
</div> </div>
<!-- 自定义table列 --> <!-- 自定义table列 -->
@@ -49,7 +50,14 @@
ref="endpointTable" ref="endpointTable"
style="width: 100%;" style="width: 100%;"
@sort-change="tableDataSort" @sort-change="tableDataSort"
@selection-change="(selection)=>{this.batchDeleteObjs=selection}"
> >
<el-table-column
:resizable="false"
type="selection"
width="40"
align="center">
</el-table-column>
<el-table-column <el-table-column
:resizable="false" :resizable="false"
v-for="(item, index) in tools.customTableTitle" v-for="(item, index) in tools.customTableTitle"
@@ -84,6 +92,7 @@
:id="'edp-edit-'+scope.row.id"> :id="'edp-edit-'+scope.row.id">
<i class="nz-icon nz-icon-edit"></i> <i class="nz-icon nz-icon-edit"></i>
</span> </span>
<span :title="$t('overall.delete')" @click.stop="delEndpoint(scope.row)" class="content-right-option" :id="'asset-del-'+scope.row.id"><i class="nz-icon nz-icon-delete"></i></span>
</div> </div>
<span v-else-if="item.prop == 'lastUpdate'">{{dateFormat(scope.row.lastUpdate)}}</span> <span v-else-if="item.prop == 'lastUpdate'">{{dateFormat(scope.row.lastUpdate)}}</span>
<span v-else-if="item.prop == 'state'" > <span v-else-if="item.prop == 'state'" >
@@ -133,10 +142,12 @@
<script> <script>
import exportXLSX from "../../exportXLSX"; import exportXLSX from "../../exportXLSX";
import bus from '@/libs/bus' import bus from '@/libs/bus'
import deleteButton from "../../deleteButton";
export default { export default {
name: "endpointTab", name: "endpointTab",
components: { components: {
'export-excel': exportXLSX 'export-excel': exportXLSX,
'delete-button':deleteButton,
}, },
props: { props: {
obj: Object, //关联的实体对象 obj: Object, //关联的实体对象
@@ -157,6 +168,7 @@
showCustomTableTitle: false, //自定义列弹框是否显示 showCustomTableTitle: false, //自定义列弹框是否显示
customTableTitle: [], //自定义列工具的数据 customTableTitle: [], //自定义列工具的数据
}, },
batchDeleteObjs:[],
endpoint: {}, //用来查看详情和编辑的对象 endpoint: {}, //用来查看详情和编辑的对象
endpointSearchLabel:{ endpointSearchLabel:{
@@ -287,6 +299,22 @@
this.getTableData(); this.getTableData();
} }
}, },
delEndpoint(endpoint) {
this.$confirm(this.$t("tip.confirmDelete"), {
confirmButtonText: this.$t("tip.yes"),
cancelButtonText: this.$t("tip.no"),
type: 'warning'
}).then(() => {
this.$delete("endpoint?ids=" + endpoint.id).then(response => {
if (response.code === 200) {
this.$message({duration: 1000, type: 'success', message: this.$t("tip.deleteSuccess")});
this.getTableData();
} else {
this.$message.error(response.msg);
}
});
});
},
toEdit(endpoint) { toEdit(endpoint) {
this.endpoint = JSON.parse(JSON.stringify(endpoint)); this.endpoint = JSON.parse(JSON.stringify(endpoint));
if (!this.endpoint.paramObj) { if (!this.endpoint.paramObj) {

View File

@@ -0,0 +1,62 @@
<template>
<div class="delete-button">
<el-button class="nz-btn nz-btn-size-normal nz-btn-style-light" :class="{'nz-btn-disabled' : deleteObjs.length<1}" @click="batchDelete"><span><i class="nz-icon nz-icon-delete"></i></span></el-button>
</div>
</template>
<script>
export default {
name: "deleteButton",
props:{
filterFunction:Function,
deleteObjs:Array,
api:String,
clickFunction:Function
},
methods:{
batchDelete:function(){
if(this.deleteObjs.length<1) return;
if(this.clickFunction){
this.clickFunction();
return;
}
this.$confirm(this.$t("tip.confirmBatchDelete",[this.deleteObjs.length]), {
confirmButtonText: this.$t("tip.yes"),
cancelButtonText: this.$t("tip.no"),
type: 'warning'
}).then(() => {
let params=this.filterParam();
this.$delete(this.api+params).then(response => {
if (response.code === 200) {
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
this.$emit('after')
} else {
this.$message.error(response.msg);
}
})
});
},
filterParam:function(){
let filterFunction=this.filterFunction
if(!filterFunction){
filterFunction=(arr)=>{return "?ids="+arr.map(t=>t.id).join(',')};
}
return filterFunction(this.deleteObjs);
},
}
}
</script>
<style scoped>
.delete-button{
margin-left: 16px;
}
.delete-button .nz-icon-delete{
color: #ee6723;
}
.delete-button .nz-btn-disabled .nz-icon-delete{
color: #e5e5e5;
}
</style>

View File

@@ -374,6 +374,7 @@ const cn = {
}, },
tip: { tip: {
confirmDelete: "确认删除吗?", confirmDelete: "确认删除吗?",
confirmBatchDelete:'确定删除这{0}条数据吗?',
assetConfirmDelete: "关联的Endpoint和告警将会被删除确认删除吗", assetConfirmDelete: "关联的Endpoint和告警将会被删除确认删除吗",
yes: "是", yes: "是",
no: "否", no: "否",

View File

@@ -377,6 +377,7 @@ const en = {
}, },
tip: { tip: {
confirmDelete: "Are you sure you want to delete?", //Are you sure you want to delete? confirmDelete: "Are you sure you want to delete?", //Are you sure you want to delete?
confirmBatchDelete:'Are you sure to delete these {0} pieces of data',
assetConfirmDelete: 'Related endpoints and alerts will be removed, are you sure you want to delete this asset?',//Related endpoints and alerts will be removed, are you sure you want to delete this asset? assetConfirmDelete: 'Related endpoints and alerts will be removed, are you sure you want to delete this asset?',//Related endpoints and alerts will be removed, are you sure you want to delete this asset?
yes: 'Yes', //"是" yes: 'Yes', //"是"
no: "No",//No no: "No",//No

View File

@@ -75,7 +75,7 @@
</el-date-picker> </el-date-picker>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item :label="$t('asset.location')" prop="locationInfo" :rules="[{validator:locationValidator, trigger:'blur'}]"> <el-form-item :label="$t('asset.location')" class="required-marker" prop="locationInfo" :rules="[{validator:locationValidator, trigger:'blur'}]">
<location-cascader :disabled="editAsset.modelId ? false : true" :default-model-u-size="modelSize" @change="setLocationData" ref="locationCascader" :idc-option="dcData"></location-cascader> <location-cascader :disabled="editAsset.modelId ? false : true" :default-model-u-size="modelSize" @change="setLocationData" ref="locationCascader" :idc-option="dcData"></location-cascader>
</el-form-item> </el-form-item>
<!--tag--> <!--tag-->

View File

@@ -48,6 +48,7 @@
</button> </button>
</template> </template>
</export-excel> </export-excel>
<delete-button :delete-objs="batchDeleteObjs" api="alert/rule" @after="getTableData"></delete-button>
</div> </div>
<div class="pagination-top pagination-top-hide display-none"></div> <div class="pagination-top pagination-top-hide display-none"></div>
</div> </div>
@@ -75,7 +76,14 @@
style="width: 100%;" style="width: 100%;"
@sort-change="tableDataSort" @sort-change="tableDataSort"
@row-dblclick="detail" @row-dblclick="detail"
@selection-change="(selection)=>{this.batchDeleteObjs=selection}"
> >
<el-table-column
:resizable="false"
type="selection"
width="40"
align="center">
</el-table-column>
<el-table-column <el-table-column
:resizable="false" :resizable="false"
v-for="(item, index) in tools.customTableTitle" v-for="(item, index) in tools.customTableTitle"
@@ -145,10 +153,12 @@
import bus from '../../../libs/bus'; import bus from '../../../libs/bus';
import exportXLSX from "../../common/exportXLSX"; import exportXLSX from "../../common/exportXLSX";
import chartDataFormat from "../../charts/chartDataFormat"; import chartDataFormat from "../../charts/chartDataFormat";
import deleteButton from "../../common/deleteButton";
export default { export default {
name: "alert-config", name: "alert-config",
components: { components: {
'export-excel': exportXLSX, 'export-excel': exportXLSX,
'delete-button':deleteButton,
}, },
data() { data() {
return { return {
@@ -178,7 +188,7 @@
customTableTitle: [], //自定义列工具的数据 customTableTitle: [], //自定义列工具的数据
}, },
mainTableHeight: this.$tableHeight.normal, //主列表table高度 mainTableHeight: this.$tableHeight.normal, //主列表table高度
batchDeleteObjs:[],
tableId: 'alertRuleTable', //需要分页的table的id用于记录每页数量 tableId: 'alertRuleTable', //需要分页的table的id用于记录每页数量
alertRule: {}, alertRule: {},
blankAlertRule: { blankAlertRule: {

View File

@@ -29,16 +29,19 @@
class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="alert-list-export"> class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="alert-list-export">
<i class="nz-icon nz-icon-download1"></i> <i class="nz-icon nz-icon-download1"></i>
</button> </button>
<delete-button :delete-objs="batchDeleteObjs" api="alert/message" @after="getAlertList" :clickFunction="openDelMessageBox"></delete-button>
</div> </div>
<div class="pagination-top pagination-top-hide display-none"></div> <div class="pagination-top pagination-top-hide display-none"></div>
</div> </div>
<alertMessageTable <alertMessageTable
ref="alertMessageTable"
:tableData="tableData" :tableData="tableData"
:loading="tools.loading" :loading="tools.loading"
:tableHeight="mainTableHeight" :tableHeight="mainTableHeight"
:tableId="tableId" :tableId="tableId"
@tableDataSort="tableDataSort" @tableDataSort="tableDataSort"
@deleteMessage="deleteMessage" @deleteMessage="deleteMessage"
@select-change="(selection)=>{this.batchDeleteObjs=selection}"
></alertMessageTable> ></alertMessageTable>
<div class="pagination-bottom" v-show="!bottomBox.showSubList"> <div class="pagination-bottom" v-show="!bottomBox.showSubList">
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination> <Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
@@ -102,6 +105,7 @@
import alertRuleInfo from '../../common/alert/alertRuleInfo' import alertRuleInfo from '../../common/alert/alertRuleInfo'
import alertLabel from '../../common/alert/alertLabel' import alertLabel from '../../common/alert/alertLabel'
import alertMessageTable from '../../common/alert/alertMessageTable.vue' import alertMessageTable from '../../common/alert/alertMessageTable.vue'
import deleteButton from "../../common/deleteButton";
export default { export default {
name: "alertList", name: "alertList",
components: { components: {
@@ -111,6 +115,7 @@
'alertLabel':alertLabel, 'alertLabel':alertLabel,
'alertMessageTable':alertMessageTable, 'alertMessageTable':alertMessageTable,
'pick-time':pickTime, 'pick-time':pickTime,
'delete-button':deleteButton,
}, },
data() { data() {
return { return {
@@ -140,7 +145,7 @@
//导出相关 //导出相关
importBox: {show: false, title:this.$t('overall.exportExcel')}, importBox: {show: false, title:this.$t('overall.exportExcel')},
deleteBox: {show: false, ids: "", remark: '', state: 2}, deleteBox: {show: false, ids: "", remark: '', state: 2},
batchDeleteObjs:[],
//详情相关 //详情相关
graphShow: false, graphShow: false,
chartDatas: [], chartDatas: [],
@@ -411,6 +416,12 @@
this.$refs['assetEditUnit'].tabView = false this.$refs['assetEditUnit'].tabView = false
} }
}, },
openDelMessageBox:function(){
if(this.batchDeleteObjs.length<1) return;
if(this.$refs.alertMessageTable){
this.$refs.alertMessageTable.toDeleteMessage(false);
}
},
toDeleteMessage(obj) { toDeleteMessage(obj) {
if (obj) { if (obj) {
this.deleteBox.ids = obj.id + ""; this.deleteBox.ids = obj.id + "";

View File

@@ -10,13 +10,14 @@
export-url="/asset/export" export-url="/asset/export"
import-url="/asset/import" import-url="/asset/import"
:params="searchLabel" :params="searchLabel"
@afterImport="getTableData" @afterImport="afterTableListChange"
> >
<template slot="optionZone"> <template slot="optionZone">
<button @click.stop="add" :title="$t('overall.createAsset')" class="nz-btn nz-btn-size-normal nz-btn-style-light" id="asset-create-asset"> <button @click.stop="add" :title="$t('overall.createAsset')" class="nz-btn nz-btn-size-normal nz-btn-style-light" id="asset-create-asset">
<i class="nz-icon nz-icon-create-square"></i></button> <i class="nz-icon nz-icon-create-square"></i></button>
</template> </template>
</export-excel> </export-excel>
<delete-button :delete-objs="batchDeleteObjs" api="asset" @after="afterTableListChange"></delete-button>
</div> </div>
<div class="pagination-top pagination-top-hide display-none"></div> <div class="pagination-top pagination-top-hide display-none"></div>
</div> </div>
@@ -44,7 +45,14 @@
:cell-class-name="messageStyle" :cell-class-name="messageStyle"
@sort-change="tableDataSort" @sort-change="tableDataSort"
@row-dblclick="detail" @row-dblclick="detail"
@selection-change="(selection)=>{this.batchDeleteObjs=selection}"
> >
<el-table-column
:resizable="false"
type="selection"
width="40"
align="center">
</el-table-column>
<el-table-column <el-table-column
:resizable="false" :resizable="false"
v-for="(item, index) in tools.customTableTitle" v-for="(item, index) in tools.customTableTitle"
@@ -190,11 +198,13 @@
import bus from "../../../libs/bus"; import bus from "../../../libs/bus";
import exportXLSX from "../../common/exportXLSX"; import exportXLSX from "../../common/exportXLSX";
import endpointStatusPop from "./endpointStatusPop"; import endpointStatusPop from "./endpointStatusPop";
import deleteButton from "../../common/deleteButton";
export default { export default {
name: "asset", name: "asset",
components:{ components:{
'export-excel':exportXLSX, 'export-excel':exportXLSX,
'endpoint-status-pop':endpointStatusPop, 'endpoint-status-pop':endpointStatusPop,
'delete-button':deleteButton,
}, },
data() { data() {
return { return {
@@ -225,6 +235,7 @@
showCustomTableTitle: false, //自定义列弹框是否显示 showCustomTableTitle: false, //自定义列弹框是否显示
customTableTitle: [], //自定义列工具的数据 customTableTitle: [], //自定义列工具的数据
}, },
batchDeleteObjs:[],
asset: {}, asset: {},
blankAsset: { blankAsset: {
id: '', id: '',
@@ -507,8 +518,7 @@
this.$delete("asset?ids=" + asset.id).then(response => { this.$delete("asset?ids=" + asset.id).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")}); this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
this.getTableData(); this.afterTableListChange()
bus.$emit('asset-list-change')
} else { } else {
this.$message.error(response.msg); this.$message.error(response.msg);
} }
@@ -539,11 +549,14 @@
closeRightBox(refresh) { closeRightBox(refresh) {
this.rightBox.show = false; this.rightBox.show = false;
if (refresh) { if (refresh) {
this.getTableData(); this.afterTableListChange()
bus.$emit('asset-list-change')
this.loadKeys(); this.loadKeys();
} }
}, },
afterTableListChange:function(){
this.getTableData();
bus.$emit('asset-list-change')
},
pageNo(val) { pageNo(val) {
this.pageObj.pageNo = val; this.pageObj.pageNo = val;
this.getTableData() this.getTableData()

View File

@@ -18,6 +18,7 @@
class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="account-add"> class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="account-add">
<i class="nz-icon-create-square nz-icon"></i> <i class="nz-icon-create-square nz-icon"></i>
</button> </button>
<delete-button :delete-objs="batchDeleteObjs" api="sys/user/delete" @after="getTableData" :filter-function="(arr)=>{return '?userIds='+arr.map(t=>t.userId).join(',')}"></delete-button>
</div> </div>
<!-- 顶部分页组件,当打开底部上滑框时出现 --> <!-- 顶部分页组件,当打开底部上滑框时出现 -->
<div class="pagination-top pagination-top-hide display-none"></div> <div class="pagination-top pagination-top-hide display-none"></div>
@@ -42,7 +43,15 @@
v-loading="tools.loading" v-loading="tools.loading"
v-scrollBar:el-table="'large'" v-scrollBar:el-table="'large'"
style="width: 100%;" style="width: 100%;"
@sort-change="tableDataSort"> @sort-change="tableDataSort"
@selection-change="(selection)=>{this.batchDeleteObjs=selection}"
>
<el-table-column
:resizable="false"
type="selection"
width="40"
align="center">
</el-table-column>
<el-table-column <el-table-column
:resizable="false" :resizable="false"
v-for="(item, index) in tools.customTableTitle" v-for="(item, index) in tools.customTableTitle"
@@ -109,13 +118,14 @@
</div> </div>
</template> </template>
<script> <script>
import bus from '../../../libs/bus'; import deleteButton from "../../common/deleteButton";
import accountBox from '../../common/rightBox/accountBox'; import accountBox from '../../common/rightBox/accountBox';
export default { export default {
name: "account", name: "account",
components: { components: {
'account-box': accountBox 'account-box': accountBox,
'delete-button':deleteButton,
}, },
data() { data() {
return { return {
@@ -145,7 +155,7 @@
customTableTitle: [], //自定义列工具的数据 customTableTitle: [], //自定义列工具的数据
}, },
mainTableHeight: this.$tableHeight.normal, //主列表table高度 mainTableHeight: this.$tableHeight.normal, //主列表table高度
batchDeleteObjs:[],
user: {}, user: {},
tableId: 'accountTable', //需要分页的table的id用于记录每页数量 tableId: 'accountTable', //需要分页的table的id用于记录每页数量

View File

@@ -17,6 +17,7 @@
class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="dc-add"> class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="dc-add">
<i class="nz-icon-create-square nz-icon"></i> <i class="nz-icon-create-square nz-icon"></i>
</button> </button>
<delete-button :delete-objs="batchDeleteObjs" api="idc" @after="getTableData"></delete-button>
</div> </div>
<div class="pagination-top pagination-top-hide display-none"></div> <div class="pagination-top pagination-top-hide display-none"></div>
</div> </div>
@@ -42,7 +43,15 @@
v-loading="tools.loading" v-loading="tools.loading"
:cell-class-name="assetStatClassName" :cell-class-name="assetStatClassName"
style="width: 100%;" style="width: 100%;"
@sort-change="tableDataSort"> @sort-change="tableDataSort"
@selection-change="(selection)=>{this.batchDeleteObjs=selection}"
>
<el-table-column
:resizable="false"
type="selection"
width="40"
align="center">
</el-table-column>
<el-table-column <el-table-column
:resizable="false" :resizable="false"
show-overflow-tooltip show-overflow-tooltip
@@ -126,11 +135,13 @@
import bus from '../../../libs/bus'; import bus from '../../../libs/bus';
import dcBox from "../../common/rightBox/dcBox"; //dc弹框 import dcBox from "../../common/rightBox/dcBox"; //dc弹框
import trafficSettingBox from "../../common/rightBox/trafficSetting/trafficSettingBox"; import trafficSettingBox from "../../common/rightBox/trafficSetting/trafficSettingBox";
import deleteButton from "../../common/deleteButton";
export default { export default {
name: "dc", name: "dc",
components:{ components:{
'traffic-setting-box': trafficSettingBox, 'traffic-setting-box': trafficSettingBox,
'dc-box': dcBox 'dc-box': dcBox,
'delete-button':deleteButton,
}, },
data() { data() {
return { return {
@@ -155,6 +166,7 @@
showCustomTableTitle: false, //自定义列弹框是否显示 showCustomTableTitle: false, //自定义列弹框是否显示
customTableTitle: [], //自定义列工具的数据 customTableTitle: [], //自定义列工具的数据
}, },
batchDeleteObjs:[],
tableId: 'dcTable', //需要分页的table的id用于记录每页数量 tableId: 'dcTable', //需要分页的table的id用于记录每页数量
dc: {}, dc: {},
blankDc: { blankDc: {

View File

@@ -19,10 +19,11 @@
<div class="top-tool-search"> <div class="top-tool-search">
<search-input :searchMsg="searchMsg" @search="search"></search-input> <search-input :searchMsg="searchMsg" @search="search"></search-input>
</div> </div>
<button @click="add" class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" :title="$t('overall.createMib')" <button type="button" @click="add" class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" :title="$t('overall.createMib')"
id="mib-add"> id="mib-add">
<i class="nz-icon-create-square nz-icon"></i> <i class="nz-icon-create-square nz-icon"></i>
</button> </button>
<delete-button :delete-objs="batchDeleteObjs" api="mib" @after="getTableData"></delete-button>
</div> </div>
</div> </div>
<!-- 自定义table列 --> <!-- 自定义table列 -->
@@ -35,7 +36,15 @@
ref="customTableTitle" ref="customTableTitle"
></element-set> ></element-set>
</transition> </transition>
<el-table :data="tableData" border :height="$tableHeight.normal" style="width: 100%;" ref="mibTable" class="nz-table mib-table" v-scrollBar:el-table="'large'" v-loading="tools.loading" @sort-change="tableDataSort"> <el-table :data="tableData" border :height="$tableHeight.normal" style="width: 100%;" ref="mibTable" class="nz-table mib-table" v-scrollBar:el-table="'large'" v-loading="tools.loading" @sort-change="tableDataSort"
@selection-change="(selection)=>{this.batchDeleteObjs=selection}"
>
<el-table-column
:resizable="false"
type="selection"
width="40"
align="center">
</el-table-column>
<el-table-column :resizable="false" v-for="(item, index) in tools.customTableTitle" v-if="item.show" :width="item.width" :class-name="item.prop == 'modelsDetail'?'detail-column':''" <el-table-column :resizable="false" v-for="(item, index) in tools.customTableTitle" v-if="item.show" :width="item.width" :class-name="item.prop == 'modelsDetail'?'detail-column':''"
:key="`col-${index}`" :label="item.label" :sortable="$tableSet.sortableShow(item.prop,'mib')" :key="`col-${index}`" :label="item.label" :sortable="$tableSet.sortableShow(item.prop,'mib')"
:prop="$tableSet.propTitle(item.prop,'mib')" :prop="$tableSet.propTitle(item.prop,'mib')"
@@ -109,11 +118,12 @@
import axios from 'axios' import axios from 'axios'
import bus from '../../../libs/bus'; import bus from '../../../libs/bus';
import mibBrowser from './mibBrowser'; import mibBrowser from './mibBrowser';
import deleteButton from "../../common/deleteButton";
export default { export default {
name: "mib", name: "mib",
components: { components: {
'mib-browser': mibBrowser 'mib-browser': mibBrowser,
'delete-button':deleteButton,
}, },
data() { data() {
return { return {
@@ -127,6 +137,7 @@
showCustomTableTitle: false, //自定义列弹框是否显示 showCustomTableTitle: false, //自定义列弹框是否显示
customTableTitle: [], //自定义列工具的数据 customTableTitle: [], //自定义列工具的数据
}, },
batchDeleteObjs:[],
tableId: 'mibTable', //需要分页的table的id用于记录每页数量 tableId: 'mibTable', //需要分页的table的id用于记录每页数量
mib: {}, mib: {},
blankMib: { blankMib: {

View File

@@ -16,6 +16,7 @@
id="model-add"> id="model-add">
<i class="nz-icon-create-square nz-icon"></i> <i class="nz-icon-create-square nz-icon"></i>
</button> </button>
<delete-button :delete-objs="batchDeleteObjs" api="model" @after="getTableData"></delete-button>
</div> </div>
<div class="pagination-top pagination-top-hide display-none"></div> <div class="pagination-top pagination-top-hide display-none"></div>
</div> </div>
@@ -40,7 +41,14 @@
:height="mainTableHeight" :height="mainTableHeight"
@sort-change="tableDataSort" @sort-change="tableDataSort"
@row-dblclick="panel" @row-dblclick="panel"
@selection-change="(selection)=>{this.batchDeleteObjs=selection}"
> >
<el-table-column
:resizable="false"
type="selection"
width="40"
align="center">
</el-table-column>
<el-table-column :resizable="false" <el-table-column :resizable="false"
v-for="(item, index) in tools.customTableTitle" v-for="(item, index) in tools.customTableTitle"
v-if="item.show" v-if="item.show"
@@ -101,8 +109,12 @@
</template> </template>
<script> <script>
import bus from '../../../libs/bus'; import bus from '../../../libs/bus';
import deleteButton from "../../common/deleteButton";
export default { export default {
name: "model", name: "model",
components: {
'delete-button':deleteButton,
},
data() { data() {
return { return {
/*二级页面相关*/ /*二级页面相关*/
@@ -126,6 +138,7 @@
showCustomTableTitle: false, //自定义列弹框是否显示 showCustomTableTitle: false, //自定义列弹框是否显示
customTableTitle: [], //自定义列工具的数据 customTableTitle: [], //自定义列工具的数据
}, },
batchDeleteObjs:[],
tableId: 'modelTable', //需要分页的table的id用于记录每页数量 tableId: 'modelTable', //需要分页的table的id用于记录每页数量
rightBox: {show: false}, rightBox: {show: false},

View File

@@ -16,6 +16,7 @@
class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="prom-add"> class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="prom-add">
<i class="nz-icon-create-square nz-icon"></i> <i class="nz-icon-create-square nz-icon"></i>
</button> </button>
<delete-button :delete-objs="batchDeleteObjs" api="promServer" @after="getTableData"></delete-button>
</div> </div>
<div class="pagination-top pagination-top-hide display-none"></div> <div class="pagination-top pagination-top-hide display-none"></div>
</div> </div>
@@ -31,7 +32,15 @@
</transition> </transition>
<el-table :data="tableData" border v-show="bottomBox.mainResizeShow" :height="mainTableHeight" style="width: 100%;" <el-table :data="tableData" border v-show="bottomBox.mainResizeShow" :height="mainTableHeight" style="width: 100%;"
v-loading="tools.loading" ref="promTable" class="nz-table" v-scrollBar:el-table="'large'" v-loading="tools.loading" ref="promTable" class="nz-table" v-scrollBar:el-table="'large'"
@sort-change="tableDataSort"> @sort-change="tableDataSort"
@selection-change="(selection)=>{this.batchDeleteObjs=selection}"
>
<el-table-column
:resizable="false"
type="selection"
width="40"
align="center">
</el-table-column>
<el-table-column :resizable="false" v-for="(item, index) in tools.customTableTitle" <el-table-column :resizable="false" v-for="(item, index) in tools.customTableTitle"
v-if="item.show" v-if="item.show"
:width="item.width" :width="item.width"
@@ -95,11 +104,12 @@
<script> <script>
import bus from '../../../libs/bus'; import bus from '../../../libs/bus';
import promServerBox from '../../common/rightBox/promServerBox'; import promServerBox from '../../common/rightBox/promServerBox';
import deleteButton from "../../common/deleteButton";
export default { export default {
name: "promServer", name: "promServer",
components: { components: {
'prom-server-box': promServerBox 'prom-server-box': promServerBox,
'delete-button':deleteButton,
}, },
data() { data() {
return { return {
@@ -128,7 +138,7 @@
showCustomTableTitle: false, //自定义列弹框是否显示 showCustomTableTitle: false, //自定义列弹框是否显示
customTableTitle: [], //自定义列工具的数据 customTableTitle: [], //自定义列工具的数据
}, },
batchDeleteObjs:[],
tableId: 'promTable', //需要分页的table的id用于记录每页数量 tableId: 'promTable', //需要分页的table的id用于记录每页数量
promServer: {}, promServer: {},
blankPromServer: { blankPromServer: {

View File

@@ -40,6 +40,7 @@
</button> </button>
</template> </template>
</export-excel> </export-excel>
<delete-button :delete-objs="batchDeleteObjs" api="endpoint" @after="afterCloseImport"></delete-button>
</div> </div>
<div class="pagination-top pagination-top-hide display-none"></div> <div class="pagination-top pagination-top-hide display-none"></div>
</div> </div>
@@ -66,7 +67,14 @@
style="width: 100%;" style="width: 100%;"
@sort-change="tableDataSort" @sort-change="tableDataSort"
@row-dblclick="detailEndpoint" @row-dblclick="detailEndpoint"
@selection-change="(selection)=>{this.batchDeleteObjs=selection}"
> >
<el-table-column
:resizable="false"
type="selection"
width="40"
align="center">
</el-table-column>
<el-table-column <el-table-column
:resizable="false" :resizable="false"
v-for="(item, index) in tools.customTableTitle" v-for="(item, index) in tools.customTableTitle"
@@ -175,6 +183,7 @@
import panelTab from '../../common/bottomBox/tabs/panelTab' import panelTab from '../../common/bottomBox/tabs/panelTab'
import bus from '../../../libs/bus' import bus from '../../../libs/bus'
import facade from '@/components/common/project/projectFacade' import facade from '@/components/common/project/projectFacade'
import deleteButton from "../../common/deleteButton";
export default { export default {
name: "project2", name: "project2",
components: { components: {
@@ -182,6 +191,7 @@
'loading': loading, 'loading': loading,
'panel-tab': panelTab, 'panel-tab': panelTab,
facade, facade,
'delete-button':deleteButton,
}, },
data() { data() {
return { return {
@@ -213,7 +223,7 @@
showCustomTableTitle: false, //自定义列弹框是否显示 showCustomTableTitle: false, //自定义列弹框是否显示
customTableTitle: [], //自定义列工具的数据 customTableTitle: [], //自定义列工具的数据
}, },
batchDeleteObjs:[],
tableId: 'projectTable', //需要分页的table的id用于记录每页数量 tableId: 'projectTable', //需要分页的table的id用于记录每页数量
userData: [], userData: [],