| | |
| | | "EnumPersonalFreeTime": true, |
| | | "EnumPersonalJobSeekingStatus": true, |
| | | "EnumPersonalRealMethod": true, |
| | | "EnumPersonalUserRealStatus": true, |
| | | "EnumRealAccess": true, |
| | | "EnumResourceController": true, |
| | | "EnumResourceMethod": true, |
| | |
| | | "SubModuleTitle": true, |
| | | "SubModuleType": true, |
| | | "TempFolderPath": true, |
| | | "TemplateEditDataItem": true, |
| | | "ThemeColorItem": true, |
| | | "ThemeColorName": true, |
| | | "ThemeColors": true, |
| | |
| | | const EnumPersonalFreeTime: typeof import('./src/constants/apiEnum')['EnumPersonalFreeTime'] |
| | | const EnumPersonalJobSeekingStatus: typeof import('./src/constants/apiEnum')['EnumPersonalJobSeekingStatus'] |
| | | const EnumPersonalRealMethod: typeof import('./src/constants/apiEnum')['EnumPersonalRealMethod'] |
| | | const EnumPersonalUserRealStatus: typeof import('./src/constants/apiEnum')['EnumPersonalUserRealStatus'] |
| | | const EnumRealAccess: typeof import('./src/constants/apiEnum')['EnumRealAccess'] |
| | | const EnumResourceController: typeof import('./src/constants/apiEnum')['EnumResourceController'] |
| | | const EnumResourceMethod: typeof import('./src/constants/apiEnum')['EnumResourceMethod'] |
| | |
| | | export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' |
| | | import('vue') |
| | | // @ts-ignore |
| | | export type { EnumBillingMethod, EnumClientType, EnumContractTemplateStatus, EnumContractTemplateValueRecorder, EnumContractTemplateValueType, EnumDataSource, EnumDbAuditOperate, EnumElectronSignAccess, EnumEnterpriseRealMethod, EnumMenuType, EnumMenuVisitLevel, EnumOcrAccess, EnumPagedListOrder, EnumPayAccess, EnumPersonalFreeTime, EnumPersonalJobSeekingStatus, EnumPersonalRealMethod, EnumRealAccess, EnumResourceController, EnumResourceMethod, EnumRoleWebApiDataPower, EnumSettlementCycle, EnumSmsAccess, EnumTaskCheckReceiveStatus, EnumTaskRecommendStatus, EnumTaskReleaseStatus, EnumTaskSettlementStatus, EnumTaskStatus, EnumTaskUserArrangeStatus, EnumTaskUserHireStatus, EnumTaskUserSignContractStatus, EnumTaskUserSubmitCheckReceiveStatus, EnumUserGender, EnumUserRealMethod, EnumUserStatus, EnumUserType, GetPersonalApplyTaskInfosQueryStatus, GetPersonalHireTaskInfosQueryStatus, GetTaskInfoQueryResultApplyButton, GetTaskInfoQueryResultHireButton, EnumBillingMethod, EnumClientType, EnumContractTemplateStatus, EnumContractTemplateValueRecorder, EnumContractTemplateValueType, EnumDataSource, EnumDbAuditOperate, EnumElectronSignAccess, EnumEnterpriseRealMethod, EnumMenuType, EnumMenuVisitLevel, EnumOcrAccess, EnumPagedListOrder, EnumPayAccess, EnumPersonalFreeTime, EnumPersonalJobSeekingStatus, EnumPersonalRealMethod, EnumRealAccess, EnumResourceController, EnumResourceMethod, EnumRoleWebApiDataPower, EnumSettlementCycle, EnumSmsAccess, EnumTaskCheckReceiveStatus, EnumTaskRecommendStatus, EnumTaskReleaseStatus, EnumTaskSettlementStatus, EnumTaskStatus, EnumTaskUserArrangeStatus, EnumTaskUserHireStatus, EnumTaskUserSignContractStatus, EnumTaskUserSubmitCheckReceiveStatus, EnumUserGender, EnumUserRealMethod, EnumUserStatus, EnumUserType, GetPersonalApplyTaskInfosQueryStatus, GetPersonalHireTaskInfosQueryStatus, GetTaskInfoQueryResultApplyButton, GetTaskInfoQueryResultHireButton } from './src/constants/apiEnum' |
| | | export type { EnumBillingMethod, EnumClientType, EnumContractTemplateStatus, EnumContractTemplateValueRecorder, EnumContractTemplateValueType, EnumDataSource, EnumDbAuditOperate, EnumElectronSignAccess, EnumEnterpriseRealMethod, EnumMenuType, EnumMenuVisitLevel, EnumOcrAccess, EnumPagedListOrder, EnumPayAccess, EnumPersonalFreeTime, EnumPersonalJobSeekingStatus, EnumPersonalRealMethod, EnumPersonalUserRealStatus, EnumRealAccess, EnumResourceController, EnumResourceMethod, EnumRoleWebApiDataPower, EnumSettlementCycle, EnumSmsAccess, EnumTaskCheckReceiveStatus, EnumTaskRecommendStatus, EnumTaskReleaseStatus, EnumTaskSettlementStatus, EnumTaskStatus, EnumTaskUserArrangeStatus, EnumTaskUserHireStatus, EnumTaskUserSignContractStatus, EnumTaskUserSubmitCheckReceiveStatus, EnumUserGender, EnumUserRealMethod, EnumUserStatus, EnumUserType, GetPersonalApplyTaskInfosQueryStatus, GetPersonalHireTaskInfosQueryStatus, GetTaskInfoQueryResultApplyButton, GetTaskInfoQueryResultHireButton, EnumBillingMethod, EnumClientType, EnumContractTemplateStatus, EnumContractTemplateValueRecorder, EnumContractTemplateValueType, EnumDataSource, EnumDbAuditOperate, EnumElectronSignAccess, EnumEnterpriseRealMethod, EnumMenuType, EnumMenuVisitLevel, EnumOcrAccess, EnumPagedListOrder, EnumPayAccess, EnumPersonalFreeTime, EnumPersonalJobSeekingStatus, EnumPersonalRealMethod, EnumPersonalUserRealStatus, EnumRealAccess, EnumResourceController, EnumResourceMethod, EnumRoleWebApiDataPower, EnumSettlementCycle, EnumSmsAccess, EnumTaskCheckReceiveStatus, EnumTaskRecommendStatus, EnumTaskReleaseStatus, EnumTaskSettlementStatus, EnumTaskStatus, EnumTaskUserArrangeStatus, EnumTaskUserHireStatus, EnumTaskUserSignContractStatus, EnumTaskUserSubmitCheckReceiveStatus, EnumUserGender, EnumUserRealMethod, EnumUserStatus, EnumUserType, GetPersonalApplyTaskInfosQueryStatus, GetPersonalHireTaskInfosQueryStatus, GetTaskInfoQueryResultApplyButton, GetTaskInfoQueryResultHireButton } from './src/constants/apiEnum' |
| | | import('./src/constants/apiEnum') |
| | | // @ts-ignore |
| | | export type { CategoryCode, IdentityCodeEnum, EducationCodeEnum, CertificateTypeCodeEnum, WelfareCodeEnum } from './src/constants/dic' |
| | |
| | | // @ts-ignore |
| | | export type { EditorType, EditorType } from './src/constants/editor' |
| | | import('./src/constants/editor') |
| | | // @ts-ignore |
| | | export type { TemplateEditDataItem } from './src/constants/electronSign' |
| | | import('./src/constants/electronSign') |
| | | // @ts-ignore |
| | | export type { AreaType, AreaType } from './src/constants/enum' |
| | | import('./src/constants/enum') |
| | |
| | | readonly EnumPersonalFreeTime: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumPersonalFreeTime']> |
| | | readonly EnumPersonalJobSeekingStatus: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumPersonalJobSeekingStatus']> |
| | | readonly EnumPersonalRealMethod: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumPersonalRealMethod']> |
| | | readonly EnumPersonalUserRealStatus: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumPersonalUserRealStatus']> |
| | | readonly EnumRealAccess: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumRealAccess']> |
| | | readonly EnumResourceController: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumResourceController']> |
| | | readonly EnumResourceMethod: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumResourceMethod']> |
| | |
| | | <meta name="referrer" content="no-referrer" /> |
| | | <title><%- title %></title> |
| | | <link rel="stylesheet" href="<%- subMenuIconCssPath %>" /> |
| | | <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js"></script> |
| | | <script> |
| | | window.process = {}; |
| | | </script> |
| | |
| | | Face = 30, |
| | | } |
| | | |
| | | /** 个人用户实名状态 */ |
| | | export enum EnumPersonalUserRealStatus { |
| | | /**未实名 */ |
| | | UnReal = 0, |
| | | /**校验中 */ |
| | | Checking = 10, |
| | | /**实名失败 */ |
| | | Fail = 99, |
| | | /**已实名 */ |
| | | Real = 100, |
| | | } |
| | | |
| | | /** 实名通道 */ |
| | | export enum EnumRealAccess { |
| | | /**上上签 */ |
| | |
| | | [EnumContractTemplateStatus.Wait]: '待制版', |
| | | [EnumContractTemplateStatus.Completed]: '已制版', |
| | | }; |
| | | |
| | | export type TemplateEditDataItem = { |
| | | path: string; |
| | | width: number; |
| | | height: number; |
| | | }; |
| | |
| | | ); |
| | | } |
| | | |
| | | /** 查询个人实名结果 GET /api/user/electronSign/getPersonalUserRealResult */ |
| | | export async function getPersonalUserRealResult( |
| | | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) |
| | | params: API.APIgetPersonalUserRealResultParams, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.GetPersonalUserRealResultQueryResult>( |
| | | '/api/user/electronSign/getPersonalUserRealResult', |
| | | { |
| | | method: 'GET', |
| | | params: { |
| | | ...params, |
| | | request: undefined, |
| | | ...params['request'], |
| | | }, |
| | | ...(options || {}), |
| | | } |
| | | ); |
| | | } |
| | | |
| | | /** 个人人脸实名认证 POST /api/user/electronSign/personalUserFaceReal */ |
| | | export async function personalUserFaceReal( |
| | | body: API.PersonalUserFaceRealCommand, |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 合同制版 POST /api/user/electronSign/saveContractTemplateValues */ |
| | | export async function saveContractTemplateValues( |
| | | body: API.SaveContractTemplateValuesCommand, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<string>('/api/user/electronSign/saveContractTemplateValues', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 发送个人三要素实名短信 POST /api/user/electronSign/sendPersonalUserIdentity3RealSms */ |
| | | export async function sendPersonalUserIdentity3RealSms( |
| | | body: API.SendPersonalUserIdentity3RealSmsCommand, |
| | |
| | | import * as user from './user'; |
| | | import * as role from './role'; |
| | | import * as enterprise from './enterprise'; |
| | | import * as electronSign from './electronSign'; |
| | | import * as resource from './resource'; |
| | | import * as task from './task'; |
| | | import * as ocrUtils from './ocrUtils'; |
| | | import * as dictionary from './dictionary'; |
| | | import * as userResume from './userResume'; |
| | | import * as auth from './auth'; |
| | | import * as taskCheckReceive from './taskCheckReceive'; |
| | | import * as electronSign from './electronSign'; |
| | | import * as taskUser from './taskUser'; |
| | | import * as ocrUtils from './ocrUtils'; |
| | | import * as menu from './menu'; |
| | | import * as logRecords from './logRecords'; |
| | | import * as fileUtils from './fileUtils'; |
| | |
| | | user, |
| | | role, |
| | | enterprise, |
| | | electronSign, |
| | | resource, |
| | | task, |
| | | ocrUtils, |
| | | dictionary, |
| | | userResume, |
| | | auth, |
| | | taskCheckReceive, |
| | | electronSign, |
| | | taskUser, |
| | | ocrUtils, |
| | | menu, |
| | | logRecords, |
| | | fileUtils, |
| | |
| | | // @ts-ignore |
| | | import { request } from '@/utils/request'; |
| | | |
| | | /** 文字识别营业执照 GET /api/common/ocrUtils/getLicenseOcr */ |
| | | export async function getLicenseOcr( |
| | | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) |
| | | params: API.APIgetLicenseOcrParams, |
| | | /** 文字识别身份证背面 POST /api/common/ocrUtils/getIdentityBackOcr */ |
| | | export async function getIdentityBackOcr( |
| | | body: API.GetIdentityBackOcrCommand, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.GetLicenseOcrCommandResult>('/api/common/ocrUtils/getLicenseOcr', { |
| | | method: 'GET', |
| | | params: { |
| | | ...params, |
| | | return request<API.GetIdentityBackOcrCommandResult>('/api/common/ocrUtils/getIdentityBackOcr', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 文字识别身份证正面 POST /api/common/ocrUtils/getIdentityFrontOcr */ |
| | | export async function getIdentityFrontOcr( |
| | | body: API.GetIdentityFrontOcrCommand, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.GetIdentityFrontOcrCommandResult>('/api/common/ocrUtils/getIdentityFrontOcr', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 文字识别营业执照 POST /api/common/ocrUtils/getLicenseOcr */ |
| | | export async function getLicenseOcr(body: API.GetLicenseOcrCommand, options?: API.RequestConfig) { |
| | | return request<API.GetLicenseOcrCommandResult>('/api/common/ocrUtils/getLicenseOcr', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | |
| | | url?: string; |
| | | } |
| | | |
| | | interface APIgetLicenseOcrParams { |
| | | /** 通道 */ |
| | | access?: EnumOcrAccess; |
| | | /** 场景 */ |
| | | scene?: string; |
| | | /** 链接地址 */ |
| | | url?: string; |
| | | /** 是否为云存储相对地址 */ |
| | | isOssUrl?: boolean; |
| | | } |
| | | |
| | | interface APIgetMenuParams { |
| | | /** Id */ |
| | | id?: string; |
| | |
| | | interface APIgetPersonalLoginInfoParams { |
| | | /** 查询个人用户登录信息 */ |
| | | request?: GetPersonalLoginInfoQuery; |
| | | } |
| | | |
| | | interface APIgetPersonalUserRealResultParams { |
| | | /** 查询个人实名结果 */ |
| | | request?: GetPersonalUserRealResultQuery; |
| | | } |
| | | |
| | | interface APIgetResourceFieldsParams { |
| | |
| | | address?: string; |
| | | /** 经营范围 */ |
| | | mainBusiness?: string; |
| | | } |
| | | |
| | | interface BaiduOcrIdentityBackResultModel { |
| | | /** 失效日期 */ |
| | | expiryDate?: string; |
| | | /** 签发机关 */ |
| | | issueAuthority?: string; |
| | | /** 签发日期 */ |
| | | issueDate?: string; |
| | | } |
| | | |
| | | interface BaiduOcrIdentityFrontResultModel { |
| | | name?: string; |
| | | /** 身份证号 */ |
| | | identity?: string; |
| | | gender?: EnumUserGender; |
| | | /** 生日 */ |
| | | birthday?: string; |
| | | /** 民族 */ |
| | | nation?: string; |
| | | /** 住址 */ |
| | | address?: string; |
| | | } |
| | | |
| | | interface BindWxmpUserInfoCommand { |
| | |
| | | Identity4 = 20, |
| | | /**刷脸认证 */ |
| | | Face = 30, |
| | | } |
| | | |
| | | enum EnumPersonalUserRealStatus { |
| | | /**未实名 */ |
| | | UnReal = 0, |
| | | /**校验中 */ |
| | | Checking = 10, |
| | | /**实名失败 */ |
| | | Fail = 99, |
| | | /**已实名 */ |
| | | Real = 100, |
| | | } |
| | | |
| | | enum EnumRealAccess { |
| | |
| | | timestamp?: number; |
| | | } |
| | | |
| | | interface FriendlyResultGetIdentityBackOcrCommandResult { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 状态码 */ |
| | | code?: number; |
| | | /** 错误码 */ |
| | | errorCode?: string; |
| | | data?: GetIdentityBackOcrCommandResult; |
| | | /** 执行成功 */ |
| | | success?: boolean; |
| | | /** 错误信息 */ |
| | | msg?: any; |
| | | /** 附加数据 */ |
| | | extras?: any; |
| | | /** 时间戳 */ |
| | | timestamp?: number; |
| | | } |
| | | |
| | | interface FriendlyResultGetIdentityFrontOcrCommandResult { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 状态码 */ |
| | | code?: number; |
| | | /** 错误码 */ |
| | | errorCode?: string; |
| | | data?: GetIdentityFrontOcrCommandResult; |
| | | /** 执行成功 */ |
| | | success?: boolean; |
| | | /** 错误信息 */ |
| | | msg?: any; |
| | | /** 附加数据 */ |
| | | extras?: any; |
| | | /** 时间戳 */ |
| | | timestamp?: number; |
| | | } |
| | | |
| | | interface FriendlyResultGetLicenseOcrCommandResult { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | |
| | | /** 错误码 */ |
| | | errorCode?: string; |
| | | data?: GetPersonalUserInfosQueryResult; |
| | | /** 执行成功 */ |
| | | success?: boolean; |
| | | /** 错误信息 */ |
| | | msg?: any; |
| | | /** 附加数据 */ |
| | | extras?: any; |
| | | /** 时间戳 */ |
| | | timestamp?: number; |
| | | } |
| | | |
| | | interface FriendlyResultGetPersonalUserRealResultQueryResult { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 状态码 */ |
| | | code?: number; |
| | | /** 错误码 */ |
| | | errorCode?: string; |
| | | data?: GetPersonalUserRealResultQueryResult; |
| | | /** 执行成功 */ |
| | | success?: boolean; |
| | | /** 错误信息 */ |
| | |
| | | name?: string; |
| | | /** 模板 */ |
| | | file?: string; |
| | | /** 制版模板照片 */ |
| | | templateEditData?: string; |
| | | /** 制版变量JSON */ |
| | | templateJsonData?: string; |
| | | /** 业务编码 */ |
| | | code?: string; |
| | | access?: EnumElectronSignAccess; |
| | |
| | | createdTime?: string; |
| | | } |
| | | |
| | | interface GetIdentityBackOcrCommand { |
| | | access?: EnumOcrAccess; |
| | | /** 场景 */ |
| | | scene?: string; |
| | | /** 链接地址 */ |
| | | url?: string; |
| | | /** 是否为云存储相对地址 */ |
| | | isOssUrl?: boolean; |
| | | } |
| | | |
| | | interface GetIdentityBackOcrCommandResult { |
| | | /** 地址 */ |
| | | url?: string; |
| | | model?: BaiduOcrIdentityBackResultModel; |
| | | } |
| | | |
| | | interface GetIdentityFrontOcrCommand { |
| | | access?: EnumOcrAccess; |
| | | /** 场景 */ |
| | | scene?: string; |
| | | /** 链接地址 */ |
| | | url?: string; |
| | | /** 是否为云存储相对地址 */ |
| | | isOssUrl?: boolean; |
| | | } |
| | | |
| | | interface GetIdentityFrontOcrCommandResult { |
| | | /** 地址 */ |
| | | url?: string; |
| | | model?: BaiduOcrIdentityFrontResultModel; |
| | | } |
| | | |
| | | interface GetLicenseOcrCommand { |
| | | access?: EnumOcrAccess; |
| | | /** 场景 */ |
| | | scene?: string; |
| | | /** 链接地址 */ |
| | | url?: string; |
| | | /** 是否为云存储相对地址 */ |
| | | isOssUrl?: boolean; |
| | | } |
| | | |
| | | interface GetLicenseOcrCommandResult { |
| | | /** 地址 */ |
| | | url?: string; |
| | |
| | | hireTime?: string; |
| | | /** 最近签约时间 */ |
| | | signContractTime?: string; |
| | | } |
| | | |
| | | type GetPersonalUserRealResultQuery = Record<string, any>; |
| | | |
| | | interface GetPersonalUserRealResultQueryResult { |
| | | /** 是否实名 */ |
| | | isReal?: boolean; |
| | | /** 实名时间 */ |
| | | realTime?: string; |
| | | realMethod?: EnumUserRealMethod; |
| | | /** 姓名 */ |
| | | name?: string; |
| | | /** 手机号 */ |
| | | phoneNumber?: string; |
| | | /** 身份证号 */ |
| | | identity?: string; |
| | | /** 身份证人像面 */ |
| | | identityImg?: string; |
| | | /** 身份证国徽面 */ |
| | | identityBackImg?: string; |
| | | gender?: EnumUserGender; |
| | | /** 生日 */ |
| | | birthday?: string; |
| | | /** 年龄 */ |
| | | age?: number; |
| | | /** 银行卡号 */ |
| | | bankCard?: string; |
| | | /** 银行卡照片 */ |
| | | bankCardImg?: string; |
| | | realAccess?: EnumRealAccess; |
| | | realStatus?: EnumPersonalUserRealStatus; |
| | | /** 实名失败消息 */ |
| | | realFailMessage?: string; |
| | | /** 人脸实名认证地址 */ |
| | | faceRealUrl?: string; |
| | | } |
| | | |
| | | interface GetResourceFieldsQueryResultItem { |
| | |
| | | name: string; |
| | | /** 模板 */ |
| | | file: string; |
| | | /** 制版模板照片 */ |
| | | templateEditData?: string; |
| | | /** 业务编码 */ |
| | | code?: string; |
| | | access?: EnumElectronSignAccess; |
| | | /** 模板Id */ |
| | | templateId?: string; |
| | | /** 变量 */ |
| | | values?: SaveContractTemplateCommandValue[]; |
| | | /** Id */ |
| | | id?: string; |
| | | } |
| | | |
| | | interface SaveContractTemplateCommandValue { |
| | | interface SaveContractTemplateValuesCommand { |
| | | /** 模板Id */ |
| | | id: string; |
| | | /** 制版变量JSON */ |
| | | templateJsonData?: string; |
| | | /** 变量 */ |
| | | values: SaveContractTemplateValuesCommandItem[]; |
| | | } |
| | | |
| | | interface SaveContractTemplateValuesCommandItem { |
| | | /** Id */ |
| | | id?: string; |
| | | type?: EnumContractTemplateValueType; |
| | |
| | | export * from './categoryUtils'; |
| | | export * from './encrypt'; |
| | | export * from './deepClone'; |
| | | export * from './pdf'; |
New file |
| | |
| | | import { BoleOss, Message } from '@bole-core/core'; |
| | | import { RichEditorUtils } from '@bole-core/components'; |
| | | import { OssManager } from '../oss'; |
| | | import { ElLoading } from 'element-plus'; |
| | | |
| | | pdfjsLib.GlobalWorkerOptions.workerSrc = |
| | | 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.worker.js'; |
| | | |
| | | export async function resolvePdfByUrl(url: string) { |
| | | let pdf = await pdfjsLib.getDocument(url).promise; |
| | | |
| | | return pdf; |
| | | } |
| | | |
| | | export type ConvertPdfToImageItem = BoleOss.PutObjectResult & { |
| | | width: number; |
| | | height: number; |
| | | }; |
| | | |
| | | export async function convertPdfToImage(pdfUrl: string) { |
| | | let loadingInstance: ReturnType<typeof ElLoading.service>; |
| | | try { |
| | | loadingInstance = ElLoading.service({ |
| | | fullscreen: true, |
| | | lock: false, |
| | | background: 'transparent', |
| | | }); |
| | | const pdf = await resolvePdfByUrl(pdfUrl); |
| | | let tasks: Promise<ConvertPdfToImageItem>[] = []; |
| | | for (let i = 0; i < pdf.numPages; i++) { |
| | | const page = await pdf.getPage(i + 1); |
| | | const viewport = page.getViewport({ scale: 1 }); |
| | | tasks.push( |
| | | new Promise(async (resolve, reject) => { |
| | | try { |
| | | let base64 = await generateBase64ByPage(page); |
| | | let file = RichEditorUtils.base64ToFile(base64); |
| | | let res = await OssManager.asyncUpload({ |
| | | file: file, |
| | | }); |
| | | resolve({ |
| | | ...res, |
| | | width: viewport.width, |
| | | height: viewport.height, |
| | | }); |
| | | } catch (error) { |
| | | reject(error); |
| | | } |
| | | }) |
| | | ); |
| | | } |
| | | return Promise.all(tasks); |
| | | } catch (error) { |
| | | Message.errorMessage(error); |
| | | throw new Error(error); |
| | | } finally { |
| | | if (loadingInstance) { |
| | | loadingInstance.close(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | async function generateBase64ByPage(page) { |
| | | const viewport = page.getViewport({ scale: 1 }); |
| | | let canvas = document.createElement('canvas'); |
| | | const context = canvas.getContext('2d'); |
| | | canvas.height = viewport.height; |
| | | canvas.width = viewport.width; |
| | | const renderContext = { |
| | | canvasContext: context, |
| | | viewport: viewport, |
| | | }; |
| | | await page.render(renderContext).promise; |
| | | let base64 = canvas.toDataURL('image/png'); |
| | | canvas = null; |
| | | return base64; |
| | | } |
| | |
| | | } from '@bole-core/components'; |
| | | import { AgreementbManageColumns } from './constants'; |
| | | import { EnumContractTemplateStatus, EnumContractTemplateStatusText } from '@/constants'; |
| | | import { downloadFileByUrl, format, setOSSLink } from '@/utils'; |
| | | import { convertPdfToImage, downloadFileByUrl, format, setOSSLink } from '@/utils'; |
| | | import { ModelValueType } from 'element-plus'; |
| | | import * as electronSignServices from '@/services/api/electronSign'; |
| | | import TemplateAddDialog from './components/TemplateAddDialog.vue'; |
| | |
| | | |
| | | async function handleAddOrEdit() { |
| | | try { |
| | | let pdfToImage = await convertPdfToImage(editForm.url?.[0].url); |
| | | let params: API.SaveContractTemplateCommand = { |
| | | name: editForm.name, |
| | | file: editForm.url[0]?.path ?? '', |
| | | templateEditData: JSON.stringify( |
| | | pdfToImage.map( |
| | | (x) => |
| | | ({ |
| | | path: x.path, |
| | | width: x.width, |
| | | height: x.height, |
| | | } as TemplateEditDataItem) |
| | | ) |
| | | ), |
| | | }; |
| | | let res = await electronSignServices.saveContractTemplate(params); |
| | | if (res) { |
| | |
| | | }; |
| | | lastBuildTime: string; |
| | | }; |
| | | |
| | | const pdfjsLib: any; |
| | | |
| | | interface Window { |
| | | webkitCancelAnimationFrame: (handle: number) => void; |
| | | mozCancelAnimationFrame: (handle: number) => void; |