考勤数据增加工区管理
parent
bb90fd9add
commit
ad5b939bf3
|
|
@ -0,0 +1,8 @@
|
||||||
|
增加表
|
||||||
|
sys_work_area
|
||||||
|
|
||||||
|
修改表
|
||||||
|
pro_mobile_attendance_data 增加 work_area_id 工区id
|
||||||
|
attendance_ubi_data 增加 work_area_id 工区id
|
||||||
|
attendance_ubi_device 增加 work_area_id 工区id
|
||||||
|
pro_video_monitor 增加 work_area_id 工区id
|
||||||
|
|
@ -14,10 +14,9 @@
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/sichuanTibet.css?v=2024103201" />
|
<link rel="stylesheet" href="css/sichuanTibet.css?v=2024103201" />
|
||||||
|
|
||||||
<script
|
<script
|
||||||
type="text/javascript"
|
type="text/javascript"
|
||||||
src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak=eseRcUMFiUlnWA6miQLejNpvS70H8SRN"
|
src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=nDcjhjtaNwnVrKNIDbjibTm6i4u0k0fk"></script>
|
||||||
></script>
|
|
||||||
<script src="/cdn/vue/dist/vue.js"></script>
|
<script src="/cdn/vue/dist/vue.js"></script>
|
||||||
<script src="/cdn/element-ui/lib/index.js"></script>
|
<script src="/cdn/element-ui/lib/index.js"></script>
|
||||||
<script src="/cdn/jquery/3.5.1/jquery.min.js"></script>
|
<script src="/cdn/jquery/3.5.1/jquery.min.js"></script>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,16 @@ const listVideoMonitor = (query) => {
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const workAreaTree = (projectId) => {
|
||||||
|
return request({
|
||||||
|
url: '/system/workAarea/workAreaTree?projectId=' + projectId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
listVideoMonitor,
|
listVideoMonitor,
|
||||||
getYsToken
|
getYsToken,
|
||||||
|
workAreaTree
|
||||||
}
|
}
|
||||||
|
|
@ -6,12 +6,23 @@
|
||||||
<img src="/cdn/bsimages/nodata.png" style="width: 240px;" />
|
<img src="/cdn/bsimages/nodata.png" style="width: 240px;" />
|
||||||
<div style="text-align: center;">暂无数据</div>
|
<div style="text-align: center;">暂无数据</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="video-list">
|
<div class="video-list" v-else-if="!showTree">
|
||||||
<div v-for="it in videoMonitors" :key="it.id" class="video-item command" :class="it.active ? 'is-active' : ''" @click="doSelectItem(it)">
|
<div v-for="it in videoMonitors" :key="it.id" class="video-item command" :class="it.active ? 'is-active' : ''" @click="doSelectItem(it)">
|
||||||
<svg-icon class-name="video-icon" icon-class="video" />
|
<svg-icon class-name="video-icon" icon-class="video" />
|
||||||
{{ it.monitorName }}
|
{{ it.monitorName }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else class="video-tree">
|
||||||
|
<el-tree ref="treeRef" :data="treeData" :props="{ label: 'label', children: 'children' }"
|
||||||
|
highlight-current node-key="id" @node-click="handleTreeNodeClick">
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span v-if="data.vdata" class="tree-node-content">
|
||||||
|
<svg-icon class-name="video-icon" icon-class="video" />{{ node.label }}
|
||||||
|
</span>
|
||||||
|
<span v-else class="tree-node-content">{{ node.label }}</span>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
</module-one-1-3>
|
</module-one-1-3>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="20" class="h100">
|
<el-col :span="20" class="h100">
|
||||||
|
|
@ -62,6 +73,9 @@ export default {
|
||||||
showIndex: 1,
|
showIndex: 1,
|
||||||
showList: [],
|
showList: [],
|
||||||
elKey: 0,
|
elKey: 0,
|
||||||
|
showTree: false,
|
||||||
|
treeData: [],
|
||||||
|
workAreaOptions: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -106,12 +120,177 @@ export default {
|
||||||
return it
|
return it
|
||||||
})
|
})
|
||||||
this.showAllVideo()
|
this.showAllVideo()
|
||||||
|
this.getWorkAreaTree()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** 查询工区树结构 */
|
||||||
|
getWorkAreaTree() {
|
||||||
|
this.$api.videoMonitor.workAreaTree(this.selProject.id).then(response => {
|
||||||
|
// 转换数据格式以适配el-tree-select组件
|
||||||
|
this.workAreaOptions = response.data || [];
|
||||||
|
if (this.videoMonitors.filter(d => d.workAreaId).length > 0) {
|
||||||
|
// 调用makeTree函数将videoMonitors挂接到工作区树中
|
||||||
|
this.treeData = this.makeTree();
|
||||||
|
if (this.treeData.length > 0) {
|
||||||
|
this.showTree = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.handleTreeNodeClick(this.treeData[0]);
|
||||||
|
// 使用ref设置当前选中节点,使默认选中显示样式
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.treeRef) {
|
||||||
|
this.$refs.treeRef.setCurrentKey(this.treeData[0].id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 400);
|
||||||
|
} else {
|
||||||
|
this.showTree = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.treeData = [];
|
||||||
|
this.showTree = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
makeTree() {
|
||||||
|
const videoMonitorMap = {};
|
||||||
|
let defNode = {
|
||||||
|
id: '',
|
||||||
|
label: '默认工区',
|
||||||
|
type: 'workArea',
|
||||||
|
children: []
|
||||||
|
}
|
||||||
|
this.videoMonitors.forEach(video => {
|
||||||
|
if (video.workAreaId) {
|
||||||
|
if (!videoMonitorMap[video.workAreaId]) {
|
||||||
|
videoMonitorMap[video.workAreaId] = [];
|
||||||
|
}
|
||||||
|
videoMonitorMap[video.workAreaId].push(video);
|
||||||
|
} else {
|
||||||
|
defNode.children.push({
|
||||||
|
id: video.id,
|
||||||
|
label: video.monitorName,
|
||||||
|
vdata: video,
|
||||||
|
type: 'workArea',
|
||||||
|
children: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 第一阶段:递归函数,处理树形结构并添加videoMonitors到所有对应节点
|
||||||
|
function attachVideoMonitors(nodes) {
|
||||||
|
if (!nodes || !Array.isArray(nodes)) return [];
|
||||||
|
|
||||||
|
return nodes.map(node => {
|
||||||
|
// 深拷贝节点
|
||||||
|
const newNode = JSON.parse(JSON.stringify(node));
|
||||||
|
|
||||||
|
// 添加videoMonitors作为子节点(如果有)
|
||||||
|
if (videoMonitorMap[node.id] && videoMonitorMap[node.id].length > 0) {
|
||||||
|
if (!newNode.children) {
|
||||||
|
newNode.children = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将videoMonitors添加为子节点
|
||||||
|
videoMonitorMap[node.id].forEach(video => {
|
||||||
|
newNode.children.push({
|
||||||
|
id: video.id,
|
||||||
|
label: video.monitorName,
|
||||||
|
type: 'workArea',
|
||||||
|
vdata: video,
|
||||||
|
children: []
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 递归处理子节点
|
||||||
|
if (newNode.children && newNode.children.length > 0) {
|
||||||
|
newNode.children = attachVideoMonitors(newNode.children);
|
||||||
|
}
|
||||||
|
|
||||||
|
return newNode;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 第二阶段:递归删除不包含videoMonitors的节点(treeNode的type为workArea)
|
||||||
|
function pruneEmptyNodes(nodes) {
|
||||||
|
if (!nodes || !Array.isArray(nodes)) return [];
|
||||||
|
|
||||||
|
const result = [];
|
||||||
|
|
||||||
|
for (const node of nodes) {
|
||||||
|
// 复制节点
|
||||||
|
const newNode = { ...node };
|
||||||
|
|
||||||
|
// 检查节点是否直接包含videoMonitors(通过查看是否有带vdata属性的子节点)
|
||||||
|
const hasDirectVideoMonitors = node.children && node.children.some(child => child.vdata && child.type === 'workArea');
|
||||||
|
|
||||||
|
// 递归处理子节点
|
||||||
|
if (node.children && node.children.length > 0) {
|
||||||
|
newNode.children = pruneEmptyNodes(node.children);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断节点是否应该保留:
|
||||||
|
// 1. 有直接的videoMonitors子节点,或者
|
||||||
|
// 2. 有保留下来的子节点(这些子节点可能包含videoMonitors)
|
||||||
|
if (hasDirectVideoMonitors || (newNode.children && newNode.children.length > 0) || newNode.type === 'workArea') {
|
||||||
|
result.push(newNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行两阶段处理
|
||||||
|
const workAreaOptionsCopy = JSON.parse(JSON.stringify(this.workAreaOptions));
|
||||||
|
|
||||||
|
const treeWithVideos = attachVideoMonitors(workAreaOptionsCopy);
|
||||||
|
const prunedTree = pruneEmptyNodes(treeWithVideos);
|
||||||
|
|
||||||
|
// 如果默认工区有视频,也添加到结果中
|
||||||
|
if (defNode.children && defNode.children.length > 0) {
|
||||||
|
return [defNode, ...prunedTree];
|
||||||
|
}
|
||||||
|
|
||||||
|
return prunedTree;
|
||||||
|
},
|
||||||
|
|
||||||
|
handleTreeNodeClick(node) {
|
||||||
|
// 如果点击的是视频监控节点(包含vdata属性),则选中该视频
|
||||||
|
if (node.vdata) {
|
||||||
|
this.doSelectItem(node.vdata, true);
|
||||||
|
} else {
|
||||||
|
//递归获取这个节点的所有视频子节点显示
|
||||||
|
let videoNodes = [];
|
||||||
|
function getVideoNodes(nodes) {
|
||||||
|
if (!nodes || !Array.isArray(nodes)) return [];
|
||||||
|
nodes.forEach(node => {
|
||||||
|
if (node.vdata) {
|
||||||
|
videoNodes.push(node);
|
||||||
|
}
|
||||||
|
if (node.children && node.children.length > 0) {
|
||||||
|
getVideoNodes(node.children);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getVideoNodes(node.children);
|
||||||
|
let videoList = videoNodes.map(d => d.vdata);
|
||||||
|
this.videoMonitors = videoList;
|
||||||
|
if (videoList.length > 1) {
|
||||||
|
this.showMode = 'all';
|
||||||
|
this.showAllData();
|
||||||
|
} else {
|
||||||
|
this.showMode = 'sigle';
|
||||||
|
this.doSelectItem(videoList[0], true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
loadVideo(it) {
|
loadVideo(it) {
|
||||||
this.$api.videoMonitor.getYsToken(it.id).then((d) => {
|
this.$api.videoMonitor.getYsToken(it.id).then((d) => {
|
||||||
it.accessToken = d.msg
|
it.accessToken = d.msg
|
||||||
it.iframeSrc =
|
it.iframeSrc =
|
||||||
'https://open.ys7.com/ezopen/h5/iframe?url=' + it.url + '&autoplay=1&accessToken=' + d.msg + '&t=' + +new Date()
|
'https://open.ys7.com/ezopen/h5/iframe?url=' + it.url + '&autoplay=1&accessToken=' + d.msg + '&t=' + +new Date()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -120,8 +299,8 @@ export default {
|
||||||
this.showIndex = 1
|
this.showIndex = 1
|
||||||
this.showAllData()
|
this.showAllData()
|
||||||
},
|
},
|
||||||
doSelectItem(it) {
|
doSelectItem(it, reLoad = false) {
|
||||||
if (it.active) {
|
if (it.active && !reLoad) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.showMode = 'sigle'
|
this.showMode = 'sigle'
|
||||||
|
|
@ -173,6 +352,147 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.video-tree {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 16px; /* 增大字体大小 */
|
||||||
|
.el-tree{
|
||||||
|
background: transparent;
|
||||||
|
color:#fff;
|
||||||
|
}
|
||||||
|
.tree-node-content {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
padding: 4px 4px; /* 增大内边距 */
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
line-height: 20px; /* 增大行高 */
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-tree-node__content{
|
||||||
|
&:hover{
|
||||||
|
background-color: rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node:focus > .el-tree-node__content {
|
||||||
|
background-color: rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
|
||||||
|
background-color: rgba(4, 148, 238, 0.787);
|
||||||
|
color: white;
|
||||||
|
font-size: 16px; /* 保持选中状态的字体大小 */
|
||||||
|
padding: 4px 4px; /* 保持选中状态的内边距 */
|
||||||
|
|
||||||
|
.el-tree-node__expand-icon,
|
||||||
|
.el-icon-arrow-right,
|
||||||
|
.el-icon-arrow-down {
|
||||||
|
color: white;
|
||||||
|
font-size: 16px; /* 增大箭头图标大小 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 覆盖默认的el-tree样式以适应大屏 */
|
||||||
|
.el-tree-node__content {
|
||||||
|
padding: 4px 4px; /* 增大节点内容的内边距 */
|
||||||
|
height: auto; /* 允许内容高度自适应 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__expand-icon {
|
||||||
|
font-size: 16px; /* 增大展开/折叠图标大小 */
|
||||||
|
width: 24px; /* 增大图标容器宽度 */
|
||||||
|
height: 24px; /* 增大图标容器高度 */
|
||||||
|
line-height: 20px; /* 调整图标行高 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__label {
|
||||||
|
font-size: 16px; /* 确保标签字体大小一致 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 针对大屏分辨率的额外调整 */
|
||||||
|
@media (min-width: 1921px) and (max-width: 2560px) {
|
||||||
|
.video-tree {
|
||||||
|
font-size: 18px; /* 更大屏显时的字体 */
|
||||||
|
|
||||||
|
.tree-node-content {
|
||||||
|
padding: 8px 4px; /* 更大的内边距 */
|
||||||
|
line-height: 32px; /* 更大的行高 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
|
||||||
|
font-size: 18px;
|
||||||
|
padding: 8px 4px;
|
||||||
|
|
||||||
|
.el-tree-node__expand-icon,
|
||||||
|
.el-icon-arrow-right,
|
||||||
|
.el-icon-arrow-down {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__content {
|
||||||
|
padding: 8px 4px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__expand-icon {
|
||||||
|
font-size: 18px;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__label {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 针对大屏分辨率的额外调整 */
|
||||||
|
@media (min-width: 2561px) {
|
||||||
|
.video-tree {
|
||||||
|
font-size: 24px; /* 更大屏显时的字体 */
|
||||||
|
|
||||||
|
.tree-node-content {
|
||||||
|
padding: 8px 4px; /* 更大的内边距 */
|
||||||
|
line-height: 32px; /* 更大的行高 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
|
||||||
|
font-size: 24px;
|
||||||
|
padding: 8px 4px;
|
||||||
|
|
||||||
|
.el-tree-node__expand-icon,
|
||||||
|
.el-icon-arrow-right,
|
||||||
|
.el-icon-arrow-down {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__content {
|
||||||
|
padding: 8px 4px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__expand-icon {
|
||||||
|
font-size: 24px;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__label {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.all-mode {
|
.all-mode {
|
||||||
.all-header {
|
.all-header {
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,16 @@ public class AttendanceUbiData extends BaseEntity
|
||||||
@Excel(name = "设备NO")
|
@Excel(name = "设备NO")
|
||||||
private String deviceNo;
|
private String deviceNo;
|
||||||
|
|
||||||
|
private Long workAreaId;
|
||||||
|
|
||||||
|
public Long getWorkAreaId() {
|
||||||
|
return workAreaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkAreaId(Long workAreaId) {
|
||||||
|
this.workAreaId = workAreaId;
|
||||||
|
}
|
||||||
|
|
||||||
/** $column.columnComment */
|
/** $column.columnComment */
|
||||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
private Long isDel;
|
private Long isDel;
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,10 @@ public class AttendanceUbiDevice extends BaseEntity
|
||||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
private Long isDel;
|
private Long isDel;
|
||||||
|
|
||||||
|
/** 工区ID */
|
||||||
|
@Excel(name = "工区ID")
|
||||||
|
private Long workAreaId;
|
||||||
|
|
||||||
private String compName;
|
private String compName;
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
|
@ -148,6 +152,7 @@ public class AttendanceUbiDevice extends BaseEntity
|
||||||
|
|
||||||
private String souceName;
|
private String souceName;
|
||||||
|
|
||||||
|
private String workAreaName; // 工区名称,用于显示
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|
@ -337,6 +342,24 @@ public class AttendanceUbiDevice extends BaseEntity
|
||||||
{
|
{
|
||||||
return isDel;
|
return isDel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setWorkAreaId(Long workAreaId)
|
||||||
|
{
|
||||||
|
this.workAreaId = workAreaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getWorkAreaId()
|
||||||
|
{
|
||||||
|
return workAreaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkAreaName() {
|
||||||
|
return workAreaName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkAreaName(String workAreaName) {
|
||||||
|
this.workAreaName = workAreaName;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,16 @@ public class ProMobileAttendanceData extends BaseEntity
|
||||||
@Excel(name = "考勤设备")
|
@Excel(name = "考勤设备")
|
||||||
private String attDevice;
|
private String attDevice;
|
||||||
|
|
||||||
|
private Long workAreaId;
|
||||||
|
|
||||||
|
public Long getWorkAreaId() {
|
||||||
|
return workAreaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkAreaId(Long workAreaId) {
|
||||||
|
this.workAreaId = workAreaId;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAttDevice() {
|
public String getAttDevice() {
|
||||||
return attDevice;
|
return attDevice;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,17 +33,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="eventGuid" column="eventGuid"/>
|
<result property="eventGuid" column="eventGuid"/>
|
||||||
<result property="inPhoto" column="inPhoto"/>
|
<result property="inPhoto" column="inPhoto"/>
|
||||||
<result property="outPhoto" column="outPhoto"/>
|
<result property="outPhoto" column="outPhoto"/>
|
||||||
|
<result property="workAreaId" column="work_area_id"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectAttendanceUbiDataVo">
|
<sql id="selectAttendanceUbiDataVo">
|
||||||
select id, comId, projectId, userId, userName, sub_dept_group, sub_dept_group_name, craft_type, craft_post,admitGuid,
|
select id, comId, projectId, userId, userName, sub_dept_group, sub_dept_group_name, craft_type, craft_post,admitGuid,
|
||||||
eventGuid,inPhoto,outPhoto,comName,projectName,sub_dept_id,sub_dept_name,
|
eventGuid,inPhoto,outPhoto,comName,projectName,sub_dept_id,sub_dept_name,work_area_id,
|
||||||
inTime, outTime, deviceNo, is_del, state, remark, create_by, create_time, update_by, update_time from attendance_ubi_data
|
inTime, outTime, deviceNo, is_del, state, remark, create_by, create_time, update_by, update_time from attendance_ubi_data
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="selectAttendanceUbiDataAllVo">
|
<sql id="selectAttendanceUbiDataAllVo">
|
||||||
select id, comId, projectId, userId, userName, sub_dept_group, sub_dept_group_name, craft_type, craft_post,admitGuid,
|
select id, comId, projectId, userId, userName, sub_dept_group, sub_dept_group_name, craft_type, craft_post,admitGuid,
|
||||||
eventGuid,inPhoto,outPhoto,inData,outData,comName,projectName,sub_dept_id,sub_dept_name,
|
eventGuid,inPhoto,outPhoto,inData,outData,comName,projectName,sub_dept_id,sub_dept_name,work_area_id,
|
||||||
inTime, outTime, deviceNo, is_del, state, remark, create_by, create_time, update_by, update_time from attendance_ubi_data
|
inTime, outTime, deviceNo, is_del, state, remark, create_by, create_time, update_by, update_time from attendance_ubi_data
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
@ -133,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="inData != null">inData,</if>
|
<if test="inData != null">inData,</if>
|
||||||
<if test="outTime != null">outTime,</if>
|
<if test="outTime != null">outTime,</if>
|
||||||
<if test="outData != null">outData,</if>
|
<if test="outData != null">outData,</if>
|
||||||
|
<if test="workAreaId!=null">work_area_id,</if>
|
||||||
<if test="deviceNo != null">deviceNo,</if>
|
<if test="deviceNo != null">deviceNo,</if>
|
||||||
<if test="isDel != null">is_del,</if>
|
<if test="isDel != null">is_del,</if>
|
||||||
<if test="subDeptId != null">sub_dept_id,</if>
|
<if test="subDeptId != null">sub_dept_id,</if>
|
||||||
|
|
@ -163,6 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="inData != null">#{inData},</if>
|
<if test="inData != null">#{inData},</if>
|
||||||
<if test="outTime != null">#{outTime},</if>
|
<if test="outTime != null">#{outTime},</if>
|
||||||
<if test="outData != null">#{outData},</if>
|
<if test="outData != null">#{outData},</if>
|
||||||
|
<if test="workAreaId!=null">#{workAreaId},</if>
|
||||||
<if test="deviceNo != null">#{deviceNo},</if>
|
<if test="deviceNo != null">#{deviceNo},</if>
|
||||||
<if test="isDel != null">#{isDel},</if>
|
<if test="isDel != null">#{isDel},</if>
|
||||||
<if test="subDeptId != null">#{subDeptId},</if>
|
<if test="subDeptId != null">#{subDeptId},</if>
|
||||||
|
|
|
||||||
|
|
@ -36,17 +36,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="compName" column="comp_name"/>
|
<result property="compName" column="comp_name"/>
|
||||||
<result property="projectName" column="project_name"/>
|
<result property="projectName" column="project_name"/>
|
||||||
<result property="souceName" column="souce_name"/>
|
<result property="souceName" column="souce_name"/>
|
||||||
|
<result property="workAreaId" column="work_area_id"/>
|
||||||
|
<result property="workAreaName" column="work_area_name"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectAttendanceUbiDeviceVo">
|
<sql id="selectAttendanceUbiDeviceVo">
|
||||||
select ud.id, ud.com_id, ud.project_id, ud.name, ud.tag, ud.scene_guid, ud.source, ud.device_no, ud.addition, ud.bind_default_scene, ud.force_empty_device,
|
select ud.id, ud.com_id, ud.project_id, ud.name, ud.tag, ud.scene_guid, ud.source, ud.device_no, ud.addition, ud.bind_default_scene, ud.force_empty_device,
|
||||||
ud.direction,ud.channel,
|
ud.direction,ud.channel,
|
||||||
|
ud.work_area_id,
|
||||||
ud.device_model, ud.device_state, ud.rec_type, ud.online_state, ud.version_no, ud.last_active_time, ud.has_register, ud.state, ud.remark, ud.is_del,
|
ud.device_model, ud.device_state, ud.rec_type, ud.online_state, ud.version_no, ud.last_active_time, ud.has_register, ud.state, ud.remark, ud.is_del,
|
||||||
ud.create_by, ud.create_time, ud.update_by, ud.update_time ,dp.`dept_name` comp_name,pp.`project_name`,dic.`dict_label` souce_name
|
ud.create_by, ud.create_time, ud.update_by, ud.update_time ,dp.`dept_name` comp_name,pp.`project_name`,dic.`dict_label` souce_name,wa.`title` work_area_name
|
||||||
from attendance_ubi_device ud
|
from attendance_ubi_device ud
|
||||||
left join sys_dept dp on ud.`com_id`=dp.`dept_id`
|
left join sys_dept dp on ud.`com_id`=dp.`dept_id`
|
||||||
left join pro_project_info pp on ud.`project_id`=pp.`id`
|
left join pro_project_info pp on ud.`project_id`=pp.`id`
|
||||||
left join sys_dict_data dic on ud.`source`=dic.`dict_value` and dic.`dict_type`='ubi_device_source'
|
left join sys_dict_data dic on ud.`source`=dic.`dict_value` and dic.`dict_type`='ubi_device_source'
|
||||||
|
left join sys_work_area wa on ud.`work_area_id`=wa.`id`
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectAttendanceUbiDeviceList" parameterType="AttendanceUbiDevice" resultMap="AttendanceUbiDeviceResult">
|
<select id="selectAttendanceUbiDeviceList" parameterType="AttendanceUbiDevice" resultMap="AttendanceUbiDeviceResult">
|
||||||
|
|
@ -107,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="hasRegister != null">has_register,</if>
|
<if test="hasRegister != null">has_register,</if>
|
||||||
<if test="state != null">state,</if>
|
<if test="state != null">state,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="workAreaId != null">work_area_id,</if>
|
||||||
<if test="isDel != null">is_del,</if>
|
<if test="isDel != null">is_del,</if>
|
||||||
<if test="direction != null">direction,</if>
|
<if test="direction != null">direction,</if>
|
||||||
<if test="channel != null">channel,</if>
|
<if test="channel != null">channel,</if>
|
||||||
|
|
@ -137,6 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="hasRegister != null">#{hasRegister},</if>
|
<if test="hasRegister != null">#{hasRegister},</if>
|
||||||
<if test="state != null">#{state},</if>
|
<if test="state != null">#{state},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="workAreaId != null">#{workAreaId},</if>
|
||||||
<if test="isDel != null">#{isDel},</if>
|
<if test="isDel != null">#{isDel},</if>
|
||||||
<if test="direction != null">#{direction},</if>
|
<if test="direction != null">#{direction},</if>
|
||||||
<if test="channel != null">#{channel},</if>
|
<if test="channel != null">#{channel},</if>
|
||||||
|
|
@ -170,6 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="hasRegister != null">has_register = #{hasRegister},</if>
|
<if test="hasRegister != null">has_register = #{hasRegister},</if>
|
||||||
<if test="state != null">state = #{state},</if>
|
<if test="state != null">state = #{state},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="workAreaId != null">work_area_id = #{workAreaId},</if>
|
||||||
<if test="isDel != null">is_del = #{isDel},</if>
|
<if test="isDel != null">is_del = #{isDel},</if>
|
||||||
<if test="direction != null">direction = #{direction},</if>
|
<if test="direction != null">direction = #{direction},</if>
|
||||||
<if test="channel != null">channel = #{channel},</if>
|
<if test="channel != null">channel = #{channel},</if>
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="userPost" column="user_post" />
|
<result property="userPost" column="user_post" />
|
||||||
<result property="userSex" column="user_sex" />
|
<result property="userSex" column="user_sex" />
|
||||||
<result property="attDevice" column="att_device" />
|
<result property="attDevice" column="att_device" />
|
||||||
|
<result property="workAreaId" column="wa.work_area_id"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectProMobileAttendanceDataVo">
|
<sql id="selectProMobileAttendanceDataVo">
|
||||||
|
|
@ -87,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="attDate != null">att_date,</if>
|
<if test="attDate != null">att_date,</if>
|
||||||
<if test="attImg != null">att_img,</if>
|
<if test="attImg != null">att_img,</if>
|
||||||
<if test="attDevice != null">att_device,</if>
|
<if test="attDevice != null">att_device,</if>
|
||||||
|
<if test="workAreaId != null">work_area_id,</if>
|
||||||
<if test="isDel != null">is_del,</if>
|
<if test="isDel != null">is_del,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
<if test="state != null">state,</if>
|
<if test="state != null">state,</if>
|
||||||
|
|
@ -106,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="attImg != null">#{attImg},</if>
|
<if test="attImg != null">#{attImg},</if>
|
||||||
<if test="attDevice != null">#{attDevice},</if>
|
<if test="attDevice != null">#{attDevice},</if>
|
||||||
<if test="isDel != null">#{isDel},</if>
|
<if test="isDel != null">#{isDel},</if>
|
||||||
|
<if test="workAreaId != null">#{workAreaId},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
<if test="state != null">#{state},</if>
|
<if test="state != null">#{state},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
|
|
||||||
|
|
@ -147,10 +147,12 @@ public class UniCallBackController {
|
||||||
addData.setSubDeptGroupName(proUser.getSubDeptGroupName());
|
addData.setSubDeptGroupName(proUser.getSubDeptGroupName());
|
||||||
addData.setCraftPost(proUser.getCraftPost());
|
addData.setCraftPost(proUser.getCraftPost());
|
||||||
addData.setCraftType(proUser.getCraftType());
|
addData.setCraftType(proUser.getCraftType());
|
||||||
|
addData.setWorkAreaId(device.getWorkAreaId());
|
||||||
attendanceData.setUserId(proUser.getUserId());
|
attendanceData.setUserId(proUser.getUserId());
|
||||||
attendanceData.setProjectId(projectId);
|
attendanceData.setProjectId(projectId);
|
||||||
attendanceData.setAttDate(showTime);
|
attendanceData.setAttDate(showTime);
|
||||||
attendanceData.setAttImg(filePath);
|
attendanceData.setAttImg(filePath);
|
||||||
|
attendanceData.setWorkAreaId(device.getWorkAreaId());
|
||||||
if(device.getDirection()==0) {
|
if(device.getDirection()==0) {
|
||||||
addData.setInTime(showTime);
|
addData.setInTime(showTime);
|
||||||
addData.setInData(data);
|
addData.setInData(data);
|
||||||
|
|
@ -171,12 +173,14 @@ public class UniCallBackController {
|
||||||
}else{
|
}else{
|
||||||
//修改操作
|
//修改操作
|
||||||
AttendanceUbiData upData= list.get(0);
|
AttendanceUbiData upData= list.get(0);
|
||||||
|
upData.setWorkAreaId(device.getWorkAreaId());
|
||||||
if(upData.getEventGuid().equals(eventGuid)){
|
if(upData.getEventGuid().equals(eventGuid)){
|
||||||
return AjaxResult.error("此记录已入库!");
|
return AjaxResult.error("此记录已入库!");
|
||||||
}
|
}
|
||||||
Date dt1=upData.getInTime();
|
Date dt1=upData.getInTime();
|
||||||
Date dt2=upData.getOutTime();
|
Date dt2=upData.getOutTime();
|
||||||
attendanceData.setUserId(upData.getUserId());
|
attendanceData.setUserId(upData.getUserId());
|
||||||
|
attendanceData.setWorkAreaId(device.getWorkAreaId());
|
||||||
attendanceData.setProjectId(projectId);
|
attendanceData.setProjectId(projectId);
|
||||||
attendanceData.setAttDate(showTime);
|
attendanceData.setAttDate(showTime);
|
||||||
attendanceData.setAttImg(filePath);
|
attendanceData.setAttImg(filePath);
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,10 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px">
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px">
|
||||||
<el-form-item label="项目" prop="projectId">
|
<el-form-item label="项目" prop="projectId">
|
||||||
<el-select :disabled="data.currentPrjId != ''" v-model="queryParams.projectId" placeholder="请选择项目" clearable @change="handleQuery">
|
<el-select :disabled="data.currentPrjId != ''" v-model="queryParams.projectId" placeholder="请选择项目"
|
||||||
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id"></el-option>
|
clearable @change="handleQuery">
|
||||||
|
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName"
|
||||||
|
:value="prj.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备名称" prop="name">
|
<el-form-item label="设备名称" prop="name">
|
||||||
|
|
@ -23,16 +25,20 @@
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['manage:attendance_ubi_device:add']">新增</el-button>
|
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||||
|
v-hasPermi="['manage:attendance_ubi_device:add']">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||||
|
v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['manage:attendance_ubi_device:remove']">删除</el-button>
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||||
|
v-hasPermi="['manage:attendance_ubi_device:remove']">删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['manage:attendance_ubi_device:export']">导出</el-button>
|
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||||
|
v-hasPermi="['manage:attendance_ubi_device:export']">导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -40,6 +46,7 @@
|
||||||
<el-table v-loading="loading" :data="attendance_ubi_deviceList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="attendance_ubi_deviceList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column label="公司" align="center" prop="compName" />
|
<el-table-column label="公司" align="center" prop="compName" />
|
||||||
<el-table-column label="所属项目" align="center" prop="projectName" />
|
<el-table-column label="所属项目" align="center" prop="projectName" />
|
||||||
|
<el-table-column label="所属工区" align="center" prop="workAreaName" />
|
||||||
<el-table-column label="设备名称" align="center" prop="name" />
|
<el-table-column label="设备名称" align="center" prop="name" />
|
||||||
<el-table-column label="设备标签" align="center" prop="tag" />
|
<el-table-column label="设备标签" align="center" prop="tag" />
|
||||||
<el-table-column label="设备来源" align="center" prop="souceName" />
|
<el-table-column label="设备来源" align="center" prop="souceName" />
|
||||||
|
|
@ -47,21 +54,21 @@
|
||||||
<el-table-column label="设备模式" align="center" prop="deviceModel" v-if="false" />
|
<el-table-column label="设备模式" align="center" prop="deviceModel" v-if="false" />
|
||||||
<el-table-column label="设备状态" align="center" prop="deviceState">
|
<el-table-column label="设备状态" align="center" prop="deviceState">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.deviceState==1">未绑定</span>
|
<span v-if="scope.row.deviceState == 1">未绑定</span>
|
||||||
<span v-if="scope.row.deviceState==2">已绑定</span>
|
<span v-if="scope.row.deviceState == 2">已绑定</span>
|
||||||
<span v-if="scope.row.deviceState==3">已禁用</span>
|
<span v-if="scope.row.deviceState == 3">已禁用</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="比对模式" align="center" prop="recType">
|
<el-table-column label="比对模式" align="center" prop="recType">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.recType==1">本地识别</span>
|
<span v-if="scope.row.recType == 1">本地识别</span>
|
||||||
<span v-if="scope.row.recType==2">云端识别</span>
|
<span v-if="scope.row.recType == 2">云端识别</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="在线状态" align="center" prop="onlineState">
|
<el-table-column label="在线状态" align="center" prop="onlineState">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.onlineState==1">在线</span>
|
<span v-if="scope.row.onlineState == 1">在线</span>
|
||||||
<span v-if="scope.row.onlineState==2">离线</span>
|
<span v-if="scope.row.onlineState == 2">离线</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="版本号" align="center" prop="versionNo" />
|
<el-table-column label="版本号" align="center" prop="versionNo" />
|
||||||
|
|
@ -72,23 +79,28 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="注册状态" align="center" prop="hasRegister">
|
<el-table-column label="注册状态" align="center" prop="hasRegister">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.onlineState==1">已注册</span>
|
<span v-if="scope.row.onlineState == 1">已注册</span>
|
||||||
<span v-else>未注册</span>
|
<span v-else>未注册</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="ChromeFilled" @click="handleAuth(scope.row)" v-hasPermi="['manage:attendance_ubi_device:edit']">同步</el-button>
|
<el-button link type="primary" icon="ChromeFilled" @click="handleAuth(scope.row)"
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
v-hasPermi="['manage:attendance_ubi_device:edit']">同步</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:attendance_ubi_device:remove']">删除</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
||||||
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['manage:attendance_ubi_device:remove']">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
<!-- 添加或修改宇泛的设备信息对话框 -->
|
<!-- 添加或修改宇泛的设备信息对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body :close-on-click-modal="false" :close-on-press-escape="false">
|
<el-dialog :title="title" v-model="open" width="600px" append-to-body :close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false" class="dlg-hide-form-hidden-scroll">
|
||||||
<el-form ref="attendance_ubi_deviceRef" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="attendance_ubi_deviceRef" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-form-item label="所属项目">
|
<el-form-item label="所属项目">
|
||||||
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
||||||
|
|
@ -101,19 +113,25 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备来源" prop="source">
|
<el-form-item label="设备来源" prop="source">
|
||||||
<el-select v-model="form.source" placeholder="请选择设备来源" clearable>
|
<el-select v-model="form.source" placeholder="请选择设备来源" clearable>
|
||||||
<el-option v-for="dict in ubi_device_source" :key="dict.value" :label="dict.label" :value="dict.value" />
|
<el-option v-for="dict in ubi_device_source" :key="dict.value" :label="dict.label"
|
||||||
|
:value="dict.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备序列号" prop="deviceNo">
|
<el-form-item label="设备序列号" prop="deviceNo">
|
||||||
<el-input v-model="form.deviceNo" placeholder="请输入设备序列号" />
|
<el-input v-model="form.deviceNo" placeholder="请输入设备序列号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="所属工区" prop="workAreaId">
|
||||||
|
<el-tree-select v-model="form.workAreaId" :data="data.workAreaOptions"
|
||||||
|
:props="{ value: 'id', label: 'title', children: 'children' }" value-key="id"
|
||||||
|
placeholder="请选择工区" clearable style="width:300px;" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm" :loading="data.submitLoading">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -132,10 +150,12 @@ import {
|
||||||
} from '@/api/manage/attendanceubidevice'
|
} from '@/api/manage/attendanceubidevice'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { findMyProjectList } from '@/api/publics'
|
import { findMyProjectList } from '@/api/publics'
|
||||||
|
import { workAreaTree } from '@/api/system/workAarea'
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { ubi_device_source } = proxy.useDict('ubi_device_source')
|
const { ubi_device_source } = proxy.useDict('ubi_device_source')
|
||||||
const attendance_ubi_deviceList = ref([])
|
const attendance_ubi_deviceList = ref([])
|
||||||
|
const workAreaList = ref([])
|
||||||
const open = ref(false)
|
const open = ref(false)
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
const showSearch = ref(true)
|
const showSearch = ref(true)
|
||||||
|
|
@ -176,10 +196,13 @@ const data = reactive({
|
||||||
tag: [{ required: true, trigger: ['blur', 'change'], message: '请输入设备标签' }],
|
tag: [{ required: true, trigger: ['blur', 'change'], message: '请输入设备标签' }],
|
||||||
source: [{ required: true, trigger: ['blur', 'change'], message: '请选择设备来源' }],
|
source: [{ required: true, trigger: ['blur', 'change'], message: '请选择设备来源' }],
|
||||||
deviceNo: [{ required: true, trigger: ['blur', 'change'], message: '请输入设备序列号' }],
|
deviceNo: [{ required: true, trigger: ['blur', 'change'], message: '请输入设备序列号' }],
|
||||||
|
workAreaId: [{ required: false, trigger: 'blur', message: '请选择所属工区' }],
|
||||||
},
|
},
|
||||||
projects: [],
|
projects: [],
|
||||||
currentPrjId: '',
|
currentPrjId: '',
|
||||||
mode: '',
|
mode: '',
|
||||||
|
workAreaOptions: [],
|
||||||
|
submitLoading: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data)
|
const { queryParams, form, rules } = toRefs(data)
|
||||||
|
|
@ -248,6 +271,7 @@ function reset() {
|
||||||
state: null,
|
state: null,
|
||||||
remark: null,
|
remark: null,
|
||||||
isDel: null,
|
isDel: null,
|
||||||
|
workAreaId: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
|
|
@ -309,17 +333,22 @@ function submitForm() {
|
||||||
proxy.$refs['attendance_ubi_deviceRef'].validate((valid) => {
|
proxy.$refs['attendance_ubi_deviceRef'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
form.value.comId = userStore.currentComId
|
form.value.comId = userStore.currentComId
|
||||||
|
data.submitLoading = true
|
||||||
if (form.value.id != null) {
|
if (form.value.id != null) {
|
||||||
updateAttendance_ubi_device(form.value).then((response) => {
|
updateAttendance_ubi_device(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess('修改成功')
|
proxy.$modal.msgSuccess('修改成功')
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
|
}).finally(() => {
|
||||||
|
data.submitLoading = false
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
addAttendance_ubi_device(form.value).then((response) => {
|
addAttendance_ubi_device(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess('新增成功')
|
proxy.$modal.msgSuccess('新增成功')
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
|
}).finally(() => {
|
||||||
|
data.submitLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -338,7 +367,7 @@ function handleDelete(row) {
|
||||||
getList()
|
getList()
|
||||||
proxy.$modal.msgSuccess('删除成功')
|
proxy.$modal.msgSuccess('删除成功')
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => { })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
|
|
@ -351,7 +380,37 @@ function handleExport() {
|
||||||
`attendance_ubi_device_${new Date().getTime()}.xlsx`
|
`attendance_ubi_device_${new Date().getTime()}.xlsx`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
/** 查询工区树结构 */
|
||||||
|
function getWorkAreaTree() {
|
||||||
|
workAreaTree(userStore.currentPrjId).then(response => {
|
||||||
|
// 转换数据格式以适配el-tree-select组件
|
||||||
|
data.workAreaOptions = transformTreeData(response.data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 转换树形数据格式 */
|
||||||
|
function transformTreeData(apiData) {
|
||||||
|
if (!apiData || !Array.isArray(apiData)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return apiData.map(item => {
|
||||||
|
// 先展开item.data,再设置children,避免被覆盖
|
||||||
|
const transformedItem = {
|
||||||
|
id: item.id,
|
||||||
|
title: item.label, // 使用label作为显示文本
|
||||||
|
ancestors: item.data?.ancestors, // 从data字段中获取ancestors
|
||||||
|
// 保留原始数据以备后用
|
||||||
|
...item.data
|
||||||
|
};
|
||||||
|
|
||||||
|
// 确保children使用正确转换后的数据
|
||||||
|
transformedItem.children = item.children ? transformTreeData(item.children) : [];
|
||||||
|
|
||||||
|
return transformedItem;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getList()
|
getList()
|
||||||
getProjectList()
|
getProjectList()
|
||||||
|
getWorkAreaTree()
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -8,28 +8,30 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="attendance_ubi_deviceList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="attendance_ubi_deviceList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="index" width="50" label="序号"/>
|
<el-table-column type="index" width="50" label="序号" />
|
||||||
<el-table-column label="公司" align="center" prop="compName" v-if="1==2"/>
|
<el-table-column label="公司" align="center" prop="compName" v-if="1 == 2" />
|
||||||
<el-table-column label="所属项目" align="center" prop="projectName" />
|
<el-table-column label="所属项目" align="center" prop="projectName" />
|
||||||
|
<el-table-column label="所属工区" align="center" prop="workAreaName" />
|
||||||
<el-table-column label="设备序列号" align="center" prop="deviceNo">
|
<el-table-column label="设备序列号" align="center" prop="deviceNo">
|
||||||
<template #default="scope"><span style="color: var(--el-color-warning);">{{scope.row.deviceNo}}</span></template>
|
<template #default="scope"><span style="color: var(--el-color-warning);">{{ scope.row.deviceNo
|
||||||
|
}}</span></template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="通道编号" align="center" prop="channel" />
|
<el-table-column label="通道编号" align="center" prop="channel" />
|
||||||
<el-table-column label="方向" align="center" prop="direction">
|
<el-table-column label="方向" align="center" prop="direction">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.direction==0?'进':'出' }}
|
{{ scope.row.direction == 0 ? '进' : '出' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="用途" align="center" prop="tag" />
|
<el-table-column label="用途" align="center" prop="tag" />
|
||||||
<el-table-column label="设备模式" align="center" prop="deviceModel" v-if="false" />
|
<el-table-column label="设备模式" align="center" prop="deviceModel" v-if="false" />
|
||||||
<el-table-column label="设备状态" align="center" prop="deviceState" v-if="false" >
|
<el-table-column label="设备状态" align="center" prop="deviceState" v-if="false">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.deviceState == 1">未绑定</span>
|
<span v-if="scope.row.deviceState == 1">未绑定</span>
|
||||||
<span v-if="scope.row.deviceState == 2">已绑定</span>
|
<span v-if="scope.row.deviceState == 2">已绑定</span>
|
||||||
<span v-if="scope.row.deviceState == 3">已禁用</span>
|
<span v-if="scope.row.deviceState == 3">已禁用</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="比对模式" align="center" prop="recType" v-if="false" >
|
<el-table-column label="比对模式" align="center" prop="recType" v-if="false">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.recType == 1">本地识别</span>
|
<span v-if="scope.row.recType == 1">本地识别</span>
|
||||||
<span v-if="scope.row.recType == 2">云端识别</span>
|
<span v-if="scope.row.recType == 2">云端识别</span>
|
||||||
|
|
@ -38,19 +40,23 @@
|
||||||
<el-table-column label="在线状态" align="center" prop="onlineState">
|
<el-table-column label="在线状态" align="center" prop="onlineState">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.onlineState == 1" style="color:green;">
|
<span v-if="scope.row.onlineState == 1" style="color:green;">
|
||||||
<el-icon style="vertical-align: middle;"><SuccessFilled /></el-icon>
|
<el-icon style="vertical-align: middle;">
|
||||||
|
<SuccessFilled />
|
||||||
|
</el-icon>
|
||||||
在线</span>
|
在线</span>
|
||||||
<span v-if="scope.row.onlineState == 2" style="color: red;">
|
<span v-if="scope.row.onlineState == 2" style="color: red;">
|
||||||
<el-icon style="vertical-align: middle;"><CircleCloseFilled /></el-icon>离线</span>
|
<el-icon style="vertical-align: middle;">
|
||||||
|
<CircleCloseFilled />
|
||||||
|
</el-icon>离线</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="版本号" align="center" prop="versionNo" v-if="false" />
|
<el-table-column label="版本号" align="center" prop="versionNo" v-if="false" />
|
||||||
<el-table-column label="最后激活时间" align="center" prop="lastActiveTime" width="180" v-if="false" >
|
<el-table-column label="最后激活时间" align="center" prop="lastActiveTime" width="180" v-if="false">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.lastActiveTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.lastActiveTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="注册状态" align="center" prop="hasRegister" v-if="false" >
|
<el-table-column label="注册状态" align="center" prop="hasRegister" v-if="false">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.onlineState == 1">已注册</span>
|
<span v-if="scope.row.onlineState == 1">已注册</span>
|
||||||
<span v-else>未注册</span>
|
<span v-else>未注册</span>
|
||||||
|
|
@ -58,7 +64,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="ChromeFilled" @click="handleAuth(scope.row)" v-if="1==2"
|
<el-button link type="primary" icon="ChromeFilled" @click="handleAuth(scope.row)" v-if="1 == 2"
|
||||||
v-hasPermi="['manage:attendance_ubi_device:edit']">同步</el-button>
|
v-hasPermi="['manage:attendance_ubi_device:edit']">同步</el-button>
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
||||||
|
|
@ -79,15 +85,14 @@
|
||||||
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备序列号" prop="deviceNo">
|
<el-form-item label="设备序列号" prop="deviceNo">
|
||||||
<el-input v-model="form.deviceNo" :disabled="data.mode=='edit'" placeholder="请输入设备序列号" />
|
<el-input v-model="form.deviceNo" :disabled="data.mode == 'edit'" placeholder="请输入设备序列号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通道编号" prop="channel">
|
<el-form-item label="通道编号" prop="channel">
|
||||||
<el-input v-model="form.channel" placeholder="请输入通道编号" />
|
<el-input v-model="form.channel" placeholder="请输入通道编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备用途" prop="tag">
|
<el-form-item label="设备用途" prop="tag">
|
||||||
<el-select v-model="form.tag" placeholder="请选择设备用途" clearable>
|
<el-select v-model="form.tag" placeholder="请选择设备用途" clearable>
|
||||||
<el-option v-for="(dict,idx) in ['考勤','培训']" :key="idx" :label="dict"
|
<el-option v-for="(dict, idx) in ['考勤', '培训']" :key="idx" :label="dict" :value="dict" />
|
||||||
:value="dict" />
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
@ -97,14 +102,20 @@
|
||||||
<el-radio :value="1" :label="1">出</el-radio>
|
<el-radio :value="1" :label="1">出</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="设备来源" prop="source" v-if="1==2">
|
<el-form-item label="设备来源" prop="source" v-if="1 == 2">
|
||||||
<el-select v-model="form.source" placeholder="请选择设备来源" clearable>
|
<el-select v-model="form.source" placeholder="请选择设备来源" clearable>
|
||||||
<el-option v-for="dict in ubi_device_source" :key="dict.value" :label="dict.label"
|
<el-option v-for="dict in ubi_device_source" :key="dict.value" :label="dict.label"
|
||||||
:value="dict.value" />
|
:value="dict.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="所属工区" prop="workAreaId" v-if="false">
|
||||||
|
<el-select v-model="form.workAreaId" placeholder="请选择工区" clearable>
|
||||||
|
<el-option v-for="workArea in workAreaList" :key="workArea.workAreaId"
|
||||||
|
:label="workArea.workAreaName" :value="workArea.workAreaId" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark" v-if="false">
|
<el-form-item label="备注" prop="remark" v-if="false">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -128,6 +139,7 @@ const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
const { ubi_device_source } = proxy.useDict('ubi_device_source');
|
const { ubi_device_source } = proxy.useDict('ubi_device_source');
|
||||||
const attendance_ubi_deviceList = ref([]);
|
const attendance_ubi_deviceList = ref([]);
|
||||||
|
const workAreaList = ref([]);
|
||||||
const open = ref(false);
|
const open = ref(false);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const ids = ref([]);
|
const ids = ref([]);
|
||||||
|
|
@ -140,7 +152,7 @@ const data = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
projectId: null,
|
projectId: null,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
|
@ -158,25 +170,25 @@ const data = reactive({
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
/*行进场,离场操作 */
|
/*行进场,离场操作 */
|
||||||
function handleEnter(row){
|
function handleEnter(row) {
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 设备人员同步
|
* 设备人员同步
|
||||||
*/
|
*/
|
||||||
function handleAuth(row){
|
function handleAuth(row) {
|
||||||
authAttendance_ubi_device(row).then(d=>{
|
authAttendance_ubi_device(row).then(d => {
|
||||||
if(d.code==200){
|
if (d.code == 200) {
|
||||||
proxy.$modal.msgSuccess("同步成功!");
|
proxy.$modal.msgSuccess("同步成功!");
|
||||||
}else{
|
} else {
|
||||||
proxy.$modal.msgError("同步失败!");
|
proxy.$modal.msgError("同步失败!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询宇泛的设备信息列表 */
|
/** 查询宇泛的设备信息列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
queryParams.value.projectId=data.row.projectId
|
queryParams.value.projectId = data.row.projectId
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listAttendance_ubi_device(queryParams.value).then(response => {
|
listAttendance_ubi_device(queryParams.value).then(response => {
|
||||||
attendance_ubi_deviceList.value = response.rows;
|
attendance_ubi_deviceList.value = response.rows;
|
||||||
|
|
@ -187,135 +199,138 @@ function getList() {
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
id: null,
|
id: null,
|
||||||
comId: null,
|
comId: null,
|
||||||
projectId: null,
|
projectId: null,
|
||||||
name: null,
|
name: null,
|
||||||
tag: '考勤',
|
tag: '考勤',
|
||||||
direction:0,
|
direction: 0,
|
||||||
channel:'',
|
channel: '',
|
||||||
sceneGuid: "",
|
sceneGuid: "",
|
||||||
source: null,
|
source: null,
|
||||||
deviceNo: null,
|
deviceNo: null,
|
||||||
addition: null,
|
addition: null,
|
||||||
bindDefaultScene: null,
|
bindDefaultScene: null,
|
||||||
forceEmptyDevice: null,
|
forceEmptyDevice: null,
|
||||||
password: null,
|
password: null,
|
||||||
deviceModel: null,
|
deviceModel: null,
|
||||||
deviceState: null,
|
deviceState: null,
|
||||||
recType: null,
|
recType: null,
|
||||||
onlineState: null,
|
onlineState: null,
|
||||||
versionNo: null,
|
versionNo: null,
|
||||||
lastActiveTime: null,
|
lastActiveTime: null,
|
||||||
hasRegister: null,
|
hasRegister: null,
|
||||||
state: null,
|
state: null,
|
||||||
remark: null,
|
remark: null,
|
||||||
isDel: null,
|
isDel: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null
|
updateTime: null,
|
||||||
};
|
workAreaId: null
|
||||||
proxy.resetForm("attendance_ubi_deviceRef");
|
};
|
||||||
|
proxy.resetForm("attendance_ubi_deviceRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.id);
|
ids.value = selection.map(item => item.id);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
data.mode="add"
|
data.mode = "add"
|
||||||
form.value.projectId = data.row.projectId;
|
form.value.projectId = data.row.projectId;
|
||||||
form.value.projectName = data.row.projectName;
|
form.value.projectName = data.row.projectName;
|
||||||
form.value.source=ubi_device_source.value[0].value;
|
form.value.source = ubi_device_source.value[0].value;
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加宇泛的设备信息";
|
title.value = "添加宇泛的设备信息";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
data.mode="edit"
|
data.mode = "edit"
|
||||||
const _id = row.id || ids.value
|
const _id = row.id || ids.value
|
||||||
getAttendance_ubi_device(_id).then(response => {
|
getAttendance_ubi_device(_id).then(response => {
|
||||||
form.value = response.data;
|
form.value = response.data;
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "修改宇泛的设备信息";
|
title.value = "修改宇泛的设备信息";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["attendance_ubi_deviceRef"].validate(valid => {
|
proxy.$refs["attendance_ubi_deviceRef"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
form.value.comId=data.row.comId;
|
form.value.comId = data.row.comId;
|
||||||
form.value.name=form.value.deviceNo;
|
form.value.name = form.value.deviceNo;
|
||||||
if (form.value.id != null) {
|
if (form.value.id != null) {
|
||||||
updateAttendance_ubi_device(form.value).then(response => {
|
updateAttendance_ubi_device(form.value).then(response => {
|
||||||
proxy.$modal.msgSuccess("修改成功");
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
open.value = false;
|
open.value = false;
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addAttendance_ubi_device(form.value).then(response => {
|
addAttendance_ubi_device(form.value).then(response => {
|
||||||
proxy.$modal.msgSuccess("新增成功");
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
open.value = false;
|
open.value = false;
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _ids = row.id || ids.value;
|
const _ids = row.id || ids.value;
|
||||||
proxy.$modal.confirm('是否确认删除宇泛的设备信息编号为"' + _ids + '"的数据项?').then(function () {
|
proxy.$modal.confirm('是否确认删除宇泛的设备信息编号为"' + _ids + '"的数据项?').then(function () {
|
||||||
return delAttendance_ubi_device(_ids);
|
return delAttendance_ubi_device(_ids);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
getList();
|
getList();
|
||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
function showDrawer(row) {
|
function showDrawer(row) {
|
||||||
data.row = row;
|
data.row = row;
|
||||||
data.show = true;
|
data.show = true;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
showDrawer
|
showDrawer
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.ubi-device-drawer{
|
.ubi-device-drawer {
|
||||||
.el-drawer__header{
|
.el-drawer__header {
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue