49
49
</div >
50
50
</form >
51
51
52
- <template #modal- footer >
52
+ <template #footer >
53
53
<div class =" w-100" >
54
54
<b-button
55
55
variant =" primary"
56
- class =" float-right "
56
+ class =" float-end "
57
57
v-on:click =" handleOk"
58
- :disabled =" ( file && file.length == 0) || !versionState"
58
+ :disabled =" ! file || !versionState"
59
59
>
60
60
UPLOAD
61
61
</b-button >
62
- <b-button variant =" secondary" class =" float-right mr-3" v-on:click =" hide" >
63
- CLOSE
64
- </b-button >
62
+ <b-button variant =" secondary" class =" float-end me-3" v-on:click =" hide" > CLOSE </b-button >
65
63
</div >
66
64
</template >
67
65
</b-modal >
@@ -74,12 +72,19 @@ import SpinnerVue from '@/components/Common/SpinnerVue.vue';
74
72
import PushNotification from ' @/utils/push-notification' ;
75
73
import RulePackService from ' @/services/rule-pack-service' ;
76
74
import { nextTick , ref , type Ref } from ' vue' ;
77
- import type { BvEvent } from ' bootstrap-vue-next' ;
75
+ import {
76
+ BFormFile ,
77
+ BButton ,
78
+ BFormGroup ,
79
+ BFormInput ,
80
+ BModal ,
81
+ type BvEvent ,
82
+ } from ' bootstrap-vue-next' ;
78
83
79
84
const loadedData = ref (true );
80
85
const rule_pack_upload_modal = ref ();
81
86
82
- const file = ref ([] as File []) ;
87
+ const file = ref (undefined ) as Ref < File | undefined > ;
83
88
const version = ref (' ' );
84
89
const versionState = ref (null ) as Ref <boolean | null >;
85
90
const emit = defineEmits ([' on-file-upload-suceess' ]);
@@ -90,14 +95,14 @@ function show(): void {
90
95
91
96
function hide(): void {
92
97
version .value = ' ' ;
93
- file .value = [] ;
98
+ file .value = undefined ;
94
99
versionState .value = null ;
95
100
rule_pack_upload_modal .value .hide ();
96
101
}
97
102
98
103
function resetModal(): void {
99
104
version .value = ' ' ;
100
- file .value = [] ;
105
+ file .value = undefined ;
101
106
versionState .value = null ;
102
107
}
103
108
@@ -118,7 +123,7 @@ function handleOk(bvModalEvt: BvEvent | MouseEvent) {
118
123
119
124
function submitForm() {
120
125
loadedData .value = false ;
121
- RulePackService .uploadRulePack (version .value , file .value [ 0 ] )
126
+ RulePackService .uploadRulePack (version .value , file .value as File )
122
127
.then ((response ) => {
123
128
emit (' on-file-upload-suceess' );
124
129
if (response && response .status === 200 ) {
0 commit comments