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: { parserOptions: {
ecmaVersion: 'latest', ecmaVersion: 'latest',
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
sourceType: 'module', sourceType: 'module'
ecmaFeatures: { // ecmaFeatures: {
modules: true // modules: true
} // }
// requireConfigFile: false // requireConfigFile: false
}, },
plugins: [ plugins: [

10
src/components/charts/ContinuousLine.vue

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

23
src/components/charts/UpLow.vue

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

2
src/components/charts/UpLowLine.vue

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

2
tsconfig.json

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

Loading…
Cancel
Save