From 2e9c878dab8b83a5acbfb2caf934a66394b60d98 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期一, 30 十二月 2024 20:44:20 +0800 Subject: [PATCH] 一些优化 --- src/views/components/ImportExcelModal.vue | 30 +++++++++++++++++++++++++++--- 1 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/views/components/ImportExcelModal.vue b/src/views/components/ImportExcelModal.vue index 9dbcb5f..a73fa51 100644 --- a/src/views/components/ImportExcelModal.vue +++ b/src/views/components/ImportExcelModal.vue @@ -136,13 +136,34 @@ EntityJson: JSON.stringify(tableListRef.value[0].dataSource), CheckJson: checkJson.value, where: where.value, - typeFullName: typeFullName.value + typeFullName: typeFullName.value, }); if (res.IsSuccessed) { tableListRef.value[0].dataSource = res.Data; err.value = ''; } else { - tableListRef.value = []; + tableListRef.value = [ + { + title: '鍒楄〃淇℃伅', + columns: [ + { + title: '瀛楁1', + dataIndex: 'field1', + width: 200, + sorter: true, + resizable: true, + }, + { + title: '瀛楁2', + dataIndex: 'field2', + width: 200, + sorter: true, + resizable: true, + }, + ], + dataSource: [], + }, + ]; createMessage.error('瀵煎叆澶辫触' + res.Message); err.value = res.Message; } @@ -171,7 +192,10 @@ title: () => h('span', t('瀵煎叆淇℃伅')), content: () => h('span', t('纭鏈変慨鏀圭殑鏁版嵁鏄惁姝g‘锛屾湁寮傚父鐨勬暟鎹棤娉曞鍏�')), onOk: async () => { - const apiAction = await ImportExcel(entityName.value, tableListRef.value[0]['dataSource'] as any[]); + const apiAction = await ImportExcel( + entityName.value, + tableListRef.value[0]['dataSource'] as any[], + ); if (apiAction.IsSuccessed) { closeModal(); createMessage.success(t('瀵煎叆鎴愬姛')); -- Gitblit v1.9.3