Showing
3 changed files
with
101 additions
and
97 deletions
... | @@ -140,8 +140,8 @@ router.post('/makefolder', function(req, res, next) { | ... | @@ -140,8 +140,8 @@ router.post('/makefolder', function(req, res, next) { |
140 | console.log('insert error'); | 140 | console.log('insert error'); |
141 | res.status(400).send({ err: err }); | 141 | res.status(400).send({ err: err }); |
142 | } else { | 142 | } else { |
143 | - let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; | 143 | + let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name != ?;'; |
144 | - connection.query(checkfolder, [cur, user_id], function(err, rows, fields) { | 144 | + connection.query(checkfolder, [cur, user_id, 'trashcan'], function(err, rows, fields) { |
145 | console.log(rows); | 145 | console.log(rows); |
146 | res.status(200).send({ | 146 | res.status(200).send({ |
147 | folders: rows | 147 | folders: rows |
... | @@ -198,8 +198,8 @@ router.post('/delfolder', function(req, res, next) { | ... | @@ -198,8 +198,8 @@ router.post('/delfolder', function(req, res, next) { |
198 | console.log("updatesql error"); | 198 | console.log("updatesql error"); |
199 | res.status(304).send({ error: "updatesql error" }); | 199 | res.status(304).send({ error: "updatesql error" }); |
200 | } else { | 200 | } else { |
201 | - let resultsql = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; | 201 | + let resultsql = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name != ?;'; |
202 | - connection.query(resultsql, [cur, user_id], function(err, rows, fields) { | 202 | + connection.query(resultsql, [cur, user_id, 'trashcan'], function(err, rows, fields) { |
203 | res.status(200).send({ | 203 | res.status(200).send({ |
204 | folders: rows | 204 | folders: rows |
205 | }); | 205 | }); |
... | @@ -268,8 +268,8 @@ router.post('/move', function(req, res, next) { | ... | @@ -268,8 +268,8 @@ router.post('/move', function(req, res, next) { |
268 | console.log("updatesql error"); | 268 | console.log("updatesql error"); |
269 | res.status(304).send({ error: "updatesql error" }); | 269 | res.status(304).send({ error: "updatesql error" }); |
270 | } else { | 270 | } else { |
271 | - let resultsql = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; | 271 | + let resultsql = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name != ?;'; |
272 | - connection.query(resultsql, [cur, user_id], function(err, rows, fields) { | 272 | + connection.query(resultsql, [cur, user_id, 'trashcan'], function(err, rows, fields) { |
273 | res.status(200).send({ | 273 | res.status(200).send({ |
274 | folders: rows | 274 | folders: rows |
275 | }); | 275 | }); |
... | @@ -317,10 +317,10 @@ router.post('/move', function(req, res, next) { | ... | @@ -317,10 +317,10 @@ router.post('/move', function(req, res, next) { |
317 | if (err3) { | 317 | if (err3) { |
318 | res.status(304).send({ error: "updatesql error" }); | 318 | res.status(304).send({ error: "updatesql error" }); |
319 | } else { | 319 | } else { |
320 | - let resultsql = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; | 320 | + let resultsql = 'SELECT * FROM files WHERE location = ? AND user_id = ?;'; |
321 | connection.query(resultsql, [cur, user_id], function(err, rows, fields) { | 321 | connection.query(resultsql, [cur, user_id], function(err, rows, fields) { |
322 | res.status(200).send({ | 322 | res.status(200).send({ |
323 | - folders: rows | 323 | + files: rows |
324 | }); | 324 | }); |
325 | }); | 325 | }); |
326 | } | 326 | } |
... | @@ -407,8 +407,8 @@ router.get('/search', function(req, res, next) { | ... | @@ -407,8 +407,8 @@ router.get('/search', function(req, res, next) { |
407 | console.log(target); | 407 | console.log(target); |
408 | let folders = [] | 408 | let folders = [] |
409 | let files = [] | 409 | let files = [] |
410 | - let checkfolder = 'SELECT * FROM folders WHERE folder_name LIKE ' + target + ' AND user_id = ?;'; | 410 | + let checkfolder = 'SELECT * FROM folders WHERE folder_name LIKE ' + target + ' AND user_id = ? AND folder_name != ?;'; |
411 | - connection.query(checkfolder, [user_id], function(err, folder, fields) { | 411 | + connection.query(checkfolder, [user_id, 'trashcan'], function(err, folder, fields) { |
412 | console.log(folder); | 412 | console.log(folder); |
413 | folders.push(folder) | 413 | folders.push(folder) |
414 | let checkfile = 'SELECT * FROM files WHERE file_name LIKE ' + target + ' AND user_id = ?;'; | 414 | let checkfile = 'SELECT * FROM files WHERE file_name LIKE ' + target + ' AND user_id = ?;'; | ... | ... |
... | @@ -69,7 +69,7 @@ | ... | @@ -69,7 +69,7 @@ |
69 | </v-list> | 69 | </v-list> |
70 | </v-menu> | 70 | </v-menu> |
71 | <v-menu | 71 | <v-menu |
72 | - v-model="showMenu" | 72 | + v-model="showMenuF" |
73 | :position-x="x" | 73 | :position-x="x" |
74 | :position-y="y" | 74 | :position-y="y" |
75 | absolute | 75 | absolute |
... | @@ -111,6 +111,9 @@ export default { | ... | @@ -111,6 +111,9 @@ export default { |
111 | return { | 111 | return { |
112 | curfName: {}, | 112 | curfName: {}, |
113 | showMenu: false, | 113 | showMenu: false, |
114 | + search: '', | ||
115 | + x: 0, | ||
116 | + y: 0, | ||
114 | cfilename: {}, | 117 | cfilename: {}, |
115 | showMenuF: false, | 118 | showMenuF: false, |
116 | }; | 119 | }; |
... | @@ -126,6 +129,7 @@ export default { | ... | @@ -126,6 +129,7 @@ export default { |
126 | try { | 129 | try { |
127 | const id = this.$store.state.id; | 130 | const id = this.$store.state.id; |
128 | const response = await showTrashcan(id); | 131 | const response = await showTrashcan(id); |
132 | + console.log(response.data); | ||
129 | this.$store.commit('settrashFolderList', response.data.folders); | 133 | this.$store.commit('settrashFolderList', response.data.folders); |
130 | this.$store.commit('settrashFileList', response.data.files); | 134 | this.$store.commit('settrashFileList', response.data.files); |
131 | } catch (error) { | 135 | } catch (error) { | ... | ... |
... | @@ -4,89 +4,89 @@ import Vuex from 'vuex'; | ... | @@ -4,89 +4,89 @@ import Vuex from 'vuex'; |
4 | Vue.use(Vuex); | 4 | Vue.use(Vuex); |
5 | 5 | ||
6 | export default new Vuex.Store({ | 6 | export default new Vuex.Store({ |
7 | - state: { | 7 | + state: { |
8 | - id: '', | 8 | + id: '', |
9 | - folders: [], | 9 | + folders: [], |
10 | - files: [], | 10 | + files: [], |
11 | - cur: '/', | 11 | + cur: '/', |
12 | - parent: '/', | 12 | + parent: '/', |
13 | - recentList: [], | 13 | + recentList: [], |
14 | - favFolderList: [], | 14 | + favFolderList: [], |
15 | - favFileList: [], | 15 | + favFileList: [], |
16 | - trashFolderList: [], | 16 | + trashFolderList: [], |
17 | - trashFileList: [], | 17 | + trashFileList: [], |
18 | - }, | 18 | + }, |
19 | - mutations: { | 19 | + mutations: { |
20 | - setId(state, userid) { | 20 | + setId(state, userid) { |
21 | - state.id = userid; | 21 | + state.id = userid; |
22 | - }, | 22 | + }, |
23 | - clearid(state) { | 23 | + clearid(state) { |
24 | - state.id = ''; | 24 | + state.id = ''; |
25 | - }, | 25 | + }, |
26 | - setFolder(state, folderlist) { | 26 | + setFolder(state, folderlist) { |
27 | - state.folders = folderlist; | 27 | + state.folders = folderlist; |
28 | - }, | 28 | + }, |
29 | - setFile(state, filelist) { | 29 | + setFile(state, filelist) { |
30 | - state.files = filelist; | 30 | + state.files = filelist; |
31 | - }, | 31 | + }, |
32 | - setCur(state, cur) { | 32 | + setCur(state, cur) { |
33 | - state.cur = cur; | 33 | + state.cur = cur; |
34 | - }, | 34 | + }, |
35 | - setParent(state, parent) { | 35 | + setParent(state, parent) { |
36 | - state.parent = parent; | 36 | + state.parent = parent; |
37 | - }, | 37 | + }, |
38 | - setRecentList(state, list) { | 38 | + setRecentList(state, list) { |
39 | - state.recentList = list; | 39 | + state.recentList = list; |
40 | - }, | 40 | + }, |
41 | - setfavFolderList(state, fflist) { | 41 | + setfavFolderList(state, fflist) { |
42 | - state.favFolderList = fflist; | 42 | + state.favFolderList = fflist; |
43 | - }, | 43 | + }, |
44 | - setfavFileList(state, fflist) { | 44 | + setfavFileList(state, fflist) { |
45 | - state.favFileList = fflist; | 45 | + state.favFileList = fflist; |
46 | - }, | 46 | + }, |
47 | - settrashFolderList(state, tflist) { | 47 | + settrashFolderList(state, tflist) { |
48 | - state.trashFolderList = tflist; | 48 | + state.trashFolderList = tflist; |
49 | - }, | 49 | + }, |
50 | - settrashFileList(state, tflist) { | 50 | + settrashFileList(state, tflist) { |
51 | - state.trashFileList = tflist; | 51 | + state.trashFileList = tflist; |
52 | - }, | 52 | + }, |
53 | - }, | 53 | + }, |
54 | - getters: { | 54 | + getters: { |
55 | - isLogin(state) { | 55 | + isLogin(state) { |
56 | - return state.id !== ''; | 56 | + return state.id !== ''; |
57 | - }, | 57 | + }, |
58 | - userID(state) { | 58 | + userID(state) { |
59 | - return state.id; | 59 | + return state.id; |
60 | - }, | 60 | + }, |
61 | - folderL(state) { | 61 | + folderL(state) { |
62 | - return state.folders; | 62 | + return state.folders; |
63 | - }, | 63 | + }, |
64 | - fileL(state) { | 64 | + fileL(state) { |
65 | - return state.files; | 65 | + return state.files; |
66 | - }, | 66 | + }, |
67 | - recentL(state) { | 67 | + recentL(state) { |
68 | - return state.recentList; | 68 | + return state.recentList; |
69 | - }, | 69 | + }, |
70 | - cur(state) { | 70 | + cur(state) { |
71 | - return state.cur; | 71 | + return state.cur; |
72 | - }, | 72 | + }, |
73 | - setFolder(state, folderlist) { | 73 | + setFolder(state, folderlist) { |
74 | - state.folders = folderlist; | 74 | + state.folders = folderlist; |
75 | - }, | 75 | + }, |
76 | - setFile(state, filelist) { | 76 | + setFile(state, filelist) { |
77 | - state.files = filelist; | 77 | + state.files = filelist; |
78 | - }, | 78 | + }, |
79 | - favFolderL(state) { | 79 | + favFolderL(state) { |
80 | - return state.favFolderList; | 80 | + return state.favFolderList; |
81 | - }, | 81 | + }, |
82 | - favFileL(state) { | 82 | + favFileL(state) { |
83 | - return state.favFileList; | 83 | + return state.favFileList; |
84 | - }, | 84 | + }, |
85 | - trashFolderL(state) { | 85 | + trashFolderL(state) { |
86 | - return state.trashFolderList; | 86 | + return state.trashFolderList; |
87 | - }, | 87 | + }, |
88 | - trashFileL(state) { | 88 | + trashFileL(state) { |
89 | - return state.trashFolderList; | 89 | + return state.trashFileList; |
90 | - }, | 90 | + }, |
91 | - }, | 91 | + }, |
92 | -}); | 92 | +}); |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment