|
|
@@ -11,6 +11,8 @@
|
|
|
format="YYYY-MM-DD"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
style="width: 140px"
|
|
|
+ :disabled-date="(date: Date) => endDate ? date > new Date(endDate) : false"
|
|
|
+ @change="handleFilterChange"
|
|
|
/>
|
|
|
<span class="filter-label">结束时间</span>
|
|
|
<el-date-picker
|
|
|
@@ -20,6 +22,8 @@
|
|
|
format="YYYY-MM-DD"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
style="width: 140px"
|
|
|
+ :disabled-date="(date: Date) => startDate ? date < new Date(startDate) : false"
|
|
|
+ @change="handleFilterChange"
|
|
|
/>
|
|
|
<div class="quick-btns">
|
|
|
<el-button
|
|
|
@@ -39,6 +43,7 @@
|
|
|
collapse-tags-tooltip
|
|
|
placeholder="选择账号"
|
|
|
style="width: 160px"
|
|
|
+ @change="handleFilterChange"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="account in accountList"
|
|
|
@@ -47,7 +52,6 @@
|
|
|
:value="account.id"
|
|
|
/>
|
|
|
</el-select>
|
|
|
- <el-button type="primary" @click="handleQuery">查询</el-button>
|
|
|
</div>
|
|
|
<div class="filter-right">
|
|
|
<el-button @click="handleExport">导出数据</el-button>
|
|
|
@@ -70,7 +74,7 @@
|
|
|
<!-- 第二行筛选 -->
|
|
|
<div class="filter-bar secondary">
|
|
|
<div class="filter-left">
|
|
|
- <el-select v-model="selectedGroup" placeholder="全部" clearable style="width: 120px">
|
|
|
+ <el-select v-model="selectedGroup" placeholder="全部" clearable style="width: 120px" @change="handleFilterChange">
|
|
|
<el-option label="全部" value="" />
|
|
|
<el-option
|
|
|
v-for="group in accountGroups"
|
|
|
@@ -79,7 +83,7 @@
|
|
|
:value="group.id"
|
|
|
/>
|
|
|
</el-select>
|
|
|
- <el-select v-model="selectedPlatform" placeholder="全部平台" clearable style="width: 120px">
|
|
|
+ <el-select v-model="selectedPlatform" placeholder="全部平台" clearable style="width: 120px" @change="handleFilterChange">
|
|
|
<el-option label="全部平台" value="" />
|
|
|
<el-option
|
|
|
v-for="platform in availablePlatforms"
|
|
|
@@ -97,8 +101,9 @@
|
|
|
placeholder="请输入要搜索的作品标题"
|
|
|
clearable
|
|
|
style="width: 240px"
|
|
|
- @clear="handleQuery"
|
|
|
- @keyup.enter="handleQuery"
|
|
|
+ @input="handleSearchInput"
|
|
|
+ @clear="handleFilterChange"
|
|
|
+ @keyup.enter="handleFilterChange"
|
|
|
>
|
|
|
<template #prefix>
|
|
|
<el-icon><Search /></el-icon>
|
|
|
@@ -154,6 +159,7 @@
|
|
|
<span class="publish-time">{{ formatTime(row.publishTime) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <!-- 操作列暂时注释
|
|
|
<el-table-column label="操作" width="80" align="center" fixed="right">
|
|
|
<template #default="{ row }">
|
|
|
<el-button type="primary" link @click="handleView(row)">
|
|
|
@@ -161,6 +167,7 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ -->
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 分页 -->
|
|
|
@@ -239,7 +246,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import { ref, computed, onMounted } from 'vue';
|
|
|
import { Search, Picture, Document, View, ChatDotRound, Share, Star, Pointer } from '@element-plus/icons-vue';
|
|
|
-import { PLATFORMS } from '@media-manager/shared';
|
|
|
+import { PLATFORMS, AVAILABLE_PLATFORM_TYPES } from '@media-manager/shared';
|
|
|
import type { PlatformType } from '@media-manager/shared';
|
|
|
import { useAuthStore } from '@/stores/auth';
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
@@ -278,11 +285,11 @@ interface AccountGroup {
|
|
|
}
|
|
|
const accountGroups = ref<AccountGroup[]>([]);
|
|
|
|
|
|
-// 可用平台
|
|
|
+// 可用平台(统一配置:小红书、抖音、视频号、百家号)
|
|
|
const availablePlatforms = computed(() => {
|
|
|
- return Object.entries(PLATFORMS).map(([key, value]) => ({
|
|
|
- value: key as PlatformType,
|
|
|
- label: value.name,
|
|
|
+ return AVAILABLE_PLATFORM_TYPES.map(key => ({
|
|
|
+ value: key,
|
|
|
+ label: PLATFORMS[key].name,
|
|
|
}));
|
|
|
});
|
|
|
|
|
|
@@ -382,6 +389,7 @@ function handleQuickDate(type: string) {
|
|
|
endDate.value = today.format('YYYY-MM-DD');
|
|
|
break;
|
|
|
}
|
|
|
+ handleQuery();
|
|
|
}
|
|
|
|
|
|
// 查询
|
|
|
@@ -389,6 +397,23 @@ function handleQuery() {
|
|
|
loadData();
|
|
|
}
|
|
|
|
|
|
+// 平台/分组/日期/账号变更时重置页码并查询
|
|
|
+function handleFilterChange() {
|
|
|
+ currentPage.value = 1;
|
|
|
+ handleQuery();
|
|
|
+}
|
|
|
+
|
|
|
+// 搜索框防抖(300ms 后触发查询)
|
|
|
+let searchDebounceTimer: ReturnType<typeof setTimeout> | null = null;
|
|
|
+function handleSearchInput() {
|
|
|
+ if (searchDebounceTimer) clearTimeout(searchDebounceTimer);
|
|
|
+ searchDebounceTimer = setTimeout(() => {
|
|
|
+ currentPage.value = 1;
|
|
|
+ handleQuery();
|
|
|
+ searchDebounceTimer = null;
|
|
|
+ }, 300);
|
|
|
+}
|
|
|
+
|
|
|
// 加载账号列表
|
|
|
async function loadAccountList() {
|
|
|
try {
|