java后端
@ -1,11 +1,23 @@
|
|||||||
# ---> Vue
|
.DS_Store
|
||||||
# gitignore template for Vue.js projects
|
node_modules
|
||||||
#
|
/dist
|
||||||
# Recommended template: Node.gitignore
|
|
||||||
|
|
||||||
# TODO: where does this rule come from?
|
|
||||||
docs/_book
|
|
||||||
|
|
||||||
# TODO: where does this rule come from?
|
# local env files
|
||||||
test/
|
.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,27 @@
|
|||||||
# ops-fronted-java
|
# ops-fronted
|
||||||
|
|
||||||
java后端的运维
|
运维
|
||||||
|
|
||||||
|
## 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
|
||||||
|
```
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
// module.exports = {
|
||||||
|
// presets: ["@vue/cli-plugin-babel/preset"],
|
||||||
|
// };
|
||||||
|
module.exports = {
|
||||||
|
plugins: ["@babel/plugin-transform-optional-chaining"],
|
||||||
|
};
|
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"module": "esnext",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lib": [
|
||||||
|
"esnext",
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"scripthost"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"name": "operation",
|
||||||
|
"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",
|
||||||
|
"file-saver": "^2.0.5",
|
||||||
|
"moment": "^2.29.4",
|
||||||
|
"postcss-px2rem": "^0.3.0",
|
||||||
|
"px2rem-loader": "^0.1.9",
|
||||||
|
"three": "^0.158.0",
|
||||||
|
"umy-ui": "^1.1.6",
|
||||||
|
"vue": "^2.6.14",
|
||||||
|
"vue-router": "^3.5.1",
|
||||||
|
"vuex": "^3.6.2",
|
||||||
|
"xlsx": "^0.17.5"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.12.16",
|
||||||
|
"@babel/eslint-parser": "^7.12.16",
|
||||||
|
"@babel/plugin-transform-optional-chaining": "^7.24.1",
|
||||||
|
"@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-plugin-vue": "^8.0.3",
|
||||||
|
"less": "^4.0.0",
|
||||||
|
"less-loader": "^7.0.1",
|
||||||
|
"postcss-loader": "^4.3.0",
|
||||||
|
"vue-template-compiler": "^2.6.14"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"plugin:vue/essential",
|
||||||
|
"eslint:recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "@babel/eslint-parser"
|
||||||
|
},
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions",
|
||||||
|
"not dead"
|
||||||
|
]
|
||||||
|
}
|
After Width: | Height: | Size: 7.9 KiB |
@ -0,0 +1,22 @@
|
|||||||
|
<!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>
|
After Width: | Height: | Size: 1.8 MiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 77 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 25 KiB |
@ -0,0 +1,60 @@
|
|||||||
|
<template>
|
||||||
|
<div class="wrapper">
|
||||||
|
<v-head></v-head>
|
||||||
|
<layout-tabs></layout-tabs>
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<div class="content">
|
||||||
|
<!-- <transition name="move" mode="out-in"> -->
|
||||||
|
<keep-alive :include="caches">
|
||||||
|
<router-view v-if="isRenderTab"></router-view>
|
||||||
|
</keep-alive>
|
||||||
|
<!-- </transition> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import vHead from "./header.vue";
|
||||||
|
import LayoutTabs from "./LayoutTabs.vue";
|
||||||
|
import { mapState } from "vuex";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
vHead,
|
||||||
|
LayoutTabs,
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState("cache", ["caches"]),
|
||||||
|
...mapState(["isRenderTab"]),
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.wrapper {
|
||||||
|
min-width: 1366px;
|
||||||
|
color: #333;
|
||||||
|
.content-box {
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
right: 0;
|
||||||
|
top: 92px;
|
||||||
|
bottom: 0;
|
||||||
|
//padding-bottom: 30px;
|
||||||
|
-webkit-transition: left 0.3s ease-in-out;
|
||||||
|
transition: left 0.3s ease-in-out;
|
||||||
|
// background: @background-color-base;
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
//padding: 10px;
|
||||||
|
overflow-y: auto;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,94 @@
|
|||||||
|
<template>
|
||||||
|
<div class="sidebarBox">
|
||||||
|
<ul class="menuBoxUl">
|
||||||
|
<li class="menuItem" v-for="(item, index) in routeItem" :key="index">
|
||||||
|
<router-link :to="item.path"> {{ item.name }} </router-link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
routeItem: [
|
||||||
|
{
|
||||||
|
path: "/home",
|
||||||
|
name: "首页",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/report",
|
||||||
|
name: "状态报表",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/log",
|
||||||
|
name: "日志列表",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/upgradation",
|
||||||
|
name: "上传Apk",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/upgradationOta",
|
||||||
|
name: "上传Ota",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/activity",
|
||||||
|
name: "活动列表",
|
||||||
|
},
|
||||||
|
|
||||||
|
// {
|
||||||
|
// path: "/userlist",
|
||||||
|
// name: "用户列表",
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
methods: {},
|
||||||
|
created() {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.sidebarBox {
|
||||||
|
// width: 55%;
|
||||||
|
// margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.menuBoxUl {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
.menuItem {
|
||||||
|
list-style: none;
|
||||||
|
display: flex;
|
||||||
|
height: 40px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-right: 32px;
|
||||||
|
a {
|
||||||
|
color: #fff;
|
||||||
|
//background: #e8f5f4;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
padding: 0 12px;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 8px;
|
||||||
|
&:hover {
|
||||||
|
background: #128071;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.router-link-active {
|
||||||
|
background: #128071;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,153 @@
|
|||||||
|
<template>
|
||||||
|
<div class="header">
|
||||||
|
<div class="leftLogo">
|
||||||
|
<!-- <img src="../assets/stateGridCorporation.png" /> -->
|
||||||
|
<img src="../assets/logo.png" />
|
||||||
|
<p>运维管理系统</p>
|
||||||
|
</div>
|
||||||
|
<div class="menuBox">
|
||||||
|
<vSidebar></vSidebar>
|
||||||
|
</div>
|
||||||
|
<div class="userInfo">
|
||||||
|
<div class="header-user-con">
|
||||||
|
<!-- 用户头像 -->
|
||||||
|
<div class="user-avator">
|
||||||
|
<!-- <img src="../assets/user.jpeg" /> -->
|
||||||
|
<!-- 显示当前时间 -->
|
||||||
|
<span>{{ $moment(currentTime).format("YYYY-MM-DD HH:mm:ss") }}</span>
|
||||||
|
</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>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import vSidebar from "./Sidebar.vue";
|
||||||
|
// import passwordDialog from "../components/passwordDialog.vue";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
vSidebar,
|
||||||
|
// passwordDialog,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
currentTime: null,
|
||||||
|
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() {
|
||||||
|
this.currentTime = new Date();
|
||||||
|
setInterval(() => {
|
||||||
|
this.currentTime = new Date();
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.header {
|
||||||
|
width: 100%;
|
||||||
|
height: 52px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #169e8c;
|
||||||
|
-webkit-backdrop-filter: blur(0.41667vw);
|
||||||
|
backdrop-filter: blur(0.41667vw);
|
||||||
|
line-height: 52px;
|
||||||
|
padding: 0px 16px;
|
||||||
|
display: flex;
|
||||||
|
.leftLogo {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
img {
|
||||||
|
margin-right: 16px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #fff;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.menuBox {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 0px 32px;
|
||||||
|
}
|
||||||
|
.userInfo {
|
||||||
|
.header-user-con {
|
||||||
|
display: flex;
|
||||||
|
height: 52px;
|
||||||
|
align-items: center;
|
||||||
|
.user-avator {
|
||||||
|
margin-left: 16px;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
overflow: hidden;
|
||||||
|
// img {
|
||||||
|
// display: block;
|
||||||
|
// width: 40px;
|
||||||
|
// height: 40px;
|
||||||
|
// border-radius: 50%;
|
||||||
|
// }
|
||||||
|
span {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.user-name {
|
||||||
|
margin-left: 8px;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
overflow: hidden;
|
||||||
|
.el-dropdown-link {
|
||||||
|
color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select {
|
||||||
|
width: 90px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,53 @@
|
|||||||
|
import Vue from "vue";
|
||||||
|
import App from "./App.vue";
|
||||||
|
import router from "./router";
|
||||||
|
import store from "./store";
|
||||||
|
import ElementUI from "element-ui";
|
||||||
|
import "umy-ui/lib/theme-chalk/index.css"; // 引入样式
|
||||||
|
// import "element-ui/lib/theme-chalk/index.css";
|
||||||
|
import "../src/assets/css/theme/index.css"; //cac主题
|
||||||
|
|
||||||
|
Vue.use(ElementUI, {
|
||||||
|
size: "small",
|
||||||
|
});
|
||||||
|
|
||||||
|
//引入Echarts;
|
||||||
|
import * as echarts from "echarts";
|
||||||
|
Vue.prototype.$echarts = echarts;
|
||||||
|
|
||||||
|
//字体自适应
|
||||||
|
import "./utils/rem";
|
||||||
|
|
||||||
|
//引入日期// 注册全局 moment
|
||||||
|
import moment from "moment";
|
||||||
|
Vue.prototype.$moment = moment;
|
||||||
|
|
||||||
|
//挂载弹出信息
|
||||||
|
import { message } from "@/utils/resetMessage";
|
||||||
|
Vue.prototype.$message = message;
|
||||||
|
|
||||||
|
Vue.config.productionTip = false;
|
||||||
|
//虚拟列表
|
||||||
|
|
||||||
|
import { UTable, UTableColumn } from "umy-ui";
|
||||||
|
Vue.component(UTable.name, UTable);
|
||||||
|
Vue.component(UTableColumn.name, UTableColumn);
|
||||||
|
|
||||||
|
//使用钩子函数对路由进行权限跳转
|
||||||
|
router.beforeEach((to, from, next) => {
|
||||||
|
document.title = `${to.meta.title} | 运维管理系统`;
|
||||||
|
const token = localStorage.getItem("token");
|
||||||
|
if (!token && to.path !== "/login") {
|
||||||
|
next({
|
||||||
|
path: "/login",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
router,
|
||||||
|
store,
|
||||||
|
render: (h) => h(App),
|
||||||
|
}).$mount("#app");
|
@ -0,0 +1,90 @@
|
|||||||
|
import Vue from "vue";
|
||||||
|
import VueRouter from "vue-router";
|
||||||
|
|
||||||
|
Vue.use(VueRouter);
|
||||||
|
|
||||||
|
const routes = [
|
||||||
|
{
|
||||||
|
path: "/login",
|
||||||
|
component: () => import("../views/login/index.vue"),
|
||||||
|
meta: { title: "登录" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/",
|
||||||
|
redirect: "/home",
|
||||||
|
component: () => import("../components/Home.vue"),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "/home",
|
||||||
|
component: () => import("../views/homePage/index.vue"),
|
||||||
|
name: "home",
|
||||||
|
meta: {
|
||||||
|
title: "首页",
|
||||||
|
keepAlive: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/report",
|
||||||
|
component: () => import("../views/report/index.vue"),
|
||||||
|
name: "report",
|
||||||
|
meta: {
|
||||||
|
title: "状态报表",
|
||||||
|
//keepAlive: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/log",
|
||||||
|
component: () => import("../views/logList/index.vue"),
|
||||||
|
name: "log",
|
||||||
|
meta: {
|
||||||
|
title: "日志列表",
|
||||||
|
keepAlive: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/upgradation",
|
||||||
|
component: () => import("../views/upgradation/index.vue"),
|
||||||
|
name: "upgradation",
|
||||||
|
meta: {
|
||||||
|
title: "上传Apk",
|
||||||
|
keepAlive: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/upgradationOta",
|
||||||
|
component: () => import("../views/upgradationOta/index.vue"),
|
||||||
|
name: "upgradationOta",
|
||||||
|
meta: {
|
||||||
|
title: "上传Ota",
|
||||||
|
keepAlive: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/activity",
|
||||||
|
component: () => import("../views/activityList/index.vue"),
|
||||||
|
name: "activity",
|
||||||
|
meta: {
|
||||||
|
title: "活动列表",
|
||||||
|
keepAlive: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/userlist",
|
||||||
|
component: () => import("../views/userList/index.vue"),
|
||||||
|
name: "userList",
|
||||||
|
meta: {
|
||||||
|
title: "用户列表",
|
||||||
|
keepAlive: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const router = new VueRouter({
|
||||||
|
mode: "hash",
|
||||||
|
base: process.env.BASE_URL,
|
||||||
|
routes,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default router;
|
@ -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,20 @@
|
|||||||
|
import Vue from "vue";
|
||||||
|
import Vuex from "vuex";
|
||||||
|
import cacheModule from "./cache";
|
||||||
|
Vue.use(Vuex);
|
||||||
|
|
||||||
|
export default new Vuex.Store({
|
||||||
|
state: {
|
||||||
|
//用户登录token 存储
|
||||||
|
|
||||||
|
isRenderTab: true,
|
||||||
|
},
|
||||||
|
getters: {},
|
||||||
|
mutations: {
|
||||||
|
setIsRenderTab(state, data) {
|
||||||
|
state.isRenderTab = data;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
actions: {},
|
||||||
|
modules: { cache: cacheModule },
|
||||||
|
});
|
@ -0,0 +1,172 @@
|
|||||||
|
import request from "../request";
|
||||||
|
//获取登录
|
||||||
|
export function loginJoggle(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/login.php",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//获取line
|
||||||
|
export function getqueryLineApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/queryLine.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export function getqueryTermsApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/queryTerms.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//获取规约
|
||||||
|
|
||||||
|
export function getqueryProtocolApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/queryProtocol.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//运维,快心跳
|
||||||
|
export function getdoActionApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/doAction.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//上传日志列表
|
||||||
|
export function getqueryUploadsApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/queryUploads.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//删除日志列表
|
||||||
|
export function updUploadApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/updUpload.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取信息装置的信息
|
||||||
|
export function getqueryRawApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/queryRawData.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//带下发状态
|
||||||
|
export function getqueryCmdsApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/queryCmds.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传apk
|
||||||
|
|
||||||
|
export function postuploadFileApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/uploadFile.php",
|
||||||
|
method: "post",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "multipart/form-data", // set the content type to multipart/form-data
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//获取上传列表
|
||||||
|
export function getqueryUpgradesApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/queryUpgrades.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除列表
|
||||||
|
export function getupdUpgradeApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/updUpgrade.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//新建活动和删除活动
|
||||||
|
|
||||||
|
export function updActivityApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/updActivity.php",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "multipart/form-data", // set the content type to multipart/form-data
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取活动列表和详细列表
|
||||||
|
export function getqueryActivityApi(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/queryActivity.php",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updComment(data) {
|
||||||
|
return request({
|
||||||
|
url: "api/updComment.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,309 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
class="cmdMsgDialog"
|
||||||
|
title="历史信息"
|
||||||
|
:visible.sync="isShow"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<div class="cmdBoxMain">
|
||||||
|
<el-table
|
||||||
|
:data="gridData"
|
||||||
|
style="width: 100%"
|
||||||
|
border
|
||||||
|
stripe
|
||||||
|
height="calc(100% - 40px)"
|
||||||
|
v-loading="girdloading"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" label="序号">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="createTime" label="时间"></el-table-column>
|
||||||
|
<el-table-column label="id">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.raw_report.id }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="i1服务器">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.cma
|
||||||
|
}}</span>
|
||||||
|
<span v-else>{{ scope.row.raw_report.msgs.cma }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="心跳间隔" width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.heartbeatDuration
|
||||||
|
}}</span>
|
||||||
|
<span v-else>{{
|
||||||
|
scope.row.raw_report.msgs.heartbeatDuration
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="电池">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.battary
|
||||||
|
}}</span>
|
||||||
|
<span v-else> {{ scope.row.raw_report.msgs.battery }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="电池温度" width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.batteryTmp
|
||||||
|
}}</span>
|
||||||
|
<span v-else>{{ scope.row.raw_report.msgs.batteryTmp }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="主板温度" width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.mainBoardTmp
|
||||||
|
}}</span>
|
||||||
|
<span v-else> {{ scope.row.raw_report.msgs.mainBoardTmp }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="系统重启" width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.rebootTimes
|
||||||
|
}}</span>
|
||||||
|
<span v-else>{{ scope.row.raw_report.msgs.rebootTimes }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="i1重启" width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.i1RebootTimes
|
||||||
|
}}</span>
|
||||||
|
<span v-else>{{ scope.row.raw_report.msgs.i1RebootTimes }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="收" width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.recv
|
||||||
|
}}</span>
|
||||||
|
<span v-else> {{ scope.row.raw_report.msgs.recv }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="传图" width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.pic
|
||||||
|
}}</span>
|
||||||
|
<span v-else> {{ scope.row.raw_report.pic }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="拍" width="60">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.photoTimes
|
||||||
|
}}</span>
|
||||||
|
<span v-else> {{ scope.row.raw_report.msgs.photoTimes }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="成/败/传" width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">
|
||||||
|
{{ scope.row.raw_report.success }}/{{
|
||||||
|
scope.row.raw_report.failure
|
||||||
|
}}/{{ scope.row.raw_report.uploads }}</span
|
||||||
|
>
|
||||||
|
<span v-else>
|
||||||
|
{{ scope.row.raw_report.msgs.success }}/{{
|
||||||
|
scope.row.raw_report.msgs.failure
|
||||||
|
}}/{{ scope.row.raw_report.msgs.uploads }}</span
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="心跳累计" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.numberOfHb
|
||||||
|
}}</span>
|
||||||
|
<span v-else> {{ scope.row.raw_report.msgs.numberOfHb }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="网络异常" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.networkError
|
||||||
|
}}</span>
|
||||||
|
<span v-else>{{ scope.row.raw_report.msgs.networkError }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="信号1" width="60">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.signature1
|
||||||
|
}}</span>
|
||||||
|
<span v-else>{{ scope.row.raw_report.msgs.signature1 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="信号2" width="60">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
||||||
|
scope.row.raw_report.signature2
|
||||||
|
}}</span>
|
||||||
|
<span v-else> {{ scope.row.raw_report.msgs.signature2 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="其他">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.raw_report.msgs.id }}
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
|
||||||
|
<el-table-column prop="content" label="其他" class-name="msgClass">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tooltip
|
||||||
|
:open-delay="600"
|
||||||
|
popper-class="msgTootip"
|
||||||
|
placement="top"
|
||||||
|
effect="light"
|
||||||
|
>
|
||||||
|
<div slot="content">
|
||||||
|
<p v-html="cutout(scope.row)"></p>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
{{ scope.row.content }}
|
||||||
|
</p>
|
||||||
|
</el-tooltip>
|
||||||
|
</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>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getqueryRawApi } from "@/utils/api/index";
|
||||||
|
export default {
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
gridData: [],
|
||||||
|
girdloading: true,
|
||||||
|
isShow: false,
|
||||||
|
page: 1, // 当前页数
|
||||||
|
pageSize: 20, // 每页数量
|
||||||
|
total: 0, //总条数
|
||||||
|
termid: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//tootip提示
|
||||||
|
cutout(cellValue) {
|
||||||
|
var aString = cellValue.content
|
||||||
|
.replace(/\,/g, "</br>")
|
||||||
|
.replace(/{|}/g, "")
|
||||||
|
.replace(/"|"/g, "")
|
||||||
|
.replace(/msg:/g, "");
|
||||||
|
|
||||||
|
return aString;
|
||||||
|
},
|
||||||
|
getQueryList() {
|
||||||
|
this.girdloading = true;
|
||||||
|
getqueryRawApi({
|
||||||
|
termId: this.termid,
|
||||||
|
p: this.page,
|
||||||
|
ps: this.pageSize,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.gridData = res.data;
|
||||||
|
this.total = Number(res.page.totalRecords);
|
||||||
|
this.girdloading = false;
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
},
|
||||||
|
display(val) {
|
||||||
|
this.isShow = true;
|
||||||
|
this.termid = val.id;
|
||||||
|
this.getQueryList();
|
||||||
|
},
|
||||||
|
|
||||||
|
hide() {
|
||||||
|
this.isShow = false;
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.page = val;
|
||||||
|
this.getQueryList();
|
||||||
|
},
|
||||||
|
//每页条数
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.pageSize = val;
|
||||||
|
this.getQueryList();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.cmdMsgDialog {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.el-dialog {
|
||||||
|
width: 95%;
|
||||||
|
height: 83%;
|
||||||
|
margin-top: 0px !important;
|
||||||
|
|
||||||
|
.el-dialog__body {
|
||||||
|
padding: 12px;
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
height: calc(100% - 78px);
|
||||||
|
|
||||||
|
.cmdBoxMain {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.el-table {
|
||||||
|
.el-table__cell {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.msgClass {
|
||||||
|
.cell {
|
||||||
|
p {
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pageNation {
|
||||||
|
margin-top: 10px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.msgTootip {
|
||||||
|
color: #333;
|
||||||
|
overflow: auto;
|
||||||
|
height: 90%;
|
||||||
|
p {
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,158 @@
|
|||||||
|
<template>
|
||||||
|
<div class="logMainClass">
|
||||||
|
<h3>日志列表</h3>
|
||||||
|
<div class="boxLogTable">
|
||||||
|
<el-table
|
||||||
|
v-loading="logLoading"
|
||||||
|
:data="tableData"
|
||||||
|
border
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
height="100%"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" label="序号">
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column prop="id" label="Id" width="80"> </el-table-column> -->
|
||||||
|
<el-table-column prop="line_name" label="线路"> </el-table-column>
|
||||||
|
<el-table-column prop="cmdid" label="装置编号"> </el-table-column>
|
||||||
|
<el-table-column label="规约" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ protocolMap[scope.row.protocol] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="file_name" label="文件名">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<a :href="'/dl/?id=' + scope.row.id" class="buttonText">{{
|
||||||
|
scope.row.file_name
|
||||||
|
}}</a>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="文件大小">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.file_size | changeType }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="create_time" label="上传时间"> </el-table-column>
|
||||||
|
<el-table-column label="操作" class-name="editClass">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDeleteClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getqueryUploadsApi, updUploadApi } from "@/utils/api/index";
|
||||||
|
export default {
|
||||||
|
name: "log",
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableData: [],
|
||||||
|
logLoading: false,
|
||||||
|
protocolMap: {
|
||||||
|
65280: "国网I1",
|
||||||
|
65296: "陕西",
|
||||||
|
65281: "安徽",
|
||||||
|
65282: "江苏",
|
||||||
|
65283: "湖南",
|
||||||
|
65284: "浙江",
|
||||||
|
65285: "河南全景",
|
||||||
|
65286: "河南郑州",
|
||||||
|
65290: "河南统一视频v2020",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
changeType(val) {
|
||||||
|
if (val == "0") return "0B";
|
||||||
|
var k = 1024;
|
||||||
|
var sizes = ["B", "KB", "MB", "GB", "TB"];
|
||||||
|
|
||||||
|
let i = Math.floor(Math.log(val) / Math.log(k)); //得出该数字的单位应该是kB?MB
|
||||||
|
return (val / Math.pow(k, i)).toPrecision(3) + "" + sizes[i];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
this.getLogList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getLogList() {
|
||||||
|
this.logLoading = true;
|
||||||
|
getqueryUploadsApi()
|
||||||
|
.then((res) => {
|
||||||
|
this.tableData = res.data;
|
||||||
|
this.logLoading = false;
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
},
|
||||||
|
handleDeleteClick(row) {
|
||||||
|
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
updUploadApi({
|
||||||
|
act: "del",
|
||||||
|
id: row.id,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "文件删除成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getLogList();
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.logMainClass {
|
||||||
|
height: calc(100% - 24px);
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
padding: 12px;
|
||||||
|
h3 {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxLogTable {
|
||||||
|
height: calc(100% - 36px);
|
||||||
|
background: #fcc;
|
||||||
|
.el-table__cell {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.el-table thead {
|
||||||
|
th.el-table__cell {
|
||||||
|
background: #fafafa;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttonText {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #606266;
|
||||||
|
&:hover {
|
||||||
|
color: #337ab7;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,122 @@
|
|||||||
|
<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="rules"
|
||||||
|
:model="formdata"
|
||||||
|
>
|
||||||
|
<el-form-item label="用户名:" prop="userName">
|
||||||
|
<el-input
|
||||||
|
placeholder="请输入用户名"
|
||||||
|
v-model="formdata.userName"
|
||||||
|
autocomplete="off"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="密码:" prop="password">
|
||||||
|
<el-input
|
||||||
|
placeholder="请输入密码"
|
||||||
|
v-model="formdata.password"
|
||||||
|
show-password
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注:" prop="notesNewVal">
|
||||||
|
<el-input
|
||||||
|
placeholder="请输入备注"
|
||||||
|
v-model="formdata.notesNewVal"
|
||||||
|
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 { addUserApi, updateUserApi } from "@/utils/api/index";
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
title: String,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
roleUser: "",
|
||||||
|
isShow: false,
|
||||||
|
roleoptions: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: "管理员",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: "用户",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
formdata: {},
|
||||||
|
rules: {
|
||||||
|
userName: [
|
||||||
|
{ required: true, message: "请输入用户名", trigger: "blur" },
|
||||||
|
],
|
||||||
|
|
||||||
|
password: [
|
||||||
|
{ required: true, message: "请输入密码", trigger: "blur" },
|
||||||
|
// { min: 6, max: 8, message: "请输入6-8位字符", trigger: "blur" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//判断
|
||||||
|
getdataform(val) {
|
||||||
|
console.log(val);
|
||||||
|
},
|
||||||
|
// 保存确定操作
|
||||||
|
submitForm() {
|
||||||
|
this.$refs.formInfo.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.title == "新增") {
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("error submit!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
display() {
|
||||||
|
this.isShow = true;
|
||||||
|
this.roleUser = localStorage.getItem("role");
|
||||||
|
},
|
||||||
|
hide() {
|
||||||
|
this.isShow = false;
|
||||||
|
},
|
||||||
|
handleclose() {
|
||||||
|
//this.$parent.deviceList();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.addUserDialog {
|
||||||
|
.el-form-item {
|
||||||
|
.el-input,
|
||||||
|
.el-select,
|
||||||
|
.el-input-number {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,143 @@
|
|||||||
|
<template>
|
||||||
|
<div class="userbox">
|
||||||
|
<el-button
|
||||||
|
class="addBtn"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="handleAdddevice()"
|
||||||
|
>新建用户</el-button
|
||||||
|
>
|
||||||
|
<div class="usercontain">
|
||||||
|
<el-table
|
||||||
|
v-loading="logLoading"
|
||||||
|
:data="userData"
|
||||||
|
border
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
height="100%"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" label="序号">
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="name" label="用户名"> </el-table-column>
|
||||||
|
<el-table-column prop="mark" label="备注"> </el-table-column>
|
||||||
|
<el-table-column prop="updateTime" label="创建时间"> </el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" class-name="editClass">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="handleSetClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-setting"
|
||||||
|
>设置权限</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="handleEditClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-document"
|
||||||
|
>修改</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDeleteClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<addEditDialog :title="title" ref="adduserref"></addEditDialog>
|
||||||
|
<setPermission ref="setpermissionRef"></setPermission>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
// import { getqueryUploadsApi } from "@/utils/api/index";
|
||||||
|
import addEditDialog from "./components/addEditDialog.vue";
|
||||||
|
import setPermission from "./components/setPermission.vue";
|
||||||
|
export default {
|
||||||
|
name: "userlist",
|
||||||
|
components: {
|
||||||
|
addEditDialog,
|
||||||
|
setPermission,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: "", //弹窗标题
|
||||||
|
page: 1, // 当前页数
|
||||||
|
pageSize: 20, // 每页数量
|
||||||
|
total: 0, //总条数
|
||||||
|
logLoading: false,
|
||||||
|
userData: [
|
||||||
|
{ name: "用户1", mark: "xxxxx", updateTime: "2023-12-25 10:20:30" },
|
||||||
|
{ name: "用户2", mark: "xxxxx", updateTime: "2023-12-25 10:20:30" },
|
||||||
|
{ name: "用户3", mark: "xxxxx", updateTime: "2023-12-25 10:20:30" },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {},
|
||||||
|
created() {},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
//新增用户
|
||||||
|
handleAdddevice() {
|
||||||
|
this.title = "修改";
|
||||||
|
this.$refs.adduserref.display();
|
||||||
|
this.$refs.adduserref.getdataform(data);
|
||||||
|
},
|
||||||
|
//设置权限
|
||||||
|
handleSetClick(data) {
|
||||||
|
this.$refs.setpermissionRef.display(data);
|
||||||
|
},
|
||||||
|
//修改用户
|
||||||
|
handleEditClick() {
|
||||||
|
this.title = "修改";
|
||||||
|
this.$refs.adduserref.display();
|
||||||
|
this.$refs.adduserref.getdataform(data);
|
||||||
|
},
|
||||||
|
//删除用户
|
||||||
|
handleDeleteClick() {
|
||||||
|
this.$confirm("确定要删除该用户?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.userbox {
|
||||||
|
height: calc(100% - 24px);
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
padding: 12px;
|
||||||
|
.addBtn {
|
||||||
|
display: flex;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.usercontain {
|
||||||
|
height: calc(100% - 44px);
|
||||||
|
background: #fcc;
|
||||||
|
.el-table__cell {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.el-table thead {
|
||||||
|
th.el-table__cell {
|
||||||
|
background: #fafafa;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.editClass {
|
||||||
|
.el-link.el-link--primary {
|
||||||
|
margin-right: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|