Sfoglia il codice sorgente

Search log screens - properties only

master
George Williams 5 anni fa
parent
commit
be7e5447d9

+ 5
- 0
package-lock.json Vedi File

7793
         }
7793
         }
7794
       }
7794
       }
7795
     },
7795
     },
7796
+    "moment": {
7797
+      "version": "2.24.0",
7798
+      "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
7799
+      "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
7800
+    },
7796
     "move-concurrently": {
7801
     "move-concurrently": {
7797
       "version": "1.0.1",
7802
       "version": "1.0.1",
7798
       "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
7803
       "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",

+ 1
- 0
package.json Vedi File

17
     "jquery": "^3.4.1",
17
     "jquery": "^3.4.1",
18
     "lodash": "^4.17.15",
18
     "lodash": "^4.17.15",
19
     "material-design-icons-iconfont": "^3.0.3",
19
     "material-design-icons-iconfont": "^3.0.3",
20
+    "moment": "^2.24.0",
20
     "node-sass": "^4.12.0",
21
     "node-sass": "^4.12.0",
21
     "roboto-fontface": "*",
22
     "roboto-fontface": "*",
22
     "sass-loader": "^7.3.1",
23
     "sass-loader": "^7.3.1",

+ 87
- 0
src/components/admin/logs/SearchLogs.vue Vedi File

1
+<template>
2
+  <!-- eslint-disable max-len -->
3
+  <div>
4
+    <div class="container">
5
+      <!-- <section class="intro-single"> -->
6
+      <div class="container">
7
+        <br />
8
+        <br />
9
+        <br />
10
+        <br />
11
+        <div class="row">
12
+          <div class="col-md-12 col-lg-8">
13
+            <div class="title-box-d">
14
+              <h1 class="title-d" style="text-align:left; font-size: 250%">Search Log</h1>
15
+            </div>
16
+          </div>
17
+        </div>
18
+      </div>
19
+      <!-- </section> -->
20
+    </div>
21
+    <div class="container">
22
+      <table class="table table-bordered">
23
+        <thead>
24
+          <tr>
25
+            <th>Date</th>
26
+            <th>Time</th>
27
+            <th>User</th>
28
+            <th>Keyword</th>
29
+            <th>Sales Type</th>
30
+            <th>Property Usage Type</th>
31
+            <th>Property Type</th>
32
+            <th>Province</th>
33
+            <th>City</th>
34
+            <th>Suburb</th>
35
+          </tr>
36
+        </thead>
37
+        <tbody>
38
+          <tr v-for="(item, i) in propertySearch" :key="i">
39
+            <td>{{ formatDate(item.date) }}</td>
40
+            <td>{{ formatTime(item.date) }}</td>
41
+            <td v-if="item.user">{{ item.user }}</td>
42
+            <td v-else>No User</td>
43
+            <td>{{ item.keyword === 'All' ? '' : item.keyword }}</td>
44
+            <td>{{ item.salesType === 'All' ? '' : item.salesType }}</td>
45
+            <td>{{ item.propertyUsageType === 'All' ? '' : item.propertyUsageType }}</td>
46
+            <td>{{ item.propertyType === 'All' ? '' : item.propertyType }}</td>
47
+            <td>{{ item.province === 'All' ? '' : item.province }}</td>
48
+            <td>{{ item.city === 'All' ? '' : item.city }}</td>
49
+            <td>{{ item.suburb === 'All' ? '' : item.suburb }}</td>
50
+          </tr>
51
+        </tbody>
52
+      </table>
53
+    </div>
54
+    <br />
55
+  </div>
56
+</template>
57
+
58
+<script>
59
+import { mapState, mapActions } from 'vuex';
60
+import moment from 'moment';
61
+import Vue from 'vue';
62
+import excel from 'vue-excel-export';
63
+
64
+Vue.use(excel);
65
+
66
+export default {
67
+  name: 'searchLog',
68
+  data() {
69
+    return {};
70
+  },
71
+  methods: {
72
+    ...mapActions('searchLog', ['getPropertySearchLogs']),
73
+    formatDate(value) {
74
+      return moment(String(value)).format('YYYY/MM/DD');
75
+    },
76
+    formatTime(value) {
77
+      return moment(String(value)).format('hh:mm');
78
+    },
79
+  },
80
+  mounted() {
81
+    this.getPropertySearchLogs();
82
+  },
83
+  computed: {
84
+    ...mapState('searchLog', ['propertySearch']),
85
+  },
86
+};
87
+</script>

+ 9
- 2
src/components/property/propertyList.vue Vedi File

49
             <td v-html="item.size" />
49
             <td v-html="item.size" />
50
             <td>{{ item.price }}</td>
50
             <td>{{ item.price }}</td>
51
             <td>{{ item.type }}</td>
51
             <td>{{ item.type }}</td>
52
-            <td>{{ item.publish }}</td>
52
+            <!-- <td>{{ item.publish }}</td> -->
53
+            <td></td>
53
             <td>{{ item.status }}</td>
54
             <td>{{ item.status }}</td>
54
             <td>
55
             <td>
55
               <button
56
               <button
57
                 @click="Edit(item)"
58
                 @click="Edit(item)"
58
                 class="btn btn-b-n"
59
                 class="btn btn-b-n"
59
                 style="width: 85px; height:40px;"
60
                 style="width: 85px; height:40px;"
61
+                disabled
60
               >Edit</button>
62
               >Edit</button>
61
             </td>
63
             </td>
62
             <td>
64
             <td>
63
-              <button type="button" class="btn btn-b-n" style="width: 85px; height:40px;">Delete</button>
65
+              <button
66
+                type="button"
67
+                class="btn btn-b-n"
68
+                style="width: 85px; height:40px;"
69
+                disabled
70
+              >Delete</button>
64
             </td>
71
             </td>
65
           </tr>
72
           </tr>
66
         </tbody>
73
         </tbody>

+ 5
- 0
src/components/shared/navBar.vue Vedi File

174
                   class="dropdown-item cursor-pointer"
174
                   class="dropdown-item cursor-pointer"
175
                   @click="routerGoTo('/propertyTypes/list')"
175
                   @click="routerGoTo('/propertyTypes/list')"
176
                 >Property Types</a>
176
                 >Property Types</a>
177
+                <a
178
+                  class="dropdown-item cursor-pointer"
179
+                  @click="routerGoTo('/searchLog')"
180
+                >Search Logs</a>
181
+                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Offers')">Offers</a>
177
               </div>
182
               </div>
178
             </li>
183
             </li>
179
             <li class="nav-item dropdown">
184
             <li class="nav-item dropdown">

+ 6
- 0
src/router/index.js Vedi File

40
 
40
 
41
 import MakeOffer from '../components/processFlow/makeOffer.vue';
41
 import MakeOffer from '../components/processFlow/makeOffer.vue';
42
 import Offer from '../components/processFlow/offers.vue';
42
 import Offer from '../components/processFlow/offers.vue';
43
+import searchLog from '../components/admin/logs/SearchLogs.vue';
43
 // import store from '../store';
44
 // import store from '../store';
44
 
45
 
45
 Vue.use(Router);
46
 Vue.use(Router);
221
       name: 'TimeshareSearch',
222
       name: 'TimeshareSearch',
222
       component: TimeshareSearch,
223
       component: TimeshareSearch,
223
     },
224
     },
225
+    {
226
+      path: '/searchLog',
227
+      name: 'SearchLog',
228
+      component: searchLog,
229
+    },
224
   ],
230
   ],
225
 });
231
 });

+ 2
- 0
src/store/index.js Vedi File

18
 import Bid from './modules/processFlow/bid';
18
 import Bid from './modules/processFlow/bid';
19
 import Authentication from './modules/user/authentication';
19
 import Authentication from './modules/user/authentication';
20
 import PropertySearch from './modules/property/propertySearch';
20
 import PropertySearch from './modules/property/propertySearch';
21
+import SearchLog from './modules/logs/searchLog';
21
 
22
 
22
 Vue.use(Vuex);
23
 Vue.use(Vuex);
23
 /* eslint no-param-reassign: ["error", { "props": false }] */
24
 /* eslint no-param-reassign: ["error", { "props": false }] */
41
     bid: Bid,
42
     bid: Bid,
42
     authentication: Authentication,
43
     authentication: Authentication,
43
     propertySearch: PropertySearch,
44
     propertySearch: PropertySearch,
45
+    searchLog: SearchLog,
44
   },
46
   },
45
 });
47
 });

+ 24
- 0
src/store/modules/logs/searchLog.js Vedi File

1
+// api/searchLog/property
2
+import axios from 'axios';
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    propertySearch: {},
8
+  },
9
+  mutations: {
10
+    updateSearch(state, data) {
11
+      state.propertySearch = [];
12
+      state.propertySearch = data;
13
+    },
14
+  },
15
+  getters: {},
16
+  actions: {
17
+    getPropertySearchLogs({ commit }) {
18
+      axios
19
+        .get('/api/searchLog/property')
20
+        .then(result => commit('updateSearch', result.data))
21
+        .catch(console.error);
22
+    },
23
+  },
24
+};

+ 1
- 1
src/store/modules/property/propertyLists.js Vedi File

14
   actions: {
14
   actions: {
15
     getProperties({ commit }, item) {
15
     getProperties({ commit }, item) {
16
       axios
16
       axios
17
-        .get(`/api/property/${item.propertyType}/${item.user}`)
17
+        .get(`/api/property/${item.propertyType}/All`) // .get(`/api/property/${item.propertyType}/${item.user}`)
18
         .then(result => commit('setProperties', result.data))
18
         .then(result => commit('setProperties', result.data))
19
         .catch(console.error);
19
         .catch(console.error);
20
     },
20
     },

Loading…
Annulla
Salva