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