上饶市警务平台后台管理前端
guoshilong
2022-11-29 c36183e7d11898b44ebbdc5899715cb68f9d7635
活动人员区域;活动车辆区域根据所选活动默认回填
3 files modified
91 ■■■■ changed files
src/api/security/security.js 7 ●●●●● patch | view | raw | blame | history
src/views/securityManage/securityManage.vue 42 ●●●● patch | view | raw | blame | history
src/views/securityManageCar/securityManageCar.vue 42 ●●●● patch | view | raw | blame | history
src/api/security/security.js
@@ -24,6 +24,13 @@
  })
}
export const getAll = () => {
  return request({
    url: '/api/security/security/all',
    method: 'get',
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/security/security/details',
src/views/securityManage/securityManage.vue
@@ -48,6 +48,7 @@
<script>
  import {getPage, getDetails, add, update, remove} from "@/api/securityManage/securityManage";
  import {getAll} from "@/api/security/security";
  import {mapGetters} from "vuex";
  import MapBox from "@/components/map/mapBox";
@@ -83,11 +84,16 @@
              prop:"securityId",
              search: true,
              type:"select",
              dicUrl:"/api/security/security/all",
              dicData:[],
              props:{
                label:"name",
                value:"id"
              }
              },
              rules: [{
                required: true,
                message: "请选择所属活动",
                trigger: "blur"
              }]
            },
            {
              label: "警员",
@@ -103,6 +109,7 @@
              label: "所属机构",
              prop: "deptId",
              type: "tree",
              disabled:true,
              dicUrl: "api/blade-system/dept/lazy-list",
              props:{
                label:'deptName',
@@ -111,11 +118,6 @@
              },
              search: true,
              searchSpan:4,
              rules: [{
                required: true,
                message: "请选择所属机构",
                trigger: "blur"
              }]
            },
            {
              label: "类型",
@@ -146,6 +148,7 @@
        data: [],
        isDetail:false,
        routeRange:"",
        securityList:[],
      };
    },
    computed: {
@@ -164,6 +167,21 @@
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    },
    created() {
      this.getSecurityList()
    },
    watch:{
      //根据活动回显机构
      'form.securityId':{
        handler(newVal,oldVal){
          this.securityList.forEach(e=>{
            if (e.id == newVal){
              this.form.deptId = e.deptId
            }
          })
        }
      }
    },
    methods: {
@@ -279,6 +297,16 @@
          this.loading = false;
          this.selectionClear();
        });
      },
      //获取所有活动集合
      getSecurityList(){
        getAll().then(res=>{
          if (res.data.code == 200){
            this.securityList = res.data.data
            const securityIdColumn = this.findObject(this.option.column,"securityId")
            securityIdColumn.dicData = this.securityList
          }
        })
      }
    }
  };
src/views/securityManageCar/securityManageCar.vue
@@ -50,6 +50,7 @@
  import {getPage, getDetail, add, update, remove} from "@/api/securityManageCar/securityManageCar";
  import {mapGetters} from "vuex";
  import MapBox from "@/components/map/mapBox";
  import {getAll} from "@/api/security/security";
  export default {
    components: {MapBox},
@@ -92,11 +93,16 @@
              prop: "securityId",
              type: "select",
              search:true,
              dicUrl:"/api/security/security/all",
              dicData:[],
              props:{
                label:"name",
                value:"id"
              }
              },
              rules: [{
                required: true,
                message: "请选择所属活动",
                trigger: "blur"
              }]
            },
            {
              label: "警车",
@@ -120,11 +126,7 @@
              },
              search: true,
              searchSpan:4,
              rules: [{
                required: true,
                message: "请选择所属机构",
                trigger: "blur"
              }]
              disabled:true,
            },
            {
              label: "位置或范围",
@@ -219,6 +221,7 @@
        data: [],
        isDetail:false,
        routeRange:"",
        securityList:[],
      };
    },
    computed: {
@@ -237,6 +240,21 @@
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    },
    created() {
      this.getSecurityList()
    },
    watch:{
      //根据活动回显机构
      'form.securityId':{
        handler(newVal,oldVal){
          this.securityList.forEach(e=>{
            if (e.id == newVal){
              this.form.deptId = e.deptId
            }
          })
        }
      }
    },
    methods: {
@@ -352,6 +370,16 @@
          this.loading = false;
          this.selectionClear();
        });
      },
      //获取所有活动集合
      getSecurityList(){
        getAll().then(res=>{
          if (res.data.code == 200){
            this.securityList = res.data.data
            const securityIdColumn = this.findObject(this.option.column,"securityId")
            securityIdColumn.dicData = this.securityList
          }
        })
      }
    }
  };