Skip to content

Commit 252fac6

Browse files
committed
update
1 parent d7f9dc0 commit 252fac6

File tree

12 files changed

+259
-179
lines changed

12 files changed

+259
-179
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "enab",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"description": "Enab System",
55
"main": "./dist/main/index.js",
66
"scripts": {

src/renderer/components/Utilities/table.vue

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<template>
22
<div>
3-
<div class="table-responsive" v-if="data">
3+
<div class="table-responsive" v-if="data.length > 0">
4+
<c-input-group v-if="properties.search" mt=1>
5+
<c-input-left-element>
6+
<i class="fas fa-search"></i>
7+
</c-input-left-element>
8+
<c-input py=5 v-model="searchInput" type="text" placeholder="بحث" />
9+
</c-input-group>
410
<table class="table table-cards text-right">
511
<thead>
612
<tr class="text-light">
@@ -23,27 +29,21 @@
2329
<!-- Control Column -->
2430
<td class="align-middle">
2531
<!-- Custom Control -->
26-
<slot name="control" />
32+
<!-- <slot name="control" /> -->
2733

2834
<!-- Controllable Buttons -->
2935
<div class="d-inline-block" v-if="x.id">
30-
<c-button v-if="properties.watch" size="sm" @click="$emit('watch', x.id)" variant="ghost">
31-
<i class="fas fa-eye text-dark"></i>
32-
</c-button>
33-
34-
<c-button v-if="properties.edit" variant-color="blue" size="sm" @click="$emit('edit', x.id)" variant="ghost">
35-
<i class="fas fa-pen"></i>
36-
</c-button>
37-
38-
<c-button v-if="properties.remove" variant-color="red" size="sm" @click="$emit('remove', x.id)" variant="ghost">
39-
<i class="fas fa-times"></i>
40-
</c-button>
36+
<div v-for="control in properties.control" :key="control.name" class="d-inline-block">
37+
<c-button v-if="$_.get(x, control.column ? control.column : 'id')" size="sm" @click="$emit(control.name, $_.get(x, control.column ? control.column : 'id'))" variant="ghost">
38+
<i class="fas" :class="[control.icon, 'text-'+(control.variant ? control.variant : 'dark')]"></i>
39+
</c-button>
40+
</div>
4141
</div>
4242
</td>
4343
</tr>
4444
</tbody>
4545
</table>
46-
<UtilitiesLoadMore @page="paginatedCounter = $event" @data="paginatedData = $event" :data="data" perPage="10" />
46+
<UtilitiesLoadMore @page="paginatedCounter = $event" @data="paginatedData = $event" :data="datas" perPage="10" />
4747

4848
</div>
4949
<div v-else>
@@ -52,9 +52,13 @@
5252
<c-alert-title :mt="4" :mb="1" fontSize="xl" v-if="properties.noData.message">{{properties.noData.message}}</c-alert-title>
5353
<c-alert-title :mt="4" :mb="1" fontSize="xl" v-else>لايوجد بيانات</c-alert-title>
5454
<c-alert-description maxWidth="sm">
55-
<span v-if="properties.noData.tip">{{properties.noData.tip}}</span>
55+
<span v-if="properties.noData.tip">
56+
<nuxt-link v-if="properties.noData.link" :to="properties.noData.link" class="fw-bold text-light">
57+
{{properties.noData.tip}}
58+
</nuxt-link>
59+
<span v-else>{{properties.noData.tip}}</span>
60+
</span>
5661
<span v-else></span>
57-
<nuxt-link v-if="properties.noData.link" to="/supermarket/new-order" class="fw-bold text-light"> نافذة الطلبات </nuxt-link>
5862
</c-alert-description>
5963
</c-alert>
6064
</div>
@@ -68,12 +72,23 @@ export default {
6872
columns() {
6973
return this.properties.head.filter((x) => x.column);
7074
},
75+
datas() {
76+
let datas = this.data;
77+
if (this.searchInput !== "") {
78+
datas = datas.filter((x) => {
79+
let t = this.$_.get(x, this.properties.search);
80+
return this.$_.includes((t + ''), this.searchInput);
81+
});
82+
}
83+
return datas;
84+
},
7185
},
7286
data() {
7387
return {
7488
// Pagination
7589
paginatedData: [],
7690
paginatedCounter: 0,
91+
searchInput: "",
7792
};
7893
},
7994
};

src/renderer/components/supermarket/Menu.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
<div class="row mb-3">
1414
<SupermarketMenuQuickAccess />
1515
</div>
16-
<div class="row d-flex align-content-stretch flex-wrap components-height">
16+
<div v-if="updateDetails">
17+
<SupermarketMenuUpdateDetails @toggle="updateDetails = false" />
18+
</div>
19+
<div v-else class="row d-flex align-content-stretch flex-wrap components-height">
1720
<!-- Quick Access Buttons -->
1821
<!-- Quick Change Buttons -->
1922
<div class="col-3">
@@ -37,7 +40,7 @@
3740
</a>
3841
</div>
3942
<div class="col-6">
40-
<SupermarketMenuUpdate />
43+
<SupermarketMenuUpdate @toggle="updateDetails = true" />
4144
</div>
4245
</div>
4346
</div>
@@ -74,6 +77,7 @@ export default {
7477
data() {
7578
return {
7679
day: true,
80+
updateDetails: false
7781
};
7882
},
7983
};

src/renderer/components/supermarket/Menu/Update.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<template>
22
<div>
3-
<div v-if="!updateProgress.percent" class="content py-4 text-center d-flex flex-column justify-content-center align-items-center">
3+
<div @click="$emit('toggle')" v-if="!updateProgress.percent" class="content pointer py-4 text-center d-flex flex-column justify-content-center align-items-center">
44
<i class="fas fa-history fa-3x text-light"></i>
5-
<span class="text-light mt-3 fw-bold h6">{{version}} <small class="text-light">(اخر اصدار)</small></span>
5+
<span class="text-light mt-3 fw-bold h6">{{version}}
6+
<small class="text-light">(اخر اصدار)</small>
7+
</span>
68
</div>
79
<div v-if="updateProgress.percent && updateProgress.percent !==100" class="content bg-info text-center d-flex flex-column justify-content-center align-items-center">
810
<i class="fas fa-redo fa-spin fa-3x text-light"></i>
@@ -35,12 +37,16 @@ export default {
3537
data() {
3638
return {
3739
version: "",
40+
show: false,
3841
};
3942
},
4043
methods: {
4144
updateCompleted() {
4245
ipcRenderer.send("restart_app");
4346
},
47+
closeModal() {
48+
this.show = false;
49+
},
4450
},
4551
};
4652
</script>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<template>
2+
<div>
3+
<div class="row d-flex align-content-stretch flex-wrap components-height m-0 content">
4+
<div class="col-12">
5+
<div class="row mt-3">
6+
<div class="col-6">
7+
<span class="fs-3">
8+
قائمة التحديثات للإصدار <span class="badge">({{version}})</span>
9+
</span>
10+
</div>
11+
<div class="col-6 text-left">
12+
<c-button @click="$emit('toggle')" class="content text-light px-4" variant="ghost">
13+
رجوع
14+
</c-button>
15+
</div>
16+
</div>
17+
<hr class="my-3" />
18+
<div class="row mb-3">
19+
<div class="col-12">
20+
<div v-if="loading">
21+
<UtilitiesLoading />
22+
</div>
23+
<div v-else>
24+
<ul class="list-group r-2" v-if="list.length > 0">
25+
<li v-for="item in list" :key="item" class="list-group-item fs-4 text-light b-1">{{ item }}</li>
26+
</ul>
27+
<div v-else class="text-center b-1 r-2 p-3 content">
28+
<span class="fs-4 text-light">لايوجد معلومات</span>
29+
</div>
30+
</div>
31+
</div>
32+
</div>
33+
</div>
34+
</div>
35+
</div>
36+
</template>
37+
38+
<script>
39+
import { mapMutations, mapGetters, mapActions, mapState } from "vuex";
40+
const { remote, ipcRenderer } = require("electron");
41+
export default {
42+
async mounted() {
43+
try {
44+
this.loading = true
45+
this.version = await this.$version();
46+
47+
await this.$axios
48+
.get("/api/release/notes?version=" + "1.6.0", {
49+
withCredentials: true,
50+
})
51+
.then((response) => {
52+
this.list = response.data.data;
53+
})
54+
.catch((error) => {
55+
console.log(error);
56+
});
57+
this.loading = false
58+
} catch (e) {
59+
console.log(e);
60+
}
61+
},
62+
data() {
63+
return {
64+
version: "",
65+
list: [],
66+
loading: true
67+
};
68+
},
69+
};
70+
</script>
71+
72+
<style lang="scss" scoped>
73+
</style>

src/renderer/components/supermarket/control/categories.vue

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@
3535
</span>
3636
</div>
3737
</div>
38-
39-
<div class="col-xl-12 col-md-12">
40-
<c-input-group mt=1>
41-
<c-input-left-element>
42-
<i class="fas fa-search"></i>
43-
</c-input-left-element>
44-
<c-input py=5 v-model="search" type="text" placeholder="بحث" />
45-
</c-input-group>
46-
</div>
4738
</div>
4839

4940
<div class="mt-3 mb-3">
@@ -98,8 +89,11 @@ export default {
9889
message: "لايوجد فئات",
9990
tip: "يمكن إضافة فئات من خلال (إضافة فئة)",
10091
},
101-
edit: true,
102-
remove: true,
92+
search: "name",
93+
control: [
94+
{name: "edit", icon: "fa-pen", variant: "primary"},
95+
{name: "remove", icon: "fa-times", variant: "danger"},
96+
],
10397
head: [
10498
{ title: "الاسم", column: "name" },
10599
{ title: "عدد المنتجات", column: "products_count" },
@@ -142,11 +136,6 @@ export default {
142136
countUp: "supermarket/categories/countUp",
143137
}),
144138
},
145-
watch: {
146-
...mapActions({
147-
search: "supermarket/categories/search",
148-
}),
149-
},
150139
};
151140
</script>
152141

src/renderer/components/supermarket/control/customers.vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ export default {
9898
message: "لايوجد زبائن",
9999
tip: "يمكن إضافة زبون من خلال (إضافة زبون)",
100100
},
101-
edit: true,
102-
remove: true,
103-
watch: true,
101+
control: [
102+
{name: "watch", icon: "fa-eye"},
103+
{name: "edit", icon: "fa-pen", variant: "primary"},
104+
{name: "remove", icon: "fa-times", variant: "danger"},
105+
],
104106
head: [
105107
{ title: "الاسم", column: "name" },
106108
{ title: "الدين", column: "debt" },
@@ -138,11 +140,6 @@ export default {
138140
fetchCustomers: "supermarket/customers/fetchCustomers",
139141
}),
140142
},
141-
watch: {
142-
...mapActions({
143-
search: "supermarket/customers/search",
144-
}),
145-
},
146143
};
147144
</script>
148145

0 commit comments

Comments
 (0)