import request from '@/utils/request' import constant from '@/constant' function pageList(formData) { return request.post(constant.serverUrl + "/base/deviceInfo/pageList", formData); } function create() { return request.get(constant.serverUrl + "/base/deviceInfo/create"); } function edit(id) { return request.get(constant.serverUrl + "/base/deviceInfo/edit/" + id); } function add(formModel) { return request.post(constant.serverUrl + "/base/deviceInfo/add", formModel, { headers: { "Content-Type": "application/json" } }); } function update(formModel) { return request.post(constant.serverUrl + "/base/deviceInfo/update", formModel, { headers: { "Content-Type": "application/json" } }); } function remove(id) { return request.post(constant.serverUrl + "/base/deviceInfo/delete/" + id); } function batchRemove(idList) { return request.post(constant.serverUrl + "/base/deviceInfo/batchDelete", idList, { headers: { "Content-Type": "application/json" } }); } function getByIpAddressAndPort(formData) { return request.post(constant.serverUrl + "/base/deviceInfo/getByIpAddressAndPort", formData); } function list() { return request.post(constant.serverUrl + "/base/deviceInfo/list"); } function getDeviceRule(formData) { return request.post(constant.serverUrl + "/base/deviceInfo/getDeviceRule", formData); } function saveDeviceRule(formData) { return request.post(constant.serverUrl + "/base/deviceInfo/saveDeviceRule", formData); } function query(formData) { return request.post(constant.serverUrl + "/base/deviceInfo/query", formData); } function reboot(formData) { return request.post(constant.serverUrl + "/base/deviceInfo/reboot", formData); } function personLibList(deviceNo) { return request.get(constant.serverUrl + `/devOps/queryPeopleLib?deviceNo=${deviceNo}`); } function personList(formData) { return request.post(constant.serverUrl + "/devOps/queryPeople",formData); } function deletePerson(deviceNo,libId,personId){ var formData = new FormData(); formData.append("deviceNo",deviceNo); formData.append("libId",libId); formData.append("personId",personId); return request.post(constant.serverUrl + "/devOps/deletePeople",formData); } export default { create, edit, add, update, remove, batchRemove, pageList, getByIpAddressAndPort, list, getDeviceRule, saveDeviceRule, query, reboot, personLibList,personList,deletePerson }