|
|
|
@ -58,6 +58,7 @@ import Cookies from 'js-cookie'; |
|
|
|
|
const router = useRouter(); |
|
|
|
|
const route = useRoute(); |
|
|
|
|
const action = ref<any>(''); |
|
|
|
|
const name = route.query.name ?? ''; |
|
|
|
|
const projectId = +Cookies.get('sand-projectId'); |
|
|
|
|
const levelId = +Cookies.get('sand-level'); |
|
|
|
|
|
|
|
|
@ -65,12 +66,12 @@ const list = ref<Array<any>>([]); |
|
|
|
|
const loading = ref<boolean>(false); |
|
|
|
|
const id = computed(() => +route.query.id); |
|
|
|
|
// 列表 |
|
|
|
|
const getList = async (first: any) => { |
|
|
|
|
const getList = async (refresh?: number) => { |
|
|
|
|
loading.value = true; |
|
|
|
|
try { |
|
|
|
|
const { data } = await fundProductList({ pageNum: 1, pageSize: 1000, checkPointId: levelId, projectId }); |
|
|
|
|
const { data } = await fundProductList({ pageNum: 1, pageSize: 1000, checkPointId: levelId, projectId, fundName: name }); |
|
|
|
|
list.value = data.data.records; |
|
|
|
|
first && list.value.length && switchProduct(list.value[0].id); |
|
|
|
|
refresh && list.value.length && switchProduct(list.value[0].id); |
|
|
|
|
} finally { |
|
|
|
|
loading.value = false; |
|
|
|
|
} |
|
|
|
@ -81,16 +82,16 @@ onMounted(() => { |
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
route, |
|
|
|
|
(route: any) => { |
|
|
|
|
action.value = route.params.action; |
|
|
|
|
(val) => { |
|
|
|
|
action.value = val.params.action; |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
immediate: true, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
// 产品切换 |
|
|
|
|
const switchProduct = (id: number) => { |
|
|
|
|
router.push(`/product/fund/detail?id=` + id); |
|
|
|
|
const switchProduct = (fundId: number) => { |
|
|
|
|
router.push(`/product/fund/detail?id=` + fundId); |
|
|
|
|
}; |
|
|
|
|
// 新增 |
|
|
|
|
const toAdd = () => { |
|
|
|
@ -100,8 +101,8 @@ const toAdd = () => { |
|
|
|
|
const toList = () => { |
|
|
|
|
router.push(`/product/fund`); |
|
|
|
|
}; |
|
|
|
|
const handleDelete = async (id: number) => { |
|
|
|
|
await batchDeletion([id]); |
|
|
|
|
const handleDelete = async (fundId: number) => { |
|
|
|
|
await batchDeletion([fundId]); |
|
|
|
|
getList(1); |
|
|
|
|
ElMessage.success('删除成功!'); |
|
|
|
|
}; |
|
|
|
|