mirror of
https://github.com/veops/cmdb.git
synced 2025-08-09 12:53:11 +08:00
前端更新 (#189)
* fix:add package * fix:notice_info为null的情况 * fix:2 bugs * feat:1.common增加通知配置 2.cmdb预定义值webhook&其他模型 * fix:json 不支持预定义值 * fix:json 不支持预定义值
This commit is contained in:
@@ -1,127 +1,134 @@
|
||||
import { axios } from '@/utils/request'
|
||||
|
||||
export function getEmployeeList(params) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee',
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
// export function getEmployeeList(params, orderBy) {
|
||||
// return axios({
|
||||
// url: '/common-setting/v1/employee' + '/' + orderBy,
|
||||
// method: 'get',
|
||||
// params: params,
|
||||
// })
|
||||
// }
|
||||
export function postEmployee(data) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
export function getEmployeeCount(params) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee/count',
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
export function deleteEmployee(_id) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/${_id}`,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
export function putEmployee(_id, data) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/${_id}`,
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
export function batchEditEmployee(data) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee/batch',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
export function importEmployee(data) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee/import',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getEmployeeByUid(uid) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/by_uid/${uid}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function updateEmployeeByUid(uid, data) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/by_uid/${uid}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updatePasswordByUid(uid, data) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/by_uid/change_password/${uid}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function bindWxByUid(uid) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/by_uid/bind_work_wechat/${uid}`,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
|
||||
export function getAllPosition() {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/position`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function getEmployeeByEmployeeId(employee_id) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/${employee_id}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 下载员工列表
|
||||
export function downloadAllEmployee(params) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/export_all`,
|
||||
method: 'get',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function getEmployeeListByFilter(data) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee/filter',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getNoticeByEmployeeIds(data) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee/get_notice_by_ids',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
import { axios } from '@/utils/request'
|
||||
|
||||
export function getEmployeeList(params) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee',
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
// export function getEmployeeList(params, orderBy) {
|
||||
// return axios({
|
||||
// url: '/common-setting/v1/employee' + '/' + orderBy,
|
||||
// method: 'get',
|
||||
// params: params,
|
||||
// })
|
||||
// }
|
||||
export function postEmployee(data) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
export function getEmployeeCount(params) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee/count',
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
export function deleteEmployee(_id) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/${_id}`,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
export function putEmployee(_id, data) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/${_id}`,
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
export function batchEditEmployee(data) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee/batch',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
export function importEmployee(data) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee/import',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getEmployeeByUid(uid) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/by_uid/${uid}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function updateEmployeeByUid(uid, data) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/by_uid/${uid}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updatePasswordByUid(uid, data) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/by_uid/change_password/${uid}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function bindPlatformByUid(platform, uid) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/by_uid/bind_notice/${platform}/${uid}`,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
|
||||
export function unbindPlatformByUid(platform, uid) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/by_uid/bind_notice/${platform}/${uid}`,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
export function getAllPosition() {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/position`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function getEmployeeByEmployeeId(employee_id) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/${employee_id}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 下载员工列表
|
||||
export function downloadAllEmployee(params) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/employee/export_all`,
|
||||
method: 'get',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function getEmployeeListByFilter(data) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee/filter',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getNoticeByEmployeeIds(data) {
|
||||
return axios({
|
||||
url: '/common-setting/v1/employee/get_notice_by_ids',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
40
cmdb-ui/src/api/noticeSetting.js
Normal file
40
cmdb-ui/src/api/noticeSetting.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import { axios } from '@/utils/request'
|
||||
|
||||
export function sendTestEmail(receive_address, data) {
|
||||
return axios({
|
||||
url: `/common-setting/v1/notice_config/send_test_email?receive_address=${receive_address}`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const getNoticeConfigByPlatform = (platform) => {
|
||||
return axios({
|
||||
url: '/common-setting/v1/notice_config',
|
||||
method: 'get',
|
||||
params: { ...platform },
|
||||
})
|
||||
}
|
||||
|
||||
export const postNoticeConfigByPlatform = (data) => {
|
||||
return axios({
|
||||
url: '/common-setting/v1/notice_config',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const putNoticeConfigByPlatform = (id, info) => {
|
||||
return axios({
|
||||
url: `/common-setting/v1/notice_config/${id}`,
|
||||
method: 'put',
|
||||
data: info
|
||||
})
|
||||
}
|
||||
|
||||
export const getNoticeConfigAppBot = () => {
|
||||
return axios({
|
||||
url: `/common-setting/v1/notice_config/app_bot`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user