123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601 |
- <template>
- <div class="decision-page-3">
- <div class="query mg-b-8">
- <div class="query-items">
- <div class="query-item">
- <div class="lable">场站:</div>
- <div class="search-input">
- <el-select
- v-model="value1"
- @change="ChangZhanChange(value1)"
- clearable
- placeholder="请选择"
- popper-class="select"
- >
- <el-option
- v-for="item in ChangZhan"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- >
- </el-option>
- </el-select>
- </div>
- </div>
- <div class="query-item">
- <div class="lable">风机:</div>
- <div class="search-input">
- <el-select
- v-model="value2"
- @change="XiangMuChange(value2)"
- multiple
- multiple-limit="5"
- collapse-tags
- placeholder="请选择"
- popper-class="select"
- >
- <el-option
- v-for="item in XiangMu"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- >
- </el-option>
- </el-select>
- </div>
- </div>
- <div class="query-item">
- <div class="lable">日期:</div>
- <div class="search-input">
- <el-date-picker
- v-model="value4"
- @change="BeginChange(value4)"
- type="date"
- value-format="YYYY-MM-DD"
- placeholder="选择日期"
- popper-class="date-select"
- >
- </el-date-picker>
- </div>
- </div>
- <div class="query-actions">
- <button class="btn" @click="reset">重置</button>
- </div>
- </div>
- <div class="actions mg-b-8">
- <button
- class="btn"
- :class="TypeClass == 0 ? 'green' : ''"
- @click="TypeClick(0)"
- >
- 日风电机对比
- </button>
- <button
- class="btn"
- :class="TypeClass == 1 ? 'green' : ''"
- @click="TypeClick(1)"
- >
- 月风电机对比
- </button>
- <button
- class="btn"
- :class="TypeClass == 2 ? 'green' : ''"
- @click="TypeClick(2)"
- >
- 年风电机对比
- </button>
- </div>
- </div>
-
- <toolbar-panel title="单机横向对比" :showLine="false"></toolbar-panel>
- <div class="info">
- <div class="mg-b-16">
- <div class="project-table">
- <Table :data="tableData"></Table>
- </div>
- </div>
-
- <div class="direction-info mg-b-16">
- <table class="com-table">
- <tbody>
- <tr>
- <td v-for="(col, i) of tableData.column" :key="i">
- <div v-if="i == 0">22</div>
- <div v-if="i == 1">风资源</div>
- <div v-if="i != 0 && i != 1">
- <div class="direction-title">{{ listName[i - 2] }}</div>
- <div
- class="direction-chart"
- :class="i - 2 < fzyData.length ? '' : 'hide'"
- >
- <normal-radar-chart
- :width="'70%'"
- :height="'232px'"
- :value="fzyData[i - 2]"
- />
- </div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-
- <div>
- <toolbar-panel :title="'日功率曲线'">
- <template v-slot:tools>
- <div class="tools">
- <div
- class="tool-block"
- v-for="(item, index) in listName"
- :key="index"
- >
- <div class="legend" :class="'bg-' + (index + 1)"></div>
- <div class="legend-text">{{ item }}</div>
- </div>
- </div>
- </template>
- <double-line-chart :height="'200px'" :list="list" />
- </toolbar-panel>
- </div>
- </div>
- </div>
- </template>
- <script>
- import DoubleLineChart from "../../components/chart/line/DayPowerChart.vue";
- import NormalRadarChart from "../../components/chart/radar/normal-radar-chart.vue";
- import SvgIcon from "../../components/coms/icon/svg-icon.vue";
- import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";
- import Table from "../../components/coms/table/table.vue";
- import api from "@api/economic/index.js";
- export default {
- components: {
- Table,
- SvgIcon,
- ToolbarPanel,
- DoubleLineChart,
- NormalRadarChart,
- },
- data() {
- return {
- tableData: {
- column: [
- {
- name: "",
- field: "index",
- is_num: false,
- is_light: false,
- },
- {
- name: "项目",
- field: "name",
- is_num: false,
- is_light: false,
- },
- {
- name: "",
- field: "data1",
- is_num: false,
- is_light: false,
- },
- {
- name: "",
- field: "data2",
- is_num: false,
- is_light: false,
- },
- {
- name: "",
- field: "data3",
- is_num: false,
- is_light: false,
- },
- {
- name: "",
- field: "data4",
- is_num: false,
- is_light: false,
- },
- {
- name: "",
- field: "data5",
- is_num: false,
- is_light: false,
- },
- ],
- data: [],
- },
- ChangZhan: [],
- XiangMu: [],
- value1: [],
- value2: [],
- value4: "",
- fzyData: [],
- list: [{ value: [{ text: "", value: 0 }] }],
- listName: [],
- TypeClass: 0,
- ajaxArr: ["daydjhxdbtop", "monthdjhxdbtop", "yeardjhxdbtop"],
- ajaxName: "daydjhxdbtop",
- };
- },
- created() {
- this.ChangZhanVal();
- this.value4 = this.getTime(1);
- },
- methods: {
- ChangZhanVal() {
- api.benchmarkingWplist({}).then((res) => {
- this.ChangZhan = res.data;
- this.value1 = res.data[0].code;
- this.XiangMuVal(res.data[0].code);
- });
- },
- ChangZhanChange(val) {
- this.value1 = val;
- this.value2 = [];
- this.AjaxCommon();
- this.XiangMuVal(val);
- },
- XiangMuVal(val) {
- api
- .benchmarkingWtList({
- wpid: val ? val : "",
- })
- .then((res) => {
- this.XiangMu = res.data;
- this.value2.push(res.data[0].id);
- this.AjaxCommon();
- });
- },
- XiangMuChange(val) {
- var that = this;
- that.value2 = val;
- that.AjaxCommon();
- },
- getTime(val) {
-
- var date = new Date();
- var year = date.getFullYear(),
- month = date.getMonth() + 1,
- day = date.getDate();
- month >= 1 && month <= 9 ? (month = "0" + month) : "";
- day >= 0 && day <= 9 ? (day = "0" + day) : "";
- var begin = year + "-" + month + "-01";
- var end = year + "-" + month + "-" + day;
- if (val == 1) {
- return begin;
- } else if (val == 2) {
- return end;
- }
- },
- AjaxCommon() {
- this.list = []
- api
- .ajaxName({
- ajaxName: this.ajaxName,
- wpid: this.value1,
- wtids: this.value2,
- date: this.value4,
- target: "",
- sort: "",
- })
- .then((res) => {
- var data = res.data,
- data2 = [],
- chart = [],
- fzy = [],
- fzyArr = [],
- jfpl = [],
- jfplArr = [];
- let thisItem = [];
- jfpl = data.pop();
- fzy = data.pop();
- if (fzy["1"] == null) {
- this.BASE.showMsg({
- msg: "此风机无数据",
- type: "success",
- });
- return false;
- }
- data.forEach((ele, index) => {
- for (let key in ele) {
- if (key !== "name") {
- thisItem.push(ele[key]);
- }
- }
- });
- var count = thisItem.length / data.length;
- data.forEach((item, index) => {
- data2.push({
- index: index + 1,
- name: item.name,
- data1: thisItem[index * count],
- data2: count >= 2 ? thisItem[index * count + 1] : [],
- data3: count >= 3 ? thisItem[index * count + 2] : [],
- data4: count >= 4 ? thisItem[index * count + 3] : [],
- data5: count >= 5 ? thisItem[index * count + 4] : [],
- is_light: false,
- });
- });
- Object.keys(fzy).map((key) => {
- fzyArr.push(fzy[key]);
- });
- Object.keys(jfpl).map((key) => {
- jfplArr.push(jfpl[key]);
- });
- fzyArr.pop();
- var jfplName = jfplArr.pop();
- var indicator = [
- "北",
- "北北西",
- "北西",
- "西北西",
- "西",
- "西南西",
- "南西",
- "南南西",
- "南",
- "南南东",
- "东南",
- "东南东",
- "东",
- "东北东",
- "北东",
- "北北东",
- ];
- var fzyDataArr = [];
- fzyArr.forEach((item, index) => {
- var arr = [];
- item.forEach((e, i) => {
- arr.push(e.value);
- });
- fzyDataArr.push([
- {
- indicator: indicator,
- data: [
- {
- value: arr,
- },
- ],
- name: jfplArr[index],
- },
- ]);
- });
- this.fzyData = fzyDataArr;
- this.tableData.data = data2;
- });
- api
- .benchmarkingDjhxdbbottom({
- wpid: this.value1,
- wtids: this.value2,
- date: this.value4,
- })
- .then((res) => {
- console.log(res.data);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- for (const key in res.data) {
- let obj = {}
- obj.name = key
- obj.value = res.data[key]
- this.list.push(obj)
- }
- console.log(" this.list", this.list);
- });
- },
- reset() {
-
- this.value1 = "";
- this.value2 = "";
- this.value4 = this.getTime(1);
- this.AjaxCommon();
- },
- TypeClick(val) {
- this.TypeClass = val;
-
-
-
- this.value4 = this.getTime(1);
- this.ajaxName = this.ajaxArr[val];
- this.AjaxCommon();
-
- },
- },
- watch: {
- value4() {
- this.AjaxCommon();
- },
- },
- };
- </script>
- <style lang="less">
- .decision-page-3 {
- .com-panel {
- .panel-title {
- color: @gray-l;
- }
- .tools {
- display: flex;
- .tool-block {
- display: flex;
- align-items: center;
- margin-left: 0.741vh;
- .legend {
- flex: auto;
- width: 0.741vh;
- height: 0.741vh;
- margin-right: 0.741vh;
- &.long {
- width: 2.963vh;
- height: 0.37vh;
- }
- }
- .legend-text {
- color: @gray-l;
- font-size: @fontsize-s;
- }
- }
- }
- }
- .info {
- overflow: auto;
- height: calc(100vh - 150px);
- }
- .project-table {
- overflow: auto;
- .com-table {
- tbody {
- padding-right: 0px;
- }
- th,
- td {
- color: #b2bdc0;
- &:nth-child(1) {
- width: 32px;
- }
- &:nth-child(2) {
- width: 183px;
- }
- }
- }
- }
- .direction-info {
- .com-table {
- tbody {
- padding-right: 0px;
- }
- th,
- td {
- color: #b2bdc0;
- padding: 0;
- &:nth-child(1) {
- width: 32px;
- background-color: fade(#536268, 20);
- }
- &:nth-child(2) {
- width: 183px;
- background-color: fade(#536268, 40);
- }
- .direction-title {
- background-color: fade(#536268, 20);
- font-size: @fontsize-s;
- line-height: 2.963vh;
- }
- .direction-chart {
- padding-top: 48px;
- .legend {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 32px;
- margin-bottom: 16px;
- .dot {
- width: 7px;
- height: 7px;
- background: @green;
- display: inline-block;
- margin-right: 8px;
- }
- }
- }
- }
- }
- }
- }
- .hide {
- opacity: 0;
- }
- .bg-1 {
- background: #05bb4c;
- }
- .bg-2 {
- background: #f8de5b;
- }
- .bg-3 {
- background: #4b55ae;
- }
- .bg-4 {
- background: #fa8c16;
- }
- .bg-5 {
- background: #1da0d7;
- }
- </style>
|