diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue
index c85a176be..01196ac03 100644
--- a/nezha-fronted/src/components/charts/chart-list.vue
+++ b/nezha-fronted/src/components/charts/chart-list.vue
@@ -1717,12 +1717,17 @@ export default {
resize () {
this.init()
this.$nextTick(() => {
- this.$parent.$parent.dateChange()
+ if (this.$parent && this.$parent.$parent) {
+ this.$parent.$parent.dateChange()
+ }
})
},
init () {
- this.stepWidth = this.chartResizeTool.stepWidth(document.getElementById('listContainer').offsetWidth - 14)
- this.tempDomInit()
+ const dom = document.getElementById('listContainer')
+ if (dom) {
+ this.stepWidth = this.chartResizeTool.stepWidth(dom.offsetWidth - 14)
+ this.tempDomInit()
+ }
},
chartBySync (item) {
this.$post('visual/panel/chart/syncTmpl', { ids: [item.id] }).then(res => {
diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue
index 4a144317f..fb316c1db 100644
--- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue
+++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue
@@ -333,12 +333,14 @@ export default {
// 选择日期变化
dateChange (val) {
// this.searchTime = [...val];
- const nowTimeType = this.$refs.pickTime.$refs.timePicker.nowTimeType
- this.setSearchTime(nowTimeType.type, nowTimeType.value)
- this.filter.start_time = bus.timeFormate(this.searchTime[0], 'yyyy-MM-dd hh:mm:ss')
- this.filter.end_time = bus.timeFormate(this.searchTime[1], 'yyyy-MM-dd hh:mm:ss')
- this.filter.panelId = this.showPanel.id
- this.getData(this.filter)
+ if (this.$refs.pickTime) {
+ const nowTimeType = this.$refs.pickTime.$refs.timePicker.nowTimeType
+ this.setSearchTime(nowTimeType.type, nowTimeType.value)
+ this.filter.start_time = bus.timeFormate(this.searchTime[0], 'yyyy-MM-dd hh:mm:ss')
+ this.filter.end_time = bus.timeFormate(this.searchTime[1], 'yyyy-MM-dd hh:mm:ss')
+ this.filter.panelId = this.showPanel.id
+ this.getData(this.filter)
+ }
},
/* 时间条件查询--end */
setSearchTime (type, val) { // 设置searchTime
diff --git a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue
index 5b4c80ad0..3e8f16d61 100644
--- a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue
@@ -317,40 +317,25 @@ export default {
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
},
- /* modelCascProp: {
- lazy: true,
- value: 'id',
- label: 'name',
- lazyLoad (node, resolve) {
- const { level } = node
- vm.$get('asset/model', { brandIds: node.data.id }).then(response => {
- if (response.code === 200) {
- const models = response.data.list.map(item => ({
- ...item,
- leaf: level >= 1
- }))
- resolve(models)
- }
- })
- }
- }, */
labelCascProp: {
lazy: true,
value: 'id',
label: 'name',
lazyLoad (node, resolve) {
const { level } = node
- vm.$get('asset/field/meta', { groupIds: node.data.id }).then(response => {
- if (response.code === 200) {
- const meta = response.data.list.map(item => ({
- ...item,
- leaf: level >= 1,
- disabled: vm.editAsset.fields.some(a => a.id === item.id)
- }))
- vm.options.metaOptions = meta
- resolve(meta)
- }
- })
+ if (node && node.data) {
+ vm.$get('asset/field/meta', { groupIds: node.data.id }).then(response => {
+ if (response.code === 200) {
+ const meta = response.data.list.map(item => ({
+ ...item,
+ leaf: level >= 1,
+ disabled: vm.editAsset.fields.some(a => a.id === item.id)
+ }))
+ vm.options.metaOptions = meta
+ resolve(meta)
+ }
+ })
+ }
}
}
}
@@ -463,9 +448,13 @@ export default {
this.esc(false)
},
setLocationData ({ cabinet, dc, u }) {
+ if (cabinet) {
+ this.editAsset.cabinetId = cabinet.id
+ }
if (dc) {
this.editAsset.dcId = dc.id
- this.editAsset.cabinetId = cabinet.id
+ }
+ if (u) {
this.editAsset.cabinetStart = u[0]
this.editAsset.cabinetEnd = u[1]
}
diff --git a/nezha-fronted/src/components/common/rightBox/assetBox.vue b/nezha-fronted/src/components/common/rightBox/assetBox.vue
deleted file mode 100644
index 7b5f4a871..000000000
--- a/nezha-fronted/src/components/common/rightBox/assetBox.vue
+++ /dev/null
@@ -1,725 +0,0 @@
-
-
-
-