master
xy 1 year ago
parent 7bab8e176a
commit 4aa5a6abea

@ -18,8 +18,7 @@ export default {
type: Array,
default: () => []
},
text: String,
subText: String
title: String,
},
data() {
return {
@ -39,15 +38,15 @@ export default {
},
setOptions() {
this.chart.setOption(this.options)
this.setGraphics()
this.chart?.setOption(this.options)
//this.setGraphics()
},
setGraphics () {
const getPointOnCircle = (angle, radiusPercent) => {
let radian = (angle - 90 - 12) * Math.PI / 180;
let radius = this.chart.getWidth() / 2 * radiusPercent / 100;
let x = this.chart.getWidth() / 2 + Math.cos(radian) * radius;
let y = this.chart.getHeight() / 2 + Math.sin(radian) * radius;
let y = this.chart.getHeight() / 2 + Math.sin(radian) * radius - this.chart.getHeight() * 0.1;
return {x: x, y: y};
}
let graphicElements = [];
@ -73,7 +72,7 @@ export default {
shape: {
cx: pointStart.x,
cy: pointStart.y,
r: 4
r: 3
},
style: {
fill: '#fff'
@ -85,7 +84,7 @@ export default {
shape: {
cx: pointEnd.x,
cy: pointEnd.y,
r: 4
r: 3
},
style: {
fill: '#fff'
@ -105,7 +104,6 @@ export default {
},
computed: {
options () {
const _this = this;
return {
legend: {
show: true,
@ -120,7 +118,7 @@ export default {
{
type: 'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
center: ['50%','40%'],
padAngle: 4,
itemStyle: {
borderRadius: 10,
@ -129,14 +127,11 @@ export default {
label: {
show: true,
position: 'center',
formatter: `${_this.title||""}\n${_this.title ? '' : '{b}'}{d}%`
formatter: `{b}\n{d}%`
},
emphasis: {
label: {
show: true,
fontSize: 15,
fontWeight: 'bold'
}
avoidLabelOverlap: true, //
emphasis: { //
scale: true //item
},
labelLine: {
show: false
@ -144,8 +139,8 @@ export default {
data: (() => {
if (this.percent || this.percent === 0) {
return [
{ value: parseFloat(this.percent), name: '完成率' },
{ value: 100 - parseFloat(this.percent), name: '未完成率' }
{ value: parseFloat(this.percent), name: `${this.title}` },
{ value: 100 - parseFloat(this.percent), name: `${this.title}` }
]
} else {
return this.chartData

@ -1 +1 @@
<svg t="1718610790436" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13778" width="200" height="200"><path d="M896 128l0 832-672 0c-53.024 0-96-42.976-96-96s42.976-96 96-96l608 0 0-768-640 0c-70.4 0-128 57.6-128 128l0 768c0 70.4 57.6 128 128 128l768 0 0-896-64 0z" fill="currentColor" p-id="13779"></path><path d="M224.064 832l0 0c-0.032 0-0.032 0-0.064 0-17.664 0-32 14.336-32 32s14.336 32 32 32c0.032 0 0.032 0 0.064 0l0 0 607.904 0 0-64-607.904 0z" fill="currentColor" p-id="13780"></path></svg>
<svg t="1718780467407" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="34462" width="200" height="200"><path d="M947.701961 623.435294l-694.713725 0q-11.043137 0-23.090196 6.023529t-22.588235 18.070588-17.066667 28.611765-6.52549 37.647059 5.521569 39.152941 14.556863 32.12549 22.086275 22.086275 28.109804 8.031373l693.709804 0q-12.047059-12.047059-21.082353-27.105882-8.031373-13.05098-14.556863-31.121569t-6.52549-41.160784q0-26.101961 6.52549-43.168627t14.556863-28.109804q9.035294-12.047059 21.082353-21.082353zM947.701961 897.505882q0 17.066667-22.086275 17.066667l-733.866667 0q-34.133333 0-57.223529-14.054902t-37.647059-38.65098-20.580392-58.729412-6.023529-73.286275l0-582.27451q0-77.301961 41.160784-111.937255t117.458824-34.635294l34.133333 0 68.266667 0 93.364706 0q51.2 0 104.909804-0.501961t104.909804-0.501961l94.368627 0 70.27451 0 35.137255 0q28.109804 0 49.192157 11.545098t35.137255 32.12549 21.584314 48.690196 7.529412 60.235294l0 406.588235q-191.74902 0-345.34902-1.003922l-128.501961 0q-64.25098 0-114.94902-0.501961t-83.827451-0.501961l-37.145098 0q-21.082353 0-41.160784 12.54902t-36.141176 34.133333-26.101961 50.196078-10.039216 59.733333q0 38.14902 10.541176 68.768627t27.607843 51.701961 37.647059 32.627451 40.658824 11.545098l685.678431 0q8.031373 0 14.556863 4.517647t6.52549 14.556863zM515.011765 0l0 388.517647 77.301961-108.423529 76.298039 108.423529 0-388.517647-153.6 0z" p-id="34463" fill="#3171f4"></path></svg>

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1 @@
<svg t="1718777251258" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8538" width="200" height="200"><path d="M749.952 528.16l189.344 107.136c11.2 6.272 18.176 18.112 18.208 30.944v214.176a35.616 35.616 0 0 1-18.24 30.944l-189.312 107.04a37.184 37.184 0 0 1-36.448 0l-189.312-107.136a35.616 35.616 0 0 1-18.24-30.944v-214.176c0-12.8 6.88-24.64 18.24-30.944l189.312-107.2a37.184 37.184 0 0 1 36.48 0.064v0.096zM792.736 0.384c50.4 0 91.296 40 91.296 89.44V480a17.856 17.856 0 0 1-9.184 15.424c-5.664 3.2-12.576 3.2-18.24 0l-65.536-36.992a120.704 120.704 0 0 0-118.656 0l-189.12 107.008a115.968 115.968 0 0 0-59.36 100.8v268.16a18.144 18.144 0 0 1-18.24 17.888h-286.72a92.256 92.256 0 0 1-64.64-26.24 88.512 88.512 0 0 1-26.688-63.136V89.824C27.648 40.448 68.544 0.384 118.944 0.384h673.792z m-60.992 716.544a51.968 51.968 0 0 0-52.544 51.424c0 28.48 23.52 51.52 52.544 51.52a51.968 51.968 0 0 0 52.448-51.52 51.968 51.968 0 0 0-52.48-51.424z m-322.88-344.96H204.352a37.184 37.184 0 0 0 0 74.368h204.576a37.184 37.184 0 0 0 0-74.4z m278.976-185.984H204.32a37.184 37.184 0 1 0 0 74.368h483.52a37.184 37.184 0 0 0 0-74.368z" fill="#3171f4" p-id="8539"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1 @@
<svg t="1718780180782" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="33154" width="200" height="200"><path d="M97.434 699.7V244.837A31.955 31.955 0 0 1 112.64 217.6c49.715-30.669 215.5-112.845 408.678 10.189 184.013-118.58 355.38-46.285 409.652-10.701 8.908 5.837 14.182 15.923 14.182 26.573v453.53c0 15.41-15.872 25.804-29.952 19.455-62.464-28.108-215.603-76.697-393.933 15.412-169.779-82.996-296.294-53.146-394.445-12.698-14.028 5.786-29.388-4.506-29.388-19.66z" fill="#3171f4" p-id="33155"></path><path d="M913.408 857.805c-6.144 0-12.34-1.843-17.766-5.683-6.503-4.557-163.994-111.821-360.09-3.636a30.664 30.664 0 0 1-33.024-2.15c-161.28-118.272-370.893 0.614-372.992 1.792a30.72 30.72 0 0 1-41.984-11.213 30.72 30.72 0 0 1 11.213-41.984c9.728-5.632 233.933-132.659 424.09-9.267 222.822-112.026 400.69 10.854 408.32 16.282a30.746 30.746 0 0 1 7.27 42.854 30.433 30.433 0 0 1-25.037 13.005z" fill="#3171f4" p-id="33156"></path></svg>

After

Width:  |  Height:  |  Size: 982 B

@ -0,0 +1 @@
<svg t="1718779194387" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="24951" width="200" height="200"><path d="M834.258824 620.423529V219.858824c0-18.070588-12.047059-30.117647-30.117648-30.117648h-183.717647v-24.094117c0-18.070588-12.047059-30.117647-30.117647-30.117647h-237.929411L189.741176 298.164706v322.258823H135.529412V783.058824c0 60.235294 48.188235 108.423529 108.423529 108.423529H783.058824c60.235294 0 108.423529-48.188235 108.423529-108.423529v-162.635295h-57.223529z m-349.364706-243.952941c15.058824 0 27.105882 12.047059 27.105882 27.105883s-12.047059 27.105882-27.105882 27.105882h-162.635294c-15.058824 0-27.105882-12.047059-27.105883-27.105882s12.047059-27.105882 27.105883-27.105883h162.635294z m-138.541177-156.611764v72.282352H271.058824l75.294117-72.282352zM298.164706 512c0-15.058824 12.047059-27.105882 27.105882-27.105882h162.635294c15.058824 0 27.105882 12.047059 27.105883 27.105882s-12.047059 27.105882-27.105883 27.105882h-162.635294c-15.058824 0-27.105882-12.047059-27.105882-27.105882z m355.388235 268.047059h-283.105882v-54.211765h283.105882v54.211765z m21.082353-159.62353h-54.211765V243.952941h54.211765v376.470588z m105.411765 0h-54.211765V243.952941h54.211765v376.470588z" p-id="24952" fill="#3171f4"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -1,7 +1,8 @@
<template>
<el-card class="box-card" shadow="hover">
<div slot="header" class="clearfix">
<span style="border-left: 3px solid #338de3ff; padding-left: 6px"
<SvgIcon style="color: #3171f4;width: 22px;height: 22px;" icon-class="tushu"></SvgIcon>
<span style="padding-left: 15px"
>图书统计</span
>
<DatePicker
@ -9,32 +10,39 @@
:value="select.date"
placeholder="选择所属年份"
placement="bottom"
style="width: 130px; float: right"
style="width: 130px; margin-left: auto;"
type="month"
format
@on-change="changeMonth"
></DatePicker>
</div>
<div class="progress-card">
<div class="progress-card-item">
<div class="progress-card-item__num">{{totalData.book.total}}</div>
<div class="progress-card-item__label">总计</div>
</div>
<div class="progress-card-item">
<div class="progress-card-item__num">{{totalData.book.no_return}}</div>
<div class="progress-card-item__label">未归还</div>
</div>
<div class="progress-card-item">
<div class="progress-card-item__num">{{totalData.book.rate+'%'}}</div>
<div class="progress-card-item__label">{{(totalData.book.rate>0?'上升':(totalData.book.rate===0?'-':'下降'))}}</div>
</div>
<MyProgress width="213px" height="213px" :chart-data="chartData"></MyProgress>
<!-- <div class="progress-card-item">-->
<!-- <div class="progress-card-item__num">{{totalData.book.total}}</div>-->
<!-- <div class="progress-card-item__label">总计</div>-->
<!-- </div>-->
<!-- <div class="progress-card-item">-->
<!-- <div class="progress-card-item__num">{{totalData.book.no_return}}</div>-->
<!-- <div class="progress-card-item__label">未归还</div>-->
<!-- </div>-->
<!-- <div class="progress-card-item">-->
<!-- <div class="progress-card-item__num">{{totalData.book.rate+'%'}}</div>-->
<!-- <div class="progress-card-item__label">{{(totalData.book.rate>0?'上升':(totalData.book.rate===0?'-':'下降'))}}</div>-->
<!-- </div>-->
</div>
</el-card>
</template>
<script>
import MyProgress from "@/components/Progress"
import { httpCurl } from "@/api/out";
import SvgIcon from "@/components/SvgIcon/index.vue";
export default {
components: {
SvgIcon,
MyProgress
},
name: "card5",
layout: {
x: 0,
@ -89,7 +97,20 @@ export default {
this.totalData = res;
},
},
computed: {},
computed: {
chartData () {
return [
{
name:'已归还',
value: this.totalData.book.total??0-this.totalData.book.no_return??0
},
{
name:'未归还',
value: this.totalData.book.no_return??0
}
]
}
},
async created() {
await this.getToken();
await this.getStatic();
@ -98,9 +119,14 @@ export default {
</script>
<style scoped lang="scss">
.clearfix {
display: flex;
align-items: center;
}
.progress-card {
display: flex;
justify-content: center;
align-items: center;
&-item {
text-align: center;
flex: 1;

@ -1,7 +1,7 @@
<template>
<el-card class="box-card" shadow="hover">
<div slot="header" class="clearfix">
<SvgIcon style="color: #3171f4;width: 22px;height: 22px;" icon-class="notice"></SvgIcon>
<SvgIcon style="color: #3171f4;width: 22px;height: 22px;" icon-class="book"></SvgIcon>
<span style="padding-left: 15px"
>图书借阅统计</span
>
@ -17,26 +17,20 @@
></DatePicker>
</div>
<div class="progress-card">
<div class="progress-card-item">
<div class="progress-card-item__num">{{ totalData.borrow.total }}</div>
<div class="progress-card-item__label">借出</div>
</div>
<div class="progress-card-item">
<div class="progress-card-item__num">
{{ totalData.borrow.rate + "%" }}
</div>
<div class="progress-card-item__label">借出量</div>
</div>
<MyProgress class="progress-card-item" width="213px" height="213px" title="借出量" :percent="totalData.borrow.rate"></MyProgress>
</div>
</el-card>
</template>
<script>
import MyProgress from "@/components/Progress/index.vue";
import SvgIcon from "@/components/SvgIcon/index.vue";
import { httpCurl } from "@/api/out";
export default {
components: {
SvgIcon
SvgIcon,
MyProgress
},
name: "card6",
layout: {
@ -112,6 +106,9 @@ export default {
display: flex;
&-item {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
flex: 1;

@ -1,25 +1,29 @@
<template>
<el-card class="box-card" shadow="hover" id="department-card">
<div slot="header">
<span style="border-left: 3px solid #338de3ff; padding-left: 6px"
<div slot="header" class="clearfix">
<SvgIcon style="color: #3171f4;width: 22px;height: 22px;" icon-class="form"></SvgIcon>
<span style=" padding-left: 15px"
>科室执行情况</span
>
<i class="el-icon-more" style="float: right; font-size: 20px"></i>
<i class="el-icon-more" style="margin-left: auto; font-size: 20px"></i>
</div>
<div style="position: relative;height: 100%;width: 100%;">
<div style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;">
<Table :height="tableHeight" size="small" :data="departmentList" :columns="table"></Table>
</div>
<div id="department-chart"></div>
</div>
</el-card>
</template>
<script>
import * as echarts from "echarts";
import { moneyFormatter } from "@/utils";
import ElementResize from 'element-resize-detector'
import SvgIcon from "@/components/SvgIcon/index.vue";
export default {
components: {
SvgIcon
},
name: "card3",
layout: {
x: 0,
@ -65,6 +69,7 @@ export default {
},
data() {
return {
chart: "",
tableHeight: 200,
table: [
{
@ -129,14 +134,97 @@ export default {
};
},
methods: {
setOptions() {
this.chart.setOption({
grid: {
left: "15%"
},
tooltip: {
show: true
},
legend: {
show: true
},
xAxis: {
data: this.departmentList.map((item) => item.plan_department.name),
},
yAxis: {
axisLabel: {
color: '#999'
}
},
series: [
{
barWidth: 40,
type: 'bar',
stack: "a",
name: "合计金额(元)",
label: {
show: true,
color: "#fff",
formatter: (params) => {
console.log(params)
let m2 = params?.money_total_2 || 0;
let m1 = params?.money_total_1 || 0;
let m3 = params?.use_money_total || 0;
let per = 0;
if (m2 != 0) {
per = ((m3 / m2) * 100).toFixed(2);
} else if (m1 != 0) {
per = ((m3 / m1) * 100).toFixed(2);
}
return Number(per) + "%";
},
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 1, color: '#83bff6' },
{ offset: 0.5, color: '#188df0' },
{ offset: 0, color: '#188df0' }
]),
},
emphasis: {
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 1, color: '#4f86f5' },
{ offset: 0.3, color: '#3f79f1' },
{ offset: 0, color: '#3171f4' }
])
}
},
data: this.departmentList.map(item => (parseFloat(item.money_total_2) ? parseFloat(item.money_total_2) : parseFloat(item.money_total_1) - parseFloat(item.use_money_total))),
},
{
barWidth: 40,
type: "bar",
stack: "a",
name: "已使用金额(元)",
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#b4cef3' },
{ offset: 0.5, color: '#aecbf5' },
{ offset: 1, color: '#9fc4f9' }
]),
borderRadius: [20, 20, 0, 0]
},
data: this.departmentList.map(item => parseFloat(item.use_money_total))
}
]
})
},
init() {
this.chart = echarts.init(document.getElementById("department-chart"));
//this.setOptions();
let cardDom = document.getElementById('department-card');
let cardTitleH = 58;
const elementResize = ElementResize({
strategy:'scroll'
})
elementResize.listenTo(cardDom,ele => {
this.tableHeight = cardDom.getBoundingClientRect().height - 40 - cardTitleH
//this.setOptions()
this.chart.resize();
// this.tableHeight = cardDom.getBoundingClientRect().height - 40 - cardTitleH
})
}
},
@ -146,6 +234,14 @@ export default {
return this.getStatistic()?.statistic?.departmentList || [];
},
},
watch: {
departmentList: {
handler: function (newVal) {
this.setOptions()
},
immediate: false
}
},
created() {},
mounted() {
this.init();
@ -154,6 +250,10 @@ export default {
</script>
<style scoped lang="scss">
.clearfix {
display: flex;
align-items: center;
}
::v-deep .el-progress--line {
display: flex;
align-items: center;
@ -165,4 +265,9 @@ export default {
width: 100%;
height: calc(100% - 58px);
}
#department-chart {
width: 100%;
height: 100%;
min-height: 200px;
}
</style>

@ -1,14 +1,13 @@
<template>
<el-card class="box-card" shadow="hover">
<div slot="header" class="clearfix">
<span style="border-left: 3px solid #338de3ff; padding-left: 6px"
>快捷菜单</span
>
<Button v-if="/^\/system+/.test($route.path)" style="float: right" size="small" type="primary" @click="isShow = true"></Button>
<SvgIcon style="color: #3171f4;width: 22px;height: 22px;" icon-class="caidan"></SvgIcon>
<span style="padding-left: 15px">快捷菜单</span>
<Button v-if="/^\/system+/.test($route.path)" style="margin-left: auto;" size="small" type="primary" @click="isShow = true"></Button>
</div>
<div class="menu-container">
<div v-for="(item, index) in myMenus" :key="item.id" class="menu-item">
<div v-for="(item, index) in myMenus" :key="item.id" class="menu-item" :class="`quick-btn${(index+1)%4}`">
<div style="display: flex;align-items: center;" @click="linkTo(item)">
<el-image v-if="item.image" style="max-width: 26px;margin-right: 6px;" fit="contain" :src="item.image ? item.image.url : ''">
<template #error>
@ -133,11 +132,16 @@
</template>
<script>
import { index, show, save, destroy } from "@/api/system/diyMenu";
import { listmenu } from "@/api/system/menu";
import { deepCopy } from '@/utils';
import { getAuthMenu } from "@/api/user"
import SvgIcon from "@/components/SvgIcon/index.vue";
export default {
components: {
SvgIcon,
},
name: "card7",
layout: {
x: 0,
@ -301,6 +305,18 @@ export default {
</script>
<style scoped lang="scss">
$colors: linear-gradient(90deg, #ffa175 0%, #fd635d 99%, #fd635d 100%),linear-gradient(90deg, #d38ff3 0%, #c359fb 99%, #c359fb 100%),linear-gradient(90deg, #ffb737 0%, #ff9f3b 100%),linear-gradient(90deg, #4bcbf1 0%, #3ba7ef 99%, #3ba7ef 100%), linear-gradient(to left, #b3ffab, #12fff7);
$shadow: rgba(254,102,94,0.35),rgba(195,89,251,0.35),rgba(255,159,60,0.35),rgba(11,196,208,0.35),rgba(179,255,171,0.35);
@for $index from 1 through length($colors) {
.quick-btn#{$index} {
filter: drop-shadow(1.462px 4.782px 10px nth($shadow, $index));
background: nth($colors, $index);
}
}
.clearfix {
display: flex;
align-items: center;
}
::v-deep .el-input__inner {
text-align: left;
}
@ -313,11 +329,12 @@ export default {
flex-wrap: wrap;
.menu-item {
background: $primaryColor;
//background: $primaryColor;
color: #fff;
border-radius: 5px;
border-radius: 10px;
font-weight: 600;
padding: 10px 20px;
padding: 14px 20px;
position: relative;
margin: 5px;

@ -1,10 +1,11 @@
<template>
<el-card class="box-card" shadow="hover" id="type-card">
<div slot="header">
<span style="border-left: 3px solid #338de3ff; padding-left: 6px"
<div slot="header" class="clearfix">
<SvgIcon style="color: #3171f4;width: 22px;height: 22px;" icon-class="wengao"></SvgIcon>
<span style="padding-left: 15px"
>预算类型执行情况</span
>
<i class="el-icon-more" style="float: right; font-size: 20px"></i>
<i class="el-icon-more" style="margin-left: auto; font-size: 20px"></i>
</div>
<div id="type-card-body" style="position: relative;height: 100%;width: 100%;">
@ -19,8 +20,12 @@
import ElementResize from "element-resize-detector";
import { moneyFormatter } from "@/utils";
import echarts from 'echarts'
import SvgIcon from "@/components/SvgIcon/index.vue";
export default {
components: {
SvgIcon
},
name: "card3",
layout: {
x: 0,
@ -279,8 +284,18 @@ export default {
</script>
<style scoped lang="scss">
.clearfix {
display: flex;
align-items: center;
}
::v-deep .el-card__body {
width: 100%;
height: calc(100% - 58px);
}
::v-deep .ivu-table th,::v-deep .ivu-table td {
border-bottom-style: dashed;
}
::v-deep .el-progress {
white-space: nowrap;
}
</style>

Loading…
Cancel
Save