| | |
| | | convertJsonMapToTemplateParamObjectList, |
| | | } from '../utils'; |
| | | import { CanvasHeight, CanvasWidth } from '../constants'; |
| | | import _ from 'lodash'; |
| | | |
| | | export interface TemplateDetailContext { |
| | | templateDetail: Ref<API.GetContractTemplateQueryResult>; |
| | |
| | | ); |
| | | |
| | | type UseTemplateDetailProvideOptions = { |
| | | id: MaybeRef<string>; |
| | | id?: MaybeRef<string>; |
| | | isDefault?: boolean; |
| | | }; |
| | | |
| | | export function useTemplateDetailProvide({ id }: UseTemplateDetailProvideOptions) { |
| | | export function useTemplateDetailProvide({ id, isDefault }: UseTemplateDetailProvideOptions) { |
| | | console.log('id: ', id); |
| | | // const templateParamList = ref<API.GetContractTemplateQueryResultValue[]>([]); |
| | | |
| | |
| | | return []; |
| | | }); |
| | | |
| | | const { dictionaryDataList: templateParamList } = useDictionaryDataSelect({ |
| | | categoryCode: computed(() => CategoryCode.ElectronSignParam), |
| | | const { data: templateParamList } = useQuery({ |
| | | queryKey: ['electronSignServices/getContractParamterSelect', id], |
| | | queryFn: async () => { |
| | | let params: API.APIgetContractParamterSelectParams = { |
| | | templateId: unref(id), |
| | | isDefault: isDefault, |
| | | }; |
| | | return await electronSignServices.getContractParamterSelect( |
| | | _.pickBy(params, (value) => value !== undefined && value !== null), |
| | | { |
| | | showLoading: false, |
| | | } |
| | | ); |
| | | }, |
| | | // enabled: computed(() => !!unref(id)), |
| | | placeholderData: () => [] as API.SelectOptionStringGetDictionaryDataSelectQueryResultOption[], |
| | | onSuccess(data) {}, |
| | | }); |
| | | |
| | | // const { dictionaryDataList: templateParamList } = useDictionaryDataSelect({ |
| | | // categoryCode: computed(() => CategoryCode.ElectronSignParam), |
| | | // }); |
| | | |
| | | const templateEditState = reactive({ |
| | | templateId: unref(id), |
| | |
| | | |
| | | return { |
| | | isLoading, |
| | | templateParamList, |
| | | }; |
| | | } |
| | | |