林火综合应急信息管理系统前端
guoshilong
2023-03-07 79c5d6a424c52ec50e856cdab5d98474cfd02be8
火灾管理火灾补录
7 files modified
254 ■■■■■ changed files
src/api/fire/fire.js 10 ●●●●● patch | view | raw | blame | history
src/components/OpenLayersMap/index.vue 2 ●●● patch | view | raw | blame | history
src/config/website.js 2 ●●● patch | view | raw | blame | history
src/views/fire/fireAdd.vue 1 ●●●● patch | view | raw | blame | history
src/views/fire/fireManage.vue 98 ●●●●● patch | view | raw | blame | history
src/views/fire/fireSupplement.vue 107 ●●●●● patch | view | raw | blame | history
src/views/system/user.vue 34 ●●●● patch | view | raw | blame | history
src/api/fire/fire.js
@@ -12,6 +12,16 @@
  })
}
export const getAll = (params) => {
  return request({
    url: '/api/blade-fire/fire/all',
    method: 'get',
    params: {
      ...params,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/blade-fire/fire/detail',
src/components/OpenLayersMap/index.vue
@@ -206,7 +206,7 @@
        this.pointVector.getSource().addFeature(feature_Point)
        let center = [Number(pointLonLat[0]), Number(pointLonLat[1])]
        let view = this.map.getView()
        view.setZoom(14)
        view.setZoom(20)
        view.animate({
          center: center,
          duration: 5,
src/config/website.js
@@ -8,7 +8,7 @@
  indexTitle: 'Saber Admin',
  clientId: 'saber', // 客户端id
  clientSecret: 'saber_secret', // 客户端密钥
  tenantMode: true, // 是否开启租户模式
  tenantMode: false, // 是否开启租户模式
  tenantId: "000000", // 管理组租户编号
  captchaMode: false, // 是否开启验证码模式
  switchMode: false, // 是否开启部门切换模式
src/views/fire/fireAdd.vue
@@ -185,6 +185,7 @@
        done();
      }
    },
    //获取地图经纬度
    getMapData(data){
      this.form.lon = data[0][0]
      this.form.lat = data[0][1]
src/views/fire/fireManage.vue
@@ -29,13 +29,17 @@
          </el-button>
        </template>
        <!--      <template slot-scope="{row}" slot="location">-->
        <!--        {{row.$location.split("|").join("")}}-->
        <!--      </template>-->
        <template slot-scope="{row}" slot="level">
          <span style="color: red" v-if="row.level == '1' ">{{row.$level}}</span>
          <span style="color: #f65f44" v-if="row.level == '2' ">{{row.$level}}</span>
          <span style="color: #f6a944" v-if="row.level == '3' ">{{row.$level}}</span>
          <span style="color: #70b603" v-if="row.level == '4' ">{{row.$level}}</span>
          <span style="color: #2cff00" v-if="row.level == '5' ">{{row.$level}}</span>
        </template>
        <template slot-scope="{type,size,row,index}" slot="menu">
          <el-button icon="el-icon-edit" :size="size" :type="type" @click="goToViewDetail(row)">详 情</el-button>
          <el-button icon="el-icon-delete" :size="size" :type="type" @click="goToFireSupplement(row)">补 录</el-button>
          <el-button icon="el-icon-delete" :size="size" :type="type" :disabled="row.supplementId !='' " @click="goToFireSupplement(row)">补 录</el-button>
        </template>
      </avue-crud>
    </basic-container>
@@ -92,19 +96,14 @@
            prop: "no",
            type: "input",
            search: true,
            searchSpan: 4,
            searchSpan: 3,
          },
          {
            label: "行政区域",
            prop: "location",
            span: 24,
            type: "cascader",
            props: {
              label: 'title',
              value: 'key'
            },
            dicUrl: 'api/blade-system/region/lazy-tree',
            slot: true
            label: "火灾位置",
            prop: "address",
            type: "input",
            search: true,
            searchSpan: 3,
          },
          {
            label: "发现方式",
@@ -116,7 +115,39 @@
              value: "dictKey"
            },
            search: true,
            searchSpan: 4,
            searchSpan: 3,
          },
          {
            label: "处置状态",
            prop: "status",
            type: "select",
            dicUrl: '/api/blade-system/dict-biz/dictionary?code=fire_handle_status',
            props: {
              label: "dictValue",
              value: "dictKey"
            },
            search: true,
            searchSpan: 3,
          },
          {
            label: "行政区域",
            prop: "location",
            span: 24,
            type: "cascader",
            props: {
              label: 'title',
              value: 'key'
            },
            dicUrl: 'api/blade-system/region/lazy-tree',
            slot: true,
            search:true,
            hide:true,
            searchSpan:3,
            dicFormatter(res){
              res.data.shift()
              return res.data
            }
          },
          {
            label: "火灾等级",
@@ -129,28 +160,28 @@
            },
          },
          {
            label: "处置状态",
            prop: "status",
            type: "select",
            dicUrl: '/api/blade-system/dict-biz/dictionary?code=fire_handle_status',
            props: {
              label: "dictValue",
              value: "dictKey"
            },
            search: true,
            searchSpan: 4,
          },
          {
            label: "报警人",
            prop: "caller",
            type: "input",
          },
          {
            label: "报警时间",
            type: 'datetimerange',
            prop:'alarmTimeRange',
            format:'yyyy-MM-dd HH:mm:ss',
            valueFormat:'yyyy-MM-dd HH:mm:ss',
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            hide: true,
            search: true,
            searchRange:true,
            searchSpan: 3
          },
          {
            label: "报警时间",
            prop: "alarmTime",
            type: "input",
            search: true,
            searchSpan: 4,
          },
          {
            label: "火灾描述",
@@ -360,6 +391,10 @@
    },
    onLoad(page, params = {}) {
      this.loading = true;
      if (this.query.alarmTimeRange &&this.query.alarmTimeRange.length>0){
        this.query.alarmTimeStart = this.query.alarmTimeRange[0]
        this.query.alarmTimeEnd = this.query.alarmTimeRange[1]
      }
      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
@@ -371,6 +406,7 @@
        this.selectionClear();
      });
    },
    //展示详情
    goToViewDetail(data) {
      getSupplementDetail(data.id).then(res => {
        if (res.data.code == 200) {
@@ -384,6 +420,7 @@
        }
      })
    },
    //跳转到火灾补录
    goToFireSupplement(data) {
      //要使跳转页接收到值,必须用name
      this.$router.push({
@@ -391,6 +428,7 @@
        params: data
      })
    },
    //跳转到列表页
    goToList(){
      this.isDetail = !this.isDetail
    }
src/views/fire/fireSupplement.vue
@@ -8,7 +8,17 @@
        </div>
        <el-row>
          <el-col :span="12">
            <avue-form ref="form" v-model="form" :option="option"></avue-form>
            <avue-form ref="form" v-model="form" :option="option">
              <template slot="no">
                <el-autocomplete class="inline-input"
                  v-model="form.no"
                  :fetch-suggestions="querySearch"
                  placeholder="请输入火灾编号"
                  :trigger-on-focus="false"
                  @select="handleSelect"
                ></el-autocomplete>
              </template>
            </avue-form>
          </el-col>
          <el-col :span="12">
            <OpenLayersMap ref="olMap" :mapLocation="mapLocation"></OpenLayersMap>
@@ -54,6 +64,7 @@
<script>
import {add} from "@/api/fireSupplement/fireSupplement";
import OpenLayersMap from "@/components/OpenLayersMap/index";
import {getAll} from "@/api/fire/fire";
export default {
  name: "fireSupplieMent",
@@ -72,10 +83,11 @@
            prop: 'no',
            span: 24,
            type: 'input',
            disabled: true,
            slot:true
          },
          {
            label: "行政区域",
            disabled:true,
            prop: "location",
            span: 24,
            type: "cascader",
@@ -83,49 +95,19 @@
              label: 'title',
              value: 'key'
            },
            separator: '',
            lazy: true,
            lazyLoad(node, resolve) {
              let stop_level = 2;
              let level = node.level;
              let data = node.data || {}
              let code = data.key;
              let list = [];
              let callback = () => {
                resolve((list || []).map(ele => {
                  return Object.assign(ele, {
                    leaf: level >= stop_level
                  })
                }));
              }
              if (level == 0) {
                axios.get(`${baseUrl}00`).then(res => {
                  list = res.data.data;
                  callback()
                })
              } else if (level == 1) {
                axios.get(`${baseUrl}${code}`).then(res => {
                  list = res.data.data;
                  callback()
                })
              } else if (level == 2) {
                axios.get(`${baseUrl}${code}`).then(res => {
                  list = res.data.data;
                  callback()
                })
              } else {
                callback()
              }
            }
            dicUrl: 'api/blade-system/region/lazy-tree',
            slot: true
          },
          {
            label: '具体地址',
            disabled:true,
            prop: 'address',
            span: 24,
            type: 'input'
          },
          {
            label: "发现方式",
            disabled:true,
            prop: "findWay",
            type: "select",
            row: true,
@@ -142,6 +124,7 @@
          },
          {
            label: "火灾等级",
            disabled:true,
            prop: "level",
            type: "select",
            row: true,
@@ -158,23 +141,27 @@
          },
          {
            label: "发现时间",
            disabled:true,
            prop: "alarmTime",
            type: "datetime",
          },
          {
            label: '报警人',
            disabled:true,
            prop: 'caller',
            span: 24,
            type: 'input'
          },
          {
            label: '火灾描述',
            disabled:true,
            prop: 'description',
            span: 24,
            type: 'textarea'
          },
          {
            label: '现场图片',
            disabled:true,
            prop: 'images',
            listType: 'picture-card',
            type: 'upload',
@@ -253,7 +240,7 @@
          },
          {
            label: '重伤人数',
            prop: 'seriousInjuredPerson',
            prop: 'seriousInjuryPerson',
            span: 8,
            type: 'input',
            append: '人'
@@ -612,7 +599,7 @@
      policeResourcesForm: {},
      isDetail: false,
      mapLocation:{
        isDetail:false
        isDetail:true
      },
    }
  },
@@ -620,12 +607,16 @@
    if (this.info) {
      this.initDetail()
    } else {
      this.form = this.$route.params
      this.initSupplement()
    }
  },
  methods: {
    submit(form, done) {
      form.fireId = this.form.id
      if (!form.fireId){
        this.$message.warning("请填写需要补录的火灾编号");
        return
      }
      form.economicLoss = this.economicData
      form.damageArea = this.damageAreaData
      form.policeResources = this.policeResourcesData
@@ -760,10 +751,48 @@
        location:[this.form.lon,this.form.lat]
      }
    },
    //补录
    initSupplement(){
      this.form = this.$route.params
      if (this.form.id){
        this.option.detail = true
        this.mapLocation = {
          isDetail: true,
          location:[this.form.lon,this.form.lat]
        }
      }
    },
    //返回列表页
    goToList() {
      this.isDetail = false
      this.$emit('goToList')
    },
    //自动补全
    querySearch(queryString, cb){
      getAll({no:queryString}).then(res=>{
        if (res.data.code == 200){
          let data = res.data.data
          data.forEach(e=>{
            e.value = e.no
          })
          cb(data)
        }
      })
    },
    //选择事件
    handleSelect(item){
      Object.assign(this.form,item)
      this.mapLocation = {
        isDetail:true,
        location:[this.form.lon,this.form.lat]
      }
      this.$refs.olMap.addPoint(this.mapLocation.location)
    }
  },
  destroyed() {
    //点击其他菜单时会关闭当前页,防止出现多个相同tab
    this.$router.$avueRouter.closeTag("/fire/fireSupplement")
  }
}
</script>
src/views/system/user.vue
@@ -303,7 +303,8 @@
                required: true,
                message: "请选择所属角色",
                trigger: "click"
              }]
              }],
              display: false
            },
            {
              label: "用户名",
@@ -374,7 +375,19 @@
                required: true,
                message: "请选择所属单位",
                trigger: "click"
              }]
              }],
              display: false
            },
            {
              label: "启用状态",
              prop: "status",
              type: "select",
              dicUrl: '/api/blade-system/dict-biz/dictionary?code=user_status',
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              display: false
            },
          ],
          group: [
@@ -719,14 +732,6 @@
      if (!website.tenantMode) {
        this.initData(website.tenantId);
      }
      getRoleTree(this.userInfo.tenant_id).then(res => {
        const column = this.findObject(this.option.column, "roleId");
        column.dicData = res.data.data;
      });
      getDeptTree(this.userInfo.tenant_id).then(res => {
        const column = this.findObject(this.option.column, "deptId");
        column.dicData = res.data.data;
      });
    },
    methods: {
      nodeClick(data) {
@@ -738,10 +743,14 @@
        getRoleTree(tenantId).then(res => {
          const column = this.findObject(this.option.group, "roleId");
          column.dicData = res.data.data;
          const columnRole = this.findObject(this.option.column, "roleId");
          columnRole.dicData = res.data.data;
        });
        getDeptTree(tenantId).then(res => {
          const column = this.findObject(this.option.group, "deptId");
          column.dicData = res.data.data;
          const columnDept = this.findObject(this.option.column, "deptId");
          columnDept.dicData = res.data.data;
        });
        // getPostList(tenantId).then(res => {
        //   const column = this.findObject(this.option.group, "postId");
@@ -974,10 +983,15 @@
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.data.forEach(e=>{
            e.status = e.status + ""
          })
          this.loading = false;
          this.selectionClear();
        });
      },
      //下面的方法业务都不需要
      platformRowUpdate(row, index, done, loading) {
        updatePlatform(row.id, row.userType, row.userExt).then(() => {
          this.platformOnLoad(this.platformPage);