master
fanluyan 2 years ago
parent 12c56f0402
commit 17a4f09d41

28
.gitignore vendored

@ -1,11 +1,23 @@
# ---> Vue
# gitignore template for Vue.js projects
#
# Recommended template: Node.gitignore
.DS_Store
node_modules
/dist
# TODO: where does this rule come from?
docs/_book
# TODO: where does this rule come from?
test/
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

@ -0,0 +1,8 @@
module.exports = {
// plugins: {
// "postcss-pxtorem": {
// rootValue: 37.5,
// propList: ["*"],
// },
// },
};

@ -1,3 +1,24 @@
# xy-frontend
可视化
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
};

@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}

8821
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,61 @@
{
"name": "xy-frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^1.4.0",
"core-js": "^3.8.3",
"echarts": "^5.4.3",
"element-ui": "^2.15.13",
"moment": "^2.29.4",
"postcss-pxtorem": "^6.0.0",
"swiper": "^10.2.0",
"vue": "^2.6.14",
"vue-awesome-swiper": "^5.0.1",
"vue-lazyload": "^1.3.3",
"vue-router": "^3.5.1",
"vuex": "^3.6.2"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.0.3",
"less": "^4.0.0",
"less-loader": "^8.0.0",
"prettier": "^2.4.1",
"vue-template-compiler": "^2.6.14"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

@ -0,0 +1,10 @@
<template>
<div id="app">
<router-view />
</div>
</template>
<style lang="less">
#app {
}
</style>

@ -0,0 +1,80 @@
//表格样式
.el-table {
td.el-table__cell,
th.el-table__cell.is-leaf {
border-bottom: 1px solid #ebeef5;
}
.el-table__header-wrapper,
.el-table__fixed-header-wrapper {
border-top: 1px solid #ebeef5;
}
th.el-table__cell {
background: #f8f8f8 !important;
}
.el-button--text {
padding: 0px;
}
.el-button + .el-button,
.el-checkbox.is-bordered + .el-checkbox.is-bordered {
margin-left: 16px;
}
.deleteText {
color: #f56c6c;
}
.deleteText:focus,
.deleteText:hover {
color: #f56c6c;
}
}
.el-table::before,
.el-table__fixed-right::before,
.el-table__fixed::before {
height: 0px !important;
}
//分页
.pageNation {
margin-top: 8px;
display: flex;
justify-content: flex-end;
}
//弹窗
.el-dialog__body {
padding: 8px 20px;
}
.el-dialog {
background: #fff;
border-radius: 2px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
box-sizing: border-box;
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
margin-top: 0px !important;
}
.el-button--small {
padding: 9px 9px;
}
.el-button--default,
.el-button--primary {
width: 80px;
}
.el-dropdown [disabled] {
color: #fff;
}
.el-select-dropdown__item.selected {
font-weight: normal;
}
.el-dropdown-menu--small .el-dropdown-menu__item {
font-size: 12px;
}
.el-select-dropdown {
margin-top: 4px !important;
}
.el-link {
font-size: 12px;
}
.el-image-viewer__actions {
background: rgba(0, 0, 0, 0.15);
}

@ -0,0 +1,34 @@
//Brand @color
@color-primary: #169e8c;
@color-primary-light: mix(@color-white, @color-primary, 80%);
@color-primary-lighter: mix(@color-white, @color-primary, 90%);
//Functional @color
@color-success: #67c23a;
@color-warning: #e6a23c;
@color-danger: #f56c6c;
@color-info: #909399;
@color-red: #f00;
//Font color
@color-text-primary: #303133;
@color-text-regular: #606266;
@color-text-secondary: #909399;
@color-text-placeholder: #c0c4cc;
//Border color
@border-color-base: #dcdfe6;
@border-color-light: #e4e7ed;
@border-color-lighter: #ebeef5;
@border-color-extra-light: #f2f6fc;
//Background color
@color-white: #ffffff;
@color-black: #000000;
@background-color-base: #f5f7fa;
//阴影
@box-shadow-basic: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
//网站主题颜色
//欣影橙色色
@orange-color: #f08200;
//电网绿色
@green-color: #00a096;

@ -0,0 +1,47 @@
* {
margin: 0;
padding: 0;
}
html,
body,
#app,
.wrapper {
width: 100%;
height: 100%;
overflow: hidden;
}
body {
font-family: "PingFang SC", "Helvetica Neue", Helvetica, "microsoft yahei",
arial, STHeiTi, sans-serif;
}
a {
text-decoration: none;
}
/* 表格样式*/
.el-table-column--selection .cell {
padding-left: 14px !important;
}
/*滚动条样式*/
/* 整个滚动条 */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
/* 滚动条上的滚动滑块 */
::-webkit-scrollbar-thumb {
background-color: #ccc;
/* 关键代码 */
border-radius: 32px;
}
/* 滚动条轨道 */
::-webkit-scrollbar-track {
background-color: #f0f0f0;
border-radius: 32px;
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,61 @@
@font-face {
font-family: "iconfont"; /* Project id */
src: url('iconfont.ttf?t=1690188947515') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-paizhao:before {
content: "\e6ba";
}
.icon-paizhao-xianxing:before {
content: "\e8d1";
}
.icon-tuiguanglishitupianjinqun:before {
content: "\e613";
}
.icon-gongsi:before {
content: "\e62e";
}
.icon-dianli:before {
content: "\e649";
}
.icon-dianlihangye:before {
content: "\e791";
}
.icon-shexiangtoulixian:before {
content: "\e7b2";
}
.icon-video-camera:before {
content: "\e962";
}
.icon-shexiangtou-lixian:before {
content: "\ef1c";
}
.icon-shexiangtou-zaixian:before {
content: "\ef1d";
}
.icon-shudianxianlu_2722010801:before {
content: "\efed";
}
.icon-tupian_normal:before {
content: "\e681";
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

@ -0,0 +1,289 @@
<template>
<div class="wrapper">
<v-head></v-head>
<div class="content-box">
<div class="content">
<transition name="move" mode="out-in">
<router-view></router-view>
</transition>
</div>
</div>
</div>
</template>
<script>
import vHead from "./header.vue";
export default {
data() {
return {};
},
components: {
vHead,
},
created() {},
};
</script>
<style lang="less">
.wrapper {
min-width: 1366px;
.content-box {
position: absolute;
left: 0px;
right: 0;
top: 56px;
bottom: 0;
//padding-bottom: 30px;
-webkit-transition: left 0.3s ease-in-out;
transition: left 0.3s ease-in-out;
// background: @background-color-base;
.content {
width: 100%;
height: 100%;
//padding: 10px;
overflow-y: auto;
box-sizing: border-box;
}
}
}
@media (max-width: 900px) {
.wrapper .header {
// background: #000;
width: 100%;
height: 40px;
font-size: 12px;
line-height: 40px;
.logo {
display: none;
}
.el-menu-item {
padding: 0 10px;
}
.el-menu-item [class^="el-icon-"] {
width: 12px;
}
.sidebar .el-menu--horizontal .el-menu-item {
height: 40px;
line-height: 40px;
font-size: 12px;
i {
font-size: 12px;
}
}
.sidebar .el-menu--horizontal .el-submenu .el-submenu__title {
height: 40px;
line-height: 40px;
font-size: 12px;
i {
font-size: 12px;
}
}
.header-user-con {
height: 40px;
.user-avator {
margin-left: 4px;
img {
width: 20px;
height: 20px;
}
}
.user-avator {
//display: none;
}
}
.header-right {
padding-right: 12px;
}
}
.wrapper .content-box {
top: 41px;
//
.stritleEchartsPage {
height: 100%;
.exportDialog {
.el-dialog {
margin-top: 180px !important;
width: 80%;
}
}
.el-card .el-card__body {
padding: 8px;
height: calc(100% - 16px);
}
.echart-top {
.box-card {
h3 {
font-size: 12px;
line-height: 20px;
}
.bottomM {
p {
padding: 1.5%;
margin: 1.5%;
zoom: 0.8;
span {
font-size: 12px !important;
}
}
}
.chartClass {
height: calc(100% - 16px);
zoom: 0.6;
}
.dateBox {
top: 8px;
right: 8px;
.el-input__inner {
height: 20px;
line-height: 20px;
}
.el-input__icon {
line-height: 20px;
}
}
}
}
}
//realMonitor
.realMonitor {
.monitor-container {
.sideBar {
width: 200px;
.radioFilter {
.refresh {
display: none;
}
}
}
.picSetBox {
.swiperBox {
.title {
height: 20px;
line-height: 20px;
.el-breadcrumb {
height: 20px;
line-height: 20px;
font-size: 12px;
}
}
.thumb-example {
height: calc(100% - 8px);
.picTop {
height: 70%;
}
.picBottom {
height: 30%;
}
}
}
}
.picSetBox {
.parameterArea {
width: 180px;
.setTimebtn .buttonGroup .el-button {
width: 84px;
}
.setfocalLength {
.selectChannel {
.labelname {
font-size: 12px;
}
}
.buttonGroup .el-button {
width: 84px;
}
}
}
}
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 174px;
}
}
.infoDialog {
.el-dialog {
width: 80% !important;
margin-top: 120px !important;
}
}
.setTimeDialog {
.el-dialog {
width: 80% !important;
margin-top: 120px !important;
}
}
}
//realTimeSearch
.realTimeSearch {
height: auto;
.searchMain {
.searchBox {
.el-form-item__label {
font-size: 12px;
}
.el-select {
width: 100px;
}
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 188px;
}
}
}
.pictureBox {
height: 100%;
overflow: auto;
.imgList {
width: calc((100% - 50px) / 3);
height: auto;
margin: 2px;
.bigpic {
position: relative;
img {
height: 200px;
}
.caption {
position: absolute;
bottom: 0px;
background: #169e8ca1;
width: calc(100% - 8px);
padding: 4px;
.infoTop {
color: #fff;
font-size: 12px;
}
.infoBottom {
color: #fff;
}
}
}
}
}
}
//
.alarmHandBox {
height: auto;
}
.lineInformation,
.towerinfobox,
.camerChannel,
.photoGraphicDevice,
.deviceInformation,
.deviceReport,
.globalBox {
height: auto;
.el-dialog {
width: 100% !important;
margin-top: 140px !important;
}
}
}
.setRoadDialog {
.el-dialog {
margin-top: 140px !important;
}
}
}
</style>

@ -0,0 +1,415 @@
<template>
<div class="sidebar">
<el-menu
:default-active="activeIndex"
class="sidebar-el-menu"
mode="horizontal"
router
>
<template v-for="item in items">
<template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index">
<template slot="title">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</template>
<template v-for="subItem in item.subs">
<el-submenu
v-if="subItem.subs"
:index="subItem.index"
:key="subItem.index"
>
<template slot="title">{{ subItem.title }}</template>
<el-menu-item
v-for="(threeItem, i) in subItem.subs"
:key="i"
:index="threeItem.index"
>{{ threeItem.title }}</el-menu-item
>
</el-submenu>
<el-menu-item
v-else
:index="subItem.index"
:key="subItem.index"
>{{ subItem.title }}</el-menu-item
>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.index" :key="item.index">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</template>
</template>
</el-menu>
</div>
</template>
<script>
export default {
data() {
return {
activeIndex: "/stritl",
items: [
{
icon: "el-icon-s-home",
index: "/stritl",
title: "首页",
},
{
icon: "el-icon-camera",
index: "/realTimeMonitor",
title: "实时监控",
},
{
icon: "el-icon-film",
index: "/pictureRotation",
title: "图片轮巡",
},
{
icon: "el-icon-bell",
index: "/photoAlarm",
title: "告警处理",
},
{
icon: "el-icon-search",
index: "/realTimeSearch",
title: "历史图片",
},
{
icon: "el-icon-files",
index: "/property",
title: "资产管理",
subs: [
{
index: "/lineInformation",
title: "线路信息管理",
},
{
index: "/towerInformation",
title: "杆塔信息管理",
},
{
index: "/cameraChannel",
title: "通道管理",
},
{
index: "/photographicDevice",
title: "拍照装置管理",
},
{
index: "/devicePhotoSchedule",
title: "拍照时间表设置",
},
{
index: "/deviceReport",
title: "装置报表",
},
{
index: "/waterMark",
title: "水印下发",
},
// {
// index: "/deviceUpgrade",
// title: "",
// },
// {
// icon: "el-icon-picture-outline",
// index: "imageSettings",
// title: "",
// },
],
},
{
icon: "el-icon-monitor",
index: "/system",
title: "系统管理",
subs: [
{
index: "/userManagement",
title: "用户管理",
},
{
index: "/globalTools",
title: "全局设置",
},
],
},
],
items1: [
{
icon: "el-icon-s-home",
index: "stritl",
title: "首页",
},
{
icon: "el-icon-camera",
index: "/realTimeMonitor",
title: "实时监控",
},
{
icon: "el-icon-film",
index: "/pictureRotation",
title: "图片轮巡",
},
{
icon: "el-icon-bell",
index: "/photoAlarm",
title: "告警处理",
},
{
icon: "el-icon-search",
index: "/realTimeSearch",
title: "历史图片",
},
{
icon: "el-icon-files",
index: "/property",
title: "资产管理",
subs: [
{
index: "/lineInformation",
title: "线路信息管理",
},
{
index: "/towerInformation",
title: "杆塔信息管理",
},
{
index: "/cameraChannel",
title: "通道管理",
},
{
index: "/photographicDevice",
title: "拍照装置管理",
},
{
index: "/devicePhotoSchedule",
title: "拍照时间表设置",
},
// {
// index: "/deviceUpgrade",
// title: "",
// },
// {
// icon: "el-icon-picture-outline",
// index: "imageSettings",
// title: "",
// },
],
},
{
icon: "el-icon-monitor",
index: "/system",
title: "系统管理",
subs: [
{
index: "/userManagement",
title: "用户管理",
},
// {
// index: "/globalTools",
// title: "",
// },
],
},
],
items2: [
{
icon: "el-icon-s-home",
index: "stritl",
title: "首页",
},
{
icon: "el-icon-camera",
index: "/realTimeMonitor",
title: "实时监控",
},
{
icon: "el-icon-film",
index: "/pictureRotation",
title: "图片轮巡",
},
{
icon: "el-icon-bell",
index: "photoAlarm",
title: "告警处理",
},
{
icon: "el-icon-search",
index: "/realTimeSearch",
title: "历史图片",
},
{
icon: "el-icon-files",
index: "/property",
title: "资产管理",
subs: [
{
index: "/lineInformation",
title: "线路信息管理",
},
{
index: "/towerInformation",
title: "杆塔信息管理",
},
// {
// index: "/cameraChannel",
// title: "",
// },
{
index: "/photographicDevice",
title: "拍照装置管理",
},
{
index: "/devicePhotoSchedule",
title: "拍照时间表设置",
},
// {
// index: "/deviceUpgrade",
// title: "",
// },
// {
// icon: "el-icon-picture-outline",
// index: "imageSettings",
// title: "",
// },
],
},
],
role: "",
};
},
watch: {
$route() {
this.setCurrentRoute();
},
},
methods: {
setCurrentRoute() {
this.activeIndex = this.$route.path; //
},
},
created() {
this.setCurrentRoute();
this.role = localStorage.getItem("role");
console.log("用户管理");
console.log(this.role);
if (this.role == 0) {
this.items = this.items;
} else if (this.role == 1) {
this.items = this.items1;
} else if (this.role == 2) {
this.items = this.items2;
}
console.log(this.items);
},
};
</script>
<style lang="less">
.sidebar {
.el-menu--horizontal {
background: #169e8c;
.el-menu-item {
height: 56px;
line-height: 56px;
}
.el-submenu .el-submenu__title {
height: 56px;
line-height: 56px;
}
.el-submenu__title {
padding: 0 10px;
}
.el-dropdown-menu__item,
.el-menu-item,
.el-submenu__title {
font-size: 16px;
}
.el-menu-item i {
color: #666;
}
.el-menu-item.is-active {
i {
color: #169e8c;
}
}
.el-submenu.is-active .el-submenu__title > i {
&:first-child {
color: #333;
}
}
}
.el-menu {
background: #169e8c;
i {
color: #fff !important;
}
.el-menu-item {
color: #fff;
}
.el-submenu .el-submenu__title {
color: #fff;
}
.el-menu-item:not(.is-disabled):focus,
.el-menu-item:not(.is-disabled):hover {
color: #fff;
background-color: #128071;
border-bottom: 2px solid #128071;
i {
color: #fff !important;
}
}
.el-submenu:focus .el-submenu__title,
.el-submenu:hover .el-submenu__title {
color: #fff !important;
background-color: #128071;
border-bottom: 2px solid #128071;
i {
color: #fff !important;
}
}
}
.el-menu--horizontal > .el-menu-item.is-active {
border-bottom: 2px solid #128071 !important;
color: #fff !important;
background-color: #128071 !important;
i {
color: #fff !important;
}
}
.el-submenu.is-active {
.el-submenu__title {
border-bottom: 2px solid #128071 !important;
color: #fff !important;
background-color: #128071;
i {
color: #fff !important;
}
}
}
.gallery-thumbs .swiper-slide-active {
border: 3px solid #169e8c !important;
}
.tags-li.active {
border: 1px solid #169e8c;
background-color: #169e8c;
}
}
</style>

@ -0,0 +1,119 @@
<template>
<div class="header">
<div class="logoTitle">视频监控可视化平台</div>
<div class="menuBox">
<vSidebar></vSidebar>
<div class="userInfo">
<div class="header-user-con">
<!-- 用户头像 -->
<div class="user-avator">
<img src="../assets/img/user.jpeg" />
</div>
<!-- 用户名下拉菜单 -->
<el-dropdown
class="user-name"
trigger="click"
@command="handleCommand"
>
<span class="el-dropdown-link">
{{ userName }}
<i class="el-icon-caret-bottom"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="changePwd"> 修改密码</el-dropdown-item>
<el-dropdown-item command="loginout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</div>
<password-dialog ref="passwordref"></password-dialog>
</div>
</template>
<script>
import vSidebar from "./Sidebar.vue";
import passwordDialog from "../components/passwordDialog.vue";
export default {
components: {
vSidebar,
passwordDialog,
},
data() {
return {
userName: localStorage.getItem("userName"),
};
},
methods: {
//
handleCommand(command) {
switch (command) {
case "noticeShow": //
console.log(command);
break;
case "changePwd": //
this.$refs.passwordref.display();
break;
case "loginout": //退
this.$message({
duration: 1500,
showClose: true,
message: "退出成功",
type: "success",
});
this.$store.commit("REMOVE_INFO");
this.$router.push("/login");
break;
}
},
},
created() {},
mounted() {},
};
</script>
<style lang="less">
.header {
width: calc(100% - 32px);
height: 56px;
background: #169e8c;
line-height: 56px;
padding: 0px 16px;
display: flex;
.logoTitle {
font-size: 20px;
color: #fff;
padding-right: 16px;
}
.menuBox {
flex: 1;
display: flex;
justify-content: space-between;
.userInfo {
.header-user-con {
display: flex;
height: 56px;
align-items: center;
.user-avator {
margin-left: 16px;
img {
display: block;
width: 40px;
height: 40px;
border-radius: 50%;
}
}
.user-name {
margin-left: 8px;
.el-dropdown-link {
color: #fff;
cursor: pointer;
}
}
.el-select {
width: 90px;
}
}
}
}
}
</style>

@ -0,0 +1,84 @@
<template>
<el-dialog
class="psdDialog"
title="修改密码"
:visible.sync="isShow"
:close-on-click-modal="false"
width="420px"
>
<el-form :model="psdForm" :rules="rules" ref="formInfo" label-position="left" label-width="80px">
<el-form-item label="用户名:">
<el-input v-model="psdForm.userName" autocomplete="off" :disabled="true"></el-input>
</el-form-item>
<!-- <el-form-item label="原密码:">
<el-input v-model="psdForm.originalPsd" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="新密码:">
<el-input v-model="psdForm.newPsd" autocomplete="off"></el-input>
</el-form-item> -->
<el-form-item label="密码:">
<el-input v-model="psdForm.password" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { updateUserApi } from "@/utils/api/index";
export default {
data() {
return {
isShow:false,
psdForm: {
userName: localStorage.getItem('userName'),
originalPsd: "",
newPsd: "",
password: "",
},
rules: {
userName: [
{ required: true, message: "请输入用户名", trigger: "blur" },
],
password: [
{ required: true, message: "请输入密码", trigger: "blur" },
// { min: 6, max: 8, message: '6-8', trigger: 'blur' }
],
},
};
},
methods: {
//
submitForm() {
this.$refs.formInfo.validate((valid) => {
if (valid) {
this.$set(this.psdForm,'userId',localStorage.getItem('userid'))
updateUserApi(this.psdForm)
.then((res) => {
if (res.code == 200) {
this.$message.success("修改成功,请重新登录");
this.isShow = false
this.$store.commit("REMOVE_INFO");
this.$router.push("/login");
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
},
};
</script>

@ -0,0 +1,73 @@
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
//import "./utils/rem"; //设置body文字大小
Vue.config.productionTip = false;
import "../src/assets/css/theme/index.css"; //l绿色主题
import ElementUI from "element-ui";
//样式
import "./assets/css/reset.css"; //默认样式
import "./assets/css/global.less"; //全局定义颜色
import "./assets/css/element.less"; //全局定义颜色
import "./assets/fonts/iconfont.css"; //按钮
//引入Echarts;
import * as echarts from "echarts";
Vue.prototype.$echarts = echarts;
//引入日期// 注册全局 moment
import moment from "moment";
Vue.prototype.$moment = moment;
import { message } from "@/utils/resetMessage";
// import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI, {
size: "small",
});
//图片懒加载
//引入插件
import VueLazyload from "vue-lazyload";
//注册插件
Vue.use(VueLazyload, {
error: require("./assets/img/nodatapic2.jpg"),
});
/* 引入公共js*/
import common from "@/utils/common/common.js";
Vue.prototype.common = common;
//挂载弹出信息
Vue.prototype.$message = message;
//防抖
Vue.directive("noMoreClick", {
inserted(el, binding) {
el.addEventListener("click", (e) => {
el.classList.add("is-disabled");
el.disabled = true;
setTimeout(() => {
el.disabled = false;
el.classList.remove("is-disabled");
}, 2000); //我这里设置的是2000毫秒也就是2秒
});
},
});
//使用钩子函数对路由进行权限跳转
router.beforeEach((to, from, next) => {
document.title = `${to.meta.title} | 视频监控可视化平台`;
const role = localStorage.getItem("role");
const token = localStorage.getItem("token");
console.log(role, token);
if (!token && to.path !== "/login") {
//next("/login");
next({
path: "/login",
});
} else {
next();
}
});
new Vue({
router,
store,
render: (h) => h(App),
}).$mount("#app");

@ -0,0 +1,145 @@
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
const routes = [
{ path: "/", redirect: "/login" },
{
path: "/stritl",
component: () => import("../components/Home.vue"),
meta: { title: "首页" },
children: [
{
path: "/stritl",
component: () =>
import(
/* webpackChunkName: "dashboard" */ "../views/homePage/index.vue"
),
meta: {
title: "首页",
icon: "el-icon-s-home",
},
},
{
path: "/realTimeMonitor",
component: () =>
import(
/* webpackChunkName: "home" */ "../views/realTimeMonitor/index.vue"
),
meta: {
title: "实时监控",
permission: true,
icon: "el-icon-camera",
},
},
{
path: "/pictureRotation",
component: () =>
import(
/* webpackChunkName: "home" */ "../views/pictureRotation/index.vue"
),
meta: {
title: "图片轮巡",
permission: true,
icon: "el-icon-camera",
},
},
{
path: "/realTimeSearch",
component: () =>
import(
/* webpackChunkName: "home" */ "../views/realTimeSearch/index.vue"
),
meta: {
title: "历史图片",
permission: true,
icon: "el-icon-camera",
},
},
{
path: "/photoAlarm",
component: () =>
import(
/* webpackChunkName: "home" */ "../views/alarmHandling/index.vue"
),
meta: {
title: "告警处理",
permission: true,
icon: "el-icon-camera",
},
},
{
path: "/userManagement",
component: () =>
import(
/* webpackChunkName: "tabs" */ "../views/system/userManagement.vue"
),
meta: { title: "用户管理", icon: "el-icon-monitor" },
},
{
path: "/globalTools",
component: () =>
import(
/* webpackChunkName: "tabs" */ "../views/system/globalTools/index.vue"
),
meta: { title: "全局设置" },
},
{
path: "/lineInformation",
component: () =>
import(
/* webpackChunkName: "tabs" */ "../views/lineInformation/index.vue"
),
meta: { title: "线路信息管理", icon: "" },
},
{
path: "/towerInformation",
component: () =>
import(
/* webpackChunkName: "tabs" */ "../views/towerInformation/index.vue"
),
meta: { title: "杆塔信息管理", icon: "" },
},
{
path: "/cameraChannel",
component: () =>
import(
/* webpackChunkName: "tabs" */ "../views/cameraChannel/index.vue"
),
meta: { title: "通道管理", icon: "" },
},
{
path: "/photographicDevice",
component: () =>
import(
/* webpackChunkName: "tabs" */ "../views/photographicDevice/index.vue"
),
meta: { title: "拍照装置管理", icon: "" },
},
{
path: "/devicePhotoSchedule",
component: () =>
import(
/* webpackChunkName: "tabs" */ "../views/devicePhotoSchedule/index.vue"
),
meta: { title: "拍照时间表设置", icon: "" },
},
],
},
{
path: "/login",
component: () => import("../views/login/index.vue"),
meta: { title: "登录" },
},
];
const router = new VueRouter({
mode: "hash",
base: process.env.BASE_URL,
routes,
});
export default router;

@ -0,0 +1,79 @@
import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store({
state: {
//用户登录token 存储
token: "",
userName: "",
userid: "",
role: "",
currentData: "",
channelId: "",
termId: "",
protocol: "",
cmdId: "",
channelIdList: [],
},
getters: {
token: (state) => state.token,
userName: (state) => state.userName,
role: (state) => state.role,
},
mutations: {
//点击获取的左侧列表
currentData(state, currentData) {
state.currentData = currentData;
console.log("保存起来currentData", state.currentData);
localStorage.setItem("currentData", JSON.stringify(currentData));
},
channelId(state, channelId) {
state.channelId = channelId;
console.log("channelId", state.channelId);
localStorage.setItem("channelId", JSON.stringify(channelId));
},
termId(state, termId) {
state.termId = termId;
console.log("termId", state.termId);
localStorage.setItem("termId", JSON.stringify(termId));
},
protocol(state, protocol) {
state.protocol = protocol;
console.log("protocol", state.protocol);
localStorage.setItem("protocol", JSON.stringify(protocol));
},
cmdId(state, cmdId) {
state.cmdId = cmdId;
console.log("protocol", state.cmdId);
localStorage.setItem("protocol", JSON.stringify(cmdId));
},
channelIdList(state, channelIdList) {
state.channelIdList = channelIdList;
console.log("channelIdList", state.channelIdList);
localStorage.setItem("channelIdList", JSON.stringify(channelIdList));
},
SET_TOKEN(state, token) {
state.token = token;
localStorage.setItem("token", state.token);
},
SET_USERINFO(state, val) {
state.userName = val.userName;
state.userid = val.id;
state.role = val.role;
localStorage.setItem("userName", state.userName);
localStorage.setItem("userid", state.userid);
localStorage.setItem("role", state.role);
},
//退出清除locastorge
REMOVE_INFO(state) {
localStorage.clear();
},
},
actions: {},
modules: {},
});

@ -0,0 +1,660 @@
import request from "../request";
//获取登录
export function loginJoggle(data) {
return request({
url: "/api/login",
method: "post",
data,
});
}
//获取装置总数图表
export function getTermStatistics(data) {
return request({
url: "/api/getTermStatistics",
method: "get",
params: data,
});
}
//获取一周的装置告警
export function getWeekAlarmStatistics(data) {
return request({
url: "/api/getWeekAlarmStatistics",
method: "get",
params: data,
});
}
//获取当天告警分类统计
export function getTodayAlarmStatistics(data) {
return request({
url: "/api/getTodayAlarmStatistics",
method: "get",
params: data,
});
}
//首页查看数据
export function getOnlineTerminalList(data) {
return request({
url: "/api/getOnlineTerminalList",
method: "get",
params: data,
});
}
//导出数据
export function getOnlineTerminalListExcel() {
return request({
url: "/api/getOnlineTerminalListExcel",
method: "post",
responseType: "blob",
});
}
//修改用户
export function updateUserApi(data) {
return request({
url: "/api/updateUser",
method: "post",
data,
});
}
//实时监控
//获取线路树状结构
export function getdyTreeListJoggle(data) {
return request({
url: "/api/getdyTreeList",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//获取所有杆塔下的图片列表,实时监控
export function getTowerAndPhotoList(data) {
return request({
url: "/api/getTowerAndPhotoList",
method: "post",
data,
});
}
//获取通道
export function getChannelByTermidJoggle(data) {
return request({
url: "/api/getChannelByTermid",
method: "post",
data,
});
}
//获取图片接口
export function getTerminalPhotoListJoggle(data) {
return request({
url: "/api/getTerminalPhotoList",
method: "post",
data,
});
}
//判断装置是否在线
export function getTermStatus(data) {
return request({
url: "/api/getTermStatus",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//统一调用接口命令
export function setTermCamera(data) {
return request({
url: "/api/setTermCamera",
method: "post",
data,
// headers: {
// "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
// },
});
}
//统一返回数据
export function getTermCameraRequest(data) {
return request({
url: "/api/getTermCameraRequest",
method: "post",
data,
// headers: {
// "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
// },
});
}
//手动拍 获取装置状态
export function getTakePicStatusJoggle(data) {
return request({
url: "/api/getTakePicStatus",
method: "get",
params: data,
});
}
//手动拍照获取最新图片
export function getTakePicPhotoStatusJoggle(data) {
return request({
url: "/api/getTakePicPhotoStatus",
method: "get",
params: data,
});
}
export function getDeviceList(data) {
return request({
url: "/api/getTerminalStatus",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//获取最新装置信息aaa
export function getinfoStatus(data) {
return request({
url: "/api/getLastTermInfo",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//获取最新装置信息
export function getNewDeviceList(data) {
return request({
url: "/api/getLastedTerminalStatus",
method: "post",
data,
});
}
//声光报警
export function alarmMarkJoggle(data) {
return request({
url: "/api/alarmMark",
method: "post",
data,
});
}
// 获取GPS位置
export function getTermGPSJoggle(data) {
return request({
url: "/api/getTermGPS",
method: "post",
data,
});
}
//setTermGPS 开启关闭gps
export function setTermGPSJoggle(data) {
return request({
url: "/api/setTermGPS",
method: "post",
data,
});
}
//获取GPS位置触发
export function getTermGPSPosition(data) {
return request({
url: "/api/getTermGPSPosition",
method: "post",
data,
});
}
// 获取GPS位置
export function getTermLastGPSPosition(data) {
return request({
url: "/api/getTermLastGPSPosition",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//图片轮巡
//获取图片轮巡接口
export function getPictureList(data) {
return request({
url: "/api/getPhotoBanner",
method: "post",
data,
});
}
//历史图片
//获取电压-线路-杆塔等信息
export function getSearchInfo(data) {
return request({
url: "/api/getLineAndGt",
method: "post",
data,
});
}
//获取实时图片数据
export function getRealtimePhoto(data) {
return request({
url: "/api/getPhotoList",
method: "post",
data,
});
}
//告警功能
//获取告警列表
export function getAlarmList(data) {
return request({
url: "/api/getTerminalAlarmList",
method: "post",
data,
});
}
//获取告警label
export function getAlarmTypeList(data) {
return request({
url: "/api/getAlarmTypeList",
method: "post",
data,
});
}
//已读未读
export function readAlarm(data) {
return request({
url: "/api/readAlarm",
method: "post",
data,
});
}
//手动拍照
export function takePicJoggle(data) {
return request({
url: "/api/takePic",
method: "get",
params: data,
// data,
// headers: {
// "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
// },
});
}
//用户管理
//用户列表查询
export function getUserList(data) {
return request({
url: "/api/userList",
method: "post",
data,
});
}
//新增用户
export function addUserApi(data) {
return request({
url: "/api/addUser",
method: "post",
data,
});
}
//删除用户
export function delUserApi(data) {
return request({
url: "/api/deleteUser",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//设置告警可信度
export function updateAlarmTypeList(data) {
return request({
url: "/api/updateAlarmTypeList",
method: "post",
data,
});
} //全局设置线缆绘制
export function getMarkEnableStatus(data) {
return request({
url: "/api/getMarkEnableStatus",
method: "post",
data,
});
}
//全局更新设置线缆绘制
export function updateMarkEnableStatus(data) {
return request({
url: "/api/updateMarkEnableStatus",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//全局设置通道
export function updateAlarmChannel(data) {
return request({
url: "/api/updateAlarmChannel",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//获取电压等级列表
export function getdyListJoggle(data) {
return request({
url: "/api/getdyList",
method: "post",
data,
});
}
//1.线路列表信息
export function getLineListJoggle(data) {
return request({
url: "/api/getLineList",
method: "post",
data,
});
}
//2.添加单个或者多个线路信息
export function addLineJoggle(data) {
return request({
url: "/api/addLine",
method: "post",
data,
});
}
//3.删除新路信息
export function deleteLineJoggle(data) {
return request({
url: "/api/deleteLine",
method: "post",
data,
});
}
//4.修改信息
export function updateLineJoggle(data) {
return request({
url: "/api/updateLine",
method: "post",
data,
});
}
//杆塔信息
//1.获取杆塔列表
export function getTowerListApi(data) {
return request({
url: "/api/getTowerList",
method: "post",
data,
});
}
//2.获取线路编号列表
export function getLineListApi(data) {
return request({
url: "/api/getLineList",
method: "post",
data,
});
}
//3.新增杆塔信息
export function addTowerApi(data) {
return request({
url: "/api/addTower",
method: "post",
data,
});
}
//4.修改杆塔信息
export function updateTowerApi(data) {
return request({
url: "/api/updateTower",
method: "post",
data,
});
}
//5.删除杆塔信息
export function delTowerApi(data) {
return request({
url: "/api/deleteTower",
method: "post",
data,
});
}
//通道管理
//1.获取通道列表
export function getChannelListapi(data) {
return request({
url: "/api/getChannelList",
method: "post",
data,
});
}
//2.新增通道
export function addChannelapi(data) {
return request({
url: "/api/addChannelList",
method: "post",
data,
});
}
//3.删除通道
export function deleteChannelapi(data) {
return request({
url: "/api/deleteChannelList",
method: "post",
data,
});
}
//4.修改通道
export function updateChannelapi(data) {
return request({
url: "/api/updateChannelList",
method: "post",
data,
});
}
//拍照装置管理 接口增删改查
//获取列表
export function getTerminalJoggle(data) {
return request({
url: "/api/getTerminalList",
method: "post",
data,
});
}
//添加设备信息
export function addTerminalJoggle(data) {
return request({
url: "/api/addTerminal",
method: "post",
data,
});
}
//添加设备---获取-线路-杆塔
export function getLineAndGtInfo(data) {
return request({
url: "/api/getLineAndGtList",
method: "post",
data,
});
}
//修改设备信息
export function updateTerminalJoggle(data) {
return request({
url: "/api/updateTerminal",
method: "post",
data,
});
}
//删除设备信息
export function deleteTerminalJoggle(data) {
return request({
url: "/api/deleteTerminal",
method: "post",
data,
});
}
//导出数据
export function getTerminalListExcel() {
return request({
url: "/api/getTerminalListExcel",
method: "post",
responseType: "blob",
});
}
//获取所有通道列表
export function getAllChannelListJoggle(data) {
return request({
url: "/api/getAllChannelList",
method: "post",
data,
});
}
//规约版本
export function getProtocolList(data) {
return request({
url: "/api/getProtocolList",
method: "get",
params: data,
});
}
//获取通道的接口
export function getChannelListJoggle(data) {
return request({
url: "/api/getChannelByTermid",
method: "post",
data,
});
}
//装置复位
export function resetTerminalApi(data) {
return request({
url: "/api/resetTerminal",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//图像参数--获取图像分辨率
export function getResolutionRatio(data) {
return request({
url: "/api/getResolutionList",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//获取设备接口
export function getCoordinate(data) {
return request({
url: "/api/getCoordinate",
method: "post",
data,
});
}
//绘制坐标保存
export function updateCoordinate(data) {
return request({
url: "/api/updateCoordinate",
method: "post",
data,
});
}
//拍照时间表设置
//1.获取任务规则列表接口
export function getScheduleRulelListJoggle(data) {
return request({
url: "/api/getScheduleRulelList",
method: "post",
data,
});
}
//2.新增任务规则
export function addScheduleRulel(data) {
return request({
url: "/api/addSchelduleRuleList",
method: "post",
data,
});
}
//3.删除任务规则
export function deleteScheduleRulel(data) {
return request({
url: "/api/deleteSchelduleRule",
method: "post",
data,
});
}
//4.修改任务规则
export function updateScheduleRulel(data) {
return request({
url: "/api/updateSchelduleRule",
method: "post",
data,
});
}
//5.获取所有通道
export function getScheduleRulelAccessList(data) {
return request({
url: "/api/getChannelTreeList",
method: "post",
data,
});
}
//6.设置时间表通道
export function setScheduleRulel(data) {
return request({
url: "/api/relateSchelduleRule",
method: "post",
data,
});
}
//7.查询设备时间表
export function getSchedulenr(data) {
return request({
url: "/api/getChannelSchelduleRule",
method: "post",
data,
});
}
//根据通道编号获取设备列表
export function getTermListByChannelJoggle(data) {
return request({
url: "/api/getTermListByChannel ",
method: "post",
data,
});
}

@ -0,0 +1 @@
export default {};

@ -0,0 +1,12 @@
//兼容处理
// function setHtml() {
// //获取设备宽度
// var deviceWidth = document.documentElement.offsetWidth;
// //给html标签设置fontSize就是给rem赋值
// document.documentElement.style.fontSize = (deviceWidth / 375) * 10 + "px";
// }
// //窗口大小变化的时候执行
// window.onresize = setHtml;
// //页面初始加载时也要触发
// //setHtml();

@ -0,0 +1,75 @@
import axios from "axios";
import { MessageBox, Message } from "element-ui";
import router from "../router/index";
const service = axios.create({
// process.env.NODE_ENV === 'development' 来判断是否开发环境
// easy-mock服务挂了暂时不使用了
// baseURL: '',
// timeout: 5000
baseURL: "api", //把原来的项目地址改成api解决跨域问题
timeout: 30000,
});
service.interceptors.request.use((config) => {
if (localStorage.getItem("token")) {
config.headers.sessionId = localStorage.getItem("token");
}
return config;
});
service.interceptors.response.use(
// (response) => {
// if (response.status === 200) {
// return response.data;
// } else {
// Promise.reject();
// }
// },
// (error) => {
// console.log(error);
// return Promise.reject();
// }
(response) => {
const res = response.data;
if (res.code !== 200) {
// Message({
// showClose: true,
// message: res.msg || "Error",
// type: "error",
// duration: 5 * 1000,
// });
if (res.code === 401) {
Message({ message: res.msg, type: "error", duration: 1500 });
router.push("/login");
}
if (res.code === 400) {
Message({ message: res.msg, type: "error", duration: 1500 });
}
if (res.code === 500) {
Message({
showClose: true,
message: 服务器错误(500),
type: "error",
duration: 1500,
});
}
return Promise.reject(new Error(res.msg || "Error"));
} else {
return res;
}
},
(error) => {
Message({
message: error.message,
showClose: true,
type: "error",
duration: 1500,
});
return Promise.reject(error);
}
);
export default service;

@ -0,0 +1,28 @@
//resetMessage.js
/**重置message防止重复点击重复弹出message消息提示 */
import { Message } from "element-ui";
let messageInstance = null;
const resetMessage = (options) => {
if (messageInstance) {
messageInstance.close();
}
Message.closeAll(); //手动关闭所有消息提示实例
messageInstance = Message(options);
// console.log(Message(options));
};
["error", "success", "info", "warning"].forEach((type) => {
resetMessage[type] = (options) => {
if (typeof options === "string") {
options = {
message: options,
};
}
options.type = type;
return resetMessage(options);
};
});
export const message = resetMessage;

File diff suppressed because it is too large Load Diff

@ -0,0 +1,156 @@
<template>
<el-dialog
class="addchannelDialog"
:title="title"
:visible.sync="isShow"
:close-on-click-modal="false"
width="470px"
>
<el-form
label-position="left"
ref="formInfo"
label-width="100px"
:rules="rules"
:model="formdata"
>
<el-form-item label="通道名称:" prop="channelname">
<el-input v-model="formdata.channelname" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="通道编号:" prop="id" :error="errorMsg">
<el-input-number
v-model="formdata.id"
:disabled="title == '修改' ? true : false"
></el-input-number>
</el-form-item>
<!-- <el-form-item label="分辨率高:" prop="maxResolutionHeight">
<el-input-number
v-model="formdata.maxResolutionHeight"
></el-input-number>
</el-form-item>
<el-form-item label="分辨率宽:" prop="maxResolutionWidth">
<el-input-number
v-model="formdata.maxResolutionWidth"
></el-input-number>
</el-form-item> -->
<el-form-item label="状态:" prop="status" v-if="title == '修改'">
<el-switch
v-model="formdata.status"
:active-value="1"
:inactive-value="0"
></el-switch>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addChannelapi, updateChannelapi } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
isShow: false,
errorMsg: "",
formdata: {},
rules: {
channelname: [
{ required: true, message: "请输入名称", trigger: "blur" },
],
id: [{ required: true, message: "请输入通道编号", trigger: "blur" }],
// maxResolutionHeight: [
// { required: true, message: "", trigger: "blur" },
// ],
// maxResolutionWidth: [
// { required: true, message: "", trigger: "blur" },
// ],
},
};
},
methods: {
//
getdataform(val) {
console.log(val);
if (val == null) {
return (this.formdata = {});
}
//this.formdata = val;
this.formdata = JSON.parse(JSON.stringify(val));
},
//
submitForm() {
this.$refs.formInfo.validate((valid) => {
if (valid) {
if (this.title == "新增") {
let formArr = [];
formArr.push(this.formdata);
addChannelapi({ list: formArr })
.then((res) => {
//this.errorMsg = "";
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.$parent.deviceList();
this.isShow = false;
} else {
//this.errorMsg = res.msg;
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
});
} else {
updateChannelapi(this.formdata)
.then((res) => {
if (res.code == 200) {
this.$message.success("修改成功");
this.$parent.deviceList();
this.isShow = false;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error("修改失败");
});
}
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
},
mounted() {},
};
</script>
<style lang="less">
.addchannelDialog {
.el-form-item {
.el-input,
.el-input-number {
width: 100%;
}
}
}
</style>

@ -0,0 +1,232 @@
<template>
<div class="camerChannel">
<div class="deviceBox">
<div class="deviceBtnGroup">
<h4>通道管理</h4>
<el-button
type="primary"
icon="el-icon-plus"
@click.native.stop="handleAdddevice()"
>新增</el-button
>
</div>
<div class="deviceTable">
<el-table
ref="multipleTable"
:data="deviceTableData"
stripe
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 40px)"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<!-- <el-table-column type="index" width="55"> </el-table-column>
<el-table-column type="selection" width="55"> </el-table-column> -->
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column
label="通道名称"
show-overflow-tooltip
prop="channelname"
></el-table-column>
<el-table-column
label="通道编号"
show-overflow-tooltip
prop="id"
></el-table-column>
<el-table-column
label="分辨率高"
show-overflow-tooltip
prop="maxResolutionHeight"
></el-table-column>
<el-table-column
label="分辨率宽"
show-overflow-tooltip
prop="maxResolutionWidth"
></el-table-column>
<el-table-column label="状态" show-overflow-tooltip>
<template slot-scope="scope">
<!-- <el-switch
v-model="scope.row.status"
:active-value="1"
:inactive-value="0"
disabled
></el-switch> -->
<el-tag
:type="scope.row.status == 1 ? 'warning' : 'success'"
effect="dark"
>
{{ scope.row.status == 1 ? "开启中" : "已关闭" }}</el-tag
>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="200">
<template slot-scope="scope">
<el-button
@click.native.stop="handleResive(scope.row)"
type="text"
>修改</el-button
>
<!-- <el-button type="text" class="deleteText" @click.native.stop="handleDelete(scope.row)" >删除</el-button> -->
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
<!-- 新增时间表 -->
<addChannelDialog
:title="title"
ref="addChannelDialogref"
></addChannelDialog>
</div>
</template>
<script>
import addChannelDialog from "./components/addChannelDialog.vue";
import { getChannelListapi, deleteChannelapi } from "@/utils/api/index";
export default {
components: {
addChannelDialog,
},
data() {
return {
title: "", //
deviceTableData: [],
//multipleSelection: [], //
page: 1, //
pageSize: 20, //
total: 0, //
};
},
created() {
this.deviceList();
},
methods: {
//线
deviceList() {
getChannelListapi({
pageindex: this.page,
pagesize: this.pageSize,
})
.then((res) => {
this.deviceTableData = res.data.list;
this.total = res.data.total;
})
.catch((err) => {});
},
//
handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row);
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
handleAdddevice() {
this.title = "新增";
this.$refs.addChannelDialogref.display();
this.$refs.addChannelDialogref.getdataform(null);
},
//
handleResive(data) {
this.title = "修改";
this.$refs.addChannelDialogref.display();
this.$refs.addChannelDialogref.getdataform(data);
},
//
handleDelete(data) {
let deleteArr = [];
deleteArr.push({
id: data.id,
});
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deleteChannelapi({ list: deleteArr }).then((res) => {
this.deviceList(); //
});
this.$message({
duration: 1500,
showClose: true,
type: "success",
message: "删除成功!",
});
})
.catch(() => {
this.$message({
duration: 1500,
showClose: true,
type: "info",
message: "已取消删除",
});
});
},
//
handleCurrentChange(val) {
this.page = val;
this.deviceList();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.deviceList();
},
},
};
</script>
<style lang="less">
.camerChannel {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.deviceBox {
border: 1px solid #dddddd;
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
}
.deviceBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
}
.deviceTable {
margin-top: 16px;
height: calc(100% - 48px);
//background: #fcc;
.el-tag--dark.el-tag--success {
background: linear-gradient(180deg, #4cdbc8 10%, #128071 100%);
border-color: transparent;
}
.el-tag--dark.el-tag--warning {
background: linear-gradient(180deg, #4cdbc8 10%, #128071 100%);
border: 0px solid transparent;
}
}
}
</style>

@ -0,0 +1,304 @@
<template>
<el-dialog
class="adddeviceDialog"
:title="title"
:visible.sync="isShow"
:close-on-click-modal="false"
width="670px"
>
<el-form
label-position="left"
ref="formInfo"
label-width="auto"
:rules="rules"
:model="ruleForm"
>
<el-form-item label="名称" prop="name">
<el-input v-model="ruleForm.name" autocomplete="off"></el-input>
</el-form-item>
<div class="addtimeBox" ref="timescrollref">
<div
class="timeBoxArr"
v-for="(item, index) in ruleForm.listTime"
:key="index"
>
<el-form-item
label="时间"
:rules="{ required: true, message: '请选择时间', trigger: 'blur' }"
>
<!-- <el-time-picker
is-range
:picker-options="pickerOptions"
v-model="item.time"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
format="HH:mm"
@change="handleTimeChange"
>
</el-time-picker> -->
<div class="timeBoxList">
<el-time-picker
v-model="item.startTime"
placeholder="开始时间"
format="HH:mm"
>
</el-time-picker>
<i class="split">~</i>
<el-time-picker
v-model="item.endTime"
placeholder="结束时间"
format="HH:mm"
>
</el-time-picker>
</div>
</el-form-item>
<el-form-item
class="spanRight"
label="间隔(分)"
:prop="'listTime.' + index + '.timeSpan'"
>
<!-- <el-input v-model="ruleForm.span" autocomplete="off" type="number"></el-input> -->
<el-input-number v-model="item.timeSpan" :min="1"></el-input-number>
</el-form-item>
<div class="btngrop">
<el-button
v-if="index !== 0"
type="danger"
icon="el-icon-minus"
@click="deleteModule(item, index)"
></el-button>
<el-button
icon="el-icon-plus"
type="primary"
@click="addModule()"
v-if="index + 1 == ruleForm.listTime.length"
></el-button>
</div>
</div>
</div>
<el-form-item label="备注" prop="remark">
<el-input v-model="ruleForm.remark" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addScheduleRulel, updateScheduleRulel } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
isShow: false,
pickerOptions: {
disabledDate(time) {
//
return false;
},
},
rules: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
},
ruleForm: {},
};
},
methods: {
//
getdataform(val) {
console.log(val);
if (val == null) {
return (this.ruleForm = {
name: "",
listTime: [
{
startTime: "",
endTime: "",
timeSpan: "",
},
],
list: [],
remark: "",
});
}
//this.ruleForm = val;
this.ruleForm = JSON.parse(JSON.stringify(val));
console.log(this.ruleForm.listTime);
this.ruleForm.listTime.forEach((item) => {
this.$set(item, "startTime", this.$moment(item.startTime, "HH:mm"));
this.$set(item, "endTime", this.$moment(item.endTime, "HH:mm"));
//this.$set(item, "time", [item.startTime, item.endTime]);
});
},
handleTimeChange(value) {
console.log(value);
// this.item.time = value;
// // pickerOptions使
// this.pickerOptions.disabledDate = (time) => {
// return time.getTime() < this.item.time[0].getTime();
// };
},
addModule() {
//
this.ruleForm.listTime.push({
startTime: "",
endTime: "",
timeSpan: "",
});
console.log(this.$refs.timescrollref);
this.$nextTick(() => {
console.log(this.$refs.timescrollref);
if (this.$refs.timescrollref) {
console.log(this.$refs.timescrollref.scrollHeight);
this.$refs.timescrollref.scrollTop =
this.$refs.timescrollref.scrollHeight;
}
});
},
//
deleteModule(item, index) {
console.log(item, index);
const itemList = this.ruleForm.list.indexOf(item);
if (itemList !== -1) {
this.ruleForm.list.splice(index, 1);
}
},
//
submitForm() {
this.$refs.formInfo.validate((valid) => {
if (valid) {
// delete this.ruleForm.time;
this.ruleForm.listTime.forEach((val) => {
console.log(val);
this.$set(val, "startTime", new Date(val.startTime));
this.$set(val, "endTime", new Date(val.endTime));
// console.log(val.time[0]);
// console.log(typeof val.time[0]);
// console.log(new Date(val.time[0]));
// console.log(new Date(val.time[1]));
// console.log(new Date(val.time[0]).getHours());
// console.log(new Date(val.time[0]).getMinutes());
});
let arr = [];
for (var i = 0; i < this.ruleForm.listTime.length; i++) {
console.log(this.ruleForm.listTime);
console.log(this.ruleForm.listTime[i].startTime);
arr.push(
{
hour: Math.floor(this.ruleForm.listTime[i].timeSpan / 60),
minute: this.ruleForm.listTime[i].timeSpan % 60,
preset: 255,
},
{
hour: this.ruleForm.listTime[i].startTime.getHours(),
minute: this.ruleForm.listTime[i].startTime.getMinutes(),
preset: 255,
},
{
hour: this.ruleForm.listTime[i].endTime.getHours(),
minute: this.ruleForm.listTime[i].endTime.getMinutes(),
preset: 255,
}
);
}
console.log(arr);
this.ruleForm.list = arr;
if (this.title == "新增") {
addScheduleRulel(this.ruleForm)
.then((res) => {
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.$parent.getruleList();
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
});
} else {
updateScheduleRulel(this.ruleForm)
.then((res) => {
this.isShow = false;
this.$message.success("修改成功");
this.$parent.getruleList();
})
.catch((err) => {
this.$message.error("修改失败");
});
}
} else {
return false;
}
});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
// handleclose() {
// this.$parent.getruleList();
// },
},
mounted() {},
};
</script>
<style lang="less">
.adddeviceDialog {
.el-form {
.addtimeBox {
max-height: 205px;
overflow: auto;
}
.timeBoxArr {
display: flex;
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 226px;
margin-right: 16px;
}
.btngrop {
margin-bottom: 16px;
margin-left: 16px;
height: 32px;
.el-button--small {
padding: 9px 8px;
width: 30px;
}
}
.timeBoxList {
display: flex;
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 100px;
margin-right: 0px;
}
.split {
padding: 0 4px;
}
}
.spanRight {
margin-left: 14px;
}
}
}
}
.el-time-spinner__item.disabled {
cursor: pointer;
}
</style>

@ -0,0 +1,481 @@
<template>
<el-dialog
class="photoSetDialog"
title="设置"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1020px"
>
<div class="setTimeTd" v-loading="rulesLoading">
<div class="ruleinfo">
<!-- <h3>时间表规则</h3> -->
<div class="ruleBox">
<span class="nameinfo">时间表名称{{ currentTimeRule.name }}</span>
<div class="listGz">
<p
class="timeGz"
v-for="(val, index) in currentTimeRule.listTime"
:key="index"
>
<span>{{ val.startTime }} </span>
~
<span>{{ val.endTime }}</span>
间隔<b>{{ val.timeSpan }}分钟</b>
</p>
</div>
<div class="offsetBox">
<div class="math">
设置偏移量(max:10)
<el-input-number
v-model="setNum"
:min="0"
:max="9"
></el-input-number>
</div>
<el-button type="primary" @click="setMathFloor()"></el-button>
</div>
</div>
<div class="channelBox">
<span>请选择通道</span>
<div class="checkBox">
<el-radio-group v-model="channelAisle" @change="handleChange">
<el-radio
:label="val.id"
border
v-for="val in channelList"
:key="val.id"
>{{ val.name }}</el-radio
>
</el-radio-group>
</div>
</div>
</div>
<!-- 装置树状图 -->
<div class="treeDevice" v-loading="treeloading">
<el-tree
ref="tree"
:data="treeList"
:props="defaultProps"
show-checkbox
node-key="id"
default-expand-all
:expand-on-click-node="false"
:default-checked-keys="defaultCheckedKeys"
@check-change="handleCheckChange"
>
<div
class="custom-tree-node"
slot-scope="{ node, data }"
v-if="!data.list"
>
<span class="zzCmdidbox">{{
data.name == null ? data.cmdid : data.name
}}</span>
<!-- -- <span>{{ data.id }}</span
>-- <span>{{ data.onlinestatus == 0 ? "离线" : "在线" }}</span
>--
<span>{{ data.protocol }}</span> -->
<div class="math">
偏移时间()
<el-input-number
v-model="data.setNum"
:min="0"
:max="setNum"
></el-input-number>
</div>
<div class="xfBack">
<el-tag v-if="data.xfloading"
><i class="el-icon-loading"></i>下发中</el-tag
>
<el-tag v-if="data.xferror" type="danger"
><i class="el-icon-error"></i>下发失败</el-tag
>
<el-tag v-if="data.xfsuccess" type="success"
><i class="el-icon-success"></i>下发成功</el-tag
>
<!-- <el-button size="mini" v-if="data.xferror" @click="reissue(data)"
>重新下发</el-button
> -->
</div>
</div>
<div v-else class="custom-tree-node" slot-scope="{ data }">
<span>{{ data.name == null ? data.cmdid : data.name }}</span>
</div>
</el-tree>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleclose"> </el-button>
<el-button type="primary" @click="submitForm()" :loading="sureloading"
> </el-button
>
</div>
</el-dialog>
</template>
<script>
import {
setScheduleRulel,
getScheduleRulelAccessList,
getTermListByChannelJoggle,
getCmaSchelduleUpload,
setTermCamera,
getTermCameraRequest,
} from "@/utils/api/index";
export default {
data() {
return {
isShow: false,
currentTimeRule: [], //
sureloading: false,
setNum: 0,
channelList: [], //
channelAisle: 1, //
rulesLoading: false,
treeloading: false, //loading
treeList: [], //treelist
defaultProps: {
children: "list",
label: "name",
disabled: this.disabledFn,
},
defaultCheckedKeys: [],
checkedNodes: [],
requestid: "", //requestid
deviceTimeLoading: false,
deviceTimer: null, //
deviceNum: 1, //
};
},
mounted() {},
methods: {
getdataform(val) {
console.log(val);
this.currentTimeRule = val;
this.rulesLoading = true;
this.getChannelList();
},
//
setMathFloor() {
console.log(this.setNum);
this.handleChange();
},
//
getChannelList() {
getScheduleRulelAccessList({})
.then((res) => {
console.log(res);
this.rulesLoading = false;
this.channelList = res.data.channellist;
this.handleChange();
})
.catch((err) => {});
},
//
handleChange() {
console.log(this.channelAisle);
console.log("点击了通道");
this.getTreeList();
},
//
getTreeList() {
this.treeloading = true;
getTermListByChannelJoggle({
id: this.channelAisle,
})
.then((res) => {
console.log(res);
this.treeList = this.getChildren(res.data.list);
this.treeloading = false;
})
.catch((err) => {});
},
//treelist
getChildren(data) {
console.log(data);
return data.map((item) => {
//console.log(item);
item = Object.assign({}, item);
item.setNum = Math.floor(Math.random() * 10);
item.xfsuccess = false;
item.xferror = false;
item.xfloading = false;
if (!!item.list && item.list.length > 0) {
item.list = this.getChildren(item.list);
}
return item;
});
},
//线
disabledFn(data, node) {
if (node.level == 3) {
if (!data.onlinestatus) {
//
return true;
} else {
return false;
}
}
},
handleCheckChange(data, checked) {
if (checked) {
this.checkedNodes.push(data);
} else {
const index = this.checkedNodes.findIndex(
(node) => node.id === data.id
);
if (index !== -1) {
this.checkedNodes.splice(index, 1);
}
}
},
submitForm() {
if (this.checkedNodes.length === 0) {
this.$message.warn("请至少选择一个选项");
return;
}
this.sureloading = true;
console.log(this.checkedNodes);
const requests = this.checkedNodes.map((node) => {
console.log(node);
node.xfloading = true; //
node.xferror = false; //
node.xfsuccess = false; //
let params = [
{
name: "act",
value: "schedule",
},
{
name: "flag",
value: 1,
},
{
name: "channel",
value: this.channelAisle,
},
];
// node Axios Promise
let scheduleTimeList = this.currentTimeRule.listTime;
console.log(this.currentTimeRule.listTime);
let timeArr = []; //
//
for (let i = 0; i < scheduleTimeList.length; i++) {
console.log(scheduleTimeList[i]);
var Stime = this.$moment(scheduleTimeList[i].startTime, "HH:mm")
.add(node.setNum, "minute")
.format("YYYY-MM-DD HH:mm:ss");
var Etime = this.$moment(scheduleTimeList[i].endTime, "HH:mm")
.add(node.setNum, "minute")
.format("YYYY-MM-DD HH:mm:ss");
var spanTime = scheduleTimeList[i].timeSpan;
console.log(Stime, Etime, spanTime);
if (node.protocol == "65283" || node.protocol == "65285") {
//
console.log("湖南,河南", scheduleTimeList.length);
//
let fistSpan = this.$moment(new Date())
.startOf("day")
.minutes(spanTime)
.format("YYYY-MM-DD HH:mm:ss");
timeArr.push(fistSpan, Stime, Etime);
console.log(timeArr);
} else {
//
while (
this.$moment(Stime).isBefore(this.$moment(Etime)) ||
this.$moment(Stime).isSame(this.$moment(Etime))
) {
timeArr.push(Stime);
Stime = this.$moment(Stime)
.add(spanTime, "minute")
.format("YYYY-MM-DD HH:mm:ss");
}
}
}
console.log(timeArr);
let group = timeArr.length;
params.push({
name: "group",
value: group,
});
for (let m = 0; m < timeArr.length; m++) {
params.push(
{
name: "hour" + (m + 1),
value: this.$moment(timeArr[m]).hour(),
},
{
name: "min" + (m + 1),
value: this.$moment(timeArr[m]).minute(),
},
{
name: "preset" + (m + 1),
value: 255,
}
);
}
console.log(params);
return this.setTermFnRule(node, params);
});
// 使 Promise.all
Promise.all(requests)
.then(() => {
console.log(requests);
//
console.log("所有请求都已完成。");
})
.catch((error) => {
//
console.error("有一个或多个请求失败。", error);
});
},
//
setTermFnRule(node, dataParams) {
setTermCamera({
termId: node.id,
list: dataParams,
})
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
this.getinfoRules(node);
})
.catch((err) => {});
},
getinfoRules(node) {
console.log(this.deviceNum);
getTermCameraRequest({ requestid: this.requestid })
.then((res) => {
if (res.data.success == 1) {
console.log(JSON.parse(res.data.data));
node.xfloading = false;
node.xfsuccess = true;
this.deviceNum = 0;
this.sureloading = false;
// this.$message({
// duration: 1500,
// showClose: true,
// message: "",
// type: "success",
// });
} else if (res.data.success == 0 && this.deviceNum > 9) {
node.xfloading = false;
node.xfsuccess = false;
node.xferror = true;
this.sureloading = false;
this.deviceNum = 0;
} else {
//
setTimeout(() => {
this.deviceNum++;
this.getinfoRules(node);
}, 2000); // 1
}
})
.catch((err) => {});
},
display() {
this.isShow = true;
},
clearfn() {},
handleclose() {
this.isShow = false;
this.setNum = 0;
this.treeList = []; //treelist
},
},
};
</script>
<style lang="less">
.photoSetDialog {
.setTimeTd {
.ruleinfo {
margin-bottom: 16px;
h3 {
font-size: 14px;
margin-bottom: 8px;
}
.ruleBox {
display: flex;
flex-wrap: wrap;
align-items: center;
line-height: 32px;
margin-bottom: 16px;
.nameinfo {
//margin-bottom: 8px;
margin-right: 16px;
height: 24px;
line-height: 24px;
}
.timeGz {
height: 24px;
line-height: 24px;
b {
font-weight: 400;
color: #169e8c;
}
}
}
.offsetBox {
margin-left: 24px;
display: flex;
align-items: center;
.math {
margin-right: 12px;
}
}
}
.channelBox {
margin-bottom: 16px;
line-height: 32px;
display: flex;
height: 32px;
.checkBox {
.el-radio {
margin-right: 12px;
}
}
}
.treeDevice {
background-color: #169e8c;
height: 366px;
// overflow: auto;
display: flex;
align-items: flex-start;
border: 1px solid #eee;
padding: 8px;
border-radius: 4px;
position: relative;
.el-tree {
width: 100%;
height: 100%;
overflow: auto;
.el-tree-node {
.el-tree-node__content {
height: 32px;
border-bottom: 1px solid #eee;
}
}
.custom-tree-node {
display: flex;
align-items: center;
}
.math {
margin-left: 24px;
}
.xfBack {
margin-left: 24px;
}
}
}
}
}
</style>

@ -0,0 +1,744 @@
<template>
<el-dialog
class="photoSetDialog"
title="设置"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1020px"
@close="handleclose"
>
<div class="setTimeTd">
<div class="ruleBox">
<h3>时间表规则</h3>
<div class="flexTimeGz">
<p class="timeGz" v-for="(val, index) in ruleSchedule" :key="index">
<span>
{{
new Date(val.startTime).getHours() < 10
? "0" + new Date(val.startTime).getHours()
: new Date(val.startTime).getHours()
}}:
{{
new Date(val.startTime).getMinutes() < 10
? "0" + new Date(val.startTime).getMinutes()
: new Date(val.startTime).getMinutes()
}}</span
>
~
<span
>{{
new Date(val.endTime).getHours() < 10
? "0" + new Date(val.endTime).getHours()
: new Date(val.endTime).getHours()
}}:
{{
new Date(val.endTime).getMinutes() < 10
? "0" + new Date(val.endTime).getMinutes()
: new Date(val.endTime).getMinutes()
}}</span
>
间隔<b>{{ val.span }}分钟</b>
</p>
</div>
<div class="mathFloor">
<span class="mathTitle">设置偏移量(max:10)</span>
<el-input-number
v-model="mathMam"
:min="0"
:max="10"
></el-input-number>
<el-button type="primary" @click="setMathFloor()"></el-button>
</div>
</div>
<!-- <h3>设置通道</h3> -->
<div class="chooseTDBox">
<label>选择通道:</label>
<div class="checkBox">
<el-radio-group v-model="checkedAisle" @change="handleChange">
<el-radio
:label="val.id"
border
v-for="val in aisleList"
:key="val.id"
>{{ val.name }}</el-radio
>
</el-radio-group>
</div>
</div>
<div
class="flexnr"
v-loading="loading"
v-if="newzzList.length !== 0 || loading"
>
<el-tree
:class="sureloading ? 'noallow' : ''"
:data="newzzList"
show-checkbox
:props="defaultProps"
ref="tree"
node-key="id"
:default-expand-all="true"
@check-change="getCheckedNodes"
>
<div
v-if="!data.list"
class="custom-tree-node nodelist"
slot-scope="{ data }"
>
<span class="mr10">{{
data.name == null ? data.cmdid : data.name
}}</span>
<div class="math">
偏移时间()
<el-input-number
v-model="data.offsetNum"
:min="0"
:max="mathMam"
></el-input-number>
</div>
<div class="deStatus" v-if="allCheckNode.indexOf(data) != -1">
<el-tag v-if="xfload && showtag"
><i class="el-icon-loading"></i>下发中</el-tag
>
<el-tag
type="danger"
v-if="
nosuccessData.findIndex((item) => item.termid === data.id) !==
-1 &&
showtag &&
!xfload
"
>下发失败</el-tag
>
<el-tag
type="success"
v-if="
nosuccessData.findIndex((item) => item.termid === data.id) ==
-1 &&
showtag &&
!xfload
"
>下发成功</el-tag
>
</div>
<!-- <div
class="deStatus"
v-if="allCheckNode.indexOf(data) != -1 && showtag"
>
<el-tag
type="success"
v-if="xfsuccess && allCheckNode.indexOf(data) != -1 && showtag"
>下发成功</el-tag
>
<el-tag v-if="xfload && showtag"
><i class="el-icon-loading"></i>下发中</el-tag
>
<el-tag
type="danger"
v-if="xferror && allCheckNode.indexOf(data) != -1 && showtag"
>下发失败</el-tag
>
</div> -->
</div>
<span v-else class="custom-tree-node" slot-scope="{ data }">
<span>{{ data.name == null ? data.cmdid : data.name }}</span>
</span>
</el-tree>
</div>
<div class="flexnr" v-else>
<p class="nochannel">暂无图像监测装置</p>
</div>
</div>
<div slot="footer" class="dialog-footer">
<!-- <el-button @click="getCheckedNodes"></el-button> -->
<el-button @click="handleclose"> </el-button>
<el-button type="primary" @click="submitForm()" :loading="sureloading"
> </el-button
>
</div>
</el-dialog>
</template>
<script>
import {
setScheduleRulel,
getScheduleRulelAccessList,
getTermListByChannelJoggle,
getCmaSchelduleUpload,
} from "@/utils/api/index";
import moment from "moment";
export default {
props: {
title: String,
},
data() {
return {
isactive: "",
contentStyle: { width: "90px" },
isShow: false,
selid: 0, //id
ruleSchedule: [], //
checkedAisle: 1, //
aisleList: [], //
listnr: [], //
defaultProps: {
children: "list",
label: "name",
disabled: this.disabledFn,
},
termidArr: [],
ruleid: "",
parmsList: [], //
multipleSelection: [],
//
newzzList: [],
zzListCheck: [],
loading: false,
//
checkAll: true,
isIndeterminate: true, //
timer: null,
termidArrNum: -1,
requestList: [],
timer: null,
i: 0,
isCheck: false,
checkNode: null,
zzsuccess: false,
zzpending: false,
zzerror: false,
allCheckNode: [], //
requestArr: [], //requestid
termzzid: [],
flag: false,
sureloading: false,
showtag: false,
checkOffset: "",
mathMam: 0,
//
nosuccessData: [],
xfsuccess: false,
xfload: false,
xferror: false,
};
},
mounted() {},
methods: {
//
getdataform(val) {
console.log(val);
this.selid = val.id;
this.ruleSchedule = val.listTime;
console.log(this.ruleSchedule);
// console.log(this.ruleSchedule, "");
this.getlistnr();
},
//
getlistnr() {
getScheduleRulelAccessList({})
.then((res) => {
this.listnr = res.data.list;
this.aisleList = res.data.channellist;
this.handleChange();
})
.catch((err) => {});
},
//
handleChange() {
console.log(this.checkedAisle);
this.loading = true;
getTermListByChannelJoggle({
id: this.checkedAisle,
})
.then((res) => {
console.log(res);
this.newzzList = res.data.list;
console.log(this.newzzList);
this.newzzList = this.getChildren(this.newzzList);
console.log(this.newzzList);
this.loading = false;
})
.catch((err) => {});
},
//线
disabledFn(data, node) {
if (node.level == 3) {
if (!data.onlinestatus) {
//
return true;
} else {
return false;
}
}
},
// isEdit
getChildren(data) {
//console.log(data);
return data.map((item) => {
//console.log(item);
item = Object.assign({}, item);
item.offsetNum = Math.floor(Math.random() * 10);
if (!!item.list && item.list.length > 0) {
item.list = this.getChildren(item.list);
}
return item;
});
},
handleCheckBox() {
console.log(this.zzListCheck);
},
//
setMathFloor() {
console.log(this.mathMam);
this.handleChange();
},
// //
getCheckedNodes(nodeObj) {
this.allCheckNode = this.$refs.tree.getCheckedNodes();
// console.log(this.allCheckNode);
console.log(nodeObj);
console.log(this.allCheckNode);
this.isactive = nodeObj.id || nodeObj.termid;
this.isCheck = this.$refs.tree.getCheckedNodes().indexOf(nodeObj) > -1;
console.log(this.isCheck);
this.showtag = false;
},
//
submitForm() {
//console.log(this.termidArr);
this.sureSum();
this.showtag = true;
this.xfload = true;
this.sureloading = true;
},
//
sureSum() {
console.log(this.checkedAisle);
var ruleBox = [];
//
for (var i = 0; i < this.allCheckNode.length; i++) {
console.log(this.allCheckNode[i].bsManufacturer);
if (
this.allCheckNode[i].bsManufacturer == null ||
this.allCheckNode[i].bsManufacturer == undefined
) {
console.log(this.allCheckNode[i].offsetNum);
//
let timearr = [];
let dayArr = [];
for (var j = 0; j < this.ruleSchedule.length; j++) {
console.log(this.ruleSchedule);
console.log(this.ruleSchedule[j].startTime);
// var Stime = moment(this.ruleSchedule[j].startTime).format("HH:mm");
// var Etime = moment(this.ruleSchedule[j].endTime).format("HH:mm");
var Stime = moment(this.ruleSchedule[j].startTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.format();
var Etime = moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.format();
var lastETime = moment(this.ruleSchedule[j].endTime).format();
var spanTime = this.ruleSchedule[j].span;
console.log(spanTime);
console.log(moment(this.ruleSchedule[j].endTime).hour());
//
if (this.allCheckNode[i].protocol == "65283") {
console.log("湖南规约");
console.log(Stime, Etime);
console.log(typeof Stime);
console.log(
moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.hour()
);
console.log(
moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.minute()
);
//
console.log(moment().isSame(moment(Etime), "day"));
//
if (moment().isSame(moment(Etime), "day")) {
//
timearr.push(
{
hour: Math.floor(this.ruleSchedule[j].span / 60),
minute: this.ruleSchedule[j].span % 60,
preset: 255,
},
{
hour: moment(this.ruleSchedule[j].startTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.hour(),
minute: moment(this.ruleSchedule[j].startTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.minute(),
preset: 255,
},
{
hour: moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.hour(),
minute: moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.minute(),
preset: 255,
}
);
} else {
timearr.push(
{
hour: Math.floor(this.ruleSchedule[j].span / 60),
minute: this.ruleSchedule[j].span % 60,
preset: 255,
},
{
hour: moment(this.ruleSchedule[j].startTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.hour(),
minute: moment(this.ruleSchedule[j].startTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.minute(),
preset: 255,
},
{
hour: moment(this.ruleSchedule[j].endTime).hour(),
minute: moment(this.ruleSchedule[j].endTime).minute(),
preset: 255,
}
);
}
console.log(timearr);
}
////
if (
this.allCheckNode[i].protocol == "65286" ||
this.allCheckNode[i].protocol == "65282" ||
this.allCheckNode[i].protocol == "65280" ||
this.allCheckNode[i].protocol == "65296" ||
this.allCheckNode[i].protocol == "65281" ||
this.allCheckNode[i].protocol == "65284" ||
this.allCheckNode[i].protocol == "65285"
) {
console.log("河南规约");
//
//this.getDayArr(startDay, endDay);
let startDay = Stime;
let endDay = Etime;
var lastendDay = lastETime;
console.log(lastETime);
console.log(startDay, endDay);
let startVal = this.$moment(new Date(startDay)).format(
"YYYY-MM-DD HH:mm"
);
console.log(startVal);
console.log(moment().isSame(moment(endDay), "day"));
while (this.$moment(startVal).isBefore(endDay)) {
dayArr.push(startVal);
//
startVal = this.$moment(new Date(startVal))
.add(spanTime, "minute")
.format("YYYY-MM-DD HH:mm");
console.log(startVal);
}
// //
if (!moment().isSame(moment(endDay), "day")) {
// console.log("dayArr");
// console.log(dayArr);
// console.log(
// this.$moment(new Date(lastETime)).format("YYYY-MM-DD HH:mm")
// );
// dayArr.push(
// this.$moment(new Date(lastETime)).format("YYYY-MM-DD HH:mm")
// );
}
}
}
//console.log(dayArr);
for (var k = 0; k < dayArr.length; k++) {
//console.log(moment(dayArr[k]).hour());
timearr.push({
hour: moment(dayArr[k]).hour(),
minute: moment(dayArr[k]).minute(),
preset: 255,
});
}
// return dayArr;
var parmsobj = {
termid: this.allCheckNode[i].id,
channelid: this.checkedAisle,
offset: this.allCheckNode[i].offsetNum,
list: timearr,
};
//console.log(parmsobj);
ruleBox.push(parmsobj);
}
//console.log(ruleBox);
}
setScheduleRulel({
list: ruleBox,
scheduleid: this.selid,
})
.then((res) => {
console.log(res);
this.requestList = res.data.list;
this.requestTime();
this.timer = window.setInterval(() => {
//console.log(this.requestList);
this.requestTime();
this.i++;
}, 3000);
})
.catch((err) => {
// this.$message({
// duration: 1500,
// showClose: true,
// message: "",
// type: "error",
// });
});
},
//
//
getHnTime() {},
//
getZzTime() {},
//requestid
requestTime() {
this.sureloading = true;
getCmaSchelduleUpload({
list: this.requestList,
})
.then((res) => {
this.requestArr = res.data.list;
this.requestList = this.requestArr.filter(function (
value,
index,
arr
) {
console.log(value, index, arr);
return value.status !== 1;
});
if (this.requestList.length == 0) {
this.zzsuccess = true;
this.$message.success("下发成功");
clearInterval(this.timer);
this.timer = null;
this.sureloading = false;
this.xfload = false;
} else if (this.i > 9) {
console.log(this.requestArr);
this.nosuccessData = this.requestArr;
// this.allCheckNode.forEach((item, i) => {
// this.$refs.tree.setChecked(item.id, false, true);
// });
// this.nosuccessData.forEach((item, i) => {
// this.$refs.tree.setChecked(item.termid, true, true);
// });
this.i = 0;
// this.$message.warning("");
clearInterval(this.timer);
this.timer = null;
this.xfload = false;
this.sureloading = false;
}
})
.catch((err) => {});
},
display() {
this.isShow = true;
},
clearfn() {
clearTimeout(this.timer);
this.timer = null;
},
handleclose() {
this.isShow = false;
this.newzzList = [];
this.checkedAisle = 1;
this.mathMam = 0;
console.log(this.allCheckNode, "1111111111");
clearTimeout(this.timer);
this.timer = null;
this.sureloading = false;
this.showtag = false;
},
},
};
</script>
<style lang="less">
.photoSetDialog {
.el-dialog__body {
// height: 360px;
// overflow: auto;
}
.flexnr {
height: 360px;
overflow: auto;
display: flex;
align-items: flex-start;
border: 1px solid #eee;
padding: 16px;
border-radius: 4px;
position: relative;
.el-tree {
flex: 1;
border: 1px solid #eee;
.el-tree-node {
.el-tree-node__content {
height: 40px;
border-bottom: 1px solid #eee;
.mr10 {
margin-right: 10px;
width: 180px;
}
.nodelist {
display: flex;
align-items: center;
.math {
margin-left: 32px;
}
.deStatus {
margin-left: 24px;
}
}
}
}
}
.noallow {
.el-tree-node .el-tree-node__content {
pointer-events: none;
}
}
.dybox {
h4 {
font-size: 14px;
color: #333;
line-height: 24px;
font-weight: normal;
}
.xlbox {
h4 {
font-size: 14px;
color: #333;
line-height: 24px;
font-weight: normal;
}
margin-left: 16px;
.zzbox {
h4 {
}
.el-checkbox-group {
// display: flex;
// flex-direction: column;
margin-left: 22px;
.el-checkbox {
line-height: 28px;
//width: 196px;
.el-checkbox__label {
b {
margin-left: 18px;
font-weight: normal;
font-size: 12px;
}
}
}
}
}
}
}
.nochannel {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
}
.w50 {
width: 50px;
}
.setTimeTd {
.ruleBox {
display: flex;
align-items: center;
}
h3 {
margin: 8px 0px;
font-size: 16px;
line-height: 24px;
}
.flexTimeGz {
display: flex;
flex-wrap: wrap;
.timeGz {
line-height: 32px;
margin-right: 16px;
b {
font-weight: normal;
color: #169e8c;
}
span {
margin: 0px 8px;
}
}
}
.mathFloor {
margin-left: 20px;
.el-button {
margin-left: 12px;
}
}
.setCheckbox {
.el-table__header .el-table-column--selection .cell .el-checkbox:after {
color: #333;
content: "全选";
font-size: 16px;
margin-left: 12px;
font-weight: bold;
}
}
}
.chooseTDBox {
display: flex;
align-items: center;
margin-bottom: 8px;
margin-top: 12px;
label {
margin-right: 8px;
}
}
.treeTable {
margin-top: 16px;
}
}
</style>

@ -0,0 +1,508 @@
<template>
<el-dialog
class="photoSetDialog"
title="设置"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1020px"
@close="handleclose"
>
<div class="setTimeTd" v-loading="timeboxLoading">
<div class="headTitle">
<div class="rulesInfo">
<h3>时间表规则</h3>
<div class="timeBox" v-for="(val, index) in rulesList" :key="index">
<div class="timeSlot">
{{
new Date(val.startTime).getHours() < 10
? "0" + new Date(val.startTime).getHours()
: new Date(val.startTime).getHours()
}}:
{{
new Date(val.startTime).getMinutes() < 10
? "0" + new Date(val.startTime).getMinutes()
: new Date(val.startTime).getMinutes()
}}
~
{{
new Date(val.endTime).getHours() < 10
? "0" + new Date(val.endTime).getHours()
: new Date(val.endTime).getHours()
}}:
{{
new Date(val.endTime).getMinutes() < 10
? "0" + new Date(val.endTime).getMinutes()
: new Date(val.endTime).getMinutes()
}}
</div>
<div class="timespan">
间隔<b>{{ val.span }}分钟</b>
</div>
</div>
</div>
</div>
<div class="mathFloor">
<span class="mathTitle">设置偏移量(max:10)</span>
<el-input-number v-model="mathMam" :min="0" :max="10"></el-input-number>
<el-button type="primary" @click="setMathFloor()"></el-button>
</div>
<div class="channelBox">
<span class="channelTitle">选择通道</span>
<div class="checkBox" v-if="channelList.length !== 0">
<el-radio-group v-model="checkedAisle" @change="handleChange">
<el-radio
:label="val.id"
border
v-for="val in channelList"
:key="val.id"
>{{ val.name }}</el-radio
>
</el-radio-group>
</div>
</div>
<div class="treebox" v-loading="treeloading">
<el-tree
ref="tree"
:data="treeList"
:props="defaultProps"
show-checkbox
node-key="id"
default-expand-all
:expand-on-click-node="false"
@check="getCheckedNodes"
>
<div
class="custom-tree-node"
slot-scope="{ node, data }"
v-if="!data.list"
>
<span class="zzCmdidbox">{{
data.name == null ? data.cmdid : data.name
}}</span
>-- <span>{{ data.id }}</span
>-- <span>{{ data.onlinestatus == 0 ? "离线" : "在线" }}</span
>--
<span>{{ data.protocol }}</span>
<div class="math">
偏移时间()
<el-input-number
v-model="data.offsetNum"
:min="0"
:max="mathMam"
></el-input-number>
</div>
<div class="xfBack" v-if="allCheckNode.indexOf(data) != -1">
<el-tag v-if="data.xfloading"
><i class="el-icon-loading"></i>下发中</el-tag
>
<el-tag v-if="data.xferror" type="danger"
><i class="el-icon-error"></i>下发失败</el-tag
>
<el-tag v-if="data.xfsuccess" type="success"
><i class="el-icon-success"></i>下发成功</el-tag
>
<el-button size="mini" v-if="data.xferror" @click="reissue(data)"
>重新下发</el-button
>
</div>
</div>
<div v-else class="custom-tree-node" slot-scope="{ data }">
<span>{{ data.name == null ? data.cmdid : data.name }}</span>
</div>
</el-tree>
</div>
</div>
<div slot="footer" class="dialog-footer">
<!-- <el-button @click="getCheckedNodes"></el-button> -->
<el-button @click="handleclose"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
setScheduleRulel,
getScheduleRulelAccessList,
getTermListByChannelJoggle,
//setTermCamera,
//getTermCameraRequest,
getCmaSchelduleUpload,
} from "@/utils/api/index";
// import moment from "moment";
export default {
data() {
return {
isShow: false,
timeboxLoading: false,
rulesTimeList: "", //
rulesList: [],
rulesid: "", //id
mathMam: 0, //0
checkedAisle: 1, //
channelList: [], //
treeloading: false,
treeList: [], //
defaultProps: {
children: "list",
label: "name",
disabled: this.disabledFn,
},
allCheckNode: [], //
groupNum: "", //
xfloading: false,
xferror: false,
xfsuccess: false,
requestList: [], //requesids
timer: null,
imun: 0,
successTermid: [], //
errorTermid: [], //
};
},
mounted() {},
methods: {
//
getdataform(val) {
console.log(val);
this.rulesTimeList = val;
this.rulesid = val.id;
this.rulesList = val.listTime;
this.timeboxLoading = true;
this.getChannelList();
},
//
setMathFloor() {
console.log(this.mathMam);
this.handleChange();
},
//线
disabledFn(data, node) {
if (node.level == 3) {
if (!data.onlinestatus) {
//
return true;
} else {
return false;
}
}
},
// //
getCheckedNodes(nodeObj) {
console.log(nodeObj);
this.allCheckNode = this.$refs.tree.getCheckedNodes();
console.log(this.allCheckNode);
// console.log(nodeObj);
// console.log(this.allCheckNode);
// this.isactive = nodeObj.id || nodeObj.termid;
// this.isCheck = this.$refs.tree.getCheckedNodes().indexOf(nodeObj) > -1;
// console.log(this.isCheck);
// this.showtag = false;
},
// offsetNum
getChildren(data) {
//console.log(data);
return data.map((item) => {
//console.log(item);
item = Object.assign({}, item);
item.offsetNum = Math.floor(Math.random() * 10);
item.xfsuccess = false;
item.xferror = false;
item.xfloading = false;
if (!!item.list && item.list.length > 0) {
item.list = this.getChildren(item.list);
}
return item;
});
},
//
submitForm() {
console.log(this.allCheckNode);
this.xfloading = true;
var ruleBox = []; //
//
for (let i = 0; i < this.allCheckNode.length; i++) {
if (
this.allCheckNode[i].bsManufacturer == null ||
this.allCheckNode[i].bsManufacturer == undefined
) {
this.allCheckNode[i].xfloading = true;
let timearr = [];
let dayArr = [];
for (let j = 0; j < this.rulesList.length; j++) {
var Stime = this.$moment(this.rulesList[j].startTime).add(
this.allCheckNode[i].offsetNum,
"minute"
);
var Etime = this.$moment(this.rulesList[j].endTime).add(
this.allCheckNode[i].offsetNum,
"minute"
);
var spanTime = this.rulesList[j].span;
console.log(Stime, Etime, spanTime);
//
if (this.allCheckNode[i].protocol == "65283") {
timearr.push(
{
hour: Math.floor(spanTime / 60),
minute: spanTime % 60,
preset: 255,
},
{
hour: Stime.hour(),
minute: Etime.minute(),
preset: 255,
},
{
hour: Stime.hour(),
minute: Etime.minute(),
preset: 255,
}
);
console.log(timearr);
} else {
//
let startDay = Stime;
let endDay = Etime;
let startVal = this.$moment(new Date(startDay)).format(
"YYYY-MM-DD HH:mm"
);
while (this.$moment(startVal).isBefore(endDay)) {
dayArr.push(startVal);
//
startVal = this.$moment(new Date(startVal))
.add(spanTime, "minute")
.format("YYYY-MM-DD HH:mm");
}
}
}
console.log(dayArr);
for (var k = 0; k < dayArr.length; k++) {
//console.log(moment(dayArr[k]).hour());
timearr.push({
hour: this.$moment(dayArr[k]).hour(),
minute: this.$moment(dayArr[k]).minute(),
preset: 255,
});
}
console.log(timearr);
var parmsobj = {
termid: this.allCheckNode[i].id,
channelid: this.checkedAisle,
offset: this.allCheckNode[i].offsetNum,
list: timearr,
};
ruleBox.push(parmsobj);
}
}
//
setScheduleRulel({
list: ruleBox,
scheduleid: this.rulesid,
})
.then((res) => {
console.log(res);
this.requestList = res.data.list;
// this.requestTime();
this.timer = window.setInterval(() => {
//console.log(this.requestList);
this.requestTime();
this.imun++;
}, 3000);
})
.catch((err) => {});
},
//requestid
requestTime() {
this.sureloading = true;
getCmaSchelduleUpload({
list: this.requestList,
})
.then((res) => {
this.requestArr = res.data.list;
console.log(this.requestList);
this.requestList = this.requestArr.filter(function (
value,
index,
arr
) {
console.log(value, index, arr);
return value.status !== 1;
});
if (this.requestList.length == 0) {
console.log(this.successTermid);
console.log(this.errorTermid);
this.$message.success("下发成功");
clearInterval(this.timer);
this.timer = null;
} else if (this.imun > 9) {
console.log(this.requestList);
for (let m = 0; m < this.requestList.length; m++) {
console.log(this.requestList[m]);
this.errorTermid.push(this.requestList[m].termid);
}
console.log(this.errorTermid);
clearInterval(this.timer);
this.timer = null;
this.imun = 0;
// this.$message.warning("");
}
})
.catch((err) => {});
},
//
reissue(val) {
console.log(val);
val.xfloading = true;
val.xferror = false;
setTimeout(() => {
val.xfloading = false;
val.xfsuccess = true;
val.xferror = false;
}, 2000);
},
//
getChannelList() {
getScheduleRulelAccessList({})
.then((res) => {
console.log(res);
this.channelList = res.data.channellist;
this.handleChange();
})
.catch((err) => {});
},
//
handleChange() {
console.log(this.checkedAisle);
this.treeloading = true;
getTermListByChannelJoggle({
id: this.checkedAisle,
})
.then((res) => {
console.log(res);
this.timeboxLoading = false;
//this.treeList = res.data.list;
this.treeList = this.getChildren(res.data.list);
this.treeloading = false;
})
.catch((err) => {});
},
display() {
this.isShow = true;
},
clearfn() {},
handleclose() {
this.isShow = false;
},
},
};
</script>
<style lang="less">
.photoSetDialog {
.setTimeTd {
//background-color: #fcc;
.headTitle {
.rulesInfo {
display: flex;
align-items: center;
line-height: 32px;
h3 {
font-size: 14px;
font-weight: normal;
}
.timeBox {
display: flex;
align-items: center;
font-size: 14px;
margin-right: 8px;
.timeSlot {
font-size: 14px;
margin-right: 8px;
}
.timespan {
b {
font-size: 14px;
font-weight: normal;
color: #169e8c;
}
}
}
}
}
.mathFloor {
margin-top: 8px;
.mathTitle {
font-size: 14px;
font-weight: normal;
}
.el-button {
margin-left: 8px;
}
}
.channelBox {
display: flex;
align-items: center;
line-height: 32px;
margin-top: 8px;
.channelTitle {
font-size: 14px;
}
.el-radio {
margin-right: 8px;
}
}
.treebox {
margin-top: 8px;
background-color: #169e8c;
height: 366px;
// overflow: auto;
display: flex;
align-items: flex-start;
border: 1px solid #eee;
padding: 8px;
border-radius: 4px;
position: relative;
.el-tree {
width: 100%;
height: 100%;
overflow: auto;
.el-tree-node {
.el-tree-node__content {
height: 32px;
border-bottom: 1px solid #eee;
}
}
.custom-tree-node {
display: flex;
align-items: center;
.zzCmdidbox {
width: 180px;
}
.math {
margin-left: 32px;
}
.xfBack {
margin-left: 32px;
}
.el-input-number--small {
line-height: 26px;
}
.el-input--small .el-input__inner {
height: 26px;
line-height: 26px;
}
.el-input-number__increase {
height: 24px;
}
}
}
}
}
}
</style>

@ -0,0 +1,295 @@
<template>
<div class="deviceInformation">
<div class="deviceBox">
<div class="deviceBtnGroup">
<h4>拍照时间表设置</h4>
<el-button
type="primary"
icon="el-icon-plus"
@click.native.stop="handleAdddevice()"
>新增</el-button
>
</div>
<div class="deviceTable">
<el-table
ref="multipleTable"
:data="rulesListNew"
stripe
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 40px)"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
v-loading="loading"
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column label="名称" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="时间表规则">
<template slot-scope="scope">
<p
class="timeGz"
v-for="(val, index) in scope.row.listTime"
:key="index"
>
<span>{{ val.startTime }} </span>
~
<span>{{ val.endTime }}</span>
间隔<b>{{ val.timeSpan }}分钟</b>
</p>
</template>
</el-table-column>
<el-table-column
prop="remark"
label="备注"
show-overflow-tooltip
></el-table-column>
<el-table-column fixed="right" label="操作" width="200">
<template slot-scope="scope">
<el-button
@click.native.stop="handleResive(scope.row)"
type="text"
>修改</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
>删除</el-button
>
<el-button type="text" @click.native.stop="handleSet(scope.row)"
>设置</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
<!-- 新增时间表 -->
<adddeviceDialog :title="title" ref="adddeviceDialogref"></adddeviceDialog>
<!-- 设置时间表 -->
<bdSchedule ref="setdeviceDialogref"></bdSchedule>
</div>
</template>
<script>
import {
getScheduleRulelListJoggle,
deleteScheduleRulel,
} from "@/utils/api/index";
import adddeviceDialog from "./components/adddeviceDialog.vue";
import bdSchedule from "./components/bdSchedule.vue";
export default {
components: {
adddeviceDialog,
bdSchedule,
},
data() {
return {
title: "", //
rulesListNew: [],
newList: [],
listTime: [],
//multipleSelection: [], //
page: 1, //
pageSize: 20, //
total: 0, //
loading: true,
};
},
created() {
this.getruleList();
},
methods: {
//
getruleList() {
this.loading = true;
getScheduleRulelListJoggle({
pageindex: this.page,
pagesize: this.pageSize,
})
.then((res) => {
console.log(res);
this.rulesList = res.data.list;
this.total = res.data.total;
this.rulesListNew = [];
this.changeListData(this.rulesList);
this.loading = false;
})
.catch((err) => {});
},
//
changeListData(data) {
//
for (let i = 0; i < data.length; i++) {
console.log(data[i]);
var ruleArr = [];
//
for (let k = 0; k < data[i].list.length; k++) {
if (k % 3 == 0) {
//
var ruleObj = {};
ruleObj.timeSpan =
data[i].list[k].hour * 60 + data[i].list[k].minute;
console.log("时间间隔", ruleObj.timeSpan);
} else if (k % 3 == 1) {
//
ruleObj.startTime = this.$moment(data[i].list[k]).format("HH:mm");
console.log(this.$moment(data[i].list[k]).format("HH:mm"));
} else if (k % 3 == 2) {
ruleObj.endTime = this.$moment(data[i].list[k]).format("HH:mm");
console.log(this.$moment(data[i].list[k]).format("HH:mm"));
ruleArr.push(ruleObj);
}
}
this.rulesListNew.push({
id: data[i].id,
list: data[i].list,
name: data[i].name,
remark: data[i].remark,
listTime: ruleArr,
});
}
console.log(this.rulesListNew);
},
//
handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row);
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
handleAdddevice() {
this.title = "新增";
this.$refs.adddeviceDialogref.display();
this.$refs.adddeviceDialogref.getdataform(null);
},
//
handleResive(data) {
this.title = "修改";
this.$refs.adddeviceDialogref.display();
this.$refs.adddeviceDialogref.getdataform(data);
},
//
handleSet(data) {
this.$refs.setdeviceDialogref.display();
this.$refs.setdeviceDialogref.getdataform(data);
},
//
handleDelete(data) {
let deleteArr = [];
deleteArr.push({
id: data.id,
});
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deleteScheduleRulel({ list: deleteArr }).then((res) => {
this.getruleList(); //
});
this.$message({
duration: 1500,
showClose: true,
type: "success",
message: "删除成功!",
});
})
.catch(() => {
this.$message({
duration: 1500,
showClose: true,
type: "info",
message: "已取消删除",
});
});
},
//
handleCurrentChange(val) {
this.page = val;
this.getruleList();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getruleList();
},
},
};
</script>
<style lang="less">
.deviceInformation {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.deviceBox {
border: 1px solid #dddddd;
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
}
.deviceBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
}
.deviceTable {
margin-top: 16px;
height: calc(100% - 48px);
//background: #fcc;
.rulesBox {
display: flex;
flex-direction: row;
li {
list-style: none;
margin-right: 24px;
line-height: 24px;
span {
margin-right: 4px;
}
.el-tag--small {
height: 16px;
padding: 0 8px;
line-height: 16px;
}
}
}
.timeGz {
line-height: 32px;
b {
font-weight: normal;
color: #169e8c;
}
span {
margin: 0px 8px;
}
}
}
}
</style>

@ -0,0 +1,595 @@
<template>
<div class="stritleEchartsPage">
<div class="echart-top">
<el-card class="box-card" v-loading="numloading">
<h3>装置数量统计</h3>
<!-- <el-button class="lookBtn" type="primary" @click="handleLook"
>查看</el-button
> -->
<div class="bottomM">
<div class="infoBox">
<p @click="handleLook(-1)">
<span>装置总数</span>
<span>{{ termDataNum.totalNum ? termDataNum.totalNum : 0 }}</span>
</p>
<p @click="handleLook(1)">
<span>在线数量</span>
<span>{{
termDataNum.onlineNum ? termDataNum.onlineNum : 0
}}</span>
</p>
<p @click="handleLook(0)">
<span>离线率</span>
<span
>{{
termDataNum.offlinePercent
? (termDataNum.offlinePercent * 100).toFixed(2)
: 0
}}%</span
>
</p>
<p>
<span @click="handleLook(1)">线</span>
<span
>{{
termDataNum.onlinePercent
? (termDataNum.onlinePercent * 100).toFixed(2)
: 0
}}%</span
>
</p>
</div>
</div>
</el-card>
<el-card class="box-card">
<h3>装置在线统计</h3>
<div id="echart2" class="chartClass" v-loading="pieloading"></div>
</el-card>
</div>
<div class="echart-top">
<el-card class="box-card" v-loading="barloading">
<h3>7天告警数量统计</h3>
<div class="dateBox">
<span class="datemsg">当前日期前七天</span>
<el-date-picker
v-model="dateValue"
align="right"
type="date"
placeholder="选择日期"
:picker-options="singpickerOptions"
@change="changedate"
>
</el-date-picker>
</div>
<div id="echart3" class="chartClass"></div>
</el-card>
<el-card class="box-card" v-loading="pie2loading">
<h3>告警类型统计</h3>
<div class="dateBox">
<el-date-picker
v-model="dateValue2"
align="right"
type="date"
placeholder="选择日期"
:picker-options="singpickerOptions"
@change="changedate2"
>
</el-date-picker>
</div>
<div id="echart4" class="chartClass"></div>
</el-card>
</div>
<el-dialog
class="exportDialog"
title="装置列表"
width="70%"
:visible.sync="dialogTableVisible"
>
<div class="exportList" v-loading="exportLoading">
<el-button
class="exportbtn"
type="primary"
@click="handleExport(paramsLineVal)"
>导出</el-button
>
<el-table
:data="onLineData"
stripe
tooltip-effect="dark"
height="calc(100% - 54px)"
>
<el-table-column prop="lineName" label="线路名称"></el-table-column>
<el-table-column prop="towerName" label="杆塔名称"></el-table-column>
<el-table-column prop="cmdId" label="装置ID"></el-table-column>
<el-table-column
prop="hearttime"
label="最新心跳时间"
></el-table-column>
<el-table-column
prop="pictime"
label="最新图片拍照时间"
></el-table-column>
<el-table-column prop="isonline" label="是否在线"></el-table-column>
<el-table-column prop="longitude" label="经度"></el-table-column>
<el-table-column prop="latitude" label="纬度"></el-table-column>
</el-table>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getTermStatistics,
getWeekAlarmStatistics,
getTodayAlarmStatistics,
getOnlineTerminalList,
getOnlineTerminalListExcel,
} from "@/utils/api/index";
export default {
name: "",
data() {
return {
termDataNum: "", //
dateValue: "", //7
dateValue2: "", //
weekData: [], //7
todayAlarm: [], //
singpickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
},
myChart2: "",
myChart3: "",
myChart4: "",
numloading: false,
pieloading: false,
barloading: false,
pie2loading: false,
dialogTableVisible: false,
onLineData: [],
exportLoading: false,
paramsLineVal: "",
};
},
created() {
console.log(window.devicePixelRatio);
},
mounted() {
this.getDateTime(); //
this.getTermData();
this.getWeekAlarmStatistics();
this.getTodayAlarmStatistics();
},
watch: {
"$store.state.collapse"(val) {
console.log(val);
setTimeout(() => {
//echarts
this.myChart1.resize();
this.myChart2.resize();
this.myChart3.resize();
this.myChart4.resize();
}, 300);
},
},
methods: {
//线
handleLook(val) {
console.log(val);
this.paramsLineVal = val;
this.dialogTableVisible = true;
this.exportLoading = true;
getOnlineTerminalList({
type: val,
})
.then((res) => {
console.log(res);
this.onLineData = res.data;
this.exportLoading = false;
console.log(this.onLineData);
})
.catch((err) => {});
},
//
handleExport(val) {
console.log(val);
window.location.href = "/api/api/getOnlineTerminalListExcel?type=" + val;
},
//
changedate() {
console.log(this.dateValue.getTime());
this.dateValue = this.dateValue.getTime();
this.getWeekAlarmStatistics();
},
//
changedate2() {
console.log(this.dateValue2.getTime());
this.dateValue2 = this.dateValue2.getTime();
this.getTodayAlarmStatistics();
},
//
getDateTime() {
console.log(new Date());
this.dateValue = new Date().getTime();
this.dateValue2 = new Date().getTime();
console.log(this.dateValue);
//console.log(this.$moment(this.dateValue).format("yy-MM-DD"));
},
//
getTermData() {
this.numloading = true;
this.pieloading = true;
getTermStatistics()
.then((res) => {
console.log(res);
this.termDataNum = res.data;
this.numloading = false;
this.pieloading = false;
this.getEchart2();
})
.catch((err) => {});
},
//7
getWeekAlarmStatistics() {
this.barloading = true;
getWeekAlarmStatistics({ starttime: this.dateValue })
.then((res) => {
console.log(res);
this.weekData = res.data.list;
this.barloading = false;
this.getEchart3();
})
.catch((err) => {});
},
//
getTodayAlarmStatistics() {
this.pie2loading = true;
getTodayAlarmStatistics({ starttime: this.dateValue2 })
.then((res) => {
console.log(res);
this.todayAlarm = res.data.list;
this.pie2loading = false;
this.getEchart4();
})
.catch((err) => {});
},
//
getEchart2() {
this.$nextTick(() => {
console.log(this.termDataNum);
let that = this;
that.$echarts.init(document.getElementById("echart2")).dispose();
that.myChart2 = this.$echarts.init(document.getElementById("echart2"));
let option = {
// title: {
// text: "线",
// },
color: ["#169e8c", "#bbb"],
tooltip: {
trigger: "item",
},
legend: {
type: "scroll",
orient: "vertical",
right: 10,
top: 20,
bottom: 20,
},
series: [
{
type: "pie",
radius: ["40%", "70%"],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: "#fff",
borderWidth: 2,
},
label: {
show: true,
fontSize: 16,
fontWeight: "bold",
formatter: "{b}\n{d}%",
},
emphasis: {
label: {
show: true,
fontSize: 26,
fontWeight: "bold",
formatter: "{b}\n{d}%",
},
},
labelLine: {
show: true,
},
data: [
{ value: that.termDataNum.onlineNum, name: "在线" },
{ value: that.termDataNum.offlineNum, name: "离线" },
],
},
],
};
that.myChart2.setOption(option);
window.addEventListener("resize", () => {
that.myChart2.resize();
});
that.myChart2.on("click", function (params) {
console.log(params);
if (params.name == "在线") {
that.handleLook(1);
} else {
that.handleLook(0);
}
});
});
},
//7
getEchart3() {
this.$nextTick(() => {
this.$echarts.init(document.getElementById("echart3")).dispose();
this.myChart3 = this.$echarts.init(document.getElementById("echart3"));
let option = {
// title: {
// text: "",
// },
color: ["#169e8c"],
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
grid: {
//topleftrightbottom
top: "10%",
left: "10%",
right: "10%",
bottom: "10%",
},
xAxis: {
type: "category",
data: this.weekData.map((x) => {
return this.$moment(x.date).format("MM-DD");
}),
axisTick: {
alignWithLabel: true,
},
},
yAxis: { type: "value" },
series: [
{
name: "告警数量",
data: this.weekData.map((x) => {
return x.num;
}),
type: "bar",
showBackground: true,
backgroundStyle: { color: "rgba(180, 180, 180, 0.2)" },
},
],
};
this.myChart3.setOption(option);
window.addEventListener("resize", () => {
this.myChart3.resize();
});
});
},
//
getEchart4() {
this.$nextTick(() => {
this.$echarts.init(document.getElementById("echart4")).dispose();
this.myChart4 = this.$echarts.init(document.getElementById("echart4"));
let arr = [];
this.todayAlarm.forEach((element) => {
arr.push({
value: element.num, //numvalue
name: element.enname, //namename
});
});
let option = {
// title: {
// text: "",
// },
// tooltip: {
// trigger: "axis",
// axisPointer: {
// type: "shadow",
// },
// },
// xAxis: {
// type: "category",
// data: this.todayAlarm.map((item) => {
// return item.enname;
// }),
// axisTick: {
// alignWithLabel: true,
// },
// },
// yAxis: { type: "value" },
// series: [
// {
// name: "",
// data: this.todayAlarm.map((item) => {
// return item.num;
// }),
// type: "bar",
// showBackground: true,
// backgroundStyle: { color: "rgba(180, 180, 180, 0.2)" },
// },
// ],
// title: {
// text: "线",
// },
tooltip: {
trigger: "item",
},
legend: {
type: "scroll",
orient: "vertical",
right: 10,
top: 20,
bottom: 20,
},
series: [
{
type: "pie",
radius: ["40%", "70%"],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: "#fff",
borderWidth: 2,
},
label: {
show: true,
fontSize: 16,
fontWeight: "bold",
formatter: "{b}\n{d}%",
},
emphasis: {
label: {
show: true,
fontSize: 26,
fontWeight: "bold",
formatter: "{b}\n{d}%",
},
},
labelLine: {
show: true,
},
data: arr,
},
],
};
this.myChart4.setOption(option);
window.addEventListener("resize", () => {
this.myChart4.resize();
});
});
},
},
};
</script>
<style lang="less">
.stritleEchartsPage {
height: calc(100% - 32px);
padding: 16px;
display: flex;
flex-direction: column;
justify-content: space-around;
.echart-top {
display: flex;
height: 48%;
justify-content: space-between;
.el-card {
width: 49%;
height: 100%;
.el-card__body {
height: calc(100% - 40px);
position: relative;
}
}
.box-card {
.chartClass {
height: calc(100% - 32px);
width: 100%;
}
h3 {
font-size: 18px;
color: #333;
line-height: 32px;
}
.lookBtn {
position: absolute;
right: 20px;
top: 20px;
}
.bottomM {
.infoBox {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin-top: 2%;
p {
width: 40%;
//height: 88px;
padding: 2%;
text-align: center;
margin: 2%;
display: flex;
flex-direction: column;
justify-content: space-around;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
&:hover {
cursor: pointer;
}
&:first-child {
&:hover {
cursor: pointer;
}
}
span {
color: #333;
font-size: 16px;
&:last-child {
font-size: 20px;
margin-top: 5px;
font-weight: bold;
}
}
&:first-child {
span {
&:last-child {
color: #128071;
}
}
}
&:nth-child(2) {
span {
&:last-child {
color: #409eff;
}
}
}
&:nth-child(3) {
}
&:nth-child(4) {
}
}
}
}
.dateBox {
position: absolute;
top: 20px;
right: 20px;
.datemsg {
margin-right: 8px;
font-size: 12px;
}
.el-date-editor.el-input {
width: 140px;
}
}
}
}
}
.exportDialog {
.el-dialog__body {
//height: 400px;
height: 620px;
.exportList {
height: 100%;
.exportbtn {
margin-bottom: 12px;
float: right;
}
}
}
}
</style>

@ -0,0 +1,169 @@
<template>
<el-dialog
class="addLineDialog"
:title="lineDialogTitle"
:visible.sync="isShow"
:close-on-click-modal="false"
width="420px"
>
<el-form
label-position="left"
label-width="92px"
ref="formLineInfo"
:rules="rules"
:model="formdata"
>
<el-form-item label="公司名称:" prop="bsManufacturer">
<el-input
v-model="formdata.bsManufacturer"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item label="DY等级" prop="dyLevelid">
<el-select v-model="formdata.dyLevelid" placeholder="请选择电压等级">
<el-option
v-for="items in dyOptions"
:key="items.id"
:label="items.name"
:value="items.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="线路名称:" prop="name">
<el-input v-model="formdata.name" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
addLineJoggle,
updateLineJoggle,
getdyListJoggle,
} from "@/utils/api/index";
export default {
props: {
lineDialogTitle: String,
},
data() {
return {
isShow: false,
formdata: {},
dyOptions: "",
rules: {
bsManufacturer: [
{ required: true, message: "请输入公司名称", trigger: "blur" },
],
dyLevelid: [
{ required: true, message: "请选择DY等级", trigger: "change" },
],
name: [
{
required: true,
message: "请输入线路名称",
trigger: "blur",
},
],
},
};
},
methods: {
//
getdataform(val) {
console.log(val);
if (val == null) {
return (this.formdata = {});
}
//this.formdata = val;
this.formdata = JSON.parse(JSON.stringify(val));
//this.$set(this.formdata);
},
//
submitForm() {
this.$refs.formLineInfo.validate((valid) => {
if (valid) {
//
if (this.lineDialogTitle == "新增") {
let formArr = [];
formArr.push(this.formdata);
console.log(formArr);
addLineJoggle({ list: formArr })
.then((res) => {
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.$parent.lineList();
})
.catch((err) => {
console.log(err); //
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
});
} else {
updateLineJoggle(this.formdata)
.then((res) => {
this.isShow = false;
//this.$message.success("");
this.$message({
duration: 1500,
showClose: true,
message: "修改成功",
type: "success",
});
this.$parent.lineList();
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "修改失败",
type: "error",
});
//this.$message.error("");
});
}
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
},
created() {
getdyListJoggle().then((res) => {
console.log(res);
this.dyOptions = res.data.list;
console.log(this.dyOptions);
});
},
};
</script>
<style lang="less">
.addLineDialog {
.el-select {
width: 100%;
}
}
</style>

@ -0,0 +1,135 @@
<template>
<el-dialog
class="addtowerDialogline"
title="新增杆塔"
:visible.sync="isShow"
:close-on-click-modal="false"
width="420px"
@close="handleclose"
>
<el-form
label-position="left"
label-width="92px"
ref="formLineInfo"
:rules="rules"
:model="formdata"
>
<el-form-item label="线路名称:" prop="lineId">
<el-input
v-model="formdata.lineId"
autocomplete="off"
:disabled="true"
></el-input>
</el-form-item>
<el-form-item label="杆塔名称:" prop="towerName">
<el-input v-model="formdata.towerName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="杆塔地址:" prop="address">
<el-input v-model="formdata.address" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addTowerApi } from "@/utils/api/index";
export default {
props: {
lineDialogTitle: String,
},
data() {
return {
isShow: false,
formdata: {},
dyOptions: "",
rules: {
towerName: [
{
required: true,
message: "请输入杆塔名称",
trigger: "blur",
},
],
// address: [
// { required: true, message: "", trigger: "blur" },
// ],
},
};
},
methods: {
//
getdataform(val) {
//this.formdata = val;
this.formdata = JSON.parse(JSON.stringify(val));
this.formdata.lineId = val.name;
},
//
submitForm() {
this.$refs.formLineInfo.validate((valid) => {
if (valid) {
//
addTowerApi({
list: [
{
lineId: this.formdata.id,
name: this.formdata.towerName,
address: this.formdata.address,
},
],
})
.then((res) => {
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "新增杆塔成功",
type: "success",
});
this.$parent.lineList();
this.isShow = false;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
});
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
handleclose() {
this.$parent.lineList();
},
},
created() {},
};
</script>
<style lang="less">
.addtowerDialogline {
.el-select {
width: 100%;
}
}
</style>

@ -0,0 +1,307 @@
<template>
<div class="lineInformation">
<div class="lineBox">
<div class="lineBtnGroup">
<h4>线路信息管理</h4>
<el-button type="primary" icon="el-icon-plus" @click="handleAddLine()"
>新增</el-button
>
</div>
<div class="searchBox">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item>
<el-input
v-model="formdata.search"
placeholder="请输入线路名称或公司名称"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary" @click="onReset"></el-button>
</el-form-item>
</el-form>
</div>
<div class="lineTable">
<el-table
ref="multipleTable"
:data="lineTableData"
stripe
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 40px)"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
v-loading="loading"
highlight-current-row
:row-key="getRowKeys"
>
<!-- <el-table-column type="selection" width="55"> </el-table-column> -->
<!-- <el-table-column type="index" width="55"> </el-table-column> -->
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column label="公司名称" show-overflow-tooltip>
<template slot-scope="scope">{{
scope.row.bsManufacturer
}}</template>
</el-table-column>
<el-table-column
prop="dyLevelname"
label="电压等级名称"
show-overflow-tooltip
min-width="120"
>
</el-table-column>
<!-- <el-table-column
prop="id"
label="线路编号"
show-overflow-tooltip
min-width="120"
>
</el-table-column> -->
<el-table-column
prop="name"
label="线路名称"
min-width="120"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="status"
label="是否启用"
show-overflow-tooltip
min-width="120"
>
<template slot-scope="scope">
{{ scope.row.status == 1 ? "已启用" : "未启用" }}</template
>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button
@click.native.stop="handleResive(scope.row)"
type="text"
>修改</el-button
>
<el-button @click.native.stop="handleTower(scope.row)" type="text"
>新增杆塔</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
<!-- 新增线路 -->
<add-lineDialog
:lineDialogTitle="lineDialogTitle"
ref="addlineDialogref"
></add-lineDialog>
<!-- 新增杆塔 -->
<add-towerDialog ref="addTowerDialogref"></add-towerDialog>
</div>
</template>
<script>
import { getLineListJoggle, deleteLineJoggle } from "@/utils/api/index";
import addLineDialog from "./components/addLineDialog.vue";
import addTowerDialog from "./components/addTowerDialog.vue";
export default {
components: {
addLineDialog,
addTowerDialog,
},
data() {
return {
lineDialogTitle: "", //
lineTableData: [],
//multipleSelection: [], //
page: 1, //
pageSize: 20, //
total: 0, //
loading: true,
formdata: {
search: "",
},
};
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
// console.log(this.$route.query);
// this.formdata.search = this.$route.query.lineName;
// console.log(this.formdata.search);
},
mounted() {
this.lineList();
},
methods: {
getRowKeys(row) {
return row.id;
},
//线
lineList() {
this.loading = true;
this.$set(this.formdata, "pageindex", this.page);
this.$set(this.formdata, "pagesize", this.pageSize);
getLineListJoggle(this.formdata)
.then((res) => {
this.lineTableData = res.data.list;
this.total = res.data.total;
this.loading = false;
})
.catch((err) => {});
},
//
handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row);
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
onSubmit() {
this.page = 1;
this.lineList();
},
//
onReset() {
this.formdata = {};
this.page = 1;
this.pageSize = 20;
this.lineList();
},
//
handleAddLine() {
this.lineDialogTitle = "新增";
this.$refs.addlineDialogref.display();
this.$refs.addlineDialogref.getdataform(null);
},
//handleResive 线
handleResive(data) {
console.log(data);
this.lineDialogTitle = "修改";
this.$refs.addlineDialogref.display();
this.$refs.addlineDialogref.getdataform(data);
},
//
handleTower(data) {
console.log(data);
this.$refs.addTowerDialogref.display();
this.$refs.addTowerDialogref.getdataform(data);
},
//
handleDelete(data) {
let deleteArr = [];
deleteArr.push({
id: data.id,
});
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deleteLineJoggle({ list: deleteArr }).then((res) => {
this.lineList(); //
});
this.$message({
duration: 1500,
showClose: true,
type: "success",
message: "删除成功!",
});
})
.catch(() => {
// this.$message({
// duration: 1500,
// showClose: true,
// type: "info",
// message: "",
// });
});
},
//
handleCurrentChange(val) {
this.page = val;
this.lineList();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.lineList();
},
},
};
</script>
<style lang="less">
.lineInformation {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.lineBox {
border: 1px solid #dddddd;
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
.searchBox {
margin-top: 8px;
.ml10 {
margin-left: 10px;
}
.el-form {
.dybox {
.el-form-item__content {
width: 120px;
}
}
.xlbox {
.el-form-item__content {
width: 160px;
}
}
}
}
}
.lineBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
}
.lineTable {
//margin-top: 16px;
height: calc(100% - 94px);
}
}
</style>

@ -0,0 +1,206 @@
<template>
<div class="login-wrap">
<p class="blurBox"></p>
<div class="loginFilter">
<div class="leftPic">
<h3>视频监控可视化平台</h3>
<p>Video surveillance visualization platform</p>
</div>
<div class="ms-login">
<div class="ms-title">
<h3>登录</h3>
</div>
<el-form
:model="userInfo"
:rules="rules"
ref="loginForm"
label-width="0px"
class="ms-content"
size="medium"
>
<el-form-item prop="userName">
<el-input v-model="userInfo.userName" placeholder="用户名">
<span slot="prepend" class="el-icon-user"></span>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
placeholder="密码"
show-password
v-model="userInfo.password"
@keyup.enter.native="submitForm()"
>
<span slot="prepend" class="el-icon-lock"></span>
</el-input>
</el-form-item>
<div class="login-btn">
<el-button type="primary" @click="submitForm()"></el-button>
</div>
</el-form>
</div>
</div>
<p class="webInfo">© 2023 视频监控可视化平台.All right reserved.</p>
</div>
</template>
<script>
import { mapMutations } from "vuex";
import { loginJoggle } from "@/utils/api/index";
export default {
components: {},
data: function () {
return {
userInfo: {
userName: "",
password: "",
},
rules: {
userName: [
{ required: true, message: "请输入用户名", trigger: "blur" },
],
password: [
{ required: true, message: "请输入密码", trigger: "blur" },
// { min: 6, max: 8, message: "6-8", trigger: "blur" },
],
},
token: "",
};
},
computed: {
...mapMutations(["SET_TOKEN", "SET_USERINFO"]),
},
methods: {
submitForm() {
this.$refs.loginForm.validate((valid) => {
if (valid) {
loginJoggle(this.userInfo)
.then((res) => {
if (res.code == 200) {
this.$store.commit("SET_TOKEN", res.data.sessionId); //tokenvuex
this.$store.commit("SET_USERINFO", res.data); //vuex
this.$router.push("/stritl");
this.$message({
duration: 1500,
showClose: true,
message: "登录成功",
type: "success",
});
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
} else {
this.$message.error("请输入账号和密码");
console.log("error submit!!");
return false;
}
});
},
getLogin() {},
},
created() {},
mounted() {},
};
</script>
<style lang="less">
.login-wrap {
position: relative;
width: 100%;
height: 100%;
background: url(../../assets/img/logo.jpg) no-repeat center center;
background-size: cover;
overflow: hidden;
.blurBox {
position: absolute;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
}
.loginFilter {
width: 800px;
height: 450px;
background: #fff;
box-shadow: 0px 4px 12px 0px rgba(51, 51, 51, 0.15);
border-radius: 20px;
left: 50%;
top: 50%;
transform: translate(-50%;-50%);
position: absolute;
display: flex;
overflow: hidden;
.leftPic {
width: 50%;
background: url(../../assets/img/logo.jpg);
background-size: 120% 100%;
position: relative;
h3 {
font-size: 30px;
text-align: center;
margin-top: 60px;
color: #fff;
font-weight: normal;
}
p {
color: #fff;
text-align: center;
font-size: 12px;
margin-top: 8px;
}
}
.ms-login {
width: 50%;
height: 448px;
border-radius: 5px;
overflow: hidden;
background-size: 100%;
.ms-title {
text-align: center;
padding: 40px 16px;
h3 {
font-size: 30px;
color: #333;
font-weight: normal;
}
}
.ms-content {
padding: 40px 40px;
.el-form-item {
margin-bottom: 30px;
}
.verifyItem {
.el-form-item__content {
display: flex;
align-items: center;
justify-content: space-between;
}
}
.login-btn {
text-align: center;
button {
width: 100%;
height: 36px;
margin-bottom: 10px;
}
}
}
}
}
.webInfo {
bottom: 5%;
left: 50%;
transform: translate(-50%;-50%);
position: absolute;
font-size: 12px;
font-weight: 400;
color: #fff;
}
}
</style>

@ -0,0 +1,142 @@
<template>
<el-dialog
class="addLineDialog"
title="修改线路"
:visible.sync="isShow"
:close-on-click-modal="false"
width="420px"
>
<el-form
label-position="left"
label-width="92px"
ref="formLineInfo"
:rules="rules"
:model="formdata"
>
<!-- <el-form-item label="公司名称:" prop="bsManufacturer">
<el-input
v-model="formdata.bsManufacturer"
autocomplete="off"
></el-input>
</el-form-item> -->
<el-form-item label="DY等级" prop="dyLevelid">
<el-select v-model="formdata.dyId" placeholder="请选择电压等级">
<el-option
v-for="items in dyOptions"
:key="items.id"
:label="items.name"
:value="items.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="线路名称:" prop="name">
<el-input v-model="formdata.lineName" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
addLineJoggle,
updateLineJoggle,
getdyListJoggle,
} from "@/utils/api/index";
export default {
props: {
lineDialogTitle: String,
},
data() {
return {
isShow: false,
formdata: {},
dyOptions: "",
rules: {
// bsManufacturer: [
// { required: true, message: "", trigger: "blur" },
// ],
dyId: [{ required: true, message: "请选择DY等级", trigger: "change" }],
lineName: [
{
required: true,
message: "请输入线路名称",
trigger: "blur",
},
],
},
};
},
methods: {
//
getdataform(val) {
console.log(val);
this.formdata = JSON.parse(JSON.stringify(val));
//this.$set(this.formdata);
},
//
submitForm() {
this.$refs.formLineInfo.validate((valid) => {
if (valid) {
//
updateLineJoggle({
id: this.formdata.lineId,
// bsManufacturer: null,
name: this.formdata.lineName,
dyLevelid: this.formdata.dyId,
})
.then((res) => {
this.isShow = false;
//this.$message.success("");
this.$message({
duration: 1500,
showClose: true,
message: "修改成功",
type: "success",
});
this.$parent.terminalList(); //
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "修改失败",
type: "error",
});
//this.$message.error("");
});
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
},
created() {
getdyListJoggle().then((res) => {
console.log(res);
this.dyOptions = res.data.list;
console.log(this.dyOptions);
});
},
};
</script>
<style lang="less">
.addLineDialog {
.el-select {
width: 100%;
}
}
</style>

@ -0,0 +1,548 @@
<template>
<el-dialog
class="addPhotoDialog"
:title="photoDialogTitle"
:visible.sync="isShow"
:close-on-click-modal="false"
width="800px"
>
<el-form
label-position="left"
label-width="74px"
ref="formgrapInfo"
:rules="rules"
:model="formInfo"
>
<el-form-item label="线路名称:" prop="lineId">
<el-select
v-model="formInfo.lineId"
placeholder="请选择"
@change="getTowerchange"
>
<el-option
v-for="item in lineOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="杆塔名称:" prop="towerId">
<el-select v-model="formInfo.towerId" placeholder="请选择" filterable>
<el-option
v-for="item in toweridOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="装置ID" prop="cmdId">
<el-input v-model="formInfo.cmdId" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="云台选择:" prop="hasPan">
<el-select v-model="formInfo.hasPan" placeholder="请选择">
<el-option
v-for="item in hasPanOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="装置名称:" prop="equipName">
<el-input v-model="formInfo.equipName" auto-complete="on"></el-input>
</el-form-item>
<el-form-item label="SIM卡" prop="sim">
<el-input v-model="formInfo.sim" auto-complete="on"></el-input>
</el-form-item>
<el-form-item label="网络类型:" prop="netType">
<el-select v-model="formInfo.netType" placeholder="请选择">
<el-option
v-for="item in networkOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="装置型号:" prop="model">
<el-input v-model="formInfo.model" auto-complete="on"></el-input>
</el-form-item>
<el-form-item label="装置厂家:" prop="bsManufacturer">
<el-input
v-model="formInfo.bsManufacturer"
auto-complete="on"
></el-input>
</el-form-item>
<el-form-item label="规约版本:" prop="protocolVersion">
<!-- <el-input
v-model="formInfo.protocolVersion"
auto-complete="on"
></el-input> -->
<el-select v-model="formInfo.protocol" placeholder="请选择">
<el-option
v-for="item in protocolOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="投运日期:" prop="workingDate">
<el-date-picker
class="dateClass"
v-model="formInfo.workingDate"
type="date"
placeholder="选择日期"
format="yyyy 年 MM 月 dd 日"
value-format="timestamp"
></el-date-picker>
</el-form-item>
<!-- <el-form-item label="状态:" prop="status">
<el-select v-model="formInfo.statusId" placeholder="请选择">
<el-option v-for="item in statusOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item> -->
<el-divider></el-divider>
<h4>添加通道</h4>
<div class="addchannel" ref="channelBoxref">
<div
class="channelBoxadd"
v-for="(val, index) in formInfo.list"
:key="index"
>
<el-form-item label="通道号:">
<el-select
v-model="val.id"
placeholder="请选择通道号"
@change="changeHandle"
>
<el-option
v-for="item in filterOption"
:key="item.id"
:label="item.channelname"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="通道昵称:">
<el-input
v-model="val.alias"
placeholder="请输入通道昵称"
></el-input>
</el-form-item>
<div class="btngrop">
<el-button
v-if="index !== 0"
type="danger"
icon="el-icon-minus"
@click="deleteModule(val, index)"
></el-button>
<el-button
icon="el-icon-plus"
type="primary"
@click="addModule()"
v-if="index + 1 == formInfo.list.length"
></el-button>
</div>
</div>
<!-- <el-form-item label="通道(可多选)" prop="id">
<el-checkbox-group
class="channelBox"
v-model="formInfo.id"
v-if="channelOptions.length > 0"
>
<el-checkbox
border
v-for="item in channelOptions"
:key="item.id"
:label="item.id"
:value="item.channelname"
>{{ item.channelname }}</el-checkbox
>
</el-checkbox-group>
</el-form-item> -->
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
addTerminalJoggle,
updateTerminalJoggle,
getAllChannelListJoggle,
getLineAndGtInfo,
getProtocolList,
} from "@/utils/api/index";
export default {
props: {
photoDialog: {
type: Boolean,
},
photoDialogTitle: {
type: String,
default: "新增",
},
},
data() {
let validCmid = (rule, value, callback) => {
let reg = /^[0-9A-Za-z_/\\/-]{17}$/;
if (!reg.test(value)) {
callback(new Error("装置id为17位编码"));
} else {
callback();
}
};
return {
isShow: false,
formInfo: {},
channelOptions: [], //
filterOption: [], //
lineOptions: [], //线
toweridOptions: [], //
networkOptions: [
{
id: 1,
name: "移动",
},
{
id: 2,
name: "联通",
},
{
id: 3,
name: "电信",
},
], //
statusOptions: [
{
id: 1,
name: "在运",
},
{
id: 2,
name: "停运",
},
{
id: 3,
name: "调试",
},
], //
hasPanOptions: [
{
id: 0,
name: "否",
},
{
id: 1,
name: "是",
},
],
protocolOptions: [], //
rules: {
cmdId: [
{ required: true, message: "请输入装置ID", trigger: "blur" },
{ validator: validCmid, trigger: "blur" },
],
},
photoDialogtype: 0, //1 线change
};
},
mounted() {
this.getProtocol();
},
created() {},
watch: {},
methods: {
getProtocol() {
//
getProtocolList()
.then((res) => {
console.log(res);
this.protocolOptions = res.data.list;
console.log(this.protocolOptions);
})
.catch((err) => {});
},
//
getdataform(val) {
this.getLine();
this.getChannel();
if (val == null) {
return (this.formInfo = {
lineId: "",
towerId: "",
cmdId: "",
equipName: "",
hasPan: this.hasPanOptions[0].id,
sim: "",
netType: this.networkOptions[0].id,
model: "",
bsManufacturer: "",
protocol: this.protocolOptions[0].id,
workingDate: new Date().getTime(),
list: [
{
id: "",
alias: "",
},
],
});
}
if (val.list.length == 0) {
console.log(val);
console.log("我是没有通道的");
val.list.push({
id: "",
alias: "",
});
}
//this.formInfo = val;
this.formInfo = JSON.parse(JSON.stringify(val));
this.$set(
this.formInfo,
"workingDate",
new Date(this.formInfo.workingDate).getTime()
);
console.log(this.formInfo.workingDate);
},
//
changeHandle() {
this.filterOption = this.channelOptions.filter(
(val) => !this.formInfo.list.some((item) => item.id === val.id)
);
},
//
addModule() {
//
this.formInfo.list.push({
id: "",
alias: "",
});
this.filterOption = this.channelOptions.filter(
(val) => !this.formInfo.list.some((item) => item.id === val.id)
);
this.$nextTick(() => {
console.log(this.$refs.channelBoxref);
if (this.$refs.channelBoxref) {
console.log(this.$refs.channelBoxref.scrollHeight);
this.$refs.channelBoxref.scrollTop =
this.$refs.channelBoxref.scrollHeight;
}
});
},
//
deleteModule(item, index) {
console.log(item, index);
const itemList = this.formInfo.list.indexOf(item);
if (itemList !== -1) {
this.formInfo.list.splice(index, 1);
}
this.filterOption = this.channelOptions.filter(
(val) => !this.formInfo.list.some((item) => item.id === val.id)
);
},
//
submitForm() {
const newListLength = new Set(this.formInfo.list.map((item) => item.id))
.size;
const listLength = this.formInfo.list.length;
if (listLength > newListLength) {
return this.$message.error("通道不能重复");
}
this.$refs.formgrapInfo.validate((valid) => {
if (valid) {
if (this.photoDialogTitle == "新增") {
// this.formInfo = {
// lineId: this.formInfo.lineId,
// towerId: this.formInfo.towerId,
// cmdId: this.formInfo.cmdId,
// equipName: this.formInfo.equipName,
// sim: this.formInfo.sim,
// list: this.formInfo.list,
// displayName: this.formInfo.cmdId,
// };
this.$set(this.formInfo, "workingDate", new Date().getTime());
this.$set(this.formInfo, "displayName", this.formInfo.cmdId);
console.log(this.formInfo);
addTerminalJoggle(this.formInfo)
.then((res) => {
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.$parent.terminalList(); //
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
});
} else {
console.log(this.formInfo);
updateTerminalJoggle(this.formInfo)
.then((res) => {
this.isShow = false;
this.$message.success("修改成功");
this.$parent.terminalList();
})
.catch((err) => {
this.$message.error("修改失败");
});
}
} else {
return false;
}
});
},
//线
getLine() {
getLineAndGtInfo({ type: 1 }).then((res) => {
this.lineOptions = res.data.list;
if (res.data.list.length == 0) {
this.lineOptions = [];
this.formInfo.lineId = "";
} else {
this.lineOptions = res.data.list;
if (this.photoDialogTitle == "新增") {
// this.formInfo.lineId = res.data.list[0].id;
this.$set(this.formInfo, "lineId", res.data.list[0].id);
}
}
// this.dyOptions = res.data.list;
// this.formdata.dyid = res.data.list == [] ? "" : res.data.list[0].id;
this.getTower();
});
},
//
getTower() {
getLineAndGtInfo({ type: 2, id: this.formInfo.lineId })
.then((res) => {
if (res.data.list.length == 0) {
this.toweridOptions = [];
this.formInfo.towerId = "";
} else {
this.toweridOptions = res.data.list;
if (this.photoDialogTitle == "新增" || this.photoDialogtype == 1) {
// this.formInfo.towerId = res.data.list[0].id;
this.$set(this.formInfo, "towerId", res.data.list[0].id);
this.photoDialogtype = 0;
}
}
})
.catch((err) => {});
},
getTowerchange() {
if (this.photoDialogTitle == "修改") {
this.photoDialogtype = 1;
}
this.getTower();
},
//
getChannel() {
getAllChannelListJoggle()
.then((res) => {
this.channelOptions = res.data.list;
this.filterOption = res.data.list;
if (this.photoDialogTitle == "新增") {
this.formInfo.list[0].id = this.filterOption[0].id;
}
//this.formInfo.list[0].id = this.filterOption[0].id;
})
.catch((err) => {});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
// handleclose() {
// this.$parent.terminalList();
// },
},
};
</script>
<style lang="less">
.addPhotoDialog {
.el-dialog {
.el-form {
display: flex;
flex-wrap: wrap;
.el-form-item {
width: 364px;
margin-right: 16px;
.el-select {
width: 100%;
}
.el-checkbox-group {
.el-checkbox {
margin-right: 12px;
}
}
.el-form-item__label {
padding-right: 0px;
}
.dateClass {
width: 290px;
}
}
.el-divider--horizontal {
margin: 12px;
}
h4 {
font-size: 16px;
font-weight: normal;
margin-bottom: 6px;
line-height: 24px;
}
.addchannel {
max-height: 200px;
overflow: auto;
.channelBoxadd {
display: flex;
//justify-content: space-between;
padding-right: 6px;
.el-form-item {
width: 310px;
}
.btngrop {
margin-bottom: 16px;
margin-left: 16px;
height: 32px;
.el-button--small {
padding: 9px 8px;
width: 30px;
}
}
}
}
.channelBox {
.el-checkbox {
margin-right: 12px;
margin-left: 0px;
margin-bottom: 8px;
}
}
}
}
}
</style>

@ -0,0 +1,212 @@
<template>
<el-dialog
class="baseInforDialog"
title="基本信息"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1280px"
>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="datetime"
placeholder="开始日期"
value-format="timestamp"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="datetime"
default-time="23:59:59"
placeholder="结束日期"
value-format="timestamp"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary">导出</el-button>
</el-form-item>
</el-form>
<el-table
ref="multipleTable"
:data="listData"
stripe
tooltip-effect="dark"
style="width: 100%"
v-loading="loading"
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column min-width="45" label="序号">
<template slot-scope="scope">
<span>{{ (page - 1) * pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column
prop="name"
label="采集时间"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="设备名称"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="设备编号"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="装置名称"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="装置型号"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="装置版本号"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="生产厂家"
min-width="100"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="生产日期"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="出厂编号"
min-width="100"
show-overflow-tooltip
></el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getLineListJoggle } from "@/utils/api/index";
export default {
data() {
return {
isShow: false,
formdata: {},
listData: [
{
name: "测试",
},
{
name: "测试2",
},
],
loading: false,
seltermid: "", //id
selcmdId: "", //cmdId
requestId: "",
page: 1, //
pageSize: 20, //
total: 0, //
};
},
mounted() {},
methods: {
//
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",
});
}
this.getlistnr();
},
//
getlistnr(val) {
console.log(val);
this.seltermid = val.id;
this.selcmdId = val.cmdid;
this.loading = true;
getLineListJoggle({
pageindex: this.page,
pagesize: this.pageSize,
}).then((res) => {
this.listData = res.data.list;
this.total = res.data.total;
this.loading = false;
});
},
//
handleCurrentChange(val) {
this.page = val;
this.getlistnr();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getlistnr();
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
},
};
</script>
<<<<<<< HEAD
<style lang="less">
.baseInforDialog {
.pageNation {
justify-content: flex-start;
margin-top: 16px;
.el-pagination {
padding: 0px;
.el-select .el-input {
margin-left: 0px;
}
}
}
}
</style>
=======
<style lang="less" scoped></style>
>>>>>>> hn1.0

@ -0,0 +1,173 @@
<template>
<el-dialog
class="gpsPoisitiondialog"
title="GPS位置"
:visible.sync="isShow"
:close-on-click-modal="false"
width="662px"
@close="handleclose"
>
<!-- <div class="gpsbox" v-loading="loading">
<p>
<span>经度</span><span>{{ infornr.longitude }}</span>
</p>
<p>
<span>纬度</span><span>{{ infornr.latitude }}</span>
</p>
<p>
<span>半径</span><span>{{ infornr.radius }}</span>
</p>
</div> -->
<div class="gpsbox" v-loading="loading">
<el-descriptions :column="1" border>
<el-descriptions-item>
<template slot="label"> 采集时间 </template
>{{ $moment(infornr.updatetime).format("YYYY-MM-DD HH:mm:ss") }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 经度 </template>{{ infornr.longitude }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 纬度 </template>{{ infornr.latitude }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 半径 </template>{{ infornr.radius }}
</el-descriptions-item>
</el-descriptions>
<el-button type="text" class="newBtn" @click="getgpsData()"
>获取最新GPS位置</el-button
>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
getTermLastGPSPosition,
getTermGPSJoggle,
getTermGPSPosition,
} from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
loading: false,
isShow: false,
timer: null,
infornr: {},
i: 0,
queryTime: "", //ID
zzcmdid: "",
zztermid: "",
};
},
mounted() {},
methods: {
//
getgpssql() {
getTermLastGPSPosition({
termId: this.zztermid,
})
.then((res) => {
this.infornr = res.data;
// this.$message({
// duration: 1500,
// showClose: true,
// message: "gps",
// type: "success",
// });
})
.catch((err) => {});
},
//
getgpsData() {
console.log(this.zzcmdid);
console.log(this.zztermid);
this.loading = true;
getTermGPSPosition({
cmdId: this.zzcmdid,
})
.then((res) => {
this.queryTime = res.data;
console.log(this.zztermid);
this.getNewgpsData(this.zztermid);
this.timer = window.setInterval(() => {
this.getNewgpsData(this.zztermid);
this.i++;
}, 5000);
})
.catch((err) => {});
},
//
getNewgpsData(val) {
getTermGPSJoggle({
queryTime: this.queryTime,
termid: val,
})
.then((res) => {
this.loading = true;
if (res.code == 200) {
this.infornr = res.data;
if (res.data.hasNew == true) {
this.loading = false;
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "gps信息已更新",
type: "success",
});
clearInterval(this.timer);
} else if (this.i > 9) {
this.loading = false;
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "暂未获取到GPS信息请稍后再试",
type: "warning",
});
clearInterval(this.timer);
}
} else {
this.$message.error(res.code.msg);
}
})
.catch((err) => {});
},
display(data) {
console.log(data);
this.isShow = true;
this.zzcmdid = data.cmdId;
this.zztermid = data.id;
},
hide() {
this.isShow = false;
},
handleclose() {
this.i = 0;
clearInterval(this.timer);
this.timer = null;
this.loading = false;
},
},
};
</script>
<style lang="less">
.gpsPoisitiondialog {
.gpsbox {
p {
line-height: 32px;
height: 32px;
font-size: 16px;
}
.newBtn {
margin-top: 14px;
}
}
}
</style>

@ -0,0 +1,194 @@
<template>
<el-dialog
class="gpsSiteDialog"
title="GPS位置数据"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1280px"
>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="datetime"
placeholder="开始日期"
value-format="timestamp"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="datetime"
default-time="23:59:59"
placeholder="结束日期"
value-format="timestamp"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary">导出</el-button>
</el-form-item>
</el-form>
<el-table
ref="multipleTable"
:data="listData"
stripe
tooltip-effect="dark"
style="width: 100%"
v-loading="loading"
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column min-width="45" label="序号">
<template slot-scope="scope">
<span>{{ (page - 1) * pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column
prop="name"
label="采集时间"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="设备名称"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="设备编号"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="半径"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="维度"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="经度"
min-width="80"
show-overflow-tooltip
></el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getLineListJoggle } from "@/utils/api/index";
export default {
data() {
return {
isShow: false,
formdata: {},
listData: [
{
name: "测试",
},
{
name: "测试2",
},
],
loading: false,
seltermid: "", //id
selcmdId: "", //cmdId
requestId: "",
page: 1, //
pageSize: 20, //
total: 0, //
};
},
mounted() {},
methods: {
//
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",
});
}
this.getlistnr();
},
//
getlistnr(val) {
console.log(val);
this.seltermid = val.id;
this.selcmdId = val.cmdid;
this.loading = true;
getLineListJoggle({
pageindex: this.page,
pagesize: this.pageSize,
}).then((res) => {
this.listData = res.data.list;
this.total = res.data.total;
this.loading = false;
});
},
//
handleCurrentChange(val) {
this.page = val;
this.getlistnr();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getlistnr();
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
},
};
</script>
<<<<<<< HEAD
<style lang="less">
.gpsSiteDialog {
.pageNation {
justify-content: flex-start;
margin-top: 16px;
.el-pagination {
padding: 0px;
.el-select .el-input {
margin-left: 0px;
}
}
}
}
</style>
=======
<style lang="less" scoped></style>
>>>>>>> hn1.0

File diff suppressed because it is too large Load Diff

@ -0,0 +1,398 @@
<template>
<el-dialog
class="pictureTagsDialog"
title="图片绘制"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1262px"
>
<div class="picPannel">
<div class="imgbox" v-if="picsrc" v-loading="loading">
<img ref="picJpg" :src="picsrc" />
<canvas
id="myCanvas"
class="myCanvas"
ref="myCanvas"
@mousedown="mousedown"
@mouseup="mouseup"
@mousemove="mousemove"
></canvas>
<!-- <canvas v-else id="myCanvas" class="myCanvas" ref="myCanvas"></canvas> -->
</div>
<div class="imgbox" v-else>
<img ref="picJpg" src="../../../assets/img/nopic.jpg" />
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
</div>
<div class="setBox">
<div class="infoCompany">
<!-- <p><label>电压等级</label><span>220kv</span></p> -->
<p>
<label>线路名称</label><span>{{ pictureData.lineName }}</span>
</p>
<p>
<label>杆塔名称</label><span>{{ pictureData.towerName }}</span>
</p>
<p>
<label>装置名称</label><span>{{ pictureData.cmdId }}</span>
</p>
<p>
<label>选择通道</label>
<el-select
v-model="picvalue"
placeholder="请选择"
@change="changePic($event)"
>
<el-option
v-for="item in picoptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</p>
</div>
<div class="setColor">
<p>
<label>颜色</label
><el-color-picker v-model="color"></el-color-picker>
</p>
<p>
<label>线宽</label>
<el-input-number
v-model="num"
controls-position="right"
@change="handleChange"
:min="1"
:max="10"
></el-input-number>
</p>
<p>
<el-button type="primary" @click="restCanvas"></el-button>
<!-- <el-button type="primary" @click="saveCanvas"></el-button> -->
</p>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { updateCoordinate, getCoordinate } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
canvas: null,
ctx: null,
imgpic: null,
drawingSurfaceImageData: "",
color: "#0000ff",
num: 2,
flag: false,
x: 0,
y: 0,
isShow: false,
fileList: [],
pictureData: "",
picoptions: [],
picvalue: "",
linePoints: [],
localPoints: [],
picsrc: "",
channelId: "", //id
termId: "",
markId: "",
cmdid: "",
photoId: "",
loading: false,
nopic: require("@/assets/img/nopic.jpg"),
};
},
mounted() {},
methods: {
//
changePic(val) {
var obj = {};
obj = this.picoptions.find(function (i) {
return i.id === val;
});
console.log(obj);
// console.log(id);
this.picsrc = obj.path;
this.channelId = obj.id;
this.photoId = obj.photoId;
this.restCanvas();
this.getcanvansPic(this.pictureData, this.channelId);
// console.log(this.picsrc);
},
//线
handleChange(value) {
console.log(value);
},
//
submitForm() {
this.isShow = false;
this.saveCanvas();
this.$parent.terminalList(); //
},
display(val) {
console.log(val);
this.isShow = true;
this.pictureData = val; //
this.picoptions = val.list; //
this.channelId = val.list[0].id;
this.picvalue = val.list[0].name; //
this.termId = val.id; //id
this.getcanvansPic(val, this.channelId);
},
hide() {
this.isShow = false;
this.pictureData = "";
this.picoptions = [];
this.picvalue = "";
this.picsrc = "";
},
getcanvansPic(val, channelid) {
this.loading = true;
getCoordinate({
channelId: channelid,
needPic: "0",
termId: this.termId,
})
.then((res) => {
console.log(res);
this.markId = res.data.markId;
if (res.data.path !== null) {
this.picsrc = res.data.path;
if (res.data.list.length !== 0) {
this.localPoints = res.data.list;
this.drawline();
}
this.loading = false;
} else {
this.picsrc = this.nopic;
this.loading = false;
}
})
.catch((err) => {});
// this.picsrc = val.list[0].path;
// this.markId = val.markId;
// this.cmdid = val.cmdid;
// this.photoId = val.list[0].photoId;
console.log("this.canvas");
this.$nextTick(function () {
// codeing
this.canvas = this.$refs.myCanvas;
this.imgpic = this.$refs.picJpg;
console.log(this.canvas);
console.log(this.imgpic);
this.canvas.width = this.imgpic.offsetWidth; //
this.canvas.height = this.imgpic.offsetHeight; //
this.ctx = this.canvas.getContext("2d");
//console.log(localStorage.getItem("piclinePoints"));
});
},
mousedown(e) {
//console.log("");
this.saveDrawingSurface();
this.flag = true;
this.x = e.offsetX; // X
this.y = e.offsetY; // Y
console.log(this.x, this.y);
console.log(this.flag);
},
mouseup(e) {
//console.log("");
console.log(
this.x / this.imgpic.width,
this.y / this.imgpic.height,
e.offsetX / this.imgpic.width,
e.offsetY / this.imgpic.height
);
this.drawRect(e);
this.flag = false;
this.linePoints.push({
x1: this.x / this.imgpic.width,
y1: this.y / this.imgpic.height,
x2: e.offsetX / this.imgpic.width,
y2: e.offsetY / this.imgpic.height,
});
console.log(this.linePoints);
},
//
saveDrawingSurface() {
this.drawingSurfaceImageData = this.ctx.getImageData(
0,
0,
this.canvas.width,
this.canvas.height
);
},
restoreDrawingSurface() {
this.ctx.putImageData(this.drawingSurfaceImageData, 0, 0);
},
mousemove(e) {
//console.log("");
if (this.flag) {
this.restoreDrawingSurface();
this.drawRect(e);
}
},
drawRect(e) {
if (this.flag) {
console.log("绘制图形");
let x = this.x;
let y = this.y;
// ctx.save();
this.ctx.beginPath();
//线
this.ctx.strokeStyle = this.color;
// 线
this.ctx.lineWidth = this.num;
// console.log(x, y, e.offsetX, e.offsetY);
// this.ctx.strokeRect(x, y, e.offsetX - x, e.offsetY - y);
this.ctx.moveTo(x, y);
this.ctx.lineTo(e.offsetX, e.offsetY);
// this.ctx.moveTo(this.defult[0].x1, this.defult[0].y1);
// this.ctx.lineTo(this.defult[0].x2, this.defult[0].y2);
this.ctx.closePath();
this.ctx.stroke();
} else {
console.log("aaaaaaaa");
}
},
drawline() {
console.log(this.localPoints);
this.ctx.beginPath();
//线
this.ctx.strokeStyle = this.color;
// 线
this.ctx.lineWidth = this.num;
if (this.localPoints.length !== 0) {
for (var i = 0; i < this.localPoints.length; i++) {
this.ctx.moveTo(
this.localPoints[i].x1 * this.imgpic.width,
this.localPoints[i].y1 * this.imgpic.height
);
this.ctx.lineTo(
this.localPoints[i].x2 * this.imgpic.width,
this.localPoints[i].y2 * this.imgpic.height
);
}
}
// this.ctx.moveTo(x, y);
// this.ctx.lineTo(e.offsetX, e.offsetY);
this.ctx.closePath();
this.ctx.stroke();
},
//
saveCanvas() {
console.log(this.linePoints);
updateCoordinate({
boderWidth: this.num,
channelId: this.channelId,
color: this.color,
height: this.imgpic.height,
id: this.markId,
list: this.linePoints,
termId: this.termId,
width: this.imgpic.width,
})
.then((res) => {
this.localPoints = [];
console.log(this.linePoints);
console.log("qing");
console.log(res);
this.$message({
duration: 1500,
type: "success",
message: "绘制保存成功",
showClose: true,
});
})
.catch((err) => {});
},
restCanvas() {
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
this.linePoints = [];
console.log(this.linePoints);
},
},
};
</script>
<style lang="less">
.pictureTagsDialog {
.el-dialog {
height: 672px;
.el-dialog__body {
height: 540px;
}
}
.picPannel {
display: flex;
flex-direction: row;
justify-content: space-between;
position: relative;
height: 100%;
.imgbox {
//flex: 1;
width: 960px;
height: 540px;
position: relative;
img {
width: 100%;
height: 100%;
}
.myCanvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
cursor: pointer;
}
}
.setBox {
width: 230px;
padding: 12px;
border: 3px solid #169e8c;
.infoCompany {
display: flex;
flex-direction: column;
line-height: 32px;
margin-bottom: 16px;
}
}
.setColor {
display: flex;
flex-direction: column;
line-height: 32px;
p {
display: flex;
align-items: center;
margin-bottom: 16px;
}
}
}
}
</style>

@ -0,0 +1,196 @@
<template>
<el-dialog
class="runStatusDialog"
title="装置运行状态"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1280px"
>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="datetime"
placeholder="开始日期"
value-format="timestamp"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="datetime"
default-time="23:59:59"
placeholder="结束日期"
value-format="timestamp"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary">导出</el-button>
</el-form-item>
</el-form>
<el-table
ref="multipleTable"
:data="listData"
stripe
tooltip-effect="dark"
style="width: 100%"
v-loading="loading"
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column min-width="45" label="序号">
<template slot-scope="scope">
<span>{{ (page - 1) * pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column
prop="name"
label="采集时间"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="设备名称"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="设备编号"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="4G信号强度"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="2G信号强度"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="剩余运行内存"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="剩余存储内存"
min-width="100"
show-overflow-tooltip
></el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getLineListJoggle } from "@/utils/api/index";
export default {
data() {
return {
isShow: false,
formdata: {},
listData: [
{
name: "测试",
},
{
name: "测试2",
},
],
loading: false,
seltermid: "", //id
selcmdId: "", //cmdId
requestId: "",
page: 1, //
pageSize: 20, //
total: 0, //
};
},
mounted() {},
methods: {
//
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",
});
}
this.getlistnr();
},
//
getlistnr(val) {
console.log(val);
this.seltermid = val.id;
this.selcmdId = val.cmdid;
this.loading = true;
getLineListJoggle({
pageindex: this.page,
pagesize: this.pageSize,
}).then((res) => {
this.listData = res.data.list;
this.total = res.data.total;
this.loading = false;
});
},
//
handleCurrentChange(val) {
this.page = val;
this.getlistnr();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getlistnr();
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
},
};
</script>
<style lang="less">
.runStatusDialog {
.pageNation {
justify-content: flex-start;
margin-top: 16px;
.el-pagination {
padding: 0px;
.el-select .el-input {
margin-left: 0px;
}
}
}
}
</style>

@ -0,0 +1,145 @@
<template>
<el-dialog
class="addtowerDialog"
title="修改杆塔"
:visible.sync="isShow"
:close-on-click-modal="false"
width="470px"
>
<el-form
label-position="left"
ref="formInfo"
label-width="100px"
:rules="rules"
:model="formdata"
>
<el-form-item label="线路名称:" prop="lineId">
<el-select v-model="formdata.lineId" placeholder="请选择">
<el-option
v-for="item in lineOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="杆塔名称:" prop="name">
<el-input v-model="formdata.towerName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="杆塔地址:" prop="address">
<el-input v-model="formdata.address" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="排序号:" prop="order">
<el-input-number
controls-position="right"
v-model="formdata.order"
:min="0"
></el-input-number>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getLineListApi, addTowerApi, updateTowerApi } from "@/utils/api/index";
export default {
data() {
return {
isShow: false,
lineOptions: [],
formdata: {},
rules: {
towerName: [
{ required: true, message: "请输入杆塔名称", trigger: "blur" },
],
lineId: [
{ required: true, message: "请选择线路编号", trigger: "blur" },
],
// address: [
// { required: true, message: "", trigger: "blur" },
// ],
order: [{ required: true, message: "请输入排序号", trigger: "blur" }],
},
};
},
mounted() {
this.getLineListdata();
},
methods: {
getLineListdata() {
getLineListApi({ pageindex: 1, pagesize: 100 })
.then((res) => {
this.lineOptions = res.data.list;
})
.catch((err) => {});
},
//
getdataform(val) {
//this.formdata = val;
this.formdata.order = 0;
this.formdata = JSON.parse(JSON.stringify(val));
},
//
submitForm() {
this.$refs.formInfo.validate((valid) => {
if (valid) {
updateTowerApi({
id: this.formdata.towerId,
name: this.formdata.towerName,
address: null,
lineId: this.formdata.lineId,
lineName: this.formdata.lineName,
order: this.formdata.order,
})
.then((res) => {
this.isShow = false;
//this.$message.success("");
this.$message({
duration: 1500,
showClose: true,
message: "修改成功",
type: "success",
});
this.$parent.terminalList(); //
})
.catch((err) => {
//this.$message.error("");
this.$message({
duration: 1500,
showClose: true,
message: "修改失败",
type: "error",
});
});
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
},
};
</script>
<style lang="less">
.addtowerDialog {
.el-select {
width: 100%;
}
.el-input-number {
width: 100%;
}
.el-input-number .el-input__inner {
text-align: left;
}
}
</style>

@ -0,0 +1,467 @@
<template>
<el-tabs
v-model="activeName"
@tab-click="handleClick"
type="card"
v-loading="loading"
>
<el-tab-pane label="查询实际参数" name="1">
<div class="captureBoxVideo">
<div class="flexnr">
<div class="wt80">通道:</div>
<el-select
v-model="selaccess"
placeholder="请选择"
class="mr20"
@change="clearform"
>
<el-option
v-for="item in accesslist"
:key="item.channelid"
:label="
item.alias !== null && item.alias !== ''
? item.alias
: item.channelname
"
:value="item.channelid"
>
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelname
}}
</el-option>
</el-select>
</div>
<div class="flexno bt30">
<div class="wt80">视频分辨率:</div>
<el-select
v-model="capturenr.videoFormat"
class="wt280"
:disabled="true"
>
<el-option
v-for="item in ratiolist"
:key="item.id"
:label="item.id + ' (' + item.name + ')'"
:value="item.id"
>
</el-option>
</el-select>
</div>
<div class="flexno bt30">
<div class="wt80">预置位:</div>
<el-input
v-model="capturenr.preset"
:disabled="true"
class="wt280"
></el-input>
</div>
<div class="flexno bt30">
<div class="wt80">录制时长:</div>
<el-input
v-model="capturenr.videoTime"
:disabled="true"
class="wt280"
>
<template slot="append">s ()</template>
</el-input>
</div>
<!-- <el-button
class="searchImage"
:loading="searchloading"
type="primary"
@click="inquirebtn()"
>查询</el-button
> -->
<el-button
class="searchImage"
:loading="searchloading"
type="primary"
@click="videoSearch()"
>查询</el-button
>
</div>
</el-tab-pane>
<el-tab-pane label="设置参数" name="2">
<div class="captureBoxVideo">
<el-form
:model="setForm"
:rules="rules"
ref="setForm"
label-width="120px"
class="captureForm"
>
<el-form-item label="通道" prop="channelId">
<el-select
v-model="setForm.channelId"
placeholder="请选择"
class="mr20"
>
<el-option
v-for="item in accesslist"
:key="item.channelid"
:label="
item.alias !== null && item.alias !== ''
? item.alias
: item.channelname
"
:value="item.channelid"
>
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelname
}}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="视频分辨率" prop="videoFormat">
<el-select
v-model="setForm.videoFormat"
placeholder="请选择"
class="mr20"
>
<el-option
v-for="item in ratiolist"
:key="item.id"
:label="item.id + ' (' + item.name + ')'"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="预置位" prop="preset">
<el-input-number
v-model="setForm.preset"
:min="1"
:max="255"
:disabled="true"
></el-input-number>
</el-form-item>
<el-form-item label="录制时长 s(秒)" prop="videoTime">
<el-input-number
v-model="setForm.videoTime"
:min="1"
:max="100"
></el-input-number>
</el-form-item>
<el-form-item>
<!-- <el-button type="primary" @click="submitbtn('setForm')"
>确认</el-button
> -->
<el-button
type="primary"
@click="videoSet('setForm')"
:loading="setloading"
>确认</el-button
>
</el-form-item>
</el-form>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import {
getChannelListJoggle,
getVideoParamApi,
setVideoParamApi,
getVideoParamnrApi,
getResolutionRatio,
setTermCamera,
getTermCameraRequest,
} from "@/utils/api/index";
export default {
data() {
return {
loading: false,
isShow: false,
searchloading: false,
setloading: false,
activeName: "1", //
accesslist: [], //
ratiolist: [],
hnratiolist: [
{
id: 1,
name: "480P",
},
{
id: 2,
name: "720p",
},
{
id: 3,
name: "1080P",
},
{
id: 4,
name: "QVGA",
},
{
id: 5,
name: "VGA",
},
], //
selaccess: "", //
capturenr: {}, //
setForm: {
preset: 255,
}, //
rules: {
channelId: [{ required: true, message: "请选择通道", trigger: "blur" }],
videoTime: [
{ required: true, message: "请输入录制时长", trigger: "blur" },
],
preset: [{ required: true, message: "请输入预置位", trigger: "blur" }],
videoFormat: [
{ required: true, message: "请选择视频分辨率", trigger: "blur" },
],
},
timer: null,
i: 0,
seltermid: "", //id
selcmdId: "", //cmdId
requestId: "",
onlinestatus: "",
};
},
mounted() {},
methods: {
handleClick(tab, event) {
console.log(tab, event);
this.capturenr = {};
},
//
getSingleAccess(val) {
this.setForm = {
preset: 255,
};
console.log(val);
this.seltermid = val.id;
this.selcmdId = val.cmdId;
this.onlinestatus = val.onlinestatus;
getChannelListJoggle({ termid: this.seltermid })
.then((res) => {
this.accesslist = res.data.list;
this.selaccess = res.data.list[0].channelid;
this.$set(this.setForm, "channelId", res.data.list[0].channelid);
})
.catch((err) => {});
},
//
getRatio() {
getResolutionRatio({ type: 1 })
.then((res) => {
this.ratiolist = this.hnratiolist;
this.$set(this.setForm, "videoFormat", this.ratiolist[0].id);
})
.catch((err) => {});
},
//videoSearch
// --act=videoparams [0xD5] --flag=[Request Set Flag, default is set=1, 0: request] --channel=[Channel No] --preset=[Preset No] format=[Video Format: 1 QVGA 2 VGA 3 480p 4 720P 5 1080P] time=[seconds]
videoSearch() {
if (this.onlinestatus == 1) {
this.searchloading = true;
let params = [
{
name: "act",
value: "videoparams",
},
{
name: "flag",
value: 0,
},
{
name: "channel",
value: this.selaccess,
},
{
name: "preset",
value: 255,
},
{
name: "format",
value: "",
},
{
name: "time",
value: "",
},
];
this.setTermFn(params);
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
},
videoSet(setForm) {
console.log(this.setForm);
if (this.onlinestatus == 1) {
this.setloading = true;
let params = [
{
name: "act",
value: "videoparams",
},
{
name: "flag",
value: 1,
},
{
name: "channel",
value: this.setForm.channelId,
},
{
name: "preset",
value: 255,
},
{
name: "format",
value: this.setForm.videoFormat,
},
{
name: "time",
value: this.setForm.videoTime,
},
];
this.setTermFn(params);
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
},
setTermFn(dataParams) {
setTermCamera({
termId: this.seltermid,
list: dataParams,
})
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
//this.getinfo1();
clearInterval(this.timer);
this.timer = window.setInterval(() => {
this.getinfo();
this.i++;
}, 1000);
// this.timer = setInterval(() => {
// this.getinfo();
// this.i++;
// }, 1000);
})
.catch((err) => {});
},
getinfo() {
getTermCameraRequest({ requestid: this.requestid })
.then((res) => {
if (res.data.success == 1) {
window.clearInterval(this.timer);
this.timer = null;
this.i = 0;
console.log("终止轮询");
// && res.data.result == 255
this.searchloading = false;
this.setloading = false;
console.log(JSON.parse(res.data.data));
this.capturenr = JSON.parse(res.data.data);
this.$message({
duration: 1500,
showClose: true,
message: "信息已更新",
type: "success",
});
} else if (this.i > 9) {
window.clearInterval(this.timer);
this.timer = null;
this.i = 0;
this.searchloading = false;
this.setloading = false;
this.$message({
duration: 1500,
showClose: true,
message: "暂未获取到信息,请稍后再试!!",
type: "warning",
});
}
})
.catch();
},
clearform() {
console.log("清除其他数据");
this.capturenr = {};
this.setForm = {};
this.searchloading = false;
this.setloading = false;
},
clearData() {
this.capturenr = {};
this.setForm = {};
this.searchloading = false;
this.setloading = false;
},
},
};
</script>
<style lang="less">
.captureBoxVideo {
width: 400px;
margin: 0 auto;
margin-top: 24px;
.flexnr {
display: flex;
height: 32px;
line-height: 32px;
margin-bottom: 18px;
.wt80 {
text-align: right;
float: left;
font-size: 14px;
color: #606266;
margin: 0 12px 0 0;
box-sizing: border-box;
width: 100px;
display: block;
}
.mr20 {
flex: 1;
}
}
.searchImage {
margin-left: 110px;
}
.flexno {
display: flex;
height: 32px;
line-height: 32px;
margin-bottom: 18px;
.wt80 {
text-align: right;
float: left;
font-size: 14px;
color: #606266;
margin: 0 12px 0 0;
box-sizing: border-box;
width: 100px;
display: block;
}
.wt280 {
flex: 1;
}
}
.captureForm {
.el-form-item__content {
}
}
}
</style>

@ -0,0 +1,226 @@
<template>
<el-dialog
class="workStatus"
title="工作状态"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1280px"
>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="datetime"
placeholder="开始日期"
value-format="timestamp"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="datetime"
default-time="23:59:59"
placeholder="结束日期"
value-format="timestamp"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary">导出</el-button>
</el-form-item>
</el-form>
<el-table
ref="multipleTable"
:data="listData"
stripe
tooltip-effect="dark"
style="width: 100%"
v-loading="loading"
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column min-width="45" label="序号">
<template slot-scope="scope">
<span>{{ (page - 1) * pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column
prop="name"
label="采集时间"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="设备名称"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="设备编号"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="电源电压"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="工作温度"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="电池电量"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="浮充状态"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="scope">{{
scope.row.name == 0 ? "充电" : "放电"
}}</template>
</el-table-column>
<el-table-column
prop="name"
label="工作总时间"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="连续工作时间"
min-width="100"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="网络连接状态"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="scope">{{
scope.row.name == 0 ? "已连接" : "未连接"
}}</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getLineListJoggle } from "@/utils/api/index";
export default {
data() {
return {
isShow: false,
formdata: {},
listData: [
{
name: "测试",
},
{
name: "测试2",
},
],
loading: false,
seltermid: "", //id
selcmdId: "", //cmdId
requestId: "",
page: 1, //
pageSize: 20, //
total: 0, //
};
},
mounted() {},
methods: {
//
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",
});
}
this.getlistnr();
},
//
getlistnr(val) {
console.log(val);
this.seltermid = val.id;
this.selcmdId = val.cmdid;
this.loading = true;
getLineListJoggle({
pageindex: this.page,
pagesize: this.pageSize,
}).then((res) => {
this.listData = res.data.list;
this.total = res.data.total;
this.loading = false;
});
},
//
handleCurrentChange(val) {
this.page = val;
this.getlistnr();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getlistnr();
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
},
};
</script>
<<<<<<< HEAD
<style lang="less">
.workStatus {
.pageNation {
justify-content: flex-start;
margin-top: 16px;
.el-pagination {
padding: 0px;
.el-select .el-input {
margin-left: 0px;
}
}
}
}
</style>
=======
<style lang="less" scoped></style>
>>>>>>> hn1.0

@ -0,0 +1,702 @@
<template>
<div class="photoGraphicDevice">
<div class="photoBox">
<div class="photoGraphicBtnGroup">
<h4>拍照装置管理</h4>
<div>
<el-button
type="primary"
icon="el-icon-plus"
@click="handleAddPhoto()"
>新增</el-button
>
<el-button
type="primary"
icon="el-icon-document"
@click="handleExport()"
>导出</el-button
>
</div>
</div>
<div class="searchBox">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="电压等级" class="dybox">
<el-select v-model="formdata.dyId" @change="getSearchxl">
<el-option
v-for="item in dyOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="线路名称" class="xlbox">
<el-select
v-model="formdata.lineId"
@change="getSearchgt"
filterable
>
<el-option
v-for="item in xlOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="杆塔名称">
<el-select v-model="formdata.towerId" filterable>
<el-option
v-for="item in gtOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否在线" class="isonLineClass">
<el-select v-model="formdata.isonline" filterable>
<el-option
v-for="item in onlineOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input
v-model="formdata.search"
placeholder="请输入线路/杆塔/设备编号"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary" @click="onReset"></el-button>
</el-form-item>
</el-form>
</div>
<div class="photoGraphicTable">
<el-table
ref="multipleTable"
:data="terminalTableData"
stripe
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 40px)"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
v-loading="loading"
highlight-current-row
:row-key="getRowKeys"
>
<el-table-column prop="dyName" label="电压等级" show-overflow-tooltip>
</el-table-column>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column
prop="lineName"
label="线路名称"
show-overflow-tooltip
min-width="120"
>
<template slot-scope="scope">
<el-link @click.native.stop="handleLine(scope.row)">{{
scope.row.lineName
}}</el-link>
</template>
</el-table-column>
<el-table-column
prop="towerName"
label="杆塔名称"
show-overflow-tooltip
min-width="150"
>
<template slot-scope="scope">
<el-link @click.native.stop="handleTower(scope.row)">{{
scope.row.towerName
}}</el-link>
</template>
</el-table-column>
<el-table-column
prop="equipName"
label="设备名称"
show-overflow-tooltip
min-width="150"
>
</el-table-column>
<el-table-column
prop="cmdId"
label="设备编号"
show-overflow-tooltip
min-width="150"
>
</el-table-column>
<el-table-column
prop="protocolName"
label="规约名称"
show-overflow-tooltip
min-width="90"
/>
<el-table-column
prop="isonline"
label="是否在线"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ scope.row.isonline ? "在线" : "离线" }}</template
>
</el-table-column>
<el-table-column
prop="hasPan"
label="是否带云台"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ scope.row.hasPan == 1 ? "是" : "否" }}</template
>
</el-table-column>
<el-table-column prop="sim" label="SIM卡号" show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="netType"
label="网络类型"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="scope.row.netType == 1"> </span>
<span v-if="scope.row.netType == 2"> </span>
<span v-if="scope.row.netType == 3"> </span>
</template>
</el-table-column>
<el-table-column prop="model" label="装置型号" show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="bsManufacturer"
label="装置厂家"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="workingDate"
label="投运日期"
show-overflow-tooltip
>
<template slot-scope="scope">
{{
scope.row.workingDate == null
? ""
: $moment(scope.row.workingDate).format("yy-MM-DD")
}}</template
>
</el-table-column>
<el-table-column
prop="status"
label="装置状态"
show-overflow-tooltip
v-if="roleUser != 2"
>
<template slot-scope="scope">
{{ scope.row.status == 1 ? "运行中" : "已删除" }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="340"
v-if="roleUser != 2"
>
<template slot-scope="scope">
<el-dropdown
class="dropgps"
trigger="click"
@command="
(command) => {
handleSearchCommand(command, scope.row);
}
"
>
<span class="el-dropdown-link">
数据查询<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="info">基本信息</el-dropdown-item>
<el-dropdown-item command="workStatus"
>工作状态</el-dropdown-item
>
<el-dropdown-item command="runStatus"
>运行状态</el-dropdown-item
>
<el-dropdown-item command="GPS">GPS位置</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button
@click.native.stop="handleParameterSet(scope.row)"
type="text"
>参数配置</el-button
>
<el-button
@click.native.stop="handleRevisePhoto(scope.row)"
type="text"
>修改</el-button
>
<el-button
type="text"
@click.native.stop="handlepicture(scope.row)"
>图片标记</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
v-if="scope.row.status == 1"
>关闭</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
v-if="scope.row.status == 0"
>打开</el-button
>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="180" v-else>
<template slot-scope="scope">
<el-button
@click.native.stop="handleRevisePhoto(scope.row)"
type="text"
>修改</el-button
>
<el-button
type="text"
@click.native.stop="handlepicture(scope.row)"
>图片标记</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
<addPhotoDialog
:photoDialogTitle="photoDialogTitle"
ref="addPhotoDialogref"
></addPhotoDialog>
<pictureTags ref="picturetagsref"></pictureTags>
<gps-position ref="gpsdialog_ref"></gps-position>
<parameterSetDialog ref="parameterSetref"></parameterSetDialog>
<baseInfor ref="baseInfor_ref"></baseInfor>
<workStatus ref="workStatus_ref"></workStatus>
<runStatus ref="runStatus_ref"></runStatus>
<gpsSite ref="gpsSite_ref"></gpsSite>
<!-- 新增线路 -->
<add-lineDialog ref="addlineDialogref"></add-lineDialog>
<towerDialog ref="towerDialogref"></towerDialog>
</div>
</template>
<script>
import {
getTerminalJoggle,
deleteTerminalJoggle,
getSearchInfo,
getTerminalListExcel,
} from "@/utils/api/index";
import moment from "moment";
import addPhotoDialog from "./components/addPhotoDialog.vue";
import pictureTags from "./components/pictureTags.vue";
import gpsPosition from "./components/gpsPosition.vue";
import parameterSetDialog from "./components/parameterSetDialog.vue";
import baseInfor from "./components/baseInfor.vue";
import workStatus from "./components/workStatus.vue";
import runStatus from "./components/runStatus.vue";
import gpsSite from "./components/gpsSite.vue";
import addLineDialog from "./components/addLineDialog.vue";
import towerDialog from "./components/towerDialog.vue";
export default {
components: {
addPhotoDialog,
pictureTags,
gpsPosition,
parameterSetDialog,
baseInfor,
workStatus,
runStatus,
gpsSite,
addLineDialog,
towerDialog,
},
data() {
return {
dyOptions: [{ id: -1, name: "全部" }], //
xlOptions: [{ id: -1, name: "全部" }], //线
gtOptions: [{ id: -1, name: "全部" }], //
onlineOptions: [
{ id: -1, name: "全部" },
{ id: 1, name: "在线" },
{ id: 0, name: "离线" },
],
formdata: {
dyId: -1,
lineId: -1,
towerId: -1,
search: "",
isonline: -1,
},
roleUser: "",
terminalTableData: [], //
photoDialog: false, //
photoDialogTitle: "", //
deleteArr: [], //
multipleSelection: [], //
formphotoInfo: {}, //
page: 1, //
pageSize: 20, //
total: 0, //
loading: true,
gpsOptions: [
{
value: "1",
label: "GPS关闭",
},
{
value: "2",
label: "GPS开启",
},
],
gpsvalue: "1",
};
},
created() {
this.roleUser = localStorage.getItem("role");
console.log(this.roleUser);
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
console.log(this.$route.query);
this.formdata.search = this.$route.query.name;
console.log(this.formdata.search);
},
mounted() {
this.getSearchdy();
this.terminalList();
},
methods: {
getRowKeys(row) {
return row.id;
},
//线
handleLineLink(val) {
console.log(val);
this.$router.push({
path: "/lineInformation",
query: { lineName: val.lineName, name: val.towerName },
});
},
//
handletowerLink(val) {
console.log(val);
this.$router.push({
path: "/towerInformation",
query: { lineName: val.lineName, name: val.towerName },
});
},
//
getSearchdy() {
getSearchInfo({ type: 1 })
.then((res) => {
this.dyOptions = [{ id: -1, name: "全部" }];
this.dyOptions = this.dyOptions.concat(res.data.list);
this.formdata.dyId = this.dyOptions[0].id;
this.getSearchxl();
})
.catch((err) => {});
},
//线
getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyId })
.then((res) => {
this.xlOptions = [{ id: -1, name: "全部" }];
this.xlOptions = this.xlOptions.concat(res.data.list);
this.formdata.lineId = this.xlOptions[0].id;
this.getSearchgt();
})
.catch((err) => {});
},
//
getSearchgt() {
getSearchInfo({ type: 3, id: this.formdata.lineId })
.then((res) => {
this.gtOptions = [{ id: -1, name: "全部" }];
this.gtOptions = this.gtOptions.concat(res.data.list);
this.formdata.towerId = this.gtOptions[0].id;
})
.catch((err) => {});
},
//
onSubmit() {
this.page = 1;
this.terminalList();
},
//
onReset() {
this.formdata = {
isonline: -1,
};
this.getSearchdy();
this.page = 1;
this.pageSize = 20;
this.terminalList();
},
////
terminalList() {
this.loading = true;
this.$set(this.formdata, "pageindex", this.page);
this.$set(this.formdata, "pagesize", this.pageSize);
getTerminalJoggle(this.formdata)
.then((res) => {
console.log(res);
this.terminalTableData = res.data.list;
this.total = res.data.total;
this.loading = false;
})
.catch((err) => {
console.log(err); //
});
},
//
handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row);
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
dateFormat(row, column) {
var date = row[column.property];
if (date == undefined) {
return "";
}
return moment(date).format("YYYY-MM-DD HH:mm:ss");
},
//
handleAddPhoto() {
this.photoDialogTitle = "新增";
this.$refs.addPhotoDialogref.display();
this.$refs.addPhotoDialogref.getdataform(null);
},
//
handleExport() {
window.location.href = "/api/api/getTerminalListExcel";
},
handleLine(data) {
this.$refs.addlineDialogref.display();
this.$refs.addlineDialogref.getdataform(data);
},
handleTower(data) {
this.$refs.towerDialogref.display();
this.$refs.towerDialogref.getdataform(data);
},
//handleResive 线
handleRevisePhoto(data) {
this.photoDialogTitle = "修改";
this.$refs.addPhotoDialogref.display();
this.$refs.addPhotoDialogref.getdataform(data);
console.log(data);
},
//线
handlepicture(data) {
console.log(data);
this.$refs.picturetagsref.display(data);
},
//
handleSearchCommand(command, row) {
console.log(command, row);
switch (command) {
case "info":
this.$refs.baseInfor_ref.display();
break;
case "workStatus":
this.$refs.workStatus_ref.display();
break;
case "runStatus":
this.$refs.runStatus_ref.display();
break;
case "GPS":
this.$refs.gpsSite_ref.display();
break;
default:
break;
}
},
//
handleParameterSet(data) {
this.$refs.parameterSetref.display(data);
},
// //handleAddPhoto
// handleAddPhoto() {
// this.photoDialog = true;
// this.photoDialogTitle = "";
// },
// //handleRevisePhoto
// handleRevisePhoto(data) {
// this.photoDialog = true;
// this.photoDialogTitle = "";
// this.formphotoInfo = Object.assign({}, data);
// },
//
handleDelete(data) {
console.log(data);
this.deleteArr.push({
termid: data.id,
});
console.log(this.deleteArr);
this.$confirm("确定要关闭该装置?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
//
deleteTerminalJoggle({ list: this.deleteArr }).then((res) => {
console.log(res);
this.terminalList(); //
});
this.$message({
duration: 1500,
type: "success",
message: "关闭成功!",
showClose: true,
});
})
.catch(() => {
// this.$message({
// duration: 1500,
// type: "info",
// message: "",
// showClose: true,
// });
});
},
//
handleCurrentChange(val) {
this.page = val;
this.terminalList(); //
},
//
handleSizeChange(val) {
this.pageSize = val;
this.terminalList();
},
},
};
</script>
<style lang="less">
.photoGraphicDevice {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.photoBox {
border: 1px solid #dddddd;
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
.searchBox {
.ml10 {
margin-left: 10px;
}
.el-form {
.dybox {
.el-form-item__content {
width: 120px;
}
}
.xlbox {
.el-form-item__content {
width: 160px;
}
}
.isonLineClass {
.el-form-item__content {
width: 120px;
}
}
}
}
}
.photoGraphicBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
}
.searchBox {
margin-top: 8px;
}
.photoGraphicTable {
// margin-top: 16px;
//margin-top: 36px;
height: calc(100% - 94px);
}
.dropgps {
color: #169e8c;
// margin-left: 16px;
// margin-right: 16px;
cursor: pointer;
font-size: 12px;
width: 80px;
.el-input__inner {
padding: 0px;
border: none;
color: #169e8c;
font-size: 12px;
background-color: transparent;
}
}
}
.gpsdropbox {
.el-select-dropdown__item {
line-height: 27px;
padding: 0 15px;
font-size: 12px;
height: 27px;
}
}
</style>

@ -0,0 +1,563 @@
<template>
<div class="picRotation">
<div class="rotationBox">
<div class="picHead">
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
:current-page="page"
:page-size="pageSize"
layout=" prev, pager, next, jumper,total"
:total="total"
>
</el-pagination>
</div>
<div class="buttonGroup">
<span class="info">
<b> {{ isRuning ? remainingTime : "已暂停" }} </b>
</span>
<el-button type="primary" @click="toggleCountdown">{{
isRuning ? "暂停轮巡" : "开始轮巡"
}}</el-button>
<el-button type="primary" @click="setbtn"></el-button>
</div>
</div>
<div class="imageCenter" v-loading="loading" v-cloak>
<el-row
v-for="i in rowNum"
:key="'row-' + i"
:style="{ height: 100 / rowNum + '%' }"
>
<el-col
:span="24 / colNum"
v-for="(item, index) in picList"
v-if="index < colNum * i && index >= colNum * (i - 1)"
:key="'col-' + index"
>
<div class="imgList" @click="handleShowHistory(item)">
<div
v-if="item.path !== null && item.path.indexOf('videos') == -1"
class="bigpic"
>
<img :src="item.path + '!1366x768'" @error="setDefaultImage" />
</div>
<div
class="bigpic"
v-else-if="
item.path !== null && item.path.indexOf('videos') !== -1
"
>
<video
width="100%"
height="100%"
:src="item.path"
controls="controls"
></video>
</div>
<div class="bigpic" v-else>
<img src="../../assets/img/nopic.jpg" />
</div>
<div class="picInfo">
<p>
{{ item.linename }}-{{ item.towername }}-{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channnelname
}}
</p>
<p class="timeinfo" v-if="item.photoTime !== null">
{{ $moment(item.photoTime).format("YYYY-MM-DD HH:mm:ss") }}
</p>
<p class="timeinfo" v-else></p>
</div>
</div>
</el-col>
</el-row>
</div>
</div>
<el-dialog
title="设置"
:visible.sync="setdialog"
width="480px"
:close-on-click-modal="false"
class="setPicShow"
>
<el-form label-position="left">
<el-form-item label="轮巡速度">
<el-select v-model="selSpeed" placeholder="请选择">
<el-option
v-for="item in speedOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="画面布局" class="layoutBox">
<!-- <el-select v-model="selLayout" placeholder="s请选择">
<el-option
v-for="item in layoutOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> -->
<div class="selectGroup">
<div class="rowbox">
<el-radio-group v-model="rowradio" class="radio1">
<el-radio-button label="1"></el-radio-button>
<el-radio-button label="2"></el-radio-button>
<el-radio-button label="3"></el-radio-button>
<el-radio-button label="4"></el-radio-button>
<!-- <el-radio-button label="5"></el-radio-button>
<el-radio-button label="6"></el-radio-button> -->
</el-radio-group>
<span class="labelinfo"></span>
</div>
<div class="colbox">
<el-radio-group v-model="colradio" class="radio2">
<el-radio-button label="1"></el-radio-button>
<el-radio-button label="2"></el-radio-button>
<el-radio-button label="3"></el-radio-button>
<el-radio-button label="4"></el-radio-button>
<!-- <el-radio-button label="5"></el-radio-button>
<el-radio-button label="6"></el-radio-button> -->
</el-radio-group>
<span class="labelinfo"></span>
</div>
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="setdialog = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
<morePicPreveiw ref="morePicPreveiw_ref"></morePicPreveiw>
<!-- <el-dialog
title="历史图片"
:visible.sync="historyPicdialog"
width="1366px"
:close-on-click-modal="false"
class="showDialogHistoryPic"
>
<div class="title">
{{ picInfoData.linename }}-{{ picInfoData.towername }}-{{
picInfoData.alias !== null && picInfoData.alias !== ""
? picInfoData.alias
: picInfoData.channnelname
}} {{ $moment(picInfoData.photoTime).format("YYYY-MM-DD ") }}
</div>
<carouselChart
ref="carouselpic"
:terminalPhoto="terminalPhoto"
v-if="terminalPhoto.length > 0"
v-loading="historyPicLoading"
></carouselChart>
</el-dialog> -->
</div>
</template>
<script>
import { getPictureList, getTerminalPhotoListJoggle } from "@/utils/api/index";
// import carouselChart from "../realTimeMonitor/components/carouselChart";
import morePicPreveiw from "../realTimeMonitor/components/morePicPreveiw";
import defaultImage from "../../assets/img/nodatapic2.jpg";
export default {
components: {
morePicPreveiw,
},
data() {
return {
OptionssalseImg: {
inline: false,
button: true,
navbar: false,
title: false,
toolbar: false,
tooltip: false,
zoomable: true,
url: "src",
},
value: "选项1",
page: 1, //
pageSize: 4, //
totalPage: 0, //
total: 0, //
picList: [], //
remainingTime: 0, //
isRuning: false,
timer: null,
loading: false,
setdialog: false, //
speedOptions: [
{
value: 5,
label: "5秒",
},
{
value: 11,
label: "11秒",
},
{
value: 12,
label: "12秒",
},
{
value: 13,
label: "13秒",
},
{
value: 14,
label: "14秒",
},
{
value: 15,
label: "15秒",
},
], //
selSpeed: 5,
//
rowNum: "",
colNum: "",
rowradio: "4",
colradio: "4",
selLayout: 1,
options: [
{
value: "选项1",
label: "顺序",
},
{
value: "选项2",
label: "倒序",
},
],
//
picInfoData: {}, //
historyPicdialog: false,
historyPicLoading: false,
terminalPhoto: [], //
nopicPath: require("@/assets/img/nopic.jpg"),
};
},
methods: {
setDefaultImage(e) {
e.target.src = defaultImage;
},
//
handleShowHistory(item) {
console.log(item);
this.$refs.morePicPreveiw_ref.display(item);
// this.picInfoData = item;
// console.log(this.picInfoData);
// this.historyPicdialog = true;
// //this.getTerminalPhotoList(item.cmdid);
// this.getTerminalPhotoList(item.channelid, item.photoTime, item.termid);
},
//
getTerminalPhotoList(channelid, date, termId) {
this.terminalPhoto = [];
this.historyPicLoading = true;
getTerminalPhotoListJoggle({
channelid: channelid,
time: date,
terminalid: termId,
})
.then((res) => {
console.log(res);
this.historyPicLoading = false;
if (res.data.list.length == 0) {
this.terminalPhoto = [
{
path: this.nopicPath,
termId: termId,
mediatype: 0,
},
];
} else {
this.terminalPhoto = res.data.list;
}
})
.catch((err) => {
console.log(err); //
});
},
setbtn() {
this.isRuning = false;
this.pauseCountdown();
this.setdialog = true;
this.selSpeed = parseInt(localStorage.getItem("totalTime"))
? parseInt(localStorage.getItem("totalTime"))
: 15;
this.rowNum = parseInt(localStorage.getItem("row"))
? parseInt(localStorage.getItem("row"))
: 4;
this.colNum = parseInt(localStorage.getItem("col"))
? parseInt(localStorage.getItem("col"))
: 4;
this.rowradio = parseInt(localStorage.getItem("row"))
? parseInt(localStorage.getItem("row"))
: 4;
this.colradio = parseInt(localStorage.getItem("col"))
? parseInt(localStorage.getItem("col"))
: 4;
},
submitForm() {
localStorage.setItem("totalTime", this.selSpeed);
localStorage.setItem("row", this.rowradio);
localStorage.setItem("col", this.colradio);
this.rowNum = parseInt(localStorage.getItem("row"))
? parseInt(localStorage.getItem("row"))
: 4;
this.colNum = parseInt(localStorage.getItem("col"))
? parseInt(localStorage.getItem("col"))
: 4;
this.pageSize = this.rowradio * this.colradio;
this.setdialog = false;
this.$message.success("设置成功");
this.getPicData();
},
//
handleCurrentChange(val) {
this.isRuning = false;
this.pauseCountdown();
this.page = val;
this.getPicData();
},
//
getPicData() {
this.loading = true;
this.picList = [];
getPictureList({
pageindex: this.page,
pagesize: this.rowNum * this.colNum,
})
.then((res) => {
this.picList = res.data.list;
this.totalPage = res.data.totalpage;
this.total = res.data.total;
this.loading = false;
})
.catch((err) => {
console.log(err);
});
},
//
startCountdown() {
this.timer = setInterval(() => {
if (this.remainingTime <= 0) {
this.clearTimer();
this.page++;
if (this.page > this.totalPage) {
this.page = 0;
this.startCountdown();
} else {
this.remainingTime = parseInt(localStorage.getItem("totalTime"))
? parseInt(localStorage.getItem("totalTime"))
: 15;
this.getPicData();
this.startCountdown();
}
} else {
this.remainingTime--;
}
}, 1000);
},
clearTimer() {
//
clearInterval(this.timer);
this.timer = null;
},
pauseCountdown() {
//
clearInterval(this.timer);
this.timer = null;
},
//isRuning
toggleCountdown() {
if (this.isRuning) {
this.pauseCountdown();
} else {
this.startCountdown();
this.getPicData();
}
this.isRuning = !this.isRuning;
},
},
computed: {},
mounted() {
this.remainingTime = parseInt(localStorage.getItem("totalTime"))
? parseInt(localStorage.getItem("totalTime"))
: 15;
this.rowradio = this.rowNum = parseInt(localStorage.getItem("row"))
? parseInt(localStorage.getItem("row"))
: 4;
this.colradio = this.colNum = parseInt(localStorage.getItem("col"))
? parseInt(localStorage.getItem("col"))
: 4;
this.pageSize = this.rowradio * this.colradio;
//this.toggleCountdown();
this.getPicData();
},
created() {},
beforeDestroy() {
// console.log("");
clearInterval(this.timer);
this.timer = null;
},
};
</script>
<style lang="less">
.picRotation {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #ffffff;
.rotationBox {
border: 1px solid #dddddd;
height: calc(100% - 22px);
max-height: calc(100% - 22px);
padding: 12px;
border-radius: 4px;
}
.picHead {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0px 0px 8px 0px;
.buttonGroup {
display: flex;
.el-select {
margin-left: 10px;
width: 100px;
}
.info {
width: 80px;
text-align: center;
margin-right: 16px;
line-height: 32px;
b {
font-size: 24px;
font-weight: normal;
color: #67c23a;
vertical-align: middle;
}
}
}
}
.imageCenter {
// display: flex;
// flex-wrap: wrap;
height: calc(100% - 52px);
.el-col {
height: 100%;
padding-right: 0.1%;
padding-left: 0.1%;
padding-top: 0.1%;
padding-bottom: 0.1%;
}
// justify-content: space-between;
.imgList {
border: 1px solid #eee;
width: 100%;
position: relative;
//background-color: #00eaff;
height: 100%;
.bigpic {
width: 100%;
height: 100%;
background-size: 100% 100%;
}
img {
width: 100%;
height: 100%;
cursor: pointer;
}
.picInfo {
position: absolute;
background: #169e8ca1;
color: #fff;
height: auto;
font-size: 12px;
left: 0;
bottom: 0;
width: 100%;
text-align: center;
p {
margin-top: 4px;
}
.timeinfo {
margin-bottom: 4px;
}
}
}
}
.setPicShow {
.el-select {
width: 222px;
}
.layoutBox {
display: flex;
align-items: center;
}
.selectGroup {
display: flex;
flex-direction: column;
.el-radio-button--small .el-radio-button__inner {
padding: 9px 24px;
}
.rowbox {
margin-bottom: 8px;
.labelinfo {
margin-left: 8px;
}
}
.colbox {
.labelinfo {
margin-left: 8px;
}
}
}
}
.showDialogHistoryPic {
display: flex;
align-items: center;
justify-content: center;
.el-dialog {
width: 70% !important;
height: 90%;
transform: none;
margin: auto;
left: auto;
top: auto;
}
.el-dialog__body {
height: calc(100% - 70px);
.title {
height: 32px;
padding-left: 12px;
line-height: 32px;
color: #fff;
font-size: 14px;
background: linear-gradient(180deg, #4cdbc8 10%, #128071 100%);
text-align: center;
}
.thumb-example {
//height: 100%;
}
}
}
}
[v-cloak] {
display: none;
}
</style>

@ -0,0 +1,117 @@
<template>
<div class="buttonBox">
<!-- <el-button type="primary" @click="handleDeviceInfo"> </el-button> -->
<el-dropdown class="dropgps" trigger="click" @command="handleCommandWarn">
<el-button type="primary">
声光报警<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" class="gpsdropStyle">
<el-dropdown-item command="open">开启</el-dropdown-item>
<el-dropdown-item command="close">关闭</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
<script>
// import infoDialog from "./infoDialog.vue";
import { getTermStatus, alarmMarkJoggle } from "@/utils/api/index";
export default {
components: {
// infoDialog,
},
data() {
return {};
},
watch: {
termId: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
cmdId: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
},
computed: {
termId() {
return this.$store.state.termId;
},
cmdId() {
return this.$store.state.cmdId;
},
},
methods: {
//
handleCommandWarn(command) {
switch (command) {
case "open": //
this.handleWarn(1);
break;
case "close": //
this.handleWarn(0);
break;
}
},
//
handleWarn(val) {
console.log("声光报警");
console.log(this.termId);
getTermStatus({ termId: this.termId }).then((res) => {
console.log(res);
if (res.data.isonline) {
alarmMarkJoggle({
cmdId: this.cmdId,
ctrl: val,
termId: this.termId,
})
.then((res) => {
console.log(res);
if (res.code == 200) {
if (val == 1) {
this.$message({
duration: 1500,
showClose: true,
message: "声光报警开启成功",
type: "success",
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: "声光报警关闭成功",
type: "warning",
});
}
}
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "声光报警操作失败",
type: "error",
});
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
},
};
</script>
<style lang="less">
.picdropStyle,
.videodropStyle,
.gpsdropStyle {
width: 104px;
margin-top: 0px !important;
}
</style>

@ -0,0 +1,59 @@
<template>
<div class="buttonBox">
<!-- 线缆显示 -->
<el-dropdown class="dropgps" trigger="click" @command="handleCommandLine">
<el-button type="primary">
线缆显示<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" class="gpsdropStyle">
<el-dropdown-item command="open">开启</el-dropdown-item>
<el-dropdown-item command="close">关闭</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
<script>
export default {
components: {},
data() {
return {};
},
watch: {
termId: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
cmdId: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
},
computed: {
termId() {
return this.$store.state.termId;
},
cmdId() {
return this.$store.state.cmdId;
},
},
methods: {
//线
handleCommandLine(command) {
switch (command) {
case "open": //
console.log("开启");
//console.log(this.$parent.$parent.$refs.carouselpic.a());
this.$parent.$parent.$refs.carouselpic.openLine();
break;
case "close": //
console.log("关闭");
// this.$refs.carouselpic.handelClear();
this.$parent.$parent.$refs.carouselpic.closeLine();
break;
}
},
},
};
</script>

@ -0,0 +1,917 @@
<template>
<div class="thumb-example">
<div class="picTop">
<!-- 判断是否是图片并且不为空 -->
<div
class="bigimg"
v-if="
bigPicPath.indexOf('nopic') == -1 &&
bigPicPath.indexOf('videos') == -1
"
:style="bigPicPath ? 'backgroundImage:url(' + bigPicPath + ')' : ''"
>
<el-button
class="downBtn"
@click.stop="
downLoadPic(
bigPicPath.substring(0, bigPicPath.length - 9),
bigPicPath.substring(0, bigPicPath.length - 9)
)
"
>下载图片</el-button
>
<!-- @click="handleBigPicbox(bigPicPath)" v-viewer="OptionssalseImg"-->
<div
class="nosee"
:style="'backgroundImage:url(' + bigPicPath + ')'"
></div>
<div class="bigimgView" @click="handleBigPicbox(bigPicPath)">
<img
ref="picJpg"
class="animImg"
:src="bigPicPath"
@error="setDefaultImage"
/>
</div>
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
<!-- <img ref="picJpg" class="animImg" :src="bigPicPath + '!1366x768'" /> -->
</div>
<div class="bigimg" v-else-if="bigPicPath.indexOf('videos') !== -1">
<video
width="100%"
height="100%"
:src="bigPicPath.substring(0, bigPicPath.length - 9)"
controls="controls"
:poster="videopath"
autoplay
></video>
</div>
<div class="bigimg nopic" v-if="bigPicPath.indexOf('nopic') !== -1">
<img
class="animImg"
:src="bigPicPath.substring(0, bigPicPath.length - 9)"
/>
</div>
<div class="arrow leftArrow" v-if="this.bigNum != 0" @click="leftClick">
<i class="el-icon-arrow-left"></i>
</div>
<div
class="arrow rightArrow"
v-if="this.bigNum < this.terminalPhoto.length - 1"
@click="rightClick"
>
<i class="el-icon-arrow-right"></i>
</div>
</div>
<div class="picBottom">
<ul class="smallPicBox">
<li
v-for="(item, index) in fiveList"
@click="handleBigpic(item, index)"
:class="activeSmall === index ? 'borderActive' : ''"
>
<div
class="smallhavePic"
v-if="
item.path.indexOf('nopic') == -1 &&
item.path.indexOf('videos') == -1
"
>
<img :src="item.path + '!260x160'" @error="setDefaultImage" />
<p class="timeInfo">
<el-tooltip
class="item"
effect="dark"
content="拍照时间"
placement="top-start"
>
<span>{{ $moment(item.photoTime).format("HH:mm:ss") }}</span>
</el-tooltip>
(
<el-tooltip
class="item"
effect="dark"
content="图片上传时间"
placement="top-start"
>
<span> {{ $moment(item.recvTime).format("HH:mm:ss") }}</span>
</el-tooltip>
)
<span
>--{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelName
}}</span
>
</p>
</div>
<div
class="smallnoPic"
v-else-if="item.path.indexOf('videos') !== -1"
>
<img
src="../../../assets/img/loading.jpg"
style="object-fit: cover"
v-if="item.thumb == null"
/>
<img :src="item.thumb" v-else />
<p class="videoicon"><i class="el-icon-video-play"></i></p>
<p class="timeInfo">
<el-tooltip
class="item"
effect="dark"
content="拍照时间"
placement="top-start"
>
<span>{{ $moment(item.photoTime).format("HH:mm:ss") }}</span>
</el-tooltip>
(
<el-tooltip
class="item"
effect="dark"
content="图片上传时间"
placement="top-start"
>
<span> {{ $moment(item.recvTime).format("HH:mm:ss") }}</span>
</el-tooltip>
)
<span
>--{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelName
}}</span
>
</p>
</div>
<div class="smallnoPic" v-else>
<img :src="item.path" />
</div>
</li>
</ul>
<div
class="arrow leftArrow"
v-if="this.page != 1"
@click="smallLeftClick"
>
<i class="el-icon-arrow-left"></i>
</div>
<div
class="arrow rightArrow"
v-if="this.page < this.total"
@click="smallRightClick"
>
<i class="el-icon-arrow-right"></i>
</div>
</div>
<!-- 点击出现大图 -->
<div
v-if="showBigpic"
class="showPic"
v-loading="canvasloading"
@click="closePic($event)"
>
<div
class="picboxI"
@mousewheel.prevent="rollImg"
:style="{
transform: 'scale(' + zoomD + ')',
}"
@mousedown="move"
>
<img
@load="imgOnload"
id="bigimg"
ref="bigimgref"
class="maskPic img"
:src="bigImgPath"
/>
<!-- <canvas id="bigCanvas" class="myCanvas" ref="myCanvasbig"></canvas> -->
</div>
<div class="viewClose" @click="closePic($event)">
<i class="el-icon-close"></i>
</div>
</div>
</div>
</template>
<script>
import { getCoordinate, updateMarkEnableStatus } from "@/utils/api/index";
import defaultImage from "../../../assets/img/nodatapic2.jpg";
export default {
components: {},
props: {
terminalPhoto: {
type: Array,
default: () => [],
},
},
data() {
return {
OptionssalseImg: {
inline: false,
button: true,
navbar: false,
title: false,
toolbar: false,
tooltip: false,
zoomable: true,
url: "src",
},
isshowArrow: true, //
mediaType: "", //
bigPicPath: "", //
videopath: "",
smallPicPath: "", //
bigNum: 0, //
fiveList: [], //list
activeSmall: 0, //,
page: 1, //
pagesize: 5, //
total: 0, //
localPoints: [], //
canvas: null,
ctx: null,
imgpic: null,
color: "",
num: "",
showBigpic: false,
flagline: true,
markEnable: "",
zoomD: 1,
canvasloading: false,
bigImgPath: "",
};
},
mounted() {
console.log(this.terminalPhoto);
this.mediaType = this.terminalPhoto[0].mediaType;
this.bigPicPath = this.terminalPhoto[0].path + "!1366x768";
// this.bigPicPath = this.terminalPhoto[0].path + "!1366x768";
this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize);
this.total = this.terminalPhoto.length / this.pagesize;
console.log(this.fiveList);
//points
getCoordinate({
channelId:
this.fiveList[0].channelId == null ? 1 : this.fiveList[0].channelId,
needPic: "0",
termId: this.fiveList[0].termId,
})
.then((res) => {
console.log(res);
this.localPoints = res.data.list;
this.color = res.data.color;
this.num = res.data.boderWidth;
this.markEnable = res.data.markEnable;
if (this.markEnable === 1) {
this.drawline();
}
})
.catch((err) => {});
},
watch: {
terminalPhoto: function (newVal, oldVal) {
this.bigPicPath = this.terminalPhoto[0].path + "!1366x768";
this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize);
this.total = this.terminalPhoto.length / this.pagesize;
},
},
created() {},
methods: {
setDefaultImage(e) {
e.target.src = defaultImage;
this.bigPicPath = defaultImage;
},
downLoadPic(url, name) {
const image = new Image();
image.setAttribute("crossOrigin", "anonymous");
image.src = url;
image.onload = () => {
const canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
const ctx = canvas.getContext("2d");
ctx.drawImage(image, 0, 0, image.width, image.height);
canvas.toBlob((blob) => {
const url = URL.createObjectURL(blob);
this.download(url, name);
// URL
URL.revokeObjectURL(url);
});
};
},
download(href, name) {
const eleLink = document.createElement("a");
eleLink.download = name;
eleLink.href = href;
eleLink.click();
eleLink.remove();
},
// showbigpicPath(data) {
// console.log(data);
// if (data.includes("!")) {
// this.bigPicPath = data.substring(0, data.length - 9);
// } else {
// this.bigPicPath = data;
// this.bgbigPath = data;
// }
// console.log(this.bigPicPath);
// },
// handleBigPicbox() {
// this.showBigpic = true;
// },
//demo
move(e) {
console.log(e);
e.preventDefault();
//
var personBox = document.querySelector(".picboxI");
var img = document.querySelector(".img");
var x = e.pageX - img.offsetLeft;
var y = e.pageY - img.offsetTop;
//
personBox.addEventListener("mousemove", move);
console.log(personBox.addEventListener("mousemove", move));
console.log(personBox.style);
function move(e) {
console.log(personBox.style.left);
personBox.style.left = e.pageX - x + "px";
personBox.style.top = e.pageY - y + "px";
}
//
img.addEventListener("mouseup", function () {
personBox.removeEventListener("mousemove", move);
});
//
personBox.addEventListener("mouseout", function () {
personBox.removeEventListener("mousemove", move);
});
},
//
rollImg(e) {
let direction = e.deltaY > 0 ? "down" : "up";
if (direction === "up") {
//
this.large();
} else {
//
this.Small();
}
},
//
large() {
this.$nextTick(() => {
if (this.zoomD < 6) {
this.zoomD += 0.1;
}
document.querySelector(
".picboxI"
).style.transform = `matrix(${this.zoomD}, 0, 0,${this.zoomD}, 0, 0)`;
});
},
//
Small() {
this.$nextTick(() => {
if (this.zoomD > 0.3) {
this.zoomD -= 0.1;
}
document.querySelector(
".picboxI"
).style.transform = `matrix(${this.zoomD}, 0, 0, ${this.zoomD}, 0, 0)`;
});
},
imgOnload() {
console.log("加载完成");
this.canvasloading = false;
},
//
handleBigPicbox(val) {
console.log(val);
//this.canvasloading = true;
this.showBigpic = true;
this.bigImgPath = val.substring(0, val.length - 9);
},
closePic(e) {
console.log(e);
var btn = this.$refs.bigimgref;
console.log(btn);
if (btn) {
if (!btn.contains(event.target)) {
//.app-download
this.zoomD = 1;
this.showBigpic = false;
}
}
//
// this.showBigpic = false;
},
openline() {
this.flagline = true;
console.log("11111111111111111111111111", this.flagline);
updateMarkEnableStatus({
status: 1,
}).then((res) => {
console.log(res);
});
this.drawline();
},
drawline() {
this.canvas = this.$refs.myCanvas;
this.imgpic = this.$refs.picJpg;
console.log(this.canvas);
console.log(this.imgpic);
this.canvas.width = this.imgpic.offsetWidth; //
this.canvas.height = this.imgpic.offsetHeight; //
this.ctx = this.canvas.getContext("2d");
console.log(this.localPoints);
if (this.flagline == true) {
this.localPoints = this.localPoints;
} else {
this.localPoints = [];
}
console.log(this.ctx);
this.ctx.beginPath();
//线
this.ctx.strokeStyle = this.color;
// 线
this.ctx.lineWidth = this.num;
for (var i = 0; i < this.localPoints.length; i++) {
this.ctx.moveTo(
this.localPoints[i].x1 * this.imgpic.width,
this.localPoints[i].y1 * this.imgpic.height
);
this.ctx.lineTo(
this.localPoints[i].x2 * this.imgpic.width,
this.localPoints[i].y2 * this.imgpic.height
);
}
this.ctx.closePath();
this.ctx.stroke();
},
//线
handelClear() {
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
this.flagline = false;
updateMarkEnableStatus({
status: 0,
}).then((res) => {
console.log(res);
});
},
getphotoList() {
this.fiveList = this.terminalPhoto.slice(
(this.page - 1) * this.pagesize,
this.page * this.pagesize
);
this.bigPicPath = this.fiveList[this.activeSmall].path + "!1366x768";
this.videopath = this.fiveList[this.activeSmall].thumb;
},
//
leftClick() {
this.bigNum--; //
this.mediaType = this.terminalPhoto[this.bigNum].mediaType;
this.bigPicPath = this.terminalPhoto[this.bigNum].path + "!1366x768";
this.activeSmall--;
console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum);
console.log(this.page);
if (this.activeSmall < 0) {
this.activeSmall = 4;
this.smallLeftClick();
}
console.log(this.terminalPhoto[this.bigNum]);
getCoordinate({
channelId: this.terminalPhoto[this.bigNum].channelId,
needPic: "1",
termId: this.terminalPhoto[this.bigNum].termId,
})
.then((res) => {
console.log(res);
this.localPoints = res.data.list;
if (this.markEnable === 1) {
this.drawline();
}
})
.catch((err) => {});
},
//
rightClick() {
this.bigNum++; //
this.mediaType = this.terminalPhoto[this.bigNum].mediaType;
this.bigPicPath = this.terminalPhoto[this.bigNum].path + "!1366x768";
this.activeSmall++;
console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum);
if (this.activeSmall > 4) {
this.activeSmall = 0;
console.log(this.activeSmall);
this.smallRightClick();
}
getCoordinate({
channelId: this.terminalPhoto[this.bigNum].channelId,
needPic: "1",
termId: this.terminalPhoto[this.bigNum].termId,
})
.then((res) => {
console.log(res);
this.localPoints = res.data.list;
if (this.markEnable === 1) {
this.drawline();
}
})
.catch((err) => {});
},
//
handleBigpic(row, index) {
console.log(row);
console.log();
this.activeSmall = index;
this.mediaType = row.mediaType;
this.bigPicPath = row.path + "!1366x768";
// this.bgbigPath = row.path + "!1366x768";
getCoordinate({
channelId: row.channelId,
needPic: "1",
termId: row.termId,
})
.then((res) => {
console.log(res);
this.localPoints = res.data.list;
if (this.markEnable === 1) {
this.drawline();
}
// this.drawline();
})
.catch((err) => {});
},
//
smallLeftClick() {
this.activeSmall = 0;
console.log("点击了左侧");
this.page--;
if (this.page < 1) {
this.isshowArrow = false;
} else {
this.getphotoList();
}
console.log(this.page);
console.log(this.fiveList);
//points
getCoordinate({
channelId: this.fiveList[0].channelId,
needPic: "0",
termId: this.fiveList[0].termId,
})
.then((res) => {
console.log(res);
this.localPoints = res.data.list;
if (this.markEnable === 1) {
this.drawline();
}
// this.drawline();
})
.catch((err) => {});
},
//
smallRightClick() {
this.activeSmall = 0;
console.log("点击了右侧");
console.log(this.page);
this.page++;
this.getphotoList();
console.log(this.fiveList);
//points
getCoordinate({
channelId: this.fiveList[0].channelId,
needPic: "0",
termId: this.fiveList[0].termId,
})
.then((res) => {
console.log(res);
this.localPoints = res.data.list;
if (this.markEnable === 1) {
this.drawline();
}
// this.drawline();
})
.catch((err) => {});
},
},
};
</script>
<style lang="less">
.thumb-example {
width: 100%;
display: flex;
flex-direction: column;
height: calc(100% - 32px);
box-sizing: border-box;
.picTop {
width: 100%;
height: 80%;
overflow: hidden;
margin-bottom: 4px;
position: relative;
.downBtn {
position: absolute;
background: rgba(0, 0, 0, 0.5);
border: none;
right: 8px;
bottom: 16px;
color: #fff;
z-index: 5;
&:hover {
background: rgba(0, 0, 0, 0.9);
color: #169e8c;
}
}
&:hover {
.arrow {
opacity: 1;
transition: all 0.5s ease-in;
}
}
.bigimg {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
background-size: 100% 100%;
.nosee {
width: 100%;
height: 100%;
position: absolute;
background-size: 100% 100%;
z-index: 2;
}
.bigimgView {
width: 100%;
height: 100%;
position: absolute;
z-index: 3;
opacity: 0;
.animImg {
opacity: 0;
}
}
.mark {
position: absolute;
bottom: 12px;
color: #fff;
background-color: rgba(0, 0, 0, 0.5);
left: 16px;
font-size: 14px;
line-height: 24px;
//opacity: 0;
transition: bottom 2s ease 0s;
}
.myCanvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
cursor: pointer;
z-index: 2;
}
}
img {
width: 100%;
height: 100%;
object-fit: fill;
cursor: pointer;
}
.arrow {
opacity: 0;
position: absolute;
cursor: pointer;
color: #fff;
font-size: 16px;
border-radius: 30px;
position: absolute;
top: 50%;
transform: translateY(-50%);
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
color: #fff;
text-align: center;
line-height: 60px;
width: 40px;
height: 40px;
z-index: 4;
&:hover {
color: #169e8c;
}
}
.leftArrow {
left: 16px;
}
.rightArrow {
right: 16px;
}
}
.picBottom {
width: 100%;
height: 20%;
position: relative;
.smallPicBox {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
li {
width: 20%;
border: 3px solid transparent;
// overflow: hidden;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
position: relative;
img {
width: 100%;
height: 100%;
object-fit: fill;
cursor: pointer;
}
.smallhavePic {
width: 100%;
height: 100%;
}
.smallnoPic {
width: 100%;
height: 100%;
}
}
.timeInfo {
position: absolute;
bottom: 0px;
width: 100%;
background: #f0f0f0;
padding: 6px 0px;
font-size: 12px;
text-align: center;
color: #333;
}
.videoicon {
position: absolute;
top: 73%;
left: 10%;
transform: translate(-50%, -50%);
i {
font-size: 28px;
color: #fff;
}
}
.borderActive {
.timeInfo {
//background: @color-primary;
background: linear-gradient(180deg, #00eaff 10%, #169e8c 100%);
color: #fff;
}
}
// .borderActive {
// border: 3px solid @color-primary;
// &::after {
// content: "";
// position: absolute;
// width: 0;
// height: 0;
// left: 50%;
// top: -16px;
// margin-left: -8px;
// border-bottom: 13px solid @color-primary;
// border-left: 8px solid transparent;
// border-right: 8px solid transparent;
// }
// }
}
.arrow {
position: absolute;
cursor: pointer;
color: #fff;
font-size: 12px;
border-radius: 30px;
position: absolute;
top: 45%;
transform: translateY(-50%);
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
color: #fff;
text-align: center;
line-height: 60px;
width: 28px;
height: 28px;
}
.leftArrow {
left: 16px;
}
.rightArrow {
right: 16px;
}
}
//
.showPic {
position: fixed;
background-color: rgba(0, 0, 0, 50%);
bottom: 0;
left: 0;
overflow: hidden;
right: 0;
top: 0;
z-index: 9999;
width: 100%;
height: 100%;
display: flex;
cursor: pointer;
.picboxI {
position: relative;
width: 85%;
height: 85%;
margin: auto;
animation-name: scaleDraw;
/*关键帧名称*/
animation-timing-function: ease;
/*动画的速度曲线*/
animation-iteration-count: 1;
/*动画播放的次数*/
animation-duration: 0.65s;
display: flex;
align-items: center;
justify-content: center;
img {
max-width: 100%;
max-height: 100%;
margin: auto;
position: absolute;
cursor: grab;
}
.myCanvas {
position: absolute;
// top: 0;
// left: 0;
max-width: 100%;
max-height: 100%;
margin: 0 auto;
cursor: pointer;
pointer-events: none;
}
}
.viewClose {
-webkit-app-region: no-drag;
background-color: rgba(0, 0, 0, 0.5);
border-radius: 50%;
cursor: pointer;
height: 80px;
overflow: hidden;
position: absolute;
right: -40px;
top: -40px;
transition: background-color 0.15s;
width: 80px;
.el-icon-close {
bottom: 16px;
left: 16px;
position: absolute;
color: #fff;
font-size: 18px;
}
}
}
}
@keyframes scaleDraw {
/*定义关键帧、scaleDrew是需要绑定到选择器的关键帧名称*/
0% {
transform: scale(0);
/*开始为原始大小*/
}
100% {
transform: scale(1);
}
}
// https://v1.github.surmon.me/vue-awesome-swiper/
</style>

@ -0,0 +1,612 @@
<template>
<div class="thumb-example">
<div class="radioBox" v-if="roleUser != 2">{{ radioPx }}</div>
<div class="topPic">
<div
class="bigPic"
v-if="currentPicPath.indexOf('nopic') !== -1 && currentPicPath"
>
<el-image :src="currentPicPath"></el-image>
</div>
<div
class="bigPic"
v-else-if="currentPicPath && mediaType == 0"
v-loading="picLoading"
>
<el-image
:src="currentPicPath + '!1366x768'"
:preview-src-list="srcList"
@load="loadImage"
ref="picJpg"
>
<template slot="error">
<img src="../../../assets/img/nodatapic2.jpg" />
</template>
</el-image>
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
<!-- <img :src="currentPicPath + '!1366x768'" @load="loadImage" /> -->
</div>
<div class="bigPic" v-else-if="currentPicPath && mediaType == 1">
<video
width="100%"
height="100%"
:src="currentPicPath"
controls="controls"
autoplay
></video>
</div>
<div class="arrow leftArrow" @click="leftClick" v-if="currentPage > 0">
<i class="el-icon-arrow-left"></i>
</div>
<el-button
class="downBtn"
@click.stop="downLoadPic(currentPicPath, currentPicPath)"
>下载图片</el-button
>
<div
class="arrow rightArrow"
@click="rightClick"
v-if="currentPage < terminalPhoto.length - 1"
>
<i class="el-icon-arrow-right"></i>
</div>
</div>
<div class="bottomPic" v-on:wheel="handleScroll">
<el-carousel
:loop="false"
:autoplay="false"
ref="carousel"
indicator-position="none"
@change="changeItem"
>
<el-carousel-item
class="el-car-item"
v-for="(list, index) in terminalPhoto"
:key="index"
>
<div
class="smallPic"
v-for="(item, index2) in list"
:key="index2"
@click="changeBigPic(item, index2)"
:class="activeSmall === index2 ? 'borderActive' : ''"
>
<div
class="picBox"
v-if="
item.path.indexOf('nopic') == -1 &&
item.path.indexOf('videos') == -1
"
>
<!-- <el-image v-lazy="item.path + '!260x160'"></el-image> -->
<img v-lazy="item.path + '!260x160'" />
<p class="timeInfo">
<el-tooltip
class="item"
effect="dark"
content="拍照时间"
placement="top-start"
>
<span>{{ $moment(item.photoTime).format("HH:mm:ss") }}</span>
</el-tooltip>
(
<el-tooltip
class="item"
effect="dark"
content="图片上传时间"
placement="top-start"
>
<span> {{ $moment(item.recvTime).format("HH:mm:ss") }}</span>
</el-tooltip>
)
<span
>--{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelName
}}</span
>
</p>
</div>
<div class="picBox" v-else-if="item.mediaType == 1">
<!-- <el-image :src="item.thumb + '!260x160'"></el-image> -->
<img v-lazy="item.thumb + '!260x160'" />
<p class="timeInfo">
<i class="el-icon-video-camera"></i>
<el-tooltip
class="item"
effect="dark"
content="拍照时间"
placement="top-start"
>
<span>{{ $moment(item.photoTime).format("HH:mm:ss") }}</span>
</el-tooltip>
(
<el-tooltip
class="item"
effect="dark"
content="图片上传时间"
placement="top-start"
>
<span> {{ $moment(item.recvTime).format("HH:mm:ss") }}</span>
</el-tooltip>
)
<span
>--{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelName
}}</span
>
</p>
</div>
<div class="picBox" v-else>
<!-- <el-image :src="item.path"></el-image> -->
<img v-lazy="item.path" />
</div>
</div>
</el-carousel-item>
</el-carousel>
</div>
</div>
</template>
<script>
import defaultImage from "../../../assets/img/nodatapic2.jpg";
import { getCoordinate, updateMarkEnableStatus } from "@/utils/api/index";
export default {
components: {},
props: {
terminalPhoto: {
type: Array,
default: () => [],
},
photoNum: {
type: Number,
default: () => [],
},
},
data() {
return {
picLoading: true,
currentPicPath: "", //
mediaType: "", //
activeSmall: 0, //,
currentPage: 0,
srcList: [],
radioPx: "",
roleUser: "",
localPoints: [], //线
flagLine: true, //线
canvas: null,
ctx: null,
imgpic: null,
color: "", //线
borderwidth: "", //线
markEnable: "", //
};
},
mounted() {
console.log(this.terminalPhoto);
this.changeBigPic(this.terminalPhoto[0][0], 0);
},
watch: {
terminalPhoto: {
handler(newVal, oldVal) {
this.terminalPhoto = newVal;
},
immediate: true,
deep: true, //deep false
},
},
created() {
this.roleUser = localStorage.getItem("role");
console.log(this.roleUser);
},
methods: {
//
downLoadPic(url, name) {
const image = new Image();
image.setAttribute("crossOrigin", "anonymous");
image.src = url;
image.onload = () => {
const canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
const ctx = canvas.getContext("2d");
ctx.drawImage(image, 0, 0, image.width, image.height);
canvas.toBlob((blob) => {
const url = URL.createObjectURL(blob);
this.download(url, name);
// URL
URL.revokeObjectURL(url);
});
};
},
download(href, name) {
const eleLink = document.createElement("a");
eleLink.download = name;
eleLink.href = href;
eleLink.click();
eleLink.remove();
},
//线
getPointList(data) {
getCoordinate({
channelId: data.channelId,
needPic: "1",
termId: data.termId,
})
.then((res) => {
console.log(res);
this.localPoints = res.data.list;
this.color = res.data.color;
this.borderwidth = res.data.boderWidth;
this.markEnable = res.data.markEnable;
if (this.markEnable === 1) {
this.drawline();
}
})
.catch((err) => {});
},
//线
openLine() {
this.flagLine = true;
console.log("我是绘制线缆");
//1
updateMarkEnableStatus({
status: 1,
}).then((res) => {
console.log(res);
});
this.drawline();
},
//线
closeLine() {
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
this.flagLine = false;
console.log("关闭线缆");
//0
updateMarkEnableStatus({
status: 0,
}).then((res) => {
console.log(res);
});
},
//线
drawline() {
this.canvas = this.$refs.myCanvas;
this.imgpic = this.$refs.picJpg;
console.log(this.canvas);
console.log(this.imgpic);
this.canvas.width = this.imgpic.imageWidth; //
this.canvas.height = this.imgpic.imageHeight; //
this.ctx = this.canvas.getContext("2d");
console.log(this.localPoints);
if (this.flagLine == true) {
this.localPoints = this.localPoints;
console.log(this.localPoints);
} else {
this.localPoints = [];
}
console.log(this.ctx);
this.ctx.beginPath();
//线
this.ctx.strokeStyle = this.color;
// 线
this.ctx.lineWidth = this.borderwidth;
console.log(this.ctx.lineWidth, this.ctx.strokeStyle);
console.log(this.localPoints);
if (this.localPoints == null) {
return;
} else {
for (var i = 0; i < this.localPoints.length; i++) {
this.ctx.moveTo(
this.localPoints[i].x1 * this.imgpic.imageWidth,
this.localPoints[i].y1 * this.imgpic.imageHeight
);
this.ctx.lineTo(
this.localPoints[i].x2 * this.imgpic.imageWidth,
this.localPoints[i].y2 * this.imgpic.imageHeight
);
}
this.ctx.closePath();
this.ctx.stroke();
}
// this.ctx.beginPath(); //
// this.ctx.moveTo(100, 100); //
// this.ctx.lineTo(300, 100); //
// this.ctx.lineTo(300, 300); //
// this.ctx.closePath(); //
// this.ctx.stroke(); //
},
//
leftClick() {
console.log("我点击了左侧按钮", this.activeSmall, this.currentPage);
this.activeSmall--;
if (this.activeSmall < 0) {
this.currentPage--;
this.$refs.carousel.setActiveItem(this.currentPage);
this.activeSmall =
this.terminalPhoto[this.terminalPhoto.length - 1].length - 1;
}
this.changeBigPic(
this.terminalPhoto[this.currentPage][this.activeSmall],
this.activeSmall
);
},
rightClick() {
console.log(this.activeSmall);
console.log(this.terminalPhoto.length);
this.activeSmall++;
if (this.activeSmall > this.photoNum - 1) {
this.currentPage++;
this.$refs.carousel.setActiveItem(this.currentPage);
this.activeSmall = 0;
}
this.changeBigPic(
this.terminalPhoto[this.currentPage][this.activeSmall],
this.activeSmall
);
},
//
changeBigPic(data, i) {
console.log(data, i);
console.log("鼠标222222222", this.currentPage, this.activeSmall);
this.srcList = [];
this.localPoints = [];
this.activeSmall = i;
this.mediaType = data.mediaType;
this.currentPicPath = data.path;
this.srcList.push(data.path);
if (data.width != undefined) {
this.radioPx = data.width + "x" + data.height;
} else {
this.radioPx = "";
}
this.getPointList(data);
},
loadImage() {
this.picLoading = false;
},
changeItem(e) {
// console.log(this.currentPage);
// this.currentPage = e;
// if (e === 0) {
// this.activeSmall = 0;
// //this.changeBigPic(this.terminalPhoto[0][0], 0);
// } else {
// this.activeSmall = 0;
// // this.changeBigPic(this.terminalPhoto[this.currentPage][0], 0);
// }
//this.active = e; // tab
},
//
handleScroll(e) {
let direction = e.deltaY > 0 ? "down" : "up"; //deltaY
console.log(e.deltaY, direction);
if (direction == "down") {
if (
this.currentPage == this.terminalPhoto.length - 1 &&
this.activeSmall ==
this.terminalPhoto[this.terminalPhoto.length - 1].length - 1
) {
this.$message({
message: "已经是最后一张图",
type: "success",
showClose: true,
duration: 500,
});
return;
} else {
// this.rightClick();
this.activeSmall++;
if (this.activeSmall > this.photoNum - 1) {
this.currentPage++;
this.$refs.carousel.setActiveItem(this.currentPage);
this.activeSmall = 0;
}
console.log(this.activeSmall);
}
}
if (direction == "up") {
if (this.currentPage == 0 && this.activeSmall == 0) {
this.$message({
showClose: true,
duration: 500,
message: "已经是最新一张图",
type: "success",
});
return;
} else {
// this.leftClick();
console.log(this.activeSmall);
this.activeSmall--;
console.log(this.activeSmall);
if (this.activeSmall < 0) {
this.currentPage--;
console.log("我是页数", this.currentPage);
this.$refs.carousel.setActiveItem(this.currentPage);
this.activeSmall = this.terminalPhoto[this.currentPage].length - 1;
console.log(this.terminalPhoto);
console.log(this.terminalPhoto[this.currentPage].length);
console.log("我是选中的值", this.activeSmall);
}
console.log(this.activeSmall);
}
}
},
},
};
</script>
<style lang="less">
.thumb-example {
width: 100%;
// display: flex;
// flex-direction: column;
height: calc(100% - 32px);
box-sizing: border-box;
.radioBox {
position: absolute;
top: 8px;
right: 24px;
color: #fff;
font-size: 14px;
}
.topPic {
width: 100%;
height: 80%;
margin-bottom: 4px;
position: relative;
.bigPic {
width: 100%;
height: 100%;
.el-image {
width: 100%;
height: 100%;
img {
width: 100%;
height: 100%;
}
}
}
.myCanvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
cursor: pointer;
z-index: 3;
pointer-events: none;
}
&:hover {
.arrow {
opacity: 1;
transition: all 0.5s ease-in;
}
.downBtn {
opacity: 1;
transition: all 0.5s ease-in;
}
}
.arrow {
opacity: 0;
position: absolute;
cursor: pointer;
font-size: 16px;
border-radius: 30px;
position: absolute;
top: 50%;
transform: translateY(-50%);
color: #4cdbc8;
font-weight: bold;
background-color: rgba(31, 45, 61, 0.8);
display: flex;
justify-content: center;
align-items: center;
text-align: center;
line-height: 60px;
width: 40px;
height: 40px;
z-index: 4;
&:hover {
background-color: rgba(31, 45, 61, 1);
}
}
.leftArrow {
left: 16px;
}
.rightArrow {
right: 16px;
}
.downBtn {
position: absolute;
background: rgba(0, 0, 0, 0.5);
border: none;
right: 24px;
bottom: 24px;
color: #fff;
z-index: 5;
opacity: 0;
&:hover {
background: rgba(0, 0, 0, 0.9);
color: #169e8c;
}
}
}
.bottomPic {
width: 100%;
height: 20%;
margin-bottom: 6px;
.el-carousel {
height: 100%;
.el-carousel__container {
height: 100% !important;
}
.el-carousel__arrow {
color: #4cdbc8;
font-weight: bold;
background-color: rgba(31, 45, 61, 0.8);
&:hover {
background-color: rgba(31, 45, 61, 1);
}
}
}
.el-car-item {
display: flex;
justify-content: center;
.smallPic {
width: 20%;
border: 3px solid transparent;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
position: relative;
cursor: pointer;
.picBox {
width: 100%;
height: 100%;
}
// .el-image {
// width: 100%;
// height: 100%;
// }
img {
width: 100%;
height: 100%;
}
.timeInfo {
position: absolute;
bottom: 0px;
width: 100%;
background: #f0f0f0;
padding: 6px 0;
font-size: 12px;
text-align: center;
color: #333;
.el-icon-video-camera {
font-size: 20px;
margin-right: 8px;
align-items: center;
vertical-align: sub;
color: #169e8c;
}
}
}
.borderActive {
.timeInfo {
color: #fff;
background: linear-gradient(180deg, #4cdbc8 10%, #128071);
}
}
}
}
}
</style>

@ -0,0 +1,58 @@
<template>
<div class="buttonBox">
<el-button type="primary" @click="handleDeviceInfo"> </el-button>
<info-dialog ref="infodialog_ref"></info-dialog>
</div>
</template>
<script>
import infoDialog from "./infoDialog.vue";
import { getTermStatus } from "@/utils/api/index";
export default {
components: {
infoDialog,
},
data() {
return {};
},
watch: {
termId: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
cmdId: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
},
computed: {
termId() {
return this.$store.state.termId;
},
cmdId() {
return this.$store.state.cmdId;
},
},
methods: {
handleDeviceInfo() {
this.picLoading = true;
getTermStatus({ termId: this.termId }).then((res) => {
console.log(res);
if (res.data.isonline) {
this.$refs.infodialog_ref.display(this.termId, this.cmdId);
this.$refs.infodialog_ref.getinfo();
} else {
this.picLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
},
};
</script>

@ -0,0 +1,110 @@
<template>
<div class="gpsbuttonBox">
<el-button type="primary" @click="handleShowGPS">GPS </el-button>
<el-dropdown class="dropgps" trigger="click" @command="handleCommandGps">
<el-button type="primary">
GPS开关<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" class="gpsdropStyle">
<el-dropdown-item command="open">开启GPS</el-dropdown-item>
<el-dropdown-item command="close">关闭GPS</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<gps-position ref="gpsdialog_ref"></gps-position>
</div>
</template>
<script>
// import infoDialog from "./infoDialog.vue";
import gpsPosition from "./gpsPosition.vue";
import { getTermStatus, setTermGPSJoggle } from "@/utils/api/index";
export default {
components: {
gpsPosition,
},
data() {
return {};
},
watch: {
termId: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
cmdId: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
},
computed: {
termId() {
return this.$store.state.termId;
},
cmdId() {
return this.$store.state.cmdId;
},
},
methods: {
//gps
handleCommandGps(command) {
switch (command) {
case "open": //
this.changeGPS(1, this.cmdId);
break;
case "close": //
this.changeGPS(0, this.cmdId);
break;
}
},
changeGPS(val, cmdid) {
console.log(val, cmdid);
getTermStatus({ termId: this.termId }).then((res) => {
console.log(res);
if (res.data.isonline) {
setTermGPSJoggle({ gpsstatus: val, cmdId: cmdid })
.then((res) => {
console.log(res);
if (val == 0) {
this.$message({
duration: 1500,
message: "GPS已关闭",
type: "warning",
showClose: true,
});
} else {
this.$message({
duration: 1500,
message: "成功开启GPS",
type: "success",
showClose: true,
});
}
})
.catch((err) => {
console.log(err); //
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
//GPS
handleShowGPS() {
this.$refs.gpsdialog_ref.display(this.cmdId, this.termId);
this.$refs.gpsdialog_ref.getgpssql();
},
},
};
</script>
<style lang="less">
.gpsbuttonBox {
width: 100%;
display: flex;
justify-content: space-between;
}
</style>

@ -0,0 +1,161 @@
<template>
<el-dialog
class="gpsPoisitiondialog"
title="GPS位置"
:visible.sync="isShow"
:close-on-click-modal="false"
width="662px"
@close="handleclose"
>
<div class="gpsbox" v-loading="loading">
<el-descriptions :column="1" border>
<el-descriptions-item>
<template slot="label"> 采集时间 </template
>{{ $moment(infornr.updatetime).format("YYYY-MM-DD HH:mm:ss") }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 经度 </template>{{ infornr.longitude }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 纬度 </template>{{ infornr.latitude }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 半径 </template>{{ infornr.radius }}
</el-descriptions-item>
</el-descriptions>
<el-button type="text" class="newBtn" @click="getgpsData()"
>获取最新GPS位置</el-button
>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
getTermLastGPSPosition,
getTermGPSJoggle,
getTermGPSPosition,
} from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
loading: false,
isShow: false,
timer: null,
infornr: {},
i: 0,
queryTime: "", //ID
zzcmdid: "",
zztermid: "",
};
},
mounted() {},
methods: {
//
getgpssql() {
getTermLastGPSPosition({
termId: this.zztermid,
})
.then((res) => {
this.infornr = res.data;
// this.$message({
// duration: 1500,
// showClose: true,
// message: "gps",
// type: "success",
// });
})
.catch((err) => {});
},
//
getgpsData() {
console.log(this.zzcmdid);
console.log(this.zztermid);
this.loading = true;
getTermGPSPosition({
cmdId: this.zzcmdid,
})
.then((res) => {
this.queryTime = res.data;
console.log(this.zztermid);
this.getNewgpsData(this.zztermid);
this.timer = window.setInterval(() => {
this.getNewgpsData(this.zztermid);
this.i++;
}, 3000);
})
.catch((err) => {});
},
//
getNewgpsData(val) {
getTermGPSJoggle({
queryTime: this.queryTime,
termid: val,
})
.then((res) => {
this.loading = true;
if (res.code == 200) {
this.infornr = res.data;
if (res.data.hasNew == true) {
this.loading = false;
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "gps信息已更新",
type: "success",
});
clearInterval(this.timer);
} else if (this.i > 9) {
this.loading = false;
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "暂未获取到GPS信息请稍后再试",
type: "warning",
});
clearInterval(this.timer);
}
} else {
this.$message.error(res.code.msg);
}
})
.catch((err) => {});
},
display(cmdid, newTermId) {
this.isShow = true;
this.zzcmdid = cmdid;
this.zztermid = newTermId;
},
hide() {
this.isShow = false;
},
handleclose() {
this.i = 0;
clearInterval(this.timer);
this.timer = null;
this.loading = false;
},
},
};
</script>
<style lang="less">
.gpsPoisitiondialog {
.gpsbox {
p {
line-height: 32px;
height: 32px;
font-size: 16px;
}
.newBtn {
margin-top: 14px;
}
}
}
</style>

@ -0,0 +1,240 @@
<template>
<el-dialog
class="infoDialog"
title="装置信息"
:visible.sync="isShow"
:close-on-click-modal="false"
width="50%"
@close="handleclose"
>
<div class="infoTable" v-loading="loading">
<el-descriptions :column="1" border>
<el-descriptions-item>
<template slot="label"> 装置编号 </template>{{ cmdid }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 电池电量 </template
>{{ infornr.batteryCapacity }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 电池电压 </template
>{{ infornr.batteryVoltage }}V
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> MEID </template>{{ infornr.cmld }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 网络连接状态 </template
>{{ infornr.connectionState == 0 ? "正常" : "断开" }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 浮充状态 </template
>{{ infornr.floatingCharge == 0 ? "充电" : "放电" }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 工作总时间 </template
>{{ infornr.totalWorkingTime }}小时
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 本次连续工作时间 </template
>{{ infornr.workingTime }}小时
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 工作状态更新时间 </template
>{{
$moment(infornr.wsUpdateTime * 1000).format("yy-MM-DD HH:mm:ss")
}}
</el-descriptions-item>
</el-descriptions>
<el-button type="text" class="newBtn" @click="getListData()"
>获取最新装置信息</el-button
>
</div>
<div slot="footer" class="dialog-footer">
<!-- <el-button @click="isShow = false"> </el-button> -->
<el-button type="primary" @click="handleclose" :disabled="loading"
> </el-button
>
</div>
</el-dialog>
</template>
<script>
import {
getDeviceList,
getNewDeviceList,
getinfoStatus,
} from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
loading: false,
isShow: false,
infornr: {}, //
timer: null,
i: 0,
queryTime: "", //ID
cmdid: "",
zztermid: "",
};
},
mounted() {},
methods: {
//
getinfo() {
this.loading = true;
getinfoStatus({
termId: this.zztermid,
})
.then((res) => {
this.infornr = res.data;
this.loading = false;
})
.catch((err) => {});
},
// getNewData() {
// let params = [
// {
// name: "act",
// value: "runningstatus",
// },
// ];
// this.setTermFn(params);
// },
// setTermFn(dataParams) {
// console.log("", "runningstatus");
// setTermCamera({
// termId: this.zztermid,
// list: dataParams,
// })
// .then((res) => {
// console.log(res);
// this.requestid = res.data.requestId;
// //this.getinfo1();
// clearInterval(this.timer);
// this.timer = window.setInterval(() => {
// this.getinfo();
// this.i++;
// }, 1000);
// // this.timer = setInterval(() => {
// // this.getinfo();
// // this.i++;
// // }, 1000);
// })
// .catch((err) => {});
// },
// getinfo() {
// getTermCameraRequest({ requestid: this.requestid })
// .then((res) => {
// if (res.data.success == 1) {
// window.clearInterval(this.timer);
// this.timer = null;
// this.i = 0;
// console.log("");
// // && res.data.result == 255
// console.log(JSON.parse(res.data.data));
// this.$message({
// duration: 1500,
// showClose: true,
// message: "",
// type: "success",
// });
// } else if (this.i > 9) {
// window.clearInterval(this.timer);
// this.timer = null;
// this.i = 0;
// this.$message({
// duration: 1500,
// showClose: true,
// message: "",
// type: "warning",
// });
// }
// })
// .catch((err) => {});
// },
//
getListData() {
this.loading = true;
getDeviceList({
termId: this.zztermid,
})
.then((res) => {
this.queryTime = res.data.queryTime;
//this.getNewListData(this.zztermid);
this.timer = window.setInterval(() => {
this.getNewListData(this.zztermid);
this.i++;
}, 2000);
})
.catch((err) => {});
},
//
getNewListData(val) {
getNewDeviceList({
queryTime: this.queryTime,
termId: val,
})
.then((res) => {
if (res.code == 200) {
this.infornr = res.data;
if (res.data.isNew == true) {
this.i = 0;
this.$message.success("装置信息已更新");
clearInterval(this.timer);
this.loading = false;
} else if (this.i > 4) {
this.i = 0;
this.$message.warning("暂无响应,请稍后再试!");
clearInterval(this.timer);
this.loading = false;
}
} else {
this.$message.error(res.code.msg);
}
})
.catch((err) => {});
},
// display() {
// this.isShow = true;
// },
display(newTermId, cmdid) {
console.log(newTermId, cmdid);
this.isShow = true;
this.zztermid = newTermId;
this.cmdid = cmdid;
},
hide() {
this.isShow = false;
},
handleclose() {
this.isShow = false;
this.loading = false;
this.i = 0;
clearInterval(this.timer);
this.timer = null;
},
},
destroyed() {
this.isShow = false;
this.loading = false;
this.i = 0;
clearInterval(this.timer);
this.timer = null;
},
};
</script>
<style lang="less">
.infoDialog {
.newBtn {
margin-top: 14px;
}
}
</style>

@ -0,0 +1,155 @@
<template>
<div class="morePicBox" v-if="isShow">
<div class="headTitle">
<div class="info">
<p>
{{ deviceData.linename }} - {{ deviceData.towername }} - ({{
deviceData.alias !== null && deviceData.alias !== ""
? deviceData.alias
: deviceData.channnelname
}}) -
{{ $moment(deviceData.photoTime).format("YYYY-MM-DD") }}
</p>
<!-- <p class="timeinfo" v-if="item.mediatype !== null">
{{ $moment(item.photoTime).format("YYYY-MM-DD HH:mm:ss") }}
</p> -->
</div>
<div class="closeBox" @click="handleclose">
<i class="el-icon-close"></i>
</div>
</div>
<div class="picmain" v-loading="picLoading">
<carouselChart
ref="carouselpic"
:terminalPhoto="terminalPhoto"
:photoNum="photoNum"
v-if="terminalPhoto.length > 0"
></carouselChart>
</div>
</div>
</template>
<script>
import carouselChart from "./carouselChart.vue";
import { getTerminalPhotoListJoggle } from "@/utils/api/index";
export default {
components: {
carouselChart,
},
props: {
title: String,
},
data() {
return {
isShow: false,
deviceData: "",
terminalPhoto: [], //
nopicPath: require("@/assets/img/nopic.jpg"),
picLoading: false,
photoNum: 10,
};
},
mounted() {},
methods: {
display(data) {
this.isShow = true;
console.log(data);
this.deviceData = data;
if (data.photoTime == null) {
data.photoTime = new Date().getTime();
}
this.getTerminalPhotoList(data.channelid, data.photoTime, data.termid);
},
//
getTerminalPhotoList(channelid, date, termId) {
this.terminalPhoto = [];
this.picLoading = true;
getTerminalPhotoListJoggle({
channelid: channelid,
time: date,
terminalid: termId,
})
.then((res) => {
console.log(res);
this.picLoading = false;
if (res.data.list.length == 0) {
this.terminalPhoto = [
{
path: this.nopicPath,
termId: termId,
mediatype: 0,
},
];
} else {
this.terminalPhoto = res.data.list;
}
let newDataList = [];
let current = 0;
if (this.terminalPhoto && this.terminalPhoto.length > 0) {
for (let i = 0; i <= this.terminalPhoto.length - 1; i++) {
if (i % this.photoNum !== 0 || i === 0) {
if (!newDataList[current]) {
newDataList.push([this.terminalPhoto[i]]);
} else {
newDataList[current].push(this.terminalPhoto[i]);
}
} else {
current++;
newDataList.push([this.terminalPhoto[i]]);
}
}
}
this.terminalPhoto = [...newDataList];
})
.catch((err) => {
console.log(err); //
});
},
handleclose() {
this.isShow = false;
},
},
};
</script>
<style lang="less">
.morePicBox {
position: fixed;
width: 100%;
height: 100%;
background: #fff;
top: 0px;
left: 0px;
//z-index: 99999;
.headTitle {
height: 40px;
padding-left: 18px;
padding-right: 18px;
line-height: 40px;
color: #fff;
font-size: 14px;
background: linear-gradient(180deg, #4cdbc8 10%, #128071);
display: flex;
justify-content: space-between;
align-items: center;
.closeBox {
width: 24px;
height: 24px;
align-items: center;
display: flex;
justify-content: center;
cursor: pointer;
}
}
.radioBox {
position: absolute;
top: 12px;
right: 68px;
color: #fff;
font-size: 14px;
}
.picmain {
width: 100%;
height: calc(100% - 10px);
}
}
</style>

@ -0,0 +1,273 @@
<template>
<div class="AreaBox">
<div class="areaHead">{{ areaData.cmdid }}</div>
<div class="paramsDate">
<h3>日历快速查询</h3>
<el-date-picker
v-model="dateValue"
type="date"
placeholder="选择日期"
format="yyyy 年 MM 月 dd 日"
:picker-options="pickerOptions"
@change="changedate"
:clearable="false"
>
</el-date-picker>
</div>
<div class="paramsDate">
<h3>通道监拍点</h3>
<!-- <el-radio-group v-model="selectChannelValue" @input="changeChannelId">
<el-radio-button
v-for="item in channelListOption"
:key="item.channelid"
:value="item.channelid"
:label="item.channelid"
>
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelname
}}</el-radio-button
>
</el-radio-group> -->
<el-select
v-model="selectChannelValue"
placeholder="请选择通道"
@change="changeChannelId"
ref="multiSelect"
>
<el-option
v-for="item in channelListOption"
:key="item.channelid"
:label="
item.alias !== null && item.alias !== ''
? item.alias
: item.channelname
"
:value="item.channelid"
>
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelname
}}
</el-option>
</el-select>
</div>
<div class="paramsDate setTimebtn">
<h3>操作项</h3>
<div class="buttonGroup">
<takePicButton></takePicButton>
<takeVideoButton></takeVideoButton>
<deviceInfoButton></deviceInfoButton>
<scheduleButton></scheduleButton>
<alarmButton></alarmButton>
<cableButton></cableButton>
<gpsButton></gpsButton>
<el-button type="primary" @click="handlehistoryPic">
历史图片</el-button
>
<el-button type="primary" @click="handleParams"> </el-button>
<!-- <el-button type="primary" @click="handleTakePic" :loading="picLoading"
>主动拍照
</el-button> -->
<!-- <el-button type="primary">主动拍照 </el-button>
<el-button type="primary">主动拍照 </el-button>
<el-button type="primary">主动拍照 </el-button>
<el-button type="primary">主动拍照 </el-button>
<el-button type="primary">主动拍照 </el-button>
<el-button type="primary">主动拍照 </el-button>
<el-button type="primary">主动拍照 </el-button> -->
</div>
</div>
<parameterSetDialog ref="parameterSetref"></parameterSetDialog>
</div>
</template>
<script>
import takePicButton from "./takePicButton.vue";
import takeVideoButton from "./takeVideoButton.vue";
import deviceInfoButton from "./deviceInfoButton.vue";
import scheduleButton from "./scheduleButton.vue";
import alarmButton from "./alarmButton.vue";
import cableButton from "./cableButton.vue";
import gpsButton from "./gpsButton.vue";
import parameterSetDialog from "../../photographicDevice/components/parameterSetDialog.vue";
import { getChannelByTermidJoggle } from "@/utils/api/index";
export default {
components: {
takePicButton,
takeVideoButton,
deviceInfoButton,
scheduleButton,
alarmButton,
cableButton,
gpsButton,
parameterSetDialog,
},
data() {
return {
selectChannelValue: null, //
channelListOption: [], //
dateValue: "", //
pickerOptions: {
disabledDate(date) {
return date.getTime() > Date.now(); //
},
},
picLoading: false, //loading
selectDyId: "", //线
selectLineId: "",
selectTowerId: "",
};
},
watch: {
areaData: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
},
computed: {
areaData() {
return this.$store.state.currentData;
},
},
mounted() {
this.getDateTime();
},
methods: {
//
getDateTime() {
console.log(new Date());
this.dateValue = new Date().getTime();
console.log(this.dateValue);
},
//
changedate() {
console.log(this.dateValue.getTime());
this.$parent.getPhotoList(
this.selectChannelValue,
this.dateValue,
this.areaData.id
);
},
//
getChannelList() {
console.log(this.areaData);
getChannelByTermidJoggle({ termid: this.areaData.id })
.then((res) => {
console.log(res);
this.channelListOption = [
{ channelname: "全部", channelid: -1, alias: null },
];
this.channelListOption = this.channelListOption.concat(res.data.list);
console.log(this.channelListOption);
this.selectChannelValue = this.channelListOption[0].channelid; //;
this.$store.commit("channelId", this.selectChannelValue); //vuex
this.$store.commit("channelIdList", res.data.list); //vuex
this.$parent.getPhotoList(
this.selectChannelValue,
this.dateValue,
this.areaData.id
);
this.selectDyId = res.data.dyId;
this.selectLineId = res.data.lineId;
this.selectTowerId = res.data.towerId;
})
.catch((err) => {
console.log(err); //
});
},
//
changeChannelId(val) {
console.log(val);
this.$store.commit("channelId", val); //currentDatavuex
this.$parent.getPhotoList(val, this.dateValue, this.areaData.id);
},
//
handlehistoryPic() {
console.log(this.areaData);
console.log(this.selectDyId, this.selectLineId, this.selectTowerId);
// console.log(this.zzCmdid, this.selectChannelValue);
if (typeof this.dateValue == "number") {
this.dateValue = new Date(new Date().toLocaleDateString()).getTime();
} else {
this.dateValue = this.dateValue.getTime();
}
this.$router.push({
path: "/realTimeSearch",
query: {
dyId: this.selectDyId,
lineId: this.selectLineId,
towerId: this.selectTowerId,
termId: this.areaData.id,
cmdId: this.areaData.cmdid,
channelId: this.selectChannelValue,
date: this.dateValue,
},
});
},
//
handleParams() {
console.log(this.areaData);
this.$refs.parameterSetref.display(this.areaData);
},
},
};
</script>
<style lang="less">
.AreaBox {
.areaHead {
height: 32px;
line-height: 32px;
color: #169e8c;
font-size: 14px;
font-weight: normal;
}
.paramsDate {
margin-bottom: 16px;
position: relative;
h3 {
font-size: 14px;
font-weight: normal;
color: #303133;
margin-bottom: 8px;
}
.el-radio-group {
display: flex;
flex-wrap: wrap;
.el-radio-button {
margin-right: 6px;
margin-top: 6px;
.el-radio-button__inner {
padding: 8px 4px;
width: 66px;
border-left: 1px solid #dcdfe6;
border-radius: 4px;
}
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
box-shadow: none !important;
}
}
}
}
.setTimebtn {
.buttonGroup {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.el-button {
margin-bottom: 8px;
width: 104px;
}
.el-button + .el-button {
margin-left: 0px;
}
}
}
}
</style>

@ -0,0 +1,176 @@
<template>
<div class="previewContain" v-loading="previewLoading">
<div class="pictureBox">
<el-row
v-for="i in rowNum"
:key="'row-' + i"
:style="{ height: 100 / rowNum + '%' }"
>
<el-col
:span="24 / colNum"
v-for="(item, index) in picList"
:key="'col-' + index"
v-if="index < colNum * i && index >= colNum * (i - 1)"
>
<div class="imgcloum" @click="handleTowerPic(item)">
<!-- 首先判断是否是图片mediatype=0,并且path不为空 展示图片 -->
<img
:src="item.path + '!1366x768'"
v-if="item.mediatype == 0 && item.path !== null"
@error="setDefaultImage"
/>
<!-- 判断是否是视频mediatype=1,并且path不为空 展示图片 -->
<img
v-else-if="item.mediatype == 1 && item.thumb !== null"
:src="item.thumb + '!1366x768'"
/>
<!-- 判断是否是视频mediatype=bull,并且path为空 展示暂无图片 -->
<img
v-else-if="item.mediatype == null"
src="../../../assets/img/nodatapic2.jpg"
/>
<div class="picInfo">
<p>
{{ item.linename }}-{{ item.towername }}-{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channnelname
}}
</p>
<p class="timeinfo" v-if="item.mediatype !== null">
{{ $moment(item.photoTime).format("YYYY-MM-DD HH:mm:ss") }}
</p>
<p class="timeinfo" v-else></p>
</div>
</div>
</el-col>
</el-row>
</div>
<div class="pageNation" v-if="picList.length !== 0">
<el-pagination
@current-change="handleCurrentChange"
:current-page="page"
:page-size="pageSize"
layout=" prev, pager, next, jumper,total"
:total="total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import { getTowerAndPhotoList } from "@/utils/api/index";
import defaultImage from "../../../assets/img/nodatapic2.jpg";
export default {
data() {
return {
rowNum: 4,
colNum: 4,
page: 1, //
pageSize: 16, //
totalPage: 0, //
total: 0, //
picList: [], //
id: "",
type: "",
previewLoading: false,
};
},
mounted: function () {},
methods: {
setDefaultImage(e) {
e.target.src = defaultImage;
},
//
getPicList(id, type, page) {
this.id = id;
this.type = type;
this.page = page;
console.log(id, type);
this.previewLoading = true;
getTowerAndPhotoList({
id: id,
type: type,
pageindex: page,
pagesize: this.rowNum * this.colNum,
})
.then((res) => {
this.previewLoading = false;
console.log(res);
this.picList = res.data.list;
this.totalPage = res.data.totalpage;
this.total = res.data.total;
})
.catch((err) => {
console.log(err); //
});
},
handleTowerPic(val) {
console.log(val);
this.$parent.jumpTowerPic(val);
console.log("调用父组件方法");
},
//
handleCurrentChange(val) {
this.page = val;
this.picList = [];
this.getPicList(this.id, this.type, this.page);
},
},
};
</script>
<style lang="less">
.previewContain {
width: 100%;
padding: 16px;
height: auto;
//background: #fcc;
.pictureBox {
height: calc(100% - 38px);
//background-color: aquamarine;
.el-col {
height: 100%;
padding-right: 0.3%;
padding-left: 0.3%;
padding-top: 0.3%;
padding-bottom: 0.3%;
border-radius: 4px;
overflow: hidden;
}
.imgcloum {
width: 100%;
height: 100%;
// background: #f00;
cursor: pointer;
position: relative;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
&:hover {
border: 1px solid #169e8c;
}
img {
width: 100%;
height: 100%;
}
.picInfo {
position: absolute;
background: #169e8ca1;
color: #fff;
height: auto;
font-size: 12px;
left: 0;
bottom: 0;
width: 100%;
text-align: center;
.timeinfo {
margin-top: 4px;
margin-bottom: 4px;
}
}
}
}
}
</style>

@ -0,0 +1,36 @@
<template>
<div class="buttonBox">
<el-button type="primary" @click="handleSetSchedule"> </el-button>
<setschedule ref="setschedule_ref"></setschedule>
</div>
</template>
<script>
import { getTermStatus } from "@/utils/api/index";
import setschedule from "./setschedule.vue";
export default {
components: { setschedule },
data() {
return {};
},
watch: {},
computed: {
termId() {
return this.$store.state.termId;
},
cmdId() {
return this.$store.state.cmdId;
},
},
methods: {
handleSetSchedule() {
this.$refs.setschedule_ref.display();
// this.$refs.setschedule_ref.getSingleAccess(
// this.zztermId,
// this.zzCmdid,
// this.zzprotocol
// );
// this.$refs.setschedule_ref.deviceList();
},
},
};
</script>

@ -0,0 +1,912 @@
<template>
<el-dialog
class="setTimeDialog"
title="拍照时间表设置"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1000px"
@close="handleclose"
>
<div class="zzinfo">装置编号{{ areaData.cmdid }}</div>
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<el-tab-pane label="拍照时间表查询" name="1">
<div class="searchTime">
<div class="channelBox">
<span>选择通道</span>
<el-select
v-model="selectChannel"
placeholder="请选择"
@change="changeChannel"
>
<el-option
v-for="item in channelList"
:key="item.channelid"
:label="
item.alias !== null && item.alias !== ''
? item.alias
: item.channelname
"
:value="item.channelid"
>
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelname
}}
</el-option>
</el-select>
</div>
<div class="timeContain">
<div class="timeLeft" v-loading="baseTimeLoading">
<h3>时间表({{ baseTimeList.length }})</h3>
<div class="tagsBox" v-if="baseTimeList.length !== 0">
<el-tag v-for="(item, index) in baseTimeList" :key="index"
>{{ $moment(item).format("HH:mm") }}
</el-tag>
</div>
<div class="nodata" v-else>
<el-empty description="暂无数据"></el-empty>
</div>
</div>
<div class="timeRight" v-loading="deviceTimeLoading">
<h3>
装置时间表({{ deviceTimeList.length }})
<span
v-if="deviceTimeList.length !== 0 && offsetNumTime !== null"
>偏移量{{ offsetNumTime }}分钟</span
>
</h3>
<div class="tagsBox" v-if="deviceTimeList.length !== 0">
<el-tag v-for="(item, index) in deviceTimeList" :key="index">{{
$moment(item).format("HH:mm")
}}</el-tag>
</div>
<div class="nodata" v-else>
<el-empty description="暂无数据">
<el-button type="primary" @click="deviceTimeClick"
>装置时间表</el-button
>
</el-empty>
</div>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="拍照时间表下发" name="2">
<div class="setTimerule">
<el-table
ref="multipleTable"
:data="rulesListNew"
stripe
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 40px)"
v-loading="ruleLoading"
>
<!-- <el-table-column type="index" width="55"> </el-table-column>
<el-table-column type="selection" width="55"> </el-table-column> -->
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column label="名称" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="时间表规则">
<template slot-scope="scope">
<p
class="timeGz"
v-for="(val, index) in scope.row.listTime"
:key="index"
>
<span>{{ val.startTime }} </span>
~
<span>{{ val.endTime }}</span>
间隔<b>{{ val.timeSpan }}分钟</b>
</p>
</template>
</el-table-column>
<el-table-column
prop="remark"
label="备注"
show-overflow-tooltip
></el-table-column>
<el-table-column fixed="right" label="操作" width="140">
<template slot-scope="scope">
<el-button
type="primary"
@click.native.stop="handleSet(scope.row)"
>设置</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
<el-dialog
class="setRoadDialog"
title="设置"
:visible.sync="isShowset"
:close-on-click-modal="false"
width="660px"
append-to-body
@close="closebtn"
>
<div class="setTimeTd">
<div class="ruleinfo">
<h3>装置信息</h3>
<!-- <el-descriptions title="" :column="3" border>
<el-descriptions-item label="装置名称">{{
areaData.name
}}</el-descriptions-item>
<el-descriptions-item label="装置编号">
{{ areaData.cmdid }}</el-descriptions-item
>
</el-descriptions> -->
<p>
<span>{{ infoData.dyname }}</span> /
<span>{{ infoData.bsManufacturer }}</span> /
<span>{{ infoData.xlname }}</span> /
<span>{{ infoData.zzcmid }}</span>
</p>
</div>
<div class="ruleinfo">
<h3>时间表规则</h3>
<div class="ruleBox">
<span class="nameinfo"
>时间表名称{{ currentTimeRule.name }}</span
>
<div class="listGz">
<p
class="timeGz"
v-for="(val, index) in currentTimeRule.listTime"
:key="index"
>
<span>{{ val.startTime }} </span>
~
<span>{{ val.endTime }}</span>
间隔<b>{{ val.timeSpan }}分钟</b>
</p>
</div>
</div>
</div>
<div class="ruleinfo">
<div class="math">
偏移时间()
<el-input-number
v-model="setNum"
:min="0"
:max="9"
></el-input-number>
</div>
</div>
<div class="ruleinfo">
<h3>选择通道</h3>
<div class="checkBox">
<el-radio-group v-model="timeChannel">
<el-radio
:label="item.channelid"
border
v-for="item in timeChannelList"
:key="item.channelid"
>{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelname
}}</el-radio
>
</el-radio-group>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="closebtn"> </el-button>
<el-button type="primary" @click="submitForm" :loading="sureloading"
> </el-button
>
</div>
</el-dialog>
</el-tab-pane>
</el-tabs>
</el-dialog>
</template>
<script>
import {
getChannelListJoggle,
getSchedulenr,
getScheduleRulelListJoggle,
getScheduleRulelAccessList,
setTermCamera,
getTermCameraRequest,
getTermStatus,
} from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
isShow: false,
activeName: "1", //
infoData: {},
selectChannel: "", //
channelList: [], //
baseTimeList: [], //
deviceTimeList: [], //
baseTimeLoading: false,
deviceTimeLoading: false,
deviceTimer: null, //
deviceNum: 1, //
offsetTime: 0, //
page: 1, //
pageSize: 20, //
total: 0, //
rulesList: [], //
rulesListNew: [], //
ruleLoading: false, //loading
isShowset: false, //
currentTimeRule: [],
setNum: 0, //
timeChannel: "",
timeChannelList: [], //
sureloading: false, //loading
offsetNumTime: null,
};
},
computed: {
areaData() {
return this.$store.state.currentData;
},
},
mounted() {},
methods: {
handleClick(tab, event) {
console.log(tab, event);
//
if (tab.name == 2) {
this.deviceTimeList = [];
this.getruleList();
}
},
//
getChannelSelect() {
getChannelListJoggle({ termid: this.areaData.id })
.then((res) => {
this.channelList = res.data.list;
this.timeChannelList = res.data.list;
this.timeChannel = this.channelList[0].channelid;
this.selectChannel = this.channelList[0].channelid;
console.log(this.channelList);
this.changeChannel();
})
.catch((err) => {});
},
//
changeChannel() {
console.log(this.selectChannel);
this.getDataBaseTime(this.areaData.id, this.selectChannel);
this.baseTimeLoading = true;
this.deviceTimeList = [];
},
//
getDataBaseTime(id, channelId) {
getSchedulenr({
channelid: channelId,
terminalid: id,
})
.then((res) => {
console.log(res);
let val = res.data.list;
this.offsetNumTime = res.data.offset;
if (
this.areaData.protocol == "65283" ||
this.areaData.protocol == "65285"
) {
//
console.log("湖南");
console.log(val);
var hnarr = [];
for (var i = 0; i < val.length; i++) {
if (i % 3 == 0) {
var hnobj = {};
hnobj.span = val[i].hour * 60 + val[i].minute;
console.log("时间间隔");
} else if (i % 3 == 1) {
console.log("开始时间");
console.log("a");
hnobj.startTime = this.$moment(val[i]).format("HH:mm");
} else if (i % 3 == 2) {
console.log("结束时间");
hnobj.endTime = this.$moment(val[i]).format("HH:mm");
hnarr.push(hnobj);
}
}
console.log("222222222222222222");
console.log(hnarr);
console.log("22222222222222222222222");
let dayArr = [];
//
for (let k = 0; k < hnarr.length; k++) {
console.log(hnarr[k].startTime);
console.log(hnarr[k].endTime);
console.log(hnarr[k].span);
let Stime = this.$moment(hnarr[k].startTime, "HH:mm").format(
"YYYY-MM-DD HH:mm:ss"
);
let Etime = this.$moment(hnarr[k].endTime, "HH:mm").format(
"YYYY-MM-DD HH:mm:ss"
);
let spanTime = hnarr[k].span;
while (
this.$moment(Stime).isBefore(this.$moment(Etime)) ||
this.$moment(Stime).isSame(this.$moment(Etime))
) {
dayArr.push(Stime);
Stime = this.$moment(Stime)
.add(spanTime, "minute")
.format("YYYY-MM-DD HH:mm:ss");
}
// //
console.log(dayArr);
}
this.baseTimeList = [...new Set(dayArr)];
} else {
//
this.baseTimeList = res.data.list;
}
this.baseTimeLoading = false;
})
.catch((err) => {});
},
//
deviceTimeClick() {
console.log("点击了获取装置时间表");
if (this.areaData.onlinestatus === 1) {
this.deviceTimeLoading = true;
let params = [
{
name: "act",
value: "schedule",
},
{
name: "flag",
value: 0,
},
{
name: "channel",
value: this.selectChannel,
},
];
this.setTermFn(params);
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
},
//
setTermFn(dataParams) {
console.log("点击了统一的接口", dataParams);
setTermCamera({
termId: this.areaData.id,
list: dataParams,
})
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
clearInterval(this.timer);
this.deviceTimer = window.setInterval(() => {
this.getinfo();
this.deviceNum++;
console.log(this.deviceNum, this.deviceNum * 1000);
}, 1000 * this.deviceNum);
})
.catch((err) => {});
},
getinfo() {
getTermCameraRequest({ requestid: this.requestid })
.then((res) => {
if (res.data.success == 1) {
this.deviceTimeLoading = false;
window.clearInterval(this.deviceTimer);
this.deviceTimer = null;
this.deviceNum = 1;
console.log(JSON.parse(res.data.data));
//this.deviceTimeList = JSON.parse(res.data.data).groupData;
//this.processingData(JSON.parse(res.data.data).groupData); //
this.processingData(JSON.parse(res.data.data).groupData); //
console.log(this.deviceTimeList);
this.$message({
duration: 1500,
showClose: true,
message: "装置时间表已更新",
type: "success",
});
} else if (this.deviceNum > 9) {
this.deviceTimeLoading = false;
window.clearInterval(this.deviceTimer);
this.deviceTimer = null;
this.deviceNum = 1;
this.$message({
duration: 1500,
showClose: true,
message: "查询失败",
type: "error",
});
}
})
.catch((err) => {});
},
//
getruleList() {
this.ruleLoading = true;
getScheduleRulelListJoggle({
pageindex: this.page,
pagesize: this.pageSize,
})
.then((res) => {
console.log(res);
this.rulesList = res.data.list;
this.total = res.data.total;
this.rulesListNew = [];
this.changeListData(this.rulesList);
this.ruleLoading = false;
})
.catch((err) => {});
},
//
changeListData(data) {
//
for (let i = 0; i < data.length; i++) {
console.log(data[i]);
var ruleArr = [];
//
for (let k = 0; k < data[i].list.length; k++) {
if (k % 3 == 0) {
//
var ruleObj = {};
ruleObj.timeSpan =
data[i].list[k].hour * 60 + data[i].list[k].minute;
console.log("时间间隔", ruleObj.timeSpan);
} else if (k % 3 == 1) {
//
ruleObj.startTime = this.$moment(data[i].list[k]).format("HH:mm");
console.log(this.$moment(data[i].list[k]).format("HH:mm"));
} else if (k % 3 == 2) {
ruleObj.endTime = this.$moment(data[i].list[k]).format("HH:mm");
console.log(this.$moment(data[i].list[k]).format("HH:mm"));
ruleArr.push(ruleObj);
}
}
this.rulesListNew.push({
id: data[i].id,
list: data[i].list,
name: data[i].name,
remark: data[i].remark,
listTime: ruleArr,
});
}
console.log(this.rulesListNew);
},
//
processingData(val) {
console.log(this.areaData.protocol);
if (
this.areaData.protocol == "65283" ||
this.areaData.protocol == "65285"
) {
//
console.log("湖南");
console.log(val);
var hnarr = [];
for (var i = 0; i < val.length; i++) {
if (i % 3 == 0) {
var hnobj = {};
hnobj.span = val[i].hour * 60 + val[i].minute;
console.log("时间间隔");
} else if (i % 3 == 1) {
console.log("开始时间");
console.log("a");
hnobj.startTime = this.$moment(val[i]).format("HH:mm");
} else if (i % 3 == 2) {
console.log("结束时间");
hnobj.endTime = this.$moment(val[i]).format("HH:mm");
hnarr.push(hnobj);
}
}
console.log("222222222222222222");
console.log(hnarr);
console.log("22222222222222222222222");
let dayArr = [];
//
for (let k = 0; k < hnarr.length; k++) {
console.log(hnarr[k].startTime);
console.log(hnarr[k].endTime);
console.log(hnarr[k].span);
let Stime = this.$moment(hnarr[k].startTime, "HH:mm").format(
"YYYY-MM-DD HH:mm:ss"
);
let Etime = this.$moment(hnarr[k].endTime, "HH:mm").format(
"YYYY-MM-DD HH:mm:ss"
);
let spanTime = hnarr[k].span;
if (this.$moment(Etime).isBefore(this.$moment(Stime))) {
let zeroEnd = this.$moment("23:59", "HH:mm").format(
"YYYY-MM-DD HH:mm:ss"
);
let zeroStart = this.$moment("00:00", "HH:mm").format(
"YYYY-MM-DD HH:mm:ss"
);
while (
this.$moment(Stime).isBefore(this.$moment(zeroEnd)) ||
this.$moment(Stime).isSame(this.$moment(zeroEnd))
) {
dayArr.push(Stime);
Stime = this.$moment(Stime)
.add(spanTime, "minute")
.format("YYYY-MM-DD HH:mm:ss");
}
while (
this.$moment(zeroStart).isBefore(this.$moment(Etime)) ||
this.$moment(zeroStart).isSame(this.$moment(Etime))
) {
dayArr.push(zeroStart);
zeroStart = this.$moment(zeroStart)
.add(spanTime, "minute")
.format("YYYY-MM-DD HH:mm:ss");
}
} else {
while (
this.$moment(Stime).isBefore(this.$moment(Etime)) ||
this.$moment(Stime).isSame(this.$moment(Etime))
) {
dayArr.push(Stime);
Stime = this.$moment(Stime)
.add(spanTime, "minute")
.format("YYYY-MM-DD HH:mm:ss");
}
}
// //
console.log(dayArr);
}
this.deviceTimeList = [...new Set(dayArr)];
} else {
//
this.deviceTimeList = val;
}
},
//
handleSet(val) {
console.log(val);
this.isShowset = true;
this.currentTimeRule = val;
getScheduleRulelAccessList({ termid: this.areaData.id })
.then((res) => {
console.log(res);
this.infoData = {
dyname: res.data.list[0].name,
xlname: res.data.list[0].list[0].name,
bsManufacturer: res.data.list[0].list[0].bsManufacturer,
zzname:
res.data.list[0].list[0].list[0].name == null
? res.data.list[0].list[0].list[0].cmdid
: res.data.list[0].list[0].list[0].name,
zzcmid: res.data.list[0].list[0].list[0].cmdid,
};
})
.catch((err) => {});
},
//
//xympadmn --act=schedule [0xCA] --flag=[Request Set Flag, default is set=1, 0: request] --channel=[Channel No] --group=[Group] --hour1=[Hour 1] --min1=[Minute 1] --preset1=[Preset 1]
submitForm() {
console.log(this.currentTimeRule);
if (
this.areaData.protocol == "65285" &&
this.currentTimeRule.listTime.length > 1
) {
this.$message({
duration: 1500,
showClose: true,
message: "不支持多段时间表,请选择单段时间表",
type: "warning",
});
return;
}
this.sureloading = true;
getTermStatus({ termId: this.areaData.id }).then((res) => {
console.log(res);
if (res.data.isonline) {
console.log(this.timeChannel, this.setNum, this.areaData.protocol);
let params = [
{
name: "act",
value: "schedule",
},
{
name: "flag",
value: 1,
},
{
name: "channel",
value: this.timeChannel,
},
];
let scheduleTimeList = this.currentTimeRule.listTime;
console.log(this.currentTimeRule.listTime);
let timeArr = []; //
//
for (let i = 0; i < scheduleTimeList.length; i++) {
console.log(scheduleTimeList[i]);
var Stime = this.$moment(scheduleTimeList[i].startTime, "HH:mm")
.add(this.setNum, "minute")
.format("YYYY-MM-DD HH:mm:ss");
var Etime = this.$moment(scheduleTimeList[i].endTime, "HH:mm")
.add(this.setNum, "minute")
.format("YYYY-MM-DD HH:mm:ss");
var spanTime = scheduleTimeList[i].timeSpan;
console.log(Stime, Etime, spanTime);
if (
this.areaData.protocol == "65283" ||
this.areaData.protocol == "65285"
) {
//
console.log("湖南", scheduleTimeList.length);
//
let fistSpan = this.$moment(new Date())
.startOf("day")
.minutes(spanTime)
.format("YYYY-MM-DD HH:mm:ss");
timeArr.push(fistSpan, Stime, Etime);
console.log(timeArr);
} else {
//
while (
this.$moment(Stime).isBefore(this.$moment(Etime)) ||
this.$moment(Stime).isSame(this.$moment(Etime))
) {
timeArr.push(Stime);
Stime = this.$moment(Stime)
.add(spanTime, "minute")
.format("YYYY-MM-DD HH:mm:ss");
}
}
}
console.log(timeArr);
let group = timeArr.length;
params.push({
name: "group",
value: group,
});
for (let m = 0; m < timeArr.length; m++) {
params.push(
{
name: "hour" + (m + 1),
value: this.$moment(timeArr[m]).hour(),
},
{
name: "min" + (m + 1),
value: this.$moment(timeArr[m]).minute(),
},
{
name: "preset" + (m + 1),
value: 255,
}
);
}
console.log(params);
this.setTermFnRule(params);
} else {
this.sureloading = false;
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
//
setTermFnRule(dataParams) {
setTermCamera({
termId: this.areaData.id,
list: dataParams,
})
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
clearInterval(this.timer);
this.deviceTimer = window.setInterval(() => {
this.getinfoRules();
this.deviceNum++;
console.log(this.deviceNum, this.deviceNum * 1000);
}, 1000 * this.deviceNum);
})
.catch((err) => {});
},
getinfoRules() {
getTermCameraRequest({ requestid: this.requestid })
.then((res) => {
if (res.data.success == 1) {
this.sureloading = false;
window.clearInterval(this.deviceTimer);
this.deviceTimer = null;
this.deviceNum = 1;
console.log(JSON.parse(res.data.data));
this.isShowset = false;
this.$message({
duration: 1500,
showClose: true,
message: "时间表下发成功",
type: "success",
});
} else if (this.deviceNum > 9) {
this.sureloading = false;
window.clearInterval(this.deviceTimer);
this.deviceTimer = null;
this.deviceNum = 1;
this.$message({
duration: 1500,
showClose: true,
message: "时间表下发失败",
type: "error",
});
}
})
.catch((err) => {});
},
//
closebtn() {
this.isShowset = false;
this.sureloading = false;
this.setNum = 0;
},
display() {
this.isShow = true;
this.getChannelSelect();
console.log(this.areaData);
},
handleclose() {
this.isShow = false;
this.sureloading = false;
this.activeName = "1"; //
this.selectChannel = ""; //
this.channelList = []; //
this.baseTimeList = []; //
this.deviceTimeList = []; //
window.clearInterval(this.deviceTimer);
this.deviceTimer = null;
this.deviceNum = 1;
},
//
handleCurrentChange(val) {
this.page = val;
},
//
handleSizeChange(val) {
this.pageSize = val;
},
},
};
</script>
<style lang="less">
.setTimeDialog {
.zzinfo {
position: absolute;
top: 22px;
left: 170px;
}
.el-dialog__body {
margin-bottom: 12px;
.el-tabs__content {
height: 425px;
.searchTime {
.channelBox {
margin-bottom: 12px;
}
.timeContain {
display: flex;
justify-content: space-between;
.timeLeft {
width: 428px;
height: 336px;
border-radius: 4px;
border: 1px solid #eee;
padding: 12px;
}
.timeRight {
width: 428px;
height: 336px;
border-radius: 4px;
border: 1px solid #eee;
padding: 12px;
}
.tagsBox {
height: 308px;
overflow: auto;
.el-tag--small {
margin: 4px;
}
}
}
}
.el-tab-pane {
height: 100%;
.setTimerule {
height: 100%;
.timeGz {
line-height: 24px;
b {
font-weight: 400;
color: #169e8c;
}
}
.el-button {
width: 80px;
}
.pageNation {
justify-content: flex-start;
}
}
}
}
}
}
.setRoadDialog {
.setTimeTd {
.ruleinfo {
margin-bottom: 16px;
h3 {
font-size: 14px;
margin-bottom: 8px;
}
.ruleBox {
display: flex;
flex-wrap: wrap;
align-items: center;
.nameinfo {
//margin-bottom: 8px;
margin-right: 16px;
height: 24px;
line-height: 24px;
}
.timeGz {
height: 24px;
line-height: 24px;
b {
font-weight: 400;
color: #169e8c;
}
}
}
}
}
}
</style>

@ -0,0 +1,313 @@
<template>
<div class="realsideBar">
<div class="searchBar">
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
prefix-icon="el-icon-search"
>
</el-input>
</div>
<div class="deviceNum">
<el-statistic title="装置在线 / 总数">
<template slot="formatter">
<span>{{ onlineNum ? onlineNum : 0 }}</span> /
<span>{{ totalNum ? totalNum : 0 }}</span
>
</template>
</el-statistic>
</div>
<div class="radioFilter">
<el-radio-group v-model="zzradio" @input="getRadio">
<el-radio :label="-1">全部</el-radio>
<el-radio :label="1">在线</el-radio>
<el-radio :label="0">离线</el-radio>
</el-radio-group>
<el-button
class="refresh"
@click="getLineTreeStatus"
type="text"
icon="el-icon-refresh-right"
>刷新</el-button
>
</div>
<el-tree
ref="tree"
:data="lineTreeData"
:props="defaultProps"
node-key="id"
default-expand-all
highlight-current
:expand-on-click-node="false"
:filter-node-method="filterNode"
:current-node-key="currentNodekey"
@node-click="handleNodeClick"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span v-if="node.level === 1">
<span class="iconfont icon-dianli" style="margin-right: 6px"></span>
<span>{{ node.label }} </span>
</span>
<span v-else-if="node.level === 2">
<span class="iconfont icon-dianlihangye" style="margin-right: 6px">
</span>
<span>{{ node.label }} </span>
</span>
<span v-else>
<span
class="iconfont icon-shexiangtoulixian"
v-if="data.onlinestatus == 0"
:class="data.onlinestatus == 0 ? 'disconnect' : ''"
style="margin-right: 6px"
></span>
<span
class="iconfont icon-shexiangtou-lixian"
v-else
:class="data.onlinestatus == 0 ? 'disconnect' : ''"
style="margin-right: 6px"
></span>
<span
:id="data.id"
:class="data.onlinestatus == 0 ? 'disconnect' : ''"
>{{ node.label }}</span
>
</span>
</span>
</el-tree>
</div>
</template>
<script>
import { getdyTreeListJoggle } from "@/utils/api/index";
export default {
data() {
return {
filterText: "", //
onlineNum: "", //线
totalNum: "", //
zzradio: -1, //线
lineTreeData: [],
defaultProps: {
//
children: "list",
label: "name",
},
currentData: {}, //
currentNodekey: "", //,
};
},
components: {},
watch: {
filterText(val) {
console.log(val);
this.$refs.tree.filter(val);
console.log(this.$refs.tree);
},
},
mounted() {},
created() {
this.zzradio =
JSON.parse(localStorage.getItem("radio")) !== null
? JSON.parse(localStorage.getItem("radio"))
: -1; //radio
this.getRadio(); //线线
this.getLineTreeList(); //
},
methods: {
//radio
getRadio() {
console.log(this.zzradio);
this.filterText = "";
localStorage.setItem("radio", JSON.stringify(this.zzradio));
this.getLineTreeStatus();
},
//tree
getLineTreeStatus() {
console.log("点击了刷新");
if (this.filterText !== "") {
this.$refs.tree.filter(this.filterText);
} else {
getdyTreeListJoggle({ type: this.zzradio })
.then((res) => {
console.log(res);
this.lineTreeData = res.data.list;
this.onlineNum = res.data.onlineNum;
this.totalNum = res.data.totalNum;
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentData.id); //
});
})
.catch((err) => {
console.log(err); //
});
}
},
//
filterNode(value, data, node) {
//console.log(value, data, node);
this.filterText = value;
console.log(this.filterText);
//
if (!value) return true;
this.searchName = data.name + data.cmdid;
//console.log(this.searchName);
// valuedatalabel
if (this.searchName.indexOf(value) !== -1) {
return true;
}
},
//
getLineTreeList() {
console.log(this.zzradio);
getdyTreeListJoggle({ type: this.zzradio })
.then((res) => {
console.log(res);
this.lineTreeData = res.data.list;
console.log(this.lineTreeData);
this.onlineNum = res.data.onlineNum;
this.totalNum = res.data.totalNum;
this.currentData = JSON.parse(localStorage.getItem("currentData"));
if (this.lineTreeData[0].list[0].list.length > 0) {
}
if (
this.currentData !== null &&
Object.keys(this.currentData).length !== 0
) {
console.log("aaaa");
this.currentNodekey = this.currentData.id;
this.handleNodeClick(this.currentData);
} else {
console.log("aaaa");
this.currentData = this.lineTreeData[0]; //
this.currentNodekey = this.lineTreeData[0].id; //
this.handleNodeClick(this.currentData);
}
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey); //
this.scrollView();
});
})
.catch((err) => {
console.log(err); //
});
},
//treenode
handleNodeClick(data) {
console.log(data);
this.currentData = data;
this.scrollView();
this.$store.commit("currentData", this.currentData); //currentDatavuex
this.$store.commit("termId", this.currentData.id); //currentDatavuex
this.$store.commit("protocol", this.currentData.protocol); //currentDatavuex
this.$store.commit("cmdId", this.currentData.cmdid); //currentDatavuex
this.$parent.getCurrentData();
//this.$refs.tree.scrollTo(data);
// localStorage.setItem("currentData", JSON.stringify(this.currentData));
},
scrollView() {
if (this.currentData) {
this.$nextTick(() => {
let treeComponent = this.$refs.tree.$el;
let node = treeComponent.querySelector(".is-current");
console.log(node);
if (node) {
node.scrollIntoView({ behavior: "smooth" });
}
});
}
},
},
};
</script>
<style lang="less">
.realsideBar {
width: 300px;
display: flex;
flex-direction: column;
padding: 16px 0px;
.searchBar {
width: 94%;
margin: 0 auto;
margin-bottom: 8px;
}
.deviceNum {
width: 94%;
margin: 0 auto;
margin-bottom: 8px;
height: 20px;
line-height: 20px;
font-size: 12px;
.el-statistic {
display: flex;
justify-content: center;
align-items: center;
.head {
}
.con {
color: #169e8c;
}
}
}
.radioFilter {
width: 94%;
margin: 0 auto;
margin-bottom: 8px;
font-size: 12px;
display: flex;
justify-content: space-around;
.refresh {
}
.el-radio-group {
display: flex;
align-items: center;
justify-content: center;
.el-radio {
margin-right: 16px;
}
}
}
.el-tree {
overflow-y: scroll;
overflow-x: hidden;
.el-tree-node__content {
height: 32px;
font-size: 12px;
}
.custom-tree-node {
color: #333;
overflow: hidden;
span {
display: flex;
display: inline-table;
overflow: hidden;
}
}
}
.el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
//
color: #fff;
background: #169e8c;
.custom-tree-node {
color: #fff;
//overflow: hidden;
span {
display: flex;
//overflow: hidden;
.iconfont {
//width: 30px;
display: inline-table;
}
}
}
}
.disconnect {
color: #d3d3d3;
}
}
</style>

@ -0,0 +1,198 @@
<template>
<!-- <el-button type="primary" @click="handleTakePic" :loading="picLoading"
>主动拍照
</el-button> -->
<el-dropdown trigger="click" @command="handleCommandpic">
<el-button type="primary" :loading="picLoading">
主动拍照<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" class="picdropStyle">
<el-dropdown-item
:command="item.channelid"
v-for="(item, index) in channelIdList"
:key="index"
>{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelname
}}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</template>
<script>
import {
getTermStatus,
setTermCamera,
getTakePicStatusJoggle,
getTakePicPhotoStatusJoggle,
} from "@/utils/api/index";
export default {
data() {
return {
picLoading: false,
statusTimer: null,
statusNum: 0,
picPimer: null,
picNum: 0,
pzchannelId: "",
};
},
watch: {
termId: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
},
mounted() {
console.log(this.channelIdList);
},
computed: {
termId() {
return this.$store.state.termId;
},
channelIdList() {
return this.$store.state.channelIdList;
},
},
methods: {
handleCommandpic(command) {
console.log(command);
this.pzchannelId = command;
this.picLoading = true;
getTermStatus({ termId: this.termId }).then((res) => {
console.log(res);
if (res.data.isonline) {
let params = [
{
name: "act",
value: "capture",
},
{
name: "channel",
value: command,
},
{
name: "preset",
value: 255,
},
{
name: "type",
value: 0,
},
];
this.setTermFn(params);
} else {
this.picLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
handleTakePic() {},
//
setTermFn(val) {
setTermCamera({
termId: this.termId,
list: val,
})
.then((res) => {
console.log(res);
this.getTakePicStatus(res.data);
clearInterval(this.statusTimer);
this.statusTimer = null;
this.statusTimer = window.setInterval(() => {
this.getTakePicStatus(res.data);
this.statusNum++;
}, 3000);
})
.catch((err) => {});
},
//
getTakePicStatus(val) {
console.log(val);
getTakePicStatusJoggle({
requestid: val.requestId,
termId: this.termId,
photoTime: new Date(val.date).getTime(),
})
.then((res) => {
console.log(res);
//res.data 0 1 2
if (res.data.cmaStatus != 1 && this.statusNum >= 5) {
this.clearFn();
this.$message({
duration: 1500,
showClose: true,
message: "下发指令超时,请重试!",
type: "warning",
});
} else if (res.data.cmaStatus == 1 || res.data.picStatus == true) {
this.clearFn();
this.$message({
duration: 1500,
showClose: true,
message: "下发指令成功!",
type: "success",
});
clearInterval(this.picPimer);
this.picPimer = null;
this.picPimer = window.setInterval(() => {
this.newPicApi(val);
this.picNum++;
}, 8000);
}
})
.catch((err) => {
console.log(err); //
});
},
//
newPicApi(val) {
getTakePicPhotoStatusJoggle({
requestid: val.requestId,
termId: this.termId,
photoTime: new Date(val.date).getTime(),
}).then((res) => {
console.log(res.data);
console.log(this.picNum);
if (res.data == true && this.picNum < 10) {
// console.log(this.$parent.$parent);
this.$parent.$parent.getPhotoList(
-1,
new Date(val.date).getTime(),
this.termId
); // id termid
this.$message({
duration: 1500,
showClose: true,
message: "已返回最新图片!",
type: "success",
});
clearInterval(this.picPimer);
this.picPimer = null;
this.picNum = 0;
console.log("返回最新图片");
} else if (res.data == false && this.picNum > 10) {
clearInterval(this.picPimer);
this.picPimer = null;
this.picNum = 0;
}
});
},
clearFn() {
clearInterval(this.statusTimer);
this.statusTimer = null;
this.statusNum = 0;
this.picLoading = false;
},
},
};
</script>

@ -0,0 +1,311 @@
<template>
<div class="videobtnbox">
<!-- <el-button type="primary" @click="handleTakePic" :loading="picLoading"
>主动录像
</el-button> -->
<el-dropdown trigger="click" @command="handleCommandpic">
<el-button type="primary" :loading="picLoading">
主动录像<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" class="picdropStyle">
<el-dropdown-item
:command="item.channelid"
v-for="(item, index) in channelIdList"
:key="index"
>{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelname
}}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
<el-dialog
class="videoDialog"
title="配置参数"
:visible.sync="videoVisible"
>
<el-form :model="videoForm" label-width="94px" ref="videoRef">
<el-form-item label="码流类型">
<el-select v-model="videoForm.stream">
<el-option label="主码流" value="0"></el-option>
<el-option label="从码流" value="1"></el-option>
<el-option label="第3码流" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item
label="时间 s(秒)"
prop="time"
:rules="[
{ required: true, message: '时间不能为空' },
{ type: 'number', message: '时间必须为数字值' },
]"
>
<el-input-number
v-model="videoForm.time"
:min="1"
:max="60"
></el-input-number>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="videoVisible = false"> </el-button>
<el-button type="primary" @click="anVideoFn"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getTermStatus,
setTermCamera,
getTakePicStatusJoggle,
getTakePicPhotoStatusJoggle,
} from "@/utils/api/index";
export default {
data() {
return {
picLoading: false,
statusTimer: null,
statusNum: 0,
picPimer: null,
picNum: 0,
videoVisible: false,
pzchannelId: "",
videoForm: {
stream: "0",
time: 20,
},
};
},
watch: {
// protocol: {
// handler(newVal, oldVal) {},
// deep: true,
// immediate: true,
// },
// termId: {
// handler(newVal, oldVal) {},
// deep: true,
// immediate: true,
// },
// channelId: {
// handler(newVal, oldVal) {},
// deep: true,
// immediate: true,
// },
},
computed: {
termId() {
return this.$store.state.termId;
},
channelIdList() {
return this.$store.state.channelIdList;
},
protocol() {
return this.$store.state.protocol;
},
},
methods: {
handleCommandpic(command) {
console.log(command);
this.pzchannelId = command;
this.picLoading = true;
getTermStatus({ termId: this.termId }).then((res) => {
console.log(res);
if (res.data.isonline) {
console.log(this.protocol);
if (this.protocol == "65281") {
this.videoVisible = true;
} else {
this.picLoading = true;
let params = [
{
name: "act",
value: "capture",
},
{
name: "channel",
value: command,
},
{
name: "preset",
value: 255,
},
{
name: "type",
value: 1,
},
];
this.setTermFn(params);
}
} else {
this.picLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
anVideoFn() {
this.$refs.videoRef.validate((valid) => {
if (valid) {
this.videoVisible = false;
this.picLoading = true;
let params = [
{
name: "act",
value: "capture",
},
{
name: "channel",
value: this.pzchannelId,
},
{
name: "preset",
value: 255,
},
{
name: "type",
value: 1,
},
{
name: "stream",
value: this.videoForm.stream,
},
{
name: "videoTime",
value: this.videoForm.time,
},
];
this.setTermFn(params);
} else {
return false;
}
});
},
//
setTermFn(val) {
setTermCamera({
termId: this.termId,
list: val,
})
.then((res) => {
console.log(res);
this.getTakePicStatus(res.data);
clearInterval(this.statusTimer);
this.statusTimer = null;
this.statusTimer = window.setInterval(() => {
this.getTakePicStatus(res.data);
this.statusNum++;
}, 3000);
})
.catch((err) => {});
},
//
getTakePicStatus(val) {
console.log(val);
getTakePicStatusJoggle({
requestid: val.requestId,
termId: this.termId,
photoTime: new Date(val.date).getTime(),
})
.then((res) => {
console.log(res);
//res.data 0 1 2
if (res.data.cmaStatus != 1 && this.statusNum >= 5) {
this.clearFn();
this.$message({
duration: 1500,
showClose: true,
message: "下发指令超时,请重试!",
type: "warning",
});
} else if (res.data.cmaStatus == 1 || res.data.picStatus == true) {
this.clearFn();
this.$message({
duration: 1500,
showClose: true,
message: "下发指令成功!",
type: "success",
});
clearInterval(this.picPimer);
this.picPimer = null;
this.picPimer = window.setInterval(() => {
this.newPicApi(val);
this.picNum++;
}, 8000);
}
})
.catch((err) => {
console.log(err); //
});
},
//
newPicApi(val) {
getTakePicPhotoStatusJoggle({
requestid: val.requestId,
termId: this.termId,
photoTime: new Date(val.date).getTime(),
}).then((res) => {
console.log(res.data);
if (res.data == true && this.picNum < 10) {
// console.log(this.$parent.$parent);
this.$parent.$parent.getPhotoList(
-1,
new Date(val.date).getTime(),
this.termId
); // id termid
this.$message({
duration: 1500,
showClose: true,
message: "已返回最新视频!",
type: "success",
});
clearInterval(this.picPimer);
this.picPimer = null;
this.picNum = 0;
console.log("已返回最新视频!");
} else if (res.data == false && this.picNum > 10) {
clearInterval(this.picPimer);
this.picPimer = null;
this.picNum = 0;
}
});
},
clearFn() {
clearInterval(this.statusTimer);
this.statusTimer = null;
this.statusNum = 0;
this.picLoading = false;
},
},
};
</script>
<style lang="less">
.videobtnbox {
.videoDialog {
.el-dialog {
width: 380px;
}
.el-input,
.el-input-number {
width: 214px;
}
.dialog-footer {
.el-button--default,
.el-button--primary {
width: 80px !important;
}
.el-button + .el-button {
margin-left: 10px !important;
}
}
}
}
</style>

@ -0,0 +1,253 @@
<template>
<div class="realTimeMonitor" v-loading="mainLoading">
<div class="monitor-container">
<sideBar ref="sideTree"></sideBar>
<div class="picListBox">
<div class="previewBox" v-if="LineFlag">
<!-- 预览图页面 -->
<previewContain ref="previewRef"></previewContain>
</div>
<div class="previewBox" v-if="towerFlag">
<div class="swiperBox" v-loading="swiperLoading">
<div class="title">
<el-breadcrumb separator="/">
<el-breadcrumb-item> {{ towertitle }}</el-breadcrumb-item>
</el-breadcrumb>
</div>
<carouselChart
ref="carouselpic"
:terminalPhoto="terminalPhoto"
:photoNum="photoNum"
v-if="terminalPhoto.length !== 0"
></carouselChart>
</div>
<div class="parameterArea">
<parameterArea ref="areaRef"></parameterArea>
</div>
</div>
</div>
</div>
<morePicPreveiw ref="morePicPreveiw_ref"></morePicPreveiw>
</div>
</template>
<script>
import { getTerminalPhotoListJoggle } from "@/utils/api/index";
import sideBar from "./components/siderBar";
import previewContain from "./components/previewContain";
import carouselChart from "./components/carouselChart";
import parameterArea from "./components/parameterArea";
import morePicPreveiw from "./components/morePicPreveiw";
import { mapGetters, mapState } from "vuex";
export default {
data() {
return {
LineFlag: false, //线
towerFlag: false, //
mainLoading: false, //loading
page: 1, //
towertitle: "", //
lineLoading: false, //loading
swiperLoading: false,
terminalPhoto: [], //
photoNum: 5,
dateValue: "", //
nopicPath: require("@/assets/img/nopic.jpg"),
};
},
watch: {
treeSelectData: {
handler(newVal, oldVal) {},
deep: true,
immediate: true,
},
},
components: {
sideBar,
previewContain,
carouselChart,
parameterArea,
morePicPreveiw,
},
computed: {
treeSelectData() {
return this.$store.state.currentData;
},
},
created() {
//this.treeSelectData = currentData;
//
},
mounted() {
this.mainLoading = true;
setTimeout(() => {
this.mainLoading = false;
}, 1000);
},
methods: {
getCurrentData(data) {
console.log("执行父组件", this.treeSelectData);
if (this.treeSelectData.dyValue) {
console.log("电压");
this.LineFlag = true;
this.towerFlag = false;
this.lineLoading = true;
this.type = 1;
this.$nextTick(() => {
this.$refs.previewRef.getPicList(
this.treeSelectData.id,
this.type,
this.page
);
});
} else if (this.treeSelectData.bsManufacturer) {
console.log("线路");
this.LineFlag = true;
this.towerFlag = false;
this.type = 2;
console.log(this.treeSelectData);
this.$nextTick(() => {
this.$refs.previewRef.getPicList(
this.treeSelectData.id,
this.type,
this.page
);
});
} else {
console.log("杆塔");
this.LineFlag = false;
this.towerFlag = true;
this.terminalPhoto = [];
this.towertitle = this.treeSelectData.name;
this.$nextTick(() => {
this.$refs.areaRef.getChannelList();
});
}
},
getPhotoList(channelId, date, termId) {
console.log(channelId, date, termId);
this.swiperLoading = true;
console.log("zhanshi asdadadadadadsddadadadadad", this.terminalPhoto);
this.terminalPhoto = [];
getTerminalPhotoListJoggle({
channelid: channelId,
time: date,
terminalid: termId,
})
.then((res) => {
console.log(res);
if (res.data.list.length == 0) {
this.terminalPhoto = [
{
path: this.nopicPath,
termId: termId,
mediatype: 0,
},
];
} else {
this.terminalPhoto = res.data.list;
}
let newDataList = [];
let current = 0;
if (this.terminalPhoto && this.terminalPhoto.length > 0) {
for (let i = 0; i <= this.terminalPhoto.length - 1; i++) {
if (i % this.photoNum !== 0 || i === 0) {
if (!newDataList[current]) {
newDataList.push([this.terminalPhoto[i]]);
} else {
newDataList[current].push(this.terminalPhoto[i]);
}
} else {
current++;
newDataList.push([this.terminalPhoto[i]]);
}
}
}
this.terminalPhoto = [...newDataList];
this.$nextTick(() => {
this.$refs.carouselpic.changeBigPic(this.terminalPhoto[0][0], 0);
});
this.swiperLoading = false;
})
.catch((err) => {
console.log(err); //
});
},
//
jumpTowerPic(data) {
console.log("我是从子组件过来的数据");
console.log(data);
this.$refs.morePicPreveiw_ref.display(data);
},
},
};
</script>
<style lang="less">
.realTimeMonitor {
width: calc(100% - 0px);
height: calc(100% - 12px);
padding: 12px 0px 0px 0px;
background: #ffffff;
.monitor-container {
display: flex;
height: 100%;
box-sizing: border-box;
background: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
.picListBox {
display: flex;
width: 100%;
height: 100%;
flex: 1;
overflow: hidden;
border-left: 1px solid #dddddd;
.previewBox {
display: flex;
width: 100%;
height: 100%;
flex: 1;
}
.swiperBox {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
width: auto;
overflow: hidden;
display: flex;
flex-direction: column;
position: relative;
.title {
height: 32px;
padding-left: 12px;
line-height: 32px;
color: #fff;
font-size: 12px;
//background-color: #169e8cb0;
background: linear-gradient(180deg, #4cdbc8 10%, #128071 100%);
.el-breadcrumb {
line-height: 32px;
color: #fff !important;
font-size: 14px;
height: 32px;
.el-breadcrumb__inner,
.el-breadcrumb__separator {
color: #fff !important;
}
}
}
}
.parameterArea {
width: 220px;
padding: 0px 8px;
border-left: 1px solid #dddddd;
position: relative;
overflow-y: auto;
}
}
}
}
</style>

@ -0,0 +1,492 @@
<template>
<div class="realTimeSearch">
<div class="searchMain">
<div class="searchBox" ref="searchref">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="电压等级">
<el-select v-model="formdata.dyid" @change="getSearchxl">
<el-option
v-for="item in dyOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="线路名称">
<el-select
v-model="formdata.lineid"
@change="getSearchgt"
filterable
>
<el-option
v-for="item in xlOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="杆塔名称">
<el-select
v-model="formdata.towerid"
@change="getSearchzz"
filterable
>
<el-option
v-for="item in gtOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="装置名称">
<el-select
v-model="formdata.termid"
@change="getSearchtd"
filterable
>
<el-option
v-for="item in zzOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="通道">
<el-select v-model="formdata.channelid">
<el-option
v-for="item in tdOptions"
:key="item.id"
:label="
item.alias !== null && item.alias !== ''
? item.alias
: item.name
"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="datetime"
placeholder="开始日期"
value-format="timestamp"
:picker-options="pickerOptions"
default-time="00:00:00"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="datetime"
default-time="23:59:59"
placeholder="结束日期"
value-format="timestamp"
:picker-options="pickerOptions"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-input
v-model="formdata.search"
placeholder="请输入线路/杆塔/设备名称"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div>
<div class="pictureBox" v-loading="loading">
<div
v-if="picList.length !== 0"
style="width: 100%"
v-loading="loading"
>
<el-card
class="box-card imgList"
v-for="(item, index) in picList"
:key="index"
>
<div class="bigpic" v-if="item.path.indexOf('videos') == -1">
<el-image
lazy
:src="item.path + '!1366x768'"
:preview-src-list="[item.path]"
>
<template slot="error">
<img src="../../assets/img/nodatapic2.jpg" />
</template>
</el-image>
<div class="caption">
<p class="infoTop">
{{ item.linename }} /
{{
item.displayname !== null && item.displayname !== ""
? item.displayname
: item.cmdid
}}
</p>
<p class="infoBottom">
拍照时间{{ $moment(item.photoTime).format("MM-DD HH:mm") }}
/
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channnelname
}}
</p>
</div>
</div>
<div class="bigpic" v-else>
<!-- <el-image :src="item.path" lazy></el-image> -->
<video
width="100%"
height="250px"
:src="item.path"
controls="controls"
></video>
<div class="caption">
<p class="infoTop">
{{ item.linename }} /
{{
item.displayname !== null && item.displayname !== ""
? item.displayname
: item.cmdid
}}
</p>
<p class="infoBottom">
拍照时间{{ $moment(item.photoTime).format("MM-DD HH:mm") }}
/
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channnelname
}}
<!-- 上传时间{{
$moment(item.recvTime).format("YYYY-MM-DD HH:mm:ss")
}} -->
</p>
</div>
</div>
</el-card>
</div>
<div class="noPicBox" v-else>
<el-empty description="暂无图片"></el-empty>
</div>
</div>
<div class="pageNation" v-if="picList.length !== 0">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import { getSearchInfo, getRealtimePhoto } from "@/utils/api/index";
import defaultImage from "../../assets/img/nodatapic2.jpg";
export default {
data() {
return {
pickerOptions: {
disabledDate(date) {
return date.getTime() > Date.now(); //
},
},
picList: [],
dyOptions: [{ id: -1, name: "全部" }], //
xlOptions: [{ id: -1, name: "全部" }], //线
gtOptions: [{ id: -1, name: "全部" }], //
zzOptions: [{ id: -1, name: "全部" }], //
tdOptions: [{ id: -1, name: "全部", alias: null }], //
formdata: {
dyid: -1,
lineid: -1,
towerid: -1,
channelid: -1,
termid: -1,
search: "",
},
page: 1, //
pageSize: 20, //
total: 0, //
loading: false,
signtype: 0, //0
};
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
},
mounted() {
this.$set(this.formdata, "endtime", new Date().getTime());
if (JSON.stringify(this.$route.query) === "{}") {
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
this.getSearchdy();
} else {
this.getSearchdy();
this.formdata.dyid = this.$route.query.dyId;
this.formdata.lineid = this.$route.query.lineId;
this.formdata.towerid = this.$route.query.towerId;
this.formdata.channelid = this.$route.query.channelId;
this.formdata.termid = this.$route.query.termId;
this.$set(this.formdata, "starttime", this.$route.query.date);
}
},
methods: {
setDefaultImage(e) {
e.target.src = defaultImage;
},
//
getSearchdy() {
getSearchInfo({ type: 1 })
.then((res) => {
this.dyOptions = this.dyOptions.concat(res.data.list);
console.log(this.dyOptions);
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.dyid = this.dyOptions[0].id;
} else {
this.formdata.dyid = Number(this.$route.query.dyId);
}
this.getSearchxl();
})
.catch((err) => {});
},
//线
getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyid })
.then((res) => {
this.xlOptions = [{ id: -1, name: "全部" }];
this.xlOptions = this.xlOptions.concat(res.data.list);
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.lineid = this.xlOptions[0].id;
} else {
this.formdata.lineid = Number(this.$route.query.lineId);
}
this.getSearchgt();
})
.catch((err) => {});
},
//
getSearchgt() {
getSearchInfo({ type: 3, id: this.formdata.lineid })
.then((res) => {
this.gtOptions = [{ id: -1, name: "全部" }];
this.gtOptions = this.gtOptions.concat(res.data.list);
// this.formdata.towerid = this.gtOptions[0].id;
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.towerid = this.gtOptions[0].id;
} else {
this.formdata.towerid = Number(this.$route.query.towerId);
}
this.getSearchzz();
})
.catch((err) => {});
},
//
getSearchzz() {
getSearchInfo({ type: 4, id: this.formdata.towerid })
.then((res) => {
this.zzOptions = [{ id: -1, name: "全部" }];
this.zzOptions = this.zzOptions.concat(res.data.list);
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.termid = this.zzOptions[0].id;
} else {
this.formdata.termid = Number(this.$route.query.termId);
}
this.getSearchtd();
})
.catch((err) => {});
},
//
getSearchtd() {
getSearchInfo({ type: 5, id: this.formdata.termid })
.then((res) => {
this.tdOptions = [{ id: -1, name: "全部", alias: null }];
this.tdOptions = this.tdOptions.concat(res.data.list);
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.channelid = this.tdOptions[0].id;
} else {
this.formdata.channelid = Number(this.$route.query.channelId);
}
this.getPicData();
})
.catch((err) => {});
},
//
getPicData() {
this.loading = true;
this.$set(this.formdata, "pageindex", this.page);
this.$set(this.formdata, "pagesize", this.pageSize);
getRealtimePhoto(this.formdata)
.then((res) => {
this.picList = [];
this.picList = res.data.list;
this.total = res.data.total;
this.loading = false;
})
.catch((err) => {
this.loading = false;
console.log(err);
});
},
//
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",
});
}
this.page = 1;
this.getPicData();
},
//
handleCurrentChange(val) {
this.page = val;
this.picList = [];
this.getPicData();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getPicData();
},
},
};
</script>
<style lang="less">
.realTimeSearch {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.searchMain {
border: 1px solid #dddddd;
height: calc(100% - 22px);
padding: 12px;
border-radius: 4px;
.ml10 {
margin-left: 10px;
}
}
.pictureBox {
display: flex;
// justify-content: space-around;
flex-wrap: wrap;
height: calc(100% - 135px);
max-height: calc(100% - 135px);
overflow: auto;
border: 1px solid #eee;
.imgList {
width: calc((100% - 104px) / 4);
position: relative;
display: inline-block;
margin: 8px;
position: relative;
padding: 4px;
border-radius: 3px;
background: #fff;
height: 200px;
.el-card__body {
padding: 0px;
height: 100%;
}
.bigpic {
width: 100%;
height: 100%;
background-size: 100% 100%;
position: relative;
.el-image {
width: 100%;
height: 100%;
img {
cursor: pointer;
width: 100%;
height: 200px;
}
}
}
.caption {
position: absolute;
bottom: 0px;
background: #169e8ca1;
width: calc(100% - 8px);
padding: 4px;
color: #333;
.infoTop {
font-size: 16px;
color: #fff;
font-weight: normal;
margin-top: 2px;
padding-left: 5px;
padding-right: 5px;
}
.infoBottom {
color: #fff;
font-size: 12px;
font-weight: normal;
margin-top: 6px;
padding-left: 5px;
padding-right: 5px;
}
}
}
.noPicBox {
display: flex;
width: 100%;
height: calc(100% - 86px);
overflow: auto;
.el-empty {
margin: auto;
}
}
}
}
</style>

@ -0,0 +1,163 @@
<template>
<el-dialog
class="addUserDialog"
:title="title"
:visible.sync="isShow"
:close-on-click-modal="false"
width="470px"
@close="handleclose"
>
<el-form
label-position="left"
ref="formInfo"
label-width="100px"
:rules="title == '新增' ? rules : xgrules"
:model="formdata"
>
<el-form-item label="用户名:" prop="userName">
<el-input
placeholder="请输入用户名"
v-model="formdata.userName"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item label="角色:" prop="role">
<el-select v-model="formdata.role" placeholder="请选择">
<el-option
v-for="item in roleoptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="密码:" prop="password">
<el-input
placeholder="请输入密码"
v-model="formdata.password"
show-password
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addUserApi, updateUserApi } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
roleUser: "",
isShow: false,
roleoptions: [
{
value: 1,
label: "管理员",
},
{
value: 2,
label: "用户",
},
],
formdata: {},
rules: {
userName: [
{ required: true, message: "请输入用户名", trigger: "blur" },
],
role: [{ required: true, message: "请选择角色", trigger: "blur" }],
password: [
{ required: true, message: "请输入密码", trigger: "blur" },
// { min: 6, max: 8, message: "6-8", trigger: "blur" },
],
},
xgrules: {
userName: [
{ required: true, message: "请输入用户名", trigger: "blur" },
],
role: [{ required: true, message: "请选择角色", trigger: "blur" }],
},
};
},
methods: {
//
getdataform(val) {
console.log(val);
if (val == null) {
return (this.formdata = {
role: 2,
});
}
//this.formdata = val;
this.formdata = JSON.parse(JSON.stringify(val));
},
//
submitForm() {
this.$refs.formInfo.validate((valid) => {
if (valid) {
if (this.title == "新增") {
addUserApi(this.formdata)
.then((res) => {
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.isShow = false;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
} else {
updateUserApi(this.formdata)
.then((res) => {
if (res.code == 200) {
this.$message.success("修改成功");
this.isShow = false;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
}
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
this.roleUser = localStorage.getItem("role");
},
hide() {
this.isShow = false;
},
handleclose() {
this.$parent.deviceList();
},
},
mounted() {},
};
</script>
<style lang="less">
.addUserDialog {
.el-form-item {
.el-input,
.el-select,
.el-input-number {
width: 100%;
}
}
}
</style>

@ -0,0 +1,210 @@
<template>
<div class="globalBox">
<div class="setBox">
<el-card class="box-card globalDrawLine">
<div slot="header" class="clearfix">
<span>线缆开启关闭</span>
</div>
<div>
<el-switch
style="display: block"
v-model="lineValue"
active-text="开启"
inactive-text="关闭"
@change="showLine"
>
</el-switch>
</div>
</el-card>
<el-card class="box-card globalDrawLine">
<div slot="header" class="clearfix">
<span>设置告警通道</span>
</div>
<div>
<el-select v-model="channel" @change="handleChange">
<el-option
v-for="item in tdOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</div>
</el-card>
<el-card class="box-card globalprob">
<div slot="header" class="clearfix">
<span>设置告警可信度</span>
</div>
<div v-for="(item, index) in probList" :key="index" class="probBox">
<label>{{ item.name }}</label>
<el-input-number
:min="0"
:max="110"
controls-position="right"
v-model="item.prob"
placeholder="请输入可信度值"
></el-input-number>
</div>
<el-button class="setbtn" type="primary" @click="setProb"
>设置</el-button
>
</el-card>
</div>
</div>
</template>
<script>
import {
getAlarmTypeList,
updateAlarmTypeList,
getMarkEnableStatus,
updateMarkEnableStatus,
updateAlarmChannel,
} from "@/utils/api/index";
export default {
components: {},
data() {
return {
lineValue: false,
lineNum: 0,
probList: [],
tdOptions: [{ id: -1, name: "全部", alias: null }], //
channel: "",
};
},
created() {
this.getalarmList();
this.getmark();
},
methods: {
//
getmark() {
getMarkEnableStatus()
.then((res) => {
console.log(res);
if (res.data.imgMark === 1) {
this.lineValue = true;
console.log("绘制开启");
} else {
this.lineValue = false;
console.log("绘制关闭");
}
this.channel = res.data.alarmChannel;
console.log(this.channel);
})
.catch((err) => {});
},
//线
showLine(val) {
if (val) {
this.lineNum = 1;
} else {
this.lineNum = 0;
}
updateMarkEnableStatus({
status: this.lineNum,
})
.then((res) => {
console.log(res);
})
.catch((err) => {});
console.log(val, this.lineNum, "开关");
},
//
getalarmList() {
getAlarmTypeList().then((res) => {
console.log(res);
this.probList = res.data.list;
this.tdOptions = [{ id: -1, name: "全部", alias: null }];
this.tdOptions = this.tdOptions.concat(res.data.channellist);
});
},
setProb() {
console.log(this.probList);
updateAlarmTypeList({ list: this.probList })
.then((res) => {
console.log(res);
if (res.code === 200) {
this.$message({
duration: 1500,
showClose: true,
message: "告警可信度设置成功",
type: "success",
});
}
})
.catch((err) => {
console.log(err);
});
},
//
handleChange(val) {
console.log(val);
updateAlarmChannel({ channel: this.channel })
.then((res) => {
console.log(res);
if (res.code === 200) {
this.$message({
duration: 1500,
showClose: true,
message: "告警通道设置成功",
type: "success",
});
}
})
.catch((err) => {
console.log(err);
});
},
},
};
</script>
<style lang="less">
.globalBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.setBox {
border: 1px solid #dddddd;
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
display: flex;
.globalDrawLine {
width: 200px;
height: max-content;
margin-right: 24px;
}
.globalprob {
width: 378px;
height: max-content;
display: flex;
flex-direction: column;
.el-card__body {
display: flex;
flex-direction: column;
.probBox {
display: flex;
height: 40px;
line-height: 40px;
align-items: center;
label {
width: 138px;
}
.el-input-number--small {
width: 200px;
}
.el-input {
width: 200px;
}
}
.setbtn {
margin-top: 24px;
margin-left: auto;
}
}
}
}
}
</style>

@ -0,0 +1,200 @@
<template>
<div class="usermanagement">
<div class="deviceBox">
<div class="deviceBtnGroup">
<h4>用户管理</h4>
<el-button type="primary" icon="el-icon-plus" @click="handleAdddevice()"
>新增</el-button
>
</div>
<div class="deviceTable">
<el-table
ref="multipleTable"
:data="deviceTableData"
stripe
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 40px)"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<!-- <el-table-column type="index" width="55"> </el-table-column>
<el-table-column type="selection" width="55"> </el-table-column> -->
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column
label="用户名"
show-overflow-tooltip
prop="userName"
></el-table-column>
<el-table-column label="角色" show-overflow-tooltip prop="role">
<template slot-scope="scope">{{
scope.row.role == 1 ? "管理员" : "用户"
}}</template>
</el-table-column>
<el-table-column
label="创建时间"
show-overflow-tooltip
prop="createTime"
>
<template slot-scope="scope">{{
$moment(scope.row.createTime).format("yy-MM-DD HH:mm:ss")
}}</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="200">
<template slot-scope="scope">
<el-button
@click.native.stop="handleResive(scope.row)"
type="text"
>修改</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
<!-- 新增 -->
<addUser :title="title" ref="adduserref"></addUser>
</div>
</template>
<script>
import addUser from "./components/addUser.vue";
import { getUserList, delUserApi } from "@/utils/api/index";
export default {
components: {
addUser,
},
data() {
return {
title: "", //
deviceTableData: [],
//multipleSelection: [], //
page: 1, //
pageSize: 20, //
total: 0, //
};
},
created() {
this.deviceList();
},
methods: {
//线
deviceList() {
getUserList({
pageindex: this.page,
pagesize: this.pageSize,
})
.then((res) => {
this.deviceTableData = res.data.list;
this.total = res.data.total;
})
.catch((err) => {});
},
//
handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row);
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
handleAdddevice() {
this.title = "新增";
this.$refs.adduserref.display();
this.$refs.adduserref.getdataform(null);
},
//
handleResive(data) {
this.title = "修改";
this.$refs.adduserref.display();
this.$refs.adduserref.getdataform(data);
},
//
handleDelete(data) {
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delUserApi({ uid: data.userId }).then((res) => {
if (res.code == 200) {
this.$message.success("删除成功");
this.deviceList(); //
} else {
this.$message.error(res.msg);
}
});
})
.catch(() => {
this.$message({
duration: 1500,
showClose: true,
type: "info",
message: "已取消删除",
});
});
},
//
handleCurrentChange(val) {
this.page = val;
this.deviceList();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.deviceList();
},
},
};
</script>
<style lang="less">
.usermanagement {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.deviceBox {
border: 1px solid #dddddd;
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
}
.deviceBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
}
.deviceTable {
margin-top: 16px;
height: calc(100% - 48px);
//background: #fcc;
}
}
</style>

@ -0,0 +1,169 @@
<template>
<el-dialog
class="addtowerDialog"
:title="title"
:visible.sync="isShow"
:close-on-click-modal="false"
width="470px"
>
<el-form
label-position="left"
ref="formInfo"
label-width="100px"
:rules="rules"
:model="formdata"
>
<el-form-item label="线路名称:" prop="lineId">
<el-select v-model="formdata.lineId" placeholder="请选择">
<el-option
v-for="item in lineOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="杆塔名称:" prop="name">
<el-input v-model="formdata.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="杆塔地址:" prop="address">
<el-input v-model="formdata.address" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="排序号:" prop="order">
<el-input-number
controls-position="right"
v-model="formdata.order"
:min="0"
></el-input-number>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getLineListApi, addTowerApi, updateTowerApi } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
isShow: false,
lineOptions: [],
formdata: {},
rules: {
name: [{ required: true, message: "请输入杆塔名称", trigger: "blur" }],
lineId: [
{ required: true, message: "请选择线路编号", trigger: "blur" },
],
// address: [
// { required: true, message: "", trigger: "blur" },
// ],
order: [{ required: true, message: "请输入排序号", trigger: "blur" }],
},
};
},
mounted() {
this.getLineListdata();
},
methods: {
getLineListdata() {
getLineListApi({ pageindex: 1, pagesize: 100 })
.then((res) => {
this.lineOptions = res.data.list;
})
.catch((err) => {});
},
//
getdataform(val) {
if (val == null) {
return (this.formdata = {
order: 0,
});
}
//this.formdata = val;
this.formdata = JSON.parse(JSON.stringify(val));
},
//
submitForm() {
this.$refs.formInfo.validate((valid) => {
if (valid) {
if (this.title == "新增") {
let formArr = [];
formArr.push(this.formdata);
console.log(this.formdata);
addTowerApi({ list: formArr })
.then((res) => {
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.$parent.deviceList();
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
});
} else {
console.log(this.formdata);
updateTowerApi(this.formdata)
.then((res) => {
this.isShow = false;
//this.$message.success("");
this.$message({
duration: 1500,
showClose: true,
message: "修改成功",
type: "success",
});
this.$parent.deviceList();
})
.catch((err) => {
//this.$message.error("");
this.$message({
duration: 1500,
showClose: true,
message: "修改失败",
type: "error",
});
});
}
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
},
};
</script>
<style lang="less">
.addtowerDialog {
.el-select {
width: 100%;
}
.el-input-number {
width: 100%;
}
.el-input-number .el-input__inner {
text-align: left;
}
}
</style>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save