liuyg
2021-11-10 73fe012110a5c65f03720d3b7164308101e2d850
src/views/securityGuard/securityGuard.vue
@@ -1,21 +1,22 @@
<template>
    <el-row :class="{ securityGuard: isSecurity }">
        <el-col :span="0"
                style="display: none">
    <el-col :span="0" style="display: none">
            <div class="box">
                <el-scrollbar>
                    <basic-container>
                        <avue-tree :option="treeOption"
            <avue-tree
              :option="treeOption"
                                   :data="treeData"
                                   @node-click="nodeClick" />
              @node-click="nodeClick"
            />
                    </basic-container>
                </el-scrollbar>
            </div>
        </el-col>
        <el-col :span="24">
            <basic-container>
                <avue-crud :option="option"
        <avue-crud
          :option="option"
                           :search.sync="search"
                           :table-loading="loading"
                           :data="data"
@@ -34,189 +35,243 @@
                           @current-change="currentChange"
                           @size-change="sizeChange"
                           @refresh-change="refreshChange"
                           @on-load="onLoad">
          @on-load="onLoad"
        >
                    <!-- @row-update="rowUpdate" -->
                    <template slot="menuLeft">
                        <el-button type="success"
            <el-button
              type="success"
                                   size="small"
                                   plain
                                   icon="el-icon-upload2"
                                   v-if="permission.securityGuard_import"
                                   @click="handleImport1">保安员批量导入
              @click="handleImport1"
              >保安员批量导入
                        </el-button>
                        <el-button type="success"
            <el-button
              type="success"
                                   size="small"
                                   plain
                                   icon="el-icon-upload2"
                                   v-if="permission.securityGuard_import"
                                   @click="handleImport2">个人照片批量上传
              @click="handleImport2"
              >个人照片批量上传
                        </el-button>
                        <el-button type="primary"
            <el-button
              type="primary"
                                   size="small"
                                   plain
                                   v-if="permission.securityGuard_security_apply"
                                   icon="el-icon-s-promotion"
                                   @click="handleSecurityApply">上岗证制证申请
              @click="handleSecurityApply"
              >上岗证制证申请
                        </el-button>
                        <el-button type="danger"
            <el-button
              type="danger"
                                   style="display: none"
                                   size="small"
                                   plain
                                   icon="el-icon-delete"
                                   @click="handleDelete">注 销
              @click="handleDelete"
              >注 销
                        </el-button>
                        <el-button type="info"
            <el-button
              type="info"
                                   style="display: none"
                                   size="small"
                                   plain
                                   v-if="permission.user_role"
                                   icon="el-icon-user"
                                   @click="handleGrant">角色配置
              @click="handleGrant"
              >角色配置
                        </el-button>
                        <el-button type="info"
            <el-button
              type="info"
                                   style="display: none"
                                   size="small"
                                   plain
                                   v-if="permission.user_reset"
                                   icon="el-icon-refresh"
                                   @click="handleReset">密码重置
              @click="handleReset"
              >密码重置
                        </el-button>
                        <el-button type="info"
            <el-button
              type="info"
                                   style="display: none"
                                   size="small"
                                   plain
                                   v-if="userInfo.role_name.includes('admin')"
                                   icon="el-icon-setting"
                                   @click="handlePlatform">平台配置
              @click="handlePlatform"
              >平台配置
                        </el-button>
                        <el-button type="success"
            <el-button
              type="success"
                                   style="display: none"
                                   size="small"
                                   plain
                                   v-if="userInfo.role_name.includes('admin')"
                                   icon="el-icon-upload2"
                                   @click="handleImport">导入
              @click="handleImport"
              >导入
                        </el-button>
                        <el-button type="warning"
            <el-button
              type="warning"
                                   style="display: none"
                                   size="small"
                                   plain
                                   v-if="userInfo.role_name.includes('admin')"
                                   icon="el-icon-download"
                                   @click="handleExport">导出
              @click="handleExport"
              >导出
                        </el-button>
                    </template>
                    <template slot-scope="{ type, size, row }"
                              slot="menu">
                        <el-button icon="el-icon-s-custom"
          <template slot-scope="{ type, size, row }" slot="menu">
            <el-button
              icon="el-icon-s-custom"
                                   :size="size"
                                   :type="type"
                                   @click.stop="rowClick(row)">查看
              @click.stop="rowClick(row)"
              >查看
                        </el-button>
                        <el-button icon="el-icon-edit"
            <el-button
              icon="el-icon-edit"
                                   :size="size"
                                   :type="type"
                                   v-if="permission.securityGuard_delete && row.status != 2"
                                   @click.stop="rowStatus(row)">离职登记
              @click.stop="rowStatus(row)"
              >离职登记
                        </el-button>
                        <el-button icon="el-icon-edit"
            <el-button
              icon="el-icon-edit"
                                   :size="size"
                                   :type="type"
                                   v-if="row.status == 2"
                                   @click.stop="rowDellook(row)">离职查询
              @click.stop="rowDellook(row)"
              >离职查询
                        </el-button>
                        <el-button icon="el-icon-edit"
            <el-button
              icon="el-icon-edit"
                                   :size="size"
                                   :type="type"
                                   v-if="permission.securityGuard_check"
                                   @click.stop="rowCheck(row)">异常
              @click.stop="rowCheck(row)"
              >异常
                        </el-button>
                        <el-button icon="el-icon-edit"
            <el-button
              icon="el-icon-edit"
                                   :size="size"
                                   :type="type"
                                   v-if="permission.securityGuard_paper"
                                   @click.stop="certificateClick(row)">纸质证书制作
              @click.stop="certificateClick(row)"
              >纸质证书制作
                        </el-button>
                    </template>
                    <template slot-scope="{ row }"
                              slot="sex">
          <template slot-scope="{ row }" slot="sex">
                        <el-tag v-if="row.sex == 1">男</el-tag>
                        <el-tag v-if="row.sex == 2">女</el-tag>
                    </template>
                    <template slot-scope="{ row }"
                              slot="deptId">
                        <el-tag class="rowClickSelf"
          <template slot-scope="{ row }" slot="deptId">
            <el-tag
              class="rowClickSelf"
                                title="点击查看所属公司情况"
                                @click="rowClickSelf(row.deptId)">{{ row.deptName }}</el-tag>
              @click="rowClickSelf(row.deptId)"
              >{{ row.deptName }}</el-tag
            >
                    </template>
                    <template slot-scope="{ row }"
                              slot="tenantName">
          <template slot-scope="{ row }" slot="tenantName">
                        <el-tag>{{ row.tenantName }}</el-tag>
                    </template>
                    <template slot-scope="{ row }"
                              slot="roleName">
          <template slot-scope="{ row }" slot="roleName">
                        <el-tag>{{ row.roleName }}</el-tag>
                    </template>
                    <template slot-scope="{ row }"
                              slot="deptName">
          <template slot-scope="{ row }" slot="deptName">
                        <el-tag>{{ row.deptName }}</el-tag>
                    </template>
                    <template slot-scope="{ row }"
                              slot="userTypeName">
          <template slot-scope="{ row }" slot="userTypeName">
                        <el-tag>{{ row.userTypeName }}</el-tag>
                    </template>
                    <template slot-scope="{ row }"
                              slot="userType">
          <template slot-scope="{ row }" slot="userType">
                        {{
                                row.userType == 6 ? '已制证' : row.userType == 7 ? '未制证' : ''
              row.userType == 6 ? "已制证" : row.userType == 7 ? "未制证" : ""
                              }}
          </template>
          <!-- 自定义新增和编辑中的指纹信息 -->
          <!-- src="http://223.82.109.183:2081/zhba/upload/picture/85004574ae23472da37350b918960206.png" -->
          <template slot-scope="{ type, disabled }" slot="fingerprintForm">
            <div class="zhiwenMain">
              <!-- <img class="zhiwenImgs" :src="zhiwenImg" alt="" />
              <el-button type="primary" @click="openzhiwen" v-show="isOr">{{
                zhiwenTitle
              }}</el-button>
              <el-button type="warning" @click="closezhiwen" v-show="!isOr">{{
                zhiwenTitle
              }}</el-button>
              <el-button type="primary" @click="openccc">openccc</el-button>-->
              <iframe
                id="zhiwen"
                ref="zhiwen"
                src="/zhiwenDemo/CID.html"
                frameborder="0"
                width="100%"
                height="100%"
                name="zhiwen"
              ></iframe>
            </div>
                    </template>
                </avue-crud>
                <el-dialog title="用户角色配置"
        <el-dialog
          title="用户角色配置"
                           append-to-body
                           :visible.sync="roleBox"
                           width="345px">
                    <el-tree :data="roleGrantList"
          width="345px"
        >
          <el-tree
            :data="roleGrantList"
                             show-checkbox
                             check-strictly
                             default-expand-all
                             node-key="id"
                             ref="treeRole"
                             :default-checked-keys="roleTreeObj"
                             :props="props">
            :props="props"
          >
                    </el-tree>
                    <span slot="footer"
                          class="dialog-footer">
          <span slot="footer" class="dialog-footer">
                        <el-button @click="roleBox = false">取 消</el-button>
                        <el-button type="primary"
                                   @click="submitRole">确 定</el-button>
            <el-button type="primary" @click="submitRole">确 定</el-button>
                    </span>
                </el-dialog>
                <el-dialog title="用户数据导入"
        <el-dialog
          title="用户数据导入"
                           append-to-body
                           :visible.sync="excelBox"
                           width="555px">
                    <avue-form :option="excelOption"
          width="555px"
        >
          <avue-form
            :option="excelOption"
                               v-model="excelForm"
                               :upload-after="uploadAfter">
            :upload-after="uploadAfter"
          >
                        <template slot="excelTemplate">
                            <el-button type="primary"
                                       @click="handleTemplate">
              <el-button type="primary" @click="handleTemplate">
                                点击下载<i class="el-icon-download el-icon--right"></i>
                            </el-button>
                        </template>
                    </avue-form>
                </el-dialog>
                <el-dialog title="用户平台配置"
        <el-dialog
          title="用户平台配置"
                           append-to-body
                           :visible.sync="platformBox">
                    <avue-crud :option="platformOption"
          :visible.sync="platformBox"
        >
          <avue-crud
            :option="platformOption"
                               :table-loading="platformLoading"
                               :data="platformData"
                               ref="platformCrud"
@@ -231,52 +286,54 @@
                               @current-change="platformCurrentChange"
                               @size-change="platformSizeChange"
                               @refresh-change="platformRefreshChange"
                               @on-load="platformOnLoad">
                        <template slot-scope="{ row }"
                                  slot="tenantName">
            @on-load="platformOnLoad"
          >
            <template slot-scope="{ row }" slot="tenantName">
                            <el-tag>{{ row.tenantName }}</el-tag>
                        </template>
                        <template slot-scope="{ row }"
                                  slot="userTypeName">
            <template slot-scope="{ row }" slot="userTypeName">
                            <el-tag>{{ row.userTypeName }}</el-tag>
                        </template>
                    </avue-crud>
                </el-dialog>
                <el-dialog title="保安员导入"
        <el-dialog
          title="保安员导入"
                           append-to-body
                           :visible.sync="excelBox1"
                           width="555px">
                    <avue-form :option="excelOption1"
          width="555px"
        >
          <avue-form
            :option="excelOption1"
                               v-model="excelForm1"
                               :upload-after="uploadAfter1">
            :upload-after="uploadAfter1"
          >
                        <template slot="excelTemplate">
                            <el-button type="primary"
                                       @click="handleTemplate1">
              <el-button type="primary" @click="handleTemplate1">
                                点击下载<i class="el-icon-download el-icon--right"></i>
                            </el-button>
                        </template>
                    </avue-form>
                </el-dialog>
                <el-dialog title="个人照片批量上传"
        <el-dialog
          title="个人照片批量上传"
                           append-to-body
                           :visible.sync="excelBox2"
                           width="555px">
                    <avue-form :option="excelOption2"
          width="555px"
        >
          <avue-form
            :option="excelOption2"
                               v-model="excelForm2"
                               :upload-after="uploadAfter2">
            :upload-after="uploadAfter2"
          >
                    </avue-form>
                </el-dialog>
                <div style="position: fixed; top: 9999px; width: 100%; height: 100%; ">
                    <div class="certificate_box"
                         id="certificateDom">
                        <div class="security_main"
                             ref="certificateBox">
        <div style="position: fixed; top: 9999px; width: 100%; height: 100%">
          <div class="certificate_box" id="certificateDom">
            <div class="security_main" ref="certificateBox">
                            <div class="security_m_l_titleName widt">
                                {{ certificateObj.realName }}
                            </div>
                            <div class="security_m_r_o_jg widt">
                                南昌市公安局
                            </div>
              <div class="security_m_r_o_jg widt">南昌市公安局</div>
                            <div class="security_m_l_titlepaperTimenian widt">
                                {{ certificateYear }}
                            </div>
@@ -290,7 +347,15 @@
                                {{ certificateObj.realName }}
                            </div>
                            <div class="security_m_r_o_rightbirthday widt">
                                {{ certificateObj.cardid ? (certificateObj.cardid.slice(6, 10) +'.'+ certificateObj.cardid.slice(10, 12) +'.'+ certificateObj.cardid.slice(12, 14)) : '' }}
                {{
                  certificateObj.cardid
                    ? certificateObj.cardid.slice(6, 10) +
                      "." +
                      certificateObj.cardid.slice(10, 12) +
                      "." +
                      certificateObj.cardid.slice(12, 14)
                    : ""
                }}
                            </div>
                            <div class="security_m_r_o_rightaddress security_m_r_o_l_r widt">
                                {{ certificateObj.registered }}
@@ -298,7 +363,6 @@
                            <div class="security_m_r_o_rightcardid">
                                {{ certificateObj.cardid }}
                            </div>
                        </div>
                    </div>
                </div>
@@ -321,8 +385,9 @@
    getUserPractitionersInfo,
    updatePaperTime,
    saveOrUpdateUserPractitionersInfo,
  getzhiwen, //指纹
} from "@/api/system/user";
import { securityApply } from '@/api/accreditationRecords/accreditationRecords'
import { securityApply } from "@/api/accreditationRecords/accreditationRecords";
import { getList } from "@/api/securityGuard/securityGuard";
import { getDeptLazyTree } from "@/api/system/dept";
import { getRoleTree, getRoleDetail } from "@/api/system/role";
@@ -332,6 +397,11 @@
import { getToken } from "@/util/auth";
import { securityFormPageColumn } from "./data";
import { mapState } from "vuex";
//加载指纹类
import Client from "./Client";
import doneVue from "../work/done.vue";
// import func from "vue-editor-bridge";
export default {
    data () {
@@ -416,14 +486,25 @@
            }
        };
        return {
      // 指纹数据
      isopen: false, //识别是否需要传指纹进去(解决异步传递后指纹DOM不存在的问题)
      zhiwenImg: "",
      zhiwenChart: "",
      zhiwenTitle: "开始采集",
      Client: "", //实例化指纹采集类合集
      isOr: true,
      begin_cap: false,
      RAWzhiwen: "",
      yuzhi: 60, //指纹获取结束阈值
      // 指纹数据
            certificateYear: null,
            certificateMonth: null,
            certificateFlag: false,
            certificateObj: {
                realName: '',
                securitynumber: '',
                cardid: '',
                registered: ''
        realName: "",
        securitynumber: "",
        cardid: "",
        registered: "",
            },
            securityid: "",
            excelBox1: false,
@@ -710,22 +791,40 @@
                            },
                            {
                                label: "指纹信息",
                                type: "upload",
                                listType: "picture-img",
                                propsHttp: {
                                    res: "data",
                                    url: "url",
                                },
                                canvasOption: {
                                    text: " ",
                                    ratio: 0.1,
                                },
                                action: "/api/blade-resource/oss/endpoint/put-files",
                                tip: "只能上传jpg/png指纹信息,且不超过500kb",
                // type: "upload",
                // listType: "picture-img",
                // propsHttp: {
                //   res: "data",
                //   url: "url",
                // },
                // canvasOption: {
                //   text: " ",
                //   ratio: 0.1,
                // },
                // action: "/api/blade-resource/oss/endpoint/put-files",
                // tip: "只能上传jpg/png指纹信息,且不超过500kb",
                                span: 12,
                                // row: true,
                                prop: "fingerprint",
                            },
              //   {
              //     label: "指纹信息",
              //     type: "upload",
              //     listType: "picture-img",
              //     propsHttp: {
              //       res: "data",
              //       url: "url",
              //     },
              //     canvasOption: {
              //       text: " ",
              //       ratio: 0.1,
              //     },
              //     action: "/api/blade-resource/oss/endpoint/put-files",
              //     tip: "只能上传jpg/png指纹信息,且不超过500kb",
              //     span: 12,
              //     // row: true,
              //     prop: "fingerprint",
              //   },
                            {
                                label: "是否持证",
                                prop: "hold",
@@ -809,18 +908,18 @@
                            },
                            {
                                label: "联系地址",
                                prop: "address"
                prop: "address",
                            },
                            {
                                label: "住址",
                                prop: "registered",
                                rules: [
                                    {
                                        required: true,
                                        message: "请输入住址",
                                        trigger: "click",
                                    },
                                ],
                // rules: [
                //   {
                //     required: true,
                //     message: "请输入住址",
                //     trigger: "click",
                //   },
                // ],
                            },
                            {
                                label: "所属辖区",
@@ -848,13 +947,13 @@
                                type: "date",
                                format: "yyyy-MM-dd",
                                valueFormat: "yyyy-MM-dd",
                                rules: [
                                    {
                                        required: true,
                                        message: "请输入入职时间",
                                        trigger: "click",
                                    },
                                ],
                // rules: [
                //   {
                //     required: true,
                //     message: "请输入入职时间",
                //     trigger: "click",
                //   },
                // ],
                            },
                            {
                                label: "性别",
@@ -1028,6 +1127,49 @@
                this.initData(this.form.tenantId);
            }
        },
    "form.fingerprint"() {
      let that = this;
      if (this.form.fingerprint != undefined) {
        that.isopen = true;
        let isoks = false;
        function sets(state, fingerprint, myPicture) {
          isoks = state;
          var winzhiwen = document.getElementById("zhiwen").contentWindow;
          winzhiwen.setZhiwenData({
            imgBMP: fingerprint,
            // imgBMP: imgBMP,
            // CID_img_raw: CID_img_raw,
            featuredatas: myPicture,
            isoks: isoks,
          });
        }
        setTimeout(() => {
          // if()
          if (!this.form.id) {
            sets(false);
            return;
          }
          // return;
          getzhiwen(this.form.id).then((res) => {
            const data = res.data.data;
            if (that.isopen) {
              if (
                data.fingerprint != "" &&
                data.fingerprint != undefined &&
                data.myPicture != "" &&
                data.myPicture != undefined
              ) {
                sets(true, data.fingerprint, data.myPicture);
              } else {
                sets(false);
              }
            }
          });
        }, 1800);
      } else {
        that.isopen = false;
      }
    },
        "form.deptId" () {
            this.initData(this.form.tenantId);
        },
@@ -1086,8 +1228,185 @@
            this.search["userType"] = 7;
        }
        this.deptIds = this.userInfo.dept_id;
    // this.beginzhiwen();
    },
    methods: {
    openccc() {
      console.log(this.zhiwenImg);
      // console.log(this.zhiwenChart);
      // this.Client.CID_Alg_FeatureExtract(
      //         //99是获取特征
      //         // ID_FingerPosition.UNKNOWN,
      //         99,
      //         this.RAWzhiwen
      //       );
      // console.log(this.RAWzhiwen);
    },
    beginzhiwen() {
      //初始化指纹采集系统
      let that = this;
      this.Client = new Client(); //实例化指纹采集类
      //添加指纹消息提醒
      //初始化设备
      this.Client.beginFn = {
        fn: this.Client.CID_Init,
        CID5000: this.Client.CIDDeviceType.CID5000,
      };
      this.Client.OnCID_Alg_Begin = function (code, msg) {
        //初始化机器返数据
        if (code == 1) {
          console.log("初始化成功");
          that.zhiwenTitle = "选定指纹";
          that.isOr = false;
          that.beginUseImg(); //开始预览指纹
        } else {
          that.closezhiwen();
          alert("设备被占用或发生不可预料原因   错误码:" + code);
          console.log("算法初始化发生错误   错误码:" + code);
        }
      };
      this.Client.OnCID_Close = function (code, msg) {
        //关闭机器返数据
        if (code == 1) {
          console.log("关闭设备成功");
          that.Client.CID_Alg_FeatureExtract(
            //99是获取特征
            // ID_FingerPosition.UNKNOWN,
            99,
            that.RAWzhiwen
          );
          that.zhiwenTitle = "开始采集";
          that.isOr = true;
        } else {
          console.log("关闭设备发生错误   错误码:" + code);
        }
      };
      this.Client.OnCID_BeginCapture = function (code, msg) {
        //开始使用预览图片模式函数
        // console.log(code, "图片模式开始");
        if (code == 1) {
          that.Client.CID_GetFPBmpData(0);
        } else {
          console.log("开始采集发生错误   错误码:" + code);
        }
      };
      this.Client.OnCID_GetBmpData = function (code, msg, imagedata, feadata) {
        //使用预览图片模式 采集 BMP格式
        // console.log(msg, "图片模式采集");
        if (code == 1) {
          that.zhiwenImg = "data:image/bmp;base64," + imagedata;
          if (that.begin_cap) {
            that.Client.BmpToRaw(imagedata, 256, 360);
          }
        } else {
          that.Client.CID_EndCapture(0);
          that.begin_cap = false;
          console.log("采集发生错误   错误码:" + code);
        }
      };
      // this.Client.OnBmpToRaw = function (code, msg, imagedata) {
      //   //使用预览图片模式  BMP格式转换成RAW
      //   // console.log(code, msg, "BMP格式转换成RAW");
      //   // console.log(imagedata, "BMP格式转换成RAW");
      //   if (code == 0) {
      //     that.RAWzhiwen = imagedata;
      //     // console.log(imagedata);
      //     that.Client.CID_Alg_GetQualityScore(imagedata);
      //   } else {
      //     that.Client.CID_EndCapture(0);
      //     that.begin_cap = false;
      //     console.log("格式转换失败," + code + " " + msg);
      //   }
      // };
      this.Client.OnBmpToRaw = function (code, msg, imagedata) {
        //使用预览图片模式  BMP格式转换成RAW
        // console.log(code, msg, "BMP格式转换成RAW");
        if (code == 0) {
          that.Client.CID_Alg_GetQualityScore(imagedata);
          // console.log(imagedata);
          that.RAWzhiwen = imagedata;
        } else {
          that.Client.CID_EndCapture(0);
          that.begin_cap = false;
          alert("格式转换失败," + code + " " + msg);
        }
      };
      this.Client.OnCID_EndCapture = function (code, msg) {
        //使用预览图片模式  停止采集
        if (code == 1) {
          if (that.begin_cap) {
            that.Client.CID_BeginCapture(0);
          }
        } else {
          that.begin_cap = false;
          console.log("停止采集发生错误   错误码:" + code);
        }
      };
      this.Client.OnCID_Alg_GetQualityScore = function (code, msg, score) {
        //停止获取
        console.log(
          "code:" + code + ";",
          "msg:" + msg + ";",
          "score:" + score + ";",
          "传送RAW图片代码后返回值"
        );
        if (code == 1) {
          if (score >= that.yuzhi) {
            that.begin_cap = false;
            that.Client.CID_EndCapture(0);
            that.Client.CID_Alg_FeatureExtract(
              //99是获取特征
              // ID_FingerPosition.UNKNOWN,
              99,
              that.RAWzhiwen
            );
          } else {
            that.Client.CID_EndCapture(0);
          }
        } else if (code == -9) {
          that.Client.CID_EndCapture(0);
        } else {
          that.Client.CID_EndCapture(0);
          that.begin_cap = false;
          // console.log("获取质量分数发生错误   错误码:" + code);
          console.log("获取质量分数发生错误   错误码:" + code);
        }
      };
      this.Client.OnCID_Alg_FeatureExtract = function (code, msg, featuredata) {
        //获取特征
        if (code == 1) {
          that.zhiwenChart = featuredata;
          console.log("特征提取成功");
          console.log("特征提取成功", that.zhiwenChart);
        } else {
          console.log("特征提取发生错误   错误码:" + code);
        }
      };
    },
    openzhiwen() {
      // 连接指纹助手
      this.Client.Connect_Server(); //成功后台打印Connect Success
      //成功后将自动初始化设备
      //若不成功将重复2秒计时重连设备
    },
    closezhiwen() {
      // 关闭指纹设备
      if (!this.Client.isConnect) {
        console.log("助手程序未连接");
        return;
      }
      this.Client.CID_Close();
    },
    beginUseImg() {
      //开始预览图片
      if (!this.Client.isConnect) {
        alert("助手程序未连接");
        return;
      }
      this.begin_cap = true;
      this.Client.CID_BeginCapture(0);
    },
        handleImport1 () {
            this.excelBox1 = true;
        },
@@ -1120,19 +1439,22 @@
        //行点击事件
        certificateClick (row) {
            if (row) {
                var time = this.getNewTime()
                this.certificateYear = time[0]
                this.certificateMonth = time[1]
                this.certificateObj = row
        var time = this.getNewTime();
        this.certificateYear = time[0];
        this.certificateMonth = time[1];
        this.certificateObj = row;
                setTimeout(() => {
                    this.Print();
                }, 500);
            }
        },
        Print () {
            if (this.certificateObj.registered == '' || this.certificateObj.registered == null) {
                this.$message({ message: '请完善住址信息', type: 'warning' })
                return
      if (
        this.certificateObj.registered == "" ||
        this.certificateObj.registered == null
      ) {
        this.$message({ message: "请完善住址信息", type: "warning" });
        return;
            }
            //更新发证时间
            var printDom = document.getElementById("certificateDom");
@@ -1143,44 +1465,52 @@
            printDom.style.height = "100%";
            printDom.style.fontFamily = "SimSun";
            this.$print('#certificateDom', {
                noPrint: '.noPrint',
      this.$print("#certificateDom", {
        noPrint: ".noPrint",
                onStart: () => {
                    // console.log('打印开始', Date.parse(new Date()));
                },
                onEnd: () => {
                    this.updateUserInfo();
                    // console.log('打印完成', Date.parse(new Date()));
                }
        },
            });
        },
        getNewTime () {
            var nowTime = new Date()
      var nowTime = new Date();
            var oneHoursAgo = new Date(new Date(nowTime).getTime() - 1 * 60 * 60 * 1000)
            var oneHoursAgoY = oneHoursAgo.getFullYear()
            var oneHoursAgoM = oneHoursAgo.getMonth() + 1 < 10 ? '0' + (oneHoursAgo.getMonth() + 1) : oneHoursAgo.getMonth() + 1
      var oneHoursAgo = new Date(
        new Date(nowTime).getTime() - 1 * 60 * 60 * 1000
      );
      var oneHoursAgoY = oneHoursAgo.getFullYear();
      var oneHoursAgoM =
        oneHoursAgo.getMonth() + 1 < 10
          ? "0" + (oneHoursAgo.getMonth() + 1)
          : oneHoursAgo.getMonth() + 1;
            /**
             * @return 返回1小时,2小时,3小时,4小时,24小时
             */
            return [oneHoursAgoY, oneHoursAgoM]
      return [oneHoursAgoY, oneHoursAgoM];
        },
        //更新用户发证时间
        updateUserInfo () {
            var nowTime = new Date()
            var oneHoursAgo = new Date(new Date(nowTime).getTime() - 1 * 60 * 60 * 1000)
            var oneHoursAgoY = oneHoursAgo.getFullYear()
            var oneHoursAgoM = oneHoursAgo.getMonth() + 1 < 10 ? '0' + (oneHoursAgo.getMonth() + 1) : oneHoursAgo.getMonth() + 1
      var nowTime = new Date();
      var oneHoursAgo = new Date(
        new Date(nowTime).getTime() - 1 * 60 * 60 * 1000
      );
      var oneHoursAgoY = oneHoursAgo.getFullYear();
      var oneHoursAgoM =
        oneHoursAgo.getMonth() + 1 < 10
          ? "0" + (oneHoursAgo.getMonth() + 1)
          : oneHoursAgo.getMonth() + 1;
            var day = oneHoursAgo.getDay();
            var date = oneHoursAgoY + "-" + oneHoursAgoM + "-" + day;
            const data = {
                id: this.certificateObj.id,
                userType: 6,
                paperTime: date
            }
        paperTime: date,
      };
            updatePaperTime(data);
        },
        rowClickSelf (row) {
@@ -1225,11 +1555,14 @@
                this.$message.warning("请勾选至少一位持证保安员");
                return;
            }
            this.$confirm("共选择制证申请人数" + this.choiceList.length + "人,确定申请制证?", {
      this.$confirm(
        "共选择制证申请人数" + this.choiceList.length + "人,确定申请制证?",
        {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
        }
      )
                .then(() => {
                    let cho = this.choiceList;
                    let str = "";
@@ -1241,8 +1574,8 @@
                    }
                    const data = {
                        ids: str,
                        createUser: this.userInfo.user_id
                    }
            createUser: this.userInfo.user_id,
          };
                    return securityApply(data);
                })
                .then(() => {
@@ -1254,6 +1587,16 @@
                });
        },
        rowSave (row, done, loading) {
      // var dom = document.getElementById("zhiwenOur");
      // window.frames["iframe的name值"].document.getElementById("iframe中控件的ID").click();
      var winzhiwen = document.getElementById("zhiwen").contentWindow;
      let zhiwen = winzhiwen.outZhiwenData();
      // console.log(zhiwen);
      // for (let k in zhiwen) {
      //   console.log(k);
      //   console.log(zhiwen[k]);
      // }
      // return;
            if (row.deptId) {
                row.deptId = row.deptId;
            }
@@ -1263,12 +1606,15 @@
            if (row.postId) {
                row.postId = row.postId.join(",");
            }
            const userMap = {
                user: {
          //指纹↓
          fingerprint: zhiwen.imgBMP, //图
          myPicture: zhiwen.featuredata, //特征
          //指纹↑
                    account: row.account,
                    avatar: row.avatar,
                    fingerprint: row.fingerprint,
          // fingerprint: row.fingerprint,
                    healstats: row.healstats,
                    address: row.address,
                    birthday: row.birthday,
@@ -1279,7 +1625,7 @@
                    height: row.height,
                    hold: row.hold,
                    jurisdiction: row.jurisdiction,
                    myPicture: row.myPicture,
          // myPicture: row.myPicture,
                    name: row.name,
                    nation: row.nation,
                    nativeplace: row.nativeplace,
@@ -1322,6 +1668,16 @@
            row.postId = row.postId.join(",");
            //值替换,education 放在页面会卡死
            row.education = row.education1;
      var winzhiwen = document.getElementById("zhiwen").contentWindow;
      let zhiwen = winzhiwen.outZhiwenData();
      // console.log(zhiwen);
      if (zhiwen.isoks) {
        row.fingerprint = zhiwen.imgBMP;
        row.myPicture = zhiwen.featuredata;
      }
      // console.log(row);
      // return;
            update(row).then(
                () => {
                    this.initFlag = false;
@@ -1503,15 +1859,18 @@
                type: "warning",
            }).then(() => {
                window.open(
                    `/api/blade-user/export-user?${this.website.tokenHeader
                    }=${getToken()}&account=${this.search.account}&realName=${this.search.realName
          `/api/blade-user/export-user?${
            this.website.tokenHeader
          }=${getToken()}&account=${this.search.account}&realName=${
            this.search.realName
                    }`
                );
            });
        },
        handleTemplate () {
            window.open(
                `/api/blade-user/export-template?${this.website.tokenHeader
        `/api/blade-user/export-template?${
          this.website.tokenHeader
                }=${getToken()}`
            );
        },
@@ -1750,7 +2109,7 @@
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font: normal 18px 'SimSuncss' !important;
  font: normal 18px "SimSuncss" !important;
}
.security_main {
    width: 630px;
@@ -1931,4 +2290,19 @@
    line-height: 40px;
    letter-spacing: 2px;
}
.zhiwenMain {
  width: 100%;
  height: 305px;
  // display: flex;
  // align-items: center;
  // justify-content: space-around;
  // border: 1px solid red;
}
// .zhiwenImgs {
//   width: 178px;
//   height: 178px;
//   border-radius: 5px;
//   text-align: center;
//   border: 1px dashed #8c939d;
// }
</style>