fix: 恢复project修改,修复overview/asset接口

This commit is contained in:
chenjinsong
2021-04-30 11:45:22 +08:00
parent 66409db79f
commit 3f348e3624
9 changed files with 654 additions and 635 deletions

View File

@@ -43,6 +43,7 @@ import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList'
import axios from 'axios'
import bus from '@/libs/bus'
import alertMessageTable from '@/components/common/table/alert/alertMessageTable.vue'
import { fromRoute } from '@/components/common/js/constants'
// import {getTime} from "@/components/common/js/tools";
// import chartDataFormat from "@/components/charts/chartDataFormat";
@@ -293,14 +294,16 @@ export default {
delete this.searchLabel.endAt
}
this.tools.loading = true
if (this.targetTab === 'moduleAlertMessage') {
if (this.from === fromRoute.module) {
this.searchLabel.moduleIds = this.obj.id
} else {
} else if (this.from === fromRoute.endpoint) {
this.searchLabel.endpointIds = this.obj.id
} else if (this.from === fromRoute.asset) {
this.searchLabel.assetIds = this.obj.id
}
this.$get(this.url, this.searchLabel).then(response => {
this.tools.loading = false
if (response.code == 200) {
if (response.code === 200) {
this.nowTime = this.utcTimeToTimezoneStr(response.time)
this.tableData = response.data.list
const axiosAll = []

View File

@@ -43,6 +43,7 @@ import subDataListMixin from '@/components/common/mixin/subDataList'
import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList'
import endpointTable from '@/components/common/table/settings/endpointTable'
import EditEndpointBoxNew from '@/components/common/rightBox/editEndpointBoxNew'
import {fromRoute} from "@/components/common/js/constants";
export default {
name: 'terminalLogTab',
@@ -56,7 +57,6 @@ export default {
obj: {
immediate: true,
handler (n) {
console.log(n)
if (n) {
this.getTableData()
}
@@ -99,7 +99,11 @@ export default {
pageNo: this.pageObj.pageNo,
pageSize: this.pageObj.pageSize
}
params.moduleIds = this.obj.id
if (this.from === fromRoute.module) {
params.moduleIds = this.obj.id
} else if (this.from === fromRoute.asset) {
params.assetIds = this.obj.id
}
this.$get(this.url, params).then(response => {
this.tools.loading = false
if (response.code === 200) {

File diff suppressed because it is too large Load Diff

View File

@@ -96,7 +96,7 @@
</el-tooltip>
<div class="content-col-content-title">{{$t("overall.alert")}}</div>
</div>
<div class="content-alert-num">{{$t("dashboard.overview.alert.ruleNum")}}&nbsp;:&nbsp;{{(alertRuleData ? alertRuleData.alertRuleTotal : "") | numberFormat}}</div>
<div class="content-alert-num">{{$t("dashboard.overview.alert.ruleNum")}}&nbsp;:&nbsp;{{(alertRuleData ? alertRuleData : "") | numberFormat}}</div>
</div>
</div>
</div>
@@ -222,7 +222,7 @@ export default {
endpointData: { num: 0 },
alertMessageLoading: false,
alertMessageData: { num: 0 },
alertRuleData: [],
alertRuleData: 0,
map: null,
allProject: [],
@@ -605,7 +605,9 @@ export default {
return new Promise(resolve => {
this.$get('stat/alertRule/total').then(response => {
if (response.code === 200) {
this.alertRuleData = response.data
response.data.list.forEach(d => {
this.alertRuleData += d.num
})
}
resolve()
})

View File

@@ -1,17 +1,18 @@
<template>
<div class="endpoint-list" v-has="'endpoint_list'">
<div>
<nz-data-list
ref="dataList"
:api="url"
:tableId="tableId"
class="dataList"
:custom-table-title.sync="tools.customTableTitle"
:from="fromRoute.endpoint"
:layout="['searchInput', 'elementSet']"
:hasSearch="true"
:layout="dataListLayout"
:search-msg="searchMsg"
@search="search"
:search-msg="searchMsg">
>
<template v-slot:top-tool-right>
<button id="asset-filter" :class="{ 'is-focus': dataListLayout.indexOf('clickSearch') > -1 }" class="top-tool-btn margin-r-10" @click.stop="showClickSearch">
<i class="nz-icon nz-icon-funnel"></i>
</button>
<export-excel
id="expression-template-list"
v-has="''"
@@ -24,7 +25,7 @@
class="top-tool-export margin-r-10"
>
<template slot="optionZone">
<button id="account-add" v-has="'monitor_endpoint_add'" class="top-tool-btn margin-l-20"
<button id="account-add" v-has="'monitor_endpoint_add'" class="top-tool-btn"
type="button" @click="add">
<i class="nz-icon-create-square nz-icon"></i>
</button>
@@ -45,7 +46,7 @@
v-loading="slotProps.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="searchTableHeight"
:height="dataListLayout.indexOf('clickSearch') > -1 ? endpointTableHeight : mainTableHeight"
:table-data="tableData"
:tableId="tableId"
@del="del"
@@ -106,6 +107,8 @@ export default {
blankObject: {}, // 新增/编辑的endpoint
tableId: 'endpointTable',
queryPermission: 'account_view',
endpointTableHeight: 'calc(100% - 193px)', // 主列表table高度
dataListLayout: ['searchInput', 'elementSet'],
searchMsg: { // 给搜索框子组件传递的信息
zheze_none: true,
searchLabelList: [{
@@ -354,7 +357,4 @@ export default {
flex: 1;
width: 100%;
}
/deep/ .nz-btn-disabled {
opacity: 0.5;
}
</style>

View File

@@ -7,7 +7,9 @@
:custom-table-title.sync="tools.customTableTitle"
:from="fromRoute.module"
:layout="['searchInput', 'elementSet']"
:search-msg="searchMsg">
:search-msg="searchMsg"
@search="search"
>
<template v-slot:top-tool-right>
<export-excel
id="expression-template-list"
@@ -21,7 +23,7 @@
class="top-tool-export margin-r-10"
>
<template slot="optionZone">
<button id="account-add" v-has="'monitor_module_add'" :title="$t('overall.createUser')" class="top-tool-btn margin-l-20"
<button id="account-add" v-has="'monitor_module_add'" :title="$t('overall.createUser')" class="top-tool-btn"
type="button" @click="add">
<i class="nz-icon-create-square nz-icon"></i>
</button>

View File

@@ -1,7 +1,7 @@
<template>
<div class="main-list">
<projectList :class="showList?'projectList':'hide'" />
<projectTopo :class="showList?'projectTopo':'projectTopo ml10'" />
<projectList :class="showList?'projectList':'hide'" />
<projectTopo :class="showList?'projectTopo':'projectTopo ml10'" />
</div>
</template>

View File

@@ -25,9 +25,7 @@
</style>
<template>
<div class="project">
<template>
<topologyL5 :obj="currentProject" targetTab.sync="panel" ref="facade" :topologyIndexF="topologyIndexF" v-if="reloadFacade" @changeTopologyIndexF="changeTopologyIndexF" v-has="'topo_list'"/>
</template>
<topologyL5 v-if="reloadFacade" ref="facade" v-has="'topo_list'" :obj="currentProject" :topologyIndexF="topologyIndexF" targetTab.sync="panel" @changeTopologyIndexF="changeTopologyIndexF"/>
<transition name="el-zoom-in-bottom">
<bottom-box v-if="bottomBox.showSubList"

View File

@@ -7,9 +7,11 @@
:custom-table-title.sync="tools.customTableTitle"
:from="fromRoute.project"
:layout="['searchInput', 'elementSet']"
:search-msg="searchMsg">
:search-msg="searchMsg"
@search="search"
>
<template v-slot:top-tool-right>
<button id="account-add" v-has="'project_add'" :title="$t('overall.createUser')" class="top-tool-btn margin-l-20 margin-r-10"
<button id="account-add" v-has="'project_add'" :title="$t('overall.createUser')" class="top-tool-btn margin-r-10"
type="button" @click="add">
<i class="nz-icon-create-square nz-icon"></i>
</button>