南昌市物联网技防平台-前端
Administrator
2021-03-18 2f515e6dc3887f69b407812f596306eddcdcbad2
healthcode健康码,体温分页页面
2 files modified
4 files added
460 ■■■■■ changed files
src/api/animalHeat/animalHeat.js 13 ●●●●● patch | view | raw | blame | history
src/api/healthcode/healthcode.js 13 ●●●●● patch | view | raw | blame | history
src/views/animalHeat/animalHeat.vue 207 ●●●●● patch | view | raw | blame | history
src/views/healthcode/healthcode.vue 207 ●●●●● patch | view | raw | blame | history
src/views/home/home.vue 14 ●●●● patch | view | raw | blame | history
vue.config.js 6 ●●●● patch | view | raw | blame | history
src/api/animalHeat/animalHeat.js
New file
@@ -0,0 +1,13 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
    return request({
        url: '/api/blade-jfpts/animalHeat/animalHeat/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}
src/api/healthcode/healthcode.js
New file
@@ -0,0 +1,13 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
    return request({
        url: '/api/blade-jfpts/healthcode/healthcode/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}
src/views/animalHeat/animalHeat.vue
New file
@@ -0,0 +1,207 @@
<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">
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="true"
                   @click="handleDelete">删 除
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
  import {getList} from "@/api/animalHeat/animalHeat";
  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: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          labelWidth:120,
          dialogClickModal: false,
          headerAlign: 'center',
          align: 'center',
          column: [
            {
              label: '坐标',
              prop: 'test',
              hide: true,
              span: 24,
              component: "avueMap",
              clickChild: (obj) => {
                this.form.jd = obj.latitude
                this.form.wd = obj.longitude
              },
            },
            {
              label: "检测时间",
              prop: "createTime"
            },
            {
              label: "体温",
              prop: "tempRed"
            },
            {
              label: '图片',
              prop: 'picture',
              type: 'upload',
              width: 300,
              listType: 'picture-img',
              span: 24,
              propsHttp: {
                res: 'data'
              },
              canvasOption: {
                text: 'avue',
                ratio: 0.1
              }
            },
            {
              label: "检测时间",
              prop: "dateTime",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              searchRange: true,
              searchSpan: 5,
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入时间",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "体温状态",
              search: true,
              searchLabelWidth: 120,
              prop: "status",
              searchSpan: 5,
              width:110,
              type: "select",
              dicData: [
                {
                  label: "正常",
                  value: 0
                },
                {
                  label: "异常",
                  value: 1
                }
              ],
            }
          ]
        },
        data: []
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(null, true),
          viewBtn: this.vaildData(null, true),
          delBtn: this.vaildData(null, true),
          editBtn: this.vaildData(null, true)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    },
    methods: {
      beforeOpen(done, type) {
      },
      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 = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
      },
      handleHistory(row) {
        this.$router.push({ path: `/real/history/${row.deviceNumber}` });
      }
    }
  };
</script>
src/views/healthcode/healthcode.vue
New file
@@ -0,0 +1,207 @@
<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">
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="true"
                   @click="handleDelete">删 除
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
  import {getList} from "@/api/healthcode/healthcode";
  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: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          labelWidth:120,
          dialogClickModal: false,
          headerAlign: 'center',
          align: 'center',
          column: [
            {
              label: '坐标',
              prop: 'test',
              hide: true,
              span: 24,
              component: "avueMap",
              clickChild: (obj) => {
                this.form.jd = obj.latitude
                this.form.wd = obj.longitude
              },
            },
            {
              label: "检测时间",
              prop: "createTime"
            },
            {
              label: "体温",
              prop: "tempRed"
            },
            {
              label: '图片',
              prop: 'picture',
              type: 'upload',
              width: 300,
              listType: 'picture-img',
              span: 24,
              propsHttp: {
                res: 'data'
              },
              canvasOption: {
                text: 'avue',
                ratio: 0.1
              }
            },
            {
              label: "检测时间",
              prop: "dateTime",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              searchRange: true,
              searchSpan: 5,
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入时间",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "体温状态",
              search: true,
              searchLabelWidth: 120,
              prop: "status",
              searchSpan: 5,
              width:110,
              type: "select",
              dicData: [
                {
                  label: "正常",
                  value: 0
                },
                {
                  label: "异常",
                  value: 1
                }
              ],
            }
          ]
        },
        data: []
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(null, true),
          viewBtn: this.vaildData(null, true),
          delBtn: this.vaildData(null, true),
          editBtn: this.vaildData(null, true)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    },
    methods: {
      beforeOpen(done, type) {
      },
      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 = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
      },
      handleHealthcode(row) {
        this.$router.push({ path: `/healthcode/healthcode/${row.deviceNumber}` });
      }
    }
  };
</script>
src/views/home/home.vue
@@ -28,10 +28,16 @@
    },
    methods: {
      handleStart() {
      this.$router.push({
        path: `/real/history/000000000003`
      });
    }
        this.$router.push({
          path: `/real/history/000000000003`
        });
      },
      handleStartHealthcode(){
        this.$router.push({
          path: `/healthcode/healthcode/1`
        });
      }
      // getData() {
      //   var that = this;
      //
vue.config.js
@@ -34,8 +34,8 @@
        proxy: {
            '/api': {
                //本地服务接口地址
                //target: 'http://localhost:82/',
                target: 'https://web.byisf.com:18001/api/',
                target: 'http://localhost:82/',
                //target: 'https://web.byisf.com:18001/api/',
                //远程演示服务地址,可用于直接启动项目
                //target: 'https://saber.bladex.vip/api',
                ws: true,
@@ -45,4 +45,4 @@
            }
        }
    }
};
};