fix bug
parent
345e57e504
commit
1f20c6f589
|
|
@ -25,6 +25,7 @@
|
||||||
"echarts": "^5.4.3",
|
"echarts": "^5.4.3",
|
||||||
"echarts-liquidfill": "^3.1.0",
|
"echarts-liquidfill": "^3.1.0",
|
||||||
"element-plus": "^2.6.2",
|
"element-plus": "^2.6.2",
|
||||||
|
"lodash-es": "^4.17.21",
|
||||||
"lottie-web": "^5.12.2",
|
"lottie-web": "^5.12.2",
|
||||||
"naive-ui": "^2.34.4",
|
"naive-ui": "^2.34.4",
|
||||||
"pinia": "^2.0.32",
|
"pinia": "^2.0.32",
|
||||||
|
|
|
||||||
|
|
@ -1246,6 +1246,14 @@ export async function getPieChartData(params: any) {
|
||||||
export async function getDepartChart(params: any) {
|
export async function getDepartChart(params: any) {
|
||||||
return http.get(`/moduleStat/getDepartChart`, { params })
|
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
|
* 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 |
|
|
@ -129,7 +129,7 @@ const router = createRouter({
|
||||||
{
|
{
|
||||||
path: '/Home/latest',
|
path: '/Home/latest',
|
||||||
name: 'Latest',
|
name: 'Latest',
|
||||||
meta: { title: '最新更新列表' },
|
meta: { title: '最进更新列表' },
|
||||||
component: () => import('@/views/home/news/news.vue')
|
component: () => import('@/views/home/news/news.vue')
|
||||||
},
|
},
|
||||||
// 搜索
|
// 搜索
|
||||||
|
|
|
||||||
|
|
@ -22,14 +22,14 @@ async function getPageList() {
|
||||||
// console.log(rows)
|
// console.log(rows)
|
||||||
// for (let index = 0; index < 50; index++) {
|
// for (let index = 0; index < 50; index++) {
|
||||||
listData.value = rows
|
listData.value = rows
|
||||||
|
|
||||||
// }
|
// }
|
||||||
console.log(listData.value.length)
|
console.log(listData.value.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchNewDataList = async () => {
|
const fetchNewDataList = async () => {
|
||||||
const res = await newDataList({ pageNum: 1, pageSize: 10 })
|
const res = await newDataList({ pageNum: 1, pageSize: 8 })
|
||||||
const data = groupDatesByWeek(res.rows || [])
|
// const data = groupDatesByWeek(res.rows || [])
|
||||||
|
const data = res.rows || []
|
||||||
newsData.value = data
|
newsData.value = data
|
||||||
firstItem.value = Object.keys(data)[0]
|
firstItem.value = Object.keys(data)[0]
|
||||||
}
|
}
|
||||||
|
|
@ -67,11 +67,50 @@ const toDetail2 = (n: any) => {
|
||||||
console.log(n)
|
console.log(n)
|
||||||
if (n.id === 0) return
|
if (n.id === 0) return
|
||||||
if (n.isSelect === 1) {
|
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)
|
push(`/intelligence/${n.type == 2 ? 'within' : 'outside'}/` + n.id)
|
||||||
} else {
|
} else {
|
||||||
message.error('没有访问权限')
|
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 modules = [Autoplay, Pagination, Navigation, A11y]
|
||||||
|
|
||||||
const files = ref<any>({})
|
const files = ref<any>({})
|
||||||
|
|
@ -105,7 +144,7 @@ fetchNewDataList()
|
||||||
:class="[{ 'text-#fff': curTab == 1 }]"
|
:class="[{ 'text-#fff': curTab == 1 }]"
|
||||||
@click="curTab = 0"
|
@click="curTab = 0"
|
||||||
>
|
>
|
||||||
最新更新
|
最近更新
|
||||||
</div>
|
</div>
|
||||||
<div class="card_title !pt-10px !pl-30px flex-1 !pb-10px" @click="curTab = 1">
|
<div class="card_title !pt-10px !pl-30px flex-1 !pb-10px" @click="curTab = 1">
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
|
|
@ -168,32 +207,33 @@ fetchNewDataList()
|
||||||
style="height: 280px"
|
style="height: 280px"
|
||||||
>
|
>
|
||||||
<swiper-slide v-for="(i, index) of newsData" :key="index"> -->
|
<swiper-slide v-for="(i, index) of newsData" :key="index"> -->
|
||||||
<div height="310px" class="h-310px overflow-y-auto">
|
<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="(item, index) of newsData" :key="index"> -->
|
||||||
<div class="flex justify-between items-center">
|
<div class="text-black mb-10px" v-for="(i, index) in newsData" :key="index">
|
||||||
<span class="text-18px mb-10px mt-20px">{{ index }}</span>
|
<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
|
<span
|
||||||
class="text-16px text-#4D7EE8 cursor-pointer hover:underline"
|
class="text-16px text-#4D7EE8 cursor-pointer hover:underline"
|
||||||
v-if="firstItem == index"
|
|
||||||
@click="push({ name: 'Latest' })"
|
@click="push({ name: 'Latest' })"
|
||||||
>更多</span
|
>更多</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<template v-for="(i, k) in item" :key="k">
|
<!-- <template v-for="(i, k) in item" :key="k"> -->
|
||||||
<div class="text-#142142 truncate text-16px mt8px">
|
<div class="flex items-baseline flex-1">
|
||||||
<div
|
<div
|
||||||
@click="toDetail2(i)"
|
@click="toDetail2(i)"
|
||||||
class="no-underline text-#142142 cursor-pointer hover:underline h-16px leading-16px"
|
class="text-#142142 truncate text-18px font-bold w-95% no-underline text-#142142 cursor-pointer hover:underline h-16px leading-16px"
|
||||||
>
|
>
|
||||||
{{ i.title || '' }}
|
<!-- <img class="h-20px" src="@/assets/images/NEW.gif" alt="" /> -->
|
||||||
</div>
|
<span>{{ i.title || '' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-#808696 mt-8px text-14px flex items-center justify-between mb-10px">
|
<div class="text-#808696 ml20px text-14px flex items-center justify-between mb-10px">
|
||||||
<span class="flex-1">发布科室: {{ i.departName }}</span>
|
<span class="whitespace-nowrap block w-100px"> {{ i.departName }}</span>
|
||||||
<span class="w-[36%]">发布人: {{ i.userName }}</span>
|
<!-- <span class="w-[36%]"> {{ i.userName }}</span> -->
|
||||||
<span class="w-[20%]"> {{ i.createTime?.slice(0, 10) }}</span>
|
<span class="whitespace-nowrap block w86px"> {{ i.createTime?.slice(0, 10) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</div>
|
||||||
|
<!-- </template> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- </swiper-slide>
|
<!-- </swiper-slide>
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,12 @@ import {
|
||||||
userDetailExport,
|
userDetailExport,
|
||||||
getDepartData,
|
getDepartData,
|
||||||
getPieChartData,
|
getPieChartData,
|
||||||
getDepartChart
|
getDepartChart,
|
||||||
|
fetchModuleList,
|
||||||
|
fetchInsideToday
|
||||||
} from '@/api/daikin/base'
|
} from '@/api/daikin/base'
|
||||||
import { formatDate } from '@/utils/format'
|
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 { Search, Download } from '@element-plus/icons-vue'
|
||||||
import { NModal, useMessage } from 'naive-ui'
|
import { NModal, useMessage } from 'naive-ui'
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
@ -31,6 +33,7 @@ const chartRef1 = ref()
|
||||||
const chartRef2 = ref()
|
const chartRef2 = ref()
|
||||||
const chartOption1 = ref<any>({})
|
const chartOption1 = ref<any>({})
|
||||||
const chartOption2 = ref({})
|
const chartOption2 = ref({})
|
||||||
|
const barEchartModule = ref({})
|
||||||
const primary = ref(1)
|
const primary = ref(1)
|
||||||
const primarys = ref(2)
|
const primarys = ref(2)
|
||||||
const activeName = ref('echart')
|
const activeName = ref('echart')
|
||||||
|
|
@ -57,7 +60,8 @@ const colorList: any = [
|
||||||
'#44CF8C',
|
'#44CF8C',
|
||||||
'#6266F8',
|
'#6266F8',
|
||||||
'#FA6B39',
|
'#FA6B39',
|
||||||
'#F05F96'
|
'#F05F96',
|
||||||
|
'#21F3D0'
|
||||||
]
|
]
|
||||||
const moduleCode = ref()
|
const moduleCode = ref()
|
||||||
const imoduleCode = ref()
|
const imoduleCode = ref()
|
||||||
|
|
@ -152,6 +156,31 @@ const state = reactive<any>({
|
||||||
// timeType:1
|
// 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 getInsideListPage = async () => {
|
||||||
const res: any = await fetchmoduleStatInternalPage({
|
const res: any = await fetchmoduleStatInternalPage({
|
||||||
postId: postId.value,
|
postId: postId.value,
|
||||||
|
|
@ -352,6 +381,8 @@ const handleClick = ({ paneName }: any, down: Boolean = false) => {
|
||||||
paneName === 'inside' && getDat()
|
paneName === 'inside' && getDat()
|
||||||
paneName === 'out-detail' && getListPage()
|
paneName === 'out-detail' && getListPage()
|
||||||
paneName === 'inside-detail' && getInsideListPage()
|
paneName === 'inside-detail' && getInsideListPage()
|
||||||
|
paneName === 'inside-today' && getInsideToday()
|
||||||
|
paneName === 'module-update' && getmoduleList()
|
||||||
paneName === 'inside' &&
|
paneName === 'inside' &&
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
showEchart.value = true
|
showEchart.value = true
|
||||||
|
|
@ -544,10 +575,14 @@ getdeptTree()
|
||||||
<HomeHead class="top"></HomeHead>
|
<HomeHead class="top"></HomeHead>
|
||||||
<div class="w-full h-850px mt30px rd-20px bg-#fff p30px overflow-hidden">
|
<div class="w-full h-850px mt30px rd-20px bg-#fff p30px overflow-hidden">
|
||||||
<div class="min-h-30px flex items-center">
|
<div class="min-h-30px flex items-center">
|
||||||
<span class="text-#000 mr-10px">日期: </span>
|
<span class="text-#000 mr-10px" v-if="activeName !== 'inside-today'">日期: </span>
|
||||||
<div class="max-w-350px flex items-center">
|
<div class="max-w-350px flex items-center" v-if="activeName !== 'inside-today'">
|
||||||
<el-date-picker
|
<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"
|
v-model="value1"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
range-separator="到"
|
range-separator="到"
|
||||||
|
|
@ -612,15 +647,23 @@ getdeptTree()
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center" v-if="activeName === 'out-detail'">
|
<div class="flex items-center" v-if="activeName === 'out-detail'">
|
||||||
>
|
|
||||||
<span class="text-#000 mr-10px w-50px">供方: </span>
|
<span class="text-#000 mr-10px w-50px">供方: </span>
|
||||||
<el-input v-model="waibuKd" placeholder="请输入供方昵称或代码"></el-input>
|
<el-input v-model="waibuKd" placeholder="请输入供方昵称或代码"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center" v-if="activeName === 'inside-detail'">
|
<div class="flex items-center" v-if="activeName === 'inside-detail'">
|
||||||
>
|
|
||||||
<span class="text-#000 mr-10px w-50px">昵称: </span>
|
<span class="text-#000 mr-10px w-50px">昵称: </span>
|
||||||
<el-input v-model="nickName" placeholder="请输入用户昵称"></el-input>
|
<el-input v-model="nickName" placeholder="请输入用户昵称"></el-input>
|
||||||
</div>
|
</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
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
:icon="Search"
|
:icon="Search"
|
||||||
|
|
@ -881,6 +924,49 @@ getdeptTree()
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</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"> </el-tab-pane>
|
||||||
<el-tab-pane label="外部足迹-明细" name="out-detail">
|
<el-tab-pane label="外部足迹-明细" name="out-detail">
|
||||||
<div class="h-720px">
|
<div class="h-720px">
|
||||||
|
|
@ -905,10 +991,10 @@ getdeptTree()
|
||||||
height: '60px'
|
height: '60px'
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<el-table-column prop="title" label="访问模块" show-overflow-tooltip>
|
<el-table-column prop="moduleName" label="访问模块" show-overflow-tooltip>
|
||||||
<template #default="{ row }">
|
<!-- <template #default="{ row }">
|
||||||
<span>{{ externalObj[row.moduleCode] || '' }}</span>
|
<span>{{ externalObj[row.moduleCode] || '' }}</span>
|
||||||
</template>
|
</template> -->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="userId" label="供方ID" />
|
<el-table-column prop="userId" label="供方ID" />
|
||||||
<el-table-column prop="nickName" label="供方昵称" show-overflow-tooltip>
|
<el-table-column prop="nickName" label="供方昵称" show-overflow-tooltip>
|
||||||
|
|
@ -929,6 +1015,52 @@ getdeptTree()
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</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>
|
</el-tabs>
|
||||||
<div>
|
<div>
|
||||||
<div class="mt20px w-full">
|
<div class="mt20px w-full">
|
||||||
|
|
|
||||||
|
|
@ -5,19 +5,13 @@ 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()), new Date()])
|
||||||
currentDate.setMonth(currentDate.getMonth()),
|
const value2 = ref<[Date, Date]>([currentDates.setMonth(currentDates.getMonth()), new Date()])
|
||||||
new Date()
|
|
||||||
])
|
|
||||||
const value2 = ref<[Date, Date]>([
|
|
||||||
currentDates.setMonth(currentDates.getMonth()),
|
|
||||||
new 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() {
|
||||||
|
|
@ -86,126 +80,126 @@ const states = reactive<any>({
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export function Chart1(xAxisData: any = [], color = []) {
|
export function Chart1(xAxisData: any = [], color = []) {
|
||||||
const option = {
|
const option = {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
// height: '450px', // 设置图表高度为 400 像素
|
// height: '450px', // 设置图表高度为 400 像素
|
||||||
grid: {
|
grid: {
|
||||||
left: '10',
|
left: '10',
|
||||||
top: 90,
|
top: 90,
|
||||||
right: '10',
|
right: '10',
|
||||||
bottom: '10',
|
bottom: '10',
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: xAxisData
|
data: xAxisData
|
||||||
},
|
},
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
type: 'value'
|
type: 'value'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: [],
|
data: [],
|
||||||
color: function (params: any) {
|
color: function (params: any) {
|
||||||
return color[params.dataIndex] || '#8F97F8'
|
return color[params.dataIndex] || '#8F97F8'
|
||||||
},
|
},
|
||||||
type: 'bar'
|
type: 'bar'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
return { ...option }
|
return { ...option }
|
||||||
}
|
}
|
||||||
|
|
||||||
export function pieEchart(arr: any = [], colorList: any = {}) {
|
export function pieEchart(arr: any = [], colorList: any = {}) {
|
||||||
console.log('🚀 ~ colorList:', colorList)
|
console.log('🚀 ~ colorList:', colorList)
|
||||||
const color: any = []
|
const color: any = []
|
||||||
const data = arr.map((item: any) => {
|
const data = arr.map((item: any) => {
|
||||||
color.push(colorList[item.moduleCode])
|
color.push(colorList[item.moduleCode])
|
||||||
console.log('🚀 ~ item.moduleCode:', item.moduleCode)
|
console.log('🚀 ~ item.moduleCode:', item.moduleCode)
|
||||||
return {
|
return {
|
||||||
name: item.moduleName,
|
name: item.moduleName,
|
||||||
value: item.visitCount,
|
value: item.visitCount,
|
||||||
_code: item.moduleCode
|
_code: item.moduleCode
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
// color,
|
// color,
|
||||||
title: {
|
title: {
|
||||||
text: '各模块登录占比',
|
text: '各模块登录占比',
|
||||||
left: 'center',
|
left: 'center',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 30
|
fontSize: 30
|
||||||
},
|
},
|
||||||
top: 20
|
top: 20
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '0',
|
left: '0',
|
||||||
top: 0,
|
top: 0,
|
||||||
right: '0',
|
right: '0',
|
||||||
bottom: '2%',
|
bottom: '2%',
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item',
|
trigger: 'item',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 24
|
fontSize: 24
|
||||||
},
|
},
|
||||||
formatter: function (params: any) {
|
formatter: function (params: any) {
|
||||||
// const title = `<p>${params.seriesName}</p>`
|
// const title = `<p>${params.seriesName}</p>`
|
||||||
const colorDot =
|
const colorDot =
|
||||||
'<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:' +
|
'<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:' +
|
||||||
params.color +
|
params.color +
|
||||||
'"></span>'
|
'"></span>'
|
||||||
return colorDot + params.name + ': ' + params.percent + '%'
|
return colorDot + params.name + ': ' + params.percent + '%'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
// orient: 'vertical',
|
// orient: 'vertical',
|
||||||
// left: 'left'
|
// left: 'left'
|
||||||
// type: 'warp',
|
// type: 'warp',
|
||||||
bottom: '3%',
|
bottom: '3%',
|
||||||
// left: '30%',
|
// left: '30%',
|
||||||
width: '78%',
|
width: '78%',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
borderRadius: 0
|
borderRadius: 0
|
||||||
},
|
},
|
||||||
itemWidth: 24,
|
itemWidth: 24,
|
||||||
itemHeight: 24
|
itemHeight: 24
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '',
|
name: '',
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: '60%',
|
radius: '60%',
|
||||||
data: data,
|
data: data,
|
||||||
label: {
|
label: {
|
||||||
// show: false,
|
// show: false,
|
||||||
position: 'inside',
|
position: 'inside',
|
||||||
// formatter: '{b}-{c}%',
|
// formatter: '{b}-{c}%',
|
||||||
formatter: function (params: any) {
|
formatter: function (params: any) {
|
||||||
return params.percent < 10
|
return params.percent < 10
|
||||||
? params.percent + '%'
|
? params.percent + '%'
|
||||||
: params.name + ' ' + params.percent + '%'
|
: params.name + ' ' + params.percent + '%'
|
||||||
},
|
},
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
color: '#fff'
|
color: '#fff'
|
||||||
},
|
},
|
||||||
emphasis: {
|
emphasis: {
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
shadowBlur: 10,
|
shadowBlur: 10,
|
||||||
shadowOffsetX: 0,
|
shadowOffsetX: 0,
|
||||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// data:{
|
// data:{
|
||||||
// '科室':['科室一','科室二','科室三'],
|
// '科室':['科室一','科室二','科室三'],
|
||||||
|
|
@ -213,151 +207,183 @@ export function pieEchart(arr: any = [], colorList: any = {}) {
|
||||||
// '平均活跃度(人员平均访问次数)':['科室一平均活跃度','科室二平均活跃度','科室三平均活跃度'],
|
// '平均活跃度(人员平均访问次数)':['科室一平均活跃度','科室二平均活跃度','科室三平均活跃度'],
|
||||||
// }
|
// }
|
||||||
export function barEchart({ deptName = [], visitCount = [], avgCount = [] }) {
|
export function barEchart({ deptName = [], visitCount = [], avgCount = [] }) {
|
||||||
return {
|
return {
|
||||||
// width: '100%',
|
// width: '100%',
|
||||||
title: {
|
title: {
|
||||||
text: '调达本部各科室HP登录情况(内部足迹)',
|
text: '调达本部各科室HP登录情况(内部足迹)',
|
||||||
left: 'center',
|
left: 'center',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 30
|
fontSize: 30
|
||||||
},
|
},
|
||||||
top: 10
|
top: 10
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '4%',
|
left: '4%',
|
||||||
top: '10%',
|
top: '10%',
|
||||||
right: '4%',
|
right: '4%',
|
||||||
bottom: '10%',
|
bottom: '10%',
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
// axisPointer: {
|
// axisPointer: {
|
||||||
// type: 'cross',
|
// type: 'cross',
|
||||||
// crossStyle: {
|
// crossStyle: {
|
||||||
// color: '#999'
|
// color: '#999'
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
name: 'HP访问次数',
|
name: 'HP访问次数',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
// color: '#f8cbad',
|
// color: '#f8cbad',
|
||||||
borderWidth: 0
|
borderWidth: 0
|
||||||
},
|
},
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 18
|
fontSize: 18
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '平均活跃度(人员平均访问次数)',
|
name: '平均活跃度(人员平均访问次数)',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
// color: '#acc1fb',
|
// color: '#acc1fb',
|
||||||
borderWidth: 0
|
borderWidth: 0
|
||||||
},
|
},
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 18
|
fontSize: 18
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// data: ['HP访问次数', '平均活跃度(人员平均访问次数)'],
|
// data: ['HP访问次数', '平均活跃度(人员平均访问次数)'],
|
||||||
bottom: '0px'
|
bottom: '0px'
|
||||||
},
|
},
|
||||||
xAxis: [
|
xAxis: [
|
||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||||
data: deptName,
|
data: deptName,
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
type: 'shadow'
|
type: 'shadow'
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
interval: 0,
|
interval: 0,
|
||||||
rotate: 45,
|
rotate: 45,
|
||||||
fontSize: 18
|
fontSize: 18
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: 'HP访问次数',
|
name: 'HP访问次数',
|
||||||
// min: 0,
|
// min: 0,
|
||||||
// max: 250,
|
// max: 250,
|
||||||
// interval: 50,
|
// interval: 50,
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
formatter: '{value}'
|
formatter: '{value}'
|
||||||
},
|
},
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: 18
|
fontSize: 18
|
||||||
},
|
},
|
||||||
nameRotate: 90,
|
nameRotate: 90,
|
||||||
nameGap: '60',
|
nameGap: '60',
|
||||||
nameLocation: 'middle'
|
nameLocation: 'middle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: '平均活跃度(人员平均访问次数)',
|
name: '平均活跃度(人员平均访问次数)',
|
||||||
// min: 0,
|
// min: 0,
|
||||||
// max: 25,
|
// max: 25,
|
||||||
// interval: 5,
|
// interval: 5,
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
formatter: '{value}'
|
formatter: '{value}'
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: 18
|
fontSize: 18
|
||||||
},
|
},
|
||||||
nameRotate: 90,
|
nameRotate: 90,
|
||||||
nameGap: '46',
|
nameGap: '46',
|
||||||
nameLocation: 'middle'
|
nameLocation: 'middle'
|
||||||
// axisLine: {
|
// axisLine: {
|
||||||
// lineStyle: {
|
// lineStyle: {
|
||||||
// color: '#f7c455'
|
// color: '#f7c455'
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: 'HP访问次数',
|
name: 'HP访问次数',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
tooltip: {
|
tooltip: {
|
||||||
valueFormatter: function (value) {
|
valueFormatter: function (value) {
|
||||||
return value + ''
|
return value + ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// data: [
|
// 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
|
// 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
|
data: visitCount
|
||||||
// color: '#5b9bd5'
|
// color: '#5b9bd5'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '平均活跃度(人员平均访问次数)',
|
name: '平均活跃度(人员平均访问次数)',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
yAxisIndex: 1,
|
yAxisIndex: 1,
|
||||||
tooltip: {
|
tooltip: {
|
||||||
valueFormatter: function (value) {
|
valueFormatter: function (value) {
|
||||||
return 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: [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,
|
data: avgCount,
|
||||||
smooth: true,
|
smooth: true,
|
||||||
color: '#ed7d31'
|
color: '#ed7d31'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
// emphasis: {
|
// emphasis: {
|
||||||
// itemStyle: {
|
// itemStyle: {
|
||||||
// shadowBlur: 10,
|
// shadowBlur: 10,
|
||||||
// shadowOffsetX: 0,
|
// shadowOffsetX: 0,
|
||||||
// shadowColor: 'rgba(0, 0, 0, 0.5)'
|
// 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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,173 +1,184 @@
|
||||||
<script setup lang="ts">
|
<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 { message } from '@/utils/message'
|
||||||
import { Search, Refresh } from '@element-plus/icons-vue'
|
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 stores = noticeld()
|
||||||
const treeData = ref<any>()
|
const treeData = ref<any>()
|
||||||
const emit = defineEmits(['clickChild','CloseThis'])
|
const emit = defineEmits(['clickChild', 'CloseThis'])
|
||||||
const FlashOutline = ref('')
|
const FlashOutline = ref('')
|
||||||
const treeRef =ref()
|
const treeRef = ref()
|
||||||
|
const flag = ref(false)
|
||||||
async function getTree() {
|
async function getTree() {
|
||||||
const reviewSource =stores.article.reviewSource
|
const reviewSource = stores.article.reviewSource
|
||||||
const { data } = await deptTree({reviewSource})
|
const { data } = await deptTree({ reviewSource })
|
||||||
if(data&&data!='null'&&data.length>0){
|
if (data && data != 'null' && data.length > 0) {
|
||||||
treeData.value = data
|
treeData.value = data
|
||||||
}
|
}
|
||||||
|
console.log(data)
|
||||||
console.log(data)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
userDataList: {
|
userDataList: {
|
||||||
type: Array as PropType<any[]>,
|
type: Array as PropType<any[]>,
|
||||||
default: () => [],
|
default: () => []
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const da = reactive({
|
const da = reactive({
|
||||||
pageNum: '1',
|
pageNum: '1',
|
||||||
pageSize: '1000',
|
pageSize: '1000',
|
||||||
phonenumber: '',
|
phonenumber: '',
|
||||||
status: '',
|
status: '',
|
||||||
beingTime: '',
|
beingTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
deptId: '',
|
deptId: '',
|
||||||
nickName:''
|
nickName: ''
|
||||||
})
|
})
|
||||||
const userData = ref<any>()
|
const userData = ref<any>()
|
||||||
async function getUserPage() {
|
async function getUserPage() {
|
||||||
const reviewSource =stores.article.reviewSource
|
const reviewSource = stores.article.reviewSource
|
||||||
const {pageNum,pageSize,phonenumber,status,beingTime,endTime,deptId,nickName} = unref(da)
|
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 { rows } = await getPage({
|
||||||
const rowsD = rows.map((i: any) => {
|
pageNum,
|
||||||
if (i.loginDate) {
|
pageSize,
|
||||||
i.loginDate = i.loginDate.slice(0, 10)
|
phonenumber,
|
||||||
}
|
status,
|
||||||
|
beingTime,
|
||||||
return i
|
endTime,
|
||||||
})
|
deptId,
|
||||||
userData.value = rowsD
|
nickName,
|
||||||
|
reviewSource
|
||||||
|
})
|
||||||
|
const rowsD = rows.map((i: any) => {
|
||||||
|
if (i.loginDate) {
|
||||||
}
|
i.loginDate = i.loginDate.slice(0, 10)
|
||||||
|
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return i
|
||||||
|
})
|
||||||
|
const data = cloneDeep(toRaw(multipleSelection.value))
|
||||||
|
flag.value = false
|
||||||
|
userData.value = rowsD
|
||||||
|
setTimeout(() => {
|
||||||
|
selection(data)
|
||||||
|
}, 150)
|
||||||
|
}
|
||||||
|
|
||||||
|
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(() => {
|
onMounted(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
selection()
|
selection()
|
||||||
}, 1000);
|
}, 1000)
|
||||||
})
|
})
|
||||||
|
|
||||||
const ss = computed(() => [da.deptId,da.nickName])
|
const ss = computed(() => [da.deptId, da.nickName])
|
||||||
watch(() => unref(ss),
|
watch(
|
||||||
async (v) => {
|
() => unref(ss),
|
||||||
getUserPage()
|
async (v) => {
|
||||||
},
|
getUserPage()
|
||||||
{ immediate: true, deep: true },
|
},
|
||||||
|
{ immediate: true, deep: true }
|
||||||
)
|
)
|
||||||
const thisClick = (e: { id: string }) => {
|
const thisClick = (e: { id: string }) => {
|
||||||
da.deptId = e.id
|
da.deptId = e.id
|
||||||
// console.log(e)
|
// console.log(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
const formInline = ref()
|
const formInline = ref()
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
// console.log(formInline.value)
|
// console.log(formInline.value)
|
||||||
da.nickName= formInline.value
|
da.nickName = formInline.value
|
||||||
}
|
}
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formInline.value =''
|
formInline.value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const multipleTableRef = ref()
|
const multipleTableRef = ref()
|
||||||
const multipleSelection = ref<[]>([])
|
const multipleSelection = ref<[]>([])
|
||||||
|
const multipleSelectionObj: any = {}
|
||||||
|
|
||||||
const handleSelectionChange = (val) => {
|
const handleSelectionChange = (val) => {
|
||||||
console.log(val)
|
console.log(val)
|
||||||
multipleSelection.value = val
|
multipleSelectionObj[da.deptId] = val
|
||||||
|
multipleSelection.value = uniqBy(Object.values(multipleSelectionObj).flat(), 'userId')
|
||||||
}
|
}
|
||||||
|
|
||||||
const selet = (rows: any) => {
|
const selet = (rows: any) => {
|
||||||
multipleTableRef.value!.toggleRowSelection(rows, undefined)
|
multipleTableRef.value!.toggleRowSelection(rows, undefined)
|
||||||
// console.log(unref(multipleSelection))
|
// console.log(unref(multipleSelection))
|
||||||
}
|
}
|
||||||
|
|
||||||
const toggleSelection = (Data: any[]) => {
|
const toggleSelection = (Data: any[]) => {
|
||||||
// console.log(Data)
|
// console.log(Data)
|
||||||
if (Data) {
|
if (Data) {
|
||||||
Data.forEach((row: any) => {
|
Data.forEach((row: any) => {
|
||||||
multipleTableRef.value!.toggleRowSelection(row, undefined)
|
multipleTableRef.value!.toggleRowSelection(row, undefined)
|
||||||
// console.log(multipleTableRef.value.data)
|
// console.log(multipleTableRef.value.data)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const handleClose = (id: any) => {
|
const handleClose = (id: any) => {
|
||||||
multipleSelection.value.filter(item => {
|
multipleSelection.value = multipleSelection.value.filter((item) => {
|
||||||
|
if (item.userId === id) {
|
||||||
if (item.userId === id) {
|
console.log(item.userId, id)
|
||||||
console.log(item.userId,id)
|
multipleTableRef.value!.toggleRowSelection(item, undefined)
|
||||||
multipleTableRef.value!.toggleRowSelection(item, undefined)
|
return false
|
||||||
}
|
}
|
||||||
})
|
return item
|
||||||
|
})
|
||||||
}
|
}
|
||||||
const showModal = ref()
|
const showModal = ref()
|
||||||
const handleChange = () => {
|
const handleChange = () => {
|
||||||
emit('clickChild', { multipleSelection, showModal })
|
emit('clickChild', { multipleSelection, showModal })
|
||||||
}
|
}
|
||||||
const CloseThis=()=>{
|
const CloseThis = () => {
|
||||||
|
emit('CloseThis', false)
|
||||||
emit('CloseThis',false)
|
|
||||||
}
|
}
|
||||||
const CloseT = ()=>{
|
const CloseT = () => {
|
||||||
showModal2.value = false
|
showModal2.value = false
|
||||||
multipleSelection.value=[]
|
multipleSelection.value = []
|
||||||
}
|
}
|
||||||
getTree()
|
getTree()
|
||||||
|
|
||||||
const asGroup = ref()
|
const asGroup = ref()
|
||||||
async function getGroup(){
|
async function getGroup() {
|
||||||
const {data} = await getGroupList()
|
const { data } = await getGroupList()
|
||||||
asGroup.value = data
|
asGroup.value = data
|
||||||
}
|
}
|
||||||
|
|
||||||
getGroup()
|
getGroup()
|
||||||
|
|
||||||
const asGroupClick = (e: any)=>{
|
const asGroupClick = (e: any) => {
|
||||||
multipleSelection.value = e.userList
|
multipleSelection.value = e.userList
|
||||||
}
|
}
|
||||||
const showModal2 =ref(false)
|
const showModal2 = ref(false)
|
||||||
const groupName = ref()
|
const groupName = ref()
|
||||||
const groupDeleteId = ref()
|
const groupDeleteId = ref()
|
||||||
let id = 0
|
let id = 0
|
||||||
const modfify = (e)=>{
|
const modfify = (e) => {
|
||||||
console.log(e.id)
|
console.log(e.id)
|
||||||
groupDeleteId.value =e
|
groupDeleteId.value = e
|
||||||
id = e.id
|
id = e.id
|
||||||
showModal2.value = true
|
showModal2.value = true
|
||||||
groupName.value = e.name
|
groupName.value = e.name
|
||||||
multipleSelection.value = e.userList
|
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=()=>{
|
const changeGroup = () => {
|
||||||
changSave()
|
changSave()
|
||||||
}
|
}
|
||||||
watch(FlashOutline, (val) => {
|
watch(FlashOutline, (val) => {
|
||||||
treeRef.value!.filter(val)
|
treeRef.value!.filter(val)
|
||||||
|
|
@ -178,162 +189,200 @@ const filterNode = (value: string, data: Tree) => {
|
||||||
return data.label.includes(value)
|
return data.label.includes(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function changSave() {
|
||||||
|
let userIdList: any[] = []
|
||||||
async function changSave(){
|
const name = groupName.value
|
||||||
let userIdList: any[] = []
|
// console.log(multipleSelection.value)
|
||||||
const name = groupName.value
|
multipleSelection.value.forEach((i: { userId: any }) => {
|
||||||
// console.log(multipleSelection.value)
|
userIdList.push(i.userId)
|
||||||
multipleSelection.value.forEach((i: { userId: any })=>{
|
})
|
||||||
userIdList.push(i.userId)
|
console.log(id, groupName.value, userIdList)
|
||||||
})
|
// if(!id) return
|
||||||
console.log(id, groupName.value,userIdList)
|
let formdata = new FormData()
|
||||||
// if(!id) return
|
formdata.append('id', id)
|
||||||
let formdata = new FormData();
|
formdata.append('name', name)
|
||||||
formdata.append("id",id);
|
formdata.append('userIdList', userIdList)
|
||||||
formdata.append("name",name);
|
const { msg } = await addGroup(formdata, { headers: { 'Content-Type': 'application/form-data' } })
|
||||||
formdata.append("userIdList",userIdList);
|
message.success(msg)
|
||||||
const {msg} = await addGroup(formdata,{headers: {'Content-Type': 'application/form-data'}})
|
getGroup()
|
||||||
message.success(msg)
|
|
||||||
getGroup()
|
|
||||||
}
|
}
|
||||||
const addGroupList = () =>{
|
const addGroupList = () => {
|
||||||
showModal2.value = true
|
showModal2.value = true
|
||||||
}
|
}
|
||||||
const deleteGroupp =(i: any)=>{
|
const deleteGroupp = (i: any) => {
|
||||||
console.log(i)
|
console.log(i)
|
||||||
deleteGroups(i.id)
|
deleteGroups(i.id)
|
||||||
}
|
}
|
||||||
async function deleteGroups(id) {
|
async function deleteGroups(id) {
|
||||||
if(!id) return
|
if (!id) return
|
||||||
const {code} =await deleteGroup({id})
|
const { code } = await deleteGroup({ id })
|
||||||
getGroup()
|
getGroup()
|
||||||
asGroup.value = []
|
asGroup.value = []
|
||||||
multipleSelection.value=[]
|
multipleSelection.value = []
|
||||||
groupName.value=''
|
groupName.value = ''
|
||||||
message.info("删除成功")
|
message.info('删除成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSelect(params: any) {
|
||||||
|
console.log('🚀 ~ file: UserPages.vue:230 ~ params:', params)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<div class="max-w95% h800px m-auto bg-#fff rounded-10px overflow-hidden">
|
||||||
<div class=" max-w95% h800px m-auto bg-#fff rounded-10px overflow-hidden">
|
<div
|
||||||
<div class="pl20px text-18px w100% h60px p15px" style="border-bottom:1px solid #dfdfdf ;font-weight: 700;">
|
class="pl20px text-18px w100% h60px p15px"
|
||||||
调达中心</div>
|
style="border-bottom: 1px solid #dfdfdf; font-weight: 700"
|
||||||
<div class="p20px flex relative">
|
>
|
||||||
<div class="min-w150px">
|
调达中心
|
||||||
<el-input v-model="FlashOutline" class="w-50 m-2" placeholder="搜索" suffix-icon="Calendar"
|
</div>
|
||||||
:prefix-icon="Search" />
|
<div class="p20px flex relative">
|
||||||
<el-tree ref="treeRef" :data="treeData" :filter-node-method="filterNode" :default-expanded-keys="[2, 4]" @node-click="thisClick" class="max-h500px"/>
|
<div class="min-w150px">
|
||||||
|
<el-input
|
||||||
|
v-model="FlashOutline"
|
||||||
<ul class="absolute max-h200px min-h100px bottom-0 list-none !p0 overflow-auto w190px" v-if="asGroup">
|
class="w-50 m-2"
|
||||||
<li v-for="i in asGroup" class="cursor-default w190px h32px" >
|
placeholder="搜索"
|
||||||
<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>
|
suffix-icon="Calendar"
|
||||||
<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>
|
:prefix-icon="Search"
|
||||||
<el-icon @click="deleteGroupp(i)" class="mt7px ml5px"><Delete/></el-icon>
|
/>
|
||||||
</li>
|
<el-tree
|
||||||
</ul>
|
ref="treeRef"
|
||||||
</div>
|
:data="treeData"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
<div class="ml20px max-w80%">
|
:default-expanded-keys="[2, 4]"
|
||||||
|
@node-click="thisClick"
|
||||||
<div v-if="showModal2!=true">
|
class="max-h500px"
|
||||||
<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>
|
|
||||||
|
|
||||||
|
<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>
|
|
||||||
|
|
||||||
|
<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>
|
</template>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.el-form--inline .el-input {
|
.el-form--inline .el-input {
|
||||||
width: 180px !important;
|
width: 180px !important;
|
||||||
}
|
}
|
||||||
::-webkit-scrollbar{
|
::-webkit-scrollbar {
|
||||||
width: 1px;
|
width: 1px;
|
||||||
}
|
}
|
||||||
.thList {
|
.thList {
|
||||||
td {
|
td {
|
||||||
border-bottom: 1px solid #f5f5f5;
|
border-bottom: 1px solid #f5f5f5;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -63,21 +63,28 @@ const fetchNewDataList = async () => {
|
||||||
}
|
}
|
||||||
fetchNewDataList()
|
fetchNewDataList()
|
||||||
|
|
||||||
|
const num = ['', '第一周', '第二周', '第三周', '第四周', '第五周']
|
||||||
// 将日期按照周分组
|
// 将日期按照周分组
|
||||||
function groupDatesByWeek(dates = [], weekStartDay = 1) {
|
function groupDatesByWeek(dates = [], weekStartDay = 1) {
|
||||||
return dates.reduce((acc: any, item: any) => {
|
return dates.reduce((acc: any, item: any) => {
|
||||||
const weekStart = dayjs(item.createTime)
|
const date = dayjs(item.createTime)
|
||||||
.startOf('week')
|
const weekStart = date.startOf('week').add(weekStartDay, 'day').format('MM月DD日')
|
||||||
.add(weekStartDay, 'day')
|
item.date = date.format('YYYY-MM-DD')
|
||||||
.format('MM月DD日')
|
const weekEnd = date.endOf('week').add(weekStartDay, 'day').format('MM月DD日')
|
||||||
item.date = dayjs(item.createTime).format('YYYY-MM-DD')
|
const week = getWeekOfMonth(date)
|
||||||
const weekEnd = dayjs(item.createTime).endOf('week').add(weekStartDay, 'day').format('MM月DD日')
|
const month = date.format('MM')
|
||||||
const key = `${weekStart} - ${weekEnd}`
|
const key = `${+month}月 ${num[week]} ( ${weekStart} - ${weekEnd} )`
|
||||||
acc[key] = acc[key] || []
|
acc[key] = acc[key] || []
|
||||||
acc[key].push(item)
|
acc[key].push(item)
|
||||||
return acc
|
return acc
|
||||||
}, {})
|
}, {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getWeekOfMonth(date) {
|
||||||
|
const startOfMonth = date.startOf('month')
|
||||||
|
const diff = date.diff(startOfMonth, 'day')
|
||||||
|
return Math.ceil((diff + startOfMonth.day()) / 7)
|
||||||
|
}
|
||||||
// watchEffect(() => {
|
// watchEffect(() => {
|
||||||
// searchS.search.time
|
// searchS.search.time
|
||||||
// getSearchList(searchS.search.content)
|
// getSearchList(searchS.search.content)
|
||||||
|
|
@ -89,57 +96,62 @@ const codePath = {
|
||||||
modulePath: '/Home/intelligence'
|
modulePath: '/Home/intelligence'
|
||||||
},
|
},
|
||||||
App_Market: {
|
App_Market: {
|
||||||
path: '/Home/market',
|
path: '/Home/market/',
|
||||||
modulePath: '/Home/market'
|
modulePath: '/Home/market'
|
||||||
},
|
},
|
||||||
App_data_platform: {
|
App_data_platform: {
|
||||||
path: '/Home/cd',
|
path: '/Home/cd/',
|
||||||
modulePath: '/Home/cd'
|
modulePath: '/Home/cd'
|
||||||
},
|
},
|
||||||
App_BCP: {
|
App_BCP: {
|
||||||
path: '/Home/bcp',
|
path: '/Home/bcp/',
|
||||||
modulePath: '/Home/bcp'
|
modulePath: '/Home/bcp/'
|
||||||
},
|
},
|
||||||
// '碳中和模块',
|
// '碳中和模块',
|
||||||
App_CSR: {
|
App_CSR: {
|
||||||
path: '/Home/csr',
|
path: '/Home/csr/',
|
||||||
modulePath: '/Home/csr'
|
modulePath: '/Home/csr/'
|
||||||
},
|
},
|
||||||
// '品质模块',
|
// '品质模块',
|
||||||
App_Quality: {
|
App_Quality: {
|
||||||
path: '/Home/quality',
|
path: '/Home/quality/',
|
||||||
modulePath: '/Home/quality'
|
modulePath: '/Home/quality/'
|
||||||
},
|
},
|
||||||
// 'Lab模块',
|
// 'Lab模块',
|
||||||
App_Lab: {
|
App_Lab: {
|
||||||
path: '/Home/diffspace',
|
path: '/Home/diffspace/',
|
||||||
modulePath: '/Home/diffspace'
|
modulePath: '/Home/diffspace'
|
||||||
},
|
},
|
||||||
// 'DatabBase模块'
|
// 'DatabBase模块'
|
||||||
App_Database: {
|
App_Database: {
|
||||||
path: '/DataBase',
|
path: '/DataBase?id=',
|
||||||
modulePath: '/DataBase'
|
modulePath: '/DataBase'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const goModule = (item, type) => {
|
const goModule = (item, type) => {
|
||||||
const { moduleCode, id } = item
|
const { moduleCode, id, cateId } = item
|
||||||
const { modulePath, path } = codePath[moduleCode]
|
const { modulePath, path } = codePath[moduleCode]
|
||||||
|
console.log('🚀 ~ file: News.vue:128 ~ modulePath, path:', modulePath, path)
|
||||||
if (modulePath) {
|
if (modulePath) {
|
||||||
if (type === 'module') {
|
if (type === 'module') {
|
||||||
push(modulePath)
|
push(modulePath)
|
||||||
} else {
|
} else {
|
||||||
push(path + id)
|
push(path + (moduleCode === 'App_Database' ? cateId : id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const clickItem = (item: any) => {
|
const clickItem = (item: any) => {
|
||||||
const { id, filePath, isSelect, moduleCode, fileCommon = {} } = item
|
const { id, filePath, isSelect, moduleCode, fileCommon = {} } = item
|
||||||
if (moduleCode === 'App_Article') {
|
if (isSelect == 1) {
|
||||||
goModule(item, 'path')
|
if (item.moduleCode === 'App_Article') {
|
||||||
}
|
return push('/Home/intelligence/' + item.id)
|
||||||
if (isSelect === 1) {
|
}
|
||||||
downloads({ fileCommon, filePath })
|
if (['App_Database'].includes(moduleCode)) {
|
||||||
|
goModule(item, 'path')
|
||||||
|
} else {
|
||||||
|
downloads({ fileCommon, filePath })
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
message.info('您没有权限查看!')
|
message.info('您没有权限查看!')
|
||||||
}
|
}
|
||||||
|
|
@ -170,10 +182,6 @@ function downloadFile(url: any) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function getFileNameFromUrl(url: string) {
|
function getFileNameFromUrl(url: string) {
|
||||||
console.log(
|
|
||||||
'🚀 ~ file: index.vue:107 ~ getFileNameFromUrl ~ getFileNameFromUrl:',
|
|
||||||
getFileNameFromUrl
|
|
||||||
)
|
|
||||||
const lastSlashIndex = url.lastIndexOf('/')
|
const lastSlashIndex = url.lastIndexOf('/')
|
||||||
if (lastSlashIndex !== -1) {
|
if (lastSlashIndex !== -1) {
|
||||||
return url.substring(lastSlashIndex + 1)
|
return url.substring(lastSlashIndex + 1)
|
||||||
|
|
@ -204,30 +212,28 @@ const fileSize = 24 * 1024 * 1024
|
||||||
</HomeHead>
|
</HomeHead>
|
||||||
<div class="h-full relative flex flex-col">
|
<div class="h-full relative flex flex-col">
|
||||||
<div class="font-600 flex items-end mt30px">
|
<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 ml40px mr25px">{{ day }}</div>
|
||||||
<div class="text-18px">{{ week }}</div>
|
<div class="text-18px">{{ week }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="q-wrapper flex-1 mt30px text-#142142 flex flex-col bg-#fff p30px">
|
<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 class="h-710px overflow-y-scroll">
|
||||||
<div v-for="(val, key) of newsData" :key="key" class="w-70% mb-20px flex-1">
|
<div v-for="(val, key) of newsData" :key="key" class="w-94% mb-20px flex-1">
|
||||||
<div class="text-#142142 text-20px font-600 mb20px">
|
<div class="text-#142142 text-20px font-bold mb20px mt40px">
|
||||||
{{ key }}
|
{{ key }}
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(i, k) in val" :key="k" class="mb-10px">
|
<div v-for="(i, k) in val" :key="k" class="mb-20px flex items-center w-full">
|
||||||
<div class="text-#142142 truncate text-18px mt8px">
|
<div
|
||||||
<div
|
@click="clickItem(i)"
|
||||||
@click="clickItem(i)"
|
class="w-[40%] no-underline truncate text-18px text-#142142 cursor-pointer hover:underline h-16px leading-16px"
|
||||||
class="no-underline text-#142142 cursor-pointer hover:underline h-16px leading-16px"
|
>
|
||||||
>
|
{{ i.title || '' }}
|
||||||
{{ i.title || '' }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="text-#808696 mt-10px text-16px flex items-center justify-between mb-14px">
|
<div class="text-#808696 text-16px ml30px flex flex-1 items-center justify-between">
|
||||||
<span class="flex-1">发布科室: {{ i.departName }}</span>
|
<div class="flex-1">发布科室: {{ i.departName }}</div>
|
||||||
<span class="w-[36%]">发布人: {{ i.userName }}</span>
|
<div class="w-[36%]">发布人: {{ i.userName }}</div>
|
||||||
<span class="w-[20%]"> {{ i.createTime?.slice(0, 10) }}</span>
|
<div class="w-[20%]">{{ i.createTime?.slice(0, 10) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,10 @@ const array = ref<any[]>([
|
||||||
{ content1: '站稳脚跟 强化优势 大步迈进', content2: '', year: '2016年' },
|
{ content1: '站稳脚跟 强化优势 大步迈进', content2: '', year: '2016年' },
|
||||||
{ content1: '创造未来,决胜于变化的时代', content2: '', year: '2015年' }
|
{ content1: '创造未来,决胜于变化的时代', content2: '', year: '2015年' }
|
||||||
])
|
])
|
||||||
|
let flag = ref(false)
|
||||||
|
const switchImg = () => {
|
||||||
|
flag.value = !flag.value
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -70,9 +74,22 @@ const array = ref<any[]>([
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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/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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue