create-young-proj 1.7.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. package/CHANGELOG.md +95 -1
  2. package/README.md +6 -1
  3. package/dist/index.mjs +19 -19
  4. package/package.json +1 -1
  5. package/src/index.ts +6 -1
  6. package/template-admin-server/src/service/role.service.ts +5 -3
  7. package/template-big-screen/.editorconfig +14 -0
  8. package/template-big-screen/.nvmrc +1 -0
  9. package/template-big-screen/.vscode/extensions.json +12 -0
  10. package/template-big-screen/.vscode/settings.json +39 -0
  11. package/template-big-screen/Dockerfile +49 -0
  12. package/template-big-screen/README.md +20 -0
  13. package/template-big-screen/_gitignore +23 -0
  14. package/template-big-screen/_npmrc +2 -0
  15. package/template-big-screen/_nvmrc +1 -0
  16. package/template-big-screen/boot.mjs +16 -0
  17. package/template-big-screen/config/.devrc +1 -0
  18. package/template-big-screen/config/.onlinerc +1 -0
  19. package/template-big-screen/config/.testrc +1 -0
  20. package/template-big-screen/eslint.config.js +34 -0
  21. package/template-big-screen/index.html +48 -0
  22. package/template-big-screen/nitro.config.ts +23 -0
  23. package/template-big-screen/package.json +66 -0
  24. package/template-big-screen/plugins/init.ts +57 -0
  25. package/template-big-screen/public/favicon.svg +3 -0
  26. package/template-big-screen/routes/api/[...all].ts +19 -0
  27. package/template-big-screen/routes/get/env.ts +13 -0
  28. package/template-big-screen/src/App.vue +24 -0
  29. package/template-big-screen/src/apis/get.ts +77 -0
  30. package/template-big-screen/src/apis/index.ts +53 -0
  31. package/template-big-screen/src/apis/post.ts +14 -0
  32. package/template-big-screen/src/assets/data/china.json +1 -0
  33. package/template-big-screen/src/components/YoungCountUp.vue +29 -0
  34. package/template-big-screen/src/components/YoungECharts/config.ts +56 -0
  35. package/template-big-screen/src/components/YoungECharts/index.vue +111 -0
  36. package/template-big-screen/src/components/YoungHeader.vue +54 -0
  37. package/template-big-screen/src/components/YoungSectionContainer.vue +55 -0
  38. package/template-big-screen/src/components/YoungSectionHeader.vue +23 -0
  39. package/template-big-screen/src/composables/breakPoint.ts +20 -0
  40. package/template-big-screen/src/composables/dark.ts +52 -0
  41. package/template-big-screen/src/composables/echarts.ts +17 -0
  42. package/template-big-screen/src/composables/loadData.ts +38 -0
  43. package/template-big-screen/src/directives/ellipsis.ts +20 -0
  44. package/template-big-screen/src/directives/index.ts +13 -0
  45. package/template-big-screen/src/enums/breakpointEnum.ts +9 -0
  46. package/template-big-screen/src/layouts/404.vue +19 -0
  47. package/template-big-screen/src/layouts/blank.vue +9 -0
  48. package/template-big-screen/src/layouts/default.vue +17 -0
  49. package/template-big-screen/src/main.ts +59 -0
  50. package/template-big-screen/src/modules/index.ts +8 -0
  51. package/template-big-screen/src/modules/pinia.ts +11 -0
  52. package/template-big-screen/src/modules/router.ts +28 -0
  53. package/template-big-screen/src/pages/[...all].vue +16 -0
  54. package/template-big-screen/src/pages/electricity/build.vue +135 -0
  55. package/template-big-screen/src/pages/electricity/reliability.vue +137 -0
  56. package/template-big-screen/src/pages/electricity/sale-and-cost.vue +158 -0
  57. package/template-big-screen/src/pages/index.vue +59 -0
  58. package/template-big-screen/src/pages/kpi.vue +129 -0
  59. package/template-big-screen/src/pages/manage-improve.vue +114 -0
  60. package/template-big-screen/src/pages/social/condition.vue +202 -0
  61. package/template-big-screen/src/pages/social/electricity-usage.vue +140 -0
  62. package/template-big-screen/src/styles/index.scss +82 -0
  63. package/template-big-screen/tsconfig.json +38 -0
  64. package/template-big-screen/types/auto-imports.d.ts +949 -0
  65. package/template-big-screen/types/components.d.ts +19 -0
  66. package/template-big-screen/types/echarts.d.ts +36 -0
  67. package/template-big-screen/types/index.d.ts +45 -0
  68. package/template-big-screen/types/type.d.ts +38 -0
  69. package/template-big-screen/uno.config.ts +68 -0
  70. package/template-big-screen/vite.config.ts +131 -0
  71. package/template-big-screen/yarn.lock +7443 -0
  72. package/template-nuxt-admin/README.md +3 -3
  73. package/template-nuxt-admin/boot.mjs +4 -1
  74. package/template-nuxt-admin/composables/config.ts +2 -2
  75. package/template-nuxt-admin/config/.devrc +1 -1
  76. package/template-nuxt-admin/config/.onlinerc +1 -1
  77. package/template-nuxt-admin/config/.testrc +1 -1
  78. package/template-nuxt-admin/nuxt.config.ts +14 -5
  79. package/template-nuxt-admin/package.json +12 -11
  80. package/template-nuxt-admin/pages/system/api.vue +6 -6
  81. package/template-nuxt-admin/pages/system/role.vue +4 -4
  82. package/template-nuxt-admin/pages/system/user.vue +4 -4
  83. package/template-nuxt-admin/server/api/[...all].ts +10 -3
  84. package/template-nuxt-admin/server/plugins/env.ts +5 -4
  85. package/template-nuxt-admin/uno.config.ts +1 -9
  86. package/template-nuxt-admin/yarn.lock +3659 -3363
  87. package/template-nuxt-mobile/package.json +1 -0
  88. package/template-nuxt-mobile/server/utils/proxy.ts +1 -30
  89. package/template-nuxt-mobile/yarn.lock +9 -0
  90. package/template-nuxt-website/package.json +1 -0
  91. package/template-nuxt-website/server/utils/proxy.ts +1 -30
  92. package/template-nuxt-website/yarn.lock +9 -0
  93. package/template-nuxt-admin/server/utils/index.ts +0 -36
@@ -0,0 +1,54 @@
1
+ <!--
2
+ * @Author: zhangyang
3
+ * @Date: 2024-02-02 14:28:02
4
+ * @LastEditTime: 2024-05-30 18:49:53
5
+ * @Description:
6
+ -->
7
+ <script setup lang='ts'>
8
+ const formatted = useDateFormat(useNow(), 'YYYY-MM-DD HH:mm:ss')
9
+ const { toggle, isFullscreen } = useFullscreen()
10
+
11
+ const colorBtnTitle = computed(() => {
12
+ return isDark.value ? '切换成浅色主题' : '切换成深色主题'
13
+ })
14
+
15
+ const fullScreenTitle = computed(() => {
16
+ return isFullscreen.value ? '退出全屏' : '全屏'
17
+ })
18
+ </script>
19
+
20
+ <template>
21
+ <div class="between">
22
+ <div class="center-y">
23
+ <div :class="{ 'logo-light': !isDark, 'logo-night': isDark }" class="h-120px bg-no-repeat" />
24
+ <div class="ml-4 flex-col justify-between">
25
+ <div class="font-mono text-2xl font-bold tracking-1">
26
+ XXXXXXXX
27
+ </div>
28
+ <div class="relative top-2 font-extralight tracking-widest italic underline decoration-[#ddd] underline-offset-8">
29
+ XXXX可视化分析平台
30
+ </div>
31
+ </div>
32
+ </div>
33
+ <div class="center-y">
34
+ <div class="w-80 center text-2xl font-bold tracking-0.5">
35
+ {{ formatted }}
36
+ </div>
37
+ <div class="w-14 center" :title="colorBtnTitle">
38
+ <div class="i-carbon-light dark:i-carbon-moon icon-btn" @click="toggleDark" />
39
+ </div>
40
+ <div class="w-14 center" :title="fullScreenTitle">
41
+ <div class="i-carbon-ica-2d icon-btn" @click="toggle" />
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </template>
46
+
47
+ <style scoped lang="scss">
48
+ .logo-light{
49
+ background-position: 0 -140px;
50
+ }
51
+ .logo-night{
52
+ background-position: 0 0;
53
+ }
54
+ </style>
@@ -0,0 +1,55 @@
1
+ <!--
2
+ * @Author: zhangyang
3
+ * @Date: 2024-02-02 11:43:48
4
+ * @LastEditTime: 2024-02-02 11:44:33
5
+ * @Description:
6
+ -->
7
+ <script setup lang='ts'>
8
+ withDefaults(defineProps<{
9
+ right?: boolean
10
+ }>(), {
11
+ right: false,
12
+ })
13
+ </script>
14
+
15
+ <template>
16
+ <div :class="[!right ? 'contanier-border-left' : 'contanier-border-right']">
17
+ <div />
18
+ <div />
19
+ <div />
20
+ <slot />
21
+ </div>
22
+ </template>
23
+
24
+ <style scoped lang="scss">
25
+ .contanier-border-left{
26
+ --uno:relative px-2 py-2 text-sm w-50% border-1 border-solid border-[#457482] rounded-br-6;
27
+
28
+ > div:nth-child(1){
29
+ --uno:h-1.5 w-1.5 bg-[#ffda67] absolute top-0 left-0 ;
30
+ }
31
+
32
+ > div:nth-child(2){
33
+ --uno:h-1.5 w-1.5 bg-[#ffda67] absolute top-0 right-0 ;
34
+ }
35
+
36
+ > div:nth-child(3){
37
+ --uno:h-1.5 w-1.5 bg-[#ffda67] absolute bottom-0 left-0 ;
38
+ }
39
+ }
40
+ .contanier-border-right{
41
+ --uno:relative px-2 py-2 text-sm w-50% border-1 border-solid border-[#457482] rounded-bl-6;
42
+
43
+ > div:nth-child(1){
44
+ --uno:h-1.5 w-1.5 bg-[#ffda67] absolute top-0 left-0 ;
45
+ }
46
+
47
+ > div:nth-child(2){
48
+ --uno:h-1.5 w-1.5 bg-[#ffda67] absolute top-0 right-0 ;
49
+ }
50
+
51
+ > div:nth-child(3){
52
+ --uno:h-1.5 w-1.5 bg-[#ffda67] absolute bottom-0 right-0 ;
53
+ }
54
+ }
55
+ </style>
@@ -0,0 +1,23 @@
1
+ <!--
2
+ * @Author: zhangyang
3
+ * @Date: 2024-02-02 11:36:25
4
+ * @LastEditTime: 2024-02-02 11:41:22
5
+ * @Description:
6
+ -->
7
+ <script setup lang='ts'>
8
+ defineProps<{
9
+ index: string
10
+ title: string
11
+ }>()
12
+ </script>
13
+
14
+ <template>
15
+ <div class="center-y text-white dark:text-[#03dbf6]">
16
+ <div class="h-8 w-8 center bg-[#189692] dark:bg-[#4e6b8d]">
17
+ {{ index }}
18
+ </div>
19
+ <div class="h-8 w-full center-y bg-[#189692] pl-2 opacity-70 dark:bg-[#2a3c55] dark:opacity-100">
20
+ {{ title }}
21
+ </div>
22
+ </div>
23
+ </template>
@@ -0,0 +1,20 @@
1
+ export function useAppBreakpoint() {
2
+ const breakpoints = useBreakpoints(Breakpoint)
3
+ const current = breakpoints.current()
4
+ const xs = breakpoints.smaller('sm')
5
+ const sm = breakpoints.between('sm', 'md')
6
+ const md = breakpoints.between('md', 'lg')
7
+ const lg = breakpoints.between('lg', 'xl')
8
+ const xl = breakpoints.between('xl', '2xl')
9
+ const xxl = breakpoints['2xl']
10
+ return {
11
+ breakpoints,
12
+ current,
13
+ xs,
14
+ sm,
15
+ md,
16
+ lg,
17
+ xl,
18
+ xxl,
19
+ }
20
+ }
@@ -0,0 +1,52 @@
1
+ /*
2
+ * @Author: Leo l024983409@qq.com
3
+ * @Date: 2023-09-19 20:22:55
4
+ * @LastEditors: Leo l024983409@qq.com
5
+ * @LastEditTime: 2023-09-27 11:40:43
6
+ * @Description:
7
+ */
8
+ // these APIs are auto-imported from @vueuse/core
9
+ export const isDark = useDark()
10
+ export const preferredDark = usePreferredDark()
11
+
12
+ // @ts-expect-error: Transition API
13
+ const isAppearanceTransition = document.startViewTransition
14
+ && !window.matchMedia('(prefers-reduced-motion: reduce)').matches
15
+
16
+ export function toggleDark(event?: MouseEvent) {
17
+ if (!isAppearanceTransition || !event) {
18
+ isDark.value = !isDark.value
19
+ return
20
+ }
21
+ const x = event.clientX
22
+ const y = event.clientY
23
+ const endRadius = Math.hypot(
24
+ Math.max(x, innerWidth - x),
25
+ Math.max(y, innerHeight - y),
26
+ )
27
+ // @ts-expect-error: Transition API
28
+ const transition = document.startViewTransition(async () => {
29
+ isDark.value = !isDark.value
30
+ await nextTick()
31
+ })
32
+ transition.ready.then(() => {
33
+ const clipPath = [
34
+ `circle(0px at ${x}px ${y}px)`,
35
+ `circle(${endRadius}px at ${x}px ${y}px)`,
36
+ ]
37
+ document.documentElement.animate(
38
+ {
39
+ clipPath: isDark.value
40
+ ? [...clipPath].reverse()
41
+ : clipPath,
42
+ },
43
+ {
44
+ duration: 400,
45
+ easing: 'ease-in',
46
+ pseudoElement: isDark.value
47
+ ? '::view-transition-old(root)'
48
+ : '::view-transition-new(root)',
49
+ },
50
+ )
51
+ })
52
+ }
@@ -0,0 +1,17 @@
1
+ /*
2
+ * @Author: Leo l024983409@qq.com
3
+ * @Date: 2023-09-24 16:34:11
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-02-02 12:09:50
6
+ * @Description:
7
+ */
8
+ export function useEcharts() {
9
+ const options = ref<EChartsOption>()
10
+ function setOptions(data: EChartsOption) {
11
+ options.value = data
12
+ }
13
+ return {
14
+ options,
15
+ setOptions,
16
+ }
17
+ }
@@ -0,0 +1,38 @@
1
+ /*
2
+ * @Author: Leo l024983409@qq.com
3
+ * @Date: 2023-09-28 10:03:45
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-02-02 15:35:58
6
+ * @Description:
7
+ */
8
+
9
+ type LoadData<T> = () => Promise<T>
10
+ type InitialOptionsWithData<T> = (data: T) => EChartsOption
11
+
12
+ /**
13
+ * 定时刷新数据
14
+ * @param getData 获取数据的Api
15
+ * @param initialOptionsWithData 传入回调函数
16
+ */
17
+ export function useLoadData<T>(getData: LoadData<T>, initialOptionsWithData: InitialOptionsWithData<T>) {
18
+ const { options, setOptions } = useEcharts()
19
+
20
+ const data = ref<T>()
21
+
22
+ loadData()
23
+
24
+ async function loadData() {
25
+ const res = await getData()
26
+ data.value = res
27
+ setOptions(initialOptionsWithData(data.value))
28
+ }
29
+
30
+ useIntervalFn(async () => {
31
+ await loadData()
32
+ }, 5000)
33
+
34
+ return {
35
+ data,
36
+ options,
37
+ }
38
+ }
@@ -0,0 +1,20 @@
1
+ import type { App, Directive } from 'vue'
2
+
3
+ const ellipsisDirective: Directive = {
4
+ updated(el: Element) {
5
+ const ellipsisCcontainer = el.parentElement as HTMLDivElement
6
+ const scrollingText = el as HTMLDivElement
7
+
8
+ ellipsisCcontainer.classList.add('ellipsis-container')
9
+ scrollingText.classList.add('scrolling-text')
10
+
11
+ if (scrollingText.offsetWidth > ellipsisCcontainer.offsetWidth)
12
+ scrollingText.style.animation = 'scrollText 10s linear infinite'
13
+ else
14
+ scrollingText.style.animation = 'none' // 如果文本没有溢出,停止滚动动画
15
+ },
16
+ }
17
+
18
+ export function setupEllipsisDirective(app: App) {
19
+ app.directive('ellipsis', ellipsisDirective)
20
+ }
@@ -0,0 +1,13 @@
1
+ /*
2
+ * @Author: Leo l024983409@qq.com
3
+ * @Date: 2023-09-25 11:17:47
4
+ * @LastEditors: Leo l024983409@qq.com
5
+ * @LastEditTime: 2023-09-25 11:24:39
6
+ * @Description:
7
+ */
8
+ import type { App } from 'vue'
9
+ import { setupEllipsisDirective } from './ellipsis'
10
+
11
+ export function setupDirectives(app: App) {
12
+ setupEllipsisDirective(app)
13
+ }
@@ -0,0 +1,9 @@
1
+ export enum Breakpoint {
2
+ 'xs' = '480px',
3
+ 'sm' = '640px',
4
+ 'md' = '768px',
5
+ 'lg' = '1024px',
6
+ 'xl' = '1280px',
7
+ '2xl' = '1536px',
8
+ '3xl' = '1920px',
9
+ }
@@ -0,0 +1,19 @@
1
+ <!--
2
+ * @Author: zhangyang
3
+ * @Date: 2024-02-02 14:16:12
4
+ * @LastEditTime: 2024-02-02 14:16:12
5
+ * @Description:
6
+ -->
7
+ <template>
8
+ <main p="x4 y10" text="center teal-700 dark:gray-200">
9
+ <div text-4xl>
10
+ <div i-carbon-warning inline-block />
11
+ </div>
12
+ <RouterView />
13
+ <div>
14
+ <button text-sm btn m="3 t8" @click="$router.back()">
15
+ back
16
+ </button>
17
+ </div>
18
+ </main>
19
+ </template>
@@ -0,0 +1,9 @@
1
+ <!--
2
+ * @Author: zhangyang
3
+ * @Date: 2024-02-02 14:16:52
4
+ * @LastEditTime: 2024-02-02 14:16:53
5
+ * @Description:
6
+ -->
7
+ <template>
8
+ <RouterView />
9
+ </template>
@@ -0,0 +1,17 @@
1
+ <!--
2
+ * @Author: zhangyang
3
+ * @Date: 2024-02-02 14:55:35
4
+ * @LastEditTime: 2024-02-02 14:56:49
5
+ * @Description:
6
+ -->
7
+ <template>
8
+ <div>
9
+ <YoungHeader />
10
+ <main px-4 py-10 text="center gray-700 dark:gray-200">
11
+ <RouterView />
12
+ <div mx-auto mt-5 text-center text-sm opacity-50 cursor="pointer" underline @click="$router.back">
13
+ [返回]
14
+ </div>
15
+ </main>
16
+ </div>
17
+ </template>
@@ -0,0 +1,59 @@
1
+ /*
2
+ * @Author: Leo l024983409@qq.com
3
+ * @Date: 2023-09-19 20:22:55
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-02-02 16:20:23
6
+ * @Description:
7
+ */
8
+ import { server } from 'virtual:local-server'
9
+ import appVue from './App.vue'
10
+
11
+ import '@unocss/reset/tailwind.css'
12
+ import './styles/index.scss'
13
+ import 'uno.css'
14
+ import { setupDirectives } from './directives'
15
+ import { setupModules } from './modules'
16
+
17
+ async function getEnv() {
18
+ try {
19
+ const viteEnv: ImportMetaEnv = await (await fetch(`${server}/get/env`)).json()
20
+ console.log('🚀 ~ getEnv ~ viteEnv:', viteEnv)
21
+ return viteEnv
22
+ }
23
+ catch (error) {
24
+ document.write(`服务启动异常:\n${error}`)
25
+ throw error
26
+ }
27
+ }
28
+
29
+ function checkUpadte() {
30
+ const YOUNG_UPDATE_TIMER = setInterval(() => {
31
+ getEnv().then(({ NUXT_PUBLIC_CURRENT_VERSION }) => {
32
+ if (NUXT_PUBLIC_CURRENT_VERSION !== window.__YOUNG_ENV__.NUXT_PUBLIC_CURRENT_VERSION) {
33
+ clearInterval(YOUNG_UPDATE_TIMER)
34
+
35
+ // eslint-disable-next-line no-alert
36
+ alert('检测到新版本,请刷新页面')
37
+ window.location.reload()
38
+ }
39
+ })
40
+ }, 6e4)
41
+ }
42
+
43
+ async function init() {
44
+ const env = await getEnv()
45
+ window.__YOUNG_ENV__ = env
46
+
47
+ checkUpadte()
48
+ }
49
+
50
+ function setup() {
51
+ const app = createApp(appVue)
52
+
53
+ setupDirectives(app)
54
+ setupModules(app)
55
+
56
+ app.mount('#app')
57
+ }
58
+
59
+ init().then(setup)
@@ -0,0 +1,8 @@
1
+ import type { App } from 'vue'
2
+ import pinia from './pinia'
3
+ import router from './router'
4
+
5
+ export function setupModules(app: App) {
6
+ app.use(router)
7
+ app.use(pinia)
8
+ }
@@ -0,0 +1,11 @@
1
+ /*
2
+ * @Author: Leo l024983409@qq.com
3
+ * @Date: 2023-09-19 20:22:55
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-02-02 14:23:35
6
+ * @Description:
7
+ */
8
+ // Setup Pinia
9
+ // https://pinia.vuejs.org/
10
+ const pinia = createPinia()
11
+ export default pinia
@@ -0,0 +1,28 @@
1
+ /*
2
+ * @Author: Leo l024983409@qq.com
3
+ * @Date: 2023-09-19 21:04:34
4
+ * @LastEditors: Leo l024983409@qq.com
5
+ * @LastEditTime: 2023-09-24 11:55:22
6
+ * @Description:
7
+ */
8
+ import NProgress from 'nprogress'
9
+ import { setupLayouts } from 'virtual:generated-layouts'
10
+ import generatedRoutes from 'virtual:generated-pages'
11
+ import { createRouter, createWebHistory } from 'vue-router'
12
+
13
+ const routes = setupLayouts(generatedRoutes)
14
+
15
+ const router = createRouter({
16
+ history: createWebHistory(),
17
+ routes,
18
+ })
19
+
20
+ router.beforeEach((to, from) => {
21
+ if (to.path !== from.path)
22
+ NProgress.start()
23
+ })
24
+ router.afterEach(() => {
25
+ NProgress.done()
26
+ })
27
+
28
+ export default router
@@ -0,0 +1,16 @@
1
+ <!--
2
+ * @Author: zhangyang
3
+ * @Date: 2024-02-01 16:33:23
4
+ * @LastEditTime: 2024-02-02 14:22:23
5
+ * @Description:
6
+ -->
7
+ <route lang="yaml">
8
+ meta:
9
+ layout: 404
10
+ </route>
11
+
12
+ <template>
13
+ <div>
14
+ 页面不存在
15
+ </div>
16
+ </template>
@@ -0,0 +1,135 @@
1
+ <!--
2
+ * @Author: zhangyang
3
+ * @Date: 2024-02-02 14:40:50
4
+ * @LastEditTime: 2024-02-02 14:42:06
5
+ * @Description:
6
+ -->
7
+ <script setup lang='ts'>
8
+ import echarts from '~/components/YoungECharts/config'
9
+
10
+ const { data, options } = useLoadData<IPowerGridConstruction>(apis.get.getPowerGridConstruction, (res) => {
11
+ return {
12
+ grid: {
13
+ left: '10%',
14
+ right: '2%',
15
+ top: '13%',
16
+ bottom: '0%',
17
+ containLabel: true,
18
+ },
19
+ title: {
20
+ text: '固定资产投资完成情况',
21
+ left: 'center',
22
+ top: '0%',
23
+ textStyle: {
24
+ fontSize: '12px',
25
+ width: 250,
26
+ overflow: 'break',
27
+ color: '#aed3dd',
28
+ },
29
+
30
+ },
31
+ xAxis: {
32
+ max(value) {
33
+ return 120
34
+ },
35
+ show: false,
36
+ type: 'value',
37
+ boundaryGap: [0, 0.01],
38
+ axisPointer: {
39
+ show: true,
40
+ },
41
+ },
42
+ yAxis: {
43
+ type: 'category',
44
+ data: ['福建', '浙江', '安徽', '上海', '江苏'],
45
+ inverse: true,
46
+ animationDuration: 300,
47
+ animationDurationUpdate: 300,
48
+ axisTick: {
49
+ show: false,
50
+ },
51
+ axisLine: {
52
+ show: false,
53
+ },
54
+ axisLabel: {
55
+ color: '#92b1bb',
56
+ },
57
+ },
58
+ series: [
59
+ {
60
+ realtimeSort: true,
61
+ type: 'bar',
62
+ data: res.province,
63
+ label: {
64
+ show: true,
65
+ position: 'right',
66
+ valueAnimation: true,
67
+ color: '#92b1bb',
68
+ },
69
+ barWidth: '12px',
70
+ barGap: '100%',
71
+ itemStyle: {
72
+ color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
73
+ {
74
+ offset: 0,
75
+ color: '#409ef7',
76
+ },
77
+ {
78
+ offset: 1,
79
+ color: '#11ccd6',
80
+ },
81
+ ]),
82
+ borderRadius: [0, 9999, 9999, 0],
83
+ },
84
+ },
85
+ ],
86
+ tooltip: {
87
+ show: true,
88
+ },
89
+ legend: {
90
+ show: false,
91
+ },
92
+ animationDuration: 0,
93
+ animationDurationUpdate: 3000,
94
+ animationEasing: 'linear',
95
+ animationEasingUpdate: 'linear',
96
+ }
97
+ })
98
+ </script>
99
+
100
+ <template>
101
+ <div class="h-full flex flex-col">
102
+ <YoungSectionHeader index="2" title="XX建设" />
103
+ <div class="h-full w-full flex flex-1 py-4">
104
+ <YoungSectionContainer v-if="data">
105
+ <div class="h-full w-full center">
106
+ <div class="h-60% w-full between flex-col">
107
+ <div class="w-full between">
108
+ <div>
109
+ <div v-ellipsis>
110
+ 500KV线路长度(公里)
111
+ </div>
112
+ <YoungCountUp :count="data?.values?.[0]" :decimal-places="1" />
113
+ </div>
114
+ <YoungCountUp :count="data?.increment?.[0]" showfix :decimal-places="1" />
115
+ </div>
116
+ <div class="w-full between">
117
+ <div>
118
+ <div v-ellipsis>
119
+ 500KV变电功率(万千伏安)
120
+ </div>
121
+ <YoungCountUp :count="data?.values?.[1]" :decimal-places="1" />
122
+ </div>
123
+ <YoungCountUp :count="data?.increment?.[1]" showfix :decimal-places="1" />
124
+ </div>
125
+ </div>
126
+ </div>
127
+ </YoungSectionContainer>
128
+ <div class="h-full w-50% center">
129
+ <YoungECharts width="250px" height="200px" :options="options" />
130
+ </div>
131
+ </div>
132
+ </div>
133
+ </template>
134
+
135
+ <style scoped lang="scss"></style>