Compare commits
126 Commits
Author | SHA1 | Date |
---|---|---|
|
6a6cc213e5 | 1 year ago |
|
e3b7b79e74 | 1 year ago |
|
18ce1d2a85 | 1 year ago |
|
63bd189786 | 1 year ago |
|
b6ee182149 | 1 year ago |
|
2fb20f00ea | 1 year ago |
|
273a9509b3 | 1 year ago |
|
092698f720 | 1 year ago |
|
ad9811ab72 | 1 year ago |
|
24b38ab2eb | 1 year ago |
|
e8074e74f1 | 1 year ago |
|
c15df590bd | 1 year ago |
|
95bc9d09a4 | 1 year ago |
|
1127c752e1 | 1 year ago |
|
17e5e4605c | 1 year ago |
|
bd3e4b481f | 1 year ago |
|
932f0e968a | 1 year ago |
|
a35c1912f2 | 1 year ago |
|
8365e5bfea | 1 year ago |
|
ea73cb1a24 | 1 year ago |
|
9e2ad20c0b | 1 year ago |
|
3c869485ab | 1 year ago |
|
b105c7b200 | 1 year ago |
|
5d37873db3 | 1 year ago |
|
6533731144 | 1 year ago |
|
e458251052 | 1 year ago |
|
ecddc99dea | 1 year ago |
|
23b397081b | 1 year ago |
|
7b85da722b | 1 year ago |
|
221be28fff | 1 year ago |
|
2f54c610a0 | 1 year ago |
|
b57c0847de | 1 year ago |
|
4392ef299b | 1 year ago |
|
205574e9b6 | 1 year ago |
|
01b008bfec | 1 year ago |
|
45b1aacc7e | 1 year ago |
|
90acfc0a27 | 1 year ago |
|
67b2706c4b | 1 year ago |
|
ee82d0fc81 | 1 year ago |
|
8c5ce46d94 | 1 year ago |
|
283df218bb | 1 year ago |
|
e1dcadd102 | 1 year ago |
|
2ab38f7a9f | 1 year ago |
|
5f69fddaa5 | 1 year ago |
|
38b708b4a3 | 1 year ago |
|
ceb665d724 | 1 year ago |
|
656a3daa8d | 1 year ago |
|
2326f8d7c7 | 1 year ago |
|
3a527fbb18 | 1 year ago |
|
b3a60b2240 | 1 year ago |
|
f18923ebf1 | 1 year ago |
|
63d72d78dc | 1 year ago |
|
a642779d14 | 1 year ago |
|
d96eb977eb | 1 year ago |
|
71991fe073 | 1 year ago |
|
572dd7a30b | 1 year ago |
|
3c55c84392 | 1 year ago |
|
8ffb77634f | 1 year ago |
|
414554c0e5 | 1 year ago |
|
4e98177836 | 1 year ago |
|
c2797030dc | 1 year ago |
|
b6d67b038e | 1 year ago |
|
c9a84a7eb3 | 1 year ago |
|
2c2d771878 | 1 year ago |
|
c71cfda1d8 | 1 year ago |
|
5c3ce1f285 | 1 year ago |
|
dc83c28dc5 | 1 year ago |
|
e3b3e08682 | 1 year ago |
|
2dc62f2d57 | 1 year ago |
|
c30be6e10c | 1 year ago |
|
dd7fc8b9e4 | 1 year ago |
|
6197c53804 | 1 year ago |
|
4f7c960e6b | 1 year ago |
|
c9f58fb9ce | 1 year ago |
|
e58d1c07cb | 1 year ago |
|
fcdde8aa33 | 1 year ago |
|
fa46e54a1d | 1 year ago |
|
818214d10d | 1 year ago |
|
d3ea703444 | 1 year ago |
|
e5bf15f4a2 | 1 year ago |
|
bbed91b05e | 1 year ago |
|
8ff60d0a52 | 1 year ago |
|
4e4cfc26e0 | 1 year ago |
|
c6c82dc570 | 1 year ago |
|
ce1b533423 | 1 year ago |
|
bd9b11294c | 1 year ago |
|
88edc135a9 | 1 year ago |
|
fa1d3650dd | 1 year ago |
|
92994a3ef0 | 1 year ago |
|
7970f3e4b3 | 2 years ago |
|
733715a903 | 2 years ago |
|
ff7556dabe | 2 years ago |
|
be998f5ced | 2 years ago |
|
5bc7261752 | 2 years ago |
|
ba823ee505 | 2 years ago |
|
25ca61b79e | 2 years ago |
|
d2249ca1d0 | 2 years ago |
|
0806ead733 | 2 years ago |
|
70df922e2a | 2 years ago |
|
4b33b2fb93 | 2 years ago |
|
a2d0bde682 | 2 years ago |
|
9f6463bfd6 | 2 years ago |
|
f734489a79 | 2 years ago |
|
aa9b6a4f09 | 2 years ago |
|
05037ccc6d | 2 years ago |
|
df63fb7b81 | 2 years ago |
|
83a531be52 | 2 years ago |
|
4aa18787c3 | 2 years ago |
|
a7a0b600f2 | 2 years ago |
|
b17f4424a6 | 2 years ago |
|
25342a89e9 | 2 years ago |
|
f606b9003e | 2 years ago |
|
96a75a4e6b | 2 years ago |
|
56e425f513 | 2 years ago |
|
a8c6a339c5 | 2 years ago |
|
c50d9597a0 | 2 years ago |
|
08bb06f78c | 2 years ago |
|
1e63720f56 | 2 years ago |
|
e9cb3bcbbf | 2 years ago |
|
3fe5f93838 | 2 years ago |
|
82f60a0fa9 | 2 years ago |
|
c46203b0c1 | 2 years ago |
|
d8bb891ba2 | 2 years ago |
|
42a7c92543 | 2 years ago |
|
1f9476a5c3 | 2 years ago |
|
bca647a736 | 2 years ago |
@ -1,3 +1,6 @@
|
||||
// module.exports = {
|
||||
// presets: ["@vue/cli-plugin-babel/preset"],
|
||||
// };
|
||||
module.exports = {
|
||||
presets: ["@vue/cli-plugin-babel/preset"],
|
||||
plugins: ["@babel/plugin-transform-optional-chaining"],
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 7.9 KiB |
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<div class="error-page">
|
||||
<div class="error-code">4<span>0</span>3</div>
|
||||
<div class="error-desc">啊哦~ 你没有权限访问该页面哦</div>
|
||||
<div class="error-handle">
|
||||
<router-link to="/stritl">
|
||||
<el-button type="primary" size="large">返回首页</el-button>
|
||||
</router-link>
|
||||
<el-button class="error-btn" type="primary" size="large" @click="goBack"
|
||||
>返回上一页</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
goBack() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.error-page {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f3f3f3;
|
||||
box-sizing: border-box;
|
||||
.error-code {
|
||||
line-height: 1;
|
||||
font-size: 250px;
|
||||
font-weight: bolder;
|
||||
color: #f02d2d;
|
||||
}
|
||||
.error-code span {
|
||||
color: #00a854;
|
||||
}
|
||||
.error-desc {
|
||||
font-size: 30px;
|
||||
color: #777;
|
||||
}
|
||||
.error-handle {
|
||||
margin-top: 30px;
|
||||
padding-bottom: 200px;
|
||||
}
|
||||
.el-button--primary {
|
||||
width: auto !important;
|
||||
}
|
||||
.error-btn {
|
||||
margin-left: 100px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,61 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id */
|
||||
src: url('iconfont.ttf?t=1690188947515') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-paizhao:before {
|
||||
content: "\e6ba";
|
||||
}
|
||||
|
||||
.icon-paizhao-xianxing:before {
|
||||
content: "\e8d1";
|
||||
}
|
||||
|
||||
.icon-tuiguanglishitupianjinqun:before {
|
||||
content: "\e613";
|
||||
}
|
||||
|
||||
.icon-gongsi:before {
|
||||
content: "\e62e";
|
||||
}
|
||||
|
||||
.icon-dianli:before {
|
||||
content: "\e649";
|
||||
}
|
||||
|
||||
.icon-dianlihangye:before {
|
||||
content: "\e791";
|
||||
}
|
||||
|
||||
.icon-shexiangtoulixian:before {
|
||||
content: "\e7b2";
|
||||
}
|
||||
|
||||
.icon-video-camera:before {
|
||||
content: "\e962";
|
||||
}
|
||||
|
||||
.icon-shexiangtou-lixian:before {
|
||||
content: "\ef1c";
|
||||
}
|
||||
|
||||
.icon-shexiangtou-zaixian:before {
|
||||
content: "\ef1d";
|
||||
}
|
||||
|
||||
.icon-shudianxianlu_2722010801:before {
|
||||
content: "\efed";
|
||||
}
|
||||
|
||||
.icon-tupian_normal:before {
|
||||
content: "\e681";
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,57 @@
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
caches: [],
|
||||
},
|
||||
actions: {
|
||||
// 添加缓存的路由组件
|
||||
addCache({ state, dispatch }, componentName) {
|
||||
if (Array.isArray(componentName)) {
|
||||
componentName.forEach((item) => {
|
||||
dispatch("addCache", item);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const { caches } = state;
|
||||
if (!componentName || caches.includes(componentName)) return;
|
||||
|
||||
caches.push(componentName);
|
||||
console.log("缓存路由组件:", componentName);
|
||||
},
|
||||
|
||||
// 移除缓存的路由组件
|
||||
removeCache({ state, dispatch }, componentName) {
|
||||
if (Array.isArray(componentName)) {
|
||||
componentName.forEach((item) => {
|
||||
dispatch("removeCache", item);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const { caches } = state;
|
||||
const index = caches.indexOf(componentName);
|
||||
if (index > -1) {
|
||||
console.log("清除缓存的路由组件:", componentName);
|
||||
return caches.splice(index, 1)[0];
|
||||
}
|
||||
},
|
||||
// 移除缓存的路由组件的实例
|
||||
async removeCacheEntry({ dispatch }, componentName) {
|
||||
const cacheRemoved = await dispatch("removeCache", componentName);
|
||||
if (cacheRemoved) {
|
||||
await Vue.nextTick();
|
||||
dispatch("addCache", componentName);
|
||||
}
|
||||
},
|
||||
// 清除缓存的路由组件的实例
|
||||
clearEntry({ state, dispatch }) {
|
||||
const { caches } = state;
|
||||
caches.slice().forEach((key) => {
|
||||
dispatch("removeCacheEntry", key);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
@ -0,0 +1,24 @@
|
||||
import request from "../request";
|
||||
//获取装置总数图表
|
||||
//获取数据接口
|
||||
export function getDataListJoggle(data) {
|
||||
return request({
|
||||
url: "/xapi/query.php",
|
||||
method: "get",
|
||||
params: data,
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
},
|
||||
});
|
||||
}
|
||||
//获取相位码
|
||||
export function funccodeJoggle(data) {
|
||||
return request({
|
||||
url: "/xapi/funccode.php",
|
||||
method: "get",
|
||||
params: data,
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
},
|
||||
});
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
const EventBus = new Vue()
|
||||
export default EventBus
|
@ -0,0 +1,700 @@
|
||||
<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%"
|
||||
v-loading="loading"
|
||||
height="calc(100% - 40px)"
|
||||
>
|
||||
<el-table-column prop="lineName" label="线路"> </el-table-column>
|
||||
<el-table-column prop="towerName" label="杆塔"> </el-table-column>
|
||||
<el-table-column prop="cmdid" label="终端"> </el-table-column>
|
||||
|
||||
<el-table-column prop="updateTime" label="时间">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.updateTime">
|
||||
{{
|
||||
$moment(scope.row.updateTime * 1000).format(
|
||||
"YYYY-MM-DD HH:mm:ss"
|
||||
)
|
||||
}}</span
|
||||
>
|
||||
<span v-else> - </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="temperature" label="温度(℃)">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.temperature">{{
|
||||
scope.row.temperature
|
||||
}}</span>
|
||||
<span v-else> - </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="humidity" label="湿度(%RH)">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.humidity">{{
|
||||
scope.row.humidity
|
||||
}}</span>
|
||||
<span v-else> - </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="windSpeed" label="瞬时风速(m/s)">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.windSpeed">{{
|
||||
scope.row.windSpeed
|
||||
}}</span>
|
||||
<span v-else> - </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="windDirection" label="瞬时风向(°)">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.windDirection">{{
|
||||
scope.row.windDirection
|
||||
}}</span>
|
||||
<span v-else> - </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rain" label="雨量(mm/hour)">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.rain">{{ scope.row.rain }}</span>
|
||||
<span v-else> - </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="airPressure" label="气压(hPa(百帕))">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.airPressure">{{
|
||||
scope.row.airPressure
|
||||
}}</span>
|
||||
<span v-else> - </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="radiationIntensity" label="日照(W/m2)">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.radiationIntensity">{{
|
||||
scope.row.radiationIntensity
|
||||
}}</span>
|
||||
<span v-else> - </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="moreDataClick(scope.row)"
|
||||
v-if="scope.row.updateTime"
|
||||
>更多历史数据</el-button
|
||||
>
|
||||
<span v-else> 没有数据</span>
|
||||
</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"
|
||||
>
|
||||
</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
|
||||
@change="changedate"
|
||||
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="termalBox">
|
||||
<h3>当前监测终端</h3>
|
||||
<el-descriptions direction="vertical" :column="4" border>
|
||||
<el-descriptions-item label="线路">{{
|
||||
childMsg.lineName
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="杆塔">{{
|
||||
childMsg.towerName
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="终端">{{
|
||||
childMsg.cmdid
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="echartsBox">
|
||||
<div class="btnbox">
|
||||
<el-button type="primary" @click="onWdLine"
|
||||
>温度变化趋势</el-button
|
||||
>
|
||||
<el-button type="primary" @click="onSdLine"
|
||||
>湿度变化趋势</el-button
|
||||
>
|
||||
<el-button type="primary" @click="onHidden">隐藏图表</el-button>
|
||||
</div>
|
||||
<div id="wDechart" class="chartClass" v-show="wdFlag"></div>
|
||||
<div id="sDechart" class="chartClass" v-show="sdFlag"></div>
|
||||
</div>
|
||||
<div class="childTableShowBox">
|
||||
<h3>气象数据列表</h3>
|
||||
<el-table
|
||||
:data="childTableDate"
|
||||
style="width: 100%"
|
||||
v-loading="loading"
|
||||
height="calc(100% - 40px)"
|
||||
>
|
||||
<el-table-column prop="updateTime" label="时间">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.updateTime">
|
||||
{{
|
||||
$moment(scope.row.updateTime * 1000).format(
|
||||
"YYYY-MM-DD HH:mm:ss"
|
||||
)
|
||||
}}</span
|
||||
>
|
||||
<span v-else> - </span>
|
||||
</template>
|
||||
</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="precipitation"
|
||||
label="雨量(mm/hour)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="airPressure"
|
||||
label="气压(hPa(百帕))"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="radiationIntensity"
|
||||
label="日照(W/m2)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="avgWindSpeed1Min"
|
||||
label="1分钟平均风速(m/s)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="avgWindDir1Min"
|
||||
label="1分钟平均风向(°)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="avgWindSpeed10Min"
|
||||
label="10分钟平均风速(m/s)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="avgWindDir10Min"
|
||||
label="10分钟平均风向(°)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="maxSpeed10Min"
|
||||
label="10分钟最大风速(m/s)"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pageNation">
|
||||
<el-pagination
|
||||
@current-change="handlechildCurrentChange"
|
||||
@size-change="handlechildSizeChange"
|
||||
:current-page="childpage"
|
||||
:page-size="childpageSize"
|
||||
layout="sizes, prev, pager, next, jumper,total"
|
||||
:total="childtotal"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import leftTree from "../components/leftTree";
|
||||
import { getDataListJoggle } from "@/utils/api/iceApi";
|
||||
export default {
|
||||
name: "weather",
|
||||
components: {
|
||||
leftTree,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
childFlag: false,
|
||||
tableData: [],
|
||||
childTableDate: [],
|
||||
formdata: {},
|
||||
page: 1, // 当前页数
|
||||
pageSize: 20, // 每页数量
|
||||
total: 0, //总条数
|
||||
qt: "",
|
||||
id: "",
|
||||
paramsData: "",
|
||||
childpage: 1, // 当前页数
|
||||
childpageSize: 20, // 每页数量
|
||||
childtotal: 0, //总条数
|
||||
childParma: "",
|
||||
childMsg: "",
|
||||
echartsData: "", //echarts数据
|
||||
wdFlag: true,
|
||||
sdFlag: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
var that = this;
|
||||
document.onkeydown = function (e) {
|
||||
var key = window.event.keyCode;
|
||||
if (key === 13) {
|
||||
that.onSubmit(); // 触发事件
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
endtime(newVal) {
|
||||
if (newVal) {
|
||||
const date = new Date(newVal);
|
||||
date.setHours(23);
|
||||
date.setMinutes(59);
|
||||
date.setSeconds(59);
|
||||
this.formdata.endtime = date.getTime();
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
//this.getWeatherData();
|
||||
},
|
||||
methods: {
|
||||
getCurrentData(data) {
|
||||
console.log("执行父组件", data);
|
||||
this.paramsData = data;
|
||||
console.log(data);
|
||||
if (data.dyValue) {
|
||||
console.log("电压-公司");
|
||||
this.qt = "all";
|
||||
this.id = data.id;
|
||||
this.getWeatherData(data);
|
||||
} else if (data.bsManufacturer) {
|
||||
console.log("线路-电压");
|
||||
this.qt = "line";
|
||||
this.id = data.id;
|
||||
this.getWeatherData(data);
|
||||
} else {
|
||||
console.log("装置-杆塔");
|
||||
this.qt = "tower";
|
||||
this.id = data.towerid;
|
||||
this.getWeatherData(data);
|
||||
}
|
||||
//this.getAllData(data);
|
||||
},
|
||||
getWeatherData(data) {
|
||||
this.childFlag = false;
|
||||
console.log(data, this.qt);
|
||||
this.loading = true;
|
||||
getDataListJoggle({
|
||||
act: "meteo",
|
||||
qt: this.qt,
|
||||
id: this.id,
|
||||
p: this.page,
|
||||
ps: this.pageSize,
|
||||
latest: 1,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.tableData = res.data;
|
||||
this.total = Number(res.page.totalRecords);
|
||||
this.loading = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err); //代码错误、请求失败捕获
|
||||
});
|
||||
},
|
||||
//点击分页
|
||||
handleCurrentChange(val) {
|
||||
this.page = val;
|
||||
this.tableData = [];
|
||||
this.getWeatherData(this.paramsData);
|
||||
},
|
||||
//每页条数
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.tableData = [];
|
||||
this.getWeatherData(this.paramsData);
|
||||
},
|
||||
//点击查看更多历史数据
|
||||
moreDataClick(row) {
|
||||
this.childFlag = true;
|
||||
console.log(row);
|
||||
this.$set(
|
||||
this.formdata,
|
||||
"starttime",
|
||||
new Date(new Date().toLocaleDateString()).getTime()
|
||||
);
|
||||
const currentDate = new Date(); // 获取当前时间
|
||||
currentDate.setHours(23); // 设置小时为23
|
||||
currentDate.setMinutes(59); // 设置分钟为59
|
||||
currentDate.setSeconds(59); // 设置秒数为59
|
||||
this.$set(this.formdata, "endtime", currentDate.getTime());
|
||||
this.qt = "terminal";
|
||||
this.id = row.termId;
|
||||
this.childParma = row;
|
||||
this.getchildWeatherData(row);
|
||||
},
|
||||
|
||||
//查询时间
|
||||
onSubmit() {
|
||||
this.getchildWeatherData(this.childParma);
|
||||
},
|
||||
getchildWeatherData(row) {
|
||||
this.loading = true;
|
||||
this.childMsg = row;
|
||||
const sTime = Math.floor(this.formdata.starttime / 1000);
|
||||
const eTime = Math.floor(this.formdata.endtime / 1000);
|
||||
getDataListJoggle({
|
||||
act: "meteo",
|
||||
qt: this.qt,
|
||||
id: this.id,
|
||||
bt: sTime,
|
||||
et: eTime,
|
||||
p: this.childpage,
|
||||
ps: this.childpageSize,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.childTableDate = res.data;
|
||||
this.childtotal = Number(res.page.totalRecords);
|
||||
this.loading = false;
|
||||
//获取温度折线图
|
||||
this.getAllData(row);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err); //代码错误、请求失败捕获
|
||||
});
|
||||
},
|
||||
getAllData(row) {
|
||||
const sTime = Math.floor(this.formdata.starttime / 1000);
|
||||
const eTime = Math.floor(this.formdata.endtime / 1000);
|
||||
getDataListJoggle({
|
||||
act: "meteo",
|
||||
qt: this.qt,
|
||||
id: this.id,
|
||||
bt: sTime,
|
||||
et: eTime,
|
||||
p: this.childpage,
|
||||
ps: 1000,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.echartsData = res.data;
|
||||
//获取温度折线图
|
||||
this.getEchart4(this.echartsData);
|
||||
this.getEchart5(this.echartsData);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err); //代码错误、请求失败捕获
|
||||
});
|
||||
},
|
||||
onWdLine() {
|
||||
this.wdFlag = true;
|
||||
this.sdFlag = false;
|
||||
},
|
||||
onSdLine() {
|
||||
this.wdFlag = false;
|
||||
this.sdFlag = true;
|
||||
},
|
||||
onHidden() {
|
||||
this.wdFlag = false;
|
||||
this.sdFlag = false;
|
||||
},
|
||||
//获取当天告警分类统计
|
||||
getEchart4(wd) {
|
||||
this.$nextTick(() => {
|
||||
this.$echarts.init(document.getElementById("wDechart"));
|
||||
this.mywDechart = this.$echarts.init(
|
||||
document.getElementById("wDechart")
|
||||
);
|
||||
console.log(wd);
|
||||
var xData = [];
|
||||
var yData = [];
|
||||
xData = wd.map((item) =>
|
||||
this.$moment(item.updateTime * 1000).format("HH:mm:ss")
|
||||
);
|
||||
yData = wd.map((item) => item.temperature);
|
||||
let option = {
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
},
|
||||
grid: {
|
||||
//left: "6%", //图表距离容器左侧多少距离
|
||||
//right: "6%", //图表距离容器右侧侧多少距离
|
||||
bottom: "6%", //图表距离容器上面多少距离
|
||||
//top: "2%", //图表距离容器下面多少距离
|
||||
},
|
||||
title: {
|
||||
text: "温度变化趋势",
|
||||
x: "center", //设置标题位置居中
|
||||
textStyle: {
|
||||
//设置主标题的文字风格
|
||||
color: "#333", //字体颜色
|
||||
fontSize: 16, //文字大小
|
||||
fontWeight: "normal",
|
||||
},
|
||||
},
|
||||
toolbox: {
|
||||
show: true,
|
||||
feature: {
|
||||
dataView: { readOnly: false },
|
||||
magicType: { type: ["line", "bar"] },
|
||||
restore: {},
|
||||
saveAsImage: {},
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
name: "时间", // 坐标轴名称
|
||||
type: "category",
|
||||
boundaryGap: false,
|
||||
data: xData,
|
||||
},
|
||||
yAxis: {
|
||||
name: "温度", // 坐标轴名称
|
||||
type: "value",
|
||||
axisLabel: {
|
||||
formatter: "{value} °C",
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "温度",
|
||||
symbol: "none",
|
||||
type: "line",
|
||||
data: yData,
|
||||
},
|
||||
],
|
||||
};
|
||||
this.mywDechart.setOption(option);
|
||||
window.addEventListener("resize", () => {
|
||||
this.mywDechart.resize();
|
||||
});
|
||||
});
|
||||
},
|
||||
getEchart5(sd) {
|
||||
this.$nextTick(() => {
|
||||
this.$echarts.init(document.getElementById("sDechart"));
|
||||
this.mysDechart = this.$echarts.init(
|
||||
document.getElementById("sDechart")
|
||||
);
|
||||
console.log(sd);
|
||||
var xData = [];
|
||||
var yData = [];
|
||||
xData = sd.map((item) =>
|
||||
this.$moment(item.updateTime * 1000).format("HH:mm:ss")
|
||||
);
|
||||
yData = sd.map((item) => item.humidity);
|
||||
let option = {
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
},
|
||||
grid: {
|
||||
//left: "6%", //图表距离容器左侧多少距离
|
||||
//right: "6%", //图表距离容器右侧侧多少距离
|
||||
bottom: "6%", //图表距离容器上面多少距离
|
||||
//top: "2%", //图表距离容器下面多少距离
|
||||
},
|
||||
title: {
|
||||
text: "湿度变化趋势",
|
||||
x: "center", //设置标题位置居中
|
||||
textStyle: {
|
||||
//设置主标题的文字风格
|
||||
color: "#333", //字体颜色
|
||||
fontSize: 16, //文字大小
|
||||
fontWeight: "normal",
|
||||
},
|
||||
},
|
||||
toolbox: {
|
||||
show: true,
|
||||
feature: {
|
||||
dataView: { readOnly: false },
|
||||
magicType: { type: ["line", "bar"] },
|
||||
restore: {},
|
||||
saveAsImage: {},
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
name: "时间", // 坐标轴名称
|
||||
type: "category",
|
||||
boundaryGap: false,
|
||||
data: xData,
|
||||
},
|
||||
yAxis: {
|
||||
name: "湿度", // 坐标轴名称
|
||||
type: "value",
|
||||
axisLabel: {
|
||||
formatter: "{value} %RH",
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "湿度",
|
||||
symbol: "none",
|
||||
type: "line",
|
||||
data: yData,
|
||||
},
|
||||
],
|
||||
};
|
||||
this.mysDechart.setOption(option);
|
||||
window.addEventListener("resize", () => {
|
||||
this.mysDechart.resize();
|
||||
});
|
||||
});
|
||||
},
|
||||
changedate() {
|
||||
console.log(new Date(this.formdata.endtime));
|
||||
const currentDate = new Date(this.formdata.endtime); // 获取当前时间
|
||||
currentDate.setHours(23); // 设置小时为23
|
||||
currentDate.setMinutes(59); // 设置分钟为59
|
||||
currentDate.setSeconds(59); // 设置秒数为59
|
||||
this.formdata.endtime = currentDate;
|
||||
console.log("结束时间", this.formdata.endtime);
|
||||
},
|
||||
//点击child分页
|
||||
handlechildCurrentChange(val) {
|
||||
this.childpage = val;
|
||||
this.childTableDate = [];
|
||||
this.getchildWeatherData(this.childParma);
|
||||
},
|
||||
//每页条数child分页
|
||||
handlechildSizeChange(val) {
|
||||
this.childpageSize = val;
|
||||
this.childTableDate = [];
|
||||
this.getchildWeatherData(this.childParma);
|
||||
},
|
||||
},
|
||||
};
|
||||
</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: auto;
|
||||
border-left: 1px solid #ddd;
|
||||
.el-table .el-table__cell {
|
||||
text-align: center;
|
||||
}
|
||||
.dataBox {
|
||||
width: calc(100% - 24px);
|
||||
height: calc(100% - 24px);
|
||||
padding: 12px 12px;
|
||||
background: #fff;
|
||||
}
|
||||
.fatherTableShowBox {
|
||||
height: calc(100% - 0px);
|
||||
}
|
||||
.childBox {
|
||||
height: 100%;
|
||||
.echartsBox {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.btnbox {
|
||||
display: flex;
|
||||
margin-bottom: 8px;
|
||||
.el-button--primary {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
.chartClass {
|
||||
height: 450px;
|
||||
width: 800px;
|
||||
}
|
||||
}
|
||||
.childTableShowBox {
|
||||
h3 {
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
margin-bottom: 8px;
|
||||
text-align: center;
|
||||
color: #666;
|
||||
margin-top: 16px;
|
||||
}
|
||||
height: calc(100% - 200px);
|
||||
}
|
||||
.termalBox {
|
||||
h3 {
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
margin-bottom: 4px;
|
||||
text-align: center;
|
||||
color: #666;
|
||||
}
|
||||
.el-descriptions {
|
||||
margin-bottom: 16px;
|
||||
.el-descriptions-item__label.is-bordered-label {
|
||||
color: #333;
|
||||
}
|
||||
.el-descriptions__body
|
||||
.el-descriptions__table
|
||||
.el-descriptions-item__cell {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="faultInfo"
|
||||
title="故障信息报"
|
||||
:visible.sync="isShow"
|
||||
:close-on-click-modal="false"
|
||||
width="1000px"
|
||||
>
|
||||
<div class="zzinfo">
|
||||
<span v-if="rowInfo.protocol == '65280'"> 国网I1 </span>
|
||||
<span v-if="rowInfo.protocol == '65296'"> 陕西 </span>
|
||||
<span v-if="rowInfo.protocol == '65281'"> 安徽 </span>
|
||||
<span v-if="rowInfo.protocol == '65282'"> 江苏 </span>
|
||||
<span v-if="rowInfo.protocol == '65283'"> 湖南 </span>
|
||||
<span v-if="rowInfo.protocol == '65284'"> 浙江 </span>
|
||||
<span v-if="rowInfo.protocol == '65285'"> 河南 </span>
|
||||
<span v-if="rowInfo.protocol == '65286'"> 河南郑州 </span>
|
||||
<span v-if="rowInfo.protocol == '65290'"> 河南统一视频v2020 </span>
|
||||
</div>
|
||||
<el-form :inline="true" :model="formdata" class="demo-form-inline">
|
||||
<el-form-item label="开始日期">
|
||||
<el-date-picker
|
||||
@change="changestartdate"
|
||||
v-model="formdata.starttime"
|
||||
type="datetime"
|
||||
:picker-options="pickerOptions"
|
||||
placeholder="开始日期"
|
||||
value-format="timestamp"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期">
|
||||
<el-date-picker
|
||||
@change="changeenddate"
|
||||
v-model="formdata.endtime"
|
||||
type="datetime"
|
||||
:picker-options="pickerOptions"
|
||||
placeholder="结束日期"
|
||||
value-format="timestamp"
|
||||
class="ml10"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||
<el-button type="primary" @click="exportFault">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="listData"
|
||||
stripe
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
height="442px"
|
||||
v-loading="loading"
|
||||
>
|
||||
<template slot="empty">
|
||||
<el-empty :image-size="160" description="暂无数据"></el-empty>
|
||||
</template>
|
||||
<el-table-column min-width="45" label="序号">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (page - 1) * pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="cmdid"
|
||||
label="装置编号"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="faultTime"
|
||||
label="采集时间"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="msg"
|
||||
label="故障信息"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
<div class="pageNation">
|
||||
<el-pagination
|
||||
@current-change="handleCurrentChange"
|
||||
@size-change="handleSizeChange"
|
||||
:current-page="page"
|
||||
:page-size="pageSize"
|
||||
layout="sizes, prev, pager, next, jumper,total"
|
||||
:total="total"
|
||||
background
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="hide">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getTermFaultsApi, getTermFaultsExcel } from "@/utils/api/index";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
formdata: {},
|
||||
rowInfo: "",
|
||||
listData: [],
|
||||
loading: false,
|
||||
page: 1, // 当前页数
|
||||
pageSize: 10, // 每页数量
|
||||
total: 0, //总条数
|
||||
pickerOptions: {
|
||||
disabledDate(date) {
|
||||
return date.getTime() > Date.now(); // 禁用大于今天的日期
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
endtime(newVal) {
|
||||
if (newVal) {
|
||||
const date = new Date(newVal);
|
||||
date.setHours(23);
|
||||
date.setMinutes(59);
|
||||
date.setSeconds(59);
|
||||
this.formdata.endtime = date;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
getTime() {
|
||||
const thirtyDaysAgo = new Date();
|
||||
thirtyDaysAgo.setHours(0); // 设置小时为23
|
||||
thirtyDaysAgo.setMinutes(0); // 设置分钟为59
|
||||
thirtyDaysAgo.setSeconds(0); // 设置秒数为59
|
||||
console.log(
|
||||
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
|
||||
);
|
||||
|
||||
const startTimeNew = new Date(
|
||||
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate())
|
||||
).getTime();
|
||||
this.$set(this.formdata, "starttime", startTimeNew);
|
||||
console.log("开始时间", this.formdata.starttime);
|
||||
const currentDate = new Date(); // 获取当前时间
|
||||
currentDate.setHours(23); // 设置小时为23
|
||||
currentDate.setMinutes(59); // 设置分钟为59
|
||||
currentDate.setSeconds(59); // 设置秒数为59
|
||||
this.$set(this.formdata, "endtime", currentDate.getTime());
|
||||
console.log("结束时间", this.formdata.endtime);
|
||||
|
||||
this.getfaultinfo();
|
||||
},
|
||||
changestartdate(val) {
|
||||
console.log(val);
|
||||
if (val == null) {
|
||||
console.log(new Date());
|
||||
const startDate = new Date();
|
||||
startDate.setHours(0); // 设置小时为23
|
||||
startDate.setMinutes(0); // 设置分钟为59
|
||||
startDate.setSeconds(0); // 设置秒数为59
|
||||
this.formdata.starttime = startDate;
|
||||
console.log(this.formdata.starttime);
|
||||
} else {
|
||||
this.formdata.starttime = val;
|
||||
}
|
||||
},
|
||||
//结束日期
|
||||
changeenddate(val) {
|
||||
if (val == null) {
|
||||
console.log(new Date());
|
||||
const endDate = new Date();
|
||||
endDate.setHours(23); // 设置小时为23
|
||||
endDate.setMinutes(59); // 设置分钟为59
|
||||
endDate.setSeconds(59); // 设置秒数为59
|
||||
this.formdata.endtime = endDate;
|
||||
console.log(this.formdata.endtime);
|
||||
} else {
|
||||
this.formdata.endtime = val;
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
//查询
|
||||
onSubmit() {
|
||||
if (this.formdata.starttime > this.formdata.endtime) {
|
||||
return this.$message({
|
||||
duration: 1500,
|
||||
showClose: true,
|
||||
message: "开始日期不能大于结束日期",
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
this.getfaultinfo();
|
||||
},
|
||||
//导出
|
||||
exportFault() {
|
||||
window.location.href =
|
||||
"/api/getTermFaultsExcel?termid=" + this.rowInfo.id;
|
||||
},
|
||||
//获取数据
|
||||
getfaultinfo() {
|
||||
this.loading = true;
|
||||
getTermFaultsApi({
|
||||
termid: this.rowInfo.id,
|
||||
starttime: this.formdata.starttime,
|
||||
endtime: this.formdata.endtime,
|
||||
pageindex: this.page,
|
||||
pagesize: this.pageSize,
|
||||
}).then((res) => {
|
||||
this.listData = res.data.list;
|
||||
this.total = res.data.total;
|
||||
this.$nextTick(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
//点击分页
|
||||
handleCurrentChange(val) {
|
||||
this.page = val;
|
||||
this.getfaultinfo();
|
||||
},
|
||||
//每页条数
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.getfaultinfo();
|
||||
},
|
||||
display(row) {
|
||||
console.log(row);
|
||||
this.rowInfo = row;
|
||||
this.isShow = true;
|
||||
this.getTime();
|
||||
},
|
||||
hide() {
|
||||
this.isShow = false;
|
||||
this.formdata = {};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.faultInfo {
|
||||
.zzinfo {
|
||||
position: absolute;
|
||||
top: 22px;
|
||||
left: 126px;
|
||||
}
|
||||
.pageNation {
|
||||
justify-content: flex-start;
|
||||
margin-top: 16px;
|
||||
.el-pagination {
|
||||
padding: 0px;
|
||||
.el-select .el-input {
|
||||
margin-left: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="buttonBox">
|
||||
<el-button type="primary" @click="handleSetChannel">APP设置 </el-button>
|
||||
<setAppDialog ref="setChannelDialog_ref"></setAppDialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {} from "@/utils/api/index";
|
||||
import setAppDialog from "./setAppDialog.vue";
|
||||
export default {
|
||||
components: { setAppDialog },
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
watch: {},
|
||||
mounted() {},
|
||||
computed: {
|
||||
termId() {
|
||||
return this.$store.state.termId;
|
||||
},
|
||||
channelIdList() {
|
||||
return this.$store.state.channelIdList;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleSetChannel() {
|
||||
this.$refs.setChannelDialog_ref.display();
|
||||
},
|
||||
},
|
||||
destroyed() {},
|
||||
beforeRouteLeave(to, from, next) {},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="buttonBox">
|
||||
<el-button type="primary" @click="handleSetChannel">通道设置 </el-button>
|
||||
<setChannelDialog ref="setChannelDialog_ref"></setChannelDialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {} from "@/utils/api/index";
|
||||
import setChannelDialog from "./setChannelDialog.vue";
|
||||
export default {
|
||||
components: { setChannelDialog },
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
watch: {},
|
||||
mounted() {},
|
||||
computed: {
|
||||
termId() {
|
||||
return this.$store.state.termId;
|
||||
},
|
||||
channelIdList() {
|
||||
return this.$store.state.channelIdList;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleSetChannel() {
|
||||
this.$refs.setChannelDialog_ref.display();
|
||||
},
|
||||
},
|
||||
destroyed() {},
|
||||
beforeRouteLeave(to, from, next) {},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="uploadPic"
|
||||
title="上传图片"
|
||||
:visible.sync="isShow"
|
||||
:close-on-click-modal="false"
|
||||
width="600px"
|
||||
@close="handleclose"
|
||||
>
|
||||
<div class="uploadBox">
|
||||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-form-item label="装置编号">
|
||||
<el-input v-model="form.cmdid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="装置Id">
|
||||
<el-input v-model="form.termid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="通道选择">
|
||||
<el-select v-model="form.channel" placeholder="选择通道">
|
||||
<el-option label="通道一" :value="1"></el-option>
|
||||
<el-option label="通道二" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择时间">
|
||||
<el-date-picker
|
||||
v-model="form.phototime"
|
||||
value-format="timestamp"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
ref="upload"
|
||||
action="#"
|
||||
:http-request="httpRequest"
|
||||
>
|
||||
<el-button slot="trigger" size="small" type="primary"
|
||||
>选取图片</el-button
|
||||
>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="isShow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handlesure">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { uploadPicApi } from "@/utils/api/index";
|
||||
export default {
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
form: {},
|
||||
fileList: [], //上传列表
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
httpRequest(raw) {
|
||||
this.fileList.push(raw);
|
||||
},
|
||||
//数据库获取最新数据
|
||||
display(data) {
|
||||
console.log(data);
|
||||
this.$set(this.form, "cmdid", data.cmdid);
|
||||
this.$set(this.form, "termid", data.id);
|
||||
this.isShow = true;
|
||||
},
|
||||
handleclose() {
|
||||
this.isShow = false;
|
||||
this.fileList = [];
|
||||
},
|
||||
handlesure() {
|
||||
this.isShow = false;
|
||||
//console.log(this.fileList[0].file);
|
||||
this.$set(this.form, "file", this.fileList[0].file);
|
||||
console.log(this.form);
|
||||
uploadPicApi(this.form)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.$message({
|
||||
duration: 1500,
|
||||
showClose: true,
|
||||
message: "上传成功",
|
||||
type: "success",
|
||||
});
|
||||
this.fileList = [];
|
||||
})
|
||||
.catch((err) => {});
|
||||
},
|
||||
},
|
||||
destroyed() {
|
||||
this.isShow = false;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.uploadPic {
|
||||
.uploadBox {
|
||||
}
|
||||
.upload-demo {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row-reverse;
|
||||
margin-right: 16px;
|
||||
.el-upload-list {
|
||||
width: 370px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
border: 1px solid #dcdfe6;
|
||||
background: #fff;
|
||||
margin-right: 12px;
|
||||
border-radius: 4px;
|
||||
.el-upload-list__item-name {
|
||||
margin-right: 0px;
|
||||
}
|
||||
.el-upload-list__item {
|
||||
transition: none;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
margin-top: 0px !important;
|
||||
.el-icon-close {
|
||||
top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<div class="menumanagement">
|
||||
<div class="deviceBox">
|
||||
<div class="deviceBtnGroup">
|
||||
<h4>菜单功能管理</h4>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdddevice()"
|
||||
>新增</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="deviceTable">
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="menuTableData"
|
||||
stripe
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
height="calc(100% - 40px)"
|
||||
@row-click="handleRowClick"
|
||||
>
|
||||
<template slot="empty">
|
||||
<el-empty :image-size="160" description="暂无数据"></el-empty>
|
||||
</template>
|
||||
<el-table-column
|
||||
label="ID"
|
||||
show-overflow-tooltip
|
||||
prop="id"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="路由名称"
|
||||
show-overflow-tooltip
|
||||
prop="key"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="菜单名称"
|
||||
show-overflow-tooltip
|
||||
prop="desc"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
show-overflow-tooltip
|
||||
prop="createTime"
|
||||
>
|
||||
<template slot-scope="scope" v-if="scope.row.createTime !== null">{{
|
||||
$moment(scope.row.createTime).format("yy-MM-DD HH:mm:ss")
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="200">
|
||||
<template slot-scope="scope" v-if="scope.row.id !== 0">
|
||||
<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>
|
||||
</div>
|
||||
<!-- 新增 -->
|
||||
<addMenu :title="title" ref="menuref"></addMenu>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import addMenu from "./components/addMenu.vue";
|
||||
|
||||
import { getMenuListApi, deleteResourceApi } from "@/utils/api/index";
|
||||
|
||||
export default {
|
||||
name: "menuManagement",
|
||||
components: {
|
||||
addMenu,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "", //弹窗标题
|
||||
menuTableData: [],
|
||||
//multipleSelection: [], //获取当前选中
|
||||
page: 1, // 当前页数
|
||||
pageSize: 20, // 每页数量
|
||||
total: 0, //总条数
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.menuListAll();
|
||||
},
|
||||
methods: {
|
||||
//获取线路列表数据
|
||||
menuListAll() {
|
||||
getMenuListApi()
|
||||
.then((res) => {
|
||||
this.menuTableData = res.data;
|
||||
this.total = res.data.total;
|
||||
})
|
||||
.catch((err) => {});
|
||||
},
|
||||
//点击行选中
|
||||
handleRowClick(row, column, event) {
|
||||
this.$refs.multipleTable.toggleRowSelection(row);
|
||||
},
|
||||
//获取选中的行
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
// 新建
|
||||
handleAdddevice() {
|
||||
this.title = "新增";
|
||||
this.$refs.menuref.display();
|
||||
this.$refs.menuref.getdataform(null);
|
||||
},
|
||||
|
||||
//修改
|
||||
handleResive(data) {
|
||||
this.title = "修改";
|
||||
this.$refs.menuref.display();
|
||||
this.$refs.menuref.getdataform(data);
|
||||
},
|
||||
|
||||
//删除数据
|
||||
handleDelete(data) {
|
||||
console.log(data);
|
||||
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
deleteResourceApi({ id: data.id }).then((res) => {
|
||||
console.log(res.code);
|
||||
if (res.code == 200) {
|
||||
this.$message.success("删除成功");
|
||||
this.menuListAll(); //刷新
|
||||
} else if (res.code == 400) {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
duration: 1500,
|
||||
showClose: true,
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
//点击分页
|
||||
handleCurrentChange(val) {
|
||||
this.page = val;
|
||||
this.menuListAll();
|
||||
},
|
||||
//每页条数
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.menuListAll();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.menumanagement {
|
||||
width: calc(100% - 24px);
|
||||
height: calc(100% - 24px);
|
||||
padding: 12px 12px;
|
||||
background: #fff;
|
||||
|
||||
.deviceBox {
|
||||
border: 1px solid #dddddd;
|
||||
height: calc(100% - 24px);
|
||||
padding: 12px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.deviceBtnGroup {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.deviceTable {
|
||||
margin-top: 16px;
|
||||
height: calc(100% - 48px);
|
||||
//background: #fcc;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
../user/components/blindPermiss.vue./components/addMenu.vue
|
@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="addUserDialog"
|
||||
:title="title"
|
||||
:visible.sync="isShow"
|
||||
:close-on-click-modal="false"
|
||||
width="470px"
|
||||
@close="handleclose"
|
||||
>
|
||||
<el-form
|
||||
label-position="left"
|
||||
ref="formInfo"
|
||||
label-width="100px"
|
||||
:rules="title == '新增' ? rules : xgrules"
|
||||
:model="formdata"
|
||||
>
|
||||
<el-form-item label="角色名称:" prop="name">
|
||||
<el-input
|
||||
placeholder="请输入角色名称"
|
||||
v-model="formdata.name"
|
||||
autocomplete="off"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注:" prop="desc">
|
||||
<el-input
|
||||
placeholder="请输入备注"
|
||||
v-model="formdata.desc"
|
||||
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 { addRole, updateRole } from "@/utils/api/index";
|
||||
export default {
|
||||
props: {
|
||||
title: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
roleUser: "",
|
||||
isShow: false,
|
||||
|
||||
formdata: {},
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入角色名", trigger: "blur" }],
|
||||
},
|
||||
xgrules: {
|
||||
name: [{ required: true, message: "请输入角色名", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//判断
|
||||
getdataform(val) {
|
||||
console.log(val);
|
||||
if (val == null) {
|
||||
return (this.formdata = {
|
||||
name: "",
|
||||
});
|
||||
}
|
||||
//this.formdata = val;
|
||||
this.formdata = JSON.parse(JSON.stringify(val));
|
||||
},
|
||||
// 保存确定操作
|
||||
submitForm() {
|
||||
this.$refs.formInfo.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.title == "新增") {
|
||||
addRole(this.formdata)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
duration: 1500,
|
||||
showClose: true,
|
||||
message: "添加成功",
|
||||
type: "success",
|
||||
});
|
||||
this.isShow = false;
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
} else {
|
||||
updateRole(this.formdata)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success("修改成功");
|
||||
this.isShow = false;
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
display() {
|
||||
this.isShow = true;
|
||||
this.roleUser = localStorage.getItem("role");
|
||||
},
|
||||
hide() {
|
||||
this.isShow = false;
|
||||
},
|
||||
handleclose() {
|
||||
this.$parent.roleListAll();
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.addUserDialog {
|
||||
.el-form-item {
|
||||
.el-input,
|
||||
.el-select,
|
||||
.el-input-number {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,217 @@
|
||||
<template>
|
||||
<div class="rolemanagement">
|
||||
<div class="deviceBox">
|
||||
<div class="deviceBtnGroup">
|
||||
<h4>角色管理</h4>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdddevice()"
|
||||
>新增</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="deviceTable">
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="roleTableData"
|
||||
stripe
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
height="calc(100% - 40px)"
|
||||
@row-click="handleRowClick"
|
||||
>
|
||||
<template slot="empty">
|
||||
<el-empty :image-size="160" description="暂无数据"></el-empty>
|
||||
</template>
|
||||
<el-table-column
|
||||
label="ID"
|
||||
show-overflow-tooltip
|
||||
prop="id"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="角色"
|
||||
show-overflow-tooltip
|
||||
prop="name"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
show-overflow-tooltip
|
||||
prop="desc"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
show-overflow-tooltip
|
||||
prop="createTime"
|
||||
>
|
||||
<template slot-scope="scope" v-if="scope.row.createTime !== null">{{
|
||||
$moment(scope.row.createTime).format("yy-MM-DD HH:mm:ss")
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="200">
|
||||
<template slot-scope="scope" v-if="scope.row.id !== 0">
|
||||
<el-button
|
||||
@click.native.stop="handleResive(scope.row)"
|
||||
type="text"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
@click.native.stop="handleMenuBlind(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>
|
||||
<!-- 新增 -->
|
||||
<addRole :title="title" ref="adduserref"></addRole>
|
||||
<!-- 权限绑定 -->
|
||||
<blindMenuPermiss ref="blindMenuPermissRef"></blindMenuPermiss>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import addRole from "./components/addRole.vue";
|
||||
import blindMenuPermiss from "./components/blindMenuPermiss.vue";
|
||||
import { getRoleList, deleteRole } from "@/utils/api/index";
|
||||
|
||||
export default {
|
||||
name: "roleManagement",
|
||||
components: {
|
||||
addRole,
|
||||
blindMenuPermiss,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "", //弹窗标题
|
||||
roleTableData: [],
|
||||
//multipleSelection: [], //获取当前选中
|
||||
page: 1, // 当前页数
|
||||
pageSize: 20, // 每页数量
|
||||
total: 0, //总条数
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.roleListAll();
|
||||
},
|
||||
methods: {
|
||||
//获取角色数据
|
||||
roleListAll() {
|
||||
getRoleList()
|
||||
.then((res) => {
|
||||
this.roleTableData = res.data;
|
||||
this.total = res.data.total;
|
||||
})
|
||||
.catch((err) => {});
|
||||
},
|
||||
//点击行选中
|
||||
handleRowClick(row, column, event) {
|
||||
this.$refs.multipleTable.toggleRowSelection(row);
|
||||
},
|
||||
//获取选中的行
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
// 新建
|
||||
handleAdddevice() {
|
||||
this.title = "新增";
|
||||
this.$refs.adduserref.display();
|
||||
this.$refs.adduserref.getdataform(null);
|
||||
},
|
||||
|
||||
//修改
|
||||
handleResive(data) {
|
||||
this.title = "修改";
|
||||
this.$refs.adduserref.display();
|
||||
this.$refs.adduserref.getdataform(data);
|
||||
},
|
||||
//菜单资源分配
|
||||
handleMenuBlind(row) {
|
||||
console.log(row);
|
||||
this.$refs.blindMenuPermissRef.display();
|
||||
this.$refs.blindMenuPermissRef.getdataform(row);
|
||||
},
|
||||
|
||||
//删除数据
|
||||
handleDelete(data) {
|
||||
console.log(data);
|
||||
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
deleteRole({ id: data.id }).then((res) => {
|
||||
console.log(res.code);
|
||||
if (res.code == 200) {
|
||||
this.$message.success("删除成功");
|
||||
this.roleListAll(); //刷新
|
||||
} else if (res.code == 400) {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
duration: 1500,
|
||||
showClose: true,
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
//点击分页
|
||||
handleCurrentChange(val) {
|
||||
this.page = val;
|
||||
this.roleListAll();
|
||||
},
|
||||
//每页条数
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.roleListAll();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.rolemanagement {
|
||||
width: calc(100% - 24px);
|
||||
height: calc(100% - 24px);
|
||||
padding: 12px 12px;
|
||||
background: #fff;
|
||||
|
||||
.deviceBox {
|
||||
border: 1px solid #dddddd;
|
||||
height: calc(100% - 24px);
|
||||
padding: 12px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.deviceBtnGroup {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.deviceTable {
|
||||
margin-top: 16px;
|
||||
height: calc(100% - 48px);
|
||||
//background: #fcc;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
../user/components/blindPermiss.vue
|
Loading…
Reference in New Issue