storage url o'zgartirildi
This commit is contained in:
@@ -324,7 +324,6 @@
|
||||
<input
|
||||
class="form-control"
|
||||
@change="posterFile($event)"
|
||||
onchange="PreviewImage();"
|
||||
required
|
||||
type="file"
|
||||
id="poster"
|
||||
@@ -684,6 +683,7 @@
|
||||
:theme="'default'"
|
||||
:multiple="true"
|
||||
:deletable="true"
|
||||
:linkable="true"
|
||||
:meta="true"
|
||||
:accept="'image/*'"
|
||||
:maxSize="'10MB'"
|
||||
@@ -693,10 +693,13 @@
|
||||
type: 'Invalid file type. Only images or zip Allowed',
|
||||
size: 'Files should not exceed 10MB in size',
|
||||
}"
|
||||
@select="
|
||||
filesSelected($event, index)
|
||||
"
|
||||
@beforedelete="
|
||||
onBeforeDelete(
|
||||
$event,
|
||||
index
|
||||
)
|
||||
"
|
||||
@delete="
|
||||
fileDeleted($event, index)
|
||||
"
|
||||
v-model="color.screens"
|
||||
@@ -1278,18 +1281,6 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.product.colors[i].filesDataForUpload) {
|
||||
for (
|
||||
let f = 0;
|
||||
f < this.product.colors[i].filesDataForUpload.length;
|
||||
f++
|
||||
) {
|
||||
formData.append(
|
||||
"colors[" + i + "][screens][new_" + f + "][image]",
|
||||
this.product.colors[i].filesDataForUpload[f].file
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < this.characteristics.length; i++) {
|
||||
@@ -1442,25 +1433,17 @@ export default {
|
||||
// this.$refs.vueFileAgent.deleteUpload(this.uploadUrl, this.uploadHeaders, fileData);
|
||||
// },
|
||||
|
||||
filesSelected: function (filesDataNewlySelected, index) {
|
||||
var validFilesData = filesDataNewlySelected.filter(
|
||||
(fileData) => !fileData.error
|
||||
);
|
||||
this.product.colors[index].filesDataForUpload =
|
||||
this.product.colors[index].filesDataForUpload.concat(
|
||||
validFilesData
|
||||
);
|
||||
},
|
||||
onBeforeDelete: function (fileData, index) {
|
||||
const agent = Array.isArray(this.$refs.vueFileAgent)
|
||||
? this.$refs.vueFileAgent[index]
|
||||
: this.$refs.vueFileAgent;
|
||||
|
||||
fileDeleted: function (fileData, index) {
|
||||
var i =
|
||||
this.product.colors[index].filesDataForUpload.indexOf(fileData);
|
||||
if (i !== -1) {
|
||||
this.product.colors[index].filesDataForUpload.splice(i, 1);
|
||||
} else {
|
||||
this.deleteUploadedFile(fileData);
|
||||
if (agent) {
|
||||
agent.deleteFileRecord(fileData);
|
||||
}
|
||||
},
|
||||
|
||||
fileDeleted: function () {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user