feat: 打开渠道与脚本自动化分离

This commit is contained in:
DEV_DSW
2026-03-12 17:05:16 +08:00
parent f084e47c58
commit 236f4c7dc1
12 changed files with 201 additions and 132 deletions

View File

@@ -1,27 +1,25 @@
import { v4 as uuidv4 } from 'uuid'
export interface Item {
id: number
id: string
channelName: string
channelUrl: string
}
export const channel: Item[] = [
export const channels: Item[] = [
{
id: 1,
channelName: 'pms',
id: uuidv4(),
channelName: 'fliggy',
channelUrl: 'https://hotel.fliggy.com/ebooking/hotelBaseInfoUv.htm#/ebk/homeV1',
},
{
id: 2,
channelName: 'xc',
id: uuidv4(),
channelName: 'meituan',
channelUrl: 'https://me.meituan.com/ebooking/merchant/product#/index',
},
{
id: 3,
channelName: 'fz',
},
{
id: 4,
channelName: 'mt',
},
{
id: 5,
channelName: 'dy',
},
id: uuidv4(),
channelName: 'douyin',
channelUrl: 'https://life.douyin.com/p/goods_winetour/physical_room_list?groupid=1816249020842116',
}
]

View File

@@ -5,7 +5,7 @@ export interface taskCenterItem {
desc: string,
id: string,
icon: string,
type: 'sale' | 'close' | 'open'
type: 'sale' | 'close' | 'open' | 'channel'
}
export const taskCenterList: taskCenterItem[] = [
@@ -16,6 +16,13 @@ export const taskCenterList: taskCenterItem[] = [
icon: '销',
type: 'sale'
},
{
title: '一键打开各渠道',
desc: '人工账号登录,为自动化操作做好准备',
id: uuidv4(),
icon: '渠',
type: 'channel'
},
{
title: '关渠道房型',
desc: '关闭销售渠道下的指定房型',

View File

@@ -33,6 +33,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import { taskCenterList, taskCenterItem } from '@constant/taskCenterList'
import { channels } from '@constant/channel'
import emitter from '@utils/emitter'
const taskList = computed(() => taskCenterList)
@@ -43,6 +44,12 @@ const handleTaskItem = (item: taskCenterItem) => {
return
}
// 一键打开各渠道
if (item.type === 'channel') {
window.api.openChannel(channels)
return
}
// 操作房型
emitter.emit('OPERATION_CHANNEL', item)
}