NEZ-610 fix: 修复dc、cabinet相关bug

This commit is contained in:
@changcode
2021-05-11 19:06:46 +08:00
parent 70da98a2aa
commit ce123e31f9
4 changed files with 7 additions and 19 deletions

View File

@@ -26,7 +26,7 @@
></cabinet-table> ></cabinet-table>
</template> </template>
<template v-slot:top-tool-right> <template v-slot:top-tool-right>
<button id="asset-create-asset" v-has="'panel_chart_add'" class="top-tool-btn margin-r-10" @click.stop="addChart"> <button id="asset-create-asset" v-has="'dc_add'" class="top-tool-btn margin-r-10" @click.stop="add">
<i class="nz-icon nz-icon-create-square"></i> <i class="nz-icon nz-icon-create-square"></i>
</button> </button>
</template> </template>
@@ -56,13 +56,11 @@ export default {
'delete-button': deleteButton, 'delete-button': deleteButton,
cabinetTable cabinetTable
}, },
props: {
obj: Object // 关联的实体对象
},
data () { data () {
return { return {
url: 'dc/cabinet', url: 'dc/cabinet',
tableId: 'cabinetTable', tableId: 'cabinetTable',
blankObject: { blankObject: {
id: '', id: '',
idcId: '', idcId: '',
@@ -104,15 +102,6 @@ export default {
// 切换tab // 切换tab
changeTab (tab) { changeTab (tab) {
this.$emit('changeTab', tab) this.$emit('changeTab', tab)
},
addChart () {
this.rightBox.show = true
},
closeRightBox (refresh) {
this.rightBox.show = false
if (refresh) {
this.refresh()
}
} }
}, },
watch: { watch: {

View File

@@ -22,8 +22,7 @@
</el-form-item> </el-form-item>
<el-form-item :label='$t("asset.principal")' prop="principal"> <el-form-item :label='$t("asset.principal")' prop="principal">
<el-select value-key="id" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" v-model="editDc.principal" placeholder="" size="small" id="dc-box-input-principal"> <el-select value-key="id" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" v-model="editDc.principal" placeholder="" size="small" id="dc-box-input-principal">
<el-option v-for="item in userData" :id="'dc-principal-op-'+item.userId" :key="item.userId" :label="item.username" :value="item.userId"> <el-option v-for="item in userData" :key="item.id" :label="item.name" :value="item.id">
<span>{{item.username}}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -91,7 +90,7 @@ export default {
} }
}, },
created() { created() {
console.log(this.props)
}, },
methods: { methods: {
/* 关闭弹框 */ /* 关闭弹框 */
@@ -209,7 +208,6 @@ export default {
deep: true, deep: true,
handler (n, o) { handler (n, o) {
this.editDc = JSON.parse(JSON.stringify(n)) this.editDc = JSON.parse(JSON.stringify(n))
console.info(this.editDc)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.latlngPicker.setLnglat(this.editDc.latitude, this.editDc.longitude) this.$refs.latlngPicker.setLnglat(this.editDc.latitude, this.editDc.longitude)
}) })

View File

@@ -57,6 +57,7 @@ export default {
} }
}, },
created() { created() {
}, },
methods: { methods: {
clickOutside () { clickOutside () {
@@ -71,7 +72,7 @@ export default {
this.prevent_opt.save = true this.prevent_opt.save = true
this.$refs.cabinetForm.validate(valid => { this.$refs.cabinetForm.validate(valid => {
if (valid) { if (valid) {
this.editCabinet.idcId = this.currentDc.id this.editCabinet.dcId = this.currentDc.id
if (this.editCabinet.id) { if (this.editCabinet.id) {
this.$put('/dc/cabinet', this.editCabinet).then(res => { this.$put('/dc/cabinet', this.editCabinet).then(res => {
this.prevent_opt.save = false this.prevent_opt.save = false
@@ -126,6 +127,7 @@ export default {
deep: true, deep: true,
immediate: true, immediate: true,
handler: function (n, o) { handler: function (n, o) {
console.info(n)
if (n) { if (n) {
this.editCabinet = JSON.parse(JSON.stringify(n)) this.editCabinet = JSON.parse(JSON.stringify(n))
} }

View File

@@ -97,7 +97,6 @@ export default {
} }
}, },
methods: { methods: {
} }
} }
</script> </script>