master
fanluyan 2 years ago
parent 46dd2570ee
commit c084fdb756

@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

@ -0,0 +1,18 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
"plugin:vue/essential",
"eslint:recommended",
"plugin:prettier/recommended",
],
parserOptions: {
parser: "@babel/eslint-parser",
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
};

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?

@ -1,3 +1,24 @@
# icing-front
# my
覆冰项目
## 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,11 @@
# ---> Vue
# gitignore template for Vue.js projects
#
# Recommended template: Node.gitignore
# TODO: where does this rule come from?
docs/_book
# TODO: where does this rule come from?
test/

@ -0,0 +1,3 @@
# icing-front
覆冰项目

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

8846
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,37 @@
{
"name": "icingsystem",
"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.6.2",
"core-js": "^3.8.3",
"echarts": "^5.4.3",
"element-ui": "^2.15.14",
"moment": "^2.29.4",
"vue": "^2.6.14",
"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.1.3",
"less-loader": "^8.0.0",
"prettier": "^2.4.1",
"vue-template-compiler": "^2.6.14"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

@ -0,0 +1,21 @@
<!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,12 @@
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<style lang="less">
#app {
width: 100%;
height: 100%;
}
</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: #1c77ac;
@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,52 @@
* {
margin: 0;
padding: 0;
}
img {
-webkit-user-select: none; /* Safari 3.1+ */
-moz-user-select: none; /* Firefox 2+ */
-ms-user-select: none; /* IE 10+ */
user-select: none; /* Standard syntax */
}
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";
}

@ -0,0 +1,73 @@
@font-face {
font-family: "iconfont"; /* Project id */
src: url('iconfont.ttf?t=1700030201509') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-1wenhe:before {
content: "\e653";
}
.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-qixiang:before {
content: "\e67c";
}
.icon-shexiangtou-lixian:before {
content: "\ef1c";
}
.icon-shexiangtou-zaixian:before {
content: "\ef1d";
}
.icon-shudianxianlu_2722010801:before {
content: "\efed";
}
.icon-tupian_normal:before {
content: "\e681";
}
.icon-fubing:before {
content: "\e7ac";
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 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: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 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,48 @@
<template>
<div class="wrapper">
<v-head></v-head>
<div class="content-box">
<div class="content">
<router-view></router-view>
</div>
</div>
</div>
</template>
<script>
import vHead from "./header.vue";
export default {
data() {
return {};
},
components: {
vHead,
},
computed: {},
created() {},
};
</script>
<style lang="less">
.wrapper {
min-width: 1366px;
.content-box {
position: absolute;
left: 0px;
right: 0;
top: 60px;
bottom: 0;
-webkit-transition: left 0.3s ease-in-out;
transition: left 0.3s ease-in-out;
.content {
width: 100%;
height: 100%;
overflow-y: auto;
box-sizing: border-box;
}
}
}
</style>

@ -0,0 +1,209 @@
<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: "/weather",
items: [
{
icon: "iconfont icon-qixiang",
index: "/weather",
title: "气象监测",
},
{
icon: "iconfont icon-fubing",
index: "/icing",
title: "覆冰监测",
},
{
icon: "el-icon-s-marketing",
index: "/equipmentStatus",
title: "设备状态",
},
// {
// icon: "el-icon-files",
// index: "/property",
// title: "",
// subs: [
// {
// index: "/lineInformation",
// title: "线",
// },
// {
// index: "/towerInformation",
// title: "",
// },
// {
// index: "/photographicDevice",
// title: "",
// },
// ],
// },
],
};
},
watch: {
$route() {
this.setCurrentRoute();
},
},
methods: {
setCurrentRoute() {
this.activeIndex = this.$route.path; //
},
},
created() {
this.setCurrentRoute();
},
};
</script>
<style lang="less">
.sidebar {
.el-menu--horizontal {
background: #1c77ac;
.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: #1c77ac;
}
}
.el-submenu.is-active .el-submenu__title > i {
&:first-child {
color: #333;
}
}
}
.el-menu {
background: #1c77ac;
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: #0e5b87;
border-bottom: 2px solid #0e5b87;
i {
color: #fff !important;
}
}
.el-submenu:focus .el-submenu__title,
.el-submenu:hover .el-submenu__title {
color: #fff !important;
background-color: #0e5b87;
border-bottom: 2px solid #0e5b87;
i {
color: #fff !important;
}
}
}
.el-menu--horizontal > .el-menu-item.is-active {
border-bottom: 2px solid #0e5b87 !important;
color: #fff !important;
background-color: #0e5b87 !important;
i {
color: #fff !important;
}
}
.el-submenu.is-active {
.el-submenu__title {
border-bottom: 2px solid #0e5b87 !important;
color: #fff !important;
background-color: #0e5b87;
i {
color: #fff !important;
}
}
}
// .gallery-thumbs .swiper-slide-active {
// border: 3px solid #1c77ac !important;
// }
// .tags-li.active {
// border: 1px solid #1c77ac;
// background-color: #1c77ac;
// }
.el-menu-item [class^="iconfont"] {
margin-right: 5px;
width: 24px;
text-align: center;
font-size: 18px;
vertical-align: middle;
}
}
</style>

@ -0,0 +1,121 @@
<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"),
role: localStorage.getItem("role"),
};
},
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: #1c77ac;
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,262 @@
<template>
<div class="leftTreeBox">
<div class="searchBar">
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
prefix-icon="el-icon-search"
>
</el-input>
</div>
<el-tree
ref="tree"
:data="lineTreeData"
:props="defaultProps"
node-key="id"
:default-expanded-keys="defaultExpandedKeys"
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 class="num">({{ data.list.length }}) </span></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: "", //
lineTreeData: [],
defaultExpandedKeys: [], //
collapsedKeys: [], // key
defaultProps: {
//
children: "list",
label: "name",
},
currentData: {}, //
currentNodekey: "", //,
};
},
watch: {
// filterText(val) {
// console.log(val);
// this.$refs.tree.filter(val);
// console.log(this.$refs.tree);
// },
filterText(newVal) {
this.handleFilter(); // filterText
},
},
created() {
this.getLineTreeList(); //
},
methods: {
handleFilter() {
// 500
setTimeout(() => {
this.$refs.tree.filter(this.filterText);
}, 500);
},
//
filterNode(value, data, node) {
//
if (!value) return true;
this.searchName = data.name + data.cmdid;
//console.log(this.searchName);
// valuedatalabel
if (this.searchName.indexOf(value) !== -1) {
return true;
}
},
//
getLineTreeList() {
getdyTreeListJoggle({ type: 1 })
.then((res) => {
//this.lineTreeData = res.data.list;
this.lineTreeData = [
{
id: 4,
name: "公司名称",
dyValue: 220,
list: [
{
id: 209,
name: "线路",
bsManufacturer: "电力公司2",
list: [
{
id: 10323,
towerid: 295,
cmdid: "装置1",
equipname: "XYIGQ10D221000100",
name: "装置1",
address: "上海",
protocol: 65283,
displayname: "XYIGQ10D221000100",
model: null,
onlinestatus: 1,
hasPan: null,
},
{
id: 10556,
towerid: 532,
cmdid: "装置2",
equipname: "",
name: "装置2",
address: null,
protocol: 65283,
displayname: "XYIGQ10C230100005",
model: "",
onlinestatus: 1,
hasPan: 0,
},
],
},
],
},
];
this.currentData = JSON.parse(localStorage.getItem("currentData"));
this.lineTreeData.forEach((node) => {
if (node.list) {
node.list.forEach((child) => {
this.defaultExpandedKeys.push(child.id);
});
} else {
this.defaultExpandedKeys.push(node.id);
}
});
this.defaultExpandedKeys =
JSON.parse(localStorage.getItem("defaultKey")) !== null
? JSON.parse(localStorage.getItem("defaultKey"))
: this.defaultExpandedKeys; //defaultKey ;
console.log(this.defaultExpandedKeys);
if (this.lineTreeData[0].list[0].list.length > 0) {
}
if (
this.currentData !== null &&
Object.keys(this.currentData).length !== 0
) {
this.currentNodekey = this.currentData.id;
this.handleNodeClick(this.currentData);
} else {
this.currentData = this.lineTreeData[0]; //
this.currentNodekey = this.lineTreeData[0].id; //
this.handleNodeClick(this.currentData);
}
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey); //
});
})
.catch((err) => {
console.log(err); //
});
},
//treenode
handleNodeClick(data) {
this.currentData = data;
this.$parent.getCurrentData(this.currentData);
},
},
};
</script>
<style lang="less">
.leftTreeBox {
width: 200px;
display: flex;
flex-direction: column;
padding: 16px 0;
.searchBar {
width: 94%;
margin: 0 auto;
margin-bottom: 8px;
}
.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;
align-items: center;
}
.num {
color: #1c77ac;
}
}
}
.el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
//
color: #fff;
background: #1c77ac;
.custom-tree-node {
color: #fff;
//overflow: hidden;
span {
display: flex;
//overflow: hidden;
align-items: center;
.num {
color: #fff;
}
.iconfont {
//width: 30px;
display: inline-table;
}
}
}
}
.disconnect {
color: #d3d3d3;
}
}
</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,71 @@
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"),
// });
//挂载弹出信息
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,69 @@
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
const routes = [
{ path: "/", redirect: "/login" },
{
path: "/weather",
component: () => import("../components/Home.vue"),
children: [
//气象检测
{
path: "/weather",
component: () => import("../views/weather/index.vue"),
name: "weather",
meta: { title: "气象检测", icon: "", keepAlive: true },
},
//覆冰
{
path: "/icing",
component: () => import("../views/icing/index.vue"),
name: "icing",
meta: { title: "覆冰", icon: "", keepAlive: true },
},
//设备状态
{
path: "/equipmentStatus",
component: () => import("../views/equipmentStatus/index.vue"),
name: "equipmentStatus",
meta: { title: "设备状态", icon: "", keepAlive: true },
},
//线路信息管理
{
path: "/lineInformation",
component: () => import("../views/lineInformation/index.vue"),
name: "lineInformation",
meta: { title: "线路管理", icon: "", keepAlive: true },
},
//杆塔信息管理
{
path: "/towerInformation",
component: () => import("../views/towerInformation/index.vue"),
name: "towerInformation",
meta: { title: "杆塔管理", icon: "", keepAlive: true },
},
//装置管理
{
path: "/photographicDevice",
component: () => import("../views/photographicDevice/index.vue"),
name: "photographicDevice",
meta: { title: "装置管理", icon: "", keepAlive: true },
},
],
},
{
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,175 @@
import request from "../request";
//获取登录
export function loginJoggle(data) {
return request({
url: "/api/login",
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 getOnlineTerminalListExcel() {
return request({
url: "/api/getOnlineTerminalListExcel",
method: "post",
responseType: "blob",
});
}
//修改用户
export function updateUserApi(data) {
return request({
url: "/api/updateUser",
method: "post",
data,
});
}
//获取装置总数图表
// export function getTermStatistics(data) {
// return request({
// url: "/api/getTermStatistics",
// method: "get",
// params: 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,
});
}
//获取电压等级列表
export function getdyListJoggle(data) {
return request({
url: "/api/getdyList",
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,
});
}
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 getProtocolList(data) {
return request({
url: "/api/getProtocolList",
method: "get",
params: data,
});
}

@ -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;

@ -0,0 +1,338 @@
<template>
<div class="equipmentStatus">
<div class="weatherContain">
<leftTree ref="sideTree"></leftTree>
<div class="rightTable">
<div class="dataBox">
<div class="fatherTableShowBox" v-if="!childFlag">
<el-table
:data="tableData"
style="width: 100%"
height="calc(100% - 40px)"
>
<el-table-column prop="line" label="线路"></el-table-column>
<el-table-column prop="pole" label="杆塔"></el-table-column>
<el-table-column prop="terminal" label="终端"></el-table-column>
<el-table-column prop="terminalStatus" label="终端状态">
<template slot-scope="scope">
<i
class="el-icon-success"
v-if="scope.row.terminalStatus == '在线'"
></i>
<i
class="el-icon-error"
v-if="scope.row.terminalStatus == '离线'"
></i>
<span style="margin-left: 10px">{{
scope.row.terminalStatus
}}</span>
</template>
</el-table-column>
<el-table-column prop="tension" label="拉力"></el-table-column>
<el-table-column
prop="lastHeartbeatTime"
label="最后心跳时间"
></el-table-column>
<el-table-column
prop="signalStrength"
label="信号强度"
></el-table-column>
<el-table-column
prop="batteryVoltage"
label="蓄电池电压"
></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"
>
</el-pagination>
</div>
</div>
<div class="childBox" v-else>
<!-- <div class="searchBox" ref="searchref">
<el-form
:inline="true"
:model="formdata"
class="demo-form-inline"
>
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="date"
placeholder="开始日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="date"
placeholder="结束日期"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div> -->
<div class="childTableShowBox">
<el-table
:data="childTableDate"
style="width: 100%"
height="calc(100% - 40px)"
>
<el-table-column prop="line" label="线路"></el-table-column>
<el-table-column prop="pole" label="杆塔"></el-table-column>
<el-table-column prop="terminal" label="终端"></el-table-column>
<el-table-column prop="terminalStatus" label="终端状态">
<template slot-scope="scope">
<i
class="el-icon-success"
v-if="scope.row.terminalStatus == '在线'"
></i>
<i
class="el-icon-error"
v-if="scope.row.terminalStatus == '离线'"
></i>
<span style="margin-left: 10px">{{
scope.row.terminalStatus
}}</span>
</template>
</el-table-column>
<el-table-column prop="tension" label="拉力"></el-table-column>
<el-table-column
prop="lastHeartbeatTime"
label="最后心跳时间"
></el-table-column>
<el-table-column
prop="signalStrength"
label="信号强度"
></el-table-column>
<el-table-column
prop="batteryVoltage"
label="蓄电池电压"
></el-table-column>
</el-table>
</div>
<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"
>
</el-pagination>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import leftTree from "../../components/leftTree";
import { getTerminalJoggle } from "@/utils/api/index";
export default {
name: "equipmentStatus",
components: {
leftTree,
},
data() {
return {
msg: "",
childFlag: false,
tableData: [],
childTableDate: [],
formdata: {},
page: 1, //
pageSize: 20, //
total: 0, //
};
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
},
mounted() {
this.terminalList();
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
this.$set(this.formdata, "endtime", new Date().getTime());
},
methods: {
getCurrentData(data) {
console.log("执行父组件", data);
if (data.dyValue) {
console.log("电压");
this.msg = "公司所有数据";
this.childFlag = false;
this.tableData = [
{
line: "线路1",
pole: "杆塔1",
terminal: "终端1",
terminalStatus: "在线",
tension: 200,
lastHeartbeatTime: "2023-05-01 10:00:00",
signalStrength: 80,
batteryVoltage: 12.5,
},
{
line: "线路2",
pole: "杆塔2",
terminal: "终端2",
terminalStatus: "离线",
tension: 180,
lastHeartbeatTime: "2023-05-01 09:30:00",
signalStrength: 65,
batteryVoltage: 12.0,
},
{
line: "线路3",
pole: "杆塔3",
terminal: "终端3",
terminalStatus: "在线",
tension: 200,
lastHeartbeatTime: "2023-05-01 10:00:00",
signalStrength: 80,
batteryVoltage: 12.5,
},
];
} else if (data.bsManufacturer) {
this.msg = "杆塔下所有数据";
this.childFlag = false;
this.tableData = [
{
line: "线路1",
pole: "杆塔1",
terminal: "终端1",
terminalStatus: "在线",
tension: 200,
lastHeartbeatTime: "2023-05-01 10:00:00",
signalStrength: 80,
batteryVoltage: 12.5,
},
{
line: "线路2",
pole: "杆塔2",
terminal: "终端2",
terminalStatus: "离线",
tension: 180,
lastHeartbeatTime: "2023-05-01 09:30:00",
signalStrength: 65,
batteryVoltage: 12.0,
},
];
} else {
console.log("杆塔");
this.msg = "装置当天数据";
this.childFlag = true;
this.childTableDate = [
{
line: "线路1",
pole: "杆塔1",
terminal: "终端1",
terminalStatus: "在线",
tension: 200,
lastHeartbeatTime: "2023-05-01 10:00:00",
signalStrength: 80,
batteryVoltage: 12.5,
},
];
}
},
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); //
});
},
onSubmit() {},
//
handleCurrentChange(val) {
this.page = val;
// this.picList = [];
// this.getPicData();
},
//
handleSizeChange(val) {
this.pageSize = val;
//this.getPicData();
},
},
};
</script>
<style lang="less">
.equipmentStatus {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.weatherContain {
display: flex;
height: 100%;
box-sizing: border-box;
background: #fff;
border: 1px solid #ddd;
border-radius: 4px;
}
.rightTable {
display: flex;
width: 100%;
height: 100%;
flex: 1;
overflow: hidden;
border-left: 1px solid #ddd;
.el-icon-success {
color: #67c23a;
font-size: 14px;
}
.el-icon-error {
color: #909399;
font-size: 14px;
}
.dataBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
}
.fatherTableShowBox {
height: calc(100% - 0px);
}
.childBox {
height: 100%;
.childTableShowBox {
height: calc(100% - 0px);
}
}
}
}
</style>

@ -0,0 +1,330 @@
<template>
<div class="icingBox">
<div class="icingContain">
<leftTree ref="sideTree"></leftTree>
<div class="rightTable">
<div class="dataBox">
<div class="childBox">
<div class="searchBox" ref="searchref">
<el-form
:inline="true"
:model="formdata"
class="demo-form-inline"
>
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="date"
placeholder="开始日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="date"
placeholder="结束日期"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"
>导出数据</el-button
>
</el-form-item>
</el-form>
</div>
<div class="childTableShowBox">
<el-table
:data="tableData"
style="width: 100%"
height="calc(100% - 40px)"
>
<el-table-column
prop="terminalNumber"
label="监测终端编号"
></el-table-column>
<el-table-column prop="time" label="时间"></el-table-column>
<el-table-column
prop="functionalUnitIdentifier"
label="功能单元识别码"
></el-table-column>
<el-table-column
prop="maxPullForceKg"
label="最大拉力(Kg)"
></el-table-column>
<el-table-column
prop="maxPullForceWindBiasAngle"
label="最大拉力时风偏角(°)"
></el-table-column>
<el-table-column
prop="maxPullForceTiltAngle"
label="最大拉力时倾斜角(°)"
></el-table-column>
<el-table-column
prop="minPullForceKg"
label="最小拉力(Kg)"
></el-table-column>
<el-table-column
prop="minPullForceWindBiasAngle"
label="最小拉力时风偏角(°)"
></el-table-column>
<el-table-column
prop="minPullForceTiltAngle"
label="最小拉力时倾斜角(°)"
></el-table-column>
<el-table-column
prop="maxWindBiasAngle"
label="最大风偏角(°)"
></el-table-column>
<el-table-column
prop="maxWindBiasAngleTiltAngle"
label="最大风偏角时倾斜角(°)"
></el-table-column>
<el-table-column
prop="maxWindBiasAnglePullForceKg"
label="最大风偏角时拉力(Kg)"
></el-table-column>
<el-table-column
prop="minWindBiasAngle"
label="最小风偏角(°)"
></el-table-column>
<el-table-column
prop="minWindBiasAngleTiltAngle"
label="最小风偏角时倾斜角(°)"
></el-table-column>
<el-table-column
prop="minWindBiasAnglePullForceKg"
label="最小风偏角时拉力(Kg)"
></el-table-column>
</el-table>
</div>
<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"
>
</el-pagination>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import leftTree from "../../components/leftTree";
export default {
name: "icing",
components: {
leftTree,
},
data() {
return {
msg: "",
childFlag: false,
tableData: [],
formdata: {},
page: 1, //
pageSize: 20, //
total: 0, //
};
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
},
mounted() {
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
this.$set(this.formdata, "endtime", new Date().getTime());
},
methods: {
getCurrentData(data) {
console.log("执行父组件", data);
if (data.dyValue) {
console.log("电压");
this.tableData = [
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
];
} else if (data.bsManufacturer) {
this.tableData = [
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
];
} else {
console.log("杆塔");
this.tableData = [
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
];
}
},
onSubmit() {},
//
handleCurrentChange(val) {
this.page = val;
// this.picList = [];
// this.getPicData();
},
//
handleSizeChange(val) {
this.pageSize = val;
//this.getPicData();
},
},
};
</script>
<style lang="less">
.icingBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.icingContain {
display: flex;
height: 100%;
box-sizing: border-box;
background: #fff;
border: 1px solid #ddd;
border-radius: 4px;
}
.rightTable {
display: flex;
width: 100%;
height: 100%;
flex: 1;
overflow: hidden;
border-left: 1px solid #ddd;
.dataBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
}
// .fatherTableShowBox {
// height: calc(100% - 0px);
// }
.childBox {
height: calc(100% - 0px);
.childTableShowBox {
height: calc(100% - 91px);
}
}
}
}
</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,252 @@
<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="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 {
name: "lineInformation",
components: {
addLineDialog,
addTowerDialog,
},
data() {
return {
lineDialogTitle: "", //
lineTableData: [],
//multipleSelection: [], //
page: 1, //
pageSize: 20, //
total: 0, //
loading: true,
formdata: {},
};
},
created() {},
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;
},
//
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;
}
.lineBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
}
.lineTable {
margin-top: 16px;
height: calc(100% - 46px);
}
}
</style>

@ -0,0 +1,196 @@
<template>
<div class="login-wrap">
<div class="bs_logintop">
<span>欢迎登录</span>
</div>
<div class="loginFilter">
<h3>覆冰在线监测系统</h3>
<p class="english">icing load on-line monitoring system</p>
<div class="ms-login">
<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
console.log(res.data);
this.$router.push("/weather");
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-color: #1c77ac;
background-repeat: no-repeat;
background-position: center top;
overflow: hidden;
background-size: cover;
overflow: hidden;
.bs_logintop {
height: 47px;
position: absolute;
top: 0;
background: url(../../assets/img/loginbg1.png) repeat-x;
z-index: 100;
width: 100%;
span {
color: #fff;
line-height: 47px;
background: url(../../assets/img/loginsj.png) no-repeat 21px 16px;
text-indent: 44px;
color: #afc5d2;
float: left;
}
}
.loginFilter {
background: url(../../assets/img/loginbg3.png) no-repeat center center;
width: 100%;
height: 585px;
overflow: hidden;
position: absolute;
top: 47px;
h3 {
width: 100%;
//height: 71px;
margin-top: 120px;
text-align: center;
font-size: 28px;
color: white;
font-family: "微软雅黑";
}
.english {
width: 100%;
height: 24px;
text-align: center;
font-size: 12px;
color: white;
font-family: "微软雅黑";
}
.ms-login {
width: 692px;
height: 373px;
margin: 0 auto;
position: relative;
background: url(../../assets/img/logininfo3.png) no-repeat;
margin-top: 32px;
.ms-content {
position: absolute;
width: 340px;
left: 283px;
top: 108px;
.el-form-item {
margin-bottom: 30px;
}
.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,462 @@
<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="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-divider></el-divider>
</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,
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();
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();
},
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,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,362 @@
<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
>
</div>
</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="120">
<template slot-scope="scope">
<el-button
@click.native.stop="handleRevisePhoto(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>
<addPhotoDialog
:photoDialogTitle="photoDialogTitle"
ref="addPhotoDialogref"
></addPhotoDialog>
<!-- 新增线路 -->
<add-lineDialog ref="addlineDialogref"></add-lineDialog>
<towerDialog ref="towerDialogref"></towerDialog>
</div>
</template>
<script>
import { getTerminalJoggle, deleteTerminalJoggle } from "@/utils/api/index";
import moment from "moment";
import addPhotoDialog from "./components/addPhotoDialog.vue";
import addLineDialog from "./components/addLineDialog.vue";
import towerDialog from "./components/towerDialog.vue";
export default {
name: "photographicDevice",
components: {
addPhotoDialog,
addLineDialog,
towerDialog,
},
data() {
return {
formdata: {},
roleUser: "",
terminalTableData: [], //
photoDialog: false, //
photoDialogTitle: "", //
deleteArr: [], //
multipleSelection: [], //
formphotoInfo: {}, //
page: 1, //
pageSize: 20, //
total: 0, //
loading: true,
};
},
created() {
this.roleUser = localStorage.getItem("role");
console.log(this.roleUser);
},
mounted() {
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 },
});
},
//
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;
},
//
handleAddPhoto() {
this.photoDialogTitle = "新增";
this.$refs.addPhotoDialogref.display();
this.$refs.addPhotoDialogref.getdataform(null);
},
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);
},
//
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, type: 0 }).then(
(res) => {
console.log(res);
this.deleteArr = [];
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;
.photoGraphicBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
}
.photoGraphicTable {
margin-top: 16px;
height: calc(100% - 46px);
}
}
}
</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>

@ -0,0 +1,264 @@
<template>
<div class="towerinfobox">
<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="tableDate"
tooltip-effect="dark"
stripe
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="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
prop="dyLevelname"
label="电压等级"
show-overflow-tooltip
>
<template slot-scope="scope">
{{
scope.row.dyLevelname
}}
</template>
</el-table-column> -->
<el-table-column
prop="lineName"
label="线路名称"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-link @click.native.stop="handleResive(scope.row)">{{
scope.row.lineName
}}</el-link>
</template>
</el-table-column>
<!-- <el-table-column
prop="lineId"
label="线路编号"
show-overflow-tooltip
></el-table-column> -->
<el-table-column prop="name" label="杆塔名称" show-overflow-tooltip>
<template slot-scope="scope">
<el-link @click.native.stop="handleResive(scope.row)">{{
scope.row.name
}}</el-link>
</template></el-table-column
>
<el-table-column
prop="address"
label="杆塔地址"
show-overflow-tooltip
></el-table-column>
<el-table-column prop="order" label="排序号" width="100">
<template slot-scope="scope">
{{ scope.row.order == null ? 0 : scope.row.order }}
</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>
<!-- 新增时间表 -->
<addDialog :title="title" ref="addDialogref"></addDialog>
</div>
</template>
<script>
import { getTowerListApi, delTowerApi, getSearchInfo } from "@/utils/api/index";
import addDialog from "./components/addDialog.vue";
export default {
name: "towerInformation",
components: {
addDialog,
},
data() {
return {
title: "", //
tableDate: [],
//multipleSelection: [], //
page: 1, //
pageSize: 20, //
total: 0, //
loading: true,
formdata: {},
};
},
created() {},
mounted() {
this.deviceList();
},
methods: {
getRowKeys(row) {
return row.id;
},
//线
handleLineLink(val) {
console.log(val);
this.$router.push({
path: "/lineInformation",
query: { lineName: val.lineName, name: val.name },
});
},
//线
handletowerLink(val) {
console.log(val);
this.$router.push({
path: "/photographicDevice",
query: { lineName: val.lineName, name: val.name },
});
},
//
deviceList() {
this.loading = true;
this.$set(this.formdata, "pageindex", this.page);
this.$set(this.formdata, "pagesize", this.pageSize);
getTowerListApi(this.formdata)
.then((res) => {
this.tableDate = 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;
},
//
handleAdddevice() {
this.title = "新增";
this.$refs.addDialogref.display();
this.$refs.addDialogref.getdataform(null);
},
//
handleResive(data) {
this.title = "修改";
this.$refs.addDialogref.display();
this.$refs.addDialogref.getdataform(data);
},
//
handleDelete(data) {
let deleteArr = [];
deleteArr.push({
id: data.id,
});
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delTowerApi({ 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">
.towerinfobox {
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% - 46px);
//background: #fcc;
}
}
</style>

@ -0,0 +1,393 @@
<template>
<div class="weatherBox">
<div class="weatherContain">
<leftTree ref="sideTree"></leftTree>
<div class="rightTable">
<div class="dataBox">
<div class="fatherTableShowBox" v-if="!childFlag">
<el-table
:data="tableData"
style="width: 100%"
height="calc(100% - 40px)"
>
<el-table-column prop="line" label="线路"> </el-table-column>
<el-table-column prop="pole" label="杆塔"> </el-table-column>
<el-table-column prop="terminal" label="终端"> </el-table-column>
<el-table-column prop="time" label="时间"> </el-table-column>
<el-table-column prop="temperature" label="温度(℃)">
</el-table-column>
<el-table-column prop="humidity" label="湿度(%RH)">
</el-table-column>
<el-table-column prop="windSpeed" label="瞬时风速(m/s)">
</el-table-column>
<el-table-column prop="windDirection" label="瞬时风向(°)">
</el-table-column>
<el-table-column prop="rainfall" label="雨量(mm/hour)">
</el-table-column>
<el-table-column prop="pressure" label="气压(hPa(百帕))">
</el-table-column>
<el-table-column prop="sunlight" label="日照(W/m2)">
</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"
>
</el-pagination>
</div>
</div>
<div class="childBox" v-else>
<div class="searchBox" ref="searchref">
<el-form
:inline="true"
:model="formdata"
class="demo-form-inline"
>
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="date"
placeholder="开始日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="date"
placeholder="结束日期"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div>
<div class="childTableShowBox">
<el-table
:data="childTableDate"
style="width: 100%"
height="calc(100% - 40px)"
>
<el-table-column prop="time" label="时间"></el-table-column>
<el-table-column
prop="temperature"
label="温度(℃)"
></el-table-column>
<el-table-column
prop="humidity"
label="湿度(%RH)"
></el-table-column>
<el-table-column
prop="windSpeed"
label="瞬时风速(m/s)"
></el-table-column>
<el-table-column
prop="windDirection"
label="瞬时风向(°)"
></el-table-column>
<el-table-column
prop="rainfall"
label="雨量(mm/hour)"
></el-table-column>
<el-table-column
prop="pressure"
label="气压(hPa(百帕))"
></el-table-column>
<el-table-column
prop="sunlight"
label="日照(W/m2)"
></el-table-column>
<el-table-column
prop="minuteAverageWindSpeed"
label="1分钟平均风速(m/s)"
></el-table-column>
<el-table-column
prop="minuteAverageWindDirection"
label="1分钟平均风向(°)"
></el-table-column>
<el-table-column
prop="tenMinuteAverageWindSpeed"
label="10分钟平均风速(m/s)"
></el-table-column>
<el-table-column
prop="tenMinuteAverageWindDirection"
label="10分钟平均风向(°)"
></el-table-column>
<el-table-column
prop="tenMinuteMaxWindSpeed"
label="10分钟最大风速(m/s)"
></el-table-column>
</el-table>
</div>
<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"
>
</el-pagination>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import leftTree from "../../components/leftTree";
export default {
name: "weather",
components: {
leftTree,
},
data() {
return {
msg: "",
childFlag: false,
tableData: [],
childTableDate: [],
formdata: {},
page: 1, //
pageSize: 20, //
total: 0, //
};
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
},
mounted() {
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
this.$set(this.formdata, "endtime", new Date().getTime());
},
methods: {
getCurrentData(data) {
console.log("执行父组件", data);
if (data.dyValue) {
console.log("电压");
this.msg = "公司所有数据";
this.childFlag = false;
this.tableData = [
{
line: "线路A",
pole: "杆塔1",
terminal: "终端1",
time: "2023-03-15 08:00:00",
temperature: "25℃",
humidity: "60%",
windSpeed: "0.5m/s",
windDirection: "120°",
rainfall: "0mm/hour",
pressure: "1015hPa",
sunlight: "500W/m2",
},
{
line: "线路B",
pole: "杆塔2",
terminal: "终端2",
time: "2023-03-15 09:00:00",
temperature: "23℃",
humidity: "70%",
windSpeed: "0.3m/s",
windDirection: "90°",
rainfall: "0mm/hour",
pressure: "1013hPa",
sunlight: "350W/m2",
},
{
line: "线路C",
pole: "杆塔3",
terminal: "终端3",
time: "2023-03-15 10:00:00",
temperature: "27℃",
humidity: "55%",
windSpeed: "0.7m/s",
windDirection: "60°",
rainfall: "0mm/hour",
pressure: "1017hPa",
sunlight: "650W/m2",
},
{
line: "线路D",
pole: "杆塔4",
terminal: "终端4",
time: "2023-03-15 11:00:00",
temperature: "24℃",
humidity: "65%",
windSpeed: "0.4m/s",
windDirection: "30°",
rainfall: "0mm/hour",
pressure: "1016hPa",
sunlight: "450W/m2",
},
{
line: "线路E",
pole: "杆塔5",
terminal: "终端5",
time: "2023-03-15 12:00:00",
temperature: "28℃",
humidity: "50%",
windSpeed: "0.6m/s",
windDirection: "90°",
rainfall: "0mm/hour",
pressure: "1018hPa",
sunlight: "750W/m2",
},
];
} else if (data.bsManufacturer) {
this.msg = "杆塔下所有数据";
this.childFlag = false;
this.tableData = [
{
line: "线路F",
pole: "杆塔6",
terminal: "终端6",
time: "2023-03-15 13:00:00",
temperature: "26℃",
humidity: "60%",
windSpeed: "0.5m/s",
windDirection: "150°",
rainfall: "0mm/hour",
pressure: "1017hPa",
sunlight: "600W/m2",
},
{
line: "线路G",
pole: "杆塔7",
terminal: "终端7",
time: "2023-03-15 14:00:00",
temperature: "29℃",
humidity: "45%",
windSpeed: "0.7m/s",
windDirection: "180°",
rainfall: "mm/hour, ",
pressure: "184hPa百帕 ",
sunlight: "789W/m²",
},
{
line: "线路H",
pole: "杆塔8 ",
terminal: "终端8 ",
time: "24-Mar-23 16:45 ",
temperature: "24℃摄氏度 ",
humidity: "78% (百分比) ",
windSpeed: "1.8m/s米/秒) ",
windDirection: "88 °(度) ",
rainfall: "至今无数据 ",
pressure: "184hPa百帕 ",
sunlight: " 无数据 ",
comment: " 天气晴朗,适合户外活动。",
},
];
} else {
console.log("杆塔");
this.msg = "装置当天数据";
this.childFlag = true;
this.childTableDate = [
{
time: "2023-03-15 08:00:00",
temperature: "25℃",
humidity: "60%",
windSpeed: "0.5m/s",
windDirection: "120°",
rainfall: "0mm/hour",
pressure: "1015hPa",
sunlight: "500W/m2",
minuteAverageWindSpeed: "无数据",
minuteAverageWindDirection: "无数据",
tenMinuteAverageWindSpeed: "无数据",
tenMinuteAverageWindDirection: "无数据",
tenMinuteMaxWindSpeed: "无数据",
},
{
time: "2023-03-15 09:00:00",
temperature: "23℃",
humidity: "70%",
windSpeed: "0.3m/s",
windDirection: "90°",
rainfall: "0mm/hour",
pressure: "1013hPa",
sunlight: "350W/m2",
minuteAverageWindSpeed: "无数据",
minuteAverageWindDirection: "无数据",
tenMinuteAverageWindSpeed: "无数据",
tenMinuteAverageWindDirection: "无数据",
tenMinuteMaxWindSpeed: "无数据",
},
];
}
},
onSubmit() {},
//
handleCurrentChange(val) {
this.page = val;
// this.picList = [];
// this.getPicData();
},
//
handleSizeChange(val) {
this.pageSize = val;
//this.getPicData();
},
},
};
</script>
<style lang="less">
.weatherBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.weatherContain {
display: flex;
height: 100%;
box-sizing: border-box;
background: #fff;
border: 1px solid #ddd;
border-radius: 4px;
}
.rightTable {
display: flex;
width: 100%;
height: 100%;
flex: 1;
overflow: hidden;
border-left: 1px solid #ddd;
.dataBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
}
.fatherTableShowBox {
height: calc(100% - 0px);
}
.childBox {
height: 100%;
.childTableShowBox {
height: calc(100% - 91px);
}
}
}
}
</style>

@ -0,0 +1,34 @@
const { defineConfig } = require("@vue/cli-service");
// const path = require("path");
// const webpack = require("webpack");
module.exports = defineConfig({
//打包清除console
chainWebpack(config) {
config.optimization.minimizer("terser").tap((args) => {
args[0].terserOptions.compress.drop_console = true;
return args;
});
},
productionSourceMap: false, // 生产环境是否要生成 sourceMap
publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : "./", // 部署应用包时的基本 URL
//assetsPublicPath: process.env.NODE_ENV === "production" ? "" : "/",
outputDir: "dist", // 打包时输出的文件目录
assetsDir: "static", // 放置静态文件夹目录
transpileDependencies: true,
lintOnSave: false,
devServer: {
port: 8082, // 端口号的配置
proxy: {
"/api": {
//表示拦截以/api开头的请求路径
//target: "http://47.96.238.157:8093", //阿里云服务器环境
target: "http://180.166.218.222:40080", //dell
// target: "http://192.168.50.42:81", //东视
changOrigin: true, //是否开启跨域
pathRewrite: {
"^/api": "/api", //重写api把api变成空字符因为我们真正请求的路径是没有api的
},
},
},
},
});
Loading…
Cancel
Save