更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -1,24 +1,17 @@
|
||||
/**
|
||||
* OA 协同办公(移动端)接口封装。
|
||||
* 对应后端 go/controllers/app_oa.go 的 /api/oa/* 只读接口。
|
||||
*/
|
||||
import { request } from '@/api/request.js'
|
||||
|
||||
/** 公告类型:0-通知 1-公告 2-活动 */
|
||||
export const NOTICE_TYPE_OPTIONS = [
|
||||
{ value: 0, label: '通知' },
|
||||
{ value: 1, label: '公告' },
|
||||
{ value: 2, label: '活动' }
|
||||
]
|
||||
|
||||
/** 公告级别:0-普通 1-重要 2-紧急 */
|
||||
export const NOTICE_LEVEL_OPTIONS = [
|
||||
{ value: 0, label: '普通' },
|
||||
{ value: 1, label: '重要' },
|
||||
{ value: 2, label: '紧急' }
|
||||
]
|
||||
|
||||
/** 文档类型:与 models.DocType* 常量一致 */
|
||||
export const DOC_TYPE_OPTIONS = [
|
||||
{ value: 0, label: '其他', icon: 'file' },
|
||||
{ value: 1, label: '文档', icon: 'file-lines' },
|
||||
@@ -31,7 +24,6 @@ export const DOC_TYPE_OPTIONS = [
|
||||
{ value: 8, label: '音频', icon: 'file-audio' }
|
||||
]
|
||||
|
||||
/** 薪资单状态:0-草稿 1-已确认 2-已发放 3-已归档 */
|
||||
export const PAYROLL_STATUS_OPTIONS = [
|
||||
{ value: 0, label: '草稿' },
|
||||
{ value: 1, label: '已确认' },
|
||||
@@ -39,14 +31,12 @@ export const PAYROLL_STATUS_OPTIONS = [
|
||||
{ value: 3, label: '已归档' }
|
||||
]
|
||||
|
||||
/** 在职状态:1-试用 2-正式 3-离职 */
|
||||
export const EMPLOYMENT_STATUS_OPTIONS = [
|
||||
{ value: 1, label: '试用' },
|
||||
{ value: 2, label: '正式' },
|
||||
{ value: 3, label: '离职' }
|
||||
]
|
||||
|
||||
/** 婚姻状况:0-未填 1-未婚 2-已婚 3-离异 4-丧偶 */
|
||||
export const MARITAL_STATUS_OPTIONS = [
|
||||
{ value: 0, label: '未填' },
|
||||
{ value: 1, label: '未婚' },
|
||||
@@ -55,7 +45,6 @@ export const MARITAL_STATUS_OPTIONS = [
|
||||
{ value: 4, label: '丧偶' }
|
||||
]
|
||||
|
||||
/** 档案子记录类型:1-教育经历 2-工作经历 3-合同信息 4-证照附件 */
|
||||
export const FILE_RECORD_TYPE_OPTIONS = [
|
||||
{ value: 1, label: '教育经历' },
|
||||
{ value: 2, label: '工作经历' },
|
||||
@@ -96,7 +85,6 @@ export function getDocTypeMeta(value) {
|
||||
return DOC_TYPE_OPTIONS.find(item => item.value === Number(value)) || DOC_TYPE_OPTIONS[0]
|
||||
}
|
||||
|
||||
/** 文件大小人性化展示 */
|
||||
export function formatFileSize(size) {
|
||||
const bytes = Number(size) || 0
|
||||
if (bytes <= 0) return ''
|
||||
@@ -106,8 +94,6 @@ export function formatFileSize(size) {
|
||||
return (bytes / 1024 / 1024 / 1024).toFixed(2) + ' GB'
|
||||
}
|
||||
|
||||
// ---------------- 通知公告 ----------------
|
||||
|
||||
export async function fetchNotices(params = {}) {
|
||||
const data = await request({
|
||||
url: '/api/oa/notice/list',
|
||||
@@ -124,8 +110,6 @@ export function getNotice(id) {
|
||||
return request({ url: `/api/oa/notice/${id}` })
|
||||
}
|
||||
|
||||
// ---------------- 文档库 ----------------
|
||||
|
||||
export function fetchDocCategories(scope = 'shared') {
|
||||
return request({ url: '/api/oa/document/categories', data: { scope } })
|
||||
}
|
||||
@@ -159,8 +143,6 @@ export function toggleDocStar(id) {
|
||||
return request({ url: `/api/oa/document/${id}/star`, method: 'POST' })
|
||||
}
|
||||
|
||||
// ---------------- 薪酬工资单(仅本人) ----------------
|
||||
|
||||
export async function fetchPayrolls(params = {}) {
|
||||
const data = await request({
|
||||
url: '/api/oa/compensation/payrolls',
|
||||
@@ -177,15 +159,11 @@ export function getPayroll(id) {
|
||||
return request({ url: `/api/oa/compensation/payrolls/${id}` })
|
||||
}
|
||||
|
||||
// ---------------- 员工档案 ----------------
|
||||
|
||||
/** 当前用户是否具备 HR 视角(可见全公司档案)。角色里勾了「员工档案」菜单即为 HR。 */
|
||||
export async function getEmployeeFileAccess() {
|
||||
const data = await request({ url: '/api/oa/employee-file/access' })
|
||||
return !!(data && data.can_view_all)
|
||||
}
|
||||
|
||||
/** 全公司档案分页列表(HR),支持 keyword / status / org_id */
|
||||
export async function fetchEmployeeFiles(params = {}) {
|
||||
const data = await request({
|
||||
url: '/api/oa/employee-file/list',
|
||||
@@ -200,12 +178,10 @@ export async function fetchEmployeeFiles(params = {}) {
|
||||
return { list: (data && data.list) || [], total: (data && data.total) || 0 }
|
||||
}
|
||||
|
||||
/** 指定员工档案详情(含教育/工作/合同/证照子记录) */
|
||||
export function getEmployeeFileDetail(id) {
|
||||
return request({ url: `/api/oa/employee-file/detail/${id}` })
|
||||
}
|
||||
|
||||
/** 本人档案(无 HR 权限时的兜底视图) */
|
||||
export function getMyEmployeeFile() {
|
||||
return request({ url: '/api/oa/employee-file' })
|
||||
}
|
||||
Reference in new issue
Block a user