From fa7ed6310484790541f1fc29537fd5b32b993e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E9=BE=99?= Date: Thu, 7 Dec 2023 11:39:38 +0800 Subject: [PATCH] update --- src/api/daikin/base.ts | 35 +- src/components/AppHeadUserInfo.vue | 3 + src/router/index.ts | 5 + src/views/home/Home.vue | 16 +- src/views/home/database/guize/index.vue | 32 +- src/views/home/database/modify.vue | 1147 ++++++++++------- .../home/intelligence/components/Layout.vue | 5 +- 7 files changed, 774 insertions(+), 469 deletions(-) diff --git a/src/api/daikin/base.ts b/src/api/daikin/base.ts index 93bbe7f..947bab2 100644 --- a/src/api/daikin/base.ts +++ b/src/api/daikin/base.ts @@ -1315,15 +1315,46 @@ export async function fetchMaterialAddInfo(data?: any){ /** * 查看模块查看范围历史 https://console-docs.apipost.cn/preview/d9d2c859db1009cd/18265d950ad924e4?target_id=4c25a720-44f2-472e-be82-c2eaf41d9a43 - */ +*/ export async function fetchGetViewScope(params?: any){ return http.get(`/common/getViewScope`,{params}) } +/** + * DB添加上传/审核者 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156 +*/ +export async function fetchdbAuthAdd(data?: any){ + return http.post(`/dbAuth/add`,data) +} + +/** + * DB获取上传/审核者信息 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156 +*/ +export async function fetchdbAuthGetInfo(params?: any){ + return http.get(`/dbAuth/getInfo`,{params}) +} +/** + * DB撤回 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156 +*/ +export async function fetchdbWithdraw(params?: any){ + return http.get(`/db/withdraw`,{params}) +} +/** + * DB文件审核 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156 +*/ +export async function fetchdbReview(params?: any){ + return http.get(`/db/review`,{params}) +} +/** + * DB审核列表分页 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156 +*/ +export async function fetchdbReviewFileList(params?: any){ + return http.get(`/dbAuth/reviewFileList`,{params}) +} + - diff --git a/src/components/AppHeadUserInfo.vue b/src/components/AppHeadUserInfo.vue index 6307c5e..9da4271 100644 --- a/src/components/AppHeadUserInfo.vue +++ b/src/components/AppHeadUserInfo.vue @@ -83,6 +83,9 @@ const goModeuls = (obj) => { case 7: push({ name: "Diffspace" }); break; + case 9: + push({ name: "DataBaseReview" }); + break; default: push("/Home/intelligence"); break; diff --git a/src/router/index.ts b/src/router/index.ts index 8b7e187..e89246a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -507,6 +507,11 @@ const router = createRouter({ name: 'DataBase', component: () => import('@/views/home/database/guize/index.vue') }, + { + path: '/DataBase/review', + name: 'DataBaseReview', + component: () => import('@/views/home/database/Process.vue') + }, { path: '/DataBase/Modify', name: 'DataBaseModify', diff --git a/src/views/home/Home.vue b/src/views/home/Home.vue index 7a6cb67..456fe0b 100644 --- a/src/views/home/Home.vue +++ b/src/views/home/Home.vue @@ -31,6 +31,7 @@ const dszList = ref([{}, {}, {}, {}]); const dishList = ref([{}, {}, {}, {}]); const month_1 = ref(); const month_2 = ref(); +const month_3 = ref(); let now = (new Date()).getMonth() + 13; month_2.value = (now - 2) % 12; month_1.value = (now - 1) % 12; @@ -48,6 +49,7 @@ const addDIS3 = ref() const addDISH3 = ref() const timeObj = ref({}) onMounted(async () => { + try{ const { data: { ailist, culist, lastUTime },data } = await homePageMarket() //市况 const { data: { itemList, lastUTime: _lastUTime } } = await homePageRate() //汇率 const { data: _disList } = await getHomeList({number: "DIS"}) //汇率 @@ -72,10 +74,12 @@ onMounted(async () => { itemLists.value = itemList timeA.value = lastUTime timeB.value = _lastUTime - disList.value = _disList dszList.value = _dszList dishList.value = _dishList + month_1.value = _disList[0].monthDate?.split('-')[1] + month_2.value = _dszList[0].monthDate?.split('-')[1] + month_3.value = _dishList[0].monthDate?.split('-')[1] addDIS1.value = _disList.reduce((previousValue: any, currentValue: { budget: any }) => { const sum =parseFloat (currentValue.budget) +parseFloat(previousValue) @@ -85,7 +89,6 @@ onMounted(async () => { addDIS1.value -= _disList[0].budget addDIS1.value >0? addDIS1.value = addDIS1.value.toFixed(2):0 } - console.log("🚀 ~ file: Home.vue:86 ~ addDIS1:", addDIS1) addDSZ1.value = _dszList.reduce((previousValue: any, currentValue: { budget: any }) => { const sum = parseFloat(currentValue.budget) +parseFloat(previousValue) return sum>0 ? sum.toFixed(2):0 @@ -160,6 +163,9 @@ onMounted(async () => { push({ name: 'modifys' }) }) } + }catch (error) { + + } }) const { push } = useRouter() const route = useRoute() @@ -363,7 +369,7 @@ function formatNumber(num = 0) { 年初予算 改订 - {{month_1}}月 + {{+month_1}}月 合计 @@ -418,7 +424,7 @@ function formatNumber(num = 0) { 年初予算 改订 - {{month_1}}月 + {{+month_2}}月 合计 @@ -473,7 +479,7 @@ function formatNumber(num = 0) { 年初予算 改订 - {{month_1}}月 + {{+month_3}}月 合计 diff --git a/src/views/home/database/guize/index.vue b/src/views/home/database/guize/index.vue index 9d52672..7798968 100644 --- a/src/views/home/database/guize/index.vue +++ b/src/views/home/database/guize/index.vue @@ -5,13 +5,13 @@ import { useUserStore } from '@/stores/modules/user' import { useMessage,NModal } from 'naive-ui' const store = useUserStore() const message = useMessage() -const userCode = ['admin','database_dandang','tech_service'].includes(store.user.roleCode) +const userCode = ['admin','database_dandang','tech_service'].includes(store.user.roleCode) || !!store.user?.isDbUpload || !!store.user?.isDbReview const { push } = useRouter(); const title = ref("大金集团经营理念") const prop = defineProps({ - cateId:String, + cateId: Number, title:String }) const pageInfo = reactive({ @@ -56,15 +56,18 @@ async function getTree() { // // message.error('下载文件出错:', error); // } // } -async function downloads(row) { - console.log(row) +async function downloads(row:any) { + console.log(row,'!!!!!!!!!!xiazai') const {isSelect,filePath} = row if(isSelect === 2) { message.info("没有访问权限") return } - - window.open(filePath) + try{ + downloadFile(filePath) + }catch(error){ + window.open(filePath) + } } const lazyState = computed(() => [pageInfo.currentPage]) watch( @@ -121,7 +124,22 @@ function getLastSubstring(str: string): string { return ''; } } - +function downloadFile(url: any) { + fetch(url) + .then((response) => response.blob()) + .then((blob) => { + const downloadUrl = URL.createObjectURL(blob) + const link = document.createElement('a') + link.href = downloadUrl + link.download = getFileName(url) + link.click() + }) +} +function getFileName(url: string) { + let lastSplashIndex = url.lastIndexOf('/') + let lastDotIndex = url.lastIndexOf('.') + return url.slice(lastSplashIndex + 1, lastDotIndex) +}