fetch(modify):修复BUG
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m27s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m27s
This commit is contained in:
@@ -66,10 +66,22 @@
|
||||
</div>
|
||||
|
||||
<ElFormItem label="运营商" required style="margin-bottom: 20px">
|
||||
<ElSelect v-model="selectedCarrierId" placeholder="请选择运营商" style="width: 100%">
|
||||
<ElOption label="中国移动" :value="1" />
|
||||
<ElOption label="中国联通" :value="2" />
|
||||
<ElOption label="中国电信" :value="3" />
|
||||
<ElSelect
|
||||
v-model="selectedCarrierId"
|
||||
placeholder="请输入运营商名称搜索"
|
||||
style="width: 100%"
|
||||
filterable
|
||||
remote
|
||||
:remote-method="handleCarrierSearch"
|
||||
:loading="carrierLoading"
|
||||
clearable
|
||||
>
|
||||
<ElOption
|
||||
v-for="carrier in carrierList"
|
||||
:key="carrier.id"
|
||||
:label="carrier.carrier_name"
|
||||
:value="carrier.id"
|
||||
/>
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
|
||||
@@ -194,7 +206,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { h } from 'vue'
|
||||
import { CardService } from '@/api/modules'
|
||||
import { CardService, CarrierService } from '@/api/modules'
|
||||
import { ElMessage, ElTag, ElFormItem, ElSelect, ElOption } from 'element-plus'
|
||||
import { Download, UploadFilled, Upload } from '@element-plus/icons-vue'
|
||||
import type { UploadInstance } from 'element-plus'
|
||||
@@ -204,6 +216,7 @@
|
||||
import ArtButtonTable from '@/components/core/forms/ArtButtonTable.vue'
|
||||
import { StorageService } from '@/api/modules/storage'
|
||||
import type { IotCardImportTask, IotCardImportTaskStatus } from '@/types/api/card'
|
||||
import type { Carrier } from '@/types/api'
|
||||
|
||||
defineOptions({ name: 'IotCardTask' })
|
||||
|
||||
@@ -215,6 +228,8 @@
|
||||
const importDialogVisible = ref(false)
|
||||
const detailDialogVisible = ref(false)
|
||||
const selectedCarrierId = ref<number>()
|
||||
const carrierList = ref<Carrier[]>([])
|
||||
const carrierLoading = ref(false)
|
||||
|
||||
// 搜索表单初始值
|
||||
const initialSearchState = {
|
||||
@@ -235,7 +250,7 @@
|
||||
})
|
||||
|
||||
// 搜索表单配置
|
||||
const searchFormItems: SearchFormItem[] = [
|
||||
const searchFormItems = computed<SearchFormItem[]>(() => [
|
||||
{
|
||||
label: '任务状态',
|
||||
prop: 'status',
|
||||
@@ -255,15 +270,17 @@
|
||||
label: '运营商',
|
||||
prop: 'carrier_id',
|
||||
type: 'select',
|
||||
options: carrierList.value.map((carrier) => ({
|
||||
label: carrier.carrier_name,
|
||||
value: carrier.id
|
||||
})),
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: '全部'
|
||||
},
|
||||
options: () => [
|
||||
{ label: '中国移动', value: 1 },
|
||||
{ label: '中国联通', value: 2 },
|
||||
{ label: '中国电信', value: 3 }
|
||||
]
|
||||
filterable: true,
|
||||
remote: true,
|
||||
remoteMethod: handleCarrierSearch,
|
||||
placeholder: '请输入运营商名称搜索'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '批次号',
|
||||
@@ -285,7 +302,7 @@
|
||||
valueFormat: 'YYYY-MM-DDTHH:mm:ssZ'
|
||||
}
|
||||
}
|
||||
]
|
||||
])
|
||||
|
||||
// 列配置
|
||||
const columnOptions = [
|
||||
@@ -456,6 +473,7 @@
|
||||
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
loadCarrierList()
|
||||
})
|
||||
|
||||
// 获取IoT卡任务列表
|
||||
@@ -717,6 +735,31 @@
|
||||
importDialogVisible.value = false
|
||||
}
|
||||
|
||||
// 加载运营商列表
|
||||
const loadCarrierList = async (carrierName?: string) => {
|
||||
carrierLoading.value = true
|
||||
try {
|
||||
const res = await CarrierService.getCarriers({
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
carrier_name: carrierName || undefined,
|
||||
status: 1 // 只加载启用的运营商
|
||||
})
|
||||
if (res.code === 0) {
|
||||
carrierList.value = res.data.items || []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取运营商列表失败:', error)
|
||||
} finally {
|
||||
carrierLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 运营商搜索处理
|
||||
const handleCarrierSearch = (query: string) => {
|
||||
loadCarrierList(query)
|
||||
}
|
||||
|
||||
// 提交上传
|
||||
const submitUpload = async () => {
|
||||
if (!selectedCarrierId.value) {
|
||||
|
||||
Reference in New Issue
Block a user