fix(operator): fix operator edit issue
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m51s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m51s
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { ElCard, ElInput, ElButton } from 'element-plus'
|
||||
import { Search, Refresh } from '@element-plus/icons-vue'
|
||||
import { useAssetFormatters } from '../composables/useAssetFormatters'
|
||||
@@ -47,6 +48,8 @@
|
||||
// Use formatters
|
||||
const { formatIccidWithDashes } = useAssetFormatters()
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
// Props
|
||||
interface Props {
|
||||
hasCardInfo?: boolean
|
||||
@@ -66,6 +69,26 @@
|
||||
const searchIccid = ref('')
|
||||
const iccidInputFocused = ref(false)
|
||||
|
||||
// 从URL参数中获取初始值
|
||||
const initializeFromQuery = () => {
|
||||
const iccid = route.query.iccid as string
|
||||
const virtualNo = route.query.virtual_no as string
|
||||
const deviceNo = route.query.device_no as string
|
||||
|
||||
const identifier = iccid || virtualNo || deviceNo
|
||||
if (identifier) {
|
||||
searchIccid.value = identifier
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化时从URL参数加载
|
||||
initializeFromQuery()
|
||||
|
||||
// 暴露方法供父组件调用,用于更新搜索框值
|
||||
const updateSearchValue = (value: string) => {
|
||||
searchIccid.value = value
|
||||
}
|
||||
|
||||
// Methods
|
||||
const handleSearch = () => {
|
||||
if (!searchIccid.value.trim()) {
|
||||
@@ -77,6 +100,11 @@
|
||||
const handleRefresh = () => {
|
||||
emit('refresh')
|
||||
}
|
||||
|
||||
// 暴露给父组件
|
||||
defineExpose({
|
||||
updateSearchValue
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -477,9 +477,10 @@
|
||||
(e: 'resetDevice'): void
|
||||
(e: 'showSpeedLimit'): void
|
||||
(e: 'showSwitchCard'): void
|
||||
(e: 'showSetWiFi'): void
|
||||
(e: 'show-set-wifi'): void
|
||||
(e: 'enableBindingCard', payload: { card: BindingCard }): void
|
||||
(e: 'disableBindingCard', payload: { card: BindingCard }): void
|
||||
(e: 'navigateToCard', iccid: string): void
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
@@ -528,8 +529,8 @@
|
||||
|
||||
// 跳转到卡片信息
|
||||
const handleNavigateToCardInfo = (iccid: string) => {
|
||||
// 可以通过路由跳转或触发搜索
|
||||
console.log('Navigate to card:', iccid)
|
||||
// 触发搜索事件,让父组件处理
|
||||
emit('navigateToCard', iccid)
|
||||
}
|
||||
|
||||
// 卡操作
|
||||
@@ -559,7 +560,7 @@
|
||||
}
|
||||
|
||||
const handleShowSetWiFi = () => {
|
||||
emit('showSetWiFi')
|
||||
emit('show-set-wifi')
|
||||
}
|
||||
|
||||
// 绑定卡操作
|
||||
|
||||
@@ -69,27 +69,27 @@
|
||||
.wallet-balance-cards {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
gap: 12px;
|
||||
|
||||
.balance-card {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
gap: 14px;
|
||||
align-items: center;
|
||||
padding: 10px 14px;
|
||||
padding: 16px 18px;
|
||||
background: var(--el-fill-color-light);
|
||||
border: 1px solid var(--el-border-color-lighter);
|
||||
border-radius: 4px;
|
||||
border-radius: 6px;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--el-color-primary);
|
||||
box-shadow: 0 2px 6px rgb(0 0 0 / 6%);
|
||||
box-shadow: 0 2px 8px rgb(0 0 0 / 8%);
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
.balance-icon {
|
||||
flex-shrink: 0;
|
||||
font-size: 20px;
|
||||
font-size: 26px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@@ -97,16 +97,18 @@
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
gap: 4px;
|
||||
|
||||
.balance-label {
|
||||
font-size: 12px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.balance-value {
|
||||
font-size: 18px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,9 @@
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
style="width: 360px"
|
||||
@change="handleDateChange"
|
||||
/>
|
||||
<ElButton type="primary" @click="handleFilterChange">查询</ElButton>
|
||||
<ElButton @click="handleResetFilter">重置</ElButton>
|
||||
<ElButton type="primary" @click="handleQuery">查询</ElButton>
|
||||
<ElButton @click="handleReset">重置</ElButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -194,28 +193,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 处理日期范围变化
|
||||
const handleDateChange = (value: [Date, Date] | null) => {
|
||||
if (value && value.length === 2) {
|
||||
// 转换为 RFC3339 格式
|
||||
queryParams.value.start_time = value[0].toISOString()
|
||||
queryParams.value.end_time = value[1].toISOString()
|
||||
// 处理查询按钮点击
|
||||
const handleQuery = () => {
|
||||
queryParams.value.page = 1
|
||||
pagination.value.page = 1
|
||||
queryParams.value.transaction_type = filterForm.value.transaction_type
|
||||
|
||||
// 处理日期范围
|
||||
if (filterForm.value.date_range && filterForm.value.date_range.length === 2) {
|
||||
queryParams.value.start_time = filterForm.value.date_range[0].toISOString()
|
||||
queryParams.value.end_time = filterForm.value.date_range[1].toISOString()
|
||||
} else {
|
||||
queryParams.value.start_time = null
|
||||
queryParams.value.end_time = null
|
||||
}
|
||||
}
|
||||
|
||||
// 处理筛选条件变化
|
||||
const handleFilterChange = () => {
|
||||
queryParams.value.page = 1
|
||||
pagination.value.page = 1
|
||||
queryParams.value.transaction_type = filterForm.value.transaction_type
|
||||
loadTransactions()
|
||||
}
|
||||
|
||||
// 重置筛选条件
|
||||
const handleResetFilter = () => {
|
||||
// 处理重置按钮点击
|
||||
const handleReset = () => {
|
||||
filterForm.value = {
|
||||
transaction_type: null,
|
||||
date_range: null
|
||||
@@ -254,7 +251,7 @@
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
// 重置状态
|
||||
handleResetFilter()
|
||||
handleReset()
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载流量详单失败:', error)
|
||||
ElMessage.error('加载流量详单失败')
|
||||
console.log('加载流量详单失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('加载往期订单失败:', error)
|
||||
ElMessage.error(error?.message || '加载往期订单失败')
|
||||
console.log(error?.message || '加载往期订单失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('加载套餐列表失败:', error)
|
||||
ElMessage.error(error?.message || '加载套餐列表失败')
|
||||
console.log(error?.message || '加载套餐列表失败')
|
||||
} finally {
|
||||
packageSearchLoading.value = false
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载设备绑定卡列表失败:', error)
|
||||
ElMessage.error('加载卡列表失败')
|
||||
console.log('加载卡列表失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<ElDialog v-model="visible" title="设置WiFi" width="500px">
|
||||
<ElDialog v-model="visible" title="设置WiFi" width="500px" :append-to-body="true">
|
||||
<ElForm ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<ElFormItem label="WiFi状态" prop="enabled">
|
||||
<ElRadioGroup v-model="form.enabled">
|
||||
|
||||
Reference in New Issue
Block a user