123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394 |
- <template>
- <div class="parcel-box">
- <div class="title">
- <el-select
- size="mini"
- v-model="company"
- placeholder="请选择"
- @change="getTableDate"
- >
- <el-option
- v-for="item in companyOptions"
- :key="item.id"
- :label="item.aname"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <div class="station">
- 开始日期
- <div class="search-input">
- <el-date-picker
- v-model="starTime"
- type="date"
- size="mini"
- value-format="YYYY-MM-DD"
- placeholder="选择日期"
- popper-class="date-select"
- >
- </el-date-picker>
- </div>
- </div>
- <div class="station">
- 结束日期
- <div class="search-input">
- <el-date-picker
- v-model="endTime"
- type="date"
- size="mini"
- value-format="YYYY-MM-DD"
- placeholder="选择日期"
- popper-class="date-select"
- >
- </el-date-picker>
- </div>
- </div>
- <div class="date">
- <div
- class="day"
- :class="current === '1' ? 'active' : ''"
- @click="handleChange('1')"
- >
- 小于3米风速
- </div>
- <div
- class="mouth"
- :class="current === '2' ? 'active' : ''"
- @click="handleChange('2')"
- >
- 大于3米风速
- </div>
- <div
- class="year"
- :class="current === '3' ? 'active' : ''"
- @click="handleChange('3')"
- >
- 大于4米风速
- </div>
- </div>
- <el-button round size="mini" class="searchColor" @click="getTableDate"
- >搜索</el-button
- >
- <!-- <el-button round size="mini">导出</el-button> -->
- </div>
- <div class="data-bodys">
- <div class="line clearfix">
- <div class="leftContent left"><span>状态转换率</span></div>
- </div>
- <div class="economicTable">
- <el-table
- :data="tableData"
- style="width: 100%"
- size="mini"
- stripe
- height="100%"
- >
- <el-table-column
- align="center"
- prop="wpid"
- label="风场"
- width="200"
- sortable
- ></el-table-column>
- <el-table-column
- align="center"
- prop="wfz"
- label="5分钟 / 转换次数(次)"
- sortable
- ></el-table-column>
- <el-table-column
- align="center"
- prop="wfzfwl"
- label="5分钟 / 转换率(%)"
- sortable
- ></el-table-column>
- <el-table-column
- align="center"
- prop="sfz"
- label="10分钟 / 转换次数(次)"
- sortable
- ></el-table-column>
- <el-table-column
- align="center"
- prop="sfzfwl"
- label="10分钟 / 转换率(%)"
- sortable
- ></el-table-column>
- <el-table-column
- align="center"
- prop="swfz"
- label="15分钟 / 转换次数(次)"
- sortable
- ></el-table-column>
- <el-table-column
- align="center"
- prop="swfzfwl"
- label="15分钟 / 转换率(%)"
- sortable
- ></el-table-column>
- <el-table-column
- align="center"
- prop="esfz"
- label="20分钟 / 转换次数(次)"
- sortable
- ></el-table-column>
- <el-table-column
- align="center"
- prop="esfzfwl"
- label="20分钟 / 转换率(%)"
- sortable
- ></el-table-column>
- </el-table>
- </div>
- </div>
- </div>
- </template>
- <script>
- import dayjs from "dayjs";
- import { companys, conversionRate } from "@/api/curveAnalyse";
- export default {
- name: "stateEfficiency",
- components: {},
- data() {
- return {
- starTime: "",
- endTime: "",
- company: "",
- companyOptions: [],
- tableData: [],
- current: "1",
- };
- },
- filters: {},
- computed: {},
- created() {
- let date = new Date();
- date.setDate(1);
- let month = parseInt(date.getMonth() + 1);
- let day = date.getDate();
- if (month < 10) {
- month = "0" + month;
- }
- if (day < 10) {
- day = "0" + day;
- }
- this.starTime = dayjs().add(-1, "day").format("YYYY-MM-DD");
- this.endTime = dayjs().format("YYYY-MM-DD");
- this.initialization();
- },
- methods: {
- initialization() {
- companys().then(({ data: res }) => {
- this.companyOptions = res.data;
- this.company = res.data[0].id;
- this.getTableDate();
- });
- },
- getTableDate() {
- conversionRate({
- companyId: this.company,
- beginDate: this.starTime,
- endDate: this.endTime,
- }).then(({ data: res }) => {
- if (res) {
- const current = this.current;
- if (current == "1") {
- this.tableData = res.data.小于3米风速;
- } else if (current == "2") {
- this.tableData = res.data.大于3米风速;
- } else {
- this.tableData = res.data.大于4米风速;
- }
- }
- });
- },
- handleChange(val) {
- this.current = val;
- this.getTableDate();
- },
- },
- mounted() {},
- beforeUnmount() {},
- };
- </script>
- <style lang="less" scoped>
- .title {
- display: flex;
- flex-direction: row;
- align-items: center;
- margin-top: 10px;
- .station {
- display: flex;
- flex-direction: row;
- align-items: center;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #b3b3b3;
- margin-left: 10px;
- }
- .search-input {
- margin-left: 10px;
- }
- .but {
- display: flex;
- flex-direction: row;
- align-content: center;
- margin-left: 20px;
- }
- .buttons {
- background-color: rgba(5, 187, 76, 0.2);
- border: 1px solid #3b6c53;
- color: #b3b3b3;
- font-size: 14px;
- &:hover {
- background-color: rgba(5, 187, 76, 0.5);
- color: #ffffff;
- }
- }
- }
- .parcel-box {
- height: 100%;
- width: 100%;
- padding: 0 30px;
- padding-bottom: 10px;
- .line {
- padding-bottom: 5px;
- .leftContent {
- width: 242px;
- height: 41px;
- line-height: 41px;
- background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
- span {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #05bb4c;
- margin-left: 25px;
- }
- }
- .rightContent {
- width: 212px;
- height: 28px;
- margin-top: 13px;
- background: url("../../../../assets/imgs/title_right_bg.png");
- }
- }
- .data-bodys {
- display: flex;
- flex-direction: column;
- background-color: rgba(0, 0, 0, 0.45);
- border-radius: 5px;
- height: calc(100% - 45px);
- padding-top: 10px;
- .economicTable {
- width: 100%;
- height: calc(100% - 40px);
- }
- }
- }
- .clearfix::after {
- content: "";
- clear: both;
- height: 0;
- line-height: 0;
- visibility: hidden;
- display: block;
- }
- .clearfix {
- zoom: 1;
- }
- .left {
- float: left;
- }
- .right {
- float: right;
- }
- .searchColor {
- background-color: rgba(5, 187, 76, 0.2);
- border: 1px solid #3b6c53;
- color: #b3b3b3;
- font-size: 14px;
- &:hover {
- background-color: rgba(5, 187, 76, 0.5);
- color: #ffffff;
- }
- }
- .date {
- display: flex;
- flex-direction: row;
- align-items: center;
- font-size: 12px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #b3b3b3;
- margin: 0 15px;
- .day {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100px;
- height: 26px;
- border: 1px solid #3b6c53;
- border-radius: 11px 0px 0px 11px;
- background: rgba(67, 81, 107, 0.2);
- &.active {
- background: rgba(5, 187, 76, 0.4);
- color: #ffffff;
- }
- }
- .mouth {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100px;
- height: 26px;
- border-top: 1px solid #3b6c53;
- border-bottom: 1px solid #3b6c53;
- background: rgba(67, 81, 107, 0.2);
- &.active {
- background: rgba(5, 187, 76, 0.4);
- color: #ffffff;
- }
- }
- .year {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100px;
- height: 26px;
- border: 1px solid #3b6c53;
- border-radius: 0px 11px 11px 0px;
- background: rgba(67, 81, 107, 0.2);
- &.active {
- background: rgba(5, 187, 76, 0.4);
- color: #ffffff;
- }
- }
- }
- </style>
|