소스 검색

森林防火预警、修复dialog样式问题

Hwf 10 달 전
부모
커밋
74623248bc

BIN
src/assets/images/down.png


+ 1 - 1
src/router/routes.ts

@@ -101,7 +101,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
     name: "ForestFirePrevention",
     component: () => import("@/views/disasterRiskMonitor/forestFirePrevention.vue"),
     meta: {
-      title: "城市应急事件专题",
+      title: "森林防火应急专题",
       noCache: true
     }
   },

+ 1 - 0
src/styles/vant-ui.less

@@ -70,6 +70,7 @@
 }
 .van-dialog {
    border-radius: 8px !important;
+  width: var(--van-dialog-width) !important;
   .van-dialog__header {
     padding: 12px 16px;
     font-size: 14px;

+ 86 - 0
src/views/disasterRiskMonitor/chartOptions.ts

@@ -405,3 +405,89 @@ export const chartOption3 = {
         }
     ]
 };
+
+export const chartOption4 = {
+    grid: {
+        top: '0',
+        left: '10px',
+        right: '40px',
+        bottom: '20px',
+        containLabel: true
+    },
+    tooltip: {
+        trigger: 'axis',
+        axisPointer: {
+            type: 'shadow'
+        }
+    },
+    xAxis: {
+        type: 'value',
+        axisLabel: {
+            show: true,
+            textStyle: {
+                color: '#7F8B9F'
+            }
+        },
+        axisLine: {
+            show: true,
+            lineStyle: {
+                color: '#eaeef7'
+            }
+        },
+        splitLine: {
+            show: false
+        }
+    },
+    yAxis: {
+        type: 'category',
+        axisLabel: {
+            show: true,
+            textStyle: {
+                color: '#7F8B9F'
+            }
+        },
+        axisLine: {
+            show: true,
+            lineStyle: {
+                color: '#eaeef7'
+            }
+        },
+        axisTick: {
+            show: false
+        },
+        data: [
+            '信宜市',
+            '高州市',
+            '化州市',
+            '电白区',
+            '茂南区',
+            '滨海新区',
+            '高新区'
+        ]
+    },
+    series: [
+        {
+            name: '2011',
+            type: 'bar',
+            label: {
+                show: true,
+                position: 'right',
+                fontSize: '12px',
+                color: '#2C81FF'
+            },
+            data: [67524, 57524, 47524, 37524, 47524, 47524, 32524],
+            itemStyle: {
+                color: new graphic.LinearGradient(0, 0, 1, 0, [
+                    {
+                        offset: 0,
+                        color: '#266FE8'
+                    },
+                    {
+                        offset: 1,
+                        color: '#A1C0F5'
+                    }
+                ])
+            }
+        }
+    ]
+}

+ 214 - 2
src/views/disasterRiskMonitor/forestFirePrevention.vue

@@ -77,6 +77,26 @@
         <div class="text">森林防火隐患图分布</div>
       </div>
       <div class="card-content3">
+        <div class="box1">
+          <van-search
+              placeholder="请输入位置信息"
+              v-model="queryParams.keyword"
+              class="common-search"
+              :left-icon="searchImg"
+              :right-icon="closeImg"
+              show-action
+              @search="onSearchKeyword"
+              @click-right-icon.stop="onSearchCancel"
+          >
+            <template #action>
+              <div @click="onSearchKeyword">搜索</div>
+            </template>
+          </van-search>
+          <div class="select-box" @click="showPicker = true">
+            <div class="label">{{ selectLabel }}</div>
+            <i class="icon-down" />
+          </div>
+        </div>
         <Map
             ref="mapRef"
             class="map"
@@ -85,16 +105,116 @@
             :event-details="eventDetails"
             style="height: 308px"
         />
+        <div class="box2">
+          <div class="box-item">
+            <i class="icon1" />
+            <div class="text1">高风险</div>
+            <div class="text-box">
+              <div class="text-red">0</div>
+              个
+            </div>
+          </div>
+          <div class="box-item">
+            <i class="icon2" />
+            <div class="text1">中风险</div>
+            <div class="text-box">
+              <div class="text-orange">0</div>
+              个
+            </div>
+          </div>
+          <div class="box-item">
+            <i class="icon3" />
+            <div class="text1">低风险</div>
+            <div class="text-box">
+              <div class="text-blue">0</div>
+              个
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="card">
+      <div class="card-header" style="justify-content: space-between;">
+        <div class="flex">
+          <i class="icon-line" />
+          <div class="text">各区县森林防火隐患排行</div>
+        </div>
+        <div class="sub-text2">更新时间:10-10</div>
+      </div>
+      <div class="card-content4">
+        <Chart :option="option1" style="height: 270px" />
       </div>
     </div>
+    <van-popup v-model:show="showPicker" round position="bottom">
+      <van-picker
+          :columns="columns"
+          @cancel="showPicker = false"
+          @confirm="onConfirm"
+      />
+    </van-popup>
   </div>
 </template>
 
 <script lang="ts" setup name="forestFirePrevention">
-import {ref} from "vue";
+import {onMounted, reactive, ref} from "vue";
+import searchImg from "@/assets/images/search.png";
+import closeImg from "@/assets/images/close.png";
+import {chartOption4} from "@/views/disasterRiskMonitor/chartOptions";
 
 let pointType = ref([]);
 let eventDetails = ref({});
+const queryParams = reactive({
+  keyword: '',
+  page: 0,
+  pageSize: 10
+});
+const queryParams2 = reactive({
+  area: ''
+});
+let selectLabel = ref('茂名市');
+let showPicker = ref(false);
+const columns = ref([
+  { text: '茂名市', value: '' },
+  { text: '茂南区', value: '0' },
+  { text: '信宜市', value: '1' },
+  { text: '高州市', value: '2' },
+  { text: '化州市', value: '3' }
+])
+let option1 = ref(chartOption4);
+// 搜索关键字变化时触发的方法
+function onSearchKeyword(keyword) {
+  // 根据搜索关键字更新查询参数
+  queryParams.keyword = keyword;
+  queryParams.page = 0;
+  // 刷新列表数据
+  getList();
+}
+
+// 右侧关闭按钮点击时触发的方法
+const onSearchCancel = () => {
+  // 清空搜索关键字
+  queryParams.keyword = "";
+  queryParams.page = 0;
+  // 刷新列表数据
+  getList();
+}
+const onConfirm  = ({selectedOptions}) => {
+  showPicker.value = false;
+  queryParams.page = 0;
+  selectLabel.value = selectedOptions[0].text;
+  queryParams2.area = selectedOptions[0].value;
+  initData();
+};
+const getList = () => {
+
+}
+const initData = () => {
+
+}
+
+onMounted(() => {
+
+})
 </script>
 
 <style scoped lang="scss">
@@ -116,6 +236,10 @@ let eventDetails = ref({});
       padding: 11px 5px;
       display: flex;
       align-items: center;
+      .flex {
+        display: flex;
+        align-items: center;
+      }
       .icon-line {
         display: inline-block;
         width: 6px;
@@ -131,6 +255,11 @@ let eventDetails = ref({});
       color: rgba(0, 0, 0, 0.45);
       margin-top: -7px;
     }
+    .sub-text2 {
+      font-size: 12px;
+      padding: 0 5px;
+      color: #7F8B9F;
+    }
     .card-content {
       padding: 13px;
       //padding-bottom: 13px;
@@ -268,7 +397,90 @@ let eventDetails = ref({});
         align-items: center;
       }
     }
+    .card-content3 {
+      .box1 {
+        display: flex;
+        align-items: center;
+        margin: 12px 12px 12px 16px;
+        .select-box {
+          width: 80px;
+          margin-left: 10px;
+          display: flex;
+          align-items: center;
+          .icon-down {
+            margin-left: 3px;
+            display: inline-block;
+            flex-shrink: 0;
+            width: 14px;
+            height: 14px;
+            background: url('@/assets/images/down.png') no-repeat;
+            background-size: 100% 100%;
+          }
+        }
+      }
+      .box2 {
+        padding: 0 30px;
+        display: flex;
+        justify-content: space-between;
+        .box-item {
+          .icon1, .icon2, .icon3 {
+            display: inline-block;
+            width: 48px;
+            height: 48px;
+            background: #FFFFFF;
+            box-shadow: 0 2px 1px -1px #bcd7ffb5, inset 0 1px 3px 6px #ace2ff08;
+            border-radius: 11px;
+          }
+          .text1 {
+            font-size: 14px;
+            color: #414F64;
+            line-height: 26px;
+          }
+          .text-box {
+            display: flex;
+            align-items: center;
+            .text-blue {
+              font-size: 24px;
+              margin-right: 5px;
+              color: #80C2FF;
+            }
+            .text-orange {
+              font-size: 24px;
+              margin-right: 5px;
+              color: #FFAF00;
+            }
+            .text-red {
+              font-size: 24px;
+              margin-right: 5px;
+              color: #FF2F3C;
+            }
+          }
+        }
+      }
+    }
+  }
+}
+.common-search {
+  border: 1px solid #DCE0EE;
+  border-radius: 2px;
+  padding: 0;
+  :deep(.van-search__content) {
+    background-color: #ffffff;
+  }
+  :deep(.van-field__left-icon) {
+    .van-icon__image {
+      width: 12px;
+      height: 12px;
+    }
+  }
+  :deep(.van-field__right-icon) {
+    width: 30px;
+    height: 30px;
+    padding: 0;
+    .van-icon__image {
+      width: 30px;
+      height: 30px;
+    }
   }
-
 }
 </style>