fix: 细节优化修改
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"author": "",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "node --max-old-space-size=6000 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --progress --config build/webpack.dev.conf.js",
|
||||
"dev": "node --max-old-space-size=10240 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --progress --config build/webpack.dev.conf.js",
|
||||
"start": "npm run dev",
|
||||
"build": "node build/build.js",
|
||||
"lint": "eslint --fix --ext .js,.vue src"
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<div class="sub-list__tabs">
|
||||
<!--机柜-->
|
||||
<cabinet-tab v-if="from === fromRoute.dc && targetTab === 'cabinet'" :tabs="tabs.dc.cabinet" v-show="subResizeShow" :obj="obj" @changeTab="changeTab"></cabinet-tab>
|
||||
<alertMessageTabNew v-if="from === fromRoute.dc && targetTab === 'alertMessageTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.dc.alertMessage" :targetTab="targetTab" @changeTab="changeTab"></alertMessageTabNew>
|
||||
<!--告警信息-->
|
||||
<alert-message-tab v-if="((from === fromRoute.alertRule || from === fromRoute.asset || from === fromRoute.endpoint || from === fromRoute.project ) && targetTab === 'alertMessage')" v-show="subResizeShow" :from="from" :obj="obj" @changeTab="changeTab"></alert-message-tab>
|
||||
<!--asset页的endpoint列表-->
|
||||
@@ -172,11 +173,18 @@ export default {
|
||||
dc: {
|
||||
cabinet: [
|
||||
{ prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: true },
|
||||
{ prop: 'asset', name: this.$t('asset.assets'), active: false }
|
||||
{ prop: 'asset', name: this.$t('asset.assets'), active: false },
|
||||
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }
|
||||
],
|
||||
asset: [
|
||||
{ prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: false },
|
||||
{ prop: 'asset', name: this.$t('asset.assets'), active: true }
|
||||
{ prop: 'asset', name: this.$t('asset.assets'), active: true },
|
||||
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }
|
||||
],
|
||||
alertMessage: [
|
||||
{ prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: false },
|
||||
{ prop: 'asset', name: this.$t('asset.assets'), active: false },
|
||||
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true }
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ const en = {
|
||||
panelId: 'ID' // ID
|
||||
},
|
||||
// 图表-侧滑框
|
||||
createChartTitle: 'New chart', // "新增图表"
|
||||
createChartTitle: 'New Chart Template', // "新增图表"
|
||||
editChartTitle: 'Edit', // "编辑图表"
|
||||
chartForm: {
|
||||
chartId: 'ID',
|
||||
@@ -677,6 +677,7 @@ const en = {
|
||||
type: 'Type', // "类别"
|
||||
checkTime: 'Check time',
|
||||
dataCenter: 'Data center',
|
||||
name : 'Name',
|
||||
agent: {
|
||||
agent: 'Agent',
|
||||
title: 'Download agent',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div v-clickoutside="{obj:editPromServer,func:clickOutside}" class="right-box right-box-prom">
|
||||
<!-- begin--标题-->
|
||||
<div class="right-box__header">
|
||||
<div class="header__title">{{editPromServer.id ? ($t("config.promServer.editProm") + " ID:" + editPromServer.id) : $t("config.promServer.createProm")}}</div>
|
||||
<div class="header__title">{{editPromServer.id ? ($t("config.agent.editProm") + " ID:" + editPromServer.id) : $t("config.agent.createProm")}}</div>
|
||||
<div class="header__operation">
|
||||
<span v-cancel="{obj: editPromServer, func: esc}"><i class="nz-icon nz-icon-close"></i></span>
|
||||
</div>
|
||||
@@ -11,9 +11,9 @@
|
||||
<!-- begin--表单-->
|
||||
<div class="right-box__container">
|
||||
<div class="container__form">
|
||||
<el-form ref="promServerForm" :model="editPromServer" :rules="rules" label-position = "top" label-width="120px">
|
||||
<el-form ref="agentForm" :model="editPromServer" :rules="rules" label-position = "top" label-width="120px">
|
||||
<!--DC-->
|
||||
<el-form-item :label="$t('config.dc.dc')" prop="dc.name">
|
||||
<el-form-item :label="$t('config.agent.name')" prop="name">
|
||||
<div class="right-box-form-content">
|
||||
<el-select id="prom-box-input-dc" v-model="editPromServer.dc" placeholder="" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="id">
|
||||
<el-option v-for="item in dcData" :id="'prom-edit-dc-op-'+item.id" :key="item.id" :label="item.name" :value="item">
|
||||
@@ -32,14 +32,14 @@
|
||||
<el-input id="prom-box-input-port" v-model.number="editPromServer.port" placeholder="" size="small" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<!--type-->
|
||||
<el-form-item :label="$t('config.promServer.type')" prop="type">
|
||||
<el-form-item :label="$t('config.agent.type')" prop="type">
|
||||
<!-- <el-cascader-->
|
||||
<!-- id="prom-box-input-type"-->
|
||||
<!-- style="width: 100%"-->
|
||||
<!-- v-model="editPromServer.type"-->
|
||||
<!-- placeholder=""-->
|
||||
<!-- size="small"-->
|
||||
<!-- :options="$CONSTANTS.promServer.theData"-->
|
||||
<!-- :options="$CONSTANTS.agent.theData"-->
|
||||
<!-- :props="{ multiple: false, checkStrictly: false ,emitPath:false}"-->
|
||||
<!-- clearable></el-cascader>-->
|
||||
<el-select v-model="editPromServer.type" :disabled="editPromServer.id != null&& editPromServer.id != ''" placeholder="" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="value">
|
||||
@@ -77,7 +77,7 @@ import { agent2 } from '@/components/common/js/constants'
|
||||
export default {
|
||||
name: 'agentBox',
|
||||
props: {
|
||||
promServer: Object
|
||||
agent: Object
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -127,11 +127,11 @@ export default {
|
||||
},
|
||||
/* 保存 */
|
||||
save () {
|
||||
this.$refs.promServerForm.validate(valid => {
|
||||
this.$refs.agentForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.prevent_opt.save = true
|
||||
if (this.editPromServer.id) {
|
||||
this.$put('promServer', this.editPromServer).then(response => {
|
||||
this.$put('agent', this.editPromServer).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||
this.esc(true)
|
||||
@@ -141,7 +141,7 @@ export default {
|
||||
this.prevent_opt.save = false
|
||||
})
|
||||
} else {
|
||||
this.$post('promServer', this.editPromServer).then(response => {
|
||||
this.$post('agent', this.editPromServer).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||
this.esc(true)
|
||||
@@ -163,7 +163,7 @@ export default {
|
||||
cancelButtonText: this.$t('tip.no'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$delete('promServer?ids=' + this.editPromServer.id).then(response => {
|
||||
this.$delete('agent?ids=' + this.editPromServer.id).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
||||
this.esc(true)
|
||||
@@ -184,7 +184,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
// 将prop里的user转为组件内部对象
|
||||
promServer: {
|
||||
agent: {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler (n) {
|
||||
|
||||
@@ -30,20 +30,20 @@
|
||||
@change="switchSearch"
|
||||
v-model="editAssetMeta.search"
|
||||
active-color="#ee9d3f"
|
||||
:active-value="1"
|
||||
:inactive-value="0">
|
||||
active-value="1"
|
||||
inactive-value="0">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item :label='$t("config.assetLabel.display")' prop="display">
|
||||
<el-switch
|
||||
v-model="editAssetMeta.display"
|
||||
active-color="#ee9d3f"
|
||||
:active-value="1"
|
||||
:inactive-value="0">
|
||||
active-value="1"
|
||||
inactive-value="0">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item :label='$t("config.assetLabel.type")' prop="type">
|
||||
<el-select v-model="editAssetMeta.type" size="small" class="right-box__select" placeholder='请选择' popper-class="right-box-select-dropdown prevent-clickoutside" :popper-append-to-body="false" @change="selectType">
|
||||
<el-select v-model="editAssetMeta.type" size="small" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" :popper-append-to-body="false" @change="selectType">
|
||||
<el-option v-for="(item, index) in typeData" :key="index" :value="item.value" :disabled="item.disabled">
|
||||
<div><i :class="item.icon"></i> <span >{{item.name}}</span></div>
|
||||
</el-option>
|
||||
@@ -160,8 +160,8 @@ export default {
|
||||
id: '',
|
||||
name: ''
|
||||
},
|
||||
search: 1,
|
||||
display: 1,
|
||||
search: '0',
|
||||
display: '0',
|
||||
type: '',
|
||||
param: {},
|
||||
remark: ''
|
||||
@@ -246,21 +246,23 @@ export default {
|
||||
assetLabel: {
|
||||
immediate: true,
|
||||
handler (n) {
|
||||
this.editAssetMeta = { ...n }
|
||||
this.editAssetMeta = { ...n, search: `${n.search}`, display: `${n.display}` }
|
||||
this.selectType(n.type, true)
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getGroupData()
|
||||
this.switchSearch()
|
||||
this.switchSearch('0')
|
||||
},
|
||||
methods: {
|
||||
switchSearch(value){
|
||||
this.typeData.forEach(element => {
|
||||
if( value === 0 ) {
|
||||
if( value == 0 ) {
|
||||
element.disabled = false
|
||||
}else {
|
||||
console.log(value);
|
||||
}else if(value == 1) {
|
||||
console.log(value);
|
||||
if(element.value == 'radio'){
|
||||
element.disabled = false
|
||||
}else if(element.value == 'checkbox'){
|
||||
@@ -268,6 +270,8 @@ export default {
|
||||
}else if(element.value == 'select'){
|
||||
element.disabled = false
|
||||
}
|
||||
}else {
|
||||
return console.log('不为0,也不为1');
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -113,7 +113,7 @@ export default {
|
||||
cancelButtonText: this.$t('tip.no'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$delete('/cabinet?ids=' + this.editCabinet.id).then(response => {
|
||||
this.$delete('dc/cabinet?ids=' + this.editCabinet.id).then(response => {
|
||||
this.prevent_opt.save = false
|
||||
if (response.code == 200) {
|
||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||
|
||||
@@ -105,7 +105,7 @@ export default {
|
||||
cancelButtonText: this.$t('tip.no'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$delete('/cabinet?ids=' + this.editCabinet.id).then(response => {
|
||||
this.$delete('dc/cabinet?ids=' + this.editCabinet.id).then(response => {
|
||||
this.prevent_opt.save = false
|
||||
if (response.code == 200) {
|
||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||
|
||||
@@ -86,7 +86,7 @@ export default {
|
||||
show: true,
|
||||
width: 80
|
||||
}, {
|
||||
label: this.$t('config.dc.dc'),
|
||||
label: this.$t('config.agent.name'),
|
||||
prop: 'dc',
|
||||
show: true
|
||||
}, {
|
||||
|
||||
@@ -61,12 +61,12 @@
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'assetNum'">
|
||||
<span class="endpoint-num" @click="showBottomBox('asset', scope.row)">
|
||||
<i class="nz-icon nz-icon-overview-project" :class="scope.row[item.prop]>0?'color23BF9A':'color23BF9A'"/>
|
||||
<i class="nz-icon nz-icon-overview-project monitorColor" :class="scope.row[item.prop]>0?'color23BF9A':'color23BF9A'"/>
|
||||
{{scope.row[item.prop]}}
|
||||
</span>
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'alertNum'">
|
||||
<span class="alert-num" @click="showBottomBox('moduleAlertMessage', scope.row)">
|
||||
<span class="alert-num" @click="showBottomBox('alertMessageTab', scope.row)">
|
||||
<i class="nz-icon nz-icon-overview-alert" :class="scope.row[item.prop]>0?'colorEF7458':'color23BF9A'"/>
|
||||
{{scope.row[item.prop]}}
|
||||
</span>
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
<template v-else-if="item.prop === 'cabinetNum'">
|
||||
<span class="alert-num" @click="showBottomBox('cabinet', scope.row)">
|
||||
<i class="nz-icon nz-icon-cabinet" :class="scope.row[item.prop]>0?'color23BF9A':'colorEF7458'"/>
|
||||
<i class="nz-icon nz-icon-cabinet monitorColor" :class="scope.row[item.prop]>0?'color23BF9A':'colorEF7458'"/>
|
||||
{{scope.row[item.prop]}}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
@@ -128,8 +128,8 @@ export default {
|
||||
name: '',
|
||||
metaKey: '',
|
||||
groupId: '',
|
||||
search: 1,
|
||||
display: 1,
|
||||
search: '0',
|
||||
display: '0',
|
||||
type: 'text',
|
||||
param: {},
|
||||
remark: ''
|
||||
|
||||
Reference in New Issue
Block a user