Chamilo is a learning management system focused on ease of use and accessibility
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.
chamilo-lms/assets/vue/views/ctoolintro/Update.vue

77 lines
1.8 KiB

<template>
4 years ago
<Toolbar
:handle-submit="onSendForm"
/>
<ToolIntroForm
ref="updateForm"
v-if="item"
:values="item"
:errors="violations"
/>
<Loading :visible="isLoading || deleteLoading" />
</template>
<script>
import { mapActions, mapGetters } from 'vuex';
import { mapFields } from 'vuex-map-fields';
import ToolIntroForm from '../../components/ctoolintro/Form.vue';
import Loading from '../../components/Loading.vue';
import Toolbar from '../../components/Toolbar.vue';
import UpdateMixin from '../../mixins/UpdateMixin';
import useNotification from "../../components/Notification";
import {useI18n} from "vue-i18n";
import {useRouter} from "vue-router";
import {watch} from "vue";
4 years ago
const servicePrefix = 'ctoolintro';
export default {
name: 'ToolIntroUpdate',
servicePrefix,
mixins: [UpdateMixin],
components: {
Loading,
Toolbar,
ToolIntroForm
},
setup() {
const {showNotification} = useNotification();
const { t } = useI18n();
const router = useRouter();
/*function updated(val) {
showNotification(t('Updated'));
router.go(-1);
}*/
//return {updated};
return;
},
computed: {
...mapFields('ctoolintro', {
deleteLoading: 'isLoading',
isLoading: 'isLoading',
error: 'error',
updated: 'updated',
violations: 'violations'
}),
4 years ago
...mapGetters('ctoolintro', ['find']),
...mapGetters({
'isCurrentTeacher': 'security/isCurrentTeacher',
}),
},
methods: {
...mapActions('ctoolintro', {
createReset: 'resetCreate',
deleteItem: 'del',
delReset: 'resetDelete',
retrieve: 'load',
update: 'update',
4 years ago
updateWithFormData: 'updateWithFormData',
updateReset: 'resetUpdate'
})
}
};
</script>