master
fanluyan 1 year ago
parent 9565047050
commit 9982e73ea0

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

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

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

@ -76,6 +76,17 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </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-form-item>
<el-button type="primary" class="searchBtn" @click="handleSearch" <el-button type="primary" class="searchBtn" @click="handleSearch"
>查询</el-button >查询</el-button
@ -162,6 +173,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
:current-page="page" :current-page="page"
:page-size="pageSize" :page-size="pageSize"
:page-sizes="[20, 40, 100]"
layout="sizes, prev, pager, next, jumper,total" layout="sizes, prev, pager, next, jumper,total"
:total="total" :total="total"
> >
@ -218,7 +230,31 @@ export default {
label: "name", label: "name",
key: "compositeKey", // 使 uniqueKey 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", activeName: "dataTab",
tableLoading: false, //loading tableLoading: false, //loading
checkAll: true, // checkAll: true, //
@ -495,6 +531,7 @@ export default {
if (this.tabName == "dataTab") { if (this.tabName == "dataTab") {
this.getDetailTable( this.getDetailTable(
this.currentId, this.currentId,
this.formdata.dayValue,
this.formdata.starttime, this.formdata.starttime,
this.formdata.endtime this.formdata.endtime
); );
@ -507,11 +544,12 @@ export default {
} }
}, },
// //
getDetailTable(id, stime, eTime) { getDetailTable(id, dayval, stime, eTime) {
console.log(id, stime, eTime); console.log(id, stime, eTime);
this.tableLoading = true; this.tableLoading = true;
getDetailApi({ getDetailApi({
id: id, id: id,
numPerDay: dayval,
startTime: stime, startTime: stime,
endTime: eTime, endTime: eTime,
pageNum: this.page, pageNum: this.page,
@ -578,6 +616,13 @@ export default {
this.formdata.starttime, this.formdata.starttime,
this.formdata.endtime 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 = window.location.href =
"/cac-api/nsensor/export?id=" + "/cac-api/nsensor/export?id=" +
this.currentId + this.currentId +
"&numPerDay=" +
this.formdata.dayValue +
"&startTime=" + "&startTime=" +
this.formdata.starttime + this.formdata.starttime +
"&endTime=" + "&endTime=" +
@ -620,13 +667,15 @@ export default {
window.location.href = window.location.href =
"/cac-api/nsensor/export?id=" + "/cac-api/nsensor/export?id=" +
this.currentId + this.currentId +
"&numPerDay=" +
this.formdata.dayValue +
"&startTime=" + "&startTime=" +
this.formdata.starttime + this.formdata.starttime +
"&endTime=" + "&endTime=" +
this.formdata.endtime + this.formdata.endtime +
"&pageNum=" + "&pageNum=" +
this.page + this.page +
"&pageSizee=" + "&pageSize=" +
this.pageSize; this.pageSize;
}, },
// //
@ -635,6 +684,7 @@ export default {
this.tableData = []; this.tableData = [];
this.getDetailTable( this.getDetailTable(
this.currentId, this.currentId,
this.formdata.dayValue,
this.formdata.starttime, this.formdata.starttime,
this.formdata.endtime this.formdata.endtime
); );
@ -645,6 +695,7 @@ export default {
this.tableData = []; this.tableData = [];
this.getDetailTable( this.getDetailTable(
this.currentId, this.currentId,
this.formdata.dayValue,
this.formdata.starttime, this.formdata.starttime,
this.formdata.endtime this.formdata.endtime
); );

@ -41,6 +41,8 @@
<script> <script>
import * as THREE from "three"; import * as THREE from "three";
import threejs from "./threejs"; import threejs from "./threejs";
import { getloginApi } from "@/utils/api/index";
export default { export default {
components: { components: {
threejs, threejs,
@ -69,13 +71,38 @@ export default {
this.$refs.loginForm.validate((valid) => { this.$refs.loginForm.validate((valid) => {
if (valid) { if (valid) {
console.log(this.userInfo); console.log(this.userInfo);
if ( // if (
(this.userInfo.userName == "admin" && // (this.userInfo.userName == "admin" &&
this.userInfo.password == "shxy123456") || // this.userInfo.password == "shxy123456") ||
(this.userInfo.userName == "cacuser" && // (this.userInfo.userName == "cacuser" &&
this.userInfo.password == "cac123456") // this.userInfo.password == "cac123456")
) { // ) {
localStorage.setItem("token", "13747c96ff9f434cb09ecf78e4b9a8bc"); // 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;
// }
//
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({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
@ -83,35 +110,11 @@ export default {
type: "success", type: "success",
}); });
this.$router.push("/"); this.$router.push("/");
return;
} else { } else {
this.$message({ this.$message.error(res.msg);
duration: 1500,
showClose: true,
message: "账号密码错误,请重新输入!",
type: "warning",
});
return;
} }
// })
// loginJoggle(this.userInfo) .catch((err) => {});
// .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) => {});
} else { } else {
this.$message.error("请输入账号和密码"); this.$message.error("请输入账号和密码");
console.log("error submit!!"); console.log("error submit!!");

Loading…
Cancel
Save