燕山石化溯源三维电子沙盘-【前端】-Web
WX
2023-08-01 0d0582cc5352a60e5f7042df81e6153e70a9715e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<template>
  <div class="FX_box">
    <div class="FX_title">三维污染物</div>
    <div class="form_box">
      <div class="inp_box">
        <span>监测点选择</span>
        <el-select
          v-model="data.SJvalue"
          class="m-2"
          size="large"
          @change="selectChange"
        >
          <el-option
            v-for="item in optionsPOI"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </div>
 
      <div class="inp_box">
        <span>时间选择</span>
        <el-date-picker
          size="large"
          v-model="selectform.value"
          type="datetime"
          @change="changeTime"
          value-format="YYYY-MM-DD HH"
        />
      </div>
      <div class="button_box">
        <el-button size="small" @click="selectList">确认</el-button>
      </div>
    </div>
  </div>
</template>
 
<script>
import { reactive, onMounted, watch, ref } from "vue";
import { useStore } from "vuex";
import {
  locationControllerQ,
  threedreliController,
  threedreliControllerbyt,
} from "@/api/api.js";
 
import { ElMessage } from "element-plus";
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  setup() {
    const store = useStore();
    let data = reactive({
      SJvalue: "",
    });
    const selectform = reactive({
      value1: [],
      value: "",
    });
    let optionsPOI = ref([]);
 
    //网格名称选择框
    // const getWGname = () => {
    //   let arr = [];
    //   optionsPOI = [];
    //   store.state.jkList.forEach((e) => {
    //     optionsPOI.value.push({ value: e.name, label: e.name });
    //   });
    //   //   optionsPOI = arr;
 
    // };
    const getWGname = async () => {
      // const dt = await locationControllerQ({ type: "监控点" });
      // const dt1 = await locationControllerQ({ type: "超级站" });
      const dt = await locationControllerQ({ type: "监控点" });
      const dt1 = await locationControllerQ({ type: "超级站" });
      let arr = [...dt.result, ...dt1.result];
 
      arr.forEach((e) => {
        optionsPOI.value.push({
          value: e.name,
          label: e.name,
          x: e.lon,
          y: e.lat,
        });
      });
    };
    //多层热力图
    const getDHeat = async (val) => {
      sgworld.Core.postMessage({ duoceng: "delete" });
      // const dt = await threedreliController({ name: val });
      // const dt = await threedreliControllerbyt({
      //   name: val,
      //   startTime: selectform.value,
      //   endOfTime: selectform.value,
      // });
      const dt = await threedreliControllerbyt({
        name: val,
        date: selectform.value,
      });
 
      let Narr = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90];
      let arr = [];
      Narr.forEach((e) => {
        dt.result.forEach((v) => {
          arr.push({
            vocs: v[`height${e}`],
            toumingdu: 0.8,
            lon: v.lon,
            lat: v.lat,
            high: 300 + e,
          });
        });
      });
      sgworld.Core.postMessage({
        duoceng: "gezi",
        duocengarr: arr,
        toumingdu: 2,
      });
      // sgworld.Core.postMessage({ type: "yincang", Hs: "show", id: -1 });
    };
    const selectList = async () => {
      if (selectform.value == "" || selectform.value == null) {
        return ElMessage.error("请选择时间段");
      }
      optionsPOI.value.forEach((e) => {
        if (e.value == data.SJvalue) {
          sgworld.Navigate.flyToPosition(e.x, e.y - 0.003, 500, {
            heading: -90,
            pitch: -30,
            roll: 0,
          });
        }
      });
      getDHeat(data.SJvalue);
    };
    const selectChange = (val) => {};
    getWGname();
    function changeTime(value) {
      // if (value == null) {
      //   selectform.value = "";
      // }
    }
    onMounted(() => {});
    return {
      data,
      selectList,
      selectChange,
      getWGname,
      optionsPOI,
      selectform,
      changeTime,
    };
  },
};
</script>
<style lang="less" scoped>
//@import url(); 引入公共css类
.FX_box {
  width: calc(742px * 1.5);
  height: calc(200px * 1);
  position: absolute;
  right: 70px;
  top: 490px;
  background: url("../assets/img/d.png") no-repeat center;
  background-size: 100% 100%;
  padding: 40px;
  box-sizing: border-box;
  .FX_title {
    font-size: 30px;
    font-weight: bold;
    color: #ffffff;
    padding-bottom: 30px;
  }
}
.form_box {
  display: flex;
  justify-content: space-around;
  align-items: center;
  .inp_box {
    span {
      font-size: 24px;
      font-weight: 400;
      color: #ffffff;
      padding-right: 10px;
    }
    /deep/ .el-input__wrapper {
      width: 460px;
      background: rgba(0, 0, 0, 0.2);
      border: 2px solid #2e58cc;
      border-radius: 10px;
      color: #ffffff;
      padding: 0;
      padding-left: 3px;
    }
    /deep/ .el-input__inner,
    /deep/ .el-textarea__inner {
      //   background-color: rgba(134, 132, 132, 0.5);
      color: #ffffff;
      font-size: 24px;
    }
    /deep/.el-range-input {
      color: white;
    }
    /deep/ .el-range-separator {
      color: white;
    }
    .el-select {
      width: 180px;
    }
    .el-select /deep/ .el-input__wrapper {
      background: rgba(0, 0, 0, 0.2);
      border: 2px solid #2e58cc;
      border-radius: 10px;
      color: #ffffff;
      padding: 0;
      padding-left: 6px;
    }
    .el-select /deep/ .el-input__inner {
      color: #ffffff;
      font-size: 24px;
    }
  }
}
.el-button {
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid #2e58cc;
  border-radius: 10px;
  color: #ffffff;
}
</style>