박기범

add recent access list

1 +<template lang="html">
2 + <v-flex>
3 + <h1>빠른액세스</h1>
4 + <v-simple-table>
5 + <template v-slot:default>
6 + <thead>
7 + <tr>
8 + <th class="text-left">Name</th>
9 + <th class="text-left">Date</th>
10 + </tr>
11 + </thead>
12 + <tbody>
13 + <tr v-for="item in recent_list" :key="item.name">
14 + <td>{{ item.file_id }}</td>
15 + <td>{{ item.file_name}}</td>
16 + <td>{{ item.location }}</td>
17 + <td>{{ item.date }}</td>
18 + </tr>
19 + </tbody>
20 + </template>
21 + </v-simple-table>
22 + <v-divider></v-divider>
23 + </v-flex>
24 +</template>
25 +
26 +<script>
27 + import { accessed_list } from '../api/index';
28 + import Axios from 'axios';
29 + export default {
30 + data() {
31 + return {
32 + recent_list = []
33 + }
34 + },
35 + async created(){
36 + try {
37 + const curData = {
38 + id : this.$store.state.id,
39 + }
40 + console.log(curData);
41 + const list_reponse = await accessed_list(curData);
42 + this.$store.commit('setRecentList', list_reponse.data)
43 + this.recent_list = this.$stroe.getters.recentL;
44 + console.log(this.$store.getters.recentL);
45 + } catch (error) {
46 + console.log("에러");
47 + console.log(error);
48 + }
49 + },
50 + methods:{
51 +
52 + }
53 + }
54 +</script>
55 +
56 +<style lang="css" scoped>
57 +</style>
...@@ -9,7 +9,8 @@ export default new Vuex.Store({ ...@@ -9,7 +9,8 @@ export default new Vuex.Store({
9 folders: [], 9 folders: [],
10 files: [], 10 files: [],
11 cur: '/', 11 cur: '/',
12 - parent: '/' 12 + parent: '/',
13 + recentList:[]
13 }, 14 },
14 mutations: { 15 mutations: {
15 setId(state, userid) { 16 setId(state, userid) {
...@@ -29,6 +30,9 @@ export default new Vuex.Store({ ...@@ -29,6 +30,9 @@ export default new Vuex.Store({
29 }, 30 },
30 setParent(state, parent) { 31 setParent(state, parent) {
31 state.parent = parent; 32 state.parent = parent;
33 + },
34 + setRecentList(state, list){
35 + state.recentList = list;
32 } 36 }
33 }, 37 },
34 getters: { 38 getters: {
...@@ -44,6 +48,9 @@ export default new Vuex.Store({ ...@@ -44,6 +48,9 @@ export default new Vuex.Store({
44 fileL(state) { 48 fileL(state) {
45 return state.files; 49 return state.files;
46 }, 50 },
51 + recentL(state){
52 + return state.recentList;
53 + },
47 cur(state) { 54 cur(state) {
48 return state.cur; 55 return state.cur;
49 }, 56 },
......
...@@ -20,26 +20,9 @@ ...@@ -20,26 +20,9 @@
20 <v-spacer></v-spacer> 20 <v-spacer></v-spacer>
21 </v-flex> 21 </v-flex>
22 <v-flex><br><v-divider></v-divider><br></v-flex> 22 <v-flex><br><v-divider></v-divider><br></v-flex>
23 - <v-flex> 23 + <v-container>
24 - <h1>빠른액세스</h1> 24 +
25 - <v-simple-table> 25 + </v-container>
26 - <template v-slot:default>
27 - <thead>
28 - <tr>
29 - <th class="text-left">Name</th>
30 - <th class="text-left">Date</th>
31 - </tr>
32 - </thead>
33 - <tbody>
34 - <tr v-for="item in favorite" :key="item.name">
35 - <td>{{ item.name }}</td>
36 - <td>{{ item.date }}</td>
37 - </tr>
38 - </tbody>
39 - </template>
40 - </v-simple-table>
41 - <v-divider></v-divider>
42 - </v-flex>
43 </v-flex> 26 </v-flex>
44 <v-flex><br><v-divider></v-divider><br></v-flex> 27 <v-flex><br><v-divider></v-divider><br></v-flex>
45 <v-flex xs6> 28 <v-flex xs6>
...@@ -72,6 +55,7 @@ ...@@ -72,6 +55,7 @@
72 55
73 56
74 <script> 57 <script>
58 + import Filecard from '@/components/accessList.vue'
75 export default { 59 export default {
76 data () { 60 data () {
77 return { 61 return {
......