V0.1
yujialong 1 year ago
parent e39ab950f3
commit a9d1f93311
  1. 2
      .env
  2. 2
      src/api/bank.ts
  3. 14
      src/api/model.ts
  4. 0
      src/assets/images/level/line3.png
  5. 31
      src/utils/common.ts
  6. 2
      src/utils/getPageTitle.ts
  7. 125
      src/views/Home.vue
  8. 52
      src/views/Role.vue
  9. 10
      src/views/product/bank/Add.vue
  10. 3
      src/views/product/bank/CardList.vue
  11. 10
      src/views/product/bank/Config.vue
  12. 71
      src/views/product/strategy/150.vue
  13. 82
      src/views/product/strategy/151.vue
  14. 6
      src/views/product/strategy/CardList.vue

@ -2,7 +2,7 @@ VITE_APP_TITLE=金融产品设计及数字化营销沙盘
VITE_PORT=9520 VITE_PORT=9520
VITE_PROXY=http://192.168.31.125:8080 VITE_PROXY=http://192.168.31.125:8080
VITE_PUBLIC_PATH=./ VITE_PUBLIC_PATH=./
VITE_BASE_API=http://192.168.31.217:9000 VITE_BASE_API=http://192.168.31.51:9000
# VITE_BASE_API=http://121.37.12.51 # VITE_BASE_API=http://121.37.12.51
VITE_I18N_LOCALE=zh-cn VITE_I18N_LOCALE=zh-cn
VITE_I18N_FALLBACK_LOCALE=zh-cn VITE_I18N_FALLBACK_LOCALE=zh-cn

@ -18,3 +18,5 @@ export const riskById = async (id: number): Promise<any> => (await axios.post(`/
export const examineAndApprove = async (id: number | string, opinionDescription: string, status: number, approvalTime: string): Promise<any> => export const examineAndApprove = async (id: number | string, opinionDescription: string, status: number, approvalTime: string): Promise<any> =>
(await axios.post(`/product/product/bank/products/examineAndApprove?id=${id}&opinionDescription=${opinionDescription}&status=${status}&approvalTime=${approvalTime}`)).data; (await axios.post(`/product/product/bank/products/examineAndApprove?id=${id}&opinionDescription=${opinionDescription}&status=${status}&approvalTime=${approvalTime}`)).data;
export const update = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/product/bank/products/update`, data)).data; export const update = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/product/bank/products/update`, data)).data;
export const cancelCollection = async (id: number): Promise<any> => (await axios.post(`/product/checkPointCollect/cancelCollection?favoriteId=${id}`)).data;
export const collect = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/checkPointCollect/collect`, data)).data;

@ -2,35 +2,35 @@ import axios from '@/utils/request';
export const accessStrategyGovernmentBlacklistFind = async (checkpointId: number, projectId: number): Promise<any> => export const accessStrategyGovernmentBlacklistFind = async (checkpointId: number, projectId: number): Promise<any> =>
(await axios.post(`/product/accessStrategyGovernmentBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; (await axios.post(`/product/accessStrategyGovernmentBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data;
export const accessStrategyGovernmentBlacklistSave = async (data: Record<string, any>[]): Promise<any> => export const accessStrategyGovernmentBlacklistSave = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyGovernmentBlacklist/saveOrUpdate`, data)).data; (await axios.post(`/product/accessStrategyGovernmentBlacklist/saveOrUpdate`, data)).data;
export const accessStrategyEnterpriseBlacklistFind = async (checkpointId: number, projectId: number): Promise<any> => export const accessStrategyEnterpriseBlacklistFind = async (checkpointId: number, projectId: number): Promise<any> =>
(await axios.post(`/product/accessStrategyEnterpriseBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; (await axios.post(`/product/accessStrategyEnterpriseBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).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 accessStrategyAntiFraudStrategyFind = async (checkpointId: number, projectId: number): Promise<any> => export const accessStrategyAntiFraudStrategyFind = async (checkpointId: number, projectId: number): Promise<any> =>
(await axios.post(`/product/accessStrategyAntiFraudStrategy/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; (await axios.post(`/product/accessStrategyAntiFraudStrategy/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data;
export const accessStrategyAntiFraudStrategySave = async (data: Record<string, any>[]): Promise<any> => 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 accessStrategyBusinessBlacklistFind = async (checkpointId: number, projectId: number): Promise<any> => export const accessStrategyBusinessBlacklistFind = async (checkpointId: number, projectId: number): Promise<any> =>
(await axios.post(`/product/accessStrategyBusinessBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; (await axios.post(`/product/accessStrategyBusinessBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data;
export const accessStrategyBusinessBlacklistSave = async (data: Record<string, any>[]): Promise<any> => export const accessStrategyBusinessBlacklistSave = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyBusinessBlacklist/saveOrUpdate`, data)).data; (await axios.post(`/product/accessStrategyBusinessBlacklist/saveOrUpdate`, data)).data;
export const accessStrategyCreditBlacklistFind = async (checkpointId: number, projectId: number): Promise<any> => export const accessStrategyCreditBlacklistFind = async (checkpointId: number, projectId: number): Promise<any> =>
(await axios.post(`/product/accessStrategyCreditBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; (await axios.post(`/product/accessStrategyCreditBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data;
export const accessStrategyCreditBlacklistSave = async (data: Record<string, any>[]): Promise<any> => export const accessStrategyCreditBlacklistSave = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/accessStrategyCreditBlacklist/saveOrUpdate`, data)).data; (await axios.post(`/product/accessStrategyCreditBlacklist/saveOrUpdate`, data)).data;
export const accessStrategyInlineBlacklistFind = async (checkpointId: number, projectId: number): Promise<any> => export const accessStrategyInlineBlacklistFind = async (checkpointId: number, projectId: number): Promise<any> =>
(await axios.post(`/product/accessStrategyInlineBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; (await axios.post(`/product/accessStrategyInlineBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).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 accessStrategyNegativeIndustryStrategyFind = async (checkpointId: number, projectId: number): Promise<any> => export const accessStrategyNegativeIndustryStrategyFind = async (checkpointId: number, projectId: number): Promise<any> =>
(await axios.post(`/product/accessStrategyNegativeIndustryStrategy/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; (await axios.post(`/product/accessStrategyNegativeIndustryStrategy/details?checkpointId=${checkpointId}&projectId=${projectId}`)).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;

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -132,3 +132,34 @@ export const handleId = (
type, type,
}; };
}; };
/**
*
*/
export const numToChinese = (num: number): string => {
const arr1 = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
const arr2 = ['', '十', '百', '千', '万', '亿', '点', ''];
const a = `${num}`.replace(/(^0*)/g, '').split('.');
let k = 0;
let re = '';
for (let i = a[0].length - 1; i >= 0; i--) {
switch (k) {
case 0:
re = arr2[7] + re;
break;
case 4:
if (!new RegExp(`0{4}//d{${a[0].length - i - 1}}$`).test(a[0])) re = arr2[4] + re;
break;
case 8:
re = arr2[5] + re;
arr2[7] = arr2[5];
k = 0;
break;
default:
}
if (k % 4 == 2 && a[0].charAt(i + 2) != 0 && a[0].charAt(i + 1) == 0) re = arr1[0] + re;
if (a[0].charAt(i) != 0) re = arr1[a[0].charAt(i)] + arr2[k % 4] + re;
k++;
}
return num > 9 && num < 20 ? re.slice(1) : re;
};

@ -1,7 +1,7 @@
import defaultSettings from '@/settings'; import defaultSettings from '@/settings';
import i18n from '@/i18n'; import i18n from '@/i18n';
const title = defaultSettings.title || 'UJCMS'; const { title } = defaultSettings;
export default function getPageTitle(pageTitle: string | undefined): string { export default function getPageTitle(pageTitle: string | undefined): string {
if (pageTitle) { if (pageTitle) {

@ -34,25 +34,32 @@
@click="selecLevel(item)"> @click="selecLevel(item)">
<span class="num">LV.{{ i + 1 }}</span> <span class="num">LV.{{ i + 1 }}</span>
<div class="texts"> <div class="texts">
<h6>第一关</h6> <h6>{{ numToChinese(i + 1) }}</h6>
<p class="des mul-ellipsis2">{{ item.name }}</p> <p class="des mul-ellipsis2">{{ item.name.split(' ')[1] }}</p>
<img class="icon" <img v-if="item.collect"
class="icon"
src="@/assets/images/level/star2.png"
alt=""
@click.stop="collectItem(item)" />
<img v-else
class="icon"
src="@/assets/images/level/star1.png" src="@/assets/images/level/star1.png"
alt="" /> alt=""
@click.stop="collectItem(item)" />
</div> </div>
</div> </div>
</div> </div>
<img class="arrow top-0 left-[50%] translate-x-[-50%]" <img class="arrow top-0 left-[50%] translate-x-[-50%] animate-pulse"
src="@/assets/images/level/arrow-up.png" src="@/assets/images/level/arrow-up.png"
alt="" /> alt="" />
<img class="arrow right-0 top-[50%] translate-y-[-50%]" <img class="arrow right-0 top-[50%] translate-y-[-50%] animate-pulse"
src="@/assets/images/level/arrow-right.png" src="@/assets/images/level/arrow-right.png"
alt="" /> alt="" />
<img class="arrow bottom-0 left-[50%] translate-x-[-50%]" <img class="arrow bottom-0 left-[50%] translate-x-[-50%] animate-pulse"
src="@/assets/images/level/arrow-down.png" src="@/assets/images/level/arrow-down.png"
alt="" /> alt="" />
<img class="arrow left-0 top-[50%] translate-y-[-50%]" <img class="arrow left-0 top-[50%] translate-y-[-50%] animate-pulse"
src="@/assets/images/level/arrow-left.png" src="@/assets/images/level/arrow-left.png"
alt="" /> alt="" />
<div class="absolute bottom-2 right-1 w-[262px] h-[74px] bg-[url('@/assets/images/level/submit.png')] bg-[length:100%_100%] bg-no-repeat cursor-pointer hover:bg-[url('@/assets/images/level/submit-hover.png')]" <div class="absolute bottom-2 right-1 w-[262px] h-[74px] bg-[url('@/assets/images/level/submit.png')] bg-[length:100%_100%] bg-no-repeat cursor-pointer hover:bg-[url('@/assets/images/level/submit-hover.png')]"
@ -64,27 +71,41 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { checkPointList } from '@/api/judgment'; import { checkPointList } from '@/api/judgment';
import { cancelCollection, collect } from '@/api/bank';
import Panel from '@/components/Panel/index.vue'; import Panel from '@/components/Panel/index.vue';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { logout } from '@/store/useCurrentUser'; import { logout } from '@/store/useCurrentUser';
import { numToChinese } from '@/utils/common';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const { token, referrer } = route.query;
const collected = ref<boolean>(false); const collected = ref<boolean>(false);
const curLevel = ref<number | string>(''); const curLevel = ref<number | string>('');
const levels = ref<Record<string, any>[]>([]); const levels = ref<Record<string, any>[]>([]);
const projectId = +Cookies.get('sand-projectId');
// //
const getLevel = async () => { const getLevel = async () => {
const { data } = await checkPointList(1); const { data } = await checkPointList(projectId);
levels.value = data; levels.value = data;
}; };
// //
const selecLevel = (item: Record<string, any>) => { const selecLevel = (item: Record<string, any>) => {
curLevel.value = item.id; curLevel.value = item.id;
}; };
//
const collectItem = async (item: Record<string, any>) => {
if (item.collect) {
await cancelCollection(item.favoriteId);
} else {
await collect({
checkPointId: item.id,
projectId,
});
}
getLevel();
};
// //
const toRole = () => { const toRole = () => {
if (curLevel.value) { if (curLevel.value) {
@ -106,13 +127,18 @@ onMounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.item { .item {
--w: 300px; --w: 330px;
--line2: 160px; --line2: 160px;
--line3: 360px; --line3: 360px;
--line4: 520px; --line4: 520px;
@apply absolute w-[218px] h-[120px] text-white bg-[url('@/assets/images/level/8.png')] bg-[length:100%_100%] bg-no-repeat cursor-pointer; @apply absolute w-[218px] h-[120px] text-white bg-[url('@/assets/images/level/8.png')] bg-[length:100%_100%] bg-no-repeat cursor-pointer;
&:before,
&:after {
content: '';
@apply absolute top-[86%] left-[100px] w-[90px] h-[70px] bg-[length:auto] bg-no-repeat;
}
.num { .num {
@apply absolute bottom-[35px] left-[28px] font-['DIN-BlackItalic']; @apply absolute bottom-[37px] left-[12px] w-[60px] font-['DIN-BlackItalic'] text-center;
text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2); text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
} }
.texts { .texts {
@ -143,38 +169,99 @@ onMounted(() => {
-webkit-text-fill-color: #fff; -webkit-text-fill-color: #fff;
} }
} }
&:nth-child(2) { &:nth-child(2) {
@apply top-[var(--line2)] left-[150px]; @apply top-[var(--line2)] left-[160px];
} }
&:nth-child(3) { &:nth-child(3) {
@apply left-[var(--w)]; @apply left-[var(--w)];
} }
&:nth-child(4) { &:nth-child(4) {
@apply top-[var(--line2)] left-[450px]; @apply top-[var(--line2)] left-[510px];
} }
&:nth-child(5) { &:nth-child(5) {
@apply left-[calc(var(--w)*2)]; @apply left-[calc(var(--w)*2)];
} }
&:nth-child(6) { &:nth-child(6) {
@apply top-[var(--line2)] left-[750px]; @apply top-[var(--line2)] left-[820px];
} }
&:nth-child(7) { &:nth-child(7) {
@apply left-[calc(var(--w)*3)]; @apply left-[calc(var(--w)*3)];
} }
&:nth-child(8) { &:nth-child(8) {
@apply top-[var(--line2)] left-[1050px]; @apply top-[var(--line2)] left-[1170px];
} }
&:nth-child(9) { &:nth-child(9) {
@apply left-[calc(var(--w)*4)]; @apply left-[calc(var(--w)*4)];
} }
&:nth-child(10) { &:nth-child(10) {
@apply top-[var(--line2)] left-[1350px]; @apply top-[var(--line2)] left-[1500px];
} }
&:nth-child(11) { &:nth-child(11) {
@apply top-[var(--line3)] left-[1350px]; @apply top-[var(--line3)] left-[1500px];
} }
&:nth-child(12) { &:nth-child(12) {
@apply top-[var(--line4)] left-[1200px]; @apply top-[var(--line4)] left-[calc(var(--w)*4)];
}
&:nth-child(13) {
@apply top-[var(--line3)] left-[1170px];
}
&:nth-child(14) {
@apply top-[var(--line4)] left-[calc(var(--w)*3)];
}
&:nth-child(15) {
@apply top-[var(--line3)] left-[820px];
}
&:nth-child(16) {
@apply top-[var(--line4)] left-[calc(var(--w)*2)];
}
&:nth-child(17) {
@apply top-[var(--line3)] left-[510px];
}
&:nth-child(18) {
@apply top-[var(--line4)] left-[var(--w)];
}
&:nth-child(19) {
@apply top-[var(--line3)] left-[160px];
}
&:nth-child(20) {
@apply top-[var(--line4)];
}
&:nth-child(odd) {
&:before {
@apply left-[40px] bg-[url('@/assets/images/level/line2.png')];
transform: rotateX(180deg);
}
&:after {
@apply bg-[url('@/assets/images/level/line2.png')];
}
}
&:first-child {
z-index: 1;
&:before {
display: none;
}
&:after {
@apply bg-[url('@/assets/images/level/line2.png')];
}
}
&:nth-child(10) {
&:before {
display: none;
}
&:after {
@apply left-[108px] h-[98px] bg-[url('@/assets/images/level/line3.png')];
}
}
&:nth-child(11) {
&:before {
@apply left-[40px] bg-[url('@/assets/images/level/line2.png')];
transform: rotateX(180deg);
}
&:after {
display: none;
}
} }
} }
.arrow { .arrow {

@ -2,6 +2,45 @@
<div class="flex justify-between items-center h-[64px] px-5 bg-white"> <div class="flex justify-between items-center h-[64px] px-5 bg-white">
<h1>金融产品设计及数字化营销沙盘系统</h1> <h1>金融产品设计及数字化营销沙盘系统</h1>
<div class="inline-flex items-center"> <div class="inline-flex items-center">
<div class="stat">
<div class="w-10 h-10 bg-[url('@/assets/images/role/3.png')] bg-[length:100%_100%] bg-no-repeat"></div>
<div class="texts">
<h6 class="text-[#FF5252]">+999,999.00</h6>
<p class="text">今日银行收益</p>
</div>
</div>
<div class="stat">
<div class="w-10 h-10 bg-[url('@/assets/images/role/4.png')] bg-[length:100%_100%] bg-no-repeat"></div>
<div class="texts">
<h6 class="text-[#FF5252]">+999,999.00</h6>
<p class="text">今日保险收益</p>
</div>
</div>
<div class="stat">
<div class="w-10 h-10 bg-[url('@/assets/images/role/5.png')] bg-[length:100%_100%] bg-no-repeat"></div>
<div class="texts">
<h6 class="text-[#FF5252]">+999,999.00</h6>
<p class="text">今日基金收益</p>
</div>
</div>
<div class="stat">
<div class="flex justify-center items-center w-10 h-10 bg-[#F9F9F9] rounded-[10px]">
<div class="w-[22px] h-[24px] bg-[url('@/assets/images/role/6.png')] bg-[length:100%_100%] bg-no-repeat"></div>
</div>
<div class="texts">
<h6 class="text-[#333]">67890</h6>
<p class="text">今日新增订单</p>
</div>
</div>
<div class="stat">
<div class="flex justify-center items-center w-10 h-10 bg-[#F9F9F9] rounded-[10px]">
<div class="w-[22px] h-[24px] bg-[url('@/assets/images/role/6.png')] bg-[length:100%_100%] bg-no-repeat"></div>
</div>
<div class="texts">
<h6 class="text-[#333]">1212</h6>
<p class="text">今日渠道订单</p>
</div>
</div>
<el-tooltip effect="light" <el-tooltip effect="light"
content="退出实训" content="退出实训"
placement="bottom"> placement="bottom">
@ -26,9 +65,9 @@
<div class="role top-[310px] left-[340px] bg-[url('@/assets/images/role/product.png')] hover:bg-[url('@/assets/images/role/product1.png')]" <div class="role top-[310px] left-[340px] bg-[url('@/assets/images/role/product.png')] hover:bg-[url('@/assets/images/role/product1.png')]"
@click="selecRole(41)"></div> @click="selecRole(41)"></div>
<div class="role top-[220px] left-[490px] bg-[url('@/assets/images/role/committee.png')] hover:bg-[url('@/assets/images/role/committee1.png')]" <div class="role top-[220px] left-[490px] bg-[url('@/assets/images/role/committee.png')] hover:bg-[url('@/assets/images/role/committee1.png')]"
@click="selecRole(42)"></div>
<div class="role top-[140px] left-[630px] bg-[url('@/assets/images/role/riskControl.png')] hover:bg-[url('@/assets/images/role/riskControl1.png')]"
@click="selecRole(43)"></div> @click="selecRole(43)"></div>
<div class="role top-[140px] left-[630px] bg-[url('@/assets/images/role/riskControl.png')] hover:bg-[url('@/assets/images/role/riskControl1.png')]"
@click="selecRole(42)"></div>
</div> </div>
<div class="fixed top-[80px] right-[80px]"> <div class="fixed top-[80px] right-[80px]">
<div class="flex items-center h-[60px] px-4 rounded-tl-[20px] rounded-tr-[20px]" <div class="flex items-center h-[60px] px-4 rounded-tl-[20px] rounded-tr-[20px]"
@ -209,4 +248,13 @@ onMounted(() => {
.role { .role {
@apply absolute w-[172px] h-[48px] bg-[length:100%_100%] bg-no-repeat cursor-pointer transition; @apply absolute w-[172px] h-[48px] bg-[length:100%_100%] bg-no-repeat cursor-pointer transition;
} }
.stat {
@apply inline-flex items-center mr-8;
.texts {
@apply ml-2;
}
.text {
@apply text-xs text-[#666];
}
}
</style> </style>

@ -449,10 +449,10 @@ const submit = async (formEl: FormInstance | undefined) => {
param.id = id.value; param.id = id.value;
param.status = 295; param.status = 295;
await update(param); await update(param);
addRecord(param, id.value); addRecord(param);
} else { } else {
const { message } = await save(param); await save(param);
addRecord(param, message); addRecord(param);
} }
ElMessage.success('提交成功!'); ElMessage.success('提交成功!');
emit('getList', 1); emit('getList', 1);
@ -464,9 +464,9 @@ const submit = async (formEl: FormInstance | undefined) => {
}); });
}; };
// //
const addRecord = async (data: Record<string, any>, newId: number) => { const addRecord = async (data: Record<string, any>) => {
const isEnterprise = data.productType === 1; const isEnterprise = data.productType === 1;
const preIds = `1,${Cookies.get('sand-level')},41,${data.productType ? 45 : 44},${newId}`; // 1id/44/45 const preIds = `1,${Cookies.get('sand-level')},41,${data.productType ? 45 : 44}`; // 1id/44/45
const lcRule = <Record<string, any>[]>[ const lcRule = <Record<string, any>[]>[
handleId(48, 1, data.productDefinition, preIds + ',48', 3), handleId(48, 1, data.productDefinition, preIds + ',48', 3),
handleId(49, 2, data.productName, preIds + ',49', 3), handleId(49, 2, data.productName, preIds + ',49', 3),

@ -115,8 +115,7 @@ const handleDelete = async (id: number) => {
} }
.products { .products {
li { li {
@apply relative p-5 pt-7 mb-5 rounded-[10px] cursor-pointer border border-solid; @apply relative p-5 pt-7 mb-5 rounded-[10px] cursor-pointer border border-solid border-[transparent] bg-[url('@/assets/images/10.png')] bg-no-repeat;
background: url(../../assets/images/10.png) 0 0/100% 100% no-repeat;
&.active { &.active {
@apply border-[#CAE0FF]; @apply border-[#CAE0FF];
} }

@ -530,10 +530,10 @@ const submit = async (formEl: FormInstance | undefined) => {
if (info.value.riskControlDetails) { if (info.value.riskControlDetails) {
param.id = info.value.riskControlDetails.id; param.id = info.value.riskControlDetails.id;
await riskUpdate(param); await riskUpdate(param);
addRecord(param, id.value); addRecord(param);
} else { } else {
const { message } = await riskSave(param); await riskSave(param);
addRecord(param, message); addRecord(param);
} }
ElMessage.success('提交成功!'); ElMessage.success('提交成功!');
@ -546,9 +546,9 @@ const submit = async (formEl: FormInstance | undefined) => {
}); });
}; };
// //
const addRecord = async (data: Record<string, any>, newId: number) => { const addRecord = async (data: Record<string, any>) => {
const isEnterprise = info.value.productType === 1; const isEnterprise = info.value.productType === 1;
const preIds = `1,${Cookies.get('sand-level')},42,${data.productType ? 71 : 70},${newId}`; // 1id/70/71 const preIds = `1,${Cookies.get('sand-level')},42,${data.productType ? 71 : 70}`; // 1id/70/71
const lcRule = <Record<string, any>[]>[]; const lcRule = <Record<string, any>[]>[];
// //

@ -122,12 +122,13 @@ import { useRouter, useRoute } from 'vue-router';
import { handleId } from '@/utils/common'; import { handleId } from '@/utils/common';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
const emit = defineEmits(['getList']);
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const id = computed(() => +route.query.id); const id = computed(() => +route.query.id);
const form = ref<Record<string, any>[]>([]); const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const height = window.innerHeight - 270; const height = window.innerHeight - 270;
const symbols = <Record<string, any>[]>[ const symbols = <Record<string, any>[]>[
{ {
@ -151,28 +152,39 @@ const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(150); const { process } = await getProcessInformationBasedOnRoles(150);
const result = []; const result = [];
process.map((e) => { process.map((e) => {
const cur = info.value.find((n) => n.stRecordId === e.id);
let num = cur?.ruleOne.match(/\d+/g);
let symbol = cur?.ruleOne.match(/[<>=]+/g);
let had = cur?.ruleOne.match(/[有无]+/g);
let temp = { let temp = {
checkpointId: 1, checkpointId: Cookies.get('sand-level'),
projectId: 1, projectId: Cookies.get('sand-projectId'),
name: e.name, name: e.name,
recordChildren: e.recordChildren, recordChildren: e.recordChildren,
isRule: isRule(e.id) ? 1 : 0, isRule: isRule(e.id) ? 1 : 0,
corporateMajorityHitRejected: false, corporateMajorityHitRejected: !!cur?.corporateMajorityHitRejected,
mateHitRejected: false, mateHitRejected: !!cur?.mateHitRejected,
otherFamilyMembersHitRejected: false, otherFamilyMembersHitRejected: !!cur?.otherFamilyMembersHitRejected,
parentsHitRejected: false, parentsHitRejected: !!cur?.parentsHitRejected,
personalHitBlacklist: false, personalHitBlacklist: !!cur?.personalHitBlacklist,
symbol: '>=', symbol: isRule(e.id) ? symbol[0] : '>=',
had: '', had: e.id === 167 && had.length ? had[0] : '',
num: '', num: isRule(e.id) && num?.length ? num[0] : '',
ruleOne: '', ruleOne: '',
ruleTwo: '', ruleTwo: '',
subjectId: e.subjectId,
stRecordId: e.id, stRecordId: e.id,
}; };
result.push(temp); result.push(temp);
if (isRule(e.id)) { if (isRule(e.id)) {
temp = JSON.parse(JSON.stringify(temp)); temp = JSON.parse(JSON.stringify(temp));
temp.span = 1; temp.span = 1;
num = cur?.ruleTwo.match(/\d+/g);
if (num?.length) temp.num = num[0];
symbol = cur?.ruleTwo.match(/[<>=]+/g);
if (symbol?.length) temp.symbol = symbol[0];
if (e.id === 167) temp.had = cur?.ruleTwo;
result.push(temp); result.push(temp);
} }
}); });
@ -182,18 +194,18 @@ const getConfig = async () => {
const getDetail = async () => { const getDetail = async () => {
if (id.value) { if (id.value) {
try { try {
const { data } = await accessStrategyGovernmentBlacklistFind(1, 1); const { data } = await accessStrategyGovernmentBlacklistFind(levelId, projectId);
// info.value = data; info.value = data;
getConfig(); getConfig();
} finally { } finally {
} }
} }
}; };
watch( watch(
() => route.query, () => route.query,
() => { () => {
// getDetail(); getDetail();
getConfig();
}, },
{ {
immediate: true, immediate: true,
@ -226,11 +238,11 @@ const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
} }
} }
}; };
onMounted(() => {});
// //
const submit = async () => { const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value)); let param = JSON.parse(JSON.stringify(form.value));
param.map((e, i) => { param.map((e, i) => {
if (info.value.length) e.id = info.value.find((n) => n.stRecordId === e.stRecordId)?.id;
e.corporateMajorityHitRejected = +e.corporateMajorityHitRejected; e.corporateMajorityHitRejected = +e.corporateMajorityHitRejected;
e.mateHitRejected = +e.mateHitRejected; e.mateHitRejected = +e.mateHitRejected;
e.otherFamilyMembersHitRejected = +e.otherFamilyMembersHitRejected; e.otherFamilyMembersHitRejected = +e.otherFamilyMembersHitRejected;
@ -256,22 +268,25 @@ const submit = async () => {
const recordParam = JSON.parse(JSON.stringify(param)); const recordParam = JSON.parse(JSON.stringify(param));
param.map((e) => { param.map((e) => {
delete e.recordChildren; delete e.recordChildren;
delete e.had;
delete e.name;
delete e.symbol;
delete e.num;
}); });
const { message } = await accessStrategyGovernmentBlacklistSave(recordParam); await accessStrategyGovernmentBlacklistSave({ governmentBlacklistList: param });
// addRecord(param, message); addRecord(recordParam);
getDetail();
ElMessage.success('提交成功!'); ElMessage.success('提交成功!');
emit('getList', 1);
}; };
// //
const addRecord = async (data: Record<string, any>, newId: number) => { const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,${newId}`; // 1id const preIds = `1,${Cookies.get('sand-level')},42,67,147,150`; // 1id
const rule = <Record<string, any>[]>[]; const rule = <Record<string, any>[]>[];
data.map((e, i) => { data.map((e, i) => {
if (e.stRecordId == 161 || e.stRecordId == 164) { if (isRule(e.stRecordId)) {
e.recordChildren.map((n, j) => { e?.recordChildren.map((n, j) => {
rule.push(handleId(n.id, e.subjectId, j ? e.ruleTwo : e.ruleOne, preIds + ',' + e.id + ',' + n.id, 5)); rule.push(handleId(n.id, e.subjectId, j ? e.ruleTwo : e.ruleOne, preIds + ',' + e.stRecordId + ',' + n.id, 5));
}); });
} }
@ -281,13 +296,13 @@ const addRecord = async (data: Record<string, any>, newId: number) => {
e.parentsHitRejected && temp.push(302); e.parentsHitRejected && temp.push(302);
e.otherFamilyMembersHitRejected && temp.push(303); e.otherFamilyMembersHitRejected && temp.push(303);
e.corporateMajorityHitRejected && temp.push(304); e.corporateMajorityHitRejected && temp.push(304);
rule.push(handleId(e.id, e.subjectId, temp.join(), preIds + ',' + e.id, 1)); rule.push(handleId(e.stRecordId, e.subjectId, temp.join(), preIds + ',' + e.stRecordId, 1));
}); });
await addOperation({ await addOperation({
parentId: preIds, parentId: preIds,
lcJudgmentRuleReq: rule, lcJudgmentRuleReq: rule,
projectId: 1, projectId,
}); });
}; };
</script> </script>

@ -86,19 +86,19 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watch, onMounted } from 'vue'; import { ref, computed, watch, onMounted } from 'vue';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { accessStrategyGovernmentBlacklistFind, accessStrategyGovernmentBlacklistSave } from '@/api/model'; import { accessStrategyGovernmentBlacklistFind, accessStrategyCreditBlacklistSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus'; import type { TableColumnCtx } from 'element-plus';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { handleId } from '@/utils/common'; import { handleId } from '@/utils/common';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
const emit = defineEmits(['getList']);
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const id = computed(() => +route.query.id); const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const form = ref<Record<string, any>[]>([]); const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const height = window.innerHeight - 270; const height = window.innerHeight - 270;
const symbols = <Record<string, any>[]>[ const symbols = <Record<string, any>[]>[
{ {
@ -119,31 +119,38 @@ const symbols = <Record<string, any>[]>[
]; ];
// //
const getConfig = async () => { const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(150); const { process } = await getProcessInformationBasedOnRoles(151);
const result = []; const result = [];
process.map((e) => { process.map((e) => {
const cur = info.value.find((n) => n.stRecordId === e.id);
let num = cur?.ruleOne.match(/\d+/g);
let symbol = cur?.ruleOne.match(/[<>=]+/g);
let had = cur?.ruleOne.match(/[有无]+/g);
let temp = { let temp = {
checkpointId: 1, checkpointId: Cookies.get('sand-level'),
projectId: 1, projectId: Cookies.get('sand-projectId'),
name: e.name, name: e.name,
recordChildren: e.recordChildren, recordChildren: e.recordChildren,
isRule: isRule(e.id) ? 1 : 0, isRule: isRule(e.id) ? 1 : 0,
corporateMajorityHitRejected: false, mateRejectedStandardIdentity: !!cur?.mateRejectedStandardIdentity,
mateHitRejected: false, symbol: isRule(e.id) ? symbol[0] : '>=',
otherFamilyMembersHitRejected: false, had: e.id === 167 && had.length ? had[0] : '',
parentsHitRejected: false, num: isRule(e.id) && num?.length ? num[0] : '',
personalHitBlacklist: false,
symbol: '>=',
had: '',
num: '',
ruleOne: '', ruleOne: '',
ruleTwo: '', ruleTwo: '',
subjectId: e.subjectId,
stRecordId: e.id, stRecordId: e.id,
}; };
result.push(temp); result.push(temp);
if (isRule(e.id)) { if (isRule(e.id)) {
temp = JSON.parse(JSON.stringify(temp)); temp = JSON.parse(JSON.stringify(temp));
temp.span = 1; temp.span = 1;
num = cur?.ruleTwo.match(/\d+/g);
if (num?.length) temp.num = num[0];
symbol = cur?.ruleTwo.match(/[<>=]+/g);
if (symbol?.length) temp.symbol = symbol[0];
if (e.id === 167) temp.had = cur?.ruleTwo;
result.push(temp); result.push(temp);
} }
}); });
@ -153,18 +160,18 @@ const getConfig = async () => {
const getDetail = async () => { const getDetail = async () => {
if (id.value) { if (id.value) {
try { try {
const { data } = await accessStrategyGovernmentBlacklistFind(1, 1); const { data } = await accessStrategyGovernmentBlacklistFind(levelId, projectId);
// info.value = data; info.value = data;
getConfig(); getConfig();
} finally { } finally {
} }
} }
}; };
watch( watch(
() => route.query, () => route.query,
() => { () => {
// getDetail(); getDetail();
getConfig();
}, },
{ {
immediate: true, immediate: true,
@ -181,16 +188,12 @@ interface SpanMethodProps {
rowIndex: number; rowIndex: number;
columnIndex: number; columnIndex: number;
} }
onMounted(() => {});
// //
const submit = async () => { const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value)); let param = JSON.parse(JSON.stringify(form.value));
param.map((e, i) => { param.map((e, i) => {
e.corporateMajorityHitRejected = +e.corporateMajorityHitRejected; if (info.value.length) e.id = info.value.find((n) => n.stRecordId === e.stRecordId)?.id;
e.mateHitRejected = +e.mateHitRejected; e.mateRejectedStandardIdentity = +e.mateRejectedStandardIdentity;
e.otherFamilyMembersHitRejected = +e.otherFamilyMembersHitRejected;
e.parentsHitRejected = +e.parentsHitRejected;
e.personalHitBlacklist = +e.personalHitBlacklist;
if (e.stRecordId == 161 || e.stRecordId == 164) { if (e.stRecordId == 161 || e.stRecordId == 164) {
if (e.span) { if (e.span) {
// //
@ -211,38 +214,37 @@ const submit = async () => {
const recordParam = JSON.parse(JSON.stringify(param)); const recordParam = JSON.parse(JSON.stringify(param));
param.map((e) => { param.map((e) => {
delete e.recordChildren; delete e.recordChildren;
delete e.had;
delete e.name;
delete e.symbol;
delete e.num;
}); });
const { message } = await accessStrategyGovernmentBlacklistSave(recordParam); await accessStrategyCreditBlacklistSave({ creditBlacklistList: param });
// addRecord(param, message); addRecord(recordParam);
getDetail();
ElMessage.success('提交成功!'); ElMessage.success('提交成功!');
emit('getList', 1);
}; };
// //
const addRecord = async (data: Record<string, any>, newId: number) => { const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,${newId}`; // 1id const preIds = `1,${Cookies.get('sand-level')},42,67,147,151`; // 1id
const rule = <Record<string, any>[]>[]; const rule = <Record<string, any>[]>[];
data.map((e, i) => { data.map((e, i) => {
if (e.stRecordId == 161 || e.stRecordId == 164) { if (isRule(e.stRecordId)) {
e.recordChildren.map((n, j) => { e?.recordChildren.map((n, j) => {
rule.push(handleId(n.id, e.subjectId, j ? e.ruleTwo : e.ruleOne, preIds + ',' + e.id + ',' + n.id, 5)); rule.push(handleId(n.id, e.subjectId, j ? e.ruleTwo : e.ruleOne, preIds + ',' + e.stRecordId + ',' + n.id, 5));
}); });
} }
const temp = []; const temp = [];
e.personalHitBlacklist && temp.push(300); e.personalHitBlacklist && temp.push(300);
e.mateHitRejected && temp.push(301); rule.push(handleId(e.stRecordId, e.subjectId, temp.join(), preIds + ',' + e.stRecordId, 1));
e.parentsHitRejected && temp.push(302);
e.otherFamilyMembersHitRejected && temp.push(303);
e.corporateMajorityHitRejected && temp.push(304);
rule.push(handleId(e.id, e.subjectId, temp.join(), preIds + ',' + e.id, 1));
}); });
await addOperation({ await addOperation({
parentId: preIds, parentId: preIds,
lcJudgmentRuleReq: rule, lcJudgmentRuleReq: rule,
projectId: 1, projectId,
}); });
}; };
</script> </script>

@ -18,8 +18,7 @@
</ul> </ul>
</div> </div>
<div class="right flex-1 px-5 pt-2"> <div class="right flex-1 px-5 pt-2">
<component :is="defineAsyncComponent(() => import('./' + id + '.vue'))" <component :is="defineAsyncComponent(() => import('./' + id + '.vue'))"></component>
@getList="getList"></component>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -96,8 +95,7 @@ const tabChange = (tab: TabsPaneContext, event: Event) => {
} }
.products { .products {
li { li {
@apply relative p-5 mb-5 rounded-[10px] cursor-pointer border border-solid; @apply relative p-5 pt-7 mb-5 rounded-[10px] cursor-pointer border border-solid border-[transparent] bg-[url('@/assets/images/10.png')] bg-[length:100%_100%] bg-no-repeat;
background: url(../../assets/images/10.png) 0 0/100% 100% no-repeat;
&.active { &.active {
@apply border-[#CAE0FF]; @apply border-[#CAE0FF];
} }

Loading…
Cancel
Save