Procházet zdrojové kódy

List View and Random Styles

master
30117125 před 4 roky
rodič
revize
4f7433d048

+ 2
- 0
src/components/admin/status/timeshareAdminPage.vue Zobrazit soubor

68
             :CustomActionHeading="'Publish'"
68
             :CustomActionHeading="'Publish'"
69
             :showColumnChooser="false"
69
             :showColumnChooser="false"
70
             :displayColumns="columns"
70
             :displayColumns="columns"
71
+            :displayFormats="displayFormats"
71
             @onRowClick="onRowClick"
72
             @onRowClick="onRowClick"
72
             @onClearSelected="onClearSelected"
73
             @onClearSelected="onClearSelected"
73
             @onEdit="onEdit"
74
             @onEdit="onEdit"
117
         "region",
118
         "region",
118
         "sellPrice"
119
         "sellPrice"
119
       ],
120
       ],
121
+      displayFormats: ["", "", "", "", "", "", "", "", "money"],
120
       // selectedItems: [],
122
       // selectedItems: [],
121
       showMessage: false,
123
       showMessage: false,
122
       region: ""
124
       region: ""

+ 15
- 9
src/components/property/commercial/commercialSearchResults.vue Zobrazit soubor

1
 <template>
1
 <template>
2
   <main id="main" style="margin-top:-20px; padding-bottom:50px">
2
   <main id="main" style="margin-top:-20px; padding-bottom:50px">
3
     <div v-if="wait" id="preloader"></div>
3
     <div v-if="wait" id="preloader"></div>
4
-    <section v-if="properties.length > 0">
4
+    <div class="row pt-5 justify-content-md-center">
5
+      <h3 v-if="propertySearch.salesType === 'Sale'">COMMERCIAL PROPERTIES FOR SALE</h3>
6
+      <h3 v-else-if="propertySearch.salesType === 'Rent'">COMMERCIAL PROPERTIES FOR RENT</h3>
7
+    </div>
8
+    <propertyCard
9
+      v-if="properties.length > 0"
10
+      name="propertyholder"
11
+      :properties="properties"
12
+      :showSort="false"
13
+    />
14
+    <!-- <section v-if="properties.length > 0">
5
       <div class="container">
15
       <div class="container">
6
-        <div class="row pt-5 justify-content-md-center">
7
-          <h3 v-if="propertySearch.salesType === 'Sale'">COMMERCIAL PROPERTIES FOR SALE</h3>
8
-          <h3 v-else-if="propertySearch.salesType === 'Rent'">COMMERCIAL PROPERTIES FOR RENT</h3>
9
-        </div>
10
         <div class="row justify-content-md-center">
16
         <div class="row justify-content-md-center">
11
           <div
17
           <div
12
             class="col-lg-3 col-md-6 col-sm-6"
18
             class="col-lg-3 col-md-6 col-sm-6"
19
                 <h4>{{ currentProperty.displayPrice }}</h4>
25
                 <h4>{{ currentProperty.displayPrice }}</h4>
20
                 <p>
26
                 <p>
21
                   {{ currentProperty.suburb }}, {{ currentProperty.city }} |
27
                   {{ currentProperty.suburb }}, {{ currentProperty.city }} |
22
-                  {{ currentProperty.area }}M<sup>2</sup>
28
+                  {{ currentProperty.area }}
23
                 </p>
29
                 </p>
24
                 <p>{{ currentProperty.shortDescription }}</p>
30
                 <p>{{ currentProperty.shortDescription }}</p>
25
                 <br />
31
                 <br />
26
 
32
 
27
-                <!-- <a href="commercialproperty-page.php" class="btn-white-border">VIEW</a> -->
33
+                <a href="commercialproperty-page.php" class="btn-white-border">VIEW</a>
28
                 <router-link
34
                 <router-link
29
                   class="btn-white-border"
35
                   class="btn-white-border"
30
                   :to="`/property/commercial/property/${currentProperty.id}`"
36
                   :to="`/property/commercial/property/${currentProperty.id}`"
35
           </div>
41
           </div>
36
         </div>
42
         </div>
37
       </div>
43
       </div>
38
-    </section>
44
+    </section> -->
39
     <section v-else id="intro" style="margin-bottom:-50px">
45
     <section v-else id="intro" style="margin-bottom:-50px">
40
       <div class="container">
46
       <div class="container">
41
         <div class="row d-flex justify-content-center">
47
         <div class="row d-flex justify-content-center">
72
 <script>
78
 <script>
73
 /* eslint-disable */
79
 /* eslint-disable */
74
 import { mapState, mapActions } from "vuex";
80
 import { mapState, mapActions } from "vuex";
75
-import propertyCard from "../propertyCard";
81
+import propertyCard from "../propertyCardSearch";
76
 import carousel from "vue-owl-carousel";
82
 import carousel from "vue-owl-carousel";
77
 
83
 
78
 export default {
84
 export default {

+ 11
- 9
src/components/property/propertyCard.vue Zobrazit soubor

12
               <div class="portfolio-item p-4 wow fadeInUp justify-content-md-center">
12
               <div class="portfolio-item p-4 wow fadeInUp justify-content-md-center">
13
                 <div class="feature-top pt-3 mb-2">
13
                 <div class="feature-top pt-3 mb-2">
14
                   <h3>{{ currentProperty.displayPrice }}</h3>
14
                   <h3>{{ currentProperty.displayPrice }}</h3>
15
-                  <img
16
-                    style="max-height:165px; object-fit: cover;"
17
-                    :src="currentProperty.displayImage"
18
-                    alt
19
-                  />
15
+                  <div>
16
+                    <img
17
+                      style="max-height:165px; object-fit: cover;"
18
+                      :src="currentProperty.displayImage"
19
+                      alt
20
+                    />
21
+                  </div>
20
                 </div>
22
                 </div>
21
                 <h1>{{ currentProperty.suburb }}</h1>
23
                 <h1>{{ currentProperty.suburb }}</h1>
22
                 <p>
24
                 <p>
30
                   <strong>{{ currentProperty.available }}</strong>
32
                   <strong>{{ currentProperty.available }}</strong>
31
                 </p>
33
                 </p>
32
                 <p
34
                 <p
33
-                  v-if="currentProperty.isSale  && currentProperty.hasPendingOffer"
35
+                  v-if="currentProperty.isSale && currentProperty.hasPendingOffer"
34
                   class="pendingOffer"
36
                   class="pendingOffer"
35
                 >
37
                 >
36
                   <strong>{{ currentProperty.available }}</strong>
38
                   <strong>{{ currentProperty.available }}</strong>
71
   props: {
73
   props: {
72
     properties: { type: Array, default: () => [] },
74
     properties: { type: Array, default: () => [] },
73
     showSort: { type: Boolean, default: true },
75
     showSort: { type: Boolean, default: true },
74
-    salesType: { type: String, default: "Rent" },
76
+    salesType: { type: String, default: "Rent" }
75
   },
77
   },
76
   methods: {
78
   methods: {
77
     sortHighPrice() {
79
     sortHighPrice() {
109
       }
111
       }
110
 
112
 
111
       return this.properties.sort(compare);
113
       return this.properties.sort(compare);
112
-    },
113
-  },
114
+    }
115
+  }
114
 };
116
 };
115
 </script>
117
 </script>
116
 
118
 

+ 117
- 0
src/components/property/propertyCardSearch.vue Zobrazit soubor

1
+<template>
2
+  <section id="portfolio">
3
+    <div class="container-fluid">
4
+      <div class="row">
5
+        <div
6
+          class="col-lg-3 col-md-6 col-sm-6 my-3"
7
+          v-for="currentProperty in properties"
8
+          :key="currentProperty.id"
9
+        >
10
+          <div v-if="currentProperty.propertyUsageType === 'Residential'">
11
+            <router-link :to="`/property/residential/property/${currentProperty.id}`">
12
+              <div class="portfolio-item p-4 wow fadeInUp justify-content-md-center">
13
+                <div class="feature-top pt-3 mb-2">
14
+                  <h3 style="color:white !important">{{ currentProperty.displayPrice }}</h3>
15
+                  <img
16
+                    style="max-height:165px; object-fit: cover;"
17
+                    :src="currentProperty.displayImage"
18
+                    alt
19
+                  />
20
+                </div>
21
+                <h1>{{ currentProperty.suburb }}</h1>
22
+                <p>
23
+                  <strong>Property Reference</strong>
24
+                  {{ currentProperty.propertyReference }}
25
+                </p>
26
+                <p
27
+                  v-if="!currentProperty.isSale"
28
+                  :class="[currentProperty.hasPendingOffer ? 'pendingOffer' : 'normalText']"
29
+                >
30
+                  <strong>{{ currentProperty.available }}</strong>
31
+                </p>
32
+                <p
33
+                  v-if="currentProperty.isSale && currentProperty.hasPendingOffer"
34
+                  class="pendingOffer"
35
+                >
36
+                  <strong>{{ currentProperty.available }}</strong>
37
+                </p>
38
+              </div>
39
+            </router-link>
40
+          </div>
41
+          <div v-else-if="currentProperty.propertyUsageType === 'Commercial'">
42
+            <router-link :to="`/property/commercial/property/${currentProperty.id}`">
43
+              <div class="portfolio-item p-4 wow fadeInUp justify-content-md-center">
44
+                <div class="feature-top pt-3 mb-2">
45
+                  <h3>{{ currentProperty.displayPrice }}</h3>
46
+                  <img
47
+                    style="max-height:165px; object-fit: cover;"
48
+                    :src="currentProperty.displayImage"
49
+                    alt
50
+                  />
51
+                </div>
52
+                <h1>{{ currentProperty.suburb }}</h1>
53
+                <p>
54
+                  <strong>Property Reference</strong>
55
+                  {{ currentProperty.propertyReference }}
56
+                </p>
57
+              </div>
58
+            </router-link>
59
+          </div>
60
+        </div>
61
+      </div>
62
+    </div>
63
+  </section>
64
+  <!-- #listings -->
65
+</template>
66
+
67
+<script>
68
+/* eslint-disable */
69
+
70
+export default {
71
+  props: {
72
+    properties: { type: Array, default: () => [] },
73
+    showSort: { type: Boolean, default: true },
74
+    salesType: { type: String, default: "Rent" }
75
+  },
76
+  methods: {
77
+    sortHighPrice() {
78
+      function compare(a, b) {
79
+        if (a.price < b.price) return 1;
80
+        if (a.price > b.price) return -1;
81
+        return 0;
82
+      }
83
+
84
+      return this.properties.sort(compare);
85
+    },
86
+    sortLowPrice() {
87
+      function compare(a, b) {
88
+        if (a.price < b.price) return -1;
89
+        if (a.price > b.price) return 1;
90
+        return 0;
91
+      }
92
+
93
+      return this.properties.sort(compare);
94
+    },
95
+    sortNewest() {
96
+      function compare(a, b) {
97
+        if (a.dateCreated < b.dateCreated) return 1;
98
+        if (a.dateCreated > b.dateCreated) return -1;
99
+        return 0;
100
+      }
101
+
102
+      return this.properties.sort(compare);
103
+    },
104
+    sortDateAvailable() {
105
+      function compare(a, b) {
106
+        if (a.dateAvailable > b.dateAvailable) return 1;
107
+        if (a.dateAvailable < b.dateAvailable) return -1;
108
+        return 0;
109
+      }
110
+
111
+      return this.properties.sort(compare);
112
+    }
113
+  }
114
+};
115
+</script>
116
+
117
+<style lang="scss" scoped></style>

+ 14
- 8
src/components/property/residential/residentialSearchResults.vue Zobrazit soubor

1
 <template>
1
 <template>
2
   <main id="main" style="margin-top:-20px; padding-bottom:50px">
2
   <main id="main" style="margin-top:-20px; padding-bottom:50px">
3
     <div v-if="wait" id="preloader"></div>
3
     <div v-if="wait" id="preloader"></div>
4
-    <section v-if="properties.length > 0">
4
+    <div class="row pt-5 justify-content-md-center">
5
+      <h3 v-if="propertySearch.salesType === 'Sale'">RESIDENTIAL PROPERTIES FOR SALE</h3>
6
+      <h3 v-else-if="propertySearch.salesType === 'Rent'">RESIDENTIAL PROPERTIES FOR RENT</h3>
7
+    </div>
8
+    <propertyCard
9
+      v-if="properties.length > 0"
10
+      name="propertyholder"
11
+      :properties="properties"
12
+      :showSort="false"
13
+    />
14
+    <!-- <section v-if="properties.length > 0">
5
       <div class="container">
15
       <div class="container">
6
-        <div class="row pt-5 justify-content-md-center">
7
-          <h3 v-if="propertySearch.salesType === 'Sale'">RESIDENTIAL PROPERTIES FOR SALE</h3>
8
-          <h3 v-else-if="propertySearch.salesType === 'Rent'">RESIDENTIAL PROPERTIES FOR RENT</h3>
9
-        </div>
10
         <div class="row justify-content-md-center">
16
         <div class="row justify-content-md-center">
11
           <div
17
           <div
12
             class="col-lg-3 col-md-6 col-sm-6"
18
             class="col-lg-3 col-md-6 col-sm-6"
21
                 <p>{{ currentProperty.shortDescription }}</p>
27
                 <p>{{ currentProperty.shortDescription }}</p>
22
                 <br />
28
                 <br />
23
 
29
 
24
-                <!-- <a href="commercialproperty-page.php" class="btn-white-border">VIEW</a> -->
30
+                <a href="commercialproperty-page.php" class="btn-white-border">VIEW</a>
25
                 <router-link
31
                 <router-link
26
                   class="btn-white-border"
32
                   class="btn-white-border"
27
                   :to="`/property/residential/property/${currentProperty.id}`"
33
                   :to="`/property/residential/property/${currentProperty.id}`"
32
           </div>
38
           </div>
33
         </div>
39
         </div>
34
       </div>
40
       </div>
35
-    </section>
41
+    </section> -->
36
     <section v-else id="intro" style="margin-bottom:-50px">
42
     <section v-else id="intro" style="margin-bottom:-50px">
37
       <div class="container">
43
       <div class="container">
38
         <div class="row d-flex justify-content-center">
44
         <div class="row d-flex justify-content-center">
69
 <script>
75
 <script>
70
 /* eslint-disable */
76
 /* eslint-disable */
71
 import { mapState, mapActions } from "vuex";
77
 import { mapState, mapActions } from "vuex";
72
-import propertyCard from "../propertyCard";
78
+import propertyCard from "../propertyCardSearch";
73
 
79
 
74
 export default {
80
 export default {
75
   name: "propertysearch",
81
   name: "propertysearch",

+ 26
- 19
src/components/property/residential/singleView/contentSection.vue Zobrazit soubor

91
                 <p v-html="property.description"></p>
91
                 <p v-html="property.description"></p>
92
               </div>
92
               </div>
93
             </div>
93
             </div>
94
-          </div>
95
-          <div>
96
-            <router-link
97
-              style="float:right"
98
-              class="btn-solid-blue mt-3"
99
-              :to="{ name: 'EnquireNow', params: { id: $route.params.id } }"
100
-              >MORE INFO...</router-link
101
-            >
102
-            <h4>Property Features</h4>
103
-            {{ propertyFeatures }}
104
-            <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
105
-              <div v-for="(field, j) in data.values" :key="j" class="col-md-6">
106
-                <div v-if="field.value.toUpperCase() != 'TRUE'">
107
-                  <i class="fa fa-check-circle"></i>
108
-                  {{ field.value }} {{ field.name }}
109
-                </div>
110
-                <div v-else>
111
-                  <i class="fa fa-check-circle"></i>
112
-                  {{ field.name }}
94
+            <div class="row">
95
+              <div class="col">
96
+                <h4>Property Features</h4>
97
+              </div>
98
+            </div>
99
+            <div class="row">
100
+              <div class="col-md-8">
101
+                <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
102
+                  <div v-for="(field, j) in data.values" :key="j" class="col-md-6">
103
+                    <div v-if="field.value !== 'yes'">
104
+                      <i class="fa fa-check-circle"></i>
105
+                      {{ field.value }} {{ field.name }}
106
+                    </div>
107
+                    <div v-else>
108
+                      <i class="fa fa-check-circle"></i>
109
+                      {{ field.name }}
110
+                    </div>
111
+                  </div>
113
                 </div>
112
                 </div>
114
               </div>
113
               </div>
114
+              <div class="col-md-4">
115
+                <router-link
116
+                  style="float:right"
117
+                  class="btn-solid-blue mt-3"
118
+                  :to="{ name: 'EnquireNow', params: { id: $route.params.id } }"
119
+                  >MORE INFO...</router-link
120
+                >
121
+              </div>
115
             </div>
122
             </div>
116
           </div>
123
           </div>
117
           <h4 v-if="property.video != null" class="mt-5">Video Tour</h4>
124
           <h4 v-if="property.video != null" class="mt-5">Video Tour</h4>

+ 78
- 77
src/components/shared/listView.vue Zobrazit soubor

1
 /* eslint-disable no-restricted-syntax */ /* eslint-disable guard-for-in */
1
 /* eslint-disable no-restricted-syntax */ /* eslint-disable guard-for-in */
2
 <template>
2
 <template>
3
   <div>
3
   <div>
4
-    <div style="height:5px"></div>
5
-    <div class="d-flex justify-content-between">
6
-      <div class="p-2" v-if="!hideSearch">
7
-        <float-label label="SEARCH">
8
-          <input v-model="searchItem" class="form-control uniInput mt-3" placeholder="Search..." />
4
+    <div class="row">
5
+      <div align="center" class="col">
6
+        <float-label class="mb-3" label="SEARCH" style="width:50%; float:center">
7
+          <input v-model="searchItem" class="form-control uniInput mt-3" placeholder="SEARCH" />
9
         </float-label>
8
         </float-label>
10
       </div>
9
       </div>
10
+    </div>
11
+
12
+    <div class="d-flex justify-content-between">
13
+      <div class="p-2" v-if="!hideSearch"></div>
11
       <div class="p-2" v-if="title">
14
       <div class="p-2" v-if="title">
12
         <h2>{{ title }}</h2>
15
         <h2>{{ title }}</h2>
13
       </div>
16
       </div>
14
       <div class="p-2">
17
       <div class="p-2">
15
         <div class="d-flex flex-row">
18
         <div class="d-flex flex-row">
16
           <div class="p2" v-if="showColumnChooser">
19
           <div class="p2" v-if="showColumnChooser">
17
-            <div
18
-              class="btn-solid-blue cursor-pointer"
19
-              data-toggle="modal"
20
-              data-target="#myModal"
21
-            >Column Chooser</div>
20
+            <div class="btn-solid-blue cursor-pointer" data-toggle="modal" data-target="#myModal">
21
+              Column Chooser
22
+            </div>
22
             <div class="col-md-12">
23
             <div class="col-md-12">
23
               <div id="myModal" class="modal fade" role="dialog">
24
               <div id="myModal" class="modal fade" role="dialog">
24
                 <div class="modal-dialog modal-lg" style="width:500px">
25
                 <div class="modal-dialog modal-lg" style="width:500px">
37
             </div>
38
             </div>
38
           </div>
39
           </div>
39
           <div class="p2" v-if="selectedItems.length > 0">
40
           <div class="p2" v-if="selectedItems.length > 0">
40
-            <div class="btn-solid-blue cursor-pointer" @click="onClearSelected()">Clear Selected</div>
41
+            <div class="btn-solid-blue cursor-pointer" @click="onClearSelected()">
42
+              Clear Selected
43
+            </div>
41
           </div>
44
           </div>
42
           <div class="p2" v-if="showNew">
45
           <div class="p2" v-if="showNew">
43
             <div class="btn-solid-blue cursor-pointer" @click="onNew()">New</div>
46
             <div class="btn-solid-blue cursor-pointer" @click="onNew()">New</div>
62
                 :class="{ active: hover === c }"
65
                 :class="{ active: hover === c }"
63
               >
66
               >
64
                 <div class="d-flex bd-highlight">
67
                 <div class="d-flex bd-highlight">
65
-                  <div
66
-                    v-if="displayHeaders.length === 0"
67
-                    class="p-2 w-100 bd-highlight"
68
-                  >{{ column | toProper }}</div>
69
-                  <div
70
-                    v-else
71
-                    class="p-2 w-100 bd-highlight"
72
-                  >{{ displayHeaders[c] !== "" ? displayHeaders[c] : column | toProper }}</div>
68
+                  <div v-if="displayHeaders.length === 0" class="p-2 w-100 bd-highlight">
69
+                    {{ column | toProper }}
70
+                  </div>
71
+                  <div v-else class="p-2 w-100 bd-highlight">
72
+                    {{ displayHeaders[c] !== "" ? displayHeaders[c] : column | toProper }}
73
+                  </div>
73
                   <div class="p-2 flex-shrink-1 bd-highlight">
74
                   <div class="p-2 flex-shrink-1 bd-highlight">
74
                     <img
75
                     <img
75
                       src="../../../public/img/sort-up.png"
76
                       src="../../../public/img/sort-up.png"
90
             <th v-if="deleteable"></th>
91
             <th v-if="deleteable"></th>
91
           </tr>
92
           </tr>
92
         </thead>
93
         </thead>
93
-        <tbody class="table">
94
+
95
+        <tbody>
94
           <tr
96
           <tr
95
             v-for="(item, i) in DisplayItems"
97
             v-for="(item, i) in DisplayItems"
96
             :key="i"
98
             :key="i"
98
             :class="{ selected: isSelected(i), 'cursor-pointer': allowSelect }"
100
             :class="{ selected: isSelected(i), 'cursor-pointer': allowSelect }"
99
           >
101
           >
100
             <td v-for="(column, c) in Columns" :key="c">
102
             <td v-for="(column, c) in Columns" :key="c">
101
-              <div
102
-                v-if="displayFormats.length === 0"
103
-              >{{ isObject(item[column]) ? item[column].display : item[column] }}</div>
103
+              <div v-if="displayFormats.length === 0">
104
+                {{ isObject(item[column]) ? item[column].display : item[column] }}
105
+              </div>
104
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'date'">
106
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'date'">
105
-                <div
106
-                  v-if="item[column] !== '0001-01-01T00:00:00'"
107
-                >{{ isObject(item[column]) ? item[column].display : item[column] | toDate }}</div>
107
+                <div v-if="item[column] !== '0001-01-01T00:00:00'">
108
+                  {{ isObject(item[column]) ? item[column].display : item[column] | toDate }}
109
+                </div>
108
               </div>
110
               </div>
109
               <div
111
               <div
112
+                style="padding-left:10px;white-space: nowrap;"
110
                 v-else-if="displayFormats.length > 0 && displayFormats[c] === 'money'"
113
                 v-else-if="displayFormats.length > 0 && displayFormats[c] === 'money'"
111
-              >{{ isObject(item[column]) ? item[column].display : item[column] | toCurrency }}</div>
114
+              >
115
+                {{ isObject(item[column]) ? item[column].display : item[column] | toCurrency }}
116
+              </div>
112
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'image'">
117
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'image'">
113
                 <img :src="item[column]" style="height:100px; width:100px; object-fit: cover;" />
118
                 <img :src="item[column]" style="height:100px; width:100px; object-fit: cover;" />
114
               </div>
119
               </div>
115
               <div v-else>{{ isObject(item[column]) ? item[column].display : item[column] }}</div>
120
               <div v-else>{{ isObject(item[column]) ? item[column].display : item[column] }}</div>
116
             </td>
121
             </td>
117
             <td v-if="showCustomAction" class="my-width">
122
             <td v-if="showCustomAction" class="my-width">
118
-              <button
119
-                type="button"
120
-                class="btn my-btn"
121
-                @click="onCustomClick(item)"
122
-              >{{ CustomActionHeading }}</button>
123
+              <button type="button" class="btn my-btn" @click="onCustomClick(item)">
124
+                <p v-if="CustomActionHeading !== 'Publish'">{{ CustomActionHeading }}</p>
125
+                <img v-else src="../../../public/img/icons/Upload.png" height="25" width="25" />
126
+              </button>
123
             </td>
127
             </td>
128
+
124
             <td v-if="editable" class="my-width">
129
             <td v-if="editable" class="my-width">
125
               <a @click="onEdit(item)" class="p-3">
130
               <a @click="onEdit(item)" class="p-3">
126
                 <img src="../../../public/img/icons/Edit.png" height="25" width="25" />
131
                 <img src="../../../public/img/icons/Edit.png" height="25" width="25" />
139
       <div class="d-flex justify-content-between" v-if="showPager">
144
       <div class="d-flex justify-content-between" v-if="showPager">
140
         <div class="p-1">
145
         <div class="p-1">
141
           {{
146
           {{
142
-          currentPage +
143
-          " / " +
144
-          PageCount +
145
-          (!hideItemCount ? " - (" + FilteredItems.length + " items)" : "")
147
+            currentPage +
148
+              " / " +
149
+              PageCount +
150
+              (!hideItemCount ? " - (" + FilteredItems.length + " items)" : "")
146
           }}
151
           }}
147
         </div>
152
         </div>
148
         <div class="p-1">
153
         <div class="p-1">
187
   components: {
192
   components: {
188
     BasePagination,
193
     BasePagination,
189
     Alert,
194
     Alert,
190
-    ListViewControl,
195
+    ListViewControl
191
   },
196
   },
192
   mounted() {
197
   mounted() {
193
     try {
198
     try {
203
   },
208
   },
204
   props: {
209
   props: {
205
     compact: {
210
     compact: {
206
-      default: true,
211
+      default: false
207
     },
212
     },
208
     allowSelect: {
213
     allowSelect: {
209
-      default: true,
214
+      default: true
210
     },
215
     },
211
     allowMultipleSelect: {
216
     allowMultipleSelect: {
212
-      default: false,
217
+      default: false
213
     },
218
     },
214
     hideSearch: {
219
     hideSearch: {
215
-      default: false,
220
+      default: false
216
     },
221
     },
217
     showNew: {
222
     showNew: {
218
-      default: true,
223
+      default: true
219
     },
224
     },
220
     items: undefined,
225
     items: undefined,
221
     editable: {
226
     editable: {
222
-      default: false,
227
+      default: false
223
     },
228
     },
224
     deleteable: {
229
     deleteable: {
225
-      default: false,
230
+      default: false
226
     },
231
     },
227
     columnCount: {
232
     columnCount: {
228
-      default: 6,
233
+      default: 6
229
     },
234
     },
230
     showPager: {
235
     showPager: {
231
-      default: true,
236
+      default: true
232
     },
237
     },
233
     title: {
238
     title: {
234
-      default: undefined,
239
+      default: undefined
235
     },
240
     },
236
     sortKey: {
241
     sortKey: {
237
-      default: "id",
242
+      default: "id"
238
     },
243
     },
239
     hideItemCount: {
244
     hideItemCount: {
240
-      default: false,
245
+      default: false
241
     },
246
     },
242
     currentPage: {
247
     currentPage: {
243
-      default: 1,
248
+      default: 1
244
     },
249
     },
245
     bordered: {
250
     bordered: {
246
-      default: true,
251
+      default: false
247
     },
252
     },
248
     striped: {
253
     striped: {
249
-      default: true,
254
+      default: true
250
     },
255
     },
251
     showColumnChooser: {
256
     showColumnChooser: {
252
-      default: true,
257
+      default: true
253
     },
258
     },
254
     displayColumns: {
259
     displayColumns: {
255
       type: Array,
260
       type: Array,
256
-      default: () => [],
261
+      default: () => []
257
     },
262
     },
258
     displayFormats: {
263
     displayFormats: {
259
       type: Array,
264
       type: Array,
260
-      default: () => [],
265
+      default: () => []
261
     },
266
     },
262
     displayHeaders: {
267
     displayHeaders: {
263
       type: Array,
268
       type: Array,
264
-      default: () => [],
269
+      default: () => []
265
     },
270
     },
266
     showCustomAction: {
271
     showCustomAction: {
267
-      default: false,
272
+      default: false
268
     },
273
     },
269
     CustomActionHeading: {
274
     CustomActionHeading: {
270
-      default: "",
275
+      default: ""
271
     },
276
     },
272
     CustomActionCondition: {
277
     CustomActionCondition: {
273
-      default: "",
274
-    },
278
+      default: ""
279
+    }
275
   },
280
   },
276
   data() {
281
   data() {
277
     return {
282
     return {
284
       visibleItemsPerPageCount: 20,
289
       visibleItemsPerPageCount: 20,
285
       itemsPerPageList: ItemsPerPageList,
290
       itemsPerPageList: ItemsPerPageList,
286
       visibleColumn: [],
291
       visibleColumn: [],
287
-      allColumn: [],
292
+      allColumn: []
288
     };
293
     };
289
   },
294
   },
290
   methods: {
295
   methods: {
306
         for (const i in Object.keys(this.items)) {
311
         for (const i in Object.keys(this.items)) {
307
           const item = this.items[i];
312
           const item = this.items[i];
308
           for (const o in Object.keys(item)) {
313
           for (const o in Object.keys(item)) {
309
-            if (
310
-              !listAll.includes(Object.keys(item)[o]) &&
311
-              !Array.isArray(Object.values(item)[o])
312
-            ) {
314
+            if (!listAll.includes(Object.keys(item)[o]) && !Array.isArray(Object.values(item)[o])) {
313
               const columnName = Object.keys(item)[o];
315
               const columnName = Object.keys(item)[o];
314
-              if (!listAll.some((x) => x.column === columnName)) {
316
+              if (!listAll.some(x => x.column === columnName)) {
315
                 listAll.push({
317
                 listAll.push({
316
                   column: columnName,
318
                   column: columnName,
317
-                  show:
318
-                    _.filter(listAll, (x) => x.show).length < this.columnCount,
319
+                  show: _.filter(listAll, x => x.show).length < this.columnCount
319
                 });
320
                 });
320
               }
321
               }
321
             }
322
             }
330
     },
331
     },
331
     isSelected(i) {
332
     isSelected(i) {
332
       const ind = this.getActualIndex(i);
333
       const ind = this.getActualIndex(i);
333
-      return _.some(this.selectedItems, (x) => x === ind);
334
+      return _.some(this.selectedItems, x => x === ind);
334
     },
335
     },
335
     onNew() {
336
     onNew() {
336
       this.$emit("onNew");
337
       this.$emit("onNew");
366
     },
367
     },
367
     onRowClick(item, i) {
368
     onRowClick(item, i) {
368
       const ind = this.getActualIndex(i);
369
       const ind = this.getActualIndex(i);
369
-      if (_.some(this.selectedItems, (x) => x === ind)) {
370
-        this.selectedItems = this.selectedItems.filter((x) => x !== ind);
370
+      if (_.some(this.selectedItems, x => x === ind)) {
371
+        this.selectedItems = this.selectedItems.filter(x => x !== ind);
371
       } else {
372
       } else {
372
         if (!this.allowMultipleSelect) {
373
         if (!this.allowMultipleSelect) {
373
           this.selectedItems = [];
374
           this.selectedItems = [];
420
         if (array[i] === value) return true;
421
         if (array[i] === value) return true;
421
       }
422
       }
422
       return false;
423
       return false;
423
-    },
424
+    }
424
   },
425
   },
425
   computed: {
426
   computed: {
426
     ListWidth() {
427
     ListWidth() {
447
           listColumns.push(this.displayColumns[i]);
448
           listColumns.push(this.displayColumns[i]);
448
         }
449
         }
449
       } else {
450
       } else {
450
-        const list = _.filter(this.allColumn, (x) => x.show);
451
+        const list = _.filter(this.allColumn, x => x.show);
451
         for (const i in list) {
452
         for (const i in list) {
452
           const item = list[i];
453
           const item = list[i];
453
           if (item) {
454
           if (item) {
464
       return list;
465
       return list;
465
     },
466
     },
466
     FilteredItems() {
467
     FilteredItems() {
467
-      const list = _.filter(this.items, (item) =>
468
+      const list = _.filter(this.items, item =>
468
         Object.values(item).some(
469
         Object.values(item).some(
469
-          (i) =>
470
+          i =>
470
             JSON.stringify(i)
471
             JSON.stringify(i)
471
               .toLowerCase()
472
               .toLowerCase()
472
               .indexOf(this.searchItem.toLowerCase()) > -1
473
               .indexOf(this.searchItem.toLowerCase()) > -1
484
       return list.slice(startSlice, endSlice);
485
       return list.slice(startSlice, endSlice);
485
     },
486
     },
486
 
487
 
487
-    GetAllColumn() {},
488
-  },
488
+    GetAllColumn() {}
489
+  }
489
 };
490
 };
490
 </script>
491
 </script>
491
 <style scoped>
492
 <style scoped>

+ 1
- 1
src/main.js Zobrazit soubor

63
     return value;
63
     return value;
64
   }
64
   }
65
   const formatter = new Intl.NumberFormat("en-US", {
65
   const formatter = new Intl.NumberFormat("en-US", {
66
-    minimumFractionDigits: 2
66
+    minimumFractionDigits: 0
67
   });
67
   });
68
   return `R ${formatter.format(value)}`;
68
   return `R ${formatter.format(value)}`;
69
 });
69
 });

Načítá se…
Zrušit
Uložit