Commit 2929a4e8 authored by dupengyu's avatar dupengyu

数据备份 页面及功能对接完成 时间同步页面完成

parent b936d57d
import request from '@/utils/request'
// 查询分页
export function selectPage(params) {
return request({
url: '/backuprestore/selectPage',
method: 'post',
params
})
}
// 数据备份
export function doBackup(data) {
return request({
url: '/backuprestore/doBackup',
method: 'post',
data
})
}
// 数据恢复
export function restore(params) {
return request({
url: '/backuprestore/restore',
method: 'post',
params
})
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ export const constantRoutes = [
{
path: '/login',
component: () => import('@/views/login/index'),
meta:{title:"登录"},
meta: { title: "登录" },
hidden: true
},
......@@ -26,7 +26,7 @@ export const constantRoutes = [
path: 'dashboard',
name: 'Dashboard',
component: () => import('@/views/dashboard/index'),
meta: { title: '首页', icon: 'homePage'}
meta: { title: '首页', icon: 'homePage' }
}]
},
{
......@@ -46,7 +46,7 @@ export const constantRoutes = [
path: 'device',
name: 'device',
component: () => import('@/views/alarm/device/index'),
meta: { title: '设备连接告警'}
meta: { title: '设备连接告警' }
}
]
},
......@@ -66,35 +66,35 @@ export const constantRoutes = [
{
path: 'statistics',
name: 'settingAtatistics',
component: () => import('@/views/setting/statistics/index'),
meta: { title: '配置信息统计' },
children: [
]
},
{
path: "/detail/",
name: "detail",
beforeEnter: (to, from, next) => {
if (to.query.type==1) {
if (to.query.type == 1) {
to.meta.title = '铁路线详情'
}
else if (to.query.type==2) {
}
else if (to.query.type == 2) {
to.meta.title = '站点详情'
}
else if (to.query.type==3) {
else if (to.query.type == 3) {
to.meta.title = 'FSU详情'
}
else if (to.query.type==4) {
else if (to.query.type == 4) {
to.meta.title = '监测设备详情'
}
else if (to.query.type==5) {
else if (to.query.type == 5) {
to.meta.title = '漏缆详情'
}
else if (to.query.type==6) {
else if (to.query.type == 6) {
to.meta.title = '天馈线详情'
} else{
} else {
to.meta.title = '详情'
}
next()
......@@ -178,6 +178,26 @@ export const constantRoutes = [
meta: { title: '设备连接维修历史' }
}
]
}, {
path: '/system',
component: Layout,
redirect: '/dashboard',
name: '系统管理',
meta: { title: '系统管理', icon: 'system' },
children: [
{
path: 'backups',
name: '数据备份',
component: () => import('@/views/system/backups/index'),
meta: { title: '数据备份' }
},
{
path: 'synchronize',
name: '时间同步',
component: () => import('@/views/system/synchronize/index'),
meta: { title: '时间同步' }
}
]
},
]
......@@ -187,27 +207,27 @@ export const asyncRoutes = [
component: Layout,
redirect: '/dashboard',
name: 'User',
meta: { title: '用户管理', icon: 'user'},
meta: { title: '用户管理', icon: 'user' },
children: [{
path: 'updateUser',
name: 'UpdateUser',
component: () => import('@/views/user/updateUser'),
meta: { title: '个人信息管理',roles: ['admin', 'editor'] },
meta: { title: '个人信息管理', roles: ['admin', 'editor'] },
},
{
path: 'userList',
name: 'UserList',
component: () => import('@/views/user/userList'),
meta: { title: '用户信息列表',roles: ['admin'] },
meta: { title: '用户信息列表', roles: ['admin'] },
},
{
path: 'userLog',
name: 'UserLog',
component: () => import('@/views/user/userLog'),
meta: { title: '用户操作日志', roles: ['admin'] },
}]
},
// 404 page must be placed at the end !!!
......
<template>
<div class="container">
<div class="top-box">
<div class="nav-title">数据备份</div>
<el-button type="primary" @click="handleDoBackup">开始备份</el-button>
</div>
<div class="table" v-loading="loading">
<el-table
:data="tableData"
style="width: 100%"
border
:header-cell-style="{ background: '#f5f7fa', color: '#909399' }"
>
<el-table-column
prop="backupPath"
label="备份文件名"
width=""
></el-table-column>
<el-table-column
prop="backupPath"
label="备份文件路径"
width=""
></el-table-column>
<el-table-column
prop="backupStatus"
label="状态"
width="80"
align="center"
>
<template #default="scope">
<el-tag
:type="scope.row.backupStatus == 1 ? 'success' : 'danger'"
>{{ scope.row.backupStatus == 1 ? "成功" : "失败" }}</el-tag
>
</template>
</el-table-column>
<el-table-column
prop="backupTime"
label="备份时间"
width=""
></el-table-column>
<el-table-column
prop="restoreTime"
label="恢复时间"
width=""
></el-table-column>
<el-table-column prop="name" label="操作" width="180">
<template #default="scope">
<el-button
type="text"
size="small"
@click="handleRestore(scope.row)"
>恢复</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<Pagination
:limit="params.size"
:page="params.current"
:total="total"
class="pagination"
@pagination="handlePageChange"
/>
</div>
</div>
</div>
</template>
<script>
import { selectPage, doBackup, restore } from "@/api/backuprestore";
export default {
data() {
return {
params: {
current: 1,
size: 10,
},
total: 0,
tableData: [],
loading: false,
};
},
mounted() {
this.handleSelectPage();
},
methods: {
handleEdit() {},
// 分页更改
handlePageChange(pageData) {
this.params.size = pageData.size;
this.params.current = pageData.page;
this.handleSelectPage();
},
async handleRestore(row) {
let res = await restore({id:row.id});
this.$message.success("恢复成功");
this.handleSelectPage();
},
async handleDoBackup() {
let res = await doBackup({});
this.$message.success("备份成功");
this.handleSelectPage();
},
async handleSelectPage() {
this.loading = true;
let res = await selectPage(this.params);
this.tableData = res.records;
this.total = res.total;
this.loading = false;
},
handleClick() {
// this.$message.success("开始备份");
},
},
};
</script>
<style lang="scss" scoped>
.top-box {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
.nav-title {
color: #02a7f0;
font-size: 20px;
position: relative;
padding-left: 16px;
font-weight: bold;
line-height: 28px;
}
.nav-title::before {
content: "";
position: absolute;
left: 0px;
top: 1px;
width: 5px;
height: 100%;
background-color: #02a7f0;
border-radius: 4px;
}
}
</style>
\ No newline at end of file
<template>
<div class="container">
<el-tabs type="border-card">
<el-tab-pane label="同步设备">
<div class="top-box">
<div class="nav-title">同步设备</div>
<el-button type="primary" @click="handleClick">开始同步</el-button>
</div>
<div class="table">
<el-table
:data="tableData"
style="width: 100%"
border
:header-cell-style="{ background: '#f5f7fa', color: '#909399' }"
>
<el-table-column
prop="name"
label="设备IP"
width=""
></el-table-column>
<el-table-column
prop="name"
label="设备编号"
width=""
></el-table-column>
<el-table-column
prop="name"
label="站点名称"
width=""
></el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="同步记录">
<div class="top-box">
<div class="nav-title">时间同步记录</div>
<!-- <el-button type="primary" @click="handleClick">开始同步</el-button> -->
</div>
<div class="table">
<el-table
:data="tableData"
style="width: 100%"
border
:header-cell-style="{ background: '#f5f7fa', color: '#909399' }"
>
<el-table-column
prop="name"
label="同步设备"
width=""
></el-table-column>
<el-table-column
prop="name"
label="状态"
width=""
></el-table-column>
<el-table-column
prop="name"
label="同步时间"
width=""
></el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
export default {
data() {
return {
tableData: [],
};
},
methods: {
handleClick() {
this.$message.success("开始备份");
},
},
};
</script>
<style lang="scss" scoped>
.top-box {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
.nav-title {
color: #02a7f0;
font-size: 20px;
position: relative;
padding-left: 16px;
font-weight: bold;
line-height: 28px;
}
.nav-title::before {
content: "";
position: absolute;
left: 0px;
top: 1px;
width: 5px;
height: 100%;
background-color: #02a7f0;
border-radius: 4px;
}
}
</style>
\ No newline at end of file
......@@ -11,20 +11,13 @@ const port = process.env.port || process.env.npm_config_port || 8886 // dev port
const rewriteDefaultConfig = {
changeOrigin: true,
target: 'http://8.142.143.40:8886',
// target: 'http://192.168.0.122:8886',
target: 'http://101.126.159.207:8886',
// target: 'http://192.168.0.127:8886',
// ws: true,
headers: {
referer: 'laddercloud.cn'
},
// onProxyRes: proxyResponse => {
// if (proxyResponse.headers['set-cookie']) {
// const cookies = proxyResponse.headers['set-cookie'].map(cookie =>
// cookie.replace(/; secure/gi, '')
// )
// proxyResponse.headers['set-cookie'] = cookies
// }
// }
}
module.exports = {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment