123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484 |
- <template>
- <div class="parcel-box">
- <div class="search">
- <div class="search-left">
- <el-select
- size="mini"
- v-model="tabIndex"
- placeholder="请选择"
- @change="tabClick"
- >
- <el-option
- v-for="item in tabOptions"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <el-select
- size="mini"
- v-model="company"
- placeholder="请选择"
- @change="getHomePageData()"
- >
- <el-option
- v-for="item in companyOptions"
- :key="item.id"
- :label="item.aname"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <div class="search-input">
- <el-date-picker
- size="mini"
- v-model="searchYear"
- type="year"
- value-format="YYYY"
- placeholder="选择年"
- popper-class="date-select"
- >
- </el-date-picker>
- </div>
- </div>
- <div class="search-btns">
- <el-button round size="mini" class="searchColor" @click="search"
- >搜索</el-button
- >
- </div>
- <!-- <el-button round size="mini">导出</el-button> -->
- </div>
- <div class="data-bodys">
- <div class="line clearfix">
- <div class="leftContent left">
- <span>风能利用率</span>
- </div>
- <div class="rightContent right"></div>
- </div>
- <div class="economicTable">
- <el-table
- :data="tableData"
- style="width: 100%"
- size="mini"
- stripe
- height="50vh"
- @row-click="rowClick"
- >
- <el-table-column
- align="center"
- prop=""
- label="场站"
- show-overflow-tooltip
- sortable
- >
- <template v-slot="scope">
- <span style="cursor: pointer">{{ scope.row.wpname }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- :label="val"
- v-for="(val, index) in tableHead"
- :key="index"
- width="144"
- sortable
- >
- <template v-slot="scope">
- <div v-if="scope.row.wpname == ''">
- <el-row>
- <el-col :span="12"
- ><span>{{ scope.row.data?.current }}</span></el-col
- >
- <el-col :span="12"
- ><span>{{ scope.row.data.sameperiod }}</span></el-col
- >
- </el-row>
- </div>
- <div v-else>
- <el-row>
- <el-col :span="12" style="position: relative">
- <div
- style="
- padding: 0 10px;
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- "
- >
- <span style="width: 40px">{{
- scope.row.targetList &&
- (scope.row.targetList[index]?.current ||
- scope.row.targetList[index]?.current === 0
- ? scope.row.targetList[index]?.current
- : "--")
- }}</span>
- <i
- style="position: absolute; right: 0; top: 4px"
- v-if="
- scope.row.targetList &&
- (scope.row.targetList[index]?.compare > 0 ||
- scope.row.targetList[index]?.compare === 0)
- "
- class="active_icon icon-arrow-up compare-lift-up"
- ></i>
- <i
- style="position: absolute; right: 0; top: 4px"
- v-if="
- scope.row.targetList &&
- scope.row.targetList[index]?.compare < 0
- "
- class="active_icon icon-arrow-dpwn compare-lift-down"
- ></i>
- </div>
- </el-col>
- <el-col :span="12"
- ><span>{{
- scope.row.targetList &&
- (scope.row.targetList[index]?.sameperiod ||
- scope.row.targetList[index]?.sameperiod === 0
- ? scope.row.targetList[index]?.sameperiod
- : "--")
- }}</span></el-col
- >
- </el-row>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <div class="echarts" style="height: 30vh">
- <div class="chart-name">
- <div class="point left bottom"></div>
- <div class="point right bottom"></div>
- 风能利用率
- </div>
- <div style="margin-top: 10px">
- <BarCharts
- :list="barList"
- width="97%"
- height="32vh"
- :top="60"
- :pillarName="pillarName"
- :xdate="false"
- :showLegend="true"
- :units="['', '']"
- ></BarCharts>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { GetOrganization } from "@/api/headerNav.js";
- import BarCharts from "../../../economicsOperation/homePage/components/barCharts.vue";
- import { companys, fnlylList } from "@/api/curveAnalyse";
- export default {
- name: "curveAnalyse",
- components: {
- BarCharts,
- },
- data() {
- return {
- pillarName: "",
- list: [],
- tabIndex: -1,
- tabOptions: [
- { id: -1, name: "风电" },
- { id: -2, name: "光伏" },
- ],
- barList: [],
- tableData: [],
- tableHead: [
- "一月",
- "二月",
- "三月",
- "四月",
- "五月",
- "六月",
- "七月",
- "八月",
- "九月",
- "十月",
- "十一月",
- "十二月",
- ],
- company: "",
- companyOptions: [],
- searchYear: this.getmonthValue(),
- };
- },
- watch: {},
- filters: {},
- computed: {},
- created() {
- this.initialization();
- },
- methods: {
- compare(property) {
- return (a, b) => {
- let val1 = a[property];
- let val2 = b[property];
- return val1 - val2;
- };
- },
- rowClick(list) {
- if (list?.wpname) {
- let barList = [
- {
- name: "本期",
- children: [],
- date: [],
- },
- {
- name: "同期",
- children: [],
- },
- ];
- this.pillarName = list.wpname;
- list.targetList.forEach((item) => {
- barList[0].date.push(item.month + "月");
- barList[0].children.push(item.current || 0);
- barList[1].children.push(item.compare || 0);
- });
- this.barList = barList;
- }
- },
- // isNumber(val) {
- // return typeof val === "number" && !isNaN(val);
- // },
- search() {
- fnlylList({
- companys: this.company,
- type: this.tabIndex,
- year: this.monthChange(this.searchYear),
- }).then((res) => {
- if (res.data) {
- let arr = [
- {
- wpname: "",
- data: {
- wpname: "期次",
- current: "本期",
- sameperiod: "同期",
- },
- },
- ];
- this.tableData = [...arr, ...res.data];
- this.rowClick(res.data[res.data.length - 1]);
- }
- });
- },
- getHomePageData() {
- this.search();
- },
- monthChange(data) {
- let year = new Date(data).getFullYear().toString();
- return year;
- },
- getmonthValue() {
- let year = new Date().getFullYear().toString();
- return year;
- },
- tabClick() {
- this.$router.push({
- path: "/economicsOperation/thematicAnalysis/lightEnergy",
- });
- },
- initialization() {
- GetOrganization({ type: this.tabIndex }).then((res) => {
- if (res.data) {
- this.companyOptions = res.data;
- this.company = res.data[0].id;
- this.search();
- }
- });
- },
- },
- mounted() {},
- beforeUnmount() {},
- };
- </script>
- <style lang="less" scoped>
- .data-bodys {
- display: flex;
- flex-direction: column;
- background-color: rgba(0, 0, 0, 0.45);
- border-radius: 5px;
- padding: 5px;
- }
- .parcel-box {
- padding: 0 20px;
- box-sizing: border-box;
- ::v-deep .search-left {
- display: flex;
- align-items: center;
- .el-select {
- margin-right: 10px;
- width: 155px;
- .el-input .el-input__inner {
- width: 150px;
- }
- }
- .search-btns {
- display: flex;
- }
- }
- .line {
- padding-bottom: 5px;
- .leftContent {
- width: 242px;
- height: 41px;
- line-height: 41px;
- background: url("../../../../../assets/imgs/title_left_bg.png");
- span {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- margin-left: 25px;
- }
- }
- .rightContent {
- width: 212px;
- height: 28px;
- margin-top: 13px;
- background: url("../../../../../assets/imgs/title_right_bg.png");
- }
- }
- .search {
- display: flex;
- flex-direction: row;
- padding-top: 10px;
- padding-bottom: 10px;
- align-items: center;
- // justify-content: space-between;
- button {
- margin-left: 10px;
- background: rgba(67, 81, 107, 0.3);
- border: 1px solid #354460;
- color: #b3b3b3;
- }
- .searchColor {
- background-color: rgba(0, 70, 199, 0.2);
- border: 1px solid #3b4c6c;
- color: #b3b3b3;
- font-size: 14px;
- &:hover {
- background-color: rgba(0, 70, 199, 0.5);
- color: #ffffff;
- }
- }
- }
- .echarts {
- margin-top: 20px;
- background-color: rgba(0, 0, 0, 0.45);
- border-radius: 5px;
- width: 100%;
- }
- }
- .clearfix::after {
- content: "";
- clear: both;
- height: 0;
- line-height: 0;
- visibility: hidden;
- display: block;
- }
- .clearfix {
- zoom: 1;
- }
- .left {
- float: left;
- }
- .right {
- float: right;
- }
- /deep/ .el-input__prefix {
- right: -15px;
- left: unset;
- }
- /deep/ .el-input--prefix .el-input__inner {
- padding-left: 20px;
- }
- .el-table::before {
- height: 0;
- }
- .compare-lift-down {
- margin-left: 7px;
- font-size: 14px;
- font-family: Arial;
- font-weight: 400;
- color: #ff8300;
- }
- .compare-lift-up {
- margin-left: 7px;
- font-size: 14px;
- font-family: Arial;
- font-weight: 400;
- color: #1c99ff;
- }
- .chart-name {
- display: flex;
- align-items: center;
- justify-content: center;
- position: relative;
- width: 100%;
- height: 40px;
- border-bottom: 1px solid rgba(106, 106, 106, 0.5);
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- }
- .point {
- width: 6px;
- height: 1px;
- background-color: #ffffff;
- position: absolute;
- &.left {
- left: 0;
- }
- &.right {
- right: 0;
- }
- &.top {
- top: -1px;
- }
- &.bottom {
- bottom: -1px;
- }
- }
- </style>
|