master
parent
863f8b36a9
commit
1a08a8d259
@ -0,0 +1,58 @@
|
||||
import request from "@/utils/request";
|
||||
function customParamsSerializer(params) {
|
||||
let result = '';
|
||||
for (let key in params) {
|
||||
if (params.hasOwnProperty(key)) {
|
||||
if (Array.isArray(params[key])) {
|
||||
params[key].forEach((item,index) => {
|
||||
if(item.key){
|
||||
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
|
||||
|
||||
}else{
|
||||
result +=`${key}[${index}]=${item}&`
|
||||
}
|
||||
});
|
||||
} else {
|
||||
result += `${key}=${params[key]}&`;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.slice(0, -1);
|
||||
}
|
||||
|
||||
export function index(params,isLoading = false) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/api/admin/company/index",
|
||||
params,
|
||||
paramsSerializer: customParamsSerializer,
|
||||
isLoading
|
||||
})
|
||||
}
|
||||
|
||||
export function show(params, isLoading = true) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/api/admin/company/show",
|
||||
params,
|
||||
isLoading
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/api/admin/company/save",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function destroy(params) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/api/admin/company/destroy",
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 2.7 MiB |
@ -0,0 +1,212 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div>
|
||||
<div ref="lxHeader">
|
||||
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content">
|
||||
<div class="searchwrap" style="display: flex;align-items: center;">
|
||||
<div>
|
||||
<el-select filterable v-model="select.teacher_id" placeholder="请选择授课老师" clearable style="width: 100%;">
|
||||
<el-option v-for="(item,index) in teachers" :key="index" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="select.page=1,getList()">查询</el-button>
|
||||
<el-button type="primary" size="small" @click="resetSelect">重置</el-button>
|
||||
|
||||
</div>
|
||||
<!-- <div>
|
||||
<el-button type="primary" size="small" @click="editNotice('add')">新增</el-button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</lx-header>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
|
||||
:table-item="table_item">
|
||||
<template v-slot:files>
|
||||
<el-table-column align='left' label="课件" width="240" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<div v-for="(item,index) in scope.row.files">
|
||||
<div>
|
||||
{{index+1}}、 <a style="cursor: pointer;color:blue;text-decoration: underline;" :href="item.url"
|
||||
target="_blank">{{item.original_name}}</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-slot:btns>
|
||||
<!-- <el-table-column align='center' fixed="right" label="操作" width="180" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="small" @click="editNotice('editor',scope.row.id)">编辑</el-button>
|
||||
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
|
||||
<el-button type="danger" size="small" slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</template>
|
||||
</xy-table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
index as teacherGet
|
||||
} from "@/api/info/teachers.js"
|
||||
import {
|
||||
index
|
||||
} from '@/api/course/courseContent.js'
|
||||
export default {
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
teachers:[],
|
||||
select: {
|
||||
teacher_id: '',
|
||||
page: 1,
|
||||
page_size: 10
|
||||
},
|
||||
list: [],
|
||||
total: 0,
|
||||
table_item: [{
|
||||
prop: 'files',
|
||||
label: '课件',
|
||||
align: 'left',
|
||||
width: 240
|
||||
}, {
|
||||
prop: 'course.name',
|
||||
label: '课程名称',
|
||||
align: 'left',
|
||||
width: 240,
|
||||
}, {
|
||||
prop: 'theme',
|
||||
label: '授课主题',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
}, {
|
||||
prop: 'date',
|
||||
label: '日期',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
}, {
|
||||
prop: 'period',
|
||||
label: '时间 ',
|
||||
align: 'center',
|
||||
width: 180,
|
||||
}, {
|
||||
prop: 'teacher.name',
|
||||
label: '授课老师',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
}, {
|
||||
prop: 'teacher.sex',
|
||||
label: '性别',
|
||||
align: 'center',
|
||||
width: 80
|
||||
}, {
|
||||
prop: 'teacher.mobile',
|
||||
label: '联系方式',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
}, {
|
||||
prop: 'address',
|
||||
label: '上课地点',
|
||||
align: 'left',
|
||||
width: 240,
|
||||
}, {
|
||||
prop: 'teacher.introduce',
|
||||
label: '老师简介',
|
||||
align: 'left',
|
||||
width: 240,
|
||||
}],
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTeachers()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
async getTeachers(){
|
||||
const res = await teacherGet({
|
||||
page:1,
|
||||
page_size:999
|
||||
})
|
||||
this.teachers = res.data
|
||||
},
|
||||
pageIndexChange(e) {
|
||||
this.select.page = e
|
||||
this.getList()
|
||||
},
|
||||
pageSizeChange(e) {
|
||||
this.select.page_size = e
|
||||
this.select.page = 1
|
||||
this.getList()
|
||||
},
|
||||
resetSelect() {
|
||||
this.select.teacher_id = ''
|
||||
this.select.course = ''
|
||||
this.select.page = 1
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
const res = await index({
|
||||
page_size: this.select.page_size,
|
||||
page: this.select.page,
|
||||
show_relation: ['course','teacher'],
|
||||
filter: [{
|
||||
key: 'file_ids',
|
||||
op: 'notnull',
|
||||
value: '1'
|
||||
},{
|
||||
key: 'teacher_id',
|
||||
op: 'eq',
|
||||
value: this.select.teacher_id?this.select.teacher_id:''
|
||||
}]
|
||||
})
|
||||
this.list = res.data
|
||||
this.total = res.total
|
||||
},
|
||||
deleteList(id) {
|
||||
var that = this;
|
||||
destroy({
|
||||
id: id
|
||||
}).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
this.getList()
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchwrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
|
||||
span {
|
||||
min-width: 70px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,298 +1,92 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="statistics">
|
||||
<!-- <panel-group :totaldata="list" /> -->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from "echarts"
|
||||
import PanelGroup from './components/PanelGroup'
|
||||
import {
|
||||
getChartsHome
|
||||
} from "../../api/dashboard.js"
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PanelGroup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
col: '',
|
||||
line: '',
|
||||
business_data: [],
|
||||
collect_data: [],
|
||||
list: {},
|
||||
customerArr: [],
|
||||
orderArr: [],
|
||||
chartData: {},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
chartData(val, newval) {
|
||||
if (newval){
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
await getChartsHome().then((res) => {
|
||||
console.log(res);
|
||||
this.list = res.list;
|
||||
this.chartData = res;
|
||||
let _business_data = [];
|
||||
let _collect_data = [];
|
||||
res.business_data.map(item => {
|
||||
_business_data.push(item.server_money_total)
|
||||
_collect_data.push(item.collect_money)
|
||||
})
|
||||
this.business_data = _business_data;
|
||||
this.collect_data = _collect_data;
|
||||
let _customerArr = [];
|
||||
let _orderArr = [];
|
||||
|
||||
res.order_data.map(item => {
|
||||
_customerArr.push(item.active_customer)
|
||||
_orderArr.push(item.order_total)
|
||||
})
|
||||
this.customerArr = _customerArr;
|
||||
this.orderArr = _orderArr;
|
||||
}).catch()
|
||||
},
|
||||
init() {
|
||||
this.col = echarts.init(document.getElementById('col-chart'))
|
||||
this.col.setOption({
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
},
|
||||
position: 'bottom'
|
||||
},
|
||||
legend: {},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
boundaryGap: [0, 0.01]
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['第一周', '第二周', '第三周', '第四周']
|
||||
},
|
||||
series: [{
|
||||
name: '服务金额',
|
||||
type: 'bar',
|
||||
data: this.business_data,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: 'rgb(42,182,252)'
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '收款',
|
||||
type: 'bar',
|
||||
data: this.collect_data,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: 'rgb(34,228,255)'
|
||||
},
|
||||
},
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
this.line = echarts.init(document.getElementById('line-chart'))
|
||||
this.line.setOption({
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: ['活跃客户', '服务订单']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '6%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
toolbox: {
|
||||
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['第一周', '第二周', '第三周', '第四周']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
},
|
||||
series: [{
|
||||
name: '活跃客户',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
data: this.customerArr,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: 'rgb(42,182,252)'
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '服务订单',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
data: this.orderArr,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: 'rgb(34,228,255)'
|
||||
},
|
||||
},
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
//this.loadData();
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
//this.init()
|
||||
|
||||
// window.onresize = () => {
|
||||
// this.col.resize()
|
||||
// this.line.resize()
|
||||
// }
|
||||
|
||||
},
|
||||
destroyed() {
|
||||
window.onresize = null
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.statistics {
|
||||
display: flex;
|
||||
|
||||
margin-top: 20px;
|
||||
|
||||
&-title {
|
||||
|
||||
padding-left: 6px;
|
||||
}
|
||||
|
||||
&-content {
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
|
||||
&-top {
|
||||
|
||||
&__num {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-size: 10px;
|
||||
color: rgb(140, 140, 140);
|
||||
}
|
||||
}
|
||||
|
||||
&-bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
&-left {
|
||||
|
||||
&__num {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-size: 10px;
|
||||
color: rgb(140, 140, 140);
|
||||
}
|
||||
}
|
||||
|
||||
&-right {
|
||||
|
||||
&__num {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-size: 10px;
|
||||
color: rgb(140, 140, 140);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&>div {
|
||||
flex: 1;
|
||||
margin-right: 20px;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.chart {
|
||||
display: flex;
|
||||
|
||||
margin-top: 20px;
|
||||
|
||||
|
||||
.chartItem {
|
||||
|
||||
width: 49%;
|
||||
|
||||
.chartItemTitle {
|
||||
font-size: 16px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#col-chart {
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
flex: 1;
|
||||
margin-right: 20px;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
min-height: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#line-chart {
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
flex: 1;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
min-height: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
<template>
|
||||
<div class="jsc" :style="bgStyle">
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from "echarts"
|
||||
import PanelGroup from './components/PanelGroup'
|
||||
import {
|
||||
getChartsHome
|
||||
} from "../../api/dashboard.js"
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PanelGroup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
screenWidth: 0,
|
||||
screenHeight: 0,
|
||||
bgStyle: {
|
||||
width: 0,
|
||||
height: 0
|
||||
},
|
||||
col: '',
|
||||
line: '',
|
||||
business_data: [],
|
||||
collect_data: [],
|
||||
list: {},
|
||||
customerArr: [],
|
||||
orderArr: [],
|
||||
chartData: {},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// chartData(val, newval) {
|
||||
// if (newval){
|
||||
// this.init();
|
||||
// }
|
||||
// }
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.$store.dispatch('app/closeSideBar', {
|
||||
withoutAnimation: false
|
||||
})
|
||||
this.calculateScreenSize()
|
||||
},
|
||||
destroyed() {
|
||||
window.onresize = null
|
||||
},
|
||||
methods: {
|
||||
calculateScreenSize() {
|
||||
this.screenWidth = window.innerWidth
|
||||
this.screenHeight = window.innerHeight
|
||||
this.bgStyle = {
|
||||
width: this.screenWidth - 56 + 'px',
|
||||
height: this.screenHeight + 'px',
|
||||
position: 'relative',
|
||||
left: '-20px',
|
||||
top: '-50px',
|
||||
'z-index': 999
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .app-main {
|
||||
padding: 0 !important
|
||||
}
|
||||
|
||||
::v-deep .hideSidebar .fixed-header {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.jsc {
|
||||
height: 100%;
|
||||
background: url(../../assets/dashboard.png) no-repeat center top;
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 10px;
|
||||
padding-top: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
Reference in new issue