lion 2 years ago
parent 3fe155ecda
commit 6b5341ec52

@ -0,0 +1,198 @@
<template>
<div class="chartWrap"
:style="{ width: width, height: height,'textAlign':'center',lineHeight: height,color:'#909399'}">
<div v-if="showChart" ref="mybar"></div>
<div v-else></div>
</div>
</template>
<script>
import * as echarts from 'echarts'
require('echarts/theme/macarons')
import resize from './mixins/resize'
const animationDuration = 6000
export default {
mixins: [resize],
props: {
//
data: {
type: Object,
default: () => {},
},
//
width: {
type: String,
default: "100%",
},
//
height: {
type: String,
default: "350px",
},
//
axisPointerType:{
type: String,
default: "shadow",
},
//
colors: {
type: Array,
default: () => {
return [
"#5470c6",
"#91cc75",
"#fac858",
"#ee6666",
"#73c0de",
"#3ba272",
"#fc8452",
"#9a60b4",
"#ea7ccc",
];
},
},
},
data() {
return {
myChart: "",
showChart: true
};
},
watch: {
data: {
//
handler() {
this.initChart(this.$refs.mybar, this.data);
},
deep: true,
},
},
computed: {},
created() {},
mounted() {
//
this.initChart(this.$refs.mybar, this.data);
},
methods: {
initChart(dom, currentData) {
if (Object.keys(currentData).length == 0) {
console.log("123")
this.showChart = false
return
}
//
if (
this.myChart != null &&
this.myChart != "" &&
this.myChart != undefined
) {
this.myChart.dispose(); //
}
// this.myChart = this.$echarts.init(dom);
this.myChart = echarts.init(this.$el, 'macarons')
let option = this.option(currentData);
this.myChart.setOption(option);
},
option(currentData) {
let seriesList = currentData.list.map((item) => {
return {
name: item.name || "",
type: item.type || "line", //线
data: item.data,
...item
};
});
// echarts
return {
grid: {
left: '20',
right: '20',
top: '40',
bottom: '20',
containLabel: true
},
color: this.colors, //
legend: {},
tooltip: { //
// trigger: "axis",
// formatter: currentData.formatter, //
trigger: currentData.trigger||'axis',
formatter:currentData.formatter,
axisPointer: {
type: this.axisPointerType,
},
textStyle: { //
align: 'left'
}
},
itemStyle: {
borderRadius: [0, 0, 0, 0]
},
xAxis: {
type: "category",
data: currentData.x, //
splitArea: false,
splitLine: false,
axisLine: {
show: currentData.xShow,
lineStyle: {
color: "#338de3", //x线
width: 1,
type: "solid",
},
},
axisTick: {
show: false,
},
toolbox: {},
axisLabel: {
interval: 0,
rotate:currentData.rotate||'',
show: true,
splitNumber: 15,
textStyle: {
color: "rgba(122,122,122,1)",
fontSize: "14",
},
},
},
yAxis: {
type: "value",
splitArea: false,
splitLine: false,
// name: currentData.list[0].unit, //
axisLabel: {
formatter: "{value}", //
show: true,
textStyle: {
color: "rgba(122,122,122,1)",
fontSize: "12",
},
},
axisLine: {
show: currentData.yShow,
lineStyle: {
color: "#338de3", //y线
width: 1,
type: "solid",
},
},
// interval: 0
},
series: seriesList, //
};
},
},
};
</script>
<style>
.chartWrap {
background-color: #fff;
}
</style>

@ -0,0 +1,55 @@
import { debounce } from '@/utils'
export default {
data() {
return {
$_sidebarElm: null,
$_resizeHandler: null
}
},
mounted() {
this.$_resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
this.$_initResizeEvent()
this.$_initSidebarResizeEvent()
},
beforeDestroy() {
this.$_destroyResizeEvent()
this.$_destroySidebarResizeEvent()
},
// to fixed bug when cached by keep-alive
// https://github.com/PanJiaChen/vue-element-admin/issues/2116
activated() {
this.$_initResizeEvent()
this.$_initSidebarResizeEvent()
},
deactivated() {
this.$_destroyResizeEvent()
this.$_destroySidebarResizeEvent()
},
methods: {
// use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_initResizeEvent() {
window.addEventListener('resize', this.$_resizeHandler)
},
$_destroyResizeEvent() {
window.removeEventListener('resize', this.$_resizeHandler)
},
$_sidebarResizeHandler(e) {
if (e.propertyName === 'width') {
this.$_resizeHandler()
}
},
$_initSidebarResizeEvent() {
this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
},
$_destroySidebarResizeEvent() {
this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
}
}
}

@ -23,13 +23,13 @@
</div>
<div>
<xy-table :list="list" :isPage="false" rowKey="id"
:table-item="table_item">
<xy-table :list="list" :isPage="false" rowKey="id" :table-item="table_item">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="240" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editCatalog('child',scope.row.id,scope.row.name)"></el-button>
<el-button type="primary" size="small" @click="editCatalog('editor',scope.row.id)"></el-button>
<template slot-scope="scope">
<el-button type="primary" size="small"
@click="editCatalog('child',scope.row.id,scope.row.name)">子目录</el-button>
<el-button type="primary" size="small" @click="editCatalog('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>
@ -63,14 +63,19 @@
},
list: [],
table_item: [{
prop: 'id',
label: 'id',
align: 'center',
width: 100
}, {
prop: 'name',
label: '目录名称',
align: 'left',
},{
}, {
prop: 'sort',
label: '排序',
align: 'center',
width:50
align: 'center',
width: 50
}]
}
@ -79,12 +84,12 @@
this.getList()
},
methods: {
editCatalog(type, id,pName) {
editCatalog(type, id, pName) {
if (type == 'editor') {
this.$refs.addCatalog.id = id
}
if(type=='child'){
this.$refs.addCatalog.setPid(id,pName)
}
if (type == 'child') {
this.$refs.addCatalog.setPid(id, pName)
}
this.$refs.addCatalog.type = type
this.$refs.addCatalog.isShow = true
@ -92,19 +97,19 @@
async getList() {
const res = await index({
page_size: this.select.page_size,
page: this.select.page,
sort_type:'ASC',
sort_name:'sort',
page: this.select.page,
sort_type: 'ASC',
sort_name: 'sort',
table_name: this.select.table_name,
filter: [{
"key": "name",
"op": "like",
"value": this.select.name
}],
})
if(res.data.length>0){
this.list = this.base.buildTree(res.data)
})
if (res.data.length > 0) {
this.list = this.base.buildTree(res.data)
}
},

@ -3,17 +3,17 @@
<div class="boxlist">
<div class="box box1">
<div class="boxtitle">
<span>营业统计</span>
<span>档案统计</span>
<i class="el-icon-data-line statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">服务金额</div>
<div class="boxcontentsubtitle">总数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
{{totaldata.business.server_money_total}}
{{totaldata.record_total?totaldata.record_total:0}}
</div>
<div style="display: flex;justify-content: space-around;">
<!-- <div style="display: flex;justify-content: space-around;">
<div class="boxcontentitem-small">
<span>{{totaldata.business.nurse_money_total}}</span>
<span>护工金额</span>
@ -22,7 +22,7 @@
<span>{{totaldata.business.remain_money_total}}</span>
<span>留存金额</span>
</div>
</div>
</div> -->
</div>
</div>
</div>
@ -30,18 +30,17 @@
<div class="box box2">
<div class="boxtitle">
<span>人效统计</span>
<span>组织统计</span>
<i class="el-icon-user statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">服务时长</div>
<div class="boxcontentsubtitle"></div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
{{totaldata.person_efficiency.server_time_total}}
分钟
{{totaldata.originze_total?totaldata.originze_total:0}}
</div>
<div style="display: flex;justify-content: space-around;">
<!-- <div style="display: flex;justify-content: space-around;">
<div class="boxcontentitem-small">
<span>{{totaldata.person_efficiency.expect}}</span>
@ -51,24 +50,24 @@
<span>{{totaldata.person_efficiency.act}} </span>
<span>天数</span>
</div>
</div>
</div> -->
</div>
</div>
</div>
<div class="box box3">
<div class="boxtitle">
<span>客户统计</span>
<span>区域统计</span>
<i class="el-icon-s-custom statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">活跃客户</div>
<div class="boxcontentsubtitle">总数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
{{totaldata.customer.active}}
{{totaldata.area_total?totaldata.area_total:0}}
</div>
<div style="display: flex;justify-content: space-around;">
<!-- <div style="display: flex;justify-content: space-around;">
<div class="boxcontentitem-small">
<span>{{totaldata.customer.add}}</span>
<span>新增</span>
@ -77,12 +76,12 @@
<span>{{totaldata.customer.wash}}</span>
<span>流失</span>
</div>
</div>
</div> -->
</div>
</div>
</div>
<div class="box box4">
<!-- <div class="box box4">
<div class="boxtitle">
<span>订单统计</span>
@ -106,7 +105,7 @@
</div>
</div>
</div>
</div>
</div> -->
</div>
</div>
</template>
@ -122,27 +121,9 @@
totaldata: {
type: Object,
default: {
"business": {
"server_money_total": 0,
"nurse_money_total": 0,
"remain_money_total": 0
},
"person_efficiency": {
"server_time_total": "0",
"expect": 0,
"act": 0
},
"customer": {
"active": 0,
"add": 0,
"wash": 0
},
"order": {
"server_total": 0,
"cycle_total": 0,
"unit_total": 0
},
record_total:0,
originze_total:0,
area_total:0
}
}
},
@ -162,7 +143,8 @@
<style lang="scss" scoped>
.boxlist {
display: flex;
display: flex;
justify-content: space-between;
}
.statIcon {
@ -193,10 +175,10 @@
.box {
position: relative;
width: 33%;
margin-left: 0.5%;
margin-right: 0.5%;
margin-bottom: 2.375rem;
width: 32%;
// margin-left: 0.5%;
// margin-right: 0.5%;
margin-bottom: 10px;
box-shadow: 0px 8px 15px 0px rgba(212, 84, 32, 0.3100);
border-radius: 8px;
box-sizing: border-box;

@ -1,298 +1,107 @@
<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 style="padding:20px 0">
<el-row :gutter="20" class='elrows'>
<el-col :span="24">
<PanelGroup :totaldata="list"></PanelGroup>
</el-col>
<el-col :span="12" class="chartSize">
<div style="padding:10px;color:#b3241d;font-size:18px">月度上传档案统计</div>
<myecharts :width="'100%'" :height="'300px'" :data="overall_month_data"></myecharts>
</el-col>
<el-col :span="12" class="chartSize">
<div style="padding:10px;color:#b3241d;font-size:18px">组织档案统计</div>
<myecharts :width="'100%'" :height="'300px'" :data="overall_originze_data"></myecharts>
</el-col>
</el-row>
</div>
</template>
<script>
import myecharts from '@/components/myecharts';
import PanelGroup from './components/PanelGroup';
export default {
components: {
myecharts,
PanelGroup
},
data() {
return {
list: {},
overall_month_data: {},
overall_originze_data: {}
}
},
watch: {
},
created() {
this.init()
},
mounted() {
},
methods: {
init() {
this.overall_month_data = {
xShow: true,
yShow: true,
rotate: 0,
// formatter:function(params){
// return that.chartFomatter(params)
// },
x: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
list: [{
name: "上传数",
data: [3, 10, 12, 4, 20, 13, 1, 21, 8, 2, 1, 14],
type: 'bar',
barGap: '0%',
}]
}
this.overall_originze_data = {
trigger: 'item',
xShow: false,
yShow: false,
list: [{
name: '上传数',
type: 'pie',
radius: '80%',
// center:['20%','20%'],
data: [{
value: 30,
name: '集团'
},
{
value: 22,
name: '子公司'
}
],
label: {
show: false,
position: 'center'
},
}]
}
}
},
}
</script>
<style lang="scss" scoped>
.elrows {
// margin: 0 !important;
.el-col {
padding: 10px !important
}
.chartSize {
width: calc(50% - 20px)!important;
margin: 10px!important;
background: #fff;
}
}
</style>

@ -11,9 +11,9 @@
</div>
<div>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="resetSearch"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="resetSearch"></el-button>
</div>
<div v-if="catalogList.length>0">
<el-button type="primary" size="small" @click="editIndex('add')"></el-button>
@ -26,24 +26,24 @@
</div>
<div class="catalog">
<div class="catalog_left" :style="{'height': myHeight+'px',overflow:'scroll'}">
<!-- <div class="catalog_left" :style="{'height': myHeight+'px',overflow:'scroll'}">
<el-tree @node-click="getSelectedNodes" :data="catalogList" default-expand-all node-key="id" ref="tree"
highlight-current :props="defaultProps">
</el-tree>
</div>
</div> -->
<div class="catalog_right">
<xy-table @getHeight="initHeight" :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
:table-item="table_item">
<template v-slot:catalog_name>
<el-table-column align='left' label="所属目录" width="120" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.catalog_id_details && scope.row.catalog_id_details.length>0">
<el-tag style="margin-right:5px;margin-bottom:5px" v-for="item in scope.row.catalog_id_details">
{{item.name}}</el-tag>
</div>
</template>
</el-table-column>
<xy-table @getHeight="initHeight" :list="list" :total="total" @pageIndexChange="pageIndexChange"
@pageSizeChange="pageSizeChange" :table-item="table_item">
<template v-slot:catalog_name>
<el-table-column align='left' label="所属目录" width="120" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.catalog_id_details && scope.row.catalog_id_details.length>0">
<el-tag style="margin-right:5px;margin-bottom:5px" v-for="item in scope.row.catalog_id_details">
{{item.name}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:area_name>
<el-table-column align='left' label="所属区域" width="240" header-align="center">
@ -72,8 +72,10 @@
<!-- <el-button type="primary" size="small" @click="editIndex('child',scope.row.id,scope.row.name)"></el-button> -->
<el-button type="primary" size="small" @click="showIndex('show',scope.row.id)"></el-button>
<el-button v-if="stateObj.login_id===scope.row.admin_id || stateObj.roles.includes('admin')" type="primary" size="small" @click="editIndex('editor',scope.row.id)"></el-button>
<el-popconfirm v-if="stateObj.login_id===scope.row.admin_id || stateObj.roles.includes('admin')" style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button v-if="stateObj.login_id===scope.row.admin_id || stateObj.roles.includes('admin')"
type="primary" size="small" @click="editIndex('editor',scope.row.id)">编辑</el-button>
<el-popconfirm v-if="stateObj.login_id===scope.row.admin_id || stateObj.roles.includes('admin')"
style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
@ -110,9 +112,9 @@
page: 1,
page_size: 10,
catalog_id: ''
},
myHeight:0,
stateObj:{},
},
myHeight: 0,
stateObj: {},
total: 0,
list: [],
defaultProps: {
@ -122,8 +124,8 @@
catalogList: [],
table_item: [{
type: 'index',
width: 50,
fixed:'left'
width: 50,
fixed: 'left'
}, {
prop: 'title',
label: '标题',
@ -159,17 +161,20 @@
}
},
created() {
//
this.stateObj = state.state
console.log("this.stateObj",this.stateObj)
this.getCatalogList()
//
this.stateObj = state.state
console.log("this.stateObj", this.stateObj)
// this.getCatalogList()
if (this.$route.path) {
let path = this.$route.path.split("_")
this.select.catalog_id = path[1]
}
this.getList()
},
methods: {
initHeight(e){
console.log("e",e)
this.myHeight = e + 37
methods: {
initHeight(e) {
console.log("e", e)
this.myHeight = e + 37
},
async getCatalogList() {
const res = await index({
@ -196,8 +201,8 @@
editIndex(type, id) {
if (type == 'editor') {
this.$refs.addRecord.id = id
}else{
this.$refs.addRecord.setCheck(this.select.catalog_id)
} else {
this.$refs.addRecord.setCheck(this.select.catalog_id)
}
// if(this.select.catalog_id){
// this.$refs.addRecord.setCatalogId(this.select.catalog_id)
@ -219,22 +224,22 @@
this.select.page_size = e
this.select.page = 1
this.getList()
},
resetSearch(){
this.select.page = 1
this.select.title = ''
this.select.catalog_id = ''
this.getList()
},
resetSearch() {
this.select.page = 1
this.select.title = ''
// this.select.catalog_id = ''
this.getList()
},
async getList() {
const res = await index({
page_size: this.select.page_size,
page: this.select.page,
table_name: this.select.table_name,
json_data_fields: ['files', 'area_ids', 'tag_ids', 'catalog_id'],
is_auth: 1,
sort_type:'DESC',
sort_name:'date',
json_data_fields: ['files', 'area_ids', 'tag_ids', 'catalog_id'],
is_auth: 1,
sort_type: 'DESC',
sort_name: 'date',
filter: [{
"key": "title",
"op": "like",
@ -282,18 +287,18 @@
}
.catalog {
display: flex;
// align-items: center;
justify-content: space-between;
// display: flex;
// // align-items: center;
// justify-content: space-between;
&_left {
width: 20%;
background: #fff;
padding: 10px;
}
// &_left {
// width: 20%;
// background: #fff;
// padding: 10px;
// }
&_right {
width: 79%
}
// &_right {
// width: 79%
// }
}
</style>

@ -34,9 +34,10 @@
style="width: 100%; margin-bottom: 20px"
row-key="id"
border
default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<!-- default-expand-all -->
<el-table-column type="index" align="center"> </el-table-column>
<el-table-column prop="name" label="菜单" sortable width="180">
</el-table-column>

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: '/Users/mac/Documents/朗业/2024/s-四世同堂-档案/sstt_dangan/public/admin_test',
outputDir: '/Users/mac/Documents/朗业/2024/s-四世同堂-档案/sstt_dangan/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save