@@ -297,11 +360,6 @@ const {
});
const handleTableChange = (pagination: any, sorter: any, extra: any) => {
- console.log('分页信息:', pagination);
- console.log('排序信息:', sorter);
- console.log('额外信息:', extra);
- console.log('所有列信息:', columns.value);
-
// 获取当前排序的列信息
if (sorter && sorter.sorter.direction == 'ascend' && sorter.sorter.field !== undefined) {
// 在columns中查找对应的列
@@ -312,12 +370,9 @@ const handleTableChange = (pagination: any, sorter: any, extra: any) => {
});
if (column) {
- console.log('找到的列:', column);
if (column.date) {
- console.log('当前排序列的日期:', column.date);
// 获取格式化的日期字符串
const formattedDate = DateUtils.formatDate(column.date);
- console.log('当前排序列的格式化日期:', formattedDate);
query.top_execution_time = formattedDate;
handleSearch();
}
@@ -369,10 +424,12 @@ const query = reactive({
page: 1,
page_size: 20,
platform: '',
- operator_id: undefined,
+ operator_ids: undefined,
name: '',
- execution_time: [] as string[],
+ top_execution_time: '' as string | undefined,
+ execution_time: undefined,
operator: '',
+ ids: [],
});
// 处理删除操作
@@ -722,17 +779,16 @@ const handleFilterChange = (field: string, value: any, options?: any[]) => {
// 根据不同的筛选字段执行不同的操作
switch (field) {
case 'operator_id':
- console.log('运营人员选择:', value);
+ console.log('运营人员选择:', value, typeof value, Array.isArray(value), options);
// 查找选中的运营人员完整信息
if (options && value) {
if (Array.isArray(value)) {
// 多选情况
- const selectedOperators = options.filter((op: any) => value.includes(op.value));
+ const selectedOperators = options.filter((op) => value.includes(op.name)).map((op) => op.value);
+ query.operator_ids = selectedOperators;
console.log('选中的运营人员完整信息(多选):', selectedOperators);
- } else {
- // 单选情况
- const selectedOperator = options.find((op: any) => op.value == value);
- console.log('选中的运营人员完整信息(单选):', selectedOperator);
+ handleSearch();
+ break;
}
}
break;
@@ -754,13 +810,11 @@ const handleFilterChange = (field: string, value: any, options?: any[]) => {
default:
console.log('未知筛选字段:', field, value);
}
-
- // 调用原有的搜索函数
- handleSearch();
};
// 获取数据
const handleSearch = () => {
+ console.log('handleSearch查询参数:', query);
query.page = pageInfo.page;
query.page_size = pageInfo.page_size;
getTaskSchedules(query)
From 19f2eb86f978c4f5006606ffadbd895cfe043086 Mon Sep 17 00:00:00 2001
From: lq <121091329@qq.com>
Date: Thu, 4 Sep 2025 09:21:18 +0800
Subject: [PATCH 09/13] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=9A=84=E8=AE=BE?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../assignment-management/index.vue | 47 +++++++++++++------
1 file changed, 32 insertions(+), 15 deletions(-)
diff --git a/src/views/property-marketing/assignment-management/index.vue b/src/views/property-marketing/assignment-management/index.vue
index cd0532a..b4519bf 100644
--- a/src/views/property-marketing/assignment-management/index.vue
+++ b/src/views/property-marketing/assignment-management/index.vue
@@ -146,9 +146,13 @@
账号名称
{
+ handleFilterChange('account_id', val, accountList);
+ }
+ "
class="!w-200px"
placeholder="请选择账号名称"
/>
@@ -411,24 +415,26 @@ const data = ref([]);
const operators = ref([]);
const accountList = ref([]);
const platformOptions = ref([
- { value: 0, label: '抖音' },
- { value: 1, label: '小红书' },
- { value: 2, label: 'B站' },
- { value: 3, label: '快手' },
- { value: 4, label: '视频号' },
- { value: 5, label: '微博' },
- { value: 6, label: '公众号' },
+ { id: 0, name: '抖音' },
+ { id: 1, name: '小红书' },
+ { id: 2, name: 'B站' },
+ { id: 3, name: '快手' },
+ { id: 4, name: '视频号' },
+ { id: 5, name: '微博' },
+ { id: 6, name: '公众号' },
]);
const query = reactive({
page: 1,
page_size: 20,
- platform: '',
+ platforms: undefined,
operator_ids: undefined,
name: '',
top_execution_time: '' as string | undefined,
execution_time: undefined,
operator: '',
+ platform:'',
+ accounts:'',
ids: [],
});
@@ -792,6 +798,19 @@ const handleFilterChange = (field: string, value: any, options?: any[]) => {
}
}
break;
+ case 'account_id':
+ console.log('账号名称选择:', value);
+ // 查找选中的平台完整信息
+ if (options && value !== undefined && value !== '') {
+ if (Array.isArray(value)) {
+ // 多选情况
+ const selectedPlatforms = options.filter((op: any) => value.includes(op.value));
+ query.ids = selectedPlatforms;
+ handleSearch();
+ break;
+ }
+ }
+ break;
case 'platform':
console.log('发布平台选择:', value);
// 查找选中的平台完整信息
@@ -799,11 +818,9 @@ const handleFilterChange = (field: string, value: any, options?: any[]) => {
if (Array.isArray(value)) {
// 多选情况
const selectedPlatforms = options.filter((op: any) => value.includes(op.value));
- console.log('选中的发布平台完整信息(多选):', selectedPlatforms);
- } else {
- // 单选情况
- const selectedPlatform = options.find((op: any) => op.value == value);
- console.log('选中的发布平台完整信息(单选):', selectedPlatform);
+ query.platforms = selectedPlatforms;
+ handleSearch();
+ break;
}
}
break;
From 835032ad3ac0c593544d97e89b8d198fe2c40e5f Mon Sep 17 00:00:00 2001
From: lq <121091329@qq.com>
Date: Thu, 4 Sep 2025 11:09:21 +0800
Subject: [PATCH 10/13] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=AD=9B=E9=80=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/common-select/index.vue | 7 +-
.../assignment-management/index.vue | 86 +++++++++++++------
2 files changed, 67 insertions(+), 26 deletions(-)
diff --git a/src/components/common-select/index.vue b/src/components/common-select/index.vue
index fbcc4c9..b895a1e 100644
--- a/src/components/common-select/index.vue
+++ b/src/components/common-select/index.vue
@@ -13,7 +13,10 @@
@change="handleChange"
>
- {{ item.name }}
+
+
![]()
+ {{ item.name }}
+
@@ -68,4 +71,4 @@ const handleChange = (value) => {
selectedValues.value = value;
emits('change', value);
};
-
+
\ No newline at end of file
diff --git a/src/views/property-marketing/assignment-management/index.vue b/src/views/property-marketing/assignment-management/index.vue
index b4519bf..135961e 100644
--- a/src/views/property-marketing/assignment-management/index.vue
+++ b/src/views/property-marketing/assignment-management/index.vue
@@ -148,6 +148,7 @@
{
handleFilterChange('account_id', val, accountList);
@@ -356,9 +357,13 @@ const {
DEFAULT_PAGE_INFO,
} = useTableSelectionWithPagination({
onPageChange: () => {
+ query.page = pageInfo.page;
+ query.page_size = pageInfo.page_size;
handleSearch();
},
onPageSizeChange: () => {
+ query.page = pageInfo.page;
+ query.page_size = pageInfo.page_size;
handleSearch();
},
});
@@ -415,13 +420,13 @@ const data = ref([]);
const operators = ref([]);
const accountList = ref([]);
const platformOptions = ref([
- { id: 0, name: '抖音' },
- { id: 1, name: '小红书' },
- { id: 2, name: 'B站' },
- { id: 3, name: '快手' },
- { id: 4, name: '视频号' },
- { id: 5, name: '微博' },
- { id: 6, name: '公众号' },
+ { id: 0, name: '抖音', icon: icon1 },
+ { id: 1, name: '小红书', icon: icon2 },
+ { id: 2, name: 'B站', icon: icon8 },
+ { id: 3, name: '快手', icon: icon7 },
+ { id: 4, name: '视频号', icon: icon4 },
+ { id: 5, name: '微博', icon: icon5 },
+ { id: 6, name: '公众号', icon: icon6 },
]);
const query = reactive({
@@ -433,8 +438,8 @@ const query = reactive({
top_execution_time: '' as string | undefined,
execution_time: undefined,
operator: '',
- platform:'',
- accounts:'',
+ platform: '',
+ accounts: '',
ids: [],
});
@@ -504,6 +509,21 @@ const getPlatformIcon = (platform: number) => {
return platformIcons[platform] || icon3; // 默认图标
};
+// 根据平台ID获取平台名称
+const getPlatformName = (platform: number) => {
+ const platformNames: { [key: number]: string } = {
+ 0: '抖音',
+ 1: '小红书',
+ 2: 'B站',
+ 3: '快手',
+ 4: '视频号',
+ 5: '微博',
+ 6: '公众号',
+ };
+
+ return platformNames[platform] || '未知平台';
+};
+
// 获取任务颜色
const getTaskColor = (taskType: number, executionTime: number) => {
// 判断任务是否已过期
@@ -792,37 +812,42 @@ const handleFilterChange = (field: string, value: any, options?: any[]) => {
// 多选情况
const selectedOperators = options.filter((op) => value.includes(op.name)).map((op) => op.value);
query.operator_ids = selectedOperators;
- console.log('选中的运营人员完整信息(多选):', selectedOperators);
- handleSearch();
- break;
}
+ } else {
+ query.operator_ids = [];
}
+ console.log('选中的运营人员完整信息(多选):', query.operator_ids);
+ handleSearch();
break;
case 'account_id':
- console.log('账号名称选择:', value);
- // 查找选中的平台完整信息
+ // 查找选中的账号完整信息
if (options && value !== undefined && value !== '') {
if (Array.isArray(value)) {
+ console.log(options, value);
// 多选情况
- const selectedPlatforms = options.filter((op: any) => value.includes(op.value));
- query.ids = selectedPlatforms;
- handleSearch();
- break;
+ const selectedAccounts = options.filter((op: any) => value.includes(op.name));
+ query.ids = selectedAccounts.map((account: any) => account.value);
}
+ } else {
+ query.ids = [];
}
+ console.log('选中的账号完整信息(单选):', query.ids);
+ handleSearch();
break;
case 'platform':
- console.log('发布平台选择:', value);
// 查找选中的平台完整信息
if (options && value !== undefined && value !== '') {
+ console.log(options, value);
if (Array.isArray(value)) {
// 多选情况
- const selectedPlatforms = options.filter((op: any) => value.includes(op.value));
- query.platforms = selectedPlatforms;
- handleSearch();
- break;
+ const selectedPlatforms = options.filter((op: any) => value.includes(op.id));
+ query.platforms = selectedPlatforms.map((account: any) => account.id);
}
+ } else {
+ query.platforms = [];
}
+ console.log('发布平台选择:', query.platforms);
+ handleSearch();
break;
default:
console.log('未知筛选字段:', field, value);
@@ -867,9 +892,22 @@ const getAccountList = async () => {
try {
const { code, data: accountData } = await getMediaAccountList();
if (code === 200) {
+ // 创建平台映射,用于获取平台名称
+ const platformMap = {
+ 0: '抖音',
+ 1: '小红书',
+ 2: 'B站',
+ 3: '快手',
+ 4: '视频号',
+ 5: '微博',
+ 6: '公众号',
+ };
+
accountList.value = accountData.map((account: any) => ({
value: account.id,
- name: account.name,
+ name: `${account.name}(${platformMap[account.platform] || '未知平台'})`,
+ platform: account.platform,
+ icon: getPlatformIcon(account.platform),
}));
}
} catch (error) {}
From e235d36ee70f8538ac65af413d15d5b68087bc90 Mon Sep 17 00:00:00 2001
From: lq <121091329@qq.com>
Date: Thu, 4 Sep 2025 15:48:06 +0800
Subject: [PATCH 11/13] =?UTF-8?q?=E8=AF=A6=E6=83=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../routes/modules/propertyMarketing.ts | 13 +++++
src/stores/modules/side-bar/constants.ts | 2 +
src/utils/DateUtils.ts | 56 -------------------
.../assignment-management/index.vue | 34 ++++++++---
4 files changed, 41 insertions(+), 64 deletions(-)
diff --git a/src/router/routes/modules/propertyMarketing.ts b/src/router/routes/modules/propertyMarketing.ts
index eab2175..c80e9ae 100644
--- a/src/router/routes/modules/propertyMarketing.ts
+++ b/src/router/routes/modules/propertyMarketing.ts
@@ -84,6 +84,19 @@ const COMPONENTS: AppRouteRecordRaw[] = [
},
component: () => import('@/views/property-marketing/assignment-management/index.vue'),
},
+ {
+ path: 'management-detail/:id',
+ name: 'managementDetail',
+ meta: {
+ locale: '任务详情',
+ requiresAuth: true,
+ requireLogin: true,
+ roles: ['*'],
+ hideInMenu: true,
+ activeMenu: 'MediaAccountAccountDashboard',
+ },
+ component: () => import('@/views/property-marketing/assignment-management/managementDetail.vue'),
+ },
{
path: 'detail/:id',
name: 'MediaAccountAccountDetails',
diff --git a/src/stores/modules/side-bar/constants.ts b/src/stores/modules/side-bar/constants.ts
index 3c458e8..de80a81 100644
--- a/src/stores/modules/side-bar/constants.ts
+++ b/src/stores/modules/side-bar/constants.ts
@@ -85,6 +85,8 @@ export const MENU_LIST = [
'MediaAccountAccountManagement',
'MediaAccountAccountDashboard',
'MediaAccountAccountDetails',
+ 'assignmentManagement',
+ 'managementDetail',
],
},
{
diff --git a/src/utils/DateUtils.ts b/src/utils/DateUtils.ts
index 9b2a237..dfcb77e 100644
--- a/src/utils/DateUtils.ts
+++ b/src/utils/DateUtils.ts
@@ -349,63 +349,7 @@ class DateUtils {
};
}
- /**
- * 获取当前日期信息(增强版,包含年月信息)
- * @returns 包含各种格式的当前日期信息
- */
- static getCurrentDateInfo() {
- const now = new Date();
- now.setHours(0, 0, 0, 0);
- const monthRange = this.getMonthRange();
- const weekRange = this.getWeekRange();
- const yearMonth = this.getCurrentYearMonth();
-
- return {
- current: {
- date: now,
- formatted: this.formatDate(now),
- dayOfWeek: this.getChineseDayOfWeek(now),
- day: now.getDate(),
- month: yearMonth.month,
- year: yearMonth.year,
- },
- month: {
- start: monthRange.start,
- end: monthRange.end,
- startFormatted: monthRange.startFormatted,
- endFormatted: monthRange.endFormatted,
- totalDays: this.getDaysInMonth(now.getFullYear(), now.getMonth() + 1),
- month: yearMonth.month,
- year: yearMonth.year,
- formatted: this.getFormattedYearMonth(),
- chinese: this.getChineseYearMonth(),
- },
- week: {
- start: weekRange.start,
- end: weekRange.end,
- startFormatted: weekRange.startFormatted,
- endFormatted: weekRange.endFormatted,
- weekNumber: this.getWeekNumber(now),
- },
- year: yearMonth.year,
- quarter: {
- number: this.getCurrentQuarter(),
- range: this.getCurrentQuarterRange(),
- },
- };
- }
-
- /**
- * 获取指定日期所在的周数
- * @param date 日期对象
- * @returns 周数 (1-53)
- */
- static getWeekNumber(date: Date): number {
- const firstDayOfYear = new Date(date.getFullYear(), 0, 1);
- const pastDaysOfYear = (date.getTime() - firstDayOfYear.getTime()) / 86400000;
- return Math.ceil((pastDaysOfYear + firstDayOfYear.getDay() + 1) / 7);
- }
/**
* 获取指定年份的所有月份信息
diff --git a/src/views/property-marketing/assignment-management/index.vue b/src/views/property-marketing/assignment-management/index.vue
index 135961e..d8ef5d7 100644
--- a/src/views/property-marketing/assignment-management/index.vue
+++ b/src/views/property-marketing/assignment-management/index.vue
@@ -325,6 +325,11 @@
{{ deleteContent }}
+
+
+