NEZ-2338 fix:asset 复制保存未校验location必填项

This commit is contained in:
zyh
2022-10-31 17:40:02 +08:00
parent a90a94e095
commit 419a953646
2 changed files with 2 additions and 2 deletions

View File

@@ -871,7 +871,7 @@ export default {
} else if (this.editAsset.cabinetStart && this.editAsset.cabinetEnd) {
callback()
} else {
callback(new Error(vm.$t('validate.required')))
callback(new Error(this.$t('validate.required')))
}
}, 100)
}

View File

@@ -472,7 +472,7 @@ export default {
duplicate (row) {
this.$get(`${this.url}/${row.id}`).then(response => {
if (response.code === 200) {
this.object = { ...response.data, id: '', name: `${row.name}-copy`, brandAndModel: '', cabinet: '', dc: '', u: [], cabinetId: '', dcId: '' }
this.object = { ...response.data, id: '', name: `${row.name}-copy`, brandAndModel: '', cabinet: undefined, dc: undefined, u: [], cabinetId: '', dcId: '', cabinetStart: '', cabinetEnd: '' }
if (this.object.name.length > 64) {
const length = this.object.name.length - 64
this.object.name = row.name.substring(0, row.name.length - length) + '-copy'