Browse Source

Merge remote-tracking branch 'origin/master'

master
DX 2 weeks ago
parent
commit
acda1514a8
  1. 19
      src/components/RouterSearch/index.vue
  2. 10
      src/layout/components/AppView.vue
  3. 29
      src/layout/components/ToolHeader.vue
  4. 11
      src/layout/components/UserInfo/src/UserInfo.vue
  5. 215
      src/views/Home/Index.vue

19
src/components/RouterSearch/index.vue

@ -17,8 +17,8 @@
/>
</el-select>
</ElDialog>
<div v-else class="custom-hover" @click.stop="showTopSearch = !showTopSearch">
<Icon icon="ep:search" />
<div v-else class="block" @click.stop="showTopSearch = !showTopSearch">
<Icon :icon="icon" @focus="focus" />
<el-select
@click.stop
filterable
@ -52,7 +52,7 @@ const router = useRouter() // 路由对象
const showSearch = ref(false) //
const showTopSearch = ref(false) //
const value: Ref = ref('') //
const icon = ref('ep:search')
const routers = router.getRoutes() //
const options = computed(() => {
//
@ -77,6 +77,8 @@ function remoteMethod(data) {
value.value = data
}
const focus = () => {}
function handleChange(path) {
router.push({ path })
hiddenSearch()
@ -117,3 +119,14 @@ defineExpose({
}
})
</script>
<style lang="scss" scoped>
.block {
display: flex;
height: 100%;
padding: 0 10px;
cursor: pointer;
align-items: center;
transition: background var(--transition-time-02);
}
</style>

10
src/layout/components/AppView.vue

@ -44,10 +44,14 @@ provide('reload', reload)
]"
>
<router-view v-if="routerAlive">
<!-- <template #default="{ Component, route }">-->
<!-- <keep-alive :include="getCaches">-->
<!-- <component :is="Component" :key="route.fullPath" />-->
<!-- </keep-alive>-->
<!-- </template>-->
<template #default="{ Component, route }">
<keep-alive :include="getCaches">
<component :is="Component" :key="route.fullPath" />
</keep-alive>
<component :is="Component" :key="route.fullPath" />
</template>
</router-view>
</section>

29
src/layout/components/ToolHeader.vue

@ -1,10 +1,7 @@
<script lang="tsx">
import { defineComponent, computed } from 'vue'
import { Message } from '@/layout/components//Message'
import { Collapse } from '@/layout/components/Collapse'
import { UserInfo } from '@/layout/components/UserInfo'
import { Screenfull } from '@/layout/components/Screenfull'
import { Breadcrumb } from '@/layout/components/Breadcrumb'
import { SizeDropdown } from '@/layout/components/SizeDropdown'
import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
import { Screen } from '@/layout/components/Screen'
@ -14,15 +11,10 @@ import { useDesign } from '@/hooks/web/useDesign'
const { getPrefixCls, variables } = useDesign()
const prefixCls = getPrefixCls('tool-header')
const appStore = useAppStore()
//
const breadcrumb = computed(() => appStore.getBreadcrumb)
//
const hamburger = computed(() => appStore.getHamburger)
//
const screenfull = computed(() => appStore.getScreenfull)
@ -33,14 +25,11 @@ const search = computed(() => appStore.search)
//
const size = computed(() => appStore.getSize)
//
const layout = computed(() => appStore.getLayout)
//
const locale = computed(() => appStore.getLocale)
//
const message = computed(() => appStore.getMessage)
export default defineComponent({
name: 'ToolHeader',
@ -51,17 +40,17 @@ export default defineComponent({
class=" relative flex items-cente "
>
<div class="flex items-center" >
<Screen class="custom-hover" color="var(--top-header-text-color)" />
<Screen class="block" color="var(--top-header-text-color)" />
{screenfull.value ? (
<Screenfull class="custom-hover" color="var(--top-header-text-color)"></Screenfull>
<Screenfull class="block" color="var(--top-header-text-color)"></Screenfull>
) : undefined}
{search.value ? <RouterSearch isModal={false} /> : undefined}
{size.value ? (
<SizeDropdown class="custom-hover" color="var(--top-header-text-color)"></SizeDropdown>
<SizeDropdown class="block" color="var(--top-header-text-color)"></SizeDropdown>
) : undefined}
{locale.value ? (
<LocaleDropdown
class="custom-hover"
class="block"
color="var(--top-header-text-color)"
></LocaleDropdown>
) : undefined}
@ -79,4 +68,12 @@ $prefix-cls: #{$namespace}-tool-header;
.#{$prefix-cls} {
transition: left var(--transition-time-02);
}
.block{
display: flex;
height: 100%;
padding: 0 10px;
cursor: pointer;
align-items: center;
transition: background var(--transition-time-02);
}
</style>

11
src/layout/components/UserInfo/src/UserInfo.vue

@ -55,7 +55,7 @@ const toDocument = () => {
</script>
<template>
<ElDropdown class="custom-hover" :class="prefixCls" trigger="click">
<ElDropdown class="block" :class="prefixCls" trigger="click">
<div class="flex items-center gap-4px">
<ElAvatar :src="avatar" alt="" :size="32" class="rounded-[50%]" />
<span class="text-14px color-#303133 font-500 line-height-22px">
@ -110,4 +110,13 @@ const toDocument = () => {
opacity: 0;
transform: translateY(10%);
}
.block {
display: flex;
height: 100%;
padding: 0 10px;
cursor: pointer;
align-items: center;
transition: background var(--transition-time-02);
}
</style>

215
src/views/Home/Index.vue

@ -303,22 +303,28 @@ const barOptionsData = ref({
},
{
name: '执法记录',
type: 'bar',
type: 'pictorialBar',
symbol: 'rect',
symbolPosition: 'end',
symbolSize: [20, 5],
symbolOffset: [-13, -1],
barWidth: 20,
stack: '执法记录',
barGap: '30%',
barGap: '-100% ',
itemStyle: {
color: 'rgba(64, 158, 255, 1)'
},
tooltip: {
show: false
},
data: [1, 1, 1, 1, 1]
data: []
},
{
name: '整改次数',
type: 'bar',
stack: '整改次数',
type: 'pictorialBar',
symbol: 'rect',
symbolPosition: 'end',
symbolSize: [20,5],
symbolOffset: [13, -1],
barWidth: 20,
itemStyle: {
color: 'rgba(103, 194, 58, 1)'
@ -326,103 +332,103 @@ const barOptionsData = ref({
tooltip: {
show: false
},
data: [1, 1, 1, 1, 1]
data: []
}
]
})
const lineOptionsData = ref({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
top: 42,
left: 16,
right: 16,
bottom: 16,
containLabel: true
},
legend: {
show: true,
top: 16,
left: 'center',
textStyle: {
color: '#333'
}
},
xAxis: {
type: 'category',
data:[],
axisTick: {
show: false
},
axisLine: {
show: false
},
splitLine: {
show: true,
lineStyle: {
type: 'dashed',
color: '#E5E7EB'
}
},
axisLabel: {
show: false,
color: '#333'
}
},
yAxis: {
type: 'value',
axisLine: {
show: false
},
max: (v) => {
return Math.floor(v.max * 1.2 + 1)
},
axisTick: {
show: false
},
splitLine: {
lineStyle: {
type: 'dashed',
color: '#E5E7EB'
}
}
},
series: [
{
name: '任务数',
data: [13253, 34235, 26321, 12340, 24643],
type: 'line',
smooth: true,
itemStyle: {
color: 'rgba(64, 158, 255, 1)'
},
lineStyle: {
color: 'rgba(64, 158, 255, 1)'
},
areaStyle: {
color: 'rgba(64, 158, 255, .3)'
}
},
{
name: '执法数',
data: [15678, 28943, 31452, 19876, 22345],
type: 'line',
smooth: true,
itemStyle: {
color: 'rgba(103, 194, 58, 1)'
},
lineStyle: {
color: 'rgba(103, 194, 58, 1)'
},
areaStyle: {
color: 'rgba(103, 194, 58, .3)'
}
}
]
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
top: 42,
left: 16,
right: 16,
bottom: 16,
containLabel: true
},
legend: {
show: true,
top: 16,
left: 'center',
textStyle: {
color: '#333'
}
},
xAxis: {
type: 'category',
data: [],
axisTick: {
show: false
},
axisLine: {
show: false
},
splitLine: {
show: true,
lineStyle: {
type: 'dashed',
color: '#E5E7EB'
}
},
axisLabel: {
show: false,
color: '#333'
}
},
yAxis: {
type: 'value',
axisLine: {
show: false
},
max: (v) => {
return Math.floor(v.max * 1.2 + 1)
},
axisTick: {
show: false
},
splitLine: {
lineStyle: {
type: 'dashed',
color: '#E5E7EB'
}
}
},
series: [
{
name: '任务数',
data: [13253, 34235, 26321, 12340, 24643],
type: 'line',
smooth: true,
itemStyle: {
color: 'rgba(64, 158, 255, 1)'
},
lineStyle: {
color: 'rgba(64, 158, 255, 1)'
},
areaStyle: {
color: 'rgba(64, 158, 255, .3)'
}
},
{
name: '执法数',
data: [15678, 28943, 31452, 19876, 22345],
type: 'line',
smooth: true,
itemStyle: {
color: 'rgba(103, 194, 58, 1)'
},
lineStyle: {
color: 'rgba(103, 194, 58, 1)'
},
areaStyle: {
color: 'rgba(103, 194, 58, .3)'
}
}
]
})
const queryParams = reactive({
@ -497,9 +503,9 @@ const getS3Data = async () => {
data1.push({ name: item.month, value: item.taskCount })
data2.push({ name: item.month, value: item.inspectionCount })
})
lineOptionsData.value.series[0].data = data1
lineOptionsData.value.series[1].data = data2
lineOptionsData.value.xAxis.data = res.map((i) => i.month)
lineOptionsData.value.series[0].data = data1
lineOptionsData.value.series[1].data = data2
lineOptionsData.value.xAxis.data = res.map((i) => i.month)
}
//
@ -518,12 +524,11 @@ const getS2Data = async () => {
}
})
const axis = res.map((i) => i.realName)
const top = (res[0].inspectionCount % 10) / 10
barOptionsData.value.series[0].data = data1
barOptionsData.value.series[1].data = data2
barOptionsData.value.xAxis.data = axis
barOptionsData.value.series[2].data = new Array(axis.length).fill(top || 0.1)
barOptionsData.value.series[3].data = new Array(axis.length).fill(top || 0.1)
barOptionsData.value.series[2].data = data1
barOptionsData.value.series[3].data = data2
}
//

Loading…
Cancel
Save