| | |
| | | const operationBtnMap: Record<string, OperationBtnType> = { |
| | | editBtn: { |
| | | emits: { onClick: (role) => openDialog(role) }, |
| | | extraProps: { |
| | | hide: (row: API.GetEnterpriseContractTemplatesQueryResultItem) => |
| | | row.status !== EnumContractTemplateStatus.Completed, |
| | | }, |
| | | }, |
| | | editTemplateBtn: { |
| | | emits: { onClick: (role) => goEditTemplate(role) }, |
| | |
| | | file: [] as UploadUserFile[], |
| | | access: '' as any as EnumElectronSignAccess, |
| | | title: '新增模板', |
| | | isEnterpriseUserCreated: false, |
| | | templateEditData: '', |
| | | }, |
| | | }); |
| | | |
| | | function openDialog(row?: API.GetEnterpriseContractTemplatesQueryResultItem) { |
| | | if (row) { |
| | | handleEdit({ |
| | | id: row.id, |
| | | templateId: row.templateId, |
| | | name: row.name, |
| | | code: row.code, |
| | | file: convertApi2FormUrlOnlyOne(row.file), |
| | | access: row.access, |
| | | }); |
| | | } else { |
| | | handleAdd(); |
| | | } |
| | | async function openDialog(row?: API.GetEnterpriseContractTemplatesQueryResultItem) { |
| | | try { |
| | | if (row) { |
| | | let detail = await electronSignServices.getContractTemplate({ id: row.id }); |
| | | handleEdit({ |
| | | id: row.id, |
| | | templateId: row.templateId, |
| | | name: row.name, |
| | | code: row.code, |
| | | file: convertApi2FormUrlOnlyOne(row.file), |
| | | access: row.access, |
| | | isEnterpriseUserCreated: detail.isEnterpriseUserCreated, |
| | | templateEditData: detail.templateEditData, |
| | | }); |
| | | } else { |
| | | handleAdd(); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function handleAddOrEdit() { |