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