fix:修改idc状态为 switch按钮

This commit is contained in:
zhangyu
2020-11-11 14:30:34 +08:00
parent 29e617b4a9
commit b1c9f9f201
5 changed files with 40 additions and 20 deletions

View File

@@ -79,8 +79,13 @@
<template v-else>-</template>
</template>
<template v-else-if="item.prop == 'state'">
<template v-if="scope.row.state">{{$CONSTANTS.setting.DcState.find(val=>val.value===scope.row.state).label}}</template>
<template v-else>-</template>
<el-switch
v-model="scope.row.state"
active-value="ON"
inactive-value="OFF"
active-color="#ee9d3f"
@change="(val)=>{statusChange(scope.row)}"
/>
</template>
<template v-else-if="item.prop == 'longitude'">
<template v-if="regNumTest(scope.row.longitude)">{{scope.row.longitude}}</template>
@@ -210,10 +215,6 @@
label: this.$t("overall.name"),
prop: 'name',
show: true,
}, {
label: this.$t('config.dc.state'),
prop: 'state',
show: true
}, {
label: this.$t('config.dc.longitude'),
prop: 'longitude',
@@ -242,6 +243,10 @@
label: this.$t('asset.principal'),
prop: 'principal',
show: true
}, {
label: this.$t('config.dc.state'),
prop: 'state',
show: true
}, {
label: this.$t('config.account.option'),
prop: 'option',
@@ -379,6 +384,17 @@
});
});
},
statusChange(idc) {
this.$put('idc', idc).then(response => {
if (response.code === 200) {
this.rightBox.show = false;
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
} else {
this.$message.error(response.msg);
}
this.getTableData();
});
},
getTableData() {
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);