mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-11 23:13:18 +03:30
fix : details page url
This commit is contained in:
@@ -1,94 +1,94 @@
|
||||
<template>
|
||||
<div class="">
|
||||
<vue-dropzone id="customdropzone02"
|
||||
ref="myVueDropzone"
|
||||
:options="dropzoneOptions"
|
||||
:useCustomSlot="true"
|
||||
@vdropzone-sending = "sending"
|
||||
@vdropzone-success = "success"
|
||||
@vdropzone-removed-file = "afterRemove"
|
||||
@vdropzone-error = "error"
|
||||
class="WM-Relative" >
|
||||
<div class="dropzone-custom-content">
|
||||
<h3 class="dropzone-custom-title">Upload your files here</h3>
|
||||
<div class="subtitle">image or pdf or word</div>
|
||||
</div>
|
||||
</vue-dropzone>
|
||||
</div>
|
||||
<div class="">
|
||||
<vue-dropzone id="customdropzone02"
|
||||
ref="myVueDropzone"
|
||||
:options="dropzoneOptions"
|
||||
:useCustomSlot="true"
|
||||
@vdropzone-sending="sending"
|
||||
@vdropzone-success="success"
|
||||
@vdropzone-removed-file="afterRemove"
|
||||
@vdropzone-error="error"
|
||||
class="WM-Relative">
|
||||
<div class="dropzone-custom-content">
|
||||
<h3 class="dropzone-custom-title">Upload your files here</h3>
|
||||
<div class="subtitle">image or pdf or word</div>
|
||||
</div>
|
||||
</vue-dropzone>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vue2Dropzone from 'vue2-dropzone'
|
||||
import 'vue2-dropzone/dist/vue2Dropzone.min.css'
|
||||
import { TokenService } from '@/services/auth/storage.service';
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
import toast from "@/services/global/toast.service";
|
||||
import vue2Dropzone from 'vue2-dropzone'
|
||||
import 'vue2-dropzone/dist/vue2Dropzone.min.css'
|
||||
import {TokenService} from '@/services/auth/storage.service';
|
||||
import {ApiService} from "@/services";
|
||||
import {urls} from "@/config/urls";
|
||||
import toast from "@/services/global/toast.service";
|
||||
|
||||
export default {
|
||||
props: ['ModelID', 'Images', 'BatchID', 'ModelType'],
|
||||
components : {
|
||||
vueDropzone: vue2Dropzone
|
||||
},
|
||||
data: () => ({
|
||||
dropzoneOptions: {
|
||||
url: '/api/store_media',
|
||||
export default {
|
||||
props: ['ModelID', 'Images', 'BatchID', 'ModelType'],
|
||||
components: {
|
||||
vueDropzone: vue2Dropzone
|
||||
},
|
||||
data: () => ({
|
||||
dropzoneOptions: {
|
||||
url: 'https://www.cssd-doc.com/api/store_media',
|
||||
thumbnailWidth: 150,
|
||||
maxFilesize: 2,
|
||||
headers: { "Authorization": `Bearer ${TokenService.getToken()}` },
|
||||
headers: {"Authorization": `Bearer ${TokenService.getToken()}`},
|
||||
addRemoveLinks: true
|
||||
},
|
||||
}),
|
||||
mounted() {
|
||||
this.loadImages();
|
||||
},
|
||||
methods: {
|
||||
loadImages(){
|
||||
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};
|
||||
vm.$refs.myVueDropzone.manuallyAddFile(file, '/'+image.path);
|
||||
});
|
||||
}
|
||||
},
|
||||
success(file, response){
|
||||
file.id = response.data.id;
|
||||
if(typeof response.message !== 'undefined') {
|
||||
toast.success(response.message, response.title);
|
||||
}
|
||||
},
|
||||
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], 'خطا');
|
||||
}
|
||||
}),
|
||||
mounted() {
|
||||
this.loadImages();
|
||||
},
|
||||
methods: {
|
||||
loadImages() {
|
||||
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};
|
||||
vm.$refs.myVueDropzone.manuallyAddFile(file, '/' + image.path);
|
||||
});
|
||||
}
|
||||
},
|
||||
success(file, response) {
|
||||
file.id = response.data.id;
|
||||
if (typeof response.message !== 'undefined') {
|
||||
toast.success(response.message, response.title);
|
||||
}
|
||||
},
|
||||
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);
|
||||
form_data.append('model_id', this.ModelID);
|
||||
form_data.append('model_type', this.ModelType);
|
||||
form_data.append('batch_id', this.BatchID);
|
||||
},
|
||||
async afterRemove( file, error, xhr) {
|
||||
let status = null;
|
||||
if (this.$refs.myVueDropzone.dropzone.disabled !== undefined) {
|
||||
status = this.$refs.myVueDropzone.dropzone.disabled;
|
||||
}
|
||||
}
|
||||
},
|
||||
sending(file, xhr, form_data) {
|
||||
// form_data.append('file', file);
|
||||
form_data.append('model_id', this.ModelID);
|
||||
form_data.append('model_type', this.ModelType);
|
||||
form_data.append('batch_id', this.BatchID);
|
||||
},
|
||||
async afterRemove(file, error, xhr) {
|
||||
let status = null;
|
||||
if (this.$refs.myVueDropzone.dropzone.disabled !== undefined) {
|
||||
status = this.$refs.myVueDropzone.dropzone.disabled;
|
||||
}
|
||||
|
||||
if (status !== true) {
|
||||
let formdata = new FormData();
|
||||
formdata.append('media_id', file.id);
|
||||
formdata.append('name', file.name);
|
||||
formdata.append('model_id', this.ModelID);
|
||||
formdata.append('model_type', this.ModelType);
|
||||
formdata.append('batch_id', this.BatchID);
|
||||
let result = await ApiService.post(urls.deleteFile,formdata);
|
||||
}
|
||||
},
|
||||
}
|
||||
if (status !== true) {
|
||||
let formdata = new FormData();
|
||||
formdata.append('media_id', file.id);
|
||||
formdata.append('name', file.name);
|
||||
formdata.append('model_id', this.ModelID);
|
||||
formdata.append('model_type', this.ModelType);
|
||||
formdata.append('batch_id', this.BatchID);
|
||||
let result = await ApiService.post(urls.deleteFile, formdata);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</v-layout>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<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-layout>
|
||||
</v-layout>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</v-layout>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<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">
|
||||
</a>
|
||||
</v-flex>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div>
|
||||
<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>
|
||||
</div>
|
||||
</v-flex>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</v-layout>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<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-layout>
|
||||
</v-layout>
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
</v-flex>
|
||||
|
||||
<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-icon class="black--text mr-2 caption">fas fa-print</v-icon>
|
||||
<span class="black--text">Go to Print Page</span>
|
||||
|
||||
Reference in New Issue
Block a user