|
|
|
@ -43,6 +43,7 @@ |
|
|
|
|
<!-- <component :is="currentSubApp" |
|
|
|
|
@getList="getList"></component> --> |
|
|
|
|
<config v-if="action === 'config'" |
|
|
|
|
:key="configKey" |
|
|
|
|
@getList="getList"></config> |
|
|
|
|
<detail v-if="action === 'detail'"></detail> |
|
|
|
|
<add v-else-if="action === 'add'" |
|
|
|
@ -69,7 +70,7 @@ import { getIds } from '@/utils/common'; |
|
|
|
|
|
|
|
|
|
const router = useRouter(); |
|
|
|
|
const route = useRoute(); |
|
|
|
|
const action = ref<any>(''); |
|
|
|
|
const action = ref<string>(); |
|
|
|
|
|
|
|
|
|
// const modules: any = import.meta.glob('./*.vue'); |
|
|
|
|
// let currentSubApp = defineAsyncComponent(modules[`./${route.params.action}.vue`]); |
|
|
|
@ -78,6 +79,7 @@ const loading = ref<boolean>(false); |
|
|
|
|
const productType = computed(() => route.query.type); // 个人/企业 |
|
|
|
|
const role = computed(() => +route.query.role || 41); |
|
|
|
|
const id = computed(() => +route.query.id); |
|
|
|
|
const configKey = ref<number>(1); |
|
|
|
|
// 列表 |
|
|
|
|
const getList = async (refresh?: number) => { |
|
|
|
|
loading.value = true; |
|
|
|
@ -115,8 +117,12 @@ watch( |
|
|
|
|
// 产品切换 |
|
|
|
|
const switchProduct = (row: any, refresh?: number) => { |
|
|
|
|
// 产品经理配置要素:add;风控经理:config;专家委员会:approve。这3个权限都没有的话,跳详情 |
|
|
|
|
const path = `/product/bank/${refresh ? 'detail' : row.showElementsOrNot ? 'add' : row.showRiskControlOrNot ? 'config' : row.showApprovalOrNot ? 'approve' : 'detail'}`; |
|
|
|
|
router.push(`${path}?type=${route.query.type || ''}&i=${route.query.i}&role=${route.query.role}&id=${row.id}&name=${name}`); |
|
|
|
|
const toAction = refresh ? 'detail' : row.showElementsOrNot ? 'add' : row.showRiskControlOrNot ? 'config' : row.showApprovalOrNot ? 'approve' : 'detail'; |
|
|
|
|
const curAction = action.value; |
|
|
|
|
const path = `/product/bank/${toAction}`; |
|
|
|
|
router.push(`${path}?type=${route.query.type || ''}&i=${route.query.i}&role=${route.query.role}&id=${row.id}&name=${route.query.name ?? ''}`); |
|
|
|
|
console.log('🚀 ~ switchProduct ~ toAction:', toAction, curAction, (toAction === curAction) === 'config'); |
|
|
|
|
if (toAction === 'config' && curAction === 'config') configKey.value += 1; |
|
|
|
|
}; |
|
|
|
|
// 新增 |
|
|
|
|
const toAdd = () => { |
|
|
|
|