3 Star 0 Fork 0

GKLBB/ruoyi-webftp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.vue 20.62 KB
一键复制 编辑 原始数据 按行查看 历史
马吉 提交于 2023-11-08 10:59 . ftpd优化
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
<template>
<div class="home-container">
<div class="home-head">
<div
class="home-head-div"
:class="index + 1 !== headList.length ? 'margin-right' : ''"
v-for="(item, index) in headList"
:key="index"
:style="{
background: `url(${item.bgc}) no-repeat`,
'background-size': 'cover',
}"
>
<div class="left">
<div
class="round"
:style="{
backgroundImage: `url(${item.round})`,
}"
></div>
<h4 class="title">{{ item.title }}</h4>
<h4 class="total" :style="{ color: item.color }">{{ item.total }}</h4>
</div>
<div
class="right"
:style="{
backgroundImage: `url(${item.icon})`,
}"
></div>
</div>
</div>
<div class="home-body">
<!-- 区域分析 -->
<div class="home-body-div margin-bottom margin-right">
<div class="home-body-top">
<div
class="home-body-top-bgc"
:style="{ background: `url(${bodyList[0].bgc})` }"
></div>
<h3 class="home-body-top-title">{{ bodyList[0].title }}</h3>
</div>
<div class="home-body-bottom echarts" ref="bin"></div>
</div>
<!-- 企业分析 -->
<div class="home-body-div margin-bottom">
<div class="home-body-top">
<div
class="home-body-top-bgc"
:style="{ background: `url(${bodyList[1].bgc})` }"
></div>
<h3 class="home-body-top-title">{{ bodyList[1].title }}</h3>
</div>
<div class="home-body-bottom echarts" ref="line"></div>
</div>
<!-- 企业概况 -->
<div class="home-body-div margin-right">
<div class="home-body-top">
<div
class="home-body-top-bgc"
:style="{ background: `url(${bodyList[2].bgc})` }"
></div>
<h3 class="home-body-top-title">{{ bodyList[2].title }}</h3>
</div>
<div class="home-body-bottom qiyeOverview">
<ul>
<li v-for="(item, index) in overviewList" :key="index">
<div class="name table-div">
<div class="name-top">
<div class="name-bgc qiyeBgc"></div>
<div class="name-text qiyeText">企业名称</div>
</div>
<div class="name-bottom">{{ item.qiyeName }}</div>
</div>
<div class="city table-div">
<div class="city-top">
<div class="city-bgc qiyeBgc"></div>
<div class="city-text qiyeText">市内销售额</div>
</div>
<div class="city-bottom">
{{ item.cityMoney }}
<span class="wanYuan">万元</span>
</div>
</div>
<div class="current table-div">
<div class="current-top">
<div class="current-bgc qiyeBgc"></div>
<div class="current-text qiyeText">当月销售额</div>
</div>
<div class="current-bottom">
{{ item.currentMoney }}
<span class="wanYuan">万元</span>
</div>
</div>
</li>
</ul>
</div>
</div>
<!-- 供需信息 -->
<div class="home-body-div">
<div class="home-body-top">
<div
class="home-body-top-bgc"
:style="{ background: `url(${bodyList[3].bgc})` }"
></div>
<h3 class="home-body-top-title">{{ bodyList[3].title }}</h3>
</div>
<div class="home-body-bottom">
<div class="home-body-bottom-elBottom">
<el-table
:data="tableData"
height="240"
border
:header-cell-style="{
background: '#eef5f9',
color: '#000',
fontSize: '16px',
}"
:cell-style="{ color: '#000' }"
style="width: 100%"
>
<el-table-column
prop="product"
label="产品"
header-align="center"
align="center"
width="180"
>
</el-table-column>
<el-table-column
prop="type"
label="供需类型"
header-align="center"
align="center"
width="180"
>
</el-table-column>
<el-table-column
prop="unit"
header-align="center"
align="center"
label="部门/单位"
>
</el-table-column>
<el-table-column
prop="content"
header-align="center"
align="center"
show-overflow-tooltip
label="内容"
>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import service from "@/utils/request.js";
export default {
name: "homeIndex",
data() {
return {
headList: [
{
title: "企业总数",
total: "1754",
color: "#66a0fc",
icon: require("@/assets/images/head1.png"),
bgc: require("@/assets/images/headBgc1.png"),
round: require("@/assets/images/round1.png"),
},
{
title: "产品类别",
total: "3456",
color: "#ff5a78",
icon: require("@/assets/images/head2.png"),
bgc: require("@/assets/images/headBgc2.png"),
round: require("@/assets/images/round2.png"),
},
{
title: "市内销售额",
total: "13",
color: "#57e2f3",
icon: require("@/assets/images/head3.png"),
bgc: require("@/assets/images/headBgc3.png"),
round: require("@/assets/images/round3.png"),
},
{
title: "市内占比",
total: "13",
color: "#ff9d53",
icon: require("@/assets/images/head4.png"),
bgc: require("@/assets/images/headBgc4.png"),
round: require("@/assets/images/round4.png"),
},
],
bodyList: [
{
title: "区域分析",
bgc: require("@/assets/images/body1.png"),
},
{
title: "企业分析",
bgc: require("@/assets/images/body2.png"),
},
{
title: "企业概况",
bgc: require("@/assets/images/body3.png"),
},
{
title: "供需信息",
bgc: require("@/assets/images/body4.png"),
},
],
// 企业概况数据
overviewList: [],
// 供需信息数据
tableData: [
{
product: "NB物联网智能水表",
type: "供给",
unit: "天水二一三电器集团有限公司",
content: "公司生产智能水表1000台,有需求部门欢迎12356487978",
},
{
product: "钢材",
type: "需求",
unit: "住建局",
content: "因***项目现需采购钢材400吨,有供应部门.12356487978",
},
{
product: "水泥",
type: "需求",
unit: "农村农业局",
content: "为打造**项目,需采购水泥800吨,请对口.12356487978",
},
{
product: "机制砂石",
type: "供给",
unit: "华健新材料股份有限公司",
content: "现有机制砂石共计100万吨,有需求部门请.12356487978",
},
{
product: "工作服",
type: "需求",
unit: "环保局",
content: "因现环卫工人需重新定制工作服,如有关部.12356487978",
},
],
areaList1: [],
areaList2: [],
lineNameList: [],
lineList1: [],
lineList2: [],
};
},
methods: {
getNormalsum() {
return service({
url: "/system/inter/normalsum",
method: "get",
});
},
async getHeadList() {
const { ComSum, ProSum, TotalPricle, TotalPricleinCity, code } =
await this.getNormalsum();
if (code == "200") {
this.headList[0].total = ComSum;
this.headList[1].total = ProSum;
this.headList[2].total = TotalPricleinCity;
this.headList[3].total = (TotalPricleinCity / TotalPricle).toFixed(2);
}
},
getQiyeOverview() {
return service({
url: "/system/inter/groupby",
method: "get",
});
},
async getOverviewList() {
const {
AreaPricle,
ComArt,
ComProfile,
DusPricle,
areatotalPrice,
code,
protime,
} = await this.getQiyeOverview();
if (code == "200") {
let arr = [];
for (let key in AreaPricle) {
arr = arr.concat(AreaPricle[key]);
}
this.areaList1 = arr.filter((item, index) => {
return index % 2 === 0;
});
this.areaList2 = arr.filter((item, index) => {
return index % 2 === 1;
});
this.initBin(arr, this.areaList1, this.areaList2);
let arr1 = [];
let lineList1 = [];
let lineList2 = [];
for (let key in ComArt) {
arr1 = arr1.concat(ComArt[key]);
}
lineList1 = arr1.filter((item, index) => {
return index % 2 === 0;
});
lineList2 = arr1.filter((item, index) => {
return index % 2 === 1;
});
this.lineNameList = arr1.map((item) => item.name);
this.lineList1 = lineList1.map((item) => item.value);
this.lineList2 = lineList2.map((item) => item.value);
this.initLine(this.lineNameList, this.lineList1, this.lineList2);
this.overviewList = ComProfile.map((obj) => {
return {
qiyeName: obj["name"],
cityMoney: obj["value"],
currentMoney: obj["valueincity"],
};
});
}
},
initLine(nameList, arr1, arr2) {
let myChart = this.$echarts.init(this.$refs.line);
let option = {
tooltip: {
trigger: "axis",
},
legend: {
data: ["产品总量", "市内总额"],
left: "70%",
},
calculable: true,
xAxis: [
{
type: "category",
data: nameList,
axisLabel: {
formatter(params) {
var newParamsName = "";
var paramsNameNumber = params.length;
var provideNumber = 8; // 每行能显示的字的个数
var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
if (paramsNameNumber > provideNumber) {
for (var p = 0; p < rowNumber; p++) {
var tempStr = "";
var start = p * provideNumber;
var end = start + provideNumber;
if (p == rowNumber - 1) {
tempStr = params.substring(start, paramsNameNumber);
} else {
tempStr = params.substring(start, end) + "\n";
}
newParamsName += tempStr;
}
} else {
newParamsName = params;
}
return newParamsName;
}
}
},
],
yAxis: [
{
type: "value",
scale: true,
splitNumber: 4,
splitArea: {
show: true,
areaStyle: {
color: ["#eff8ff", "#ffffff"],
},
},
axisLabel: {
color: "#000",
fontSize: 16,
},
},
],
series: [
{
name: "产品总量",
type: "bar",
barWidth: 20,
data: arr1,
itemStyle: {
normal: {
color: "#1b89fb",
},
},
},
{
name: "市内总额",
type: "bar",
barWidth: 20,
data: arr2,
itemStyle: {
normal: {
color: "#ffc558",
},
},
},
],
dataZoom: {
realtime: true, //拖动滚动条时是否动态的更新图表数据
bottom: 6,
height: 8, //滚动条高度
start: 0, //滚动条开始位置
end: 30, //结束位置
},
};
option && myChart.setOption(option);
window.addEventListener("resize", () => {
myChart.resize();
});
},
initBin(arr, arr1, arr2) {
let myChart = this.$echarts.init(this.$refs.bin);
let option = {
tooltip: {
trigger: "item",
},
legend: [
{
data: arr1,
icon: "roundRect",
itemHeight: 8,
itemWidth: 12,
itemGap: 30,
top: "4%",
x: "75%",
y: "center",
formatter: (name) => {
let data = arr1;
let target;
for (let i = 0, l = data.length; i < l; i++) {
if (data[i].name == name) {
target = data[i].value;
}
}
return `{b|${name}${target}}`;
},
textStyle: {
color: "#000",
fontSize: 14,
align: "left",
backgroundColor: "transparent",
rich: {
b: {
width: 400,
},
},
},
},
{
data: arr2,
icon: "roundRect",
itemHeight: 8,
itemWidth: 12,
itemGap: 30,
top: "4%",
x: "50%",
y: "center",
formatter: (name) => {
let data = arr2;
let target;
for (let i = 0, l = data.length; i < l; i++) {
if (data[i].name == name) {
target = data[i].value;
}
}
return `{b|${name}${target}}`;
},
textStyle: {
color: "#000",
fontSize: 14,
align: "left",
backgroundColor: "transparent",
rich: {
b: {
width: 400,
},
},
},
},
],
series: [
{
name: "Access From",
type: "pie",
color: [
"#37A2DA",
"#32C5E9",
"#67E0E3",
"#9FE6B8",
"#FFDB5C",
"#ff9f7f",
"#fb7293",
"#E062AE",
"#E690D1",
"#e7bcf3",
"#9d96f5",
"#8378EA",
"#96BFFF",
],
radius: ["45%", "80%"],
center: ["20%", "50%"],
avoidLabelOverlap: false,
label: {
show: false,
position: "center",
},
emphasis: {
label: {
show: false,
fontSize: 40,
fontWeight: "bold",
},
},
labelLine: {
show: false,
},
data: arr,
},
],
};
option && myChart.setOption(option);
window.addEventListener("resize", () => {
myChart.resize();
});
},
},
created() {
this.getHeadList();
},
mounted() {
this.initLine();
this.getOverviewList();
},
};
</script>
<style lang="scss" scoped>
.home-container {
width: 100%;
min-width: 1300px;
height: 100%;
padding: 16px;
.home-head {
display: flex;
width: 100%;
height: 100px;
margin-bottom: 16px;
.home-head-div {
position: relative;
display: flex;
width: calc(100% / 4);
height: 100%;
padding: 0 3%;
.left {
height: 100%;
padding-top: 6%;
.round {
position: absolute;
top: 14%;
left: 6%;
width: 34px;
height: 34px;
background-size: contain;
background-repeat: no-repeat;
}
.title {
position: absolute;
top: 23%;
left: 10%;
font-size: 16px !important;
font-weight: 700;
margin-bottom: 18%;
}
.total {
position: absolute;
bottom: 14%;
left: 10%;
font-size: 24px !important;
}
}
.right {
position: absolute;
bottom: 10%;
right: 10%;
width: 40px;
height: 40px;
background-size: contain;
background-repeat: no-repeat;
}
}
}
.home-body {
display: flex;
flex-shrink: none;
flex-wrap: wrap;
width: 100%;
.home-body-div {
width: calc((100% - 20px) / 2);
height: calc((100vh - 248px) / 2);
padding: 16px;
background-color: #fff;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
.home-body-top {
display: flex;
justify-content: flex-start;
align-items: center;
margin-bottom: 10px;
.home-body-top-bgc {
width: 18px;
height: 20px;
margin-right: 10px;
background-size: 100%, 100%;
}
.home-body-top-title {
font-weight: 700;
}
}
&:nth-child(-n + 2) {
padding-bottom: 0;
}
.home-body-bottom {
width: 100%;
height: 82%;
padding: 6px 12px 12px;
li {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2px dashed #eee;
padding-bottom: 2px;
margin-bottom: 6px;
.name {
width: 30%;
.name-bottom {
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
}
.current {
margin-right: 20px;
}
.table-div {
.name-top,
.city-top,
.current-top {
display: flex;
justify-content: flex-start;
align-items: center;
margin-bottom: 8px;
}
.qiyeText {
font-size: 18px;
}
.name-bgc {
width: 23px;
height: 24px;
margin-right: 10px;
background: url("../assets/images/body3-1.png") no-repeat;
background-size: cover;
}
.city-bgc {
width: 19px;
height: 18px;
margin-right: 10px;
background: url("../assets/images/body3-2.png") no-repeat;
background-size: cover;
}
.current-bgc {
width: 36px;
height: 36px;
background: url("../assets/images/body3-3.png") no-repeat;
background-size: cover;
background-position-y: 4px;
}
.name-bottom,
.city-bottom,
.current-bottom {
color: #0c91e8;
font-weight: 700;
}
.city-bottom,
.current-bottom {
font-size: 20px;
}
.current-bottom {
padding-left: 6px;
margin-bottom: 6px;
}
.wanYuan {
color: #a5a5a5;
font-size: 16px;
font-weight: 700;
}
}
}
.home-body-bottom-elBottom {
margin-top: 12px;
}
}
.echarts {
// margin-top: 22px;
height: 90%;
}
.qiyeOverview {
overflow-y: auto;
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: rgba(0, 0, 0, 0.2);
}
&::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 0;
background: rgba(0, 0, 0, 0.1);
}
&::-webkit-scrollbar-track {
border-radius: 10px;
}
}
}
}
.margin-right {
margin-right: 16px;
}
.margin-bottom {
margin-bottom: 16px;
}
}
</style>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/null_465_7266/ruoyi-webftp.git
git@gitee.com:null_465_7266/ruoyi-webftp.git
null_465_7266
ruoyi-webftp
ruoyi-webftp
master

搜索帮助