update
parent
fa7ed63104
commit
c7f492865f
|
|
@ -16,7 +16,6 @@ declare module 'vue' {
|
||||||
AppNewsBox: typeof import('./src/components/AppNewsBox.vue')['default']
|
AppNewsBox: typeof import('./src/components/AppNewsBox.vue')['default']
|
||||||
AppPagination: typeof import('./src/components/AppPagination.vue')['default']
|
AppPagination: typeof import('./src/components/AppPagination.vue')['default']
|
||||||
ElButton: typeof import('element-plus/es')['ElButton']
|
ElButton: typeof import('element-plus/es')['ElButton']
|
||||||
ElCascader: typeof import('element-plus/es')['ElCascader']
|
|
||||||
ElCol: typeof import('element-plus/es')['ElCol']
|
ElCol: typeof import('element-plus/es')['ElCol']
|
||||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||||
|
|
@ -32,6 +31,7 @@ declare module 'vue' {
|
||||||
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
||||||
ElOption: typeof import('element-plus/es')['ElOption']
|
ElOption: typeof import('element-plus/es')['ElOption']
|
||||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||||
|
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
|
||||||
ElProgress: typeof import('element-plus/es')['ElProgress']
|
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { RouterView } from 'vue-router'
|
||||||
import { useUserStore } from '@/stores/modules/user'
|
import { useUserStore } from '@/stores/modules/user'
|
||||||
import { treeDbList,download } from '@/api/daikin/base'
|
import { treeDbList,download } from '@/api/daikin/base'
|
||||||
import {databaseld} from "@/stores/modules/database"
|
import {databaseld} from "@/stores/modules/database"
|
||||||
import { NPopover } from 'naive-ui'
|
import { NPopover } from 'naive-ui'
|
||||||
|
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
const store = useUserStore()
|
const store = useUserStore()
|
||||||
|
|
@ -11,10 +11,10 @@ const database = databaseld()
|
||||||
const { toggle } = inject<any>('fullscreen')
|
const { toggle } = inject<any>('fullscreen')
|
||||||
const activeMenuKey = ref()
|
const activeMenuKey = ref()
|
||||||
let idx = ref(0)
|
let idx = ref(0)
|
||||||
|
const onClic = ref(false)
|
||||||
const titles = ref()
|
const titles = ref()
|
||||||
function menuHandler(menu: any, index: number) {
|
function menuHandler(menu: any, index: number) {
|
||||||
console.log(menu)
|
console.log(menu,index)
|
||||||
activeMenuKey.value = menu.id
|
activeMenuKey.value = menu.id
|
||||||
titles.value = menu.name
|
titles.value = menu.name
|
||||||
idx.value = index;
|
idx.value = index;
|
||||||
|
|
@ -29,10 +29,10 @@ function goChild(menu: any) {
|
||||||
console.log(menu.id)
|
console.log(menu.id)
|
||||||
database.database.id =menu.id
|
database.database.id =menu.id
|
||||||
}
|
}
|
||||||
var activeItem = ref()
|
var activeItem = ref<any>()
|
||||||
const tableData = ref()
|
const tableData = ref()
|
||||||
async function getTree() {
|
async function getTree() {
|
||||||
const { data } = await treeDbList({})
|
const { data = [] } = await treeDbList({})
|
||||||
tableData.value = data
|
tableData.value = data
|
||||||
|
|
||||||
if(data&&data[0]){
|
if(data&&data[0]){
|
||||||
|
|
@ -45,13 +45,37 @@ async function getTree() {
|
||||||
// activeMenuKey.value = data[0].childList[0].id
|
// activeMenuKey.value = data[0].childList[0].id
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
if(activeItem.value){
|
||||||
|
const { topLevelItem, targetItem } = findItemById(data,activeItem.value)
|
||||||
|
if(topLevelItem && targetItem){
|
||||||
|
const index = data.findIndex((i:any) => i.id === topLevelItem.id)
|
||||||
|
nextTick(()=>{
|
||||||
|
onClic.value = true
|
||||||
|
menuHandler(topLevelItem,index === -1 ? 0 : index)
|
||||||
|
goChild(targetItem)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
getTree()
|
||||||
getTree()
|
|
||||||
})
|
|
||||||
|
|
||||||
const onClic = ref(false)
|
|
||||||
|
|
||||||
|
function findItemById(items:any, targetId:any, topLevelItem:any = null):any {
|
||||||
|
for (let i = 0; i < items.length; i++) {
|
||||||
|
const item = items[i];
|
||||||
|
if (item.id === targetId) {
|
||||||
|
return { topLevelItem: topLevelItem || item, targetItem: item };
|
||||||
|
} else if (item.childList?.length > 0) {
|
||||||
|
const result = findItemById(item.childList, targetId, topLevelItem || item);
|
||||||
|
if (result) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {topLevelItem: null, targetItem: null};
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -175,8 +175,8 @@
|
||||||
<el-tooltip :content="handTooltip(scope.row.userList)" placement="top">
|
<el-tooltip :content="handTooltip(scope.row.userList)" placement="top">
|
||||||
<div class="!h-50px descStyle">
|
<div class="!h-50px descStyle">
|
||||||
<div class="descStyle max-w-60vw !h-46px ">
|
<div class="descStyle max-w-60vw !h-46px ">
|
||||||
<p v-for="(it, e) in scope.row.userList" :class="scope.row.userList.length < 2 ? '!leading-46px' : ''">
|
<p v-for="(it, e) in scope.row.userList" :class="scope.row.userList.length < 2 ? '!leading-46px' : 'xx'">
|
||||||
{{ it.nickName }}
|
{{ it.nickName || undefined }}
|
||||||
<span v-if="e == 1 && scope.row.userList.length > 2"
|
<span v-if="e == 1 && scope.row.userList.length > 2"
|
||||||
>...共{{ scope.row.userList.length }}人</span
|
>...共{{ scope.row.userList.length }}人</span
|
||||||
>
|
>
|
||||||
|
|
@ -322,7 +322,7 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</NModal>
|
</NModal>
|
||||||
<n-modal v-model:show="showModal">
|
<n-modal v-model:show="showModal" :z-index="99999">
|
||||||
<UserList
|
<UserList
|
||||||
:userDataList="setUserList"
|
:userDataList="setUserList"
|
||||||
@clickChild="handleChild"
|
@clickChild="handleChild"
|
||||||
|
|
@ -381,7 +381,7 @@ async function getTree() {
|
||||||
let cateIds = ref()
|
let cateIds = ref()
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
cateIds.value = database.database.id
|
cateIds.value = database.database.id
|
||||||
console.log(database.database.id)
|
// console.log(database.database.id)
|
||||||
if (database.database.id) {
|
if (database.database.id) {
|
||||||
getInfo(database.database.id)
|
getInfo(database.database.id)
|
||||||
getAuth()
|
getAuth()
|
||||||
|
|
@ -734,7 +734,7 @@ const handleClick = () => {
|
||||||
push({path:'/DataBase/review',query:{cateId:cateIds.value}})
|
push({path:'/DataBase/review',query:{cateId:cateIds.value}})
|
||||||
}
|
}
|
||||||
const handTooltip = (data: any[] = []) => {
|
const handTooltip = (data: any[] = []) => {
|
||||||
return data.map((item:any) => item.nickName)?.join(', ') || ''
|
return data.map((item:any) => item.nickName)?.join(', ') || undefined
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { timeStat,externalTimeStat } from '@/api/daikin/base'
|
||||||
import { formatDate } from '@/utils/format'
|
import { formatDate } from '@/utils/format'
|
||||||
import { Chart1 } from './indexData'
|
import { Chart1 } from './indexData'
|
||||||
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
||||||
|
import { Search } from '@element-plus/icons-vue'
|
||||||
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]>([
|
||||||
|
|
@ -62,7 +63,7 @@ const getDat = async () => {
|
||||||
chartOption1.value = Chart1(xAxisData,siomesData)
|
chartOption1.value = Chart1(xAxisData,siomesData)
|
||||||
}
|
}
|
||||||
|
|
||||||
const externalList = ref()
|
const externalList = ref<any>([])
|
||||||
const getExternalTimeStat = async () => {
|
const getExternalTimeStat = async () => {
|
||||||
const { data } = await externalTimeStat(state)
|
const { data } = await externalTimeStat(state)
|
||||||
externalList.value = data
|
externalList.value = data
|
||||||
|
|
@ -169,12 +170,14 @@ const handleClick = ({paneName}:any) => {
|
||||||
paneName === 'out' && getExternalTimeStat()
|
paneName === 'out' && getExternalTimeStat()
|
||||||
paneName === 'inside' && getDat()
|
paneName === 'inside' && getDat()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const selValue =ref('')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<HomeHead class="top"></HomeHead>
|
<HomeHead class="top"></HomeHead>
|
||||||
<div class="w-full h-834px mt30px rd-20px bg-#fff p30px overflow-hidden">
|
<div class="w-full h-834px mt30px rd-20px bg-#fff p30px overflow-hidden">
|
||||||
<div>
|
<div class="min-h-30px ">
|
||||||
<span class="text-#000">日期: </span>
|
<span class="text-#000">日期: </span>
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
|
@ -195,6 +198,16 @@ const handleClick = ({paneName}:any) => {
|
||||||
class="ml20px mt--5px"
|
class="ml20px mt--5px"
|
||||||
>搜素</el-button
|
>搜素</el-button
|
||||||
>
|
>
|
||||||
|
<template v-if="activeName !== 'inside' && false">
|
||||||
|
<el-select v-model="selValue" class="ml-20px mt-[-4px]" placeholder="Select" size="small">
|
||||||
|
<el-option
|
||||||
|
v-for="item in externalList"
|
||||||
|
:key="item.moduleCode"
|
||||||
|
:label="item.moduleName"
|
||||||
|
:value="item.moduleCode"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
<!-- <el-button :type="primary == 1 ? 'primary' : ''" :icon="Search" class="!ml100px mt--5px"
|
<!-- <el-button :type="primary == 1 ? 'primary' : ''" :icon="Search" class="!ml100px mt--5px"
|
||||||
@click="clickButton(1)">本日</el-button>
|
@click="clickButton(1)">本日</el-button>
|
||||||
<el-button :type="primary == 2 ? 'primary' : ''" :icon="Search" class="!ml30px mt--5px"
|
<el-button :type="primary == 2 ? 'primary' : ''" :icon="Search" class="!ml30px mt--5px"
|
||||||
|
|
|
||||||
|
|
@ -1,42 +1,65 @@
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
import {topStat} from '@/api/daikin/base'
|
import {topStat} from '@/api/daikin/base'
|
||||||
import {getPreviousMonths} from '@/utils/format'
|
import {getPreviousMonths} from '@/utils/format'
|
||||||
|
function formatDate(inputDate: string) {
|
||||||
|
const dateRegex = /^(\d{4})-(\d{2})$/
|
||||||
|
const match = inputDate.match(dateRegex)
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
const year = match[1]
|
||||||
|
let month = match[2]
|
||||||
|
if (month.startsWith('0')) {
|
||||||
|
month = month.substring(1)
|
||||||
|
}
|
||||||
|
return `${year}年${month}月`
|
||||||
|
} else {
|
||||||
|
return inputDate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function useChart21() {
|
export function useChart21() {
|
||||||
const chartRef = ref()
|
const chartRef = ref()
|
||||||
const optionRef = ref()
|
const optionRef = ref()
|
||||||
getData()
|
getData()
|
||||||
async function getData() {
|
async function getData() {
|
||||||
const { data } = await topStat();
|
const { data } = await topStat()
|
||||||
|
|
||||||
const option = {
|
const option = {
|
||||||
legend: {},
|
legend: {},
|
||||||
title:{text:'件',textStyle:{'fontSize':14,'fontWeight':500},subtext:'数',top:'45%'},
|
title: {
|
||||||
tooltip: {
|
text: '件',
|
||||||
trigger: 'axis',
|
textStyle: { fontSize: 14, fontWeight: 500 },
|
||||||
axisPointer: {
|
subtext: '数',
|
||||||
animation: false
|
subtextStyle: { fontSize: 14, fontWeight: 500, color: '#000' },
|
||||||
}
|
top: '45%'
|
||||||
},
|
},
|
||||||
grid: {
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
left: '6%',
|
axisPointer: {
|
||||||
right: '4%',
|
animation: false
|
||||||
bottom: '5%',
|
}
|
||||||
containLabel: true
|
},
|
||||||
},
|
grid: {
|
||||||
yAxis: {
|
left: '6%',
|
||||||
type: 'value',
|
right: '4%',
|
||||||
show:true,
|
bottom: '5%',
|
||||||
},
|
containLabel: true
|
||||||
xAxis: {
|
},
|
||||||
type: 'category',
|
yAxis: {
|
||||||
data: getPreviousMonths()
|
type: 'value',
|
||||||
},
|
show: true
|
||||||
series:data
|
},
|
||||||
|
xAxis: {
|
||||||
}
|
type: 'category',
|
||||||
optionRef.value =option
|
data: data[0]?.month
|
||||||
}
|
? data[0].month.map((item: any) => {
|
||||||
return { chartRef, option:optionRef }
|
return formatDate(item)
|
||||||
|
})
|
||||||
|
: []
|
||||||
|
},
|
||||||
|
series: data
|
||||||
|
}
|
||||||
|
optionRef.value = option
|
||||||
|
}
|
||||||
|
return { chartRef, option: optionRef }
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue