tethys/resources/assets/js/components/Dataset.vue

87 lines
1.6 KiB
Vue
Raw Normal View History

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