parent
0ecda66057
commit
ab8ad7873f
@ -1,25 +1,61 @@
|
||||
<script setup>
|
||||
function OnClick()
|
||||
{
|
||||
document.getElementById('myid').click()
|
||||
import {watchEffect, onMounted} from "vue";
|
||||
const props = defineProps(['description'])
|
||||
|
||||
function DescriptionToHTML(description) {
|
||||
let html = "";
|
||||
const words = description.split('/');
|
||||
for (let i in words) {
|
||||
html += words[i] + '<br>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
onMounted(() => {
|
||||
watchEffect(() => {
|
||||
document.getElementById('description').innerHTML = DescriptionToHTML(props.description);
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="event-description">
|
||||
<button @click="OnClick">
|
||||
open file selection
|
||||
</button>
|
||||
<form>
|
||||
<input type="file" style="display:none" id="myid"/>
|
||||
</form>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="title">
|
||||
event<br>description
|
||||
</div>
|
||||
<div id="description">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.event-description {
|
||||
@import url('https://fonts.googleapis.com/css2?family=Itim&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=ZCOOL+QingKe+HuangYou&display=swap');
|
||||
.container {
|
||||
width: 20.33%;
|
||||
height: 100%;
|
||||
background-color: #537045A5;
|
||||
background-color: #718B64;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.title {
|
||||
font-size: 40px;
|
||||
height: 8.3vh;
|
||||
width: 13.46vw;
|
||||
background-color: #58767C;
|
||||
margin-top: 5.3vh;
|
||||
font-family: Itim,serif;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
#description {
|
||||
font-size: 40px;
|
||||
margin-top: 5.3vh;
|
||||
text-align: center;
|
||||
font-family: "ZCOOL QingKe HuangYou",serif;
|
||||
}
|
||||
</style>
|
@ -1,10 +0,0 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,64 @@
|
||||
<script setup>
|
||||
function select()
|
||||
{
|
||||
let file_input = document.getElementById("file-input")
|
||||
file_input.click();
|
||||
}
|
||||
function upload()
|
||||
{
|
||||
let file_input = document.getElementById("file-input")
|
||||
const formData = new FormData();
|
||||
formData.append("file", file_input.files[0]);
|
||||
console.log(file_input.files[0]);
|
||||
fetch("http://localhost:8000/api/post/upload_stu_info", {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container">
|
||||
<button class="file-selector" @click="select">select file</button>
|
||||
<form>
|
||||
<input type="file" id="file-input" accept=".csv">
|
||||
<button type="submit" class="submit-button" @click.prevent="upload">U<br>P<br>L<br>O<br>A<br>D</button>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap');
|
||||
|
||||
.container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: #2F3B4A;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.file-selector {
|
||||
margin-top: 3.5vh;
|
||||
width: 6.94vw;
|
||||
height: 4.3vh;
|
||||
border-radius: 20px;
|
||||
font-size: 1.25rem;
|
||||
font-family: Itim,serif;
|
||||
background-color: #BE8A7D;
|
||||
}
|
||||
#file-input {
|
||||
display: none;
|
||||
}
|
||||
.submit-button {
|
||||
margin-top: 3.5vh;
|
||||
width: 6.94vw;
|
||||
height: 80.3vh;
|
||||
border-radius: 30px;
|
||||
background-color: #2C3031;
|
||||
border: 3px solid #2C3031;
|
||||
font-size: 6rem;
|
||||
text-align: center;
|
||||
font-family: Kalam,serif;
|
||||
line-height: 140px;
|
||||
}
|
||||
</style>
|
@ -1,5 +1,5 @@
|
||||
import { createApp } from 'vue'
|
||||
import MenuSidebar from '../components/menu-sidebar.vue'
|
||||
import MenuSidebar from '../components/upload-panel.vue'
|
||||
|
||||
const app = createApp(MenuSidebar)
|
||||
app.mount('#menu-sidebar')
|
Loading…
Reference in new issue