index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <div class="table-box">
  3. <div class="card table-search" style="overflow: hidden;">
  4. <el-form ref="formRef" :model="searchParam" :inline="true" label-width="auto">
  5. <el-form-item label="自动站:" prop="base">
  6. <el-select v-model="searchParam.base" placeholder="请选择" style="width: 200px">
  7. <el-option v-for="item in baseOptions" :key="item.value" :label="item.label"
  8. :value="item.value" />
  9. </el-select>
  10. </el-form-item>
  11. <el-form-item label="观测时间:" prop="base">
  12. <el-date-picker v-model="searchParam.date" type="daterange" range-separator="至"
  13. start-placeholder="开始时间" end-placeholder="结束时间" style="width: 300px" />
  14. </el-form-item>
  15. <el-form-item>
  16. <div>
  17. <el-button plain>查询</el-button>
  18. <el-button plain @click="resetForm(formRef)">重置</el-button>
  19. </div>
  20. </el-form-item>
  21. </el-form>
  22. </div>
  23. <div class="main_list">
  24. <el-row :gutter="15">
  25. <el-col :span="24">
  26. <div class="chart_item">
  27. <div style="font-weight: bold;" class="item_title">
  28. <span>风向风速玫瑰图</span>
  29. </div>
  30. <div class="mt5">
  31. <div ref="data" class="data_box"></div>
  32. </div>
  33. </div>
  34. </el-col>
  35. </el-row>
  36. </div>
  37. </div>
  38. </template>
  39. <script setup lang="ts" name="dataSynthesis">
  40. import * as echarts from 'echarts';
  41. import { ref, reactive, onMounted } from "vue";
  42. import { useRouter } from "vue-router";
  43. const formRef = ref()
  44. const data = ref()
  45. const router = useRouter();
  46. const searchParam = reactive({
  47. base: undefined,
  48. date: ''
  49. })
  50. const baseOptions = ref([{
  51. value: 0,
  52. label: 'M1986',
  53. },
  54. {
  55. value: 1,
  56. label: 'M1987',
  57. }])
  58. // resetForm
  59. const resetForm = (formEl) => {
  60. if (!formEl) return;
  61. formEl.resetFields();
  62. };
  63. const showData = () => {
  64. let mychart = echarts.init(data.value);
  65. let option = {
  66. legend: {
  67. // data: ['Allocated Budget', 'Actual Spending']
  68. },
  69. radar: {
  70. shape: 'circle',
  71. name: { // (圆外的标签)雷达图每个指示器名称的配置项。
  72. formatter: '{value}',
  73. textStyle: {
  74. fontSize: 15,
  75. color: '#000'
  76. }
  77. },
  78. nameGap: 5,
  79. // 指示器名称和指示器轴的距离。[ default: 15 ]
  80. splitNumber: 7,
  81. splitLine: { // (这里是指所有圆环)坐标轴在 grid 区域中的分隔线。
  82. lineStyle: {
  83. color: '#bbbbbb',
  84. // 分隔线颜色
  85. width: 1,
  86. // 分隔线线宽
  87. }
  88. },
  89. splitArea: { // 坐标轴在 grid 区域中的分隔区域,默认不显示。
  90. show: true,
  91. areaStyle: { // 分隔区域的样式设置。
  92. color: ['#fff', '#fff'],
  93. // 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
  94. }
  95. },
  96. indicator: [
  97. { name: 'N', max: 21, axisLabel: { show: true, color: '#000' }, },
  98. { name: 'NNW', max: 21 },
  99. { name: 'NW°', max: 21 },
  100. { name: 'WNW', max: 21 },
  101. { name: 'W°', max: 21 },
  102. { name: 'WSW', max: 21 },
  103. { name: 'WS°', max: 21 },
  104. { name: 'SSW', max: 21 },
  105. { name: 'S', max: 21 },
  106. { name: 'SSE', max: 21 },
  107. { name: 'SE', max: 21 },
  108. { name: 'ESE', max: 21 },
  109. { name: 'E', max: 21 },
  110. { name: 'ENE', max: 21 },
  111. { name: 'NE', max: 21 },
  112. { name: 'NNE', max: 21 },
  113. ]
  114. },
  115. series: [
  116. {
  117. name: 'Budget vs spending',
  118. type: 'radar',
  119. symbolSize: 0,//拐点大小
  120. data: [
  121. {
  122. value: [0, 12, 12, 12, 0, 0, 0, 12, 15, 15, 9, 0, 0, 0, 15, 8],
  123. name: '风向',
  124. itemStyle: { // 单个拐点标志的样式设置。
  125. normal: {
  126. // color:'#d1d6dd'
  127. }
  128. },
  129. },
  130. {
  131. value: [0, 4, 16, 9, 0, 0, 0, 15, 13, 10, 12, 0, 0, 0, 5, 11],
  132. name: '风速 (0.1m/s)'
  133. }
  134. ]
  135. }
  136. ]
  137. };
  138. mychart.setOption(option)
  139. window.addEventListener("resize", function () {
  140. mychart.resize();
  141. });
  142. }
  143. onMounted(() => {
  144. showData()
  145. })
  146. </script>
  147. <style scoped lang="scss">
  148. .main_list {
  149. background: transparent !important;
  150. box-shadow: none !important;
  151. padding: 0 !important;
  152. height: calc(100vh - 150px);
  153. margin-bottom: 10px;
  154. overflow-y: scroll;
  155. overflow-x: hidden;
  156. .chart_item {
  157. border-radius: 10px;
  158. padding: 10px;
  159. background-color: #fff;
  160. // height: 100%;
  161. // margin-bottom: 15px;
  162. .item_title {
  163. display: flex;
  164. justify-content: space-between;
  165. align-items: center;
  166. }
  167. .FTP_box {
  168. padding: 0 50px;
  169. display: flex;
  170. align-items: center;
  171. justify-content: space-between;
  172. .FTP_item {
  173. flex: 1;
  174. flex-shrink: 0;
  175. display: flex;
  176. flex-direction: column;
  177. justify-content: center;
  178. align-items: center;
  179. img {
  180. width: 56px;
  181. margin-bottom: 20px;
  182. }
  183. }
  184. }
  185. }
  186. .info_box {
  187. .info_title {
  188. color: #999999;
  189. font-size: 16px;
  190. }
  191. .info_content {
  192. height: 40px;
  193. font-weight: bold;
  194. color: #000;
  195. font-size: 26px;
  196. }
  197. }
  198. }
  199. .data_box {
  200. height: calc(100vh - 215px);
  201. // height: 100%;
  202. }
  203. </style>