|
@@ -58,10 +58,13 @@
|
|
|
</a-tag>
|
|
</a-tag>
|
|
|
</template>
|
|
</template>
|
|
|
<template #platform="{ record }">
|
|
<template #platform="{ record }">
|
|
|
- {{ getTypeName(record.platform) }}
|
|
|
|
|
|
|
+ {{ getPlatformNameById(Number(record.platform)) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #typename="{ record }">
|
|
|
|
|
+ {{ record.typename || '-' }}
|
|
|
</template>
|
|
</template>
|
|
|
<template #scene="{ record }">
|
|
<template #scene="{ record }">
|
|
|
- {{ getSubTypeName(record.scene) }}
|
|
|
|
|
|
|
+ {{ record.scene || '-' }}
|
|
|
</template>
|
|
</template>
|
|
|
<template #path="{ record }">
|
|
<template #path="{ record }">
|
|
|
<a-typography-paragraph copyable :ellipsis="{ rows: 1 }" style="margin-bottom: 0;">
|
|
<a-typography-paragraph copyable :ellipsis="{ rows: 1 }" style="margin-bottom: 0;">
|
|
@@ -96,25 +99,21 @@
|
|
|
<a-option value="click">点击 (click)</a-option>
|
|
<a-option value="click">点击 (click)</a-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
- <a-form-item label="平台 (platform)" required>
|
|
|
|
|
- <a-select v-model="addForm.platform" placeholder="请选择或搜索平台" allow-search allow-clear
|
|
|
|
|
- :filter-option="filterOption">
|
|
|
|
|
- <a-option v-for="item in platformOptions" :key="item.value" :value="item.value">
|
|
|
|
|
- {{ item.label }}
|
|
|
|
|
- </a-option>
|
|
|
|
|
- </a-select>
|
|
|
|
|
|
|
+ <a-form-item label="平台 (platform)">
|
|
|
|
|
+ <a-input v-model="addForm.platform" placeholder="可选,输入平台ID,如:1(淘宝)、2(抖音)、13(京东)" allow-clear />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
- <a-form-item label="场景 (scene)" required>
|
|
|
|
|
- <a-select v-model="addForm.scene" placeholder="请选择或搜索场景" allow-search allow-clear
|
|
|
|
|
- :filter-option="filterOption">
|
|
|
|
|
- <a-option v-for="item in sceneOptions" :key="item.value" :value="item.value">
|
|
|
|
|
- {{ item.label }}
|
|
|
|
|
- </a-option>
|
|
|
|
|
- </a-select>
|
|
|
|
|
|
|
+ <a-form-item label="类型 (typename)">
|
|
|
|
|
+ <a-input v-model="addForm.typename" placeholder="可选,输入类型,如:口令、SDK优惠券" allow-clear />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="场景 (scene)">
|
|
|
|
|
+ <a-input v-model="addForm.scene" placeholder="可选,输入场景,如:100000、应用建议卡" allow-clear />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<a-form-item label="唯一标识 (unique_id)">
|
|
<a-form-item label="唯一标识 (unique_id)">
|
|
|
<a-input v-model="addForm.unique_id" placeholder="可选,用于区分同一场景下的不同链接" allow-clear />
|
|
<a-input v-model="addForm.unique_id" placeholder="可选,用于区分同一场景下的不同链接" allow-clear />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
|
+ <a-form-item label="描述 (description)">
|
|
|
|
|
+ <a-input v-model="addForm.description" placeholder="可选,链接描述" allow-clear />
|
|
|
|
|
+ </a-form-item>
|
|
|
</a-form>
|
|
</a-form>
|
|
|
</a-modal>
|
|
</a-modal>
|
|
|
|
|
|
|
@@ -144,6 +143,12 @@
|
|
|
{{ record.event_type === 'expose' ? '曝光' : '点击' }}
|
|
{{ record.event_type === 'expose' ? '曝光' : '点击' }}
|
|
|
</a-tag>
|
|
</a-tag>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template #report_platform="{ record }">
|
|
|
|
|
+ {{ getPlatformNameById(Number(record.platform)) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #report_scene="{ record }">
|
|
|
|
|
+ {{ record.scene || '-' }}
|
|
|
|
|
+ </template>
|
|
|
<template #event_count="{ record }">
|
|
<template #event_count="{ record }">
|
|
|
<a-tag color="arcoblue">{{ record.event_count }}</a-tag>
|
|
<a-tag color="arcoblue">{{ record.event_count }}</a-tag>
|
|
|
</template>
|
|
</template>
|
|
@@ -164,6 +169,7 @@ import {
|
|
|
TrackLinkRecord, TrackReportRecord, TrackListParams, TrackReportParams,
|
|
TrackLinkRecord, TrackReportRecord, TrackListParams, TrackReportParams,
|
|
|
queryTrackList, createTrack, deleteTrack, queryTrackReport
|
|
queryTrackList, createTrack, deleteTrack, queryTrackReport
|
|
|
} from '@/api/tracks';
|
|
} from '@/api/tracks';
|
|
|
|
|
+import { getPlatformNameById } from '@/constants/pushPlatform';
|
|
|
|
|
|
|
|
const { loading, setLoading } = useLoading(false);
|
|
const { loading, setLoading } = useLoading(false);
|
|
|
const renderData = ref<TrackLinkRecord[]>([]);
|
|
const renderData = ref<TrackLinkRecord[]>([]);
|
|
@@ -180,58 +186,15 @@ const pagination = reactive({
|
|
|
...basePagination,
|
|
...basePagination,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-// 平台选项 - 来自 getTypeName
|
|
|
|
|
-const platformOptions = [
|
|
|
|
|
- { label: '口令', value: 'kouling' },
|
|
|
|
|
- { label: 'SDK优惠券', value: 'sdk_coupon' },
|
|
|
|
|
- { label: '应用建议卡', value: 'app_suggest' },
|
|
|
|
|
- { label: '购物助手', value: 'shopping_helper' },
|
|
|
|
|
- { label: '侧边栏', value: 'sidebar' },
|
|
|
|
|
- { label: '搜同款', value: 'search_similar' },
|
|
|
|
|
-];
|
|
|
|
|
-
|
|
|
|
|
-// 场景选项 - 来自 getSubTypeName
|
|
|
|
|
-const sceneOptions = [
|
|
|
|
|
- { label: '口令', value: 'kouling' },
|
|
|
|
|
- { label: '应用内优惠券', value: 'app_coupon' },
|
|
|
|
|
- { label: '应用建议卡', value: 'app_suggest_card' },
|
|
|
|
|
- { label: '浏览器DP', value: 'browser_dp' },
|
|
|
|
|
- { label: '全搜', value: 'full_search' },
|
|
|
|
|
- { label: '分页符', value: 'page_break' },
|
|
|
|
|
- { label: '侧边栏', value: 'sidebar' },
|
|
|
|
|
- { label: '搜同款拍一拍', value: 'search_similar_tap' },
|
|
|
|
|
- { label: '搜同款相册', value: 'search_similar_album' },
|
|
|
|
|
- { label: '搜同款助力栏', value: 'search_similar_assist' },
|
|
|
|
|
- { label: '搜同款默认', value: 'search_similar_default' },
|
|
|
|
|
- { label: '搜同款识屏', value: 'search_similar_screen' },
|
|
|
|
|
- { label: '搜同款小布CUI拍一拍', value: 'search_similar_cui_tap' },
|
|
|
|
|
- { label: '搜同款小布CUI客户端', value: 'search_similar_cui_client' },
|
|
|
|
|
-];
|
|
|
|
|
-
|
|
|
|
|
-// 获取平台名称
|
|
|
|
|
-const getTypeName = (platform: string) => {
|
|
|
|
|
- const item = platformOptions.find(p => p.value === platform);
|
|
|
|
|
- return item ? item.label : platform;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-// 获取场景名称
|
|
|
|
|
-const getSubTypeName = (scene: string) => {
|
|
|
|
|
- const item = sceneOptions.find(s => s.value === scene);
|
|
|
|
|
- return item ? item.label : scene;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const filterOption = (inputValue: string, option: any) => {
|
|
|
|
|
- return option.label.toLowerCase().includes(inputValue.toLowerCase()) ||
|
|
|
|
|
- option.value.toLowerCase().includes(inputValue.toLowerCase());
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
const columns = computed<TableColumnData[]>(() => [
|
|
const columns = computed<TableColumnData[]>(() => [
|
|
|
{ title: '#', slotName: 'index', width: 60 },
|
|
{ title: '#', slotName: 'index', width: 60 },
|
|
|
{ title: '事件类型', slotName: 'event_type', width: 100 },
|
|
{ title: '事件类型', slotName: 'event_type', width: 100 },
|
|
|
- { title: '平台', slotName: 'platform', width: 120 },
|
|
|
|
|
|
|
+ { title: '平台', slotName: 'platform', width: 100 },
|
|
|
|
|
+ { title: '类型', slotName: 'typename', width: 120 },
|
|
|
{ title: '场景', slotName: 'scene', width: 150 },
|
|
{ title: '场景', slotName: 'scene', width: 150 },
|
|
|
- { title: 'UniqueId', dataIndex: 'unique_id', width: 120, ellipsis: true },
|
|
|
|
|
- { title: '路径', slotName: 'path', width: 300 },
|
|
|
|
|
|
|
+ { title: 'UniqueId', dataIndex: 'unique_id', width: 100, ellipsis: true },
|
|
|
|
|
+ { title: '描述', dataIndex: 'description', width: 150, ellipsis: true },
|
|
|
|
|
+ { title: '路径', slotName: 'path', width: 250 },
|
|
|
{ title: '时间', slotName: 'time', width: 160 },
|
|
{ title: '时间', slotName: 'time', width: 160 },
|
|
|
{ title: '操作', slotName: 'operations', width: 160, fixed: 'right' },
|
|
{ title: '操作', slotName: 'operations', width: 160, fixed: 'right' },
|
|
|
]);
|
|
]);
|
|
@@ -239,11 +202,12 @@ const columns = computed<TableColumnData[]>(() => [
|
|
|
const fetchData = async (params: TrackListParams) => {
|
|
const fetchData = async (params: TrackListParams) => {
|
|
|
setLoading(true);
|
|
setLoading(true);
|
|
|
try {
|
|
try {
|
|
|
- const { data } = await queryTrackList(params);
|
|
|
|
|
- if (!data) return;
|
|
|
|
|
- renderData.value = data.list || [];
|
|
|
|
|
- pagination.current = data.page;
|
|
|
|
|
- pagination.total = data.count;
|
|
|
|
|
|
|
+ const res: any = await queryTrackList(params);
|
|
|
|
|
+ if (res && res.data) {
|
|
|
|
|
+ renderData.value = res.data.list || [];
|
|
|
|
|
+ pagination.current = res.data.page || 1;
|
|
|
|
|
+ pagination.total = res.data.count || 0;
|
|
|
|
|
+ }
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
console.error(err);
|
|
console.error(err);
|
|
|
} finally {
|
|
} finally {
|
|
@@ -270,26 +234,37 @@ const onPageChange = (current: number) => {
|
|
|
|
|
|
|
|
// 新增链接
|
|
// 新增链接
|
|
|
const addModalVisible = ref(false);
|
|
const addModalVisible = ref(false);
|
|
|
-const addForm = ref({
|
|
|
|
|
|
|
+const addForm = ref<{
|
|
|
|
|
+ event_type: string;
|
|
|
|
|
+ platform: string;
|
|
|
|
|
+ typename: string;
|
|
|
|
|
+ scene: string;
|
|
|
|
|
+ unique_id: string;
|
|
|
|
|
+ description: string;
|
|
|
|
|
+}>({
|
|
|
event_type: 'expose',
|
|
event_type: 'expose',
|
|
|
platform: '',
|
|
platform: '',
|
|
|
|
|
+ typename: '',
|
|
|
scene: '',
|
|
scene: '',
|
|
|
unique_id: '',
|
|
unique_id: '',
|
|
|
|
|
+ description: '',
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const onAdd = () => {
|
|
const onAdd = () => {
|
|
|
addForm.value = {
|
|
addForm.value = {
|
|
|
event_type: 'expose',
|
|
event_type: 'expose',
|
|
|
platform: '',
|
|
platform: '',
|
|
|
|
|
+ typename: '',
|
|
|
scene: '',
|
|
scene: '',
|
|
|
unique_id: '',
|
|
unique_id: '',
|
|
|
|
|
+ description: '',
|
|
|
};
|
|
};
|
|
|
addModalVisible.value = true;
|
|
addModalVisible.value = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleAddSubmit = async () => {
|
|
const handleAddSubmit = async () => {
|
|
|
- if (!addForm.value.platform || !addForm.value.scene) {
|
|
|
|
|
- Message.warning('请填写平台和场景');
|
|
|
|
|
|
|
+ if (!addForm.value.event_type) {
|
|
|
|
|
+ Message.warning('请选择事件类型');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
@@ -321,11 +296,11 @@ const onDelete = (record: TrackLinkRecord) => {
|
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
|
try {
|
|
try {
|
|
|
const res: any = await deleteTrack(record.id);
|
|
const res: any = await deleteTrack(record.id);
|
|
|
- if (res.success) {
|
|
|
|
|
- Message.success(res.msg || '删除成功');
|
|
|
|
|
|
|
+ if (res.success || res.data?.success) {
|
|
|
|
|
+ Message.success(res.msg || res.data?.msg || '删除成功');
|
|
|
search();
|
|
search();
|
|
|
} else {
|
|
} else {
|
|
|
- Message.error(res.msg || '删除失败');
|
|
|
|
|
|
|
+ Message.error(res.msg || res.data?.msg || '删除失败');
|
|
|
}
|
|
}
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
Message.error('删除请求失败');
|
|
Message.error('删除请求失败');
|
|
@@ -409,8 +384,8 @@ const reportPagination = reactive({
|
|
|
const reportColumns = computed<TableColumnData[]>(() => [
|
|
const reportColumns = computed<TableColumnData[]>(() => [
|
|
|
{ title: '日期', slotName: 'report_date', width: 120 },
|
|
{ title: '日期', slotName: 'report_date', width: 120 },
|
|
|
{ title: '事件类型', slotName: 'event_type', width: 100 },
|
|
{ title: '事件类型', slotName: 'event_type', width: 100 },
|
|
|
- { title: '平台', dataIndex: 'platform', width: 100 },
|
|
|
|
|
- { title: '场景', dataIndex: 'scene', width: 120 },
|
|
|
|
|
|
|
+ { title: '平台', slotName: 'report_platform', width: 100 },
|
|
|
|
|
+ { title: '场景', slotName: 'report_scene', width: 120 },
|
|
|
{ title: 'UniqueId', dataIndex: 'unique_id', width: 120 },
|
|
{ title: 'UniqueId', dataIndex: 'unique_id', width: 120 },
|
|
|
{ title: '事件数', slotName: 'event_count', width: 100 },
|
|
{ title: '事件数', slotName: 'event_count', width: 100 },
|
|
|
]);
|
|
]);
|
|
@@ -419,9 +394,11 @@ const currentTrackInfo = computed(() => {
|
|
|
if (!currentTrack.value) return [];
|
|
if (!currentTrack.value) return [];
|
|
|
return [
|
|
return [
|
|
|
{ label: '事件类型', value: currentTrack.value.event_type === 'expose' ? '曝光' : '点击' },
|
|
{ label: '事件类型', value: currentTrack.value.event_type === 'expose' ? '曝光' : '点击' },
|
|
|
- { label: '平台', value: getTypeName(currentTrack.value.platform) },
|
|
|
|
|
- { label: '场景', value: getSubTypeName(currentTrack.value.scene) },
|
|
|
|
|
|
|
+ { label: '平台', value: getPlatformNameById(Number(currentTrack.value.platform)) },
|
|
|
|
|
+ { label: '类型', value: currentTrack.value.typename || '-' },
|
|
|
|
|
+ { label: '场景', value: currentTrack.value.scene || '-' },
|
|
|
{ label: 'UniqueId', value: currentTrack.value.unique_id || '-' },
|
|
{ label: 'UniqueId', value: currentTrack.value.unique_id || '-' },
|
|
|
|
|
+ { label: '描述', value: currentTrack.value.description || '-' },
|
|
|
];
|
|
];
|
|
|
});
|
|
});
|
|
|
|
|
|