2019-11-21 17:43:56 +00:00
|
|
|
import { Component, Vue, Watch } from 'vue-property-decorator';
|
|
|
|
|
|
|
|
//outside of the component:
|
|
|
|
function initialState() {
|
|
|
|
return {
|
|
|
|
type: "",
|
|
|
|
state: "",
|
|
|
|
rights: null,
|
|
|
|
project_id: "",
|
|
|
|
|
|
|
|
creating_corporation: "GBA Repository",
|
|
|
|
language: "",
|
|
|
|
embargo_date: "",
|
|
|
|
belongs_to_bibliography: 0,
|
|
|
|
|
|
|
|
title_main: {
|
|
|
|
value: "",
|
|
|
|
language: ""
|
|
|
|
},
|
|
|
|
abstract_main: {
|
|
|
|
value: "",
|
|
|
|
language: ""
|
|
|
|
},
|
|
|
|
// geolocation: {
|
|
|
|
// xmin: "",
|
|
|
|
// ymin: "",
|
|
|
|
// xmax: "",
|
|
|
|
// ymax: ""
|
|
|
|
// },
|
|
|
|
coverage: {
|
|
|
|
xmin: "",
|
|
|
|
ymin: "",
|
|
|
|
xmax: "",
|
|
|
|
ymax: "",
|
|
|
|
elevation_min: "",
|
|
|
|
elevation_max: "",
|
|
|
|
elevation_absolut: "",
|
|
|
|
depth_min: "",
|
|
|
|
depth_max: "",
|
|
|
|
depth_absolut: "",
|
|
|
|
time_min: "",
|
|
|
|
time_max: "",
|
|
|
|
time_absolut: ""
|
|
|
|
},
|
|
|
|
checkedAuthors: [],
|
|
|
|
checkedLicenses: [], // [],
|
|
|
|
files: [],
|
|
|
|
keywords: [],
|
|
|
|
references: [],
|
|
|
|
titles: [],
|
|
|
|
descriptions: [],
|
|
|
|
checkedContributors: [],
|
|
|
|
// checkedSubmitters: [],
|
|
|
|
|
|
|
|
persons: [],
|
|
|
|
contributors: []
|
|
|
|
// submitters: []
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// const dataset = new Vue({
|
|
|
|
@Component
|
|
|
|
export default class Dataset extends Vue {
|
|
|
|
// data: function() {
|
|
|
|
// return initialState();
|
|
|
|
// }
|
|
|
|
initialState = {};
|
2019-11-28 12:08:34 +00:00
|
|
|
type = "";
|
|
|
|
state = "";
|
|
|
|
rights = null;
|
|
|
|
project_id = "";
|
2019-11-21 17:43:56 +00:00
|
|
|
|
2019-11-28 12:08:34 +00:00
|
|
|
creating_corporation = "TETHYS Repository";
|
|
|
|
language = "";
|
|
|
|
embargo_date = "";
|
|
|
|
belongs_to_bibliography = 0;
|
2019-11-21 17:43:56 +00:00
|
|
|
|
2019-11-28 12:08:34 +00:00
|
|
|
title_main = {
|
2019-11-21 17:43:56 +00:00
|
|
|
value: "",
|
|
|
|
language: ""
|
|
|
|
};
|
2019-11-28 12:08:34 +00:00
|
|
|
abstract_main = {
|
2019-11-21 17:43:56 +00:00
|
|
|
value: "",
|
|
|
|
language: ""
|
|
|
|
};
|
|
|
|
// geolocation: {
|
|
|
|
// xmin: "",
|
|
|
|
// ymin: "",
|
|
|
|
// xmax: "",
|
|
|
|
// ymax: ""
|
|
|
|
// },
|
2019-11-28 12:08:34 +00:00
|
|
|
coverage = {
|
2019-11-21 17:43:56 +00:00
|
|
|
xmin: "",
|
|
|
|
ymin: "",
|
|
|
|
xmax: "",
|
|
|
|
ymax: "",
|
|
|
|
elevation_min: "",
|
|
|
|
elevation_max: "",
|
|
|
|
elevation_absolut: "",
|
|
|
|
depth_min: "",
|
|
|
|
depth_max: "",
|
|
|
|
depth_absolut: "",
|
|
|
|
time_min: "",
|
|
|
|
time_max: "",
|
|
|
|
time_absolut: ""
|
|
|
|
};
|
2019-11-28 12:08:34 +00:00
|
|
|
checkedAuthors = [];
|
|
|
|
checkedLicenses = [];
|
|
|
|
files = [];
|
|
|
|
keywords = [];
|
|
|
|
references = [];
|
|
|
|
titles = [];
|
|
|
|
descriptions = [];
|
|
|
|
checkedContributors = [];
|
2019-11-21 17:43:56 +00:00
|
|
|
// checkedSubmitters: [],
|
|
|
|
|
2019-11-28 12:08:34 +00:00
|
|
|
persons = [];
|
|
|
|
contributors = [];
|
2019-11-21 17:43:56 +00:00
|
|
|
// submitters: []
|
|
|
|
|
2019-11-28 12:08:34 +00:00
|
|
|
created() {
|
2019-11-21 17:43:56 +00:00
|
|
|
this.initialState = Object.assign({}, this);
|
|
|
|
// let json = JSON.stringify(this.$data);
|
|
|
|
// this.reset = () => {
|
|
|
|
// Object.assign(this.$data, JSON.parse(json));
|
|
|
|
// };
|
|
|
|
// this.reset(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Watch('language')
|
|
|
|
onLanguageChanged(val) {
|
|
|
|
this.title_main.language = val;
|
|
|
|
this.abstract_main.language = val;
|
|
|
|
}
|
2019-11-28 12:08:34 +00:00
|
|
|
|
|
|
|
|
2019-11-21 17:43:56 +00:00
|
|
|
reset() {
|
|
|
|
// Object.assign(this.$data, initialState());
|
|
|
|
Object.assign(this.$data, this.initialState);
|
|
|
|
}
|
2019-11-28 12:08:34 +00:00
|
|
|
|
2019-11-21 17:43:56 +00:00
|
|
|
}
|
|
|
|
// export default dataset;
|
|
|
|
|