-
-
-
-
-
-
-
Kopiert: Quelle, Freigaben und Optionen
-
@@ -308,7 +289,6 @@ const ADBNetzgebiet = {
filterDebounce: null,
showEditModal: false,
editItem: null,
- copyFromId: '',
showHistoryModal: false,
historyLoading: false,
historyItems: [],
@@ -380,13 +360,6 @@ const ADBNetzgebiet = {
paginationEnd() { return Math.min(this.currentPage * this.pageSize, this.filteredNetzgebiete.length); },
filteredHistory() {
return this.historyItems.filter(e => !['edit', 'create'].includes(e.field));
- },
- copyableNetzgebiete() {
- return this.netzgebiete.filter(item => {
- if (!item.netzgebiet?.id) return false;
- if (this.editItem?.id && item.netzgebiet.id === this.editItem.id) return false;
- return true;
- });
}
},
@@ -397,6 +370,12 @@ const ADBNetzgebiet = {
async mounted() { await this.fetchNetzgebiete(); },
methods: {
+ formatConsentName(name) {
+ if (name && name.startsWith('Glasfaserprojekt')) {
+ return name.replace('Glasfaserprojekt', 'Glasfaserprojekt
');
+ }
+ return name;
+ },
debouncedFilter() {
clearTimeout(this.filterDebounce);
this.filterDebounce = setTimeout(() => this.currentPage = 1, 300);
@@ -423,7 +402,6 @@ const ADBNetzgebiet = {
catch { return []; }
},
openCreateModal() {
- this.copyFromId = '';
this.editItem = {
id: null, name: '', extref: '', source: '', source_id: '',
freigabe: { interest: true, provision: true, order: true, reorder: true },
@@ -432,7 +410,6 @@ const ADBNetzgebiet = {
this.showEditModal = true;
},
openEditModal(item) {
- this.copyFromId = '';
const n = item.netzgebiet;
let options = {};
try { options = JSON.parse(n.options || '{}'); } catch {}
@@ -448,32 +425,7 @@ const ADBNetzgebiet = {
};
this.showEditModal = true;
},
- copyFromNetzgebiet() {
- if (!this.copyFromId || !this.editItem) return;
- const source = this.netzgebiete.find(item => item.netzgebiet?.id == this.copyFromId);
- if (!source) return;
- const n = source.netzgebiet;
-
- // Copy source
- if (n.source) this.editItem.source = n.source;
-
- // Copy freigabe
- let freigabeArr = [];
- try { freigabeArr = JSON.parse(n.freigabe || '[]') || []; } catch {}
- ['interest', 'provision', 'order', 'reorder'].forEach(f => {
- this.editItem.freigabe[f] = freigabeArr.includes(f);
- });
-
- // Copy options
- let options = {};
- try { options = JSON.parse(n.options || '{}'); } catch {}
- this.editItem.options = { ...this.defaultOptions, ...options };
-
- window.notify?.('success', `Felder von "${n.name}" kopiert.`);
- this.copyFromId = '';
- },
async copyNetzgebiet(item) {
- this.copyFromId = '';
const n = item.netzgebiet;
let options = {};
try { options = JSON.parse(n.options || '{}'); } catch {}