Merge branch 'dev-3.6' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.7
This commit is contained in:
@@ -13,6 +13,7 @@ export const clickoutside = {
|
||||
const unsavedChange = localStorage.getItem('nz-unsaved-change')
|
||||
try {
|
||||
el.__oldValue__ = JSON.parse(JSON.stringify(binding.value.obj))
|
||||
el.__oldData__ = JSON.parse(JSON.stringify(binding.value.oldData))
|
||||
el.__newValue__ = el.__oldValue__
|
||||
} catch (e) {
|
||||
|
||||
@@ -38,7 +39,8 @@ export const clickoutside = {
|
||||
}
|
||||
if (el.__oldValue__) {
|
||||
// const newValue = JSON.parse(JSON.stringify(binding.value.obj))
|
||||
if (unsavedChange == 'on' && !isEqual(el.__oldValue__, el.__newValue__) && !el.isShow) {
|
||||
const oldData = el.__oldData__ || el.__oldValue__
|
||||
if (unsavedChange == 'on' && !isEqual(oldData, el.__newValue__) && !el.isShow) {
|
||||
el.isShow = true
|
||||
MessageBox.confirm(i18n.t('tip.confirmCancel'), {
|
||||
confirmButtonText: i18n.t('tip.yes'),
|
||||
@@ -79,6 +81,7 @@ export const clickoutside = {
|
||||
}
|
||||
}
|
||||
el.__newValue__ = binding.value.obj
|
||||
el.__oldData__ = binding.value.oldData
|
||||
},
|
||||
unbind (el, binding) {
|
||||
// 解除事件监听
|
||||
|
||||
@@ -11,7 +11,8 @@ export default {
|
||||
closeMessage: null,
|
||||
uuid: getUUID(),
|
||||
isStable: 'instability',
|
||||
stableTime: null
|
||||
stableTime: null,
|
||||
oldData: {}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</el-form-item>
|
||||
<!-- type -->
|
||||
<el-form-item :label='$t("overall.type")' prop="typeId">
|
||||
<el-select :disabled='editModel.id !== ""' value-key="id" allow-create class="right-box__select" popper-class="right-box-select-top prevent-clickoutside" :filterable="true" v-model="editModel.typeId" placeholder="" size="small" id="module-box-input-project">
|
||||
<el-select :disabled='editModel.id !== ""' value-key="id" class="right-box__select" popper-class="right-box-select-top prevent-clickoutside" :filterable="true" v-model="editModel.typeId" placeholder="" size="small" id="module-box-input-project">
|
||||
<el-option v-for="(item, index) in typeDataList" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div v-clickoutside:[isStable]="{obj: editChart, func:clickOutside}" :class="boxClass" class="right-box right-box-chart">
|
||||
<div v-clickoutside:[isStable]="{obj: editChart,oldData: oldData, func:clickOutside}" :class="boxClass" class="right-box right-box-chart">
|
||||
<transition v-if="from !== 'chartTemp'" name="right-box">
|
||||
<!-- <panel-box v-if="!showPanel.type" ref="panelBox2" :panel="panel" @reload="panelReload"></panel-box>-->
|
||||
</transition>
|
||||
@@ -597,6 +597,7 @@ export default {
|
||||
}
|
||||
}
|
||||
this.editChart = obj
|
||||
this.oldData = this.$loadsh.cloneDeep(obj)
|
||||
if (this.stableTime) {
|
||||
clearTimeout(this.stableTime)
|
||||
this.stableTime = null
|
||||
|
||||
@@ -289,7 +289,7 @@ export default {
|
||||
disabled: false
|
||||
}, {
|
||||
name: this.$t('overall.acknowledge'),
|
||||
type: 'selectString',
|
||||
type: 'select',
|
||||
label: 'ack',
|
||||
readonly: true,
|
||||
disabled: false
|
||||
@@ -528,6 +528,25 @@ export default {
|
||||
},
|
||||
jsonKey: 'val'
|
||||
},
|
||||
ack: {
|
||||
target: this.searchLabel,
|
||||
isSearchInput: true,
|
||||
propertyName: 'acknowledge',
|
||||
type: 'string',
|
||||
defaultJson: {
|
||||
id: 4,
|
||||
label: 'ack',
|
||||
name: this.$t('overall.acknowledge'),
|
||||
val: '',
|
||||
valnum: '',
|
||||
valString: '',
|
||||
listStr: 'ack',
|
||||
type: 'select',
|
||||
readonly: true,
|
||||
disabled: false
|
||||
},
|
||||
jsonKey: 'valnum'
|
||||
},
|
||||
dcIds: { target: this.searchCheckBox, propertyName: 'dcIds', type: 'string', target2: this.selectValue, type2: 'array' },
|
||||
moduleIds: { target: this.searchCheckBox, propertyName: 'moduleIds', type: 'string', target2: this.selectValue, type2: 'array' },
|
||||
projectIds: { target: this.searchCheckBox, propertyName: 'projectIds', type: 'string', target2: this.selectValue, type2: 'array' },
|
||||
|
||||
@@ -360,7 +360,7 @@ export default {
|
||||
if (response.code === 200) {
|
||||
this.object = {
|
||||
...response.data,
|
||||
expr: response.data.expression,
|
||||
expr: response.data.expr,
|
||||
method: response.data.method ? response.data.method.split(',').map(item => Number(item)) : [],
|
||||
schedDays: response.data.schedDays ? response.data.schedDays.split(',').map(item => Number(item)) : [],
|
||||
receiverShow: response.data.receiver ? response.data.receiver.split(',').map(item => Number(item)) : []
|
||||
|
||||
Reference in New Issue
Block a user