| | |
| | | </div> |
| | | |
| | | <div class="right-btns"> |
| | | <span style="margin-right: 2px">底库状态(生效/失效)</span> |
| | | <el-switch |
| | | :active-value="1" |
| | | :width="52" |
| | |
| | | tooltip-effect="dark" |
| | | style="width: 100%; overflow: auto" |
| | | :fit="true" |
| | | row-class-name="hover-row" |
| | | cell-class-name="cell-classname" |
| | | @row-click="pickRow" |
| | | :default-sort="{ prop: 'createTime', order: 'descending' }" |
| | |
| | | type="info" |
| | | >取消</el-button |
| | | > |
| | | <el-button |
| | | size="small" |
| | | class="sure-btn" |
| | | type="primary" |
| | | @click="submit" |
| | | <el-button size="small" class="sure-btn" type="primary" @click="submit" |
| | | >确定</el-button |
| | | > |
| | | </div> |
| | |
| | | > |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 确认删除对话框 --> |
| | | <el-dialog |
| | | :visible.sync="askDeleteShow" |
| | | :center="true" |
| | |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="askDeleteShow = false">取 消</el-button> |
| | | <el-button type="primary" @click="handleDel">确 定</el-button> |
| | | <el-button type="primary" @click="handleDel" :loading="delBtnLoading" |
| | | >确 定</el-button |
| | | > |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | title="复制到" |
| | | :visible.sync="copyVisiabled" |
| | |
| | | updateBasePerson, |
| | | deleteBasePersons, |
| | | updateDbTableStatus, |
| | | deleteDbPersonById, |
| | | deleteDBtablesById, |
| | | } from "@/api/baseLibrary"; |
| | | import { getCameraFaceData } from "@/api/es"; |
| | | // import { checkIDCard } from "@/api/utils"; |
| | | import { isIDCard } from "../../../scripts/validate"; |
| | | |
| | | import axios from "axios"; |
| | |
| | | import fTemplate from "@/components/fTemplate"; |
| | | import UploadIcon from "@/components/searching/UploadIcon.vue"; |
| | | function isPhone(rule, value, callback) { |
| | | if (!value) { |
| | | return callback(); |
| | | } else if (value.trim()) { |
| | | var pattern = /^1[345789]\d{9}$/; |
| | | if (pattern.test(value)) { |
| | | return callback(); |
| | | } |
| | | return callback(new Error("输入的手机号错误")); |
| | | } |
| | | if (!value) { |
| | | return callback(); |
| | | } else if (value.trim()) { |
| | | var pattern = /^1[345789]\d{9}$/; |
| | | if (pattern.test(value)) { |
| | | return callback(); |
| | | } |
| | | return callback(new Error("输入的手机号错误")); |
| | | } |
| | | } |
| | | Date.prototype.Format = function (fmt) { |
| | | var o = { |
| | | "M+": this.getMonth() + 1, //月份 |
| | |
| | | }; |
| | | |
| | | export default { |
| | | components: { |
| | | UploadBtn, |
| | | fTemplate, |
| | | UploadIcon, |
| | | }, |
| | | props: { |
| | | baseObject: { |
| | | default: () => {}, |
| | | type: Object, |
| | | }, |
| | | syncType: { |
| | | type: String, |
| | | }, |
| | | }, |
| | | computed: { |
| | | isAdmin() { |
| | | if ( |
| | | sessionStorage.getItem("userInfo") && |
| | | sessionStorage.getItem("userInfo") !== "" |
| | | ) { |
| | | let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username; |
| | | return loginName === "superadmin" || loginName === "basic"; |
| | | } |
| | | return false; |
| | | }, |
| | | delText() { |
| | | switch (this.delType) { |
| | | case "base": |
| | | return ["删除底库", "确定删除该底库?"]; |
| | | case "single": |
| | | return ["删除人员", "确定删除该底库人员?"]; |
| | | case "batch": |
| | | return ["批量删除", "确定删除该底库选中人员?"]; |
| | | default: |
| | | return ["", ""]; |
| | | } |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | timeRange: [ |
| | |
| | | multiFaceList: [], |
| | | noFaceList: [], |
| | | }, |
| | | delBtnLoading: false, |
| | | }; |
| | | }, |
| | | computed: { |
| | | isAdmin() { |
| | | if ( |
| | | sessionStorage.getItem("userInfo") && |
| | | sessionStorage.getItem("userInfo") !== "" |
| | | ) { |
| | | let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username; |
| | | return loginName === "superadmin" || loginName === "basic"; |
| | | } |
| | | return false; |
| | | |
| | | watch: { |
| | | "BaseManageData.selectBlacks": function (value) { |
| | | this.blackAngWhite(); |
| | | }, |
| | | delText() { |
| | | switch (this.delType) { |
| | | case "base": |
| | | return ["删除底库", "确定删除该底库?"]; |
| | | case "single": |
| | | return ["删除人员", "确定删除该底库人员?"]; |
| | | case "batch": |
| | | return ["批量删除", "确定删除该底库选中人员?"]; |
| | | default: |
| | | return ["", ""]; |
| | | } |
| | | "BaseManageData.selectWhites": function (value) { |
| | | this.blackAngWhite(); |
| | | }, |
| | | }, |
| | | methods: { |
| | |
| | | this.delType = typ; |
| | | id && (this.toDeleteId = id); |
| | | }, |
| | | deleteThis() { |
| | | let token = |
| | | sessionStorage.getItem("loginedInfo") && |
| | | JSON.parse(sessionStorage.getItem("loginedInfo")).access_token; |
| | | |
| | | fetch(`/data/api-v/dbperson/deleteDbPersonById?id=${this.toDeleteId}`, { |
| | | method: "GET", |
| | | headers: { |
| | | "Content-Type": "application/json", |
| | | Authorization: token, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | return res.json(); |
| | | }) |
| | | .then((data) => { |
| | | if (data.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "该人员删除成功!", |
| | | }); |
| | | this.askDeleteShow = false; |
| | | } |
| | | this.getPersonList(); |
| | | }) |
| | | .catch((err) => {}); |
| | | }, |
| | | sayHello() {}, |
| | | getUploadResult(result) { |
| | | this.uploadResult = result.data; |
| | | this.dialogVisible = true; |
| | |
| | | edit() { |
| | | this.$emit("changeShow", this.baseObject, this.syncType); |
| | | }, |
| | | deleteBase() { |
| | | let token = |
| | | sessionStorage.getItem("loginedInfo") && |
| | | JSON.parse(sessionStorage.getItem("loginedInfo")).access_token; |
| | | fetch(`/data/api-v/dbtable/deleteDBtablesById?id=${this.baseObject.id}`, { |
| | | method: "GET", |
| | | headers: { |
| | | "Content-Type": "application/json", |
| | | Authorization: token, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | return res.json(); |
| | | |
| | | deleteThis() { |
| | | debugger; |
| | | deleteDbPersonById({ id: this.toDeleteId }) |
| | | .then((data) => { |
| | | if (data.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "该人员删除成功!", |
| | | }); |
| | | } |
| | | this.getPersonList(); |
| | | }) |
| | | .catch((err) => {}); |
| | | }, |
| | | deleteBase() { |
| | | deleteDBtablesById({ id: this.baseObject.id }) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | this.$notify({ |
| | |
| | | message: "底库删除成功!", |
| | | }); |
| | | } |
| | | |
| | | this.$emit("onDelete"); |
| | | }) |
| | | .catch((err) => { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | async deleteBatch() { |
| | | let ids = []; |
| | | this.selectedRowKeys.map((item, index) => { |
| | | ids.push(item.id); |
| | | }); |
| | | let res = await deleteBasePersons({ ids: ids }); |
| | | if (res.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "删除成功!", |
| | | }); |
| | | this.getPersonList(); |
| | | } else { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: "删除失败!", |
| | | }); |
| | | } |
| | | }, |
| | | async getPersonList() { |
| | | console.log(this.baseObject); |
| | | this.$nextTick(() => { |
| | | if (this.baseObject.id && this.baseObject.id !== undefined) { |
| | | this.BaseManageData.tableId = this.baseObject.id; |
| | |
| | | this.$notify({ |
| | | type: "error", |
| | | message: item.errorMsg.message, |
| | | customClass: "PersonListDialog", |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | delete json["compareScore"]; |
| | | let res = await updateBasePerson(json); |
| | | if (res.success) { |
| | | this.getPersonList() |
| | | this.getPersonList(); |
| | | this.$notify.success("人员修改成功!"); |
| | | this.showInfoDrawer = false; |
| | | } else { |
| | |
| | | handleSearch() { |
| | | this.getPersonList(); |
| | | }, |
| | | handleDel() { |
| | | async handleDel() { |
| | | this.delBtnLoading = true; |
| | | if (this.delType == "single") { |
| | | this.deleteThis(); |
| | | await this.deleteThis(); |
| | | } else if (this.delType == "base") { |
| | | this.deleteBase(); |
| | | await this.deleteBase(); |
| | | } else if (this.delType == "batch") { |
| | | this.deleteBatch(); |
| | | await this.deleteBatch(); |
| | | } |
| | | |
| | | this.delBtnLoading = false; |
| | | this.askDeleteShow = false; |
| | | }, |
| | | searchImg() { |
| | | this.$refs.uploadDrag && this.$refs.uploadDrag.uploadStart(); |
| | |
| | | }, |
| | | uploadSuccess() {}, |
| | | uploadError() {}, |
| | | async deleteBatch() { |
| | | let ids = []; |
| | | this.selectedRowKeys.map((item, index) => { |
| | | ids.push(item.id); |
| | | }); |
| | | let res = await deleteBasePersons(ids); |
| | | if (res.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "删除成功!", |
| | | }); |
| | | this.getPersonList(); |
| | | } else { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: "删除失败!", |
| | | }); |
| | | } |
| | | }, |
| | | async init() { |
| | | await this.BaseManageData.querySyncTables(); |
| | | await this.BaseManageData.queryLocalTables(); |
| | |
| | | }, |
| | | beforeDestroy() { |
| | | window.onresize = null; |
| | | }, |
| | | watch: { |
| | | baseObject: { |
| | | handler(newVal, oldVal) { |
| | | this.BaseManageData.cleanData(); |
| | | this.getPersonList(); |
| | | }, |
| | | deep: true, |
| | | }, |
| | | "BaseManageData.selectBlacks": function (value) { |
| | | this.blackAngWhite(); |
| | | }, |
| | | "BaseManageData.selectWhites": function (value) { |
| | | this.blackAngWhite(); |
| | | }, |
| | | }, |
| | | components: { |
| | | UploadBtn, |
| | | fTemplate, |
| | | UploadIcon, |
| | | }, |
| | | props: { |
| | | baseObject: { |
| | | default: () => {}, |
| | | type: Object, |
| | | }, |
| | | syncType: { |
| | | type: String, |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | } |
| | | |
| | | .el-button--small:hover { |
| | | // background: "rgba(#{var(--colorCard-rgb)},10%) !important" ; |
| | | filter: brightness(92%); |
| | | } |
| | | .el-input__suffix { |
| | |
| | | .el-input-number--mini { |
| | | width: 72px; |
| | | } |
| | | } |
| | | .upload-img-box { |
| | | } |
| | | .uploadIconBox .left-section1 .el-input__inner { |
| | | height: 32px; |
| | |
| | | } |
| | | } |
| | | .el-dialog.copy-dialog { |
| | | width: 516px; |
| | | width: 550px; |
| | | border-radius: 24px; |
| | | .el-dialog__header { |
| | | text-align: center; |
| | |
| | | color: #5f5f5f; |
| | | } |
| | | .dialog-footer { |
| | | // width: 315px; |
| | | .el-button--info { |
| | | color: #999999; |
| | | background: #fff; |
| | |
| | | .items { |
| | | width: 100%; |
| | | min-height: 150px; |
| | | margin-bottom: 20px; |
| | | margin-bottom: 10px; |
| | | .lable { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | |
| | | } |
| | | .baseList { |
| | | height: 100%; |
| | | overflow: auto; |
| | | .base { |
| | | width: 152px; |
| | | padding: 5px 5px 5px 10px; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .PersonListDialog { |
| | | width: 360px !important; |
| | | } |
| | | </style> |