fix:修改idc状态为 switch按钮
This commit is contained in:
@@ -541,6 +541,8 @@ const cn = {
|
|||||||
featureTitle: "属性",
|
featureTitle: "属性",
|
||||||
endpointUpNum:'代表正常的数量',
|
endpointUpNum:'代表正常的数量',
|
||||||
endpointNum:'代表总的数量',
|
endpointNum:'代表总的数量',
|
||||||
|
active:"Active",
|
||||||
|
Total:"Total",
|
||||||
},
|
},
|
||||||
config: {
|
config: {
|
||||||
config: "设置",
|
config: "设置",
|
||||||
|
|||||||
@@ -542,7 +542,8 @@ const en = {
|
|||||||
endPoint: 'End point',//'EndPoint'
|
endPoint: 'End point',//'EndPoint'
|
||||||
alert: 'Alert',//'告警'
|
alert: 'Alert',//'告警'
|
||||||
},
|
},
|
||||||
|
active:"Active",
|
||||||
|
Total:"Total",
|
||||||
},
|
},
|
||||||
config: {
|
config: {
|
||||||
config: 'Settings',//"设置"
|
config: 'Settings',//"设置"
|
||||||
|
|||||||
@@ -40,13 +40,15 @@
|
|||||||
<!--</select-area>-->
|
<!--</select-area>-->
|
||||||
<!--</el-form-item>-->
|
<!--</el-form-item>-->
|
||||||
<el-form-item :label='$t("config.dc.state")' prop="state">
|
<el-form-item :label='$t("config.dc.state")' prop="state">
|
||||||
<el-select value-key="value" popper-class="config-dropdown" v-model="editDc.state" placeholder="" size="small">
|
<el-switch
|
||||||
<el-option @click.native="" v-for="item in $CONSTANTS.setting.DcState" :key="item.value" :label="item.label" :value="item.value" :id="'dc-principal-op-'+item.value">
|
v-model="editDc.state"
|
||||||
<span>{{item.label}}</span>
|
active-value="ON"
|
||||||
</el-option>
|
inactive-value="OFF"
|
||||||
</el-select>
|
active-color="#ee9d3f"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label='$t("config.dc.longitude")' prop="longitude">
|
<el-form-item :label='$t("config.dc.longitude")' prop="longitude" :rules="[{required:editDc.latitude,trigger:'blur'}]">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
placeholder=""
|
placeholder=""
|
||||||
v-model="editDc.longitude"
|
v-model="editDc.longitude"
|
||||||
@@ -58,7 +60,7 @@
|
|||||||
:precision="5"
|
:precision="5"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label='$t("config.dc.latitude")' prop="latitude">
|
<el-form-item :label='$t("config.dc.latitude")' prop="latitude" :rules="[{required:editDc.longitude,trigger:'blur'}]">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
placeholder=""
|
placeholder=""
|
||||||
v-model="editDc.latitude"
|
v-model="editDc.latitude"
|
||||||
@@ -135,10 +137,10 @@
|
|||||||
param.areaId = param.area.id;
|
param.areaId = param.area.id;
|
||||||
}
|
}
|
||||||
if(!regNum.test(param.longitude)){
|
if(!regNum.test(param.longitude)){
|
||||||
param.longitude=''
|
param.longitude=null
|
||||||
}
|
}
|
||||||
if(!regNum.test(param.latitude)){
|
if(!regNum.test(param.latitude)){
|
||||||
param.latitude=''
|
param.latitude=null
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$put('idc', param).then(response => {
|
this.$put('idc', param).then(response => {
|
||||||
@@ -155,10 +157,10 @@
|
|||||||
param.areaId = param.area.id;
|
param.areaId = param.area.id;
|
||||||
}
|
}
|
||||||
if(!regNum.test(param.longitude)){
|
if(!regNum.test(param.longitude)){
|
||||||
param.longitude=''
|
param.longitude=null;
|
||||||
}
|
}
|
||||||
if(!regNum.test(param.latitude)){
|
if(!regNum.test(param.latitude)){
|
||||||
param.latitude=''
|
param.latitude=null;
|
||||||
}
|
}
|
||||||
this.$post('idc', param).then(response => {
|
this.$post('idc', param).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
|||||||
@@ -103,8 +103,7 @@
|
|||||||
<template v-if="item.prop=='Module'">
|
<template v-if="item.prop=='Module'">
|
||||||
<el-tooltip placement="right" effect="light">
|
<el-tooltip placement="right" effect="light">
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
{{scope.row.endpointNum-scope.row.endpointDownNum}} {{$t('asset.endpointUpNum')}}<br/>
|
{{$t('asset.active')}} / {{$t('asset.total')}}
|
||||||
{{scope.row.endpointNum}} {{$t('asset.endpointNum')}}
|
|
||||||
</div>
|
</div>
|
||||||
<span class="link" @click="showEndpoint(scope.row)" style="padding: 2px 8px">{{scope.row.endpointNum-scope.row.endpointDownNum}}/{{scope.row.endpointNum}}</span>
|
<span class="link" @click="showEndpoint(scope.row)" style="padding: 2px 8px">{{scope.row.endpointNum-scope.row.endpointDownNum}}/{{scope.row.endpointNum}}</span>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|||||||
@@ -79,8 +79,13 @@
|
|||||||
<template v-else>-</template>
|
<template v-else>-</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop == 'state'">
|
<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>
|
<el-switch
|
||||||
<template v-else>-</template>
|
v-model="scope.row.state"
|
||||||
|
active-value="ON"
|
||||||
|
inactive-value="OFF"
|
||||||
|
active-color="#ee9d3f"
|
||||||
|
@change="(val)=>{statusChange(scope.row)}"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop == 'longitude'">
|
<template v-else-if="item.prop == 'longitude'">
|
||||||
<template v-if="regNumTest(scope.row.longitude)">{{scope.row.longitude}}</template>
|
<template v-if="regNumTest(scope.row.longitude)">{{scope.row.longitude}}</template>
|
||||||
@@ -210,10 +215,6 @@
|
|||||||
label: this.$t("overall.name"),
|
label: this.$t("overall.name"),
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
show: true,
|
show: true,
|
||||||
}, {
|
|
||||||
label: this.$t('config.dc.state'),
|
|
||||||
prop: 'state',
|
|
||||||
show: true
|
|
||||||
}, {
|
}, {
|
||||||
label: this.$t('config.dc.longitude'),
|
label: this.$t('config.dc.longitude'),
|
||||||
prop: 'longitude',
|
prop: 'longitude',
|
||||||
@@ -242,6 +243,10 @@
|
|||||||
label: this.$t('asset.principal'),
|
label: this.$t('asset.principal'),
|
||||||
prop: 'principal',
|
prop: 'principal',
|
||||||
show: true
|
show: true
|
||||||
|
}, {
|
||||||
|
label: this.$t('config.dc.state'),
|
||||||
|
prop: 'state',
|
||||||
|
show: true
|
||||||
}, {
|
}, {
|
||||||
label: this.$t('config.account.option'),
|
label: this.$t('config.account.option'),
|
||||||
prop: '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() {
|
getTableData() {
|
||||||
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
|
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
|
||||||
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
|
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user