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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@@ -7,7 +7,9 @@
:custom-table-title.sync="tools.customTableTitle" :custom-table-title.sync="tools.customTableTitle"
:from="fromRoute.module" :from="fromRoute.module"
:layout="['searchInput', 'elementSet']" :layout="['searchInput', 'elementSet']"
:search-msg="searchMsg"> :search-msg="searchMsg"
@search="search"
>
<template v-slot:top-tool-right> <template v-slot:top-tool-right>
<export-excel <export-excel
id="expression-template-list" id="expression-template-list"
@@ -21,7 +23,7 @@
class="top-tool-export margin-r-10" class="top-tool-export margin-r-10"
> >
<template slot="optionZone"> <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"> type="button" @click="add">
<i class="nz-icon-create-square nz-icon"></i> <i class="nz-icon-create-square nz-icon"></i>
</button> </button>

View File

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

View File

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

View File

@@ -7,9 +7,11 @@
:custom-table-title.sync="tools.customTableTitle" :custom-table-title.sync="tools.customTableTitle"
:from="fromRoute.project" :from="fromRoute.project"
:layout="['searchInput', 'elementSet']" :layout="['searchInput', 'elementSet']"
:search-msg="searchMsg"> :search-msg="searchMsg"
@search="search"
>
<template v-slot:top-tool-right> <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"> type="button" @click="add">
<i class="nz-icon-create-square nz-icon"></i> <i class="nz-icon-create-square nz-icon"></i>
</button> </button>