123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <template>
- <div class="agc">
- <el-scrollbar>
- <div class="panel-groups">
- <AgcPanel class="panel-item" v-for="(data, index) of datas" :key="index" :data="data"></AgcPanel>
- </div>
- </el-scrollbar>
- </div>
- </template>
- <script>
- import AgcPanel from "./components/agc-panel.vue";
- import store from "@store/index.js";
- export default {
- // 名称
- name: "Agc",
- // 使用组件
- components: {
- AgcPanel,
- },
- // 数据
- data() {
- return {
- timmer: null, // 计时器
- datas: [
- {
- title: "某某风电场",
- subTitle: "(调度名称)",
- icon: "fa fa-gears",
- color: "green",
- },
- ],
- btnGroups: [
- {
- icon: "fa fa-fire",
- btns: [
- {
- text: "某某风电场",
- code: "mmfdc1",
- },
- {
- text: "麻黄山风场",
- code: "mhsfc",
- },
- {
- text: "某某风电场",
- code: "mmfdc2",
- },
- {
- text: "某某风电场",
- code: "mmfdc3",
- },
- {
- text: "某某风电场",
- code: "mmfdc4",
- },
- ],
- },
- {
- icon: "fa fa-fire-extinguisher",
- btns: [
- {
- text: "某某光伏",
- code: "mmgf1",
- },
- {
- text: "某某光伏",
- code: "mmgf2",
- },
- {
- text: "某某光伏",
- code: "mmgf3",
- },
- {
- text: "某某光伏",
- code: "mmgf4",
- },
- ],
- },
- ],
- };
- },
- // 函数
- methods: {
- select: function(item) {
- // console.log(item);
- },
- // 请求服务
- requestData(showLoading) {
- let that = this;
- that.API.requestData({
- showLoading,
- method: "POST",
- subUrl: "genreset/getAgcValues",
- // timeout: 600000,
- success(res) {
- let datas = [];
- if (res.data) {
- res.data.forEach((pEle) => {
- pEle.jcxx.icon = "fa fa-gears";
- pEle.jcxx.color = pEle.jcxx.zt === 0 ? "red" : "green";
- let keys = ["llgl", "sjgl", "xdzl", "ycgl"];
- let tb = [
- {
- title: "理论功率",
- yAxisIndex: 0,
- value: [],
- },
- {
- title: "实际功率",
- yAxisIndex: 0,
- value: [],
- },
- {
- title: "限电指令",
- yAxisIndex: 0,
- value: [],
- },
- {
- title: "预测功率",
- yAxisIndex: 0,
- value: [],
- },
- ];
- keys.forEach((key, keyIndex) => {
- pEle.tb.forEach((cEle, cIndex) => {
- // debugger;
- tb[keyIndex].value.push({ text: new Date(cEle.time).formatDate("hh:mm"), value: cEle[keys[keyIndex]] || 0 });
- });
- });
- pEle.tb = tb;
- datas.push(pEle);
- });
- that.datas = datas;
- } else {
- that.datas = datas;
- }
- },
- });
- },
- },
- created() {
- let that = this;
- that.$nextTick(() => {
- that.requestData(false);
- that.timmer = setInterval(() => {
- that.requestData(false);
- }, 10000);
- });
- },
- mounted() {
- // 渲染后
- for (let i = 1; i < 12; i++) {
- this.datas.push(JSON.parse(JSON.stringify(this.datas[0])));
- if (i % 2 == 0) {
- this.datas[i].color = "red";
- }
- }
- },
- unmounted() {
- clearInterval(this.timmer);
- this.timmer = null;
- },
- };
- </script>
- <style lang="less" scoped>
- .agc {
- height: calc(100vh - 7.222vh);
- overflow: hidden;
- .btn-group-tabs {
- display: flex;
- flex-direction: row;
- .photovoltaic {
- margin-left: 1.481vh;
- }
- }
- .panel-groups {
- display: flex;
- flex-direction: row;
- width: 100%;
- flex-wrap: wrap;
- .panel-item {
- width: calc(25% - 12px);
- height: 29vh;
- margin-left: 16px;
- margin-bottom: 16px;
- &:nth-child(4n + 1) {
- margin-left: 0;
- }
- }
- }
- }
- </style>
|