add library, navigation

This commit is contained in:
Amir
2022-08-28 08:33:28 +08:00
parent 7b08280693
commit 8e1cba67cf
15 changed files with 306 additions and 112 deletions
+34
View File
@@ -19,6 +19,7 @@
"postcss": "^8",
"vue": "^3.2.13",
"vue-router": "^4.0.14",
"vue-sweetalert2": "^5.0.5",
"vuex": "^4.0.2"
},
"devDependencies": {
@@ -9068,6 +9069,15 @@
"node": ">= 10"
}
},
"node_modules/sweetalert2": {
"version": "11.4.29",
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.4.29.tgz",
"integrity": "sha512-UMCZgyEk0m+KizxspB8Bsm5ZQRdguba2t2+Rf0r8XBmq5YqhXq7ItV2C15A3VLfRlxHnEJBTYg6hkSk/x+5Ofw==",
"funding": {
"type": "individual",
"url": "https://sweetalert2.github.io/#donations"
}
},
"node_modules/tapable": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
@@ -9588,6 +9598,17 @@
"integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=",
"dev": true
},
"node_modules/vue-sweetalert2": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/vue-sweetalert2/-/vue-sweetalert2-5.0.5.tgz",
"integrity": "sha512-Q7+TjQxNwGruT2jfPaSKMz18HHWs81r4umEwlrrtOf/QL5Iwl1T+tUaNkcvKB7Rf9rYftubt7NnOMjfDMnDH3A==",
"dependencies": {
"sweetalert2": "11.x"
},
"peerDependencies": {
"vue": "*"
}
},
"node_modules/vue-template-es2015-compiler": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz",
@@ -16971,6 +16992,11 @@
}
}
},
"sweetalert2": {
"version": "11.4.29",
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.4.29.tgz",
"integrity": "sha512-UMCZgyEk0m+KizxspB8Bsm5ZQRdguba2t2+Rf0r8XBmq5YqhXq7ItV2C15A3VLfRlxHnEJBTYg6hkSk/x+5Ofw=="
},
"tapable": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
@@ -17357,6 +17383,14 @@
}
}
},
"vue-sweetalert2": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/vue-sweetalert2/-/vue-sweetalert2-5.0.5.tgz",
"integrity": "sha512-Q7+TjQxNwGruT2jfPaSKMz18HHWs81r4umEwlrrtOf/QL5Iwl1T+tUaNkcvKB7Rf9rYftubt7NnOMjfDMnDH3A==",
"requires": {
"sweetalert2": "11.x"
}
},
"vue-template-es2015-compiler": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz",
+1
View File
@@ -18,6 +18,7 @@
"postcss": "^8",
"vue": "^3.2.13",
"vue-router": "^4.0.14",
"vue-sweetalert2": "^5.0.5",
"vuex": "^4.0.2"
},
"devDependencies": {
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

+3 -2
View File
@@ -5,12 +5,13 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico"> -->
<link rel="icon" href="img/arrahn_favicon.ico">
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');
</style>
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
<title>Lelong | Ar-Rahn</title>
<title>eLelong | Ar-Rahn</title>
</head>
<body>
+1 -13
View File
@@ -24,20 +24,8 @@ export default {
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
/* background-color: #e8ebef; */
}
.list {
padding: 30px;
display: inline-flex;
}
.list a {
font-weight: bold;
color: #2c3e50;
padding: 10px;
}
.list a.router-link-exact-active {
color: #42b983;
}
</style>
+3 -5
View File
@@ -111,16 +111,14 @@
</div>
<div class="col">
<table class="table table-bordered">
<thead>
<tr>
<tbody>
<tr class="table-light">
<th scope="col">Bil</th>
<th scope="col">Jenis</th>
<th scope="col">Karat</th>
<th scope="col">Berat</th>
<th scope="col">Harga Asas</th>
</tr>
</thead>
<tbody>
<tr
v-for="(marhun, index) in theData.lelongbidmarhun"
v-bind:key="marhun"
@@ -134,7 +132,7 @@
<tr style="text-transform: uppercase">
<th colspan="3">Jumlah</th>
<th>{{ theData.berat }}g</th>
<th colspan="2"></th>
<th>RM{{ theData.hargaasas }}</th>
</tr>
</tbody>
</table>
+14 -7
View File
@@ -3,14 +3,15 @@
<div class="container">
<div class="row justify-content-center">
<div class="col-10">
<h2>Rekod Bidaan Hari Ini : {{ date }}</h2>
<button
v-on:click="reloadComponent()"
class="badge btn-secondary m-2"
>
Reload <i class="bi bi-arrow-clockwise"></i>
</button>
<base-card>
<button
v-on:click="reloadComponent()"
class="badge btn-secondary m-2"
>
Reload <i class="bi bi-arrow-clockwise"></i>
</button>
<h5>REKOD BIDAAN HARI INI : {{date}}</h5>
<bid-record-list v-bind:key="statusComponent"></bid-record-list>
</base-card>
</div>
@@ -51,3 +52,9 @@ export default {
},
};
</script>
<style scoped>
h2 {
font-weight: 600;
}
</style>
+37 -6
View File
@@ -184,7 +184,6 @@
<th scope="col">Jenis Marhun</th>
<th scope="col">Karat</th>
<th scope="col">Berat</th>
<th scope="col">Nota</th>
<th scope="col">Harga Asas</th>
</tr>
<tr
@@ -195,13 +194,11 @@
<td>{{ data.marhun }}</td>
<td>{{ data.karat }}</td>
<td>{{ data.berat }}g</td>
<td>{{ data.nota }}</td>
<td>RM{{ data.hargaasas }}</td>
</tr>
<tr style="text-transform: uppercase">
<th colspan="3">Jumlah</th>
<th>{{ theSurat.berat }}g</th>
<th></th>
<th>RM{{ theSurat.hargaasas }}</th>
</tr>
</tbody>
@@ -679,6 +676,14 @@ export default {
.then((response) => {
this.isLoading = false;
if (response.data.success == true) {
this.$swal.fire({
icon: "success",
title: "Surat Berjaya Dipadam",
confirmButtonColor: "#344871",
confirmButtonText: "OK",
allowOutsideClick: false,
allowEscapeKey: false,
});
this.$emit("reloadComponent");
} else if (response.data.success == false) {
alert(response.data.message);
@@ -701,8 +706,6 @@ export default {
updateItem(value) {
this.v$.$validate();
if (!this.v$.$error) {
this.$refs.editClose.click();
this.isLoading = true;
this.formEdit.lelongBidId = value.id;
this.formEdit.hargabida = this.jumlahBidaan;
axios
@@ -712,7 +715,17 @@ export default {
},
})
.then((response) => {
this.isLoading = true;
this.$refs.editClose.click();
console.log(response);
this.$swal.fire({
icon: "success",
title: "Bidaan Berjaya Diubah",
confirmButtonColor: "#344871",
confirmButtonText: "OK",
allowOutsideClick: false,
allowEscapeKey: false,
});
this.isLoading = false;
this.$emit("reloadComponent");
})
@@ -734,6 +747,15 @@ export default {
})
.then((response) => {
this.$refs.daftarBidaanClose.click();
this.$swal.fire({
icon: "success",
title: "Bidaan Berjaya Didaftarkan",
text: "Sila ke halaman rekod untuk senarai rekod bidaan.",
confirmButtonColor: "#344871",
confirmButtonText: "OK",
allowOutsideClick: false,
allowEscapeKey: false,
});
this.loading = false;
console.log(response);
this.$emit("reloadComponent");
@@ -744,7 +766,16 @@ export default {
console.log(error);
});
} else {
this.$refs.daftarBidaanOpen.click();
this.$refs.daftarBidaanClose.click();
this.$swal.fire({
icon: "error",
title: "Gagal Daftar Bidaan",
text: "Sila tambah item ke dalam troli.",
confirmButtonColor: "#344871",
confirmButtonText: "OK",
allowOutsideClick: false,
allowEscapeKey: false,
});
}
},
},
+26 -17
View File
@@ -28,8 +28,6 @@
"
>
<svg class="bi me-2" width="40" height="32">
<!-- <use xlink:href="#bootstrap" /> -->
<!-- <i class="bi bi-spotify"></i> -->
</svg>
</a>
@@ -39,24 +37,18 @@
>Permodalan Kelantan Berhad</a
>
</li>
<!-- <li class="nav-item">
<a href="#" class="nav-link px-2 text-muted">Home</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link px-2 text-muted">Features</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link px-2 text-muted">Pricing</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link px-2 text-muted">FAQs</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link px-2 text-muted">About</a>
</li> -->
</ul>
</footer>
</div>
<!-- <footer class="footer">
<div class="footer-first-row">
<img class="footer-img" src="img/logo_pkb.png" alt="logo-pkb" />
<div class="footer-title">Permodalan Kelantan Berhad</div>
</div>
<div class="footer-second-row">
<div>Dibangunkan oleh Unit Teknologi Maklumat PKB</div>
</div>
</footer> -->
</template>
<style scoped>
@@ -65,4 +57,21 @@
bottom: 0;
width: 100%;
}
.footer {
}
.footer-first-row {
display: flex;
justify-content: center;
align-items: center;
height: 3.2rem;
gap: 1rem;
border-top: 0.5px solid #1d3461;
padding: 0 1.6rem;
}
.footer-img {
height: 1.6rem;
}
</style>
+164 -56
View File
@@ -1,69 +1,74 @@
<template>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<router-link class="navbar-brand" v-bind:to="{ name: 'home' }"
>Sistem Lelong</router-link
>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<router-link class="nav-link" v-bind:to="{ name: 'home' }"
>Utama</router-link
>
<header class="header">
<div class="company-title" type="button" v-on:click="toHome()">
<div class="logo-title">eLelong</div>
<img class="logo-img" src="img/logo_arrahn.png" alt="arrahn-logo" />
</div>
<nav class="main-nav">
<ul class="main-nav-list">
<li>
<router-link class="main-nav-link" v-bind:to="{ name: 'home' }"
>Utama <i class="ms-1 bi bi-house"></i></router-link
>
</li>
<li>
<router-link class="main-nav-link" v-bind:to="{ name: 'list' }"
>Senarai <i class="bi ms-1 bi-clipboard2-data"></i></router-link
>
</li>
<li>
<router-link class="main-nav-link" v-bind:to="{ name: 'cart' }"
>Troli <i class="ms-1 bi bi-cart3"></i></router-link
>
</li>
<li>
<router-link class="main-nav-link" v-bind:to="{ name: 'bid-record' }"
>Rekod <i class="bi ms-1 bi-clock-history"></i></router-link
>
</li>
<li>
<router-link class="main-nav-link" v-bind:to="{ name: 'result' }"
>Keputusan <i class="bi ms-1 bi-trophy"></i></router-link
>
</li>
</ul>
</nav>
<div class="profile-title">
<div class="dropdown">
<div
class="dropdown-toggle"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<i class="bi bi-person-circle me-1"></i>Hi, {{ name }}!
</div>
<ul class="dropdown-menu">
<li>
<div type="button" class="dropdown-item" v-on:click="toProfile()">
Profil <i class="bi bi-person-workspace"></i>
</div>
</li>
<li class="nav-item">
<router-link class="nav-link" v-bind:to="{ name: 'list' }"
>Senarai</router-link
>
</li>
<li class="nav-item">
<router-link class="nav-link" v-bind:to="{ name: 'cart' }"
>Troli</router-link
>
</li>
<li class="nav-item">
<router-link class="nav-link" v-bind:to="{ name: 'bid-record' }"
>Rekod Bidaan</router-link
>
</li>
<li class="nav-item">
<router-link class="nav-link" v-bind:to="{ name: 'result' }"
>Keputusan</router-link
>
</li>
<li class="nav-item">
<router-link class="nav-link" v-bind:to="{ name: 'profile' }"
>Profil</router-link
>
</li>
<li class="nav-item">
<a class="nav-link" style="cursor:pointer" v-on:click="doLogout()">Log Keluar</a>
</li>
<li class="nav-item">
<router-link class="nav-link" v-bind:to="{ name: 'login' }"
>Log Keluar</router-link
>
<li><hr class="dropdown-divider" /></li>
<li>
<div type="button" v-on:click="doLogout()" class="dropdown-item">
Log Keluar <i class="bi bi-box-arrow-right"></i>
</div>
</li>
</ul>
</div>
</div>
</nav>
</header>
</template>
<script>
import axios from "axios";
export default {
data() {
return {
name: localStorage.getItem("name"),
};
},
methods: {
doLogout() {
axios
@@ -84,16 +89,119 @@ export default {
console.log(error);
});
},
toHome() {
this.$router.push({ name: "home" });
},
toProfile() {
this.$router.push({ name: "profile" });
},
},
};
</script>
<style scoped>
.nav-link:hover {
/*
========== 01 TYPOGRAPHY ==========
-Font sizes(px)
10 / 12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 44 / 52 / 62 / 74 / 86 / 98
========== 02 COLORS ==========
-Primary: #1d3461
-Shades: #142444
-Tints: #bbc2d0 #d2d6df
-Accents:
-Greys:
#555
#333
-Tints KIV: #617190
-Accents KIV: #E9C439
========== 07 WHITESPACE ==========
-Spacing system(px)
2 / 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 80 / 96 / 128
*/
/* .nav-link:hover {
color: blue !important;
}
router-link:hover {
color: blue;
} */
.header {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #1d3461;
height: 3.2rem;
padding: 0 6.4rem;
}
.company-title {
display: flex;
text-decoration: none;
}
.logo-title {
display: flex;
justify-content: center;
align-items: center;
color: #e8ebef;
font-size: 1rem;
font-weight: 700;
}
.logo-img {
height: 1.6rem;
}
.main-nav-list {
list-style: none;
display: flex;
gap: 3.2rem;
align-items: center;
margin: 0;
}
.main-nav-link:link,
.main-nav-link {
display: flex;
text-decoration: none;
align-items: center;
justify-content: center;
height: 2.4rem;
color: #bbc2d0;
font-weight: 500;
font-size: 1rem;
transition: all 0.3s;
}
.main-nav-link:hover {
color: #fff;
}
a.router-link-exact-active {
background: #bbc2d0;
color: #1d3461;
border-radius: 10px;
padding: 1rem;
}
a.router-link-exact-active:hover {
color: #142444;
}
.profile-title {
color: #fff;
}
.arrow-logo {
font-size: 0.5rem;
}
</style>
+17 -2
View File
@@ -144,7 +144,7 @@
<tr style="text-transform: uppercase">
<th colspan="3">Jumlah</th>
<th>{{ norujukan.berat }}g</th>
<th colspan="2"></th>
<th class="disabled-bg"></th>
</tr>
</tbody>
</table>
@@ -361,9 +361,18 @@ export default {
})
.then((response) => {
console.log(response);
this.loading = false;
this.$emit("reloadComponent");
this.$swal.fire({
toast: true,
icon: "success",
title: "Berjaya Tambah Ke Troli",
animation: false,
position: "bottom",
showConfirmButton: false,
timer: 5000,
timerProgressBar: true,
});
// location.reload();
})
.catch((error) => {
@@ -377,3 +386,9 @@ export default {
},
};
</script>
<style scoped>
.disabled-bg {
background-color: rgb(233, 236, 239);
}
</style>
+1 -1
View File
@@ -1,7 +1,7 @@
<template>
<the-template>
<div class="container">
<h1>Senarai <i class="bi bi-card-list"></i></h1>
<!-- <h1>Senarai <i class="bi bi-card-list"></i></h1> -->
<div class="input-group mb-3">
<span class="input-group-text" id="basic-addon3">Cawangan</span>
+3 -1
View File
@@ -8,6 +8,8 @@ import './interceptors/axios'
import "bootstrap/dist/css/bootstrap.css"
import "bootstrap/dist/js/bootstrap.js"
import 'bootstrap-icons/font/bootstrap-icons.css'
import VueSweetalert2 from 'vue-sweetalert2';
import 'sweetalert2/dist/sweetalert2.min.css';
import TheTemplate from './components/layouts/TheTemplate.vue'
import BaseCard from './components/base/BaseCard.vue'
@@ -18,7 +20,7 @@ const app = createApp(App);
app.component('the-template', TheTemplate);
app.component('base-card', BaseCard);
app.use(router).use(store).mount('#app');
app.use(router).use(store).use(VueSweetalert2).mount('#app');
// createApp(App).use(router).use(store).mount('#app')
// createApp(Master).use(router).use(store).mount('#app')