-
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.
Merge pull request #19 from sunquakes/development
Dashboard and chart.
- Loading branch information
Showing
23 changed files
with
429 additions
and
22 deletions.
There are no files selected for viewing
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"xAxis": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], | ||
"series": [ | ||
{ | ||
"data": [120, 200, 150, 80, 70, 110, 130], | ||
"type": "bar" | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"xAxis": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], | ||
"legend": ["Email", "Union Ads", "Video Ads", "Direct", "Search Engine"], | ||
"series": [ | ||
{ | ||
"name": "Email", | ||
"type": "line", | ||
"stack": "Total", | ||
"data": [120, 132, 101, 134, 90, 230, 210] | ||
}, | ||
{ | ||
"name": "Union Ads", | ||
"type": "line", | ||
"stack": "Total", | ||
"data": [220, 182, 191, 234, 290, 330, 310] | ||
}, | ||
{ | ||
"name": "Video Ads", | ||
"type": "line", | ||
"stack": "Total", | ||
"data": [150, 232, 201, 154, 190, 330, 410] | ||
}, | ||
{ | ||
"name": "Direct", | ||
"type": "line", | ||
"stack": "Total", | ||
"data": [320, 332, 301, 334, 390, 330, 320] | ||
}, | ||
{ | ||
"name": "Search Engine", | ||
"type": "line", | ||
"stack": "Total", | ||
"data": [820, 932, 901, 934, 1290, 1330, 1320] | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ "value": 1048, "name": "Search Engine" }, | ||
{ "value": 735, "name": "Direct" }, | ||
{ "value": 580, "name": "Email" }, | ||
{ "value": 484, "name": "Union Ads" }, | ||
{ "value": 300, "name": "Video Ads" } | ||
] |
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,14 +1,16 @@ | ||
export async function pageList( | ||
export function pageList( | ||
current: number, | ||
pageSize: number, | ||
where: string[][], | ||
orderBy: string | ||
): Promise<any> | ||
|
||
export async function login(username: string, password: string): Promise<any> | ||
export function login(username: string, password: string): Promise<any> | ||
|
||
export async function del(where: string[][]): Promise<any> | ||
export function del(where: string[][]): Promise<any> | ||
|
||
export async function edit(id: number, data: any): Promise<any> | ||
export function edit(id: number, data: any): Promise<any> | ||
|
||
export async function add(data: any): Promise<any> | ||
export function add(data: any): Promise<any> | ||
|
||
export function doCount(data: any): Promise<number> |
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template> | ||
<a-row> | ||
<a-col class="chart-container" :span="12"><Pie :data="pieData" /></a-col> | ||
<a-col class="chart-container" :span="12"><Bar :data="barData" /></a-col> | ||
</a-row> | ||
<a-row> | ||
<a-col class="chart-container" :span="24"><Line :data="lineData" /></a-col> | ||
</a-row> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import Pie from './chart/Pie.vue' | ||
import Bar from './chart/Bar.vue' | ||
import Line from './chart/Line.vue' | ||
import pieData from '../api/pie.json' | ||
import barData from '../api/bar.json' | ||
import lineData from '../api/line.json' | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.chart-container { | ||
height: 25vw; | ||
} | ||
</style> |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<template> | ||
<a-row> | ||
<a-col :span="12"> | ||
<a-statistic title="Active Users" :value="userCount" style="margin-right: 50px" /> | ||
</a-col> | ||
<a-col :span="12"> | ||
<a-statistic title="Account Balance (CNY)" :precision="2" :value="112893" /> | ||
</a-col> | ||
</a-row> | ||
<a-row> | ||
<a-col :span="24"> | ||
<a-collapse v-model:activeKey="activeKey"> | ||
<a-collapse-panel key="1" header="This is panel header 1"> | ||
<p> | ||
A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be | ||
found as a welcome guest in many households across the world. | ||
</p> | ||
</a-collapse-panel> | ||
<a-collapse-panel key="2" header="This is panel header 2"> | ||
<p> | ||
A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be | ||
found as a welcome guest in many households across the world. | ||
</p> | ||
</a-collapse-panel> | ||
<a-collapse-panel key="3" header="This is panel header 3" collapsible="disabled"> | ||
<p> | ||
A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be | ||
found as a welcome guest in many households across the world. | ||
</p> | ||
</a-collapse-panel> | ||
</a-collapse> | ||
</a-col> | ||
</a-row> | ||
<a-row> | ||
<a-col :span="24"> | ||
<a-alert message="Success Tips" type="success" show-icon /> | ||
</a-col> | ||
<a-col :span="24"> | ||
<a-alert message="Informational Notes" type="info" show-icon /> | ||
</a-col> | ||
<a-col :span="24"> | ||
<a-alert message="Warning" type="warning" show-icon /> | ||
</a-col> | ||
<a-col :span="24"> | ||
<a-alert message="Error" type="error" show-icon /> | ||
</a-col> | ||
</a-row> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { doCount } from '../api/user' | ||
import { ref, onMounted } from 'vue' | ||
const userCount = ref<number>(0) | ||
const activeKey = ref(['1']) | ||
onMounted(async () => { | ||
userCount.value = await doCount() | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.ant-row { | ||
padding: 8px 0; | ||
} | ||
.ant-col { | ||
margin: 4px 0; | ||
} | ||
</style> |
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
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<div class="chart-container" :id="id"></div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import * as echarts from 'echarts' | ||
import { onMounted } from 'vue' | ||
const props = defineProps({ | ||
id: { | ||
type: String, | ||
default: 'bar-container' | ||
}, | ||
data: { | ||
type: Object, | ||
default: () => {} | ||
} | ||
}) | ||
onMounted(() => { | ||
init() | ||
}) | ||
const init = () => { | ||
const chartDom = document.getElementById(props.id) | ||
const chart = echarts.init(chartDom) | ||
window.addEventListener('resize', function () { | ||
chart.resize() | ||
}) | ||
const option = { | ||
grid: { | ||
top: '10%', | ||
left: '2%', | ||
right: '2%', | ||
bottom: '10%', | ||
containLabel: true | ||
}, | ||
xAxis: { | ||
type: 'category', | ||
data: props.data.xAxis | ||
}, | ||
yAxis: { | ||
type: 'value' | ||
}, | ||
series: props.data.series | ||
} | ||
option && chart.setOption(option) | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.chart-container { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> |
Oops, something went wrong.