|
|
@@ -24,6 +24,15 @@
|
|
|
@click="handleRemoveAll"
|
|
|
>解绑所有设备</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ plain
|
|
|
+ icon="el-icon-remove"
|
|
|
+ @click="handleRemoveSelect"
|
|
|
+ >解绑选择的设备</el-button
|
|
|
+ >
|
|
|
+
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
@@ -286,6 +295,52 @@ export default {
|
|
|
// self.$message.error(error + "");
|
|
|
});
|
|
|
},
|
|
|
+ handleRemoveSelect() {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ var deviceIdList = this.multipleSelection.map((record) => {
|
|
|
+ return record.deviceId;
|
|
|
+ });
|
|
|
+
|
|
|
+ alert(deviceIdList);
|
|
|
+
|
|
|
+ this.$confirm("是否解除关联?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ self.loading = true;
|
|
|
+ var formData = new FormData();
|
|
|
+ formData.append("personId", self.personId);
|
|
|
+ formData.append("deviceIds", deviceIdList);
|
|
|
+
|
|
|
+ personDeviceRelationApi
|
|
|
+ .unbindSelectDevice(formData)
|
|
|
+ .then(function (response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+ self.loading = false;
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
+
|
|
|
+ self.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "解绑成功!",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ self.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: jsonData.message,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ self.loading = false;
|
|
|
+ // self.$message.error(error + "");
|
|
|
+ });
|
|
|
+ },
|
|
|
handleRemoveAll() {
|
|
|
var self = this;
|
|
|
|