NEZ-1908 feat:用户使用引导提示

This commit is contained in:
zhangyu
2022-06-14 16:12:27 +08:00
parent 4af0c7468e
commit 77d883620a
10 changed files with 63 additions and 14 deletions

View File

@@ -96,7 +96,6 @@ export default {
}
const decimals = this.chartInfo.param.decimals || 2
const { minTime, maxTime, minValue, maxValue, copies, unit, dot } = this.getMinMaxFromData(this.chartData, this.chartInfo.unit) //
console.log(maxTime - minTime, maxTime, minTime)
chartOption.xAxis.axisLabel.formatter = this.xAxisLabelFormatter(minTime, maxTime)// 需转为毫秒
chartOption.tooltip.formatter = this.tooltipFormatter(this.chartInfo.param.stack)
chartOption.tooltip.position = this.tooltipPosition

View File

@@ -4,7 +4,8 @@ export default {
isEdit: false,
messageParams: {
route: '',
params: {}
params: {},
emit: ''
},
closeMessage: ''
}
@@ -17,9 +18,10 @@ export default {
}
},
methods: {
messageShow (msg, route, params, showNext = false, nextText = 'setup.next') {
messageShow (msg, route, params, showNext = false, nextText = 'setup.next', emit) {
this.messageParams.route = route
this.messageParams.params = params
this.messageParams.emit = emit
this.closeMessage = this.$message({
duration: showNext ? 5000 : 2000,
dangerouslyUseHTMLString: true,
@@ -35,6 +37,10 @@ export default {
assetAdd.addEventListener('click', this.saveNext)
},
saveNext () {
if (!this.messageParams.route) {
this.$store.dispatch(this.messageParams.emit, this.messageParams.params)
return
}
this.$router.push({
path: this.messageParams.route,
query: this.messageParams.params

View File

@@ -743,7 +743,7 @@ export default {
this.$put(this.url, params).then(res => {
this.prevent_opt.save = false
if (res.code === 200) {
this.messageShow(this.$t('tip.saveSuccess'), '/endpoint', { assetId: res.data.id }, true, 'guide.addEndpoint')
this.messageShow(this.$t('tip.saveSuccess'), '/endpoint', { assetId: res.data.id }, false, 'guide.addEndpoint')
this.esc(true)
} else {
this.$message.error(res.msg)
@@ -753,7 +753,7 @@ export default {
this.$post(this.url, params).then(res => {
this.prevent_opt.save = false
if (res.code === 200) {
this.messageShow(this.$t('tip.saveSuccess'), '/endpoint', { assetId: res.data.id }, false, 'guide.addEndpoint')
this.messageShow(this.$t('tip.saveSuccess'), '/endpoint', { assetId: res.data.id }, true, 'guide.addEndpoint')
this.esc(true)
} else {
this.$message.error(res.msg)

View File

@@ -124,7 +124,7 @@ export default {
this.$put('/dc', param).then(response => {
this.prevent_opt.save = false
if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
this.messageShow(this.$t('tip.saveSuccess'), '', { dcId: response.data.id, cabinetBoxShow: true }, false, 'guide.addCabinet', 'addCabinet')
this.esc(true)
} else {
this.$message.error(response.msg)
@@ -147,7 +147,7 @@ export default {
this.$post('/dc', param).then(response => {
this.prevent_opt.save = false
if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
this.messageShow(this.$t('tip.saveSuccess'), '', { dcId: response.data.id, cabinetBoxShow: true }, true, 'guide.addCabinet', 'addCabinet')
this.esc(true)
} else {
this.$message.error(response.msg)

View File

@@ -934,7 +934,8 @@ export default {
if (this.editModule.id) {
this.$put('monitor/module', params).then(response => {
if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
// this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
this.messageShow(this.$t('tip.saveSuccess'), '/endpoint', { projectId: this.editModule.projectId, moduleId: response.data.id }, false, 'guide.addEndpoint')
this.$store.commit('setReloadFacade')
this.esc(true)
} else {
@@ -945,7 +946,7 @@ export default {
} else {
this.$post('monitor/module', params).then(response => {
if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
this.messageShow(this.$t('tip.saveSuccess'), '/endpoint', { projectId: this.editModule.projectId, moduleId: response.data.id }, true, 'guide.addEndpoint')
this.$store.commit('setReloadFacade')
this.esc(true)
} else {

View File

@@ -71,7 +71,8 @@ export default {
if (this.editProject.id) {
this.$put('monitor/project', this.editProject).then(response => {
if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
// this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
this.messageShow(this.$t('tip.saveSuccess'), '/module', { projectId: response.data.id }, false, 'guide.addModule')
this.$store.commit('projectListChange')
this.$store.commit('setProject', this.project)
this.esc(true)
@@ -83,7 +84,7 @@ export default {
} else {
this.$post('monitor/project', this.editProject).then(response => {
if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
this.messageShow(this.$t('tip.saveSuccess'), '/module', { projectId: response.data.id }, true, 'guide.addModule')
this.$store.commit('projectListChange')
this.esc(true)
} else {

View File

@@ -137,7 +137,7 @@
</template>
</nz-data-list>
<transition name="right-box">
<dc-box v-if="rightBox.show" :obj="object" :user-data="userData" @close="closeRightBox" @reload="getTableData"></dc-box>
<dc-box v-if="rightBox.show" :obj="object" :user-data="userData" @close="closeRightBox" @reload="getTableData" @addcabinet="addCabinet"></dc-box>
</transition>
<transition name="right-box">
<cabinetBox v-if="cabinetBoxShow" :obj="cabinet" :current-dc="{}" @close="closeRightBox" :dcDisabled="false" @reload="getTableData"></cabinetBox>
@@ -232,6 +232,11 @@ export default {
trendKey: 'dcId'
}
},
computed: {
addCabinetBoxShow () {
return this.$store.getters.getAddCabinetBoxParams
}
},
methods: {
getUserData () {
return new Promise(resolve => {
@@ -246,7 +251,11 @@ export default {
regNumTest (val) { // 校验是否是数字
return this.regNum.test(val)
},
addCabinet () {
addCabinet (params) {
console.log('addCabinet')
if (params) {
this.cabinet.idcId = params.dcid
}
this.cabinetBoxShow = true
},
add () {
@@ -261,8 +270,10 @@ export default {
})
},
closeRightBox (refresh) {
console.log('closeRightBox')
this.rightBox.show = false
this.cabinetBoxShow = false
this.$store.dispatch('addCabinet', { dcid: '', cabinetBoxShow: false })
if (refresh) {
this.delFlag = true
this.getTableData()
@@ -290,6 +301,12 @@ export default {
}
}
}
},
addCabinetBoxShow: {
handler (n) {
this.cabinetBoxShow = n.cabinetBoxShow
this.cabinet.idcId = n.dcId
}
}
}
}

View File

@@ -896,6 +896,14 @@ export default {
}
this.rightBox.show = true
}
if (this.$route.query && this.$route.query.moduleId) {
this.object = {
...this.newObject(),
moduleId: Number(this.$route.query.moduleId),
projectId: Number(this.$route.query.projectId)
}
this.rightBox.show = true
}
if (localStorage.getItem('endpointProjectId')) {
this.selectValue.projectIds = [Number(localStorage.getItem('endpointProjectId'))]
// this.$refs.clickSearch.selectValueOut.projectIds = [localStorage.getItem('endpointProjectId')]

View File

@@ -549,6 +549,13 @@ export default {
this.initQueryFromPath(searchKeys)
},
mounted () {
if (this.$route.query && this.$route.query.projectId) {
this.object = {
...this.newObject(),
projectId: Number(this.$route.query.projectId)
}
this.rightBox.show = true
}
},
watch: {
$route: {

View File

@@ -19,7 +19,8 @@ const panel = {
topologyShow: false,
topologyChartInfo: {},
// 查看模式
mode: ''
mode: '',
addCabinetBoxParams: { dcid: '', cabinetBoxShow: false }
},
mutations: {
setShowRightBox (state, flag) {
@@ -54,6 +55,9 @@ const panel = {
state.headerHPadding = h.headerHPadding
state.rowHeight = h.rowHeight
},
setCabinet (state, params) {
state.addCabinetBoxParams = params
},
cleanPanel (state) {
state.showRightBox = false
state.chart = ''
@@ -120,6 +124,9 @@ const panel = {
},
getTopologyChartInfo (state) {
return state.topologyChartInfo
},
getAddCabinetBoxParams (state) {
return state.addCabinetBoxParams
}
},
actions: {
@@ -149,6 +156,9 @@ const panel = {
dispatchPanelLock (store, playload) {
store.commit('setPanelLock', playload.flag)
},
addCabinet (store, playload) {
store.commit('setCabinet', playload)
},
clearPanel (store) {
store.commit('cleanPanel')
},