main
王文龙 2024-01-29 18:02:58 +08:00
parent 14fec77952
commit 4a4ac0c29f
37 changed files with 6944 additions and 4820 deletions

4
components.d.ts vendored
View File

@ -37,6 +37,7 @@ declare module 'vue' {
ElRadio: typeof import('element-plus/es')['ElRadio'] ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect'] ElSelect: typeof import('element-plus/es')['ElSelect']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
@ -50,4 +51,7 @@ declare module 'vue' {
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
Search: typeof import('./src/components/search.vue')['default'] Search: typeof import('./src/components/search.vue')['default']
} }
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
} }

View File

@ -30,6 +30,7 @@
"pinia": "^2.0.32", "pinia": "^2.0.32",
"swiper": "^9.3.2", "swiper": "^9.3.2",
"tinymce": "^6.6.0", "tinymce": "^6.6.0",
"v-scale-screen": "^2.2.0",
"vue": "^3.2.47", "vue": "^3.2.47",
"vue-demi": "^0.14.5", "vue-demi": "^0.14.5",
"vue-echarts": "^6.5.4", "vue-echarts": "^6.5.4",

View File

@ -1,25 +1,29 @@
<script setup lang="ts"> <script setup lang="ts">
import { RouterView } from "vue-router"; import { RouterView } from 'vue-router'
import { useFullscreen, useFavicon, useTitle } from "@vueuse/core"; import { useFullscreen, useFavicon, useTitle } from '@vueuse/core'
import zhCn from 'element-plus/dist/locale/zh-cn' import zhCn from 'element-plus/dist/locale/zh-cn'
import FitScreen from "@fit-screen/vue"; import FitScreen from '@fit-screen/vue'
import { NMessageProvider } from "naive-ui"; import { NMessageProvider } from 'naive-ui'
import { useUserStore } from "@/stores/modules/user"; import { useUserStore } from '@/stores/modules/user'
import { NConfigProvider } from 'naive-ui' import { NConfigProvider } from 'naive-ui'
import { zhCN as NZhCN, dateZhCN } from 'naive-ui' import { zhCN as NZhCN, dateZhCN } from 'naive-ui'
import VScaleScreen from 'v-scale-screen'
import img from '@/assets/images/bg.jpg'
// //
const fitscreenRef = ref<HTMLElement | null>(null); const fitscreenRef = ref<HTMLElement | null>(null)
const { toggle } = useFullscreen(fitscreenRef); const { toggle } = useFullscreen(fitscreenRef)
// console.log(RouterView) // console.log(RouterView)
provide("fullscreen", { toggle }); provide('fullscreen', { toggle })
// const screenWidth = window.screen.width; // const screenWidth = window.screen.width
// const screenHeight = window.screen.height; // const screenHeight = window.screen.height
// console.log('🚀 ~ screenWidth:', screenWidth)
// console.log('🚀 ~ screenHeight:', screenHeight)
const screenWidth = 1920 const screenWidth = 1920
const screenHeight = 1080 const screenHeight = 1080
const store = useUserStore(); const store = useUserStore()
store.getUser(); store.getUser()
console.log(screenWidth,screenHeight) // console.log(screenWidth, screenHeight)
const route = useRoute(); // const route = useRoute() //
const pageClass = computed(() => { const pageClass = computed(() => {
// console.log(route.name) // console.log(route.name)
@ -31,46 +35,88 @@ const pageClass = computed(() => {
// console.log("") // console.log("")
// } // }
// //
if (route.name === "Entry") { if (route.name === 'Entry') {
return "bg-#fff"; // page-about return 'bg-#fff' // page-about
} } else if (route.name === 'DataBase') {
else if(route.name==='DataBase'){
return 'bg-#fff' return 'bg-#fff'
} else if (route.name === 'ExternalLogin' || route.name === 'Login') {
return 'bg-#f3f3f3' // page-about
} }
else if (route.name === "ExternalLogin"||route.name === "Login") { return 'page' //
return "bg-#f3f3f3"; // page-about })
const pageStyle = computed(() => {
//
if (route.name === 'Entry') {
return { 'background-color': '#fff !important' } // page-about
} else if (route.name === 'DataBase') {
return { 'background-color': '#fff !important' }
} else if (route.name === 'ExternalLogin' || route.name === 'Login') {
return { 'background-color': '#f3f3f3 !important' } // page-about
} }
return "page"; // return {
}); 'background-image': `url(${img}) !important`,
'background-position': '0 0',
'background-repeat': 'no-repeat',
'background-size': 'cover'
} //
})
const locale = computed(() => zhCn) const locale = computed(() => zhCn)
const scaleChange = ({
widthRatio,
heightRatio
}: {
widthRatio: number
heightRatio: number
}) => {
console.log('scaleChange', widthRatio, heightRatio)
}
const beforeCalculate = (scale) => {
console.log('🚀 ~ scale:', scale)
return false
}
// ref="fitscreenRef"
// :width="screenWidth"
// :height="screenHeight"
// mode="fit"
// :class="pageClass"
// executeMode="debounce"
// waitTime="300"
// @scaleChange="scaleChange"
// :beforeCalculate="beforeCalculate"
</script> </script>
<template> <template>
<NMessageProvider> <NMessageProvider>
<FitScreen <VScaleScreen
ref="fitscreenRef" ref="fitscreenRef"
:width="screenWidth" :width="screenWidth"
:height="screenHeight" :height="screenHeight"
mode="fit" mode="fit"
:class="pageClass" :box-style="pageStyle"
> >
<!-- <div :class="pageClass"> -->
<n-config-provider :locale="NZhCN" :date-locale="dateZhCN"> <n-config-provider :locale="NZhCN" :date-locale="dateZhCN">
<el-config-provider :locale="locale"> <el-config-provider :locale="locale">
<RouterView /> <RouterView />
</el-config-provider> </el-config-provider>
</n-config-provider> </n-config-provider>
</FitScreen> <!-- </div> -->
</VScaleScreen>
</NMessageProvider> </NMessageProvider>
</template> </template>
<style scoped lang="less"> <style scoped lang="less">
.page { .fit-screen {
text-rendering: optimizeLegibility !important;
background-image: url('@/assets/images/bg.jpg'); }
background-position: 0 0; .page,
background-repeat: no-repeat; .v-screen-box {
background-size: cover; // background-image: url('@/assets/images/bg.jpg') !important;
// background-position: 0 0;
// background-repeat: no-repeat;
// background-size: cover;
} }
.pages { .pages {
background-color: #fff; background-color: #fff;
@ -78,5 +124,4 @@ const locale = computed(() => zhCn)
.pagess { .pagess {
background-color: #f3f3f3; background-color: #f3f3f3;
} }
</style> </style>

View File

@ -1235,6 +1235,33 @@ export async function externalTimeStat(data: any) {
return http.post(`/moduleStat/externalTimeStat`, data) return http.post(`/moduleStat/externalTimeStat`, data)
} }
/**
* https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=32575a43-0b66-4e39-a681-68ef295b2b37
*/
export async function userDetailExport(data: any) {
return http.post(`/moduleStat/userDetailExport`, data, {
responseType: 'blob'
})
}
/**
* 2- https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=32575a43-0b66-4e39-a681-68ef295b2b37
*/
export async function getDepartData(params: any) {
return http.get(`/moduleStat/getDepartData`, { params })
}
/**
* 1- https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=32575a43-0b66-4e39-a681-68ef295b2b37
*/
export async function getPieChartData(params: any) {
return http.get(`/moduleStat/getPieChartData`, { params })
}
/**
* 3-线 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=32575a43-0b66-4e39-a681-68ef295b2b37
*/
export async function getDepartChart(params: any) {
return http.get(`/moduleStat/getDepartChart`, { params })
}
/** /**
* csr https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=5e2e22e5-fab5-4c46-8a93-8f0c3a3675cb * csr https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=5e2e22e5-fab5-4c46-8a93-8f0c3a3675cb
*/ */

BIN
src/assets/images/NEW.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/assets/images/NEW2.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -14,7 +14,6 @@ const userCode = ref(false)
async function getNoticeList() { async function getNoticeList() {
const { data } = await getAllNoticeList() const { data } = await getAllNoticeList()
noticeData.value = data noticeData.value = data
console.log('🚀 ~ file: AppHeadUserInfo.vue:18 ~ data:', data)
} }
onMounted(() => { onMounted(() => {
getNoticeList() getNoticeList()
@ -22,9 +21,11 @@ onMounted(() => {
// console.log( flgs.value,flg) // console.log( flgs.value,flg)
}) })
watchEffect(() => { watchEffect(() => {
// console.log( flgs.value,store.user.type) // console.log( flgs.value,store.user.type, 'tech_service')
flgs.value = [1, 2, 3, 4].includes(store.user.type) flgs.value = [1, 2, 3, 4].includes(store.user.type)
userCode.value = ['admin', 'tech_service'].includes(store.user.roleCode) userCode.value = ['admin', 'tech_service', 'footprint_dandang'].includes(
store.user.roleCode
)
}) })
const options = [ const options = [
{ label: '个人中心', key: 'ucenter' }, { label: '个人中心', key: 'ucenter' },

View File

@ -1,11 +1,11 @@
import { createRouter, createWebHistory } from "vue-router"; import { createRouter, createWebHistory } from 'vue-router'
const NewsDetail = { const NewsDetail = {
path: "/intelligence/:id", path: '/intelligence/:id',
meta: { title: "情报详情" }, meta: { title: '情报详情' },
name: "IntelligenceDetail", name: 'IntelligenceDetail',
component: () => import("@/views/home/intelligence/Detail.vue"), component: () => import('@/views/home/intelligence/Detail.vue')
}; }
const router = createRouter({ const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL), history: createWebHistory(import.meta.env.BASE_URL),
routes: [ routes: [
@ -548,4 +548,4 @@ const router = createRouter({
} }
] ]
}) })
export default router; export default router

View File

@ -1,8 +1,8 @@
import axios from 'axios' import axios from 'axios'
// import type { AxiosRequestConfig } from 'axios'; // import type { AxiosRequestConfig } from 'axios';
import { token } from "@/stores/modules/user"; import { token } from '@/stores/modules/user'
import { message } from "./message"; import { message } from './message'
import router from '@/router'; import router from '@/router'
export const TOKEN_KEY = 'token' export const TOKEN_KEY = 'token'
@ -16,7 +16,7 @@ declare module 'axios' {
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
// 服务接口请求 // 服务接口请求
baseURL: "/test-api", baseURL: '/test-api',
// 超时设置 // 超时设置
timeout: 15000, timeout: 15000,
headers: { 'Content-Type': 'application/json;charset=utf-8;' }, headers: { 'Content-Type': 'application/json;charset=utf-8;' },
@ -58,7 +58,7 @@ service.interceptors.request.use(
if (config.showLoading) { if (config.showLoading) {
showLoading() showLoading()
} }
if (token) config.headers[TOKEN_KEY] = unref(token); if (token) config.headers[TOKEN_KEY] = unref(token)
// if (getToken()) { // if (getToken()) {
// // 是否需要设置 token放在请求头 // // 是否需要设置 token放在请求头
// config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 // config.headers['token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
@ -105,31 +105,29 @@ service.interceptors.response.use(
hideLoading() hideLoading()
// 未设置状态码则默认成功状态 // 未设置状态码则默认成功状态
const { data, status } = response; const { data, status } = response
if (data instanceof Blob || data instanceof ArrayBuffer) { if (data instanceof Blob || data instanceof ArrayBuffer) {
if (response.headers["content-disposition"]) {
const fileName = response.headers["content-disposition"]
?.split(";")[1]
?.split("=")[1];
return { return {
data, data,
fileName, code: 200
};
} }
else { if (response.headers['content-disposition']) {
return Promise.reject("没有访问权限"); const fileName = response.headers['content-disposition']
?.split(';')[1]
?.split('=')[1]
} else {
return Promise.reject('没有访问权限')
} }
} }
const { errCode, code, msg } = data || {}; const { errCode, code, msg } = data || {}
const errMsg = data?.errMsg || data?.message || msg; const errMsg = data?.errMsg || data?.message || msg
// console.log(11, code, errMsg) // console.log(11, code, errMsg)
if (code === 2000) { if (code === 2000) {
await router.push('/'); await router.push('/')
} }
if (![0, 200].includes(code)) { if (![0, 200].includes(code)) {
// if(errMsg==='用户未登录') // if(errMsg==='用户未登录')
// { message.error(errMsg);} // { message.error(errMsg);}
// else if(errMsg==='密码不正确'){ // else if(errMsg==='密码不正确'){
@ -139,22 +137,22 @@ service.interceptors.response.use(
// message.error(errMsg); // message.error(errMsg);
// } // }
// else{ message.error("服务器升级维护中,请稍后重试!")}\ // else{ message.error("服务器升级维护中,请稍后重试!")}\
message.error(errMsg); message.error(errMsg)
return Promise.reject(errMsg); return Promise.reject(errMsg)
} }
if (/^[4|5].*/.test(code || errCode || status)) { if (/^[4|5].*/.test(code || errCode || status)) {
// console.error('> axios(interceptors.response): ', errMsg); // console.error('> axios(interceptors.response): ', errMsg);
message.error(errMsg); message.error(errMsg)
// message.error("服务器访问过多,请稍后重试!"); // message.error("服务器访问过多,请稍后重试!");
// 处理未登录token过期等 情况 // 处理未登录token过期等 情况
// if (code !== 404 && /^[4].*/.test(code || errCode || status)) { // if (code !== 404 && /^[4].*/.test(code || errCode || status)) {
// await app.fedLogout(); // await app.fedLogout();
// } // }
return Promise.reject(data); return Promise.reject(data)
} }
return data; return data
}, },
(error) => { (error) => {
// console.log('err' + error) // console.log('err' + error)
@ -167,7 +165,7 @@ service.interceptors.response.use(
} else if (message.includes('Request failed with status code')) { } else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常' message = '系统接口' + message.substr(message.length - 3) + '异常'
} }
message.err("服务器升级维护中,请稍后重试!") message.err('服务器升级维护中,请稍后重试!')
return Promise.reject(error) return Promise.reject(error)
} }
) )

13
src/utils/index.ts Normal file
View File

@ -0,0 +1,13 @@
import dayjs from 'dayjs'
import isSameOrAfter from 'dayjs/plugin/isSameOrAfter'
dayjs.extend(isSameOrAfter)
// dayjs.extend(isBefore)
function isNotOneWeekAgo(date: any) {
if (!date) return false
const oneWeekAgo = dayjs().subtract(1, 'week')
// console.log('🚀 ~ oneWeekAgo:', oneWeekAgo.format('YYYY-MM-DD'))
return dayjs(date).isSameOrAfter(oneWeekAgo, 'day')
}
export { isNotOneWeekAgo }

View File

@ -4,20 +4,70 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue' // import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from '@/views/home/hooks/useDate' import { useDate } from '@/views/home/hooks/useDate'
// import { NTimeline, NTimelineItem } from 'naive-ui' // import { NTimeline, NTimelineItem } from 'naive-ui'
import { useMessage } from 'naive-ui'
import { cateFileList } from '@/api/daikin/base'
const { day, week } = useDate() const { day, week } = useDate()
const { push } = useRouter() const { push } = useRouter()
const array = ref<any[]>([ const array = ref<any[]>([
{ content1: '将扩大的机遇转为成果 更强更大地展翅飞翔', content2: 'ひろがるチャンスを 成果につなげ 強く大きく 羽ばたこう', year: '2023年' }, {
content1: '将扩大的机遇转为成果 更强更大地展翅飞翔',
content2: 'ひろがるチャンスを 成果につなげ 強く大きく 羽ばたこう',
year: '2023年'
},
{ content1: '领先时代的变化 开创崭新的未来', content2: '', year: '2022年' }, { content1: '领先时代的变化 开创崭新的未来', content2: '', year: '2022年' },
{ content1: '以“重大变化”为契机 向新课题发起挑战', content2: '', year: '2021年' }, {
{ content1: '加速推进三个协创 决胜于变化的时代', content2: '', year: '2020年' }, content1: '以“重大变化”为契机 向新课题发起挑战',
{ content1: '以三个协创为轴心 人人迅速果断行动', content2: '', year: '2016年' }, content2: '',
{ content1: '突破壁垒 集中优势 不断挑战新课题', content2: '', year: '2018年' }, year: '2021年'
{ content1: '坚持以人为轴心,融合新的力量', content2: '集团上下齐心协力提升企业价值', year: '2017年' }, },
{
content1: '加速推进三个协创 决胜于变化的时代',
content2: '',
year: '2020年'
},
{
content1: '以三个协创为轴心 人人迅速果断行动',
content2: '',
year: '2016年'
},
{
content1: '突破壁垒 集中优势 不断挑战新课题',
content2: '',
year: '2018年'
},
{
content1: '坚持以人为轴心,融合新的力量',
content2: '集团上下齐心协力提升企业价值',
year: '2017年'
},
{ content1: '站稳脚跟 强化优势 大步迈进', content2: '', year: '2016年' }, { content1: '站稳脚跟 强化优势 大步迈进', content2: '', year: '2016年' },
{ content1: '创造未来,决胜于变化的时代', content2: '', year: '2015年' }, { content1: '创造未来,决胜于变化的时代', content2: '', year: '2015年' }
]); ])
const fileItem = ref<any>({})
const message = useMessage()
const getFile = async () => {
const { rows }: any = await cateFileList({
cateId: 261,
pageNum: 1,
pageSize: 100
})
fileItem.value = rows.find((item: any) => item.id == 1693) || {}
}
const goFile = () => {
const { isSelect, filePath } = fileItem.value
if (!isSelect || isSelect === 2) {
message.info('没有访问权限!')
return
}
if (!filePath) {
message.info('暂无文件')
}
window.open(filePath)
}
getFile()
</script> </script>
<template> <template>
@ -46,8 +96,16 @@ const array = ref<any[]>([
</div> </div>
</div> </div>
</div> --> </div> -->
<div class="mt30px mr20px flex w100%"> <div class="mt30px mr20px flex w100% relative">
<img src="../../assets/images/fangz.png" class="w100%"/> <!-- <img src="../../assets/images/fangz.png" class="w100%"/> -->
<img src="../../assets/images/fzqiet.png" class="w100%" />
<div
class="absolute py10px left-1160px top-270px pb-0px z-100 text-20px text-#285FE9 flex justify-center items-center hover:border-b-1px hover:border-b-solid hover:border-b-#285FE9 hover:cursor-pointer"
@click="goFile"
>
<img src="../../assets/images/wjqq@2x.png" class="w18px h20px mr8px" />
2024年グループ年頭方针
</div>
</div> </div>
</template> </template>
@ -60,7 +118,7 @@ const array = ref<any[]>([
.g-wrapper { .g-wrapper {
border-radius: 18px; border-radius: 18px;
border: 1px solid #E7EBF5; border: 1px solid #e7ebf5;
box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32); box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32);
overflow: hidden; overflow: hidden;
@ -74,7 +132,7 @@ const array = ref<any[]>([
.year { .year {
left: -132px; left: -132px;
top: -14px; top: -14px;
color: #003CB7; color: #003cb7;
font-size: 26px; font-size: 26px;
font-weight: normal; font-weight: normal;
text-align: center; text-align: center;

View File

@ -589,6 +589,7 @@ const demandWithdraws = async (obj) => {
<img src="@/assets/images/logo.png" class="w197px h44px mt14px" /> <img src="@/assets/images/logo.png" class="w197px h44px mt14px" />
</div> </div>
<div <div
v-if="false"
class="beijing absolute flex left-[45%] translate-x-[-50%] top-11 text-[22px] items-center justify-center font-bold" class="beijing absolute flex left-[45%] translate-x-[-50%] top-11 text-[22px] items-center justify-center font-bold"
> >
<img src="./images/laba@2x.png" class="w-[48px] h-[45px] mr-4" alt="" /> <img src="./images/laba@2x.png" class="w-[48px] h-[45px] mr-4" alt="" />
@ -633,8 +634,7 @@ const demandWithdraws = async (obj) => {
" "
class="mr15px mt17px flex px5px pt6px" class="mr15px mt17px flex px5px pt6px"
@click="toList(7)" @click="toList(7)"
>更多<el-icon> >更多<el-icon> <DArrowRight class="" /> </el-icon
<DArrowRight class="" /> </el-icon
></span> ></span>
<div class="absolute right-25px top-20px"> <div class="absolute right-25px top-20px">
@ -713,8 +713,7 @@ const demandWithdraws = async (obj) => {
" "
class="mr15px mt2px flex px5px pt6px" class="mr15px mt2px flex px5px pt6px"
@click="toList(8)" @click="toList(8)"
>更多<el-icon> >更多<el-icon> <DArrowRight class="" /> </el-icon
<DArrowRight class="" /> </el-icon
></span> ></span>
</div> </div>
@ -1252,10 +1251,9 @@ const demandWithdraws = async (obj) => {
alt="" alt=""
style="margin-right: 50px" style="margin-right: 50px"
/> />
<p <p style="text-align: center; color: #dde5fd">
style="text-align: center; color: #dde5fd" 暂无供方留言
>暂无供方留言</p </p>
>
</div> </div>
<div <div
v-else v-else

View File

@ -1,24 +1,38 @@
<script setup lang="ts"> <script setup lang="ts">
import VChart from 'vue-echarts' import VChart from 'vue-echarts'
import { useChart1, useChart22, useChart21, useChart3, useChart23 } from './HomeData' import {
useChart1,
useChart22,
useChart21,
useChart3,
useChart23
} from './HomeData'
import AppHeadUserInfo from '@/components/AppHeadUserInfo.vue' import AppHeadUserInfo from '@/components/AppHeadUserInfo.vue'
import { NSelect } from 'naive-ui' import { NSelect } from 'naive-ui'
import News from './components/New.vue' import News from './components/New.vue'
import { homePageMarket, homePageRate, report, getHomeList ,amountList} from '@/api/daikin/base' import {
import { useUserStore } from "@/stores/modules/user"; homePageMarket,
const store = useUserStore(); homePageRate,
report,
getHomeList,
amountList
} from '@/api/daikin/base'
import { useUserStore } from '@/stores/modules/user'
const store = useUserStore()
const isUpPwds = ref(false) const isUpPwds = ref(false)
const userCode = ref(false) const userCode = ref(false)
watchEffect(() => { watchEffect(() => {
userCode.value = ['admin', 'cd_dandang', 'tech_service'].includes(store.user.roleCode) userCode.value = ['admin', 'cd_dandang', 'tech_service'].includes(
store.user.roleCode
)
isUpPwds.value = store.user.isUpPwd === 2 ? true : false isUpPwds.value = store.user.isUpPwd === 2 ? true : false
}) })
const activeCard5NavKey = ref('DIS') const activeCard5NavKey = ref('DIS')
const Card5Navs = [ const Card5Navs = [
{ key: 'DIS', name: 'DIS' }, { key: 'DIS', name: 'DIS' },
{ key: 'DSZ', name: 'DSZ' }, { key: 'DSZ', name: 'DSZ' },
{ key: 'DISH', name: 'DISH' }, { key: 'DISH', name: 'DISH' }
] ]
const ailists = ref() const ailists = ref()
const culists = ref() const culists = ref()
@ -26,15 +40,15 @@ const itemLists = ref()
const timeA = ref() const timeA = ref()
const timeB = ref() const timeB = ref()
const disList = ref<any>([{}, {}, {}, {}]); const disList = ref<any>([{}, {}, {}, {}])
const dszList = ref<any>([{}, {}, {}, {}]); const dszList = ref<any>([{}, {}, {}, {}])
const dishList = ref<any>([{}, {}, {}, {}]); const dishList = ref<any>([{}, {}, {}, {}])
const month_1 = ref(); const month_1 = ref()
const month_2 = ref(); const month_2 = ref()
const month_3 = ref(); const month_3 = ref()
let now = (new Date()).getMonth() + 13; let now = new Date().getMonth() + 13
month_2.value = (now - 2) % 12; month_2.value = (now - 2) % 12
month_1.value = (now - 1) % 12; month_1.value = (now - 1) % 12
const dataDIS = ref() const dataDIS = ref()
const dataDSZ = ref() const dataDSZ = ref()
const dataDISH = ref() const dataDISH = ref()
@ -50,11 +64,16 @@ const addDISH3 = ref()
const timeObj = ref<any>({}) const timeObj = ref<any>({})
onMounted(async () => { onMounted(async () => {
try { try {
const { data: { ailist, culist, lastUTime },data } = await homePageMarket() // const {
const { data: { itemList, lastUTime: _lastUTime } } = await homePageRate() // data: { ailist, culist, lastUTime },
const { data: _disList } = await getHomeList({number: "DIS"}) // data
const { data: _dszList } = await getHomeList({number: "DSZ"}) // } = await homePageMarket() //
const { data: _dishList } = await getHomeList({number: "DISH"}) // const {
data: { itemList, lastUTime: _lastUTime }
} = await homePageRate() //
const { data: _disList } = await getHomeList({ number: 'DIS' }) //
const { data: _dszList } = await getHomeList({ number: 'DSZ' }) //
const { data: _dishList } = await getHomeList({ number: 'DISH' }) //
const { data: fazhu } = await amountList() const { data: fazhu } = await amountList()
fazhu.forEach((i: { number: string; amount: any }) => { fazhu.forEach((i: { number: string; amount: any }) => {
// timeObj.value[i.number] = i.modifyTime?.substring(0, 10) || '' // timeObj.value[i.number] = i.modifyTime?.substring(0, 10) || ''
@ -68,7 +87,7 @@ onMounted(async () => {
if (i.number == 'DISH') { if (i.number == 'DISH') {
dataDISH.value = i.amount dataDISH.value = i.amount
} }
}); })
ailists.value = ailist ailists.value = ailist
culists.value = culist culists.value = culist
itemLists.value = itemList itemLists.value = itemList
@ -81,91 +100,125 @@ onMounted(async () => {
month_2.value = _dszList[0].monthDate?.split('-')[1] month_2.value = _dszList[0].monthDate?.split('-')[1]
month_3.value = _dishList[0].monthDate?.split('-')[1] month_3.value = _dishList[0].monthDate?.split('-')[1]
addDIS1.value = _disList.reduce((previousValue: any, currentValue: { budget: any }) => { addDIS1.value = _disList.reduce(
(previousValue: any, currentValue: { budget: any }) => {
const sum = parseFloat(currentValue.budget) + parseFloat(previousValue) const sum = parseFloat(currentValue.budget) + parseFloat(previousValue)
return sum > 0 ? sum.toFixed(2) : 0 return sum > 0 ? sum.toFixed(2) : 0
}, 0) },
0
)
if (_disList[0].budget == _disList[1].budget && addDIS1.value > 0) { if (_disList[0].budget == _disList[1].budget && addDIS1.value > 0) {
addDIS1.value -= _disList[0].budget addDIS1.value -= _disList[0].budget
addDIS1.value >0? addDIS1.value = addDIS1.value.toFixed(2):0 addDIS1.value > 0 ? (addDIS1.value = addDIS1.value.toFixed(2)) : 0
} }
addDSZ1.value = _dszList.reduce((previousValue: any, currentValue: { budget: any }) => { addDSZ1.value = _dszList.reduce(
(previousValue: any, currentValue: { budget: any }) => {
const sum = parseFloat(currentValue.budget) + parseFloat(previousValue) const sum = parseFloat(currentValue.budget) + parseFloat(previousValue)
return sum > 0 ? sum.toFixed(2) : 0 return sum > 0 ? sum.toFixed(2) : 0
}, 0) },
0
)
if (_dszList[0].budget == _dszList[1].budget && addDSZ1.value > 0) { if (_dszList[0].budget == _dszList[1].budget && addDSZ1.value > 0) {
addDSZ1.value -= _dszList[0].budget addDSZ1.value -= _dszList[0].budget
addDSZ1.value >0? addDSZ1.value = addDSZ1.value.toFixed(2):0 addDSZ1.value > 0 ? (addDSZ1.value = addDSZ1.value.toFixed(2)) : 0
} }
addDISH1.value = _dishList.reduce((previousValue: any, currentValue: { budget: any }) => { addDISH1.value = _dishList.reduce(
(previousValue: any, currentValue: { budget: any }) => {
const sum = parseFloat(currentValue.budget) + parseFloat(previousValue) const sum = parseFloat(currentValue.budget) + parseFloat(previousValue)
return sum > 0 ? sum.toFixed(2) : 0 return sum > 0 ? sum.toFixed(2) : 0
}, 0) },
0
)
if (_dishList[0].budget == _dishList[1].budget && addDISH1.value > 0) { if (_dishList[0].budget == _dishList[1].budget && addDISH1.value > 0) {
addDISH1.value -= _dishList[0].budget addDISH1.value -= _dishList[0].budget
addDISH1.value >0? addDISH1.value = addDISH1.value.toFixed(2):0 addDISH1.value > 0 ? (addDISH1.value = addDISH1.value.toFixed(2)) : 0
} }
addDIS2.value = _disList.reduce((previousValue: any, currentValue: { monthOne: any }) => { addDIS2.value = _disList.reduce(
const sum = parseFloat(currentValue.monthOne) +parseFloat(previousValue) (previousValue: any, currentValue: { monthOne: any }) => {
const sum =
parseFloat(currentValue.monthOne) + parseFloat(previousValue)
return sum > 0 ? sum.toFixed(2) : 0 return sum > 0 ? sum.toFixed(2) : 0
}, 0) },
0
)
if (_disList[0].monthOne == _disList[1].monthOne && addDIS2.value > 0) { if (_disList[0].monthOne == _disList[1].monthOne && addDIS2.value > 0) {
addDIS2.value -= _disList[0].monthOne addDIS2.value -= _disList[0].monthOne
addDIS2.value >0 ? addDIS2.value = addDIS2.value.toFixed(2):0 addDIS2.value > 0 ? (addDIS2.value = addDIS2.value.toFixed(2)) : 0
} }
addDSZ2.value = _dszList.reduce((previousValue: any, currentValue: { monthOne: any }) => { addDSZ2.value = _dszList.reduce(
const sum = parseFloat(currentValue.monthOne) +parseFloat(previousValue) (previousValue: any, currentValue: { monthOne: any }) => {
const sum =
parseFloat(currentValue.monthOne) + parseFloat(previousValue)
return sum > 0 ? sum.toFixed(2) : 0 return sum > 0 ? sum.toFixed(2) : 0
}, 0) },
0
)
if (_dszList[0].monthOne == _dszList[1].monthOne && addDSZ2.value > 0) { if (_dszList[0].monthOne == _dszList[1].monthOne && addDSZ2.value > 0) {
addDSZ2.value -= _dszList[0].monthOne addDSZ2.value -= _dszList[0].monthOne
addDSZ2.value >0? addDSZ2.value = addDSZ2.value.toFixed(2):0 addDSZ2.value > 0 ? (addDSZ2.value = addDSZ2.value.toFixed(2)) : 0
} }
addDISH2.value = _dishList.reduce((previousValue: any, currentValue: { monthOne: any }) => { addDISH2.value = _dishList.reduce(
const sum = parseFloat(currentValue.monthOne) +parseFloat(previousValue) (previousValue: any, currentValue: { monthOne: any }) => {
const sum =
parseFloat(currentValue.monthOne) + parseFloat(previousValue)
return sum > 0 ? sum.toFixed(2) : 0 return sum > 0 ? sum.toFixed(2) : 0
}, 0) },
0
)
if (_dishList[0].monthOne == _dishList[1].monthOne && addDISH2.value > 0) { if (_dishList[0].monthOne == _dishList[1].monthOne && addDISH2.value > 0) {
addDISH2.value -= _dishList[0].monthOne addDISH2.value -= _dishList[0].monthOne
addDISH2.value >0? addDISH2.value = addDISH2.value.toFixed(2):0 addDISH2.value > 0 ? (addDISH2.value = addDISH2.value.toFixed(2)) : 0
} }
addDIS3.value = _disList.reduce((previousValue: any, currentValue: { monthTwo: any }) => { addDIS3.value = _disList.reduce(
const sum = parseFloat(currentValue.monthTwo) +parseFloat(previousValue) (previousValue: any, currentValue: { monthTwo: any }) => {
const sum =
parseFloat(currentValue.monthTwo) + parseFloat(previousValue)
return sum > 0 ? sum.toFixed(2) : 0 return sum > 0 ? sum.toFixed(2) : 0
}, 0) },
0
)
if (_disList[0].monthTwo == _disList[1].monthTwo && addDIS3.value > 0) { if (_disList[0].monthTwo == _disList[1].monthTwo && addDIS3.value > 0) {
addDIS3.value -= _disList[0].monthTwo addDIS3.value -= _disList[0].monthTwo
addDIS3.value >0? addDIS3.value = addDIS3.value.toFixed(2):0 addDIS3.value > 0 ? (addDIS3.value = addDIS3.value.toFixed(2)) : 0
} }
addDSZ3.value = _dszList.reduce((previousValue: any, currentValue: { monthTwo: any }) => { addDSZ3.value = _dszList.reduce(
const sum = parseFloat(currentValue.monthTwo) +parseFloat(previousValue) (previousValue: any, currentValue: { monthTwo: any }) => {
const sum =
parseFloat(currentValue.monthTwo) + parseFloat(previousValue)
return sum > 0 ? sum.toFixed(2) : 0 return sum > 0 ? sum.toFixed(2) : 0
}, 0) },
0
)
if (_dszList[0].monthTwo == _dszList[1].monthTwo && addDSZ3.value > 0) { if (_dszList[0].monthTwo == _dszList[1].monthTwo && addDSZ3.value > 0) {
addDSZ3.value -= _dszList[0].monthTwo addDSZ3.value -= _dszList[0].monthTwo
addDSZ3.value >0? addDSZ3.value = addDSZ3.value.toFixed(2):0 addDSZ3.value > 0 ? (addDSZ3.value = addDSZ3.value.toFixed(2)) : 0
} }
addDISH3.value = _dishList.reduce((previousValue: any, currentValue: { monthTwo: any }) => { addDISH3.value = _dishList.reduce(
const sum = parseFloat(currentValue.monthTwo) +parseFloat(previousValue) (previousValue: any, currentValue: { monthTwo: any }) => {
const sum =
parseFloat(currentValue.monthTwo) + parseFloat(previousValue)
return sum > 0 ? sum.toFixed(2) : 0 return sum > 0 ? sum.toFixed(2) : 0
}, 0) },
0
)
if (_dishList[0].monthTwo == _dishList[1].monthTwo && addDISH3.value > 0) { if (_dishList[0].monthTwo == _dishList[1].monthTwo && addDISH3.value > 0) {
addDISH3.value -= _dishList[0].monthTwo addDISH3.value -= _dishList[0].monthTwo
addDISH3.value >0? addDISH3.value = addDISH3.value.toFixed(2):0 addDISH3.value > 0 ? (addDISH3.value = addDISH3.value.toFixed(2)) : 0
} }
if (isUpPwds.value) { if (isUpPwds.value) {
ElMessageBox.alert('为了您的帐号安全,首次登录必须更改初始密码', '重要提醒', ElMessageBox.alert(
'为了您的帐号安全,首次登录必须更改初始密码',
'重要提醒',
{ {
confirmButtonText: 'OK', confirmButtonText: 'OK',
showClose: false, showClose: false,
showCancelButton:false, showCancelButton: false
}).then(()=>{ }
).then(() => {
push({ name: 'modifys' }) push({ name: 'modifys' })
}) })
} }
}catch (error) { } catch (error) {}
}
}) })
const { push } = useRouter() const { push } = useRouter()
const route = useRoute() const route = useRoute()
@ -178,11 +231,11 @@ const { chartRef: chartRef23, option: chartOption23 } = useChart23()
const { chartRef: chartRef3, option: chartOption3 } = useChart3() const { chartRef: chartRef3, option: chartOption3 } = useChart3()
const displayDiffValue = (diffValue: number) => { const displayDiffValue = (diffValue: number) => {
if (diffValue > 0) { if (diffValue > 0) {
return `+${diffValue} %`; return `+${diffValue} %`
} else if (diffValue < 0) { } else if (diffValue < 0) {
return `-${Math.abs(diffValue)} %`; return `-${Math.abs(diffValue)} %`
} else { } else {
return `${diffValue} %`; return `${diffValue} %`
} }
} }
@ -191,13 +244,14 @@ async function setModule(codes: any, names: any) {
console.log(codes, names) console.log(codes, names)
push({ name: names }) push({ name: names })
const { code } = await report({ moduleCode }) const { code } = await report({ moduleCode })
} }
const selectData = ref("原材料") const selectData = ref('原材料')
const option = [{ const option = [
{
label: '全部数据', label: '全部数据',
value: 'quanbu' value: 'quanbu'
},{ },
{
label: '原材料', label: '原材料',
value: 'yuancailiao' value: 'yuancailiao'
}, },
@ -208,8 +262,8 @@ const option = [{
{ {
label: '机能部品', label: '机能部品',
value: 'jineng' value: 'jineng'
},] }
]
const thisSelect = (e) => { const thisSelect = (e) => {
console.log(e) console.log(e)
@ -217,13 +271,12 @@ const thisSelect = (e) => {
} }
function formatNumber(num = 0) { function formatNumber(num = 0) {
num = +num; num = +num
const roundedNum:string = num.toFixed(2); const roundedNum: string = num.toFixed(2)
const [wholePart, decimalPart] = roundedNum.split('.'); const [wholePart, decimalPart] = roundedNum.split('.')
const formattedDecimalPart = decimalPart.padEnd(2, '0'); const formattedDecimalPart = decimalPart.padEnd(2, '0')
return `${wholePart}.${formattedDecimalPart}`; return `${wholePart}.${formattedDecimalPart}`
} }
</script> </script>
<template> <template>
@ -232,19 +285,24 @@ function formatNumber(num = 0) {
<AppHeadUserInfo /> <AppHeadUserInfo />
</div> </div>
<div class="page-wrapper h-full flex-1 flex flex-col flex-wrap"> <div class="page-wrapper h-full flex-1 flex flex-col flex-wrap">
<div class="font-800 text-30px mt39px">FY23年度调达本部方针创新实干勇毅前行以综合实力挑战变革提升存在感</div> <div class="font-800 text-30px mt39px">
FY23年度调达本部方针创新实干勇毅前行以综合实力挑战变革提升存在感
</div>
<div class="mt30px flex-1 flex flex-wrap justify-between"> <div class="mt30px flex-1 flex flex-wrap justify-between">
<News></News> <News></News>
<div class="card">
<div class="card cursor-pointer"> <div
<div class="card_title" @click="setModule('App_Market', 'Market')">市况汇率 每日更新</div> class="card_title cursor-pointer hover:underline"
@click="setModule('App_Market', 'Market')"
>
市况汇率 每日更新
</div>
<div class="card_nav card_nav2 !top--3px !right--1px"> <div class="card_nav card_nav2 !top--3px !right--1px">
<div class="!text-14px w260px top--4px text-right leading-18px"> <div class="!text-14px w260px top--4px text-right leading-18px">
出处市况-SMM/LME<br /> 出处市况-SMM/LME<br />
汇率-外汇管理局 汇率-外汇管理局
</div> </div>
</div> </div>
<!-- <div class="card_sub-title">责任者调达中心 Device变革T/原材料变革T</div> --> <!-- <div class="card_sub-title">责任者调达中心 Device变革T/原材料变革T</div> -->
@ -256,10 +314,18 @@ function formatNumber(num = 0) {
<span class="ml15px text-12px">更新时间{{ timeA }}</span> <span class="ml15px text-12px">更新时间{{ timeA }}</span>
<div class="h150px overflow-auto"> <div class="h150px overflow-auto">
<table
<table class="history w-full text-center mt18px text-16px border-spacing-0 w219px"> class="history w-full text-center mt18px text-16px border-spacing-0 w219px"
>
<thead <thead
style="background-color: #417BEF;color: #fff;height: 42px;width: 220px; border: 1px solid #417BEF;"> style="
background-color: #417bef;
color: #fff;
height: 42px;
width: 220px;
border: 1px solid #417bef;
"
>
<tr class="h41px"> <tr class="h41px">
<th></th> <th></th>
<th>最新</th> <th>最新</th>
@ -267,21 +333,37 @@ function formatNumber(num = 0) {
</tr> </tr>
</thead> </thead>
<tbody v-if="culists"> <tbody v-if="culists">
<tr class="h45px" v-for="(it, index) in culists" :key="index" <tr
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"> class="h45px"
v-for="(it, index) in culists"
:key="index"
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"
>
<td class="text-12px">{{ it.channel }}</td> <td class="text-12px">{{ it.channel }}</td>
<td class="text-12px">{{ it.negAmount }}</td> <td class="text-12px">{{ it.negAmount }}</td>
<td class=" text-12px" :class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'"> <td
{{ displayDiffValue(it.diffValue) }}</td> class="text-12px"
:class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'"
>
{{ displayDiffValue(it.diffValue) }}
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="h150px overflow-auto"> <div class="h150px overflow-auto">
<table class="history w-full text-center mt15px text-16px border-spacing-0 overflow-auto w219px"> <table
class="history w-full text-center mt15px text-16px border-spacing-0 overflow-auto w219px"
>
<thead <thead
style="background-color: #417BEF;color: #fff;height: 42px;width: 220px; border: 1px solid #417BEF;"> style="
background-color: #417bef;
color: #fff;
height: 42px;
width: 220px;
border: 1px solid #417bef;
"
>
<tr class="h41px"> <tr class="h41px">
<th></th> <th></th>
<th>最新</th> <th>最新</th>
@ -289,27 +371,41 @@ function formatNumber(num = 0) {
</tr> </tr>
</thead> </thead>
<tbody v-if="ailists"> <tbody v-if="ailists">
<tr class="h45px" v-for="(it, index) in ailists" :key="index" <tr
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"> class="h45px"
v-for="(it, index) in ailists"
:key="index"
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"
>
<td class="text-12px">{{ it.channel }}</td> <td class="text-12px">{{ it.channel }}</td>
<td class="text-12px">{{ it.negAmount }}</td> <td class="text-12px">{{ it.negAmount }}</td>
<td class=" text-12px" :class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'"> <td
{{ displayDiffValue(it.diffValue) }}</td> class="text-12px"
:class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'"
>
{{ displayDiffValue(it.diffValue) }}
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="ml10px"> <div class="ml10px">
<span class="icoT">汇率</span> <span class="icoT">汇率</span>
<span class="ml15px text-12px">更新时间{{ timeB }}</span> <span class="ml15px text-12px">更新时间{{ timeB }}</span>
<div class="h282px pt18px"> <div class="h282px pt18px">
<table class="history w-full text-center text-16px border-spacing-0 w219px "> <table
class="history w-full text-center text-16px border-spacing-0 w219px"
>
<thead <thead
style="background-color: #417BEF;color: #fff;height: 42px;width: 220px; border: 1px solid #417BEF;"> style="
background-color: #417bef;
color: #fff;
height: 42px;
width: 220px;
border: 1px solid #417bef;
"
>
<tr class="h41px"> <tr class="h41px">
<th class="w75px">币种</th> <th class="w75px">币种</th>
<th>最新</th> <th>最新</th>
@ -317,35 +413,61 @@ function formatNumber(num = 0) {
</tr> </tr>
</thead> </thead>
<tbody v-if="itemLists" class="h238px overflow-auto absolute"> <tbody v-if="itemLists" class="h238px overflow-auto absolute">
<tr class="h60px !text-12px" v-for="(it, index) in itemLists" :key="index" <tr
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"> class="h60px !text-12px"
<td class=" w75px text-center">{{ it.currencyNameFrom }}-{{ it.currencyNameTo }}</td> v-for="(it, index) in itemLists"
:key="index"
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"
>
<td class="w75px text-center">
{{ it.currencyNameFrom }}-{{ it.currencyNameTo }}
</td>
<td class="w85px text-center">{{ it.negAmount }}</td> <td class="w85px text-center">{{ it.negAmount }}</td>
<td class=" w65px text-center" :class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'"> <td
{{ displayDiffValue(it.diffValue) }}</td> class="w65px text-center"
:class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'"
>
{{ displayDiffValue(it.diffValue) }}
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="card"> <div class="card">
<div class="card_title cursor-pointer" @click="setModule('App_data_platform', 'CD')">数据平台</div> <div
class="card_title cursor-pointer hover:underline"
@click="setModule('App_data_platform', 'CD')"
>
数据平台
</div>
<!-- <div class="card_sub-title">责任者调达中心 企画变革T</div> --> <!-- <div class="card_sub-title">责任者调达中心 企画变革T</div> -->
<div class="card_nav card_nav1"> <div class="card_nav card_nav1">
<div class="card_nav_item" :class="activeCard5NavKey === i.key && 'active'" v-for="i in Card5Navs" :key="i.name" <div
@click="() => (activeCard5NavKey = i.key)"> class="card_nav_item cursor-pointer hover:underline"
:class="activeCard5NavKey === i.key && 'active'"
v-for="i in Card5Navs"
:key="i.name"
@click="() => (activeCard5NavKey = i.key)"
>
{{ i.name }} {{ i.name }}
</div> </div>
</div> </div>
<div class="table-container"> <div class="table-container">
<el-button v-if="userCode" type="primary" class="button abs-top" @click="push({ name: 'dataPlatform' })"></el-button> <el-button
<div class="block p-[10px] pr-0 absolute top-[4px] right-[36px] font-normal h-[20px] !text-[16px] text-[#000]"> v-if="userCode"
type="primary"
class="button abs-top"
@click="push({ name: 'dataPlatform' })"
>数据管理</el-button
>
<div
class="block p-[10px] pr-0 absolute top-[4px] right-[36px] font-normal h-[20px] !text-[16px] text-[#000]"
>
更新日{{ timeObj[activeCard5NavKey] }} 更新日{{ timeObj[activeCard5NavKey] }}
</div> </div>
<table class="data-table" border v-if="activeCard5NavKey === 'DIS'"> <table class="data-table" border v-if="activeCard5NavKey === 'DIS'">
@ -380,15 +502,31 @@ function formatNumber(num = 0) {
<tr> <tr>
<th rowspan="2">C/D</th> <th rowspan="2">C/D</th>
<th>交涉</th> <th>交涉</th>
<td :rowspan="disList[0].budget ==disList[1].budget?'2':''">{{formatNumber(disList[0].budget)}}%</td> <td :rowspan="disList[0].budget == disList[1].budget ? '2' : ''">
<td :rowspan="disList[0].monthOne ==disList[1].monthOne?'2':''">{{formatNumber(disList[0].monthOne)}}%</td> {{ formatNumber(disList[0].budget) }}%
<td :rowspan="disList[0].monthTwo ==disList[1].monthTwo?'2':''">{{formatNumber(disList[0].monthTwo)}}%</td> </td>
<td
:rowspan="disList[0].monthOne == disList[1].monthOne ? '2' : ''"
>
{{ formatNumber(disList[0].monthOne) }}%
</td>
<td
:rowspan="disList[0].monthTwo == disList[1].monthTwo ? '2' : ''"
>
{{ formatNumber(disList[0].monthTwo) }}%
</td>
</tr> </tr>
<tr> <tr>
<th>THEME</th> <th>THEME</th>
<td v-if="disList[1].budget !=disList[0].budget">{{formatNumber(disList[1].budget)}}%</td> <td v-if="disList[1].budget != disList[0].budget">
<td v-if="disList[1].monthOne !=disList[0].monthOne">{{formatNumber(disList[1].monthOne)}}%</td> {{ formatNumber(disList[1].budget) }}%
<td v-if="disList[1].monthTwo !=disList[0].monthTwo">{{formatNumber(disList[1].monthTwo)}}%</td> </td>
<td v-if="disList[1].monthOne != disList[0].monthOne">
{{ formatNumber(disList[1].monthOne) }}%
</td>
<td v-if="disList[1].monthTwo != disList[0].monthTwo">
{{ formatNumber(disList[1].monthTwo) }}%
</td>
</tr> </tr>
<tr> <tr>
<th colspan="2">市况</th> <th colspan="2">市况</th>
@ -435,15 +573,31 @@ function formatNumber(num = 0) {
<tr> <tr>
<th rowspan="2">C/D</th> <th rowspan="2">C/D</th>
<th>交涉</th> <th>交涉</th>
<td :rowspan="dszList[0].budget ==dszList[1].budget?'2':''">{{formatNumber(dszList[0].budget)}}%</td> <td :rowspan="dszList[0].budget == dszList[1].budget ? '2' : ''">
<td :rowspan="dszList[0].monthOne ==dszList[1].monthOne?'2':''">{{formatNumber(dszList[0].monthOne)}}%</td> {{ formatNumber(dszList[0].budget) }}%
<td :rowspan="dszList[0].monthTwo ==dszList[1].monthTwo?'2':''">{{formatNumber(dszList[0].monthTwo)}}%</td> </td>
<td
:rowspan="dszList[0].monthOne == dszList[1].monthOne ? '2' : ''"
>
{{ formatNumber(dszList[0].monthOne) }}%
</td>
<td
:rowspan="dszList[0].monthTwo == dszList[1].monthTwo ? '2' : ''"
>
{{ formatNumber(dszList[0].monthTwo) }}%
</td>
</tr> </tr>
<tr> <tr>
<th>THEME</th> <th>THEME</th>
<td v-if="dszList[1].budget !=dszList[0].budget">{{formatNumber(dszList[1].budget)}}%</td> <td v-if="dszList[1].budget != dszList[0].budget">
<td v-if="dszList[1].monthOne !=dszList[0].monthOne">{{formatNumber(dszList[1].monthOne)}}%</td> {{ formatNumber(dszList[1].budget) }}%
<td v-if="dszList[1].monthTwo !=dszList[0].monthTwo">{{formatNumber(dszList[1].monthTwo)}}%</td> </td>
<td v-if="dszList[1].monthOne != dszList[0].monthOne">
{{ formatNumber(dszList[1].monthOne) }}%
</td>
<td v-if="dszList[1].monthTwo != dszList[0].monthTwo">
{{ formatNumber(dszList[1].monthTwo) }}%
</td>
</tr> </tr>
<tr> <tr>
<th colspan="2">市况</th> <th colspan="2">市况</th>
@ -490,15 +644,37 @@ function formatNumber(num = 0) {
<tr> <tr>
<th rowspan="2">C/D</th> <th rowspan="2">C/D</th>
<th>交涉</th> <th>交涉</th>
<td :rowspan="dishList[0].budget ==dishList[1].budget?'2':''">{{formatNumber(dishList[0].budget)}}%</td> <td
<td :rowspan="dishList[0].monthOne ==dishList[1].monthOne?'2':''">{{formatNumber(dishList[0].monthOne)}}%</td> :rowspan="dishList[0].budget == dishList[1].budget ? '2' : ''"
<td :rowspan="dishList[0].monthTwo ==dishList[1].monthTwo?'2':''">{{formatNumber(dishList[0].monthTwo)}}%</td> >
{{ formatNumber(dishList[0].budget) }}%
</td>
<td
:rowspan="
dishList[0].monthOne == dishList[1].monthOne ? '2' : ''
"
>
{{ formatNumber(dishList[0].monthOne) }}%
</td>
<td
:rowspan="
dishList[0].monthTwo == dishList[1].monthTwo ? '2' : ''
"
>
{{ formatNumber(dishList[0].monthTwo) }}%
</td>
</tr> </tr>
<tr> <tr>
<th>THEME</th> <th>THEME</th>
<td v-if="dishList[1].budget !=dishList[0].budget">{{formatNumber(dishList[1].budget)}}%</td> <td v-if="dishList[1].budget != dishList[0].budget">
<td v-if="dishList[1].monthOne !=dishList[0].monthOne">{{formatNumber(dishList[1].monthOne)}}%</td> {{ formatNumber(dishList[1].budget) }}%
<td v-if="dishList[1].monthTwo !=dishList[0].monthTwo">{{formatNumber(dishList[1].monthTwo)}}%</td> </td>
<td v-if="dishList[1].monthOne != dishList[0].monthOne">
{{ formatNumber(dishList[1].monthOne) }}%
</td>
<td v-if="dishList[1].monthTwo != dishList[0].monthTwo">
{{ formatNumber(dishList[1].monthTwo) }}%
</td>
</tr> </tr>
<tr> <tr>
<th colspan="2">市况</th> <th colspan="2">市况</th>
@ -521,19 +697,32 @@ function formatNumber(num = 0) {
<VChart ref="chartRef3" :option="chartOption3" autoresize /> <VChart ref="chartRef3" :option="chartOption3" autoresize />
</div> --> </div> -->
</div> </div>
<div class="card cursor-pointer" @click="setModule('App_BCP', 'BCP')"> <div class="card" @click="setModule('App_BCP', 'BCP')">
<div class="card_title">调达BCP管理</div> <div class="card_title cursor-pointer hover:underline">调达BCP管理</div>
<div class="card_sub-title">责任者调达中心 加工品变革T</div> <div class="card_sub-title">责任者调达中心 加工品变革T</div>
<div class="card_content"> <div class="card_content">
<img src="@/assets/images/img-11.png" class="w-full h-full object-cover" /> <img
src="@/assets/images/img-11.png"
class="w-full h-full object-cover"
/>
</div> </div>
</div> </div>
<div class="card cursor-pointer relative"> <div class="card relative">
<!-- <img src="@/assets/images/img-42.png" class="absolute top-10px right-0" /> --> <!-- <img src="@/assets/images/img-42.png" class="absolute top-10px right-0" /> -->
<div class="card_title" @click="setModule('App_CSR', 'CSR')">SCM碳中和活动</div> <div
<div class="card_sub-title" @click="setModule('App_CSR', 'CSR')">责任者调达研究院 调达机能研究T</div> class="card_title cursor-pointer hover:underline"
@click="setModule('App_CSR', 'CSR')"
>
SCM碳中和活动
</div>
<div class="card_sub-title" @click="setModule('App_CSR', 'CSR')">
责任者调达研究院 调达机能研究T
</div>
<div class="card_content px20px" @click="setModule('App_CSR', 'CSR')"> <div class="card_content px20px" @click="setModule('App_CSR', 'CSR')">
<img src="../../assets/images/scmtzh@2x.png" class="w-full h-96% cover"/> <img
src="../../assets/images/scmtzh@2x.png"
class="w-full h-96% cover"
/>
<!-- <div class="flex text-center"> <!-- <div class="flex text-center">
<div class="bg-#F4F8FF text-#000 h30px w-full pt5px font-bold">F25碳减排目标 <el-icon class="!text-#004DE1"> <div class="bg-#F4F8FF text-#000 h30px w-full pt5px font-bold">F25碳减排目标 <el-icon class="!text-#004DE1">
<CaretTop /> <CaretTop />
@ -576,44 +765,64 @@ function formatNumber(num = 0) {
</div> </div>
</div> </div>
<div class="card topics"> <div class="card topics">
<div class="card_title">重点Theme取组</div> <div class="card_title cursor-pointer hover:underline">
重点Theme取组
</div>
<div class="card_content p20px pt10px"> <div class="card_content p20px pt10px">
<div class="w-full h-full flex flex-wrap content-between justify-between text-18px font-bold"> <div
<div class="item !h-188px cursor-pointer" @click="setModule('App_Quality', 'Quality')"> class="w-full h-full flex flex-wrap content-between justify-between text-18px font-bold"
<div class="item_title">品质</div> >
<div
class="item !h-188px cursor-pointer"
@click="setModule('App_Quality', 'Quality')"
>
<div class="item_title hover:underline">品质</div>
<div class="item_sub-title">责任者调达中心 加工品变革T</div> <div class="item_sub-title">责任者调达中心 加工品变革T</div>
<!-- <img src="@/assets/images/img-45.svg" class="item_img pb13px pr20px" /> --> <!-- <img src="@/assets/images/img-45.svg" class="item_img pb13px pr20px" /> -->
<img src="@/assets/images/img-41.png" class="item_img b !bottom--20px" /> <img
src="@/assets/images/img-41.png"
class="item_img b !bottom--20px"
/>
</div> </div>
<div class="item !h-188px cursor-pointer" @click="setModule('App_Lab', 'Diffspace')"> <div
<div class="item_title">AI差别化LAB</div> class="item !h-188px cursor-pointer"
@click="setModule('App_Lab', 'Diffspace')"
>
<div class="item_title hover:underline">AI差别化LAB</div>
<div class="item_sub-title">责任者调达研究院</div> <div class="item_sub-title">责任者调达研究院</div>
<div class="item_sub-title">差别化研究T</div> <div class="item_sub-title">差别化研究T</div>
<img src="@/assets/images/img-43.png" class="item_img" /> <img src="@/assets/images/img-43.png" class="item_img" />
</div> </div>
<div class="item !w-full flex flex-col cursor-pointer" @click="push({ name: 'StrategicPlanning' })"> <div
<div class="item_title">战略企划</div> class="item !w-full flex flex-col cursor-pointer"
@click="push({ name: 'StrategicPlanning' })"
>
<div class="item_title hover:underline">战略企划</div>
<div class="item_sub-title">责任者调达本部 管理G</div> <div class="item_sub-title">责任者调达本部 管理G</div>
<!-- <img src="./images/home-1.svg" /> --> <!-- <img src="./images/home-1.svg" /> -->
<div class="flex mt20px items-center justify-center"> <div class="flex mt20px items-center justify-center">
<div class="bg-#0038BE w210px px15px py7px rounded-30px"> <div class="bg-#0038BE w210px px15px py7px rounded-30px">
<img src="@/assets/images/biaoq2@2x.png" class="w25px h21px"> <img
src="@/assets/images/biaoq2@2x.png"
class="w25px h21px"
/>
重点Theme管理 重点Theme管理
</div> </div>
<span class="text-#000 font-thin underline-text mx23px">调达研究院</span> <span
<span class="text-#000 font-thin underline-text">调达中心</span> class="text-#000 font-thin underline-text mx23px hover:underline-solid"
>调达研究院</span
>
<span
class="text-#000 font-thin underline-text hover:underline-solid"
>调达中心</span
>
<!-- <VChart :option="chartOption2" autoresize /> --> <!-- <VChart :option="chartOption2" autoresize /> -->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
@ -655,8 +864,9 @@ function formatNumber(num = 0) {
background: #f4f5ff; background: #f4f5ff;
color: #142142; color: #142142;
} }
.data-table tr.header, .data-table tr.header th{ .data-table tr.header,
background: #417BEF; .data-table tr.header th {
background: #417bef;
color: white; color: white;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
@ -676,7 +886,7 @@ function formatNumber(num = 0) {
.icoT { .icoT {
padding: 5px; padding: 5px;
color: #fff; color: #fff;
background-color: #002AAE; background-color: #002aae;
border-radius: 5px; border-radius: 5px;
} }
@ -842,14 +1052,12 @@ function formatNumber(num = 0) {
padding: 16px; padding: 16px;
font-size: 14px; font-size: 14px;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
position: relative; position: relative;
} }
} }
}</style> }
</style>

View File

@ -3,24 +3,28 @@ import { getArticlePage,report } from '@/api/daikin/base'
import { message } from '@/utils/message' import { message } from '@/utils/message'
import { Swiper, SwiperSlide } from 'swiper/vue' import { Swiper, SwiperSlide } from 'swiper/vue'
import { Autoplay, Navigation, Pagination, A11y } from 'swiper' import { Autoplay, Navigation, Pagination, A11y } from 'swiper'
import { NCarousel } from 'naive-ui'; import { NCarousel } from 'naive-ui'
const route = useRoute() const route = useRoute()
const { push } = useRouter() const { push } = useRouter()
const listData = ref<any[]>([]) const listData = ref<any[]>([])
async function getPageList() { async function getPageList() {
const { code } = report({ moduleCode: 'App_Article' }) const { code } = report({ moduleCode: 'App_Article' })
const { rows } = await getArticlePage({ pageNum: 1, pageSize: 10, type: 2, position: 'homePage' } as any); const { rows } = await getArticlePage({
pageNum: 1,
pageSize: 10,
type: 2,
position: 'homePage'
} as any)
// console.log(rows) // console.log(rows)
// for (let index = 0; index < 50; index++) { // for (let index = 0; index < 50; index++) {
listData.value.push(...rows) listData.value = rows
// } // }
console.log(listData.value.length) console.log(listData.value.length)
} }
onMounted(getPageList) onMounted(getPageList)
// console.log(listData) // console.log(listData)
// const toDetail2 =(n: { id: any; })=>{ // const toDetail2 =(n: { id: any; })=>{
@ -33,39 +37,81 @@ onMounted(getPageList)
// message.info("") // message.info("")
// } // }
// } // }
const toDetail2 = (n: any) => {
// console.log(n)
if (n.id === 0) return
if (n.isSelect === 1) {
push(`/intelligence/${n.type == 2 ? 'within' : 'outside'}/` + n.id)
} else {
message.error('没有访问权限')
}
}
const modules = [Autoplay, Pagination, Navigation, A11y] const modules = [Autoplay, Pagination, Navigation, A11y]
</script> </script>
<template> <template>
<div class="card news cursor-pointer"> <div class="card news relative">
<div class="card_title" @click="push({ name: 'Intelligence' })">外部情报</div> <div
class="card_title cursor-pointer hover:underline"
@click="push({ name: 'Intelligence' })"
>
外部情报
</div>
<div class="card_sub-title">责任者调达研究院 研究企画T</div> <div class="card_sub-title">责任者调达研究院 研究企画T</div>
<div class="card_content"> <div class="card_content px-20px pt-30px pb-0">
<div class="news_card w-437px flex items-end gap-12px text-#fff/80"> <div
<img src="@/assets/images/bg-card6-text.svg" class="news_card w-437px flex items-end gap-12px text-#fff/80 !absolute right--20% top--38% scale-50"
class="h26px absolute left-16px top-16px animate__animated animate__zoomIn animate__delay-2s animate__slower animate__repeat-2" /> >
<div class="news_card_item i1 flex-1 w0 h100px p10px pt56px flex flex-col justify-around"> <img
<img src="@/assets/images/WATCHING@2x.png" src="@/assets/images/bg-card6-text.svg"
class="w41px h47px absolute left-40px top-25px animate__animated animate__infinite animate__heartBeat" /> class="h26px absolute left-16px top-16px animate__animated animate__zoomIn animate__delay-2s animate__slower animate__repeat-2"
<img src="@/assets/images/WATCHING2@2x.png" class="w80px left-10px top-10px" /> />
<div
class="news_card_item i1 flex-1 w0 h100px p10px pt56px flex flex-col justify-around"
>
<img
src="@/assets/images/WATCHING@2x.png"
class="w41px h47px absolute left-40px top-25px animate__animated animate__infinite animate__heartBeat"
/>
<img
src="@/assets/images/WATCHING2@2x.png"
class="w80px left-10px top-10px"
/>
<!-- <p class="truncate" v-if="listData && Array.isArray(listData) && listData.length > 0" v-for="i in listData.slice(0,2)" :key="i" @click="toDetail2(i)">{{ i.title }}</p> --> <!-- <p class="truncate" v-if="listData && Array.isArray(listData) && listData.length > 0" v-for="i in listData.slice(0,2)" :key="i" @click="toDetail2(i)">{{ i.title }}</p> -->
</div> </div>
<div class="news_card_item i2 flex-1 w0 h120px p10px pt56px flex flex-col justify-around"> <div
<img src="@/assets/images/ALARM@2x.png" class="news_card_item i2 flex-1 w0 h120px p10px pt56px flex flex-col justify-around"
class="w61px h63px absolute left-28px top-30px animate__animated animate__infinite animate__fadeIn" /> >
<img src="@/assets/images/ALARM2@2x.png" class="w70px left-15px top-14px" /> <img
src="@/assets/images/ALARM@2x.png"
class="w61px h63px absolute left-28px top-30px animate__animated animate__infinite animate__fadeIn"
/>
<img
src="@/assets/images/ALARM2@2x.png"
class="w70px left-15px top-14px"
/>
<!-- <p class="truncate" v-if="listData && Array.isArray(listData) && listData.length > 2" v-for="i in listData.slice(2,4)" :key="i" @click="toDetail2(i)">{{ i.title }}</p> --> <!-- <p class="truncate" v-if="listData && Array.isArray(listData) && listData.length > 2" v-for="i in listData.slice(2,4)" :key="i" @click="toDetail2(i)">{{ i.title }}</p> -->
</div> </div>
<div class="news_card_item i3 w140px h160px p10px pt70px flex flex-col justify-around"> <div
<img src="@/assets/images/WARNING@2x.png" class="news_card_item i3 w140px h160px p10px pt70px flex flex-col justify-around"
class="w82px h66px absolute left-30px top-45px animate__animated animate__infinite animate__flipOutY" /> >
<img src="@/assets/images//WARNING2@2x.png" class="w100px left-8px top-20px" /> <img
src="@/assets/images/WARNING@2x.png"
class="w82px h66px absolute left-30px top-45px animate__animated animate__infinite animate__flipOutY"
/>
<img
src="@/assets/images//WARNING2@2x.png"
class="w100px left-8px top-20px"
/>
<!-- <p class="truncate" v-if="listData && Array.isArray(listData) && listData.length > 4" v-for="i in listData.slice(4,7)" :key="i" @click="toDetail2(i)">{{ i.title }}</p> --> <!-- <p class="truncate" v-if="listData && Array.isArray(listData) && listData.length > 4" v-for="i in listData.slice(4,7)" :key="i" @click="toDetail2(i)">{{ i.title }}</p> -->
</div> </div>
</div> </div>
<div class="card_title !pl0 !pt0" @click="push({ name: 'News' })">最新News</div> <div
<div class="font-16px h-100px overflow-y-auto mt10px"> class="card_title !pl0 !pt0 cursor-pointer hover:underline"
@click="push({ name: 'News' })"
>
最新News
</div>
<div class="font-16px !h-230px overflow-y-auto mt10px">
<!-- <n-carousel direction="vertical" dot-placement="right" style="width: 100%; height: 100px" autoplay :interval="1200" <!-- <n-carousel direction="vertical" dot-placement="right" style="width: 100%; height: 100px" autoplay :interval="1200"
:slides-per-view="2" :space-between="0" :loop="false" mousewheel> :slides-per-view="2" :space-between="0" :loop="false" mousewheel>
<div class="mt-10px" v-if="listData && Array.isArray(listData) && listData.length > 0" v-for="i in listData" <div class="mt-10px" v-if="listData && Array.isArray(listData) && listData.length > 0" v-for="i in listData"
@ -77,24 +123,37 @@ const modules = [Autoplay, Pagination, Navigation, A11y]
</div> </div>
</n-carousel> --> </n-carousel> -->
<swiper id="swiperList2" v-if="listData" :slides-per-view="2" <swiper
:autoplay="{ delay: 1000, disableOnInteraction: false }" :speed="500" :space-between="0" :direction="'vertical'" id="swiperList2"
:scrollbar="{ draggable: false }" :loop="true" :modules="modules" style="height: 100px"> v-if="listData"
:slides-per-view="4"
:autoplay="{ delay: 1000, disableOnInteraction: false }"
:speed="500"
:space-between="10"
:direction="'vertical'"
:scrollbar="{ draggable: false }"
:loop="true"
:modules="modules"
style="height: 230px"
>
<swiper-slide v-for="(i, index) in listData" :key="index"> <swiper-slide v-for="(i, index) in listData" :key="index">
<div class="mt-10px"> <div class="mt-10px">
<div class="text-#142142 truncate text-16px"> <div class="text-#142142 truncate text-16px">
<a :href="i.url" class="no-underline text-#142142">{{ i.title}}</a> <a
@click="toDetail2(i)"
:href="i.url"
class="no-underline text-#142142 cursor-pointer hover:underline"
>{{ i.title }}</a
>
</div> </div>
<div class="text-#808696 mt-8px text-14px"> <div class="text-#808696 mt-8px text-14px">
<span>来源于: {{ i.source }}</span> &nbsp;&nbsp;&nbsp;<span>{{i.publishTime }}</span> <span>来源于: {{ i.source }}</span> &nbsp;&nbsp;&nbsp;<span>{{
i.publishTime
}}</span>
</div> </div>
</div> </div>
</swiper-slide> </swiper-slide>
</swiper> </swiper>
</div> </div>
</div> </div>
</div> </div>
@ -148,11 +207,8 @@ const modules = [Autoplay, Pagination, Navigation, A11y]
padding-bottom: 0; padding-bottom: 0;
margin-top: 10px; margin-top: 10px;
} }
} }
.topics { .topics {
.item { .item {
border-radius: 8px; border-radius: 8px;
@ -201,8 +257,8 @@ const modules = [Autoplay, Pagination, Navigation, A11y]
.news { .news {
.card_content { .card_content {
padding: 20px; // padding: 20px;
padding-top: 0; // padding-top: 0;
} }
.news_card { .news_card {

View File

@ -7,6 +7,7 @@ import { NIcon, useMessage, NCarousel } from 'naive-ui'
import { ChevronBack, ChevronForward } from '@vicons/ionicons5' import { ChevronBack, ChevronForward } from '@vicons/ionicons5'
import { ElCarousel, ElCarouselItem } from 'element-plus' import { ElCarousel, ElCarouselItem } from 'element-plus'
import { NPopover } from 'naive-ui' import { NPopover } from 'naive-ui'
import { isNotOneWeekAgo } from '@/utils'
import { getFootprintList } from '@/api/daikin/base' import { getFootprintList } from '@/api/daikin/base'
@ -194,6 +195,15 @@ const handleVisitsScoll = () => {
} }
} }
} }
const scroll = ({ scrollTop }: any) => {
const isAtBottom = scrollTop >= 400
if (isAtBottom) {
if (pageNum < maxMsgLingth) {
++pageNum
getZu(pageNum)
}
}
}
</script> </script>
<template> <template>
@ -232,24 +242,20 @@ const handleVisitsScoll = () => {
</div> </div>
<AppBlock class="w-full h325px box !b-0" style="box-shadow: none"> <AppBlock class="w-full h325px box !b-0" style="box-shadow: none">
<div class="w1200px px68px relative"> <div class="w1200px px68px relative">
<div <div class="swipe-nav nav-prev">
class="swipe-nav nav-prev"
>
<NIcon size="40" color="#537deb"> <NIcon size="40" color="#537deb">
<ChevronBack /> <ChevronBack />
</NIcon> </NIcon>
</div> </div>
<div <div class="swipe-nav nav-next">
class="swipe-nav nav-next"
>
<NIcon size="40" color="#537deb"> <NIcon size="40" color="#537deb">
<ChevronForward /> <ChevronForward />
</NIcon> </NIcon>
</div> </div>
<!-- :slides-per-group="3" --> <!-- :slides-per-group="3" -->
<!-- :autoplay="{delay: 3000, disableOnInteraction: false, pauseOnMouseEnter: true,stopOnLastSlide: false}" -->
<Swiper <Swiper
ref="swipeRef" ref="swipeRef"
:autoplay="{delay: 3000, disableOnInteraction: false, pauseOnMouseEnter: true,stopOnLastSlide: false}"
@swiper="setSwiperRef" @swiper="setSwiperRef"
class="h325px" class="h325px"
:slides-per-view="3" :slides-per-view="3"
@ -262,27 +268,33 @@ const handleVisitsScoll = () => {
:loop="true" :loop="true"
:navigation="{ :navigation="{
nextEl: '.nav-next', nextEl: '.nav-next',
prevEl: '.nav-prev', prevEl: '.nav-prev'
}" }"
> >
<template v-for="(i, index) in swiperList" :key="i"> <template v-for="(i, index) in swiperList" :key="index">
<SwiperSlide> <SwiperSlide>
<div <div
class="w340px h300px overflow-hidden bg-#F6F8FF mt10px relative rd-25px" class="w340px h300px overflow-hidden bg-#F6F8FF mt10px relative rd-25px"
style="box-shadow: 0px 7px 12px 0px #e7e7e7" style="box-shadow: 0px 7px 12px 0px #e7e7e7"
> >
<div <div
class="!bg-gradient-to-r !from-#5C87F5/90 !to-#466CCD/70 text-#fff px20px py15px text-18px truncates" class="flex items-center !bg-gradient-to-r !from-#5C87F5/90 !to-#466CCD/70 text-#fff font-[500] font-bold px20px py15px text-18px truncates"
> >
活动{{ index + 1 }} <img
{{ i.title }} v-if="isNotOneWeekAgo(i.createTime)"
src="@/assets/images/NEW.gif"
class="h-20px"
alt=""
/>
活动{{ index + 1 }}:
<span>{{ i.title }}</span>
<!-- <span class="float-right"><el-icon> <!-- <span class="float-right"><el-icon>
<ArrowRightBold /> <ArrowRightBold />
</el-icon></span> --> </el-icon></span> -->
</div> </div>
<div class="overflow-hidden w-full h-196px z-10"> <div class="overflow-hidden w-full h-206px z-10">
<!-- <el-carousel <!-- <el-carousel
autoplay autoplay
indicator-position="none" indicator-position="none"
@ -308,23 +320,28 @@ const handleVisitsScoll = () => {
effect="fade" effect="fade"
:interval="5000" :interval="5000"
:loop="true" :loop="true"
class="overflow-hidden box-border"
> >
<img <div
class="w-full h-200px overflow-hidden p10px"
v-if="i.imgUrl" v-if="i.imgUrl"
v-for="ite in i.imgUrl" v-for="ite in i.imgUrl"
>
<img
:src="ite.url" :src="ite.url"
class="p10px w-full max-h-200px image-container overflow-hidden" class="w-full max-h-200px image-container overflow-hidden"
/> />
</div>
</n-carousel> </n-carousel>
</div> </div>
<!-- <img :src="i.imgPath" class="p10px w-full max-h-180px rd-10px" @click="toDetail(i)" /> --> <!-- <img :src="i.imgPath" class="p10px w-full max-h-180px rd-10px" @click="toDetail(i)" /> -->
<div <div
class="left-0 right-0 bottom-0 text-#000 text-left px16px py6px z-100" class="absolute left-0 right-0 bottom-14px text-#000 text-18px text-left px16px py6px z-100 transition-none"
> >
<div class="max-w500px text-12px flex flex-col"> <div class="max-w500px text-16px flex flex-col">
<div class="flex items-center"> <div class="flex items-center max-w-[84%]">
<img <img
src="../../../assets/images/lvbiao@2x.png" src="../../../assets/images/lvbiao@2x.png"
class="mr-5px" class="mr-5px"
@ -332,9 +349,10 @@ const handleVisitsScoll = () => {
<n-popover trigger="hover" placement="top-start"> <n-popover trigger="hover" placement="top-start">
<template #trigger> <template #trigger>
<span <span
class="truncate text-16px" class="truncate text-18px !min-w-[auto]"
@click="toDetail(i)" @click="toDetail(i)"
> {{ i.filePath[0]?.originalFileName }} >
{{ i.filePath[0]?.originalFileName }}
</span> </span>
</template> </template>
<div class="text-18px leading-40px"> <div class="text-18px leading-40px">
@ -343,14 +361,14 @@ const handleVisitsScoll = () => {
</n-popover> </n-popover>
</div> </div>
<div <div
v-if="i.filePath.length > 1" v-if="i.filePath.length >= 1"
title="查看更多" title="查看更多"
@click="toDetail(i)" @click="toDetail(i)"
class="cursor-pointer right--20px top-0px w60px pt-6px flex items-center ml-auto text-right" class="absolute cursor-pointer right--14px top-0px w60px pt-3px flex items-center ml-auto text-right"
style=" style="
color: #4d7ee8; color: #4d7ee8;
text-align: center; text-align: center;
font-size: 14px; font-size: 16px;
" "
> >
更多<el-icon> 更多<el-icon>
@ -414,25 +432,42 @@ const handleVisitsScoll = () => {
>更多<el-icon> <DArrowRight class="" /> </el-icon >更多<el-icon> <DArrowRight class="" /> </el-icon
></span> ></span>
<!-- <div ref="msgScoll" class="px20px h280px cent_box overflow-y-scroll "> --> <!-- <div ref="msgScoll" class="px20px h280px cent_box overflow-y-scroll "> -->
<div ref="msgScoll" class="px20px h280px cent_box overflow-y-scroll"> <!-- <div
ref="msgScoll"
class="px20px h280px cent_box overflow-y-scroll"
> -->
<el-scrollbar
class="px20px"
ref=""
height="280px"
always
@scroll="scroll"
>
<!-- <div class="text-#808696 bg-#F4F8FF py10px rd-5px mt10px" v-for="(i, key) in dataList" :key="i"> --> <!-- <div class="text-#808696 bg-#F4F8FF py10px rd-5px mt10px" v-for="(i, key) in dataList" :key="i"> -->
<div <div
class="text-#808696 bg-#F4F8FF py10px rd-5px mt10px" class="text-#808696 bg-#F4F8FF py10px rd-5px mt10px"
v-for="(i, key) in dataList" v-for="(i, key) in dataList"
:key="i" :key="i"
> >
<div class="truncate2" @click="toDetail(i)"> <div class="truncate2 flex items-center" @click="toDetail(i)">
<span <span
class="text-#fff bg-#407DF1 px5px text-18px rounded-20px mr-5px inlineFlex" class="text-#fff bg-#407DF1 px5px text-18px rounded-20px mr-5px inlineFlex"
>{{ ++key }}</span >{{ ++key }}</span
> >
<span class="text-18px">{{ i.title }}</span> <span class="text-18px mr-2">{{ i.title }}</span>
<img
v-if="isNotOneWeekAgo(i.createTime)"
src="@/assets/images/NEW.gif"
class="h-20px"
alt=""
/>
</div> </div>
<span class="absolute right-10px top-24px text-18px">{{ <span class="absolute right-10px top-24px text-18px">{{
i.createTime i.createTime
}}</span> }}</span>
</div> </div>
</div> </el-scrollbar>
<!-- </div> -->
</div> </div>
<div class="w-50% h-375px bg-#fff float-left ml-1%"> <div class="w-50% h-375px bg-#fff float-left ml-1%">
<div class="text-24px font-bold p20px">碳足迹平台</div> <div class="text-24px font-bold p20px">碳足迹平台</div>

View File

@ -1,17 +1,24 @@
<script setup lang="ts"> <script setup lang="ts">
// import {message} from '@/utils/message' // import {message} from '@/utils/message'
import {fetchCsrSupplier,fetchCsrSupplierList,fetchCsrSupplierTopList,fetchCsrSupplierTaskInfo} from '@/api/daikin/base' import {
fetchCsrSupplier,
fetchCsrSupplierList,
fetchCsrSupplierTopList,
fetchCsrSupplierTaskInfo
} from '@/api/daikin/base'
const query = ref<any>({ const query = ref<any>({
year: '', year: '',
supplierName: '' supplierName: ''
}) })
query.value.year = new Date().getFullYear() + '' const year = new Date().getFullYear()
const month = new Date().getMonth()
const jpMonth = (month < 3 ? year - 1 : year) + ''
query.value.year = jpMonth
const calendar = [4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3] const calendar = [4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3]
const calendarShow = new Date().getMonth() + 1 const calendarShow = new Date().getMonth() + 1
const nowIndexMonth = calendar.indexOf(calendarShow) const nowIndexMonth = calendar.indexOf(calendarShow)
const updateTime = ref(''); const updateTime = ref('')
const handleChange = () => { const handleChange = () => {
getCsrSupplier() getCsrSupplier()
@ -22,10 +29,24 @@ const isDateDisabled = (date:any) => {
return date > new Date() return date > new Date()
} }
const csrSupplier = ref<any>([]) const csrSupplier = ref<any>([])
const csrSupplierObj = ref<any>({}); const csrSupplierObj = ref<any>({})
const months = ['04','05','06','07','08','09','10','11','12','01','02','03'] const months = [
'04',
'05',
'06',
'07',
'08',
'09',
'10',
'11',
'12',
'01',
'02',
'03'
]
const loading = ref(false)
const getCsrSupplier = () => { const getCsrSupplier = () => {
loading.value = true
months.forEach((item: any) => { months.forEach((item: any) => {
csrSupplierObj.value[item] = { month: item } csrSupplierObj.value[item] = { month: item }
}) })
@ -33,38 +54,52 @@ const getCsrSupplier = ()=>{
fetchCsrSupplier(req).then(({ data = {} }) => { fetchCsrSupplier(req).then(({ data = {} }) => {
const resData = Object.keys(data) || [] const resData = Object.keys(data) || []
try { try {
csrSupplier.value = resData.length ? resData.map(key => { csrSupplier.value = resData.length
? resData.map((key) => {
const obj = data[key] || {} const obj = data[key] || {}
const month = String(key).split('-')?.[1] || '' const month = String(key).split('-')?.[1] || ''
Object.assign(csrSupplierObj.value[month], obj) Object.assign(csrSupplierObj.value[month], obj)
return { return {
key, key,
month, month,
data: obj, data: obj
} }
}) : [] })
} catch (error) { : []
} } catch (error) {}
console.log("🚀 ~ file: CSRContent23.vue:50 ~ csrSupplierObj:", csrSupplierObj) console.log(
'🚀 ~ file: CSRContent23.vue:50 ~ csrSupplierObj:',
csrSupplierObj
)
if (!csrSupplier.value.length) { if (!csrSupplier.value.length) {
// message.warning('') // message.warning('')
csrSupplierObj.value = {} csrSupplierObj.value = {}
} }
}) })
setTimeout(() => {
loading.value = false
}, 300)
} }
const csrSupplierList = ref<any>([]) const csrSupplierList = ref<any>([])
const selMonth = ref('') const selMonth = ref('')
const getCsrSupplierList = (index?: any) => { const getCsrSupplierList = (index?: any) => {
const month = (index || index=== 0) ? query.value.year +'-'+ months[index] : '' const month =
index || index === 0 ? query.value.year + '-' + months[index] : ''
csrSupplierList.value = [] csrSupplierList.value = []
selMonth.value = '' selMonth.value = ''
const req = { pageNum: 1, pageSize: 10, ...query.value, month } const req = { pageNum: 1, pageSize: 10, ...query.value, month }
req.supplierName ? fetchCsrSupplierList(req).then((res : any)=>{ req.supplierName
csrSupplierList.value = (res.rows || []).filter((item:any) => item.submitunCount > 0) ? fetchCsrSupplierList(req).then((res: any) => {
}) : fetchCsrSupplierTopList(req).then((res : any)=>{ csrSupplierList.value = (res.rows || []).filter(
csrSupplierList.value = (res.rows || []).filter((item:any) => item.submitunCount > 0) (item: any) => item.submitunCount > 0
}); )
})
: fetchCsrSupplierTopList(req).then((res: any) => {
csrSupplierList.value = (res.rows || []).filter(
(item: any) => item.submitunCount > 0
)
})
selMonth.value = month ? +months[index] + '月' : '' selMonth.value = month ? +months[index] + '月' : ''
} }
@ -81,129 +116,300 @@ const handleMonth = (index:number) => {
getCsrSupplier() getCsrSupplier()
getCsrSupplierList() getCsrSupplierList()
getCsrSupplierTaskInfo() getCsrSupplierTaskInfo()
</script> </script>
<template> <template>
<div class="flex w-full rounded-18px"> <div class="flex w-full rounded-18px">
<!-- <AppBlock> --> <!-- <AppBlock> -->
<!-- <img src="./images/goudongxi2.png" class="w-full h-full" /> --> <!-- <img src="./images/goudongxi2.png" class="w-full h-full" /> -->
<div class="relative overflow-hidden w-full bg-#f4f4f4 flex flex-wrap justify-between h-full rd-25px">
<div <div
v-if="false" class="relative overflow-hidden w-full bg-#f4f4f4 flex flex-wrap justify-between h-full rd-25px"
class="absolute flex flex-col w-full h-full z-100 top-0 left-0 text-center bg-red justify-center items-center"
style="background-color: rgba(255, 255, 255, 0.8)"
> >
<img src="@/assets/images/chah.png" class="h-300px object-contain" />
<br />
<div class="text-#5683DB text-46px mt-10">做成中,敬请期待</div>
</div>
<div class="cards"> <div class="cards">
<div class="cards_title">供方月度碳排放数据提交情况</div> <div class="cards_title">供方月度碳排放数据提交情况</div>
<div class="!text-18px right-20 pt30px text-#4E7EE8"> <div class="!text-18px right-20 pt30px text-#4E7EE8">
<a href="https://procurement.daikin.net.cn/mingdao/portal/app/7abea528-f7b4-4437-84bb-6b6b169bad3d" <a
class="no-underline text-#4E7EE8 "><img src="./images/yuny@2x.png" href="https://procurement.daikin.net.cn/mingdao/portal/app/7abea528-f7b4-4437-84bb-6b6b169bad3d"
class="w25px mr5px mt--4px" /><span>明道云</span></a> class="no-underline text-#4E7EE8"
><img src="./images/yuny@2x.png" class="w25px mr5px mt--4px" /><span
>明道云</span
></a
>
</div> </div>
<div class="flex w-full h-80px p20px items-center mt10px"> <div class="flex w-full h-80px p20px items-center mt10px">
<div> <div>
<el-date-picker v-model="query.year" type="year" @change="handleChange" placeholder="" :disabled-date="isDateDisabled" :clearable="false" value-format="YYYY" /> <el-date-picker
v-model="query.year"
type="year"
@change="handleChange"
placeholder=""
:disabled-date="isDateDisabled"
:clearable="false"
value-format="YYYY"
/>
</div> </div>
<el-input v-model.trim="query.supplierName" class="w-50 m-2" placeholder="供方名" prefix-icon="Search" width="150px"/> <el-input
v-model.trim="query.supplierName"
class="w-50 m-2"
placeholder="供方名"
prefix-icon="Search"
width="150px"
/>
<el-button type="primary" @click="handleChange"></el-button> <el-button type="primary" @click="handleChange"></el-button>
</div> </div>
<div class="w-full h-730px p20px"> <div class="w-full h-730px p20px" v-loading="loading">
<el-row :gutter="10" v-if="false"> <el-row :gutter="10" v-if="false">
<el-col :span="8"><div class="times" > <el-col :span="8"
<div class="text-#fff text-18px font-bold absolute left-40% top-18px"><span class="text-30px">1</span></div> ><div class="times">
<div class="bg-#fff w-120px absolute top-70px text-#A0C6B5 text-16px font-bold p10px left-15%">已提交45</div> <div
<div class="bg-#fff w-120px absolute top-110px text-red text-16px font-bold p10px left-15%">未提交100</div> class="text-#fff text-18px font-bold absolute left-40% top-18px"
</div></el-col> >
<el-col :span="8"><div class="time" > <span class="text-30px">1</span>
<div class="text-#d3d2d2 text-18px font-bold absolute left-40% top-45%"><span class="text-60px">2</span></div> </div>
</div></el-col> <div
<el-col :span="8"><div class="time"> class="bg-#fff w-120px absolute top-70px text-#A0C6B5 text-16px font-bold p10px left-15%"
<div class="text-#d3d2d2 text-18px font-bold absolute left-40% top-45%"><span class="text-60px">3</span></div> >
</div></el-col> 已提交45
</div>
<div
class="bg-#fff w-120px absolute top-110px text-red text-16px font-bold p10px left-15%"
>
未提交100
</div>
</div></el-col
>
<el-col :span="8"
><div class="time">
<div
class="text-#d3d2d2 text-18px font-bold absolute left-40% top-45%"
>
<span class="text-60px">2</span>
</div>
</div></el-col
>
<el-col :span="8"
><div class="time">
<div
class="text-#d3d2d2 text-18px font-bold absolute left-40% top-45%"
>
<span class="text-60px">3</span>
</div>
</div></el-col
>
</el-row> </el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="8" v-for="(it, i) in months" :key="i"> <el-col :span="8" v-for="(it, i) in months" :key="i">
<div :class=" i <= nowIndexMonth ? 'times' : 'time'" @click="handleMonth(i)" > <div
<div v-if="i > nowIndexMonth" class="text-#d3d2d2 text-18px font-bold absolute left-40% top-45%"><span class="text-60px">{{ +it }}</span></div> v-show="!loading"
<template v-if="i <= nowIndexMonth"> :class="
<div class="text-#fff text-18px font-bold absolute left-40% top-24px"><span class="text-24px">{{ +it }}</span></div> i <= nowIndexMonth && query.year == jpMonth ? 'times' : 'time'
<div class="bg-#fff w-140px absolute top-70px text-#A0C6B5 text-18px font-bold p10px left-10% rounded-xl">已提交{{csrSupplierObj[it]?.submitedCount || 0 }}</div> "
<div class="bg-#fff w-140px absolute top-110px text-red text-18px font-bold p10px left-10% rounded-xl">未提交{{ csrSupplierObj[it]?.submitunCount || 0 }}</div> @click="handleMonth(i)"
>
<div
v-if="i > nowIndexMonth || query.year != jpMonth"
class="text-#d3d2d2 text-18px font-bold absolute left-40% top-45%"
>
<span class="text-60px">{{ +it }}</span
>
</div>
<template
v-if="
i <= nowIndexMonth &&
(query.year == jpMonth || !!csrSupplierObj[it])
"
>
<div
class="text-#fff text-18px font-bold absolute left-40% top-24px"
>
<span class="text-24px">{{ +it }}</span
>
</div>
<div
class="bg-#fff w-140px absolute top-70px text-#A0C6B5 text-18px font-bold p10px left-10% rounded-xl"
>
已提交{{ csrSupplierObj[it]?.submitedCount || 0 }}
</div>
<div
class="bg-#fff w-140px absolute top-110px text-red text-18px font-bold p10px left-10% rounded-xl"
>
未提交{{ csrSupplierObj[it]?.submitunCount || 0 }}
</div>
</template> </template>
</div> </div>
</el-col> </el-col>
<el-col :span="8" v-if="false"><div class="time" > <el-col :span="8" v-if="false"
<div class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"><span class="text-60px">5</span></div> ><div class="time">
<div
class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"
>
<span class="text-60px">5</span>
</div>
<template v-if="false"> <template v-if="false">
<div class="bg-#fff w-120px absolute top-70px text-#A0C6B5 text-16px font-bold p10px left-15% rounded-xl">已提交45</div> <div
<div class="bg-#fff w-120px absolute top-110px text-red text-16px font-bold p10px left-15% rounded-xl">未提交100</div> class="bg-#fff w-120px absolute top-70px text-#A0C6B5 text-16px font-bold p10px left-15% rounded-xl"
>
已提交45
</div>
<div
class="bg-#fff w-120px absolute top-110px text-red text-16px font-bold p10px left-15% rounded-xl"
>
未提交100
</div>
</template> </template>
</div></el-col> </div></el-col
<el-col :span="8" v-if="false"><div class="time"> >
<div class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"><span class="text-60px">6</span></div> <el-col :span="8" v-if="false"
</div></el-col> ><div class="time">
<div
class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"
>
<span class="text-60px">6</span>
</div>
</div></el-col
>
</el-row> </el-row>
<el-row :gutter="10" v-if="false"> <el-row :gutter="10" v-if="false">
<el-col :span="8"><div class="time" > <el-col :span="8"
<div class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"><span class="text-60px">7</span></div> ><div class="time">
</div></el-col> <div
<el-col :span="8"><div class="time" > class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"
<div class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"><span class="text-60px">8</span></div> >
</div></el-col> <span class="text-60px">7</span>
<el-col :span="8"><div class="times"> </div>
</div></el-col
>
<el-col :span="8"
><div class="time">
<div
class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"
>
<span class="text-60px">8</span>
</div>
</div></el-col
>
<el-col :span="8"
><div class="times">
<!-- <div class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"><span class="text-60px">9</span></div> --> <!-- <div class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"><span class="text-60px">9</span></div> -->
<div class="text-#fff text-18px font-bold absolute left-40% top-24px"><span class="text-24px">9</span></div> <div
<div class="bg-#fff w-140px absolute top-70px text-#A0C6B5 text-18px font-bold p10px left-10% rounded-xl">已提交45</div> class="text-#fff text-18px font-bold absolute left-40% top-24px"
<div class="bg-#fff w-140px absolute top-110px text-red text-18px font-bold p10px left-10% rounded-xl">未提交100</div> >
</div></el-col> <span class="text-24px">9</span>
</div>
<div
class="bg-#fff w-140px absolute top-70px text-#A0C6B5 text-18px font-bold p10px left-10% rounded-xl"
>
已提交45
</div>
<div
class="bg-#fff w-140px absolute top-110px text-red text-18px font-bold p10px left-10% rounded-xl"
>
未提交100
</div>
</div></el-col
>
</el-row> </el-row>
<el-row :gutter="10" v-if="false"> <el-row :gutter="10" v-if="false">
<el-col :span="8"><div class="time" > <el-col :span="8"
<div class="text-#d3d2d2 text-18px font-bold absolute left-30% top-45%"><span class="text-60px">10</span></div> ><div class="time">
</div></el-col> <div
<el-col :span="8"><div class="time" > class="text-#d3d2d2 text-18px font-bold absolute left-30% top-45%"
<div class="text-#d3d2d2 text-18px font-bold absolute left-30% top-45%"><span class="text-60px">11</span></div> >
</div></el-col> <span class="text-60px">10</span>
<el-col :span="8"><div class="time"> </div>
<div class="text-#d3d2d2 text-18px font-bold absolute left-30% top-45%"><span class="text-60px">12</span></div> </div></el-col
</div></el-col> >
<el-col :span="8"
><div class="time">
<div
class="text-#d3d2d2 text-18px font-bold absolute left-30% top-45%"
>
<span class="text-60px">11</span>
</div>
</div></el-col
>
<el-col :span="8"
><div class="time">
<div
class="text-#d3d2d2 text-18px font-bold absolute left-30% top-45%"
>
<span class="text-60px">12</span>
</div>
</div></el-col
>
</el-row> </el-row>
<el-row :gutter="10" v-if="false"> <el-row :gutter="10" v-if="false">
<el-col :span="8"><div class="time" > <el-col :span="8"
<div class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"><span class="text-60px">1</span></div> ><div class="time">
<div
class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"
>
<span class="text-60px">1</span>
</div>
<template v-if="false"> <template v-if="false">
<div class="bg-#fff w-120px absolute top-70px text-#A0C6B5 text-16px font-bold p10px left-15%">已提交45</div> <div
<div class="bg-#fff w-120px absolute top-110px text-red text-16px font-bold p10px left-15%">未提交100</div> class="bg-#fff w-120px absolute top-70px text-#A0C6B5 text-16px font-bold p10px left-15%"
>
已提交45
</div>
<div
class="bg-#fff w-120px absolute top-110px text-red text-16px font-bold p10px left-15%"
>
未提交100
</div>
</template> </template>
</div></el-col> </div></el-col
<el-col :span="8"><div class="time" > >
<div class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"><span class="text-60px">2</span></div> <el-col :span="8"
</div></el-col> ><div class="time">
<el-col :span="8"><div class="time"> <div
<div class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"><span class="text-60px">3</span></div> class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"
</div></el-col> >
<span class="text-60px">2</span>
</div>
</div></el-col
>
<el-col :span="8"
><div class="time">
<div
class="text-#d3d2d2 text-18px font-bold absolute left-38% top-45%"
>
<span class="text-60px">3</span>
</div>
</div></el-col
>
</el-row> </el-row>
</div> </div>
</div> </div>
<div class="cards"> <div class="cards">
<div class="cards_title relative">
<div class="cards_title relative">未提交供应商明细({{query.year}}{{ selMonth }})</div> 未提交供应商明细({{ query.year }}{{ selMonth }})
<div class="absolute top-24px !text-18px right-20px pt30px text-#4E7EE8 "> </div>
<div
class="absolute top-24px !text-18px right-20px pt30px text-#4E7EE8"
>
<span class="text-#ababab">更新时间{{ updateTime }}</span> <span class="text-#ababab">更新时间{{ updateTime }}</span>
</div> </div>
<div ref="msgScoll" class="px20px w-full h800px cent_box overflow-y-auto mt-12px"> <div
ref="msgScoll"
<div v-if=" csrSupplierList?.length" class=" text-18px text-#808696 bg-#F4F8FF items-center flex py10px rd-5px mt10px" v-for="(i, key) in csrSupplierList" :key="key"> class="px20px w-full h800px cent_box overflow-y-auto mt-12px"
>
<div
v-if="csrSupplierList?.length"
class="text-18px text-#808696 bg-#F4F8FF items-center flex py10px rd-5px mt10px"
v-for="(i, key) in csrSupplierList"
:key="key"
>
<div class="truncate2" @click=""> <div class="truncate2" @click="">
<span class="text-#fff bg-#407DF1 px8px rounded-1/2 mr-5px inlineFlex">{{ ++key }}</span> <span
class="text-#fff bg-#407DF1 px8px rounded-1/2 mr-5px inlineFlex"
>{{ ++key }}</span
>
<span>{{ i.supplierName }} </span> <span>{{ i.supplierName }} </span>
</div> </div>
<div class="min-w130px max-w130px text-#000">{{i.submitunCount}}次未提交</div> <div class="min-w130px max-w130px text-#000">
{{ i.submitunCount }}次未提交
</div>
<!-- <div class="min-w150px max-w150px text-#000">{{++key}}月未提交</div> --> <!-- <div class="min-w150px max-w150px text-#000">{{++key}}月未提交</div> -->
<span class="absolute right-10px top-18px"> <span class="absolute right-10px top-18px">
<!-- 暂不开发 12-03 --> <!-- 暂不开发 12-03 -->
@ -214,7 +420,6 @@ getCsrSupplierTaskInfo()
<el-empty description="该月份下供应商全部提交" :image-size="300" /> <el-empty description="该月份下供应商全部提交" :image-size="300" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -232,7 +437,6 @@ getCsrSupplierTaskInfo()
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
} }
.time { .time {
width: 175px; width: 175px;
@ -256,7 +460,7 @@ getCsrSupplierTaskInfo()
padding-bottom: 0; padding-bottom: 0;
&::before { &::before {
content: " "; content: ' ';
display: block; display: block;
width: 8px; width: 8px;
height: 30px; height: 30px;
@ -278,7 +482,7 @@ getCsrSupplierTaskInfo()
cursor: pointer; cursor: pointer;
a { a {
text-decoration: none text-decoration: none;
} }
} }
:deep { :deep {

View File

@ -1,13 +1,14 @@
<template> <template>
<HomeHead class="top"> <HomeHead class="top"> </HomeHead>
</HomeHead>
<div class="w-full h-1px bg-#507FFD mt50px rd-b-20px"></div> <div class="w-full h-1px bg-#507FFD mt50px rd-b-20px"></div>
<div class="bg-#fff rd-15px px30px pt30px w-full"> <div class="bg-#fff rd-15px px30px pt30px w-full">
<el-tabs v-model="activeName" class="demo-tabs"> <el-tabs v-model="activeName" class="demo-tabs">
<el-button class="float-right px20px py10px z-200 cursor-pointer felx items-center" type="info" @click="goBacks"> <el-button
class="float-right px20px py10px z-200 cursor-pointer felx items-center"
type="info"
@click="goBacks"
>
<el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon> <el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon>
</el-button> </el-button>
<el-tab-pane label="banner管理" name="first"> <el-tab-pane label="banner管理" name="first">
@ -15,57 +16,112 @@
新增 新增
</el-button> </el-button>
<el-button class="button mt--20px" @click="getUser('1')" :type="userData?'success':'primary'" :icon="userData?'Check':''">{{userData?'已设置':'查看范围设置'}}</el-button> <el-button
class="button mt--20px"
@click="getUser('1')"
:type="userData ? 'success' : 'primary'"
:icon="userData ? 'Check' : ''"
>{{ userData ? '已设置' : '查看范围设置' }}</el-button
>
<div class="w100% h750px overflow-auto"> <div class="w100% h750px overflow-auto">
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px" row-key="id" border <el-table
default-expand-all :header-cell-style="{textAlign: 'center', :data="tableData"
background: '#2A7BF7', color: '#fff', style="width: 100%; margin-bottom: 20px"
height: '60px', 'font-size': '24px' row-key="id"
}" :cell-style="{ 'overflow-y': 'auto' }" border
:tree-props="{ children: 'childList', hasChildren: 'hasChildren'}"> default-expand-all
:header-cell-style="{
textAlign: 'center',
background: '#2A7BF7',
color: '#fff',
height: '60px',
'font-size': '24px'
}"
:cell-style="{ 'overflow-y': 'auto' }"
:tree-props="{ children: 'childList', hasChildren: 'hasChildren' }"
>
<el-table-column prop="title" label="标题" align="center" /> <el-table-column prop="title" label="标题" align="center" />
<el-table-column prop="imgUrl" label="图片" align="center"> <el-table-column prop="imgUrl" label="图片" align="center">
<template #default="scope"> <template #default="scope">
<div style="display: grid;grid-template-columns: repeat(3,1fr);grid-template-rows: masonry;grid-gap: 2px;"> <div
<img v-if="scope.row.imgUrl" v-for="i in scope.row.imgUrl" :src="i.url" alt="" class="w-full"> style="
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: masonry;
grid-gap: 2px;
"
>
<img
v-if="scope.row.imgUrl"
v-for="i in scope.row.imgUrl"
:src="i.url"
alt=""
class="w-full"
/>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="filePath" label="文件列表" align="center"> <el-table-column prop="filePath" label="文件列表" align="center">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.filePath" v-for="i in scope.row.filePath">{{i.originalFileName}}<br></span> <span v-if="scope.row.filePath" v-for="i in scope.row.filePath"
>{{ i.originalFileName }}<br
/></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="address" label="操作" align="center"> <el-table-column prop="address" label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button type="primary" @click="editClickA('edit', scope.row)" class="mb-20px"> <el-button
编辑</el-button> type="primary"
@click="editClickA('edit', scope.row)"
class="mb-20px"
>
编辑</el-button
>
<el-button type="danger" @click="deleteClickA(scope.row)" class="mb-20px"> 删除</el-button> <el-button
type="danger"
@click="deleteClickA(scope.row)"
class="mb-20px"
>
删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="足迹管理" name="second"> <el-tab-pane label="足迹管理" name="second">
<el-button type="primary" @click="editClickB('add')" class="mb-20px"> <el-button type="primary" @click="editClickB('add')" class="mb-20px">
新增 新增
</el-button> </el-button>
<el-button class="button mt--20px" @click="getUser('2')" :type="userData?'success':'primary'" :icon="userData?'Check':''">{{userData?'已设置':'查看范围设置'}}</el-button> <el-button
class="button mt--20px"
@click="getUser('2')"
:type="userData ? 'success' : 'primary'"
:icon="userData ? 'Check' : ''"
>{{ userData ? '已设置' : '查看范围设置' }}</el-button
>
<div class="w100% h750px overflow-auto"> <div class="w100% h750px overflow-auto">
<el-table :data="tableDataB" style="width: 100%; margin-bottom: 20px" row-key="id" border <el-table
default-expand-all :header-cell-style="{textAlign: 'center', :data="tableDataB"
background: '#2A7BF7', color: '#fff', style="width: 100%; margin-bottom: 20px"
height: '60px', 'font-size': '24px' row-key="id"
}" :cell-style="{ 'overflow-y': 'auto' }" border
:tree-props="{ children: 'childList', hasChildren: 'hasChildren'}"> default-expand-all
:header-cell-style="{
textAlign: 'center',
background: '#2A7BF7',
color: '#fff',
height: '60px',
'font-size': '24px'
}"
:cell-style="{ 'overflow-y': 'auto' }"
:tree-props="{ children: 'childList', hasChildren: 'hasChildren' }"
>
<!-- <!--
<el-table-column prop="imgUrl" label="图片" align="center"> <el-table-column prop="imgUrl" label="图片" align="center">
<template #default="scope"> <template #default="scope">
@ -74,30 +130,41 @@
</el-table-column> --> </el-table-column> -->
<el-table-column prop="title" label="标题" align="center" /> <el-table-column prop="title" label="标题" align="center" />
<el-table-column prop="createTime" label="上传时间" align="center"/> <el-table-column
prop="createTime"
label="上传时间"
align="center"
/>
<el-table-column prop="filePath" label="文件列表" align="center"> <el-table-column prop="filePath" label="文件列表" align="center">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.filePath" v-for="i in scope.row.filePath">{{i.originalFileName}}<br></span> <span v-if="scope.row.filePath" v-for="i in scope.row.filePath"
>{{ i.originalFileName }}<br
/></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="address" label="操作" align="center"> <el-table-column prop="address" label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button type="primary" @click="editClickB('edit', scope.row)" class="mb-20px"> <el-button
编辑</el-button> type="primary"
@click="editClickB('edit', scope.row)"
class="mb-20px"
>
编辑</el-button
>
<el-button type="danger" @click="deleteClickB(scope.row)" class="mb-20px"> 删除</el-button> <el-button
type="danger"
@click="deleteClickB(scope.row)"
class="mb-20px"
>
删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<NModal v-model:show="shomkA"> <NModal v-model:show="shomkA">
@ -119,34 +186,45 @@
action="/test-api/common/upload" action="/test-api/common/upload"
list-type="picture-card" list-type="picture-card"
:on-exceed="handOnExceed" :on-exceed="handOnExceed"
:on-preview="handlePictureCardPreview"
:limit="5" :limit="5"
multiple="true" :multiple="true"
> >
<el-icon><Plus /></el-icon> <el-icon><Plus /></el-icon>
</el-upload> </el-upload>
<el-dialog v-model="dialogVisible">
<img w-full :src="dialogImageUrl" alt="选择图片" />
</el-dialog>
</el-form-item> </el-form-item>
<br /> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" :on-exceed="handOnExceed" multiple="true" > v-model:file-list="editA.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
:on-exceed="handOnExceed"
:multiple="true"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br /> <br />
<div class="text-center"> <div class="text-center">
<el-button type="primary" @click="addClickA(editA)" class="mb-20px"> 确认</el-button> <el-button type="primary" @click="addClickA(editA)" class="mb-20px">
确认</el-button
>
</div> </div>
</el-form> </el-form>
</div> </div>
</NModal> </NModal>
<NModal v-model:show="dialogVisible" :z-index="999999">
<img
class="object-contain max-w-65%"
:src="dialogImageUrl"
alt="选择图片"
/>
</NModal>
<NModal v-model:show="shomkB"> <NModal v-model:show="shomkB">
<div class="bg-#FFF p30px"> <div class="bg-#FFF p30px">
<el-form :model="editB" label-width="120px" :inline="true"> <el-form :model="editB" label-width="120px" :inline="true">
@ -156,43 +234,57 @@
<br /> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editB.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" :on-exceed="handOnExceed" multiple="true"> v-model:file-list="editB.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
:on-exceed="handOnExceed"
:multiple="true"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br /> <br />
<div class="text-center"> <div class="text-center">
<el-button type="primary" @click="addClickB(editB)" class="mb-20px"> 确认</el-button> <el-button type="primary" @click="addClickB(editB)" class="mb-20px">
确认</el-button
>
</div> </div>
</el-form> </el-form>
</div> </div>
</NModal> </NModal>
<n-modal v-model:show="showModal"> <n-modal v-model:show="showModal">
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss"/> <UserList
:userDataList="setUserList"
@clickChild="handleChild"
@CloseThis="CloseThiss"
/>
</n-modal> </n-modal>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import HomeHead from '@/views/home/components/HomeHead.vue' import HomeHead from '@/views/home/components/HomeHead.vue'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import { updateFootprint,getFootprintList,saveFootprintUser,delFootprint,fetchGetViewScope} from '@/api/daikin/base' import {
import { NModal, useMessage, NSelect } from "naive-ui"; updateFootprint,
getFootprintList,
saveFootprintUser,
delFootprint,
fetchGetViewScope
} from '@/api/daikin/base'
import { NModal, useMessage, NSelect } from 'naive-ui'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
const store = useUserStore() const store = useUserStore()
const message = useMessage() const message = useMessage()
const tableData = ref() const tableData = ref()
const tableDataB = ref() const tableDataB = ref()
const shomkA = ref() const shomkA = ref(false)
const shomkB = ref() const shomkB = ref(false)
const editA = ref() const editA = ref()
const editB = ref() const editB = ref()
const pageInfo = reactive({ const pageInfo = reactive({
@ -206,16 +298,22 @@ const pageInfos = reactive({
total: 10 total: 10
}) })
async function getTree() { async function getTree() {
const { rows,total } = await getFootprintList({pageNum:pageInfo.pageNum,pageSize:pageInfo.pageSize,moduleId:'1'}) const { rows, total } = await getFootprintList({
const { rows:row,total:tota} = await getFootprintList({pageNum:pageInfos.pageNum,pageSize:pageInfos.pageSize,moduleId:'2'}) pageNum: pageInfo.pageNum,
pageSize: pageInfo.pageSize,
moduleId: '1'
})
const { rows: row, total: tota } = await getFootprintList({
pageNum: pageInfos.pageNum,
pageSize: pageInfos.pageSize,
moduleId: '2'
})
pageInfo.total = total pageInfo.total = total
pageInfos.total = tota pageInfos.total = tota
tableData.value = rows tableData.value = rows
tableDataB.value = row tableDataB.value = row
} }
const activeName = ref('first') const activeName = ref('first')
const deptId = ref() const deptId = ref()
// onMounted(() => { // onMounted(() => {
@ -234,16 +332,17 @@ const editClickA = (edit: any, obj: any) => {
fileList: [] fileList: []
} }
if (obj.filePath) { if (obj.filePath) {
editA.value.fileList = [{ editA.value.fileList = [
{
name: obj.title, name: obj.title,
originalFilename: obj.filePath.originalFileName, originalFilename: obj.filePath.originalFileName,
url: obj.filePath.url, url: obj.filePath.url
}] }
]
} }
dialogImageUrl.value = obj.imgUrl dialogImageUrl.value = obj.imgUrl
// dialogVisible.value = true // dialogVisible.value = true
} } else if (obj && obj.id) {
else if (obj && obj.id) {
editA.value = obj editA.value = obj
if (obj.filePath) { if (obj.filePath) {
// editA.value.fileList = [{ // editA.value.fileList = [{
@ -251,11 +350,13 @@ const editClickA = (edit: any, obj: any) => {
// originalFilename: obj.originalFileName, // originalFilename: obj.originalFileName,
// url: obj.filePath.url, // url: obj.filePath.url,
// }] // }]
editA.value.fileList = obj.filePath.map((item: any)=>Object.assign(item,{ editA.value.fileList = obj.filePath.map((item: any) =>
Object.assign(item, {
name: item.originalFileName, name: item.originalFileName,
originalFilename: item.originalFileName, originalFilename: item.originalFileName,
url: item.url, url: item.url
})) })
)
} }
if (obj.imgUrl) { if (obj.imgUrl) {
// editA.value.imgFile=[{ // editA.value.imgFile=[{
@ -263,16 +364,17 @@ const editClickA = (edit: any, obj: any) => {
// originalFilename: obj.title, // originalFilename: obj.title,
// url: obj.imgUrl, // url: obj.imgUrl,
// }] // }]
editA.value.imgFile = obj.imgUrl.map((item: any)=>Object.assign(item,{ editA.value.imgFile = obj.imgUrl.map((item: any) =>
Object.assign(item, {
name: item.originalFileName, name: item.originalFileName,
originalFilename: item.originalFileName, originalFilename: item.originalFileName,
url: item.url, url: item.url
})) })
)
} }
dialogImageUrl.value = obj.imgUrl dialogImageUrl.value = obj.imgUrl
// dialogVisible.value = true // dialogVisible.value = true
} } else {
else {
editA.value = { editA.value = {
title: '', title: '',
moduleId: '1', moduleId: '1',
@ -281,19 +383,17 @@ const editClickA = (edit: any, obj: any) => {
type: edit, type: edit,
fileList: [] fileList: []
} }
} }
console.log(editA.value) console.log(editA.value)
shomkA.value = true shomkA.value = true
} }
const deleteClickA = async (row: any) => { const deleteClickA = async (row: any) => {
if (row && row.id) { if (row && row.id) {
const { code, msg } = await delFootprint({ id: row.id }) const { code, msg } = await delFootprint({ id: row.id })
if (code === 200) { message.success("删除成功") } if (code === 200) {
else message.warning(msg) message.success('删除成功')
} else message.warning(msg)
} }
getTree() getTree()
} }
@ -301,25 +401,22 @@ async function addClickA(row: any) {
console.log(row) console.log(row)
if (!row) return if (!row) return
const { id, moduleId, title, fileList, imgFile } = row const { id, moduleId, title, fileList, imgFile } = row
let filePath: any[] =[],imgUrl: any[] =[] let filePath: any[] = [],
imgUrl: any[] = []
if (!imgFile) { if (!imgFile) {
message.error("图片不能为空") message.error('图片不能为空')
return return
} } else {
else{
row.imgFile.forEach((index) => { row.imgFile.forEach((index) => {
if (index.response) { if (index.response) {
console.log(121212) console.log(121212)
// imgUrl = index.response.url // imgUrl = index.response.url
imgUrl.push(index.response.url) imgUrl.push(index.response.url)
} } else {
else{
// imgUrl = index.url // imgUrl = index.url
imgUrl.push(index.url) imgUrl.push(index.url)
} }
}) })
} }
if (fileList && fileList.length > 0) { if (fileList && fileList.length > 0) {
console.log(1, 212121, fileList && fileList.length > 0, fileList) console.log(1, 212121, fileList && fileList.length > 0, fileList)
@ -328,24 +425,35 @@ async function addClickA(row: any) {
console.log(212121) console.log(212121)
filePath.push(index.response.url) filePath.push(index.response.url)
// filePath = index.response.url // filePath = index.response.url
} } else {
else{
filePath.push(index.url) filePath.push(index.url)
// filePath = index.url // filePath = index.url
} }
}) })
} }
console.log(row) console.log(row)
if (row.type === 'add') { if (row.type === 'add') {
const { code, msg } = await updateFootprint({id,moduleId,title,filePath,imgUrl}) const { code, msg } = await updateFootprint({
if (code === 200) { message.success("新增成功") } id,
else message.warning(msg) moduleId,
} title,
else { filePath,
const { code, msg } = await updateFootprint({id,moduleId,title,filePath,imgUrl}) imgUrl
if (code === 200) { message.success("修改成功") } })
else message.warning(msg) if (code === 200) {
message.success('新增成功')
} else message.warning(msg)
} else {
const { code, msg } = await updateFootprint({
id,
moduleId,
title,
filePath,
imgUrl
})
if (code === 200) {
message.success('修改成功')
} else message.warning(msg)
} }
shomkA.value = false shomkA.value = false
getTree() getTree()
@ -368,14 +476,15 @@ const editClickB = (edit: any, obj: any) => {
// originalFilename: obj.filePath.originalFileName, // originalFilename: obj.filePath.originalFileName,
// url: obj.filePath.url, // url: obj.filePath.url,
// }] // }]
editB.value.fileList = obj.filePath.map((item: any)=>Object.assign(item,{ editB.value.fileList = obj.filePath.map((item: any) =>
Object.assign(item, {
name: item.originalFileName, name: item.originalFileName,
originalFilename: item.originalFileName, originalFilename: item.originalFileName,
url: item.url, url: item.url
})) })
)
} }
} } else if (obj && obj.id) {
else if (obj && obj.id) {
editB.value = obj editB.value = obj
if (obj.filePath) { if (obj.filePath) {
// editB.value.fileList = [{ // editB.value.fileList = [{
@ -383,14 +492,15 @@ const editClickB = (edit: any, obj: any) => {
// originalFilename: obj.originalFileName, // originalFilename: obj.originalFileName,
// url: obj.filePath.url, // url: obj.filePath.url,
// }] // }]
editB.value.fileList = obj.filePath.map((item: any)=>Object.assign(item,{ editB.value.fileList = obj.filePath.map((item: any) =>
Object.assign(item, {
name: item.originalFileName, name: item.originalFileName,
originalFilename: item.originalFileName, originalFilename: item.originalFileName,
url: item.url, url: item.url
})) })
)
} }
} } else {
else {
editB.value = { editB.value = {
title: '', title: '',
moduleId: '2', moduleId: '2',
@ -399,19 +509,17 @@ const editClickB = (edit: any, obj: any) => {
type: edit, type: edit,
fileList: [] fileList: []
} }
} }
console.log(editB.value) console.log(editB.value)
shomkB.value = true shomkB.value = true
} }
const deleteClickB = async (row: any) => { const deleteClickB = async (row: any) => {
if (row && row.id) { if (row && row.id) {
const { code, msg } = await delFootprint({ id: row.id }) const { code, msg } = await delFootprint({ id: row.id })
if (code === 200) { message.success("删除成功") } if (code === 200) {
else message.warning(msg) message.success('删除成功')
} else message.warning(msg)
} }
getTree() getTree()
} }
@ -428,48 +536,57 @@ async function addClickB(row: any) {
console.log(212121) console.log(212121)
filePath.push(index.response.url) filePath.push(index.response.url)
// filePath = index.response.url // filePath = index.response.url
} } else {
else{
filePath.push(index.url) filePath.push(index.url)
// filePath = index.url // filePath = index.url
} }
}) })
} }
console.log(row) console.log(row)
if (row.type === 'add') { if (row.type === 'add') {
const { code, msg } = await updateFootprint({id,moduleId,title,filePath}) const { code, msg } = await updateFootprint({
if (code === 200) { message.success("新增成功") } id,
else message.warning(msg) moduleId,
} title,
else { filePath
const { code, msg } = await updateFootprint({id,moduleId,title,filePath}) })
if (code === 200) { message.success("修改成功") } if (code === 200) {
else message.warning(msg) message.success('新增成功')
} else message.warning(msg)
} else {
const { code, msg } = await updateFootprint({
id,
moduleId,
title,
filePath
})
if (code === 200) {
message.success('修改成功')
} else message.warning(msg)
} }
shomkB.value = false shomkB.value = false
getTree() getTree()
} }
const handleChange = (e: string | any[]) => { const handleChange = (e: string | any[]) => {
if (e && e.length > 1 && e.length <= 2) { if (e && e.length > 1 && e.length <= 2) {
// console.log(e, editB.value) // console.log(e, editB.value)
editB.value.cateId = e[1] editB.value.cateId = e[1]
} } else if (e && e.length > 2) {
else if(e && e.length > 2){
editB.value.cateId = e[2] editB.value.cateId = e[2]
} } else {
else {
editB.value.cateId = e[0] editB.value.cateId = e[0]
} }
// console.log(e,editB.value.cateId,99999) // console.log(e,editB.value.cateId,99999)
} }
const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => { const handOnExceed: UploadProps['onExceed'] = (
message.warning("最多只能上传5张图片") uploadFile: any,
uploadFiles: any
) => {
message.warning('最多只能上传5张图片')
} }
const header = { 'token': store.user.token } const header = { token: store.user.token }
const goBacks = (e) => { const goBacks = (e) => {
// console.log(444) // console.log(444)
history.back() history.back()
@ -487,12 +604,11 @@ async function getUser(row) {
// } // }
const { data: userArr } = await fetchGetViewScope({ moduleId: row }) const { data: userArr } = await fetchGetViewScope({ moduleId: row })
setUserList.value = userArr setUserList.value = userArr
} }
// //
const userData = ref(false) const userData = ref(false)
const handleChild = (data: any) => { const handleChild = (data: any) => {
console.log(data, 444); console.log(data, 444)
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
showModal.value = unref(show) showModal.value = unref(show)
let userIdList: any[] = [] let userIdList: any[] = []
@ -509,22 +625,19 @@ async function getUser(row) {
if (userIdList.length > 0) { if (userIdList.length > 0) {
userData.value = true userData.value = true
console.log(userIdList, 8888) console.log(userIdList, 8888)
} } else userData.value = false
else userData.value = false
} }
const CloseThiss = (data: boolean) => { const CloseThiss = (data: boolean) => {
showModal.value = data showModal.value = data
} }
const lazyState = computed(() => [pageInfo.currentPage]) const lazyState = computed(() => [pageInfo.currentPage])
watch( watch(
() => unref(lazyState), () => unref(lazyState),
async (v) => { async (v) => {
getTree() getTree()
}, },
{ immediate: true, deep: true }, { immediate: true, deep: true }
) )
const handleSizeChange = (e) => { const handleSizeChange = (e) => {
@ -537,17 +650,11 @@ const handleCurrentChange=(e)=>{
const dialogImageUrl = ref('') const dialogImageUrl = ref('')
const dialogVisible = ref(false) const dialogVisible = ref(false)
const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile: { url: string }) => { const handlePictureCardPreview = (uploadFile: { url: string }) => {
dialogImageUrl.value = uploadFile.url! dialogImageUrl.value = uploadFile.url!
dialogVisible.value = true dialogVisible.value = true
// console.log(dialogImageUrl.value) // console.log(dialogImageUrl.value)
} }
</script> </script>
<style lang="less"> <style lang="less">
::-webkit-scrollbar { ::-webkit-scrollbar {
@ -558,5 +665,4 @@ const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile: { url: s
right: 30px; right: 30px;
top: -92px; top: -92px;
} }
</style> </style>

View File

@ -16,7 +16,7 @@ import {
} from '@/api/daikin/base' } from '@/api/daikin/base'
import { noticeld } from '@/stores/modules/noticeId' import { noticeld } from '@/stores/modules/noticeId'
import { databaseld } from '@/stores/modules/database' import { databaseld } from '@/stores/modules/database'
import { NTag, useMessage, NModal } from 'naive-ui' import { NTag, useMessage, NModal, NPopover } from 'naive-ui'
import { ArrowDown, Check, Close } from '@element-plus/icons-vue' import { ArrowDown, Check, Close } from '@element-plus/icons-vue'
const store = noticeld() const store = noticeld()
const store2 = useUserStore() const store2 = useUserStore()
@ -88,6 +88,10 @@ async function getPageList(cateId: any = database.database.id) {
const handleEditClick = async () => { const handleEditClick = async () => {
const row = { ...editObj.value } const row = { ...editObj.value }
if (!row) return if (!row) return
if (!row.cateId) {
message.error('所属类别不能为空!')
return
}
let url: any[] = [] let url: any[] = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.forEach((index: any) => { row.fileList.forEach((index: any) => {
@ -289,10 +293,17 @@ const CloseThiss = (data?: boolean) => {
// setUserList.value = [] // setUserList.value = []
} }
const downloads = (data: any) => { // const arr = [1706, 1416, 1415, 1414, 1413, 1412, 1411, 1410, 1386, 1388, 1391]
// downloadFile(data.filePath)
if (data && data.filePath) { const downloads = (data: any = {}) => {
window.open(data.filePath) const { fileCommon, filePath } = data
if ((fileCommon?.fileSize || 0) > 25 * 1024 * 1024) {
message.info('正在下载中,请稍等~')
downloadFile(filePath)
return
}
if (filePath) {
window.open(filePath)
// window.open("https://view.officeapps.live.com/op/view.aspx?src=" + encodeURIComponent(data.filePath)) // window.open("https://view.officeapps.live.com/op/view.aspx?src=" + encodeURIComponent(data.filePath))
} else { } else {
message.info('没有可预览文件!') message.info('没有可预览文件!')
@ -475,9 +486,29 @@ function getParentIds(id: number, list: any[] = tableData.value): any {
<!-- <el-button style="color: #000" @click="openUrl(row)" <!-- <el-button style="color: #000" @click="openUrl(row)"
>预览</el-button >预览</el-button
> --> > -->
<div class="inline-block">
<n-popover
trigger="hover"
placement="top-start"
v-if="(row.fileCommon?.fileSize || 0) > 25 * 1024 * 1024"
>
<template #trigger>
<el-button style="color: #000" @click="downloads(row)" <el-button style="color: #000" @click="downloads(row)"
>查看</el-button >查看</el-button
> >
</template>
<span
>该文件超过25MB无法进行预览请点击 查看
进行下载</span
>
</n-popover>
<el-button
v-else
style="color: #000"
@click="downloads(row)"
>查看</el-button
>
</div>
<el-dropdown <el-dropdown
v-if="activeName === 1 && isDbReview" v-if="activeName === 1 && isDbReview"
trigger="click" trigger="click"
@ -508,6 +539,7 @@ function getParentIds(id: number, list: any[] = tableData.value): any {
<el-button <el-button
v-if="activeName > 2 && isDbUpload" v-if="activeName > 2 && isDbUpload"
type="primary" type="primary"
class="ml-16px"
@click="editClick(row)" @click="editClick(row)"
> >
编辑</el-button 编辑</el-button

View File

@ -13,7 +13,10 @@ import {
fetchdbAuthGetInfo fetchdbAuthGetInfo
} from '@/api/daikin/base' } from '@/api/daikin/base'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import { useMessage, NModal } from 'naive-ui' import { useMessage, NModal, NPopover } from 'naive-ui'
import { isNotOneWeekAgo } from '@/utils'
// console.log('🚀 ~ isNotOneWeekAgo:', isNotOneWeekAgo('2024-1-16'))
const store: any = useUserStore() const store: any = useUserStore()
const message = useMessage() const message = useMessage()
const userCode = ['admin', 'database_dandang'].includes(store.user.roleCode) const userCode = ['admin', 'database_dandang'].includes(store.user.roleCode)
@ -75,17 +78,21 @@ async function getTree() {
// // message.error('', error); // // message.error('', error);
// } // }
// } // }
const arr = [1706, 1416, 1415, 1414, 1413, 1412, 1411, 1410, 1386, 1388, 1391]
async function downloads(row: any) { async function downloads(row: any) {
console.log(row, '!!!!!!!!!!xiazai') // console.log('xiazai', row)
const { isSelect, filePath } = row const { isSelect, filePath, id, fileCommon } = row
if (isSelect === 2) { if (isSelect === 2) {
message.info('没有访问权限') message.info('没有访问权限')
return return
} }
// try{ if (arr.includes(id) || (fileCommon?.fileSize || 0) > 25 * 1024 * 1024) {
// downloadFile(filePath) try {
// }catch(error){ message.info('正在下载中,请稍等~')
// } downloadFile(filePath)
} catch (error) {}
}
// window.open( // window.open(
// 'https://view.officeapps.live.com/op/view.aspx?src=' + // 'https://view.officeapps.live.com/op/view.aspx?src=' +
// encodeURIComponent(filePath) // encodeURIComponent(filePath)
@ -301,7 +308,15 @@ async function getAuth() {
<td <td
class="w20% h50px cursor-pointer overflow-hidden text-left pl25px truncate text-#000" class="w20% h50px cursor-pointer overflow-hidden text-left pl25px truncate text-#000"
> >
<div class="flex items-center truncate">
<img
v-if="isNotOneWeekAgo(it.createTime)"
src="@/assets/images/NEW.gif"
class="!h-20px !w-auto mr-2"
alt=""
/>
<span :title="it.title"> {{ it.title }}</span> <span :title="it.title"> {{ it.title }}</span>
</div>
</td> </td>
<td class="w20% h50px">{{ it.deptName }}</td> <td class="w20% h50px">{{ it.deptName }}</td>
<td class="w20% h50px">{{ it.parentDeptName }}</td> <td class="w20% h50px">{{ it.parentDeptName }}</td>
@ -309,9 +324,27 @@ async function getAuth() {
<td class="w20% h50px"> <td class="w20% h50px">
<!-- <el-button style="color: #000;" @click="openUrl(it)"></el-button> --> <!-- <el-button style="color: #000;" @click="openUrl(it)"></el-button> -->
<!-- <el-button style="color: #000;" @click="downloads(it)"></el-button> --> <!-- <el-button style="color: #000;" @click="downloads(it)"></el-button> -->
<n-popover
trigger="hover"
placement="top-start"
v-if="
arr.includes(it.id) ||
(it.fileCommon?.fileSize || 0) > 25 * 1024 * 1024
"
>
<template #trigger>
<el-button style="color: #000" @click="downloads(it)" <el-button style="color: #000" @click="downloads(it)"
>查看</el-button >查看</el-button
> >
</template>
<span
>该文件超过25MB无法进行预览请点击 查看
进行下载</span
>
</n-popover>
<el-button v-else style="color: #000" @click="downloads(it)"
>查看</el-button
>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -23,12 +23,17 @@ function menuHandler(menu: any, index: number) {
if (menu.childList && menu.childList.length > 0) { if (menu.childList && menu.childList.length > 0) {
activeItem.value = menu.childList[0].id activeItem.value = menu.childList[0].id
} }
if (database.database.id == activeItem.value && onClic.value) {
onClic.value = false
} else {
onClic.value = !!menu.childList?.length
// onClic.value = !onClic.value
}
database.database.id = activeItem.value database.database.id = activeItem.value
goListPage() goListPage()
} }
function goChild(menu: any) { function goChild(menu: any) {
activeItem.value = menu.id activeItem.value = menu.id
console.log(menu.id)
database.database.id = menu.id database.database.id = menu.id
goListPage() goListPage()
} }
@ -52,18 +57,32 @@ async function getTree() {
// activeMenuKey.value = data[0].childList[0].id // activeMenuKey.value = data[0].childList[0].id
// } // }
} }
if (activeItem.value) { const { id } = route.query
const { topLevelItem, targetItem } = findItemById(data, activeItem.value) if (id) {
if (topLevelItem && targetItem) { const index = data.findIndex((i: any) => i.id == id)
const index = data.findIndex((i: any) => i.id === topLevelItem.id) if (index > -1) {
nextTick(() => { const item = data[index]
onClic.value = true if (item) {
menuHandler(topLevelItem, index === -1 ? 0 : index) menuHandler(item, index)
goChild(targetItem) // onClic.value = true
}) // titles.value = item.name
// activeMenuKey.value = item.id
// database.database.id = item.id
} }
} }
} }
// if (activeItem.value) {
// const { topLevelItem, targetItem } = findItemById(data, activeItem.value)
// if (topLevelItem && targetItem) {
// const index = data.findIndex((i: any) => i.id === topLevelItem.id)
// nextTick(() => {
// onClic.value = true
// menuHandler(topLevelItem, index === -1 ? 0 : index)
// goChild(targetItem)
// })
// }
// }
}
getTree() getTree()
function findItemById( function findItemById(
@ -100,7 +119,7 @@ function findItemById(
<div class="pt30px pb24px flex-1 pl20px bg-#fff"> <div class="pt30px pb24px flex-1 pl20px bg-#fff">
<div <div
class="nav px36px py24px m10px mr0 rd-32px rd-r-0 flex flex-col text-#000 cursor-pointer" class="nav px50px py24px m10px mr0 rd-32px rd-r-0 flex flex-col text-#000 cursor-pointer"
v-for="(m, index) in tableData" v-for="(m, index) in tableData"
:key="m.id" :key="m.id"
:class=" :class="
@ -110,9 +129,9 @@ function findItemById(
> >
<div <div
:class="activeMenuKey === m.id && 'onActive'" :class="activeMenuKey === m.id && 'onActive'"
class="flex" class="flex relative"
@click="onClic = !onClic"
> >
<!-- @click="!!m.childList?.length ? (onClic = !onClic) : ''" -->
<!-- <img v-if="activeMenuKey === m.id" :src="m.icon1" class="w22px h22px mr16px mt--5px" /> <!-- <img v-if="activeMenuKey === m.id" :src="m.icon1" class="w22px h22px mr16px mt--5px" />
<img v-else :src="m.icon" class="w22px h22px mr16px mt--5px" /> --> <img v-else :src="m.icon" class="w22px h22px mr16px mt--5px" /> -->
<!-- lujinli --> <!-- lujinli -->
@ -127,6 +146,12 @@ function findItemById(
/> />
<CaretBottom v-else /> </el-icon <CaretBottom v-else /> </el-icon
></span> ></span>
<img
v-if="m.isSelFlag == 1"
src="@/assets/images/NEW.gif"
class="!h-20px !w-auto absolute left-[-46px] top-[50%] translate-y-[-50%]"
alt=""
/>
</span> </span>
</div> </div>
@ -165,6 +190,7 @@ function findItemById(
@click.stop="goChild(ite)" @click.stop="goChild(ite)"
@click="activeItem = ite.id" @click="activeItem = ite.id"
> >
<div class="relative">
<n-popover trigger="hover" placement="top-start"> <n-popover trigger="hover" placement="top-start">
<template #trigger> <template #trigger>
<span <span
@ -177,10 +203,18 @@ function findItemById(
{{ ite.name }} {{ ite.name }}
</div> </div>
</n-popover> </n-popover>
<img
@click="activeItem = ite.id"
v-if="ite.isSelFlag === 1 && !ite.childList?.length"
src="@/assets/images/NEW.gif"
class="!h-20px !w-auto mr-1 absolute left-[-46px] top-[50%] translate-y-[-50%]"
alt=""
/>
</div>
<div v-if="ite.childList && idx == index" class="pl10px"> <div v-if="ite.childList && idx == index" class="pl10px">
<div <div
class="my20px py-10px pl10px text-#000" class="my20px py-10px pl10px text-#000 relative"
v-for="(it, ind) in ite.childList" v-for="(it, ind) in ite.childList"
:key="item.id" :key="item.id"
@click.stop="goChild(it)" @click.stop="goChild(it)"
@ -198,6 +232,13 @@ function findItemById(
{{ it.name }} {{ it.name }}
</div> </div>
</n-popover> </n-popover>
<img
@click="activeItem = it.id"
v-if="it.isSelFlag == 1"
src="@/assets/images/NEW.gif"
class="!h-20px !w-auto mr-1 absolute left-[-36px] top-[50%] translate-y-[-50%]"
alt=""
/>
</div> </div>
</div> </div>
</div> </div>
@ -285,7 +326,7 @@ function findItemById(
background-color: #e6ecff; background-color: #e6ecff;
border-radius: 32px 0 0 32px; border-radius: 32px 0 0 32px;
padding: 24px 36px 24px 36px; padding: 24px 36px 24px 50px;
} }
} }
} }

View File

@ -272,7 +272,6 @@
<el-tab-pane label="权限管理" name="three" v-if="userCode"> <el-tab-pane label="权限管理" name="three" v-if="userCode">
<div class="h-52px"> <div class="h-52px">
<el-button <el-button
v-if="isDbReview || isDbUpload"
type="primary" type="primary"
@click="handleAuthClick('add')" @click="handleAuthClick('add')"
class="mb-20px" class="mb-20px"
@ -400,7 +399,7 @@
width="180px" width="180px"
> >
<template #default="scope"> <template #default="scope">
<div v-if="userCode"> <div>
<el-button <el-button
type="primary" type="primary"
@click="handleAuthClick('edit', scope.row)" @click="handleAuthClick('edit', scope.row)"
@ -436,8 +435,8 @@
v-model:page-size="pageInfo.pageSize" v-model:page-size="pageInfo.pageSize"
layout="prev, pager, next, jumper" layout="prev, pager, next, jumper"
:total="pageInfo.total" :total="pageInfo.total"
@size-change="handleSizeChange" @size-change="getAuth"
@current-change="handleCurrentChange" @current-change="getAuth"
/> />
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -486,10 +485,10 @@
<el-form-item label="查看范围"> <el-form-item label="查看范围">
<el-button <el-button
class="button" class="button"
@click="getUser" @click="() => getUser(editB)"
:type="userData ? 'success' : ''" :type="editB.userList?.length ? 'success' : ''"
:icon="userData ? 'Check' : ''" :icon="editB.userList?.length ? 'Check' : ''"
>{{ userData ? '已设置' : '设置' }}</el-button >{{ editB.userList?.length ? '已设置' : '设置' }}</el-button
> >
</el-form-item> </el-form-item>
@ -530,7 +529,7 @@
<el-form-item label="上传人员" class="w-300px"> <el-form-item label="上传人员" class="w-300px">
<el-button <el-button
class="button" class="button"
@click="getUser({ userList: uploadIds, key: 'uploadIds' })" @click="() => getUser({ userList: uploadIds, key: 'uploadIds' })"
:type="authModel.uploadIds?.length ? 'success' : ''" :type="authModel.uploadIds?.length ? 'success' : ''"
:icon="authModel.uploadIds?.length ? 'Check' : ''" :icon="authModel.uploadIds?.length ? 'Check' : ''"
>{{ authModel.uploadIds?.length ? '已设置' : '设置' }}</el-button >{{ authModel.uploadIds?.length ? '已设置' : '设置' }}</el-button
@ -540,7 +539,7 @@
<el-form-item label="审核人员" class="w-300px"> <el-form-item label="审核人员" class="w-300px">
<el-button <el-button
class="button" class="button"
@click="getUser({ userList: reviewIds, key: 'reviewIds' })" @click="() => getUser({ userList: reviewIds, key: 'reviewIds' })"
:type="authModel.reviewIds?.length ? 'success' : ''" :type="authModel.reviewIds?.length ? 'success' : ''"
:icon="authModel.reviewIds?.length ? 'Check' : ''" :icon="authModel.reviewIds?.length ? 'Check' : ''"
>{{ authModel.reviewIds?.length ? '已设置' : '设置' }}</el-button >{{ authModel.reviewIds?.length ? '已设置' : '设置' }}</el-button
@ -746,7 +745,8 @@ async function addClickA(row: any) {
shomkA.value = false shomkA.value = false
getTree() getTree()
} }
const editClickB = (edit: any, obj: any = {}) => { const editClickB = (edit: any, data: any = {}) => {
const obj = JSON.parse(JSON.stringify(data))
if (edit === 'add' && obj && obj.id) { if (edit === 'add' && obj && obj.id) {
editB.value = { editB.value = {
title: '', title: '',
@ -818,7 +818,6 @@ const deleteClickB = async (row: any) => {
getInfo('') getInfo('')
} }
async function addClickB(row: any) { async function addClickB(row: any) {
console.log(row, deptId.value)
if (!row) return if (!row) return
let url: any[] = [] let url: any[] = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
@ -841,6 +840,10 @@ async function addClickB(row: any) {
}) })
row.userIdList = list row.userIdList = list
} }
// if (row.userIdList?.length > 0) {
// row.userIdList = row.userIdList.join(',')
// }
// console.log('🚀 ~ row:', row)
if (!row.cateId) { if (!row.cateId) {
message.error('所属类别不能为空!') message.error('所属类别不能为空!')
return return
@ -922,9 +925,11 @@ const handleChild = async (data: any) => {
console.log(data, 444) console.log(data, 444)
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
showModal.value = unref(show) || false showModal.value = unref(show) || false
let userIdList: any[] = [] let userIdList: any[] = [],
multipleSelection.value.forEach((i: { userId: any }) => { userList: any = []
multipleSelection.value.forEach((i: { userId: any; nickName: string }) => {
userIdList.push(i.userId) userIdList.push(i.userId)
userList.push({ nickName: i.nickName, userId: i.userId })
}) })
if (authModel.value && selSetAuthKey.value) { if (authModel.value && selSetAuthKey.value) {
authModel.value[selSetAuthKey.value] = userIdList authModel.value[selSetAuthKey.value] = userIdList
@ -952,6 +957,7 @@ const handleChild = async (data: any) => {
console.log(flg.value) console.log(flg.value)
} }
editB.value.userIdList = userIdList editB.value.userIdList = userIdList
editB.value.userList = userList
if (userIdList.length > 0) { if (userIdList.length > 0) {
userData.value = true userData.value = true
console.log(userIdList, 8888) console.log(userIdList, 8888)
@ -1026,8 +1032,11 @@ const setReview = ref(false)
const hasReview = ref(false) const hasReview = ref(false)
async function getAuth() { async function getAuth() {
if (!cateIds.value) return if (!cateIds.value) return
const { pageSize, currentPage } = pageInfo
const { rows: data = [] }: any = await fetchdbAuthGetInfo({ const { rows: data = [] }: any = await fetchdbAuthGetInfo({
cateId: cateIds.value cateId: cateIds.value,
pageSize,
pageNum: currentPage
// type: 1 // type: 1
}) })
// //

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -8,12 +8,17 @@ import {
fetchPostList, fetchPostList,
fetchmoduleStatInternalPage, fetchmoduleStatInternalPage,
fetchInternalUserStat, fetchInternalUserStat,
deptTree as fetchDeptTree deptTree as fetchDeptTree,
userDetailExport,
getDepartData,
getPieChartData,
getDepartChart
} from '@/api/daikin/base' } from '@/api/daikin/base'
import { formatDate } from '@/utils/format' import { formatDate } from '@/utils/format'
import { Chart1 } from './indexData' import { Chart1, barEchart, pieEchart } from './indexData'
import { Search } from '@element-plus/icons-vue' import { Search, Download } from '@element-plus/icons-vue'
import { NModal } from 'naive-ui' import { NModal,useMessage } from 'naive-ui'
const message = useMessage()
const currentDate = new Date() const currentDate = new Date()
const currentDates = new Date() const currentDates = new Date()
const value1 = ref<[Date, Date]>([ const value1 = ref<[Date, Date]>([
@ -27,11 +32,11 @@ const states = reactive<any>({
}) })
const chartRef1 = ref() const chartRef1 = ref()
const chartRef2 = ref() const chartRef2 = ref()
const chartOption1 = ref({}) const chartOption1 = ref<any>({})
const chartOption2 = ref({}) const chartOption2 = ref({})
const primary = ref(1) const primary = ref(1)
const primarys = ref(2) const primarys = ref(2)
const activeName = ref('inside') const activeName = ref('echart')
const pageInfo = reactive({ const pageInfo = reactive({
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
@ -66,6 +71,7 @@ const outDetail = ref([])
const postId = ref<any>([]) const postId = ref<any>([])
const nickName = ref() const nickName = ref()
const postList = ref<any>([]) const postList = ref<any>([])
const showEchart = ref(true)
const barOption = { const barOption = {
width: '100%', width: '100%',
height: '100%', height: '100%',
@ -128,11 +134,27 @@ const barOption = {
] ]
} }
const itemDataList = ref<any>([]) const itemDataList = ref<any>([])
const barChartRef = ref<any>(null)
const barChartOption = ref<any>({})
const pieChartRef = ref<any>(null)
const pieChartOption = ref<any>({})
const departData = ref<any>([])
const visitType = ref('1')
const externalList = ref<any>([])
const externalObj = ref<any>({})
const colorListObj = ref<any>({})
const dataList = ref([])
const getPostList = async () => { const getPostList = async () => {
const res: any = await fetchPostList() const res: any = await fetchPostList()
postList.value = res.data || [] postList.value = res.data || []
} }
const state = reactive<any>({
startTime: formatDate(value1.value[0]).substring(0, 10),
endTime: formatDate(value1.value[1]).substring(0, 10)
// timeType:1
})
const getInsideListPage = async () => { const getInsideListPage = async () => {
const res: any = await fetchmoduleStatInternalPage({ const res: any = await fetchmoduleStatInternalPage({
postId: postId.value, postId: postId.value,
@ -157,9 +179,40 @@ const getListPage = async () => {
pageInfo.total = res?.total || 0 pageInfo.total = res?.total || 0
} }
const getBarEchart = async () => {
const res = await getDepartChart({ ...state, visitType: visitType.value })
barChartOption.value = barEchart(res.data || {})
}
const getPieEchart = async () => {
const res = await getPieChartData({ ...state, visitType: visitType.value })
pieChartOption.value = pieEchart(res.data || [], unref(colorListObj))
}
const getEchartTable = async (moduleCode = '') => {
const { currentPage, pageSize } = pageInfo
const res = await getDepartData({
...state,
visitType: visitType.value,
pageNum: currentPage,
pageSize: pageSize,
moduleCode
})
departData.value = res.data || []
// res.data && res.data.length && getEchartTable(res.data[0].moduleCode)
}
const chartClick = (it: any) => {
const { _code } = it.data
getEchartTable(_code)
}
const getEchartData = async () => {
getBarEchart()
getPieEchart()
getEchartTable()
}
getPostList() getPostList()
getListPage() // getListPage()
getInsideListPage() // getInsideListPage()
const clickButton = (id) => { const clickButton = (id) => {
primary.value = id primary.value = id
@ -180,13 +233,6 @@ const timenFirsts = (value) => {
console.log(value) console.log(value)
} }
const state = reactive<any>({
startTime: formatDate(value1.value[0]).substring(0, 10),
endTime: formatDate(value1.value[1]).substring(0, 10)
// timeType:1
})
const colorListObj = ref<any>({})
const dataList = ref([])
const getDat = async () => { const getDat = async () => {
const { data } = await timeStat(state) const { data } = await timeStat(state)
dataList.value = data dataList.value = data
@ -212,7 +258,8 @@ const getDat = async () => {
}, },
type: 'bar' type: 'bar'
} }
getInternalUserStat(1) barChartOption.value = barEchart(xAxisData, colorList)
getInternalUserStat(isLeaderFlag)
} }
const deptId = ref('') const deptId = ref('')
@ -283,8 +330,6 @@ async function getInternalUserStat(
}) })
} }
const externalList = ref<any>([])
const externalObj = ref<any>({})
const getExternalTimeStat = async () => { const getExternalTimeStat = async () => {
const { data } = await externalTimeStat(state) const { data } = await externalTimeStat(state)
externalList.value = data externalList.value = data
@ -314,21 +359,40 @@ const getExternalTimeStat = async () => {
// chartOption2.value.height=3000 // chartOption2.value.height=3000
// chartOption2.value.width=1000 // chartOption2.value.width=1000
} }
const handleClick = ({ paneName }: any, down: Boolean = false) => {
pageInfo.currentPage = 1
pageInfo.pageSize = 10
pageInfo.total = 0
paneName === 'echart' && getEchartData()
paneName === 'out' && getExternalTimeStat()
paneName === 'inside' && getDat()
paneName === 'out-detail' && getListPage()
paneName === 'inside-detail' && getInsideListPage()
paneName === 'inside' &&
setTimeout(() => {
showEchart.value = true
}, 300)
}
const ss = computed(() => [state.startTime, state.endTime, state.timeType]) const ss = computed(() => [state.startTime, state.endTime, state.timeType])
watch( watch(
() => unref(ss), () => unref(ss),
async (v) => { async (v) => {
console.log(state.type) // getDat()
getDat() // getExternalTimeStat()
getExternalTimeStat() handleClick({ paneName: activeName.value })
}, },
{ immediate: true, deep: true } { immediate: true, deep: true }
) )
onMounted(() => { onMounted(() => {
// getDat() // getDat()
// console.log(formatDate(value1.value[0]).substring(0, 10)) // console.log(formatDate(value1.value[0]).substring(0, 10))
}) })
// onBeforeMount(async () => {
// await getDat()
// await getExternalTimeStat()
// })
const shortcuts = [ const shortcuts = [
{ {
text: '今天', text: '今天',
@ -402,14 +466,38 @@ const shortcuts = [
} }
] ]
const handleClick = ({ paneName }: any) => { const downloadExcel = (data: any, name: string) => {
pageInfo.currentPage = 1 const blob = new Blob([data], {
pageInfo.pageSize = 10 // type: 'application/vnd.ms-excel'
pageInfo.total = 0 })
paneName === 'out' && getExternalTimeStat() const downloadElement = document.createElement('a')
paneName === 'inside' && getDat() downloadElement.style.display = 'none'
paneName === 'out-detail' && getListPage() const downloadUrl = URL.createObjectURL(blob)
paneName === 'inside-detail' && getInsideListPage() downloadElement.href = downloadUrl
downloadElement.download = `${name}.xlsx`
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement)
URL.revokeObjectURL(downloadUrl)
// if (navigator.userAgent.indexOf('Chrome') > -1) {
// window.open(downloadUrl)
// }
// if (navigator.userAgent.indexOf('Firefox') > -1) {
// window.open(URL.createObjectURL(blob))
// }
}
const downExcel = async () => {
const res = await userDetailExport({
...state,
visitType: activeName.value === 'inside-detail' ? 1 : 2
})
let name = activeName.value === 'inside-detail' ? '本部足迹' : '外部足迹'
name = name + state.startTime + '-' + state.endTime
if (res.code === 200) {
downloadExcel(res.data, name)
return message.success('导出成功!')
}
} }
const selValue = ref('') const selValue = ref('')
@ -487,7 +575,11 @@ getdeptTree()
<span class="text-#000 mr-10px">日期: </span> <span class="text-#000 mr-10px">日期: </span>
<div class="max-w-350px flex items-center"> <div class="max-w-350px flex items-center">
<el-date-picker <el-date-picker
v-if="['inside', 'out', 'inside-detail'].includes(activeName)" v-if="
['inside', 'out', 'inside-detail', 'echart', 'out-detail'].includes(
activeName
)
"
v-model="value1" v-model="value1"
type="daterange" type="daterange"
range-separator="到" range-separator="到"
@ -506,6 +598,12 @@ getdeptTree()
clearable clearable
/> />
</div> </div>
<div class="mx-4 flex items-center" v-if="'echart' === activeName">
<el-select v-model="visitType" placeholder="本部/外部">
<el-option label="本部足迹" value="1" />
<el-option label="外部部足迹" value="2" />
</el-select>
</div>
<div <div
class="mx-4 flex items-center" class="mx-4 flex items-center"
v-if="['inside-detail', 'out-detail'].includes(activeName)" v-if="['inside-detail', 'out-detail'].includes(activeName)"
@ -561,10 +659,19 @@ getdeptTree()
type="primary" type="primary"
:icon="Search" :icon="Search"
size="small" size="small"
class="ml20px mt--5px" class="ml20px"
@click="handleClick({ paneName: activeName })" @click="handleClick({ paneName: activeName })"
>搜索</el-button >搜索</el-button
> >
<el-button
v-if="activeName === 'out-detail' || activeName === 'inside-detail'"
type="warning"
:icon="Download"
size="small"
class="!ml40px"
@click="downExcel"
>导出 Excel</el-button
>
<template v-if="activeName !== 'inside' && false"> <template v-if="activeName !== 'inside' && false">
<el-select <el-select
v-model="selValue" v-model="selValue"
@ -588,6 +695,77 @@ getdeptTree()
@click="clickButton(3)">本月</el-button> --> @click="clickButton(3)">本月</el-button> -->
</div> </div>
<el-tabs class="mt-20px" v-model="activeName" @tab-click="handleClick"> <el-tabs class="mt-20px" v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="足迹可视化图表" name="echart">
<div class="h-720px overflow-auto w-full">
<div class="flex">
<div class="w-50% h-720px mb-30px">
<VChart
@click="chartClick"
key="bar"
ref="barChartRef"
:option="pieChartOption"
autoresize
/>
</div>
<div class="h-720px w50%">
<div class="w100% h-full overflow-auto">
<el-table
:data="departData"
style="width: 100%; margin-bottom: 20px; height: 700px"
row-key="id"
border
default-expand-all
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
lineHeight: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{
'text-align': 'center',
'overflow-y': 'auto',
height: '60px'
}"
>
<el-table-column prop="moduleName" label="模块名称" />
<el-table-column
prop="deptName"
label="职位名称"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="访问次数"
prop="visitCount"
show-overflow-tooltip
/>
</el-table>
</div>
<!-- <div class="absolute bottom-2px right-30px z-20 bg-#fff">
<el-pagination
v-model:current-page="pageInfo.currentPage"
v-model:page-size="pageInfo.pageSize"
layout="prev, pager, next, jumper"
:total="pageInfo.total"
@size-change="getInsideListPage"
@current-change="getInsideListPage"
/>
</div> -->
</div>
</div>
<div class="w-full h-720px mt-30px">
<VChart
key="yyyxx"
ref="pieChartRef"
:option="barChartOption"
autoresize
/>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="本部足迹" name="inside"> <el-tab-pane label="本部足迹" name="inside">
<div class="overflow-auto h-720px"> <div class="overflow-auto h-720px">
<div class="mt20px w-full"> <div class="mt20px w-full">
@ -618,7 +796,13 @@ getdeptTree()
</div> </div>
</div> --> </div> -->
<div class="w-full h-400px mt-10px"> <div class="w-full h-400px mt-10px">
<VChart key="yyy" ref="chartRef1" :option="chartOption1" /> <VChart
key="yyy"
ref="chartRef1"
:option="chartOption1"
v-if="showEchart"
autoresize
/>
</div> </div>
<div class="mt-30px"> <div class="mt-30px">
<div class="flex items-center"> <div class="flex items-center">
@ -662,16 +846,16 @@ getdeptTree()
> >
</div> </div>
<div class="pb-14px"> <div class="pb-14px">
<div class="flex flex-wrap mb-30px"> <div class="flex justify-between flex-wrap mb-30px">
<div <div
class="m-4 flex items-center justify-between w-45% h-full" class="m-4 flex items-center justify-between w-45% h-full"
v-for="(item, i) in itemDataList" v-for="(item, i) in itemDataList"
:key="i" :key="i"
> >
<div class="flex items-center text-#000 text-18px"> <div class="flex items-center text-#000 text-18px">
<p class="text-bold text-40px mr-15px w-80px"> <!-- <p class="text-bold text-40px mr-15px w-80px">
{{ sortArr[item.sortNum - 1] || item.sortNum + 'TH' }} {{ sortArr[item.sortNum - 1] || item.sortNum + 'TH' }}
</p> </p> -->
<div class="mx-10px flex-col items-center"> <div class="mx-10px flex-col items-center">
<img <img
v-if="item.sex == 1" v-if="item.sex == 1"
@ -688,7 +872,12 @@ getdeptTree()
<p class="text-center mt-20px">{{ item.nickName }}</p> <p class="text-center mt-20px">{{ item.nickName }}</p>
</div> </div>
</div> </div>
<VChart class="h-300px w-65% ml-auto" :option="item" /> <VChart
class="h-300px w-85% ml-auto"
:option="item"
v-if="showEchart"
autoresize
/>
</div> </div>
</div> </div>
<div class="absolute bottom-2px right-30px z-20 bg-#fff"> <div class="absolute bottom-2px right-30px z-20 bg-#fff">
@ -847,7 +1036,12 @@ getdeptTree()
<div class="mt10px w-full"> <div class="mt10px w-full">
<div class="w-full h-400px"> <div class="w-full h-400px">
<VChart key="xxxx" ref="chartRef2" :option="chartOption2" /> <VChart
key="xxxx"
ref="chartRef2"
:option="chartOption2"
autoresize
/>
</div> </div>
</div> </div>
</div> </div>

View File

@ -3,8 +3,8 @@ import type { EChartsOption } from 'echarts'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { formatDate } from '@/utils/format' import { formatDate } from '@/utils/format'
const currentDate = new Date(); const currentDate = new Date()
const currentDates = new Date(); const currentDates = new Date()
const value1 = ref<[Date, Date]>([ const value1 = ref<[Date, Date]>([
currentDate.setMonth(currentDate.getMonth()), currentDate.setMonth(currentDate.getMonth()),
new Date() new Date()
@ -16,11 +16,10 @@ const value2 = ref<[Date, Date]>([
const states = reactive<any>({ const states = reactive<any>({
startTime: formatDate(value1.value[0]).substring(0, 10), startTime: formatDate(value1.value[0]).substring(0, 10),
endTime: formatDate(value1.value[1]).substring(0,10), endTime: formatDate(value1.value[1]).substring(0, 10)
// timeType:2, // timeType:2,
}) })
// export function Chart1() { // export function Chart1() {
// const chartRef = ref() // const chartRef = ref()
@ -122,3 +121,243 @@ export function Chart1(xAxisData: any = [], color = []) {
return { ...option } return { ...option }
} }
export function pieEchart(arr: any = [], colorList: any = {}) {
console.log('🚀 ~ colorList:', colorList)
const color: any = []
const data = arr.map((item: any) => {
color.push(colorList[item.moduleCode])
console.log('🚀 ~ item.moduleCode:', item.moduleCode)
return {
name: item.moduleName,
value: item.visitCount,
_code: item.moduleCode
}
})
return {
// color,
title: {
text: '各模块登录占比',
left: 'center',
textStyle: {
fontSize: 30
},
top: 20
},
grid: {
left: '0',
top: 0,
right: '0',
bottom: '2%',
containLabel: true
},
tooltip: {
trigger: 'item',
textStyle: {
fontSize: 24
},
formatter: function (params: any) {
// const title = `<p>${params.seriesName}</p>`
const colorDot =
'<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:' +
params.color +
'"></span>'
return colorDot + params.name + ': ' + params.percent + '%'
}
},
legend: {
// orient: 'vertical',
// left: 'left'
// type: 'warp',
bottom: '3%',
// left: '30%',
width: '78%',
textStyle: {
fontSize: 24,
borderRadius: 0
},
itemWidth: 24,
itemHeight: 24
},
series: [
{
name: '',
type: 'pie',
radius: '60%',
data: data,
label: {
// show: false,
position: 'inside',
// formatter: '{b}-{c}%',
formatter: function (params: any) {
return params.percent < 10
? params.percent + '%'
: params.name + ' ' + params.percent + '%'
},
fontSize: 20,
color: '#fff'
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
}
}
// data:{
// '科室':['科室一','科室二','科室三'],
// 'HP访问次数':['科室一访问次数','科室二访问次数','科室三访问次数'],
// '平均活跃度(人员平均访问次数)':['科室一平均活跃度','科室二平均活跃度','科室三平均活跃度'],
// }
export function barEchart({ deptName = [], visitCount = [], avgCount = [] }) {
return {
// width: '100%',
title: {
text: '调达本部各科室HP登录情况(内部足迹)',
left: 'center',
textStyle: {
fontSize: 30
},
top: 10
},
grid: {
left: '4%',
top: '10%',
right: '4%',
bottom: '10%',
containLabel: true
},
tooltip: {
trigger: 'axis'
// axisPointer: {
// type: 'cross',
// crossStyle: {
// color: '#999'
// }
// }
},
legend: {
data: [
{
name: 'HP访问次数',
itemStyle: {
// color: '#f8cbad',
borderWidth: 0
},
textStyle: {
fontSize: 18
}
},
{
name: '平均活跃度(人员平均访问次数)',
itemStyle: {
// color: '#acc1fb',
borderWidth: 0
},
textStyle: {
fontSize: 18
}
}
],
// data: ['HP访问次数', '平均活跃度(人员平均访问次数)'],
bottom: '0px'
},
xAxis: [
{
type: 'category',
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
data: deptName,
axisPointer: {
type: 'shadow'
},
axisLabel: {
interval: 0,
rotate: 45,
fontSize: 18
}
}
],
yAxis: [
{
type: 'value',
name: 'HP访问次数',
// min: 0,
// max: 250,
// interval: 50,
axisLabel: {
formatter: '{value}'
},
nameTextStyle: {
fontSize: 18
},
nameRotate: 90,
nameGap: '60',
nameLocation: 'middle'
},
{
type: 'value',
name: '平均活跃度(人员平均访问次数)',
// min: 0,
// max: 25,
// interval: 5,
axisLabel: {
formatter: '{value}'
},
splitLine: {
show: false
},
nameTextStyle: {
fontSize: 18
},
nameRotate: 90,
nameGap: '46',
nameLocation: 'middle'
// axisLine: {
// lineStyle: {
// color: '#f7c455'
// }
// }
}
],
series: [
{
name: 'HP访问次数',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + ''
}
},
// data: [
// 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
// ]
data: visitCount
// color: '#5b9bd5'
},
{
name: '平均活跃度(人员平均访问次数)',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value + ''
}
},
// data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
data: avgCount,
smooth: true,
color: '#ed7d31'
}
]
// emphasis: {
// itemStyle: {
// shadowBlur: 10,
// shadowOffsetX: 0,
// shadowColor: 'rgba(0, 0, 0, 0.5)'
// }
// }
}
}

View File

@ -1,133 +1,133 @@
<!-- 外部情报 > 情报详情 --> <!-- 外部情报 > 情报详情 -->
<script setup lang="ts"> <script setup lang="ts">
import AppBlock from "@/components/AppBlock.vue"; import AppBlock from '@/components/AppBlock.vue'
import AppNewsBox from "@/components/AppNewsBox.vue"; import AppNewsBox from '@/components/AppNewsBox.vue'
import Layout from "./components/Layout.vue"; import Layout from './components/Layout.vue'
import DetailNews from "./DetailNews.vue"; import DetailNews from './DetailNews.vue'
import { import {
getArticleDetail, getArticleDetail,
getArticlePage, getArticlePage,
getManagerDetail, getManagerDetail
} from "@/api/daikin/base"; } from '@/api/daikin/base'
import { message } from "@/utils/message"; import { message } from '@/utils/message'
const { push } = useRouter(); const { push } = useRouter()
const route = useRoute(); const route = useRoute()
const SideNews = [ const SideNews = [
{ key: "IntelligenceOutside", name: "社外情报" }, { key: 'IntelligenceOutside', name: '社外情报' },
{ key: "IntelligenceWithin", name: "社内情报" }, { key: 'IntelligenceWithin', name: '社内情报' }
]; ]
const state = ref<any>({}); const state = ref<any>({})
async function getData() { async function getData() {
const { id, flag } = route.params; const { id, flag } = route.params
console.log(typeof(flag)) console.log(typeof flag)
if (!id) return; if (!id) return
if (flag === 'true') { if (flag === 'true') {
// & // &
const { data } = await getManagerDetail(id as string); const { data } = await getManagerDetail(id as string)
data.tagColor = data.tag === "紧急" ? "#e60e0e" : "#2cba06"; data.tagColor = data.tag === '紧急' ? '#e60e0e' : '#2cba06'
data.content = unescapeHTML(data.content); data.content = unescapeHTML(data.content)
state.value = data; state.value = data
} else { } else {
const { data } = await getArticleDetail(id as string); const { data } = await getArticleDetail(id as string)
data.tagColor = data.tag === "紧急" ? "#e60e0e" : "#2cba06"; data.tagColor = data.tag === '紧急' ? '#e60e0e' : '#2cba06'
data.content = unescapeHTML(data.content); data.content = unescapeHTML(data.content)
state.value = data; state.value = data
} }
} }
function unescapeHTML(html: string) { function unescapeHTML(html: string) {
const doc = new DOMParser().parseFromString(html, "text/html"); const doc = new DOMParser().parseFromString(html, 'text/html')
return doc.documentElement.textContent; return doc.documentElement.textContent
} }
async function getDatas(id: string) { async function getDatas(id: string) {
if (!id) return; if (!id) return
const { data } = await getArticleDetail(id as string); const { data } = await getArticleDetail(id as string)
data.content = unescapeHTML(data.content); data.content = unescapeHTML(data.content)
state.value = data; state.value = data
} }
async function toDetail2(n: { id: any }) { async function toDetail2(n: { id: any }) {
console.log(route, route.path, n.id); console.log(route, route.path, n.id)
if (n.id === 0) return; if (n.id === 0) return
if (n.isSelect === 1) { if (n.isSelect === 1) {
getDatas(n.id); getDatas(n.id)
} else { } else {
message.info("您没有权限查看!"); message.info('您没有权限查看!')
} }
} }
getData(); getData()
getPageList(1); getPageList(1)
getPageLists(1); getPageLists(1)
const neiScoll = ref<HTMLElement | null>(null); const neiScoll = ref<HTMLElement | null>(null)
const waiScoll = ref<HTMLElement | null>(null); const waiScoll = ref<HTMLElement | null>(null)
onMounted(() => { onMounted(() => {
neiScoll.value?.addEventListener("scroll", handleNeiScoll); neiScoll.value?.addEventListener('scroll', handleNeiScoll)
waiScoll.value?.addEventListener("scroll", handlewaiScoll); waiScoll.value?.addEventListener('scroll', handlewaiScoll)
}); })
const listData = ref<any[]>([]); const listData = ref<any[]>([])
let neiLength: number; let neiLength: number
let neiPum = 1; let neiPum = 1
async function getPageList(page) { async function getPageList(page) {
const pasr = { const pasr = {
pageNum: page, pageNum: page,
pageSize: 6, pageSize: 5,
type: 2, type: 2,
position: "recommend", position: 'recommend'
}; }
const { rows, total } = await getArticlePage(pasr); const { rows, total } = await getArticlePage(pasr)
neiLength = total / 6; neiLength = total / 6
listData.value.push(...rows); listData.value.push(...rows)
console.log(listData.value); console.log(listData.value)
} }
const listDatas = ref<any[]>([]); const listDatas = ref<any[]>([])
let waiLength: number; let waiLength: number
let waiPum = 1; let waiPum = 1
async function getPageLists(page) { async function getPageLists(page) {
const pasr = { const pasr = {
pageNum: page, pageNum: page,
pageSize: 6, pageSize: 5,
type: 1, type: 1,
position: "recommend", position: 'recommend'
}; }
const { rows, total } = await getArticlePage(pasr); const { rows, total } = await getArticlePage(pasr)
waiLength = total / 6; waiLength = total / 6
listDatas.value.push(...rows); listDatas.value.push(...rows)
} }
const handleNeiScoll = () => { const handleNeiScoll = () => {
const container = neiScoll.value; const container = neiScoll.value
if (container) { if (container) {
const isAtBottom = const isAtBottom =
container.scrollHeight - container.scrollTop === container.clientHeight; container.scrollHeight - container.scrollTop === container.clientHeight
if (isAtBottom) { if (isAtBottom) {
if (neiPum < neiLength) { if (neiPum < neiLength) {
++neiPum; ++neiPum
getPageList(neiPum); getPageList(neiPum)
}
} }
} }
} }
};
const handlewaiScoll = () => { const handlewaiScoll = () => {
const container = waiScoll.value; const container = waiScoll.value
if (container) { if (container) {
const isAtBottom = const isAtBottom =
container.scrollHeight - container.scrollTop === container.clientHeight; container.scrollHeight - container.scrollTop === container.clientHeight
if (isAtBottom) { if (isAtBottom) {
if (waiPum < waiLength) { if (waiPum < waiLength) {
++waiPum; ++waiPum
getPageList(waiPum); getPageList(waiPum)
}
} }
} }
} }
};
</script> </script>
<template> <template>

View File

@ -4,7 +4,7 @@ import { pageType } from '@/stores/modules/pages'
const store = pageType() const store = pageType()
export const Navs = [ export const Navs = [
{ key: 'IntelligenceOutside', name: '社外', type: '1' }, { key: 'IntelligenceOutside', name: '社外', type: '1' },
{ key: 'IntelligenceWithin', name: '社内', type: '2' }, { key: 'IntelligenceWithin', name: '社内', type: '2' }
] ]
export function useData() { export function useData() {
@ -17,7 +17,7 @@ export function useData() {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
cate: store.page.types, cate: store.page.types || sessionStorage.getItem('types')
}) })
const list = ref<any[]>([]) const list = ref<any[]>([])
@ -31,7 +31,12 @@ export function useData() {
list.value = [] list.value = []
state.total = 0 state.total = 0
const { rows, total } = await getArticlePage({ type: _type, cate, pageNum, pageSize }) const { rows, total } = await getArticlePage({
type: _type,
cate,
pageNum,
pageSize
})
const _rows = rows.map((i: any) => { const _rows = rows.map((i: any) => {
i.tagColor = i.tag === '紧急' ? '#e60e0e' : '#2cba06' i.tagColor = i.tag === '紧急' ? '#e60e0e' : '#2cba06'
return i return i
@ -74,7 +79,7 @@ export function useData() {
getData() getData()
}, },
{ immediate: true, deep: true }, { immediate: true, deep: true }
) )
return { state, list, getData } return { state, list, getData }

View File

@ -20,11 +20,11 @@ const props = defineProps({
routets: String, routets: String,
swipImgs: { swipImgs: {
type: Array as PropType<any[]>, type: Array as PropType<any[]>,
default: () => [], default: () => []
}, },
items: { items: {
type: Array as PropType<any[]>, type: Array as PropType<any[]>,
default: () => [], default: () => []
} }
}) })
let indexs = 3 let indexs = 3
@ -49,6 +49,7 @@ const setSwiperRef = (swiper: any) => {
} }
const toDest = (id: any) => { const toDest = (id: any) => {
store.page.types = id store.page.types = id
sessionStorage.setItem('types', id)
// console.log(routet,routet.path) // console.log(routet,routet.path)
push({ name: props.route }) push({ name: props.route })
} }
@ -57,17 +58,17 @@ const toDetail2 =(n)=>{
if (n.id === 0) return if (n.id === 0) return
if (n.isSelect === 1) { if (n.isSelect === 1) {
push(`${routet.path.replace('/Home', '')}/${props.routets}/${n.id}`) push(`${routet.path.replace('/Home', '')}/${props.routets}/${n.id}`)
} else {
message.error('没有访问权限')
} }
else{
message.error("没有访问权限")
}
} }
</script> </script>
<template> <template>
<section
<section v-if="swipImgs?.length" class="w640px h280px mt18px relative min-h280px"> v-if="swipImgs?.length"
class="w640px h280px mt18px relative min-h280px"
>
<Swiper <Swiper
@slideChangeTransitionEnd="handleIndex" @slideChangeTransitionEnd="handleIndex"
@swiper="setSwiperRef" @swiper="setSwiperRef"
@ -83,36 +84,79 @@ const toDetail2 =(n)=>{
> >
<template v-for="(item, index) in swipImgs" :key="index"> <template v-for="(item, index) in swipImgs" :key="index">
<SwiperSlide> <SwiperSlide>
<img :src="item.bannerImg" alt="" @click="toDetail2(item)" class="w100%"/> <img
<div class="absolute w-full bg-#062910/60 h52px left-0 bottom-0 z-9 text-#fff flex px18px items-center"> :src="item.bannerImg"
<div class="text-ellipsis text-22px font-600 max-w480px" @click="toDetail2(item)" :title="item.title">{{ item.title }}</div> alt=""
@click="toDetail2(item)"
class="w100%"
/>
<div
class="absolute w-full bg-#062910/60 h52px left-0 bottom-0 z-9 text-#fff flex px18px items-center"
>
<div
class="text-ellipsis text-22px font-600 max-w480px"
@click="toDetail2(item)"
:title="item.title"
>
{{ item.title }}
</div>
</div> </div>
</SwiperSlide> </SwiperSlide>
<div class="absolute w-full h52px left-0 bottom-0 z-10 flex px18px items-center justify-end"> <div
class="absolute w-full h52px left-0 bottom-0 z-10 flex px18px items-center justify-end"
>
<div class="dots shrink-0 cursor-pointer"> <div class="dots shrink-0 cursor-pointer">
<span :class="`dot ${swipeActiveIndex === idx && 'active'}`" v-for="(item, idx) in swipImgs" :key="item" @click="slideTo(idx)"></span> <span
:class="`dot ${swipeActiveIndex === idx && 'active'}`"
v-for="(item, idx) in swipImgs"
:key="item"
@click="slideTo(idx)"
></span>
</div> </div>
</div> </div>
</template> </template>
</Swiper> </Swiper>
</section> </section>
<section class="max-h-500px overflow-y-auto -webkit-scrollbar"> <section class="max-h-500px overflow-y-auto -webkit-scrollbar">
<div
<div class="flex mt19px items min-h-140px" v-for="item in items" :key="item"> class="flex mt19px items min-h-140px"
<div class="w100px h100px rd-20px flex-shrink flex flex-col justify-center items-center text-#fff" :style="{ backgroundColor: item.color }"> v-for="item in items"
:key="item"
>
<div
class="w100px h100px rd-20px flex-shrink flex flex-col justify-center items-center text-#fff"
:style="{ backgroundColor: item.color }"
>
<img :src="item.icon" /> <img :src="item.icon" />
<span class="mt14px">{{ item.name }}</span> <span class="mt14px">{{ item.name }}</span>
</div> </div>
<div class="flex flex-col flex-1 ml16px min-h-120px"> <div class="flex flex-col flex-1 ml16px min-h-120px">
<template v-if="item.list.length > 0"> <template v-if="item.list.length > 0">
<AppAlert class="flex cursor-pointer" cate="1"> <AppAlert class="flex cursor-pointer" cate="1">
<span v-if="item.list[0].isTop === 'Y'" class="flex-1 w0 truncate font-500" @click="toDetail2(item.list[0])" :title="item.list[0].source">{{ item.list[0].title }}</span> <span
<span class="flex-1 w0 truncate font-500" v-if="item.list[0].isTop === 'N'" ></span> v-if="item.list[0].isTop === 'Y'"
<img v-if="item.list[0].isTop === 'Y'" src="../../../assets/images/jj.gif" class="h27px mr5px mt3px"> class="flex-1 w0 truncate font-500"
@click="toDetail2(item.list[0])"
:title="item.list[0].source"
>{{ item.list[0].title }}</span
>
<span
class="flex-1 w0 truncate font-500"
v-if="item.list[0].isTop === 'N'"
></span>
<img
v-if="item.list[0].isTop === 'Y'"
src="../../../assets/images/jj.gif"
class="h27px mr5px mt3px"
/>
<div class="flex h40px lh-40px text-#fff text-18px"> <div class="flex h40px lh-40px text-#fff text-18px">
<div class="pr40px cursor-pointer more text-14px" @click="toDest(item.key)"></div> <div
class="pr40px cursor-pointer more text-14px"
@click="toDest(item.key)"
>
更多
</div>
</div> </div>
</AppAlert> </AppAlert>
<div class="" v-for="(n, idx) in item.news" :key="n.title"> <div class="" v-for="(n, idx) in item.news" :key="n.title">
<!-- <div v-if="idx ==0"> <!-- <div v-if="idx ==0">
@ -126,37 +170,47 @@ const toDetail2 =(n)=>{
</div> </div>
<div v-else> --> <div v-else> -->
<div v-if="idx<3" class="mt8px cursor-pointer flex items-center h25px" :data-date="n.publishTime" @click="toDetail2(n)"> <div
v-if="idx < 3"
<span class="truncate flex-1 w0 text-#142142 hover:underline mt4px" :style="n.isRead===2?'color:#0058E5;font-weight':''" :title="n.source">{{ n.title }}</span> class="mt8px cursor-pointer flex items-center h25px"
:data-date="n.publishTime"
@click="toDetail2(n)"
>
<span
class="truncate flex-1 w0 text-#142142 hover:underline mt4px"
:style="n.isRead === 2 ? 'color:#0058E5;font-weight' : ''"
:title="n.source"
>{{ n.title }}</span
>
<span class="mt4.5px"> <span class="mt4.5px">
<img v-if="n.tag === 'New'" src="./images/NEW3.gif" class="h20px"> <img
v-if="n.tag === 'New'"
src="./images/NEW3.gif"
class="h20px"
/>
</span> </span>
<span class="shrink-0 ml18px text-#808696 mt4px">{{ n.publishTime }}</span> <span class="shrink-0 ml18px text-#808696 mt4px">{{
n.publishTime
}}</span>
</div> </div>
<!-- </div> --> <!-- </div> -->
</div> </div>
</template> </template>
<template v-else> <template v-else>
<AppAlert class="flex cursor-pointer" cate="1"> <AppAlert class="flex cursor-pointer" cate="1">
<span class="flex-1 w0 truncate font-500"></span> <span class="flex-1 w0 truncate font-500"></span>
<div class="flex h40px lh-40px text-#fff text-18px"> <div class="flex h40px lh-40px text-#fff text-18px">
<div class="pr40px cursor-pointer more text-14px" @click="toDest(item.key)"></div> <div
class="pr40px cursor-pointer more text-14px"
@click="toDest(item.key)"
>
更多
</div>
</div> </div>
</AppAlert> </AppAlert>
</template> </template>
</div> </div>
</div> </div>
</section> </section>
</template> </template>
@ -172,7 +226,7 @@ const toDetail2 =(n)=>{
} }
.title { .title {
background: linear-gradient(0deg, #466CCD, #5C87F5); background: linear-gradient(0deg, #466ccd, #5c87f5);
border-radius: 10px; border-radius: 10px;
opacity: 0.52; opacity: 0.52;
} }

View File

@ -8,16 +8,40 @@ import { useDate } from '@/views/home/hooks/useDate'
const { day, week } = useDate() const { day, week } = useDate()
const { push } = useRouter() const { push } = useRouter()
const array = ref<any[]>([ const array = ref<any[]>([
{ content1: '将扩大的机遇转为成果 更强更大地展翅飞翔', content2: 'ひろがるチャンスを 成果につなげ 強く大きく 羽ばたこう', year: '2023年' }, {
content1: '将扩大的机遇转为成果 更强更大地展翅飞翔',
content2: 'ひろがるチャンスを 成果につなげ 強く大きく 羽ばたこう',
year: '2023年'
},
{ content1: '领先时代的变化 开创崭新的未来', content2: '', year: '2022年' }, { content1: '领先时代的变化 开创崭新的未来', content2: '', year: '2022年' },
{ content1: '以“重大变化”为契机 向新课题发起挑战', content2: '', year: '2021年' }, {
{ content1: '加速推进三个协创 决胜于变化的时代', content2: '', year: '2020年' }, content1: '以“重大变化”为契机 向新课题发起挑战',
{ content1: '以三个协创为轴心 人人迅速果断行动', content2: '', year: '2016年' }, content2: '',
{ content1: '突破壁垒 集中优势 不断挑战新课题', content2: '', year: '2018年' }, year: '2021年'
{ content1: '坚持以人为轴心,融合新的力量', content2: '集团上下齐心协力提升企业价值', year: '2017年' }, },
{
content1: '加速推进三个协创 决胜于变化的时代',
content2: '',
year: '2020年'
},
{
content1: '以三个协创为轴心 人人迅速果断行动',
content2: '',
year: '2016年'
},
{
content1: '突破壁垒 集中优势 不断挑战新课题',
content2: '',
year: '2018年'
},
{
content1: '坚持以人为轴心,融合新的力量',
content2: '集团上下齐心协力提升企业价值',
year: '2017年'
},
{ content1: '站稳脚跟 强化优势 大步迈进', content2: '', year: '2016年' }, { content1: '站稳脚跟 强化优势 大步迈进', content2: '', year: '2016年' },
{ content1: '创造未来,决胜于变化的时代', content2: '', year: '2015年' }, { content1: '创造未来,决胜于变化的时代', content2: '', year: '2015年' }
]); ])
</script> </script>
<template> <template>
@ -47,7 +71,7 @@ const array = ref<any[]>([
</div> </div>
</div> --> </div> -->
<div class="mt30px mr20px flex w100%"> <div class="mt30px mr20px flex w100%">
<img src="../../../assets/images/tizhibiaozi.png" class="w100%"/> <img src="../../../assets/images/fzqiet2.png" class="w100%" />
</div> </div>
</template> </template>
@ -60,7 +84,7 @@ const array = ref<any[]>([
.g-wrapper { .g-wrapper {
border-radius: 18px; border-radius: 18px;
border: 1px solid #E7EBF5; border: 1px solid #e7ebf5;
box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32); box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32);
overflow: hidden; overflow: hidden;
@ -74,7 +98,7 @@ const array = ref<any[]>([
.year { .year {
left: -132px; left: -132px;
top: -14px; top: -14px;
color: #003CB7; color: #003cb7;
font-size: 26px; font-size: 26px;
font-weight: normal; font-weight: normal;
text-align: center; text-align: center;

View File

@ -1,44 +1,45 @@
<!-- 品质 --> <!-- 品质 -->
<script setup lang="ts"> <script setup lang="ts">
import HomeHead from "@/views/home/components/HomeHead.vue"; import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from "@/views/home/components/HomeHeadSearch.vue"; // import HomeHeadSearch from "@/views/home/components/HomeHeadSearch.vue";
import { useDate } from "@/views/home/hooks/useDate"; import { useDate } from '@/views/home/hooks/useDate'
import { useChart21 } from "./Quality"; import { useChart21 } from './Quality'
import { useUserStore } from "@/stores/modules/user"; import { useUserStore } from '@/stores/modules/user'
import { NModal ,useMessage} from "naive-ui"; import { NModal, useMessage } from 'naive-ui'
import Amtion from '@/components/amtion.vue' import Amtion from '@/components/amtion.vue'
import { import {
topList, topList,
actList, actList,
highList, highList,
badartList, badartList,
topStat, topStat
} from "@/api/daikin/base"; } from '@/api/daikin/base'
import { isNotOneWeekAgo } from '@/utils'
// import { it } from "element-plus/es/locale/index.js"; // import { it } from "element-plus/es/locale/index.js";
const store = useUserStore(); const store = useUserStore()
const userCode = ["admin", "quality_dangdan", "tech_service"].includes( const userCode = ['admin', 'quality_dangdan', 'tech_service'].includes(
store.user.roleCode store.user.roleCode
); )
const message = useMessage() const message = useMessage()
// console.log(userCode); // console.log(userCode);
const dataA = ref([]); const dataA = ref([])
const dataB = ref([]); const dataB = ref([])
const dataC = ref([]); const dataC = ref([])
const dataD = ref([]); const dataD = ref([])
const dataE = ref([]); const dataE = ref([])
const { chartRef, option } = useChart21(); const { chartRef, option } = useChart21()
// const options = reactive(option); // const options = reactive(option);
async function getData() { async function getData() {
const { rows: _rowA } = await topList(); const { rows: _rowA } = await topList()
const { rows: _rowB } = await actList(); const { rows: _rowB } = await actList()
const { rows: _rowC } = await highList(); const { rows: _rowC } = await highList()
const { rows: _rowD } = await badartList(); const { rows: _rowD } = await badartList()
dataA.value = _rowA; dataA.value = _rowA
dataB.value = _rowB; dataB.value = _rowB
dataC.value = _rowC; dataC.value = _rowC
dataD.value = _rowD; dataD.value = _rowD
// dataE.value = _rowE; // dataE.value = _rowE;
// options.series = _rowE // options.series = _rowE
@ -49,154 +50,165 @@ async function getData() {
// }); // });
// options.yAxis.data = _rowE.topItem.slice(0, 10).map(item => item.indexId) // options.yAxis.data = _rowE.topItem.slice(0, 10).map(item => item.indexId)
} }
getData(); getData()
const { day, week } = useDate(); const { day, week } = useDate()
const { push } = useRouter(); const { push } = useRouter()
const tableData = [ const tableData = [
{ {
date: "2016-05-03", date: '2016-05-03',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-02", date: '2016-05-02',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-04", date: '2016-05-04',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, },
{ {
date: "2016-05-01", date: '2016-05-01',
name: "xxx类别", name: 'xxx类别',
address: "卧龙电机XX批 次运输不良", address: '卧龙电机XX批 次运输不良'
}, }
]; ]
// //
const commandVal = (type, command) => { const commandVal = (type, command) => {
return { return {
type: type, type: type,
command: command, command: command
}; }
}; }
const handleCommand = (item) => { const handleCommand = (item) => {
console.log(item); console.log(item)
const { type, command } = item; const { type, command } = item
// window.open(command.url, "_blank"); // window.open(command.url, "_blank");
}; }
// const openUrl = (url) => { // const openUrl = (url) => {
// console.log(url,111); // console.log(url,111);
// // window.open(url, "_blank"); // // window.open(url, "_blank");
// }; // };
const value1 = ref(null); const value1 = ref(null)
const src = ref(''); const src = ref('')
const srcType = ref() const srcType = ref()
const showModalRef2 = ref(false) const showModalRef2 = ref(false)
const openUrl = async (url) => { const openUrl = async (url) => {
console.log(url) console.log(url)
if (!url) { if (!url) {
message.info("没有可预览文件!") message.info('没有可预览文件!')
return return
} }
srcType.value = getLastSubstring(url) srcType.value = getLastSubstring(url)
if(['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'].includes(srcType.value)){ if (
['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)
) {
// src.value = filePath // src.value = filePath
// pdfShow.value = true // pdfShow.value = true
url = 'https://view.xdocin.com/view?src=' + url url = 'https://view.xdocin.com/view?src=' + url
const screenWidth = window.screen.width; const screenWidth = window.screen.width
const screenHeight = window.screen.height; const screenHeight = window.screen.height
window.open(url, '', 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0) window.open(
url,
'',
'width=' +
screenWidth +
',height=' +
screenHeight +
',top=' +
0 +
',left=' +
0
)
} else {
message.error(
"文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'"
)
} }
else{
message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
}
} }
function getLastSubstring(str: string): string { function getLastSubstring(str: string): string {
const lastIndex = str.lastIndexOf('.'); const lastIndex = str.lastIndexOf('.')
if (lastIndex !== -1) { if (lastIndex !== -1) {
return str.substring(lastIndex + 1); return str.substring(lastIndex + 1)
} else { } else {
return ''; return ''
} }
} }
</script> </script>
<template> <template>
@ -223,7 +235,7 @@ function getLastSubstring(str: string): string {
<div class="caver relative"> <div class="caver relative">
<div class="box-title">不良情报</div> <div class="box-title">不良情报</div>
<div class="absolute right-0 top-30px w195px text-16px text-#B2B7BE"> <div class="absolute right-0 top-30px w195px text-16px text-#B2B7BE">
{{ dataD.length > 0 ? "更新时间:" + dataD[0]?.createTime : "" }} {{ dataD.length > 0 ? '更新时间:' + dataD[0]?.createTime : '' }}
</div> </div>
<div class="mt23px overflow-y-auto"> <div class="mt23px overflow-y-auto">
<el-table <el-table
@ -237,14 +249,31 @@ function getLastSubstring(str: string): string {
color: '#fff', color: '#fff',
height: '60px', height: '60px',
'margin-top': '20px', 'margin-top': '20px',
'font-size': '18px', 'font-size': '18px'
}" }"
:cell-style="{ 'text-align': 'center', height: '70px', 'font-size': '18px' }" :cell-style="{
'text-align': 'center',
height: '70px',
'font-size': '18px'
}"
cell-class-name="p-0"
> >
<el-table-column prop="createTime" label="时间" width="134px" /> <el-table-column prop="createTime" label="时间" style="">
<el-table-column prop="cate" label="类别" width="100px" /> <template #default="{ row }">
<el-table-column prop="title" label="详情" /> <div class="flex items-center justify-center">
<el-table-column prop="filePathList" label="情报追踪"> <img
v-if="isNotOneWeekAgo(row.createTime)"
src="@/assets/images/NEW.gif"
class="!h-20px !w-auto mr-2px"
alt=""
/>
<span>{{ row.createTime }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="cate" label="类别" width="60px" />
<el-table-column prop="title" label="详情" width="120px" />
<el-table-column prop="filePathList" label="情报追踪" width="100px">
<template #default="{ row, $index }"> <template #default="{ row, $index }">
<span <span
v-if="row.filePathList.length > 0" v-if="row.filePathList.length > 0"
@ -298,15 +327,13 @@ function getLastSubstring(str: string): string {
<div class="w100% h350px pt30px"> <div class="w100% h350px pt30px">
<VChart :option="option" /> <VChart :option="option" />
</div> </div>
</div> </div>
<div class="mt23px overflow-y-auto"> <div class="mt23px overflow-y-auto">
<el-table <el-table
:data="dataA" :data="dataA"
stripe stripe
height="400px" height="400px"
style="width: 100%;" style="width: 100%"
scrollbar-always-on scrollbar-always-on
:header-cell-style="{ :header-cell-style="{
'text-align': 'center', 'text-align': 'center',
@ -314,9 +341,13 @@ function getLastSubstring(str: string): string {
color: '#fff', color: '#fff',
height: '60px', height: '60px',
'margin-top': '20px', 'margin-top': '20px',
'font-size': '18px', 'font-size': '18px'
}"
:cell-style="{
'text-align': 'center',
height: '70px',
'font-size': '18px'
}" }"
:cell-style="{ 'text-align': 'center', height: '70px', 'font-size': '18px' }"
> >
<el-table-column prop="monthStr" label="时间" width="70px" /> <el-table-column prop="monthStr" label="时间" width="70px" />
<el-table-column prop="indexId" label="供应商" width="" /> <el-table-column prop="indexId" label="供应商" width="" />
@ -361,9 +392,9 @@ function getLastSubstring(str: string): string {
<div class="h400px relative"> <div class="h400px relative">
<div class="box-title">品质情报</div> <div class="box-title">品质情报</div>
<div <div
class="absolute right-0 top-10px w165px text-14px text-#B2B7BE" class="absolute right-0px top-10px w165px text-14px text-#B2B7BE"
> >
{{ dataC.length > 0 ? "更新时间:" + dataC[0].createTime : "" }} {{ dataC.length > 0 ? '更新时间:' + dataC[0].createTime : '' }}
</div> </div>
<div class="mt23px overflow-y-auto"> <div class="mt23px overflow-y-auto">
<el-table <el-table
@ -377,13 +408,30 @@ function getLastSubstring(str: string): string {
color: '#fff', color: '#fff',
height: '60px', height: '60px',
'margin-top': '20px', 'margin-top': '20px',
'font-size': '18px', 'font-size': '18px'
}" }"
:cell-style="{ 'text-align': 'center', height: '70px', 'font-size': '18px' }" :cell-style="{
'text-align': 'center',
height: '70px',
'font-size': '18px'
}"
cell-class-name="p-0"
> >
<el-table-column prop="createTime" label="时间" width="134px" /> <el-table-column prop="createTime" label="时间" width="160px">
<template #default="{ row }">
<div class="flex items-center justify-center">
<img
v-if="isNotOneWeekAgo(row.createTime)"
src="@/assets/images/NEW.gif"
class="!h-20px !w-auto mr-2px"
alt=""
/>
<span>{{ row.createTime }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="title" label="详情" width="110px" /> <el-table-column prop="title" label="详情" width="110px" />
<el-table-column prop="source" label="来源" width="110px" /> <el-table-column prop="source" label="来源" width="60px" />
<el-table-column <el-table-column
prop="createTime" prop="createTime"
label="情报追踪" label="情报追踪"
@ -427,7 +475,7 @@ function getLastSubstring(str: string): string {
<div <div
class="absolute right-0 top-40px w165px text-14px text-#B2B7BE" class="absolute right-0 top-40px w165px text-14px text-#B2B7BE"
> >
{{ dataB.length > 0 ? "更新时间:" + dataB[0].createTime : "" }} {{ dataB.length > 0 ? '更新时间:' + dataB[0].createTime : '' }}
</div> </div>
<div class="mt23px overflow-y-auto"> <div class="mt23px overflow-y-auto">
<el-table <el-table
@ -441,17 +489,35 @@ function getLastSubstring(str: string): string {
color: '#fff', color: '#fff',
height: '60px', height: '60px',
'margin-top': '20px', 'margin-top': '20px',
'font-size': '18px', 'font-size': '18px'
}" }"
:cell-style="{ 'text-align': 'center', height: '70px', 'font-size': '18px' }" :cell-style="{
'text-align': 'center',
height: '70px',
'font-size': '18px'
}"
cell-class-name="p-0"
> >
<el-table-column prop="createTime" label="时间" width="150px" /> <!-- <el-table-column prop="createTime" label="时间" width="150px" /> -->
<el-table-column prop="createTime" label="时间" width="160px">
<template #default="{ row }">
<div class="flex items-center justify-center">
<img
v-if="isNotOneWeekAgo(row.createTime)"
src="@/assets/images/NEW.gif"
class="!h-20px !w-auto mr-2px"
alt=""
/>
<span>{{ row.createTime }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="title" label="内容" width="150px" /> <el-table-column prop="title" label="内容" width="150px" />
<el-table-column <el-table-column
prop="createTime" prop="createTime"
label="活动追踪" label="活动追踪"
width="150px" width="140px"
> >
<template #default="{ row, $index }"> <template #default="{ row, $index }">
<span <span
@ -493,7 +559,6 @@ function getLastSubstring(str: string): string {
<div class="w90% h90%"> <div class="w90% h90%">
<Amtion :data="src" :datas="srcType" /> <Amtion :data="src" :datas="srcType" />
</div> </div>
</n-modal> </n-modal>
</template> </template>
@ -531,10 +596,10 @@ function getLastSubstring(str: string): string {
color: #fff; color: #fff;
} }
.bg1 { .bg1 {
background: url("./images/lquan.png"); background: url('./images/lquan.png');
} }
.bg2 { .bg2 {
background: url("./images/lvquan.png"); background: url('./images/lvquan.png');
} }
.box-title { .box-title {
font-size: 28px; font-size: 28px;
@ -543,7 +608,7 @@ function getLastSubstring(str: string): string {
padding-left: 24px; padding-left: 24px;
&::before { &::before {
content: " "; content: ' ';
display: block; display: block;
width: 8px; width: 8px;
height: 30px; height: 30px;
@ -578,4 +643,10 @@ function getLastSubstring(str: string): string {
// box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32); // box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32);
overflow: hidden; overflow: hidden;
} }
:deep {
.p-0 .cell {
padding: 0 !important;
}
}
</style> </style>

View File

@ -2,10 +2,10 @@
import { RouterView } from 'vue-router' import { RouterView } from 'vue-router'
import { useTitle } from '@vueuse/core' import { useTitle } from '@vueuse/core'
import { getImg } from '@/assets/images' import { getImg } from '@/assets/images'
import { NModal } from 'naive-ui' import { NModal, NPopover } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import Searchs from '@/components/search.vue' import Searchs from '@/components/search.vue'
import {report} from '@/api/daikin/base' import { report, treeDbList } from '@/api/daikin/base'
useTitle('大金中国调达本部 HOMEPAGE') useTitle('大金中国调达本部 HOMEPAGE')
const { push } = useRouter() const { push } = useRouter()
const store = useUserStore() const store = useUserStore()
@ -14,11 +14,24 @@ const { toggle } = inject<any>('fullscreen')
const activeMenuKey = ref('Home') const activeMenuKey = ref('Home')
let idx = ref(0) let idx = ref(0)
const Menus = [ const Menus = ref([
// //
{ key: 'Home', name: '首页', icon: getImg('home.png'), icon1: getImg('home1.png'),link:'' },
{ {
key: 'Group', name: '年度方针', icon: getImg('company.png'),icon1: getImg('company1.png'),link:'' , key: 'Home',
name: '首页',
icon: getImg('home.png'),
icon1: getImg('home1.png'),
link: '',
path: '/Home',
other: 'Top Page'
},
{
key: 'Group',
name: '集团部门方针',
icon: getImg('company.png'),
icon1: getImg('company1.png'),
link: '',
path: '/Home/group'
// children: [ // children: [
// { key: 'Group', name: '-' }, // { key: 'Group', name: '-' },
// { key: 'Company', name: '-' }, // { key: 'Company', name: '-' },
@ -26,62 +39,126 @@ const Menus = [
// ] // ]
}, },
// { key: 'company', name: '', icon: getImg('icon-company.svg') }, // { key: 'company', name: '', icon: getImg('icon-company.svg') },
{ key: 'User', name: '年度活动日程表', icon: getImg('book.png'),icon1: getImg('book1.png'),link:'' {
key: 'User',
name: '年度活动日程表',
icon: getImg('book.png'),
icon1: getImg('book1.png'),
link: '',
path: '/Home/User'
// children: [ // children: [
// { key: '', name: 'Database' }, // { key: '', name: 'Database' },
// ] // ]
}, },
// { key: 'database', name: 'Database', icon: getImg('shuju.png'),icon1: getImg('shuju1.png'),link:'https://procurement.daikin.net.cn/scripts/cbgrn/grn.exe/' }, // { key: 'database', name: 'Database', icon: getImg('shuju.png'),icon1: getImg('shuju1.png'),link:'https://procurement.daikin.net.cn/scripts/cbgrn/grn.exe/' },
{ key: 'DataBase', name: '调达Database', icon: getImg('shuju.png'),icon1: getImg('shuju1.png') }, {
{ key: 'link', name: '其他链接', icon: getImg('link.png') ,icon1: getImg('link1.png'),link:'', key: 'DataBase',
name: '调达Database',
icon: getImg('shuju.png'),
icon1: getImg('shuju1.png'),
link: ''
},
{
key: 'link',
name: '其他链接',
icon: getImg('link.png'),
icon1: getImg('link1.png'),
link: '',
other: 'Other Links',
children: [ children: [
{ key: 'YCWZ', name: '调达本部才望子',link:'http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index' }, {
{ key: 'GCDB', name: 'GCDB全球比价系统',link:'http://10.219.11.13/gcdb/' }, key: 'YCWZ',
{ key: 'DJ', name: '大金空调官方网站',link:'https://www.daikin-china.com.cn' }, name: '调达本部才望子',
{ key:'CODE',name:"大金空调中国相关"} link: 'http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index'
},
{
key: 'GCDB',
name: 'GCDB全球比价系统',
link: 'http://10.219.11.13/gcdb/'
},
{
key: 'DJ',
name: '大金空调官方网站',
link: 'https://www.daikin-china.com.cn'
},
{ key: 'CODE', name: '大金空调中国相关' }
] ]
}, },
{ key: 'phone', name: '紧急联络体制表', icon: getImg('phone.png'),icon1: getImg('phone1.png'),link:'' , {
key: 'phone',
name: '紧急联络体制表',
icon: getImg('phone.png'),
icon1: getImg('phone1.png'),
link: '',
path: '/Home/phone'
// children: [ // children: [
// { key: 'inv', name: '' }, // { key: 'inv', name: '' },
// { key: 'visit', name: '访' }, // { key: 'visit', name: '访' },
// ] // ]
}, }
])
] async function getDbTree() {
const { data = [] } = await treeDbList({})
Menus.value[3].children = data.map((item: any) => {
return {
key: 'DataBase',
name: item.name,
params: { id: item.id }
}
})
}
getDbTree()
let flag = false
function menuHandler(menu: any, index: number) { function menuHandler(menu: any, index: number) {
activeMenuKey.value = menu.key activeMenuKey.value = menu.key
console.log(menu,index); console.log(menu, index)
idx.value = index; idx.value = index
console.log(menu.key); console.log(menu.key, 'key')
if (!menu.key) return if (!menu.key) return
if (menu.key === 'DataBase') {
if (flag) {
push({ name: menu.key })
flag = false
return
}
flag = true
setTimeout(() => {
flag = false
}, 300)
}
if (menu.children) return
if (menu.key === 'DataBase') { if (menu.key === 'DataBase') {
const { code } = report({ moduleCode: 'App_Database' }) const { code } = report({ moduleCode: 'App_Database' })
} }
push({ name: menu.key }) push({ name: menu.key })
} }
const route = useRoute()
const shorm = ref(false) const shorm = ref(false)
function goChild(menu:any){
const { path } = useRoute()
watchEffect(() => {
setTimeout(() => {
const index = Menus.value.findIndex((item: any) => item.path === path)
if (index > -1 && idx.value !== index) {
const menu = Menus.value[index]
console.log('🚀 ~ menu:', menu)
menuHandler(menu, index)
}
}, 0)
})
function goChild(menu: any) {
activeItem = menu.key activeItem = menu.key
console.log(menu.key)
if (menu.key === 'CODE') { if (menu.key === 'CODE') {
shorm.value = true shorm.value = true
return
} }
if (menu.link) { if (menu.link) {
} else {
push({ name: menu.key, query: menu.params || {} })
} }
else{
push({name:menu.key})
}
} }
var activeItem = 0 var activeItem = 0
</script> </script>
<template> <template>
@ -89,52 +166,145 @@ var activeItem=0
<div class="w300px -mr-1px flex flex-col shrink-0 overflow-auto"> <div class="w300px -mr-1px flex flex-col shrink-0 overflow-auto">
<!-- @dblclick="toggle" --> <!-- @dblclick="toggle" -->
<img src="@/assets/images/logo.png" class="w197px h44px mt14px" /> <img src="@/assets/images/logo.png" class="w197px h44px mt14px" />
<div class="text-20px text-#fff font-600 mt6px">大金中国调达本部 HOMEPAGE</div> <div class="text-20px text-#fff font-600 mt6px">
大金中国调达本部 HOMEPAGE
</div>
<div class="mt34px w270px min-h80px rd-35px b-4px bg-#fff/16 b-4px b-solid b-#fff/23 overflow-hidden relative"> <div
class="mt34px w270px min-h80px rd-35px b-4px bg-#fff/16 b-4px b-solid b-#fff/23 overflow-hidden relative"
>
<Searchs></Searchs> <Searchs></Searchs>
</div> </div>
<div class="pt44px pb24px flex-1 "> <div class="pt10px pb10px flex-1 max-h-636px">
<div
<div class="nav px36px py24px m10px mr0 rd-32px rd-r-0 flex flex-col text-#fff cursor-pointer" class="nav pl36px pr16px py24px m10px mr0 rd-32px rd-r-0 flex flex-col text-#fff cursor-pointer hover:underline"
v-for="(m, index) in Menus" :key="m.key" :class="activeMenuKey === m.key ? (m.children ?'actives':'active'):''" v-for="(m, index) in Menus"
@click="() => menuHandler(m, index)"> :key="m.key"
:class="
activeMenuKey === m.key ? (m.children ? 'actives' : 'active') : ''
"
@click="() => menuHandler(m, index)"
>
<div :class="activeMenuKey === m.key && 'onActive'"> <div :class="activeMenuKey === m.key && 'onActive'">
<img v-if="activeMenuKey === m.key" :src="m.icon1" class="w22px h22px mr16px mt--5px" /> <img
v-if="activeMenuKey === m.key"
:src="m.icon1"
class="w22px h22px mr16px mt--5px"
/>
<img v-else :src="m.icon" class="w22px h22px mr16px mt--5px" /> <img v-else :src="m.icon" class="w22px h22px mr16px mt--5px" />
<span class="text-22px font-900"> <span
class="text-22px font-900 leading-22px"
<a v-if="m.link" class="no-underline text-#fff" :href="m.link"> {{ m.name }}</a> :class="
(m.key === 'link' || m.key === 'DataBase') &&
'underline border-b-0px border-b-solid'
"
>
<a v-if="m.link" class="no-underline text-#fff" :href="m.link">
{{ m.name }}</a
>
<span v-else> <span v-else>
<a v-if="m.name===''" class="underline text-#fff" > {{ m.name }}</a> <a
v-if="m.key === 'link' || m.key === 'DataBase'"
class="text-#fff"
>
{{ m.name }}</a
>
<span v-else>{{ m.name }}</span> <span v-else>{{ m.name }}</span>
</span> </span>
<span class="text-18px italic font-500" v-if="m.other">{{
m.other
}}</span>
</span> </span>
</div> </div>
<div v-if="m.children && idx == index" class="pl40px"> <div v-if="m.children && idx == index" class="pl40px">
<div class="my20px pl30px text-#fff activeChildren" v-for="(item,ind) in m.children" :key="item.key" @click.stop="goChild(item)" @click="activeItem = ind"> <div
<a v-if="item.link" class="no-underline !text-#fff flex" :href="item.link"><span class="w7px h7px rd-7px bg-#fff block mr-8px mt4px"></span>{{ item.name }}</a> class="my16px pl30px text-#fff activeChildren text-20px"
<span v-else class="flex"><span class="w7px h7px rd-7px bg-#fff block mr-8px mt4px"></span>{{ item.name }}</span> v-for="(item, ind) in m.children"
:key="item.key"
@click.stop="goChild(item)"
@click="activeItem = ind"
>
<a
v-if="item.link"
class="no-underline !text-#fff flex"
:href="item.link"
><span
class="w7px h7px rd-7px bg-#fff block mr-8px mt4px"
></span
>{{ item.name }}</a
>
<span v-else class="flex"
><span
class="w7px h7px rd-7px bg-#fff block mr-8px mt4px"
></span
>{{ item.name }}</span
>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="p20px w270px rd-20px b-4px bg-#fff/16 b-4px b-solid b-#fff/23 text-14px relative" > <div class="h90px w270px"></div>
<a href="http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index" target="_blank" class="no-underline text-#fff"> <n-popover
v-if="false"
trigger="hover"
placement="top"
:style="{ '--n-border-radius': '8px' }"
>
<template #trigger>
<div
class="w270px py14px my20px px24px flex rd-20px bg-#003cb7"
style="box-shadow: 0 2rpx 14rpx 0 #00000069"
>
<div class="flex items-center text-18px"> <div class="flex items-center text-18px">
<img src="@/assets/images/icon-book.svg" class="w22px h22px mr10px" /> <img
src="@/assets/images/dianhhh@2x.png"
class="w22px h22px mr10px"
/>
公司内线
</div>
</div>
</template>
<div
class="text-14px text-#285FE9 flex items-center hover:underline cursor-pointer"
>
<img
src="@/assets/images/wjqq@2x.png"
class="w14px h18px mr4px object-contain"
/>
<span>{{ '公司内线公司内线公司内线' }}</span>
</div>
</n-popover>
<div
class="p20px w270px rd-20px b-4px bg-#fff/4 b-4px b-solid b-#fff/23 text-14px relative"
>
<a
href="http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index"
target="_blank"
class="no-underline text-#fff"
>
<div class="flex items-center text-18px hover:underline">
<img
src="@/assets/images/icon-book.svg"
class="w22px h22px mr10px"
/>
个人日程 个人日程
</div> </div>
<div class="mt18px">9:00-10:00</div> <!-- <div class="mt18px">9:00-10:00</div>
<div class="mt8px">召集部门成员召开项目启动会</div> <div class="mt8px">召集部门成员召开项目启动会</div>
<div class="mt16px">10:01-11:00</div> <div class="mt16px">10:01-11:00</div>
<div class="mt8px">召集部门成员召开项目启动会</div> <div class="mt8px">召集部门成员召开项目启动会</div> -->
<img src="@/assets/images/zhulj@2x.png" class="absolute w22px h22px mr10px top--15px right--20px" /> <img
src="@/assets/images/zhulj@2x.png"
class="absolute w22px h22px mr10px top--15px right--20px"
/>
</a> </a>
<div
class="mt10px ml-30px opacity-70"
@click="(e) => e.stopPropagation()"
>
请点击上方链接登录cybouzu
</div>
</div> </div>
<!-- <div class="p20px w270px rd-20px b-4px bg-#fff/16 b-4px b-solid b-#fff/23 text-14px mt22px"> <!-- <div class="p20px w270px rd-20px b-4px bg-#fff/16 b-4px b-solid b-#fff/23 text-14px mt22px">
@ -151,21 +321,47 @@ var activeItem=0
<RouterView /> <RouterView />
</div> </div>
</div> </div>
<div class="fixed bottom-4px text-#fff text-12px ml38px" style="margin:0; width: 100%; text-align: center;">今日访问人数{{store.user.appLoginToDayCount}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;累计访问人数{{store.user.appLoginCount}}</div> <div
class="fixed bottom-4px text-#fff text-12px ml38px"
style="margin: 0; width: 100%; text-align: center"
>
今日访问人数{{
store.user.appLoginToDayCount
}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;累计访问人数{{ store.user.appLoginCount }}
</div>
<NModal v-model:show="shorm" :mask-closable="false"> <NModal v-model:show="shorm" :mask-closable="false">
<div class="w700px h430px bg-#fff rd-15px"> <div class="w700px h430px bg-#fff rd-15px">
<div class="py5px px15px " style="border-bottom: 1px solid #dadada; font-weight: bold;color: #494A63;"> <div
class="py5px px15px"
style="
border-bottom: 1px solid #dadada;
font-weight: bold;
color: #494a63;
"
>
大金空调中国相关 大金空调中国相关
<img @click="shorm=false" src="@/assets/images/chac@2x.png" class="w15px float-right mt5px mr5px"/> <img
@click="shorm = false"
src="@/assets/images/chac@2x.png"
class="w15px float-right mt5px mr5px"
/>
</div> </div>
<div class="flex mt70px text-center"> <div class="flex mt70px text-center">
<div class="w-full text-center"> <div class="w-full text-center">
<img src="@/assets/images/ewm1@2x.png" class="w200px" /> <img src="@/assets/images/ewm1@2x.png" class="w200px" />
<div class="py10px bg-#377CFF text-#fff w200px rd-20px mt35px mx-auto">大金空调中国视频号</div> <div
class="py10px bg-#377CFF text-#fff w200px rd-20px mt35px mx-auto"
>
大金空调中国视频号
</div>
</div> </div>
<div class="w-full"> <div class="w-full">
<img src="@/assets/images/ewm2@2x.png" class="w200px" /> <img src="@/assets/images/ewm2@2x.png" class="w200px" />
<div class="py10px bg-#377CFF text-#fff w200px rd-20px mt35px mx-auto">大金空调抖音号</div> <div
class="py10px bg-#377CFF text-#fff w200px rd-20px mt35px mx-auto"
>
大金空调抖音号
</div>
</div> </div>
</div> </div>
</div> </div>
@ -173,7 +369,6 @@ var activeItem=0
</template> </template>
<style scoped lang="less"> <style scoped lang="less">
.page { .page {
font-family: 'PingFang SC'; font-family: 'PingFang SC';
user-select: none; user-select: none;
@ -195,7 +390,8 @@ var activeItem=0
top: -48px; top: -48px;
} }
.activeChildren:hover { .activeChildren:hover {
a,span{ a,
span {
text-decoration: underline; text-decoration: underline;
} }
} }
@ -230,7 +426,7 @@ var activeItem=0
background-color: #fff; background-color: #fff;
border-radius: 32px 0 0 32px; border-radius: 32px 0 0 32px;
padding: 24px 36px 24px 36px; padding: 24px 16px 24px 36px;
} }
} }
} }
@ -243,8 +439,6 @@ var activeItem=0
} }
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
scrollbar-width:none scrollbar-width: none;
} }
</style> </style>

View File

@ -8,8 +8,8 @@ const message = useMessage()
const { push } = useRouter() const { push } = useRouter()
const store = useUserStore() const store = useUserStore()
onMounted(() => { onMounted(() => {
const account = localStorage.getItem("accounts") const account = localStorage.getItem('accounts')
const password = localStorage.getItem("passwords") const password = localStorage.getItem('passwords')
if (password) { if (password) {
redss.value = true redss.value = true
formState.account = account formState.account = account
@ -36,47 +36,67 @@ async function handleLogin() {
if (msg) { if (msg) {
push({ name: 'external' }) push({ name: 'external' })
if (redss.value) { if (redss.value) {
localStorage.setItem('accounts', account); localStorage.setItem('accounts', account)
localStorage.setItem('passwords', password); localStorage.setItem('passwords', password)
} }
message.success('登录成功') message.success('登录成功')
} }
} }
const keyDown = (e) => { const keyDown = (e) => {
if(e.key ==='Enter') if (e.key === 'Enter') {
{
handleLogin() handleLogin()
} }
} }
</script> </script>
<template> <template>
<div class="bg-#fff w700px h610px text-center mx-auto p50px mt14% mb20%">
<p
x="0"
<div class="bg-#fff w700px h610px text-center mx-auto p50px my20%"> y="52"
<p x="0" y="52" style="font-size: 52px; font-weight: 800;margin-bottom: 50px;">大金空调(上海)有限公司</p> style="font-size: 52px; font-weight: 800; margin-bottom: 50px"
>
大金空调(上海)有限公司
</p>
<section> <section>
登录名称 登录名称
<div <div
class="b-1px b-solid b-#000 bg-#fff rd-12px inline-flex items-center w416px h-60px px12px cursor-pointer overflow-hidden relative"> class="b-1px b-solid b-#000 bg-#fff rd-12px inline-flex items-center w416px h-60px px12px cursor-pointer overflow-hidden relative"
<input class="h-full w-full text-#142142 text-18px pr54px placeholder-#97a4d2" type="text" >
placeholder="请输入您的账号" maxlength="50" v-model="formState.account" @keydown.enter="keyDown"/> <input
class="h-full w-full text-#142142 text-18px pr54px placeholder-#97a4d2"
type="text"
placeholder="请输入您的账号"
maxlength="50"
v-model="formState.account"
@keydown.enter="keyDown"
/>
</div> </div>
</section> </section>
<section class="mt28px"> <section class="mt28px">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div <div
class="b-1px b-solid b-#000 bg-#fff rd-12px inline-flex items-center w416px h-60px px12px cursor-pointer overflow-hidden relative"> class="b-1px b-solid b-#000 bg-#fff rd-12px inline-flex items-center w416px h-60px px12px cursor-pointer overflow-hidden relative"
<input class="h-full w-full text-#142142 text-18px pr54px placeholder-#97a4d2" type="password" >
placeholder="请输入您的密码" maxlength="50" v-model="formState.password" @keydown.enter="keyDown"/> <input
class="h-full w-full text-#142142 text-18px pr54px placeholder-#97a4d2"
type="password"
placeholder="请输入您的密码"
maxlength="50"
v-model="formState.password"
@keydown.enter="keyDown"
/>
</div> </div>
</section> </section>
<section class="mt16px w-full text-right text-#000"> <section class="mt16px w-full text-right text-#000">
<n-checkbox size="large" label="记住密码" :on-update:checked="pwd" class="mr-50px" :checked="redss"/> <n-checkbox
size="large"
label="记住密码"
:on-update:checked="pwd"
class="mr-50px"
:checked="redss"
/>
</section> </section>
<!-- <!--
<section class="mt28px"> <section class="mt28px">
@ -91,7 +111,9 @@ const keyDown=(e)=>{
<section class="mt48px text-#fff text-28px"> <section class="mt48px text-#fff text-28px">
<div <div
class="inline-flex items-center justify-center rd-10px w416px h62px bg-#345fdd/80 hover-bg-#345fdd/100 cursor-pointer" class="inline-flex items-center justify-center rd-10px w416px h62px bg-#345fdd/80 hover-bg-#345fdd/100 cursor-pointer"
@click="handleLogin" @keydown.enter="keyDown"> @click="handleLogin"
@keydown.enter="keyDown"
>
登录 登录
</div> </div>
</section> </section>
@ -99,11 +121,10 @@ const keyDown=(e)=>{
</template> </template>
<style scoped lang="less"> <style scoped lang="less">
.wrapper { .wrapper {
// background: url('./images/denglbj.png') no-repeat; // background: url('./images/denglbj.png') no-repeat;
background-size: cover; background-size: cover;
background-color: #E4E4E4; background-color: #e4e4e4;
overflow: hidden; overflow: hidden;
.box { .box {
width: 716px; width: 716px;

View File

@ -23,14 +23,14 @@ const themeOverrides:GlobalThemeOverrides = {
borderActive: '' borderActive: ''
}, },
InternalSelectMenu: { InternalSelectMenu: {
borderRadius: '6px', borderRadius: '6px'
} }
} }
} }
} }
onMounted(() => { onMounted(() => {
const account = localStorage.getItem("account") const account = localStorage.getItem('account')
const password = localStorage.getItem("password") const password = localStorage.getItem('password')
if (password) { if (password) {
reds.value = true reds.value = true
formState.account = account formState.account = account
@ -43,7 +43,6 @@ const formState = reactive<LoginReq>({
authType: '1' authType: '1'
}) })
async function handleLogin() { async function handleLogin() {
const { account, password } = formState const { account, password } = formState
@ -56,16 +55,14 @@ async function handleLogin() {
if (msg) { if (msg) {
push({ name: 'Home' }) push({ name: 'Home' })
if (reds.value) { if (reds.value) {
localStorage.setItem('account', account); localStorage.setItem('account', account)
localStorage.setItem('password', password); localStorage.setItem('password', password)
} }
message.success('登录成功') message.success('登录成功')
} }
} }
const keyDown = (e) => { const keyDown = (e) => {
if(e.key ==='Enter') if (e.key === 'Enter') {
{
handleLogin() handleLogin()
} }
} }
@ -76,34 +73,60 @@ const pwd=(e)=>{
</script> </script>
<template> <template>
<div class="bg-#fff w700px h610px text-center mx-auto p50px my20%"> <div class="bg-#fff w700px h610px text-center mx-auto p50px mt14% mb20%">
<p x="0" y="52" style="font-size: 52px; font-weight: 800;margin-bottom: 50px;">大金空调(上海)有限公司</p> <p
x="0"
y="52"
style="font-size: 52px; font-weight: 800; margin-bottom: 50px"
>
大金空调(上海)有限公司
</p>
<section> <section>
登录名称 登录名称
<div <div
class="b-1px b-solid b-#000 bg-#fff rd-12px inline-flex items-center w416px h-60px px12px cursor-pointer overflow-hidden relative"> class="b-1px b-solid b-#000 bg-#fff rd-12px inline-flex items-center w416px h-60px px12px cursor-pointer overflow-hidden relative"
<input class="h-full w-full text-#142142 text-18px pr54px placeholder-#97a4d2" type="text" >
placeholder="请输入您的账号" maxlength="50" v-model="formState.account" @keydown.enter="keyDown"/> <input
class="h-full w-full text-#142142 text-18px pr54px placeholder-#97a4d2"
type="text"
placeholder="请输入您的账号"
maxlength="50"
v-model="formState.account"
@keydown.enter="keyDown"
/>
</div> </div>
</section> </section>
<section class="mt28px"> <section class="mt28px">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div <div
class="b-1px b-solid b-#000 bg-#fff rd-12px inline-flex items-center w416px h-60px px12px cursor-pointer overflow-hidden relative"> class="b-1px b-solid b-#000 bg-#fff rd-12px inline-flex items-center w416px h-60px px12px cursor-pointer overflow-hidden relative"
<input class="h-full w-full text-#142142 text-18px pr54px placeholder-#97a4d2" type="password" >
placeholder="请输入您的密码" maxlength="50" v-model="formState.password" @keydown.enter="keyDown"/> <input
class="h-full w-full text-#142142 text-18px pr54px placeholder-#97a4d2"
type="password"
placeholder="请输入您的密码"
maxlength="50"
v-model="formState.password"
@keydown.enter="keyDown"
/>
</div> </div>
</section> </section>
<section class="mt16px w-full text-right text-#000"> <section class="mt16px w-full text-right text-#000">
<n-checkbox size="large" label="记住密码" :on-update:checked="pwd" class="mr-50px" :checked="reds"/> <n-checkbox
size="large"
label="记住密码"
:on-update:checked="pwd"
class="mr-50px"
:checked="reds"
/>
</section> </section>
<section class="mt48px text-#fff text-28px"> <section class="mt48px text-#fff text-28px">
<div <div
class="inline-flex items-center justify-center rd-10px w416px h62px bg-#345fdd/80 hover-bg-#345fdd/100 cursor-pointer" class="inline-flex items-center justify-center rd-10px w416px h62px bg-#345fdd/80 hover-bg-#345fdd/100 cursor-pointer"
@click="handleLogin"> @click="handleLogin"
>
登录 登录
</div> </div>
</section> </section>