南昌市物联网技防平台-前端
Administrator
2021-03-23 6463b10c9802e9e5c30b12fecabec93d05d2d64b
包裹,违禁品页面修改
4 files modified
1 files added
326 ■■■■■ changed files
src/api/parcel/parcel.js 12 ●●●●● patch | view | raw | blame | history
src/router/views/index.js 15 ●●●●● patch | view | raw | blame | history
src/views/home/home.vue 10 ●●●●● patch | view | raw | blame | history
src/views/parcel/parcel.vue 39 ●●●●● patch | view | raw | blame | history
src/views/parcel/parcelKind.vue 250 ●●●●● patch | view | raw | blame | history
src/api/parcel/parcel.js
@@ -12,6 +12,18 @@
    })
}
export const getKindList = (currentPage, pageSize, params) => {
    return request({
        url: '/api/blade-jfpts/parcel/parcel/getParcelkindDetailPage',
        method: 'get',
        params: {
            ...params,
            currentPage,
            pageSize,
        }
    })
}
export const getDetail = (id) => {
    return request({
        url: '/api/blade-jfpts/parcel/parcel/getParcelPic',
src/router/views/index.js
@@ -254,13 +254,26 @@
        redirect: '/parcel/index',
        children: [{
            path: 'index',
            name: '实时警情',
            name: '安检包裹',
            meta: {
                i18n: 'parcel'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/parcel/parcel')
        }]
    }, {
        path: '/parcelKind',
        component: Layout,
        redirect: '/parcelKind/index',
        children: [{
            path: 'index',
            name: '违禁品',
            meta: {
                i18n: 'parcelKind'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/parcel/parcelKind')
        }]
    }
src/views/home/home.vue
@@ -30,6 +30,7 @@
      window.handleStartEquipment = this.handleStartEquipment;
      window.handleStartSuser=this.handleStartSuser;
      window.handleStartParcel=this.handleStartParcel;
      window.handleStartParcelKind=this.handleStartParcelKind;
    },
    methods: {
      //体温监测分页数据
@@ -67,10 +68,19 @@
      },
      //包裹分页数据
      handleStartParcel(data){
        debugger;
        console.log(data[0]);
         this.$router.push({
          path: `/parcel/index`,
          query: data[0]
        });
      },
      //违禁品分页数据
      handleStartParcelKind(data){
         this.$router.push({
          path: `/parcelKind/index`,
          query: data[0]
        });
      }
      // getData() {
src/views/parcel/parcel.vue
@@ -44,11 +44,13 @@
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          activeClass: 3,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          labelWidth:120,
          menuWidth:120,
          dialogClickModal: false,
          headerAlign: 'center',
          align: 'center',
@@ -58,7 +60,7 @@
              label: '坐标',
              prop: 'test',
              hide: true,
              span: 24,
              span: 50,
              component: "avueMap",
              clickChild: (obj) => {
                this.form.jd = obj.latitude
@@ -76,6 +78,7 @@
            {
              label: "包裹图片KEY",
              prop: "imgUrl",
              hide:true
            },
            {
              label: "过机时间",
@@ -139,22 +142,6 @@
              label: "违禁包裹物品",
              prop: "decisioDiagramResultDetails",
            }
          ],
          group: [
            {
              label: '违禁品信息',
              prop: 'coordsDetailVoList',
              column: [
                {
                  label: '违禁品名称',
                  prop: 'objName'
                },
                {
                  label: '违禁品编号',
                  prop: 'objCode'
                }
              ]
            }
          ]
        },
        data: []
@@ -214,28 +201,28 @@
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        debugger;
        const { dateTime } = this.query;
        let values = {
          ...params,
        };
        if (this.$route.query.type && this.$route.query != undefined && this.$route.query != null && this.$route.query != "" ) {
            if (this.$route.query.status != undefined && this.$route.query.status != null && this.$route.query.status == "" ) {
              this.activeClass = this.$route.query.type;
        debugger;
        if (this.$route.query.decisioDiagramResult && this.$route.query!='' && this.$route.query!=null && this.$route.query!=undefined ) {
            if (this.$route.query.startTime != undefined && this.$route.query.startTime != null && this.$route.query.startTime != "" ) {
              this.page.currentPage = 1;
              params = {
                status:this.$route.query.status,
                type:this.$route.query.type
                startTime:this.$route.query.startTime,
                endTime:this.$route.query.endTime,
                decisioDiagramResult:this.$route.query.decisioDiagramResult
              }
            } else {
              this.activeClass = 0;
              this.page.currentPage = 1;
              params = {
                type:this.$route.query.type
                decisioDiagramResult:this.$route.query.decisioDiagramResult
              };
            }
        }
        if (dateTime) {
          values = {
            ...params,
@@ -249,8 +236,8 @@
            ...params,
            ...this.query,
          };
        }
        }
        this.loading = true;
        getList(page.currentPage, page.pageSize,values).then(res => {
          const data = res.data.data;
src/views/parcel/parcelKind.vue
New file
@@ -0,0 +1,250 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page="page"
               :permission="permissionList"
               :before-open="beforeOpen"
               v-model="form"
               ref="crud"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @row-del="rowDel"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
    </avue-crud>
  </basic-container>
</template>
<script>
  import {getKindList, getDetail} from "@/api/parcel/parcel";
  import {mapGetters} from "vuex";
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        selectionList: [],
        option: {
          height:'auto',
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 4,
          menuWidth:120,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          labelWidth:150,
          dialogClickModal: false,
          headerAlign: 'center',
          align: 'center',
          tree:true,
          column: [
            {
              label: '坐标',
              prop: 'test',
              hide: true,
              span: 100,
              component: "avueMap",
              clickChild: (obj) => {
                this.form.jd = obj.latitude
                this.form.wd = obj.longitude
              },
            },
            {
              label: "安检机名称",
              prop: "checkMachineName",
            },
            {
              label: "包裹ID",
              prop: "packageId",
            },
            {
              label: "包裹图片KEY",
              prop: "imgUrl",
              hide:true
            },
            {
              label: "过机时间",
              prop: "samplingTime",
            },
            {
              label: "过机时间",
              prop: "dateTime",
              type: "datetime",
              format: "yyyy-MM-dd HH:mm:ss",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
              searchRange: true,
              searchSpan: 8,
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入时间",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "违禁类型",
              search: true,
              searchLabelWidth: 120,
              searchSpan: 4,
              hide: true,
              prop: "decisioDiagramResult",
              type: "select",
              dicData: [
                {
                  label: "是",
                  value: "contraband"
                },
                {
                  label: "否",
                  value: "normal"
                },
              ]
            },
            {
              label: '违禁品名称',
              prop: 'objName'
            },
            {
              label: '违禁品编号',
              prop: 'objCode'
            },
            {
              label: '等级',
              prop: 'levName',
              span:120
            },
            {
              label: '坐标',
              prop: 'coords',
              span:500
            }
          ]
        },
        data: []
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(null, false),
          viewBtn: this.vaildData(this.permission.parcel_pic_view, true),
          delBtn: this.vaildData(null, false),
          editBtn: this.vaildData(null, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    },
    methods: {
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        const { dateTime } = this.query;
        let values = {
          ...params,
        };
        if (this.$route.query.decisioDiagramResult && this.$route.query != undefined && this.$route.query != null && this.$route.query != "" ) {
            if (this.$route.query.startTime != undefined && this.$route.query.startTime != null && this.$route.query.startTime != "" ) {
              this.page.currentPage = 1;
              params = {
                startTime:this.$route.query.startTime,
                endTime:this.$route.query.endTime,
                decisioDiagramResult:this.$route.query.decisioDiagramResult
              }
            } else {
              this.page.currentPage = 1;
              params = {
                decisioDiagramResult:this.$route.query.decisioDiagramResult
              };
            }
        }
        if (dateTime) {
          values = {
            ...params,
            startTime: dateTime[0],
            endTime: dateTime[1],
            ...this.query,
          };
          values.dateTime = null;
        } else {
          values = {
            ...params,
            ...this.query,
          };
        }
        this.loading = true;
        getKindList(page.currentPage, page.pageSize,values).then(res => {
          const data = res.data.data;
          this.page.total = data.totalSize;
          this.data = data.data;
          this.loading = false;
          this.selectionClear();
        });
      }
    }
  };
</script>