master
fanluyan 1 year ago
parent 9565047050
commit 9982e73ea0

@ -1,9 +1,9 @@
<template>
<div class="sidebarBox">
<ul class="menuBoxUl">
<li class="menuItem" @click="linkHome()">
<!-- <li class="menuItem" @click="linkHome()">
<a>首页</a>
</li>
</li> -->
<li class="menuItem" v-for="(item, index) in routeItem" :key="index">
<router-link :to="item.path"> {{ item.name }} </router-link>
</li>
@ -18,10 +18,10 @@ export default {
hostName: "",
isProduction: "",
routeItem: [
// {
// path: "/home",
// name: "",
// },
{
path: "/home",
name: "首页",
},
{
path: "/dataReport",
name: "数据报表",

@ -4,24 +4,24 @@ import VueRouter from "vue-router";
Vue.use(VueRouter);
const routes = [
// {
// path: "/login",
// component: () => import("../views/login/index.vue"),
// meta: { title: "登录" },
// },
{
path: "/login",
component: () => import("../views/login/index.vue"),
meta: { title: "登录" },
},
{
path: "/",
redirect: "/dataReport",
component: () => import("../components/Home.vue"),
children: [
// {
// path: "/home",
// component: () => import("../views/homePage/index.vue"),
// name: "homepage",
// meta: {
// title: "首页",
// },
// },
{
path: "/home",
component: () => import("../views/homePage/index.vue"),
name: "homepage",
meta: {
title: "首页",
},
},
{
path: "/dataReport",
component: () => import("../views/dataReport/index.vue"),

@ -1,4 +1,13 @@
import request from "../request";
//
export function getloginApi(data) {
return request({
url: "/user/login",
method: "get",
data,
});
}
//获取新的树结构
export function getTreeApi(data) {
return request({

@ -76,6 +76,17 @@
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-select v-model="formdata.dayValue" placeholder="请选择">
<el-option
v-for="item in dayOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" class="searchBtn" @click="handleSearch"
>查询</el-button
@ -162,6 +173,7 @@
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
:page-sizes="[20, 40, 100]"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
>
@ -218,7 +230,31 @@ export default {
label: "name",
key: "compositeKey", // 使 uniqueKey
},
formdata: {}, //form
formdata: {
dayValue: 4,
}, //form
dayOptions: [
{
value: -1,
label: "全部数据",
},
{
value: 1,
label: "每日最多1条",
},
{
value: 2,
label: "每日最多2条",
},
{
value: 4,
label: "每日最多4条",
},
{
value: 6,
label: "每日最多6条",
},
],
activeName: "dataTab",
tableLoading: false, //loading
checkAll: true, //
@ -495,6 +531,7 @@ export default {
if (this.tabName == "dataTab") {
this.getDetailTable(
this.currentId,
this.formdata.dayValue,
this.formdata.starttime,
this.formdata.endtime
);
@ -507,11 +544,12 @@ export default {
}
},
//
getDetailTable(id, stime, eTime) {
getDetailTable(id, dayval, stime, eTime) {
console.log(id, stime, eTime);
this.tableLoading = true;
getDetailApi({
id: id,
numPerDay: dayval,
startTime: stime,
endTime: eTime,
pageNum: this.page,
@ -578,6 +616,13 @@ export default {
this.formdata.starttime,
this.formdata.endtime
);
} else {
this.getDetailTable(
this.currentId,
this.formdata.dayValue,
this.formdata.starttime,
this.formdata.endtime
);
}
},
//
@ -591,6 +636,8 @@ export default {
window.location.href =
"/cac-api/nsensor/export?id=" +
this.currentId +
"&numPerDay=" +
this.formdata.dayValue +
"&startTime=" +
this.formdata.starttime +
"&endTime=" +
@ -620,13 +667,15 @@ export default {
window.location.href =
"/cac-api/nsensor/export?id=" +
this.currentId +
"&numPerDay=" +
this.formdata.dayValue +
"&startTime=" +
this.formdata.starttime +
"&endTime=" +
this.formdata.endtime +
"&pageNum=" +
this.page +
"&pageSizee=" +
"&pageSize=" +
this.pageSize;
},
//
@ -635,6 +684,7 @@ export default {
this.tableData = [];
this.getDetailTable(
this.currentId,
this.formdata.dayValue,
this.formdata.starttime,
this.formdata.endtime
);
@ -645,6 +695,7 @@ export default {
this.tableData = [];
this.getDetailTable(
this.currentId,
this.formdata.dayValue,
this.formdata.starttime,
this.formdata.endtime
);

@ -41,6 +41,8 @@
<script>
import * as THREE from "three";
import threejs from "./threejs";
import { getloginApi } from "@/utils/api/index";
export default {
components: {
threejs,
@ -69,49 +71,50 @@ export default {
this.$refs.loginForm.validate((valid) => {
if (valid) {
console.log(this.userInfo);
if (
(this.userInfo.userName == "admin" &&
this.userInfo.password == "shxy123456") ||
(this.userInfo.userName == "cacuser" &&
this.userInfo.password == "cac123456")
) {
localStorage.setItem("token", "13747c96ff9f434cb09ecf78e4b9a8bc");
this.$message({
duration: 1500,
showClose: true,
message: "登录成功",
type: "success",
});
this.$router.push("/");
return;
} else {
this.$message({
duration: 1500,
showClose: true,
message: "账号密码错误,请重新输入!",
type: "warning",
});
return;
}
// if (
// (this.userInfo.userName == "admin" &&
// this.userInfo.password == "shxy123456") ||
// (this.userInfo.userName == "cacuser" &&
// this.userInfo.password == "cac123456")
// ) {
// localStorage.setItem("token", "13747c96ff9f434cb09ecf78e4b9a8bc");
// this.$message({
// duration: 1500,
// showClose: true,
// message: "",
// type: "success",
// });
// this.$router.push("/");
// return;
// } else {
// this.$message({
// duration: 1500,
// showClose: true,
// message: "",
// type: "warning",
// });
// return;
// }
//
// loginJoggle(this.userInfo)
// .then((res) => {
// if (res.code == 200) {
// this.$store.commit("SET_TOKEN", res.data.sessionId); //tokenvuex
// this.$store.commit("SET_USERINFO", res.data); //vuex
// console.log(res.data);
// this.$router.push("/weather");
// this.$message({
// duration: 1500,
// showClose: true,
// message: "",
// type: "success",
// });
// } else {
// this.$message.error(res.msg);
// }
// })
// .catch((err) => {});
getloginApi(this.userInfo)
.then((res) => {
if (res.code == 200) {
// this.$store.commit("SET_TOKEN", res.data.sessionId); //tokenvuex
//this.$store.commit("SET_USERINFO", res.data); //vuex
console.log(res.data);
//this.$router.push("/weather");
this.$message({
duration: 1500,
showClose: true,
message: "登录成功",
type: "success",
});
this.$router.push("/");
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
} else {
this.$message.error("请输入账号和密码");
console.log("error submit!!");

Loading…
Cancel
Save