NEZ-2336 fix:Rcord rules复制规则保存时提示name格式错误
This commit is contained in:
@@ -55,7 +55,7 @@
|
|||||||
:multipleTime="multipleTime"
|
:multipleTime="multipleTime"
|
||||||
:isFullscreen="isFullscreen"
|
:isFullscreen="isFullscreen"
|
||||||
:showAllData="showAllData"
|
:showAllData="showAllData"
|
||||||
v-if="!isGroup(chartInfo.type) || !chartInfo.param.collapse"
|
v-if="(!isGroup(chartInfo.type) || !chartInfo.param.collapse) && snapshotShow"
|
||||||
></chart>
|
></chart>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -118,7 +118,8 @@ export default {
|
|||||||
allDataLength: 0,
|
allDataLength: 0,
|
||||||
severityData: this.$store.getters.severityData, // 告警级别的数据
|
severityData: this.$store.getters.severityData, // 告警级别的数据
|
||||||
severityDataWeight: this.$store.getters.severityDataWeight,
|
severityDataWeight: this.$store.getters.severityDataWeight,
|
||||||
myVariables: [] // 添加当前使用的变量 用于判断是否需要重新加载
|
myVariables: [], // 添加当前使用的变量 用于判断是否需要重新加载
|
||||||
|
snapshotShow: true
|
||||||
// isExportData: false
|
// isExportData: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -159,7 +160,7 @@ export default {
|
|||||||
if (!this.variablesInit) { // 变量未加载完成 不请求数据
|
if (!this.variablesInit) { // 变量未加载完成 不请求数据
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.chartData = []
|
this.chartData = window.dataJson ? this.chartData : []
|
||||||
this.myVariables = []
|
this.myVariables = []
|
||||||
this.loading = true
|
this.loading = true
|
||||||
// TODO assetInfo、endpointInfo、echarts等进行不同的处理
|
// TODO assetInfo、endpointInfo、echarts等进行不同的处理
|
||||||
@@ -758,6 +759,9 @@ export default {
|
|||||||
deep: true,
|
deep: true,
|
||||||
handler (n) {
|
handler (n) {
|
||||||
// console.log(n)
|
// console.log(n)
|
||||||
|
if (window.dataJson && this.loading) {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
variablesArr: {
|
variablesArr: {
|
||||||
@@ -778,8 +782,17 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
if (window.dataJson) {
|
||||||
|
this.snapshotShow = false
|
||||||
|
this.getChartData()
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.chartInfo.loaded && this.getChartData()
|
this.chartInfo.loaded && this.getChartData()
|
||||||
|
setTimeout(() => {
|
||||||
|
this.snapshotShow = true
|
||||||
|
})
|
||||||
this.showAllData = !this.showMultiple(this.chartInfo.type)
|
this.showAllData = !this.showMultiple(this.chartInfo.type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,8 +232,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
copy (u) {
|
copy (u, copyParams) {
|
||||||
this.object = { ...u, name: u.name + '-copy', id: '' }
|
const copyName = this.$loadsh.get(copyParams, 'copyName', '-copy')
|
||||||
|
this.object = { ...u, name: u.name + copyName, id: '' }
|
||||||
if (this.object.name.length > 64) {
|
if (this.object.name.length > 64) {
|
||||||
const length = this.object.name.length - 64
|
const length = this.object.name.length - 64
|
||||||
this.object.name = u.name.substring(0, u.name.length - length) + '-copy'
|
this.object.name = u.name.substring(0, u.name.length - length) + '-copy'
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ export default {
|
|||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' },
|
{ required: true, message: this.$t('validate.required'), trigger: 'change' },
|
||||||
{ pattern: /[a-zA-Z_:][a-zA-Z0-9_:]*/, message: this.$t('overall.ASCIIKey'), trigger: 'change' }
|
{ pattern: /^[a-zA-Z_:][a-zA-Z0-9_:]*$/, message: this.$t('overall.ASCIIKey'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
type: [
|
type: [
|
||||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown" class="right-box-select-top right-public-box-dropdown-top">
|
<el-dropdown-menu slot="dropdown" class="right-box-select-top right-public-box-dropdown-top">
|
||||||
<el-dropdown-item v-if="!scope.row.buildIn" v-has="'record_rule_edit'" :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 v-if="!scope.row.buildIn" v-has="'record_rule_edit'" :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 v-if="!scope.row.buildIn" v-has="'record_rule_edit'" :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
<el-dropdown-item v-if="!scope.row.buildIn" v-has="'record_rule_edit'" :command="['copy', scope.row, {copyName: '_copy'}]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||||
<!-- <el-dropdown-item v-if="!scope.row.buildIn" v-has="'record_rule_delete'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item> -->
|
<!-- <el-dropdown-item v-if="!scope.row.buildIn" v-has="'record_rule_delete'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item> -->
|
||||||
<el-dropdown-item v-if="!scope.row.buildIn" v-has="'record_rule_delete'" :command="['delete', scope.row]">
|
<el-dropdown-item v-if="!scope.row.buildIn" v-has="'record_rule_delete'" :command="['delete', scope.row]">
|
||||||
<delete-button
|
<delete-button
|
||||||
|
|||||||
Reference in New Issue
Block a user