feat: 迁移商务旗下渠道查询和抽屉

This commit is contained in:
Yvan
2026-11-03 19:20:42 +08:00
parent 8048dfb514
commit cd42a1d3f0
29 changed files with 409 additions and 20 deletions
@@ -15,7 +15,7 @@
<el-table-column v-if="userId" prop="platformBusierId" label="ID" min-width="90" />
<el-table-column prop="platformBusierAccount" label="游戏商务账号" min-width="140" />
<el-table-column v-if="!userId" prop="bindUserName" label="绑定商务" min-width="140" />
<el-table-column v-if="!userId" label="旗下渠道数" min-width="110"><template #default="{ row }"><span :class="{ 'text-gray-400': row.promoteCount === null }">{{ row.promoteCount === null ? '未接入' : row.promoteCount }}</span></template></el-table-column>
<el-table-column v-if="!userId" label="旗下渠道数" min-width="110"><template #default="{ row }"><span v-if="row.promoteCount === null" class="text-gray-400">未接入</span><el-button v-else type="primary" link aria-label="查看旗下渠道" :disabled="row.status !== '0'" @click="showChannels(row)">{{ row.promoteCount }}</el-button></template></el-table-column>
<el-table-column label="审核状态" width="110"><template #default="{ row }"><el-tag :type="row.status === '0' ? 'success' : row.status === '2' ? 'danger' : 'warning'">{{ statuses[row.status] || row.status }}</el-tag></template></el-table-column>
<el-table-column prop="createTime" label="绑定时间" min-width="130"><template #default="{ row }">{{ row.createTime?.slice(0, 10) }}</template></el-table-column>
<el-table-column v-if="!userId" label="操作" width="110" fixed="right">
@@ -28,6 +28,7 @@
</el-table>
<div v-if="!userId" class="kra-pagination"><el-pagination v-model:current-page="query.pageNum" v-model:page-size="query.pageSize" :total="total" :page-sizes="[10, 20, 50, 100]" layout="total, sizes, prev, pager, next, jumper" @size-change="search" @current-change="load" /></div>
</div>
<el-drawer append-to-body v-model="channelsDrawer" title="旗下渠道" size="520px" destroy-on-close><business-channels v-if="selectedChannel" :user-id="selectedChannel.userId" :source-db="selectedChannel.sourceDb" :platform-busier-id="selectedChannel.platformBusierId" /></el-drawer>
<el-drawer append-to-body v-model="dialog" title="绑定游戏商务" size="460px" destroy-on-close>
<el-alert title="验证成功后提交 OA 审核,审核通过后可查看对应渠道数据。" type="info" :closable="false" class="mb-4" />
<el-form ref="formRef" :model="form" :rules="rules" label-position="top">
@@ -64,6 +65,7 @@ import { ElMessage } from 'element-plus'
import { useUserStore } from '@/pinia/modules/user'
import { useBtnAuth } from '@/utils/btnAuth'
import { listBusinessBindings, listUserBindings, bindPlatform, unbindPlatform } from '@/api/business'
import BusinessChannels from './BusinessChannels.vue'
defineOptions({ name: 'SwBusinessBindings' })
const props = defineProps({ userId: { type: Number, default: 0 } })
@@ -81,6 +83,9 @@ const dialog = ref(false)
const rejectDrawer = ref(false)
const unbindDrawer = ref(false)
const selectedRow = ref(null)
const channelsDrawer = ref(false)
const selectedChannel = ref(null)
const showChannels = (row) => { selectedChannel.value = row; channelsDrawer.value = true }
const showReject = (row) => { selectedRow.value = row; rejectDrawer.value = true }
const saving = ref(false)
const formRef = ref()