Skip to content

Commit

Permalink
重构导出json
Browse files Browse the repository at this point in the history
  • Loading branch information
xaoyaoo committed Apr 20, 2024
1 parent 946459d commit d77665b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions src/components/chatBackup/ExportCSV.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ watch(() => props.wxid, (newVal: string, oldVal: String) => {
});
// 上述代码是监听props.wxid的变化,当props.wxid变化时,会打印新值。
const datetime = ref([]);
// const datetime = ref([]);
const Result = ref("");
const requestExport = async () => {
Result.value = "正在处理中...";
try {
Result.value = await http.post('/api/export_csv', {
'wxid': props.wxid,
'datetime': datetime.value,
// 'datetime': datetime.value,
});
} catch (error) {
console.error('Error fetching data msg_count:', error);
Expand All @@ -33,18 +33,18 @@ const requestExport = async () => {
}
// 处理时间选择器的数据
const handDatetimeChildData = (val: any) => {
datetime.value = val;
}
// const handDatetimeChildData = (val: any) => {
// datetime.value = val;
// }
</script>

<template>
<div>
<div>
<strong>时间(默认全部):</strong>
<DateTimeSelect @datetime="handDatetimeChildData"/>
</div>
<!-- <div>-->
<!-- <strong>时间(默认全部):</strong>-->
<!-- <DateTimeSelect @datetime="handDatetimeChildData"/>-->
<!-- </div>-->

<div style="position: relative;">
<el-button type="primary" @click="requestExport()">导出</el-button>
Expand Down
10 changes: 5 additions & 5 deletions src/components/chatBackup/ExportJSON.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const requestExport = async () => {
try {
Result.value = await http.post('/api/export_json', {
'wxid': props.wxid,
'datetime': datetime.value,
// 'datetime': datetime.value,
});
} catch (error) {
console.error('Error fetching data msg_count:', error);
Expand All @@ -41,10 +41,10 @@ const handDatetimeChildData = (val: any) => {

<template>
<div>
<div>
<strong>时间(默认全部):</strong>
<DateTimeSelect @datetime="handDatetimeChildData"/>
</div>
<!-- <div>-->
<!-- <strong>时间(默认全部):</strong>-->
<!-- <DateTimeSelect @datetime="handDatetimeChildData"/>-->
<!-- </div>-->

<div style="position: relative;">
<el-button type="primary" @click="requestExport()">导出</el-button>
Expand Down

0 comments on commit d77665b

Please sign in to comment.