tethys/resources/js/components/Dataset.vue

87 lines
1.6 KiB
Vue
Raw Normal View History

// <script>
2018-11-05 16:44:25 +01:00
import Vue from "vue";
//outside of the component:
function initialState() {
return {
type: "",
state: "",
rights: null,
project_id: "",
2019-01-22 18:31:46 +01:00
creating_corporation: "GBA Repository",
2019-03-19 18:04:41 +01:00
language: "",
embargo_date: "",
belongs_to_bibliography: 0,
2018-11-05 16:44:25 +01:00
title_main: {
value: "",
language: ""
},
abstract_main: {
value: "",
language: ""
},
2019-03-29 18:29:20 +01:00
// geolocation: {
// xmin: "",
// ymin: "",
// xmax: "",
// ymax: ""
// },
coverage: {
xmin: "",
ymin: "",
xmax: "",
2019-03-29 18:29:20 +01:00
ymax: "",
2019-03-20 18:40:14 +01:00
elevation_min: "",
elevation_max: "",
elevation_absolut: "",
depth_min: "",
depth_max: "",
2019-03-29 18:29:20 +01:00
depth_absolut: "",
time_min: "",
time_max: "",
time_absolut: ""
2019-03-20 18:40:14 +01:00
},
checkedAuthors: [],
checkedLicenses: [], // [],
files: [],
2019-03-18 14:32:29 +01:00
keywords: [],
references: [],
2019-01-22 18:24:18 +01:00
titles: [],
2019-01-24 17:33:04 +01:00
descriptions: [],
checkedContributors: [],
// checkedSubmitters: [],
2018-11-05 16:44:25 +01:00
persons: [],
contributors: []
// submitters: []
};
}
2018-11-05 16:44:25 +01:00
const dataset = new Vue({
data: function() {
return initialState();
},
created: function() {
// let json = JSON.stringify(this.$data);
// this.reset = () => {
// Object.assign(this.$data, JSON.parse(json));
// };
// this.reset(json);
2018-11-05 16:44:25 +01:00
},
2019-03-19 18:04:41 +01:00
watch: {
language(val) {
this.title_main.language = val;
this.abstract_main.language = val;
}
},
methods: {
reset() {
Object.assign(this.$data, initialState());
}
2018-11-05 16:44:25 +01:00
}
});
export default dataset;
//export { dataset };
2018-11-05 16:44:25 +01:00
</script>