Finalize components pengurusan gambar marhun
This commit is contained in:
Generated
+24
-4
@@ -9,6 +9,7 @@
|
|||||||
"datatables.net": "^1.11.3",
|
"datatables.net": "^1.11.3",
|
||||||
"datatables.net-dt": "^1.11.3",
|
"datatables.net-dt": "^1.11.3",
|
||||||
"jquery-confirm": "^3.3.4",
|
"jquery-confirm": "^3.3.4",
|
||||||
|
"v-viewer": "^3.0.11",
|
||||||
"viewerjs": "^1.11.2",
|
"viewerjs": "^1.11.2",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
"vue-loader": "^17.0.1"
|
"vue-loader": "^17.0.1"
|
||||||
@@ -5828,8 +5829,7 @@
|
|||||||
"node_modules/lodash": {
|
"node_modules/lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"node_modules/lodash.debounce": {
|
"node_modules/lodash.debounce": {
|
||||||
"version": "4.0.8",
|
"version": "4.0.8",
|
||||||
@@ -8804,6 +8804,18 @@
|
|||||||
"uuid": "bin/uuid"
|
"uuid": "bin/uuid"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/v-viewer": {
|
||||||
|
"version": "3.0.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/v-viewer/-/v-viewer-3.0.11.tgz",
|
||||||
|
"integrity": "sha512-E8LOdAxhzuktt4HB3PswVCccQ1Q1sYHYnLsS6zaJISpb5EvmAFs5sYNfXnDLFxVb5DQ82v4ZlGxkYlseXwWRJw==",
|
||||||
|
"dependencies": {
|
||||||
|
"lodash": "^4.17.21",
|
||||||
|
"viewerjs": "^1.9.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"vue": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/vary": {
|
"node_modules/vary": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||||
@@ -13881,8 +13893,7 @@
|
|||||||
"lodash": {
|
"lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"lodash.debounce": {
|
"lodash.debounce": {
|
||||||
"version": "4.0.8",
|
"version": "4.0.8",
|
||||||
@@ -16088,6 +16099,15 @@
|
|||||||
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
|
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"v-viewer": {
|
||||||
|
"version": "3.0.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/v-viewer/-/v-viewer-3.0.11.tgz",
|
||||||
|
"integrity": "sha512-E8LOdAxhzuktt4HB3PswVCccQ1Q1sYHYnLsS6zaJISpb5EvmAFs5sYNfXnDLFxVb5DQ82v4ZlGxkYlseXwWRJw==",
|
||||||
|
"requires": {
|
||||||
|
"lodash": "^4.17.21",
|
||||||
|
"viewerjs": "^1.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"vary": {
|
"vary": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
"datatables.net": "^1.11.3",
|
"datatables.net": "^1.11.3",
|
||||||
"datatables.net-dt": "^1.11.3",
|
"datatables.net-dt": "^1.11.3",
|
||||||
"jquery-confirm": "^3.3.4",
|
"jquery-confirm": "^3.3.4",
|
||||||
|
"v-viewer": "^3.0.11",
|
||||||
"viewerjs": "^1.11.2",
|
"viewerjs": "^1.11.2",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
"vue-loader": "^17.0.1"
|
"vue-loader": "^17.0.1"
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
<template>
|
|
||||||
<bye-detail></bye-detail>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import ByeDetail from "./ByeDetail.vue";
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
"bye-detail": ByeDetail,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>this is bye component using vuejs</div>
|
|
||||||
</template>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<template>
|
|
||||||
<hello-detail></hello-detail>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import HelloDetail from "./HelloDetail.vue";
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
"hello-detail": HelloDetail,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>this is hello detail component using vuejs</div>
|
|
||||||
</template>
|
|
||||||
@@ -1,24 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="col-12">
|
<div v-for="lelongBid in allLelongBid" v-bind:key="lelongBid">
|
||||||
Jumlah Item: {{ numberOfLelongBid }}
|
<div class="item-wrapper">
|
||||||
</div>
|
<div class="item-main">
|
||||||
<div v-for="lelongBid in allLelongBid" v-bind:key="lelongBid" class="col-lg-4 my-1 text-center col-md-6 col-sm-12">
|
<MarhunImage v-bind:lelongBidProp="lelongBid" />
|
||||||
<div class="card">
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="text-center" v-if="lelongBid.file_marhun_main != null">
|
|
||||||
<MarhunImage v-bind:noRujukan="lelongBid.norujukan" v-bind:gambarId="lelongBid.file_marhun_main.id"/>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<div class="col-12">{{ lelongBid.norujukan }}</div>
|
|
||||||
<div class="col-12 text-danger">Gambar Belum Di Muat Naik</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, computed } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import MarhunImage from "./MarhunImage.vue"
|
import MarhunImage from "./MarhunImage.vue"
|
||||||
|
|
||||||
@@ -29,10 +20,6 @@ const props = defineProps({
|
|||||||
|
|
||||||
const allLelongBid = ref();
|
const allLelongBid = ref();
|
||||||
|
|
||||||
const numberOfLelongBid = computed(
|
|
||||||
() => allLelongBid.length
|
|
||||||
);
|
|
||||||
|
|
||||||
function getListLelongBid() {
|
function getListLelongBid() {
|
||||||
axios.get("/listLelongBid", {
|
axios.get("/listLelongBid", {
|
||||||
params: {
|
params: {
|
||||||
@@ -47,4 +34,19 @@ function getListLelongBid() {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getListLelongBid();
|
getListLelongBid();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.item-wrapper {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(260px, auto));
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-main {
|
||||||
|
border: 1px solid #0000001a;
|
||||||
|
margin: 10px;
|
||||||
|
border-start-start-radius: 8px;
|
||||||
|
border-start-end-radius: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,12 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="col-12">
|
<div class="text-center">
|
||||||
file_marhun_id: {{ props.gambarId }}
|
<div v-if="props.lelongBidProp.file_marhun_main == null" class="text-danger false-style image-style">
|
||||||
|
<span class="material-symbols-rounded icon-image">
|
||||||
|
cancel
|
||||||
|
</span>
|
||||||
|
<div>Gambar Belum Di Muat Naik</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="stringGambar == 0" class="text-primary bg-light image-style">
|
||||||
|
<span class="material-symbols-rounded icon-image">
|
||||||
|
cycle
|
||||||
|
</span>
|
||||||
|
<div>No Image in Storage</div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="images" v-viewer style="cursor:pointer;">
|
||||||
|
<img :src="stringGambarMarhun" class="image-style" alt="gambar-marhun">
|
||||||
|
</div>
|
||||||
|
<div class="my-2">{{ props.lelongBidProp.norujukan }}</div>
|
||||||
|
<div class="marhun-div-style">{{ props.lelongBidProp.marhun }}</div>
|
||||||
|
<div class="my-2">RM{{
|
||||||
|
props.lelongBidProp.nilaimarhun
|
||||||
|
?.toString()
|
||||||
|
.replace(/\B(?=(\d{3})+(?!\d))/g, ",") || ""
|
||||||
|
}}</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
|
||||||
{{ props.noRujukan }}
|
|
||||||
</div>
|
|
||||||
<div v-if="stringGambar == 0" class="text-center text-primary">No Image in Storage. Please cp from the server</div>
|
|
||||||
<img v-else :src="stringGambarMarhun" alt="gambar-marhun" width="180">
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -14,26 +31,52 @@ import { ref, onMounted } from 'vue'
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
gambarId: Number,
|
lelongBidProp: Object,
|
||||||
noRujukan: String
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const stringGambar = ref();
|
const stringGambar = ref();
|
||||||
const stringGambarMarhun = ref();
|
const stringGambarMarhun = ref();
|
||||||
|
|
||||||
function getPhotoMarhun() {
|
function getPhotoMarhun() {
|
||||||
axios.get("/showPhotoMarhun", {
|
if (props.lelongBidProp.file_marhun_main != null) {
|
||||||
params: {
|
axios.get("/showPhotoMarhun", {
|
||||||
filemarhun_id: props.gambarId,
|
params: {
|
||||||
norujukan: props.noRujukan,
|
filemarhun_id: props.lelongBidProp.file_marhun_main.id,
|
||||||
},
|
norujukan: props.lelongBidProp.norujukan,
|
||||||
}).then((response) => {
|
},
|
||||||
stringGambar.value = response.data;
|
}).then((response) => {
|
||||||
stringGambarMarhun.value = "data:image/png;base64, " + stringGambar.value;
|
stringGambar.value = response.data;
|
||||||
}).catch((error) => { console.log(error); });
|
stringGambarMarhun.value = "data:image/png;base64, " + stringGambar.value;
|
||||||
|
}).catch((error) => { console.log(error); });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getPhotoMarhun();
|
getPhotoMarhun();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.image-style {
|
||||||
|
display: grid;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 245px;
|
||||||
|
height: 137.812px;
|
||||||
|
border-start-start-radius: 7px;
|
||||||
|
border-start-end-radius: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marhun-div-style {
|
||||||
|
max-width: 225px;
|
||||||
|
margin: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-image {
|
||||||
|
font-size: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.false-style {
|
||||||
|
background: #fdf3f3;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<option v-for="val in listLelong" :key="val" v-bind:value="val.id">{{ val.id }}</option>
|
<option v-for="val in listLelong" :key="val" v-bind:value="val.id">{{ val.id }}</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<SelectCawangan v-if="pilihLelong != null" v-bind:key="componentKey" v-bind:selectedLelong="pilihLelong" />
|
<SelectCawangan v-if="pilihLelong != 'Batch Lelong'" v-bind:key="componentKey" v-bind:selectedLelong="pilihLelong" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -22,7 +22,7 @@ import SelectCawangan from "./SelectCawangan.vue"
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const listLelong = ref();
|
const listLelong = ref();
|
||||||
const pilihLelong = ref();
|
const pilihLelong = ref('Batch Lelong');
|
||||||
const componentKey = ref(0);
|
const componentKey = ref(0);
|
||||||
const isLoadingGetListLelong = ref(false);
|
const isLoadingGetListLelong = ref(false);
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<button @click="testLoading()" class="btn btn-primary">Invert isLoadingGetListCawangan</button>
|
<label>Pilih Cawangan</label>
|
||||||
<div v-if="isLoadingGetListCawangan" class="row justify-content-center">
|
<select class="custom-select" @change="pilihCawangan($event)">
|
||||||
<div class="spinner-border text-primary" role="status">
|
<option selected>Cawangan</option>
|
||||||
<span class="sr-only">Loading...</span>
|
<option v-for="val in listCawangan" :key="val" v-bind:value="val.caw_id">{{ val.caw_name }}</option>
|
||||||
</div>
|
</select>
|
||||||
</div>
|
<div class="mt-3 row justify-content-center">
|
||||||
<div v-else>
|
<DisplayLelongBid v-if="pilihIdCawangan != 'Cawangan'" v-bind:key="componentKeySecond"
|
||||||
<label>Pilih Cawangan</label>
|
v-bind:selectedIdCawangan="pilihIdCawangan" v-bind:selectedBatchLelong="props.selectedLelong" />
|
||||||
<select class="custom-select" @change="pilihCawangan($event)">
|
|
||||||
<option selected>Cawangan</option>
|
|
||||||
<option v-for="val in listCawangan" :key="val" v-bind:value="val.caw_id">{{ val.caw_name }}</option>
|
|
||||||
</select>
|
|
||||||
<div class="mt-3 row justify-content-center">
|
|
||||||
<DisplayLelongBid v-if="pilihIdCawangan != null" v-bind:key="componentKeySecond"
|
|
||||||
v-bind:selectedIdCawangan="pilihIdCawangan" v-bind:selectedBatchLelong="props.selectedLelong" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -28,16 +20,10 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const listCawangan = ref();
|
const listCawangan = ref();
|
||||||
const pilihIdCawangan = ref();
|
const pilihIdCawangan = ref('Cawangan');
|
||||||
const componentKeySecond = ref(0);
|
const componentKeySecond = ref(0);
|
||||||
const isLoadingGetListCawangan = ref(false);
|
|
||||||
|
|
||||||
function testLoading() {
|
|
||||||
isLoadingGetListCawangan.value = !isLoadingGetListCawangan.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getListCawangan() {
|
function getListCawangan() {
|
||||||
isLoadingGetListCawangan.value = true;
|
|
||||||
axios.get("/listCawangan", {
|
axios.get("/listCawangan", {
|
||||||
params: {
|
params: {
|
||||||
lelong_id: props.selectedLelong,
|
lelong_id: props.selectedLelong,
|
||||||
@@ -45,7 +31,6 @@ function getListCawangan() {
|
|||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
listCawangan.value = response.data;
|
listCawangan.value = response.data;
|
||||||
}).catch((error) => { alert(error); });
|
}).catch((error) => { alert(error); });
|
||||||
isLoadingGetListCawangan.value = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function pilihCawangan(e) {
|
function pilihCawangan(e) {
|
||||||
@@ -56,5 +41,5 @@ function pilihCawangan(e) {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getListCawangan();
|
getListCawangan();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Vendored
+3
-6
@@ -1,14 +1,11 @@
|
|||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import './axios'
|
import './axios'
|
||||||
|
import 'viewerjs/dist/viewer.css'
|
||||||
|
import VueViewer from 'v-viewer'
|
||||||
|
|
||||||
// import HelloComponent from "./components/HelloComponent.vue"
|
|
||||||
// import ByeComponent from "./components/ByeComponent.vue"
|
|
||||||
import SelectBatchLelong from "./components/pengurusangambar/marhun/SelectBatchLelong.vue"
|
import SelectBatchLelong from "./components/pengurusangambar/marhun/SelectBatchLelong.vue"
|
||||||
|
|
||||||
// const appHelloComponent = createApp(HelloComponent);
|
|
||||||
// const appByeComponent = createApp(ByeComponent);
|
|
||||||
const appSelectBatchLelong = createApp(SelectBatchLelong);
|
const appSelectBatchLelong = createApp(SelectBatchLelong);
|
||||||
|
appSelectBatchLelong.use(VueViewer);
|
||||||
|
|
||||||
// appHelloComponent.mount("#appHelloComponent");
|
|
||||||
// appByeComponent.mount("#appByeComponent");
|
|
||||||
appSelectBatchLelong.mount("#appSelectBatchLelong");
|
appSelectBatchLelong.mount("#appSelectBatchLelong");
|
||||||
Reference in New Issue
Block a user