准入策略联调完成

master
yujialong 7 months ago
parent 4d2374a38d
commit 39534bf322
  1. 41
      src/api/model.ts
  2. 24
      src/views/product/bank/Config.vue
  3. 6
      src/views/product/strategy/150/Detail.vue
  4. 6
      src/views/product/strategy/151/Detail.vue
  5. 6
      src/views/product/strategy/152/Detail.vue
  6. 278
      src/views/product/strategy/153.vue
  7. 83
      src/views/product/strategy/153/Detail.vue
  8. 18
      src/views/product/strategy/153/Index.vue
  9. 23
      src/views/product/strategy/154/Detail.vue
  10. 2
      src/views/product/strategy/154/Index.vue
  11. 415
      src/views/product/strategy/155/Detail.vue
  12. 166
      src/views/product/strategy/155/Index.vue
  13. 225
      src/views/product/strategy/156.vue
  14. 254
      src/views/product/strategy/156/Detail.vue
  15. 166
      src/views/product/strategy/156/Index.vue
  16. 6
      src/views/product/strategy/CardList.vue

@ -24,15 +24,26 @@ export const accessStrategyEnterpriseBlacklist = async (data: Record<string, any
...data, ...data,
}) })
).data; ).data;
export const accessStrategyEnterpriseBlacklistFind = async (): Promise<any> => (await axios.post(`/product/accessStrategyEnterpriseBlacklist/details`, getIds())).data; export const accessStrategyEnterpriseBlacklistFind = async (params: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyEnterpriseBlacklist/details`, {}, { params })).data;
export const accessStrategyEnterpriseBlacklistSave = async (data: Record<string, any>): Promise<any> => export const accessStrategyEnterpriseBlacklistSave = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyEnterpriseBlacklist/saveOrUpdate`, data)).data; (await axios.post(`/product/accessStrategyEnterpriseBlacklist/saveOrUpdate`, data)).data;
export const accessStrategyEnterpriseBlacklistDel = async (data: Record<string, any>): Promise<any> => export const accessStrategyEnterpriseBlacklistDel = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`${host}/product/accessStrategyEnterpriseBlacklist/delete`, data)).data; (await axios.post(`${host}/product/accessStrategyEnterpriseBlacklist/delete`, data)).data;
export const accessStrategyAntiFraudStrategyFind = async (): Promise<any> => (await axios.post(`/product/accessStrategyAntiFraudStrategy/details`, getIds())).data; export const accessStrategyAntiFraudStrategy = async (data: Record<string, any>): Promise<any> =>
export const accessStrategyAntiFraudStrategySave = async (data: Record<string, any>): PromiaccessStrategyGovernmentBlacklistse<any> => (
await axios.post(`${host}/product/accessStrategyAntiFraudStrategy/list`, {
...getIds(),
...data,
})
).data;
export const accessStrategyAntiFraudStrategyFind = async (params: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyAntiFraudStrategy/details`, {}, { params })).data;
export const accessStrategyAntiFraudStrategySave = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyAntiFraudStrategy/saveOrUpdate`, data)).data; (await axios.post(`/product/accessStrategyAntiFraudStrategy/saveOrUpdate`, data)).data;
export const accessStrategyAntiFraudStrategyDel = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`${host}/product/accessStrategyAntiFraudStrategy/delete`, data)).data;
export const accessStrategyBusinessBlacklist = async (data: Record<string, any>): Promise<any> => export const accessStrategyBusinessBlacklist = async (data: Record<string, any>): Promise<any> =>
( (
@ -62,13 +73,33 @@ export const accessStrategyCreditBlacklistSave = async (data: Record<string, any
export const accessStrategyCreditBlacklistDel = async (data: Record<string, any>): Promise<any> => export const accessStrategyCreditBlacklistDel = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`${host}/product/accessStrategyCreditBlacklist/delete`, data)).data; (await axios.post(`${host}/product/accessStrategyCreditBlacklist/delete`, data)).data;
export const accessStrategyInlineBlacklistFind = async (): Promise<any> => (await axios.post(`/product/accessStrategyInlineBlacklist/details`, getIds())).data; export const accessStrategyInlineBlacklist = async (data: Record<string, any>): Promise<any> =>
(
await axios.post(`${host}/product/accessStrategyInlineBlacklist/list`, {
...getIds(),
...data,
})
).data;
export const accessStrategyInlineBlacklistFind = async (params: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyInlineBlacklist/details`, {}, { params })).data;
export const accessStrategyInlineBlacklistSave = async (data: Record<string, any>): Promise<any> => export const accessStrategyInlineBlacklistSave = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyInlineBlacklist/saveOrUpdate`, data)).data; (await axios.post(`/product/accessStrategyInlineBlacklist/saveOrUpdate`, data)).data;
export const accessStrategyInlineBlacklistDel = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`${host}/product/accessStrategyInlineBlacklist/delete`, data)).data;
export const accessStrategyNegativeIndustryStrategyFind = async (): Promise<any> => (await axios.post(`/product/accessStrategyNegativeIndustryStrategy/details`, getIds())).data; export const accessStrategyNegativeIndustryStrategy = async (data: Record<string, any>): Promise<any> =>
(
await axios.post(`${host}/product/accessStrategyNegativeIndustryStrategy/list`, {
...getIds(),
...data,
})
).data;
export const accessStrategyNegativeIndustryStrategyFind = async (params: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyNegativeIndustryStrategy/details`, {}, { params })).data;
export const accessStrategyNegativeIndustryStrategySave = async (data: Record<string, any>): Promise<any> => export const accessStrategyNegativeIndustryStrategySave = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyNegativeIndustryStrategy/saveOrUpdate`, data)).data; (await axios.post(`/product/accessStrategyNegativeIndustryStrategy/saveOrUpdate`, data)).data;
export const accessStrategyNegativeIndustryStrategyDel = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`${host}/product/accessStrategyNegativeIndustryStrategy/delete`, data)).data;
export const delCredit = async (id: number): Promise<any> => (await axios.post(`/product/creditScoringStrategy/delete?strategyId=${id}`)).data; export const delCredit = async (id: number): Promise<any> => (await axios.post(`/product/creditScoringStrategy/delete?strategyId=${id}`)).data;
export const findCredit = async (id: number): Promise<any> => (await axios.post(`/product/creditScoringStrategy/details?strategyId=${id}`)).data; export const findCredit = async (id: number): Promise<any> => (await axios.post(`/product/creditScoringStrategy/details?strategyId=${id}`)).data;

@ -598,7 +598,7 @@
</el-tabs> </el-tabs>
<el-drawer v-model="visible" <el-drawer v-model="visible"
title="查看政务黑名单策略" :title="curPreviewTitle"
size="100%" size="100%"
custom-class="model-drawer"> custom-class="model-drawer">
<component :is="curPreview" <component :is="curPreview"
@ -615,7 +615,16 @@ import { ElMessage } from 'element-plus';
import type { TabsPaneContext, FormInstance } from 'element-plus'; import type { TabsPaneContext, FormInstance } from 'element-plus';
import { findById, riskSave, riskUpdate, riskControlDetailsAreDisplayed } from '@/api/bank'; import { findById, riskSave, riskUpdate, riskControlDetailsAreDisplayed } from '@/api/bank';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import { listCredit, accessStrategyGovernmentBlacklistList, accessStrategyCreditBlacklist, accessStrategyBusinessBlacklist } from '@/api/model'; import {
listCredit,
accessStrategyGovernmentBlacklistList,
accessStrategyCreditBlacklist,
accessStrategyBusinessBlacklist,
accessStrategyInlineBlacklist,
accessStrategyEnterpriseBlacklist,
accessStrategyAntiFraudStrategy,
accessStrategyNegativeIndustryStrategy,
} from '@/api/model';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { handleId, getIds, getUsername } from '@/utils/common'; import { handleId, getIds, getUsername } from '@/utils/common';
import Info from './Info.vue'; import Info from './Info.vue';
@ -753,14 +762,16 @@ let form = reactive<RuleForm>({
enterpriseQuotaModel: [], enterpriseQuotaModel: [],
}); });
const curPreviewTitle = ref<string>();
const assessNames = ['政务黑名单', '征信黑名单', '商采黑名单', '行内黑名单', '企业黑名单', '反欺诈策略', '负面行业黑名单策略'];
const dynamicComponentMap = { const dynamicComponentMap = {
'150': defineAsyncComponent(() => import('../strategy/150/Detail.vue')), '150': defineAsyncComponent(() => import('../strategy/150/Detail.vue')),
'151': defineAsyncComponent(() => import('../strategy/151/Detail.vue')), '151': defineAsyncComponent(() => import('../strategy/151/Detail.vue')),
'152': defineAsyncComponent(() => import('../strategy/152/Detail.vue')), '152': defineAsyncComponent(() => import('../strategy/152/Detail.vue')),
'153': defineAsyncComponent(() => import('../strategy/153/Detail.vue')), '153': defineAsyncComponent(() => import('../strategy/153/Detail.vue')),
'154': defineAsyncComponent(() => import('../strategy/154/Detail.vue')), '154': defineAsyncComponent(() => import('../strategy/154/Detail.vue')),
// '155': defineAsyncComponent(() => import('./155.vue')), '155': defineAsyncComponent(() => import('../strategy/155/Detail.vue')),
// '156': defineAsyncComponent(() => import('./156.vue')), '156': defineAsyncComponent(() => import('../strategy/156/Detail.vue')),
// '148': defineAsyncComponent(() => import('./Credit.vue')), // '148': defineAsyncComponent(() => import('./Credit.vue')),
// '702': defineAsyncComponent(() => import('./Risk1.vue')), // '702': defineAsyncComponent(() => import('./Risk1.vue')),
// '703': defineAsyncComponent(() => import('./Risk2.vue')), // '703': defineAsyncComponent(() => import('./Risk2.vue')),
@ -784,6 +795,10 @@ const getAccess = async (i: number) => {
if (!i) res = await accessStrategyGovernmentBlacklistList(strategyParams); // if (!i) res = await accessStrategyGovernmentBlacklistList(strategyParams); //
if (i === 1) res = await accessStrategyCreditBlacklist(strategyParams); // if (i === 1) res = await accessStrategyCreditBlacklist(strategyParams); //
if (i === 2) res = await accessStrategyBusinessBlacklist(strategyParams); // if (i === 2) res = await accessStrategyBusinessBlacklist(strategyParams); //
if (i === 3) res = await accessStrategyInlineBlacklist(strategyParams); //
if (i === 4) res = await accessStrategyEnterpriseBlacklist(strategyParams); //
if (i === 5) res = await accessStrategyAntiFraudStrategy(strategyParams); //
if (i === 6) res = await accessStrategyNegativeIndustryStrategy(strategyParams); //
if (res) list[i].blackList = res.page.records; if (res) list[i].blackList = res.page.records;
} finally { } finally {
} }
@ -1257,6 +1272,7 @@ const preview = (row: Record<string, any>, i: number) => {
strategyName: row.blackList.find((e) => e.strategyId === tacticsId)?.strategyName, strategyName: row.blackList.find((e) => e.strategyId === tacticsId)?.strategyName,
}; };
curPreview.value = Object.keys(dynamicComponentMap)[i]; curPreview.value = Object.keys(dynamicComponentMap)[i];
curPreviewTitle.value = `查看${assessNames[i]}策略`;
visible.value = true; visible.value = true;
}; };
</script> </script>

@ -143,7 +143,7 @@
<div class="dia-btn cancel" <div class="dia-btn cancel"
@click="emit('close')">取消</div> @click="emit('close')">取消</div>
<div class="dia-btn" <div class="dia-btn"
@click="syncVisible = true">确定</div> @click="confirmSubmit">确定</div>
</div> </div>
<Confirm v-model="syncVisible" <Confirm v-model="syncVisible"
@ -376,6 +376,10 @@ const submit = async (synchronizeUpdate?: number) => {
}); });
addRecord(recordParam); addRecord(recordParam);
}; };
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -131,7 +131,7 @@
<div class="dia-btn cancel" <div class="dia-btn cancel"
@click="emit('close')">取消</div> @click="emit('close')">取消</div>
<div class="dia-btn" <div class="dia-btn"
@click="syncVisible = true">确定</div> @click="confirmSubmit">确定</div>
</div> </div>
<Confirm v-model="syncVisible" <Confirm v-model="syncVisible"
@ -288,6 +288,10 @@ const submit = async (synchronizeUpdate?: number) => {
}); });
addRecord(recordParam); addRecord(recordParam);
}; };
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -176,7 +176,7 @@
<div class="dia-btn cancel" <div class="dia-btn cancel"
@click="emit('close')">取消</div> @click="emit('close')">取消</div>
<div class="dia-btn" <div class="dia-btn"
@click="syncVisible = true">确定</div> @click="confirmSubmit">确定</div>
</div> </div>
<Confirm v-model="syncVisible" <Confirm v-model="syncVisible"
@ -492,6 +492,10 @@ const submit = async (synchronizeUpdate?: number) => {
}); });
addRecord(param); addRecord(param);
}; };
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -1,278 +0,0 @@
<template>
<!-- 行内 -->
<el-table class="c-table"
:data="form"
max-height="calc(100vh - 230px)"
:cell-style="{background:'#fff'}"
:span-method="span"
border>
<el-table-column prop="name"
label="五级分类"
min-width="100"
align="center">
</el-table-column>
<el-table-column label="未结清是否进黑名单"
min-width="100"
align="center">
<template #default="{ row, $index }">
<span v-if="$index == 4">不存在未结清情况</span>
<el-radio-group v-else
v-model="row.enterBlacklist">
<el-radio v-for="(item, i) in whethers"
:key="i"
:label="item.id">{{ item.name }}</el-radio>
</el-radio-group>
</template>
</el-table-column>
<el-table-column label="进黑名单条件"
width="330"
align="center">
<template #default="{ row }">
<div class="flex items-center">
<span v-if="row.recordChildren"
class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[0]?.name }}认定{{row.name}}</span>
<div class="min-w-[95px] ">
<el-select class="mx-2"
clearable
v-model="row.enterRuleOne">
<el-option v-for="item in nums"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<span class="whitespace-nowrap">天以上进入黑名单</span>
</div>
<div class="flex items-center mt-2">
<span v-if="row.recordChildren"
class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[1]?.name }}认定{{row.name}}</span>
<div class="min-w-[95px] ">
<el-select class="mx-2"
clearable
v-model="row.enterRuleTwo">
<el-option v-for="item in nums"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<span class="whitespace-nowrap">天以上进入黑名单</span>
</div>
</template>
</el-table-column>
<el-table-column label="结清是否能出黑名单"
min-width="120"
align="center">
<template #default="{ row }">
<el-radio-group v-model="row.outBlacklist">
<el-radio v-for="(item, i) in whethers"
:key="i"
:label="item.id">{{ item.name }}</el-radio>
</el-radio-group>
</template>
</el-table-column>
<el-table-column label="出黑名单条件"
width="380"
align="center">
<template #default="{ row }">
<div class="flex items-center">
<span v-if="row.recordChildren"
class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[0]?.name }}结清后</span>
<div class="min-w-[95px] ">
<el-select class="mx-2"
clearable
v-model="row.num">
<el-option v-for="item in nums"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<div class="min-w-[95px] ">
<el-select class="mr-2"
clearable
v-model="row.symbol">
<el-option v-for="item in units"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<span class="whitespace-nowrap">后出黑名单</span>
</div>
<div class="flex items-center mt-2">
<span v-if="row.recordChildren"
class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[1]?.name }}结清后</span>
<div class="min-w-[95px] ">
<el-select class="mx-2"
clearable
v-model="row.num1">
<el-option v-for="item in nums"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<div class="min-w-[95px] ">
<el-select class="mr-2"
clearable
v-model="row.symbol1">
<el-option v-for="item in units"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<span class="whitespace-nowrap">后出黑名单</span>
</div>
</template>
</el-table-column>
</el-table>
<div class="flex justify-end">
<div class="submit"
@click="submit">确认完成配置</div>
</div>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue';
import { ElMessage } from 'element-plus';
import { accessStrategyInlineBlacklistFind, accessStrategyInlineBlacklistSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus';
import { useRoute } from 'vue-router';
import { handleId, getNum, getChinese, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const route = useRoute();
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const nums: Array<number> = [1, 3, 5, 10, 20, 30, 40];
const units: Array<string> = ['年', '个月', '天'];
const whethers: Record<string, any>[] = [
{
id: 345,
name: '是',
},
{
id: 346,
name: '否',
},
];
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(153);
const result = [];
process.map((e) => {
const cur = info.value.find((n) => n.stRecordId === e.id);
let temp = {
...getIds(),
name: e.name,
recordChildren: e.recordChildren,
enterBlacklist: cur?.enterBlacklist,
outBlacklist: cur?.outBlacklist,
enterRuleOne: cur?.enterRuleOne || '',
enterRuleTwo: cur?.enterRuleTwo || '',
num: getNum(cur?.outRuleOne) || '',
num1: getNum(cur?.outRuleTwo) || '',
symbol: getChinese(cur?.outRuleOne) || '',
symbol1: getChinese(cur?.outRuleTwo) || '',
stRecordId: e.id,
};
result.push(temp);
});
result.push({
name: '正常',
remark: '不存在未结清情况',
});
form.value = result;
};
//
const getDetail = async () => {
try {
const { data } = await accessStrategyInlineBlacklistFind();
info.value = data;
getConfig();
} finally {
}
};
watch(
() => route.query,
() => {
route.query.id === '153' && getDetail();
},
{
immediate: true,
},
);
interface SpanMethodProps {
row: Record<string, any>;
column: TableColumnCtx<Record<string, any>>;
rowIndex: number;
columnIndex: number;
}
//
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
if (rowIndex === 4) {
if (columnIndex === 1) {
return {
rowspan: 1,
colspan: 4,
};
} else if (columnIndex > 1) {
return {
rowspan: 0,
colspan: 0,
};
}
}
};
//
const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value));
param.map((e, i) => {
if (info.value.length) e.id = info.value.find((n) => n.stRecordId === e.stRecordId)?.id;
e.outRuleOne = e.num + e.symbol;
e.outRuleTwo = e.num1 + e.symbol1;
});
param.map((e) => {
delete e.recordChildren;
});
await accessStrategyInlineBlacklistSave({ inlineBlacklistList: param });
addRecord(param);
getDetail();
ElMessage.success('提交成功!');
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,67,147,153`; // 1id
const rule: Array<Record<string, any>> = [];
data.map((e) => {
e.enterBlacklist && rule.push(handleId(363, 140, e.enterBlacklist, preIds + ',' + e.stRecordId + ',363', 1));
e.enterRuleOne && rule.push(handleId(367, 166, e.enterRuleOne, preIds + ',' + e.stRecordId + ',364,367', 5));
e.enterRuleTwo && rule.push(handleId(368, 167, e.enterRuleTwo, preIds + ',' + e.stRecordId + ',364,368', 5));
e.outBlacklist && rule.push(handleId(365, 140, e.outBlacklist, preIds + ',' + e.stRecordId + ',365', 1));
e.outRuleOne && rule.push(handleId(367, 166, e.outRuleOne, preIds + ',' + e.stRecordId + ',366,367', 5));
e.outRuleTwo && rule.push(handleId(368, 167, e.outRuleTwo, preIds + ',' + e.stRecordId + ',366,368', 5));
});
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
};
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style>

@ -147,7 +147,7 @@
<div class="dia-btn cancel" <div class="dia-btn cancel"
@click="emit('close')">取消</div> @click="emit('close')">取消</div>
<div class="dia-btn" <div class="dia-btn"
@click="syncVisible = true">确定</div> @click="confirmSubmit">确定</div>
</div> </div>
<Confirm v-model="syncVisible" <Confirm v-model="syncVisible"
@ -155,7 +155,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue'; import { ref, defineAsyncComponent, onMounted, toRefs } from 'vue';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { accessStrategyInlineBlacklistFind, accessStrategyInlineBlacklistSave } from '@/api/model'; import { accessStrategyInlineBlacklistFind, accessStrategyInlineBlacklistSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
@ -164,8 +164,16 @@ import { useRoute } from 'vue-router';
import { handleId, getNum, getChinese, getIds } from '@/utils/common'; import { handleId, getNum, getChinese, getIds } from '@/utils/common';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
const route = useRoute(); const Confirm = defineAsyncComponent(() => import('@/components/StrategyConfirm.vue'));
const props = defineProps({
disabled: { type: Boolean, default: false },
row: { type: Object },
});
const emit = defineEmits(['clsoe']);
const form = ref<Record<string, any>[]>([]); const form = ref<Record<string, any>[]>([]);
const { strategyId, strategyName } = toRefs(props.row);
const info = ref<Record<string, any>[]>([]); const info = ref<Record<string, any>[]>([]);
const nums: Array<number> = [1, 3, 5, 10, 20, 30, 40]; const nums: Array<number> = [1, 3, 5, 10, 20, 30, 40];
const units: Array<string> = ['年', '个月', '天']; const units: Array<string> = ['年', '个月', '天'];
@ -179,6 +187,7 @@ const whethers: Record<string, any>[] = [
name: '否', name: '否',
}, },
]; ];
const syncVisible = ref<boolean>(false);
// //
const getConfig = async () => { const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(153); const { process } = await getProcessInformationBasedOnRoles(153);
@ -210,22 +219,18 @@ const getConfig = async () => {
// //
const getDetail = async () => { const getDetail = async () => {
try { try {
const { data } = await accessStrategyInlineBlacklistFind(); if (strategyId.value) {
info.value = data; const { data } = await accessStrategyInlineBlacklistFind({
strategyId: strategyId.value,
});
info.value = data;
}
getConfig(); getConfig();
} finally { } finally {
} }
}; };
watch( onMounted(getDetail);
() => route.query,
() => {
route.query.id === '153' && getDetail();
},
{
immediate: true,
},
);
interface SpanMethodProps { interface SpanMethodProps {
row: Record<string, any>; row: Record<string, any>;
@ -249,22 +254,6 @@ const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
} }
} }
}; };
//
const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value));
param.map((e, i) => {
if (info.value.length) e.id = info.value.find((n) => n.stRecordId === e.stRecordId)?.id;
e.outRuleOne = e.num + e.symbol;
e.outRuleTwo = e.num1 + e.symbol1;
});
param.map((e) => {
delete e.recordChildren;
});
await accessStrategyInlineBlacklistSave({ inlineBlacklistList: param });
addRecord(param);
getDetail();
ElMessage.success('提交成功!');
};
// //
const addRecord = async (data: Record<string, any>) => { const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,67,147,153`; // 1id const preIds = `1,${Cookies.get('sand-level')},42,67,147,153`; // 1id
@ -285,13 +274,35 @@ const addRecord = async (data: Record<string, any>) => {
lcJudgmentRuleReq: rule, lcJudgmentRuleReq: rule,
}); });
}; };
//
const submit = async (synchronizeUpdate?: number) => {
let param = JSON.parse(JSON.stringify(form.value));
param.map((e, i) => {
if (info.value.length) e.id = info.value.find((n) => n.stRecordId === e.stRecordId)?.id;
e.outRuleOne = e.num + e.symbol;
e.outRuleTwo = e.num1 + e.symbol1;
});
param.map((e) => {
delete e.recordChildren;
});
await accessStrategyInlineBlacklistSave({
...getIds(),
strategyId: strategyId.value,
strategyName: strategyName.value,
synchronizeUpdate,
inlineBlacklistList: param,
});
addRecord(param);
ElMessage.success('提交成功!');
syncVisible.value = false;
emit('close', 1);
};
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import url(../../../styles/form.scss); @import url(../../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style> </style>

@ -38,7 +38,7 @@
width="60" width="60"
align="center" /> align="center" />
<el-table-column prop="strategyName" <el-table-column prop="strategyName"
label="商采黑名单策略名称" label="行内黑名单策略名称"
min-width="180" /> min-width="180" />
<el-table-column prop="createTime" <el-table-column prop="createTime"
label="新增日期" label="新增日期"
@ -53,7 +53,7 @@
@click="toDetail(row)" @click="toDetail(row)"
size="small">编辑</el-button> size="small">编辑</el-button>
<el-popconfirm title="您确定删除吗?" <el-popconfirm title="您确定删除吗?"
@confirm.stop="handleDelete([row.businessId])"> @confirm.stop="handleDelete([row.strategyId])">
<template #reference> <template #reference>
<el-button type="text" <el-button type="text"
size="small">删除</el-button> size="small">删除</el-button>
@ -73,7 +73,7 @@
class="px-3 py-2 justify-end"></el-pagination> class="px-3 py-2 justify-end"></el-pagination>
<el-drawer v-model="visible" <el-drawer v-model="visible"
:title="(isDetail ? '查看' : curRow.businessId ? '编辑' : '新增') + '商采黑名单策略'" :title="(isDetail ? '查看' : curRow.strategyId ? '编辑' : '新增') + '行内黑名单策略'"
size="100%" size="100%"
custom-class="model-drawer"> custom-class="model-drawer">
<Detail v-model:row="curRow" <Detail v-model:row="curRow"
@ -89,7 +89,7 @@ import { onMounted, ref, watch, defineAsyncComponent } from 'vue';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { Delete } from '@element-plus/icons-vue'; import { Delete } from '@element-plus/icons-vue';
import { pageSizes, pageLayout } from '@/utils/common'; import { pageSizes, pageLayout } from '@/utils/common';
import { accessStrategyBusinessBlacklist, accessStrategyBusinessBlacklistDel } from '@/api/model'; import { accessStrategyInlineBlacklist, accessStrategyInlineBlacklistDel } from '@/api/model';
import Search from '@/components/Search.vue'; import Search from '@/components/Search.vue';
const Detail = defineAsyncComponent(() => import('./Detail.vue')); const Detail = defineAsyncComponent(() => import('./Detail.vue'));
@ -104,7 +104,7 @@ const list = ref<Record<string, any>[]>([]);
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
const visible = ref<boolean>(false); const visible = ref<boolean>(false);
const curRow = ref<Record<string, any>>({ const curRow = ref<Record<string, any>>({
businessId: '', strategyId: '',
strategyName: '', strategyName: '',
}); });
const isDetail = ref<boolean>(false); const isDetail = ref<boolean>(false);
@ -113,7 +113,7 @@ const i = ref<number>(0);
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
try { try {
const { page } = await accessStrategyBusinessBlacklist({ pageNum: currentPage.value, pageSize: pageSize.value, keyWord: keyWord.value }); const { page } = await accessStrategyInlineBlacklist({ pageNum: currentPage.value, pageSize: pageSize.value, keyWord: keyWord.value });
list.value = page.records; list.value = page.records;
total.value = page.total; total.value = page.total;
} finally { } finally {
@ -134,14 +134,14 @@ const handleSelectionChange = (val: Record<string, any>[]) => {
}; };
// //
const delAll = async () => { const delAll = async () => {
handleDelete(multipleSelection.value.map((e) => e.businessId)); handleDelete(multipleSelection.value.map((e) => e.strategyId));
}; };
// //
const toAdd = () => { const toAdd = () => {
i.value++; i.value++;
isDetail.value = false; isDetail.value = false;
curRow.value = { curRow.value = {
businessId: '', strategyId: '',
strategyName: '', strategyName: '',
}; };
visible.value = true; visible.value = true;
@ -159,7 +159,7 @@ const closeDrawer = (refresh?: number) => {
refresh && initList(); refresh && initList();
}; };
const handleDelete = async (ids: number[]) => { const handleDelete = async (ids: number[]) => {
await accessStrategyBusinessBlacklistDel({ ids }); await accessStrategyInlineBlacklistDel({ ids });
getList(); getList();
ElMessage.success('删除成功!'); ElMessage.success('删除成功!');
}; };

@ -291,7 +291,7 @@
<div class="dia-btn cancel" <div class="dia-btn cancel"
@click="emit('close')">取消</div> @click="emit('close')">取消</div>
<div class="dia-btn" <div class="dia-btn"
@click="syncVisible = true">确定</div> @click="confirmSubmit">确定</div>
</div> </div>
<Confirm v-model="syncVisible" <Confirm v-model="syncVisible"
@ -396,7 +396,7 @@ const addRecord = async (data: Record<string, any>) => {
emit('close', 1); emit('close', 1);
}; };
// //
const submit = async () => { const submit = async (synchronizeUpdate?: number) => {
let param = []; let param = [];
form.value.map((e, i) => { form.value.map((e, i) => {
const temp = { const temp = {
@ -417,16 +417,21 @@ const submit = async () => {
temp.rule = rule; temp.rule = rule;
param.push(temp); param.push(temp);
}); });
await accessStrategyEnterpriseBlacklistSave({ enterpriseBlacklistList: param }); await accessStrategyEnterpriseBlacklistSave({
...getIds(),
strategyId: strategyId.value,
strategyName: strategyName.value,
synchronizeUpdate,
enterpriseBlacklistList: param,
});
addRecord(param); addRecord(param);
}; };
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import url(../../../styles/form.scss); @import url(../../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style> </style>

@ -73,7 +73,7 @@
class="px-3 py-2 justify-end"></el-pagination> class="px-3 py-2 justify-end"></el-pagination>
<el-drawer v-model="visible" <el-drawer v-model="visible"
:title="(isDetail ? '查看' : curRow.strategyId ? '编辑' : '新增') + '商采黑名单策略'" :title="(isDetail ? '查看' : curRow.strategyId ? '编辑' : '新增') + '企业黑名单策略'"
size="100%" size="100%"
custom-class="model-drawer"> custom-class="model-drawer">
<Detail v-model:row="curRow" <Detail v-model:row="curRow"

@ -1,134 +1,153 @@
<template> <template>
<!-- 反欺诈 --> <el-form label-width="90px"
<el-table class="c-table" label-suffix=":"
:data="form" class="form"
max-height="calc(100vh - 230px)" :disabled="disabled">
:cell-style="{background:'#fff'}" <el-form-item label="策略名称"
:span-method="span" prop="fundName">
border> <el-input class="w-[320px]"
<el-table-column prop="name" placeholder="请输入20以内字符"
label="反欺诈类型" maxlength="20"
min-width="100" clearable
align="center"> v-model="strategyName"></el-input>
</el-table-column> </el-form-item>
<el-table-column prop="rule" <el-form-item label="策略规则">
label="反欺诈指标" <el-table class="c-table"
min-width="150"> :data="form"
</el-table-column> max-height="calc(100vh - 230px)"
<el-table-column label="进黑名单条件" :cell-style="{background:'#fff'}"
min-width="250"> :span-method="span"
<template #default="{ row,$index }"> border>
<div class="flex items-center"> <el-table-column prop="name"
<template v-if="!$index"> label="反欺诈类型"
<span class="whitespace-nowrap">人脸识别匹配度</span> min-width="100"
<div class="w-[95px] mx-2"> align="center">
<el-select v-model="row.symbol" </el-table-column>
clearable> <el-table-column prop="rule"
<el-option v-for="item in symbols" label="反欺诈指标"
:key="item" min-width="150">
:label="item" </el-table-column>
:value="item" /> <el-table-column label="进黑名单条件"
</el-select> min-width="250">
</div> <template #default="{ row,$index }">
<div class="w-[95px]"> <div class="flex items-center">
<el-select v-model="row.num" <template v-if="!$index">
clearable> <span class="whitespace-nowrap">人脸识别匹配度</span>
<el-option v-for="item in nums" <div class="w-[95px] mx-2">
:key="item" <el-select v-model="row.symbol"
:label="item" clearable>
:value="item" /> <el-option v-for="item in symbols"
</el-select> :key="item"
</div> :label="item"
<span class="whitespace-nowrap ml-2">%</span> :value="item" />
</template> </el-select>
<div v-else-if="$index === 1 || $index === 2 || $index > 18" </div>
class="w-[95px] mx-2"> <div class="w-[95px]">
<el-select v-model="row.had" <el-select v-model="row.num"
clearable> clearable>
<el-option v-for="item in have" <el-option v-for="item in nums"
:key="item" :key="item"
:label="item" :label="item"
:value="item" /> :value="item" />
</el-select> </el-select>
</div> </div>
<template v-else-if="$index === 3 || $index === 4"> <span class="whitespace-nowrap ml-2">%</span>
<span class="whitespace-nowrap">在网期限</span> </template>
<div class="w-[95px] "> <div v-else-if="$index === 1 || $index === 2 || $index > 18"
<el-select v-model="row.num" class="w-[95px] mx-2">
clearable> <el-select v-model="row.had"
<el-option v-for="item in nums" clearable>
:key="item" <el-option v-for="item in have"
:label="item" :key="item"
:value="item" /> :label="item"
</el-select> :value="item" />
</div> </el-select>
<span class="mx-2">~</span> </div>
<div class="w-[95px] "> <template v-else-if="$index === 3 || $index === 4">
<el-select v-model="row.num1" <span class="whitespace-nowrap">在网期限</span>
clearable> <div class="w-[95px] ">
<el-option v-for="item in nums" <el-select v-model="row.num"
:key="item" clearable>
:label="item" <el-option v-for="item in nums"
:value="item" /> :key="item"
</el-select> :label="item"
</div> :value="item" />
<div class="w-[95px] mx-2"> </el-select>
<el-select v-model="row.unit" </div>
clearable> <span class="mx-2">~</span>
<el-option v-for="item in units" <div class="w-[95px] ">
:key="item" <el-select v-model="row.num1"
:label="item" clearable>
:value="item" /> <el-option v-for="item in nums"
</el-select> :key="item"
</div> :label="item"
</template> :value="item" />
<template v-else-if="row.stRecordId === 385"> </el-select>
<span class="whitespace-nowrap">命中</span> </div>
<div class="flex-1"> <div class="w-[95px] mx-2">
<el-select v-if="row.recordChildren" <el-select v-model="row.unit"
clearable clearable>
v-model="row.select"> <el-option v-for="item in units"
<el-option v-for="item in row?.recordChildren[0]?.subject?.itemList" :key="item"
:key="item" :label="item"
:value="item.options" /> :value="item" />
</el-select> </el-select>
</div>
</template>
<template v-else-if="row.stRecordId === 385">
<span class="whitespace-nowrap">命中</span>
<div class="flex-1">
<el-select v-if="row.recordChildren"
clearable
v-model="row.select">
<el-option v-for="item in row?.recordChildren[0]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
</div>
</template>
<template v-else-if="$index > 13 && $index < 19">
<span class="whitespace-nowrap">关联人数</span>
<div class="w-[95px] mx-2">
<el-select v-model="row.symbol"
clearable>
<el-option v-for="item in symbols"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<div class="w-[95px] ">
<el-select v-model="row.num"
clearable>
<el-option v-for="item in nums"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<span class="whitespace-nowrap ml-2"></span>
</template>
</div> </div>
</template> </template>
<template v-else-if="$index > 13 && $index < 19"> </el-table-column>
<span class="whitespace-nowrap">关联人数</span> </el-table>
<div class="w-[95px] mx-2"> </el-form-item>
<el-select v-model="row.symbol" </el-form>
clearable> <div v-if="!disabled"
<el-option v-for="item in symbols" class="flex justify-end mt-3">
:key="item" <div class="dia-btn cancel"
:label="item" @click="emit('close')">取消</div>
:value="item" /> <div class="dia-btn"
</el-select> @click="confirmSubmit">确定</div>
</div>
<div class="w-[95px] ">
<el-select v-model="row.num"
clearable>
<el-option v-for="item in nums"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<span class="whitespace-nowrap ml-2"></span>
</template>
</div>
</template>
</el-table-column>
</el-table>
<div class="flex justify-end">
<div class="submit"
@click="submit">确认完成配置</div>
</div> </div>
<Confirm v-model="syncVisible"
@submit="submit" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue'; import { ref, defineAsyncComponent, onMounted, toRefs } from 'vue';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { accessStrategyAntiFraudStrategyFind, accessStrategyAntiFraudStrategySave } from '@/api/model'; import { accessStrategyAntiFraudStrategyFind, accessStrategyAntiFraudStrategySave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
@ -137,14 +156,22 @@ import { useRouter, useRoute } from 'vue-router';
import { handleId, getNum, getSymbol, getChinese, getIds } from '@/utils/common'; import { handleId, getNum, getSymbol, getChinese, getIds } from '@/utils/common';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
const router = useRouter(); const Confirm = defineAsyncComponent(() => import('@/components/StrategyConfirm.vue'));
const route = useRoute();
const props = defineProps({
disabled: { type: Boolean, default: false },
row: { type: Object },
});
const emit = defineEmits(['clsoe']);
const form = ref<Record<string, any>[]>([]); const form = ref<Record<string, any>[]>([]);
const { strategyId, strategyName } = toRefs(props.row);
const info = ref<Record<string, any>[]>([]); const info = ref<Record<string, any>[]>([]);
const symbols: Array<string> = ['>=', '<', '>', '==', '<=']; const symbols: Array<string> = ['>=', '<', '>', '==', '<='];
const nums: Array<number> = [2, 3, 4, 7, 10, 30, 60, 85]; const nums: Array<number> = [2, 3, 4, 7, 10, 30, 60, 85];
const units: Array<string> = ['年', '月', '天']; const units: Array<string> = ['年', '月', '天'];
const have: Array<string> = ['否', '是']; const have: Array<string> = ['否', '是'];
const syncVisible = ref<boolean>(false);
// //
const getConfig = async () => { const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(155); const { process } = await getProcessInformationBasedOnRoles(155);
@ -251,22 +278,18 @@ const getConfig = async () => {
// //
const getDetail = async () => { const getDetail = async () => {
try { try {
const { data } = await accessStrategyAntiFraudStrategyFind(); if (strategyId.value) {
info.value = data; const { data } = await accessStrategyAntiFraudStrategyFind({
strategyId: strategyId.value,
});
info.value = data;
}
getConfig(); getConfig();
} finally { } finally {
} }
}; };
watch( onMounted(getDetail);
() => route.query,
() => {
route.query.id === '155' && getDetail();
},
{
immediate: true,
},
);
interface SpanMethodProps { interface SpanMethodProps {
row: Record<string, any>; row: Record<string, any>;
@ -300,8 +323,58 @@ const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
} }
} }
}; };
const getName = (str: string): string | number => {
const result = form.value[5]?.recordChildren[0]?.subject?.itemList?.find((e) => e.options === str);
return result?.itemId || '';
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,67,147,155`; // 1id
const rule: Array<Record<string, any>> = [];
data[0].ruleOne && rule.push(handleId(387, 181, data[0].ruleOne, preIds + ',384,387', 5));
data[0].ruleTwo && rule.push(handleId(388, 140, data[0].ruleTwo === '是' ? 345 : 346, preIds + ',384,388', 1));
data[0].ruleThree && rule.push(handleId(389, 140, data[0].ruleThree === '是' ? 345 : 346, preIds + ',384,389', 1));
data[0].ruleFour && rule.push(handleId(390, 187, data[0].ruleFour, preIds + ',384,390', 5));
data[0].ruleFive && rule.push(handleId(391, 187, data[0].ruleFive, preIds + ',384,391', 5));
data[1].ruleOne && rule.push(handleId(392, 188, getName(data[1].ruleOne), preIds + ',385,392', 1));
data[1].ruleTwo && rule.push(handleId(393, 188, getName(data[1].ruleTwo), preIds + ',385,393', 1));
data[1].ruleThree && rule.push(handleId(394, 188, getName(data[1].ruleThree), preIds + ',385,394', 1));
data[1].ruleFour && rule.push(handleId(395, 188, getName(data[1].ruleFour), preIds + ',385,395', 1));
data[1].ruleFive && rule.push(handleId(396, 188, getName(data[1].ruleFive), preIds + ',385,396', 1));
data[1].ruleSix && rule.push(handleId(397, 188, getName(data[1].ruleSix), preIds + ',385,397', 1));
data[1].ruleSeven && rule.push(handleId(398, 188, getName(data[1].ruleSeven), preIds + ',385,398', 1));
data[1].ruleEight && rule.push(handleId(399, 188, getName(data[1].ruleEight), preIds + ',385,399', 1));
data[1].ruleNine && rule.push(handleId(400, 188, getName(data[1].ruleNine), preIds + ',385,400', 1));
data[2].ruleOne && rule.push(handleId(401, 182, data[2].ruleOne, preIds + ',386,401', 5));
data[2].ruleTwo && rule.push(handleId(402, 183, data[2].ruleTwo, preIds + ',386,402', 5));
data[2].ruleThree && rule.push(handleId(403, 184, data[2].ruleThree, preIds + ',386,403', 5));
data[2].ruleFour && rule.push(handleId(404, 185, data[2].ruleFour, preIds + ',386,404', 5));
data[2].ruleFive && rule.push(handleId(405, 186, data[2].ruleFive, preIds + ',386,405', 5));
data[2].ruleSix && rule.push(handleId(406, 140, data[2].ruleSix === '是' ? 345 : 346, preIds + ',386,406', 1));
data[2].ruleSeven && rule.push(handleId(407, 140, data[2].ruleSeven === '是' ? 345 : 346, preIds + ',386,407', 1));
data[2].ruleEight && rule.push(handleId(408, 140, data[2].ruleEight === '是' ? 345 : 346, preIds + ',386,408', 1));
data[2].ruleNine && rule.push(handleId(409, 140, data[2].ruleNine === '是' ? 345 : 346, preIds + ',386,409', 1));
data[2].ruleTen && rule.push(handleId(410, 140, data[2].ruleTen === '是' ? 345 : 346, preIds + ',386,410', 1));
data[2].ruleEleven && rule.push(handleId(411, 140, data[2].ruleEleven === '是' ? 345 : 346, preIds + ',386,411', 1));
data[2].ruleTwelve && rule.push(handleId(412, 140, data[2].ruleTwelve === '是' ? 345 : 346, preIds + ',386,412', 1));
data[2].ruleThirteen && rule.push(handleId(413, 140, data[2].ruleThirteen === '是' ? 345 : 346, preIds + ',386,413', 1));
data[2].ruleFourteen && rule.push(handleId(414, 140, data[2].ruleFourteen === '是' ? 345 : 346, preIds + ',386,414', 1));
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
ElMessage.success('提交成功!');
syncVisible.value = false;
emit('close', 1);
};
// //
const submit = async () => { const submit = async (synchronizeUpdate?: number) => {
let param = [ let param = [
{ {
id: info.value.find((n) => n.stRecordId === 384)?.id, id: info.value.find((n) => n.stRecordId === 384)?.id,
@ -347,65 +420,21 @@ const submit = async () => {
ruleFourteen: form.value[27].had, ruleFourteen: form.value[27].had,
}, },
]; ];
await accessStrategyAntiFraudStrategySave({ antiFraudStrategyList: param }); await accessStrategyAntiFraudStrategySave({
addRecord(param);
getDetail();
ElMessage.success('提交成功!');
};
const getName = (str: string): string | number => {
const result = form.value[5]?.recordChildren[0]?.subject?.itemList?.find((e) => e.options === str);
return result?.itemId || '';
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,67,147,155`; // 1id
const rule: Array<Record<string, any>> = [];
data[0].ruleOne && rule.push(handleId(387, 181, data[0].ruleOne, preIds + ',384,387', 5));
data[0].ruleTwo && rule.push(handleId(388, 140, data[0].ruleTwo === '是' ? 345 : 346, preIds + ',384,388', 1));
data[0].ruleThree && rule.push(handleId(389, 140, data[0].ruleThree === '是' ? 345 : 346, preIds + ',384,389', 1));
data[0].ruleFour && rule.push(handleId(390, 187, data[0].ruleFour, preIds + ',384,390', 5));
data[0].ruleFive && rule.push(handleId(391, 187, data[0].ruleFive, preIds + ',384,391', 5));
data[1].ruleOne && rule.push(handleId(392, 188, getName(data[1].ruleOne), preIds + ',385,392', 1));
data[1].ruleTwo && rule.push(handleId(393, 188, getName(data[1].ruleTwo), preIds + ',385,393', 1));
data[1].ruleThree && rule.push(handleId(394, 188, getName(data[1].ruleThree), preIds + ',385,394', 1));
data[1].ruleFour && rule.push(handleId(395, 188, getName(data[1].ruleFour), preIds + ',385,395', 1));
data[1].ruleFive && rule.push(handleId(396, 188, getName(data[1].ruleFive), preIds + ',385,396', 1));
data[1].ruleSix && rule.push(handleId(397, 188, getName(data[1].ruleSix), preIds + ',385,397', 1));
data[1].ruleSeven && rule.push(handleId(398, 188, getName(data[1].ruleSeven), preIds + ',385,398', 1));
data[1].ruleEight && rule.push(handleId(399, 188, getName(data[1].ruleEight), preIds + ',385,399', 1));
data[1].ruleNine && rule.push(handleId(400, 188, getName(data[1].ruleNine), preIds + ',385,400', 1));
data[2].ruleOne && rule.push(handleId(401, 182, data[2].ruleOne, preIds + ',386,401', 5));
data[2].ruleTwo && rule.push(handleId(402, 183, data[2].ruleTwo, preIds + ',386,402', 5));
data[2].ruleThree && rule.push(handleId(403, 184, data[2].ruleThree, preIds + ',386,403', 5));
data[2].ruleFour && rule.push(handleId(404, 185, data[2].ruleFour, preIds + ',386,404', 5));
data[2].ruleFive && rule.push(handleId(405, 186, data[2].ruleFive, preIds + ',386,405', 5));
data[2].ruleSix && rule.push(handleId(406, 140, data[2].ruleSix === '是' ? 345 : 346, preIds + ',386,406', 1));
data[2].ruleSeven && rule.push(handleId(407, 140, data[2].ruleSeven === '是' ? 345 : 346, preIds + ',386,407', 1));
data[2].ruleEight && rule.push(handleId(408, 140, data[2].ruleEight === '是' ? 345 : 346, preIds + ',386,408', 1));
data[2].ruleNine && rule.push(handleId(409, 140, data[2].ruleNine === '是' ? 345 : 346, preIds + ',386,409', 1));
data[2].ruleTen && rule.push(handleId(410, 140, data[2].ruleTen === '是' ? 345 : 346, preIds + ',386,410', 1));
data[2].ruleEleven && rule.push(handleId(411, 140, data[2].ruleEleven === '是' ? 345 : 346, preIds + ',386,411', 1));
data[2].ruleTwelve && rule.push(handleId(412, 140, data[2].ruleTwelve === '是' ? 345 : 346, preIds + ',386,412', 1));
data[2].ruleThirteen && rule.push(handleId(413, 140, data[2].ruleThirteen === '是' ? 345 : 346, preIds + ',386,413', 1));
data[2].ruleFourteen && rule.push(handleId(414, 140, data[2].ruleFourteen === '是' ? 345 : 346, preIds + ',386,414', 1));
await addOperation({
...getIds(), ...getIds(),
parentId: preIds, strategyId: strategyId.value,
lcJudgmentRuleReq: rule, strategyName: strategyName.value,
synchronizeUpdate,
antiFraudStrategyList: param,
}); });
addRecord(param);
};
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import url(../../../styles/form.scss); @import url(../../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style> </style>

@ -0,0 +1,166 @@
<template>
<div class="block">
<div class="flex justify-between items-center mb-5">
<search v-model="keyWord"
@change="initList"></search>
<div class="filter">
<el-popconfirm title="确定要删除吗?"
:disabled="!multipleSelection.length"
@confirm.stop="delAll">
<template #reference>
<div :class="['add-btn mr-2', {'cursor-not-allowed': !multipleSelection.length}]">
<el-icon :size="24"
color="#fff">
<Delete />
</el-icon>
批量删除
</div>
</template>
</el-popconfirm>
<div class="add-btn"
@click="toAdd">
<img src="@/assets/images/plus.png"
alt=""
class="icon" />
新增
</div>
</div>
</div>
<el-table ref="table"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55" />
<el-table-column label="序号"
type="index"
width="60"
align="center" />
<el-table-column prop="strategyName"
label="反欺诈策略名称"
min-width="180" />
<el-table-column prop="createTime"
label="新增日期"
min-width="140" />
<el-table-column label="操作"
width="140">
<template #default="{ row }">
<el-button type="text"
@click="toDetail(row, true)"
size="small">查看</el-button>
<el-button type="text"
@click="toDetail(row)"
size="small">编辑</el-button>
<el-popconfirm title="您确定删除吗?"
@confirm.stop="handleDelete([row.strategyId])">
<template #reference>
<el-button type="text"
size="small">删除</el-button>
</template>
</el-popconfirm>
</template></el-table-column>
</el-table>
<el-pagination v-model:currentPage="currentPage"
v-model:pageSize="pageSize"
:total="total"
:page-sizes="pageSizes"
:layout="pageLayout"
@size-change="getList()"
@current-change="getList()"
small
background
class="px-3 py-2 justify-end"></el-pagination>
<el-drawer v-model="visible"
:title="(isDetail ? '查看' : curRow.strategyId ? '编辑' : '新增') + '反欺诈策略'"
size="100%"
custom-class="model-drawer">
<Detail v-model:row="curRow"
:disabled="isDetail"
:key="i"
@close="closeDrawer" />
</el-drawer>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, watch, defineAsyncComponent } from 'vue';
import { ElMessage } from 'element-plus';
import { Delete } from '@element-plus/icons-vue';
import { pageSizes, pageLayout } from '@/utils/common';
import { accessStrategyAntiFraudStrategy, accessStrategyAntiFraudStrategyDel } from '@/api/model';
import Search from '@/components/Search.vue';
const Detail = defineAsyncComponent(() => import('./Detail.vue'));
const keyWord = ref<string>();
const currentPage = ref<number>(1);
const pageSize = ref<number>(10);
const total = ref<number>(0);
const table = ref<any>();
const multipleSelection = ref<Record<string, any>[]>([]);
const list = ref<Record<string, any>[]>([]);
const loading = ref<boolean>(false);
const visible = ref<boolean>(false);
const curRow = ref<Record<string, any>>({
strategyId: '',
strategyName: '',
});
const isDetail = ref<boolean>(false);
const i = ref<number>(0);
//
const getList = async () => {
loading.value = true;
try {
const { page } = await accessStrategyAntiFraudStrategy({ pageNum: currentPage.value, pageSize: pageSize.value, keyWord: keyWord.value });
list.value = page.records;
total.value = page.total;
} finally {
loading.value = false;
}
};
//
const initList = async () => {
currentPage.value = 1;
getList();
};
watch(keyWord, initList);
onMounted(getList);
//
const handleSelectionChange = (val: Record<string, any>[]) => {
multipleSelection.value = val;
};
//
const delAll = async () => {
handleDelete(multipleSelection.value.map((e) => e.strategyId));
};
//
const toAdd = () => {
i.value++;
isDetail.value = false;
curRow.value = {
strategyId: '',
strategyName: '',
};
visible.value = true;
};
//
const toDetail = async (row: Record<string, any>, detail: boolean = false) => {
i.value++;
isDetail.value = detail;
curRow.value = row;
visible.value = true;
};
//
const closeDrawer = (refresh?: number) => {
visible.value = false;
refresh && initList();
};
const handleDelete = async (ids: number[]) => {
await accessStrategyAntiFraudStrategyDel({ ids });
getList();
ElMessage.success('删除成功!');
};
</script>

@ -1,225 +0,0 @@
<template>
<!-- 负面行业策略 -->
<el-table class="c-table"
:data="form"
max-height="calc(100vh - 230px)"
:cell-style="{background:'#fff'}"
:span-method="span"
border>
<el-table-column label="序号"
width="80"
align="center">
<template #default="{ row, $index }">
<p v-if="isRule($index)"
class="text-left font-semibold text-base text-[#333]">{{ row.name }}</p>
<span v-else>{{ row.index }}</span>
</template>
</el-table-column>
<el-table-column prop="name"
label="负面行业"
min-width="150"
align="center">
</el-table-column>
<el-table-column label="本人工作单位命中进黑名单"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.myselfWorkplace"
@change="e => checkRow(e, row)"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="配偶工作单位命中拒入"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.spouseWorkplace"
@change="e => checkRow(e, row)"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="本人名下企业命中进黑名单"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.myselfEnterprise"
@change="e => checkRow(e, row)"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="配偶名下企业命中拒入"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.spouseEnterprise"
@change="e => checkRow(e, row)"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="可以准入"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.admittance"
@change="checkNone(row)"></el-checkbox>
</template>
</el-table-column>
</el-table>
<div class="flex justify-end">
<div class="submit"
@click="submit">确认完成配置</div>
</div>
</template>
<script setup lang="ts">
import { ref, computed, watch, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { accessStrategyNegativeIndustryStrategyFind, accessStrategyNegativeIndustryStrategySave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus';
import { useRouter, useRoute } from 'vue-router';
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const router = useRouter();
const route = useRoute();
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(156);
const result = [];
let index = 0;
process.map((e) => {
let temp = {
...getIds(),
name: e.name,
};
result.push(temp);
e?.recordChildren.forEach((n, i) => {
index++;
temp = JSON.parse(JSON.stringify(temp));
const cur = info.value.find((j) => j.stRecordId === n.id);
temp.stRecordId = n.id;
temp.subjectId = n.subjectId;
temp.parentId = e.id;
temp.name = n.name;
temp.index = index;
temp.myselfEnterprise = !!cur?.myselfEnterprise;
temp.myselfWorkplace = !!cur?.myselfWorkplace;
temp.spouseEnterprise = !!cur?.spouseEnterprise;
temp.spouseWorkplace = !!cur?.spouseWorkplace;
temp.admittance = !!cur?.admittance;
result.push(temp);
});
});
form.value = result;
};
//
const getDetail = async () => {
try {
const { data } = await accessStrategyNegativeIndustryStrategyFind();
info.value = data;
getConfig();
} finally {
}
};
watch(
() => route.query,
() => {
route.query.id === '156' && getDetail();
},
{
immediate: true,
},
);
const isRule = (rule: number): boolean => {
return !rule || rule === 43 || rule === 63 || rule === 89;
};
interface SpanMethodProps {
row: Record<string, any>;
column: TableColumnCtx<Record<string, any>>;
rowIndex: number;
columnIndex: number;
}
//
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
if (isRule(rowIndex)) {
if (!columnIndex) {
return {
rowspan: 1,
colspan: 7,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
};
const checkRow = (e: boolean, row: Record<string, any>) => {
if (e) row.admittance = false;
};
const checkNone = (row: Record<string, any>) => {
if (row.admittance) {
row.myselfEnterprise = false;
row.myselfWorkplace = false;
row.spouseEnterprise = false;
row.spouseWorkplace = false;
}
};
//
const submit = async () => {
let param = [];
form.value.map((e, i) => {
if (e.index) {
param.push({
...getIds(),
stRecordId: e.stRecordId,
id: info.value.find((j) => j.stRecordId === e.stRecordId)?.id ?? '',
myselfEnterprise: e.myselfEnterprise ? 1 : 0,
myselfWorkplace: e.myselfWorkplace ? 1 : 0,
spouseEnterprise: e.spouseEnterprise ? 1 : 0,
spouseWorkplace: e.spouseWorkplace ? 1 : 0,
admittance: e.admittance ? 1 : 0,
});
}
});
await accessStrategyNegativeIndustryStrategySave({ negativeIndustryStrategyList: param });
addRecord(param);
getDetail();
ElMessage.success('提交成功!');
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,67,147,156`; // 1id
const rule: Array<Record<string, any>> = [];
form.value.map((e) => {
if (e.index) {
const temp = [];
e.myselfWorkplace && temp.push(383);
e.spouseWorkplace && temp.push(384);
e.myselfEnterprise && temp.push(385);
e.spouseEnterprise && temp.push(386);
e.admittance && temp.push(758);
temp.length && rule.push(handleId(e.stRecordId, e.subjectId, temp.join(), preIds + ',' + e.parentId + ',' + e.stRecordId, 1));
}
});
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
};
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style>

@ -0,0 +1,254 @@
<template>
<el-form label-width="90px"
label-suffix=":"
class="form"
:disabled="disabled">
<el-form-item label="策略名称"
prop="fundName">
<el-input class="w-[320px]"
placeholder="请输入20以内字符"
maxlength="20"
clearable
v-model="strategyName"></el-input>
</el-form-item>
<el-form-item label="策略规则">
<el-table class="c-table"
:data="form"
max-height="calc(100vh - 230px)"
:cell-style="{background:'#fff'}"
:span-method="span"
border>
<el-table-column label="序号"
width="80"
align="center">
<template #default="{ row, $index }">
<p v-if="isRule($index)"
class="text-left font-semibold text-base text-[#333]">{{ row.name }}</p>
<span v-else>{{ row.index }}</span>
</template>
</el-table-column>
<el-table-column prop="name"
label="负面行业"
min-width="150"
align="center">
</el-table-column>
<el-table-column label="本人工作单位命中进黑名单"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.myselfWorkplace"
@change="e => checkRow(e, row)"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="配偶工作单位命中拒入"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.spouseWorkplace"
@change="e => checkRow(e, row)"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="本人名下企业命中进黑名单"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.myselfEnterprise"
@change="e => checkRow(e, row)"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="配偶名下企业命中拒入"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.spouseEnterprise"
@change="e => checkRow(e, row)"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="可以准入"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.admittance"
@change="checkNone(row)"></el-checkbox>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<div v-if="!disabled"
class="flex justify-end mt-3">
<div class="dia-btn cancel"
@click="emit('close')">取消</div>
<div class="dia-btn"
@click="confirmSubmit">确定</div>
</div>
<Confirm v-model="syncVisible"
@submit="submit" />
</template>
<script setup lang="ts">
import { ref, defineAsyncComponent, onMounted, toRefs } from 'vue';
import { ElMessage } from 'element-plus';
import { accessStrategyNegativeIndustryStrategyFind, accessStrategyNegativeIndustryStrategySave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus';
import { useRouter, useRoute } from 'vue-router';
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const Confirm = defineAsyncComponent(() => import('@/components/StrategyConfirm.vue'));
const props = defineProps({
disabled: { type: Boolean, default: false },
row: { type: Object },
});
const emit = defineEmits(['clsoe']);
const form = ref<Record<string, any>[]>([]);
const { strategyId, strategyName } = toRefs(props.row);
const info = ref<Record<string, any>[]>([]);
const syncVisible = ref<boolean>(false);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(156);
const result = [];
let index = 0;
process.map((e) => {
let temp = {
...getIds(),
name: e.name,
};
result.push(temp);
e?.recordChildren.forEach((n, i) => {
index++;
temp = JSON.parse(JSON.stringify(temp));
const cur = info.value.find((j) => j.stRecordId === n.id);
temp.stRecordId = n.id;
temp.subjectId = n.subjectId;
temp.parentId = e.id;
temp.name = n.name;
temp.index = index;
temp.myselfEnterprise = !!cur?.myselfEnterprise;
temp.myselfWorkplace = !!cur?.myselfWorkplace;
temp.spouseEnterprise = !!cur?.spouseEnterprise;
temp.spouseWorkplace = !!cur?.spouseWorkplace;
temp.admittance = !!cur?.admittance;
result.push(temp);
});
});
form.value = result;
};
//
const getDetail = async () => {
try {
if (strategyId.value) {
const { data } = await accessStrategyNegativeIndustryStrategyFind({
strategyId: strategyId.value,
});
info.value = data;
}
getConfig();
} finally {
}
};
onMounted(getDetail);
const isRule = (rule: number): boolean => {
return !rule || rule === 43 || rule === 63 || rule === 89;
};
interface SpanMethodProps {
row: Record<string, any>;
column: TableColumnCtx<Record<string, any>>;
rowIndex: number;
columnIndex: number;
}
//
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
if (isRule(rowIndex)) {
if (!columnIndex) {
return {
rowspan: 1,
colspan: 7,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
};
const checkRow = (e: boolean, row: Record<string, any>) => {
if (e) row.admittance = false;
};
const checkNone = (row: Record<string, any>) => {
if (row.admittance) {
row.myselfEnterprise = false;
row.myselfWorkplace = false;
row.spouseEnterprise = false;
row.spouseWorkplace = false;
}
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,67,147,156`; // 1id
const rule: Array<Record<string, any>> = [];
form.value.map((e) => {
if (e.index) {
const temp = [];
e.myselfWorkplace && temp.push(383);
e.spouseWorkplace && temp.push(384);
e.myselfEnterprise && temp.push(385);
e.spouseEnterprise && temp.push(386);
e.admittance && temp.push(758);
temp.length && rule.push(handleId(e.stRecordId, e.subjectId, temp.join(), preIds + ',' + e.parentId + ',' + e.stRecordId, 1));
}
});
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
ElMessage.success('提交成功!');
syncVisible.value = false;
emit('close', 1);
};
//
const submit = async (synchronizeUpdate?: number) => {
let param = [];
form.value.map((e, i) => {
if (e.index) {
param.push({
...getIds(),
stRecordId: e.stRecordId,
id: info.value.find((j) => j.stRecordId === e.stRecordId)?.id ?? '',
myselfEnterprise: e.myselfEnterprise ? 1 : 0,
myselfWorkplace: e.myselfWorkplace ? 1 : 0,
spouseEnterprise: e.spouseEnterprise ? 1 : 0,
spouseWorkplace: e.spouseWorkplace ? 1 : 0,
admittance: e.admittance ? 1 : 0,
});
}
});
await accessStrategyNegativeIndustryStrategySave({
...getIds(),
strategyId: strategyId.value,
strategyName: strategyName.value,
synchronizeUpdate,
negativeIndustryStrategyList: param,
});
addRecord(param);
};
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script>
<style lang="scss" scoped>
@import url(../../../../styles/form.scss);
</style>

@ -0,0 +1,166 @@
<template>
<div class="block">
<div class="flex justify-between items-center mb-5">
<search v-model="keyWord"
@change="initList"></search>
<div class="filter">
<el-popconfirm title="确定要删除吗?"
:disabled="!multipleSelection.length"
@confirm.stop="delAll">
<template #reference>
<div :class="['add-btn mr-2', {'cursor-not-allowed': !multipleSelection.length}]">
<el-icon :size="24"
color="#fff">
<Delete />
</el-icon>
批量删除
</div>
</template>
</el-popconfirm>
<div class="add-btn"
@click="toAdd">
<img src="@/assets/images/plus.png"
alt=""
class="icon" />
新增
</div>
</div>
</div>
<el-table ref="table"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55" />
<el-table-column label="序号"
type="index"
width="60"
align="center" />
<el-table-column prop="strategyName"
label="负面行业黑名单策略名称"
min-width="180" />
<el-table-column prop="createTime"
label="新增日期"
min-width="140" />
<el-table-column label="操作"
width="140">
<template #default="{ row }">
<el-button type="text"
@click="toDetail(row, true)"
size="small">查看</el-button>
<el-button type="text"
@click="toDetail(row)"
size="small">编辑</el-button>
<el-popconfirm title="您确定删除吗?"
@confirm.stop="handleDelete([row.strategyId])">
<template #reference>
<el-button type="text"
size="small">删除</el-button>
</template>
</el-popconfirm>
</template></el-table-column>
</el-table>
<el-pagination v-model:currentPage="currentPage"
v-model:pageSize="pageSize"
:total="total"
:page-sizes="pageSizes"
:layout="pageLayout"
@size-change="getList()"
@current-change="getList()"
small
background
class="px-3 py-2 justify-end"></el-pagination>
<el-drawer v-model="visible"
:title="(isDetail ? '查看' : curRow.strategyId ? '编辑' : '新增') + '负面行业黑名单策略'"
size="100%"
custom-class="model-drawer">
<Detail v-model:row="curRow"
:disabled="isDetail"
:key="i"
@close="closeDrawer" />
</el-drawer>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, watch, defineAsyncComponent } from 'vue';
import { ElMessage } from 'element-plus';
import { Delete } from '@element-plus/icons-vue';
import { pageSizes, pageLayout } from '@/utils/common';
import { accessStrategyNegativeIndustryStrategy, accessStrategyNegativeIndustryStrategyDel } from '@/api/model';
import Search from '@/components/Search.vue';
const Detail = defineAsyncComponent(() => import('./Detail.vue'));
const keyWord = ref<string>();
const currentPage = ref<number>(1);
const pageSize = ref<number>(10);
const total = ref<number>(0);
const table = ref<any>();
const multipleSelection = ref<Record<string, any>[]>([]);
const list = ref<Record<string, any>[]>([]);
const loading = ref<boolean>(false);
const visible = ref<boolean>(false);
const curRow = ref<Record<string, any>>({
strategyId: '',
strategyName: '',
});
const isDetail = ref<boolean>(false);
const i = ref<number>(0);
//
const getList = async () => {
loading.value = true;
try {
const { page } = await accessStrategyNegativeIndustryStrategy({ pageNum: currentPage.value, pageSize: pageSize.value, keyWord: keyWord.value });
list.value = page.records;
total.value = page.total;
} finally {
loading.value = false;
}
};
//
const initList = async () => {
currentPage.value = 1;
getList();
};
watch(keyWord, initList);
onMounted(getList);
//
const handleSelectionChange = (val: Record<string, any>[]) => {
multipleSelection.value = val;
};
//
const delAll = async () => {
handleDelete(multipleSelection.value.map((e) => e.strategyId));
};
//
const toAdd = () => {
i.value++;
isDetail.value = false;
curRow.value = {
strategyId: '',
strategyName: '',
};
visible.value = true;
};
//
const toDetail = async (row: Record<string, any>, detail: boolean = false) => {
i.value++;
isDetail.value = detail;
curRow.value = row;
visible.value = true;
};
//
const closeDrawer = (refresh?: number) => {
visible.value = false;
refresh && initList();
};
const handleDelete = async (ids: number[]) => {
await accessStrategyNegativeIndustryStrategyDel({ ids });
getList();
ElMessage.success('删除成功!');
};
</script>

@ -36,10 +36,10 @@ const dynamicComponentMap = {
'150': defineAsyncComponent(() => import('./150/Index.vue')), '150': defineAsyncComponent(() => import('./150/Index.vue')),
'151': defineAsyncComponent(() => import('./151/Index.vue')), '151': defineAsyncComponent(() => import('./151/Index.vue')),
'152': defineAsyncComponent(() => import('./152/Index.vue')), '152': defineAsyncComponent(() => import('./152/Index.vue')),
'153': defineAsyncComponent(() => import('./153.vue')), '153': defineAsyncComponent(() => import('./153/Index.vue')),
'154': defineAsyncComponent(() => import('./154/Index.vue')), '154': defineAsyncComponent(() => import('./154/Index.vue')),
'155': defineAsyncComponent(() => import('./155.vue')), '155': defineAsyncComponent(() => import('./155/Index.vue')),
'156': defineAsyncComponent(() => import('./156.vue')), '156': defineAsyncComponent(() => import('./156/Index.vue')),
'148': defineAsyncComponent(() => import('./Credit.vue')), '148': defineAsyncComponent(() => import('./Credit.vue')),
'702': defineAsyncComponent(() => import('./Risk1.vue')), '702': defineAsyncComponent(() => import('./Risk1.vue')),
'703': defineAsyncComponent(() => import('./Risk2.vue')), '703': defineAsyncComponent(() => import('./Risk2.vue')),

Loading…
Cancel
Save