fix : details page url

This commit is contained in:
zeinab.ashrafi
2025-04-10 11:57:47 +03:30
parent 1d77e7b000
commit 78dfba9b24
6 changed files with 85 additions and 85 deletions
+80 -80
View File
@@ -1,94 +1,94 @@
<template> <template>
<div class=""> <div class="">
<vue-dropzone id="customdropzone02" <vue-dropzone id="customdropzone02"
ref="myVueDropzone" ref="myVueDropzone"
:options="dropzoneOptions" :options="dropzoneOptions"
:useCustomSlot="true" :useCustomSlot="true"
@vdropzone-sending = "sending" @vdropzone-sending="sending"
@vdropzone-success = "success" @vdropzone-success="success"
@vdropzone-removed-file = "afterRemove" @vdropzone-removed-file="afterRemove"
@vdropzone-error = "error" @vdropzone-error="error"
class="WM-Relative" > class="WM-Relative">
<div class="dropzone-custom-content"> <div class="dropzone-custom-content">
<h3 class="dropzone-custom-title">Upload your files here</h3> <h3 class="dropzone-custom-title">Upload your files here</h3>
<div class="subtitle">image or pdf or word</div> <div class="subtitle">image or pdf or word</div>
</div> </div>
</vue-dropzone> </vue-dropzone>
</div> </div>
</template> </template>
<script> <script>
import vue2Dropzone from 'vue2-dropzone' import vue2Dropzone from 'vue2-dropzone'
import 'vue2-dropzone/dist/vue2Dropzone.min.css' import 'vue2-dropzone/dist/vue2Dropzone.min.css'
import { TokenService } from '@/services/auth/storage.service'; import {TokenService} from '@/services/auth/storage.service';
import { ApiService } from "@/services"; import {ApiService} from "@/services";
import { urls } from "@/config/urls"; import {urls} from "@/config/urls";
import toast from "@/services/global/toast.service"; import toast from "@/services/global/toast.service";
export default { export default {
props: ['ModelID', 'Images', 'BatchID', 'ModelType'], props: ['ModelID', 'Images', 'BatchID', 'ModelType'],
components : { components: {
vueDropzone: vue2Dropzone vueDropzone: vue2Dropzone
}, },
data: () => ({ data: () => ({
dropzoneOptions: { dropzoneOptions: {
url: '/api/store_media', url: 'https://www.cssd-doc.com/api/store_media',
thumbnailWidth: 150, thumbnailWidth: 150,
maxFilesize: 2, maxFilesize: 2,
headers: { "Authorization": `Bearer ${TokenService.getToken()}` }, headers: {"Authorization": `Bearer ${TokenService.getToken()}`},
addRemoveLinks: true addRemoveLinks: true
},
}),
mounted() {
this.loadImages();
}, },
methods: { }),
loadImages(){ mounted() {
let vm = this; this.loadImages();
if (vm.Images != null) { },
vm.Images.forEach(function(image, key){ methods: {
var file = { name: image.file_name, size:'1024', type: ' ', id: image.id}; loadImages() {
vm.$refs.myVueDropzone.manuallyAddFile(file, '/'+image.path); let vm = this;
}); if (vm.Images != null) {
} vm.Images.forEach(function (image, key) {
}, var file = {name: image.file_name, size: '1024', type: ' ', id: image.id};
success(file, response){ vm.$refs.myVueDropzone.manuallyAddFile(file, '/' + image.path);
file.id = response.data.id; });
if(typeof response.message !== 'undefined') { }
toast.success(response.message, response.title); },
} success(file, response) {
}, file.id = response.data.id;
error(file, message, xhr){ if (typeof response.message !== 'undefined') {
if(typeof message.errors !== 'undefined') { toast.success(response.message, response.title);
for (const key in message.errors) { }
if (message.errors.hasOwnProperty(key)) { },
toast.error(message.errors[key], 'خطا'); error(file, message, xhr) {
} if (typeof message.errors !== 'undefined') {
for (const key in message.errors) {
if (message.errors.hasOwnProperty(key)) {
toast.error(message.errors[key], 'خطا');
} }
} }
}, }
sending(file, xhr, form_data) { },
// form_data.append('file', file); sending(file, xhr, form_data) {
form_data.append('model_id', this.ModelID); // form_data.append('file', file);
form_data.append('model_type', this.ModelType); form_data.append('model_id', this.ModelID);
form_data.append('batch_id', this.BatchID); form_data.append('model_type', this.ModelType);
}, form_data.append('batch_id', this.BatchID);
async afterRemove( file, error, xhr) { },
let status = null; async afterRemove(file, error, xhr) {
if (this.$refs.myVueDropzone.dropzone.disabled !== undefined) { let status = null;
status = this.$refs.myVueDropzone.dropzone.disabled; if (this.$refs.myVueDropzone.dropzone.disabled !== undefined) {
} status = this.$refs.myVueDropzone.dropzone.disabled;
}
if (status !== true) { if (status !== true) {
let formdata = new FormData(); let formdata = new FormData();
formdata.append('media_id', file.id); formdata.append('media_id', file.id);
formdata.append('name', file.name); formdata.append('name', file.name);
formdata.append('model_id', this.ModelID); formdata.append('model_id', this.ModelID);
formdata.append('model_type', this.ModelType); formdata.append('model_type', this.ModelType);
formdata.append('batch_id', this.BatchID); formdata.append('batch_id', this.BatchID);
let result = await ApiService.post(urls.deleteFile,formdata); let result = await ApiService.post(urls.deleteFile, formdata);
} }
}, },
}
} }
}
</script> </script>
+1 -1
View File
@@ -59,7 +59,7 @@
</v-layout> </v-layout>
<v-layout row wrap class="ml-4"> <v-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6 v-if="QRCodeimg"> <v-flex xs12 md6 sm6 v-if="QRCodeimg">
<a :href="'/Show/Cycle/'+data.id+''" target="_blank"><img :src="QRCodeimg" class="WM-Width-150"></a> <a :href="'https://www.cssd-doc.com/Show/Cycle/'+data.id+''" target="_blank"><img :src="QRCodeimg" class="WM-Width-150"></a>
</v-flex> </v-flex>
</v-layout> </v-layout>
</v-layout> </v-layout>
+1 -1
View File
@@ -60,7 +60,7 @@
</v-layout> </v-layout>
<v-layout row wrap class="ml-4"> <v-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6 v-if="QRCodeimg"> <v-flex xs12 md6 sm6 v-if="QRCodeimg">
<a :href="'/Show/Item/' + data.id + ''" target="_blank"> <a :href="'https://www.cssd-doc.com/Show/Item/' + data.id + ''" target="_blank">
<img :src="QRCodeimg" class="WM-Width-150"> <img :src="QRCodeimg" class="WM-Width-150">
</a> </a>
</v-flex> </v-flex>
+1 -1
View File
@@ -51,7 +51,7 @@
<v-flex xs12 md12 sm12> <v-flex xs12 md12 sm12>
<div> <div>
<v-flex xs6 md6 sm6 v-if="QRCodeimg"> <v-flex xs6 md6 sm6 v-if="QRCodeimg">
<a :href="'/Show/Label/'+data.id+''" target="_blank"><img :src="QRCodeimg" class="WM-Width-120"></a> <a :href="'https://www.cssd-doc.com/Show/Label/'+data.id+''" target="_blank"><img :src="QRCodeimg" class="WM-Width-120"></a>
</v-flex> </v-flex>
</div> </div>
</v-flex> </v-flex>
+1 -1
View File
@@ -46,7 +46,7 @@
</v-layout> </v-layout>
<v-layout row wrap class="ml-4"> <v-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6 v-if="QRCodeimg"> <v-flex xs12 md6 sm6 v-if="QRCodeimg">
<a :href="'/Show/Package/'+data.id+''" target="_blank"><img :src="QRCodeimg" class="WM-Width-150"></a> <a :href="'https://www.cssd-doc.com/Show/Package/'+data.id+''" target="_blank"><img :src="QRCodeimg" class="WM-Width-150"></a>
</v-flex> </v-flex>
</v-layout> </v-layout>
</v-layout> </v-layout>
+1 -1
View File
@@ -162,7 +162,7 @@
</v-flex> </v-flex>
<v-flex xs6 md2 sm2> <v-flex xs6 md2 sm2>
<a :href="'/Show/TestResult/'+data.id"> <a :href="'https://www.cssd-doc.com/Show/TestResult/'+data.id">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Gray"> <v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Gray">
<v-icon class="black--text mr-2 caption">fas fa-print</v-icon> <v-icon class="black--text mr-2 caption">fas fa-print</v-icon>
<span class="black--text">Go to Print Page</span> <span class="black--text">Go to Print Page</span>