| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <!--
- * @Title:
- * @Description: 危险区信息
- * @Author: swp
- * @Date: 2022-08-24 10:49:21
- * @LastEditors:
- * @LastEditTime: 2022-08-24 10:49:21
- -->
- <template>
- <view class="container">
- <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
- @clickLeft="toBack">
- <view class="nav-title">
- <text>{{title}}</text>
- </view>
- </uni-nav-bar>
- <view class="container">
- <uni-section title="查询" type="line">
- <view class="search-block">
- <view class="name">
- <uni-easyinput :styles="inputStyles" @input="adNameValInput" prefixIcon="search"
- v-model="adNameVal" placeholder="请输入行政区名称">
- </uni-easyinput>
- </view>
- <view class="name">
- <uni-easyinput :styles="inputStyles" @input="dangerAreaNameValInput" prefixIcon="search"
- v-model="dangerAreaNameVal" placeholder="请输入危险区名称">
- </uni-easyinput>
- </view>
- <view class="submit-btn">
- <button type="default" @click="search">查 询</button>
- </view>
- </view>
- </uni-section>
- <uni-list>
- <uni-list-item v-for="item in list" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="line">
- <text class="title text-ellipsis">{{item.dangerAreaName}}</text>
- </view>
- <view class="line" style="margin-top: 5px;">
- <uni-icons class="input-uni-icon" type="map-pin-ellipse" size="18" color="orangered" />
- <text class="lable">行政区划:</text>
- <text class="content" style="color: blue;">{{item.adnm}}</text>
- </view>
- <view class="item-button-group">
- <view class="item-button mid-size" @click="toQr(item)">
- <view class="view-flex-inline-center">
- <uni-icons class="input-uni-icon" type="scan" size="18" color="coral" />
- <text class="button-text">危险区二维码</text>
- </view>
- </view>
- <view class="item-button mid-size" @click="toMap(item)">
- <view class="view-flex-inline-center">
- <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
- <text class="button-text">地图查看</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- <uni-group>
- <view class="pagination-block">
- <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
- @change="pageChange" />
- </view>
- </uni-group>
- </view>
- </view>
- </template>
- <script>
- import http from '@/http/api.js';
- import {
- devUrl,
- prodUrl
- } from '@/common/setting';
- export default {
- components: {
- },
- onLoad(options) {
- this.id = options.id;
- this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
- this.getPage();
- },
- data() {
- return {
- title: '危险区信息',
- pageSize: 10,
- pageCurrent: 1,
- total: 0,
- list: [],
- query: {},
- adNameVal: '',
- dangerAreaNameVal: '',
- inputStyles: {
- color: '#808080',
- borderColor: '#d3d3d3'
- },
- }
- },
- computed: {
- },
- onInit(option) {
- console.log("onInit")
- },
- onLoad(option) {
- console.log("onLoad")
- this.getPage();
- },
- onShow() {
- console.log("onShow")
- },
- onReady() {
- console.log("onReady")
- },
- methods: {
- toBack() {
- uni.navigateBack({
- delta: 1
- })
- },
- adNameValInput(e) {
- if (e == null || e.length == 0) {
- this.adNameVal = '';
- }
- },
- dangerAreaNameValInput(e) {
- if (e == null || e.length == 0) {
- this.dangerAreaNameVal = '';
- }
- },
- search() {
- this.pageCurrent = 1;
- this.getPage();
- },
- toMap(item) {
- let url = '/pages/yjxt/dangerarea/dangerareamap?id=' + item.id;
- uni.navigateTo({
- url: url
- })
- },
- toQr(item) {
- let url = '/pages/yjxt/dangerarea/dangerareaqr?id=' + item.dangerAreaPid;
- uni.navigateTo({
- url: url
- })
- },
- pageChange(e) {
- this.pageCurrent = e.current;
- this.getPage()
- },
- getPage(params = {}) {
- if (this.adNameVal.length > 0) {
- params['adName'] = this.adNameVal;
- }
- if (this.dangerAreaNameVal.length > 0) {
- params['dangerAreaName'] = this.dangerAreaNameVal;
- }
- const current = this.pageCurrent;
- const size = this.pageSize;
- let postData = Object.assign(params, this.query);
- let that = this;
- http.request({
- url: '/galaxy-business/map/dangerarea/page',
- method: 'GET',
- params: {
- current,
- size,
- },
- data: postData,
- }).then(res => {
- if (res.data.records != null) {
- that.list = res.data.records;
- }
- this.total = res.data.total;
- }).catch(err => {
- console.log(err)
- })
- },
- }
- }
- </script>
- <style>
- /* page {
- background-color: rgb(240, 242, 244);
- } */
- .uni-body {
- font-size: 0.7rem;
- }
- </style>
|