Skip to content

Commit 359047d

Browse files
committed
feat(App): enhance export functionality with timestamped filenames
1 parent bf23978 commit 359047d

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

dist/assets/index-BjKdPwc7.js dist/assets/index-ivee2FPd.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<link rel="icon" href="./favicon.ico">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>Vite App</title>
8-
<script type="module" crossorigin src="./assets/index-BjKdPwc7.js"></script>
8+
<script type="module" crossorigin src="./assets/index-ivee2FPd.js"></script>
99
<link rel="stylesheet" crossorigin href="./assets/index-DTGrfxsC.css">
1010
</head>
1111
<body>

src/App.vue

+16-15
Original file line numberDiff line numberDiff line change
@@ -664,25 +664,26 @@ export default {
664664
this.autoExport = parsed.autoExport ?? true;
665665
}
666666
},
667-
668667
handleExport(task) {
668+
const data = {
669+
...task,
670+
developer: 'createskyblue'
671+
};
672+
const dataStr = JSON.stringify(data, null, 2);
673+
const timestamp = new Date().toISOString().replace(/T/, '_').replace(/\..+/, '').replace(/:/g, '-');
674+
this.downloadFile(dataStr, `task_${task.name}_${timestamp}.json`, 'application/json');
675+
},
676+
handleGlobalExport(format) {
677+
if (format === 'json') {
669678
const data = {
670-
...task,
671-
developer: 'createskyblue'
679+
tasks: this.tasks,
680+
taskDescriptions: this.taskDescriptions,
681+
developer: 'createskyblue'
672682
};
673683
const dataStr = JSON.stringify(data, null, 2);
674-
this.downloadFile(dataStr, `task_${task.id}.json`, 'application/json');
675-
},
676-
handleGlobalExport(format) {
677-
if (format === 'json') {
678-
const data = {
679-
tasks: this.tasks,
680-
taskDescriptions: this.taskDescriptions,
681-
developer: 'createskyblue'
682-
};
683-
const dataStr = JSON.stringify(data, null, 2);
684-
this.downloadFile(dataStr, 'all_tasks.json', 'application/json');
685-
}
684+
const timestamp = new Date().toISOString().replace(/T/, '_').replace(/\..+/, '').replace(/:/g, '-');
685+
this.downloadFile(dataStr, `all_tasks_${timestamp}.json`, 'application/json');
686+
}
686687
},
687688
downloadFile(content, filename, type) {
688689
const blob = new Blob([content], { type });

0 commit comments

Comments
 (0)