|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-09-16 11:27:35
|
|
|
- * @LastEditTime: 2021-11-28 15:31:59
|
|
|
+ * @LastEditTime: 2021-11-30 14:32:06
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: \hyyfClient\src\views\BioSafety\PersonAdmin.vue
|
|
@@ -33,7 +33,7 @@
|
|
|
:height="475"
|
|
|
>
|
|
|
<template v-slot:right>
|
|
|
- <template v-if="btnSelected === 1">
|
|
|
+ <!-- <template v-if="btnSelected === 1">
|
|
|
<div>
|
|
|
<el-button size="mini">添加人员</el-button>
|
|
|
<el-button size="mini">添加区域</el-button>
|
|
@@ -48,11 +48,28 @@
|
|
|
<div>
|
|
|
<el-button size="mini">添加赶猪人员</el-button>
|
|
|
</div>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</template>
|
|
|
+
|
|
|
+ <!-- 人员门禁 -->
|
|
|
<template v-slot:recordImage="slotProps">
|
|
|
<img :src="slotProps.row.recordImage" alt="人员门禁" width="100" />
|
|
|
</template>
|
|
|
+
|
|
|
+ <!-- 档案管理 -->
|
|
|
+ <template v-slot:personBiosignatures="slotProps">
|
|
|
+ <img
|
|
|
+ :src="slotProps.row.personBiosignatures[0].path"
|
|
|
+ alt="人员门禁"
|
|
|
+ width="100"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template #sex="slotProps">
|
|
|
+ <span>{{ personSex[slotProps.row.sex] }}</span>
|
|
|
+ </template>
|
|
|
+ <template #status="slotProps">
|
|
|
+ <span>{{ personStatus[slotProps.row.status] }}</span>
|
|
|
+ </template>
|
|
|
</new-table>
|
|
|
<table-footer
|
|
|
:totals="total"
|
|
@@ -69,11 +86,12 @@ import HeadBtns from "components/bioSafety/Btns";
|
|
|
import QueryConditions from "components/bioSafety/QueryConditions";
|
|
|
import NewTable from "components/newTable/NewTable";
|
|
|
import TableFooter from "../../components/TableFooter";
|
|
|
+import { timeDate } from "../../utils/index";
|
|
|
|
|
|
import { formItems, propFormData } from "./personAdmin/queryCondition.config";
|
|
|
import { titles, tableItems, tableShows } from "./personAdmin/table.config";
|
|
|
import { getFaceToken, getFaceGuard } from "../../utils/api";
|
|
|
-import { getFaceGuardTotal } from "../../utils/chenApi";
|
|
|
+import { getFaceGuardTotal, getPersonFiles } from "../../utils/chenApi";
|
|
|
|
|
|
export default {
|
|
|
name: "PersonAdmin",
|
|
@@ -91,7 +109,7 @@ export default {
|
|
|
{ id: 2, name: "人脸门禁" },
|
|
|
// { id: 3, name: '赶猪监管' }
|
|
|
],
|
|
|
- btnSelected: 2, // 选中的按钮
|
|
|
+ btnSelected: 1, // 选中的按钮
|
|
|
formItems: [], // 传给 QueryCondition 组件的 formItems
|
|
|
propFormData: {}, // 传给 QueryCondition 组件的 propFormData
|
|
|
title: "", // 传给 BioTable 组件的 title
|
|
@@ -104,6 +122,8 @@ export default {
|
|
|
pageNum: 1,
|
|
|
selectId: "",
|
|
|
params: {},
|
|
|
+ personStatus: ["已删除", "正常", "冻结"], // 档案管理 - 人员状态
|
|
|
+ personSex: ["未知", "男", "女"], // 档案管理 - 性别
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -112,6 +132,7 @@ export default {
|
|
|
this.title = titles[this.btnSelected - 1];
|
|
|
this.tableItems = tableItems[this.btnSelected - 1];
|
|
|
this.tableShows = tableShows;
|
|
|
+ this.initPersonFiles();
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取选中的按钮情况
|
|
@@ -121,28 +142,34 @@ export default {
|
|
|
this.propFormData = propFormData[id - 1];
|
|
|
this.title = titles[id - 1];
|
|
|
this.tableItems = tableItems[id - 1];
|
|
|
+ this.chooseApi();
|
|
|
+ },
|
|
|
+ // 按钮选中情况 --> 对应的 api
|
|
|
+ chooseApi(flag = true) {
|
|
|
+ if (this.btnSelected === 1) {
|
|
|
+ this.initPersonFiles();
|
|
|
+ } else {
|
|
|
+ console.log("******************");
|
|
|
+ this.faceGuard();
|
|
|
+ if (flag) {
|
|
|
+ this.faceGuardTotal();
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
// 获取查询条件
|
|
|
handleQuery(params) {
|
|
|
this.params = params;
|
|
|
- if (this.btnSelected === 2) {
|
|
|
- this.faceGuard();
|
|
|
- this.faceGuardTotal();
|
|
|
- }
|
|
|
+ this.chooseApi();
|
|
|
},
|
|
|
// 修改size
|
|
|
sizeChange(val) {
|
|
|
this.size = val;
|
|
|
- if (this.btnSelected === 2) {
|
|
|
- this.faceGuard();
|
|
|
- }
|
|
|
+ this.chooseApi(false);
|
|
|
},
|
|
|
// 修改页数
|
|
|
pageChange(val) {
|
|
|
this.pageNum = val;
|
|
|
- if (this.btnSelected === 2) {
|
|
|
- this.faceGuard();
|
|
|
- }
|
|
|
+ this.chooseApi(false);
|
|
|
},
|
|
|
init() {
|
|
|
let params = {
|
|
@@ -155,6 +182,12 @@ export default {
|
|
|
},
|
|
|
// 人脸门禁的查询
|
|
|
faceGuard() {
|
|
|
+ if (!this.params.time) {
|
|
|
+ this.params.time = [
|
|
|
+ timeDate(new Date().getTime() - 1000 * 60 * 60 * 24),
|
|
|
+ timeDate(new Date().getTime()),
|
|
|
+ ];
|
|
|
+ }
|
|
|
let queryParams = {
|
|
|
pageNum: this.pageNum,
|
|
|
pageSize: this.size,
|
|
@@ -176,7 +209,14 @@ export default {
|
|
|
console.log("token:", token);
|
|
|
});
|
|
|
},
|
|
|
+ // 人脸门禁总条数
|
|
|
faceGuardTotal() {
|
|
|
+ if (!this.params.time) {
|
|
|
+ this.params.time = [
|
|
|
+ timeDate(new Date().getTime() - 1000 * 60 * 60 * 24),
|
|
|
+ timeDate(new Date().getTime()),
|
|
|
+ ];
|
|
|
+ }
|
|
|
let queryParams = {
|
|
|
personName: this.params.name || undefined,
|
|
|
startSwingTime: this.params.time[0] + " 00:00:00",
|
|
@@ -188,6 +228,27 @@ export default {
|
|
|
this.total = JSON.parse(res.result).data;
|
|
|
});
|
|
|
},
|
|
|
+ // 档案管理
|
|
|
+ initPersonFiles() {
|
|
|
+ getPersonFiles({
|
|
|
+ searchKey: "",
|
|
|
+ pageNum: this.pageNum,
|
|
|
+ pageSize: this.size,
|
|
|
+ departmentId: this.params.departmentId || 5,
|
|
|
+ isContain: true,
|
|
|
+ statusList: [1, 2],
|
|
|
+ }).then(async ({ success, result }) => {
|
|
|
+ if (success) {
|
|
|
+ const listData = JSON.parse(result);
|
|
|
+ this.listData = listData.data.pageData;
|
|
|
+ this.total = listData.data.totalRows;
|
|
|
+ const { token } = await getFaceToken();
|
|
|
+ this.listData.forEach((item) => {
|
|
|
+ item.personBiosignatures[0].path = `https://36.26.62.70:447/evo-pic/${item.personBiosignatures[0].path}?token=${token}&oss_addr=172.16.3.223:9876`;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|