|
@@ -1,21 +1,50 @@
|
|
|
<script setup lang="tsx">
|
|
<script setup lang="tsx">
|
|
|
-import { ElButton, ElInput, ElMessage } from 'element-plus'
|
|
|
|
|
|
|
+import {ElButton, ElInput, ElMessage, ElOption, ElSelect} from 'element-plus'
|
|
|
import { ContentWrap } from '@/components/ContentWrap'
|
|
import { ContentWrap } from '@/components/ContentWrap'
|
|
|
-import { reactive } from 'vue'
|
|
|
|
|
-import { test1VersionApi, test2VersionApi } from '@/api/version'
|
|
|
|
|
|
|
+import {reactive, ref, watch} from 'vue'
|
|
|
|
|
+import {test1VersionApi, test2VersionApi} from '@/api/version'
|
|
|
|
|
+import type {ChannelData} from "@/api/channel/types";
|
|
|
|
|
+import {getChannelListApi} from "@/api/channel";
|
|
|
|
|
+
|
|
|
|
|
+const channelOptions = ref<ChannelData[]>([])
|
|
|
|
|
+const selectedChannel = ref<string>('')
|
|
|
|
|
+
|
|
|
|
|
+const getChannelList = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await getChannelListApi({ pageIndex: 1, pageSize: 100 })
|
|
|
|
|
+ const list = res?.data?.list ?? (Array.isArray(res?.data) ? res.data : [])
|
|
|
|
|
+ channelOptions.value = list.filter((c) => c && c.status !== false)
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.warn('[渠道列表] 请求失败:', e)
|
|
|
|
|
+ channelOptions.value = []
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+getChannelList()
|
|
|
|
|
|
|
|
const form = reactive({
|
|
const form = reactive({
|
|
|
|
|
+ channel: '',
|
|
|
version: '',
|
|
version: '',
|
|
|
testarea: ''
|
|
testarea: ''
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+watch(selectedChannel, (val) => {
|
|
|
|
|
+ form.channel = val
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const testApi1 = async () => {
|
|
const testApi1 = async () => {
|
|
|
if (!form.version.trim()) {
|
|
if (!form.version.trim()) {
|
|
|
ElMessage.error('版本号不能为空')
|
|
ElMessage.error('版本号不能为空')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const res = await test1VersionApi({ version: form.version })
|
|
|
|
|
|
|
+ console.log(selectedChannel.value)
|
|
|
|
|
+ if (!form.channel.trim()) {
|
|
|
|
|
+ ElMessage.error('渠道不能为空')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const res = await test1VersionApi({ version: form.version, channel: form.channel })
|
|
|
.catch(() => {})
|
|
.catch(() => {})
|
|
|
.finally(() => {})
|
|
.finally(() => {})
|
|
|
console.log(res)
|
|
console.log(res)
|
|
@@ -24,7 +53,7 @@ const testApi1 = async () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const testApi2 = async () => {
|
|
const testApi2 = async () => {
|
|
|
- const res = await test2VersionApi()
|
|
|
|
|
|
|
+ const res = await test2VersionApi({ channel: form.channel })
|
|
|
.catch(() => {})
|
|
.catch(() => {})
|
|
|
.finally(() => {})
|
|
.finally(() => {})
|
|
|
form.testarea = ''
|
|
form.testarea = ''
|
|
@@ -34,6 +63,16 @@ const testApi2 = async () => {
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<ContentWrap>
|
|
<ContentWrap>
|
|
|
|
|
+ <span style="font-size: 14px; color: var(--el-text-color-regular)">
|
|
|
|
|
+ {{ '渠道' }}:
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <ElSelect
|
|
|
|
|
+ v-model="selectedChannel"
|
|
|
|
|
+ placeholder="选择渠道"
|
|
|
|
|
+ style="width: 180px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <ElOption v-for="c in channelOptions" :key="c.code" :label="c.name" :value="c.code" />
|
|
|
|
|
+ </ElSelect>
|
|
|
<ElInput
|
|
<ElInput
|
|
|
id="version"
|
|
id="version"
|
|
|
v-model="form.version"
|
|
v-model="form.version"
|