main
wwl 2024-04-12 19:00:10 +08:00
parent 345e57e504
commit 1f20c6f589
12 changed files with 879 additions and 600 deletions

View File

@ -25,6 +25,7 @@
"echarts": "^5.4.3",
"echarts-liquidfill": "^3.1.0",
"element-plus": "^2.6.2",
"lodash-es": "^4.17.21",
"lottie-web": "^5.12.2",
"naive-ui": "^2.34.4",
"pinia": "^2.0.32",

View File

@ -1246,6 +1246,14 @@ export async function getPieChartData(params: any) {
export async function getDepartChart(params: any) {
return http.get(`/moduleStat/getDepartChart`, { params })
}
// 内部访问人数
export async function fetchInsideToday(params: any) {
return http.get(`/moduleStat/getToDayVisitList`, { params })
}
// 更新数量专项统计列表
export async function fetchModuleList(params: any) {
return http.get(`/app/moduleList`, { params })
}
/**
* csr https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=5e2e22e5-fab5-4c46-8a93-8f0c3a3675cb

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View File

@ -129,7 +129,7 @@ const router = createRouter({
{
path: '/Home/latest',
name: 'Latest',
meta: { title: '最更新列表' },
meta: { title: '最更新列表' },
component: () => import('@/views/home/news/news.vue')
},
// 搜索

View File

@ -22,14 +22,14 @@ async function getPageList() {
// console.log(rows)
// for (let index = 0; index < 50; index++) {
listData.value = rows
// }
console.log(listData.value.length)
}
const fetchNewDataList = async () => {
const res = await newDataList({ pageNum: 1, pageSize: 10 })
const data = groupDatesByWeek(res.rows || [])
const res = await newDataList({ pageNum: 1, pageSize: 8 })
// const data = groupDatesByWeek(res.rows || [])
const data = res.rows || []
newsData.value = data
firstItem.value = Object.keys(data)[0]
}
@ -67,11 +67,50 @@ const toDetail2 = (n: any) => {
console.log(n)
if (n.id === 0) return
if (n.isSelect === 1) {
if (n.moduleCode === 'App_Database') {
return push('/DataBase?id=' + n.cateId)
}
if (n.moduleCode === 'App_Article') {
return push('/Home/intelligence/' + n.id)
}
push(`/intelligence/${n.type == 2 ? 'within' : 'outside'}/` + n.id)
} else {
message.error('没有访问权限')
}
}
const downloads = (data: any = {}) => {
const { fileCommon, filePath } = data
if ((fileCommon?.fileSize || 0) > 25 * 1024 * 1024) {
message.info('正在下载中,请稍等~')
downloadFile(filePath)
return
}
if (filePath) {
window.open(filePath, '_blank')
} else {
message.info('没有可预览文件!')
}
}
function downloadFile(url: any) {
fetch(url)
.then((response) => response.blob())
.then((blob) => {
const downloadUrl = URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = downloadUrl
link.download = getFileNameFromUrl(url)
link.click()
})
}
function getFileNameFromUrl(url: string) {
const lastSlashIndex = url.lastIndexOf('/')
if (lastSlashIndex !== -1) {
return url.substring(lastSlashIndex + 1)
} else {
return 'Invalid URL'
}
}
const modules = [Autoplay, Pagination, Navigation, A11y]
const files = ref<any>({})
@ -105,7 +144,7 @@ fetchNewDataList()
:class="[{ 'text-#fff': curTab == 1 }]"
@click="curTab = 0"
>
更新
更新
</div>
<div class="card_title !pt-10px !pl-30px flex-1 !pb-10px" @click="curTab = 1">
<div class="flex justify-between items-center">
@ -168,32 +207,33 @@ fetchNewDataList()
style="height: 280px"
>
<swiper-slide v-for="(i, index) of newsData" :key="index"> -->
<div height="310px" class="h-310px overflow-y-auto">
<div class="text-black mb-10px" v-for="(item, index) of newsData" :key="index">
<div class="flex justify-between items-center">
<span class="text-18px mb-10px mt-20px">{{ index }}</span>
<div height="310px" class="h-310px overflow-hidden">
<!-- <div class="text-black mb-10px" v-for="(item, index) of newsData" :key="index"> -->
<div class="text-black mb-10px" v-for="(i, index) in newsData" :key="index">
<div class="flex justify-between items-center mb4px" v-if="index === 0">
<span class="text-18px mb-10px mt-0px opacity-0">{{ index }}</span>
<span
class="text-16px text-#4D7EE8 cursor-pointer hover:underline"
v-if="firstItem == index"
@click="push({ name: 'Latest' })"
>更多</span
>
</div>
<template v-for="(i, k) in item" :key="k">
<div class="text-#142142 truncate text-16px mt8px">
<div
@click="toDetail2(i)"
class="no-underline text-#142142 cursor-pointer hover:underline h-16px leading-16px"
>
{{ i.title || '' }}
</div>
<!-- <template v-for="(i, k) in item" :key="k"> -->
<div class="flex items-baseline flex-1">
<div
@click="toDetail2(i)"
class="text-#142142 truncate text-18px font-bold w-95% no-underline text-#142142 cursor-pointer hover:underline h-16px leading-16px"
>
<!-- <img class="h-20px" src="@/assets/images/NEW.gif" alt="" /> -->
<span>{{ i.title || '' }}</span>
</div>
<div class="text-#808696 mt-8px text-14px flex items-center justify-between mb-10px">
<span class="flex-1">发布科室: {{ i.departName }}</span>
<span class="w-[36%]">发布人: {{ i.userName }}</span>
<span class="w-[20%]"> {{ i.createTime?.slice(0, 10) }}</span>
<div class="text-#808696 ml20px text-14px flex items-center justify-between mb-10px">
<span class="whitespace-nowrap block w-100px"> {{ i.departName }}</span>
<!-- <span class="w-[36%]"> {{ i.userName }}</span> -->
<span class="whitespace-nowrap block w86px"> {{ i.createTime?.slice(0, 10) }}</span>
</div>
</template>
</div>
<!-- </template> -->
</div>
</div>
<!-- </swiper-slide>

View File

@ -12,10 +12,12 @@ import {
userDetailExport,
getDepartData,
getPieChartData,
getDepartChart
getDepartChart,
fetchModuleList,
fetchInsideToday
} from '@/api/daikin/base'
import { formatDate } from '@/utils/format'
import { Chart1, barEchart, pieEchart } from './indexData'
import { Chart1, barEchart, pieEchart, barEchartModuleList } from './indexData'
import { Search, Download } from '@element-plus/icons-vue'
import { NModal, useMessage } from 'naive-ui'
const message = useMessage()
@ -31,6 +33,7 @@ const chartRef1 = ref()
const chartRef2 = ref()
const chartOption1 = ref<any>({})
const chartOption2 = ref({})
const barEchartModule = ref({})
const primary = ref(1)
const primarys = ref(2)
const activeName = ref('echart')
@ -57,7 +60,8 @@ const colorList: any = [
'#44CF8C',
'#6266F8',
'#FA6B39',
'#F05F96'
'#F05F96',
'#21F3D0'
]
const moduleCode = ref()
const imoduleCode = ref()
@ -152,6 +156,31 @@ const state = reactive<any>({
// timeType:1
})
const insideTodayList = ref<any>([])
const getInsideToday = async () => {
const res: any = await fetchInsideToday({
postId: postId.value,
nickName: nickName.value,
pageNum: pageInfo.currentPage,
pageSize: pageInfo.pageSize,
...states
})
insideTodayList.value = res?.rows || []
pageInfo.total = res?.total || 0
}
const moduleList = ref<any>([])
const getmoduleList = async () => {
const res: any = await fetchModuleList({
pageNum: pageInfo.currentPage,
pageSize: 100 || pageInfo.pageSize,
...states
})
moduleList.value = res?.rows || []
barEchartModule.value = barEchartModuleList(res?.rows || [])
pageInfo.total = res?.total || 0
}
const getInsideListPage = async () => {
const res: any = await fetchmoduleStatInternalPage({
postId: postId.value,
@ -352,6 +381,8 @@ const handleClick = ({ paneName }: any, down: Boolean = false) => {
paneName === 'inside' && getDat()
paneName === 'out-detail' && getListPage()
paneName === 'inside-detail' && getInsideListPage()
paneName === 'inside-today' && getInsideToday()
paneName === 'module-update' && getmoduleList()
paneName === 'inside' &&
setTimeout(() => {
showEchart.value = true
@ -544,10 +575,14 @@ getdeptTree()
<HomeHead class="top"></HomeHead>
<div class="w-full h-850px mt30px rd-20px bg-#fff p30px overflow-hidden">
<div class="min-h-30px flex items-center">
<span class="text-#000 mr-10px">: </span>
<div class="max-w-350px flex items-center">
<span class="text-#000 mr-10px" v-if="activeName !== 'inside-today'">: </span>
<div class="max-w-350px flex items-center" v-if="activeName !== 'inside-today'">
<el-date-picker
v-if="['inside', 'out', 'inside-detail', 'echart', 'out-detail'].includes(activeName)"
v-if="
['inside', 'out', 'inside-detail', 'echart', 'out-detail', 'module-update'].includes(
activeName
)
"
v-model="value1"
type="daterange"
range-separator="到"
@ -612,15 +647,23 @@ getdeptTree()
</template>
</div>
<div class="flex items-center" v-if="activeName === 'out-detail'">
>
<span class="text-#000 mr-10px w-50px">供方: </span>
<el-input v-model="waibuKd" placeholder="请输入供方昵称或代码"></el-input>
</div>
<div class="flex items-center" v-if="activeName === 'inside-detail'">
>
<span class="text-#000 mr-10px w-50px">昵称: </span>
<el-input v-model="nickName" placeholder="请输入用户昵称"></el-input>
</div>
<template v-if="activeName === 'inside-today'">
<span class="text-#000 mr-10px ml-4 whitespace-nowrap">职位: </span>
<el-select class="!w200px" v-model="postId" placeholder="选择职位" clearable>
<el-option v-for="item in postList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
<div class="flex items-center">
<span class="text-#000 mx-14px w-50px">昵称: </span>
<el-input v-model="nickName" placeholder="请输入用户昵称"></el-input>
</div>
</template>
<el-button
type="primary"
:icon="Search"
@ -881,6 +924,49 @@ getdeptTree()
</div>
</div>
</el-tab-pane>
<el-tab-pane label="本部今日访问明细" name="inside-today">
<div v-show="activeName === 'inside-today'" class="h-720px">
<div class="w100% h-full overflow-auto">
<el-table
:data="insideTodayList"
style="width: 100%; margin-bottom: 20px"
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="postName" label="职位名称" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="nickName" label="用户昵称" show-overflow-tooltip />
<!-- <el-table-column label="访问次数" prop="visitCount" show-overflow-tooltip /> -->
<!-- <el-table-column label="访问日期" prop="visitTime" 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>
</el-tab-pane>
<el-tab-pane label="外部足迹" name="out"> </el-tab-pane>
<el-tab-pane label="外部足迹-明细" name="out-detail">
<div class="h-720px">
@ -905,10 +991,10 @@ getdeptTree()
height: '60px'
}"
>
<el-table-column prop="title" label="访问模块" show-overflow-tooltip>
<template #default="{ row }">
<el-table-column prop="moduleName" label="访问模块" show-overflow-tooltip>
<!-- <template #default="{ row }">
<span>{{ externalObj[row.moduleCode] || '' }}</span>
</template>
</template> -->
</el-table-column>
<el-table-column prop="userId" label="供方ID" />
<el-table-column prop="nickName" label="供方昵称" show-overflow-tooltip>
@ -929,6 +1015,52 @@ getdeptTree()
</div>
</div>
</el-tab-pane>
<el-tab-pane label="模块更新统计" name="module-update">
<div v-show="activeName === 'module-update'" class="h-720px">
<div class="w100% h-full overflow-auto">
<el-table
:data="moduleList"
height="700px"
style="width: 100%; margin-bottom: 20px"
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="模块名称" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="updateCount" label="更新数量" show-overflow-tooltip />
<!-- <el-table-column label="访问次数" prop="visitCount" show-overflow-tooltip /> -->
<!-- <el-table-column label="访问日期" prop="visitTime" show-overflow-tooltip /> -->
</el-table>
<div class="w-full h-720px mt-30px">
<VChart key="yyyxx" :option="barEchartModule" autoresize />
</div>
</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>
</el-tab-pane>
</el-tabs>
<div>
<div class="mt20px w-full">

View File

@ -5,19 +5,13 @@ import { formatDate } from '@/utils/format'
const currentDate = new Date()
const currentDates = new Date()
const value1 = ref<[Date, Date]>([
currentDate.setMonth(currentDate.getMonth()),
new Date()
])
const value2 = ref<[Date, Date]>([
currentDates.setMonth(currentDates.getMonth()),
new Date()
])
const value1 = ref<[Date, Date]>([currentDate.setMonth(currentDate.getMonth()), new Date()])
const value2 = ref<[Date, Date]>([currentDates.setMonth(currentDates.getMonth()), new Date()])
const states = reactive<any>({
startTime: formatDate(value1.value[0]).substring(0, 10),
endTime: formatDate(value1.value[1]).substring(0, 10)
// timeType:2,
startTime: formatDate(value1.value[0]).substring(0, 10),
endTime: formatDate(value1.value[1]).substring(0, 10)
// timeType:2,
})
// export function Chart1() {
@ -86,126 +80,126 @@ const states = reactive<any>({
// }
export function Chart1(xAxisData: any = [], color = []) {
const option = {
width: '100%',
// height: '450px', // 设置图表高度为 400 像素
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
data: xAxisData
},
yAxis: [
{
type: 'value'
}
],
series: [
{
data: [],
color: function (params: any) {
return color[params.dataIndex] || '#8F97F8'
},
type: 'bar'
}
]
}
return { ...option }
const option = {
width: '100%',
// height: '450px', // 设置图表高度为 400 像素
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
data: xAxisData
},
yAxis: [
{
type: 'value'
}
],
series: [
{
data: [],
color: function (params: any) {
return color[params.dataIndex] || '#8F97F8'
},
type: 'bar'
}
]
}
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)'
}
}
}
]
}
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:{
// '科室':['科室一','科室二','科室三'],
@ -213,151 +207,183 @@ export function pieEchart(arr: any = [], colorList: any = {}) {
// '平均活跃度(人员平均访问次数)':['科室一平均活跃度','科室二平均活跃度','科室三平均活跃度'],
// }
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)'
// }
// }
}
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)'
// }
// }
}
}
export function barEchartModuleList(data = []) {
const option = {
title: {
text: '模块更新统计',
left: 'center',
textStyle: {
fontSize: 30
},
top: 10
},
xAxis: {
type: 'category',
data: data.map((item) => item.moduleName)
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis'
},
series: [
{
data: data.map((item) => item.updateCount),
// data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar'
}
]
}
return option
}

View File

@ -1,173 +1,184 @@
<script setup lang="ts">
import { deptTree, getGroupList,addGroup, getPage,deleteGroup } from '@/api/daikin/base'
import { deptTree, getGroupList, addGroup, getPage, deleteGroup } from '@/api/daikin/base'
import { message } from '@/utils/message'
import { Search, Refresh } from '@element-plus/icons-vue'
import {noticeld} from '@/stores/modules/noticeId'
import { noticeld } from '@/stores/modules/noticeId'
import { uniqBy, cloneDeep } from 'lodash-es'
const stores = noticeld()
const treeData = ref<any>()
const emit = defineEmits(['clickChild','CloseThis'])
const emit = defineEmits(['clickChild', 'CloseThis'])
const FlashOutline = ref('')
const treeRef =ref()
const treeRef = ref()
const flag = ref(false)
async function getTree() {
const reviewSource =stores.article.reviewSource
const { data } = await deptTree({reviewSource})
if(data&&data!='null'&&data.length>0){
treeData.value = data
}
console.log(data)
const reviewSource = stores.article.reviewSource
const { data } = await deptTree({ reviewSource })
if (data && data != 'null' && data.length > 0) {
treeData.value = data
}
console.log(data)
}
const props = defineProps({
userDataList: {
userDataList: {
type: Array as PropType<any[]>,
default: () => [],
},
default: () => []
}
})
const da = reactive({
pageNum: '1',
pageSize: '1000',
phonenumber: '',
status: '',
beingTime: '',
endTime: '',
deptId: '',
nickName:''
pageNum: '1',
pageSize: '1000',
phonenumber: '',
status: '',
beingTime: '',
endTime: '',
deptId: '',
nickName: ''
})
const userData = ref<any>()
async function getUserPage() {
const reviewSource =stores.article.reviewSource
const {pageNum,pageSize,phonenumber,status,beingTime,endTime,deptId,nickName} = unref(da)
const { rows } = await getPage({pageNum,pageSize,phonenumber,status,beingTime,endTime,deptId,nickName,reviewSource})
const rowsD = rows.map((i: any) => {
if (i.loginDate) {
i.loginDate = i.loginDate.slice(0, 10)
}
return i
})
userData.value = rowsD
const reviewSource = stores.article.reviewSource
const { pageNum, pageSize, phonenumber, status, beingTime, endTime, deptId, nickName } = unref(da)
const { rows } = await getPage({
pageNum,
pageSize,
phonenumber,
status,
beingTime,
endTime,
deptId,
nickName,
reviewSource
})
const rowsD = rows.map((i: any) => {
if (i.loginDate) {
i.loginDate = i.loginDate.slice(0, 10)
}
return i
})
const data = cloneDeep(toRaw(multipleSelection.value))
flag.value = false
userData.value = rowsD
setTimeout(() => {
selection(data)
}, 150)
}
function selection(){
const list = props.userDataList
if(userData.value&&list){
const commonItems = userData.value.filter((item1: { userId: any; }) =>
list.some(item2 => item2.userId === item1.userId)
);
toggleSelection(commonItems)
}
function selection(list = props.userDataList) {
if (userData.value && list) {
const commonItems = userData.value.filter((item1: { userId: any }) =>
list.some((item2) => item2.userId === item1.userId)
)
toggleSelection(commonItems)
}
}
onMounted(() => {
setTimeout(() => {
setTimeout(() => {
selection()
}, 1000);
}, 1000)
})
const ss = computed(() => [da.deptId,da.nickName])
watch(() => unref(ss),
async (v) => {
getUserPage()
},
{ immediate: true, deep: true },
const ss = computed(() => [da.deptId, da.nickName])
watch(
() => unref(ss),
async (v) => {
getUserPage()
},
{ immediate: true, deep: true }
)
const thisClick = (e: { id: string }) => {
da.deptId = e.id
// console.log(e)
da.deptId = e.id
// console.log(e)
}
const formInline = ref()
const onSubmit = () => {
// console.log(formInline.value)
da.nickName= formInline.value
// console.log(formInline.value)
da.nickName = formInline.value
}
const resetForm = () => {
formInline.value =''
formInline.value = ''
}
const multipleTableRef = ref()
const multipleSelection = ref<[]>([])
const multipleSelectionObj: any = {}
const handleSelectionChange = (val) => {
console.log(val)
multipleSelection.value = val
console.log(val)
multipleSelectionObj[da.deptId] = val
multipleSelection.value = uniqBy(Object.values(multipleSelectionObj).flat(), 'userId')
}
const selet = (rows: any) => {
multipleTableRef.value!.toggleRowSelection(rows, undefined)
// console.log(unref(multipleSelection))
multipleTableRef.value!.toggleRowSelection(rows, undefined)
// console.log(unref(multipleSelection))
}
const toggleSelection = (Data: any[]) => {
// console.log(Data)
if (Data) {
Data.forEach((row: any) => {
multipleTableRef.value!.toggleRowSelection(row, undefined)
// console.log(multipleTableRef.value.data)
})
}
// console.log(Data)
if (Data) {
Data.forEach((row: any) => {
multipleTableRef.value!.toggleRowSelection(row, undefined)
// console.log(multipleTableRef.value.data)
})
}
}
const handleClose = (id: any) => {
multipleSelection.value.filter(item => {
if (item.userId === id) {
console.log(item.userId,id)
multipleTableRef.value!.toggleRowSelection(item, undefined)
}
})
multipleSelection.value = multipleSelection.value.filter((item) => {
if (item.userId === id) {
console.log(item.userId, id)
multipleTableRef.value!.toggleRowSelection(item, undefined)
return false
}
return item
})
}
const showModal = ref()
const handleChange = () => {
emit('clickChild', { multipleSelection, showModal })
emit('clickChild', { multipleSelection, showModal })
}
const CloseThis=()=>{
emit('CloseThis',false)
const CloseThis = () => {
emit('CloseThis', false)
}
const CloseT = ()=>{
showModal2.value = false
multipleSelection.value=[]
const CloseT = () => {
showModal2.value = false
multipleSelection.value = []
}
getTree()
const asGroup = ref()
async function getGroup(){
const {data} = await getGroupList()
asGroup.value = data
async function getGroup() {
const { data } = await getGroupList()
asGroup.value = data
}
getGroup()
const asGroupClick = (e: any)=>{
multipleSelection.value = e.userList
const asGroupClick = (e: any) => {
multipleSelection.value = e.userList
}
const showModal2 =ref(false)
const showModal2 = ref(false)
const groupName = ref()
const groupDeleteId = ref()
let id = 0
const modfify = (e)=>{
console.log(e.id)
groupDeleteId.value =e
id = e.id
showModal2.value = true
groupName.value = e.name
multipleSelection.value = e.userList
const modfify = (e) => {
console.log(e.id)
groupDeleteId.value = e
id = e.id
showModal2.value = true
groupName.value = e.name
multipleSelection.value = e.userList
e.userList.forEach((row: any) => {
multipleTableRef.value!.toggleRowSelection(row, undefined)
})
e.userList.forEach((row: any) => {
multipleTableRef.value!.toggleRowSelection(row, undefined)
})
}
const changeGroup=()=>{
changSave()
const changeGroup = () => {
changSave()
}
watch(FlashOutline, (val) => {
treeRef.value!.filter(val)
@ -178,162 +189,200 @@ const filterNode = (value: string, data: Tree) => {
return data.label.includes(value)
}
async function changSave(){
let userIdList: any[] = []
const name = groupName.value
// console.log(multipleSelection.value)
multipleSelection.value.forEach((i: { userId: any })=>{
userIdList.push(i.userId)
})
console.log(id, groupName.value,userIdList)
// if(!id) return
let formdata = new FormData();
formdata.append("id",id);
formdata.append("name",name);
formdata.append("userIdList",userIdList);
const {msg} = await addGroup(formdata,{headers: {'Content-Type': 'application/form-data'}})
message.success(msg)
getGroup()
async function changSave() {
let userIdList: any[] = []
const name = groupName.value
// console.log(multipleSelection.value)
multipleSelection.value.forEach((i: { userId: any }) => {
userIdList.push(i.userId)
})
console.log(id, groupName.value, userIdList)
// if(!id) return
let formdata = new FormData()
formdata.append('id', id)
formdata.append('name', name)
formdata.append('userIdList', userIdList)
const { msg } = await addGroup(formdata, { headers: { 'Content-Type': 'application/form-data' } })
message.success(msg)
getGroup()
}
const addGroupList = () =>{
showModal2.value = true
const addGroupList = () => {
showModal2.value = true
}
const deleteGroupp =(i: any)=>{
console.log(i)
deleteGroups(i.id)
const deleteGroupp = (i: any) => {
console.log(i)
deleteGroups(i.id)
}
async function deleteGroups(id) {
if(!id) return
const {code} =await deleteGroup({id})
getGroup()
asGroup.value = []
multipleSelection.value=[]
groupName.value=''
message.info("删除成功")
if (!id) return
const { code } = await deleteGroup({ id })
getGroup()
asGroup.value = []
multipleSelection.value = []
groupName.value = ''
message.info('删除成功')
}
function onSelect(params: any) {
console.log('🚀 ~ file: UserPages.vue:230 ~ params:', params)
}
</script>
<template>
<div>
<div class=" max-w95% h800px m-auto bg-#fff rounded-10px overflow-hidden">
<div class="pl20px text-18px w100% h60px p15px" style="border-bottom:1px solid #dfdfdf ;font-weight: 700;">
调达中心</div>
<div class="p20px flex relative">
<div class="min-w150px">
<el-input v-model="FlashOutline" class="w-50 m-2" placeholder="搜索" suffix-icon="Calendar"
:prefix-icon="Search" />
<el-tree ref="treeRef" :data="treeData" :filter-node-method="filterNode" :default-expanded-keys="[2, 4]" @node-click="thisClick" class="max-h500px"/>
<ul class="absolute max-h200px min-h100px bottom-0 list-none !p0 overflow-auto w190px" v-if="asGroup">
<li v-for="i in asGroup" class="cursor-default w190px h32px" >
<span @click="asGroupClick(i)" class="w100px h30px text-12px float-left block border border-solid border-#f5f5f5 leading-30px overflow-hidden" :title="i.name">{{i.name}}</span>
<span class="text-12px text-#3E7DF0 leading-30px float-left block w38px text-center block border border-solid border-#f5f5f5 h32px" @click="modfify(i)"></span>
<el-icon @click="deleteGroupp(i)" class="mt7px ml5px"><Delete/></el-icon>
</li>
</ul>
</div>
<div class="ml20px max-w80%">
<div v-if="showModal2!=true">
<el-form :inline="true" :model="formInline" label-width="80px" size="small"
class="demo-form-inline">
<el-form-item label="用户名称">
<el-input v-model="formInline" placeholder="请输入用户名称" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit" :icon="Search">搜素</el-button>
<el-button @click="resetForm()" :icon="Refresh">重置</el-button>
</el-form-item>
</el-form>
</div>
<div v-if="showModal2==true" class="w500px">
<!-- <el-form :inline="true" :model="formInline"
class="demo-form-inline"> -->
<el-form-item label="分组名称" label-width="80px" size="small">
<el-input v-model="groupName" placeholder="请输入分组名称" clearable />
</el-form-item>
<!-- </el-form> -->
</div>
<div v-if="showModal2!=true" class="float-left block">
<el-button type="warning" size="small" @click="toggleSelection(userData)">@</el-button>
<el-button type="primary" color="#00A73A" size="small" @click="addGroupList"></el-button>
</div>
<div class="w100% h450px overflow-auto">
<el-table ref="multipleTableRef" :data="userData" :header-cell-style="{ 'text-align': 'center' }"
height="400" :cell-style="{ 'text-align': 'center' }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column property="nickName" label="用户名称" width="220" />
<el-table-column property="dept.deptName" label="科室" width="180" />
<el-table-column property="dept.parentDeptName" label="部门" width="180" />
<el-table-column property="positionName" label="职位" width="120" />
<el-table-column property="name" label="操作" width="220">
<template #default="{ row, $index }">
<el-button type="primary" size="small" @click="selet(row)"></el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="h80px overflow-y-auto">
<div v-if="showModal2===true && groupName" class="mb10px h32px">
{{groupName}}
<span class="text-12px text-#959595 w30px" @click="deleteGroupp(groupDeleteId)"></span>
<!-- <el-icon class="mt8px"><Delete /></el-icon> -->
</div>
<el-tag v-for="i in multipleSelection" :key="i" class="mx-1" closable :disable-transitions="false"
@close="handleClose(i.userId)">
{{ i.nickName }}
</el-tag>
</div>
</div>
</div>
<div class="w100% text-end float-right block h50px pt10px"
style="border-top:1px solid #dfdfdf ;font-weight: 700;">
<div class="pr30px" v-if="showModal2!=true">
<el-button type="warning" color="#f1f1f1" size="small" @click="CloseThis"></el-button>
<el-button type="primary" size="small" @click="handleChange"></el-button>
</div>
<div class="pr30px" v-if="showModal2==true">
<el-button type="warning" color="#f1f1f1" size="small" @click="CloseT"></el-button>
<el-button type="primary" size="small" @click="changeGroup"></el-button>
</div>
</div>
<div>
<div class="max-w95% h800px m-auto bg-#fff rounded-10px overflow-hidden">
<div
class="pl20px text-18px w100% h60px p15px"
style="border-bottom: 1px solid #dfdfdf; font-weight: 700"
>
调达中心
</div>
<div class="p20px flex relative">
<div class="min-w150px">
<el-input
v-model="FlashOutline"
class="w-50 m-2"
placeholder="搜索"
suffix-icon="Calendar"
:prefix-icon="Search"
/>
<el-tree
ref="treeRef"
:data="treeData"
:filter-node-method="filterNode"
:default-expanded-keys="[2, 4]"
@node-click="thisClick"
class="max-h500px"
/>
<ul
class="absolute max-h200px min-h100px bottom-0 list-none !p0 overflow-auto w190px"
v-if="asGroup"
>
<li v-for="i in asGroup" class="cursor-default w190px h32px">
<span
@click="asGroupClick(i)"
class="w100px h30px text-12px float-left block border border-solid border-#f5f5f5 leading-30px overflow-hidden"
:title="i.name"
>{{ i.name }}</span
>
<span
class="text-12px text-#3E7DF0 leading-30px float-left block w38px text-center block border border-solid border-#f5f5f5 h32px"
@click="modfify(i)"
>编辑</span
>
<el-icon @click="deleteGroupp(i)" class="mt7px ml5px"><Delete /></el-icon>
</li>
</ul>
</div>
</div>
<div class="ml20px max-w80%">
<div v-if="showModal2 != true">
<el-form
:inline="true"
:model="formInline"
label-width="80px"
size="small"
class="demo-form-inline"
>
<el-form-item label="用户名称">
<el-input v-model="formInline" placeholder="请输入用户名称" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit" :icon="Search">搜素</el-button>
<el-button @click="resetForm()" :icon="Refresh">重置</el-button>
</el-form-item>
</el-form>
</div>
<div v-if="showModal2 == true" class="w500px">
<!-- <el-form :inline="true" :model="formInline"
class="demo-form-inline"> -->
<el-form-item label="分组名称" label-width="80px" size="small">
<el-input v-model="groupName" placeholder="请输入分组名称" clearable />
</el-form-item>
<!-- </el-form> -->
</div>
<div v-if="showModal2 != true" class="float-left block">
<el-button type="warning" size="small" @click="toggleSelection(userData)"
>@所有人</el-button
>
<el-button type="primary" color="#00A73A" size="small" @click="addGroupList"
>新增分组</el-button
>
</div>
<div class="w100% h450px overflow-auto">
<el-table
ref="multipleTableRef"
:data="userData"
:header-cell-style="{ 'text-align': 'center' }"
height="400"
:cell-style="{ 'text-align': 'center' }"
@selection-change="handleSelectionChange"
@select="onSelect"
>
<el-table-column type="selection" width="55" />
<el-table-column property="nickName" label="用户名称" width="220" />
<el-table-column property="dept.deptName" label="科室" width="180" />
<el-table-column property="dept.parentDeptName" label="部门" width="180" />
<el-table-column property="positionName" label="职位" width="120" />
<el-table-column property="name" label="操作" width="220">
<template #default="{ row, $index }">
<el-button type="primary" size="small" @click="selet(row)"></el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="h80px overflow-y-auto">
<div v-if="showModal2 === true && groupName" class="mb10px h32px">
{{ groupName }}
<span class="text-12px text-#959595 w30px" @click="deleteGroupp(groupDeleteId)"
>删除</span
>
<!-- <el-icon class="mt8px"><Delete /></el-icon> -->
</div>
<el-tag
v-for="i in multipleSelection"
:key="i"
class="mx-1"
closable
:disable-transitions="false"
@close="handleClose(i.userId)"
>
{{ i.nickName }}
</el-tag>
</div>
</div>
</div>
<div
class="w100% text-end float-right block h50px pt10px"
style="border-top: 1px solid #dfdfdf; font-weight: 700"
>
<div class="pr30px" v-if="showModal2 != true">
<el-button type="warning" color="#f1f1f1" size="small" @click="CloseThis"></el-button>
<el-button type="primary" size="small" @click="handleChange"></el-button>
</div>
<div class="pr30px" v-if="showModal2 == true">
<el-button type="warning" color="#f1f1f1" size="small" @click="CloseT"></el-button>
<el-button type="primary" size="small" @click="changeGroup"></el-button>
</div>
</div>
</div>
</div>
</template>
<style lang="less">
.el-form--inline .el-input {
width: 180px !important;
width: 180px !important;
}
::-webkit-scrollbar{
width: 1px;
::-webkit-scrollbar {
width: 1px;
}
.thList {
td {
border-bottom: 1px solid #f5f5f5;
line-height: 40px;
font-size: 12px;
}
td {
border-bottom: 1px solid #f5f5f5;
line-height: 40px;
font-size: 12px;
}
}
</style>
</style>

View File

@ -63,21 +63,28 @@ const fetchNewDataList = async () => {
}
fetchNewDataList()
const num = ['', '第一周', '第二周', '第三周', '第四周', '第五周']
//
function groupDatesByWeek(dates = [], weekStartDay = 1) {
return dates.reduce((acc: any, item: any) => {
const weekStart = dayjs(item.createTime)
.startOf('week')
.add(weekStartDay, 'day')
.format('MM月DD日')
item.date = dayjs(item.createTime).format('YYYY-MM-DD')
const weekEnd = dayjs(item.createTime).endOf('week').add(weekStartDay, 'day').format('MM月DD日')
const key = `${weekStart} - ${weekEnd}`
const date = dayjs(item.createTime)
const weekStart = date.startOf('week').add(weekStartDay, 'day').format('MM月DD日')
item.date = date.format('YYYY-MM-DD')
const weekEnd = date.endOf('week').add(weekStartDay, 'day').format('MM月DD日')
const week = getWeekOfMonth(date)
const month = date.format('MM')
const key = `${+month}${num[week]} ${weekStart} - ${weekEnd} `
acc[key] = acc[key] || []
acc[key].push(item)
return acc
}, {})
}
function getWeekOfMonth(date) {
const startOfMonth = date.startOf('month')
const diff = date.diff(startOfMonth, 'day')
return Math.ceil((diff + startOfMonth.day()) / 7)
}
// watchEffect(() => {
// searchS.search.time
// getSearchList(searchS.search.content)
@ -89,57 +96,62 @@ const codePath = {
modulePath: '/Home/intelligence'
},
App_Market: {
path: '/Home/market',
path: '/Home/market/',
modulePath: '/Home/market'
},
App_data_platform: {
path: '/Home/cd',
path: '/Home/cd/',
modulePath: '/Home/cd'
},
App_BCP: {
path: '/Home/bcp',
modulePath: '/Home/bcp'
path: '/Home/bcp/',
modulePath: '/Home/bcp/'
},
// '',
App_CSR: {
path: '/Home/csr',
modulePath: '/Home/csr'
path: '/Home/csr/',
modulePath: '/Home/csr/'
},
// '',
App_Quality: {
path: '/Home/quality',
modulePath: '/Home/quality'
path: '/Home/quality/',
modulePath: '/Home/quality/'
},
// 'Lab',
App_Lab: {
path: '/Home/diffspace',
path: '/Home/diffspace/',
modulePath: '/Home/diffspace'
},
// 'DatabBase'
App_Database: {
path: '/DataBase',
path: '/DataBase?id=',
modulePath: '/DataBase'
}
}
const goModule = (item, type) => {
const { moduleCode, id } = item
const { moduleCode, id, cateId } = item
const { modulePath, path } = codePath[moduleCode]
console.log('🚀 ~ file: News.vue:128 ~ modulePath, path:', modulePath, path)
if (modulePath) {
if (type === 'module') {
push(modulePath)
} else {
push(path + id)
push(path + (moduleCode === 'App_Database' ? cateId : id))
}
}
}
const clickItem = (item: any) => {
const { id, filePath, isSelect, moduleCode, fileCommon = {} } = item
if (moduleCode === 'App_Article') {
goModule(item, 'path')
}
if (isSelect === 1) {
downloads({ fileCommon, filePath })
if (isSelect == 1) {
if (item.moduleCode === 'App_Article') {
return push('/Home/intelligence/' + item.id)
}
if (['App_Database'].includes(moduleCode)) {
goModule(item, 'path')
} else {
downloads({ fileCommon, filePath })
}
} else {
message.info('您没有权限查看!')
}
@ -170,10 +182,6 @@ function downloadFile(url: any) {
})
}
function getFileNameFromUrl(url: string) {
console.log(
'🚀 ~ file: index.vue:107 ~ getFileNameFromUrl ~ getFileNameFromUrl:',
getFileNameFromUrl
)
const lastSlashIndex = url.lastIndexOf('/')
if (lastSlashIndex !== -1) {
return url.substring(lastSlashIndex + 1)
@ -204,30 +212,28 @@ const fileSize = 24 * 1024 * 1024
</HomeHead>
<div class="h-full relative flex flex-col">
<div class="font-600 flex items-end mt30px">
<div class="text-36px">更新列表</div>
<div class="text-36px">更新列表</div>
<div class="text-18px ml40px mr25px">{{ day }}</div>
<div class="text-18px">{{ week }}</div>
</div>
<div class="q-wrapper flex-1 mt30px text-#142142 flex flex-col bg-#fff p30px">
<div class="h-800px mt-30px relative" v-if="newsData">
<div class="h-800px mt-0px relative" v-if="newsData">
<div class="h-710px overflow-y-scroll">
<div v-for="(val, key) of newsData" :key="key" class="w-70% mb-20px flex-1">
<div class="text-#142142 text-20px font-600 mb20px">
<div v-for="(val, key) of newsData" :key="key" class="w-94% mb-20px flex-1">
<div class="text-#142142 text-20px font-bold mb20px mt40px">
{{ key }}
</div>
<div v-for="(i, k) in val" :key="k" class="mb-10px">
<div class="text-#142142 truncate text-18px mt8px">
<div
@click="clickItem(i)"
class="no-underline text-#142142 cursor-pointer hover:underline h-16px leading-16px"
>
{{ i.title || '' }}
</div>
<div v-for="(i, k) in val" :key="k" class="mb-20px flex items-center w-full">
<div
@click="clickItem(i)"
class="w-[40%] no-underline truncate text-18px text-#142142 cursor-pointer hover:underline h-16px leading-16px"
>
{{ i.title || '' }}
</div>
<div class="text-#808696 mt-10px text-16px flex items-center justify-between mb-14px">
<span class="flex-1">发布科室: {{ i.departName }}</span>
<span class="w-[36%]">发布人: {{ i.userName }}</span>
<span class="w-[20%]"> {{ i.createTime?.slice(0, 10) }}</span>
<div class="text-#808696 text-16px ml30px flex flex-1 items-center justify-between">
<div class="flex-1">发布科室: {{ i.departName }}</div>
<div class="w-[36%]">发布人: {{ i.userName }}</div>
<div class="w-[20%]">{{ i.createTime?.slice(0, 10) }}</div>
</div>
</div>
</div>

View File

@ -42,6 +42,10 @@ const array = ref<any[]>([
{ content1: '站稳脚跟 强化优势 大步迈进', content2: '', year: '2016年' },
{ content1: '创造未来,决胜于变化的时代', content2: '', year: '2015年' }
])
let flag = ref(false)
const switchImg = () => {
flag.value = !flag.value
}
</script>
<template>
@ -70,9 +74,22 @@ const array = ref<any[]>([
</div>
</div>
</div> -->
<div class="mt30px mr20px flex w100%">
<div class="mt30px mr20px flex w100% relative overflow-hidden">
<!-- <img src="../../../assets/images/fzqiet3.png" class="w100%" /> -->
<img src="../../../assets/images/jjllt.jpg" class="w100%" />
<img
src="../../../assets/images/jjllt.jpg"
class="w100% transition-all duration-500"
:class="flag ? '-translate-x-full' : ''"
/>
<img
src="../../../assets/images/jjllt-right.jpg"
class="w100% transition-all duration-500"
:class="flag ? '-translate-x-full' : ''"
/>
<div
@click="switchImg"
class="absolute top-56px right-40px w-300px h50px z-10 cursor-pointer"
></div>
</div>
</template>