Przeglądaj źródła

Merge fixes

master
George Williams 5 lat temu
rodzic
commit
bfeca367a9

+ 7
- 0
public/css/dragndrop.table.columns.css Wyświetl plik

@@ -0,0 +1,7 @@
1
+body {
2
+    background-color: #f9f9f9
3
+}
4
+
5
+.container {
6
+    margin-top: 20px;
7
+}

+ 6
- 2
public/index.html Wyświetl plik

@@ -16,6 +16,7 @@
16 16
   <link href="lib/ionicons/css/ionicons.min.css" rel="stylesheet">
17 17
   <link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
18 18
   <link href="css/style.css" rel="stylesheet">
19
+  <link rel="stylesheet" href="css/dragndrop.table.columns.css" />
19 20
 </head>
20 21
 
21 22
 <body>
@@ -32,7 +33,10 @@
32 33
 <script src="lib/easing/easing.min.js"></script>
33 34
 <script src="lib/owlcarousel/owl.carousel.min.js"></script>
34 35
 <script src="lib/scrollreveal/scrollreveal.min.js"></script>
35
-
36
+<script src="js/dragndrop.table.columns.js" type="text/javascript"></script>
36 37
 <script src="js/main.js"></script>
38
+<script>
39
+  $('.table').dragableColumns();
40
+</script>
37 41
 
38
-</html>
42
+</html>

+ 137
- 0
public/js/dragndrop.table.columns.js Wyświetl plik

@@ -0,0 +1,137 @@
1
+/* global $:false, jQuery:false */
2
+/*
3
+Drag & Drop Table Columns v.3.1.5
4
+for jQuery 3.x
5
+by Oleksandr Nikitin (a.nikitin@i.ua)
6
+https://github.com/alexshnur/drag-n-drop-table-columns
7
+*/
8
+(function ($, window) {
9
+  let cols;
10
+  let dragSrcEl = null;
11
+  let dragSrcEnter = null;
12
+  let dragableColumns;
13
+  let
14
+    _this;
15
+
16
+  function insertAfter(elem, refElem) {
17
+    return refElem.parentNode.insertBefore(elem, refElem.nextSibling);
18
+  }
19
+
20
+  function isIE() {
21
+    const nav = navigator.userAgent.toLowerCase();
22
+    return (nav.indexOf('msie') !== -1) ? parseInt(nav.split('msie')[1]) : false;
23
+  }
24
+
25
+  dragableColumns = (function () {
26
+    let $table;
27
+
28
+    function dragColumns(table, options) {
29
+      _this = this;
30
+      $table = table;
31
+      _this.options = $.extend({}, _this.options, options);
32
+      if (_this.options.drag) {
33
+        if (isIE() === 9) {
34
+          $table.find('thead tr th').each(function () {
35
+            if ($(this).find('.drag-ie').length === 0) {
36
+              $(this).html($('<a>').html($(this).html()).attr('href', '#').addClass(
37
+                'drag-ie',
38
+              ));
39
+            }
40
+          });
41
+        }
42
+        cols = $table.find('thead tr th');
43
+
44
+        jQuery.event.addProp('dataTransfer');
45
+        [].forEach.call(cols, (col) => {
46
+          col.setAttribute('draggable', true);
47
+
48
+          $(col).on('dragstart', _this.handleDragStart);
49
+          $(col).on('dragenter', _this.handleDragEnter);
50
+          $(col).on('dragover', _this.handleDragOver);
51
+          $(col).on('dragleave', _this.handleDragLeave);
52
+          $(col).on('drop', _this.handleDrop);
53
+          $(col).on('dragend', _this.handleDragEnd);
54
+        });
55
+      }
56
+    }
57
+
58
+    dragColumns.prototype = {
59
+      options: {
60
+        drag: true,
61
+        dragClass: 'drag',
62
+        overClass: 'over',
63
+        movedContainerSelector: '.dnd-moved',
64
+      },
65
+      handleDragStart(e) {
66
+        $(this).addClass(_this.options.dragClass);
67
+        dragSrcEl = this;
68
+        e.dataTransfer.effectAllowed = 'copy';
69
+        e.dataTransfer.setData('text/html', this.id);
70
+      },
71
+      handleDragOver(e) {
72
+        if (e.preventDefault) {
73
+          e.preventDefault();
74
+        }
75
+        e.dataTransfer.dropEffect = 'copy';
76
+      },
77
+      handleDragEnter(e) {
78
+        dragSrcEnter = this;
79
+        [].forEach.call(cols, (col) => {
80
+          $(col).removeClass(_this.options.overClass);
81
+        });
82
+        $(this).addClass(_this.options.overClass);
83
+      },
84
+      handleDragLeave(e) {
85
+        if (dragSrcEnter !== e) {
86
+          // this.classList.remove(_this.options.overClass);
87
+        }
88
+      },
89
+      handleDrop(e) {
90
+        if (e.stopPropagation) {
91
+          e.stopPropagation();
92
+        }
93
+        if (dragSrcEl !== e) {
94
+          _this.moveColumns($(dragSrcEl).index(), $(this).index());
95
+        }
96
+      },
97
+      handleDragEnd(e) {
98
+        const colPositions = {
99
+          array: [],
100
+          object: {},
101
+        };
102
+        [].forEach.call(cols, (col) => {
103
+          const name = $(col).attr('data-name') || $(col).index();
104
+          $(col).removeClass(_this.options.overClass);
105
+          colPositions.object[name] = $(col).index();
106
+          colPositions.array.push($(col).index());
107
+        });
108
+        if (typeof _this.options.onDragEnd === 'function') {
109
+          _this.options.onDragEnd(colPositions);
110
+        }
111
+        $(dragSrcEl).removeClass(_this.options.dragClass);
112
+      },
113
+      moveColumns(fromIndex, toIndex) {
114
+        const rows = $table.find(_this.options.movedContainerSelector);
115
+        for (let i = 0; i < rows.length; i++) {
116
+          if (toIndex > fromIndex) {
117
+            insertAfter(rows[i].children[fromIndex], rows[i].children[toIndex]);
118
+          } else if (toIndex < $table.find('thead tr th').length - 1) {
119
+            rows[i].insertBefore(rows[i].children[fromIndex], rows[i].children[toIndex]);
120
+          }
121
+        }
122
+      },
123
+    };
124
+
125
+    return dragColumns;
126
+  }());
127
+
128
+  return $.fn.extend({
129
+    dragableColumns() {
130
+      const option = (arguments[0]);
131
+      return this.each(function () {
132
+        const $table = $(this);
133
+        new dragableColumns($table, option);
134
+      });
135
+    },
136
+  });
137
+}(window.jQuery, window));

+ 7
- 0
public/js/dragndrop.table.columns.min.js Wyświetl plik

@@ -0,0 +1,7 @@
1
+/*
2
+ Drag & Drop Table Columns v.3.1.5
3
+ for jQuery 3.x
4
+ by Oleksandr Nikitin (a.nikitin@i.ua)
5
+ https://github.com/alexshnur/drag-n-drop-table-columns
6
+ */
7
+!function(n,e){function t(n,e){return e.parentNode.insertBefore(n,e.nextSibling)}function a(){var n=navigator.userAgent.toLowerCase();return-1!==n.indexOf("msie")?parseInt(n.split("msie")[1]):!1}var r,o,d,i=null,s=null;return o=function(){function e(e,t){d=this,o=e,d.options=n.extend({},d.options,t),d.options.drag&&(9===a()&&o.find("thead tr th").each(function(){0===n(this).find(".drag-ie").length&&n(this).html(n("<a>").html(n(this).html()).attr("href","#").addClass("drag-ie"))}),r=o.find("thead tr th"),jQuery.event.addProp("dataTransfer"),[].forEach.call(r,function(e){e.setAttribute("draggable",!0),n(e).on("dragstart",d.handleDragStart),n(e).on("dragenter",d.handleDragEnter),n(e).on("dragover",d.handleDragOver),n(e).on("dragleave",d.handleDragLeave),n(e).on("drop",d.handleDrop),n(e).on("dragend",d.handleDragEnd)}))}var o;return e.prototype={options:{drag:!0,dragClass:"drag",overClass:"over",movedContainerSelector:".dnd-moved"},handleDragStart:function(e){n(this).addClass(d.options.dragClass),i=this,e.dataTransfer.effectAllowed="copy",e.dataTransfer.setData("text/html",this.id)},handleDragOver:function(n){n.preventDefault&&n.preventDefault(),n.dataTransfer.dropEffect="copy"},handleDragEnter:function(e){s=this,[].forEach.call(r,function(e){n(e).removeClass(d.options.overClass)}),n(this).addClass(d.options.overClass)},handleDragLeave:function(n){},handleDrop:function(e){e.stopPropagation&&e.stopPropagation(),i!==e&&d.moveColumns(n(i).index(),n(this).index())},handleDragEnd:function(e){var t={array:[],object:{}};[].forEach.call(r,function(e){var a=n(e).attr("data-name")||n(e).index();n(e).removeClass(d.options.overClass),t.object[a]=n(e).index(),t.array.push(n(e).index())}),"function"==typeof d.options.onDragEnd&&d.options.onDragEnd(t),n(i).removeClass(d.options.dragClass)},moveColumns:function(n,e){for(var a=o.find(d.options.movedContainerSelector),r=0;r<a.length;r++)e>n?t(a[r].children[n],a[r].children[e]):e<o.find("thead tr th").length-1&&a[r].insertBefore(a[r].children[n],a[r].children[e])}},e}(),n.fn.extend({dragableColumns:function(){var e=arguments[0];return this.each(function(){var t=n(this);new o(t,e)})}})}(window.jQuery,window);

+ 4
- 0
public/js/jquery-3.2.1.slim.min.js
Plik diff jest za duży
Wyświetl plik


+ 8
- 0
src/assets/staticData/alertTypes.js Wyświetl plik

@@ -0,0 +1,8 @@
1
+const types = Object.freeze({
2
+  SUCCESS: 'Success',
3
+  INFO: 'Info',
4
+  WARNING: 'Warning',
5
+  ERROR: 'Error',
6
+});
7
+
8
+export default types;

+ 7
- 0
src/assets/staticData/itemsPerPage.js Wyświetl plik

@@ -0,0 +1,7 @@
1
+const items = [
2
+  10,
3
+  20,
4
+  50,
5
+  100,
6
+];
7
+export default items;

+ 0
- 4
src/components/admin/logs/SearchLogs.vue Wyświetl plik

@@ -86,10 +86,6 @@
86 86
 <script>
87 87
 import { mapState, mapActions, mapGetters } from 'vuex';
88 88
 import moment from 'moment';
89
-import Vue from 'vue';
90
-import excel from 'vue-excel-export';
91
-
92
-Vue.use(excel);
93 89
 
94 90
 export default {
95 91
   name: 'searchLog',

+ 11
- 27
src/components/admin/unitConfiguration/unitConfigurationPage.vue Wyświetl plik

@@ -20,44 +20,28 @@
20 20
     </div>
21 21
     <!-- </section> -->
22 22
     <div class="container">
23
-      <table class="table table-bordered">
24
-        <thead>
25
-          <tr>
26
-            <th>Id</th>
27
-            <th>Code</th>
28
-            <th>Bedrooms</th>
29
-            <th>Adults</th>
30
-            <th>Children</th>
31
-          </tr>
32
-        </thead>
33
-        <tbody>
34
-          <tr v-for="(item, i) in unitConfigurationList" :key="i">
35
-            <td>{{item.id}}</td>
36
-            <td>{{item.code}}</td>
37
-            <td>{{item.bedrooms}}</td>
38
-            <td>{{item.adults}}</td>
39
-            <td>{{item.children}}</td>
40
-          </tr>
41
-        </tbody>
42
-      </table>
23
+      <ListView :items="unitConfigurationList" />
43 24
     </div>
44 25
   </div>
45 26
 </template>
46 27
 <script>
47
-import { mapState, mapActions } from 'vuex';
28
+import { mapState, mapActions } from "vuex";
29
+import ListView from "../../shared/listView.vue";
48 30
 
49 31
 export default {
50
-  name: 'UnitConfiguration',
32
+  name: "UnitConfiguration",
33
+  components: {
34
+    ListView
35
+  },
51 36
   created() {
52 37
     this.getUnitConfigurationList();
53 38
   },
54 39
   computed: {
55
-    ...mapState('unitConfiguration', ['unitConfigurationList']),
40
+    ...mapState("unitConfiguration", ["unitConfigurationList"])
56 41
   },
57 42
   methods: {
58
-    ...mapActions('unitConfiguration', ['getUnitConfigurationList']),
59
-  },
43
+    ...mapActions("unitConfiguration", ["getUnitConfigurationList"])
44
+  }
60 45
 };
61 46
 </script>
62
-<style>
63
-</style>
47
+<style></style>

+ 0
- 1
src/components/home/homePage.vue Wyświetl plik

@@ -8,7 +8,6 @@
8 8
     <a href="#" class="back-to-top">
9 9
       <i class="fa fa-chevron-up"></i>
10 10
     </a>
11
-    <div id="preloader"></div>
12 11
   </div>
13 12
 </template>
14 13
 <script>

+ 1
- 1
src/components/processFlow/makeOffer.vue Wyświetl plik

@@ -21,7 +21,7 @@
21 21
         <div class="form-group row">
22 22
           <div class="col-md-6 col-lg-5 section-md-t3">
23 23
             <div class="title-box-d">
24
-              <h3 class="title-d">{{ item.resort.resortName }}</h3>
24
+              <h3 class="title-d">{{ item ? item.resortName : '' }}</h3>
25 25
             </div>
26 26
           </div>
27 27
         </div>

+ 44
- 0
src/components/shared/alert.vue Wyświetl plik

@@ -0,0 +1,44 @@
1
+<template>
2
+  <div class="container">
3
+    <!-- eslint-disable max-len -->
4
+    <div class="alert alert-success" v-if="type === 'SUCCESS'">
5
+      <eva-icon name="checkmark-outline"></eva-icon>
6
+      <strong>{{ text }}</strong>
7
+    </div>
8
+    <div class="alert alert-info" v-if="type === 'INFO'">
9
+      <eva-icon name="info-outline"></eva-icon>
10
+      <strong>{{ text }}</strong>
11
+    </div>
12
+    <div class="alert alert-warning" v-if="type === 'WARNING'">
13
+      <eva-icon name="alert-circle-outline"></eva-icon>
14
+      <strong>{{ text }}</strong>
15
+    </div>
16
+    <div class="alert alert-danger" v-if="type === 'ERROR'">
17
+      <eva-icon name="slash-outline"></eva-icon>
18
+      <strong>{{ text }}</strong>
19
+    </div>
20
+  </div>
21
+</template>
22
+
23
+<script>
24
+export default {
25
+  name: 'Alert',
26
+  data() {
27
+    return {
28
+      alertTypes: {
29
+        SUCCESS: 'Success',
30
+        INFO: 'Info',
31
+        WARNING: 'Warning',
32
+        ERROR: 'Error',
33
+      },
34
+    };
35
+  },
36
+  props: {
37
+    text: null,
38
+    type: null,
39
+  },
40
+};
41
+</script>
42
+
43
+<style>
44
+</style>

+ 107
- 0
src/components/shared/basePagination.vue Wyświetl plik

@@ -0,0 +1,107 @@
1
+<template>
2
+  <div>
3
+    <nav>
4
+      <ul class="pagination">
5
+        <li class="page-item" v-if="isPreviousButtonDisabled" @click="previousPage">
6
+          <a class="page-link" href="#" aria-label="Previous">
7
+            <span aria-hidden="true">&laquo;</span>
8
+            <span class="sr-only">Previous</span>
9
+          </a>
10
+        </li>
11
+        <li class="page-item" v-for="item in paginationItems" :key="item">
12
+          <BasePaginationItem
13
+            :pageNumber="item"
14
+            :disable="item === currentPage"
15
+            @loadPage="onLoadPage"
16
+          />
17
+        </li>
18
+        <li class="page-item" v-if="isNextButtonDisabled" @click="nextPage">
19
+          <a class="page-link" href="#" aria-label="Next">
20
+            <span aria-hidden="true">&raquo;</span>
21
+            <span class="sr-only">Next</span>
22
+          </a>
23
+        </li>
24
+      </ul>
25
+    </nav>
26
+  </div>
27
+</template>
28
+<script>
29
+import BasePaginationItem from './basePaginationItem.vue';
30
+
31
+export default {
32
+  components: {
33
+    BasePaginationItem,
34
+  },
35
+  props: {
36
+    visiblePagesCount: {
37
+      type: Number,
38
+      default: 5,
39
+    },
40
+    currentPage: {
41
+      type: Number,
42
+      required: true,
43
+    },
44
+    pageCount: {
45
+      type: Number,
46
+      required: true,
47
+    },
48
+  },
49
+  computed: {
50
+    isPreviousButtonDisabled() {
51
+      return this.currentPage !== 1;
52
+    },
53
+    isNextButtonDisabled() {
54
+      return this.currentPage !== this.pageCount;
55
+    },
56
+    paginationItems() {
57
+      const { currentPage } = this;
58
+      const { pageCount } = this;
59
+      const { visiblePagesCount } = this;
60
+      let pagintationItemsArray = [];
61
+      if (pageCount <= visiblePagesCount) {
62
+        let count = 1;
63
+        while (count <= pageCount) {
64
+          pagintationItemsArray.push(count);
65
+          count += 1;
66
+        }
67
+        return pagintationItemsArray;
68
+      }
69
+      const visiblePagesThreshold = (visiblePagesCount - 1) / 2;
70
+      pagintationItemsArray = Array(this.visiblePagesCount - 1).fill(0);
71
+      if (currentPage <= visiblePagesThreshold + 1) {
72
+        pagintationItemsArray[0] = 1;
73
+        const pagintationItems = pagintationItemsArray.map(
74
+          (paginationTrigger, index) => pagintationItemsArray[0] + index,
75
+        );
76
+        pagintationItems.push(pageCount);
77
+        return pagintationItems;
78
+      }
79
+      if (currentPage >= pageCount - visiblePagesThreshold + 1) {
80
+        const pagintationItems = pagintationItemsArray.map(
81
+          (paginationTrigger, index) => pageCount - index,
82
+        );
83
+        pagintationItems.reverse().unshift(1);
84
+        return pagintationItems;
85
+      }
86
+      pagintationItemsArray[0] = currentPage - visiblePagesThreshold + 1;
87
+      const pagintationItems = pagintationItemsArray.map(
88
+        (paginationTrigger, index) => pagintationItemsArray[0] + index,
89
+      );
90
+      pagintationItems.unshift(1);
91
+      pagintationItems[pagintationItems.length - 1] = pageCount;
92
+      return pagintationItems;
93
+    },
94
+  },
95
+  methods: {
96
+    onLoadPage(value) {
97
+      this.$emit('loadPage', value);
98
+    },
99
+    nextPage() {
100
+      this.$emit('nextPage');
101
+    },
102
+    previousPage() {
103
+      this.$emit('previousPage');
104
+    },
105
+  },
106
+};
107
+</script>

+ 32
- 0
src/components/shared/basePaginationItem.vue Wyświetl plik

@@ -0,0 +1,32 @@
1
+<template>
2
+  <div>
3
+    <div v-if="disable">
4
+      <span class="page-link disabled">{{pageNumber}}</span>
5
+    </div>
6
+    <div v-else @click="onClick">
7
+      <a class="page-link">{{pageNumber}}</a>
8
+    </div>
9
+  </div>
10
+</template>
11
+<script>
12
+export default {
13
+  props: {
14
+    pageNumber: {
15
+      type: Number,
16
+      required: true,
17
+    },
18
+    disable: undefined,
19
+  },
20
+  methods: {
21
+    onClick() {
22
+      this.$emit('loadPage', this.pageNumber);
23
+    },
24
+  },
25
+};
26
+</script>
27
+<style scoped>
28
+.disabled {
29
+  cursor: arrow;
30
+  background-color: lightgray;
31
+}
32
+</style>

+ 187
- 0
src/components/shared/listView.vue Wyświetl plik

@@ -0,0 +1,187 @@
1
+/* eslint-disable no-restricted-syntax */
2
+/* eslint-disable guard-for-in */
3
+<template>
4
+  <div>
5
+    <div class="container">
6
+      <div class="row">
7
+        <div class="col-md-12">
8
+          <input
9
+            v-model="searchItem"
10
+            class="form-control"
11
+            placeholder="Filter users by name or age"
12
+          />
13
+          <table id="table" class="table table-bordered table-hover">
14
+            <thead>
15
+              <tr class="dnd-moved">
16
+                <th v-for="(column, c) in Columns" :key="c">
17
+                  <div @click="sortBy(column)">{{ column }}</div>
18
+                </th>
19
+              </tr>
20
+            </thead>
21
+            <tbody>
22
+              <tr v-for="(item, i) in DisplayItems" :key="i" class="text-left dnd-moved">
23
+                <td v-for="(column, c) in Columns" :key="c">{{ item[column] }}</td>
24
+              </tr>
25
+            </tbody>
26
+          </table>
27
+          <div class="d-flex justify-content-between">
28
+            <div class="p-1">{{ currentPage + ' / ' + PageCount }}</div>
29
+            <div class="p-1">
30
+              <BasePagination
31
+                :currentPage="currentPage"
32
+                :pageCount="PageCount"
33
+                @nextPage="pageChangeHandle('next')"
34
+                @previousPage="pageChangeHandle('previous')"
35
+                @loadPage="pageChangeHandle"
36
+              />
37
+            </div>
38
+            <div class="p-2">
39
+              <div class="d-flex flex-row">
40
+                <div>
41
+                  <select
42
+                    class="form-control"
43
+                    id="agent"
44
+                    name="agent"
45
+                    v-model="visibleItemsPerPageCount"
46
+                    @change="onChangeItemsPerPage()"
47
+                  >
48
+                    <option v-for="(item, i) in itemsPerPageList" :key="i">{{ item }}</option>
49
+                  </select>
50
+                </div>
51
+              </div>
52
+            </div>
53
+          </div>
54
+        </div>
55
+      </div>
56
+    </div>
57
+  </div>
58
+</template>
59
+
60
+<script>
61
+import _ from "lodash";
62
+import ItemsPerPageList from "../../assets/staticData/itemsPerPage";
63
+import BasePagination from "../shared/basePagination.vue";
64
+
65
+export default {
66
+  components: {
67
+    BasePagination
68
+  },
69
+  mounted() {
70
+    try {
71
+      // to assign initial value to itemsPerPage
72
+      if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
73
+        const [startItem] = this.itemsPerPageList;
74
+        this.visibleItemsPerPageCount = startItem;
75
+      }
76
+    } catch (error) {
77
+      throw error;
78
+    }
79
+  },
80
+  props: {
81
+    items: undefined
82
+  },
83
+  data() {
84
+    return {
85
+      sortKey: "",
86
+      reverse: false,
87
+      searchItem: "",
88
+      itemsPerPageList: ItemsPerPageList,
89
+      visibleItemsPerPageCount: 0,
90
+      currentPage: 1
91
+    };
92
+  },
93
+  methods: {
94
+    sortBy(sortKey) {
95
+      this.reverse = this.sortKey === sortKey ? !this.reverse : false;
96
+      this.sortKey = sortKey;
97
+    },
98
+    async pageChangeHandle(value) {
99
+      console.log(value);
100
+      switch (value) {
101
+        case "next":
102
+          this.currentPage += 1;
103
+          break;
104
+        case "previous":
105
+          this.currentPage -= 1;
106
+          break;
107
+        default:
108
+          this.currentPage = value;
109
+      }
110
+    },
111
+    onChangeItemsPerPage() {
112
+      if (this.currentPage !== 1) {
113
+        this.currentPage = 1;
114
+      }
115
+    }
116
+  },
117
+  computed: {
118
+    SortDirection() {
119
+      return this.reverse ? "desc" : "asc";
120
+    },
121
+    PageCount() {
122
+      return this.visibleItemsPerPageCount !== 0
123
+        ? Math.ceil(this.FilteredItems.length / this.visibleItemsPerPageCount)
124
+        : 1;
125
+    },
126
+    Columns() {
127
+      const list = [];
128
+      if (this.items) {
129
+        for (const i in Object.keys(this.items)) {
130
+          const item = this.items[i];
131
+          for (const o in Object.keys(item)) {
132
+            if (
133
+              !list.includes(Object.keys(item)[o]) &&
134
+              !Array.isArray(Object.values(item)[o])
135
+            ) {
136
+              list.push(Object.keys(item)[o]);
137
+            }
138
+          }
139
+        }
140
+      }
141
+      return list;
142
+    },
143
+    FilteredItems() {
144
+      const list = _.filter(this.items, item =>
145
+        Object.values(item).some(
146
+          i =>
147
+            JSON.stringify(i)
148
+              .toLowerCase()
149
+              .indexOf(this.searchItem) > -1
150
+        )
151
+      );
152
+      return _.orderBy(list, this.sortKey, this.SortDirection);
153
+    },
154
+    DisplayItems() {
155
+      const list = this.FilteredItems;
156
+      const startSlice = (this.currentPage - 1) * this.visibleItemsPerPageCount;
157
+      let endSlice = this.currentPage * this.visibleItemsPerPageCount;
158
+      if (endSlice > list.length) {
159
+        endSlice = list.length;
160
+      }
161
+      return list.slice(startSlice, endSlice);
162
+    }
163
+  }
164
+};
165
+</script>
166
+<style scoped>
167
+th[draggable] a,
168
+th[draggable] {
169
+  cursor: move;
170
+}
171
+th[draggable] a:hover,
172
+th[draggable] a {
173
+  display: block;
174
+  text-decoration: none;
175
+  color: #333333;
176
+}
177
+.drag {
178
+  background-color: rgba(0, 255, 0, 0.35);
179
+  opacity: 0.25;
180
+}
181
+.dnd-drag {
182
+  opacity: 0.25;
183
+}
184
+.over {
185
+  background-color: rgba(0, 0, 255, 0.35);
186
+}
187
+</style>

+ 32
- 8
src/components/shared/navBar.vue Wyświetl plik

@@ -60,6 +60,7 @@
60 60
                   @click="routerGoTo('/timeshare/sell')"
61 61
                 >To Sell</a>
62 62
                 <a
63
+                  v-if="showLogout"
63 64
                   class="dropdown-item cursor-pointer"
64 65
                   @click="routerGoTo('/timeshare/sell')"
65 66
                 >My Timeshare Weeks</a>
@@ -103,12 +104,14 @@
103 104
                   class="dropdown-item cursor-pointer"
104 105
                   @click="routerGoTo('/property/Residential/Rental')"
105 106
                 >To Rent Residential Properties</a>
106
-                <hr />
107
+                <hr v-if="showLogout" />
107 108
                 <a
109
+                  v-if="showLogout"
108 110
                   class="dropdown-item cursor-pointer"
109 111
                   @click="routerGoTo('/property/list/Commercial/MyListings')"
110 112
                 >My Commercial Properties</a>
111 113
                 <a
114
+                  v-if="showLogout"
112 115
                   class="dropdown-item cursor-pointer"
113 116
                   @click="routerGoTo('/property/list/Residential/MyListings')"
114 117
                 >My Residential Properties</a>
@@ -181,7 +184,7 @@
181 184
                 <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Offers')">Offers</a>
182 185
               </div>
183 186
             </li>
184
-            <li class="nav-item dropdown">
187
+            <li class="nav-item dropdown" v-if="hideLogin">
185 188
               <a
186 189
                 class="nav-link"
187 190
                 @click="routerGoTo('/user/login')"
@@ -192,6 +195,22 @@
192 195
                 aria-expanded="false"
193 196
               >Login</a>
194 197
             </li>
198
+            <li class="nav-item dropdown" v-if="showLogout">
199
+              <span>
200
+                <a class="nav-link" @click="logout(routerGoTo('/user/login'))">Logout</a>
201
+              </span>
202
+              <!-- <span v-else></span> -->
203
+            </li>
204
+            <li>
205
+              <span v-if="showLogout">
206
+                <a>
207
+                  Welcome!
208
+                  <br />
209
+                  {{ username }}
210
+                </a>
211
+              </span>
212
+              <span v-else></span>
213
+            </li>
195 214
           </ul>
196 215
         </div>
197 216
       </div>
@@ -207,10 +226,6 @@
207 226
         </button>
208 227
       </div>
209 228
     </div>
210
-    <span v-if="showLogout">
211
-      <a @click="logout()">Logout</a>
212
-    </span>
213
-    <span v-else></span>
214 229
   </nav>
215 230
 </template>
216 231
 
@@ -219,14 +234,23 @@ import { mapGetters, mapActions } from 'vuex';
219 234
 
220 235
 export default {
221 236
   data() {
222
-    return {};
237
+    return {
238
+      username: sessionStorage.getItem('name'),
239
+    };
223 240
   },
224 241
   computed: {
225 242
     showLogout() {
243
+      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
244
+      this.username = sessionStorage.getItem('name');
226 245
       return this.$store.state.authentication.status === 'success';
227 246
     },
247
+    hideLogin() {
248
+      return this.$store.state.authentication.status !== 'success';
249
+    },
250
+    // eslint-disable-next-line vue/return-in-computed-property
228 251
     Logout() {
229
-      return this.$store.state.authentication.methods.logout;
252
+      // eslint-disable-next-line no-unused-expressions
253
+      this.$store.state.authentication.methods.logout;
230 254
     },
231 255
   },
232 256
 

+ 4
- 2
src/components/shared/searchTab.vue Wyświetl plik

@@ -101,7 +101,6 @@ export default {
101 101
   data() {
102 102
     return {
103 103
       selectedPropertyType: 'timeshare',
104
-      keyword: '',
105 104
       propertySearch: {
106 105
         userName: '',
107 106
         salesType: 'Sale',
@@ -115,6 +114,9 @@ export default {
115 114
       },
116 115
     };
117 116
   },
117
+  computed: {
118
+    ...mapState('weekList', ['filter']),
119
+  },
118 120
   methods: {
119 121
     updateType(item) {
120 122
       this.selectedPropertyType = item;
@@ -122,7 +124,7 @@ export default {
122 124
     updateSearch(item) {
123 125
       this.propertySearch = item;
124 126
       this.propertySearch.propertyUsageType = this.selectedPropertyType;
125
-      this.propertySearch.keyword = this.keyword;
127
+      this.propertySearch.keyword = this.filter.keyword;
126 128
     },
127 129
     Search() {
128 130
       if (this.selectedPropertyType === 'timeshare') {

+ 6
- 28
src/components/timeshare/buy/weekListComponent.vue Wyświetl plik

@@ -29,30 +29,7 @@
29 29
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
30 30
             <td>
31 31
               <div class="col-md-12">
32
-                <button
33
-                  type="button"
34
-                  class="btn btn-b-n"
35
-                  data-toggle="modal"
36
-                  data-target="#myModal"
37
-                >Make an Offer</button>
38
-                <div id="myModal" class="modal fade" role="dialog">
39
-                  <div class="modal-dialog modal-lg">
40
-                    <!-- Modal content-->
41
-                    <div class="modal-content">
42
-                      <div class="modal-header">
43
-                        <button type="button" class="close" data-dismiss="modal">&times;</button>
44
-                      </div>
45
-                      <div padding-left="20px">
46
-                        <makeOffer
47
-                          name="MakeOffer"
48
-                          :isMakeOffer="true"
49
-                          :isProperty="false"
50
-                          :item="item"
51
-                        />
52
-                      </div>
53
-                    </div>
54
-                  </div>
55
-                </div>
32
+                <button type="button" class="btn btn-b-n" @click="View(item)">View</button>
56 33
               </div>
57 34
             </td>
58 35
           </tr>
@@ -71,15 +48,12 @@
71 48
 </template>
72 49
 <script>
73 50
 import { mapState, mapActions, mapGetters } from 'vuex';
74
-import makeOffer from '../../processFlow/makeOffer.vue';
75 51
 
76 52
 export default {
77 53
   props: {
78 54
     resortCode: undefined,
79 55
   },
80
-  components: {
81
-    makeOffer,
82
-  },
56
+  components: {},
83 57
   computed: {
84 58
     ...mapState('weekList', ['weeks']),
85 59
     ...mapGetters({
@@ -93,6 +67,10 @@ export default {
93 67
     this.getWeeks();
94 68
   },
95 69
   methods: {
70
+    View(item) {
71
+      console.log(item);
72
+      this.$router.push(`/resort/${item.resort.resortCode}/${item.id}`);
73
+    },
96 74
     ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
97 75
   },
98 76
 };

+ 0
- 1
src/components/timeshare/resort/resortPage.vue Wyświetl plik

@@ -40,7 +40,6 @@
40 40
           </div>
41 41
           {{description}}
42 42
           <hr />
43
-
44 43
           <div class="row">
45 44
             <div class="col-md-10 mb-4">
46 45
               <ul class="nav nav-tabs" id="myTab" role="tablist">

+ 26
- 56
src/components/timeshare/resort/unitPage.vue Wyświetl plik

@@ -8,7 +8,10 @@
8 8
     <div class="row">
9 9
       <div class="col-md-12 col-lg-8">
10 10
         <div class="title-box-d">
11
-          <h1 class="title-d" style="text-align:left; font-size: 250%">{{resort.prName}}</h1>
11
+          <h1
12
+            class="title-d"
13
+            style="text-align:left; font-size: 250%"
14
+          >{{week ? week.resortName : ''}}</h1>
12 15
         </div>
13 16
         <br />
14 17
       </div>
@@ -41,7 +44,7 @@
41 44
             </ul>
42 45
           </div>
43 46
         </div>
44
-        <div class="col-md-6">
47
+        <div class="col-md-6" v-if="week">
45 48
           <form
46 49
             id="mainForm"
47 50
             method="POST"
@@ -66,7 +69,7 @@
66 69
                     type="text"
67 70
                     id="resort"
68 71
                     name="resortunit"
69
-                    :value="week.unit"
72
+                    :value="week ? week.unitNumber : ''"
70 73
                     disabled
71 74
                   />
72 75
                 </div>
@@ -84,7 +87,7 @@
84 87
                     type="text"
85 88
                     id="week"
86 89
                     name="resortWeek"
87
-                    :value="week.module"
90
+                    :value="week ? week.weekNumber : ''"
88 91
                     disabled
89 92
                   />
90 93
                 </div>
@@ -103,7 +106,7 @@
103 106
                     type="text"
104 107
                     id="levy"
105 108
                     name="levy"
106
-                    :value="formatPrice(week.currentLevy)"
109
+                    :value="formatPrice(week ? week.levyAmount : 0)"
107 110
                     disabled
108 111
                   />
109 112
                 </div>
@@ -115,7 +118,7 @@
115 118
                   <div style="width: 260px; height: 70px; border-style: solid; color: #60CBEB;">
116 119
                     <!-- <div class="card-title-c align-self-center"> -->
117 120
                     <a class="justify-content-center" style="color: black; font-size: 250%">
118
-                      <b>R{{ formatPrice(week.price) }}</b>
121
+                      <b>R{{ formatPrice(week ? week.sellPrice : 0) }}</b>
119 122
                     </a>
120 123
                     <!-- </div> -->
121 124
                   </div>
@@ -124,44 +127,9 @@
124 127
               </div>
125 128
             </div>
126 129
             <br />
127
-            <div class="form-row">
128
-              <div>
129
-                <div class="input-group mb-3">
130
-                  <div class="input-group-prepend">
131
-                    <span class="input-group-text">
132
-                      <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
133
-                    </span>
134
-                    <input class="form-control" type="text" name="name" placeholder="Name" />
135
-                  </div>
136
-                </div>
137
-                <div class="input-group mb-3">
138
-                  <div class="input-group-prepend">
139
-                    <span class="input-group-text">
140
-                      <eva-icon name="phone-outline" fill="#60CBEB"></eva-icon>
141
-                    </span>
142
-                    <input
143
-                      class="form-control"
144
-                      type="number"
145
-                      name="mobile"
146
-                      placeholder="Contact Number"
147
-                    />
148
-                  </div>
149
-                </div>
150
-                <div class="input-group mb-3">
151
-                  <div class="input-group-prepend">
152
-                    <span class="input-group-text">
153
-                      <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
154
-                    </span>
155
-                    <input class="form-control" type="email" name="email" placeholder="Email" />
156
-                  </div>
157
-                </div>
158
-              </div>
159
-            </div>
160 130
           </form>
161 131
           <br />
162 132
 
163
-          <button class="btn btn-b-c even-width mr-auto" type="submit">Enquire Now</button>
164
-
165 133
           <!-- <a
166 134
               class="btn btn-b-n even-width mr-auto"
167 135
               href="/share-transfer-initiation-for-purchaser/"
@@ -172,20 +140,22 @@
172 140
             data-toggle="modal"
173 141
             data-target="#myModal"
174 142
           >Make an Offer</button>
175
-          <div id="myModal" class="modal fade" role="dialog">
176
-            <div class="modal-dialog modal-lg">
177
-              <!-- Modal content-->
178
-              <div class="modal-content">
179
-                <div class="modal-header">
180
-                  <button type="button" class="close" data-dismiss="modal">&times;</button>
181
-                </div>
182
-                <div padding-left="20px">
183
-                  <makeOffer
184
-                    name="MakeOffer"
185
-                    :isMakeOffer="true"
186
-                    :isProperty="false"
187
-                    :item="{resort: resort.prName, unit: week.unit, week: week.week, module: week.module, price: week.price}"
188
-                  />
143
+          <div class="col-md-12">
144
+            <div id="myModal" class="modal fade" role="dialog">
145
+              <div class="modal-dialog modal-lg">
146
+                <!-- Modal content-->
147
+                <div class="modal-content">
148
+                  <div class="modal-header">
149
+                    <button type="button" class="close" data-dismiss="modal">&times;</button>
150
+                  </div>
151
+                  <div padding-left="20px">
152
+                    <makeOffer
153
+                      name="MakeOffer"
154
+                      :isMakeOffer="true"
155
+                      :isProperty="false"
156
+                      :item="week"
157
+                    />
158
+                  </div>
189 159
                 </div>
190 160
               </div>
191 161
             </div>
@@ -223,7 +193,7 @@ export default {
223 193
       'image2',
224 194
       'image3',
225 195
     ]),
226
-    ...mapState('week', ['week', 'contactDetails']),
196
+    ...mapState('week', ['week']),
227 197
   },
228 198
   methods: {
229 199
     ...mapActions('resort', ['initResort']),

+ 0
- 1
src/components/timeshare/sell/sellPage.vue Wyświetl plik

@@ -320,7 +320,6 @@
320 320
             <BankDetails :bankingDetails="sellItem.owner.bankingDetails" />
321 321
             <hr />
322 322
           </div>
323
-          <hr />
324 323
           <br />
325 324
           <div class="myWell">
326 325
             <h4>Share transfer information</h4>

+ 1
- 1
src/components/user/logOut.vue Wyświetl plik

@@ -11,7 +11,7 @@ export default {
11 11
     ...mapActions('authentication', ['logout']),
12 12
     Logout() {
13 13
       this.logout('logout').then(() => {
14
-        this.$router.push('/users/login');
14
+        this.$router.push('/user/login');
15 15
       });
16 16
     },
17 17
   },

+ 10
- 2
src/components/user/loginPage.vue Wyświetl plik

@@ -8,6 +8,11 @@
8 8
             <h4>Login</h4>
9 9
             <br />
10 10
           </div>
11
+          <!--<alert :text="'Login successful'" :type="'SUCCESS'" />
12
+          <alert :text="'User does not exist, please register'" :type="'ERROR'" />
13
+          <alert :text="'Username is incorrect'" :type="'WARNING'" />
14
+          <alert :text="'Password is incorrect'" :type="'WARNING'" />
15
+          <alert :text="'Caps Lock is on'" :type="'INFO'" />-->
11 16
           <div class="row">
12 17
             <div class="col-md-11" style="margin-bottom: 1em">
13 18
               <div class="input-group mb-3">
@@ -76,6 +81,7 @@
76 81
         <div class="form">
77 82
           <h5>Trouble signing in?</h5>
78 83
           <div>
84
+            <!--<alert :text="'Username & password request email sent'" :type="'SUCCESS'" />-->
79 85
             <div class="row">
80 86
               <div class="input-group-prepend">
81 87
                 <span class="input-group-text">
@@ -97,11 +103,13 @@
97 103
 
98 104
 <script>
99 105
 import { mapActions, mapState } from 'vuex';
100
-// import axios from 'axios';
101
-// import User from '../../assets/Log';
106
+// import alert from '../shared/alert.vue';
102 107
 
103 108
 export default {
104 109
   name: 'Login',
110
+  components: {
111
+    // alert,
112
+  },
105 113
   data() {
106 114
     return {
107 115
       username: '',

+ 2
- 9
src/main.js Wyświetl plik

@@ -38,15 +38,8 @@ Vue.filter('toCurrency', (value) => {
38 38
   return `R ${formatter.format(value)}`;
39 39
 });
40 40
 
41
-const myPad = function (value, pattern) {
42
-  const val = '' + value;
43
-  return pattern.substring(0, pattern.length - val.length) + val;
44
-};
45
-
46
-Vue.filter('toDate', (value) => {
47
-  const date = new Date(value);
48
-  return `${date.getFullYear()}/${myPad(date.getMonth(), '00')}/${myPad(date.getDay(), '00')}`;
49
-});
41
+
42
+Vue.filter('toDate', value => value.substring(0, value.length > 9 ? 10 : value.length));
50 43
 
51 44
 new Vue({
52 45
   render: h => h(App),

+ 178
- 177
src/router/index.js Wyświetl plik

@@ -52,182 +52,183 @@ export default new Router({
52 52
       y: 0,
53 53
     };
54 54
   },
55
-  routes: [{
56
-    path: '/',
57
-    name: 'Home',
58
-    component: HomePage,
59
-  },
60
-  {
61
-    path: '/about/us',
62
-    name: 'aboutus',
63
-    component: AboutUs,
64
-  },
65
-  {
66
-    path: '/about/timeshare',
67
-    name: 'abouttimeshare',
68
-    component: AboutTimeshare,
69
-  },
70
-  {
71
-    path: '/timeshare/sell',
72
-    name: 'TimeshareSell',
73
-    component: TimeshareSell,
74
-  },
75
-  {
76
-    path: '/timeshare/buy',
77
-    name: 'TimeshareBuy',
78
-    component: TimeshareBuy,
79
-  },
80
-  {
81
-    path: '/timeshare/faq',
82
-    name: 'TimeshareFAQ',
83
-    component: TimeshareFAQ,
84
-  },
85
-  {
86
-    path: '/user/login',
87
-    name: 'Login',
88
-    component: Login,
89
-  },
90
-  {
91
-    path: '/user/register',
92
-    name: 'PrivateIndividual',
93
-    component: PrivateIndividual,
94
-  },
95
-  {
96
-    path: '/user/registeragency',
97
-    name: 'Agency',
98
-    component: Agency,
99
-  },
100
-  {
101
-    path: '/property/property/:id',
102
-    name: 'PropertyPage',
103
-    component: PropertyPage,
104
-  },
105
-  {
106
-    path: '/property/:propertyUsageType/search',
107
-    name: 'PropertySearch',
108
-    component: PropertySearch,
109
-  },
110
-  {
111
-    path: '/property/search',
112
-    name: 'PropertySearchTab',
113
-    component: PropertySearch,
114
-  },
115
-  {
116
-    path: '/property/:propType/:saleType',
117
-    name: 'PropertyNew',
118
-    component: PropertyEdit,
119
-  },
120
-  {
121
-    path: '/property/edit/:id/:propType/:saleType',
122
-    name: 'PropertyEdit',
123
-    component: PropertyEdit,
124
-  },
125
-  {
126
-    path: '/property/list/:propertyType/:user',
127
-    name: 'PropertyList',
128
-    component: PropertyList,
129
-  },
130
-  {
131
-    path: '/propertyTypes/list',
132
-    name: 'PropertyTypeList',
133
-    component: PropertyTypeList,
134
-  },
135
-  {
136
-    path: '/propertyType/new',
137
-    name: 'PropertyTypeNew',
138
-    component: PropertyType,
139
-  },
140
-  {
141
-    path: '/propertyType/:id',
142
-    name: 'PropertyTypeEdit',
143
-    component: PropertyType,
144
-  },
145
-  {
146
-    path: '/userDefinedGroups/list',
147
-    name: 'UserDefinedGroupsList',
148
-    component: UserDefinedGroups,
149
-  },
150
-  {
151
-    path: '/userDefinedGroups/userDefinedGroup/:id',
152
-    name: 'UserDefinedGroupEdit',
153
-    component: UserDefinedGroup,
154
-  },
155
-  {
156
-    path: '/userDefinedGroups/userDefinedGroup',
157
-    name: 'UserDefinedGroupNew',
158
-    component: UserDefinedGroup,
159
-  },
160
-  {
161
-    path: '/status/list',
162
-    name: 'StatusList',
163
-    component: Status,
164
-  },
165
-  {
166
-    path: '/status/timeshareAdmin',
167
-    name: 'TimeshareAdmin',
168
-    component: timeshareAdminPage,
169
-  },
170
-  {
171
-    path: '/status/tenderWeekAdmin',
172
-    name: 'TenderWeekAdmin',
173
-    component: tenderWeekAdminPage,
174
-  },
175
-  {
176
-    path: '/status/userManagementPage',
177
-    name: 'userManagementPage',
178
-    component: userManagementPage,
179
-  },
180
-  {
181
-    path: '/status/changeLogPage',
182
-    name: 'changeLogPage',
183
-    component: changeLogPage,
184
-  },
185
-  {
186
-    path: '/unitConfiguration/list',
187
-    name: 'UnitConfiguration',
188
-    component: UnitConfiguration,
189
-  },
190
-  {
191
-    path: '/contactus',
192
-    name: 'ContactUs',
193
-    component: ContactUs,
194
-  },
195
-  {
196
-    path: '/privacypolicy',
197
-    name: 'PrivacyPolicy',
198
-    component: PrivacyPolicy,
199
-  },
200
-  {
201
-    path: '/resort/:resortCode',
202
-    name: 'ResortPage',
203
-    component: ResortPage,
204
-    props: true,
205
-  },
206
-  {
207
-    path: '/resort/:resortCode/:weekId',
208
-    name: 'UnitPage',
209
-    component: UnitPage,
210
-    props: true,
211
-  },
212
-  {
213
-    path: '/MakeOffer',
214
-    name: 'MakeOffer',
215
-    component: MakeOffer,
216
-  },
217
-  {
218
-    path: '/Offers',
219
-    name: 'Offers',
220
-    component: Offer,
221
-  },
222
-  {
223
-    path: '/timeshare/search',
224
-    name: 'TimeshareSearch',
225
-    component: TimeshareSearch,
226
-  },
227
-  {
228
-    path: '/searchLog',
229
-    name: 'SearchLog',
230
-    component: searchLog,
231
-  },
55
+  routes: [
56
+    {
57
+      path: '/',
58
+      name: 'Home',
59
+      component: HomePage,
60
+    },
61
+    {
62
+      path: '/about/us',
63
+      name: 'aboutus',
64
+      component: AboutUs,
65
+    },
66
+    {
67
+      path: '/about/timeshare',
68
+      name: 'abouttimeshare',
69
+      component: AboutTimeshare,
70
+    },
71
+    {
72
+      path: '/timeshare/sell',
73
+      name: 'TimeshareSell',
74
+      component: TimeshareSell,
75
+    },
76
+    {
77
+      path: '/timeshare/buy',
78
+      name: 'TimeshareBuy',
79
+      component: TimeshareBuy,
80
+    },
81
+    {
82
+      path: '/timeshare/faq',
83
+      name: 'TimeshareFAQ',
84
+      component: TimeshareFAQ,
85
+    },
86
+    {
87
+      path: '/user/login',
88
+      name: 'Login',
89
+      component: Login,
90
+    },
91
+    {
92
+      path: '/user/register',
93
+      name: 'PrivateIndividual',
94
+      component: PrivateIndividual,
95
+    },
96
+    {
97
+      path: '/user/registeragency',
98
+      name: 'Agency',
99
+      component: Agency,
100
+    },
101
+    {
102
+      path: '/property/property/:id',
103
+      name: 'PropertyPage',
104
+      component: PropertyPage,
105
+    },
106
+    {
107
+      path: '/property/:propertyUsageType/search',
108
+      name: 'PropertySearch',
109
+      component: PropertySearch,
110
+    },
111
+    {
112
+      path: '/property/search',
113
+      name: 'PropertySearchTab',
114
+      component: PropertySearch,
115
+    },
116
+    {
117
+      path: '/property/:propType/:saleType',
118
+      name: 'PropertyNew',
119
+      component: PropertyEdit,
120
+    },
121
+    {
122
+      path: '/property/edit/:id/:propType/:saleType',
123
+      name: 'PropertyEdit',
124
+      component: PropertyEdit,
125
+    },
126
+    {
127
+      path: '/property/list/:propertyType/:user',
128
+      name: 'PropertyList',
129
+      component: PropertyList,
130
+    },
131
+    {
132
+      path: '/propertyTypes/list',
133
+      name: 'PropertyTypeList',
134
+      component: PropertyTypeList,
135
+    },
136
+    {
137
+      path: '/propertyType/new',
138
+      name: 'PropertyTypeNew',
139
+      component: PropertyType,
140
+    },
141
+    {
142
+      path: '/propertyType/:id',
143
+      name: 'PropertyTypeEdit',
144
+      component: PropertyType,
145
+    },
146
+    {
147
+      path: '/userDefinedGroups/list',
148
+      name: 'UserDefinedGroupsList',
149
+      component: UserDefinedGroups,
150
+    },
151
+    {
152
+      path: '/userDefinedGroups/userDefinedGroup/:id',
153
+      name: 'UserDefinedGroupEdit',
154
+      component: UserDefinedGroup,
155
+    },
156
+    {
157
+      path: '/userDefinedGroups/userDefinedGroup',
158
+      name: 'UserDefinedGroupNew',
159
+      component: UserDefinedGroup,
160
+    },
161
+    {
162
+      path: '/status/list',
163
+      name: 'StatusList',
164
+      component: Status,
165
+    },
166
+    {
167
+      path: '/status/timeshareAdmin',
168
+      name: 'TimeshareAdmin',
169
+      component: timeshareAdminPage,
170
+    },
171
+    {
172
+      path: '/status/tenderWeekAdmin',
173
+      name: 'TenderWeekAdmin',
174
+      component: tenderWeekAdminPage,
175
+    },
176
+    {
177
+      path: '/status/userManagementPage',
178
+      name: 'userManagementPage',
179
+      component: userManagementPage,
180
+    },
181
+    {
182
+      path: '/status/changeLogPage',
183
+      name: 'changeLogPage',
184
+      component: changeLogPage,
185
+    },
186
+    {
187
+      path: '/unitConfiguration/list',
188
+      name: 'UnitConfiguration',
189
+      component: UnitConfiguration,
190
+    },
191
+    {
192
+      path: '/contactus',
193
+      name: 'ContactUs',
194
+      component: ContactUs,
195
+    },
196
+    {
197
+      path: '/privacypolicy',
198
+      name: 'PrivacyPolicy',
199
+      component: PrivacyPolicy,
200
+    },
201
+    {
202
+      path: '/resort/:resortCode',
203
+      name: 'ResortPage',
204
+      component: ResortPage,
205
+      props: true,
206
+    },
207
+    {
208
+      path: '/resort/:resortCode/:weekId',
209
+      name: 'UnitPage',
210
+      component: UnitPage,
211
+      props: true,
212
+    },
213
+    {
214
+      path: '/MakeOffer',
215
+      name: 'MakeOffer',
216
+      component: MakeOffer,
217
+    },
218
+    {
219
+      path: '/Offers',
220
+      name: 'Offers',
221
+      component: Offer,
222
+    },
223
+    {
224
+      path: '/timeshare/search',
225
+      name: 'TimeshareSearch',
226
+      component: TimeshareSearch,
227
+    },
228
+    {
229
+      path: '/searchLog',
230
+      name: 'SearchLog',
231
+      component: searchLog,
232
+    },
232 233
   ],
233 234
 });

+ 7
- 22
src/store/modules/timeshare/week.js Wyświetl plik

@@ -1,3 +1,4 @@
1
+/* eslint-disable prefer-destructuring */
1 2
 /* eslint-disable no-restricted-syntax */
2 3
 /* eslint-disable guard-for-in */
3 4
 import axios from 'axios';
@@ -5,23 +6,13 @@ import axios from 'axios';
5 6
 export default {
6 7
   namespaced: true,
7 8
   state: {
8
-    week: {
9
-      id: '',
10
-      unit: '',
11
-      week: '',
12
-      module: '',
13
-      price: '',
14
-      currentLevy: '',
15
-    },
16
-    contactDetails: {
17
-      name: '',
18
-      number: '',
19
-      email: '',
20
-    },
9
+    week: undefined,
21 10
   },
22 11
   mutations: {
23 12
     setWeek(state, week) {
24
-      state.week = week;
13
+      if (week.length > 0) {
14
+        state.week = week[0];
15
+      }
25 16
     },
26 17
   },
27 18
   getters: {},
@@ -29,14 +20,8 @@ export default {
29 20
     initWeek({
30 21
       commit,
31 22
     }, weekId) {
32
-      commit('setWeek', {
33
-        id: weekId,
34
-        unit: '359',
35
-        week: 'N18',
36
-        module: '359/N18 River View',
37
-        price: 85000,
38
-        currentLevy: 5455,
39
-      });
23
+      axios.get(`/api/timeshareweek/${weekId}`).then(r => commit('setWeek', r.data)).catch(console
24
+        .error);
40 25
     },
41 26
   },
42 27
 };

+ 16
- 0
src/store/modules/timeshare/weekList.js Wyświetl plik

@@ -15,6 +15,7 @@ export default {
15 15
       date: undefined,
16 16
       minPrice: undefined,
17 17
       maxPrice: undefined,
18
+      keyword: null,
18 19
     },
19 20
   },
20 21
   mutations: {
@@ -39,6 +40,21 @@ export default {
39 40
       } = state;
40 41
       // console.log(JSON.stringify(weekList));
41 42
       if (filter) {
43
+        if (filter.keyword) {
44
+          const list = [];
45
+          for (const i in weekList) {
46
+            const item = weekList[i];
47
+            for (const r in item) {
48
+              const innerItem = item[r];
49
+              if (innerItem && JSON.stringify(innerItem).toLowerCase().includes(filter.keyword
50
+                .toLowerCase())) {
51
+                list.push(item);
52
+                break;
53
+              }
54
+            }
55
+          }
56
+          weekList = list;
57
+        }
42 58
         if (filter.region) {
43 59
           weekList = _.filter(weekList, x => x.region && x.region.regionCode === filter.region
44 60
             .regionCode);

+ 13
- 10
src/store/modules/user/authentication.js Wyświetl plik

@@ -7,8 +7,9 @@ export default {
7 7
   namespaced: true,
8 8
   state: {
9 9
     status: '',
10
-    token: localStorage.getItem('token') || '',
10
+    token: sessionStorage.getItem('token') || '',
11 11
     user: {},
12
+    individual: {},
12 13
   },
13 14
   mutations: {
14 15
     auth_request(state) {
@@ -32,9 +33,7 @@ export default {
32 33
     authStatus: state => state.status,
33 34
   },
34 35
   actions: {
35
-    login({
36
-      commit,
37
-    }, user) {
36
+    login({ commit }, user) {
38 37
       return new Promise((reject) => {
39 38
         commit('auth_request');
40 39
         axios({
@@ -44,22 +43,26 @@ export default {
44 43
         })
45 44
           .then((resp) => {
46 45
             console.log(resp.data);
47
-            localStorage.setItem('token', resp.data.token);
46
+            sessionStorage.setItem('token', resp.data.token);
47
+            sessionStorage.setItem('username', resp.data.username);
48
+            sessionStorage.setItem('name', resp.data.name);
48 49
             commit('auth_success', resp.data.token, resp.data);
49 50
           })
50 51
           .catch((err) => {
51 52
             commit('auth_error');
52
-            localStorage.removeItem('token');
53
+            sessionStorage.removeItem('token');
54
+            sessionStorage.removeItem('username');
55
+            sessionStorage.removeItem('name');
53 56
             reject(err);
54 57
           });
55 58
       });
56 59
     },
57
-    logout({
58
-      commit,
59
-    }) {
60
+    logout({ commit }) {
60 61
       return new Promise(() => {
61 62
         commit('logout');
62
-        localStorage.removeItem('token');
63
+        sessionStorage.removeItem('token');
64
+        sessionStorage.removeItem('username');
65
+        sessionStorage.removeItem('name');
63 66
         delete axios.defaults.headers.common.Authorization;
64 67
       });
65 68
     },

+ 1
- 1
vue.config.js Wyświetl plik

@@ -2,7 +2,7 @@ module.exports = {
2 2
   devServer: {
3 3
     proxy: {
4 4
       '/api': {
5
-        target: 'http://192.168.6.188:5000',
5
+        target: 'http://localhost:57260',
6 6
         changeOrigin: true,
7 7
       },
8 8
     },

Ładowanie…
Anuluj
Zapisz