liuyg
2021-12-10 b8154654b1f83b94f62874a0462b0cd2d5db7cd5
+自动提交后  签到成功生成数据
12 files modified
3 files added
1317 ■■■■ changed files
public/zhiwenDemo/CID.html 24 ●●●● patch | view | raw | blame | history
public/zhiwenDemo/app.css 51 ●●●●● patch | view | raw | blame | history
src/api/qiandao/qiandao.js 13 ●●●●● patch | view | raw | blame | history
src/main.js 4 ●●● patch | view | raw | blame | history
src/store/getters.js 4 ●●● patch | view | raw | blame | history
src/store/index.js 3 ●●●● patch | view | raw | blame | history
src/store/modules/control.js 32 ●●●●● patch | view | raw | blame | history
src/store/modules/exam.js 17 ●●●●● patch | view | raw | blame | history
src/store/onresize.js 39 ●●●●● patch | view | raw | blame | history
src/styles/element-ui.scss 45 ●●●●● patch | view | raw | blame | history
src/views/desk/notice.vue 543 ●●●● patch | view | raw | blame | history
src/views/qiandao/forms.vue 47 ●●●●● patch | view | raw | blame | history
src/views/qiandao/index.vue 45 ●●●● patch | view | raw | blame | history
src/views/qiandao/signIn.vue 288 ●●●●● patch | view | raw | blame | history
src/views/qiandao/tables.vue 162 ●●●●● patch | view | raw | blame | history
public/zhiwenDemo/CID.html
@@ -29,22 +29,24 @@
    </select> -->
    <div id="zhiwenOur">
        <div id="main">
            <div id="imgs">
                <img id="img" width="256" height="360" />
            </div>
            <div id="butDiv">
                <button id="connect_server" onclick="connect()">开始采集</button>
                <button id="closeG" onclick="closeGfn()">取消采集</button>
                <button id="onceGgin" onclick="onceGgin()">重新采集</button>
            </div>
        <!-- <div id="main"> -->
        <div id="imgs">
            <img id="img" width="256" height="360" />
        </div>
        <!-- </div> -->
        <div id="down">
            <div id="zhiwentip">请按下食指开始采集指纹!</div>
            <div id="zhiwentip">请按下食指开始采集!</div>
            <div id="zhiwentipok">指纹采集成功!</div>
            <div id="zhiwentipno">未采集指纹!</div>
        </div>
        <div id="butDiv">
            <button id="connect_server" onclick="connect()">开始采集</button>
            <button id="closeG" onclick="closeGfn()">取消采集</button>
            <button id="onceGgin" onclick="onceGgin()">重新采集</button>
        </div>
    </div>
    <!--<button id="open_device" onclick="LIVESCAN_Init()">设备初始化</button>
public/zhiwenDemo/app.css
@@ -1,8 +1,9 @@
html,
body {
    width: 100%;
    width: 140px;
    height: 174px;
    font-family: "Segoe UI", sans-serif;
    margin-top: 0 !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
@@ -13,12 +14,13 @@
    font-style: italic;
}
#zhiwenOur {
    width: 100%;
    min-width: 208px;
    height: 174px;
    /* border: 1px solid red; */
    width: 139px;
    /* min-width: 208px; */
    height: 214px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    /* justify-content: center; */
    flex-direction: column;
}
#main {
@@ -29,7 +31,7 @@
    justify-content: space-around;
}
#imgs {
    width: 256px;
    width: 138px;
    height: 180px;
    /* border: 1px  dashed #fff; */
    /* border-image:url(/img/zhiwen/zhi.png) 30 300 round; */
@@ -52,11 +54,11 @@
    opacity: 0.9;
}
#butDiv {
    width: 200px;
    height: 180px;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-around;
    justify-content: center;
}
#down {
    width: 100%;
@@ -69,6 +71,8 @@
    font-size: 12px;
    position: relative;
    top: 20px;
    text-align: center;
    width: 100%;
    display: none;
    color: #606266;
}
@@ -76,6 +80,8 @@
    font-size: 12px;
    position: relative;
    top: 20px;
    text-align: center;
    width: 100%;
    display: none;
    color: #606266;
}
@@ -83,41 +89,48 @@
    font-size: 12px;
    position: relative;
    top: 20px;
    text-align: center;
    width: 100%;
    display: none;
    color: #606266;
}
#connect_server {
    width: 65px;
    height: 35px;
    width: 75px;
    height: 25px;
    border: none;
    font-size: 16px;
    font-size: 12px;
    background-color: #409eff;
    border-radius: 5px;
    color: #fff;
    position: relative;
    left: 13px;
    top: 23px;
    /*left: 13px; */
    display: none;
}
#closeG {
    width: 65px;
    height: 40px;
    width: 75px;
    height: 25px;
    border: none;
    background-color: #e6a23c;
    border-radius: 5px;
    color: #fff;
    display: none;
    font-size: 12px;
    top: 23px;
    position: relative;
    left: 13px;
    /* left: 13px; */
}
#onceGgin {
    width: 65px;
    height: 31px;
    width: 75px;
    height: 25px;
    font-size: 12px;
    border: none;
    background-color: #409eff;
    border-radius: 5px;
    color: #fff;
    font-size: 12px;
    top: 23px;
    display: none;
    position: relative;
    left: 8px;
    /* left: 8px; */
}
src/api/qiandao/qiandao.js
@@ -11,6 +11,19 @@
    })
}
export const getListSign = (current, size, params) => {
    return request({
        url: '/api/signInRecords/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}
export const upData = (params) => {
    return request({
        url: '/api/blade-user/updateUserInfo',
src/main.js
@@ -7,7 +7,7 @@
import './error'; // 日志
import './cache';//页面缓存
import store from './store';
import {loadStyle} from './util/util'
import { loadStyle } from './util/util'
import * as urls from '@/config/env';
import Element from 'element-ui';
import {
@@ -45,6 +45,8 @@
Object.keys(urls).forEach(key => {
  Vue.prototype[key] = urls[key];
});
// 加载website
Vue.prototype.website = website;
// 动态加载阿里云字体库
src/store/getters.js
@@ -33,10 +33,12 @@
  scoreId: state => state.exam.scoreId,
  examUserData: state => state.exam.examUserData,
  signData: state => state.exam.signData,
  // 签到
  cardInfor: state => state.exam.cardInfor,
  haveCardid: state => state.exam.haveCardid,
  useZhiWen: state => state.exam.useZhiWen,
  isClears: state => state.exam.isClears,
  windowWidth: state => state.control.windowWidth,
}
export default getters
src/store/index.js
@@ -4,6 +4,7 @@
import common from './modules/common'
import tags from './modules/tags'
import logs from './modules/logs'
import control from './modules/control'
import dict from './modules/dict'
import getters from './getters'
@@ -19,7 +20,7 @@
    logs,
    tags,
    exam,
    dict
    dict, control
  },
  getters,
})
src/store/modules/control.js
New file
@@ -0,0 +1,32 @@
// import {getStore, setStore} from '@/util/store'
// import {getDictionary} from '@/api/system/dict'
const dict = {
  state: {
    clearOtherBut: {
      refreshBtn: false,
      columnBtn: false,
      searchShowBtn: false,
      filterBtn: false,
    },
    changePageSize: {
      pageSize: 15,
      currentPage: 1,
      total: 0,
      pageSizes: [15, 30, 50, 100],
    },
    windowWidth: 1025,
  },
  actions: {
  },
  mutations: {
    setWindowSize: (state, data) => {
      state.windowWidth = data.innerWidth;
      // console.log(data)
    },
  }
};
export default dict;
src/store/modules/exam.js
@@ -4,6 +4,9 @@
const exam = {
  state: {
    signData: getStore({
      name: 'signData'
    }) || {},
    exam: getStore({
      name: 'exam'
    }) || {},
@@ -19,6 +22,7 @@
    examUserData: {},
    // 签到
    scoreId: '',
    isClears: false,
    cardInfor: {},
    haveCardid: false,
    useZhiWen: function (fn, vals) {
@@ -62,6 +66,16 @@
    }
  },
  mutations: {
    // 签到数据
    setSign(state, data) {
      state.signData[cardid] = data;
      console.log(data)
      console.log(state.signData)
      setStore({
        name: 'signData',
        content: state.signData
      })
    },
    // 签到
    setCardInfor(state, data) {
      state.cardInfor = data;
@@ -69,6 +83,9 @@
    setCardidState(state, data) {
      state.haveCardid = data;
    },
    setIsClears(state, data) {
      state.isClears = data;
    },
    // 重置考试id赋值
    SetScoreId(state, data) {
      window.localStorage.setItem("scoreId", data)
src/store/onresize.js
New file
@@ -0,0 +1,39 @@
import _this from '../main'
// 设置 init 函数
function init() {
    if (_this) {
        let innerWH = {
            innerWidth: window.innerWidth,
            innerHeight: window.innerHeight,
        }
        _this.$store.commit('setWindowSize', innerWH);
        // console.log(' window.innerWidth', window.innerWidth);
        // console.log(' window.innerHeight', window.innerHeight);
    }
}
// 节流 ms 触发间隔毫秒
var ms = 300;
var lastClick = Date.now() - ms;
// 初始化
setTimeout(() => {
    init();
}, 500);
// 改变窗口大小时重新设置 rem
// window.onresize = function () {
//     // 节流
//     if (Date.now() - lastClick >= ms) {
//         init();
//         lastClick = Date.now();
//     }
// }
window.addEventListener('resize', () => {
    // 节流
    if (Date.now() - lastClick >= ms) {
        init();
        lastClick = Date.now();
    }
}, false)
src/styles/element-ui.scss
@@ -291,3 +291,48 @@
    // height: 220px;
    // border: 1px solid rgba($color: #d3d3d3, $alpha: 1);
}
.examine_body .el-tabs.el-tabs--top {
    height: 100% !important;
    .el-tabs__content {
        height: 100% !important;
        .el-tab-pane {
            height: 100% !important;
            .examine_body_left {
            }
        }
    }
}
.e_m_right {
    .el-card.is-always-shadow {
        height: 100% !important;
        .el-card__body {
            height: 100% !important;
            box-sizing: border-box !important;
            .avue-crud {
                height: 100% !important;
                // border: 1px solid red;
            }
            .el-table__body-wrapper.is-scrolling-left {
                height: 100% !important;
            }
        }
    }
    .avue-crud__menu {
        display: none !important;
    }
}
// el-card is-never-shadow
.el-tabs__nav {
    position: relative;
    left: 10px;
}
#signIn {
    .timeDom {
        font-size: 20px !important;
        padding-bottom: 5px;
    }
    .avue-crud__menu {
        display: none !important;
    }
}
src/views/desk/notice.vue
@@ -1,293 +1,310 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               ref="crud"
               @row-del="rowDel"
               v-model="form"
               :permission="permissionList"
               @row-update="rowUpdate"
               @row-save="rowSave"
               :before-open="beforeOpen"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      ref="crud"
      @row-del="rowDel"
      v-model="form"
      :permission="permissionList"
      @row-update="rowUpdate"
      @row-save="rowSave"
      :before-open="beforeOpen"
      @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="permission.notice_delete"
                   @click="handleDelete">删 除
        <el-button
          type="danger"
          size="small"
          icon="el-icon-delete"
          plain
          v-if="permission.notice_delete"
          @click="handleDelete"
          >删 除
        </el-button>
      </template>
      <template slot-scope="{row}"
                slot="category">
        <el-tag>{{row.categoryName}}</el-tag>
      <template slot-scope="{ row }" slot="category">
        <el-tag>{{ row.categoryName }}</el-tag>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
  import {getList, remove, update, add, getNotice} from "@/api/desk/notice";
  import {mapGetters} from "vuex";
import { getList, remove, update, add, getNotice } from "@/api/desk/notice";
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,
          dialogWidth: 950,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          excelBtn: true,
          dialogClickModal: false,
          column: [
            {
              label: "通知标题",
              prop: "title",
              span: 24,
              row: true,
              search: true,
              rules: [{
export default {
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        dialogWidth: 950,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true,
        index: true,
        viewBtn: true,
        selection: true,
        excelBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "通知标题",
            prop: "title",
            span: 24,
            row: true,
            search: true,
            rules: [
              {
                required: true,
                message: "请输入通知标题",
                trigger: "blur"
              }]
            },
            {
              label: "通知类型",
              type: "select",
              dicUrl: "/api/blade-system/dict/dictionary?code=notice",
              props: {
                label: "dictValue",
                value: "dictKey"
                trigger: "blur",
              },
              dataType: "number",
              slot: true,
              prop: "category",
              search: true,
              rules: [{
            ],
          },
          {
            label: "通知类型",
            type: "select",
            dicUrl: "/api/blade-system/dict/dictionary?code=notice",
            props: {
              label: "dictValue",
              value: "dictKey",
            },
            dataType: "number",
            slot: true,
            prop: "category",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入通知类型",
                trigger: "blur"
              }]
            },
            {
              label: "通知时间",
              prop: "releaseTimeRange",
              type: "datetime",
              format: "yyyy-MM-dd hh:mm:ss",
              valueFormat: "yyyy-MM-dd hh:mm:ss",
              searchRange:true,
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              search: true,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "通知时间",
            prop: "releaseTimeRange",
            type: "datetime",
            format: "yyyy-MM-dd hh:mm:ss",
            valueFormat: "yyyy-MM-dd hh:mm:ss",
            searchRange: true,
            hide: true,
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            search: true,
            rules: [
              {
                required: true,
                message: "请输入通知时间",
                trigger: "blur"
              }]
            },
            {
              label: "通知日期",
              prop: "releaseTime",
              type: "date",
              format: "yyyy-MM-dd hh:mm:ss",
              valueFormat: "yyyy-MM-dd hh:mm:ss",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "通知日期",
            prop: "releaseTime",
            type: "date",
            format: "yyyy-MM-dd hh:mm:ss",
            valueFormat: "yyyy-MM-dd hh:mm:ss",
            rules: [
              {
                required: true,
                message: "请输入通知日期",
                trigger: "click"
              }]
            },
            {
              label: "通知内容",
              prop: "content",
              component: 'AvueUeditor',
              options: {
                action: '/api/blade-resource/oss/endpoint/put-file',
                props: {
                  res: "data",
                  url: "link",
                }
                trigger: "click",
              },
              hide: true,
              minRows: 6,
              span: 24,
            }
          ]
            ],
          },
          {
            label: "通知内容",
            prop: "content",
            component: "AvueUeditor",
            options: {
              action: "/api/blade-resource/oss/endpoint/put-file",
              props: {
                res: "data",
                url: "link",
              },
            },
            hide: true,
            minRows: 6,
            span: 24,
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    // permissionList() {
    //   return {
    //     addBtn: this.vaildData(this.permission.notice_add, false),
    //     viewBtn: this.vaildData(this.permission.notice_view, false),
    //     delBtn: this.vaildData(this.permission.notice_delete, false),
    //     editBtn: this.vaildData(this.permission.notice_edit, false)
    //   };
    // },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        data: []
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    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();
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getNotice(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      const { releaseTimeRange } = this.query;
      let values = {
        ...params,
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.notice_add, false),
          viewBtn: this.vaildData(this.permission.notice_view, false),
          delBtn: this.vaildData(this.permission.notice_delete, false),
          editBtn: this.vaildData(this.permission.notice_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      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();
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getNotice(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        const {releaseTimeRange} = this.query;
        let values = {
      if (releaseTimeRange) {
        values = {
          ...params,
          releaseTime_datege: releaseTimeRange[0],
          releaseTime_datelt: releaseTimeRange[1],
          ...this.query,
        };
        if (releaseTimeRange) {
          values = {
            ...params,
            releaseTime_datege: releaseTimeRange[0],
            releaseTime_datelt: releaseTimeRange[1],
            ...this.query
          };
          values.releaseTimeRange = null;
        }
        this.loading = true;
        getList(page.currentPage, page.pageSize, values).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
        values.releaseTimeRange = null;
      }
    }
  };
      this.loading = true;
      getList(page.currentPage, page.pageSize, values).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
  },
};
</script>
<style>
src/views/qiandao/forms.vue
@@ -5,6 +5,7 @@
      ref="form"
      v-model="obj"
      :option="option"
      res="formss"
      @reset-change="emptytChange"
    >
      <!-- @submit="submit" -->
@@ -35,7 +36,33 @@
import { mapGetters } from "vuex";
export default {
  computed: {
    ...mapGetters(["userInfo", "cardInfor", "haveCardid", "useZhiWen"]),
    ...mapGetters([
      "userInfo",
      "cardInfor",
      "haveCardid",
      "useZhiWen",
      "isClears",
    ]),
  },
  watch: {
    isClears() {
      if (this.isClears) {
        this.obj = {
          name: "",
          national: "",
          certAddress: "",
          sex: "",
          imgs: "",
          yxqend: "",
          yxqstart: "",
          birthday: "",
          id: "",
          qfjg: "",
        };
        this.emptytChange();
        this.$store.commit("setIsClears", false);
      }
    },
  },
  mounted() {
    // console.log(CertCtl);
@@ -91,6 +118,8 @@
        // mockBtn: true,
        // submitText: "完成",
        // printBtn: true,
        // emptyBtn: false,
        size: "small",
        labelWidth: 70,
        submitBtn: false,
        disabled: true,
@@ -171,6 +200,11 @@
              //回显相关数据
              // console.log(resultObj, 123);
              const data = resultObj.resultContent;
              // 判断是否是重新读卡
              // if (that.obj.id == data.certNumber) {
              //   //同一张身份证-不更新数据
              //   return;
              // }
              //赋值数据
              that.obj = {
                name: data.partyName,
@@ -214,6 +248,7 @@
                id: data.certNumber,
                qfjg: data.certOrg,
              };
              // console.log("应用数据");
              that.$store.commit("setCardInfor", that.obj);
              that.$store.commit("setCardidState", true);
            } else if (resultObj.resultFlag == "-1") {
@@ -222,6 +257,9 @@
              } else {
                // console.log(resultObj.errorMsg);
                //无卡片提醒
                that.obj = {
                  id: "",
                };
              }
            } else if (resultObj.resultFlag == "-2") {
              console.log(resultObj.errorMsg);
@@ -240,7 +278,7 @@
        clear: true,
      };
      this.useZhiWen("setZhiwenData", zhiwen);
      this.$message.success("清空身份证数据");
      // this.$message.success("清空身份证数据");
    },
    // useZhiWen: function (fn, vals) {
    //   //读取指纹实例
@@ -257,13 +295,14 @@
</script>
<style lang="scss" scoped>
.zhiwenMain {
  width: 100%;
  height: 220px;
  width: 180px;
  height: 247px;
  // border: 1px solid rgba($color: #d3d3d3, $alpha: 1);
}
.formsss {
  height: 100% !important;
  // overflow-x: hidden;
  // border: 1px solid rgb(0, 255, 64);
  // overflow-y: scroll;
}
.imgss {
src/views/qiandao/index.vue
@@ -12,12 +12,21 @@
      </div>
    </div>
    <div class="examine_body">
      <div class="e_m_left">
        <forms></forms>
      </div>
      <div class="e_m_right">
        <tables></tables>
      </div>
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="签到识别" name="first">
          <div class="examine_body_left">
            <div class="e_m_left">
              <forms></forms>
            </div>
            <div class="e_m_right">
              <tables></tables>
            </div>
          </div>
        </el-tab-pane>
        <el-tab-pane label="签到数据" name="second">
          <signIn v-if="activeName == 'second'"></signIn>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>
@@ -27,16 +36,20 @@
import { resetRouter } from "@/router/router";
import tables from "./tables.vue";
import forms from "./forms.vue";
import signIn from "./signIn.vue";
export default {
  data() {
    return {
      tabs: "",
      userName: "",
      activeName: "first",
    };
  },
  components: {
    tables,
    forms,
    signIn,
  },
  computed: {
    ...mapGetters(["userInfo"]),
@@ -50,6 +63,9 @@
    this.userName = this.userInfo.account;
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab.name, 77777);
    },
    logout() {
      this.$confirm(this.$t("logoutTip"), this.$t("tip"), {
        confirmButtonText: this.$t("submitText"),
@@ -108,20 +124,31 @@
  .examine_body {
    width: 100%;
    height: calc(100% - 50px);
    // border: 1px solid red;
    box-sizing: border-box;
  }
  .examine_body_left {
    width: 100%;
    height: calc(100% - 55px);
    // height: 100% !important;
    // border: 1px solid rgb(0, 26, 255);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    // align-items: center;
    justify-content: center;
    position: relative;
    .e_m_left {
      width: 48%;
      width: 47%;
      height: 100%;
      box-sizing: border-box;
      overflow-x: hidden;
      overflow-y: scroll;
    }
    .e_m_right {
      width: 52%;
      width: 53%;
      height: 100%;
      // border: 1px solid rgb(0, 255, 64);
      // border: 1px solid red;
    }
  }
src/views/qiandao/signIn.vue
New file
@@ -0,0 +1,288 @@
<template>
  <basic-container class="signIn" id="signIn">
    <div class="timeDom">当天时间:{{ timeDom }}</div>
    <avue-crud
      v-if="visible"
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :search.sync="search"
      ref="signIn"
      @row-del="rowDel"
      v-model="form"
      :permission="permissionList"
      @row-update="rowUpdate"
      @row-save="rowSave"
      :before-open="beforeOpen"
      @filter="filterChange"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          icon="icon-zhengjian"
          :size="size"
          :type="type"
          class="zhengJian-icon"
          @click.stop="rowUps(row)"
          >更新</el-button
        >
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import { mapGetters } from "vuex";
import { getListSign } from "@/api/qiandao/qiandao";
export default {
  data() {
    return {
      timeDom: "",
      visible: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      query: {},
      data: [],
      form: {},
      search: {},
      option: {
        // card: true,
        // tip: false,
        // searchSize: "mini",
        searchMenuSpan: 6,
        height: "auto",
        index: true,
        // selectable: (row, index) => {
        //   console.log(row, index);
        //   if (row.auditStatus == 4 && row.cancel == 1) {
        //     return true;
        //   } else {
        //     return false;
        //   }
        // },
        labelWidth: "120",
        menuWidth: 200,
        align: "center",
        menuWidth: 90,
        menu: false,
        refreshBtn: false,
        columnBtn: false,
        emptyBtnText: " ",
        searchBtnText: " ",
        searchShowBtn: false,
        // reserveSelection: true,
        // selection: true,
        column: [
          {
            label: "姓名",
            prop: "realName",
            search: true,
            searchSpan: 6,
            searchLabelWidth: 45,
            width: 70,
          },
          {
            label: "公司",
            prop: "deptName",
            search: true,
            searchSpan: 7,
            searchLabelWidth: 45,
          },
          {
            label: "身份证号码",
            prop: "idCardNo",
            search: true,
            searchSpan: 9,
            searchLabelWidth: 80,
            // searchRange: true,
            // searchValue: this.getuserid(),
            width: 180,
          },
          {
            label: "签到时间",
            prop: "updateTime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            // search: true,
            // searchSpan: 5,
            // searchLabelWidth: 80,
            width: 180,
          },
          {
            label: "签到时间",
            prop: "signTime",
            type: "date",
            hide: true,
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            search: true,
            searchSpan: 5,
            searchLabelWidth: 80,
            width: 180,
          },
        ],
        delBtn: false,
        editBtn: false,
        addBtn: false,
      },
    };
  },
  computed: {
    ...mapGetters(["signData", "userInfo"]),
    // permissionList() {
    //   return {
    //     addBtn: this.vaildData(this.permission.notice_add, false),
    //     viewBtn: this.vaildData(this.permission.notice_view, false),
    //     delBtn: this.vaildData(this.permission.notice_delete, false),
    //     editBtn: this.vaildData(this.permission.notice_edit, false),
    //   };
    // },
  },
  mounted() {
    var times = new Date();
    this.year = times.getFullYear();
    this.month = Number(times.getMonth()) + 1;
    this.day = times.getDate();
    this.timeDom = this.year + "-" + this.month + "-" + this.day;
    this.search["signTime"] = this.timeDom;
    this.query["signTime"] = this.timeDom;
    let t = this;
    window.addEventListener("resize", function () {
      t.resetHeight();
    });
    t.resetHeight();
  },
  methods: {
    // getuserid() {
    //   console.log(12345);
    //   console.log(this.haveCardid);
    //   if (this.haveCardid) {
    //     return this.cardInfor.id;
    //   } else {
    //     return;
    //   }
    // },
    resetHeight() {
      //表格自适应高度
      let windowHeight = document.body.clientHeight;
      let table = document.getElementsByClassName("signIn");
      let heard = table[0].getElementsByClassName("avue-crud__search");
      this.option.height = windowHeight - (heard[0].clientHeight + 240);
      this.visible = false;
      this.$nextTick(() => {
        this.visible = true;
        this.onLoad(this.page, this.search);
      });
    },
    rowUps(row, msg) {},
    upDataMain(row) {},
    sizeChange(val) {
      this.page.pageSize = val;
    },
    currentChange(val) {
      this.page.currentPage = val;
    },
    rowSave(form, done, loading) {},
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    searchReset() {
      // console.log(5454);
      this.query = {};
      this.onLoad(this.page);
      this.search["cardid"] = "";
    },
    rowUpdate(row, index, done, loading) {
      //   update(row).then(
      //     () => {
      //       this.onLoad(this.page);
      //       this.$message({
      //         type: "success",
      //         message: "操作成功!",
      //       });
      //       done();
      //     },
      //     (error) => {
      //       window.console.log(error);
      //       loading();
      //     }
      //   );
    },
    rowDel(row) {
      //   this.$confirm("确定将选择数据删除?", {
      //     confirmButtonText: "确定",
      //     cancelButtonText: "取消",
      //     type: "warning",
      //   })
      //     .then(() => {
      //       return remove(row.id);
      //     })
      //     .then(() => {
      //       this.onLoad(this.page);
      //       this.$message({
      //         type: "success",
      //         message: "操作成功!",
      //       });
      //     });
    },
    selectionChange(list) {
      // this.selectionList = list;
      //   this.choiceName = [];
      //   // console.log(window.name);
      //   for (let k in list) {
      //     this.choiceName.push({
      //       label: list[k].realName,
      //       value: list[k].id,
      //     });
      //   }
      // window.localStorage.setItem("baoming", JSON.stringify(this.choiceName));
      // console.log(this.choiceName);
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    msg: function (type, msg) {
      this.$message({
        message: msg,
        type: type,
      });
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["trainingUnitId"] = this.userInfo.dept_id;
      getListSign(
        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;
        console.log(this.data, 456789);
        this.loading = false;
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.tablesss {
  height: 100% !important;
}
</style>
src/views/qiandao/tables.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container class="tablesss">
    <avue-crud
      v-if="visible"
      :option="option"
      :table-loading="loading"
      :data="data"
@@ -42,6 +43,7 @@
export default {
  data() {
    return {
      visible: true,
      page: {
        pageSize: 10,
        currentPage: 1,
@@ -118,14 +120,14 @@
      "haveCardid",
      "useZhiWen",
    ]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.notice_add, false),
        viewBtn: this.vaildData(this.permission.notice_view, false),
        delBtn: this.vaildData(this.permission.notice_delete, false),
        editBtn: this.vaildData(this.permission.notice_edit, false),
      };
    },
    // permissionList() {
    //   return {
    //     addBtn: this.vaildData(this.permission.notice_add, false),
    //     viewBtn: this.vaildData(this.permission.notice_view, false),
    //     delBtn: this.vaildData(this.permission.notice_delete, false),
    //     editBtn: this.vaildData(this.permission.notice_edit, false),
    //   };
    // },
  },
  watch: {
    haveCardid() {
@@ -145,6 +147,8 @@
    },
  },
  mounted() {
    // let dom = document.getElementsByClassName("el-table--small");
    // console.log((dom[0].clientHeight = 100), 9);
    // console.log(1545);
    // if (window.name == "baoming") {
    //   let old = JSON.parse(window.localStorage.getItem("baoming"));
@@ -155,6 +159,11 @@
    //   window.name = "baoming";
    //   console.log("不刷新");
    // }
    let t = this;
    window.addEventListener("resize", function () {
      t.resetHeight();
    });
    t.resetHeight();
  },
  methods: {
    // getuserid() {
@@ -166,6 +175,18 @@
    //     return;
    //   }
    // },
    resetHeight() {
      //表格自适应高度
      let windowHeight = document.body.clientHeight;
      let table = document.getElementsByClassName("tablesss");
      let heard = table[0].getElementsByClassName("avue-crud__search");
      this.option.height = windowHeight - (heard[0].clientHeight + 220);
      this.visible = false;
      this.$nextTick(() => {
        this.visible = true;
        this.onLoad(this.page, this.search);
      });
    },
    rowUps(row, msg) {
      row["cell"] = "2";
      let zhiwenData = this.useZhiWen("outZhiwenData");
@@ -179,53 +200,53 @@
          return;
        }
        // console.log(zhiwenData, 456);
        if (
          zhiwenData.imgSRC != "" &&
          zhiwenData.imgSRC != undefined &&
          zhiwenData.imgBMP != "" &&
          zhiwenData.imgBMP != undefined &&
          zhiwenData.featuredata != "" &&
          zhiwenData.featuredata != undefined &&
          zhiwenData.isoks
        ) {
          // console.log("存在指纹");
          row.realName = card.name;
          row.cardid = card.id;
          row.sex = card.sex == "男" ? "1" : card.sex == "女" ? "2" : "3";
          row.nation = card.national;
          row.registered = card.certAddress;
          row.fingerprint = zhiwenData.imgBMP;
          row.myPicture = zhiwenData.featuredata;
          this.upDataMain(row);
        } else {
          // this.msg("warning", "无指纹信息,请添加指纹信息后重试!");
          this.$confirm("检测到无指纹信息,是否确定修改?", "确认信息", {
            distinguishCancelAndClose: true,
            confirmButtonText: "保存",
            cancelButtonText: "放弃修改",
          })
            .then(() => {
              row.realName = card.name;
              row.cardid = card.id;
              row.sex = card.sex == "男" ? "1" : card.sex == "女" ? "2" : "3";
              row.nation = card.national;
              row.registered = card.certAddress;
              row.fingerprint = zhiwenData.imgBMP;
              row.myPicture = zhiwenData.featuredata;
              this.upDataMain(row);
              // this.$message({
              //   type: "info",
              //   message: "保存修改",
              // });
            })
            .catch((action) => {
              // this.$message({
              //   type: "info",
              //   message:
              //     action === "cancel" ? "放弃保存并离开页面" : "停留在当前页面",
              // });
            });
        }
        // if (
        //   zhiwenData.imgSRC != "" &&
        //   zhiwenData.imgSRC != undefined &&
        //   zhiwenData.imgBMP != "" &&
        //   zhiwenData.imgBMP != undefined &&
        //   zhiwenData.featuredata != "" &&
        //   zhiwenData.featuredata != undefined &&
        //   zhiwenData.isoks
        // ) {
        // console.log("存在指纹");
        row.realName = card.name;
        row.cardid = card.id;
        row.sex = card.sex == "男" ? "1" : card.sex == "女" ? "2" : "3";
        row.nation = card.national;
        row.registered = card.certAddress;
        row.fingerprint = zhiwenData.imgBMP;
        row.myPicture = zhiwenData.featuredata;
        this.upDataMain(row);
        // } else {
        //   // this.msg("warning", "无指纹信息,请添加指纹信息后重试!");
        //   this.$confirm("检测到无指纹信息,是否确定修改?", "确认信息", {
        //     distinguishCancelAndClose: true,
        //     confirmButtonText: "保存",
        //     cancelButtonText: "放弃修改",
        //   })
        //     .then(() => {
        //       row.realName = card.name;
        //       row.cardid = card.id;
        //       row.sex = card.sex == "男" ? "1" : card.sex == "女" ? "2" : "3";
        //       row.nation = card.national;
        //       row.registered = card.certAddress;
        //       row.fingerprint = zhiwenData.imgBMP;
        //       row.myPicture = zhiwenData.featuredata;
        //       this.upDataMain(row);
        //       // this.$message({
        //       //   type: "info",
        //       //   message: "保存修改",
        //       // });
        //     })
        //     .catch((action) => {
        //       // this.$message({
        //       //   type: "info",
        //       //   message:
        //       //     action === "cancel" ? "放弃保存并离开页面" : "停留在当前页面",
        //       // });
        //     });
        // }
      } else {
        this.msg("warning", "请读取身份证后重试!");
      }
@@ -268,12 +289,40 @@
        registered: row.registered,
        fingerprint: row.fingerprint,
        myPicture: row.myPicture,
        candidateNo: row.candidateNo,
      };
      upData(b).then((res) => {
        const data = res.data;
        // console.log(data);
        if (data.code == 200) {
          this.msg("success", data.msg);
          // this.msg("success", data.msg);
          this.$confirm("签到成功!", "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "success",
          })
            .then(() => {
              this.$message({
                type: "success",
                message: "请继续放入身份证进行识别!",
              });
              this.$store.commit("setIsClears", true);
              // this.$store.commit("setCardidState", false);
              // let zhiwen = {
              //   featuredatas: "",
              //   imgBMP: "",
              //   url: "",
              //   isoks: false,
              //   clear: true,
              // };
              // this.useZhiWen("setZhiwenData", zhiwen);
            })
            .catch(() => {
              // this.$message({
              //   type: "info",
              //   message: "已取消删除",
              // });
            });
        } else {
          this.msg("warning", data.msg);
        }
@@ -385,6 +434,7 @@
      params["auditStatus"] = "1";
      params["cancel"] = "1";
      params["isExam"] = "1";
      params["trainingUnitId"] = this.userInfo.dept_id;
      let values = Object.assign(params, this.query);
      // console.log(values);
      if (values.realName || values.deptName || values.idCardNo) {