-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
1,484 additions
and
1,663 deletions.
There are no files selected for viewing
File renamed without changes.
240 changes: 120 additions & 120 deletions
240
src/components/chart/ChartCard.vue → src/components/Charts/ChartCard.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,120 +1,120 @@ | ||
<template> | ||
<a-card :loading="loading" :body-style="{ padding: '20px 24px 8px' }" :bordered="false"> | ||
<div class="chart-card-header"> | ||
<div class="meta"> | ||
<span class="chart-card-title"> | ||
<slot name="title"> | ||
{{ title }} | ||
</slot> | ||
</span> | ||
<span class="chart-card-action"> | ||
<slot name="action"></slot> | ||
</span> | ||
</div> | ||
<div class="total"> | ||
<slot name="total"> | ||
<span>{{ typeof total === 'function' && total() || total }}</span> | ||
</slot> | ||
</div> | ||
</div> | ||
<div class="chart-card-content"> | ||
<div class="content-fix"> | ||
<slot></slot> | ||
</div> | ||
</div> | ||
<div class="chart-card-footer"> | ||
<div class="field"> | ||
<slot name="footer"></slot> | ||
</div> | ||
</div> | ||
</a-card> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ChartCard', | ||
props: { | ||
title: { | ||
type: String, | ||
default: '' | ||
}, | ||
total: { | ||
type: [Function, Number, String], | ||
required: false, | ||
default: null | ||
}, | ||
loading: { | ||
type: Boolean, | ||
default: false | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.chart-card-header { | ||
position: relative; | ||
overflow: hidden; | ||
width: 100%; | ||
.meta { | ||
position: relative; | ||
overflow: hidden; | ||
width: 100%; | ||
color: rgba(0, 0, 0, .45); | ||
font-size: 14px; | ||
line-height: 22px; | ||
} | ||
} | ||
.chart-card-action { | ||
cursor: pointer; | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
} | ||
.chart-card-footer { | ||
border-top: 1px solid #e8e8e8; | ||
padding-top: 9px; | ||
margin-top: 8px; | ||
> * { | ||
position: relative; | ||
} | ||
.field { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
margin: 0; | ||
} | ||
} | ||
.chart-card-content { | ||
margin-bottom: 12px; | ||
position: relative; | ||
height: 46px; | ||
width: 100%; | ||
.content-fix { | ||
position: absolute; | ||
left: 0; | ||
bottom: 0; | ||
width: 100%; | ||
} | ||
} | ||
.total { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
word-break: break-all; | ||
white-space: nowrap; | ||
color: #000; | ||
margin-top: 4px; | ||
margin-bottom: 0; | ||
font-size: 30px; | ||
line-height: 38px; | ||
height: 38px; | ||
} | ||
</style> | ||
<template> | ||
<a-card :loading="loading" :body-style="{ padding: '20px 24px 8px' }" :bordered="false"> | ||
<div class="chart-card-header"> | ||
<div class="meta"> | ||
<span class="chart-card-title"> | ||
<slot name="title"> | ||
{{ title }} | ||
</slot> | ||
</span> | ||
<span class="chart-card-action"> | ||
<slot name="action"></slot> | ||
</span> | ||
</div> | ||
<div class="total"> | ||
<slot name="total"> | ||
<span>{{ typeof total === 'function' && total() || total }}</span> | ||
</slot> | ||
</div> | ||
</div> | ||
<div class="chart-card-content"> | ||
<div class="content-fix"> | ||
<slot></slot> | ||
</div> | ||
</div> | ||
<div class="chart-card-footer"> | ||
<div class="field"> | ||
<slot name="footer"></slot> | ||
</div> | ||
</div> | ||
</a-card> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ChartCard', | ||
props: { | ||
title: { | ||
type: String, | ||
default: '' | ||
}, | ||
total: { | ||
type: [Function, Number, String], | ||
required: false, | ||
default: null | ||
}, | ||
loading: { | ||
type: Boolean, | ||
default: false | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.chart-card-header { | ||
position: relative; | ||
overflow: hidden; | ||
width: 100%; | ||
.meta { | ||
position: relative; | ||
overflow: hidden; | ||
width: 100%; | ||
color: rgba(0, 0, 0, .45); | ||
font-size: 14px; | ||
line-height: 22px; | ||
} | ||
} | ||
.chart-card-action { | ||
cursor: pointer; | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
} | ||
.chart-card-footer { | ||
border-top: 1px solid #e8e8e8; | ||
padding-top: 9px; | ||
margin-top: 8px; | ||
> * { | ||
position: relative; | ||
} | ||
.field { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
margin: 0; | ||
} | ||
} | ||
.chart-card-content { | ||
margin-bottom: 12px; | ||
position: relative; | ||
height: 46px; | ||
width: 100%; | ||
.content-fix { | ||
position: absolute; | ||
left: 0; | ||
bottom: 0; | ||
width: 100%; | ||
} | ||
} | ||
.total { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
word-break: break-all; | ||
white-space: nowrap; | ||
color: #000; | ||
margin-top: 4px; | ||
margin-bottom: 0; | ||
font-size: 30px; | ||
line-height: 38px; | ||
height: 38px; | ||
} | ||
</style> |
File renamed without changes.
110 changes: 55 additions & 55 deletions
110
src/components/chart/MiniArea.vue → src/components/Charts/MiniArea.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
<template> | ||
<div class="antv-chart-mini"> | ||
<div class="chart-wrapper" :style="{ height: 46 }"> | ||
<v-chart :force-fit="true" :height="height" :data="data" :padding="[36, 0, 18, 0]"> | ||
<v-tooltip /> | ||
<v-smooth-area position="x*y" /> | ||
</v-chart> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import moment from 'moment' | ||
const data = [] | ||
const beginDay = new Date().getTime() | ||
for (let i = 0; i < 10; i++) { | ||
data.push({ | ||
x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), | ||
y: Math.round(Math.random() * 10) | ||
}) | ||
} | ||
const tooltip = [ | ||
'x*y', | ||
(x, y) => ({ | ||
name: x, | ||
value: y | ||
}) | ||
] | ||
const scale = [{ | ||
dataKey: 'x', | ||
min: 2 | ||
}, { | ||
dataKey: 'y', | ||
title: '时间', | ||
min: 1, | ||
max: 22 | ||
}] | ||
export default { | ||
name: 'MiniArea', | ||
data () { | ||
return { | ||
data, | ||
tooltip, | ||
scale, | ||
height: 100 | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
@import "chart"; | ||
<template> | ||
<div class="antv-chart-mini"> | ||
<div class="chart-wrapper" :style="{ height: 46 }"> | ||
<v-chart :force-fit="true" :height="height" :data="data" :padding="[36, 0, 18, 0]"> | ||
<v-tooltip /> | ||
<v-smooth-area position="x*y" /> | ||
</v-chart> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import moment from 'moment' | ||
const data = [] | ||
const beginDay = new Date().getTime() | ||
for (let i = 0; i < 10; i++) { | ||
data.push({ | ||
x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), | ||
y: Math.round(Math.random() * 10) | ||
}) | ||
} | ||
const tooltip = [ | ||
'x*y', | ||
(x, y) => ({ | ||
name: x, | ||
value: y | ||
}) | ||
] | ||
const scale = [{ | ||
dataKey: 'x', | ||
min: 2 | ||
}, { | ||
dataKey: 'y', | ||
title: '时间', | ||
min: 1, | ||
max: 22 | ||
}] | ||
export default { | ||
name: 'MiniArea', | ||
data () { | ||
return { | ||
data, | ||
tooltip, | ||
scale, | ||
height: 100 | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
@import "chart"; | ||
</style> |
Oops, something went wrong.