flx:优化

This commit is contained in:
Rain_ 2025-11-14 16:33:10 +08:00
parent e12415b77b
commit a2e603a931
4 changed files with 143 additions and 51 deletions

View File

@ -246,6 +246,12 @@ export default {
if (controls) { if (controls) {
controls.classList.remove("video-controls_flex"); controls.classList.remove("video-controls_flex");
} }
const findIndex = Array.from(wnd.childNodes).findIndex(
(item) => item.localName == "img" || item.className == "classImg"
);
if (findIndex !== -1) {
wnd.removeChild(wnd.childNodes[findIndex]);
}
} }
}); });
this.devH5List = []; this.devH5List = [];

View File

@ -807,7 +807,6 @@ const getSelectAllProjectInfoList = () => {
const onSelectProject = () => { const onSelectProject = () => {
workTicketInfo.pageNo = 1; workTicketInfo.pageNo = 1;
workTicketList.value = []; workTicketList.value = [];
getProjectVideoConfigList();
getWorkTicketPage(); getWorkTicketPage();
getWorkTicketCountWorkTicket(); getWorkTicketCountWorkTicket();
getWorkTicketTypeTreePage(); getWorkTicketTypeTreePage();
@ -818,7 +817,7 @@ const videoConfig = ref({
// //
const getProjectVideoConfigList = () => { const getProjectVideoConfigList = () => {
projectVideoConfigListApi({ projectVideoConfigListApi({
projectSn: workTicketInfo.projectSn, projectSn: workTicketDetail.value.projectSn,
}).then((res) => { }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.result) { if (res.result) {
@ -904,6 +903,7 @@ const timeInterval = ref(null);
const onViewDetail = (row, flag) => { const onViewDetail = (row, flag) => {
if (row.id == workTicketDetail.value.id && flag != true) return; if (row.id == workTicketDetail.value.id && flag != true) return;
workTicketDetail.value = row; workTicketDetail.value = row;
getProjectVideoConfigList();
getWorkTicketQueryById(); getWorkTicketQueryById();
getWorkTicketHistoryList(); getWorkTicketHistoryList();
initPoliceCameraItemList(); initPoliceCameraItemList();

View File

@ -33,15 +33,33 @@
<div class="bg-icon" @click="onRefresh"> <div class="bg-icon" @click="onRefresh">
<div class="refresh-icon"></div> <div class="refresh-icon"></div>
</div> </div>
<div class="bg-icon" @click="onExpand"> <div
<div class="shrink-icon"></div> class="bg-icon"
@click="onExpand"
>
<div class="shrink-icon" :class="{ 'shrink-icon_active': this.defaultExpand }"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="header-box1"> <div class="header-box1">
<div @click="onDeviceState(0)" :class="{'bg-active': searchInfo.deviceState == 0}">全部({{ filterTreeDataTotal(1) }})</div> <div
<div @click="onDeviceState(1)" :class="{'bg-active': searchInfo.deviceState == 1}">在线({{ filterTreeDataTotal(2) }})</div> @click="onDeviceState(0)"
<div @click="onDeviceState(2)" :class="{'bg-active': searchInfo.deviceState == 2}">离线({{ filterTreeDataTotal(3) }})</div> :class="{ 'bg-active': searchInfo.deviceState == 0 }"
>
全部({{ filterTreeDataTotal(1) }})
</div>
<div
@click="onDeviceState(1)"
:class="{ 'bg-active': searchInfo.deviceState == 1 }"
>
在线({{ filterTreeDataTotal(2) }})
</div>
<div
@click="onDeviceState(2)"
:class="{ 'bg-active': searchInfo.deviceState == 2 }"
>
离线({{ filterTreeDataTotal(3) }})
</div>
</div> </div>
</div> </div>
<div class="treeBox"> <div class="treeBox">
@ -78,18 +96,17 @@
" "
:title="node.label" :title="node.label"
>{{ node.label }} >{{ node.label }}
<span v-if="data.children.length > 0"> <span v-if="data.children.length > 0">
({{ ({{
(searchInfo.deviceState == 0 (searchInfo.deviceState == 0
? data.totalNum ? data.totalNum
: searchInfo.deviceState == 1 : searchInfo.deviceState == 1
? data.onlineNum ? data.onlineNum
: data.totalNum - data.onlineNum) || 0 : data.totalNum - data.onlineNum) || 0
}} }}
/ {{ data.totalNum || 0 }}) / {{ data.totalNum || 0 }})
</span> </span>
</span </span>
>
<!-- <span <!-- <span
:title="data.projectNum" :title="data.projectNum"
v-show="data.projectNum && videoType == 0" v-show="data.projectNum && videoType == 0"
@ -373,6 +390,12 @@ export default {
this.recursiveFilterList(cur.children, rountCount, resultList); this.recursiveFilterList(cur.children, rountCount, resultList);
} }
if (cur.type == "video") { if (cur.type == "video") {
if(this.searchInfo.deviceState) {
if(this.searchInfo.deviceState == cur.videoItem.deviceState){
resultList.push(cur);
}
return prev;
}
resultList.push(cur); resultList.push(cur);
} }
return prev; return prev;
@ -529,44 +552,52 @@ export default {
return data.name.indexOf(value) !== -1; return data.name.indexOf(value) !== -1;
}, },
recursion(array) { recursion(array) {
return array.filter((item) => { return array.map((item) => {
if ( if (
item.children && item.children &&
Array.isArray(item.children) && Array.isArray(item.children) &&
item.children.length > 0 item.children.length > 0
) { ) {
const resultList = this.recursion(item.children); item.children = this.recursion(item.children);
return resultList.length > 0; return item;
} }
return item.videoItem && item.videoItem.deviceState === this.searchInfo.deviceState; console.log(item.deviceState, this.searchInfo.deviceState);
}); if(item.type == "video") {
if(item.videoItem && item.videoItem.deviceState == this.searchInfo.deviceState) {
return item;
}
return
}
return item;
}).filter(item => item != undefined);
}, },
}, },
computed: { computed: {
filterTreeDataTotal() { filterTreeDataTotal() {
return (type) => { return (type) => {
if(type == 1) { if (type == 1) {
// //
return this.filterTreeData.reduce((prev, cur) => { return this.filterTreeData.reduce((prev, cur) => {
return prev += cur.totalNum return (prev += cur.totalNum);
}, 0) }, 0);
} else if(type == 2) { } else if (type == 2) {
// 线 // 线
return this.filterTreeData.reduce((prev, cur) => { return this.filterTreeData.reduce((prev, cur) => {
return prev += cur.onlineNum return (prev += cur.onlineNum);
}, 0) }, 0);
} else if(type == 3) { } else if (type == 3) {
// 线 // 线
return this.filterTreeData.reduce((prev, cur) => { return this.filterTreeData.reduce((prev, cur) => {
return prev += (cur.totalNum - cur.onlineNum) return (prev += cur.totalNum - cur.onlineNum);
}, 0) }, 0);
} }
return 0 return 0;
} };
}, },
filterTreeData() { filterTreeData() {
if (!this.searchInfo.deviceState) return this.treeData; if (!this.searchInfo.deviceState) return this.treeData;
return this.treeData.map((item) => { const dataList = structuredClone(this.treeData);
return dataList.map((item) => {
let children = []; let children = [];
if ( if (
item.children && item.children &&
@ -614,7 +645,7 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
>.bg-active { > .bg-active {
background-image: url("~@/assets/images/videoSurveillance/bg-icon1_active.png"); background-image: url("~@/assets/images/videoSurveillance/bg-icon1_active.png");
color: #ffffff; color: #ffffff;
} }
@ -652,6 +683,9 @@ export default {
.shrink-icon { .shrink-icon {
background-image: url("~@/assets/images/videoSurveillance/shrink-icon.png"); background-image: url("~@/assets/images/videoSurveillance/shrink-icon.png");
} }
.shrink-icon_active {
transform: rotate(180deg);
}
} }
} }
:deep(.el-input) { :deep(.el-input) {

View File

@ -298,7 +298,7 @@
> >
<el-button <el-button
type="text" type="text"
@click="onStateShow(3, scope.row.id)" @click="onStateShow(3, scope.row.id, 'restart')"
icon="el-icon-video-play" icon="el-icon-video-play"
v-if="scope.row.status == 4" v-if="scope.row.status == 4"
>重新开始</el-button >重新开始</el-button
@ -900,7 +900,7 @@
继续作业 继续作业
</div> </div>
<div <div
@click="onStateShow(3, workTicketDetail.id)" @click="onStateShow(3, workTicketDetail.id, 'restart')"
class="bg-3e" class="bg-3e"
v-if="workTicketDetail.status == 4" v-if="workTicketDetail.status == 4"
> >
@ -1543,10 +1543,12 @@ export default {
res.result.itemList.length > 0 res.result.itemList.length > 0
) { ) {
this.itemId = res.result.itemList[0].itemId; this.itemId = res.result.itemList[0].itemId;
this.videoItemList = [{ this.videoItemList = [
...res.result.itemList[0], {
status: this.workTicketDetail.status ...res.result.itemList[0],
}]; status: this.workTicketDetail.status,
},
];
console.log(111222, this.videoItemList); console.log(111222, this.videoItemList);
// this.getVideoItemInfoPoliceCameraItem(); // this.getVideoItemInfoPoliceCameraItem();
} else { } else {
@ -1811,19 +1813,26 @@ export default {
} }
}); });
}, },
onStateShow(type, id) { onStateShow(type, id, restartType) {
const obj = { const obj = {
1: "是否确认开始作业?", 1: "是否确认开始作业?",
2: "暂未全部施工完成,将进入暂停施工状态,待下次点击继续作业...", 2: "暂未全部施工完成,将进入暂停施工状态,待下次点击继续作业...",
3: "是否确认继续作业?", 3: "是否确认继续作业?",
4: "作业已全部施工完成,点击结束作业", 4: "作业已全部施工完成,点击结束作业",
}; };
this.$confirm(obj[type], "提示", {
confirmButtonText: "确定", this.$confirm(
cancelButtonText: "取消", restartType == "restart" ? "是否确认重新开始?" : obj[type],
customClass: `customConfirm customConfirm-box customConfirm${type}`, "提示",
type: "warning", {
}).then(() => { confirmButtonText: "确定",
cancelButtonText: "取消",
customClass: `customConfirm customConfirm-box customConfirm${
restartType == "restart" ? 5 : type
}`,
type: "warning",
}
).then(() => {
this.workTicketId = id; this.workTicketId = id;
this.onChangeState(type); this.onChangeState(type);
}); });
@ -1838,6 +1847,14 @@ export default {
}; };
setWorkTicketOperateWorkTicketApi(data).then((res) => { setWorkTicketOperateWorkTicketApi(data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.result && res.result.code == 1) {
this.$alert(res.result.message, "提示", {
confirmButtonText: "确定",
callback: (action) => {},
});
// this.$message.warning(res.result.message);
return;
}
this.$message.success(res.message); this.$message.success(res.message);
this.initWorkTicketClose(); this.initWorkTicketClose();
this.getWorkTicketList(); this.getWorkTicketList();
@ -2258,6 +2275,22 @@ export default {
.el-tooltip__popper { .el-tooltip__popper {
max-width: 30%; max-width: 30%;
} }
.customConfirm5 {
.el-message-box__status {
display: none;
}
.el-message-box__message {
padding-left: 16px;
}
.el-message-box__message::after {
content: "点击重新开始作业后,需要到执法记录仪上手动结束工单,结束后录像将会自动上传到平台,可在历史回放中查看";
color: #ffa026;
font-size: 12px;
display: inline-block;
width: 400px;
display: none;
}
}
.customConfirm4 .el-message-box__message::after { .customConfirm4 .el-message-box__message::after {
content: "点击结束作业后,需要到执法记录仪上手动结束工单,结束后录像将会自动上传到平台,可在历史回放中查看"; content: "点击结束作业后,需要到执法记录仪上手动结束工单,结束后录像将会自动上传到平台,可在历史回放中查看";
color: #ffa026; color: #ffa026;
@ -2318,7 +2351,7 @@ export default {
content: "\e720"; content: "\e720";
} }
} }
} }
.customConfirm { .customConfirm {
width: 668px; width: 668px;
.el-message-box__title { .el-message-box__title {
@ -2343,6 +2376,25 @@ export default {
text-align: center; text-align: center;
} }
} }
.el-message-box__wrapper {
.el-message-box__title {
font-weight: normal;
font-size: 16px;
color: #272d45;
margin-left: 15px;
position: relative;
}
.el-message-box__title::before {
content: "";
width: 3px;
height: 100%;
background-color: #5c81ee;
position: absolute;
left: -15px;
top: 50%;
transform: translateY(-50%);
}
}
</style> </style>
<style lang="less" scoped> <style lang="less" scoped>
.hls-video-dialog { .hls-video-dialog {