Загрузка фпйла
This commit is contained in:
1 parent
71065dbef4
commit
ca5c9830d6
5 files changed
+10782
-330
No files matched your search
BIN
Binary file not shown.
Generated
+10763
-307
File diff suppressed because it is too large.
Load diff
@@ -23,6 +23,7 @@
|
||||
"axios": "^1.4.0",
|
||||
"chart.js": "^4.4.0",
|
||||
"date-fns": "^2.30.0",
|
||||
"express-vue": "^5.16.0",
|
||||
"pinia": "^2.0.23",
|
||||
"roboto-fontface": "*",
|
||||
"vue": "^3.2.0",
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
import { ref } from 'vue'
|
||||
import { baseURL } from '@/utils/axios-api'
|
||||
import {getfromserver} from '@/utils/universal_functions'
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
|
||||
export default {
|
||||
setup(){
|
||||
const dailyfiles = ref('')
|
||||
@@ -38,9 +40,17 @@ export default {
|
||||
}
|
||||
|
||||
const onPickFile = () => {
|
||||
console.log(dailyfiles.value, '----------------');
|
||||
}
|
||||
|
||||
|
||||
const sdata = new FormData()
|
||||
sdata.append('dailyfiles', dailyfiles.value[0])
|
||||
|
||||
|
||||
axiosApiInstance.post(`api/general_vacation/dailyroundup/`, sdata).then(result => {
|
||||
console.log(dailyfiles.value[0], '----------------');
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
return {
|
||||
visiting,
|
||||
excelOp,
|
||||
|
||||
@@ -221,23 +221,8 @@ class DailyRoundUpAPIView(APIView):
|
||||
# df.to_excel(table)
|
||||
|
||||
|
||||
# def all_books(request):
|
||||
# file_path = 'media/DailyRoundUp.xlsx'
|
||||
# workbook = load_workbook(filename=file_path)
|
||||
# worksheet = workbook.active
|
||||
|
||||
# books = []
|
||||
# skip_first_row = True
|
||||
# for row in worksheet.iter_rows(values_only=True, min_row=2 if skip_first_row else 1):
|
||||
# book = {
|
||||
# 'book_id': int(row[0]),
|
||||
# 'title': row[1],
|
||||
# 'author': row[2],
|
||||
# 'genre': row[3],
|
||||
# 'year': int(row[4]),
|
||||
# 'description': row[5],
|
||||
# 'cover': row[6]
|
||||
# }
|
||||
# books.append(book)
|
||||
|
||||
# return render(request, 'books.html', {'books': books})
|
||||
def post(self, request):
|
||||
file = request.data['dailyfiles']
|
||||
df = pd.read_excel(file)
|
||||
print(df)
|
||||
return Response('')
|
||||
Reference in new issue
Block a user