Compare commits
3 Commits
8fb72b113b
...
9ec62aec5e
Author | SHA1 | Date | |
---|---|---|---|
9ec62aec5e | |||
6705afbee4 | |||
9b2a7d915c |
@ -5,4 +5,5 @@ VUE_APP_TITLE = 管理系统
|
||||
ENV = 'production'
|
||||
|
||||
# 管理系统/生产环境
|
||||
VUE_APP_BASE_API = ''
|
||||
# VUE_APP_BASE_API = 'http://101.34.131.16:8000'
|
||||
VUE_APP_BASE_API = '/api'
|
||||
|
136
src/views/dashboard/ColumnarChart.vue
Normal file
136
src/views/dashboard/ColumnarChart.vue
Normal file
@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<div :class="className" :style="{ height: height, width: width }" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from "echarts";
|
||||
require("echarts/theme/macarons"); // echarts theme
|
||||
import resize from "./mixins/resize";
|
||||
|
||||
export default {
|
||||
mixins: [resize],
|
||||
props: {
|
||||
className: {
|
||||
type: String,
|
||||
default: "chart",
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: "100%",
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: "350px",
|
||||
},
|
||||
autoResize: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
chartData: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
chartData: {
|
||||
deep: true,
|
||||
handler(val) {
|
||||
this.setOptions(val);
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return;
|
||||
}
|
||||
this.chart.dispose();
|
||||
this.chart = null;
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(this.$el, "macarons");
|
||||
this.setOptions(this.chartData);
|
||||
},
|
||||
setOptions({
|
||||
expertData,
|
||||
patentData,
|
||||
achievementsData,
|
||||
demandData,
|
||||
dockingData,
|
||||
} = {}) {
|
||||
this.chart.setOption({
|
||||
legend: {},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "cross",
|
||||
},
|
||||
padding: [5, 10],
|
||||
},
|
||||
dataset: {
|
||||
source: [
|
||||
["product", "模拟数量", "真实数量"],
|
||||
["专家数量", ...expertData],
|
||||
["专利数量", ...patentData],
|
||||
["科技成果数量", ...achievementsData],
|
||||
["需求数量", ...demandData],
|
||||
["对接数量", ...dockingData],
|
||||
],
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
barMaxWidth: "60",
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#49a9ee",
|
||||
lineStyle: {
|
||||
color: "#49a9ee",
|
||||
width: 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
barMaxWidth: "60",
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#98d87d",
|
||||
lineStyle: {
|
||||
color: "#98d87d",
|
||||
width: 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -2,14 +2,17 @@
|
||||
<el-row :gutter="40" class="panel-group">
|
||||
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
||||
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
|
||||
<div class="card-panel-icon-wrapper icon-people">
|
||||
<svg-icon icon-class="peoples" class-name="card-panel-icon" />
|
||||
<div class="card-panel-icon-wrapper icon-message">
|
||||
<svg-icon icon-class="message" class-name="card-panel-icon" />
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">
|
||||
访客
|
||||
</div>
|
||||
<count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" />
|
||||
<div class="card-panel-text">本月收入创新币</div>
|
||||
<count-to
|
||||
:start-val="0"
|
||||
:end-val="124345"
|
||||
:duration="2600"
|
||||
class="card-panel-num"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -19,36 +22,45 @@
|
||||
<svg-icon icon-class="message" class-name="card-panel-icon" />
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">
|
||||
消息
|
||||
</div>
|
||||
<count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num" />
|
||||
<div class="card-panel-text">本月收入金额</div>
|
||||
<count-to
|
||||
:start-val="0"
|
||||
:end-val="68323"
|
||||
:duration="3000"
|
||||
class="card-panel-num"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
||||
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
||||
<div class="card-panel-icon-wrapper icon-money">
|
||||
<svg-icon icon-class="money" class-name="card-panel-icon" />
|
||||
<div class="card-panel-icon-wrapper icon-message">
|
||||
<svg-icon icon-class="message" class-name="card-panel-icon" />
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">
|
||||
金额
|
||||
</div>
|
||||
<count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num" />
|
||||
<div class="card-panel-text">企业数量</div>
|
||||
<count-to
|
||||
:start-val="0"
|
||||
:end-val="60"
|
||||
:duration="3200"
|
||||
class="card-panel-num"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
||||
<div class="card-panel" @click="handleSetLineChartData('shoppings')">
|
||||
<div class="card-panel-icon-wrapper icon-shopping">
|
||||
<svg-icon icon-class="shopping" class-name="card-panel-icon" />
|
||||
<div class="card-panel-icon-wrapper icon-message">
|
||||
<svg-icon icon-class="message" class-name="card-panel-icon" />
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">
|
||||
订单
|
||||
</div>
|
||||
<count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num" />
|
||||
<div class="card-panel-text">专利成果数量</div>
|
||||
<count-to
|
||||
:start-val="0"
|
||||
:end-val="60"
|
||||
:duration="3600"
|
||||
class="card-panel-num"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -56,18 +68,18 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CountTo from 'vue-count-to'
|
||||
import CountTo from "vue-count-to";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CountTo
|
||||
CountTo,
|
||||
},
|
||||
methods: {
|
||||
handleSetLineChartData(type) {
|
||||
this.$emit('handleSetLineChartData', type)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$emit("handleSetLineChartData", type);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -86,8 +98,8 @@ export default {
|
||||
overflow: hidden;
|
||||
color: #666;
|
||||
background: #fff;
|
||||
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
|
||||
border-color: rgba(0, 0, 0, .05);
|
||||
box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
|
||||
border-color: rgba(0, 0, 0, 0.05);
|
||||
|
||||
&:hover {
|
||||
.card-panel-icon-wrapper {
|
||||
@ -107,7 +119,7 @@ export default {
|
||||
}
|
||||
|
||||
.icon-shopping {
|
||||
background: #34bfa3
|
||||
background: #34bfa3;
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,7 +136,7 @@ export default {
|
||||
}
|
||||
|
||||
.icon-shopping {
|
||||
color: #34bfa3
|
||||
color: #34bfa3;
|
||||
}
|
||||
|
||||
.card-panel-icon-wrapper {
|
||||
@ -160,7 +172,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:550px) {
|
||||
@media (max-width: 550px) {
|
||||
.card-panel-description {
|
||||
display: none;
|
||||
}
|
||||
|
@ -45,6 +45,26 @@
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click=""
|
||||
>导入</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click=""
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
|
@ -46,6 +46,26 @@
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="handleImport"
|
||||
>导入</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
@ -105,10 +125,53 @@
|
||||
:limit.sync="queryParams.page_size"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 专家导入对话框 -->
|
||||
<el-dialog
|
||||
:title="upload.title"
|
||||
:visible.sync="upload.open"
|
||||
width="400px"
|
||||
append-to-body
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<!-- <div class="el-upload__tip" slot="tip">
|
||||
<el-checkbox v-model="upload.updateSupport" />
|
||||
是否更新已经存在的用户数据
|
||||
</div> -->
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link
|
||||
type="primary"
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
@click="importTemplate"
|
||||
>下载模板</el-link
|
||||
>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { expertList } from "@/api/dataList/expert";
|
||||
|
||||
export default {
|
||||
@ -130,6 +193,21 @@ export default {
|
||||
examine_status: 2,
|
||||
tenant_id: undefined,
|
||||
},
|
||||
// 专家导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层(专家导入)
|
||||
open: false,
|
||||
// 弹出层标题(专家导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { "x-token": getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@ -174,6 +252,51 @@ export default {
|
||||
},
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// this.download(
|
||||
// "system/user/export",
|
||||
// {
|
||||
// ...this.queryParams,
|
||||
// },
|
||||
// `user_${new Date().getTime()}.xlsx`
|
||||
// );
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "专家导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
// this.download(
|
||||
// "system/user/importTemplate",
|
||||
// {},
|
||||
// `user_template_${new Date().getTime()}.xlsx`
|
||||
// );
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
this.$alert(
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
response.msg +
|
||||
"</div>",
|
||||
"导入结果",
|
||||
{ dangerouslyUseHTMLString: true }
|
||||
);
|
||||
this.getList();
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
// this.$refs.upload.submit();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
|
@ -45,6 +45,26 @@
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click=""
|
||||
>导入</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click=""
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
|
@ -60,6 +60,26 @@
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click=""
|
||||
>导入</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click=""
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
|
@ -1,12 +1,42 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- <panel-group @handleSetLineChartData="handleSetLineChartData" /> -->
|
||||
首页
|
||||
<panel-group />
|
||||
<el-card style="margin-bottom: 32px">
|
||||
<div slot="header">
|
||||
<span>快捷功能</span>
|
||||
</div>
|
||||
<el-row :gutter="10">
|
||||
<el-col
|
||||
:xs="8"
|
||||
:sm="6"
|
||||
:xl="4"
|
||||
v-for="item in quickList"
|
||||
:key="item.id"
|
||||
class="pointer"
|
||||
style="margin-bottom: 20px; padding-top: 20px; text-align: center"
|
||||
>
|
||||
<router-link :to="item.path">
|
||||
<el-avatar
|
||||
:size="80"
|
||||
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
|
||||
></el-avatar>
|
||||
<div style="margin: 10px 0">{{ item.title }}</div>
|
||||
</router-link>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-row style="background: #fff">
|
||||
<el-card>
|
||||
<div slot="header">
|
||||
<span>数据统计</span>
|
||||
</div>
|
||||
<columnar-chart :chart-data="lineChartData" />
|
||||
</el-card>
|
||||
</el-row>
|
||||
<!-- <el-row style="background: #fff; padding: 16px 16px 0; margin-bottom: 32px">
|
||||
<line-chart :chart-data="lineChartData" />
|
||||
</el-row> -->
|
||||
|
||||
<!-- <el-row :gutter="32">
|
||||
</el-row>
|
||||
<el-row :gutter="32">
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<raddar-chart />
|
||||
@ -32,25 +62,7 @@ import LineChart from "./dashboard/LineChart";
|
||||
import RaddarChart from "./dashboard/RaddarChart";
|
||||
import PieChart from "./dashboard/PieChart";
|
||||
import BarChart from "./dashboard/BarChart";
|
||||
|
||||
const lineChartData = {
|
||||
newVisitis: {
|
||||
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 145],
|
||||
},
|
||||
messages: {
|
||||
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
||||
actualData: [180, 160, 151, 106, 145, 150, 130],
|
||||
},
|
||||
purchases: {
|
||||
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
||||
actualData: [120, 90, 100, 138, 142, 130, 130],
|
||||
},
|
||||
shoppings: {
|
||||
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 130],
|
||||
},
|
||||
};
|
||||
import ColumnarChart from "./dashboard/ColumnarChart";
|
||||
|
||||
export default {
|
||||
name: "Index",
|
||||
@ -60,17 +72,54 @@ export default {
|
||||
RaddarChart,
|
||||
PieChart,
|
||||
BarChart,
|
||||
ColumnarChart,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
lineChartData: lineChartData.newVisitis,
|
||||
lineChartData: {
|
||||
expertData: [15, 45],
|
||||
patentData: [40, 30],
|
||||
achievementsData: [20, 45],
|
||||
demandData: [45, 40],
|
||||
dockingData: [15, 50],
|
||||
},
|
||||
quickList: [
|
||||
{
|
||||
title: "专家审核",
|
||||
path: "/examine/expertList",
|
||||
},
|
||||
{
|
||||
title: "企业审核",
|
||||
path: "/examine/enterpriseList",
|
||||
},
|
||||
{
|
||||
title: "机构审核",
|
||||
path: "/examine/researchList",
|
||||
},
|
||||
{
|
||||
title: "实验室审核",
|
||||
path: "/examine/laboratoryList",
|
||||
},
|
||||
{
|
||||
title: "经纪人审核",
|
||||
path: "/examine/agentList",
|
||||
},
|
||||
{
|
||||
title: "成果审核",
|
||||
path: "",
|
||||
},
|
||||
{
|
||||
title: "需求审核",
|
||||
path: "",
|
||||
},
|
||||
{
|
||||
title: "企业产品审核",
|
||||
path: "",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleSetLineChartData(type) {
|
||||
this.lineChartData = lineChartData[type];
|
||||
},
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -35,8 +35,11 @@ module.exports = {
|
||||
proxy: {
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
// target: `http://192.168.0.142:8000`,
|
||||
target: `http://hf.zky.cn:8000`,
|
||||
// target: `http://101.34.131.16:8000`,
|
||||
target: `http://192.168.0.149:8000`,
|
||||
// target: `http://192.168.0.135:8000`,
|
||||
// target: `http://zky.server.ipeace.org.cn`,
|
||||
// target: `http://hf.zky.cn:8000`,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: '',
|
||||
|
Reference in New Issue
Block a user