mirror of https://github.com/nocodb/nocodb
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.
45 lines
809 B
45 lines
809 B
3 years ago
|
<template>
|
||
|
<!-- <v-dialog :value="true">-->
|
||
|
<v-card>
|
||
|
<v-textarea v-model="template" />
|
||
|
|
||
2 years ago
|
<v-btn @click="ImportTemplate"> import </v-btn>
|
||
3 years ago
|
</v-card>
|
||
2 years ago
|
<!-- </v-dialog>-->
|
||
3 years ago
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
name: 'ImportTemplate',
|
||
|
props: {
|
||
2 years ago
|
nodes: Object,
|
||
3 years ago
|
},
|
||
|
data() {
|
||
|
return {
|
||
2 years ago
|
template: '',
|
||
|
};
|
||
3 years ago
|
},
|
||
|
methods: {
|
||
|
importTemplate() {
|
||
|
try {
|
||
2 years ago
|
const template = JSON.parse(this.template);
|
||
|
this.$store.dispatch('sqlMgr/ActSqlOp', [
|
||
|
{
|
||
|
dbAlias: this.nodes.dbAlias,
|
||
|
env: '_noco',
|
||
|
},
|
||
|
'xcModelsCreateFromTemplate',
|
||
|
{
|
||
|
template,
|
||
|
},
|
||
|
]);
|
||
3 years ago
|
} catch (e) {
|
||
2 years ago
|
this.$toast.error(e.message).goAway(3000);
|
||
3 years ago
|
}
|
||
2 years ago
|
},
|
||
|
},
|
||
|
};
|
||
3 years ago
|
</script>
|
||
|
|
||
2 years ago
|
<style scoped></style>
|