|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-09-16 11:27:35
|
|
|
- * @LastEditTime: 2021-12-22 17:42:08
|
|
|
+ * @LastEditTime: 2021-12-25 19:32:36
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: \hyyfClient\src\views\BioSafety\PersonAdmin.vue
|
|
@@ -46,12 +46,15 @@
|
|
|
:tableItems="tableItems"
|
|
|
:shows="tableShows"
|
|
|
:height="475"
|
|
|
+ @selectionChange="handleSelectionChange"
|
|
|
>
|
|
|
<template v-slot:right>
|
|
|
<template v-if="btnSelected === 1">
|
|
|
<div>
|
|
|
- <el-button size="mini">新增人员</el-button>
|
|
|
- <el-button size="mini" type="danger">批量删除</el-button>
|
|
|
+ <el-button size="mini" @click="handleAddOrEdit">新增人员</el-button>
|
|
|
+ <el-button size="mini" type="danger" @click="handleDelete"
|
|
|
+ >批量删除</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</template>
|
|
|
<!-- <template v-else-if="btnSelected === 2">
|
|
@@ -80,8 +83,12 @@
|
|
|
<!-- 档案管理 -->
|
|
|
<template v-slot:personBiosignatures="slotProps">
|
|
|
<img
|
|
|
- :src="slotProps.row.personBiosignatures[0].path"
|
|
|
- alt="人员门禁"
|
|
|
+ :src="
|
|
|
+ slotProps.row.personBiosignatures
|
|
|
+ ? slotProps.row.personBiosignatures[0].path
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ alt="没有图片"
|
|
|
width="100"
|
|
|
@click="clickImg(slotProps.row.personBiosignatures[0].path)"
|
|
|
/>
|
|
@@ -95,10 +102,18 @@
|
|
|
<template #handler="slotProps">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
+ type="primary"
|
|
|
+ @click="handleAddOrEdit(slotProps.row)"
|
|
|
+ >
|
|
|
+ 编 辑
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
type="danger"
|
|
|
@click="handleDelete(slotProps.row)"
|
|
|
- >删 除</el-button
|
|
|
>
|
|
|
+ 删 除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</new-table>
|
|
|
<table-footer
|
|
@@ -117,6 +132,7 @@
|
|
|
</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <add-or-edit ref="addOrEdit" @reflash="reflash"></add-or-edit>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -129,6 +145,7 @@ import Board from "components/bioSafety/Board";
|
|
|
import ChartElectro from "./chart/ChartElectro.vue";
|
|
|
import CostHistogram from "./chart/CostHistogram.vue";
|
|
|
import { timeDate } from "../../utils/index";
|
|
|
+import AddOrEdit from "./personAdmin/AddOrEdit.vue";
|
|
|
|
|
|
import { formItems, propFormData } from "./personAdmin/queryCondition.config";
|
|
|
import { titles, tableItems, tableShows } from "./personAdmin/table.config";
|
|
@@ -137,6 +154,7 @@ import {
|
|
|
getFaceGuardTotal,
|
|
|
getPersonFiles,
|
|
|
getRecord,
|
|
|
+ delPerson,
|
|
|
} from "../../utils/chenApi";
|
|
|
import { mapState } from "vuex";
|
|
|
|
|
@@ -150,6 +168,7 @@ export default {
|
|
|
Board,
|
|
|
ChartElectro,
|
|
|
CostHistogram,
|
|
|
+ AddOrEdit,
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(["ip"]),
|
|
@@ -183,6 +202,7 @@ export default {
|
|
|
imgUrl: "", // 点击图片后放大的图片路径
|
|
|
recordData: {}, // 进出统计
|
|
|
loading: true,
|
|
|
+ rows: [], // 人员列表 selection
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -191,6 +211,7 @@ export default {
|
|
|
this.title = titles[this.btnSelected - 1];
|
|
|
this.tableItems = tableItems[this.btnSelected - 1];
|
|
|
this.tableShows = tableShows;
|
|
|
+ this.tableShows.showSelect = true;
|
|
|
this.initPersonFiles();
|
|
|
},
|
|
|
methods: {
|
|
@@ -201,6 +222,9 @@ export default {
|
|
|
this.propFormData = propFormData[id - 1];
|
|
|
this.title = titles[id - 1];
|
|
|
this.tableItems = tableItems[id - 1];
|
|
|
+ if (this.btnSelected === 1) {
|
|
|
+ this.tableShows.showSelect = true;
|
|
|
+ }
|
|
|
this.chooseApi();
|
|
|
},
|
|
|
// 按钮选中情况 --> 对应的 api
|
|
@@ -233,14 +257,6 @@ export default {
|
|
|
this.pageNum = val;
|
|
|
this.chooseApi(false);
|
|
|
},
|
|
|
- init() {
|
|
|
- let params = {
|
|
|
- pageNum: this.pageNum,
|
|
|
- pageSize: this.size,
|
|
|
- searchStr: this.keyword,
|
|
|
- };
|
|
|
- // 获取后端数据
|
|
|
- },
|
|
|
// 人脸门禁的查询 + 近 7 小时进出统计
|
|
|
faceGuard() {
|
|
|
if (!this.params.time) {
|
|
@@ -296,9 +312,8 @@ export default {
|
|
|
openType: 61, // 进门,刷脸
|
|
|
};
|
|
|
getFaceGuardTotal(queryParams).then((res) => {
|
|
|
- console.log("total:", JSON.parse(res.result));
|
|
|
this.total = JSON.parse(res.result).data;
|
|
|
- if(this.isTotal === false) {
|
|
|
+ if (this.isTotal === false) {
|
|
|
this.total1 = JSON.parse(res.result).data;
|
|
|
this.isTotal = true;
|
|
|
}
|
|
@@ -317,10 +332,11 @@ export default {
|
|
|
if (success) {
|
|
|
const listData = JSON.parse(result);
|
|
|
this.listData = listData.data.pageData;
|
|
|
- console.log(this.listData);
|
|
|
this.total = listData.data.totalRows;
|
|
|
this.listData.forEach((item) => {
|
|
|
- item.personBiosignatures[0].path = `${this.ip}/video/picture/get?path=${item.personBiosignatures[0].path}`;
|
|
|
+ if (item.personBiosignatures) {
|
|
|
+ item.personBiosignatures[0].path = `${this.ip}/video/picture/get?path=${item.personBiosignatures[0].path}`;
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -330,9 +346,47 @@ export default {
|
|
|
this.dialogVisible = true;
|
|
|
this.imgUrl = url;
|
|
|
},
|
|
|
+ // 人员列表选中 selection
|
|
|
+ handleSelectionChange(rows) {
|
|
|
+ this.rows = [];
|
|
|
+ rows.forEach((row) => {
|
|
|
+ this.rows.push(row.id);
|
|
|
+ });
|
|
|
+ },
|
|
|
// 档案管理 - 删除
|
|
|
handleDelete(row) {
|
|
|
- console.log(row);
|
|
|
+ let ids = [];
|
|
|
+ if (row.id) {
|
|
|
+ ids.push(row.id);
|
|
|
+ } else {
|
|
|
+ ids = this.rows;
|
|
|
+ }
|
|
|
+ this.$confirm("确定删除该人员?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ }).then(async () => {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: "加载中...",
|
|
|
+ spinner: "el-icon-loading",
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
+ });
|
|
|
+ const res = await delPerson({ ids });
|
|
|
+ loading.close();
|
|
|
+ this.reflash();
|
|
|
+ if (res.code === 10000) {
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 新增 or 编辑
|
|
|
+ handleAddOrEdit(row) {
|
|
|
+ this.$refs["addOrEdit"].init(row);
|
|
|
+ },
|
|
|
+ // 刷新
|
|
|
+ reflash() {
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.initPersonFiles();
|
|
|
},
|
|
|
},
|
|
|
};
|