diff --git a/src/components/PieCharts/index.tsx b/src/components/PieCharts/index.tsx index e81d626d8989383ab9671928d139078bca8c80a9..1ee61a9ddc05b79c483dd359b19708fa1017029e 100644 --- a/src/components/PieCharts/index.tsx +++ b/src/components/PieCharts/index.tsx @@ -1,59 +1,50 @@ +import { useMemo, useRef } from 'react' import ReactEcharts from 'echarts-for-react'; -import { useRef } from 'react'; -export default ({ - data = [], - +const PieCharts = ({ style, + color, }: { - data?: any[]; style?: React.CSSProperties; + color?: string[] }) => { - const ref = useRef(null); - const option = { - tooltip: { - trigger: 'item', - }, - color:['#ffb15c','#789efe','#fee98d'], - grid: { + + const ref = useRef(null) + + const option = useMemo(() => { + return { + tooltip: { + trigger: 'item', + }, + color: color ?? ['#E16598','#AF6CF1','#67C1E2', '#EDA368'], + grid: { x: 0, y: 5, x2: 0, y2: 10, }, - series: [ - { - name: 'Access From', - type: 'pie', - radius: ['40%', '70%'], - avoidLabelOverlap: false, - itemStyle: { - // borderRadius: 10, - borderColor: '#fff', - borderWidth: 2, - }, - label: { - show: false, - position: 'center', + series: [ + { + name: 'Access From', + type: 'pie', + radius: ['40%', '70%'], + avoidLabelOverlap: false, + padAngle: 5, + label: { + show: false, + position: 'center', + }, + labelLine: { + show: false, + }, + data: [ + { value: 1048, name: 'Search Engine' }, + { value: 735, name: 'Direct' }, + { value: 580, name: 'Email' }, + ], }, - // emphasis: { - // label: { - // show: true, - // fontSize: 10, - - // }, - // }, - labelLine: { - show: false, - }, - data: [ - { value: 1048, name: 'Search Engine' }, - { value: 735, name: 'Direct' }, - { value: 580, name: 'Email' }, - - ], - }, - ], - }; + ], + } + }, []) return ( ); }; + +export default PieCharts; + diff --git a/src/components/Tabs/index.less b/src/components/Tabs/index.less new file mode 100644 index 0000000000000000000000000000000000000000..f64070dbb99994e881dda48f5a9488457a86d6c0 --- /dev/null +++ b/src/components/Tabs/index.less @@ -0,0 +1,36 @@ +.tabWrap { + width: fit-content; + height: 40px; + border-radius: 25px; + background: rgb(18, 61, 102); + display: flex; + + > div { + min-width: 44px; + padding: 0 18px; + font-weight: 500; + font-size: 16px; + color: #6194C7; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + white-space: nowrap; + font-family: DingTalk JinBuTi; + > span { + line-height: normal; + + } + } + + .active { + border-radius: 25px; + background: linear-gradient( + 180deg, + rgb(28, 192, 255), + rgb(82, 148, 255) 100% + ) !important; + color: #ffffff; + } +} diff --git a/src/components/Tabs/index.tsx b/src/components/Tabs/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..f86e6cea352d372e277bb3096544b432f8ec64eb --- /dev/null +++ b/src/components/Tabs/index.tsx @@ -0,0 +1,86 @@ +import { useDebounceFn } from 'ahooks'; +import classNames from 'classnames'; +import { useEffect, useRef, useState } from 'react'; +import styles from './index.less'; + +interface TabsProps { + onChange?: (type: string) => void; + items?: TabItem[]; + defaultValue?: string; + style?: React.CSSProperties; //父元素属性 + itemStyle?: React.CSSProperties; //每个item的属性 + itemkey?: string; //指定 key 值 +} +/** + * @description: tabs组件 + */ +export interface TabItem { + label: string | React.ReactNode; + key?: string; + icon?: string; + [key: string]: any; +} +const Tabs = (props: TabsProps) => { + const { onChange, items, defaultValue, style, itemStyle, itemkey } = props; + const [active, setActive] = useState(defaultValue); + const initStatus = useRef(true); + + useEffect(() => { + if (initStatus.current) { + if (items && items.length > 0) { + let type = itemkey ? items[0][itemkey] : items[0].key; + setActive(defaultValue || type); + initStatus.current = false; + } + } + }, [items]); + + const handleChange = async (type: string) => { + onChange && onChange(type); + }; + + //函数防抖 + const { run } = useDebounceFn( + (type: string) => { + handleChange(type); + }, + { + wait: 500, + leading: true, + }, + ); + + return ( +
+ {items?.map((v, index) => ( +
{ + e.stopPropagation(); + let type = itemkey ? v[itemkey] : v.key; + setActive(type); + run(type); + }} + > + {v.icon && ( + + )} + {v.label} +
+ ))} +
+ ); +}; + +export default Tabs; diff --git a/src/pages/Common/Event/CommonList/LineCharts/index.tsx b/src/pages/Common/Event/CommonList/LineCharts/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..d6220b607307eb6073520a95926ac14820445495 --- /dev/null +++ b/src/pages/Common/Event/CommonList/LineCharts/index.tsx @@ -0,0 +1,76 @@ +import { useMemo } from 'react' +import ReactEcharts from 'echarts-for-react'; +const LineCharts = () => { + + const option = useMemo(() => { + const data: any = [100, 50, 60, 70, 50] + const showXAis = true + return { + xAxis: { + type: 'category', + boundaryGap: false, + show: showXAis, + data: showXAis ? ['09:15', '09:15', '09:15', '09:15', '09:15'] : [], + axisLabel: { + color: '#CBEDFF', + interval: 0 // 设置为0以显示所有坐标点 + }, + axisLine: { + show: false, + }, + }, + yAxis: { + type: 'value', + show: false, + }, + grid: { + left: '5%', // 左边距 + right: '5%', // 右边距 + top: '10%', // 上边距 + bottom: '30%' // 下边距 + }, + series: [ + { + data: data, + symbol: "none", + type: 'line', + lineStyle: { + color: "#57EFE5", + }, + + areaStyle: { + // 区域填充样式。设置后显示成区域面积图。 + color: { + type: 'linear', + x: 0, + y: 1, + x2: 0, + y2: 0.2, + colorStops: [ + { + offset: 0, + color: 'rgba(87, 239, 229, 0)', // 0% 处的颜色 + }, + + { + offset: 1, + color: 'rgba(87, 239, 229, 0.36)', // 100% 处的颜色 + }, + ], + global: false, // 缺省为 false + }, + }, + }, + ], + } + }, []) + + return ( + + ) +} + +export default LineCharts \ No newline at end of file diff --git a/src/pages/Common/Event/CommonList/index.less b/src/pages/Common/Event/CommonList/index.less new file mode 100644 index 0000000000000000000000000000000000000000..8e58712af3d63668a1467adc01c1cfdf898a6f6e --- /dev/null +++ b/src/pages/Common/Event/CommonList/index.less @@ -0,0 +1,29 @@ +.wrap { + width: 100%; + .left { + width: 440px; + .top { + font-size: 18px; + color: #fff; + padding: 0 20px 15px 20px; + .num { + background: linear-gradient( + 180deg, + rgb(170, 255, 246), + rgb(37, 187, 255) + ); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + font-family: D-DIN; + font-size: 42px; + font-weight: 700; + line-height: normal; + margin-right: 5px; + } + } + } + .right { + flex: 1; + } +} diff --git a/src/pages/Common/Event/CommonList/index.tsx b/src/pages/Common/Event/CommonList/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..1364357f21e6a2dfb3c735673aeaafef30c56d6a --- /dev/null +++ b/src/pages/Common/Event/CommonList/index.tsx @@ -0,0 +1,167 @@ +import { Flex, Space } from 'antd' +import styles from './index.less' +import ListTabs from '@/pages/Common/components/ListTabs' +import IssueDescription from '@/pages/Common/components/IssueDescription' +import ProcessCard from '@/pages/Common/components/ProcessCard' +import BaseCard from '@/pages/Common/components/BaseCard' +import LineCharts from './LineCharts' +import Tabs from '@/components/Tabs'; + +const CommonList = () => { + + const changeListTab = () => { + + } + + const onChangeCategory = () => { + + } + + const areas = [ + { + name: '高新区', + progress: 50, + value: 300, + rate: 30.6 + }, + { + name: '新都区', + progress: 50, + value: 300, + rate: 30.6 + }, + { + name: '龙泉驿区', + progress: 50, + value: 300, + rate: 30.6 + } + ] + + const category = [ + { + name: '类别一', + progress: 50, + value: 300, + rate: 30.6 + }, + { + name: '类别二', + progress: 50, + value: 300, + rate: 30.6 + }, + { + name: '类别三', + progress: 50, + value: 300, + rate: 30.6 + } + ] + + return ( + + + + + + + + 56 + + + 处置中 + + + + 56 + + + 已办结 + + + + 89.6 + % + + 办结率 + + + + + +
+ +
+
+ + + } + data={category} + strokeColor={{ + '0%': '#38F2E3', + '100%': '#3DC3FF', + }} + /> + + +
+
+ +
+ +
+
+ +
+
+ ) +} + +export default CommonList; \ No newline at end of file diff --git a/src/pages/Common/Event/GeneralSituation/LineCharts/index.tsx b/src/pages/Common/Event/GeneralSituation/LineCharts/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..d6220b607307eb6073520a95926ac14820445495 --- /dev/null +++ b/src/pages/Common/Event/GeneralSituation/LineCharts/index.tsx @@ -0,0 +1,76 @@ +import { useMemo } from 'react' +import ReactEcharts from 'echarts-for-react'; +const LineCharts = () => { + + const option = useMemo(() => { + const data: any = [100, 50, 60, 70, 50] + const showXAis = true + return { + xAxis: { + type: 'category', + boundaryGap: false, + show: showXAis, + data: showXAis ? ['09:15', '09:15', '09:15', '09:15', '09:15'] : [], + axisLabel: { + color: '#CBEDFF', + interval: 0 // 设置为0以显示所有坐标点 + }, + axisLine: { + show: false, + }, + }, + yAxis: { + type: 'value', + show: false, + }, + grid: { + left: '5%', // 左边距 + right: '5%', // 右边距 + top: '10%', // 上边距 + bottom: '30%' // 下边距 + }, + series: [ + { + data: data, + symbol: "none", + type: 'line', + lineStyle: { + color: "#57EFE5", + }, + + areaStyle: { + // 区域填充样式。设置后显示成区域面积图。 + color: { + type: 'linear', + x: 0, + y: 1, + x2: 0, + y2: 0.2, + colorStops: [ + { + offset: 0, + color: 'rgba(87, 239, 229, 0)', // 0% 处的颜色 + }, + + { + offset: 1, + color: 'rgba(87, 239, 229, 0.36)', // 100% 处的颜色 + }, + ], + global: false, // 缺省为 false + }, + }, + }, + ], + } + }, []) + + return ( + + ) +} + +export default LineCharts \ No newline at end of file diff --git a/src/pages/Common/Event/GeneralSituation/index.less b/src/pages/Common/Event/GeneralSituation/index.less new file mode 100644 index 0000000000000000000000000000000000000000..168d2cd8714c0cb2c9cc58fec7831ab674797178 --- /dev/null +++ b/src/pages/Common/Event/GeneralSituation/index.less @@ -0,0 +1,44 @@ +.wrap { + width: 100%; + position: relative; + .left { + width: 440px; + .top { + font-size: 18px; + color: #fff; + padding: 0 20px 15px 20px; + .num { + background: linear-gradient( + 180deg, + rgb(170, 255, 246), + rgb(37, 187, 255) + ); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + font-family: D-DIN; + font-size: 34px; + font-weight: 700; + line-height: normal; + margin:0 5px; + } + } + } + .right { + flex: 1; + } + + .searchBox { + position: absolute; + top: -75px; + left: 300px; + :global { + .ant-select-selector { + background: transparent !important; + border: none !important; + color: #FFFFFF; + font-size: 20px; + } + } + } +} diff --git a/src/pages/Common/Event/GeneralSituation/index.tsx b/src/pages/Common/Event/GeneralSituation/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..95a73c69238109f7fba510f6c20c1e73f8ac1d69 --- /dev/null +++ b/src/pages/Common/Event/GeneralSituation/index.tsx @@ -0,0 +1,196 @@ +import { Flex, Space, Select } from 'antd' +import styles from './index.less' +import ListTabs from '@/pages/Common/components/ListTabs' +import IssueDescription from '@/pages/Common/components/IssueDescription' +import ProcessCard from '@/pages/Common/components/ProcessCard' +import BaseCard from '@/pages/Common/components/BaseCard' +import LineCharts from './LineCharts' +import Tabs from '@/components/Tabs'; +import { CaretDownOutlined } from '@ant-design/icons' + +const GeneralSituation = () => { + + const changeListTab = () => { + + } + + const onChangeCategory = () => { + + } + + const areas = [ + { + name: '高新区', + progress: 50, + value: 300, + rate: 30.6 + }, + { + name: '新都区', + progress: 50, + value: 300, + rate: 30.6 + }, + { + name: '龙泉驿区', + progress: 50, + value: 300, + rate: 30.6 + } + ] + + const category = [ + { + name: '类别一', + progress: 50, + value: 300, + rate: 30.6 + }, + { + name: '类别二', + progress: 50, + value: 300, + rate: 30.6 + }, + { + name: '类别三', + progress: 50, + value: 300, + rate: 30.6 + } + ] + + return ( + + +
+