| | |
| | | } 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) { |