Сохранит файл

This commit is contained in:
iriska-gri committed 2023-10-19 15:26:55 +03:00
1 parent 5666c46de8
commit bb27a5360b
4 files changed
+13 -3

No files matched your search

BIN
View File
Binary file not shown.
+11 -1
View File
@@ -8,6 +8,14 @@
@click="excelOp"> @click="excelOp">
Excel Excel
</v-btn> </v-btn>
<v-btn
:href="`${baseURL}media/DailyRoundUp.xlsx`"
download
>
Скачать
</v-btn>
</v-col> </v-col>
</v-row> </v-row>
@@ -15,6 +23,7 @@
<script> <script>
import { ref } from 'vue' import { ref } from 'vue'
import { baseURL } from '@/utils/axios-api'
import {getfromserver} from '@/utils/universal_functions' import {getfromserver} from '@/utils/universal_functions'
export default { export default {
setup(){ setup(){
@@ -25,7 +34,8 @@ export default {
return { return {
visiting, visiting,
excelOp excelOp,
baseURL
} }
} }
+2 -2
View File
@@ -200,12 +200,12 @@ class DailyRoundUpAPIView(APIView):
wb.save(file_path) wb.save(file_path)
urllib.request.urlretrieve(file_path, 'Пупка.xlsx') # urllib.request.urlretrieve(file_path, 'Пупка.xlsx')
# file_path = 'media/DailyRoundUp.xlsx' # file_path = 'media/DailyRoundUp.xlsx'
return Response('') return Response(file_path)
# with ExcelWriter(file_path, mode="a" if os.path.exists(file_path) else "w" , if_sheet_exists='replace') as writer: # with ExcelWriter(file_path, mode="a" if os.path.exists(file_path) else "w" , if_sheet_exists='replace') as writer:
# # # #
Binary file not shown.