diff --git a/src/api/bank.ts b/src/api/bank.ts index 0867144..b686e39 100644 --- a/src/api/bank.ts +++ b/src/api/bank.ts @@ -1,5 +1,5 @@ import axios from '@/utils/request'; - +// 银行 export const queryStorageList = async (params?: Record): Promise => (await axios.get('/backend/core/storage', { params })).data; export const queryStorage = async (id: number): Promise => (await axios.get(`/backend/core/storage/${id}`)).data; export const updateStorage = async (data: Record): Promise => (await axios.post('/backend/core/storage?_method=put', data)).data; diff --git a/src/api/finance.ts b/src/api/finance.ts new file mode 100644 index 0000000..af1aa70 --- /dev/null +++ b/src/api/finance.ts @@ -0,0 +1,6 @@ +import axios from '@/utils/request'; +// 金融市场 +export const queryStorage = async (id: number): Promise => (await axios.get(`/backend/core/storage/${id}`)).data; +export const bankingProductMarketsList = async (data: Record): Promise => + (await axios.post('/product/product/bank/products/market/bankingProductMarketsList', data)).data; +export const insuranceMarketList = async (data: Record): Promise => (await axios.post('/product/insurance/products/market/insuranceMarketList', data)).data; diff --git a/src/api/fund.ts b/src/api/fund.ts index 8f5efe9..6c40355 100644 --- a/src/api/fund.ts +++ b/src/api/fund.ts @@ -1,5 +1,5 @@ import axios from '@/utils/request'; -// 保险 +// 基金 export const saveFund = async (data: Record): Promise => (await axios.post('/product/fundProducts/save', data)).data; export const batchDeletion = async (data: number[]): Promise => (await axios.post(`/product/fundProducts/batchDeletion`, data)).data; export const fundProductList = async (data: Record): Promise => (await axios.post(`/product/fundProducts/fundProductList`, data)).data; diff --git a/src/api/system.ts b/src/api/system.ts index d8b0ff3..cada3df 100644 --- a/src/api/system.ts +++ b/src/api/system.ts @@ -15,4 +15,4 @@ export const updateReport = async (data: Record): Promise => ( export const editExperimentalData = async (data: Record): Promise => (await axios.post('/occupationlab/occupationlab/experimentalReport/editExperimentalData', data)).data; export const getStartTime = async (params: Record): Promise => (await axios.get('/python/python/getStartTime', { params })).data; -export const getCurrentTime = async (params: Record): Promise => (await axios.get('/competition/competition/management/getCurrentTime', { params })).data; +export const getCurrentTime = async (): Promise => (await axios.get('/competition/competition/management/getCurrentTime')).data; diff --git a/src/components/Panel/index.vue b/src/components/Panel/index.vue index 858b103..981908e 100644 --- a/src/components/Panel/index.vue +++ b/src/components/Panel/index.vue @@ -225,7 +225,7 @@ import { ref, reactive, onMounted, inject, computed, watch } from 'vue'; import { submitOpe } from '@/api/bank'; import { deleteCache } from '@/api/judgment'; -import { pageStuAssessment, getProjectBySystemId, getProjectDetail, getDetailById, getCompetition, getStartTime, getCurrentTime } from '@/api/system'; +import { pageStuAssessment, getProjectBySystemId, getProjectDetail, getDetailById, getCompetition, getStartTime } from '@/api/system'; import Settings from '@/settings'; import { useRouter, useRoute } from 'vue-router'; import type { Action } from 'element-plus'; @@ -238,7 +238,7 @@ import 'mavon-editor/dist/css/index.css'; import '@vueup/vue-quill/dist/vue-quill.snow.css'; import { useDraggable } from '@vueuse/core'; import { logout } from '@/store/useCurrentUser'; -import { getIds } from '@/utils/common'; +import { getIds, getNow } from '@/utils/common'; const router = useRouter(); const route = useRoute(); @@ -340,7 +340,7 @@ watch( ); // 获取上次实验的时间 -const getSumTime = () => { +const getSumTime = (): Promise => { return new Promise(async (resolve, reject) => { const res = await getStartTime({ permissions: per.value, @@ -349,13 +349,6 @@ const getSumTime = () => { resolve(res.startTime ? new Date(res.startTime) : ''); }); }; -// 获取当前时间 -const getNow = () => { - return new Promise(async (resolve, reject) => { - const res = await getCurrentTime(); - resolve(new Date(res.currentTime)); - }); -}; // 倒计时 const timeFormat = (num: number): string | number => { return num < 10 ? `0${num}` : num; diff --git a/src/layout/components/AppSidebar/index.vue b/src/layout/components/AppSidebar/index.vue index 8f2f56c..869ba0e 100644 --- a/src/layout/components/AppSidebar/index.vue +++ b/src/layout/components/AppSidebar/index.vue @@ -9,11 +9,11 @@

{{ roleName }}

产品部门

- 操作日期:{{ date }} - + @click="dateVisible = true"> -->
@@ -50,13 +50,14 @@ import { getOperationTime, saveOperationTime } from '@/api/config'; import { appState } from '@/store/useAppState'; import Cookies from 'js-cookie'; import dayjs from 'dayjs'; +import { getNow } from '@/utils/common'; const router = useRouter(); const route = useRoute(); const isConfig = computed(() => route.path.startsWith('/config')); const projectId = +Cookies.get('sand-projectId'); const levelId = +Cookies.get('sand-level'); -const date = ref(dayjs(new Date()).format('YYYY-M-D')); +const date = ref(dayjs(new Date()).format('YYYY-MM-DD')); const diaDate = ref(dayjs(new Date()).format('YYYY-M-D')); const dateVisible = ref(false); @@ -86,8 +87,9 @@ const submitDate = async () => { getDate(); dateVisible.value = false; }; -onMounted(() => { - getDate(); +onMounted(async () => { + // getDate(); + date.value = dayjs(await getNow()).format('YYYY-MM-DD'); }); diff --git a/src/router/index.ts b/src/router/index.ts index e0c1d87..6a858f0 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -50,6 +50,8 @@ export const routes: Array = [ meta: { title: '金融市场' }, children: [ { path: 'bank', component: () => import('@/views/finance/Bank.vue'), meta: { title: '银行市场' } }, + { path: 'insurance', component: () => import('@/views/finance/Insurance.vue'), meta: { title: '保险市场' } }, + { path: 'fund', component: () => import('@/views/finance/Fund.vue'), meta: { title: '基金市场' } }, { path: 'publish', component: () => import('@/views/finance/Publish.vue'), meta: { title: '发布' } }, { path: 'account', component: () => import('@/views/finance/Account.vue'), meta: { title: '我的账户' } }, { path: 'order', component: () => import('@/views/finance/Order.vue'), meta: { title: '我的订单' } }, diff --git a/src/utils/common.ts b/src/utils/common.ts index 712ea3b..6ef5682 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -1,4 +1,5 @@ import Cookies from 'js-cookie'; +import { getCurrentTime } from '@/api/system'; const UJCMS_LOCALE = 'ujcms-locale'; const UJCMS_SITE_ID = 'ujcms-site-id'; @@ -241,3 +242,13 @@ export const getIds = (): Record => { competitionId: +Cookies.get('sand-competitionId') || '', }; }; + +/** + * 获取当前时间 + */ +export const getNow = (): Promise => { + return new Promise(async (resolve) => { + const res = await getCurrentTime(); + resolve(new Date(res.currentTime)); + }); +}; diff --git a/src/views/Role.vue b/src/views/Role.vue index 701b56d..0e868a2 100644 --- a/src/views/Role.vue +++ b/src/views/Role.vue @@ -65,8 +65,7 @@ alt="">
-
+
{{ date }}
-
+
+ + + + + + + + diff --git a/src/views/product/afterLoan/1031.vue b/src/views/product/afterLoan/1031.vue index 161702b..3225dbc 100644 --- a/src/views/product/afterLoan/1031.vue +++ b/src/views/product/afterLoan/1031.vue @@ -148,7 +148,7 @@