From 9787b94a0ce442e6afa55954d2efc6559376fd76 Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Mon, 24 Jun 2024 17:15:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=8F=91=E5=B8=83=E5=90=8E?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/formrender/index.ts | 20 +++ .../ImportModal/ShowErrorList/index.vue | 44 +++++++ .../onlineform/formCall/ImportModal/index.vue | 124 ++++++++++++++++++ src/views/demo/onlineform/formCall/index.vue | 8 ++ 4 files changed, 196 insertions(+) create mode 100644 src/views/demo/onlineform/formCall/ImportModal/ShowErrorList/index.vue create mode 100644 src/views/demo/onlineform/formCall/ImportModal/index.vue diff --git a/src/api/formrender/index.ts b/src/api/formrender/index.ts index e692868d..b82f623d 100644 --- a/src/api/formrender/index.ts +++ b/src/api/formrender/index.ts @@ -15,6 +15,9 @@ enum Api { GETFORMSDATADETAIL = '/api/FormScheme/GetFormData', //表单数据详情 getFormData = '/api/FormScheme/GetFormData', //获取单行数据 exportForm = '/api/FormModule/Export?id=', //导出 + DownloadTemplate = '/api/FormScheme/DownTemplateFile?id=', //下载模板 + UploadFile = '/api/Files/Upload', //上传文件 + UploadData = '/api/FormScheme/ImportExcel', //导入 } /** @@ -47,3 +50,20 @@ export const exportForm = (params: AccountParams) => responseType: 'blob', params, }); +export const DownloadTemplate = (id: string) => + defHttp.get({ + url: Api.DownloadTemplate + id, + responseType: 'blob', + }) +export const uploadFile = (params) => + defHttp.post({ + url: Api.UploadFile, + params, + headers: { + 'Content-type': 'multipart/form-data', + }, + }) +export const uploadData = (params) => + defHttp.post({ + url: `${Api.UploadData}?id=${params.id}&pkey=${params.pkey}&path=${params.path}`, + }) diff --git a/src/views/demo/onlineform/formCall/ImportModal/ShowErrorList/index.vue b/src/views/demo/onlineform/formCall/ImportModal/ShowErrorList/index.vue new file mode 100644 index 00000000..dafa9329 --- /dev/null +++ b/src/views/demo/onlineform/formCall/ImportModal/ShowErrorList/index.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/views/demo/onlineform/formCall/ImportModal/index.vue b/src/views/demo/onlineform/formCall/ImportModal/index.vue new file mode 100644 index 00000000..2e245c47 --- /dev/null +++ b/src/views/demo/onlineform/formCall/ImportModal/index.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/src/views/demo/onlineform/formCall/index.vue b/src/views/demo/onlineform/formCall/index.vue index d2c8c13d..8849fda1 100644 --- a/src/views/demo/onlineform/formCall/index.vue +++ b/src/views/demo/onlineform/formCall/index.vue @@ -86,6 +86,9 @@ + + + import('@/components/MapboxMaps/MapComponent.vue')); const mapFormShow = ref(false); const mapFormData = ref({}); @@ -148,6 +152,8 @@ const mapSetData = ref({ width: 100, }); + const importOpen = ref (false) + const pkey = ref("") const infoCallModalOpen = ref(false); const infoCallModalData = ref({}); const selectedSubTableDataId = ref(''); @@ -601,6 +607,7 @@ } break; case 'Import': + importOpen.value = true break; case 'Export': let params = exportParams.value; @@ -746,6 +753,7 @@ getFormsDesignData(params).then((res: Recordable) => { let columnObj = JSON.parse(res.entity.scheme); let formObj = JSON.parse(res.formScheme.scheme); + pkey.value = formObj.primaryKey console.log('formObj', formObj); console.log('columnObj', columnObj); if (formObj.formInfo.tabList && formObj.formInfo.tabList.length > 0) {