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.
64 lines
1.4 KiB
64 lines
1.4 KiB
|
4 years ago
|
<template>
|
||
|
|
<div>
|
||
|
|
<Toolbar
|
||
|
|
:handle-submit="onSendForm"
|
||
|
|
:handle-reset="resetForm"
|
||
|
|
/>
|
||
|
|
|
||
|
|
<DocumentsForm
|
||
|
|
ref="createForm"
|
||
|
|
:values="item"
|
||
|
|
:errors="violations"
|
||
|
|
/>
|
||
|
|
<Loading :visible="isLoading" />
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import { mapActions } from 'vuex';
|
||
|
|
import { createHelpers } from 'vuex-map-fields';
|
||
|
|
import DocumentsForm from '../../components/personalfile/Form.vue';
|
||
|
|
import Loading from '../../components/Loading.vue';
|
||
|
|
import Toolbar from '../../components/Toolbar.vue';
|
||
|
|
import CreateMixin from '../../mixins/CreateMixin';
|
||
|
|
|
||
|
|
const servicePrefix = 'PersonalFile';
|
||
|
|
|
||
|
|
const { mapFields } = createHelpers({
|
||
|
|
getterType: 'personal_file/getField',
|
||
|
|
mutationType: 'personal_file/updateField'
|
||
|
|
});
|
||
|
|
|
||
|
|
export default {
|
||
|
|
name: 'PersonalFileCreate',
|
||
|
|
servicePrefix,
|
||
|
|
components: {
|
||
|
|
Loading,
|
||
|
|
Toolbar,
|
||
|
|
DocumentsForm
|
||
|
|
},
|
||
|
|
mixins: [CreateMixin],
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
item: {},
|
||
|
|
type: 'folder'
|
||
|
|
};
|
||
|
|
},
|
||
|
|
computed: {
|
||
|
|
...mapFields(['error', 'isLoading', 'created', 'violations'])
|
||
|
|
},
|
||
|
|
created() {
|
||
|
|
this.item.parentResourceNodeId = this.$route.params.node;
|
||
|
|
this.item.resourceLinkList = JSON.stringify([{
|
||
|
|
gid: this.$route.query.gid,
|
||
|
|
sid: this.$route.query.sid,
|
||
|
|
c_id: this.$route.query.cid,
|
||
|
|
visibility: 2, // visible by default
|
||
|
|
}]);
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
...mapActions('personalfile', ['create', 'reset'])
|
||
|
|
}
|
||
|
|
};
|
||
|
|
</script>
|