Browse Source

样式优化

master
nelson 2 years ago
parent
commit
e9d4565b70
  1. 8
      .eslintrc.js
  2. 10
      src/components/charts/ContinuousLine.vue
  3. 23
      src/components/charts/UpLow.vue
  4. 2
      src/components/charts/UpLowLine.vue
  5. 2
      tsconfig.json

8
.eslintrc.js

@ -12,10 +12,10 @@ module.exports = {
parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser',
sourceType: 'module',
ecmaFeatures: {
modules: true
}
sourceType: 'module'
// ecmaFeatures: {
// modules: true
// }
// requireConfigFile: false
},
plugins: [

10
src/components/charts/ContinuousLine.vue

@ -1,6 +1,6 @@
<template>
<div>
<div ref="ContinuousLine" style="width: 100%; height: 500px" />
<div ref="ContinuousLine" style="width: 100%; height: 750px" />
</div>
</template>
@ -34,7 +34,7 @@ watch(chgContent, (newValue) => {
const init = () => {
const dateStr = chgContent.value.map(x => x.dateStr)
//
const maxLimitUpDay = chgContent.value.map(x => x.maxLimitUpDay)
const brokenSlabCount = chgContent.value.map(x => x.brokenSlabCount)
//
const firstLimitUpCount = chgContent.value.map(x => x.firstLimitUpCount)
//
@ -71,7 +71,7 @@ const init = () => {
}
},
legend: {
data: ['最高空间板', '首板数量', '二板数量', '三板数量'],
data: ['最高空间板', '炸板数量', '首板数量', '二板数量', '三板数量'],
left: 10
},
dataZoom: [
@ -102,13 +102,13 @@ const init = () => {
],
series: [
{
name: '最高空间板',
name: '炸板数量',
type: 'line',
smooth: true,
lineStyle: {
width: 1.5
},
data: maxLimitUpDay
data: brokenSlabCount
},
{
name: '首板数量',

23
src/components/charts/UpLow.vue

@ -1,6 +1,6 @@
<template>
<div>
<div ref="UpLow" style="width: 100%; height: 500px" />
<div ref="UpLow" style="width: 100%; height: 580px" />
</div>
</template>
@ -37,6 +37,12 @@ const init = () => {
const dateStr = chgContent.value.map(x => x.dateStr)
const upCount = chgFlag ? chgContent.value.map(x => x.upCount) : chgContent.value.map(x => x.limitUpCount)
const lowCount = chgFlag ? chgContent.value.map(x => x.lowCount) : chgContent.value.map(x => x.limitLowCount)
let maxVal:number = chgFlag ? 5200 : 0
if (!chgFlag) {
maxVal = chgContent.value.map(x => x.limitUpCount + x.limitLowCount).sort((a, b) => b - a).at(0)
}
const myChart = echarts.init(UpLow.value)
//
const option = {
@ -96,22 +102,19 @@ const init = () => {
{
type: 'value',
min: 0,
max: chgFlag
? 5200
: (value) => {
return parseInt(value.max + 20)
}
max: maxVal
},
{
nameLocation: 'start',
alignTicks: true,
type: 'value',
inverse: true
inverse: true,
min: 0,
max: maxVal
}
],
series: [
{
name: chgFlag ? '涨家数' : '停家数',
name: chgFlag ? '涨家数' : '停家数',
type: 'line',
smooth: true,
areaStyle: {
@ -128,7 +131,7 @@ const init = () => {
data: upCount
},
{
name: chgFlag ? '跌家数' : '跌家数',
name: chgFlag ? '跌家数' : '跌家数',
type: 'line',
smooth: true,
yAxisIndex: 1,

2
src/components/charts/UpLowLine.vue

@ -1,6 +1,6 @@
<template>
<div>
<div ref="UpLowLine" style="width: 100%; height: 500px" />
<div ref="UpLowLine" style="width: 100%; height: 600px" />
</div>
</template>

2
tsconfig.json

@ -4,7 +4,7 @@
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"strict": false,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,

Loading…
Cancel
Save