Parcourir la source

Search log screens - properties only

master
George Williams il y a 5 ans
Parent
révision
be7e5447d9

+ 5
- 0
package-lock.json Voir le fichier

@@ -7793,6 +7793,11 @@
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 7801
     "move-concurrently": {
7797 7802
       "version": "1.0.1",
7798 7803
       "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",

+ 1
- 0
package.json Voir le fichier

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

+ 87
- 0
src/components/admin/logs/SearchLogs.vue Voir le fichier

@@ -0,0 +1,87 @@
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 Voir le fichier

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

+ 5
- 0
src/components/shared/navBar.vue Voir le fichier

@@ -174,6 +174,11 @@
174 174
                   class="dropdown-item cursor-pointer"
175 175
                   @click="routerGoTo('/propertyTypes/list')"
176 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 182
               </div>
178 183
             </li>
179 184
             <li class="nav-item dropdown">

+ 6
- 0
src/router/index.js Voir le fichier

@@ -40,6 +40,7 @@ import PrivacyPolicy from '../components/misc/privacyPolicyPage.vue';
40 40
 
41 41
 import MakeOffer from '../components/processFlow/makeOffer.vue';
42 42
 import Offer from '../components/processFlow/offers.vue';
43
+import searchLog from '../components/admin/logs/SearchLogs.vue';
43 44
 // import store from '../store';
44 45
 
45 46
 Vue.use(Router);
@@ -221,5 +222,10 @@ export default new Router({
221 222
       name: 'TimeshareSearch',
222 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 Voir le fichier

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

+ 24
- 0
src/store/modules/logs/searchLog.js Voir le fichier

@@ -0,0 +1,24 @@
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 Voir le fichier

@@ -14,7 +14,7 @@ export default {
14 14
   actions: {
15 15
     getProperties({ commit }, item) {
16 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 18
         .then(result => commit('setProperties', result.data))
19 19
         .catch(console.error);
20 20
     },

Chargement…
Annuler
Enregistrer