123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546 |
- <template>
- <div class="decision-page-1">
- <!-- 查询样式统一处理 样式在 assets/styles/form.less 文件中 -->
- <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 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-select v-model="value3" @change="XianLuChange(value3)" multiple placeholder="请选择"
- popper-class="select">
- <el-option v-for="item in XianLu" :key="item.id" :label="item.name" :value="item.id">
- </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-item">
- <div class="lable">结束日期:</div>
- <div class="search-input">
- <el-date-picker v-model="value5" @change="EndChange(value5)" type="date"
- value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
- </el-date-picker>
- <div class="unit svg-icon svg-icon-gray">
- <svg-icon :svgid="''" />
- </div>
- </div>
- </div>
- </div>
- <div class="query-actions">
- <button class="btn">搜索</button>
- <button class="btn green" @click="mxClick()">明细信息</button>
- <button class="btn">导出</button>
- </div>
- </div>
- <div class="actions mg-b-8">
- <button class="btn" :class="TypeClass==1?'green':''" @click="TypeClick(1)">风场</button>
- <button class="btn" :class="TypeClass==2?'green':''" @click="TypeClick(2)">项目</button>
- <button class="btn" :class="TypeClass==3?'green':''" @click="TypeClick(3)">集电线路</button>
- </div>
- <div class="contentMx">
- <div class="activeMx">
- <el-row :type="'flex'" class="content">
- <el-col :span="10" class="pd-r-8">
- <toolbar-panel title="风机绩效榜明细" :showLine="false">
- <bar-line-chart :height="'calc(100vh - 200px)'" :bardata="bardata" :lineData="lineData" :color="barColor" lineName="理论发电量"/>
- </toolbar-panel>
- </el-col>
- <el-col :span="14" class="pd-l-8">
- <panel :title="'项目列表'" :showLine="false">
- <div class="project-table">
- <Table :data="tableData"></Table>
- </div>
- </panel>
- </el-col>
- </el-row>
- </div>
- </div>
- </div>
- </template>
- <script>
- import BarLineChart from "../../components/chart/combination/bar-line-chart.vue";
- import SvgIcon from "../../components/coms/icon/svg-icon.vue";
- import Panel from "../../components/coms/panel/panel.vue";
- import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";
- import Table from "../../components/coms/table/table.vue";
- export default {
- components: {
- ToolbarPanel,
- BarLineChart,
- Panel,
- Table,
- SvgIcon
- },
- data() {
- return {
- tableData: {
- column: [{
- name: "",
- field: "index",
- is_num: false,
- is_light: false,
- },
- {
- name: "名称",
- field: "name",
- is_num: false,
- is_light: false,
- },
- {
- name: "理论发电量",
- field: "llfdl",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "SCADA发电量",
- field: "sjfdl",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "风速",
- field: "speed",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "故障损失",
- field: "fjhjx1",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "故障受累",
- field: "fjhjx2",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "检修损失",
- field: "jhjx1",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "检修受累",
- field: "jhjx2",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "电网受累",
- field: "sl1",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "天气受累",
- field: "sl2",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "限电降出",
- field: "xd1",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "限电停机",
- field: "xd2",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "待风损失",
- field: "xn1",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "手动停机",
- field: "xn2",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "正常发电",
- field: "xn3",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "缺陷降出",
- field: "xn4",
- is_num: false,
- is_light: false,
- sortable:true
- },
- {
- name: "风能利用率%",
- field: "fnlly",
- is_num: false,
- is_light: false,
- sortable:true
- }
- ],
- data: [],
- },
- ChangZhan: [], //场站
- XiangMu: [], //项目
- XianLu: [], //线路
- value1: [],
- value2: [],
- value3: [],
- value4: "",
- value5: "",
- TypeClass: 1, //风场,项目,集电线路 的按钮颜色,默认第一个
- bardata: [],
- lineData: [],
- };
- },
- created() {
- this.ChangZhanVal();
- this.value4 = this.getTime(1);
- this.value5 = this.getTime(2);
- this.AjaxCommon();
- // var that = this;
- // that.API.requestData({
- // method: "GET",
- // subUrl: "benchmarking/fjjxb",
- // data: {
- // wpids: that.value1,
- // projectids: that.value2,
- // lineids: that.value3,
- // beginDate: that.value4,
- // endDate: that.value5,
- // type: that.TypeClass,
- // target: 'llfdl',//当前点击的名称
- // sort: 1//1或2
- // },
- // success(res) {
- // console.log(JSON.stringify(res))
- // }
- // });
- // http://10.155.32.33:9001/
- },
- methods: {
- ChangZhanVal() {
- var that = this;
- that.API.requestData({
- method: "GET",
- subUrl: "benchmarking/wplist",
- success(res) {
- that.ChangZhan = res.data;
- }
- });
- },
- ChangZhanChange(val) {
- this.TypeClass = "";
- this.value1 = val;
- this.value2 = [];
- this.value3 = [];
- this.AjaxCommon();
- this.XiangMuVal(val);
- },
- XiangMuVal(val) {
- var that = this;
- that.API.requestData({
- method: "GET",
- subUrl: "benchmarking/projectList",
- data: {
- wpids: val
- },
- success(res) {
- that.XiangMu = res.data;
- }
- });
- },
- XiangMuChange(val) {
- this.TypeClass = "";
- this.value2 = val;
- this.value3 = [];
- this.AjaxCommon();
- this.XianLuVal(val);
- },
- XianLuVal(val) {
- var that = this;
- that.API.requestData({
- method: "GET",
- subUrl: "benchmarking/lineList",
- data: {
- projects: val
- },
- success(res) {
- that.XianLu = res.data;
- }
- });
- },
- XianLuChange(val) {
- this.TypeClass = "";
- this.value3 = val;
- this.AjaxCommon();
- },
- BeginChange(val) {
- this.value4 = val;
- this.AjaxCommon();
- },
- EndChange(val) {
- this.value5 = val;
- this.AjaxCommon();
- },
- TypeClick(val) {
- if (val != this.TypeClass && this.TypeClass) {
- this.TypeClass = val;
- // 重置状态start
- this.value1 = [];
- this.value2 = [];
- this.value3 = [];
- this.value4 = this.getTime(1);
- this.value5 = this.getTime(2);
- this.AjaxCommon();
- // 重置状态end
- }
- },
- getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
- 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() {
- var that = this;
- that.API.requestData({
- method: "GET",
- subUrl: "benchmarking/fjjxbmx",
- data: {
- wpids: that.value1,
- projectids: that.value2,
- lineids: that.value3,
- beginDate: that.value4,
- endDate: that.value5,
- type: that.TypeClass,
- target: '',
- sort: ''
- },
- success(res) {
- console.log(res)
- var name = [],
- data = [],
- llfdl = [],
- legend = ["实际电量", "故障损失", "故障受累", "检修受累", "电网受累", "天气受累", "限电降出", "限电停机", "待风损失",
- "手动停机", "正常发电", "缺陷降出"
- ],
- data2 = []; //项目列表
- res.data.forEach((item, index) => {
- name.push(item.name);
- llfdl.push(item.llfdl);
- data.push([item.sjfdl, item.fjhjx1, item.fjhjx2, item.jhjx1, item.jhjx2, item
- .sl1, item.sl2, item.xd1, item.xd2, item.xn1, item.xn2, item.xn3,
- item.xn4
- ])
- data2.push({
- index: index + 1,
- name: item.name,
- llfdl: item.llfdl,
- sjfdl: item.sjfdl,
- speed: item.speed,
- fjhjx1: item.fjhjx1,
- fjhjx2: item.fjhjx2,
- jhjx1: item.jhjx1,
- jhjx2: item.jhjx2,
- sl1: item.sl1,
- sl2: item.sl2,
- xd1: item.xd1,
- xd2: item.xd2,
- xn1: item.xn1,
- xn2: item.xn2,
- xn3: item.xn3,
- xn4: item.xn4,
- fnlly: item.fnlly,
- is_light: false
- })
- })
- name.pop();
- data.pop();
- llfdl.pop();
- if (data.length > 0) {
- let arr1 = [];
- const length = data[0].length;
- for (var i = 0; i < length; i++) {
- let arr2 = [];
- data.forEach(ele => {
- arr2.push(ele[i])
- });
- arr1.push(arr2);
- }
- that.lineData = llfdl;
- that.bardata = {
- area: name,
- legend: legend,
- data: arr1
- };
- }
- that.tableData.data = data2;
- }
- });
- },
- mxClick() {
- this.$router.push("/decision/decision1")
- },
- thClick: function(i) {
- console.log(i) // 当子组件触发按钮时,msg获取值为 哈哈啊哈哈
- }
- }
- };
- </script>
- <style lang="less">
- .decision-page-1 {
- .com-panel .panel-title {
- line-height: 3.4259vh;
- }
- .tools {
- display: flex;
- line-height: 3.4259vh;
- .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;
- }
- }
- }
- .project-table {
- overflow: auto;
- tbody {
- height: calc(100vh - 24.5vh);
- }
- td {
- color: #b2bdc0;
- }
- }
- .contentMx {
- width: 100%;
- overflow-x: auto;
- }
- .activeMx {
- width: 130%;
- }
- }
- .main {
- overflow: auto;
- }
- // .main .main-body{height: calc(100vh - 6.63vh);}
- .bg-olive {
- background-color: #8dc63f;
- color: #ffffff;
- }
- .bg-cyan {
- background-color: #1cbbb4;
- }
- .bg-mauve {
- background-color: #9c26b0;
- }
- .bg-pink {
- background-color: #e03997;
- }
- .bg-brown {
- background-color: #a5673f;
- }
- .bg-pink2 {
- background-color: #FF0099;
- }
- .bg-blue2 {
- background-color: #07ABF5;
- }
- .bg-green2 {
- background-color: #1D3638;
- }
- </style>
|