fix:修改asset 顶部按钮,修改assetModel 上滑,修改module endpoint上滑编辑页面

This commit is contained in:
zhangyu
2021-05-14 17:09:57 +08:00
parent 6d24eb864b
commit e2636bee95
11 changed files with 59 additions and 39 deletions

View File

@@ -58,6 +58,8 @@
<panel-tab-new v-if="from === fromRoute.chartTemp && targetTab === 'panel'" v-show="subResizeShow" :detail="detail" :from="from" :tabs="tabs.chartTemp.chartTempTabTitle" :obj="obj" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new> <panel-tab-new v-if="from === fromRoute.chartTemp && targetTab === 'panel'" v-show="subResizeShow" :detail="detail" :from="from" :tabs="tabs.chartTemp.chartTempTabTitle" :obj="obj" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
<!--alertRule Tab--> <!--alertRule Tab-->
<alertMessageTabNew v-if="from === fromRoute.alertRule && targetTab === 'alertRuleAlertMessage'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.alertRule.alertRule" @changeTab="changeTab" :targetTab="targetTab"></alertMessageTabNew> <alertMessageTabNew v-if="from === fromRoute.alertRule && targetTab === 'alertRuleAlertMessage'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.alertRule.alertRule" @changeTab="changeTab" :targetTab="targetTab"></alertMessageTabNew>
<!--model 下滑-->
<asset-tab v-if="(from === fromRoute.model) && targetTab === 'asset'" :tabs="tabs.model" ref="assetTab" :from="from" :obj="obj" @changeTab="changeTab" @exit="closeSubList"></asset-tab>
</div> </div>
</div> </div>
</div> </div>
@@ -157,14 +159,14 @@ export default {
moduleTabTitle: [ moduleTabTitle: [
// { prop: 'panel', name: 'Detail' }, // { prop: 'panel', name: 'Detail' },
{ prop: 'endpoint', name: this.$t('asset.endpoint') }, { prop: 'endpoint', name: this.$t('asset.endpoint') },
{ prop: 'moduleAlertMessage', name: 'Alerts' } { prop: 'moduleAlertMessage', name: 'Alert' }
] ]
}, },
endpoint: { endpoint: {
endpointTabTitle: [ endpointTabTitle: [
// { prop: 'panel', name: 'Detail' }, // { prop: 'panel', name: 'Detail' },
{ prop: 'endpointQuery', name: 'Query' }, { prop: 'endpointQuery', name: 'Query' },
{ prop: 'endpointAlertMessage', name: 'Alerts' } { prop: 'endpointAlertMessage', name: 'Alert' }
] ]
}, },
chartTemp: { chartTemp: {
@@ -174,9 +176,12 @@ export default {
}, },
alertRule: { alertRule: {
alertRule: [ alertRule: [
{ prop: 'alertRuleAlertMessage', name: 'Alerts' } { prop: 'alertRuleAlertMessage', name: 'Alert' }
] ]
}, },
model: [
{ prop: 'asset', name: this.$t('asset.assets'), active: true }
],
dc: { dc: {
cabinet: [ cabinet: [
{ prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: true }, { prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: true },

View File

@@ -52,6 +52,7 @@ import subDataListMixin from '@/components/common/mixin/subDataList'
import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList' import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList'
import assetTable from '@/components/common/table/asset/assetTable' import assetTable from '@/components/common/table/asset/assetTable'
import assetBox from '@/components/common/rightBox/asset/assetBox' import assetBox from '@/components/common/rightBox/asset/assetBox'
import {fromRoute} from "@/components/common/js/constants";
export default { export default {
name: 'assetTab', name: 'assetTab',
mixins: [dataListMixin, subDataListMixin], mixins: [dataListMixin, subDataListMixin],
@@ -193,6 +194,10 @@ export default {
deep: true, deep: true,
handler (n, o) { handler (n, o) {
this.searchLabel.dcIds = n.id this.searchLabel.dcIds = n.id
if ( this.from === fromRoute.model) {
delete this.searchLabel.dcIds
this.searchLabel.modelIds = n.id
}
this.getTableData() this.getTableData()
} }
} }

View File

@@ -32,7 +32,7 @@
</template> </template>
</nz-bottom-data-list> </nz-bottom-data-list>
<transition name="right-box"> <transition name="right-box">
<edit-endpoint-box-new v-if="rightBox.editShow" :module="object" @close="closeRightEditBox" :disabled="true" :type="'edit'"></edit-endpoint-box-new> <edit-endpoint-box-new v-if="rightBox.editShow" :module="object" @close="closeRightEditBox" :disabled="true" :optionType="'edit'"></edit-endpoint-box-new>
</transition> </transition>
</div> </div>
</template> </template>

View File

@@ -107,7 +107,8 @@ const cn = {
copy: '复制', copy: '复制',
silence: '静默', silence: '静默',
labels: '标签', labels: '标签',
editType: '类型' editType: '类型',
searchCondition: '搜索条件'
}, },
setup: { setup: {
step0: '欢迎', step0: '欢迎',

View File

@@ -112,7 +112,8 @@ const en = {
moreOption: 'More option', moreOption: 'More option',
copy: 'Copy', copy: 'Copy',
silence: 'Silence', silence: 'Silence',
editType: 'Type' editType: 'Type',
searchCondition: 'Search condition'
}, },
pageSize: '/page', pageSize: '/page',
setup: { setup: {

View File

@@ -158,7 +158,7 @@ export default {
rollbackImport () { rollbackImport () {
let url let url
if (this.importUrl.indexOf('asset') > -1) { if (this.importUrl.indexOf('asset') > -1) {
url = '/asset/cancelImport' url = '/asset/asset/cancelImport'
} else if (this.importUrl.indexOf('endpoint') > -1) { } else if (this.importUrl.indexOf('endpoint') > -1) {
url = '/monitor/endpoint/cancelImport' url = '/monitor/endpoint/cancelImport'
} else if (this.importUrl.indexOf('rule') > -1) { } else if (this.importUrl.indexOf('rule') > -1) {
@@ -227,7 +227,7 @@ export default {
let url = null let url = null
if (this.importUrl.indexOf('asset') > -1) { if (this.importUrl.indexOf('asset') > -1) {
url = '/asset/template' url = '/asset/asset/template'
} else if (this.importUrl.indexOf('rule') > -1) { } else if (this.importUrl.indexOf('rule') > -1) {
url = '/alert/rule/template' url = '/alert/rule/template'
} else if (this.importUrl.indexOf('panel') > -1) { } else if (this.importUrl.indexOf('panel') > -1) {

View File

@@ -3,7 +3,7 @@
<div class="right-box__header"> <div class="right-box__header">
<div class="header__title">{{$t('asset.batchEditAsset')}}</div> <div class="header__title">{{$t('asset.batchEditAsset')}}</div>
<div class="header__operation"> <div class="header__operation">
<span><i class="nz-icon nz-icon-close"></i></span> <span @click="esc"><i class="nz-icon nz-icon-close"></i></span>
</div> </div>
</div> </div>
<div class="right-box__container"> <div class="right-box__container">

View File

@@ -60,13 +60,14 @@
fixed="right"> fixed="right">
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div> <div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
<div slot-scope="scope" class="table-operation-items"> <div slot-scope="scope" class="table-operation-items">
<button class="table-operation-item" @click="showBottomBox('operationLogTab', scope.row)"><i class="nz-icon nz-icon-view1"></i></button> <button class="table-operation-item" @click="$emit('edit', scope.row)"><i class="nz-icon nz-icon-edit"></i></button>
<!-- <button class="table-operation-item" @click="showBottomBox('operationLogTab', scope.row)"><i class="nz-icon nz-icon-view1"></i></button>-->
<el-dropdown size="medium" trigger="hover" @command="tableOperation"> <el-dropdown size="medium" trigger="hover" @command="tableOperation">
<div class="table-operation-item table-operation-item--more"> <div class="table-operation-item table-operation-item--more">
<span></span><i class="nz-icon nz-icon-arrow-down"></i> <span></span><i class="nz-icon nz-icon-arrow-down"></i>
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item> <!-- <el-dropdown-item :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>-->
<el-dropdown-item :command="['delete', scope.row]" :disabled="scope.row.id === 1"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item> <el-dropdown-item :command="['delete', scope.row]" :disabled="scope.row.id === 1"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@@ -93,14 +94,14 @@ export default {
label: this.$t('config.model.name'), label: this.$t('config.model.name'),
prop: 'name', prop: 'name',
show: true, show: true,
width: 160, width: 450,
sortable: 'custom' sortable: 'custom'
}, { }, {
label: this.$t('config.model.brand'), label: this.$t('config.model.brand'),
prop: 'brand', prop: 'brand',
show: true, show: true,
width: 160 width: 160,
,sortable:'custom' sortable: 'custom'
}, { }, {
label: this.$t('config.model.remark'), label: this.$t('config.model.remark'),
prop: 'remark', prop: 'remark',

View File

@@ -10,30 +10,34 @@
@search="search" @search="search"
> >
<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"> <delete-button id="asset-list-batch-delete" v-has="'asset_delete'" :api="url" :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true"></delete-button>
<i class="nz-icon nz-icon-funnel"></i> <button id="asset-create-asset" v-has="'asset_add'" :title="$t('overall.createAsset')" class="top-tool-btn" @click.stop="add">
<i class="nz-icon nz-icon-create-square"></i>
</button> </button>
<export-excel <top-tool-more-options
ref="export" id="model"
id="asset-list" :params="filter"
:params="searchLabel" :permissions="{
:permissions="{import: 'asset_add', export: 'asset_view'}" import: 'asset_add',
class="top-tool-export margin-r-10" export: 'asset_view'
export-file-name="asset" }"
class="top-tool-export margin-l-10 margin-r-10"
export-file-name="chart"
export-url="/asset/asset/export" export-url="/asset/asset/export"
import-url="/asset/asset/import" import-url="/asset/asset/import"
@afterImport="getTableData" @afterImport="getTableData"
> >
<template slot="optionZone"> <template v-slot:before>
<button id="asset-create-asset" v-has="'asset_add'" :title="$t('overall.createAsset')" class="top-tool-btn" @click.stop="add"> <div>
<i class="nz-icon nz-icon-create-square"></i> <el-dropdown-item>
</button> <div id="asset-batch-asset" v-has="'asset_edit'" @click.stop="batchEdit"><i class="nz-icon nz-icon-batch-edit"></i>{{$t('overall.batchEdit')}}</div>
</el-dropdown-item>
<el-dropdown-item>
<div id="asset-filte" :class="{ 'is-focus': dataListLayout.indexOf('clickSearch') > -1 }" v-has="'asset_edit'" @click.stop="showClickSearch"><i class="nz-icon nz-icon-funnel"></i>{{$t('overall.searchCondition')}}</div>
</el-dropdown-item>
</div>
</template> </template>
</export-excel> </top-tool-more-options>
<button id="asset-batch-asset" v-has="'asset_edit'" :title="$t('overall.batchEdit')" class="top-tool-btn margin-r-10" @click.stop="batchEdit">
<i class="nz-icon nz-icon-batch-edit"></i>
</button>
<delete-button id="asset-list-batch-delete" v-has="'asset_delete'" :api="url" :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true"></delete-button>
</template> </template>
<template v-slot:search> <template v-slot:search>
<click-search ref="clickSearch" :select-value.sync="selectValue" :title-search-list="titleSearchList" @reload="reloadTable"/> <click-search ref="clickSearch" :select-value.sync="selectValue" :title-search-list="titleSearchList" @reload="reloadTable"/>
@@ -85,7 +89,6 @@
</template> </template>
<script> <script>
import exportXLSX from '@/components/common/exportXLSX'
import deleteButton from '@/components/common/deleteButton' import deleteButton from '@/components/common/deleteButton'
import assetBox from '@/components/common/rightBox/asset/assetBox' import assetBox from '@/components/common/rightBox/asset/assetBox'
import assetBatchEditBox from '@/components/common/rightBox/asset/assetBatchEditBox' import assetBatchEditBox from '@/components/common/rightBox/asset/assetBatchEditBox'
@@ -93,6 +96,7 @@ import nzDataList from '@/components/common/table/nzDataList'
import dataListMixin from '@/components/common/mixin/dataList' import dataListMixin from '@/components/common/mixin/dataList'
import assetTable from '@/components/common/table/asset/assetTable' import assetTable from '@/components/common/table/asset/assetTable'
import clickSearch from '@/components/common/labelFilter/clickSearch' import clickSearch from '@/components/common/labelFilter/clickSearch'
import topToolMoreOptions from '@/components/common/popBox/topToolMoreOptions'
export default { export default {
name: 'asset', name: 'asset',
@@ -103,7 +107,7 @@ export default {
assetBatchEditBox, assetBatchEditBox,
assetTable, assetTable,
clickSearch, clickSearch,
'export-excel': exportXLSX topToolMoreOptions
}, },
mixins: [dataListMixin], mixins: [dataListMixin],
data () { data () {

View File

@@ -458,7 +458,7 @@ const tooltipPieOption = {
{ {
type: 'pie', type: 'pie',
animation: false, animation: false,
center: ['25%', '60%'], center: ['25%', '53%'],
radius: [36, 48], radius: [36, 48],
data: [], data: [],
label: { label: {

View File

@@ -621,6 +621,9 @@
padding-bottom: 5px; padding-bottom: 5px;
box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.12), -1px 1px 4px -1px rgba(205, 205, 205, 0.47); box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.12), -1px 1px 4px -1px rgba(205, 205, 205, 0.47);
} }
#tooltip-chart--endpoint{
margin-bottom: 10px;
}
} }
} }
.over-num{ .over-num{