diff --git a/src/api/access.js b/src/api/access.js index 156c1c4..a5b5342 100644 --- a/src/api/access.js +++ b/src/api/access.js @@ -43,12 +43,15 @@ } // 取消授权 -export function delPermission(permissionId) { +export function delPermission(ids) { return request({ url: 'acsPermission/delete', method: 'post', params: { - permissionId + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) } }) } diff --git a/src/api/access.js b/src/api/access.js index 156c1c4..a5b5342 100644 --- a/src/api/access.js +++ b/src/api/access.js @@ -43,12 +43,15 @@ } // 取消授权 -export function delPermission(permissionId) { +export function delPermission(ids) { return request({ url: 'acsPermission/delete', method: 'post', params: { - permissionId + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) } }) } diff --git a/src/api/person.js b/src/api/person.js index 4143c81..24460ea 100644 --- a/src/api/person.js +++ b/src/api/person.js @@ -139,3 +139,18 @@ data: formData }) } + +// 人员数据下发 +export function updatePersonData(personIds, deviceIds) { + return request({ + url: 'person/updateData', + method: 'post', + params: { + personIds: personIds, + deviceIds: deviceIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/access.js b/src/api/access.js index 156c1c4..a5b5342 100644 --- a/src/api/access.js +++ b/src/api/access.js @@ -43,12 +43,15 @@ } // 取消授权 -export function delPermission(permissionId) { +export function delPermission(ids) { return request({ url: 'acsPermission/delete', method: 'post', params: { - permissionId + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) } }) } diff --git a/src/api/person.js b/src/api/person.js index 4143c81..24460ea 100644 --- a/src/api/person.js +++ b/src/api/person.js @@ -139,3 +139,18 @@ data: formData }) } + +// 人员数据下发 +export function updatePersonData(personIds, deviceIds) { + return request({ + url: 'person/updateData', + method: 'post', + params: { + personIds: personIds, + deviceIds: deviceIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/views/accessPermission/listStaffPermission.vue b/src/views/accessPermission/listStaffPermission.vue index a168bb9..207ea77 100644 --- a/src/views/accessPermission/listStaffPermission.vue +++ b/src/views/accessPermission/listStaffPermission.vue @@ -22,9 +22,11 @@ 导出授权记录 新增员工授权 + 取消员工授权 - + + - - - + + + + +
@@ -128,7 +130,8 @@ } ], // 显示列 list: [], // 列表数据 - listLoading: true // 加载动画 + listLoading: true, // 加载动画 + multipleSelection: [] // 多选选中项 } }, mounted() { @@ -147,23 +150,36 @@ }, methods: { // 取消授权 - cancelPermission(row) { - this.$confirm( - '确认取消该员工的门禁授权吗?', - '确认操作', - { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - } - ).then(() => { - delPermission(row.permissionId).then(response => { - if (response.code === 200) { - this.$message.success('取消授权成功') - this.fetchData() - } + cancelPermission() { + if (this.checkSelection()) { + const permissionIds = [] + this.multipleSelection.forEach(function(value, index) { + permissionIds.push(value.permissionId) }) - }) + this.$confirm( + '确认取消该员工的门禁授权吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + } + ).then(() => { + this.listLoading = true + delPermission(permissionIds).then(response => { + if (response.code === 200) { + this.$message.success('取消授权成功') + this.fetchData() + this.listLoading = false + } + }).catch(res => { + this.fetchData() + this.listLoading = false + }) + }) + } else { + this.$message.error('至少选中一项') + } }, // 新增授权 addPermission() { @@ -218,6 +234,18 @@ this.listQuery.offset = val this.fetchData() }, + // 多选触发方法 + handleSelectionChange(val) { + this.multipleSelection = val + }, + // 检查选择情况 + checkSelection() { + if (this.multipleSelection.length === 0) { + return false + } else { + return true + } + }, // 身份证号加密 encrypIdCardNo(idCardNo) { if (idCardNo) { diff --git a/src/api/access.js b/src/api/access.js index 156c1c4..a5b5342 100644 --- a/src/api/access.js +++ b/src/api/access.js @@ -43,12 +43,15 @@ } // 取消授权 -export function delPermission(permissionId) { +export function delPermission(ids) { return request({ url: 'acsPermission/delete', method: 'post', params: { - permissionId + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) } }) } diff --git a/src/api/person.js b/src/api/person.js index 4143c81..24460ea 100644 --- a/src/api/person.js +++ b/src/api/person.js @@ -139,3 +139,18 @@ data: formData }) } + +// 人员数据下发 +export function updatePersonData(personIds, deviceIds) { + return request({ + url: 'person/updateData', + method: 'post', + params: { + personIds: personIds, + deviceIds: deviceIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/views/accessPermission/listStaffPermission.vue b/src/views/accessPermission/listStaffPermission.vue index a168bb9..207ea77 100644 --- a/src/views/accessPermission/listStaffPermission.vue +++ b/src/views/accessPermission/listStaffPermission.vue @@ -22,9 +22,11 @@ 导出授权记录 新增员工授权 + 取消员工授权 - + + - - - + + + + +
@@ -128,7 +130,8 @@ } ], // 显示列 list: [], // 列表数据 - listLoading: true // 加载动画 + listLoading: true, // 加载动画 + multipleSelection: [] // 多选选中项 } }, mounted() { @@ -147,23 +150,36 @@ }, methods: { // 取消授权 - cancelPermission(row) { - this.$confirm( - '确认取消该员工的门禁授权吗?', - '确认操作', - { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - } - ).then(() => { - delPermission(row.permissionId).then(response => { - if (response.code === 200) { - this.$message.success('取消授权成功') - this.fetchData() - } + cancelPermission() { + if (this.checkSelection()) { + const permissionIds = [] + this.multipleSelection.forEach(function(value, index) { + permissionIds.push(value.permissionId) }) - }) + this.$confirm( + '确认取消该员工的门禁授权吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + } + ).then(() => { + this.listLoading = true + delPermission(permissionIds).then(response => { + if (response.code === 200) { + this.$message.success('取消授权成功') + this.fetchData() + this.listLoading = false + } + }).catch(res => { + this.fetchData() + this.listLoading = false + }) + }) + } else { + this.$message.error('至少选中一项') + } }, // 新增授权 addPermission() { @@ -218,6 +234,18 @@ this.listQuery.offset = val this.fetchData() }, + // 多选触发方法 + handleSelectionChange(val) { + this.multipleSelection = val + }, + // 检查选择情况 + checkSelection() { + if (this.multipleSelection.length === 0) { + return false + } else { + return true + } + }, // 身份证号加密 encrypIdCardNo(idCardNo) { if (idCardNo) { diff --git a/src/views/accessPermission/listVisitorPermission.vue b/src/views/accessPermission/listVisitorPermission.vue index 1ce508c..06b623f 100644 --- a/src/views/accessPermission/listVisitorPermission.vue +++ b/src/views/accessPermission/listVisitorPermission.vue @@ -19,9 +19,11 @@ 导出授权记录 新增访客授权 + 取消访客授权 - + + - - - + + + + +
@@ -119,7 +121,8 @@ } ], // 显示列 list: [], // 列表数据 - listLoading: true // 加载动画 + listLoading: true, // 加载动画 + multipleSelection: [] // 多选选中项 } }, mounted() { @@ -138,23 +141,31 @@ }, methods: { // 取消授权 - cancelPermission(row) { - this.$confirm( - '确认取消该访客的门禁授权吗?', - '确认操作', - { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - } - ).then(() => { - delPermission(row.permissionId).then(response => { - if (response.code === 200) { - this.$message.success('取消授权成功') - this.fetchData() - } + cancelPermission() { + if (this.checkSelection()) { + const permissionIds = [] + this.multipleSelection.forEach(function(value, index) { + permissionIds.push(value.id) }) - }) + this.$confirm( + '确认取消该访客的门禁授权吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + } + ).then(() => { + delPermission(permissionIds).then(response => { + if (response.code === 200) { + this.$message.success('取消授权成功') + this.fetchData() + } + }) + }) + } else { + this.$message.error('至少选中一项') + } }, // 新增授权 addPermission() { @@ -208,6 +219,18 @@ this.listQuery.offset = val this.fetchData() }, + // 多选触发方法 + handleSelectionChange(val) { + this.multipleSelection = val + }, + // 检查选择情况 + checkSelection() { + if (this.multipleSelection.length === 0) { + return false + } else { + return true + } + }, // 身份证号加密 encrypIdCardNo(idCardNo) { if (idCardNo) { diff --git a/src/api/access.js b/src/api/access.js index 156c1c4..a5b5342 100644 --- a/src/api/access.js +++ b/src/api/access.js @@ -43,12 +43,15 @@ } // 取消授权 -export function delPermission(permissionId) { +export function delPermission(ids) { return request({ url: 'acsPermission/delete', method: 'post', params: { - permissionId + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) } }) } diff --git a/src/api/person.js b/src/api/person.js index 4143c81..24460ea 100644 --- a/src/api/person.js +++ b/src/api/person.js @@ -139,3 +139,18 @@ data: formData }) } + +// 人员数据下发 +export function updatePersonData(personIds, deviceIds) { + return request({ + url: 'person/updateData', + method: 'post', + params: { + personIds: personIds, + deviceIds: deviceIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/views/accessPermission/listStaffPermission.vue b/src/views/accessPermission/listStaffPermission.vue index a168bb9..207ea77 100644 --- a/src/views/accessPermission/listStaffPermission.vue +++ b/src/views/accessPermission/listStaffPermission.vue @@ -22,9 +22,11 @@ 导出授权记录 新增员工授权 + 取消员工授权 - + + - - - + + + + +
@@ -128,7 +130,8 @@ } ], // 显示列 list: [], // 列表数据 - listLoading: true // 加载动画 + listLoading: true, // 加载动画 + multipleSelection: [] // 多选选中项 } }, mounted() { @@ -147,23 +150,36 @@ }, methods: { // 取消授权 - cancelPermission(row) { - this.$confirm( - '确认取消该员工的门禁授权吗?', - '确认操作', - { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - } - ).then(() => { - delPermission(row.permissionId).then(response => { - if (response.code === 200) { - this.$message.success('取消授权成功') - this.fetchData() - } + cancelPermission() { + if (this.checkSelection()) { + const permissionIds = [] + this.multipleSelection.forEach(function(value, index) { + permissionIds.push(value.permissionId) }) - }) + this.$confirm( + '确认取消该员工的门禁授权吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + } + ).then(() => { + this.listLoading = true + delPermission(permissionIds).then(response => { + if (response.code === 200) { + this.$message.success('取消授权成功') + this.fetchData() + this.listLoading = false + } + }).catch(res => { + this.fetchData() + this.listLoading = false + }) + }) + } else { + this.$message.error('至少选中一项') + } }, // 新增授权 addPermission() { @@ -218,6 +234,18 @@ this.listQuery.offset = val this.fetchData() }, + // 多选触发方法 + handleSelectionChange(val) { + this.multipleSelection = val + }, + // 检查选择情况 + checkSelection() { + if (this.multipleSelection.length === 0) { + return false + } else { + return true + } + }, // 身份证号加密 encrypIdCardNo(idCardNo) { if (idCardNo) { diff --git a/src/views/accessPermission/listVisitorPermission.vue b/src/views/accessPermission/listVisitorPermission.vue index 1ce508c..06b623f 100644 --- a/src/views/accessPermission/listVisitorPermission.vue +++ b/src/views/accessPermission/listVisitorPermission.vue @@ -19,9 +19,11 @@ 导出授权记录 新增访客授权 + 取消访客授权 - + + - - - + + + + +
@@ -119,7 +121,8 @@ } ], // 显示列 list: [], // 列表数据 - listLoading: true // 加载动画 + listLoading: true, // 加载动画 + multipleSelection: [] // 多选选中项 } }, mounted() { @@ -138,23 +141,31 @@ }, methods: { // 取消授权 - cancelPermission(row) { - this.$confirm( - '确认取消该访客的门禁授权吗?', - '确认操作', - { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - } - ).then(() => { - delPermission(row.permissionId).then(response => { - if (response.code === 200) { - this.$message.success('取消授权成功') - this.fetchData() - } + cancelPermission() { + if (this.checkSelection()) { + const permissionIds = [] + this.multipleSelection.forEach(function(value, index) { + permissionIds.push(value.id) }) - }) + this.$confirm( + '确认取消该访客的门禁授权吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + } + ).then(() => { + delPermission(permissionIds).then(response => { + if (response.code === 200) { + this.$message.success('取消授权成功') + this.fetchData() + } + }) + }) + } else { + this.$message.error('至少选中一项') + } }, // 新增授权 addPermission() { @@ -208,6 +219,18 @@ this.listQuery.offset = val this.fetchData() }, + // 多选触发方法 + handleSelectionChange(val) { + this.multipleSelection = val + }, + // 检查选择情况 + checkSelection() { + if (this.multipleSelection.length === 0) { + return false + } else { + return true + } + }, // 身份证号加密 encrypIdCardNo(idCardNo) { if (idCardNo) { diff --git a/src/views/deviceManage/listDevice.vue b/src/views/deviceManage/listDevice.vue index 91dc78d..42d75ea 100644 --- a/src/views/deviceManage/listDevice.vue +++ b/src/views/deviceManage/listDevice.vue @@ -6,7 +6,7 @@
设备列表
同步识别记录 - 设备数据下发 + 设备数据初始化 删除 新增 diff --git a/src/api/access.js b/src/api/access.js index 156c1c4..a5b5342 100644 --- a/src/api/access.js +++ b/src/api/access.js @@ -43,12 +43,15 @@ } // 取消授权 -export function delPermission(permissionId) { +export function delPermission(ids) { return request({ url: 'acsPermission/delete', method: 'post', params: { - permissionId + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) } }) } diff --git a/src/api/person.js b/src/api/person.js index 4143c81..24460ea 100644 --- a/src/api/person.js +++ b/src/api/person.js @@ -139,3 +139,18 @@ data: formData }) } + +// 人员数据下发 +export function updatePersonData(personIds, deviceIds) { + return request({ + url: 'person/updateData', + method: 'post', + params: { + personIds: personIds, + deviceIds: deviceIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/views/accessPermission/listStaffPermission.vue b/src/views/accessPermission/listStaffPermission.vue index a168bb9..207ea77 100644 --- a/src/views/accessPermission/listStaffPermission.vue +++ b/src/views/accessPermission/listStaffPermission.vue @@ -22,9 +22,11 @@ 导出授权记录 新增员工授权 + 取消员工授权 - + + - - - + + + + +
@@ -128,7 +130,8 @@ } ], // 显示列 list: [], // 列表数据 - listLoading: true // 加载动画 + listLoading: true, // 加载动画 + multipleSelection: [] // 多选选中项 } }, mounted() { @@ -147,23 +150,36 @@ }, methods: { // 取消授权 - cancelPermission(row) { - this.$confirm( - '确认取消该员工的门禁授权吗?', - '确认操作', - { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - } - ).then(() => { - delPermission(row.permissionId).then(response => { - if (response.code === 200) { - this.$message.success('取消授权成功') - this.fetchData() - } + cancelPermission() { + if (this.checkSelection()) { + const permissionIds = [] + this.multipleSelection.forEach(function(value, index) { + permissionIds.push(value.permissionId) }) - }) + this.$confirm( + '确认取消该员工的门禁授权吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + } + ).then(() => { + this.listLoading = true + delPermission(permissionIds).then(response => { + if (response.code === 200) { + this.$message.success('取消授权成功') + this.fetchData() + this.listLoading = false + } + }).catch(res => { + this.fetchData() + this.listLoading = false + }) + }) + } else { + this.$message.error('至少选中一项') + } }, // 新增授权 addPermission() { @@ -218,6 +234,18 @@ this.listQuery.offset = val this.fetchData() }, + // 多选触发方法 + handleSelectionChange(val) { + this.multipleSelection = val + }, + // 检查选择情况 + checkSelection() { + if (this.multipleSelection.length === 0) { + return false + } else { + return true + } + }, // 身份证号加密 encrypIdCardNo(idCardNo) { if (idCardNo) { diff --git a/src/views/accessPermission/listVisitorPermission.vue b/src/views/accessPermission/listVisitorPermission.vue index 1ce508c..06b623f 100644 --- a/src/views/accessPermission/listVisitorPermission.vue +++ b/src/views/accessPermission/listVisitorPermission.vue @@ -19,9 +19,11 @@ 导出授权记录 新增访客授权 + 取消访客授权 - + + - - - + + + + +
@@ -119,7 +121,8 @@ } ], // 显示列 list: [], // 列表数据 - listLoading: true // 加载动画 + listLoading: true, // 加载动画 + multipleSelection: [] // 多选选中项 } }, mounted() { @@ -138,23 +141,31 @@ }, methods: { // 取消授权 - cancelPermission(row) { - this.$confirm( - '确认取消该访客的门禁授权吗?', - '确认操作', - { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - } - ).then(() => { - delPermission(row.permissionId).then(response => { - if (response.code === 200) { - this.$message.success('取消授权成功') - this.fetchData() - } + cancelPermission() { + if (this.checkSelection()) { + const permissionIds = [] + this.multipleSelection.forEach(function(value, index) { + permissionIds.push(value.id) }) - }) + this.$confirm( + '确认取消该访客的门禁授权吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + } + ).then(() => { + delPermission(permissionIds).then(response => { + if (response.code === 200) { + this.$message.success('取消授权成功') + this.fetchData() + } + }) + }) + } else { + this.$message.error('至少选中一项') + } }, // 新增授权 addPermission() { @@ -208,6 +219,18 @@ this.listQuery.offset = val this.fetchData() }, + // 多选触发方法 + handleSelectionChange(val) { + this.multipleSelection = val + }, + // 检查选择情况 + checkSelection() { + if (this.multipleSelection.length === 0) { + return false + } else { + return true + } + }, // 身份证号加密 encrypIdCardNo(idCardNo) { if (idCardNo) { diff --git a/src/views/deviceManage/listDevice.vue b/src/views/deviceManage/listDevice.vue index 91dc78d..42d75ea 100644 --- a/src/views/deviceManage/listDevice.vue +++ b/src/views/deviceManage/listDevice.vue @@ -6,7 +6,7 @@
设备列表
同步识别记录 - 设备数据下发 + 设备数据初始化 删除 新增 diff --git a/src/views/memberManage/listStaff.vue b/src/views/memberManage/listStaff.vue index 2d1de6c..77818ed 100644 --- a/src/views/memberManage/listStaff.vue +++ b/src/views/memberManage/listStaff.vue @@ -30,7 +30,7 @@
数据列表
- + 初始化剩余年假 导出记录 + 人员数据下发 删除 新增
- + @@ -83,6 +84,7 @@ @current-change="handleCurrentChange"/>
+
+ +