File tree Expand file tree Collapse file tree 3 files changed +47
-2
lines changed
Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,14 @@ const table = {
123123 dataSource : dataSource
124124 } ) ;
125125 } ,
126+ multiExport : function ( dataSource , ids ) {
127+ return axiosInstance . post ( "/api/business/export" ,
128+ ids ,
129+ {
130+ dataSource : dataSource
131+ }
132+ ) ;
133+ } ,
126134 multiImport : async function ( dataSource , data , progressCallback ) {
127135 console . log ( "table->import" )
128136 console . log ( data )
Original file line number Diff line number Diff line change 7474 unelevated
7575 @click =" onExportClickAction()"
7676 color =" positive"
77- label =" 批量导出"
77+ label =" 批量导出元数据"
78+ />
79+ <p class =" q-px-sm" />
80+ <q-btn
81+ :disable =" selected.length == 0"
82+ unelevated
83+ @click =" onExportBussinessClickAction()"
84+ color =" positive"
85+ label =" 导出业务数据"
7886 />
7987 <p class =" q-px-sm" />
8088 <q-btn
8189 unelevated
8290 @click =" onImportClickAction()"
8391 color =" purple"
84- label =" 批量导入 "
92+ label =" 导入元数据 "
8593 />
8694 <p class =" q-px-sm" />
8795 <q-btn
97105 color =" primary"
98106 label =" 添加"
99107 />
108+ <p class =" q-px-sm" />
100109 </template >
101110
102111 </q-banner >
177186
178187<script >
179188import { metadataTableService } from " ../../../service" ;
189+ import { tableService } from " ../../../service" ;
180190import { date } from " ../../../utils" ;
181191
182192export default {
@@ -414,6 +424,29 @@ export default {
414424 console .error (error);
415425 }
416426 },
427+ async onExportBussinessClickAction (id ) {
428+ let ids = [];
429+ this .selected .forEach (function (val ){
430+ ids .push (val .id );
431+ });
432+ console .info (" list->onExportBussinessClickAction" );
433+
434+ this .$q .loading .show ({
435+ message: " 导出中"
436+ });
437+
438+ try {
439+ const fileName = await tableService .multiExport (this .dataSource , ids);
440+ this .$q .notify (" 业务数据JSON生成成功,请等待下载完成后查看!" );
441+
442+ window .open (" /api/file/" + fileName + " ?dataSource=" + this .dataSource , " _blank" );
443+
444+ this .$q .loading .hide ();
445+ } catch (error) {
446+ this .$q .loading .hide ();
447+ console .error (error);
448+ }
449+ },
417450
418451 onImportClickAction () {
419452 this .$router .push (" /dataSource/" + this .dataSource + " /metadata/tables/import" );
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ const tableService = {
4545 return res . data ;
4646 } )
4747 } ,
48+ multiExport : async function ( dataSource , ids ) {
49+ var res = await table . multiExport ( dataSource , ids ) ;
50+ return res . data ;
51+ } ,
4852 getImportTemplate : async function ( dataSource , tableName ) {
4953 var res = await table . getImportTemplate ( dataSource , tableName ) ;
5054 return res . data ;
You can’t perform that action at this time.
0 commit comments