diff --git a/src/components/newtab/storage/StorageEditTable.vue b/src/components/newtab/storage/StorageEditTable.vue index fbf66deb1..b5bca220c 100644 --- a/src/components/newtab/storage/StorageEditTable.vue +++ b/src/components/newtab/storage/StorageEditTable.vue @@ -6,7 +6,7 @@ style="height: 600px" >

- {{ t('storage.table.add') }} + {{ title || t('storage.table.add') }}

{{ t('message.noData') }}

- + + +
@@ -73,6 +84,7 @@ import { reactive, toRaw, watch } from 'vue'; import { useI18n } from 'vue-i18n'; import { nanoid } from 'nanoid'; +import draggable from 'vuedraggable'; import cloneDeep from 'lodash.clonedeep'; import { dataTypes } from '@/utils/constants/table'; @@ -85,6 +97,10 @@ const props = defineProps({ type: String, default: '', }, + title: { + type: String, + default: '', + }, columns: { type: Array, default: () => [], @@ -122,7 +138,10 @@ function updateColumnName(index, target) { state.columns[index].name = columnName; } function saveTable() { - const rawState = toRaw(state); + const rawState = { + ...toRaw(state), + columns: state.columns.map(toRaw), + }; emit('save', { ...rawState, changes }); } diff --git a/src/locales/en/newtab.json b/src/locales/en/newtab.json index b1f34d90a..2cf0a7263 100644 --- a/src/locales/en/newtab.json +++ b/src/locales/en/newtab.json @@ -42,6 +42,7 @@ "title": "Storage", "table": { "add": "Add table", + "edit": "Edit table", "createdAt": "Created at", "modifiedAt": "Modified at", "rowsCount": "Rows count", diff --git a/src/newtab/pages/storage/Tables.vue b/src/newtab/pages/storage/Tables.vue index 22995224a..5e0e2e96a 100644 --- a/src/newtab/pages/storage/Tables.vue +++ b/src/newtab/pages/storage/Tables.vue @@ -75,6 +75,7 @@