实验面板拖拽等

V0.1
yujialong 1 year ago
parent 6660dff502
commit 4db0b6b293
  1. 4
      .env
  2. 57
      src/components/Panel/index.vue
  3. 6
      src/views/Home.vue
  4. 4
      src/views/product/bank/Add.vue
  5. 27
      src/views/product/bank/CardList.vue
  6. 7
      src/views/product/bank/List.vue
  7. 1
      src/views/product/insurance/Add.vue
  8. 26
      src/views/product/insurance/CardList.vue
  9. 12
      src/views/product/insurance/List.vue
  10. 2
      src/views/product/interestRate/CardList.vue
  11. 4
      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.51: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

@ -1,7 +1,19 @@
<template> <template>
<!-- <Draggable
v-slot="{ x, y }"
p="x-4 y-2"
border="~ gray-400/30 rounded"
shadow="~ hover:lg"
class="fixed bg-$vp-c-bg select-none z-24"
:initial-value="{ x: innerWidth / 3.6, y: 240 }"
:prevent-default="true"
:handle="handle"
> -->
<div v-if="!hidePanel" <div v-if="!hidePanel"
:class="['panel', { active: visible }]" :class="['panel', { active: visible }]"
id="panel"> id="panel"
ref="container"
:style="style">
<el-container class="scrollbar" <el-container class="scrollbar"
id="container" id="container"
v-show="visible"> v-show="visible">
@ -203,15 +215,24 @@
</el-container> </el-container>
</el-container> </el-container>
<div class="toggle-panel absolute w-[40px] h-[175px] bg-[url('@/assets/images/panel/right.png')] bg-[length:100%_100%] bg-no-repeat cursor-pointer" <div :class="['toggle absolute top-[200px] text-center', visible ? 'top-[35%] left-[100%]' : '']">
<el-icon class="cursor-pointer"
color="#f1772b"
:size="24">
<Rank id="toggle" />
</el-icon>
<div class="toggle-panel w-[40px] h-[175px] bg-[length:100%_100%] bg-no-repeat cursor-pointer"
:class="{ active: visible }" :class="{ active: visible }"
ref="handle"
@click="visible = !visible"></div> @click="visible = !visible"></div>
</div> </div>
</div>
<!-- </Draggable> -->
<div v-if="isSubmit && !isReport" <div v-if="isSubmit && !isReport"
class="z-[199] fixed top-[64px] right-0 bottom-0 left-0 bg-[rgba(0,0,0,.3)]"></div> class="z-[199] fixed top-[64px] right-0 bottom-0 left-0 bg-[rgba(0,0,0,.3)]"></div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted, toRefs, computed, watch } from 'vue'; import { ref, reactive, onMounted, inject, computed, watch } from 'vue';
import { submitOpe } from '@/api/bank'; import { submitOpe } from '@/api/bank';
import { deleteCache } from '@/api/judgment'; import { deleteCache } from '@/api/judgment';
import { pageStuAssessment, getProjectBySystemId, getProjectDetail, getDetailById, getCompetition } from '@/api/system'; import { pageStuAssessment, getProjectBySystemId, getProjectDetail, getDetailById, getCompetition } from '@/api/system';
@ -219,12 +240,13 @@ import Settings from '@/settings';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import type { Action } from 'element-plus'; import type { Action } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import { Close, Check } from '@element-plus/icons-vue'; import { Close, Check, Rank } from '@element-plus/icons-vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { mavonEditor } from 'mavon-editor'; import { mavonEditor } from 'mavon-editor';
import 'mavon-editor/dist/css/index.css'; import 'mavon-editor/dist/css/index.css';
import '@vueup/vue-quill/dist/vue-quill.snow.css'; import '@vueup/vue-quill/dist/vue-quill.snow.css';
import { useDraggable } from '@vueuse/core';
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
@ -254,6 +276,20 @@ const pannelTab = ref<string>('first');
const statusTimer = ref<any>(null); const statusTimer = ref<any>(null);
const reportId = ref<string | number>(''); const reportId = ref<string | number>('');
const countVal = ref<any>(''); const countVal = ref<any>('');
const getLevel = ref();
const container = ref<HTMLElement | null>(null);
const handle = ref<HTMLElement | null>(null);
//
const { x, y, style } = useDraggable(container, {
initialValue: { x: 0, y: 200 },
stopPropagation: true,
// exact: true,
handle: handle.value,
onStart(position, e) {
const { id } = e.target;
if (id !== 'panelHeader' && id !== 'toggle') return false;
},
});
if (param.token) { if (param.token) {
// urlcookiecookie // urlcookiecookie
@ -404,11 +440,19 @@ const getCompetitionStatus = async () => {
}; };
// //
const selectProject = () => { const selectProject = () => {
Cookies.set('sand-projectId', param.projectId);
getProDetail(); getProDetail();
setSubmit(false); setSubmit(false);
countVal.value = 0; countVal.value = 0;
grade.value = '00'; grade.value = '00';
pannelTab.value = 'first'; pannelTab.value = 'first';
reload();
//
if (route.path === '/') {
location.reload();
} else {
getLevel.value && getLevel.value();
}
}; };
// //
const toReport = () => { const toReport = () => {
@ -539,6 +583,7 @@ const getList = async () => {
getProDetail(); getProDetail();
}; };
onMounted(() => { onMounted(() => {
getLevel.value = inject('getLevel'); //
per.value = param.assessmentId ? 1 : param.competitionId ? 2 : 0; per.value = param.assessmentId ? 1 : param.competitionId ? 2 : 0;
if (param.assessmentId) { if (param.assessmentId) {
getAssList(); getAssList();
@ -747,9 +792,9 @@ onMounted(() => {
width: 0; width: 0;
height: 0; height: 0;
.toggle-panel { .toggle-panel {
@apply top-[200px]; @apply bg-[url('@/assets/images/panel/right.png')];
&.active { &.active {
@apply top-[35%] left-[100%] bg-[url('@/assets/images/panel/left.png')]; @apply bg-[url('@/assets/images/panel/left.png')];
} }
} }
&.active { &.active {

@ -1,6 +1,6 @@
<template> <template>
<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>金融产品设计及数字化营销沙盘系统{{ projectId }}</h1>
<div class="inline-flex items-center"> <div class="inline-flex items-center">
<el-tooltip effect="light" <el-tooltip effect="light"
content="退出实训" content="退出实训"
@ -65,7 +65,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted, provide } from 'vue';
import { cancelCollection, collect } from '@/api/bank'; import { cancelCollection, collect } from '@/api/bank';
import { checkPointListByStu } from '@/api/config'; import { checkPointListByStu } from '@/api/config';
import Panel from '@/components/Panel/index.vue'; import Panel from '@/components/Panel/index.vue';
@ -81,13 +81,13 @@ 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') ?? route.query.projectId; const projectId = Cookies.get('sand-projectId') ?? route.query.projectId;
const step = 150;
// //
const getLevel = async (only: any = '') => { const getLevel = async (only: any = '') => {
if (only) collected.value = !collected.value; if (only) collected.value = !collected.value;
const { data } = await checkPointListByStu(+projectId, collected.value ? 1 : ''); const { data } = await checkPointListByStu(+projectId, collected.value ? 1 : '');
levels.value = data; levels.value = data;
}; };
provide('getLevel', getLevel);
// //
const selecLevel = (item: Record<string, any>) => { const selecLevel = (item: Record<string, any>) => {
curLevel.value = item.checkpointId; curLevel.value = item.checkpointId;

@ -424,6 +424,10 @@ const submit = async (formEl: FormInstance | undefined) => {
await save(param); await save(param);
addRecord(param); addRecord(param);
} }
router.push({
path: '/product/bank/detail',
query: route.query,
});
ElMessage.success('提交成功!'); ElMessage.success('提交成功!');
emit('getList', 1); emit('getList', 1);
} finally { } finally {

@ -22,7 +22,7 @@
<li v-for="(item, i) in list" <li v-for="(item, i) in list"
:key="i" :key="i"
:class="{ active: item.id === id }" :class="{ active: item.id === id }"
@click="switchProduct(item.id)"> @click="switchProduct('/product/bank/detail', item.id)">
<el-popconfirm title="您确定删除吗?" <el-popconfirm title="您确定删除吗?"
@confirm="handleDelete(item.id)"> @confirm="handleDelete(item.id)">
<template #reference> <template #reference>
@ -69,6 +69,7 @@ import Cookies from 'js-cookie';
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const action = ref<any>(''); const action = ref<any>('');
const name = route.query.name ?? '';
const projectId = +Cookies.get('sand-projectId'); const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level'); const levelId = +Cookies.get('sand-level');
@ -80,12 +81,20 @@ const productType = computed(() => route.query.type); // 个人/企业
const role = computed(() => +route.query.role || 41); const role = computed(() => +route.query.role || 41);
const id = computed(() => +route.query.id); const id = computed(() => +route.query.id);
// //
const getList = async (first: any) => { const getList = async () => {
loading.value = true; loading.value = true;
try { try {
const { data } = await bankingProductsList({ pageNum: 1, pageSize: 1000, productType: productType.value, checkPointId: levelId, projectId }); const { data } = await bankingProductsList({
pageNum: 1,
pageSize: 1000,
productType: productType.value,
checkPointId: levelId,
projectId,
roleId: route.query.role,
keyWord: name,
});
list.value = data.message.records; list.value = data.message.records;
first && list.value.length && switchProduct(list.value[0].id); route.path !== '/product/bank/add' && list.value.length && !id.value && switchProduct(route.path, list.value[0].id);
} finally { } finally {
loading.value = false; loading.value = false;
} }
@ -104,20 +113,20 @@ watch(
}, },
); );
// //
const switchProduct = (id: number) => { const switchProduct = (path: string, bankId?: number) => {
router.push(`/product/bank/detail?type=${route.query.type}&i=${route.query.i}&role=${route.query.role}&id=${id}`); router.push(`${path}?type=${route.query.type || ''}&i=${route.query.i}&role=${route.query.role}&id=${bankId}&name=${name}`);
}; };
// //
const toAdd = () => { const toAdd = () => {
router.push(`/product/bank/add?type=${route.query.type}&i=${route.query.i}&role=${route.query.role}`); router.push(`/product/bank/add?type=${route.query.type || ''}&i=${route.query.i}&role=${route.query.role}`);
}; };
// //
const toList = () => { const toList = () => {
router.push(`/product/bank?type=${route.query.type}&i=${route.query.i}&role=${route.query.role}`); router.push(`/product/bank?type=${route.query.type || ''}&i=${route.query.i}&role=${route.query.role}`);
}; };
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
await batchDeletion([id]); await batchDeletion([id]);
getList(1); getList();
ElMessage.success('删除成功!'); ElMessage.success('删除成功!');
}; };
</script> </script>

@ -210,14 +210,11 @@ const toAdd = () => {
}; };
// //
const toDetail = async (path: string, id: number) => { const toDetail = async (path: string, id: number) => {
router.push(`${path}?type=${params.productType}&i=${route.query.i}&role=${route.query.role}&id=${id}`); router.push(`${path}?type=${params.productType}&i=${route.query.i}&role=${route.query.role}&id=${id}&name=${params.keyWord}`);
}; };
// //
const toCardList = () => { const toCardList = () => {
router.push({ router.push(`/product/bank/detail?type=${params.productType}&i=${route.query.i}&role=${route.query.role}&name=${params.keyWord}`);
path: '/product/bank/config',
query: route.query,
});
}; };
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {

@ -187,6 +187,7 @@ const submit = async () => {
sumInsured: +e.sumInsured, sumInsured: +e.sumInsured,
}); });
}); });
if (param.premiumAmount && !isNaN(param.premiumAmount)) param.premiumAmount = Number(param.premiumAmount).toFixed(2);
param.applicationMaterial = param.applicationMaterial.join(); param.applicationMaterial = param.applicationMaterial.join();
param.exemptionFromLiability = param.exemptionFromLiability.join(); param.exemptionFromLiability = param.exemptionFromLiability.join();
await addInsuranceProducts(param); await addInsuranceProducts(param);

@ -2,8 +2,7 @@
<div class="block flex" <div class="block flex"
style="padding-top: 0"> style="padding-top: 0">
<div class="left w-[241px] min-w-[241px] pr-5 py-4"> <div class="left w-[241px] min-w-[241px] pr-5 py-4">
<div v-if="role == 41" <div class="flex justify-center items-center py-2 mb-3 text-sm text-[#006BFF] bg-[rgba(0,107,255,0.1)] border border-solid border-[#006BFF] rounded-[10px] cursor-pointer"
class="flex justify-center items-center py-2 mb-3 text-sm text-[#006BFF] bg-[rgba(0,107,255,0.1)] border border-solid border-[#006BFF] rounded-[10px] cursor-pointer"
@click="toAdd"> @click="toAdd">
<el-icon class="mr-1" <el-icon class="mr-1"
:size="16" :size="16"
@ -35,6 +34,8 @@
<h6>{{ item.insuranceName }}</h6> <h6>{{ item.insuranceName }}</h6>
<p v-if="item.minimumAge && item.maximumAge" <p v-if="item.minimumAge && item.maximumAge"
class="type">{{ item.minimumAge + '-' + item.maximumAge + '周岁' }}</p> class="type">{{ item.minimumAge + '-' + item.maximumAge + '周岁' }}</p>
<p v-if="item.insuranceCoverageConfig"
class="type">{{ item.insuranceCoverageConfig }}</p>
<p class="date">创建日期{{ item.createTime.split(' ')[0] }}</p> <p class="date">创建日期{{ item.createTime.split(' ')[0] }}</p>
</li> </li>
</ul> </ul>
@ -48,7 +49,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, onMounted, ref, watch, defineAsyncComponent } from 'vue'; import { computed, onMounted, ref, watch } from 'vue';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { Plus } from '@element-plus/icons-vue'; import { Plus } from '@element-plus/icons-vue';
import { insuranceList, batchDeletion } from '@/api/insurance'; import { insuranceList, batchDeletion } from '@/api/insurance';
@ -60,21 +61,20 @@ import Cookies from 'js-cookie';
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const action = ref<any>(''); const action = ref<any>('');
const name = route.query.name ?? '';
const projectId = +Cookies.get('sand-projectId'); const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level'); const levelId = +Cookies.get('sand-level');
const list = ref<Array<any>>([]); const list = ref<Array<any>>([]);
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
const productType = computed(() => route.query.type); // /
const role = computed(() => +route.query.role || 41);
const id = computed(() => +route.query.id); const id = computed(() => +route.query.id);
// //
const getList = async (first: any) => { const getList = async () => {
loading.value = true; loading.value = true;
try { try {
const { data } = await insuranceList({ pageNum: 1, pageSize: 1000, checkPointId: levelId, projectId }); const { data } = await insuranceList({ pageNum: 1, pageSize: 1000, checkPointId: levelId, projectId, insuranceName: name });
list.value = data.records; list.value = data.records;
first && list.value.length && switchProduct(list.value[0].insuranceId); route.path !== '/product/insurance/add' && list.value.length && !id.value && switchProduct(list.value[0].insuranceId);
} finally { } finally {
loading.value = false; loading.value = false;
} }
@ -93,8 +93,8 @@ watch(
}, },
); );
// //
const switchProduct = (id: number) => { const switchProduct = (insId: number) => {
router.push(`/product/insurance/detail?id=` + id); router.push(`/product/insurance/detail?id=` + insId);
}; };
// //
const toAdd = () => { const toAdd = () => {
@ -104,8 +104,8 @@ const toAdd = () => {
const toList = () => { const toList = () => {
router.push(`/product/insurance`); router.push(`/product/insurance`);
}; };
const handleDelete = async (id: number) => { const handleDelete = async (insId: number) => {
await batchDeletion([id]); await batchDeletion([insId]);
getList(1); getList(1);
ElMessage.success('删除成功!'); ElMessage.success('删除成功!');
}; };
@ -134,7 +134,7 @@ const handleDelete = async (id: number) => {
@apply my-[15px] text-sm text-[#333]; @apply my-[15px] text-sm text-[#333];
} }
.date { .date {
@apply text-sm text-[#8798a9]; @apply mt-[15px] text-sm text-[#8798a9];
} }
} }
</style> </style>

@ -66,7 +66,7 @@
label="保费金额(元)" label="保费金额(元)"
min-width="120"> min-width="120">
<template #default="{ row }"> <template #default="{ row }">
{{ row.premiumAmount || '-' }} {{ row.premiumAmount?.toFixed(2) || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" <el-table-column prop="createTime"
@ -110,7 +110,6 @@ import { insuranceList, batchDeletion } from '@/api/insurance';
import Search from '@/components/Search.vue'; import Search from '@/components/Search.vue';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { productState, getExpertStatus, getStatus } from '@/store/useProduct';
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
@ -173,16 +172,11 @@ const toAdd = () => {
}; };
// //
const toDetail = async (path: string, id: number) => { const toDetail = async (path: string, id: number) => {
router.push({ router.push(`${path}?id=${id}&name=${params.insuranceName}`);
path,
query: {
id,
},
});
}; };
// //
const toCardList = () => { const toCardList = () => {
router.push('/product/insurance/detail'); router.push(`/product/insurance/detail?name=${params.insuranceName}`);
}; };
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {

@ -71,7 +71,7 @@ const switchProduct = (productId: number | string) => {
router.push(`/product/interestRate/${route.params.action}?i=3&role=42&id=${productId}`); router.push(`/product/interestRate/${route.params.action}?i=3&role=42&id=${productId}`);
}; };
// //
const getList = async (refresh?: number) => { const getList = async () => {
const { process } = await getProcessInformationBasedOnRoles(68); const { process } = await getProcessInformationBasedOnRoles(68);
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
!id.value && switchProduct(process[curTab.value === 'tab1' ? 0 : 1].recordChildren[0].id); !id.value && switchProduct(process[curTab.value === 'tab1' ? 0 : 1].recordChildren[0].id);

@ -124,11 +124,11 @@ const riskId = ref<number>(702);
// //
const switchProduct = (id: number) => { const switchProduct = (id: number) => {
router.push(`/product/strategy?type=${route.query.type}&i=${route.query.i}&role=${route.query.role}&id=${id}`); router.push(`/product/strategy?&i=${route.query.i}&role=${route.query.role}&id=${id}`);
}; };
// //
const switchProductCredit = (id: number) => { const switchProductCredit = (id: number) => {
router.push(`/product/strategy?type=${route.query.type}&i=${route.query.i}&role=${route.query.role}&creditId=${id}`); router.push(`/product/strategy?&i=${route.query.i}&role=${route.query.role}&creditId=${id}`);
}; };
// //
const switchProductRisk = (id: number) => { const switchProductRisk = (id: number) => {

Loading…
Cancel
Save