Skip to content

Commit

Permalink
Inicialized project 1.5v
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoSweb committed Feb 19, 2024
1 parent 3deb7d3 commit 7cc837f
Show file tree
Hide file tree
Showing 40 changed files with 11,946 additions and 1,408 deletions.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Nuxt 3 Minimal Starter

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install the dependencies:

```bash
# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install
```

## Development Server

Start the development server on `http://localhost:3000`:

```bash
# npm
npm run dev

# pnpm
pnpm run dev

# yarn
yarn dev

# bun
bun run dev
```

## Production

Build the application for production:

```bash
# npm
npm run build

# pnpm
pnpm run build

# yarn
yarn build

# bun
bun run build
```

Locally preview production build:

```bash
# npm
npm run preview

# pnpm
pnpm run preview

# yarn
yarn preview

# bun
bun run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
17 changes: 17 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
<script>
export default {
name:'home page',
methods:{
chama: function(){
console.log('teste')
}
}
}
</script>
103 changes: 103 additions & 0 deletions components/activity/Form.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<template>
<section class="flex flex-col gap-4">
<label for="">Titulo</label>
<input
type="text"
name="plate"
v-model="title"
class="border border-[#00000040]"
/>
<label for="">Descrição</label>
<textarea
name="description"
id=""
cols="30"
rows="10"
class="border border-[#00000040]"
v-model="description"
></textarea>
<div class="flex gap-1">
<div class="flex w-1/2">
<label for="" class="mr-2">Envio</label>
<input
type="datetime-local"
name="shipping"
v-model="shipping"
class="flex-1 border border-[#00000040]"
/>
</div>
<div class="flex w-1/2">
<label for="" class="mr-2">Entrega</label>
<input
type="datetime-local"
name="delivery"
v-model="delivery"
class="flex-1 border border-[#00000040]"
/>
</div>
</div>
<div
@drop.prevent="dropFileOn"
@dragover.prevent
class="w-full h-[100px] bg-[#00000020] flex items-center justify-center"
>
Arraste e solte o arquivo nesta area
<slot></slot>
</div>
<div>
<button
@click="SendForm"
class="px-6 py-3 rounded-full bg-black text-white"
>
REGISTRAR
</button>
</div>
</section>
</template>

<script>
export default {
data() {
return {
title: "",
description: "",
delivery: "",
shipping: "",
file: "",
};
},
methods: {
dropFileOn(e) {
this.file = e.dataTransfer.files[0];
},
async SendForm() {
const options = {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
title: this.title,
description: this.description,
delivery: new Date(this.delivery),
shipping: new Date(this.shipping),
bimester_id: 1,
matter_id: 1,
}),
};
const res = await $fetch("http://localhost:8081/activity", options);
console.log(this.file)
const formData = new FormData();
formData.append('file', this.file);
formData.append('idRelation', res.activity.id);
formData.append('type', 'activity');
const upload = {
method: "POST",
body: formData
}
await $fetch("http://localhost:8081/archive", upload);
},
},
};
</script>

25 changes: 25 additions & 0 deletions components/login/Form.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<template>
<section class="flex flex-col gap-4">
<label for="">Matricula</label>
<input type="text" name="plate" v-model="plate" class="border border-[#00000040]">
<label for="">Senha</label>
<input type="password" name="password" v-model="password">
<div><button @click="SendForm" class="px-6 py-3 rounded-full bg-black text-white">ENTRAR</button></div>
</section>
</template>
<script>
export default {
data(){
return{
plate:'',
password:''
}
},
methods:{
SendForm: function(){
this.$store.commit('increment')
console.log('tett')
}
}
}
</script>
7 changes: 7 additions & 0 deletions composables/useFormation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function(){
const math = ref(0)
const exe = (num)=>{
math.value = num + num
}
return {exe,math}
}
8 changes: 8 additions & 0 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template>
<div>
<h5>teste</h5>
<slot>
</slot>

</div>
</template>
6 changes: 6 additions & 0 deletions middleware/number.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default function number(to, from){
const id = to.params.id
if(isNaN(id) || id < 0){
return navigateTo('/')
}
}
8 changes: 8 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
alias: {
css:'/<rootDir>/asserts/css'
},
modules: ['@nuxtjs/tailwindcss', '@nuxtjs/google-fonts'],
})
Loading

0 comments on commit 7cc837f

Please sign in to comment.