feat:Add chart by Temp 实现 50%
fix:修改endpointList 出现下弹窗时样式错乱的问题
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
||||||
<span class="el-dropdown-link chart-title">
|
<span class="el-dropdown-link chart-title">
|
||||||
<span class="chart-title-text">{{chartData.name}}</span>
|
<span class="chart-title-text">{{chartData.name}}</span>
|
||||||
<span class="chart-title-icon" v-if="from === 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
<span class="chart-title-icon" v-if="from !== 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
||||||
<span v-if="chartData.remark">
|
<span v-if="chartData.remark">
|
||||||
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
||||||
<i class="nz-icon nz-icon-info-normal"></i>
|
<i class="nz-icon nz-icon-info-normal"></i>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
||||||
<span class="el-dropdown-link chart-title">
|
<span class="el-dropdown-link chart-title">
|
||||||
<span class="chart-title-text">{{chartData.name}}</span>
|
<span class="chart-title-text">{{chartData.name}}</span>
|
||||||
<span class="chart-title-icon" v-if="from === 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
<span class="chart-title-icon" v-if="from !== 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
||||||
<span v-if="chartData.remark">
|
<span v-if="chartData.remark">
|
||||||
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
||||||
<i class="nz-icon nz-icon-info-normal"></i>
|
<i class="nz-icon nz-icon-info-normal"></i>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
{{chartData.name}}
|
{{chartData.name}}
|
||||||
<span v-show="!showList" class="collapse-content">({{chartData.children.length}} charts)</span>
|
<span v-show="!showList" class="collapse-content">({{chartData.children.length}} charts)</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="chart-title-icon" v-if="from === 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
<span class="chart-title-icon" v-if="from !== 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
||||||
<span v-if="chartData.remark">
|
<span v-if="chartData.remark">
|
||||||
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
||||||
<i class="nz-icon nz-icon-info-normal"></i>
|
<i class="nz-icon nz-icon-info-normal"></i>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
||||||
<span class="el-dropdown-link chart-title">
|
<span class="el-dropdown-link chart-title">
|
||||||
<span class="chart-title-text">{{chartData.name}}</span>
|
<span class="chart-title-text">{{chartData.name}}</span>
|
||||||
<span class="chart-title-icon" v-if="from === 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
<span class="chart-title-icon" v-if="from !== 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
||||||
<span v-if="chartData.remark">
|
<span v-if="chartData.remark">
|
||||||
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
||||||
<i class="nz-icon nz-icon-info-normal"></i>
|
<i class="nz-icon nz-icon-info-normal"></i>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
||||||
<span class="el-dropdown-link chart-title">
|
<span class="el-dropdown-link chart-title">
|
||||||
<span class="chart-title-text">{{chartData.name}}</span>
|
<span class="chart-title-text">{{chartData.name}}</span>
|
||||||
<span class="chart-title-icon" v-if="from === 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
<span class="chart-title-icon" v-if="from !== 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
||||||
<span v-if="chartData.remark">
|
<span v-if="chartData.remark">
|
||||||
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
||||||
<i class="nz-icon nz-icon-info-normal"></i>
|
<i class="nz-icon nz-icon-info-normal"></i>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
||||||
<span class="el-dropdown-link chart-title">
|
<span class="el-dropdown-link chart-title">
|
||||||
<span class="chart-title-text">{{chartData.name}}</span>
|
<span class="chart-title-text">{{chartData.name}}</span>
|
||||||
<span class="chart-title-icon" v-if="from === 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
<span class="chart-title-icon" v-if="from !== 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
||||||
<span v-if="chartData.remark">
|
<span v-if="chartData.remark">
|
||||||
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
||||||
<i class="nz-icon nz-icon-info-normal"></i>
|
<i class="nz-icon nz-icon-info-normal"></i>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
||||||
<span class="el-dropdown-link chart-title">
|
<span class="el-dropdown-link chart-title">
|
||||||
<span class="chart-title-text">{{chartData.name}}</span>
|
<span class="chart-title-text">{{chartData.name}}</span>
|
||||||
<span class="chart-title-icon" v-if="from === 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
<span class="chart-title-icon" v-if="from !== 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
||||||
<span v-if="chartData.remark">
|
<span v-if="chartData.remark">
|
||||||
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
||||||
<i class="nz-icon nz-icon-info-normal"></i>
|
<i class="nz-icon nz-icon-info-normal"></i>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
||||||
<span class="el-dropdown-link chart-title">
|
<span class="el-dropdown-link chart-title">
|
||||||
<span class="chart-title-text">{{chartData.name}}</span>
|
<span class="chart-title-text">{{chartData.name}}</span>
|
||||||
<span class="chart-title-icon" v-if="from === 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
<span class="chart-title-icon" v-if="from !== 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
||||||
<span v-if="chartData.remark">
|
<span v-if="chartData.remark">
|
||||||
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
||||||
<i class="nz-icon nz-icon-info-normal"></i>
|
<i class="nz-icon nz-icon-info-normal"></i>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
||||||
<span class="el-dropdown-link chart-title">
|
<span class="el-dropdown-link chart-title">
|
||||||
<span class="chart-title-text">{{chartData.name}}</span>
|
<span class="chart-title-text">{{chartData.name}}</span>
|
||||||
<span class="chart-title-icon" v-if="from === 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
<span class="chart-title-icon" v-if="from !== 'chartTemp'" :class="{'visible':caretShow,'hidden':!caretShow}">
|
||||||
<span v-if="chartData.remark">
|
<span v-if="chartData.remark">
|
||||||
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
<el-tooltip :content="chartData.remark" placement="top" effect="light">
|
||||||
<i class="nz-icon nz-icon-info-normal"></i>
|
<i class="nz-icon nz-icon-info-normal"></i>
|
||||||
|
|||||||
@@ -336,7 +336,8 @@ const cn = {
|
|||||||
moreTitle: '仅显示 20 个时间序列。',
|
moreTitle: '仅显示 20 个时间序列。',
|
||||||
moreTitleOther: '仅显示 10 条数据。',
|
moreTitleOther: '仅显示 10 条数据。',
|
||||||
showAll: '全部显示 ',
|
showAll: '全部显示 ',
|
||||||
showAllOther: '全部数据 '
|
showAllOther: '全部数据 ',
|
||||||
|
addChartTemp: 'addChartTemp'
|
||||||
},
|
},
|
||||||
metric: {
|
metric: {
|
||||||
name: '指标名称',
|
name: '指标名称',
|
||||||
@@ -563,7 +564,23 @@ const cn = {
|
|||||||
usernamePrompt: '用户名提示',
|
usernamePrompt: '用户名提示',
|
||||||
passwordPrompt: '密码提示',
|
passwordPrompt: '密码提示',
|
||||||
snmpCredential: 'SNMP凭证',
|
snmpCredential: 'SNMP凭证',
|
||||||
authProtocol: '认证协议'
|
authProtocol: '认证协议',
|
||||||
|
id: 'ID',
|
||||||
|
device: 'SN',
|
||||||
|
assetState: '状态',
|
||||||
|
modules: 'Endpoint',
|
||||||
|
alerts: '告警信息',
|
||||||
|
dataCenter: '数据中心',
|
||||||
|
manufacturer: '厂商',
|
||||||
|
procurementDate: '购买日期',
|
||||||
|
principalTel: '电话',
|
||||||
|
option: '操作',
|
||||||
|
assetPing: 'Ping',
|
||||||
|
lastReply: 'Ping最后应答',
|
||||||
|
vendor: '厂商',
|
||||||
|
name: 'Name',
|
||||||
|
dc: '数据中心',
|
||||||
|
type: '主机地址'
|
||||||
},
|
},
|
||||||
config: {
|
config: {
|
||||||
config: '设置',
|
config: '设置',
|
||||||
|
|||||||
@@ -345,7 +345,8 @@ const en = {
|
|||||||
moreTitle: 'Showing only 20 time series. ',
|
moreTitle: 'Showing only 20 time series. ',
|
||||||
moreTitleOther: 'Showing only 10 the data. ',
|
moreTitleOther: 'Showing only 10 the data. ',
|
||||||
showAll: 'Show all ',
|
showAll: 'Show all ',
|
||||||
showAllOther: 'All Data'
|
showAllOther: 'All Data',
|
||||||
|
addChartTemp: 'addChartTemp'
|
||||||
},
|
},
|
||||||
metric: {
|
metric: {
|
||||||
name: 'Metric name', // "指标名称"
|
name: 'Metric name', // "指标名称"
|
||||||
@@ -571,7 +572,22 @@ const en = {
|
|||||||
usernamePrompt: 'Username prompt',
|
usernamePrompt: 'Username prompt',
|
||||||
passwordPrompt: 'Password prompt',
|
passwordPrompt: 'Password prompt',
|
||||||
snmpCredential: 'SNMP credential',
|
snmpCredential: 'SNMP credential',
|
||||||
authProtocol: 'Auth protocol'
|
authProtocol: 'Auth protocol',
|
||||||
|
id: 'ID', // ID
|
||||||
|
device: 'SN', // SN
|
||||||
|
assetState: 'State', // '状态'
|
||||||
|
assetPing: 'Ping',
|
||||||
|
lastReply: 'Ping last reply',
|
||||||
|
modules: 'Endpoint', // '组件'
|
||||||
|
alerts: 'Alerts', // '告警信息'
|
||||||
|
dataCenter: 'Data center', // DC
|
||||||
|
vendor: 'Vendor', // '厂商'
|
||||||
|
procurementDate: 'Purchase date', // '购买日期'
|
||||||
|
principalTel: 'Telephone', // '电话'
|
||||||
|
option: 'Operation', // "操作"
|
||||||
|
name: 'Name',
|
||||||
|
dc: 'DataCenter',
|
||||||
|
type: 'Types',
|
||||||
},
|
},
|
||||||
config: {
|
config: {
|
||||||
config: 'Settings', // "设置"
|
config: 'Settings', // "设置"
|
||||||
@@ -682,9 +698,9 @@ const en = {
|
|||||||
latitude: 'Latitude',
|
latitude: 'Latitude',
|
||||||
lnglat: 'Coordinate'
|
lnglat: 'Coordinate'
|
||||||
},
|
},
|
||||||
cabinet:{
|
cabinet: {
|
||||||
editCabinet:'Edit Cabinet',
|
editCabinet: 'Edit Cabinet',
|
||||||
createCabinet:'Create Cabinet',
|
createCabinet: 'Create Cabinet'
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
model: 'Asset model',
|
model: 'Asset model',
|
||||||
@@ -752,11 +768,11 @@ const en = {
|
|||||||
replay: 'Replay',
|
replay: 'Replay',
|
||||||
skipTip: 'Skip no operation time'
|
skipTip: 'Skip no operation time'
|
||||||
},
|
},
|
||||||
loginHost:'Login host',
|
loginHost: 'Login host',
|
||||||
loginUser:'Login user',
|
loginUser: 'Login user',
|
||||||
sourceIp:'Source IP',
|
sourceIp: 'Source IP',
|
||||||
sourceUser:'Source user',
|
sourceUser: 'Source user',
|
||||||
SessionId:'Session ID',
|
SessionId: 'Session ID'
|
||||||
},
|
},
|
||||||
operationlog: {
|
operationlog: {
|
||||||
operationlog: 'Operation log',
|
operationlog: 'Operation log',
|
||||||
@@ -831,8 +847,8 @@ const en = {
|
|||||||
defaultCabinetUsize: 'Cabinet U size',
|
defaultCabinetUsize: 'Cabinet U size',
|
||||||
second: 'second',
|
second: 'second',
|
||||||
day: 'day',
|
day: 'day',
|
||||||
sessionTimeout:'Session timeout',
|
sessionTimeout: 'Session timeout',
|
||||||
minute:'minute',
|
minute: 'minute',
|
||||||
maxSeries: 'Query max series',
|
maxSeries: 'Query max series',
|
||||||
unsaved: 'Unsaved prompt',
|
unsaved: 'Unsaved prompt',
|
||||||
mapConfig: 'Map center',
|
mapConfig: 'Map center',
|
||||||
@@ -1016,7 +1032,7 @@ const en = {
|
|||||||
expressionError: 'Please fill in the "expression" value'
|
expressionError: 'Please fill in the "expression" value'
|
||||||
},
|
},
|
||||||
chartTemp: {
|
chartTemp: {
|
||||||
chartTemp: 'Chart template',
|
chartTemp: 'Chart template'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
alert: {
|
alert: {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export default {
|
|||||||
customTableTitle: [] // 自定义列工具的数据
|
customTableTitle: [] // 自定义列工具的数据
|
||||||
},
|
},
|
||||||
mainTableHeight: this.$tableHeight.normal, // 主列表table高度
|
mainTableHeight: this.$tableHeight.normal, // 主列表table高度
|
||||||
|
searchTableHeight: this.$tableHeight.search, // 主列表table高度
|
||||||
batchDeleteObjs: [],
|
batchDeleteObjs: [],
|
||||||
object: {},
|
object: {},
|
||||||
|
|
||||||
|
|||||||
@@ -529,7 +529,7 @@ export default {
|
|||||||
deep: true,
|
deep: true,
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler (n) {
|
handler (n) {
|
||||||
if (n.id) {
|
if (n && n.id) {
|
||||||
if (getTopology(this.topologyIndex)) {
|
if (getTopology(this.topologyIndex)) {
|
||||||
getTopology(this.topologyIndex).destroy()
|
getTopology(this.topologyIndex).destroy()
|
||||||
setTopology(this.topologyIndex, null)
|
setTopology(this.topologyIndex, null)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
262
nezha-fronted/src/components/common/rightBox/chartTempBox.vue
Normal file
262
nezha-fronted/src/components/common/rightBox/chartTempBox.vue
Normal file
@@ -0,0 +1,262 @@
|
|||||||
|
<template>
|
||||||
|
<div v-clickoutside="{obj: editChartTemp, func: esc}" class="right-box right-box-asset">
|
||||||
|
<div class="right-box__header">
|
||||||
|
<div class="header__title">{{editChartTemp.id ? $t('config.user.editChartTemp') : $t('config.user.createUser')}}</div>
|
||||||
|
<div class="header__operation">
|
||||||
|
<span v-cancel="{obj: editChartTemp, func: esc}"><i class="nz-icon nz-icon-close"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="right-box__container">
|
||||||
|
<div class="container__form">
|
||||||
|
<el-form ref="userForm" :model="editChartTemp" :rules="editChartTemp.id ? rules2 : rules" class="right-box-form right-box-form-left" label-position="top" label-width="120px">
|
||||||
|
<!--type-->
|
||||||
|
<el-form-item :label="$t('dashboard.panel.chartForm.varType')">
|
||||||
|
<el-select class="right-box-row-with-btn" placeholder="" clearable popper-class="chart-box-dropdown-small" size="mini" v-model="editChartTemp.varType" value-key="chartType" id="chart-box-group">
|
||||||
|
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in varTypeArr">
|
||||||
|
<span class="panel-dropdown-label-txt" >{{item.name}}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!--chartTemp list-->
|
||||||
|
<el-form-item :label="$t('dashboard.panel.chartForm.varType')">
|
||||||
|
<el-select class="right-box-row-with-btn" placeholder="" clearable popper-class="chart-box-dropdown-small" size="mini" v-model="editChartTemp.pid" value-key="chartType" id="chart-box-group">
|
||||||
|
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in chartTempArr">
|
||||||
|
<span class="panel-dropdown-label-txt" >{{item.name}}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 选择资产,穿梭框 -->
|
||||||
|
<div class="form__sub-title">{{$t('overall.select')}}</div>
|
||||||
|
<nz-transfer ref="transfer"
|
||||||
|
:page-obj="transfer.pageObj"
|
||||||
|
:search-msg="transfer.searchMsg"
|
||||||
|
:table-data="transfer.tableData"
|
||||||
|
style="margin-bottom: 20px;"
|
||||||
|
@leftToRight="addAsset"
|
||||||
|
@search="search"
|
||||||
|
@rightToLeft="removeAsset">
|
||||||
|
<template v-slot:title>Selected</template>
|
||||||
|
</nz-transfer>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="right-box__footer">
|
||||||
|
<button id="asset-edit-cancel" v-cancel="{obj: editChartTemp, func: esc}" class="footer__btn footer__btn--light">
|
||||||
|
<span>{{$t('overall.cancel')}}</span>
|
||||||
|
</button>
|
||||||
|
<button id="asset-edit-save" :class="{'footer__btn--disabled': prevent_opt.save}" :disabled="prevent_opt.save" class="footer__btn" @click="save">
|
||||||
|
<span>{{$t('overall.save')}}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import nzTransfer from '@/components/common/nzTransfer'
|
||||||
|
export default {
|
||||||
|
name: 'chartTemp',
|
||||||
|
components: {
|
||||||
|
nzTransfer
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
obj: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isCurrentUser () {
|
||||||
|
return function (username) {
|
||||||
|
return localStorage.getItem('nz-username') == username
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
editChartTemp: {},
|
||||||
|
url: 'visual/panel/chart/fromTmpl',
|
||||||
|
rightBox: { model: { show: false } },
|
||||||
|
rules: { // 表单校验规则
|
||||||
|
name: [
|
||||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
varTypeArr: [
|
||||||
|
{ name: 'Asset', id: 1 },
|
||||||
|
{ name: 'Endpoint', id: 2 }
|
||||||
|
],
|
||||||
|
chartTempArr: [],
|
||||||
|
tableData: [],
|
||||||
|
transfer: {
|
||||||
|
tableData: [],
|
||||||
|
selectedData: [],
|
||||||
|
searchLabel: {},
|
||||||
|
searchMsg: { // 给搜索框子组件传递的信息
|
||||||
|
zheze_none: true,
|
||||||
|
searchLabelList: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: 'ID',
|
||||||
|
type: 'input',
|
||||||
|
label: 'id',
|
||||||
|
disabled: false
|
||||||
|
}, {
|
||||||
|
id: 20,
|
||||||
|
name: 'SN',
|
||||||
|
type: 'input',
|
||||||
|
label: 'sn',
|
||||||
|
disabled: false
|
||||||
|
}, {
|
||||||
|
id: 21,
|
||||||
|
name: 'Host',
|
||||||
|
type: 'input',
|
||||||
|
label: 'host',
|
||||||
|
disabled: false
|
||||||
|
}, {
|
||||||
|
id: 22,
|
||||||
|
name: this.$t('asset.state'),
|
||||||
|
type: 'select',
|
||||||
|
label: 'assetState',
|
||||||
|
disabled: false
|
||||||
|
}, {
|
||||||
|
id: 23,
|
||||||
|
name: 'pingStatus',
|
||||||
|
type: 'select',
|
||||||
|
label: 'pingStatus',
|
||||||
|
disabled: false
|
||||||
|
}, {
|
||||||
|
id: 23,
|
||||||
|
name: this.$t('asset.cabinet'),
|
||||||
|
type: 'input',
|
||||||
|
label: 'cabinetName',
|
||||||
|
disabled: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
pageObj: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
pages: 1,
|
||||||
|
total: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
obj: {
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
handler (n) {
|
||||||
|
this.editChartTemp = JSON.parse(JSON.stringify(n))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.getChartTempData()
|
||||||
|
this.getAssetData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clickOutside () {
|
||||||
|
this.esc(false)
|
||||||
|
},
|
||||||
|
/* 关闭弹框 */
|
||||||
|
esc (refresh) {
|
||||||
|
this.prevent_opt.save = false
|
||||||
|
this.$emit('close', refresh)
|
||||||
|
},
|
||||||
|
save () {
|
||||||
|
if (this.prevent_opt.save) { return } ;
|
||||||
|
this.prevent_opt.save = true
|
||||||
|
if (!this.transfer.selectedData.length) {
|
||||||
|
this.prevent_opt.save = false
|
||||||
|
if (this.editChartTemp.varType === 1) {
|
||||||
|
this.$message.error('请选择Asset')
|
||||||
|
} else {
|
||||||
|
this.$message.error('请选择Endpoint')
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.editChartTemp.varIds = this.transfer.selectedData.map(item => item.id)
|
||||||
|
this.$refs.userForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.editChartTemp.id) {
|
||||||
|
this.$put(this.url, this.editChartTemp).then(res => {
|
||||||
|
this.prevent_opt.save = false
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||||
|
this.esc(true)
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$post(this.url, this.editChartTemp).then(res => {
|
||||||
|
this.prevent_opt.save = false
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||||
|
this.esc(true)
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.prevent_opt.save = false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
search (searchLabel, page) {
|
||||||
|
this.transfer.searchLabel = JSON.parse(JSON.stringify(searchLabel))
|
||||||
|
this.transfer.pageObj = JSON.parse(JSON.stringify(page))
|
||||||
|
this.getAssetData()
|
||||||
|
},
|
||||||
|
addAsset (toAdd) {
|
||||||
|
this.transfer.selectedData = toAdd
|
||||||
|
this.transfer.tableData.forEach(d => {
|
||||||
|
this.$set(d, 'hide', this.transfer.selectedData.some(s => s.id === d.id))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
removeAsset (toRemove) {
|
||||||
|
this.transfer.selectedData = this.transfer.selectedData.filter(d => !toRemove.find(s => d.id === s.id))
|
||||||
|
this.transfer.tableData.forEach(d => {
|
||||||
|
this.$set(d, 'hide', this.transfer.selectedData.some(s => s.id === d.id))
|
||||||
|
})
|
||||||
|
// dc, brand, model, type
|
||||||
|
},
|
||||||
|
getChartTempData () {
|
||||||
|
this.$get('visual/panel/chart', { pageSize: -1, panelId: 0, returnChildren: 0, varType: this.editChartTemp.varType }).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.chartTempArr = response.data.list
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getAssetData () {
|
||||||
|
this.$refs.transfer.startLoading()
|
||||||
|
this.$get('asset/asset', { ...this.transfer.searchLabel, ...this.transfer.pageObj }).then(response => {
|
||||||
|
this.$refs.transfer.endLoading()
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.transfer.tableData = response.data.list
|
||||||
|
this.transfer.pageObj.total = response.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getEndpointData () {
|
||||||
|
this.$refs.transfer.startLoading()
|
||||||
|
this.$get('monitor/endpoint', { ...this.transfer.searchLabel, ...this.transfer.pageObj }).then(response => {
|
||||||
|
this.$refs.transfer.endLoading()
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.transfer.tableData = response.data.list
|
||||||
|
this.transfer.pageObj.total = response.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
varTypeChange () {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
@import '@/assets/css/common/rightBoxCommon.scss';
|
||||||
|
</style>
|
||||||
@@ -91,6 +91,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</export-excel>
|
</export-excel>
|
||||||
|
<button id="chart-temp-add" class="top-tool-btn margin-l-10" type="button" @click="addChartByTemp"><i class='nz-icon nz-icon-lock'></i></button>
|
||||||
<button id="panel-lock" class="top-tool-btn margin-l-10" type="button" @click="panelLock=!panelLock"><i :class="{'nz-icon nz-icon-lock':panelLock,'nz-icon nz-icon-unlock':!panelLock}"></i></button>
|
<button id="panel-lock" class="top-tool-btn margin-l-10" type="button" @click="panelLock=!panelLock"><i :class="{'nz-icon nz-icon-lock':panelLock,'nz-icon nz-icon-unlock':!panelLock}"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -107,6 +108,9 @@
|
|||||||
<transition name="right-box">
|
<transition name="right-box">
|
||||||
<chart-box :chart="chart" :from="$CONSTANTS.fromRoute.panel" :panel-data="panelData" :show-panel="showPanel" @close="closeChartBox" @delete-chart="delChart" @on-create-success="createSuccess" @on-delete-success="delChartOk" @reload="panelReload" @reloadOnlyPanel="panelReloadOnlyPanel" ref="addChartModal" v-if="rightBox.chart.show"></chart-box>
|
<chart-box :chart="chart" :from="$CONSTANTS.fromRoute.panel" :panel-data="panelData" :show-panel="showPanel" @close="closeChartBox" @delete-chart="delChart" @on-create-success="createSuccess" @on-delete-success="delChartOk" @reload="panelReload" @reloadOnlyPanel="panelReloadOnlyPanel" ref="addChartModal" v-if="rightBox.chart.show"></chart-box>
|
||||||
</transition>
|
</transition>
|
||||||
|
<transition name="right-box">
|
||||||
|
<chart-temp-box :obj="chart" :from="$CONSTANTS.fromRoute.panel" :panel-data="panelData" :show-panel="showPanel" @close="closeChartTempBox" @on-create-success="createSuccess" v-if="rightBox.chartTemp.show"></chart-temp-box>
|
||||||
|
</transition>
|
||||||
<transition name="right-box">
|
<transition name="right-box">
|
||||||
<panel-box v-if="closePanelBox" :panel="panel" @reload="panelReload" @reloadForDel="panelReloadForDel" ref="panelBox"></panel-box>
|
<panel-box v-if="closePanelBox" :panel="panel" @reload="panelReload" @reloadForDel="panelReloadForDel" ref="panelBox"></panel-box>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -121,6 +125,7 @@ import pickTime from '../../common/pickTime'
|
|||||||
import exportXLSX from '../../common/exportXLSX'
|
import exportXLSX from '../../common/exportXLSX'
|
||||||
import selectPanel from '../../common/popBox/selectPanel'
|
import selectPanel from '../../common/popBox/selectPanel'
|
||||||
import panelBox from '@/components/common/rightBox/panelBox'
|
import panelBox from '@/components/common/rightBox/panelBox'
|
||||||
|
import chartTempBox from '@/components/common/rightBox/chartTempBox'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'panel',
|
name: 'panel',
|
||||||
@@ -131,6 +136,7 @@ export default {
|
|||||||
visible: false,
|
visible: false,
|
||||||
rightBox: { // 面板弹出框相关
|
rightBox: { // 面板弹出框相关
|
||||||
chart: { show: false },
|
chart: { show: false },
|
||||||
|
chartTemp: { show: false },
|
||||||
panel: { show: false }
|
panel: { show: false }
|
||||||
},
|
},
|
||||||
tableHover: false,
|
tableHover: false,
|
||||||
@@ -166,6 +172,12 @@ export default {
|
|||||||
pageSize: -1, // 此处获取所有数据,所以设置一个较大的值
|
pageSize: -1, // 此处获取所有数据,所以设置一个较大的值
|
||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
|
blankChartTemp: {
|
||||||
|
varType: 1,
|
||||||
|
pid: '',
|
||||||
|
panelId: '',
|
||||||
|
varIds: []
|
||||||
|
},
|
||||||
chartsData: [], // 中间部分图表相关数据
|
chartsData: [], // 中间部分图表相关数据
|
||||||
panelData: [],
|
panelData: [],
|
||||||
panelDataDragTmp: [],
|
panelDataDragTmp: [],
|
||||||
@@ -204,7 +216,8 @@ export default {
|
|||||||
'pick-time': pickTime,
|
'pick-time': pickTime,
|
||||||
'export-excel': exportXLSX,
|
'export-excel': exportXLSX,
|
||||||
selectPanel,
|
selectPanel,
|
||||||
'panel-box': panelBox
|
'panel-box': panelBox,
|
||||||
|
chartTempBox
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 刷新
|
// 刷新
|
||||||
@@ -290,6 +303,11 @@ export default {
|
|||||||
this.chart.panelName = this.showPanel.name
|
this.chart.panelName = this.showPanel.name
|
||||||
this.rightBox.chart.show = true
|
this.rightBox.chart.show = true
|
||||||
},
|
},
|
||||||
|
addChartByTemp () {
|
||||||
|
this.chart = Object.assign({},this.blankChartTemp)
|
||||||
|
this.chart.panelId = this.showPanel.id
|
||||||
|
this.rightBox.chartTemp.show = true
|
||||||
|
},
|
||||||
addGroupItem (groupId) {
|
addGroupItem (groupId) {
|
||||||
this.chart = this.newChart()
|
this.chart = this.newChart()
|
||||||
this.chart.groupId = groupId
|
this.chart.groupId = groupId
|
||||||
@@ -317,6 +335,12 @@ export default {
|
|||||||
|
|
||||||
} */
|
} */
|
||||||
},
|
},
|
||||||
|
closeChartTempBox () {
|
||||||
|
this.rightBox.chartTemp.show = false
|
||||||
|
/* if (refresh) {
|
||||||
|
|
||||||
|
} */
|
||||||
|
},
|
||||||
closePanelBox (refresh) {
|
closePanelBox (refresh) {
|
||||||
this.rightBox.panel.show = false
|
this.rightBox.panel.show = false
|
||||||
/* if (refresh) {
|
/* if (refresh) {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
v-loading="slotProps.loading"
|
v-loading="slotProps.loading"
|
||||||
:api="url"
|
:api="url"
|
||||||
:custom-table-title="tools.customTableTitle"
|
:custom-table-title="tools.customTableTitle"
|
||||||
:height="mainTableHeight"
|
:height="searchTableHeight"
|
||||||
:table-data="tableData"
|
:table-data="tableData"
|
||||||
:tableId="tableId"
|
:tableId="tableId"
|
||||||
@del="del"
|
@del="del"
|
||||||
|
|||||||
@@ -89,10 +89,49 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getTableData (params) {
|
||||||
|
if (params && Object.keys(params).length > 0) {
|
||||||
|
for (const key in params) {
|
||||||
|
this.$set(this.searchLabel, key, params[key])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
|
||||||
|
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
|
||||||
|
this.tools.loading = true
|
||||||
|
this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then(response => {
|
||||||
|
this.tools.loading = false
|
||||||
|
if (response.code === 200) {
|
||||||
|
for (let i = 0; i < response.data.list.length; i++) {
|
||||||
|
response.data.list[i].status = response.data.list[i].status + ''
|
||||||
|
}
|
||||||
|
if (!this.$store.state.currentProject.id) {
|
||||||
|
this.$store.commit('currentProjectChange', response.data.list[0])
|
||||||
|
}
|
||||||
|
this.tableData = response.data.list
|
||||||
|
this.pageObj.total = response.data.total
|
||||||
|
if (!this.scrollbarWrap) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
|
||||||
|
this.toTopBtnHandler(this.scrollbarWrap)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
console.log(this.$store.state.currentProject)
|
||||||
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
},
|
||||||
|
destroyed () {
|
||||||
|
this.$store.commit('currentProjectChange', {
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
remark: ''
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ Vue.prototype.$chartResizeTool = chartResizeTool
|
|||||||
Vue.prototype.$tableSet = tableSet
|
Vue.prototype.$tableSet = tableSet
|
||||||
Vue.prototype.$tableHeight = { // 列表页表格的高度
|
Vue.prototype.$tableHeight = { // 列表页表格的高度
|
||||||
normal: 'calc(100% - 48px)', // 常规高度,特例在下方定义
|
normal: 'calc(100% - 48px)', // 常规高度,特例在下方定义
|
||||||
|
search: 'calc(100% - 240px)', // 常规高度,特例在下方定义
|
||||||
openSubList: { // 打开二级列表后的高度
|
openSubList: { // 打开二级列表后的高度
|
||||||
mainList: 'calc(100% - 60px)',
|
mainList: 'calc(100% - 60px)',
|
||||||
subList: 'calc(100% - 38px)',
|
subList: 'calc(100% - 38px)',
|
||||||
|
|||||||
Reference in New Issue
Block a user