修改ui组件
This commit is contained in:
@ -11,7 +11,6 @@
|
|||||||
"prepare": "husky install"
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@arco-design/web-vue": "^2.42.0",
|
|
||||||
"@microsoft/fetch-event-source": "^2.0.1",
|
"@microsoft/fetch-event-source": "^2.0.1",
|
||||||
"@types/nprogress": "^0.2.0",
|
"@types/nprogress": "^0.2.0",
|
||||||
"@vueuse/core": "^9.12.0",
|
"@vueuse/core": "^9.12.0",
|
||||||
|
|||||||
@ -1,16 +1,10 @@
|
|||||||
<!-- // 新增内容: -->
|
<!-- // 新增内容: -->
|
||||||
<template>
|
<template>
|
||||||
<a-trigger trigger="click" :style="triggerStyle">
|
<a-popover trigger="click" :overlayStyle="{ width: '300px' }" overlayClassName="filter-popup-popover">
|
||||||
<a-button size="small">
|
|
||||||
<template #icon>
|
|
||||||
<icon-filter size="16" class="color-#55585F" />
|
|
||||||
</template>
|
|
||||||
<template #default>筛选</template>
|
|
||||||
</a-button>
|
|
||||||
<template #content>
|
<template #content>
|
||||||
<div>
|
<div>
|
||||||
<!-- 运营人员 -->
|
<!-- 运营人员 -->
|
||||||
<div class="flex items-center mb-24px">
|
<div class="flex items-center mb-6">
|
||||||
<div class="w-70px">运营人员</div>
|
<div class="w-70px">运营人员</div>
|
||||||
<a-space class="w-200px">
|
<a-space class="w-200px">
|
||||||
<CommonSelect
|
<CommonSelect
|
||||||
@ -19,11 +13,12 @@
|
|||||||
v-model="localQuery.operator"
|
v-model="localQuery.operator"
|
||||||
@change="(val) => handleChange('operator_id', val)"
|
@change="(val) => handleChange('operator_id', val)"
|
||||||
class="!w-200px"
|
class="!w-200px"
|
||||||
|
:allowSearch="true"
|
||||||
/>
|
/>
|
||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
<!-- 发布平台 -->
|
<!-- 发布平台 -->
|
||||||
<div class="flex items-center mb-24px">
|
<div class="flex items-center mb-6">
|
||||||
<div class="w-70px">发布平台</div>
|
<div class="w-70px">发布平台</div>
|
||||||
<a-space class="w-200px">
|
<a-space class="w-200px">
|
||||||
<CommonSelect
|
<CommonSelect
|
||||||
@ -32,12 +27,13 @@
|
|||||||
@change="(val) => handleChange('platform', val)"
|
@change="(val) => handleChange('platform', val)"
|
||||||
class="!w-200px"
|
class="!w-200px"
|
||||||
placeholder="请选择发布平台"
|
placeholder="请选择发布平台"
|
||||||
|
:allowSearch="true"
|
||||||
/>
|
/>
|
||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
<!-- 账号名称 -->
|
<!-- 账号名称 -->
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="w-80px">账号名称</div>
|
<div class="w-70px">账号名称</div>
|
||||||
<a-space class="w-200px">
|
<a-space class="w-200px">
|
||||||
<CommonSelect
|
<CommonSelect
|
||||||
v-model="localQuery.accounts"
|
v-model="localQuery.accounts"
|
||||||
@ -46,45 +42,74 @@
|
|||||||
@change="(val) => handleChange('account_id', val)"
|
@change="(val) => handleChange('account_id', val)"
|
||||||
class="!w-200px"
|
class="!w-200px"
|
||||||
placeholder="请选择账号名称"
|
placeholder="请选择账号名称"
|
||||||
|
:allowSearch="true"
|
||||||
/>
|
/>
|
||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</a-trigger>
|
<a-button size="small">
|
||||||
|
<template #icon>
|
||||||
|
<FilterOutlined class="color-#55585F" />
|
||||||
|
</template>
|
||||||
|
<template #default>筛选</template>
|
||||||
|
</a-button>
|
||||||
|
</a-popover>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
|
import { FilterOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
operators: Array,
|
operators: Array,
|
||||||
platformOptions: Array,
|
platformOptions: Array,
|
||||||
accountList: Array,
|
accountList: Array,
|
||||||
query: Object,
|
query: Object,
|
||||||
|
triggerStyle: Object,
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['update:query']);
|
const emit = defineEmits(['filter-change']);
|
||||||
|
|
||||||
// 初始化本地查询对象
|
// 初始化本地查询对象,只设置非空值
|
||||||
const localQuery = ref({ ...props.query });
|
const localQuery = ref({});
|
||||||
|
|
||||||
// 监听外部 query 变化并同步到本地状态
|
// 监听外部 query 变化并同步到本地状态
|
||||||
watch(
|
watch(
|
||||||
() => props.query,
|
() => props.query,
|
||||||
(newQuery) => {
|
(newQuery) => {
|
||||||
localQuery.value = { ...newQuery };
|
if (newQuery) {
|
||||||
|
// 只有当值不为空时才设置到localQuery中
|
||||||
|
const filteredQuery = {};
|
||||||
|
if (newQuery.operator) {
|
||||||
|
filteredQuery.operator = newQuery.operator;
|
||||||
|
}
|
||||||
|
if (newQuery.platform) {
|
||||||
|
filteredQuery.platform = newQuery.platform;
|
||||||
|
}
|
||||||
|
if (newQuery.accounts && newQuery.accounts.length > 0) {
|
||||||
|
filteredQuery.accounts = newQuery.accounts;
|
||||||
|
}
|
||||||
|
localQuery.value = { ...filteredQuery };
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ deep: true },
|
{ deep: true, immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
// 处理筛选变化
|
// 处理筛选变化
|
||||||
const handleChange = (field, value) => {
|
const handleChange = (field, value) => {
|
||||||
localQuery.value[field] = value;
|
localQuery.value[field] = value;
|
||||||
emit('update:query', { ...localQuery.value });
|
console.log(localQuery.value);
|
||||||
|
emit('filter-change', { ...localQuery.value });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 样式保持不变 */
|
.filter-popup-popover :deep(.ant-popover-inner-content) {
|
||||||
</style>
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #d9d9d9;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -13,7 +13,7 @@ import SvgIcon from '@/components/svg-icon/index.vue';
|
|||||||
|
|
||||||
import '@/api/index';
|
import '@/api/index';
|
||||||
import './core';
|
import './core';
|
||||||
import '@arco-design/web-vue/dist/arco.css'; // 已移除 Arco 样式
|
// import '@arco-design/web-vue/dist/arco.css'; // 已移除 Arco 样式
|
||||||
|
|
||||||
import 'normalize.css';
|
import 'normalize.css';
|
||||||
import 'uno.css';
|
import 'uno.css';
|
||||||
|
|||||||
@ -1,21 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-trigger
|
<a-popover trigger="click" overlayClassName="color-tip-popover">
|
||||||
trigger="click"
|
|
||||||
style="
|
|
||||||
background-color: #ffffff;
|
|
||||||
border: 1px solid #d9d9d9;
|
|
||||||
border-radius: 4px;
|
|
||||||
box-shadow: #00000010 0px 2px 8px;
|
|
||||||
padding: 8px;
|
|
||||||
margin-top: 8px;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<a-button size="small" class="mr-12px color-scheme-btn" :bordered="false">
|
|
||||||
<template #icon>
|
|
||||||
<icon-info-circle-fill size="16" class="color-#55585F" />
|
|
||||||
</template>
|
|
||||||
<template #default>颜色示意</template>
|
|
||||||
</a-button>
|
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="flex items-center mt-8px w-104px mr-8px">
|
<div class="flex items-center mt-8px w-104px mr-8px">
|
||||||
<div style="background-color: #ffae00; width: 16px; height: 16px; margin-right: 5px; border-radius: 4px"></div>
|
<div style="background-color: #ffae00; width: 16px; height: 16px; margin-right: 5px; border-radius: 4px"></div>
|
||||||
@ -29,10 +13,35 @@
|
|||||||
<div style="background-color: #939499; width: 16px; height: 16px; margin-right: 5px; border-radius: 4px"></div>
|
<div style="background-color: #939499; width: 16px; height: 16px; margin-right: 5px; border-radius: 4px"></div>
|
||||||
<div>已发布</div>
|
<div>已发布</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center mt-8px mb-4px w-104px mr-8px">
|
<div class="flex items-center mt-8px w-104px mr-8px">
|
||||||
<div style="background-color: #f64b31; width: 16px; height: 16px; margin-right: 5px; border-radius: 4px"></div>
|
<div style="background-color: #f64b31; width: 16px; height: 16px; margin-right: 5px; border-radius: 4px"></div>
|
||||||
<div>发布失败</div>
|
<div>发布失败</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</a-trigger>
|
<a-button size="small" class="mr-3 color-scheme-btn">
|
||||||
|
<template #icon>
|
||||||
|
<InfoCircleOutlined class="color-#55585F" />
|
||||||
|
</template>
|
||||||
|
<template #default>颜色示意</template>
|
||||||
|
</a-button>
|
||||||
|
</a-popover>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { InfoCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.color-tip-popover :deep(.ant-popover-inner-content) {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #d9d9d9;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: #00000010 0px 2px 8px;
|
||||||
|
padding: 8px;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-tip-popover :deep(.ant-popover-arrow) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -1,16 +1,10 @@
|
|||||||
<!-- // 新增内容: -->
|
<!-- // 新增内容: -->
|
||||||
<template>
|
<template>
|
||||||
<a-trigger trigger="click" :clickOutsideToClose="true" :clickToClose="false">
|
<a-popover trigger="click" :overlayStyle="{ width: '360px' }" overlayClassName="filter-popup-popover">
|
||||||
<a-button size="small">
|
|
||||||
<template #icon>
|
|
||||||
<icon-filter size="16" class="color-#55585F" />
|
|
||||||
</template>
|
|
||||||
<template #default>筛选</template>
|
|
||||||
</a-button>
|
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="filter-popup-content">
|
<div class="filter-popup-content">
|
||||||
<!-- 运营人员 -->
|
<!-- 运营人员 -->
|
||||||
<div class="flex items-center mb-24px">
|
<div class="flex items-center mb-6">
|
||||||
<div class="w-70px">运营人员</div>
|
<div class="w-70px">运营人员</div>
|
||||||
<a-space class="w-240px">
|
<a-space class="w-240px">
|
||||||
<CommonSelect
|
<CommonSelect
|
||||||
@ -25,7 +19,7 @@
|
|||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
<!-- 发布平台 -->
|
<!-- 发布平台 -->
|
||||||
<div class="flex items-center mb-24px">
|
<div class="flex items-center mb-6">
|
||||||
<div class="w-70px">发布平台</div>
|
<div class="w-70px">发布平台</div>
|
||||||
<a-space class="w-240px">
|
<a-space class="w-240px">
|
||||||
<CommonSelect
|
<CommonSelect
|
||||||
@ -57,11 +51,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</a-trigger>
|
<a-button size="small">
|
||||||
|
<template #icon>
|
||||||
|
<FilterOutlined class="color-#55585F" />
|
||||||
|
</template>
|
||||||
|
<template #default>筛选</template>
|
||||||
|
</a-button>
|
||||||
|
</a-popover>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
|
import { FilterOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
operators: Array,
|
operators: Array,
|
||||||
@ -71,7 +72,7 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
const emit = defineEmits(['update:query']);
|
const emit = defineEmits(['filter-change']);
|
||||||
|
|
||||||
// 初始化本地查询对象,只设置非空值
|
// 初始化本地查询对象,只设置非空值
|
||||||
const localQuery = ref({});
|
const localQuery = ref({});
|
||||||
@ -101,12 +102,13 @@ watch(
|
|||||||
// 处理筛选变化
|
// 处理筛选变化
|
||||||
const handleChange = (field, value) => {
|
const handleChange = (field, value) => {
|
||||||
localQuery.value[field] = value;
|
localQuery.value[field] = value;
|
||||||
emit('update:query', { ...localQuery.value });
|
console.log(localQuery.value);
|
||||||
|
emit('filter-change', { ...localQuery.value });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.filter-popup-content {
|
.filter-popup-popover :deep(.ant-popover-inner-content) {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border: 1px solid #d9d9d9;
|
border: 1px solid #d9d9d9;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@ -114,6 +116,6 @@ const handleChange = (field, value) => {
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
margin-right: 25px;
|
margin-right: 50px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -53,46 +53,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-start">
|
<div class="flex items-start">
|
||||||
<!-- <a-trigger
|
|
||||||
trigger="click"
|
|
||||||
style="
|
|
||||||
background-color: #ffffff;
|
|
||||||
border: 1px solid #d9d9d9;
|
|
||||||
border-radius: 4px;
|
|
||||||
box-shadow: #00000010 0px 2px 8px;
|
|
||||||
width: 120px;
|
|
||||||
height: 64px;
|
|
||||||
padding: 8px;
|
|
||||||
margin-top: 8px;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<a-button size="small" class="mr-12px color-scheme-btn" :bordered="false">
|
|
||||||
<template #icon>
|
|
||||||
<icon-info-circle-fill size="16" class="color-#55585F" />
|
|
||||||
</template>
|
|
||||||
<template #default>颜色示意</template>
|
|
||||||
</a-button>
|
|
||||||
<template #content>
|
|
||||||
<div class="flex items-center mb-8px">
|
|
||||||
<div
|
|
||||||
style="background-color: #6d4cfe; width: 16px; height: 16px; margin-right: 5px; border-radius: 4px"
|
|
||||||
></div>
|
|
||||||
<div>选题</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center">
|
|
||||||
<div
|
|
||||||
style="background-color: #ffae00; width: 16px; height: 16px; margin-right: 5px; border-radius: 4px"
|
|
||||||
></div>
|
|
||||||
<div>内容稿件</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</a-trigger> -->
|
|
||||||
<colorTip />
|
<colorTip />
|
||||||
<FilterPopup
|
<FilterPopup
|
||||||
:operators="operators"
|
:operators="operators"
|
||||||
:platformOptions="platformOptions"
|
:platformOptions="platformOptions"
|
||||||
:accountList="accountList"
|
:accountList="accountList"
|
||||||
:query="query"
|
:query="query"
|
||||||
|
@filter-change="handleFilterChange"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -261,7 +228,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, onMounted, watch, computed, nextTick } from 'vue';
|
import { ref, reactive, onMounted, watch, computed, nextTick } from 'vue';
|
||||||
import type { TableColumnData } from '@arco-design/web-vue';
|
import type { ColumnProps } from 'ant-design-vue/es/table';
|
||||||
import { getTaskSchedules, delTaskSchedules, editTaskSchedules } from '@/api/all/assignment-management';
|
import { getTaskSchedules, delTaskSchedules, editTaskSchedules } from '@/api/all/assignment-management';
|
||||||
import { fetchAccountOperators, getMediaAccountList } from '@/api/all/propertyMarketing';
|
import { fetchAccountOperators, getMediaAccountList } from '@/api/all/propertyMarketing';
|
||||||
import icon1 from '@/assets/img/platform/icon-dy.png';
|
import icon1 from '@/assets/img/platform/icon-dy.png';
|
||||||
@ -351,7 +318,7 @@ const currentDateRange = reactive({
|
|||||||
start: '',
|
start: '',
|
||||||
end: '',
|
end: '',
|
||||||
});
|
});
|
||||||
const columns = ref<TableColumnData[]>([]);
|
const columns = ref<ColumnProps[]>([]);
|
||||||
const data = ref<any[]>([]);
|
const data = ref<any[]>([]);
|
||||||
const operators = ref([]);
|
const operators = ref([]);
|
||||||
const accountList = ref([]);
|
const accountList = ref([]);
|
||||||
@ -744,57 +711,29 @@ const handleToday = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 处理筛选项选择事件
|
// 处理筛选项选择事件
|
||||||
const handleFilterChange = (field: string, value: any, options?: any[]) => {
|
const handleFilterChange = (field: object) => {
|
||||||
console.log(`筛选项 ${field} 发生变化:`, value);
|
console.log(`筛选项发生变化:`, field);
|
||||||
// 根据不同的筛选字段执行不同的操作
|
// // 根据不同的筛选字段执行不同的操作
|
||||||
switch (field) {
|
if (typeof field === 'object' && field !== null) {
|
||||||
case 'operator_id':
|
// 处理传入整个对象的情况
|
||||||
console.log('运营人员选择:', value, typeof value, Array.isArray(value), options);
|
Object.keys(field).forEach((key) => {
|
||||||
// 查找选中的运营人员完整信息
|
const value = field[key];
|
||||||
if (options && value) {
|
switch (key) {
|
||||||
if (Array.isArray(value)) {
|
case 'operator':
|
||||||
// 多选情况
|
query.operator_ids = value;
|
||||||
const selectedOperators = options.filter((op) => value.includes(op.name)).map((op) => op.value);
|
break;
|
||||||
query.operator_ids = selectedOperators;
|
case 'platform':
|
||||||
}
|
query.platforms = value;
|
||||||
} else {
|
break;
|
||||||
query.operator_ids = [];
|
case 'accounts':
|
||||||
|
query.ids = value;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// 其他字段直接赋值
|
||||||
|
query[key] = value;
|
||||||
}
|
}
|
||||||
console.log('选中的运营人员完整信息(多选):', query.operator_ids);
|
});
|
||||||
handleSearch();
|
handleSearch();
|
||||||
break;
|
|
||||||
case 'account_id':
|
|
||||||
// 查找选中的账号完整信息
|
|
||||||
if (options && value !== undefined && value !== '') {
|
|
||||||
if (Array.isArray(value)) {
|
|
||||||
console.log(options, value);
|
|
||||||
// 多选情况
|
|
||||||
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':
|
|
||||||
// 查找选中的平台完整信息
|
|
||||||
if (options && value !== undefined && value !== '') {
|
|
||||||
console.log(options, value);
|
|
||||||
if (Array.isArray(value)) {
|
|
||||||
// 多选情况
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user