master
xy 2 years ago
parent 985e8be5b8
commit 2a7203b9a5

@ -44,3 +44,12 @@ export function chart(params, isLoading = true) {
isLoading: true
})
}
export function home(params,isLoading = true) {
return request({
method: 'get',
url: '/api/admin/user/home',
params,
isLoading: true
})
}

@ -113,8 +113,11 @@
tinymce.init({});
},
watch: {
value(newValue) {
this.myValue = newValue;
value: {
handler: function (newValue) {
this.myValue = newValue;
},
immediate: true
},
myValue(newValue) {
this.$emit("input", newValue);

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList(true)"
@click="getList"
>搜索</el-button
>
</template>
@ -121,19 +121,57 @@
/>
<vxe-column
align="center"
field="user_way"
width="180"
title="方式"
:edit-render="{
name: 'VxeSelect',
options: [
{ value: 1, label: '裸分' },
{ value: 2, label: '总分' },
],
props: { multiple: false },
optionProps: { value: 'value', label: 'label' },
}"
header-align="center"
align="right"
field="chong_max"
width="160"
title="“冲”分数-上限"
:edit-render="{ name: 'input', attrs: { type: 'number' } }"
/>
<vxe-column
header-align="center"
align="right"
field="chong_min"
width="160"
title="“冲”分数-下限"
:edit-render="{ name: 'input', attrs: { type: 'number' } }"
/>
<vxe-column
header-align="center"
align="right"
field="bao_max"
width="160"
title="“保”分数-上限"
:edit-render="{ name: 'input', attrs: { type: 'number' } }"
/>
<vxe-column
header-align="center"
align="right"
field="bao_min"
width="160"
title="“保”分数-下限"
:edit-render="{ name: 'input', attrs: { type: 'number' } }"
/>
<vxe-column
header-align="center"
align="right"
field="wen_max"
width="160"
title="“稳”分数-上限"
:edit-render="{ name: 'input', attrs: { type: 'number' } }"
/>
<vxe-column
header-align="center"
align="right"
field="wen_min"
width="160"
title="“稳”分数-下限"
:edit-render="{ name: 'input', attrs: { type: 'number' } }"
/>
<vxe-column
@ -263,7 +301,17 @@ export default {
school_way: "",
user_way: "",
chong_max: "",
chong_min: "",
bao_max: "",
bao_min: "",
wen_max: "",
wen_min: "",
},
validRules: {
school_way: [
@ -416,10 +464,7 @@ export default {
}
},
async getList(isRefresh=false) {
if(isRefresh) {
this.select.page = 1
}
async getList() {
this.loading = true;
try {
const res = await index(this.select, false);

@ -20,7 +20,7 @@
size="small"
>
<div class="form-layout">
<el-form-item label="名称" prop="name">
<el-form-item label="名称" prop="name" class="span2">
<el-input
v-model="form['name']"
clearable
@ -45,31 +45,76 @@
v-model="form['school_way']"
clearable
placeholder="请填写计算几年平均分"
:precision="0"
:min="1"
:max="10"
:precision="2"
controls-position="right"
style="width: 100%"
></el-input-number>
</el-form-item>
<el-form-item label="方式" prop="user_way" clearable>
<el-select
v-model="form['user_way']"
<el-form-item label="“冲”分数-上限" prop="chong_max">
<el-input-number
v-model="form['chong_max']"
clearable
placeholder="请填写“冲”分数-上限"
:precision="2"
controls-position="right"
style="width: 100%"
></el-input-number>
</el-form-item>
<el-form-item label="“冲”分数-下限" prop="chong_min">
<el-input-number
v-model="form['chong_min']"
clearable
placeholder="请填写“冲”分数-下限"
:precision="2"
controls-position="right"
style="width: 100%"
></el-input-number>
</el-form-item>
<el-form-item label="“保”分数-上限" prop="bao_max">
<el-input-number
v-model="form['bao_max']"
clearable
placeholder="请填写“保”分数-上限"
:precision="2"
controls-position="right"
style="width: 100%"
></el-input-number>
</el-form-item>
<el-form-item label="“保”分数-下限" prop="bao_min">
<el-input-number
v-model="form['bao_min']"
clearable
placeholder="请填写“保”分数-下限"
:precision="2"
controls-position="right"
style="width: 100%"
></el-input-number>
</el-form-item>
<el-form-item label="“稳”分数-上限" prop="wen_max">
<el-input-number
v-model="form['wen_max']"
clearable
placeholder="请填写“稳”分数-上限"
:precision="2"
controls-position="right"
style="width: 100%"
></el-input-number>
</el-form-item>
<el-form-item label="“稳”分数-下限" prop="wen_min">
<el-input-number
v-model="form['wen_min']"
clearable
placeholder="请填写方式"
placeholder="请填写“稳”分数-下限"
:precision="2"
controls-position="right"
style="width: 100%"
>
<el-option
v-for="(option, optionIndex) in [
{ value: 1, label: '裸分' },
{ value: 2, label: '总分' },
]"
:key="optionIndex"
:label="option['label']"
:value="option['value']"
></el-option>
</el-select>
></el-input-number>
</el-form-item>
</div>
</el-form>
@ -114,7 +159,17 @@ export default {
school_way: "",
user_way: "",
chong_max: "",
chong_min: "",
bao_max: "",
bao_min: "",
wen_max: "",
wen_min: "",
},
rules: {
school_way: [
@ -194,7 +249,17 @@ export default {
school_way: "",
user_way: "",
chong_max: "",
chong_min: "",
bao_max: "",
bao_min: "",
wen_max: "",
wen_min: "",
};
this.$refs["elForm"].resetFields();
},

@ -23,8 +23,28 @@
{{ typeof form['school_way'] === 'number' ? form['school_way'].toFixed(2) : form['school_way'] }}
</el-descriptions-item>
<el-descriptions-item label="方式">
{{ [{'value':1,'label':'裸分'},{'value':2,'label':'总分'}].find(i => i['value'] === form['user_way']) ? [{'value':1,'label':'裸分'},{'value':2,'label':'总分'}].find(i => i['value'] === form['user_way'])['label'] : '' }}
<el-descriptions-item label="“冲”分数-上限">
{{ typeof form['chong_max'] === 'number' ? form['chong_max'].toFixed(2) : form['chong_max'] }}
</el-descriptions-item>
<el-descriptions-item label="“冲”分数-下限">
{{ typeof form['chong_min'] === 'number' ? form['chong_min'].toFixed(2) : form['chong_min'] }}
</el-descriptions-item>
<el-descriptions-item label="“保”分数-上限">
{{ typeof form['bao_max'] === 'number' ? form['bao_max'].toFixed(2) : form['bao_max'] }}
</el-descriptions-item>
<el-descriptions-item label="“保”分数-下限">
{{ typeof form['bao_min'] === 'number' ? form['bao_min'].toFixed(2) : form['bao_min'] }}
</el-descriptions-item>
<el-descriptions-item label="“稳”分数-上限">
{{ typeof form['wen_max'] === 'number' ? form['wen_max'].toFixed(2) : form['wen_max'] }}
</el-descriptions-item>
<el-descriptions-item label="“稳”分数-下限">
{{ typeof form['wen_min'] === 'number' ? form['wen_min'].toFixed(2) : form['wen_min'] }}
</el-descriptions-item>
</el-descriptions>
@ -58,7 +78,17 @@
school_way: '',
user_way: '',
chong_max: '',
chong_min: '',
bao_max: '',
bao_min: '',
wen_max: '',
wen_min: '',
},
}

@ -179,6 +179,24 @@
:edit-render="{ name: 'input', attrs: { type: 'number' } }"
/>
<vxe-column
header-align="center"
align="right"
field="physical_score"
width="160"
title="体育成绩"
:edit-render="{ name: 'input', attrs: { type: 'number' } }"
/>
<vxe-column
header-align="center"
align="right"
field="hearing_score"
width="160"
title="口语听力"
:edit-render="{ name: 'input', attrs: { type: 'number' } }"
/>
<vxe-column
align="center"
field="year"
@ -386,21 +404,15 @@ export default {
tableData: [],
form: {
id: "",
name: "",
nationality: "",
anticipate_score: "",
physical_score: "",
hearing_score: "",
year: "",
sex: "",
area_id: "",
is_stable: "",
is_bare: "",
},
validRules: {},

@ -49,6 +49,28 @@
></el-input-number>
</el-form-item>
<el-form-item label="体育成绩" prop="physical_score">
<el-input-number
v-model="form['physical_score']"
clearable
placeholder="请填写体育成绩"
:precision="2"
controls-position="right"
style="width: 100%"
></el-input-number>
</el-form-item>
<el-form-item label="口语听力" prop="hearing_score">
<el-input-number
v-model="form['hearing_score']"
clearable
placeholder="请填写口语听力"
:precision="2"
controls-position="right"
style="width: 100%"
></el-input-number>
</el-form-item>
<el-form-item label="年份" prop="year" clearable>
<el-date-picker
v-model="form['year']"
@ -180,7 +202,8 @@ export default {
nationality: "",
anticipate_score: "",
physical_score: "",
hearing_score: "",
year: "",
sex: "",
@ -250,7 +273,8 @@ export default {
nationality: "",
anticipate_score: "",
physical_score: "",
hearing_score: "",
year: "",
sex: "",

@ -158,16 +158,7 @@
title="学校类型"
:edit-render="{
name: 'VxeSelect',
options: [
{ label: '初中', value: '初中' },
{ label: '中专', value: '中专' },
{ label: '3+3', value: '3+3' },
{ label: '五年制大专', value: '五年制大专' },
{ label: '中本贯通5+2', value: '中本贯通5+2' },
{ label: '中本贯通3+4', value: '中本贯通3+4' },
{ label: '综合高中', value: '综合高中' },
{ label: '高中', value: '高中' },
],
options: schoolType,
props: { multiple: true },
optionProps: { value: 'value', label: 'label' },
}"
@ -343,6 +334,7 @@
<AddSchool
ref="AddSchool"
:area="area"
:school-type="schoolType"
:is-show.sync="isShowAdd"
@refresh="getList"
/>
@ -370,6 +362,7 @@ import axios from "axios";
import { getToken } from "@/utils/auth";
import { download } from "@/utils/downloadRequest"
import { index as areaIndex } from "@/api/area/area";
import { getparameter } from "@/api/system/dictionary"
export default {
name: "School",
@ -403,32 +396,26 @@ export default {
'filter[2][key]': 'star',
'filter[2][op]': 'like',
'filter[2][value]': '',
'filter[3][key]': 'from',
'filter[3][op]': 'eq',
'filter[3][value]': '',
},
total: 0,
allAlign: null,
tableData: [],
form: {
id: "",
name: "",
area_id: "",
code: "",
star: "",
address: "",
nature: "",
type: "",
build_year: "",
introduce: "",
teacher: "",
from: 1
},
validRules: {
name: [
@ -447,6 +434,7 @@ export default {
},
area: [],
schoolType: [],
};
},
computed: {
@ -464,8 +452,10 @@ export default {
},
},
created() {
console.log(this.$route)
this.select['filter[3][value]'] = this.$route.meta?.params?.from
this.getArea();
this.getSchoolType();
this.getList();
},
mounted() {
@ -551,6 +541,22 @@ export default {
console.error(err);
}
},
async getSchoolType() {
try {
const { detail } = await getparameter(
{
number: 'school_type'
},
false
);
this.schoolType = detail?.map(i => ({
value: i.value,
label: i.value
}));
} catch (err) {
console.error(err);
}
},
uploadMethod(file) {
const formData = new FormData();

@ -100,16 +100,7 @@
style="width: 100%"
>
<el-option
v-for="(option, optionIndex) in [
{ label: '初中', value: '初中' },
{ label: '中专', value: '中专' },
{ label: '3+3', value: '3+3' },
{ label: '五年制大专', value: '五年制大专' },
{ label: '中本贯通5+2', value: '中本贯通5+2' },
{ label: '中本贯通3+4', value: '中本贯通3+4' },
{ label: '综合高中', value: '综合高中' },
{ label: '高中', value: '高中' },
]"
v-for="(option, optionIndex) in schoolType"
:key="optionIndex"
:label="option['label']"
:value="option['value']"
@ -126,8 +117,9 @@
></el-input>
</el-form-item>
<el-form-item label="学校介绍" prop="introduce">
<el-form-item label="学校介绍" prop="introduce" class="span2">
<my-tinymce
:key="key"
v-model="form['introduce']"
clearable
placeholder="请填写学校介绍"
@ -135,8 +127,9 @@
></my-tinymce>
</el-form-item>
<el-form-item label="教师信息" prop="teacher">
<el-form-item label="教师信息" prop="teacher" class="span2">
<my-tinymce
:key="key"
v-model="form['teacher']"
clearable
placeholder="请填写教师信息"
@ -177,9 +170,14 @@ export default {
type: Array,
default: () => [],
},
schoolType: {
type: Array,
default: () => [],
}
},
data() {
return {
key: 0,
uploadSize,
action: process.env.VUE_APP_UPLOAD_API,
loading: false,
@ -224,6 +222,7 @@ export default {
},
watch: {
isShow(newVal) {
++this.key;
this.visible = newVal;
},
visible(newVal) {
@ -305,6 +304,7 @@ export default {
if (valid) {
this.loading = true;
try {
this.form.from = this.$route.meta?.params?.from;
await save(this.form);
this.$message.success("新增成功");
this.$emit("refresh");

@ -9,9 +9,9 @@
import resize from './mixins/resize'
const animationDuration = 6000
export default {
mixins: [resize],
inject: ['statictis'],
props: {
className: {
type: String,
@ -24,9 +24,6 @@
height: {
type: String,
default: '500px'
},
chartData: {
type: Object
}
},
data() {
@ -34,19 +31,16 @@
chart: null
}
},
computed: {
myData() {
return this.statictis().list ?? []
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
beforeDestroy() {
if (!this.chart) {
return
@ -54,92 +48,104 @@
this.chart.dispose()
this.chart = null
},
watch: {
myData: {
handler(newVal) {
if (newVal && this.chart) {
this.$nextTick(_ => {
this.setOptions()
})
}
},
immediate: true
}
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons');
this.setOptions(this.chartData);
this.setOptions();
},
setOptions(chartdata) {
console.log(chartdata.xArr)
setOptions() {
const containerWidth = this.chart.getWidth();
const gridLeft = containerWidth * 0.04; // 对应grid的left: '3%'
const gridRight = containerWidth * 0.01; // 对应grid的right: '4%'
const rectWidth = containerWidth - gridLeft - gridRight;
this.chart.setOption({
dataZoom: [
//给x轴设置滚动条
{
startValue: 0,
endValue: 6, // 显示条数
type: 'slider',
show: true,
xAxisIndex: [0],
handleSize: 0, //滑动条的 左右2个滑动条的大小
height: 8, //组件高度
left: 50, //左边的距离
right: 40, //右边的距离
bottom: 26, //右边的距离
handleColor: '#EFEFEF', //h滑动图标的颜色
handleStyle: {
borderColor: '#409EFF',
borderWidth: '1',
shadowBlur: 2,
background: '#EFEFEF',
shadowColor: '#EFEFEF'
},
fillerColor: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
//给颜色设置渐变色 前面4个参数,给第一个设置1,第四个设置0 ,就是水平渐变
//给第一个设置0,第四个设置1,就是垂直渐变
offset: 0,
color: '#409EFF'
},
{
offset: 1,
color: '#409EFF'
}
]),
backgroundColor: '#EFEFEF', //两边未选中的滑动条区域的颜色
showDataShadow: false, //是否显示数据阴影 默认auto
showDetail: false, //即拖拽时候是否显示详细数值信息 默认true
handleIcon: 'M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z',
filterMode: 'filter'
title: {
text: '趋势',
left: 'left',
textStyle: {
color: "#000",
}
//下面这个属性是里面拖到
// {
// type: 'inside',
// show: true,
// xAxisIndex: [0],
// start: 0, //默认为1
// end: 50,
// },
],
},
grid: {
top: 10,
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true
left: '4%',
right: '1%',
},
xAxis: [{
type: 'category',
data: chartdata.xArr,
axisTick: {
alignWithLabel: true
}
}],
yAxis: [{
type: 'value',
minInterval: 1,
tooltip: {
show: true
},
legend: {
show: true
},
xAxis: {
axisLabel: {
color: '#000',
fontSize: '16',
margin: 18
},
axisLine: {
show: false
},
axisTick: {
show: false
},
data: this.myData?.map(i => i.month ? this.$moment(i.month).format('MM月') : i.month)
},
yAxis: {
type: 'value',
axisLabel: {
color: '#1c1a1d'
},
axisLine: { //轴线
show: true,
lineStyle: {
color: "transparent"
}
},
splitLine: { //网格线
show: true
}
},
series: [
{
barWidth: 30,
type: 'bar',
name: '填报数量',
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 1, color: '#155ce0' },
{ offset: 0.2, color: '#155ce0' },
{ offset: 0, color: '#0093dd' }
]),
barBorderRadius: [8, 8, 0, 0]
},
data: this.myData?.map(i => i.total)
}
}],
series: [{
name: '数据',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: chartdata.yArr,
animationDuration
],
graphic: [ {
type: "rect",
bottom: '3%',
left: '4%',
shape: {
width: rectWidth,
height: 50
},
style: {
fill: "#eaeff3"
},
}]
})
}
}
}

@ -2,22 +2,22 @@
<div class="card">
<div class="title">
<div class="title__icon">
<svg viewBox="0 0 1024 1024" width="83" height="83"><path d="M450.1 501c118.8 0 215.5-98.4 215.5-219.3S568.9 62.5 450.1 62.5c-118.9 0-215.5 98.4-215.5 219.2S331.2 501 450.1 501zM524.9 522.1H377.4c-150 0-272.1 124.1-272.1 276.6v16.4c0 79.8 120.1 79.8 272.1 79.8h83.5c-26.8-43.6-42.6-94.8-42.6-149.8 0.1-90.1 41.7-170.4 106.6-223z" fill="#fff"></path><path d="M702.8 528.6c-119.2 0-215.9 96.9-215.9 216.4s96.6 216.4 215.9 216.4S918.7 864.5 918.7 745s-96.6-216.4-215.9-216.4z m96.1 270.3H691.3c-19.8 0-35.9-16.1-35.9-35.9V655.5c0-19.8 16.1-35.9 35.9-35.9s35.9 16.1 35.9 35.9v71.7h71.7c19.8 0 35.9 16.1 35.9 35.9 0 19.8-16.1 35.8-35.9 35.8z" fill="#fff"></path></svg>
<svg viewBox="0 0 1024 1024"><path d="M450.1 501c118.8 0 215.5-98.4 215.5-219.3S568.9 62.5 450.1 62.5c-118.9 0-215.5 98.4-215.5 219.2S331.2 501 450.1 501zM524.9 522.1H377.4c-150 0-272.1 124.1-272.1 276.6v16.4c0 79.8 120.1 79.8 272.1 79.8h83.5c-26.8-43.6-42.6-94.8-42.6-149.8 0.1-90.1 41.7-170.4 106.6-223z" fill="#fff"></path><path d="M702.8 528.6c-119.2 0-215.9 96.9-215.9 216.4s96.6 216.4 215.9 216.4S918.7 864.5 918.7 745s-96.6-216.4-215.9-216.4z m96.1 270.3H691.3c-19.8 0-35.9-16.1-35.9-35.9V655.5c0-19.8 16.1-35.9 35.9-35.9s35.9 16.1 35.9 35.9v71.7h71.7c19.8 0 35.9 16.1 35.9 35.9 0 19.8-16.1 35.8-35.9 35.8z" fill="#fff"></path></svg>
</div>
<div class="title__text">
<div class="title__text--name">访客量</div>
<div class="title__text--sub">描述文字</div>
<div class="title__text--sub">访客量</div>
</div>
</div>
<div class="title__data">
<div class="title__data-item">
<div class="title__data-item__num">2000</div>
<div class="title__data-item__text">今日访客</div>
<div class="title__data-item--num">{{ myData.todayVisitCount | resolveData }}</div>
<div class="title__data-item--text">今日访客</div>
</div>
<div class="title__data-item">
<div class="title__data-item__num">100000</div>
<div class="title__data-item__text">总计访客</div>
<div class="title__data-item--num">{{ myData.totalVisitCount | resolveData }}</div>
<div class="title__data-item--text">总计访客</div>
</div>
</div>
</div>
@ -25,19 +25,102 @@
<script>
export default {
inject: ['statictis'],
data() {
return {}
},
methods: {},
computed: {},
filters: {
resolveData(val) {
return val ?? 0
}
},
computed: {
myData() {
return this.statictis() ?? {}
}
},
}
</script>
<style scoped lang="scss">
@import "../index.scss";
.card {
border-radius: 7px;
border-radius: px2vw(7);
filter: drop-shadow(0 0 7.5px rgba(211,215,221,0.4));
background-color: #ffffff;
border: 1px solid #d8e2f0;
padding: px2vw(29) px2vw(52) px2vw(32) px2vw(52);
.title {
display: flex;
align-items: center;
&__icon {
width: px2vw(83);
height: px2vw(83);
background: linear-gradient(263deg, rgba(31,142,247) 0%, rgba(17,100,247,0.9981153777569027) 78%, rgba(17,100,247,0.9999999999999999) 78%);
padding: px2vw(20);
border-radius: px2vw(30);
}
&__text {
padding-left: px2vw(28);
&--name {
font-size: px2vw(20);
letter-spacing: px2vw(1);
color: #1c1a1d;
font-weight: 500;
padding-bottom: px2vw(12);
}
&--sub {
font-size: px2vw(16);
letter-spacing: px2vw(1);
color: #838383;
}
}
&__data {
margin-top: px2vw(32);
display: flex;
justify-content: space-between;
position: relative;
&::after {
content: "";
width: 2px;
background-color: #eaeaea;
position: absolute;
top: 0;
left: calc(50% - 1px);
bottom: 0;
}
&-item {
display: inline-block;
padding: 0 px2vw(60);
&--num {
font-weight: 500;
color: #0093dd;
font-size: px2vw(50);
letter-spacing: px2vw(3);
@supports (background-clip: text) {
background: linear-gradient(to bottom, #4090d7, #2b5bd4);
color: transparent;
background-clip: text;
}
}
&--text {
padding-top: px2vw(16);
font-size: px2vw(16);
letter-spacing: px2vw(1);
color: #1c1a1d;
}
}
}
}
}
</style>

@ -2,22 +2,22 @@
<div class="card">
<div class="title">
<div class="title__icon">
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="83" height="83"><path d="M883.2 192L601.6 467.2h-6.4l-96-96v-6.4L806.4 57.6c6.4-6.4 0-12.8-6.4-12.8H224c-51.2 0-96 44.8-96 96v748.8c0 51.2 44.8 96 96 96h569.6c51.2 0 96-44.8 96-96V198.4c0-6.4-6.4-12.8-6.4-6.4z m-416 217.6c0-6.4 6.4-6.4 12.8-6.4l83.2 83.2c6.4 6.4 0 12.8-6.4 12.8l-96 12.8c-6.4 0-6.4 0-6.4-6.4l12.8-96z m38.4 428.8h-256c-19.2 0-32-12.8-32-32s12.8-32 32-32h256c19.2 0 32 12.8 32 32 0 12.8-19.2 32-32 32z m224-153.6H243.2c-19.2 0-32-12.8-32-32s12.8-32 32-32h486.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z"></path></svg>
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M883.2 192L601.6 467.2h-6.4l-96-96v-6.4L806.4 57.6c6.4-6.4 0-12.8-6.4-12.8H224c-51.2 0-96 44.8-96 96v748.8c0 51.2 44.8 96 96 96h569.6c51.2 0 96-44.8 96-96V198.4c0-6.4-6.4-12.8-6.4-6.4z m-416 217.6c0-6.4 6.4-6.4 12.8-6.4l83.2 83.2c6.4 6.4 0 12.8-6.4 12.8l-96 12.8c-6.4 0-6.4 0-6.4-6.4l12.8-96z m38.4 428.8h-256c-19.2 0-32-12.8-32-32s12.8-32 32-32h256c19.2 0 32 12.8 32 32 0 12.8-19.2 32-32 32z m224-153.6H243.2c-19.2 0-32-12.8-32-32s12.8-32 32-32h486.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z" fill="#fff"></path></svg>
</div>
<div class="title__text">
<div class="title__text--name">填报量</div>
<div class="title__text--sub">描述文字</div>
<div class="title__text--sub">填报量</div>
</div>
</div>
<div class="title__data">
<div class="title__data-item">
<div class="title__data-item__num">2000</div>
<div class="title__data-item__text">今日填报</div>
<div class="title__data-item--num">{{ myData.todayFillCount | resolveData }}</div>
<div class="title__data-item--text">今日填报</div>
</div>
<div class="title__data-item">
<div class="title__data-item__num">100000</div>
<div class="title__data-item__text">总计填报</div>
<div class="title__data-item--num">{{ myData.totalFillCount | resolveData }}</div>
<div class="title__data-item--text">总计填报</div>
</div>
</div>
</div>
@ -25,19 +25,102 @@
<script>
export default {
inject: ['statictis'],
data() {
return {}
},
methods: {},
computed: {},
filters: {
resolveData(val) {
return val ?? 0
}
},
computed: {
myData() {
return this.statictis() ?? {}
}
},
}
</script>
<style scoped lang="scss">
@import "../index.scss";
.card {
border-radius: 7px;
border-radius: px2vw(7);
filter: drop-shadow(0 0 7.5px rgba(211,215,221,0.4));
background-color: #ffffff;
border: 1px solid #d8e2f0;
padding: px2vw(29) px2vw(52) px2vw(32) px2vw(52);
.title {
display: flex;
align-items: center;
&__icon {
width: px2vw(83);
height: px2vw(83);
background: linear-gradient(90deg, #f7a764 0%, #f7a764 1%, #e77816 97%, #e77816 100%);
padding: px2vw(20);
border-radius: px2vw(30);
}
&__text {
padding-left: px2vw(28);
&--name {
font-size: px2vw(20);
letter-spacing: px2vw(1);
color: #1c1a1d;
font-weight: 500;
padding-bottom: px2vw(12);
}
&--sub {
font-size: px2vw(16);
letter-spacing: px2vw(1);
color: #838383;
}
}
&__data {
margin-top: px2vw(32);
display: flex;
justify-content: space-between;
position: relative;
&::after {
content: "";
width: 2px;
background-color: #eaeaea;
position: absolute;
top: 0;
left: calc(50% - 1px);
bottom: 0;
}
&-item {
display: inline-block;
padding: 0 px2vw(60);
&--num {
font-weight: 500;
color: #e49a57;
font-size: px2vw(50);
letter-spacing: px2vw(3);
@supports (background-clip: text) {
background: linear-gradient(to bottom, #eeb580, #d97e35);
color: transparent;
background-clip: text;
}
}
&--text {
padding-top: px2vw(16);
font-size: px2vw(16);
letter-spacing: px2vw(1);
color: #1c1a1d;
}
}
}
}
}
</style>

@ -0,0 +1,117 @@
<template>
<div class="card">
<div class="title">
<div class="title__icon">
<div class="title__icon--main">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M675.10784 488.39168h96.27648l194.5344-167.54176c-8.4992-19.98848-18.0224-39.20896-28.83072-57.69728l-257.99168 221.7472-3.98848 3.49184M535.8592 20.1472v78.90944l79.20128-68.34176c-25.78432-5.40672-52.14208-9.28768-79.20128-10.56768m407.35232 468.24448l56.16128-48.34304c-3.40992-23.60832-8.95488-46.51008-15.6672-68.89472L847.3856 488.3968h95.83104v-0.00512m-160.79872-387.8912L535.8592 312.4224v82.86208l297.53856-256.4096a498.59072 498.59072 0 0 0-50.97984-38.3744M672.96256 46.37184L535.8592 164.3264v82.87744l200.89344-173.19936c-20.53632-10.48576-41.64608-20.00896-63.79008-27.63264m236.49792 174.94016a489.66656 489.66656 0 0 0-39.84384-47.7184L535.8592 460.544v27.8528h63.57504l310.02624-267.0848M489.2672 20.1472C228.05504 32.38912 19.88608 247.47008 19.88608 511.6416c0 114.37568 39.28064 219.35616 104.66816 302.92992l364.71296-313.6V20.1472m31.85152 514.76992l-366.22336 314.92608c89.87136 94.98112 216.64768 154.53184 357.6832 154.53184 264.20224 0 479.26784-208.19968 491.53024-469.4528h-482.99008z" fill="#ffffff"></path></svg>
</div>
</div>
<div class="title__text">
访问量
</div>
<div class="title__select">
<el-date-picker v-model="year" value-format="yyyy" type="year" placeholder="年份" @change="getData"></el-date-picker>
</div>
</div>
<BarChart id="visit-bar-chart" width="100%" height="36.8vh"></BarChart>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
export default {
components: {
BarChart
},
data() {
return {
year: new Date().getFullYear().toString()
}
},
methods: {
getData() {
this.$emit('change', this.year)
}
},
computed: {},
}
</script>
<style scoped lang="scss">
@import "../index.scss";
.card {
border-radius: px2vw(7);
filter: drop-shadow(0 0 7.5px rgba(211, 215, 221, 0.4));
background-color: #ffffff;
border: 1px solid #d8e2f0;
padding: px2vw(20) px2vw(46) px2vw(40) px2vw(20);
}
.title {
display: flex;
align-items: center;
&__icon {
width: px2vw(32);
height: px2vw(30);
position: relative;
&--main {
width: px2vw(28);
height: px2vw(28);
position: absolute;
bottom: 0;
right: 0;
background: rgba(158, 182, 252, 0.5);
border-radius: 100%;
padding: px2vw(5);
}
&::before {
content: '';
width: px2vw(28);
height: px2vw(28);
top: 0;
left: 0;
border-radius: 100%;
background: #3e8bd7;
position: absolute;
}
}
&__text {
font-size: px2vw(20);
letter-spacing: px2vw(1);
color: #1c1a1d;
font-weight: 500;
padding-left: px2vw(10);
}
&__select {
margin-left: auto;
::v-deep .el-date-editor--year {
width: px2vw(265) !important;
height: px2vw(41) !important;
}
::v-deep .el-input__inner {
width: px2vw(265) !important;
height: px2vw(41) !important;
background: #f5f7f9 !important;
border-radius: px2vw(8) !important;
font-size: px2vw(20) !important;
}
::v-deep .el-input__prefix {
height: px2vw(41) !important;
line-height: px2vw(41) !important;
}
::v-deep .el-input__icon {
height: px2vw(41) !important;
line-height: px2vw(41) !important;
}
::v-deep .el-input__suffix {
height: px2vw(41) !important;
line-height: px2vw(41) !important;
}
}
}
#visit-bar-chart {
margin-top: px2vw(38);
}
</style>

@ -0,0 +1,7 @@
// 将px转换为vw的混入函数
@function px2vw($px) {
@return ($px / 1668) * 100vw;
}
@function px2vh($px) {
@return ($px / 1066) * 100vh;
}

@ -1,8 +1,9 @@
<template>
<div>
<div style="padding-bottom: 20px;">
<div class="grid-container">
<Card1 style="grid-area: card1"></Card1>
<Card2 style="grid-area: card2"></Card2>
<VisitPanel style="grid-area: card3" @change="yearPick"></VisitPanel>
</div>
</div>
</template>
@ -10,17 +11,45 @@
<script>
import Card1 from './components/Card1.vue'
import Card2 from './components/Card2.vue'
import VisitPanel from "./components/VisitPanel.vue";
import { home } from '@/api/user/user'
export default {
components: {
Card1,
Card2
Card2,
VisitPanel
},
provide() {
return {
statictis: () => this.statictisData
}
},
data() {
return {};
return {
select: {
year: ''
},
statictisData: {}
};
},
watch: {},
methods: {},
created() {},
methods: {
yearPick(e) {
this.select.year = e
this.getData()
},
async getData() {
try {
const res = await home(this.select)
this.statictisData = res
} catch (err) {
console.error(err)
}
}
},
created() {
this.getData()
},
mounted() {},
destroyed() {
window.onresize = null;
@ -29,15 +58,17 @@ export default {
</script>
<style lang="scss" scoped>
@import "./index.scss";
.grid-container {
line-height: 1;
display: grid;
border-radius: 7px;
padding: 30px;
padding: px2vw(30);
margin-top: 20px;
background-color: #ffffff;
grid-template-rows: repeat(2, 1fr);
grid-template-rows: repeat(2, auto);
grid-template-columns: repeat(2, 1fr);
grid-template-areas: "card1 card2" "card3 card3";
grid-gap: 30px;
grid-gap: px2vw(30);
}
</style>

Loading…
Cancel
Save