mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 15:07:33 +08:00
support renaming queries, duplicating queries, and displaying query expressions separately for each query
This commit is contained in:
@@ -212,6 +212,22 @@ export class TransactionExploreQuery {
|
||||
return finalTokens;
|
||||
}
|
||||
|
||||
public clone(): TransactionExploreQuery {
|
||||
const clonedConditions: TransactionExploreConditionWithRelation[] = [];
|
||||
|
||||
for (const condition of this.conditions) {
|
||||
const clonedCondition = TransactionExploreConditionWithRelation.parse(condition.toJsonObject());
|
||||
|
||||
if (!clonedCondition) {
|
||||
continue;
|
||||
}
|
||||
|
||||
clonedConditions.push(clonedCondition);
|
||||
}
|
||||
|
||||
return new TransactionExploreQuery(this.name, clonedConditions);
|
||||
}
|
||||
|
||||
public toJson(): string {
|
||||
return JSON.stringify({
|
||||
name: this.name,
|
||||
|
||||
Reference in New Issue
Block a user