Commit 2788c53e authored by co_dengxiongwen's avatar co_dengxiongwen

控制

parent 15eaa0f7
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
:currentMode="currentModel" :currentMode="currentModel"
> >
<template v-slot:operation="scope"> <template v-slot:operation="scope">
<el-button type="text" @click="statusHandle">开启</el-button> <el-button type="text" @click="statusHandle(scope.scope,1)">开启</el-button>
<el-button type="text" @click="statusHandle">关闭</el-button> <el-button type="text" @click="statusHandle(scope.scope,2)">关闭</el-button>
</template> </template>
</table-list> </table-list>
<!-- <en-table <!-- <en-table
...@@ -286,7 +286,26 @@ export default { ...@@ -286,7 +286,26 @@ export default {
} }
} }
}, },
statusHandle() {} statusHandle(row,status) {
console.log('row:', row)
this.$http({
url: this.$http.adornUrl('/equipment/onOrOff'),
method: 'post',
data: {
id: row.id,
status: status,
actionName: row.name + status==1?'开启':'关闭',
actionType: 1
}
}).then((data) => {
if (data && data.code === 0) {
this.$message.success(data.msg)
}else{
this.$message.error(data.msg)
}
})
}
} }
} }
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment