10 changed files with 136 additions and 116 deletions
@ -1,105 +1,105 @@ |
|||
"use strict"; |
|||
|
|||
import { basicAction } from "@peace/utils"; |
|||
import { ApiTable } from "$utils"; |
|||
// import { basicAction } from "@peace/utils";
|
|||
import { ApiTable, basicAction } from "$utils"; |
|||
|
|||
export function getMembers(orgId) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_MEMBERS", |
|||
url: `${ApiTable.getEnterprisesMembers.replace("{enterpriseId}", orgId)}`, |
|||
msg: { error: "获取用户列表失败" }, |
|||
reducer: { name: "members" }, |
|||
}); |
|||
export function getMembers (orgId) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_MEMBERS", |
|||
url: `${ApiTable.getEnterprisesMembers.replace("{enterpriseId}", orgId)}`, |
|||
msg: { error: "获取用户列表失败" }, |
|||
reducer: { name: "members" }, |
|||
}); |
|||
} |
|||
|
|||
export function getNvr(query) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_NVR", |
|||
query: query, |
|||
url: `${ApiTable.getNvr}`, |
|||
msg: { option: "获取nvr列表信息" }, |
|||
reducer: { name: "equipmentWarehouseNvr", params: { noClear: true } }, |
|||
}); |
|||
export function getNvr (query) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_NVR", |
|||
query: query, |
|||
url: `${ApiTable.getNvr}`, |
|||
msg: { option: "获取nvr列表信息" }, |
|||
reducer: { name: "equipmentWarehouseNvr", params: { noClear: true } }, |
|||
}); |
|||
} |
|||
|
|||
export function getNvrDetails(orgId) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_NVR_DETAILS", |
|||
url: `${ApiTable.getNvrDetails.replace("{nvrId}", orgId)}`, |
|||
msg: { option: "" }, //获取nvr详情
|
|||
reducer: { name: "nvrDetails" }, |
|||
}); |
|||
export function getNvrDetails (orgId) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_NVR_DETAILS", |
|||
url: `${ApiTable.getNvrDetails.replace("{nvrId}", orgId)}`, |
|||
msg: { option: "" }, //获取nvr详情
|
|||
reducer: { name: "nvrDetails" }, |
|||
}); |
|||
} |
|||
export function delNvr(orgId) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "del", |
|||
dispatch: dispatch, |
|||
actionType: "DEL_NVR", |
|||
url: `${ApiTable.delNvr.replace("{nvrId}", orgId)}`, |
|||
msg: { |
|||
option: |
|||
"设备会被存放在“设备回收站”中,删除", |
|||
}, |
|||
reducer: { name: "" }, |
|||
}); |
|||
export function delNvr (orgId) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "del", |
|||
dispatch: dispatch, |
|||
actionType: "DEL_NVR", |
|||
url: `${ApiTable.delNvr.replace("{nvrId}", orgId)}`, |
|||
msg: { |
|||
option: |
|||
"设备会被存放在“设备回收站”中,删除", |
|||
}, |
|||
reducer: { name: "" }, |
|||
}); |
|||
} |
|||
export function addchangeNvr(data) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "post", |
|||
dispatch: dispatch, |
|||
data, |
|||
actionType: "ADD_CHANGE_NVR", |
|||
msg: { option: "添加/修改" }, |
|||
url: `${ApiTable.nvr}`, |
|||
}); |
|||
export function addchangeNvr (data) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "post", |
|||
dispatch: dispatch, |
|||
data, |
|||
actionType: "ADD_CHANGE_NVR", |
|||
msg: { option: "添加/修改" }, |
|||
url: `${ApiTable.nvr}`, |
|||
}); |
|||
} |
|||
|
|||
export function getVender() { |
|||
//获取设备厂商
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_VENDER", |
|||
url: `${ApiTable.getVender}`, |
|||
msg: { error: "获取设备厂商失败" }, |
|||
reducer: { name: "vender" }, |
|||
}); |
|||
export function getVender () { |
|||
//获取设备厂商
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_VENDER", |
|||
url: `${ApiTable.getVender}`, |
|||
msg: { error: "获取设备厂商失败" }, |
|||
reducer: { name: "vender" }, |
|||
}); |
|||
} |
|||
|
|||
export function getExport() { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_EXPORT", |
|||
url: `${ApiTable.getExport}`, |
|||
msg: { option: "导出" }, //导出
|
|||
reducer: { name: "" }, |
|||
}); |
|||
export function getExport () { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_EXPORT", |
|||
url: `${ApiTable.getExport}`, |
|||
msg: { option: "导出" }, //导出
|
|||
reducer: { name: "" }, |
|||
}); |
|||
} |
|||
|
|||
|
|||
export function getCheck(data) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "post", |
|||
dispatch: dispatch, |
|||
data, |
|||
actionType: "GET_CHECK", |
|||
url: `${ApiTable.getCheck}`, |
|||
msg: { option: "" }, //校验nvr信息
|
|||
reducer: { name: "" }, |
|||
}); |
|||
export function getCheck (data) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "post", |
|||
dispatch: dispatch, |
|||
data, |
|||
actionType: "GET_CHECK", |
|||
url: `${ApiTable.getCheck}`, |
|||
msg: { option: "" }, //校验nvr信息
|
|||
reducer: { name: "" }, |
|||
}); |
|||
} |
Loading…
Reference in new issue