Compare commits

...

5 Commits

30 changed files with 376 additions and 257 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,22 +19,44 @@ export const resetReboot = data => {
return axios.post('api/SetReboot', data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); return axios.post('api/SetReboot', data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } });
}; };
// 关于本机备份配置 // // 关于本机备份配置
export const ConfigBackup = () => { // export const ConfigBackup = () => {
return axios.post('api/ConfigBackup', { headers: { 'Content-Type': 'application/json' } }); // return axios.post('api/ConfigBackup', { headers: { 'Content-Type': 'application/json' } });
}; // };
// 还原服务器设置 // 还原服务器设置
export const ConfigRestore = () => { // export const ConfigRestore = () => {
return axios.post('api/ConfigRestore'); // return axios.post('api/ConfigRestore');
}; // };
// 还原服务器出厂设置 // 还原服务器出厂设置
export const ResetFactory = () => { export const initData = () => {
return axios.post('api/ResetFactory', { headers: { 'Content-Type': 'application/json' } }); return axios.get('api/InitData', { headers: { 'Content-Type': 'application/json' } });
}; };
// 重新启动接口
export const RestartComputer = ()=>{
return axios.get('api/RestartComputer')
}
// 更新服务器版本
export const update = (data,params)=>{
return axios.post('api/Update',data,{
params,
headers:{'Content-Type': 'multipart/form-data' }
})
}
// 备份服务器设置
export const configBackup = () =>{
return axios.get('api/ConfigBackup')
}
// 还原服务器设置
export const configRestore = (data,params)=>{
return axios.post('api/ConfigRestore',data,{
params,
headers:{'Content-Type': 'multipart/form-data' }
})
}

View File

@ -23,3 +23,10 @@ export const getTongzrzDetailsApi = params => {
params params
}); });
}; };
//根据文件名下载文件
export const downFile = (params) =>{
return axios.get('api/GetTongzrzDetails',{
params
})
}

View File

@ -9,3 +9,9 @@ export const getUserApi = params => {
return axios.get(`api/GetZhanghDetails?UserId=${params}`, {}); return axios.get(`api/GetZhanghDetails?UserId=${params}`, {});
}; };
//修改密码 //修改密码
export const updatePassword = data=>{
return axios.post('api/ChangePassword',data,{
headers:{'Content-Type': 'multipart/form-data' }
})
}

View File

@ -23,8 +23,8 @@ export default {
editFigure: 'http://172.16.1.168:5000/api/EditTuxmc', editFigure: 'http://172.16.1.168:5000/api/EditTuxmc',
//编辑保存组件弹窗传参 //编辑保存组件弹窗传参
setHostName: 'http://172.16.1.168:5000/api/SetHostName', setHostName: 'http://172.16.1.168:5000/api/SetHostName',
setHostTime: 'http://172.16.1.168:5000/api/SetHostTime' setHostTime: 'http://172.16.1.168:5000/api/SetHostTime',
// changePassowrd:'http://172.16.1.168:5000/api/ChangePassword'
// `http://${ipUurl}:5000/api/AddShipjk` // `http://${ipUurl}:5000/api/AddShipjk`
// dataUrl: `http://${ipUurl}:5000/api/AddShipjk`, // dataUrl: `http://${ipUurl}:5000/api/AddShipjk`,
// getSpareElementOrder: `http://${ipUurl}:5000/api/Upload`, // getSpareElementOrder: `http://${ipUurl}:5000/api/Upload`,

View File

@ -66,10 +66,13 @@ export default {
Account:this.param.username, Account:this.param.username,
Password:this.param.password, Password:this.param.password,
}).then(res => { }).then(res => {
console.log('c', res); console.log('cxx', res);
if(res.data.code==200){ if(res.data.code==200){
this.$message.success('登录成功'); this.$message.success('登录成功');
localStorage.setItem('ms_username', this.param.username); localStorage.setItem('ms_username', this.param.username);
localStorage.setItem('userId', res.data.data.userId);
// console.log(localStorage.getItem('userId'));
this.$router.push('/'); this.$router.push('/');
}else{ }else{
this.$message({ this.$message({

View File

@ -266,15 +266,6 @@ export default {
}, },
mounted() { }, mounted() { },
watch: { watch: {
// acticveName: {
// handler(newVal) {
// if (newVal != 'second') {
// //
// this.classify = []
// }
// }
// },
// //
triggerData: { triggerData: {
handler(newVal, oldVal) { }, handler(newVal, oldVal) { },
@ -478,7 +469,7 @@ export default {
// console.log(item.component_id, 'component_id'); // console.log(item.component_id, 'component_id');
if (ele.trigger.length == 10) { if (ele.trigger.length == 10) {
ele.trigger.pop(); ele.trigger.pop();
} else { }
if(this.$route.query.type=='离线视频'){ if(this.$route.query.type=='离线视频'){
var timeNew = item.time.split('.')[0] var timeNew = item.time.split('.')[0]
var dateLength = timeNew.length; var dateLength = timeNew.length;
@ -523,7 +514,7 @@ export default {
} }
}) })
}
} }
}); });
}); });
@ -535,7 +526,7 @@ export default {
cycleTimeData: { cycleTimeData: {
handler(newVal) { handler(newVal) {
// //
console.log(newVal, '周期时刻数据'); // console.log(newVal, '');
if (newVal != undefined && newVal.length != 0 && this.sectionData) { if (newVal != undefined && newVal.length != 0 && this.sectionData) {
var thatN = this; var thatN = this;
@ -544,9 +535,11 @@ export default {
newVal.forEach(item => { newVal.forEach(item => {
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '周期时刻') { if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '周期时刻') {
if (ele.cycleTimeData.length == 10) { if (ele.cycleTimeData.length == 10) {
ele.cycleTimeData.pop(); ele.cycleTimeData.pop();
} else {
}
// item.time = item.time.split('.')[0]; // item.time = item.time.split('.')[0];
// if(this.$route.query.type=='线'){ // if(this.$route.query.type=='线'){
// var timeNew = item.time.split('.')[0] // var timeNew = item.time.split('.')[0]
@ -561,6 +554,7 @@ export default {
thatN.typeCycleTimeData = item; thatN.typeCycleTimeData = item;
} }
ele.cycleTimeData.unshift(item); ele.cycleTimeData.unshift(item);
// thatN.$nextTick(() => { // thatN.$nextTick(() => {
if (thatN.$refs.typeChartRef1 != undefined) { if (thatN.$refs.typeChartRef1 != undefined) {
// console.log("thatN.$refs.typeChartRef1",thatN.$refs.typeChartRef1) // console.log("thatN.$refs.typeChartRef1",thatN.$refs.typeChartRef1)
@ -592,7 +586,7 @@ export default {
} }
} }
} }
}
// }); // });
} }
@ -607,7 +601,7 @@ export default {
if (ele.timeMode == '周期时刻') { if (ele.timeMode == '周期时刻') {
if (ele.cycleTimeData.length == 10) { if (ele.cycleTimeData.length == 10) {
ele.cycleTimeData.pop(); ele.cycleTimeData.pop();
} else { }
// item.time = item.time.split('.')[0]; // item.time = item.time.split('.')[0];
// if (item.type_data != null) { // if (item.type_data != null) {
// // // //
@ -643,7 +637,7 @@ export default {
if (itemTypeChartRef1.componentName.includes('OD') && itemTypeChartRef1.$refs.ODChartRef != undefined && itemTypeChartRef1.dataArr[0].ob_data.length != 0) { if (itemTypeChartRef1.componentName.includes('OD') && itemTypeChartRef1.$refs.ODChartRef != undefined && itemTypeChartRef1.dataArr[0].ob_data.length != 0) {
itemTypeChartRef1.$refs.ODChartRef.drawThermalChart(itemTypeChartRef1.dataArr[0].ob_data, itemTypeChartRef1.startEndData) itemTypeChartRef1.$refs.ODChartRef.drawThermalChart(itemTypeChartRef1.dataArr[0].ob_data, itemTypeChartRef1.startEndData)
} }
}
} }
} }
@ -659,7 +653,7 @@ export default {
// //
cycleStatisticsData: { cycleStatisticsData: {
handler(newVal) { handler(newVal) {
console.log("newVal", newVal) console.log("周期统计", newVal)
if (newVal != undefined && newVal.length != 0 && this.sectionData) { if (newVal != undefined && newVal.length != 0 && this.sectionData) {
var that = this; var that = this;
that.classify.forEach((ele, index) => { that.classify.forEach((ele, index) => {
@ -667,7 +661,7 @@ export default {
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '周期统计') { if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '周期统计') {
if (ele.cycleStatisticsData.length == 10) { if (ele.cycleStatisticsData.length == 10) {
ele.cycleStatisticsData.pop(); ele.cycleStatisticsData.pop();
} else { }
if(this.$route.query.type=='离线视频'){ if(this.$route.query.type=='离线视频'){
var timeNew = item.time.split('.')[0] var timeNew = item.time.split('.')[0]
@ -711,7 +705,7 @@ export default {
} }
} }
}
} }
} }
@ -726,7 +720,7 @@ export default {
if (ele.timeMode == '周期统计') { if (ele.timeMode == '周期统计') {
if (ele.cycleStatisticsData.length == 10) { if (ele.cycleStatisticsData.length == 10) {
ele.cycleStatisticsData.pop(); ele.cycleStatisticsData.pop();
} else { }
// item.time = item.time.split('.')[0]; // item.time = item.time.split('.')[0];
// if (item.type_data != null) { // if (item.type_data != null) {
// _that.typeCycleStatistics = item; // _that.typeCycleStatistics = item;
@ -763,7 +757,7 @@ export default {
} }
} }
}
} }
} }

View File

@ -64,7 +64,7 @@
</template> </template>
<script> <script>
import { getHostInfoApi, resetReboot, ConfigBackup, ConfigRestore, ResetFactory } from '../../api/aboutMachine'; import { getHostInfoApi, initData, configBackup,configRestore, ResetFactory,RestartComputer } from '../../api/aboutMachine';
import { getQuanjszData } from '../../api/index'; import { getQuanjszData } from '../../api/index';
import serverUrl from '../../config/apiurl.js'; import serverUrl from '../../config/apiurl.js';
import { setQuanjsz } from '@/api/index'; import { setQuanjsz } from '@/api/index';
@ -170,9 +170,9 @@ export default {
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
resetReboot() RestartComputer()
.then(res => { .then(res => {
console.log(res); console.log(res,'重启启动的接口');
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
}) })
.catch(err => { .catch(err => {
@ -186,7 +186,7 @@ export default {
}); });
}); });
}, },
// //
backupHandle() { backupHandle() {
this.$confirm('此操作将备份操作, 是否继续?', '提示', { this.$confirm('此操作将备份操作, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -194,7 +194,7 @@ export default {
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
ConfigBackup().then(res => { configBackup().then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '备份' + res.data.msg message: '备份' + res.data.msg
@ -247,11 +247,10 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => {
// //
ResetFactory().then(res => { initData().then(res => {
// console.log(res.data,''); console.log(res.data,'出厂默认设置');
this.$message({ this.$message({
type: 'success', type: 'success',
message: '重置' + res.data.msg message: '重置' + res.data.msg

View File

@ -4,11 +4,7 @@
<p class="title">通知/日志</p> <p class="title">通知/日志</p>
<el-form ref="form" :model="formData" label-width="100px" style="display:flex"> <el-form ref="form" :model="formData" label-width="100px" style="display:flex">
<el-form-item label="日期:"> <el-form-item label="日期:">
<el-date-picker <el-date-picker v-model="formData.value1" type="daterange" range-separator="" start-placeholder="开始日期"
v-model="formData.value1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -26,9 +22,23 @@
</el-form> </el-form>
<el-table :data="tableData" :height="tableHeight" border style="width: 100%"> <el-table :data="tableData" :height="tableHeight" border style="width: 100%">
<!-- <el-table-column align="center" prop="notificationType" label="通知类型" width="180"></el-table-column> --> <!-- <el-table-column align="center" prop="notificationType" label="通知类型" width="180"></el-table-column> -->
<el-table-column align="center" prop="journalTime" label="日期" width="180"></el-table-column> <el-table-column align="center" prop="logDate" label="日期" width="180"></el-table-column>
<!-- <el-table-column show-overflow-tooltip align="center" prop="content" label="内容"></el-table-column> --> <!-- <el-table-column show-overflow-tooltip align="center" prop="content" label="内容"></el-table-column> -->
<el-table-column show-overflow-tooltip align="center" prop="content" label="下载"></el-table-column> <el-table-column show-overflow-tooltip align="center" label="下载">
<template slot-scope="scope">
<div class="downBox" v-if="scope.row.content.includes(',')">
<span @click="downloadFile(scope.row.path.split(',')[0])">
{{ scope.row.content.split(',')[0] }}
</span>
<span @click="downloadFile(scope.row.path.split(',')[1])">
{{ scope.row.content.split(',')[1] }}
</span>
</div>
<div class="downBox" v-else>
<span @click="downloadFile(scope.row.path)">{{ scope.row.content }}</span>
</div>
</template>
</el-table-column>
<!-- <el-table-column align="center" label="操作" width="160"> <!-- <el-table-column align="center" label="操作" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="showView(scope.row)" type="text" size="small">详情</el-button> <el-button @click="showView(scope.row)" type="text" size="small">详情</el-button>
@ -37,19 +47,13 @@
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<el-pagination <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
@size-change="handleSizeChange" :current-page.sync="currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="pageSize"
@current-change="handleCurrentChange" layout="sizes, total,prev, pager, next" :total="totalNumber" style="padding-top: 10px;">
:current-page.sync="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
layout="sizes, total,prev, pager, next"
:total="totalNumber"
style="padding-top: 10px;"
>
</el-pagination> </el-pagination>
<el-dialog :title="concetData.notificationType" :visible.sync="dialogVisible" width="30%" @close="notificClosed"> <el-dialog :title="concetData.notificationType" :visible.sync="dialogVisible" width="30%"
@close="notificClosed">
<span>{{ concetData.content }}</span> <span>{{ concetData.content }}</span>
</el-dialog> </el-dialog>
</div> </div>
@ -57,7 +61,7 @@
</template> </template>
<script> <script>
import { getTongzrzApi, deleteTongzrzApi, getTongzrzDetailsApi } from '@/api/logs'; import { downFile, getTongzrzApi, deleteTongzrzApi, getTongzrzDetailsApi } from '@/api/logs';
import moment from 'moment'; import moment from 'moment';
export default { export default {
data() { data() {
@ -96,12 +100,38 @@ export default {
created() { created() {
let windowHeight = document.documentElement.clientHeight || document.body.clientHeight; let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
this.tableHeight = windowHeight - 270; this.tableHeight = windowHeight - 270;
},
mounted() {
this.setTimes(); this.setTimes();
this.getData(); this.getData();
},
mounted() {
},
computed: {
}, },
methods: { methods: {
//
downloadFile(file) {
// console.log(data,'');
// console.log(file);
//
// downFile({'filepath':file}).then(res=>{
// })
// console.log(window.location.origin);
var url = window.location.origin + '/api/GetTongzrzDetails?filepath=' + file
// console.log(url, '');
const a = document.createElement('a')
a.href = url
a.download = file //
a.style.display = 'none'
document.body.appendChild(a)
a.click() //
document.body.removeChild(a)
},
setTimes() { setTimes() {
let arr = []; let arr = [];
// //
@ -110,7 +140,7 @@ export default {
let i = moment(s) let i = moment(s)
.subtract(2, 'days') .subtract(2, 'days')
.format('YYYY-MM-DD'); .format('YYYY-MM-DD');
arr = [s, i]; arr = [i, s];
this.formData.value1 = arr; this.formData.value1 = arr;
this.$forceUpdate(); this.$forceUpdate();
}, },
@ -166,22 +196,28 @@ export default {
// //
lookForMessage() { lookForMessage() {
this.currentPage = 1; this.currentPage = 1;
for (let i = 0; i < this.formData.value1.length; i++) {
this.formData.value1[i] = moment(this.formData.value1[i]).format('YYYY-MM-DD')
}
// console.log(this.formData.value1);
this.getData(); this.getData();
}, },
// //
getData() { getData() {
getTongzrzApi({ getTongzrzApi({
Content: this.formData.content, // Content: this.formData.content,
Type: this.formData.notificationType, // Type: this.formData.notificationType,
CurrentPage: this.currentPage, // CurrentPage: this.currentPage,
PageSize: this.pageSize, // PageSize: this.pageSize,
StartTime: this.formData.value1.length > 0 ? this.formData.value1[0] : '', StartTime: this.formData.value1.length > 0 ? this.formData.value1[0] : '',
EndTime: this.formData.value1.length > 0 ? this.formData.value1[1] : '' EndTime: this.formData.value1.length > 0 ? this.formData.value1[1] : ''
}) })
.then(res => { .then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
this.tableData = res.data.data.data; // console.log(res.data.data);
this.totalNumber = res.data.data.total; this.tableData = res.data.data;
this.totalNumber = res.data.data.length;
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
@ -201,6 +237,10 @@ export default {
this.currentPage = val; this.currentPage = val;
this.getData(); this.getData();
} }
},
watch: {
} }
}; };
</script> </script>
@ -209,4 +249,8 @@ export default {
.test-div i { .test-div i {
font-size: 25px; font-size: 25px;
} }
.downBox span {
cursor: pointer;
}
</style> </style>

View File

@ -16,7 +16,17 @@
<el-button @click="editPassword" slot="prepend" size="small" type="primary">修改密码</el-button> <el-button @click="editPassword" slot="prepend" size="small" type="primary">修改密码</el-button>
</div> </div>
<el-dialog title="修改密码" :visible.sync="dialogVisible" width="30%" @close="dialogClosed"> <el-dialog title="修改密码" :visible.sync="dialogVisible" width="30%" @close="dialogClosed">
<el-input v-model="password"></el-input> <el-form label-width="auto" :model="userData">
<el-form-item label="账号" aria-disabled="true">
<el-input type="test" :disabled="true" v-model="userData.Account"></el-input>
</el-form-item>
<el-form-item label="原密码">
<el-input type="password" v-model="userData.oldPassword"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input type="password" v-model="userData.newPassword"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="savePassword">确定</el-button> <el-button type="primary" @click="savePassword">确定</el-button>
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
@ -26,42 +36,45 @@
</template> </template>
<script> <script>
import { getUserApi } from '@/api/myld.js'; import { getUserApi, updatePassword } from '@/api/myld.js';
import serverUrl from '@/config/apiurl.js'; import serverUrl from '@/config/apiurl.js';
import axios from 'axios'; import axios from 'axios';
export default { export default {
data() { data() {
return { return {
password: '',
dialogVisible: false, dialogVisible: false,
formLabelAlign: { formLabelAlign: {
userName: '', userName: '',
account: '', account: '',
password: '' password: ''
},
userData: {
Account: '',
oldPassword: '',
newPassword: '',
} }
}; };
}, },
mounted() {
this.getUser();
},
methods: { methods: {
dialogClosed() { dialogClosed() {
this.password = ''; this.password = '';
}, },
mounted() {
this.getUser();
},
// //
savePassword() { savePassword() {
// console.log(serverUrl);
let formData = new FormData(); let formData = new FormData();
formData.append('userName', this.formLabelAlign.userName); console.log(this.userData);
formData.append('account', this.formLabelAlign.account); formData.append('Account', this.userData.Account);
formData.append('roleId', this.formLabelAlign.roleId); formData.append('OldPassword', this.userData.oldPassword);
formData.append('IsEnable', 1); formData.append('NewPassword', this.userData.newPassword);
formData.append('passWord', this.password); console.log(formData, '数据');
formData.append('userId', this.formLabelAlign.userId);
axios({ updatePassword(formData).then(res => {
method: 'post', console.log(res, '修改状态');
url: serverUrl.editRoleApi,
data: formData
}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message({ this.$message({
message: res.data.msg, message: res.data.msg,
@ -69,27 +82,57 @@ export default {
}); });
this.dialogVisible = false; this.dialogVisible = false;
this.$router.push('/Login'); this.$router.push('/Login');
this.getUser(); // this.getUser();
} else { } else {
this.$message({ this.$message({
message: res.data.msg, message: res.data.msg,
type: 'warning' type: 'warning'
}); });
} }
}); })
// formData.append('IsEnable', 1);
// formData.append('passWord', this.password);
// formData.append('userId', this.formLabelAlign.userId);
// axios({
// method: 'post',
// url: serverUrl.editRoleApi,
// data: formData
// }).then(res => {
// if (res.data.code == 200) {
// this.$message({
// message: res.data.msg,
// type: 'success'
// });
// this.dialogVisible = false;
// this.$router.push('/Login');
// this.getUser();
// } else {
// this.$message({
// message: res.data.msg,
// type: 'warning'
// });
// }
// });
}, },
editPassword() { editPassword() {
this.dialogVisible = true; this.dialogVisible = true;
}, },
getUser() { getUser() {
if (window.localStorage.getItem('user')) { // console.log(window.localStorage.getItem('userId'),'id');
let form = JSON.parse(window.localStorage.getItem('user')); if (window.localStorage.getItem('userId')) {
getUserApi(form.userId) let userId = window.localStorage.getItem('userId');
// console.log(form,'');
getUserApi(userId)
.then(res => { .then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
// console.log(res.data);
this.formLabelAlign = res.data.data; this.formLabelAlign = res.data.data;
this.formLabelAlign.password = '******'; this.formLabelAlign.password = '******';
console.log(this.formLabelAlign); this.userData.Account = this.formLabelAlign.account
// console.log(this.formLabelAlign);
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }

View File

@ -70,6 +70,7 @@ module.exports = {
// '^/aps':'', // '^/aps':'',
// } // }
// } // }
} }
} }
} }