You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
47 lines
1.1 KiB
![]()
5 years ago
|
import NotificationMixin from './NotificationMixin';
|
||
|
import { formatDateTime } from '../utils/dates';
|
||
|
|
||
|
export default {
|
||
|
mixins: [NotificationMixin],
|
||
|
methods: {
|
||
|
formatDateTime,
|
||
|
onCreated(item) {
|
||
|
this.showMessage(this.$i18n.t('{resource} created', {'resource': item['resourceNode'].title}));
|
||
|
this.$refs.createForm.files = [];
|
||
|
|
||
|
let folderParams = this.$route.query;
|
||
|
|
||
|
/*this.$router.push({
|
||
|
name: `${this.$options.servicePrefix}List`,
|
||
|
params: {id: item['@id']},
|
||
|
query: folderParams
|
||
|
});*/
|
||
|
},
|
||
|
onUploadForm() {
|
||
|
console.log('onUploadForm');
|
||
|
const createForm = this.$refs.createForm;
|
||
|
createForm.$v.$touch();
|
||
|
|
||
|
if (!createForm.$v.$invalid) {
|
||
|
for (let i = 0; i < createForm.files.length; i++) {
|
||
|
let file = createForm.files[i];
|
||
|
this.create(file);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
watch: {
|
||
|
created(created) {
|
||
|
if (!created) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
this.onCreated(created);
|
||
|
},
|
||
|
|
||
|
error(message) {
|
||
|
message && this.showError(message);
|
||
|
}
|
||
|
}
|
||
|
};
|