运营人员

This commit is contained in:
lq
2025-09-03 18:22:51 +08:00
parent e8b117d29e
commit 7720c3ac06

View File

@ -88,12 +88,75 @@
</template> </template>
</a-trigger> </a-trigger>
<a-button size="small"> <a-trigger
<template #icon> trigger="click"
<icon-filter size="16" class="color-#55585F" /> style="
background-color: #ffffff;
border: 1px solid #d9d9d9;
border-radius: 4px;
box-shadow: #00000010 0px 2px 8px;
width: 308px;
max-height: 400px;
overflow-y: auto;
padding: 24px;
margin-top: 8px;
"
>
<a-button size="small">
<template #icon>
<icon-filter size="16" class="color-#55585F" />
</template>
<template #default>筛选</template>
</a-button>
<template #content>
<div>
<div class="flex items-center mb-24px">
<div class="w-70px">运营人员</div>
<a-space class="w-200px">
<CommonSelect
placeholder="请选择运营人员"
:options="operators"
v-model="query.operator"
@change="
(val) => {
handleFilterChange('operator_id', val, operators);
}
"
class="!w-200px"
/>
</a-space>
</div>
<div class="flex items-center mb-24px">
<div class="w-70px">发布平台</div>
<a-space class="w-200px">
<CommonSelect
:options="platformOptions"
v-model="query.platform"
@change="
(val) => {
handleFilterChange('platform', val, platformOptions);
}
"
class="!w-200px"
placeholder="请选择发布平台"
/>
</a-space>
</div>
<div class="flex items-center">
<div class="w-80px">账号名称</div>
<a-space class="w-200px">
<CommonSelect
v-model="query.tag_ids"
:options="accountList"
@change="handleSearch"
class="!w-200px"
placeholder="请选择账号名称"
/>
</a-space>
</div>
</div>
</template> </template>
<template #default>筛选</template> </a-trigger>
</a-button>
</div> </div>
</div> </div>
<div class="flex justify-between items-start mt-16px" style="width: 100%"> <div class="flex justify-between items-start mt-16px" style="width: 100%">
@ -297,11 +360,6 @@ const {
}); });
const handleTableChange = (pagination: any, sorter: any, extra: any) => { 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) { if (sorter && sorter.sorter.direction == 'ascend' && sorter.sorter.field !== undefined) {
// 在columns中查找对应的列 // 在columns中查找对应的列
@ -312,12 +370,9 @@ const handleTableChange = (pagination: any, sorter: any, extra: any) => {
}); });
if (column) { if (column) {
console.log('找到的列:', column);
if (column.date) { if (column.date) {
console.log('当前排序列的日期:', column.date);
// 获取格式化的日期字符串 // 获取格式化的日期字符串
const formattedDate = DateUtils.formatDate(column.date); const formattedDate = DateUtils.formatDate(column.date);
console.log('当前排序列的格式化日期:', formattedDate);
query.top_execution_time = formattedDate; query.top_execution_time = formattedDate;
handleSearch(); handleSearch();
} }
@ -369,10 +424,12 @@ const query = reactive({
page: 1, page: 1,
page_size: 20, page_size: 20,
platform: '', platform: '',
operator_id: undefined, operator_ids: undefined,
name: '', name: '',
execution_time: [] as string[], top_execution_time: '' as string | undefined,
execution_time: undefined,
operator: '', operator: '',
ids: [],
}); });
// 处理删除操作 // 处理删除操作
@ -722,17 +779,16 @@ const handleFilterChange = (field: string, value: any, options?: any[]) => {
// 根据不同的筛选字段执行不同的操作 // 根据不同的筛选字段执行不同的操作
switch (field) { switch (field) {
case 'operator_id': case 'operator_id':
console.log('运营人员选择:', value); console.log('运营人员选择:', value, typeof value, Array.isArray(value), options);
// 查找选中的运营人员完整信息 // 查找选中的运营人员完整信息
if (options && value) { if (options && value) {
if (Array.isArray(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); console.log('选中的运营人员完整信息(多选):', selectedOperators);
} else { handleSearch();
// 单选情况 break;
const selectedOperator = options.find((op: any) => op.value == value);
console.log('选中的运营人员完整信息(单选):', selectedOperator);
} }
} }
break; break;
@ -754,13 +810,11 @@ const handleFilterChange = (field: string, value: any, options?: any[]) => {
default: default:
console.log('未知筛选字段:', field, value); console.log('未知筛选字段:', field, value);
} }
// 调用原有的搜索函数
handleSearch();
}; };
// 获取数据 // 获取数据
const handleSearch = () => { const handleSearch = () => {
console.log('handleSearch查询参数:', query);
query.page = pageInfo.page; query.page = pageInfo.page;
query.page_size = pageInfo.page_size; query.page_size = pageInfo.page_size;
getTaskSchedules(query) getTaskSchedules(query)