master
lion 4 years ago
parent d5d2d2dc2f
commit 343dcc7318

@ -4,7 +4,8 @@
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" src="../../../assets/logo-mini.png?v=1" class="sidebar-logo">
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<router-link v-else key="expand" class="sidebar-logo-link" to="/yiwanggongzhi/jsc.html">
<!-- 驾驶舱 -->
<!-- <img v-if="logo" src="../../../assets/logo-mini.png" class="sidebar-logo"> -->
<img src="../../../assets/logo.png?v=1"
class="sidebar-name-logo" />

@ -1,95 +1,115 @@
<template>
<div class="dashboard-editor-container">
<panel-group @handleRoute="handleRoute" :countsData="countsData" />
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="12">
<div class="chart-wrapper">
<div class="chart-title">
<router-link to="/toolbox/warning">数据统计</router-link>
<div>
<el-tag @click="changeDate('warning',item.type,index)" :type="(item.checked?'success':'info')"
style="margin-right: 10px;cursor: pointer;" v-for="(item,index) in stat.warning.dateRange">
{{item.name}}
</el-tag>
</div>
<div style="font-size:18px;margin-bottom:20px">
<p>欢迎回来!</p>
<p>{{userName}}</p>
</div>
<bar-chart :chartData="stat.warning" />
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>代办事项</span>
<el-button style="float: right; padding: 3px 0" type="text">更多</el-button>
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="12">
<div class="chart-wrapper">
<div class="chart-title">
<router-link to="/toolbox/exception">登录统计</router-link>
<div>
<el-tag @click="changeDate('exception',item.type,index)" :type="(item.checked?'success':'info')"
style="margin-right: 10px;cursor: pointer;" v-for="(item,index) in stat.exception.dateRange">
{{item.name}}
</el-tag>
<div class="text item">
<div ref="lxTable">
<el-table :data="list" :height="tableHeight" style="width: 100%">
<el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
:label="column.title" :width="column.width">
<template slot-scope="scope">
<div v-if="column.type=='status'">
<el-tag type="warning">待审核</el-tag>
<!-- <div v-if="scope.row[column.field]==0"></div>
<div v-if="scope.row[column.field]==1"></div>
<div v-if="scope.row[column.field]==2"></div> -->
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
<!-- <div class="pagination">
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
</el-pagination>
</div> -->
</div>
<bar-chart :chartData="stat.exception" />
</div>
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
import PanelGroup from './components/PanelGroup'
import BarChart from './components/BarChart'
import {getInfo} from "../../api/user.js";
import {
getChartsData,
getCounts
} from "../../api/dashboard.js"
listNotice
} from "../../api/notice/index.js";
export default {
name: 'DashboardAdmin',
components: {
PanelGroup,
BarChart
},
data() {
return {
countsData: {
client_count: 0,
tool_count: 0,
user_count: 0
userName:"",
searchList:{
page:1,
page_size:10
},
tableHeight:600,
list:[],
columns: [{
field: "title",
title: "公告名称",
type: "string",
},
stat: {
warning: {
xArr: ["一","二","三","四","五"],
yArr: [200,300,400,500,330],
dateRange: [{
checked: true,
type: "week",
name: "本周"
}, {
checked: false,
type: "month",
name: "本月"
}]
{
field: "author",
title: "发布者",
type: "string",
width: 200,
align: "center"
},
exception: {
xArr: ["一","二","三","四","五"],
yArr: [200,300,400,500,330],
dateRange: [{
checked: true,
type: "week",
name: "本周"
}, {
checked: false,
type: "month",
name: "本月"
}]
{
field: "author_date",
title: "发布时间",
type: "string",
width: 200,
align: "center"
},
{
field: "status",
title: "状态",
type: "status",
width: 180,
align: "status"
}
]
}
},
created: function() {
created() {
this.init();
},
methods: {
init(){
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 110;
that.tableHeight = tableHeight;
getInfo().then(res => {
this.userName = res.name;
});
listNotice({
page: this.searchList.page,
page_size: this.searchList.page_size,
}).then(res => {
this.list = res.data
})
},
}
}

@ -0,0 +1,130 @@
<template>
<div class="dashboard-editor-container">
<panel-group @handleRoute="handleRoute" :countsData="countsData" />
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="12">
<div class="chart-wrapper">
<div class="chart-title">
<router-link to="/toolbox/warning">数据统计</router-link>
<div>
<el-tag @click="changeDate('warning',item.type,index)" :type="(item.checked?'success':'info')"
style="margin-right: 10px;cursor: pointer;" v-for="(item,index) in stat.warning.dateRange">
{{item.name}}
</el-tag>
</div>
</div>
<bar-chart :chartData="stat.warning" />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="12">
<div class="chart-wrapper">
<div class="chart-title">
<router-link to="/toolbox/exception">登录统计</router-link>
<div>
<el-tag @click="changeDate('exception',item.type,index)" :type="(item.checked?'success':'info')"
style="margin-right: 10px;cursor: pointer;" v-for="(item,index) in stat.exception.dateRange">
{{item.name}}
</el-tag>
</div>
</div>
<bar-chart :chartData="stat.exception" />
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import PanelGroup from './components/PanelGroup'
import BarChart from './components/BarChart'
import {
getChartsData,
getCounts
} from "../../api/dashboard.js"
export default {
name: 'DashboardAdmin',
components: {
PanelGroup,
BarChart
},
data() {
return {
countsData: {
client_count: 0,
tool_count: 0,
user_count: 0
},
stat: {
warning: {
xArr: ["一","二","三","四","五"],
yArr: [200,300,400,500,330],
dateRange: [{
checked: true,
type: "week",
name: "本周"
}, {
checked: false,
type: "month",
name: "本月"
}]
},
exception: {
xArr: ["一","二","三","四","五"],
yArr: [200,300,400,500,330],
dateRange: [{
checked: true,
type: "week",
name: "本周"
}, {
checked: false,
type: "month",
name: "本月"
}]
},
}
}
},
created: function() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.dashboard-editor-container {
padding: 32px;
background-color: rgb(240, 242, 245);
position: relative;
.github-corner {
position: absolute;
top: 0px;
border: 0;
right: 0;
}
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
.chart-title {
font-size: 16px;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
}
}
}
@media (max-width:1024px) {
.chart-wrapper {
padding: 8px;
}
}
</style>
Loading…
Cancel
Save