This commit is contained in:
2024-09-14 10:38:43 +08:00
parent b870839d39
commit 794646c001
4 changed files with 58 additions and 14 deletions

View File

@@ -41,7 +41,7 @@
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import { ref, onMounted, provide, nextTick, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
@@ -52,7 +52,7 @@ import { useDictData } from '@/stores/dictData'
import { useRouter } from 'vue-router'
import { downloadSensitiveReportTemplate } from '@/api/supervision-boot/userReport/form'
import DetailInfo from '../../interfere/components/undocumented/detail.vue'
import { cancelFormData } from '@/api/supervision-boot/interfere/index'
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
const addForms = ref()
const dictData = useDictData()
@@ -357,4 +357,22 @@ const exportExcelTemplate = () => {
const importUserData = () => {
sensitiveUserPopup.value.open('导入干扰源用户')
}
const props = defineProps({id: {type: String, default: 'null'}})
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, {immediate: true})
</script>