From 59efc044444834646bf7443dd8de10f09a246434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BC=BA?= <1206709430@qq.com> Date: Wed, 15 Jun 2022 21:57:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=98=E5=8C=96:=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/dvadmin/utils/import_export.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/dvadmin/utils/import_export.py b/backend/dvadmin/utils/import_export.py index 84fd5ed..882ff4c 100644 --- a/backend/dvadmin/utils/import_export.py +++ b/backend/dvadmin/utils/import_export.py @@ -47,6 +47,8 @@ def import_to_data(file_url, field_data, m2m_fields=None): cell_value = int(str(cell_value).split(".")[0]) if type(cell_value) is str: cell_value = cell_value.strip(" \t\n\r") + if cell_value is None: + continue if key in validation_data_dict: array[key] = validation_data_dict.get(key, {}).get(cell_value, None) if key in m2m_fields: From 7e91f07b497398b81bc2469aeacfa77bfdae105b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BC=BA?= <1206709430@qq.com> Date: Thu, 16 Jun 2022 09:02:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E:=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=EF=BC=8C=E5=8F=AF=E6=A0=B9=E6=8D=AE=E5=89=8D?= =?UTF-8?q?=E7=AB=AFSearch=E8=BF=9B=E8=A1=8C=E8=BF=87=E6=BB=A4=E5=AF=BC?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/api/service.js | 5 +++-- web/src/views/system/user/index.vue | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/src/api/service.js b/web/src/api/service.js index 4262a4c..7470667 100644 --- a/web/src/api/service.js +++ b/web/src/api/service.js @@ -213,13 +213,14 @@ const refreshTken = function () { * 下载文件 * @param url * @param params + * @param method * @param filename */ -export const downloadFile = function ({ url, data, method, filename }) { +export const downloadFile = function ({ url, params, method, filename }) { request({ url: url, method: method, - data: data, + params: params, responseType: 'blob' // headers: {Accept: 'application/vnd.openxmlformats-officedocument'} }).then(res => { diff --git a/web/src/views/system/user/index.vue b/web/src/views/system/user/index.vue index af78319..f897164 100644 --- a/web/src/views/system/user/index.vue +++ b/web/src/views/system/user/index.vue @@ -166,12 +166,14 @@ export default { return api.BatchDel(ids) }, onExport () { + const that = this this.$confirm('是否确认导出所有数据项?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(function () { - return api.exportData() + const query = that.getSearch().getForm() + return api.exportData({ ...query }) }) }, // 重置密码弹框