Browse Source

图表文本设置为白色;四维矩阵图样式修改完成;修改四个图表的样式

ds_hxl
宋杰 2 weeks ago
parent
commit
85f3ecaad6
  1. 136
      src/views/AiEmotion.vue
  2. 12
      src/views/components/emoEnergyConverter.vue
  3. 25
      src/views/components/emotionDecod.vue
  4. 20
      src/views/components/emotionalBottomRadar.vue
  5. 32
      src/views/components/marketTemperature.vue

136
src/views/AiEmotion.vue

@ -30,7 +30,7 @@
<!-- 四维矩阵图 -->
<div class="class02">
<div class="container">
<img class="item" :src="item" alt="思维矩阵图片" />
<!-- <img class="item" :src="item" alt="思维矩阵图片" /> -->
<div class="span01">
{{ stockName }}{{ stockName ? '量子四维矩阵图' : '' }}
</div>
@ -206,6 +206,8 @@ const displayedTexts = ref({
disclaimer: ''
});
const typewriterTimers = ref([]);
//
const stockTypewriterShown = ref(new Map());
//
const audioUrl = ref('');
@ -248,10 +250,35 @@ const parsedConclusion = computed(() => {
watch(currentStock, (newStock) => {
if (newStock && newStock.apiData) {
isPageLoaded.value = true;
//
stopAudio();
//
hasTriggeredAudio.value = false;
hasTriggeredTypewriter.value = false;
//
//
const stockCode = newStock.stockInfo?.code || newStock.stockInfo?.symbol;
//
if (stockCode && stockTypewriterShown.value.has(stockCode)) {
//
if (newStock.conclusionData) {
try {
const conclusion = JSON.parse(newStock.conclusionData);
displayedTexts.value = {
one1: conclusion.one1 || '',
one2: conclusion.one2 || '',
two: conclusion.two || '',
three: conclusion.three || '',
four: conclusion.four || '',
disclaimer: '该内容由AI内容生成,请注意甄别'
};
} catch (error) {
console.error('解析结论数据失败:', error);
}
}
} else {
//
displayedTexts.value = {
one1: '',
one2: '',
@ -260,6 +287,8 @@ watch(currentStock, (newStock) => {
four: '',
disclaimer: ''
};
}
nextTick(() => {
renderCharts(newStock.apiData);
});
@ -317,7 +346,7 @@ function startTypewriterEffect(conclusion) {
};
//
const typeSpeed = 300;
const typeSpeed = 250;
let totalDelay = 0;
//
@ -688,36 +717,40 @@ function startAutoScroll() {
}
isAutoScrolling.value = true;
const sections = document.querySelectorAll('.class02, .class03, .class04, .class05, .class06, .class08, .class09');
console.log('开始流畅自动滚动');
let currentIndex = 0;
//
const documentHeight = document.documentElement.scrollHeight;
const windowHeight = window.innerHeight;
const maxScrollTop = documentHeight - windowHeight;
function scrollToNextSection() {
if (currentIndex < sections.length) {
const section = sections[currentIndex];
//
const scrollDuration = 15000; // 15
const scrollStep = maxScrollTop / (scrollDuration / 50); // 50ms
let currentScrollTop = 0;
// 使
section.scrollIntoView({
behavior: 'smooth',
block: 'center', //
inline: 'nearest'
});
function smoothScroll() {
if (currentScrollTop < maxScrollTop) {
currentScrollTop += scrollStep;
if (currentScrollTop > maxScrollTop) {
currentScrollTop = maxScrollTop;
}
console.log(`滚动到第${currentIndex + 1}个部分`);
currentSection.value = currentIndex;
currentIndex++;
window.scrollTo({
top: currentScrollTop,
behavior: 'auto' // 使autosmooth
});
//
setTimeout(scrollToNextSection, 4000); // 24
//
setTimeout(smoothScroll, 50);
} else {
console.log('自动滚动完成');
console.log('流畅自动滚动完成');
isAutoScrolling.value = false;
}
}
// 2
console.log('自动滚动将在2秒后开始');
setTimeout(scrollToNextSection, 2000);
// 1
setTimeout(smoothScroll, 1000);
}
// Intersection Observer
@ -730,11 +763,22 @@ function startAutoScroll() {
if (entry.isIntersecting && (!hasTriggeredAudio.value || !hasTriggeredTypewriter.value)) {
console.log('场景应用部分进入视口,开始打字机效果和音频播放');
//
const stockCode = currentStock.value?.stockInfo?.code || currentStock.value?.stockInfo?.symbol;
//
if (!hasTriggeredTypewriter.value && parsedConclusion.value) {
if (!hasTriggeredTypewriter.value && parsedConclusion.value && stockCode) {
//
if (!stockTypewriterShown.value.has(stockCode)) {
console.log('开始场景应用打字机效果');
hasTriggeredTypewriter.value = true;
startTypewriterEffect(parsedConclusion.value);
//
stockTypewriterShown.value.set(stockCode, true);
} else {
console.log('该股票已显示过打字机效果,跳过');
hasTriggeredTypewriter.value = true;
}
}
//
@ -814,6 +858,10 @@ function startAutoScroll() {
</script>
<style scoped>
.container {
padding-top: 2%;
}
.class003 {
padding-top: 8%;
padding-left: 10%;
@ -937,7 +985,7 @@ function startAutoScroll() {
}
.conclusion-title {
color: #00d4ff;
color: #fff000;
font-size: 22px;
font-weight: bold;
margin: 0 0 15px 0;
@ -1177,14 +1225,14 @@ function startAutoScroll() {
color: white;
font-size: 30px;
font-weight: bold;
margin-left: 42%;
margin-left: 44%;
}
.title3 {
color: white;
font-size: 30px;
font-weight: bold;
margin-left: 41%;
margin-left: 43%;
}
.title4 {
@ -1341,16 +1389,17 @@ function startAutoScroll() {
font-size: 1.5rem;
color: white;
float: right;
margin-top: -3.5rem;
margin-top: -2%;
}
.span01 {
background-image: url('@/assets/img/AiEmotion/bk01.png');
/* 使用导入的背景图片 */
background-size: 100% 100%;
/* 背景图片覆盖整个容器 */
background-repeat: no-repeat;
/* 防止背景图片重复 */
display: inline-block;
/* display: inline-block; */
/* 确保容器是块级元素 */
padding: 10px;
/* 添加内边距以显示内容 */
@ -1359,9 +1408,10 @@ function startAutoScroll() {
font-size: 1.5rem;
/* 增加字体大小以便更清晰显示股票名称 */
text-align: center;
transform: translate(-50%, -50%);
margin-left: -13rem;
/* transform: translate(-50%, -50%); */
margin-left: 0;
width: 30%;
height: auto;
}
.class01 {
@ -1463,12 +1513,9 @@ function startAutoScroll() {
/* 手机端适配样式 */
@media only screen and (max-width: 768px) {
.container {
margin: 0 auto;
max-width: 80vw;
padding-top: 2%;
}
.title4 {
color: white;
font-size: 20px;
@ -1506,11 +1553,6 @@ function startAutoScroll() {
width: 100%;
}
.class02 img {
width: 70%;
}
.class0201 img {
width: 100%;
}
@ -1566,7 +1608,7 @@ function startAutoScroll() {
font-size: 14px;
color: white;
float: right;
margin-top: -45px;
margin-top: -6%;
}
.class03 {
@ -1603,7 +1645,7 @@ function startAutoScroll() {
.class02 .container img {
width: 68%;
height: auto;
margin-top: 5%;
/* margin-top: 5%; */
margin-left: 0%;
}
@ -1663,7 +1705,7 @@ function startAutoScroll() {
}
.conclusion-title {
color: #00d4ff;
color: #fff000;
font-size: 16px;
font-weight: bold;
margin: 0 0 8px 0;
@ -1749,7 +1791,7 @@ function startAutoScroll() {
}
.conclusion-title {
color: #00d4ff;
color: #fff000;
font-size: 22px;
font-weight: bold;
margin: 0 0 15px 0;
@ -1894,6 +1936,7 @@ function startAutoScroll() {
.span01 {
/* 使用导入的背景图片 */
background-image: url('@/assets/img/AiEmotion/bk01.png');
background-size: 100% 100%;
/* 背景图片覆盖整个容器 */
background-repeat: no-repeat;
@ -1907,8 +1950,7 @@ function startAutoScroll() {
font-size: 14px;
/* 增加字体大小以便更清晰显示股票名称 */
text-align: center;
transform: translate(-50%, -50%);
margin-left: 33%;
width: 50%;
}
.class0502,

12
src/views/components/emoEnergyConverter.vue

@ -36,7 +36,7 @@ const generateGraphics = (min, max) => {
//
{
type: "text",
left: '17', // y
left: '60', //
top: getNameTop(min, max, middleY),
style: {
text: region.name,
@ -49,7 +49,7 @@ const generateGraphics = (min, max) => {
// y
{
type: "text",
left: '25',
left: '60', //
top: getNumberTop(min, max, region.max),
// top: 100,
style: {
@ -91,7 +91,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
max: qxnlzhqData.zc,
name: "【情绪冰点区】",
color: "#e7a5d6",
fontColor: '#000',
fontColor: 'white',
NumberColor: 'blue',
},
{
@ -99,7 +99,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
max: qxnlzhqData.ht,
name: "【认知潜伏区】",
color: "#f36587",
fontColor: '#000',
fontColor: 'white',
NumberColor: 'blue',
},
{
@ -107,7 +107,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
max: qxnlzhqData.qs,
name: "【多空消化区】",
color: "#e99883",
fontColor: '#000',
fontColor: 'white',
NumberColor: 'blue',
},
{
@ -115,7 +115,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
max: qxnlzhqData.tp,
name: "【共识加速区】",
color: "#f0db84",
fontColor: '#000',
fontColor: 'white',
NumberColor: 'red',
},
{

25
src/views/components/emotionDecod.vue

@ -118,14 +118,17 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
data: dealData.categoryData,
axisPointer: {
show: true,
type: "shadow",
label: {
show: false,
},
type: "line",
},
axisTick: { show: false }, // 线
axisLabel: { show: false, rotate: 45 }, //
axisLine: {
show: true,
lineStyle: {
color: "grey",
color: "white",
},
},
},
@ -149,7 +152,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
type: "category",
gridIndex: 2,
data: dealData.categoryData,
axisLine: { lineStyle: { color: "#8392A5" } },
axisLine: { lineStyle: { color: "white" } },
},
],
yAxis: [
@ -162,7 +165,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
},
axisLine: {
show: true,
lineStyle: { color: "#8392A5" },
lineStyle: { color: "white" },
},
splitLine: {
show: false,
@ -170,7 +173,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
axisPointer: {
show: true,
label: {
show: true,
show: false,
},
type: "line",
},
@ -179,7 +182,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
gridIndex: 1,
type: "category",
data: [0, 1, 2, 3], //
axisLine: { lineStyle: { color: "#8392A5" } },
axisLine: { lineStyle: { color: "white" } },
axisLabel: {
show: false, //
color: "#fff", //
@ -187,6 +190,13 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
fontSize: 12,
margin: 8,
},
axisPointer: {
show: true,
label: {
show: false,
},
type: "line",
},
axisTick: { show: false }, // 线
splitLine: {
show: true,
@ -204,7 +214,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
type: "value",
axisLine: {
show: true,
lineStyle: { color: "#8392A5" },
lineStyle: { color: "white" },
},
splitLine: {
show: !1,
@ -377,6 +387,7 @@ onBeforeUnmount(() => {
margin-left: 1rem;
top: 5rem;
}
.qxjmqbox {
height: auto;
width: 110%;

20
src/views/components/emotionalBottomRadar.vue

@ -185,7 +185,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
axisLine: {
// show: false,
lineStyle: {
color: '#837b7b', // x线
color: 'white', // x线
}
},
axisTick: {
@ -212,7 +212,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
// show: false,
lineStyle: {
// color: '#008000'
color: '#837b7b'
color: 'white'
}
},
axisTick: {
@ -236,7 +236,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
gridIndex: 2,
axisLine: {
lineStyle: {
color: '#837b7b'
color: 'white'
}
},
axisTick: {
@ -249,7 +249,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
}
},
axisLabel: {
color: '#000000',
color: 'white',
interval: 'auto',
rotate: 45
},
@ -270,7 +270,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
splitNumber: 4,
axisLine: {
lineStyle: {
color: '#837b7b' // y
color: 'white' // y
}
},
axisTick: {
@ -278,7 +278,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
},
axisLabel: {
width: 50, //
color: '#000000',
color: 'white',
formatter: function (value, index) {
if (index === 0) {
return '0'
@ -302,7 +302,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
splitNumber: 3,
axisLine: {
lineStyle: {
color: '#837b7b'
color: 'white'
}
},
axisTick: {
@ -311,7 +311,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
splitNumber: 5, //
axisLabel: {
width: 50, //
color: '#000000',
color: 'white',
formatter: function (value, index) {
// y
if (index === 0) {
@ -336,7 +336,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
splitNumber: 2,
axisLine: {
lineStyle: {
color: '#837b7b'
color: 'white'
}
},
axisTick: {
@ -345,7 +345,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
splitNumber: 5, //
axisLabel: {
width: 50, //
color: '#000000',
color: 'white',
formatter: function (value, index) {
if (index === 5) {
return ''

32
src/views/components/marketTemperature.vue

@ -190,14 +190,29 @@ function initChart(raw, klineDataRawValue, WDRLValue) {
//
chartInstance = echarts.init(KlineCanvs.value)
chartInstance.setOption({
tooltip: {},
tooltip: {
formatter: function (params) {
if (params.seriesType === 'candlestick') {
const date = params.name
// 25
const open = params.data[1]
const close = params.data[2]
const low = params.data[3]
const high = params.data[4]
return `日期: ${date}<br/>开: ${open}<br/>收: ${close}<br/>低: ${low}<br/>高: ${high}`
}
return params.value[2]
}
},
legend: { data: ['K线', '市场温度', '股票温度'], textStyle: { color: 'white' } },
xAxis: {
type: 'category',
data: dateLabels,
axisLine: { lineStyle: { color: '#8392A5' } }
axisLine: { lineStyle: { color: 'white' } }
},
yAxis: [{}, {
yAxis: [{
axisLine: { lineStyle: { color: 'white' } }
}, {
min: 0,
max: 100,
position: 'right',
@ -210,7 +225,14 @@ function initChart(raw, klineDataRawValue, WDRLValue) {
name: 'K线',
type: 'candlestick',
data: klineData,
itemStyle: { color: '#0CF49B', color0: '#FD1050' }
itemStyle: {
normal: {
color: '#FF0000', // 线
color0: '#00FF00', // 线绿
borderColor: '#FF0000', // 线
borderColor0: '#00FF00' // 线绿
}
}
},
{
name: '市场温度',
@ -255,8 +277,6 @@ function initChart(raw, klineDataRawValue, WDRLValue) {
adjustCellFontSize()
}
//
function adjustCellFontSize() {
const table = document.querySelector('.border4 .el-table')

Loading…
Cancel
Save