Compare commits
No commits in common. "main" and "xingyy" have entirely different histories.
3
env/.env.prod
vendored
@ -5,6 +5,3 @@ VITE_DELETE_CONSOLE = true
|
|||||||
# 是否开启sourcemap
|
# 是否开启sourcemap
|
||||||
VITE_SHOW_SOURCEMAP = false
|
VITE_SHOW_SOURCEMAP = false
|
||||||
VITE_BASEURL = '//appointteam.szjixun.cn'
|
VITE_BASEURL = '//appointteam.szjixun.cn'
|
||||||
|
|
||||||
# 文档查看
|
|
||||||
VITE_PAGE_URL="https://www.fiee.com"
|
|
||||||
|
4
env/.env.test
vendored
@ -3,7 +3,3 @@ NODE_ENV = 'test'
|
|||||||
# 是否去除console 和 debugger
|
# 是否去除console 和 debugger
|
||||||
VITE_DELETE_CONSOLE = false
|
VITE_DELETE_CONSOLE = false
|
||||||
VITE_BASEURL = '//kid-art-test.szjixun.cn'
|
VITE_BASEURL = '//kid-art-test.szjixun.cn'
|
||||||
|
|
||||||
# 文档查看
|
|
||||||
VITE_PAGE_URL="http://172.16.100.22:8045"
|
|
||||||
# VITE_PAGE_URL="http://192.168.88.50:5878"
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
google-site-verification: googledeec2461668656b4.html
|
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" type="image/svg+xml" href="/src/assets/image/icon.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
<title>FiEE</title>
|
<title>FiEE</title>
|
||||||
</head>
|
</head>
|
||||||
|
15822
package-lock.json
generated
@ -12,14 +12,11 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fingerprintjs/fingerprintjs": "^4.4.3",
|
"@fingerprintjs/fingerprintjs": "^4.4.3",
|
||||||
"@onlyoffice/document-editor-vue": "^1.5.0",
|
|
||||||
"@unocss/reset": "^0.61.9",
|
"@unocss/reset": "^0.61.9",
|
||||||
"@vicons/ionicons5": "^0.13.0",
|
"@vicons/ionicons5": "^0.13.0",
|
||||||
"@vicons/utils": "^0.1.4",
|
"@vicons/utils": "^0.1.4",
|
||||||
"axios": "^1.7.3",
|
"axios": "^1.7.3",
|
||||||
"cnjm-postcss-px-to-viewport": "^1.0.1",
|
"cnjm-postcss-px-to-viewport": "^1.0.1",
|
||||||
"countup.js": "^2.8.2",
|
|
||||||
"dayjs": "^1.11.13",
|
|
||||||
"echarts": "^5.6.0",
|
"echarts": "^5.6.0",
|
||||||
"gsap": "^3.12.5",
|
"gsap": "^3.12.5",
|
||||||
"jsdom": "^24.0.0",
|
"jsdom": "^24.0.0",
|
||||||
@ -52,7 +49,6 @@
|
|||||||
"unplugin-auto-import": "^0.18.2",
|
"unplugin-auto-import": "^0.18.2",
|
||||||
"unplugin-vue-components": "^0.27.3",
|
"unplugin-vue-components": "^0.27.3",
|
||||||
"vite": "^5.3.4",
|
"vite": "^5.3.4",
|
||||||
"vite-plugin-imagemin": "^0.6.1",
|
"vite-plugin-imagemin": "^0.6.1"
|
||||||
"vite-plugin-vue-devtools": "^7.7.6"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
810
pnpm-lock.yaml
Before Width: | Height: | Size: 63 KiB |
BIN
public/icon.png
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
src/assets/file/2025 Q1 Quarterly Results.pdf
Normal file
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 210 KiB |
BIN
src/assets/images/header/logo.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
@ -1,55 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
import { ref, watch, onMounted } from 'vue'
|
|
||||||
import { CountUp } from 'countup.js'
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
endVal: {
|
|
||||||
type: [Number, String],
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
duration: {
|
|
||||||
type: Number,
|
|
||||||
default: 1.2
|
|
||||||
},
|
|
||||||
decimals: {
|
|
||||||
type: Number,
|
|
||||||
default: 2
|
|
||||||
},
|
|
||||||
prefix: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
suffix: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const el = ref(null)
|
|
||||||
let countUpInstance = null
|
|
||||||
|
|
||||||
const start = (val) => {
|
|
||||||
if (countUpInstance) countUpInstance.update(val)
|
|
||||||
else {
|
|
||||||
countUpInstance = new CountUp(el.value, val, {
|
|
||||||
duration: props.duration,
|
|
||||||
decimalPlaces: props.decimals,
|
|
||||||
prefix: props.prefix,
|
|
||||||
suffix: props.suffix
|
|
||||||
})
|
|
||||||
countUpInstance.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
start(props.endVal)
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(() => props.endVal, (val) => {
|
|
||||||
start(val)
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<span ref="el"></span>
|
|
||||||
</template>
|
|
@ -3,8 +3,6 @@ import { computed } from 'vue'
|
|||||||
import { useWindowSize } from '@vueuse/core'
|
import { useWindowSize } from '@vueuse/core'
|
||||||
|
|
||||||
import size375 from '@/components/customDefaultPage/size375/index.vue'
|
import size375 from '@/components/customDefaultPage/size375/index.vue'
|
||||||
import size768 from '@/components/customDefaultPage/size1920/index.vue'
|
|
||||||
import size1440 from '@/components/customDefaultPage/size1920/index.vue'
|
|
||||||
import size1920 from '@/components/customDefaultPage/size1920/index.vue'
|
import size1920 from '@/components/customDefaultPage/size1920/index.vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
@ -17,22 +15,20 @@ const viewComponent = computed(() => {
|
|||||||
const viewWidth = width.value
|
const viewWidth = width.value
|
||||||
if (viewWidth <= 450) {
|
if (viewWidth <= 450) {
|
||||||
return size375
|
return size375
|
||||||
} else if (viewWidth <= 1100) {
|
}
|
||||||
return size768
|
// else if (viewWidth <= 1100) {
|
||||||
} else if (viewWidth <= 1500) {
|
// return size768;
|
||||||
return size1440
|
// } else if (viewWidth <= 1500) {
|
||||||
} else if (viewWidth <= 1920 || viewWidth > 1920) {
|
// return size1440;
|
||||||
|
// }
|
||||||
|
else if (viewWidth <= 1920 || viewWidth > 1920) {
|
||||||
return size1920
|
return size1920
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<component :is="viewComponent" v-bind="$attrs">
|
<component :is="viewComponent" />
|
||||||
<template v-for="(_, slot) in $slots" #[slot]="scope">
|
|
||||||
<slot :name="slot" v-bind="scope" />
|
|
||||||
</template>
|
|
||||||
</component>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
|
@ -1,27 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 通用缺省页 -->
|
<!-- 通用缺省页 -->
|
||||||
<div class="custom-default-page">
|
<div class="custom-default-page">
|
||||||
<slot name="content"></slot>
|
<div class="search-area">
|
||||||
<template v-if="$slots.empty">
|
<customSelectSearch></customSelectSearch>
|
||||||
<slot name="empty"></slot>
|
</div>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div class="default-empty-icon">
|
|
||||||
<img
|
|
||||||
src="@/assets/image/icon/default-empty.png"
|
|
||||||
alt="empty"
|
|
||||||
style="width: 476px; height: 262px;"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
<script setup>
|
||||||
</template>
|
import customSelectSearch from '@/components/customSelectSearch/index.vue'
|
||||||
<script setup></script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.default-empty-icon {
|
.search-area {
|
||||||
display: flex;
|
width: 300px;
|
||||||
justify-content: center;
|
margin: 100px 300px;
|
||||||
align-items: center;
|
|
||||||
margin: 40px 0 24px 0;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,27 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 通用缺省页 -->
|
<!-- 通用缺省页 -->
|
||||||
<div class="custom-default-page">
|
<div class="custom-default-page">
|
||||||
<slot name="content"></slot>
|
<div class="search-area">
|
||||||
<template v-if="$slots.empty">
|
<customSelectSearch></customSelectSearch>
|
||||||
<slot name="empty"></slot>
|
</div>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div class="default-empty-icon">
|
|
||||||
<img
|
|
||||||
src="@/assets/image/icon/default-empty.png"
|
|
||||||
alt="empty"
|
|
||||||
style="width: 350px; height: 198px; margin: 40px 0 0;"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
<script setup>
|
||||||
</template>
|
import customSelectSearch from '@/components/customSelectSearch/index.vue'
|
||||||
<script setup></script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.default-empty-icon {
|
.search-area {
|
||||||
display: flex;
|
width: 1500px;
|
||||||
justify-content: center;
|
margin: 500px 200px;
|
||||||
align-items: center;
|
|
||||||
margin: 40px 0 24px 0;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,34 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
import { computed } from 'vue'
|
|
||||||
import { useWindowSize } from '@vueuse/core'
|
|
||||||
|
|
||||||
import size375 from '@/components/customEcharts/size375/index.vue'
|
|
||||||
import size768 from '@/components/customEcharts/size375/index.vue'
|
|
||||||
import size1440 from '@/components/customEcharts/size1920/index.vue'
|
|
||||||
import size1920 from '@/components/customEcharts/size1920/index.vue'
|
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
import { useI18n } from 'vue-i18n'
|
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
const { width } = useWindowSize()
|
|
||||||
const { t } = useI18n()
|
|
||||||
|
|
||||||
const viewComponent = computed(() => {
|
|
||||||
const viewWidth = width.value
|
|
||||||
if (viewWidth <= 500) {
|
|
||||||
return size375
|
|
||||||
} else if (viewWidth <= 960) {
|
|
||||||
return size768
|
|
||||||
} else if (viewWidth <= 1500) {
|
|
||||||
return size1440
|
|
||||||
} else if (viewWidth <= 1920 || viewWidth > 1920) {
|
|
||||||
return size1920
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<component :is="viewComponent" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
|
@ -1,602 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="custom-echarts">
|
|
||||||
<div>
|
|
||||||
<div class="echarts-header">
|
|
||||||
<div class="echarts-header-title">
|
|
||||||
<span>FiEE, Inc. Stock Price History</span>
|
|
||||||
</div>
|
|
||||||
<div class="echarts-search-area">
|
|
||||||
<div class="echarts-search-byRange">
|
|
||||||
<text style="font-size: 0.9rem; font-weight: 400; color: #666666;">
|
|
||||||
Range
|
|
||||||
</text>
|
|
||||||
<div class="search-range-list">
|
|
||||||
<div
|
|
||||||
class="search-range-list-each"
|
|
||||||
v-for="(item, index) in state.searchRange"
|
|
||||||
:key="index"
|
|
||||||
@click="changeSearchRange(item)"
|
|
||||||
>
|
|
||||||
<span>{{ item }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="echarts-search-byDate">
|
|
||||||
<n-date-picker
|
|
||||||
v-model:value="state.selectHistoricStartDate"
|
|
||||||
type="date"
|
|
||||||
:is-date-disabled="disableAfterDate"
|
|
||||||
@update:value="changeSearchRangeStartDate"
|
|
||||||
input-readonly
|
|
||||||
/>
|
|
||||||
<!-- <n-icon size="16">
|
|
||||||
<ArrowForwardOutline />
|
|
||||||
</n-icon> -->
|
|
||||||
<span>to</span>
|
|
||||||
<n-date-picker
|
|
||||||
v-model:value="state.selectHistoricEndDate"
|
|
||||||
type="date"
|
|
||||||
:is-date-disabled="disablePreviousDate"
|
|
||||||
@update:value="changeSearchRangeEndDate"
|
|
||||||
input-readonly
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="myEcharts" class="myChart"></div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import { onMounted, watch, reactive } from 'vue'
|
|
||||||
import * as echarts from 'echarts'
|
|
||||||
import markPointerIcon from '@/assets/image/icon/echarts_markPointer.png'
|
|
||||||
import axios from 'axios'
|
|
||||||
import { NDatePicker, NIcon } from 'naive-ui'
|
|
||||||
import { ArrowForwardOutline } from '@vicons/ionicons5'
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
searchRange: ['1m', '3m', 'YTD', '1Y', '5Y', '10Y', 'Max'],
|
|
||||||
selectHistoricStartDate: '2009-10-07',
|
|
||||||
selectHistoricEndDate: new Date(),
|
|
||||||
})
|
|
||||||
|
|
||||||
let myCharts = null
|
|
||||||
let historicData = []
|
|
||||||
let xAxisData = []
|
|
||||||
|
|
||||||
//初始化eCharts
|
|
||||||
const initEcharts = (data) => {
|
|
||||||
historicData = data
|
|
||||||
xAxisData = data.map((item) => {
|
|
||||||
return new Date(item.date).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
})
|
|
||||||
const yAxisData = data.map((item) => item.price)
|
|
||||||
// console.error(xAxisData, yAxisData)
|
|
||||||
// 基于准备好的dom,初始化echarts实例
|
|
||||||
myCharts = echarts.init(document.getElementById('myEcharts'), null, {
|
|
||||||
renderer: 'canvas',
|
|
||||||
useDirtyRect: true
|
|
||||||
})
|
|
||||||
// 绘制图表
|
|
||||||
myCharts.setOption({
|
|
||||||
animation: false,
|
|
||||||
progressive: 500,
|
|
||||||
progressiveThreshold: 3000,
|
|
||||||
// title: {
|
|
||||||
// text: 'FiEE, Inc. Stock Price History',
|
|
||||||
// },
|
|
||||||
grid: {
|
|
||||||
left: '8%', // 或 '2%',根据实际情况调整
|
|
||||||
right: '12%', // 给右侧y轴留空间,数值可根据y轴label宽度调整
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: {
|
|
||||||
type: 'line',
|
|
||||||
label: {
|
|
||||||
backgroundColor: '#6a7985',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
formatter: function (params) {
|
|
||||||
const p = params[0]
|
|
||||||
return `<span style="font-size: 1.1rem; font-weight: 600;">${p.axisValue}</span><br/><span style="font-size: 0.9rem; font-weight: 400;">Price: ${p.data}</span>`
|
|
||||||
},
|
|
||||||
triggerOn: 'mousemove',
|
|
||||||
confine: true,
|
|
||||||
hideDelay: 1500
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
data: xAxisData,
|
|
||||||
type: 'category',
|
|
||||||
boundaryGap: false,
|
|
||||||
inverse: true,
|
|
||||||
axisLine: {
|
|
||||||
lineStyle: {
|
|
||||||
color: '#CCD6EB',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
color: '#323232',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
interval: 'auto',
|
|
||||||
hideOverlap: true
|
|
||||||
},
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'value',
|
|
||||||
position: 'right',
|
|
||||||
interval: 25,
|
|
||||||
// max: 75.0,
|
|
||||||
show: true,
|
|
||||||
axisLabel: {
|
|
||||||
color: '#323232',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
formatter: function (value) {
|
|
||||||
return value > 0 ? value.toFixed(2) : value
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
data: yAxisData,
|
|
||||||
type: 'line',
|
|
||||||
sampling: 'lttb',
|
|
||||||
symbol: 'none',
|
|
||||||
lineStyle: {
|
|
||||||
color: '#2c6288',
|
|
||||||
},
|
|
||||||
areaStyle: {
|
|
||||||
color: {
|
|
||||||
type: 'linear',
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
x2: 0,
|
|
||||||
y2: 1,
|
|
||||||
colorStops: [
|
|
||||||
{
|
|
||||||
offset: 0,
|
|
||||||
color: '#2c6288',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
offset: 1,
|
|
||||||
color: '#F4F6F8',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
markPoint: {
|
|
||||||
symbol: 'image://' + markPointerIcon,
|
|
||||||
symbolSize: 24,
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
progressive: 500,
|
|
||||||
progressiveThreshold: 3000,
|
|
||||||
large: true,
|
|
||||||
largeThreshold: 2000
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
dataZoom: [
|
|
||||||
{
|
|
||||||
type: 'inside',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'slider',
|
|
||||||
show: true,
|
|
||||||
dataBackground: {
|
|
||||||
lineStyle: {
|
|
||||||
color: '#2C6288',
|
|
||||||
},
|
|
||||||
areaStyle: {
|
|
||||||
color: {
|
|
||||||
type: 'linear',
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
x2: 0,
|
|
||||||
y2: 1,
|
|
||||||
colorStops: [
|
|
||||||
{ offset: 1, color: '#2c6288' },
|
|
||||||
{ offset: 0, color: '#F4F6F8' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
selectedDataBackground: {
|
|
||||||
lineStyle: {
|
|
||||||
color: '#2C6288',
|
|
||||||
},
|
|
||||||
areaStyle: {
|
|
||||||
color: {
|
|
||||||
type: 'linear',
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
x2: 0,
|
|
||||||
y2: 1,
|
|
||||||
colorStops: [
|
|
||||||
{ offset: 1, color: '#2c6288' },
|
|
||||||
{ offset: 0, color: '#F4F6F8' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
fillerColor: 'rgba(44, 98, 136, 0.3)',
|
|
||||||
realtime: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
// 监听 showTip 事件,动态显示 markPoint
|
|
||||||
myCharts.on('showTip', function (params) {
|
|
||||||
if (params) {
|
|
||||||
const dataIndex = params.dataIndex
|
|
||||||
const x = myCharts.getOption().xAxis[0].data[dataIndex]
|
|
||||||
const y = myCharts.getOption().series[0].data[dataIndex]
|
|
||||||
myCharts.setOption({
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
markPoint: {
|
|
||||||
symbol: 'image://' + markPointerIcon,
|
|
||||||
symbolSize: 24,
|
|
||||||
data: [{ coord: [x, y] }],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 鼠标移出时,清除 markPoint
|
|
||||||
myCharts.on('globalout', function () {
|
|
||||||
myCharts.setOption({
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
markPoint: {
|
|
||||||
symbol: 'image://' + markPointerIcon,
|
|
||||||
symbolSize: 24,
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
})
|
|
||||||
myCharts.on('dataZoom', function (params) {
|
|
||||||
// 获取当前 dataZoom 范围
|
|
||||||
const option = myCharts.getOption()
|
|
||||||
const xAxisData = option.xAxis[0].data
|
|
||||||
const dataZoom = option.dataZoom[1] || option.dataZoom[0]
|
|
||||||
|
|
||||||
// 获取 dataZoom 的 startValue 和 endValue
|
|
||||||
let startValue = dataZoom.endValue
|
|
||||||
let endValue = dataZoom.startValue
|
|
||||||
|
|
||||||
// 如果是索引,转为日期
|
|
||||||
if (typeof startValue === 'number') {
|
|
||||||
startValue = xAxisData[startValue]
|
|
||||||
}
|
|
||||||
if (typeof endValue === 'number') {
|
|
||||||
endValue = xAxisData[endValue]
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新日期选择器
|
|
||||||
state.selectHistoricStartDate = new Date(startValue)
|
|
||||||
state.selectHistoricEndDate = new Date(endValue)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getHistoricalData()
|
|
||||||
})
|
|
||||||
|
|
||||||
//获取历史数据
|
|
||||||
const getHistoricalData = async () => {
|
|
||||||
let now = new Date()
|
|
||||||
let toDate =
|
|
||||||
now.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
String(now.getMonth() + 1).padStart(2, '0') +
|
|
||||||
'-' +
|
|
||||||
String(now.getDate()).padStart(2, '0')
|
|
||||||
let url =
|
|
||||||
'https://common.szjixun.cn/api/stock/history/base/list?from=2009-10-07&to=' +
|
|
||||||
toDate
|
|
||||||
const res = await axios.get(url)
|
|
||||||
if (res.status === 200) {
|
|
||||||
if (res.data.status === 0) {
|
|
||||||
initEcharts(res.data.data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 适配倒序数据,返回大于等于目标日期的最近一天索引
|
|
||||||
function findClosestDateIndex(data, targetDateStr) {
|
|
||||||
let left = 0,
|
|
||||||
right = data.length - 1
|
|
||||||
const target = new Date(targetDateStr).getTime()
|
|
||||||
let res = data.length - 1 // 默认返回最后一个
|
|
||||||
while (left <= right) {
|
|
||||||
const mid = Math.floor((left + right) / 2)
|
|
||||||
const midTime = new Date(data[mid].date).getTime()
|
|
||||||
if (midTime > target) {
|
|
||||||
left = mid + 1
|
|
||||||
} else {
|
|
||||||
res = mid
|
|
||||||
right = mid - 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
// 适配倒序数据,返回小于等于目标日期的最近一天索引
|
|
||||||
function findClosestDateIndexDescLeft(data, targetDateStr) {
|
|
||||||
let left = 0,
|
|
||||||
right = data.length - 1
|
|
||||||
const target = new Date(targetDateStr).getTime()
|
|
||||||
let res = -1
|
|
||||||
while (left <= right) {
|
|
||||||
const mid = Math.floor((left + right) / 2)
|
|
||||||
const midTime = new Date(data[mid].date).getTime()
|
|
||||||
if (midTime > target) {
|
|
||||||
left = mid + 1 // mid 比目标新,往更旧的方向找
|
|
||||||
} else {
|
|
||||||
res = mid // mid <= target,记录下来,继续往更新的方向找
|
|
||||||
right = mid - 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
//点击切换搜索区间
|
|
||||||
const changeSearchRange = (range, dateTime) => {
|
|
||||||
const now = new Date()
|
|
||||||
let startDate = ''
|
|
||||||
let endDate = ''
|
|
||||||
if (range === '1m') {
|
|
||||||
const last = new Date(now)
|
|
||||||
last.setMonth(now.getMonth() - 1)
|
|
||||||
startDate = last.toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === '3m') {
|
|
||||||
const last = new Date(now)
|
|
||||||
last.setMonth(now.getMonth() - 3)
|
|
||||||
startDate = last.toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === 'YTD') {
|
|
||||||
startDate = new Date(now.getFullYear(), 0, 1).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === '1Y') {
|
|
||||||
const last = new Date(now)
|
|
||||||
last.setFullYear(now.getFullYear() - 1)
|
|
||||||
startDate = last.toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === '5Y') {
|
|
||||||
const last = new Date(now)
|
|
||||||
last.setFullYear(now.getFullYear() - 5)
|
|
||||||
startDate = last.toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === '10Y') {
|
|
||||||
const last = new Date(now)
|
|
||||||
last.setFullYear(now.getFullYear() - 10)
|
|
||||||
startDate = last.toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === 'Max') {
|
|
||||||
startDate = ''
|
|
||||||
endDate = ''
|
|
||||||
} else if (range === 'startDateTime') {
|
|
||||||
startDate = dateTime
|
|
||||||
endDate = ''
|
|
||||||
} else if (range === 'endDateTime') {
|
|
||||||
startDate = ''
|
|
||||||
endDate = dateTime
|
|
||||||
}
|
|
||||||
if (startDate || endDate) {
|
|
||||||
// historicData 和 xAxisData 需在 initEcharts 作用域可用
|
|
||||||
if (
|
|
||||||
typeof historicData !== 'undefined' &&
|
|
||||||
typeof xAxisData !== 'undefined'
|
|
||||||
) {
|
|
||||||
let startValue = xAxisData[0]
|
|
||||||
if (startDate) {
|
|
||||||
const idx = findClosestDateIndex(historicData, startDate)
|
|
||||||
// 用 historicData[idx].date 格式化为 xAxisData 的格式
|
|
||||||
startValue = new Date(historicData[idx].date).toLocaleDateString(
|
|
||||||
'en-US',
|
|
||||||
{
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
let endValue = endDate
|
|
||||||
if (endDate) {
|
|
||||||
// console.warn(endDate)
|
|
||||||
const idx = findClosestDateIndexDescLeft(historicData, endDate)
|
|
||||||
// console.warn(idx)
|
|
||||||
// 用 historicData[idx].date 格式化为 xAxisData 的格式
|
|
||||||
endValue = new Date(historicData[idx].date).toLocaleDateString(
|
|
||||||
'en-US',
|
|
||||||
{
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
},
|
|
||||||
)
|
|
||||||
// console.warn(endValue)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (startDate) {
|
|
||||||
myCharts.setOption({
|
|
||||||
dataZoom: {
|
|
||||||
endValue: startValue,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
state.selectHistoricStartDate = new Date(startValue)
|
|
||||||
}
|
|
||||||
if (endDate) {
|
|
||||||
myCharts.setOption({
|
|
||||||
dataZoom: {
|
|
||||||
startValue: endValue,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
state.selectHistoricEndDate = new Date(endValue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
myCharts.setOption({
|
|
||||||
dataZoom: {
|
|
||||||
startValue: '',
|
|
||||||
endValue: '',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
state.selectHistoricStartDate = new Date('2009-10-07')
|
|
||||||
state.selectHistoricEndDate = new Date()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 禁用2009-10-07之后的日期
|
|
||||||
const disableAfterDate = (date) => {
|
|
||||||
return date < new Date('2009-10-06') || date > new Date()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 禁用过去的日期
|
|
||||||
const disablePreviousDate = (date) => {
|
|
||||||
return date < new Date(state.selectHistoricStartDate) || date > new Date()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 切换搜索区间开始日期
|
|
||||||
const changeSearchRangeStartDate = (date) => {
|
|
||||||
// console.error(date)
|
|
||||||
changeSearchRange(
|
|
||||||
'startDateTime',
|
|
||||||
new Date(date).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 切换搜索区间结束日期
|
|
||||||
const changeSearchRangeEndDate = (date) => {
|
|
||||||
// console.error(date)
|
|
||||||
changeSearchRange(
|
|
||||||
'endDateTime',
|
|
||||||
new Date(date).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.custom-echarts {
|
|
||||||
.myChart {
|
|
||||||
width: 100%;
|
|
||||||
height: 25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.echarts-header {
|
|
||||||
.echarts-header-title {
|
|
||||||
span {
|
|
||||||
font-size: 2rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #323232;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.echarts-search-area {
|
|
||||||
padding: 2rem 0 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.echarts-search-byRange {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
gap: 10px;
|
|
||||||
.search-range-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
gap: 10px;
|
|
||||||
.search-range-list-each {
|
|
||||||
padding: 5px 10px;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: #f3f4f6;
|
|
||||||
cursor: pointer;
|
|
||||||
span {
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.echarts-search-byDate {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
gap: 0.4rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,604 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="custom-echarts">
|
|
||||||
<div>
|
|
||||||
<div class="echarts-header">
|
|
||||||
<div class="echarts-header-title">
|
|
||||||
<span>FiEE, Inc. Stock Price History</span>
|
|
||||||
</div>
|
|
||||||
<div class="echarts-search-area">
|
|
||||||
<div class="echarts-search-byRange">
|
|
||||||
<text style="font-size: 0.9rem; font-weight: 400; color: #666666;">
|
|
||||||
Range
|
|
||||||
</text>
|
|
||||||
<div class="search-range-list">
|
|
||||||
<div
|
|
||||||
class="search-range-list-each"
|
|
||||||
v-for="(item, index) in state.searchRange"
|
|
||||||
:key="index"
|
|
||||||
@click="changeSearchRange(item)"
|
|
||||||
>
|
|
||||||
<span>{{ item }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="echarts-search-byDate">
|
|
||||||
<n-date-picker
|
|
||||||
v-model:value="state.selectHistoricStartDate"
|
|
||||||
type="date"
|
|
||||||
:is-date-disabled="disableAfterDate"
|
|
||||||
@update:value="changeSearchRangeStartDate"
|
|
||||||
input-readonly
|
|
||||||
/>
|
|
||||||
<!-- <n-icon size="30">
|
|
||||||
<ArrowForwardOutline />
|
|
||||||
</n-icon> -->
|
|
||||||
<span>to</span>
|
|
||||||
<n-date-picker
|
|
||||||
v-model:value="state.selectHistoricEndDate"
|
|
||||||
type="date"
|
|
||||||
:is-date-disabled="disablePreviousDate"
|
|
||||||
@update:value="changeSearchRangeEndDate"
|
|
||||||
input-readonly
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="myEcharts" class="myChart"></div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import { onMounted, watch, reactive } from 'vue'
|
|
||||||
import * as echarts from 'echarts'
|
|
||||||
import markPointerIcon from '@/assets/image/icon/echarts_markPointer.png'
|
|
||||||
import axios from 'axios'
|
|
||||||
import { NDatePicker } from 'naive-ui'
|
|
||||||
import { ArrowForwardOutline } from '@vicons/ionicons5'
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
searchRange: ['1m', '3m', 'YTD', '1Y', '5Y', '10Y', 'Max'],
|
|
||||||
selectHistoricStartDate: '2009-10-07',
|
|
||||||
selectHistoricEndDate: new Date(),
|
|
||||||
})
|
|
||||||
|
|
||||||
let myCharts = null
|
|
||||||
let historicData = []
|
|
||||||
let xAxisData = []
|
|
||||||
|
|
||||||
//初始化eCharts
|
|
||||||
const initEcharts = (data) => {
|
|
||||||
historicData = data
|
|
||||||
xAxisData = data.map((item) => {
|
|
||||||
return new Date(item.date).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
})
|
|
||||||
const yAxisData = data.map((item) => item.price)
|
|
||||||
// console.error(xAxisData, yAxisData)
|
|
||||||
// 基于准备好的dom,初始化echarts实例
|
|
||||||
myCharts = echarts.init(document.getElementById('myEcharts'))
|
|
||||||
// 绘制图表
|
|
||||||
myCharts.setOption({
|
|
||||||
animation: false,
|
|
||||||
progressive: 500,
|
|
||||||
progressiveThreshold: 3000,
|
|
||||||
// title: {
|
|
||||||
// text: 'FiEE, Inc. Stock Price History',
|
|
||||||
// },
|
|
||||||
grid: {
|
|
||||||
left: '8%', // 或 '2%',根据实际情况调整
|
|
||||||
right: '15%', // 给右侧y轴留空间,数值可根据y轴label宽度调整
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: {
|
|
||||||
type: 'line',
|
|
||||||
snap: true,
|
|
||||||
label: {
|
|
||||||
backgroundColor: '#6a7985',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
formatter: function (params) {
|
|
||||||
const p = params[0]
|
|
||||||
return `<span style="font-size: 1.1rem; font-weight: 600;">${p.axisValue}</span><br/><span style="font-size: 0.9rem; font-weight: 400;">Price: ${p.data}</span>`
|
|
||||||
},
|
|
||||||
confine: true,
|
|
||||||
hideDelay: 1500
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
data: xAxisData,
|
|
||||||
type: 'category',
|
|
||||||
boundaryGap: false,
|
|
||||||
inverse: true,
|
|
||||||
axisLine: {
|
|
||||||
lineStyle: {
|
|
||||||
color: '#CCD6EB',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
color: '#323232',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
// formatter: function (value) {
|
|
||||||
// return value ? value.split('-')[0] : ''
|
|
||||||
// },
|
|
||||||
// interval: function (index, value) {
|
|
||||||
// if (index === 0) return true;
|
|
||||||
// const axisData = this && this.axis && this.axis.data ? this.axis.data : [];
|
|
||||||
// if (!axisData[index - 1]) return true;
|
|
||||||
// return value.split('-')[0] !== axisData[index - 1].split('-')[0];
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'value',
|
|
||||||
position: 'right',
|
|
||||||
interval: 25,
|
|
||||||
// max: 75.0,
|
|
||||||
show: true,
|
|
||||||
axisLabel: {
|
|
||||||
color: '#323232',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
formatter: function (value) {
|
|
||||||
return value > 0 ? value.toFixed(2) : value
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
data: yAxisData,
|
|
||||||
type: 'line',
|
|
||||||
sampling: 'lttb',
|
|
||||||
symbol: 'none',
|
|
||||||
lineStyle: {
|
|
||||||
color: '#2c6288',
|
|
||||||
},
|
|
||||||
areaStyle: {
|
|
||||||
color: {
|
|
||||||
type: 'linear',
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
x2: 0,
|
|
||||||
y2: 1,
|
|
||||||
colorStops: [
|
|
||||||
{
|
|
||||||
offset: 0,
|
|
||||||
color: '#2c6288',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
offset: 1,
|
|
||||||
color: '#F4F6F8',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
markPoint: {
|
|
||||||
symbol: 'image://' + markPointerIcon,
|
|
||||||
symbolSize: 24,
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
dataZoom: [
|
|
||||||
{
|
|
||||||
type: 'inside',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'slider',
|
|
||||||
show: true,
|
|
||||||
dataBackground: {
|
|
||||||
lineStyle: {
|
|
||||||
color: '#2C6288',
|
|
||||||
},
|
|
||||||
areaStyle: {
|
|
||||||
color: {
|
|
||||||
type: 'linear',
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
x2: 0,
|
|
||||||
y2: 1,
|
|
||||||
colorStops: [
|
|
||||||
{ offset: 1, color: '#2c6288' },
|
|
||||||
{ offset: 0, color: '#F4F6F8' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
selectedDataBackground: {
|
|
||||||
lineStyle: {
|
|
||||||
color: '#2C6288',
|
|
||||||
},
|
|
||||||
areaStyle: {
|
|
||||||
color: {
|
|
||||||
type: 'linear',
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
x2: 0,
|
|
||||||
y2: 1,
|
|
||||||
colorStops: [
|
|
||||||
{ offset: 1, color: '#2c6288' },
|
|
||||||
{ offset: 0, color: '#F4F6F8' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
fillerColor: 'rgba(44, 98, 136, 0.3)',
|
|
||||||
realtime: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
// 监听 showTip 事件,动态显示 markPoint
|
|
||||||
myCharts.on('showTip', function (params) {
|
|
||||||
if (params) {
|
|
||||||
const dataIndex = params.dataIndex
|
|
||||||
const x = myCharts.getOption().xAxis[0].data[dataIndex]
|
|
||||||
const y = myCharts.getOption().series[0].data[dataIndex]
|
|
||||||
myCharts.setOption({
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
markPoint: {
|
|
||||||
symbol: 'image://' + markPointerIcon,
|
|
||||||
symbolSize: 24,
|
|
||||||
data: [{ coord: [x, y] }],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 鼠标移出时,清除 markPoint
|
|
||||||
myCharts.on('globalout', function () {
|
|
||||||
myCharts.setOption({
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
markPoint: {
|
|
||||||
symbol: 'image://' + markPointerIcon,
|
|
||||||
symbolSize: 24,
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
myCharts.on('dataZoom', function (params) {
|
|
||||||
// 获取当前 dataZoom 范围
|
|
||||||
const option = myCharts.getOption()
|
|
||||||
const xAxisData = option.xAxis[0].data
|
|
||||||
const dataZoom = option.dataZoom[1] || option.dataZoom[0]
|
|
||||||
|
|
||||||
// 获取 dataZoom 的 startValue 和 endValue
|
|
||||||
let startValue = dataZoom.endValue
|
|
||||||
let endValue = dataZoom.startValue
|
|
||||||
|
|
||||||
// 如果是索引,转为日期
|
|
||||||
if (typeof startValue === 'number') {
|
|
||||||
startValue = xAxisData[startValue]
|
|
||||||
}
|
|
||||||
if (typeof endValue === 'number') {
|
|
||||||
endValue = xAxisData[endValue]
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新日期选择器
|
|
||||||
state.selectHistoricStartDate = new Date(startValue)
|
|
||||||
state.selectHistoricEndDate = new Date(endValue)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getHistoricalData()
|
|
||||||
})
|
|
||||||
|
|
||||||
//获取历史数据
|
|
||||||
const getHistoricalData = async () => {
|
|
||||||
let now = new Date()
|
|
||||||
let toDate =
|
|
||||||
now.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
String(now.getMonth() + 1).padStart(2, '0') +
|
|
||||||
'-' +
|
|
||||||
String(now.getDate()).padStart(2, '0')
|
|
||||||
let url =
|
|
||||||
'https://common.szjixun.cn/api/stock/history/base/list?from=2009-10-07&to=' +
|
|
||||||
toDate
|
|
||||||
const res = await axios.get(url)
|
|
||||||
if (res.status === 200) {
|
|
||||||
if (res.data.status === 0) {
|
|
||||||
initEcharts(res.data.data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 适配倒序数据,返回大于等于目标日期的最近一天索引
|
|
||||||
function findClosestDateIndex(data, targetDateStr) {
|
|
||||||
let left = 0,
|
|
||||||
right = data.length - 1
|
|
||||||
const target = new Date(targetDateStr).getTime()
|
|
||||||
let res = data.length - 1 // 默认返回最后一个
|
|
||||||
while (left <= right) {
|
|
||||||
const mid = Math.floor((left + right) / 2)
|
|
||||||
const midTime = new Date(data[mid].date).getTime()
|
|
||||||
if (midTime > target) {
|
|
||||||
left = mid + 1
|
|
||||||
} else {
|
|
||||||
res = mid
|
|
||||||
right = mid - 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
// 适配倒序数据,返回小于等于目标日期的最近一天索引
|
|
||||||
function findClosestDateIndexDescLeft(data, targetDateStr) {
|
|
||||||
let left = 0,
|
|
||||||
right = data.length - 1
|
|
||||||
const target = new Date(targetDateStr).getTime()
|
|
||||||
let res = -1
|
|
||||||
while (left <= right) {
|
|
||||||
const mid = Math.floor((left + right) / 2)
|
|
||||||
const midTime = new Date(data[mid].date).getTime()
|
|
||||||
if (midTime > target) {
|
|
||||||
left = mid + 1 // mid 比目标新,往更旧的方向找
|
|
||||||
} else {
|
|
||||||
res = mid // mid <= target,记录下来,继续往更新的方向找
|
|
||||||
right = mid - 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
//点击切换搜索区间
|
|
||||||
const changeSearchRange = (range, dateTime) => {
|
|
||||||
const now = new Date()
|
|
||||||
let startDate = ''
|
|
||||||
let endDate = ''
|
|
||||||
if (range === '1m') {
|
|
||||||
const last = new Date(now)
|
|
||||||
last.setMonth(now.getMonth() - 1)
|
|
||||||
startDate = last.toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === '3m') {
|
|
||||||
const last = new Date(now)
|
|
||||||
last.setMonth(now.getMonth() - 3)
|
|
||||||
startDate = last.toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === 'YTD') {
|
|
||||||
startDate = new Date(now.getFullYear(), 0, 1).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === '1Y') {
|
|
||||||
const last = new Date(now)
|
|
||||||
last.setFullYear(now.getFullYear() - 1)
|
|
||||||
startDate = last.toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === '5Y') {
|
|
||||||
const last = new Date(now)
|
|
||||||
last.setFullYear(now.getFullYear() - 5)
|
|
||||||
startDate = last.toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === '10Y') {
|
|
||||||
const last = new Date(now)
|
|
||||||
last.setFullYear(now.getFullYear() - 10)
|
|
||||||
startDate = last.toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
endDate = new Date(new Date()).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
})
|
|
||||||
} else if (range === 'Max') {
|
|
||||||
startDate = ''
|
|
||||||
endDate = ''
|
|
||||||
} else if (range === 'startDateTime') {
|
|
||||||
startDate = dateTime
|
|
||||||
endDate = ''
|
|
||||||
} else if (range === 'endDateTime') {
|
|
||||||
startDate = ''
|
|
||||||
endDate = dateTime
|
|
||||||
}
|
|
||||||
if (startDate || endDate) {
|
|
||||||
// historicData 和 xAxisData 需在 initEcharts 作用域可用
|
|
||||||
if (
|
|
||||||
typeof historicData !== 'undefined' &&
|
|
||||||
typeof xAxisData !== 'undefined'
|
|
||||||
) {
|
|
||||||
let startValue = xAxisData[0]
|
|
||||||
if (startDate) {
|
|
||||||
const idx = findClosestDateIndex(historicData, startDate)
|
|
||||||
// 用 historicData[idx].date 格式化为 xAxisData 的格式
|
|
||||||
startValue = new Date(historicData[idx].date).toLocaleDateString(
|
|
||||||
'en-US',
|
|
||||||
{
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
let endValue = endDate
|
|
||||||
if (endDate) {
|
|
||||||
// console.warn(endDate)
|
|
||||||
const idx = findClosestDateIndexDescLeft(historicData, endDate)
|
|
||||||
// console.warn(idx)
|
|
||||||
// 用 historicData[idx].date 格式化为 xAxisData 的格式
|
|
||||||
endValue = new Date(historicData[idx].date).toLocaleDateString(
|
|
||||||
'en-US',
|
|
||||||
{
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
},
|
|
||||||
)
|
|
||||||
// console.warn(endValue)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (startDate) {
|
|
||||||
myCharts.setOption({
|
|
||||||
dataZoom: {
|
|
||||||
endValue: startValue,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
state.selectHistoricStartDate = new Date(startValue)
|
|
||||||
}
|
|
||||||
if (endDate) {
|
|
||||||
myCharts.setOption({
|
|
||||||
dataZoom: {
|
|
||||||
startValue: endValue,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
state.selectHistoricEndDate = new Date(endValue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
myCharts.setOption({
|
|
||||||
dataZoom: {
|
|
||||||
startValue: '',
|
|
||||||
endValue: '',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
state.selectHistoricStartDate = new Date('2009-10-07')
|
|
||||||
state.selectHistoricEndDate = new Date()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 禁用2009-10-07之后的日期
|
|
||||||
const disableAfterDate = (date) => {
|
|
||||||
return date < new Date('2009-10-06') || date > new Date()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 禁用过去的日期
|
|
||||||
const disablePreviousDate = (date) => {
|
|
||||||
return date < new Date(state.selectHistoricStartDate) || date > new Date()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 切换搜索区间开始日期
|
|
||||||
const changeSearchRangeStartDate = (date) => {
|
|
||||||
// console.error(date)
|
|
||||||
changeSearchRange(
|
|
||||||
'startDateTime',
|
|
||||||
new Date(date).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 切换搜索区间结束日期
|
|
||||||
const changeSearchRangeEndDate = (date) => {
|
|
||||||
// console.error(date)
|
|
||||||
changeSearchRange(
|
|
||||||
'endDateTime',
|
|
||||||
new Date(date).toLocaleDateString('en-US', {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.custom-echarts {
|
|
||||||
.myChart {
|
|
||||||
width: 100%;
|
|
||||||
height: 25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.echarts-header {
|
|
||||||
.echarts-header-title {
|
|
||||||
span {
|
|
||||||
font-size: 2rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #323232;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.echarts-search-area {
|
|
||||||
padding: 2rem 0 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.echarts-search-byRange {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
gap: 0.7rem;
|
|
||||||
.search-range-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
gap: 0.7rem;
|
|
||||||
.search-range-list-each {
|
|
||||||
padding: 0.2rem 0.3rem;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: #f3f4f6;
|
|
||||||
cursor: pointer;
|
|
||||||
span {
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.echarts-search-byDate {
|
|
||||||
padding: 1.5rem 0 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
gap: 0.4rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -3,8 +3,6 @@ import { computed } from 'vue'
|
|||||||
import { useWindowSize } from '@vueuse/core'
|
import { useWindowSize } from '@vueuse/core'
|
||||||
|
|
||||||
import size375 from '@/components/customFooter/size375/index.vue'
|
import size375 from '@/components/customFooter/size375/index.vue'
|
||||||
import size768 from '@/components/customFooter/size768/index.vue'
|
|
||||||
import size1440 from '@/components/customFooter/size1920/index.vue'
|
|
||||||
import size1920 from '@/components/customFooter/size1920/index.vue'
|
import size1920 from '@/components/customFooter/size1920/index.vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
@ -15,13 +13,15 @@ const { t } = useI18n()
|
|||||||
|
|
||||||
const viewComponent = computed(() => {
|
const viewComponent = computed(() => {
|
||||||
const viewWidth = width.value
|
const viewWidth = width.value
|
||||||
if (viewWidth <= 500) {
|
if (viewWidth <= 450) {
|
||||||
return size375
|
return size375
|
||||||
} else if (viewWidth <= 1100) {
|
}
|
||||||
return size768
|
// else if (viewWidth <= 1100) {
|
||||||
} else if (viewWidth <= 1500) {
|
// return size768;
|
||||||
return size1440
|
// } else if (viewWidth <= 1500) {
|
||||||
} else if (viewWidth <= 1920 || viewWidth > 1920) {
|
// return size1440;
|
||||||
|
// }
|
||||||
|
else if (viewWidth <= 1920 || viewWidth > 1920) {
|
||||||
return size1920
|
return size1920
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1,69 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 通用页脚 -->
|
<!-- 通用页脚 -->
|
||||||
<div class="custom-footer">
|
<div class="custom-footer">
|
||||||
<div class="custom-footer-box">
|
<span>Copyright © 2024-2027 FiEE</span>
|
||||||
<span>© 2025 FiEE, Inc. All Rights Reserved.</span>
|
|
||||||
<div class="footer-links">
|
|
||||||
<span @click="handleLink('privacyPolicy')">Privacy Policy</span>
|
|
||||||
<span @click="handleLink('termsOfUse')">Terms of use</span>
|
|
||||||
<span @click="handleLink('siteMap')">Site Map</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup></script>
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
const router = useRouter();
|
|
||||||
import privacyPolicy from "@/assets/file/footer/FiEE, Inc. _ Privacy policy.pdf";
|
|
||||||
import termsOfUse from "@/assets/file/footer/FiEE, Inc. _ Terms of Use.pdf";
|
|
||||||
import siteMap from "@/assets/file/footer/FiEE, Inc. _ Site Map.pdf";
|
|
||||||
|
|
||||||
//点击跳转到对应的链接页面
|
|
||||||
const handleLink = (link) => {
|
|
||||||
// if (link === "privacyPolicy") {
|
|
||||||
// window.open(privacyPolicy, "_blank");
|
|
||||||
// } else if (link === "termsOfUse") {
|
|
||||||
// window.open(termsOfUse, "_blank");
|
|
||||||
// } else if (link === "siteMap") {
|
|
||||||
// window.open(siteMap, "_blank");
|
|
||||||
// }
|
|
||||||
router.push(link)
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.custom-footer {
|
.custom-footer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #f7f8fa;
|
|
||||||
border-top: 1px solid #ececec;
|
|
||||||
z-index: 100;
|
|
||||||
|
|
||||||
.custom-footer-box {
|
|
||||||
max-width: 1700px;
|
|
||||||
margin: 0 auto;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
color: #888;
|
|
||||||
// font-size: 15px;
|
|
||||||
font-size: 1.05rem;
|
|
||||||
padding: 1rem 40px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
padding: 24px 0;
|
||||||
|
color: #888;
|
||||||
.footer-links {
|
font-size: 15px;
|
||||||
margin: 0.4rem 0 0;
|
background: #f7f8fa;
|
||||||
span {
|
letter-spacing: 1px;
|
||||||
border-right: 1px solid #d2d2d7;
|
border-top: 1px solid #ececec;
|
||||||
padding: 0 10px;
|
position: fixed;
|
||||||
cursor: pointer;
|
left: 0;
|
||||||
}
|
bottom: 0;
|
||||||
span:nth-last-child(1) {
|
z-index: 100;
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,70 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 通用页脚 -->
|
<!-- 通用页脚 -->
|
||||||
<div class="custom-footer">
|
<div class="custom-footer">
|
||||||
<span>© 2025 FiEE, Inc. All Rights Reserved.</span>
|
<span>Copyright © 2024-2027 FiEE</span>
|
||||||
<div class="footer-links-box">
|
|
||||||
<div class="footer-links">
|
|
||||||
<span @click="handleLink('privacyPolicy')">Privacy Policy</span>
|
|
||||||
<span @click="handleLink('termsOfUse')">Terms of use</span>
|
|
||||||
<span @click="handleLink('siteMap')">Site Map</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup></script>
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
import privacyPolicy from "@/assets/file/footer/FiEE, Inc. _ Privacy policy.pdf";
|
|
||||||
import termsOfUse from "@/assets/file/footer/FiEE, Inc. _ Terms of Use.pdf";
|
|
||||||
import siteMap from "@/assets/file/footer/FiEE, Inc. _ Site Map.pdf";
|
|
||||||
|
|
||||||
//点击跳转到对应的链接页面
|
|
||||||
const handleLink = (link) => {
|
|
||||||
// if (link === "privacyPolicy") {
|
|
||||||
// window.open(privacyPolicy, "_blank");
|
|
||||||
// } else if (link === "termsOfUse") {
|
|
||||||
// window.open(termsOfUse, "_blank");
|
|
||||||
// } else if (link === "siteMap") {
|
|
||||||
// window.open(siteMap, "_blank");
|
|
||||||
// }
|
|
||||||
router.push(link)
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.custom-footer {
|
.custom-footer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 1rem 0;
|
padding: 120px 0;
|
||||||
color: #888;
|
color: #888;
|
||||||
font-size: 0.9rem;
|
font-size: 75px;
|
||||||
background: #f7f8fa;
|
background: #f7f8fa;
|
||||||
letter-spacing: 5px;
|
letter-spacing: 5px;
|
||||||
border-top: 5px solid #ececec;
|
border-top: 5px solid #ececec;
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
|
|
||||||
.footer-links-box {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin: 0.6rem 0 0;
|
|
||||||
|
|
||||||
.footer-links {
|
|
||||||
span {
|
|
||||||
border-right: 1px solid #d2d2d7;
|
|
||||||
padding: 0 0.8rem;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 0.75rem;
|
|
||||||
display: inline-block;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
span:nth-last-child(1) {
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,59 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 通用页脚 -->
|
|
||||||
<div class="custom-footer">
|
|
||||||
<span>© 2025 FiEE, Inc. All Rights Reserved.</span>
|
|
||||||
<div class="footer-links">
|
|
||||||
<span @click="handleLink('privacyPolicy')">Privacy Policy</span>
|
|
||||||
<span @click="handleLink('termsOfUse')">Terms of use</span>
|
|
||||||
<span @click="handleLink('siteMap')">Site Map</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
const router = useRouter();
|
|
||||||
import privacyPolicy from "@/assets/file/footer/FiEE, Inc. _ Privacy policy.pdf";
|
|
||||||
import termsOfUse from "@/assets/file/footer/FiEE, Inc. _ Terms of Use.pdf";
|
|
||||||
import siteMap from "@/assets/file/footer/FiEE, Inc. _ Site Map.pdf";
|
|
||||||
|
|
||||||
//点击跳转到对应的链接页面
|
|
||||||
const handleLink = (link) => {
|
|
||||||
// if (link === "privacyPolicy") {
|
|
||||||
// window.open(privacyPolicy, "_blank");
|
|
||||||
// } else if (link === "termsOfUse") {
|
|
||||||
// window.open(termsOfUse, "_blank");
|
|
||||||
// } else if (link === "siteMap") {
|
|
||||||
// window.open(siteMap, "_blank");
|
|
||||||
// }
|
|
||||||
router.push(link)
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.custom-footer {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
padding: 24px 0;
|
|
||||||
color: #888;
|
|
||||||
// font-size: 15px;
|
|
||||||
font-size: 1.05rem;
|
|
||||||
background: #f7f8fa;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
border-top: 1px solid #ececec;
|
|
||||||
z-index: 100;
|
|
||||||
padding: 1rem 0;
|
|
||||||
|
|
||||||
.footer-links {
|
|
||||||
margin: 0.4rem 0 0;
|
|
||||||
span {
|
|
||||||
border-right: 1px solid #d2d2d7;
|
|
||||||
padding: 0 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
span:nth-last-child(1) {
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -3,8 +3,6 @@ import { computed } from 'vue'
|
|||||||
import { useWindowSize } from '@vueuse/core'
|
import { useWindowSize } from '@vueuse/core'
|
||||||
|
|
||||||
import size375 from '@/components/customHeader/size375/index.vue'
|
import size375 from '@/components/customHeader/size375/index.vue'
|
||||||
import size768 from '@/components/customHeader/size375/index.vue'
|
|
||||||
import size1440 from '@/components/customHeader/size1440/index.vue'
|
|
||||||
import size1920 from '@/components/customHeader/size1920/index.vue'
|
import size1920 from '@/components/customHeader/size1920/index.vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
@ -17,11 +15,13 @@ const viewComponent = computed(() => {
|
|||||||
const viewWidth = width.value
|
const viewWidth = width.value
|
||||||
if (viewWidth <= 450) {
|
if (viewWidth <= 450) {
|
||||||
return size375
|
return size375
|
||||||
} else if (viewWidth <= 835) {
|
}
|
||||||
return size768
|
// else if (viewWidth <= 1100) {
|
||||||
} else if (viewWidth <= 1640) {
|
// return size768;
|
||||||
return size1440
|
// } else if (viewWidth <= 1500) {
|
||||||
} else if (viewWidth <= 1920 || viewWidth > 1920) {
|
// return size1440;
|
||||||
|
// }
|
||||||
|
else if (viewWidth <= 1920 || viewWidth > 1920) {
|
||||||
return size1920
|
return size1920
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1,230 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 通用页头 -->
|
|
||||||
<NLayoutHeader
|
|
||||||
class="custom-header"
|
|
||||||
:class="{ 'header-scrolled': isScrolled }"
|
|
||||||
>
|
|
||||||
<div class="header-container">
|
|
||||||
<div class="logo" @click="handleToHome">
|
|
||||||
<NImage width="80" height="80" :src="FiEELogo" preview-disabled />
|
|
||||||
</div>
|
|
||||||
<div class="header-menu">
|
|
||||||
<NMenu
|
|
||||||
mode="horizontal"
|
|
||||||
:options="menuOptions"
|
|
||||||
:inverted="isScrolled"
|
|
||||||
v-model:value="selectedKey"
|
|
||||||
@update:value="handleMenuSelect"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</NLayoutHeader>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import FiEELogo from "@/assets/image/header/logo.png";
|
|
||||||
import { ref, onMounted, onUnmounted } from "vue";
|
|
||||||
import { NMenu, NLayoutHeader, NImage } from "naive-ui";
|
|
||||||
import { useI18n } from "vue-i18n";
|
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
import { useHeaderMenuConfig } from "@/config/headerMenuConfig";
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
// 使用统一的菜单配置
|
|
||||||
const menuOptions = useHeaderMenuConfig();
|
|
||||||
const selectedKey = ref(null);
|
|
||||||
|
|
||||||
const isScrolled = ref(false);
|
|
||||||
|
|
||||||
// 递归查找菜单项
|
|
||||||
function findMenuOptionByKey(options, key) {
|
|
||||||
for (const option of options) {
|
|
||||||
if (option.key === key) return option;
|
|
||||||
if (option.children) {
|
|
||||||
const found = findMenuOptionByKey(option.children, key);
|
|
||||||
if (found) return found;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 菜单点击跳转
|
|
||||||
const handleMenuSelect = (key) => {
|
|
||||||
const option = findMenuOptionByKey(menuOptions, key);
|
|
||||||
if (option && option.href) {
|
|
||||||
router.push(option.href);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 监听滚动事件
|
|
||||||
const handleScroll = () => {
|
|
||||||
//滚动距离大于100px时,处理对应的header样式
|
|
||||||
isScrolled.value = window.scrollY >= 100;
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
window.addEventListener("scroll", handleScroll);
|
|
||||||
});
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
window.removeEventListener("scroll", handleScroll);
|
|
||||||
});
|
|
||||||
|
|
||||||
//点击回到首页
|
|
||||||
const handleToHome = () => {
|
|
||||||
router.push("/myhome");
|
|
||||||
selectedKey.value = null; // 重置菜单选中状态
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.custom-header {
|
|
||||||
--header-height: 5rem;
|
|
||||||
--primary-color: #8b59f7;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
background: transparent;
|
|
||||||
height: var(--header-height);
|
|
||||||
|
|
||||||
&.header-scrolled {
|
|
||||||
background: rgba(220, 207, 248, 0.95);
|
|
||||||
backdrop-filter: blur(8px);
|
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-container {
|
|
||||||
max-width: 1700px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 0 40px;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
flex-shrink: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: transform 0.3s ease;
|
|
||||||
margin-left: 100px;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
transform: scale(1.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
transform: scale(0.98);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-menu {
|
|
||||||
display: block;
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
:deep(.n-menu) {
|
|
||||||
background: transparent;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.n-menu-item) {
|
|
||||||
position: relative;
|
|
||||||
margin: 0 10px;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
font-weight: 700;
|
|
||||||
// font-size: 16px;
|
|
||||||
font-size: 0.875rem;
|
|
||||||
min-width: 120px;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 50%;
|
|
||||||
width: 0;
|
|
||||||
height: 2px;
|
|
||||||
background: var(--primary-color);
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
opacity: 0;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
&::after {
|
|
||||||
width: 80px;
|
|
||||||
height: 3px;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 选中状态的样式
|
|
||||||
&.n-menu-item--selected {
|
|
||||||
&::after {
|
|
||||||
width: 40px;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 子菜单样式
|
|
||||||
:deep(.n-submenu) {
|
|
||||||
.n-submenu-children {
|
|
||||||
backdrop-filter: blur(16px);
|
|
||||||
background: rgba(255, 255, 255, 0.9);
|
|
||||||
border-radius: 12px;
|
|
||||||
padding: 8px 0;
|
|
||||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
||||||
transform-origin: top;
|
|
||||||
animation: dropDown 0.3s ease;
|
|
||||||
|
|
||||||
.n-menu-item {
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: var(--primary-color);
|
|
||||||
transform: translateX(-100%);
|
|
||||||
transition: transform 0.3s ease;
|
|
||||||
opacity: 0.1;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
&::before {
|
|
||||||
transform: translateX(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes dropDown {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(-10px) scale(0.95);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0) scale(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style>
|
|
||||||
.header-menu .n-menu .n-menu-item-content .n-menu-item-content-header {
|
|
||||||
word-break: break-word;
|
|
||||||
white-space: unset !important;
|
|
||||||
}
|
|
||||||
.header-menu .n-menu .n-submenu .n-menu-item-content {
|
|
||||||
padding: 0 8px !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -6,7 +6,7 @@
|
|||||||
>
|
>
|
||||||
<div class="header-container">
|
<div class="header-container">
|
||||||
<div class="logo" @click="handleToHome">
|
<div class="logo" @click="handleToHome">
|
||||||
<NImage width="80" height="80" :src="FiEELogo" preview-disabled />
|
<NImage width="160" height="50" :src="FiEELogo" preview-disabled />
|
||||||
</div>
|
</div>
|
||||||
<div class="header-menu">
|
<div class="header-menu">
|
||||||
<NMenu
|
<NMenu
|
||||||
@ -22,21 +22,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import FiEELogo from "@/assets/image/header/logo.png";
|
import FiEELogo from '@/assets/image/header/logo.png'
|
||||||
import { ref, onMounted, onUnmounted } from "vue";
|
import { ref, onMounted, onUnmounted } from 'vue'
|
||||||
import { NMenu, NLayoutHeader, NImage } from "naive-ui";
|
import { NMenu, NLayoutHeader, NImage } from 'naive-ui'
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from 'vue-i18n'
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from 'vue-router'
|
||||||
import { useHeaderMenuConfig } from "@/config/headerMenuConfig";
|
import { useHeaderMenuConfig } from '@/config/headerMenuConfig'
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n()
|
||||||
const router = useRouter();
|
const router = useRouter()
|
||||||
|
|
||||||
// 使用统一的菜单配置
|
// 使用统一的菜单配置
|
||||||
const menuOptions = useHeaderMenuConfig();
|
const menuOptions = useHeaderMenuConfig()
|
||||||
const selectedKey = ref(null);
|
const selectedKey = ref(null)
|
||||||
|
|
||||||
const isScrolled = ref(false);
|
const isScrolled = ref(false)
|
||||||
|
|
||||||
// 递归查找菜单项
|
// 递归查找菜单项
|
||||||
function findMenuOptionByKey(options, key) {
|
function findMenuOptionByKey(options, key) {
|
||||||
@ -69,26 +69,31 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
window.removeEventListener("scroll", handleScroll);
|
window.removeEventListener('scroll', handleScroll)
|
||||||
});
|
})
|
||||||
|
|
||||||
//点击回到首页
|
//点击回到首页
|
||||||
const handleToHome = () => {
|
const handleToHome = () => {
|
||||||
router.push("/myhome");
|
router.push('/')
|
||||||
selectedKey.value = null; // 重置菜单选中状态
|
selectedKey.value = null // 重置菜单选中状态
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.custom-header {
|
.custom-header {
|
||||||
--header-height: 5rem;
|
--header-height: 80px;
|
||||||
--primary-color: #8b59f7;
|
--primary-color: #8B59F7;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1000;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
height: var(--header-height);
|
height: var(--header-height);
|
||||||
|
|
||||||
&.header-scrolled {
|
&.header-scrolled {
|
||||||
background: rgba(220, 207, 248, 0.95);
|
background: rgba(255, 255, 255, 0.95);
|
||||||
backdrop-filter: blur(8px);
|
backdrop-filter: blur(8px);
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
@ -108,7 +113,7 @@ const handleToHome = () => {
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: transform 0.3s ease;
|
transition: transform 0.3s ease;
|
||||||
margin-left: 100px;
|
margin-right: 100px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
transform: scale(1.05);
|
transform: scale(1.05);
|
||||||
@ -133,13 +138,12 @@ const handleToHome = () => {
|
|||||||
margin: 0 20px;
|
margin: 0 20px;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
// font-size: 16px;
|
font-size: 16px;
|
||||||
font-size: 1.05rem;
|
|
||||||
min-width: 120px;
|
min-width: 120px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: "";
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@ -185,7 +189,7 @@ const handleToHome = () => {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: "";
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|