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">
|
||||
|
||||
Reference in New Issue
Block a user