feat: asset二级endpoint增加导入导出按钮等
1.asset二级endpoint增加导入导出按钮 2.asset/alertRule二级alertMessage页面初始参数
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="top-tool-right">
|
<div class="top-tool-right">
|
||||||
<div class="top-tool-search">
|
<div class="top-tool-search">
|
||||||
<search-input :searchMsg="searchMsg" @search="search"></search-input>
|
<search-input :default-item="'alertMessageState'" :default-value="defaultSearchValue" :searchMsg="searchMsg" @search="search"></search-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -117,6 +117,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
defaultSearchValue: this.obj.alertNum ? 1 : 0,
|
||||||
showElementSet: false,
|
showElementSet: false,
|
||||||
tableId: 'alertListTable', //需要分页的table的id,用于记录每页数量
|
tableId: 'alertListTable', //需要分页的table的id,用于记录每页数量
|
||||||
showTopBtn: false, //top按钮是否显示
|
showTopBtn: false, //top按钮是否显示
|
||||||
@@ -196,6 +197,12 @@
|
|||||||
type: 'asset',
|
type: 'asset',
|
||||||
label: 'asset',
|
label: 'asset',
|
||||||
disabled: true
|
disabled: true
|
||||||
|
}, {
|
||||||
|
id: 12,
|
||||||
|
name: this.$t('alert.list.state'),
|
||||||
|
type: 'select',
|
||||||
|
label: 'alertMessageState',
|
||||||
|
disabled: false
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
searchLabel: { //搜索参数
|
searchLabel: { //搜索参数
|
||||||
@@ -366,6 +373,9 @@
|
|||||||
this.searchLabel.type = 3;
|
this.searchLabel.type = 3;
|
||||||
this.searchLabel.linkId = n.id;
|
this.searchLabel.linkId = n.id;
|
||||||
}
|
}
|
||||||
|
if (n.alertNum) {
|
||||||
|
this.defaultSearchValue = 1;
|
||||||
|
}
|
||||||
this.getAlertList();
|
this.getAlertList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,18 @@
|
|||||||
<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 type="button" @click="toAddCabinet" :title="$t('overall.createCabinet')"
|
<export-excel
|
||||||
class="nz-btn nz-btn-size-normal nz-btn-style-light float-right margin-l-20" id="cab-add">
|
export-file-name="endpoint"
|
||||||
<i class="nz-icon-create-square nz-icon"></i>
|
export-url="/endpoint/export"
|
||||||
</button>-->
|
:params="searchLabel"
|
||||||
|
@afterImport="getTableData"
|
||||||
|
class="margin-l-20"
|
||||||
|
style="width: 59px;"
|
||||||
|
>
|
||||||
|
<template slot="optionZone">
|
||||||
|
<i class="nz-icon nz-icon-create-square" @click.stop="toAdd" :title="$t('overall.createProject')" ></i>
|
||||||
|
</template>
|
||||||
|
</export-excel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
@@ -82,21 +90,24 @@
|
|||||||
:path="'/assetEndpoint'"
|
:path="'/assetEndpoint'"
|
||||||
ref="elementset"
|
ref="elementset"
|
||||||
></element-set>
|
></element-set>
|
||||||
|
<add-endpoint-box :currentProject="currentProject" :module="currentModule" @reload="getTableData" ref="addEndpointBox"></add-endpoint-box>
|
||||||
<edit-endpoint-box @close="closeEditEndpoint" v-if="editBoxShow" :currentProject="endpoint.project" :currentModule="endpoint.module" :endpoint="endpoint" @reload="getTableData" ref="editEndpointBox"></edit-endpoint-box>
|
<edit-endpoint-box @close="closeEditEndpoint" v-if="editBoxShow" :currentProject="endpoint.project" :currentModule="endpoint.module" :endpoint="endpoint" @reload="getTableData" ref="editEndpointBox"></edit-endpoint-box>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import exportXLSX from "../../exportXLSX";
|
||||||
export default {
|
export default {
|
||||||
name: "endpointTab",
|
name: "endpointTab",
|
||||||
components: {
|
components: {
|
||||||
|
'export-excel': exportXLSX
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
obj: Object, //关联的实体对象
|
obj: Object, //关联的实体对象
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showAddBox: false,
|
||||||
editBoxShow: false,
|
editBoxShow: false,
|
||||||
endpoint: {}, //用来查看详情和编辑的对象
|
endpoint: {}, //用来查看详情和编辑的对象
|
||||||
endpointDetail: {}, //用来查看详情的对象
|
endpointDetail: {}, //用来查看详情的对象
|
||||||
@@ -155,6 +166,8 @@
|
|||||||
],
|
],
|
||||||
tablelable: [],
|
tablelable: [],
|
||||||
dropCol: [],
|
dropCol: [],
|
||||||
|
currentProject: {id: '', name: '', remark: ''}, //endpoint弹框、module列表用来回显project
|
||||||
|
currentModule: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []}, //endpoint弹框用来回显module
|
||||||
searchMsg: { //给搜索框子组件传递的信息
|
searchMsg: { //给搜索框子组件传递的信息
|
||||||
zheze_none: true,
|
zheze_none: true,
|
||||||
searchLabelList: [{
|
searchLabelList: [{
|
||||||
@@ -185,6 +198,7 @@
|
|||||||
this.$get('/endpoint?assetId=' + this.asset.id + 'pageSize=-1').then(response => {
|
this.$get('/endpoint?assetId=' + this.asset.id + 'pageSize=-1').then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.tableData = response.data.list;
|
this.tableData = response.data.list;
|
||||||
|
this.$emit("reload");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -207,7 +221,10 @@
|
|||||||
this.$refs.editEndpointBox.show(true);
|
this.$refs.editEndpointBox.show(true);
|
||||||
this.$refs.editEndpointBox.toEdit(true, this.endpoint.id);
|
this.$refs.editEndpointBox.toEdit(true, this.endpoint.id);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
toAdd() {
|
||||||
|
this.$refs.addEndpointBox.show(true);
|
||||||
|
this.$refs.addEndpointBox.clearEndpoints();
|
||||||
},
|
},
|
||||||
search: function (searchObj) {
|
search: function (searchObj) {
|
||||||
/*this.searchLabel = {idcId: this.currentDc.id, pageNo: 1, pageSize: -1};
|
/*this.searchLabel = {idcId: this.currentDc.id, pageNo: 1, pageSize: -1};
|
||||||
|
|||||||
@@ -631,8 +631,10 @@
|
|||||||
currentModule: {
|
currentModule: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(n, o) {
|
handler(n, o) {
|
||||||
this.endpointForm.moduleId = n.id;
|
if(n) {
|
||||||
this.currentModuleCopy = JSON.parse(JSON.stringify(n));
|
this.endpointForm.moduleId = n.id;
|
||||||
|
this.currentModuleCopy = JSON.parse(JSON.stringify(n));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
projectListReloadWatch(n, o) {
|
projectListReloadWatch(n, o) {
|
||||||
|
|||||||
@@ -185,6 +185,37 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
defaultValue: {
|
||||||
|
immediate: true,
|
||||||
|
handler(n) {
|
||||||
|
if (n) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.defaultItem) {
|
||||||
|
if (this.defaultItem == 'alertMessageState' && this.defaultValue) {
|
||||||
|
this.searchLabelList.forEach((item, index) => {
|
||||||
|
if (item.id == 12) {
|
||||||
|
this.searchLabelList.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.select_list.push({
|
||||||
|
name: this.$t('alert.list.state'),
|
||||||
|
type: 'select',
|
||||||
|
label: 'state',
|
||||||
|
disabled: false,
|
||||||
|
val: this.$t('alert.list.pending'),
|
||||||
|
valnum: 1
|
||||||
|
});
|
||||||
|
this.input_sreach = '';
|
||||||
|
this.sreach_num = this.select_list.length;
|
||||||
|
this.change_sreach_show = false;
|
||||||
|
this.input_list = true;
|
||||||
|
this.select();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
inTransform: {
|
inTransform: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(n) {
|
handler(n) {
|
||||||
@@ -274,7 +305,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
alertListAssetId: {
|
/*alertListAssetId: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(newData, oldData) {
|
handler(newData, oldData) {
|
||||||
if (newData && this.$route.path == '/alertList') {
|
if (newData && this.$route.path == '/alertList') {
|
||||||
@@ -367,7 +398,7 @@
|
|||||||
this.$store.commit('assetForAlertListChange', '');
|
this.$store.commit('assetForAlertListChange', '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
},
|
},
|
||||||
props:['searchMsg','defaultItem','defaultValue','inTransform'],
|
props:['searchMsg','defaultItem','defaultValue','inTransform'],
|
||||||
methods: {
|
methods: {
|
||||||
@@ -1222,8 +1253,8 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.defaultItem ? this.select_list.push({name:this.defaultItem,label:this.defaultItem}) : '';
|
/*this.defaultItem ? this.select_list.push({name:this.defaultItem,label:this.defaultItem}) : '';
|
||||||
this.defaultValue != '' ? this.no_condition=this.defaultValue:'';
|
this.defaultValue != '' ? this.no_condition=this.defaultValue:'';*/
|
||||||
this.restructure_historyDate()
|
this.restructure_historyDate()
|
||||||
if(this.$route.path=='/Objects_Objects'){
|
if(this.$route.path=='/Objects_Objects'){
|
||||||
this.schelistget()
|
this.schelistget()
|
||||||
@@ -1257,7 +1288,6 @@
|
|||||||
if(e.keyCode==27){
|
if(e.keyCode==27){
|
||||||
_this.close_search(e)
|
_this.close_search(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,16 @@
|
|||||||
value: '1',
|
value: '1',
|
||||||
label:i18n.t('asset.pingActive')
|
label:i18n.t('asset.pingActive')
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
alertMessageState: [
|
||||||
|
{
|
||||||
|
value: '1',
|
||||||
|
label:i18n.t('alert.list.pending')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '2',
|
||||||
|
label:i18n.t('alert.list.expired')
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
export default searchSelectInfo;
|
export default searchSelectInfo;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop == 'alertNum'">
|
<template v-else-if="item.prop == 'alertNum'">
|
||||||
<span class="link" @click="queryMessage(scope.row)">{{scope.row.alertNum}}<template v-if="scope.row.alertNum && scope.row.alertNum > 0">{{' ' + $t('overall.active')}}</template></span>
|
<span class="link" @click="queryMessage(scope.row)">{{scope.row.alertNum + ' ' + $t('overall.active')}}</span>
|
||||||
</template>
|
</template>
|
||||||
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
|
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
|
||||||
<template v-else>-</template>
|
<template v-else>-</template>
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
<div class="content-left">
|
<div class="content-left">
|
||||||
<div class="sidebar-title">{{$t('alert.alert')}}</div>
|
<div class="sidebar-title">{{$t('alert.alert')}}</div>
|
||||||
<div class="sidebar-info">
|
<div class="sidebar-info">
|
||||||
<div class="sidebar-info-item sidebar-info-top sidebar-info-item-active">{{$t('alert.alertList')}}</div>
|
<div class="sidebar-info-item sidebar-info-top sidebar-info-item-
|
||||||
|
">{{$t('alert.alertList')}}</div>
|
||||||
<div class="sidebar-info-item" @click="jumpTo('alertConfig')" id="alert-jump-config">
|
<div class="sidebar-info-item" @click="jumpTo('alertConfig')" id="alert-jump-config">
|
||||||
{{$t('alert.alertConfig')}}
|
{{$t('alert.alertConfig')}}
|
||||||
</div>
|
</div>
|
||||||
@@ -195,6 +196,12 @@
|
|||||||
type: 'asset',
|
type: 'asset',
|
||||||
label: 'asset',
|
label: 'asset',
|
||||||
disabled: true
|
disabled: true
|
||||||
|
}, {
|
||||||
|
id: 12,
|
||||||
|
name: this.$t('alert.list.state'),
|
||||||
|
type: 'select',
|
||||||
|
label: 'alertMessageState',
|
||||||
|
disabled: false
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
searchLabel: { //搜索参数
|
searchLabel: { //搜索参数
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
<span v-else class="unclickable">{{scope.row.endpointNum}}</span>-->
|
<span v-else class="unclickable">{{scope.row.endpointNum}}</span>-->
|
||||||
</template>
|
</template>
|
||||||
<template v-if="item.prop=='Alert'">
|
<template v-if="item.prop=='Alert'">
|
||||||
<span :id="'asset-alerts-'+scope.row.id" @click="jumpToAlertMsg(scope.row)" class="link">{{scope.row.alertNum}}<template v-if="scope.row.alertNum && scope.row.alertNum > 0">{{' ' + $t('overall.active')}}</template></span>
|
<span :id="'asset-alerts-'+scope.row.id" @click="jumpToAlertMsg(scope.row)" class="link">{{scope.row.alertNum + ' ' + $t('overall.active')}}</span>
|
||||||
</template>
|
</template>
|
||||||
<div v-if="item.prop=='dataCenter'">
|
<div v-if="item.prop=='dataCenter'">
|
||||||
<!-- <idc-config-box :post-idc="JSON.parse(JSON.stringify(scope.row.idc))" ref="idcConfigBox" :is-edit="false" placement="left" @after="getAssetData(null, true)" :button-class="'checkbox-edit'" :user-data="idcUserData">-->
|
<!-- <idc-config-box :post-idc="JSON.parse(JSON.stringify(scope.row.idc))" ref="idcConfigBox" :is-edit="false" placement="left" @after="getAssetData(null, true)" :button-class="'checkbox-edit'" :user-data="idcUserData">-->
|
||||||
@@ -187,6 +187,7 @@
|
|||||||
<button class="to-top" v-show="showTopBtn" @click="$toTop"><i class="nz-icon nz-icon-top"></i></button>
|
<button class="to-top" v-show="showTopBtn" @click="$toTop"><i class="nz-icon nz-icon-top"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<bottom-box v-if="showSubList" :show-sub-list="showSubList" :subResizeShow="subResizeShow" :obj="alertMsgAsset" :isFullScreen="isFullScreen" :from="'asset'" :targetTab="targetTab" :detail="assetDetail"
|
<bottom-box v-if="showSubList" :show-sub-list="showSubList" :subResizeShow="subResizeShow" :obj="alertMsgAsset" :isFullScreen="isFullScreen" :from="'asset'" :targetTab="targetTab" :detail="assetDetail"
|
||||||
|
@reload="getAssetData"
|
||||||
@closeSubList="showSubList = false"
|
@closeSubList="showSubList = false"
|
||||||
@fullScreen="fullScreen"
|
@fullScreen="fullScreen"
|
||||||
@exitFullScreen="exitFullScreen"
|
@exitFullScreen="exitFullScreen"
|
||||||
@@ -554,6 +555,9 @@
|
|||||||
this.targetTab = 'alertMessage';
|
this.targetTab = 'alertMessage';
|
||||||
this.alertMsgAsset = JSON.parse(JSON.stringify(asset));
|
this.alertMsgAsset = JSON.parse(JSON.stringify(asset));
|
||||||
this.showSubList = true;
|
this.showSubList = true;
|
||||||
|
/*this.$nextTick(() => {
|
||||||
|
this.$store.commit("assetForAlertListChange", this.$store.state.assetForAlertList+1);
|
||||||
|
});*/
|
||||||
},
|
},
|
||||||
getAssetData(data, flushRightBoxDc) {
|
getAssetData(data, flushRightBoxDc) {
|
||||||
this.searchLabel = Object.assign(this.searchLabel, this.pageObj);
|
this.searchLabel = Object.assign(this.searchLabel, this.pageObj);
|
||||||
|
|||||||
@@ -647,7 +647,7 @@
|
|||||||
this.currentModule = module;
|
this.currentModule = module;
|
||||||
this.endpointSearchLabel = {moduleId: ''};
|
this.endpointSearchLabel = {moduleId: ''};
|
||||||
this.$refs.projectSearch.clearSearch();
|
this.$refs.projectSearch.clearSearch();
|
||||||
this.showSubList=1;
|
this.showSubList = false;
|
||||||
this.selectedEndpoints=[];
|
this.selectedEndpoints=[];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const store = new Vuex.Store({
|
|||||||
type: -1 //0: asset 1: header
|
type: -1 //0: asset 1: header
|
||||||
},
|
},
|
||||||
assetDcList: 0, //监听此值,改变则刷新dc列表
|
assetDcList: 0, //监听此值,改变则刷新dc列表
|
||||||
assetForAlertList: '', //asset页跳转alertList时传递的assetId
|
assetForAlertList: 0, //asset页跳转alertList时传递的assetId
|
||||||
currentProject: {
|
currentProject: {
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user