Browse Source

能耗管理 基本信息页面完成

hzj18279462576@163.com 2 years ago
parent
commit
0e740d14a8
8 changed files with 1844 additions and 6630 deletions
  1. 11 3535
      package-lock.json
  2. 1 0
      package.json
  3. BIN
      src/assets/school/login_bg.png
  4. 830 1197
      src/views/caller/caller.vue
  5. 630 228
      src/views/energy/energy.vue
  6. 100 201
      src/views/home/home.vue
  7. 188 1208
      src/views/info/info.vue
  8. 84 261
      src/views/login/index.vue

File diff suppressed because it is too large
+ 11 - 3535
package-lock.json


+ 1 - 0
package.json

@@ -19,6 +19,7 @@
     "hls.js": "^1.3.4",
     "jsencrypt": "^3.3.1",
     "lodash": "^4.17.21",
+    "qrcode.vue": "^3.4.1",
     "sass": "^1.58.0",
     "sass-loader": "^13.2.0",
     "terser": "^5.16.5",

BIN
src/assets/school/login_bg.png


File diff suppressed because it is too large
+ 830 - 1197
src/views/caller/caller.vue


+ 630 - 228
src/views/energy/energy.vue

@@ -9,12 +9,132 @@
         <div class="echarts1">
           <div class="title">用户类别占比</div>
           <div id="annulus"></div>
+          <div class="quantity_title">
+            <div class="quantity">
+              <div class="dosage">用电量</div>
+              <span class="num">7,865</span><span>kw/h</span>
+            </div>
+            <div class="quantity">
+              <div class="dosage">用水量</div>
+              <span class="num">7,865</span><span>L</span>
+            </div>
+          </div>
+        </div>
+        <div class="echarts1 echarts2">
+          <div class="title">区域统计</div>
+          <div id="areaTJ"></div>
+          <div class="quantity_title">
+            <div class="btn">
+              <div
+                class="btn_li"
+                :class="areaInd == 1 ? 'btn_active' : ''"
+                @click="areaStatistics(1)"
+              >
+                水
+              </div>
+              <div
+                class="btn_li"
+                :class="areaInd == 2 ? 'btn_active' : ''"
+                @click="areaStatistics(2)"
+              >
+                电
+              </div>
+            </div>
+          </div>
         </div>
-        <div class="echarts2"></div>
       </div>
       <div class="table">
-        <div class="table1"></div>
-        <div class="table2"></div>
+        <div class="table1">
+          <div class="title">区域能耗统计</div>
+          <div class="table1Data">
+            <div class="selInput">
+              <span>月份 : </span
+              ><el-select
+                v-model="tableSearch1"
+                class="m-2"
+                placeholder="请选择月份"
+              >
+                <!-- size="small" -->
+                <el-option label="1月" value="1" />
+                <el-option label="2月" value="2" />
+              </el-select>
+            </div>
+            <el-table
+              :row-class-name="tableRowClassName"
+              :data="table1Data.list"
+              style="width: 100%"
+              :header-cell-style="{
+                background: 'rgba(240, 243, 247, 1)',
+                height: '40px',
+                border: 0,
+              }"
+            >
+              <el-table-column align="center " type="index" label="序号" />
+              <el-table-column align="center" prop="dian" label="电(kw/h)" />
+              <el-table-column align="center" prop="shui" label="水(L)" />
+              <el-table-column align="center" prop="build" label="楼栋" />
+              <el-table-column align="center" prop="month" label="月份" />
+            </el-table>
+            <!-- 分页组件 -->
+            <div class="pageSize">
+              <span></span>
+              <el-pagination
+                small
+                background
+                :current-page="currentPage1"
+                :page-size="pageSize1"
+                layout="total, prev, pager, next, jumper, slot"
+                :total="total1"
+                @update:current-page="handleCurrentChange1"
+              />
+            </div>
+          </div>
+        </div>
+        <div class="table1 table2">
+          <div class="title">实时抄表</div>
+          <div class="table1Data">
+            <div class="selInput">
+              <span>通讯时间 : </span>
+              <el-date-picker
+                v-model="tableSearch2"
+                type="date"
+                format="YYYY-MM-DD"
+                value-format="YYYY-MM-DD"
+                :prefix-icon="Calendar"
+                placeholder="请选择日期"
+              />
+            </div>
+            <el-table
+              :row-class-name="tableRowClassName"
+              :data="table2Data.list"
+              style="width: 100%"
+              :header-cell-style="{
+                background: 'rgba(240, 243, 247, 1)',
+                height: '40px',
+                border: 0,
+              }"
+            >
+              <el-table-column align="center " type="index" label="序号" />
+              <el-table-column align="center" prop="dian" label="电(kw/h)" />
+              <el-table-column align="center" prop="shui" label="水(L)" />
+              <el-table-column align="center" prop="build" label="楼栋" />
+              <el-table-column align="center" prop="month" label="通讯时间" />
+            </el-table>
+            <!-- 分页组件 -->
+            <div class="pageSize">
+              <span></span>
+              <el-pagination
+                small
+                background
+                :current-page="currentPage2"
+                :page-size="pageSize2"
+                layout="total, prev, pager, next, jumper, slot"
+                :total="total2"
+                @update:current-page="handleCurrentChange1"
+              />
+            </div>
+          </div>
+        </div>
       </div>
     </div>
   </div>
@@ -113,7 +233,15 @@
 
 <script setup>
 import * as echarts from "echarts";
-import { ref, reactive, watch, nextTick, onMounted, onUnmounted } from "vue";
+import {
+  ref,
+  shallowRef,
+  reactive,
+  watch,
+  nextTick,
+  onMounted,
+  onUnmounted,
+} from "vue";
 import { useRouter } from "vue-router";
 import { ElMessage, ElMessageBox } from "element-plus";
 import { Calendar } from "@element-plus/icons-vue";
@@ -126,270 +254,352 @@ const api = ref("");
 const router = useRouter();
 
 // 用户类别占比
-const category = ref();
+const category = shallowRef();
+// 区域统计
+const areaTJEcharts = shallowRef();
+const areaInd = ref(1);
 
-// 表格数据
-const loading = ref(false);
-const tableData = reactive({
+// 区域能耗统计
+const tableSearch1 = ref(); // 月份搜索
+const table1Data = reactive({
   list: [
-    // {
-    //   userName: "双人房",
-    //   userPhone: 150,
-    //   teamName: 12,
-    // },
-    // {
-    //   userName: "双人房",
-    //   userPhone: 150,
-    //   teamName: 12,
-    // },
-    // {
-    //   userName: "双人房",
-    //   userPhone: 150,
-    //   teamName: 12,
-    // },
-    // {
-    //   userName: "双人房",
-    //   userPhone: 150,
-    //   teamName: 12,
-    // },
+    {
+      dian: "120",
+      shui: 12,
+      build: "6栋",
+      month: 6,
+    },
+    {
+      dian: "120",
+      shui: 12,
+      build: "7栋",
+      month: 7,
+    },
+    {
+      dian: "120",
+      shui: 12,
+      build: "8栋",
+      month: 8,
+    },
+    {
+      dian: "120",
+      shui: 12,
+      build: "9栋",
+      month: 9,
+    },
+    {
+      dian: "120",
+      shui: 12,
+      build: "9栋",
+      month: 9,
+    },
+    {
+      dian: "120",
+      shui: 12,
+      build: "9栋",
+      month: 9,
+    },
   ],
 });
-const currentPage = ref(1); // 当前页
-const pageSize = ref(10);
-const total = ref(); // 当前总数
-
-// 编辑功能
-const titleDialog = ref("");
-const editVisible = ref(false);
-const editRef = ref();
-const editRuleForm = reactive({
-  userDepartment: "", // 用户部门
-  userName: "", // 用户名
-  userRoles: "", // 用户角色
-  schoolCard: "", // 微校卡号
-  idNumber: "", // 身份证号
-  fingerprint: "", // 指纹
-  id: "",
-});
+const currentPage1 = ref(1); // 当前页
+const pageSize1 = ref(5);
+const total1 = ref(5); // 当前总数
 
-// 表单验证
-const editRules = reactive({
-  userDepartment: [
-    { required: true, message: "用户部门不能为空", trigger: "blur" },
-  ],
-  userName: [
+// 区域能耗统计
+const tableSearch2 = ref(); // 月份搜索
+const table2Data = reactive({
+  list: [
     {
-      required: true,
-      message: "用户名不能为空",
-      trigger: "blur",
+      dian: "120",
+      shui: 12,
+      build: "6栋",
+      time: "2023-12-08",
     },
-  ],
-  userRoles: [
     {
-      required: true,
-      message: "用户角色不能为空",
-      trigger: "blur",
+      dian: "120",
+      shui: 12,
+      build: "7栋",
+      time: "2023-12-08",
     },
-  ],
-  schoolCard: [
     {
-      required: true,
-      message: "微校卡号不能为空",
-      trigger: "blur",
+      dian: "120",
+      shui: 12,
+      build: "8栋",
+      time: "2023-12-08",
     },
-  ],
-  idNumber: [
     {
-      required: true,
-      message: "身份证号不能为空",
-      trigger: "blur",
+      dian: "120",
+      shui: 12,
+      build: "9栋",
+      time: "2023-12-08",
+    },
+    {
+      dian: "120",
+      shui: 12,
+      build: "9栋",
+      month: "2023-12-08",
     },
-  ],
-  fingerprint: [
     {
-      required: true,
-      message: "指纹不能为空",
-      trigger: "blur",
+      dian: "120",
+      shui: 12,
+      build: "9栋",
+      time: "2023-12-08",
     },
   ],
 });
+const currentPage2 = ref(1); // 当前页
+const pageSize2 = ref(5);
+const total2 = ref(5); // 当前总数
 
 // 用户类别占比
 const echarts1 = async () => {
   category.value = echarts.init(document.getElementById("annulus"));
-  let value = 20;
   category.value.setOption({
-    // title: {
-    //   text: "圆环图的例子",
-    //   left: "center",
-    //   top: "center",
-    // },
     tooltip: {
       trigger: "item",
     },
     legend: {
-      orient: "vertical",
-      right: "6%",
-      top: "15%",
+      orient: "horizontal",
+      bottom: "16%",
+      left: "22%",
       itemGap: 20,
       itemWidth: 15,
       itemHeight: 15,
     },
     series: [
       {
+        name: "用户类别占比",
         type: "pie",
+        radius: ["70%", "90%"],
+        center: ["30%", "60%"],
+        // adjust the start angle
+        startAngle: 180,
+        label: {
+          show: true,
+          formatter(param) {
+            // correct the percentage
+            return param.name + " (" + param.percent * 2 + "%)";
+          },
+        },
         data: [
           {
-            value: 224,
-            name: "电子资源库",
+            value: 1048,
+            name: "电",
             itemStyle: {
               color: "rgba(67, 181, 244, 1)",
             },
           },
           {
-            value: 304,
-            name: "课程资源库",
+            value: 580,
+            name: "用水",
             itemStyle: {
-              color: "rgba(137, 207, 245, 1)",
+              color: "#D4EDFB",
             },
           },
           {
-            value: 484,
-            name: "教学方案库",
+            // make an record to fill the bottom 50%
+            value: 1048 + 580,
             itemStyle: {
-              color: "rgba(180, 226, 251, 1)",
+              // stop the chart from rendering this piece
+              color: "none",
+              decal: {
+                symbol: "none",
+              },
             },
-          },
-          {
-            value: 300,
-            name: "第三资源库",
-            itemStyle: {
-              color: "rgba(212, 237, 251, 1)",
+            label: {
+              show: false,
             },
           },
         ],
-        center: ["40%", "48%"],
-        radius: ["48%", "65%"],
-        label: {
-          show: true,
-          //   position: "center",
-          formatter: "{b} ({d}%)",
-          padding: 1,
-        },
-        labelLine: {
-          show: true,
-          //   length: -1,
-        },
       },
     ],
   });
 };
 const resizeChart = () => {
   category.value.resize();
+  areaTJEcharts.value.resize();
 };
+// 区域统计
+const echarts2 = async () => {
+  areaTJEcharts.value = echarts.init(document.getElementById("areaTJ"));
+  areaTJEcharts.value.setOption({
+    legend: {
+      orient: "horizontal",
+      bottom: "5%",
+      left: "22%",
+      itemGap: 20,
+      itemWidth: 15,
+      itemHeight: 15,
+    },
+    tooltip: {
+      trigger: "axis",
+      axisPointer: {
+        type: "shadow",
+      },
+    },
 
-//编辑按钮  (-------------------------------------------)
-const editClick = async () => {
-  titleDialog.value = "编辑";
-  editVisible.value = true;
-  //   let data = {
-  //     linkId: row.id,
-  //   };
-  //   let res = await axios({
-  //     method: "post",
-  //     url: api.value + "/mhotel/uploadgetByLinkId.action",
-  //     headers: {},
-  //     params: data,
-  //   });
-  //   console.log(res, "编辑中查找图片");
-  //   if (res.data.code == 200) {
-  //     // res.data.data.fileInfoList.forEach((item) => {
-  //     //   item.uid = item.id;
-  //     // });
-  //     // fileList.list = res.data.data.fileInfoList;
-  //     // ruleForm.fileListJson = fileList.list;
-  //     res.data.data.forEach((item) => {
-  //       item.uid = item.id;
-  //     });
-  //     fileList.list = res.data.data;
-  //     ruleForm.fileListJson = fileList.list;
-  //     // ElMessage({
-  //     //   type: "success",
-  //     //   showClose: true,
-  //     //   message: res.data.message,
-  //     //   center: true,
-  //     // });
-  //   } else {
-  //     ElMessage({
-  //       type: "error",
-  //       showClose: true,
-  //       message: res.data.message,
-  //       center: true,
-  //     });
-  //   }
+    grid: {
+      show: false,
+      top: "10%", // 一下数值可为百分比也可为具体像素值
+      right: "8%",
+      bottom: "25%",
+      left: "10%",
+    },
+    dataZoom: [
+      {
+        type: "slider",
+        realtime: true,
+        start: 0,
+        end: 60, // 数据窗口范围的结束百分比。范围是:0 ~ 100。
+        height: 5, // 组件高度
+        left: 5, // 左边的距离
+        right: 5, // 右边的距离
+        bottom: 2, // 下边的距离
+        show: true, // 是否展示
+        fillerColor: "rgba(180, 226, 251, 1)", // 滚动条颜色
+        borderColor: "rgba(180, 226, 251, 0.12)",
+        handleSize: 0, // 两边手柄尺寸
+        showDetail: false, // 拖拽时是否展示滚动条两侧的文字
+        zoomLock: true, // 是否只平移不缩放
+        moveOnMouseMove: false, // 鼠标移动能触发数据窗口平移
+        zoomOnMouseWheel: true, // 鼠标移动能触发数据窗口缩放
+      },
+      {
+        type: "inside", // 支持内部鼠标滚动平移
+        start: 0,
+        end: 70,
+        zoomOnMouseWheel: false, // 关闭滚轮缩放
+        moveOnMouseWheel: true, // 开启滚轮平移
+        moveOnMouseMove: true, // 鼠标移动能触发数据窗口平移
+      },
+    ],
+    // dataset: {
+    //   source: [
+    //     ["product", "2015", "2016", "2017"],
+    //     ["教学楼", 43.3, 85.8, 93.7],
+    //     ["行政楼", 83.1, 73.4, 55.1],
+    //     ["食堂", 86.4, 65.2, 82.5],
+    //     ["其他", 72.4, 53.9, 39.1],
+    //   ],
+    // },
+    xAxis: {
+      type: "category",
+      axisLine: {
+        show: true,
+        //这是x轴文字颜色
+        lineStyle: {
+          color: "##5B5B5B",
+        },
+      },
+      axisTick: {
+        show: false,
+      },
+      data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月"],
+    },
+    yAxis: {
+      name: "吨/度",
+      nameTextStyle: {
+        color: "#aaa",
+        nameLocation: "start",
+      },
+      axisLine: {
+        //这是x轴文字颜色
+        show: true,
+        lineStyle: {
+          color: "##5B5B5B",
+        },
+      },
+      splitLine: {
+        //x轴的网格 样式
+        lineStyle: {
+          color: "#F0EEEE",
+          width: 1,
+          type: "dashed",
+        },
+      },
+    },
+    // Declare several bar series, each will be mapped
+    // to a column of dataset.source by default.
+    series: [
+      {
+        name: "教学楼",
+        type: "bar",
+        data: [120, 200, 150, 80, 70, 110, 130, 60],
+        itemStyle: {
+          color: "#43B5F4",
+        },
+        barGap: "0%", // 同一列柱子的间距
+        barWidth: 20, // 柱子的宽度
+        emphasis: {
+          focus: "series",
+        },
+      },
+      {
+        type: "bar",
+        name: "行政楼",
+        data: [52, 20, 15, 68, 97, 11, 93, 6],
+        itemStyle: {
+          color: "#89CFF5",
+        },
+        barWidth: 20, // 柱子的宽度
+        emphasis: {
+          focus: "series",
+        },
+      },
+      {
+        type: "bar",
+        name: "食堂",
+        data: [102, 120, 105, 48, 75, 101, 103, 26],
+        itemStyle: {
+          color: "#B4E2FB",
+        },
+        barWidth: 20, // 柱子的宽度
+        emphasis: {
+          focus: "series",
+        },
+      },
+      {
+        type: "bar",
+        name: "其他",
+        data: [62, 120, 150, 88, 17, 211, 103, 66],
+        itemStyle: {
+          color: "#D4EDFB",
+        },
+        barWidth: 20, // 柱子的宽度
+        emphasis: {
+          focus: "series",
+        },
+      },
+    ],
+  });
+  // areaTJEcharts.value.setOption({
+  //   legend: {},
+  //   tooltip: {},
+  //   dataset: {
+  //     source: [
+  //       ["product", "2015", "2016", "2017"],
+  //       ["Matcha Latte", 43.3, 85.8, 93.7],
+  //       ["Milk Tea", 83.1, 73.4, 55.1],
+  //       ["Cheese Cocoa", 86.4, 65.2, 82.5],
+  //       ["Walnut Brownie", 72.4, 53.9, 39.1],
+  //     ],
+  //   },
+  //   xAxis: { type: "category" },
+  //   yAxis: {},
+  //   // Declare several bar series, each will be mapped
+  //   // to a column of dataset.source by default.
+  //   series: [{ type: "bar" }, { type: "bar" }, { type: "bar" }],
+  // });
 };
-
-const cancelEdit = () => {
-  editVisible.value = false;
-  editRef.value.resetFields();
+const areaStatistics = (ind) => {
+  areaInd.value = ind;
 };
 
-// 多选框功能
-const handleSelectionChange = (val) => {
-  console.log(val);
-  selectData.list = val;
+// 区域能耗统计
+const handleCurrentChange1 = (value) => {
+  // console.log(value);
+  currentPage.value = value;
 };
-//导出功能
-// const importExcel = async () => {
-//   if (searchInput.createTime == null) {
-//     searchInput.createTime = "";
-//   }
-//   let data = new FormData();
-//   data.set("car_number", searchInput.carnumber);
-//   data.set("create_time", searchInput.createTime);
-//   let res = await axios({
-//     method: "post",
-//     url: api.value + "/carBook/cinfotoExcel.action",
-//     headers: {
-//       token: sessionStorage.getItem("token"),
-//     },
-//     data: data,
-//   });
-//   // console.log(res, "导出账号");
-//   if (res.data.code == 200) {
-//     // const elt = document.createElement("a");
-//     // elt.setAttribute(
-//     //   "href",
-//     //   "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
-//     // );
-//     // elt.setAttribute("download", "file.png");
-//     // elt.style.display = "none";
-//     // document.body.appendChild(elt);
-//     // elt.click();
-//     var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
-//     console.log("获得地址数据:", downloadPath);
-//     var downloadLink = document.createElement("a");
-//     downloadLink.style.display = "none"; // 使其隐藏
-//     downloadLink.href = downloadPath;
-//     downloadLink.download = "";
-//     downloadLink.click();
-//     document.body.appendChild(downloadLink);
-//     document.body.removeChild(downloadLink);
-//     ElMessage({
-//       type: "success",
-//       showClose: true,
-//       message: res.data.message,
-//       center: true,
-//     });
-//   } else {
-//     ElMessage({
-//       type: "error",
-//       showClose: true,
-//       message: res.data.message,
-//       center: true,
-//     });
-//   }
-// };
 // 表格斑马纹颜色修改
 const tableRowClassName = ({ row, rowIndex }) => {
   if (rowIndex % 2 === 0) {
@@ -399,28 +609,27 @@ const tableRowClassName = ({ row, rowIndex }) => {
   }
   return "";
 };
-// 分页
-const handleCurrentChange = (value) => {
-  // console.log(value);
-  currentPage.value = value;
-  getList();
-};
 
 onMounted(() => {
   api.value = store.state.user.api;
-
   echarts1();
+  echarts2();
   window.addEventListener("resize", resizeChart);
 });
+onUnmounted(() => {
+  category.value.dispose();
+  areaTJEcharts.value.dispose();
+});
 </script>
 
 <style scoped lang="scss">
 .content-box {
   width: 97.5%;
   height: 89%;
+
   margin: 20px auto;
   background-color: #fff;
-  color: #fff;
+  // color: #fff;
   display: flex;
   flex-direction: column;
   box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
@@ -454,46 +663,239 @@ onMounted(() => {
     display: flex;
     flex-direction: column;
     .echarts {
+      // flex: 1;
+      height: 360px;
       width: 100%;
-      margin: 20px 0 15px 0;
-      flex: 1;
+      margin: 10px 0 15px 0;
       display: flex;
+
       .echarts1 {
-        flex: 1;
+        width: 50%;
+        // min-width: 500px;
+        height: 100%;
+        // height: 500px;
         margin-right: 20px;
         border-radius: 8px;
         box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
+        position: relative;
         .title {
+          font-size: 18px;
           font-weight: 700;
           margin: 16px 30px;
         }
         #annulus {
           width: 100%;
-          height: calc(100% - 56px);
-          border: 1px solid red;
+          height: 300px;
+          // height: calc(100% - 56px);
+        }
+        .quantity_title {
+          position: absolute;
+          z-index: 999;
+          top: 87px;
+          right: 47px;
+          color: rgba(91, 91, 91, 1);
+          font-size: 20px;
+          .quantity {
+            margin-bottom: 20px;
+            .num {
+              font-size: 30px;
+              font-weight: 600;
+              color: rgba(42, 42, 42, 1);
+            }
+          }
         }
       }
       .echarts2 {
-        flex: 1;
-        border-radius: 8px;
-        box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
+        margin-right: 0;
+        #areaTJ {
+          width: 100%;
+          height: calc(100% - 56px);
+          // height: 300px;
+        }
+        .quantity_title {
+          position: absolute;
+          z-index: 999;
+          top: 20px;
+          right: 80px;
+          font-size: 18px;
+          color: rgba(0, 97, 255, 1);
+          .btn {
+            display: flex;
+            .btn_li {
+              width: 65px;
+              height: 28px;
+              border-radius: 5px;
+              background: rgba(235, 242, 255, 1);
+              text-align: center;
+              line-height: 28px;
+              margin-right: 15px;
+              cursor: pointer;
+            }
+            .btn_active {
+              background: rgba(0, 97, 255, 1);
+              color: #fff;
+            }
+          }
+        }
       }
     }
     .table {
+      // flex: 1;
+      height: 360px;
       width: 100%;
-      flex: 1;
       margin: 0 0 20px 0;
       display: flex;
       .table1 {
-        flex: 1;
+        width: 50%;
+        // min-width: 500px;
+        height: 100%;
+        // height: 500px;
         margin-right: 20px;
         border-radius: 8px;
         box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
+        position: relative;
+        .title {
+          font-weight: 700;
+          margin: 16px 30px 10px;
+          font-size: 18px;
+        }
+        .table1Data {
+          margin: 0 30px;
+          height: calc(100% - 51px);
+          .selInput {
+            margin-bottom: 10px;
+            font-size: 14px;
+          }
+
+          .el-table--fit {
+            height: 65%;
+
+            :deep(.el-table__header-wrapper) {
+              background-color: #000;
+              font-size: 16px;
+
+              tr {
+                color: #000;
+              }
+            }
+
+            :deep(.el-table__row) {
+              height: 40px;
+              font-size: 16px;
+              color: #000;
+            }
+
+            :deep(.el-table__row):nth-child(2n) {
+              .el-table-fixed-column--right {
+                background-color: rgba(240, 243, 247, 1);
+              }
+            }
+
+            :deep(.el-table__row td) {
+              padding: 0;
+              border: 0;
+            }
+
+            .el-button--primary {
+              margin-left: 5px;
+            }
+
+            :deep(.el-table__body .even) {
+              background-color: #fff;
+            }
+
+            :deep(.el-table__body .odd) {
+              background-color: rgba(240, 243, 247, 1);
+            }
+
+            :deep(.edit) {
+              display: flex;
+              align-items: center;
+              justify-content: center;
+              color: rgba(111, 182, 184, 1);
+            }
+
+            :deep(.look) {
+              padding: 0 10px;
+              cursor: pointer;
+              color: rgba(30, 125, 251, 1);
+            }
+
+            .del {
+              padding: 0 10px;
+              color: rgba(212, 48, 48, 1);
+              cursor: pointer;
+            }
+
+            // :deep(.look):hover {
+            //   color: red;
+            // }
+            // :deep(.del):hover {
+            //   color: red;
+            // }
+          }
+          .pageSize {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            margin: 18px 0 0;
+
+            span {
+              color: #000;
+            }
+
+            .el-pagination {
+              // width: 1600px;
+              :deep(.el-pagination__total) {
+                color: #000;
+              }
+
+              :deep(.el-pagination__goto) {
+                color: #000;
+              }
+
+              :deep(.el-pagination__classifier) {
+                color: #000;
+              }
+
+              :deep(.el-input__wrapper) {
+                border: 1px solid rgba(0, 0, 0, 1);
+                border-radius: 5px;
+                box-shadow: none;
+              }
+
+              :deep(.el-pager li) {
+                margin: 0 5px;
+                border: 1px solid rgba(0, 0, 0, 1);
+                border-radius: 5px;
+                background-color: transparent;
+              }
+
+              :deep(.el-pager li.is-active) {
+                // background-color: rgba(0, 97, 255, 0.8);
+                border: 1px solid rgba(0, 97, 255, 1);
+                color: rgba(0, 97, 255, 1);
+              }
+
+              :deep(.btn-prev) {
+                margin-right: 5px;
+                border: 1px solid rgba(0, 0, 0, 1);
+                border-radius: 5px;
+                background-color: transparent;
+              }
+
+              :deep(.btn-next) {
+                margin-left: 5px;
+                border: 1px solid rgba(0, 0, 0, 1);
+                border-radius: 5px;
+                background-color: transparent;
+              }
+            }
+          }
+        }
       }
       .table2 {
-        flex: 1;
-        border-radius: 8px;
-        box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
+        margin: 0;
       }
     }
   }

+ 100 - 201
src/views/home/home.vue

@@ -263,7 +263,7 @@
 
 <script setup>
 import * as echarts from "echarts";
-import { ref, watch, reactive, nextTick, onBeforeMount, onMounted } from "vue";
+import { ref, watch, reactive, nextTick, onUnmounted, onMounted } from "vue";
 import { useRouter } from "vue-router";
 import { ElMessage, ElMessageBox } from "element-plus";
 import { dayjs } from "element-plus";
@@ -274,21 +274,18 @@ const store = useStore();
 const api = ref("");
 const router = useRouter();
 
-// 顶部数据
-const topTitleData = ref([]); // 循环数据
-const accomplishCount = ref(); // 已完成
-const shutCount = ref(); // 已关单
-const cancelCount = ref(); // 已取消
-
-// 圆环统计图
-const annulus = ref();
-let tabIndex1 = ref(2);
-const echartsData1 = ref([]);
-
-// 折现统计图
-let tabIndex2 = ref(2);
-
-const tableData3 = reactive({ list: [] });
+// 用户类别占比
+const echarts1 = ref();
+// 能耗趋势图
+const echarts2 = ref();
+// 门禁管理
+const echarts3 = ref();
+// 行为统计
+const echarts4 = ref();
+// 班级考勤
+const echarts5 = ref();
+// 资源大数据
+const echarts6 = ref();
 
 const getList = () => {
   cartogram();
@@ -317,8 +314,9 @@ const cartogram = async () => {
   // });
   // console.log(res, "圆环 报修分析统计");
   // let echartsData1 = [];
-  var myChart1 = echarts.init(document.getElementById("annulus"));
-  myChart1.setOption({
+
+  echarts1.value = echarts.init(document.getElementById("annulus"));
+  echarts1.value.setOption({
     // title: {
     //   text: "圆环图的例子",
     //   left: "center",
@@ -383,7 +381,7 @@ const cartogram = async () => {
     ],
   });
 };
-// 折现统计图按钮(----------------------------)
+// 能耗趋势图(----------------------------)
 const cartogram2 = async () => {
   // let data = {
   //   state: tabIndex2.value,
@@ -410,47 +408,6 @@ const cartogram2 = async () => {
   // let newData = []; // 当前数据
   // let xname = "";
   // if (res.data.code == 200) {
-  //   res.data.data.forEach((item) => {
-  //     if (tabIndex2.value == 1) {
-  //       xname = "月";
-  //       newTitle = "今年";
-  //       oldTitle = "去年";
-  //       dayData.push(item.trendComparisonName);
-  //       oldData.push(item.trendComparisonCount);
-  //       if (item.trendCount != null) {
-  //         newData.push(item.trendCount);
-  //       }
-  //     } else if (tabIndex2.value == 2) {
-  //       xname = "日";
-  //       dayData = monthData;
-  //       newTitle = "本月";
-  //       oldTitle = "上月";
-  //       if (item.trendComparisonCount != null) {
-  //         oldData.push(item.trendComparisonCount);
-  //       }
-  //       if (item.trendCount != null) {
-  //         newData.push(item.trendCount);
-  //       }
-  //     } else if (tabIndex2.value == 3) {
-  //       xname = "周";
-  //       dayData.push(item.trendComparisonName);
-  //       newTitle = "本周";
-  //       oldTitle = "上周";
-  //       oldData.push(item.trendComparisonCount);
-  //       if (item.trendCount != null) {
-  //         newData.push(item.trendCount);
-  //       }
-  //     } else if (tabIndex2.value == 4) {
-  //       xname = "小时";
-  //       dayData.push(item.trendComparisonName);
-  //       newTitle = "今天";
-  //       oldTitle = "昨天";
-  //       oldData.push(item.trendComparisonCount);
-  //       if (item.trendCount != null) {
-  //         newData.push(item.trendCount);
-  //       }
-  //     }
-  //   });
   // } else {
   //   ElMessage({
   //     type: "error",
@@ -460,139 +417,8 @@ const cartogram2 = async () => {
   //   });
   // }
   // 折现统计图
-  var myChart2 = echarts.init(document.getElementById("broken"));
-  // myChart2.setOption(
-  //   {
-  //   tooltip: {
-  //     trigger: "axis",
-  //     axisPointer: {
-  //       type: "cross",
-  //       label: {
-  //         backgroundColor: "#6a7985",
-  //       },
-  //     },
-  //   },
-  //   legend: {
-  //     // data: dayTitle,
-  //     bottom: "25",
-  //     icon: "circle",
-  //     itemHeight: 8, // 修改icon图形大小
-  //     itemGap: 30, // 修改间距
-  //     textStyle: {
-  //       fontSize: 10,
-  //       color: "#000",
-  //       padding: [0, 0, 0, -5], // 修改文字和图标距离
-  //     },
-  //   },
-  //   grid: {
-  //     top: "12%",
-  //     left: "5%",
-  //     right: "8%",
-  //     bottom: "20%",
-  //     containLabel: true,
-  //   },
-  //   xAxis: [
-  //     {
-  //       type: "category",
-  //       boundaryGap: false,
-  //       axisLine: {
-  //         show: false, // 不显示坐标轴线
-  //       },
-  //       axisTick: {
-  //         show: false, // 不显示坐标轴刻度线
-  //       },
-  //       data: [
-  //         "11.20",
-  //         "11.21",
-  //         "11.22",
-  //         "11.23",
-  //         "11.24",
-  //         "11.25",
-  //         "11.26",
-  //         "11.27",
-  //         "11.28",
-  //         "11.29",
-  //         "11.30",
-  //       ],
-  //       // axisLabel: {
-  //       //   // 每个数据后面都会带有单位
-  //       //   formatter: "{value}月",
-  //       // },
-  //       name: "",
-  //       nameLocation: "end",
-  //       nameTextStyle: {
-  //         padding: [60, 0, 0, 0], // 四个数字分别为上右下左与原位置距离
-  //       },
-  //     },
-  //   ],
-  //   yAxis: [
-  //     {
-  //       type: "value",
-  //     },
-  //   ],
-  //   series: [
-  //     {
-  //       name: "水",
-  //       type: "line",
-  //       // stack: "Total",
-  //       areaStyle: {},
-  //       emphasis: {
-  //         focus: "series",
-  //       },
-  //       data: [15, 20, 19, 30, 11, 20, 11, 9, 12, 32, 10],
-  //       symbolSize: 4, // 点的大小
-  //       symbol: "circle", // 折线点设置为实心点
-  //       itemStyle: {
-  //         normal: {
-  //           color: "rgba(30, 125, 251, 1)", // 拐点的颜色
-  //           borderColor: "white", // 拐点边框颜色
-  //           borderWidth: 2, // 拐点边框大小
-  //         },
-  //       },
-  //       lineStyle: {
-  //         normal: {
-  //           color: "rgba(30, 125, 251, 1)", // 折线点的颜色
-  //         },
-  //       },
-  //       smooth: true, //平滑曲线图。值可为数字
-  //       areaStyle: {
-  //         //2.基础面积图。区域填充样式
-  //         color: "rgba(30, 125, 251, 0.3)", //支持RGB、ALPHA通道+RGBA、十六进制、渐变色、纹理填充
-  //       },
-  //     },
-  //     {
-  //       name: "电",
-  //       type: "line",
-  //       // stack: "Total",
-  //       areaStyle: {},
-  //       emphasis: {
-  //         focus: "series",
-  //       },
-  //       data: [10, 40, 7, 10, 23, 10, 6, 10, 20, 14, 22],
-  //       symbolSize: 4, // 点的大小
-  //       symbol: "circle", // 折线点设置为实心点
-  //       itemStyle: {
-  //         normal: {
-  //           color: "rgba(111, 182, 184, 1)", // 拐点的颜色
-  //           borderColor: "white", // 拐点边框颜色
-  //           borderWidth: 2, // 拐点边框大小
-  //         },
-  //       },
-  //       lineStyle: {
-  //         normal: {
-  //           color: "rgba(111, 182, 184, 1)", // 折线点的颜色
-  //         },
-  //       },
-  //       smooth: true, //平滑曲线图。值可为数字
-  //       areaStyle: {
-  //         //2.基础面积图。区域填充样式
-  //         color: "rgba(111, 182, 184, 0.3)", //支持RGB、ALPHA通道+RGBA、十六进制、渐变色、纹理填充
-  //       },
-  //     },
-  //   ],
-  // }
-  // );
-  myChart2.setOption({
+  echarts2.value = echarts.init(document.getElementById("broken"));
+  echarts2.value.setOption({
     // title: {
     //   text: "运动量对比",
     //   textStyle: {
@@ -752,9 +578,10 @@ const cartogram2 = async () => {
     ],
   });
 };
+// 门禁管理
 const doorForbidClick = () => {
-  var myChart2 = echarts.init(document.getElementById("doorForbid"));
-  myChart2.setOption({
+  echarts3.value = echarts.init(document.getElementById("doorForbid"));
+  echarts3.value.setOption({
     tooltip: {
       trigger: "axis",
       axisPointer: {
@@ -930,8 +757,8 @@ const behaviorClick = async () => {
   // });
   // console.log(res, "圆环 报修分析统计");
   // let echartsData1 = [];
-  var myChart1 = echarts.init(document.getElementById("behavior6"));
-  myChart1.setOption({
+  echarts4.value = echarts.init(document.getElementById("behavior6"));
+  echarts4.value.setOption({
     // title: {
     //   text: "圆环图的例子",
     //   left: "center",
@@ -1022,8 +849,8 @@ const classClick = async () => {
   // });
   // console.log(res, "圆环 报修分析统计");
   // let echartsData1 = [];
-  var myChart1 = echarts.init(document.getElementById("class"));
-  myChart1.setOption({
+  echarts5.value = echarts.init(document.getElementById("class"));
+  echarts5.value.setOption({
     // title: {
     //   text: "圆环图的例子",
     //   left: "center",
@@ -1114,8 +941,72 @@ const resourceClick = async () => {
   // });
   // console.log(res, "圆环 报修分析统计");
   // let echartsData1 = [];
-  var myChart1 = echarts.init(document.getElementById("resource"));
-  myChart1.setOption();
+  echarts6.value = echarts.init(document.getElementById("resource"));
+  echarts6.value.setOption({
+    // title: {
+    //   text: "圆环图的例子",
+    //   left: "center",
+    //   top: "center",
+    // },
+    tooltip: {
+      trigger: "item",
+    },
+    legend: {
+      orient: "vertical",
+      right: "6%",
+      top: "15%",
+      itemGap: 20,
+      itemWidth: 15,
+      itemHeight: 15,
+    },
+    series: [
+      {
+        type: "pie",
+        data: [
+          {
+            value: 224,
+            name: "电子资源库",
+            itemStyle: {
+              color: "rgba(67, 181, 244, 1)",
+            },
+          },
+          {
+            value: 304,
+            name: "课程资源库",
+            itemStyle: {
+              color: "rgba(137, 207, 245, 1)",
+            },
+          },
+          {
+            value: 484,
+            name: "教学方案库",
+            itemStyle: {
+              color: "rgba(180, 226, 251, 1)",
+            },
+          },
+          {
+            value: 300,
+            name: "第三资源库",
+            itemStyle: {
+              color: "rgba(212, 237, 251, 1)",
+            },
+          },
+        ],
+        center: ["40%", "48%"],
+        radius: ["48%", "65%"],
+        label: {
+          show: true,
+          //   position: "center",
+          formatter: "{b} ({d}%)",
+          padding: 1,
+        },
+        labelLine: {
+          show: true,
+          //   length: -1,
+        },
+      },
+    ],
+  });
 };
 
 // 墨轩湖搜索关键字
@@ -1211,6 +1102,14 @@ onMounted(() => {
   api.value = store.state.user.api;
   getList();
 });
+onUnmounted(() => {
+  echarts1.value.dispose();
+  echarts2.value.dispose();
+  echarts3.value.dispose();
+  echarts4.value.dispose();
+  echarts5.value.dispose();
+  echarts6.value.dispose();
+});
 </script>
 
 <style scoped lang="scss">

File diff suppressed because it is too large
+ 188 - 1208
src/views/info/info.vue


+ 84 - 261
src/views/login/index.vue

@@ -1,288 +1,111 @@
 <template>
   <div class="box">
-    <div class="login-container">
-      <div class="contain">
-        <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" class="login-form">
-          <div class="title-container">
-            <h3 class="title">智慧校园公寓管理端</h3>
-          </div>
-
-          <el-form-item prop="user">
-            <!-- <span class="svg-container">
-              <div class="user"></div>
-            </span> -->
-            <!-- <el-input v-model="ruleForm.user" placeholder="用户名" type="text" /> -->
-            <el-input v-model="ruleForm.user" placeholder="用户名">
-              <template #prefix>
-                <img src="../../assets/items/user.png" alt="">
-              </template>
-            </el-input>
-          </el-form-item>
-
-          <el-form-item prop="pass">
-            <!-- <span class="svg-container">
-              <div class="password"></div>
-            </span>
-            <el-input ref="password" v-model="ruleForm.pass" :type="passwordType" placeholder="密码"
-              @keyup.enter.native="handleLogin" />
-            <span class="show-pwd" @click="showPwd">
-              <div :class="passwordType === 'password' ? 'eye_close' : 'eye'"></div>
-            </span> -->
-            <el-input v-model="ruleForm.pass" placeholder="密码" :type="passwordType">
-              <template #prefix>
-                <img src="../../assets/items/password.png" alt="">
-              </template>
-              <template #suffix>
-                <span class="show-pwd" @click="showPwd">
-                  <div :class="passwordType === 'password' ? 'eye_close' : 'eye'"></div>
-                </span>
-              </template>
-            </el-input>
-          </el-form-item>
-
-          <el-button :loading="loading" type="primary" style="width: 100%; margin-bottom: 30px;height: 42px;"
-            @click="handleLogin">登录</el-button>
-        </el-form>
+    <div class="box_img"></div>
+    <div class="box_school">万载三中</div>
+    <div class="box_wel">欢迎使用智慧校园管理平台</div>
+    <div class="box_login">
+      <div class="login_title">微信扫码登录</div>
+      <div class="login_tips">请使用微信扫描二维码登录</div>
+      <div class="login_code">
+        <qrcode-vue :value="codeUrl" :size="codeSize" level="H" />
+      </div>
+      <div class="login_btn">
+        <div class="btn">单点登录</div>
+        <div class="btn">统一认证</div>
       </div>
     </div>
   </div>
 </template>
 
 <script setup>
-import { ref, reactive, onMounted, onUnmounted } from "vue";
-import { User, Lock } from "@element-plus/icons-vue";
-import { useRouter } from "vue-router";
-import { ElMessage } from "element-plus";
-import { JSEncrypt } from "jsencrypt"; // 加密密码
-import adminApi from "@/api/admin.js";
-import { useStore } from "vuex";
-import axios from "axios";
-
-const router = useRouter();
-const api = ref("");
-const store = useStore();
-const loading = ref(false);
-const ruleFormRef = ref();
-const ruleForm = reactive({
-  user: "",
-  pass: "",
-});
-const passwordType = ref("password")
-const checked = ref(false); // 记住密码
-
-const rules = reactive({
-  user: [{ required: true, message: "请填写用户名", trigger: "blur" }],
-  pass: [{ required: true, message: "请填写密码", trigger: "blur" }],
-});
+import { ref } from "vue";
+import QrcodeVue from "qrcode.vue";
 
-const showPwd = () => {
-  if (passwordType.value === "password") {
-    passwordType.value = "";
-  } else {
-    passwordType.value = "password";
-  }
-  // 重新渲染后使密码框聚焦
-  // this.$nextTick(() => {
-  //   this.$refs.password.focus();
-  // });
-}
-
-const submitForm = (formEl) => {
-  // router.push({
-  //   path: `/seniorCelebrity/order`,
-  // });
-  // sessionStorage.setItem("sidevarItem", 1);
-  // store.commit("indexUp", 1);
-  if (!formEl) return;
-  formEl.validate(async (valid) => {
-    if (valid) {
-      loading.value = true;
-
-      let data = {
-        adminName: ruleForm.user,
-        password: ruleForm.pass,
-      };
-      let res;
-      try {
-        res = await store.dispatch("login", data);
-      } catch (e) {
-        console.log(e);
-      }
-      console.log(res);
-      // sessionStorage.setItem("name", ruleForm.pass);
-      if (res == "success") {
-        router.push({ path: `/seniorCelebrity/order` });
-        store.commit("indexUp", "/seniorCelebrity/order");
-        sessionStorage.setItem("sidevarItem", "/seniorCelebrity/order");
-        ElMessage({
-          type: "success",
-          showClose: true,
-          message: "登录成功",
-          center: true,
-        });
-      } else {
-        loading.value = false;
-        ElMessage({
-          type: "error",
-          showClose: true,
-          message: res.data.data.message,
-          center: true,
-        });
-      }
-    } else {
-      return false;
-    }
-  });
-};
-const Enters = (e) => {
-  // console.log("按键:", e.key);
-  if (e.key == "Enter") {
-    submitForm(ruleFormRef.value);
-  }
-};
-onMounted(() => {
-  api.value = store.state.user.api;
-  if (localStorage.getItem("pass") && localStorage.getItem("user")) {
-    ruleForm.user = localStorage.getItem("user");
-    ruleForm.pass = localStorage.getItem("pass");
-    checked.value = true;
-  }
-  if (localStorage.getItem("user")) {
-    ruleForm.user = localStorage.getItem("user");
-  }
-  document.addEventListener("keyup", Enters);
-});
-onUnmounted(() => {
-  document.removeEventListener("keyup", Enters);
-});
+const codeUrl = ref("123");
+const codeSize = ref(200);
 </script>
 
 <style lang="scss" scoped>
-$bg: #2d3a4b;
-
 .box {
-  width: 100%;
-  height: 100vh;
-  // background: url(@/assets/login.png);
-  background-size: cover;
-  display: flex;
-  align-items: center;
-  justify-content: center;
+  position: relative;
+  width: 1920px;
+  height: 1080px;
+  color: #000;
+  background-image: url(@/assets/school/login_bg.png);
+  background-size: 100% 100%;
+
+  .box_img {
+    position: absolute;
+    top: 54px;
+    left: 62px;
+    width: 56px;
+    height: 56px;
+    border-radius: 50%;
+    background-color: skyblue;
+  }
 
+  .box_school {
+    position: absolute;
+    top: 61px;
+    left: 141px;
+    font-size: 29px;
+    font-weight: bold;
+  }
+
+  .box_wel {
+    position: absolute;
+    top: 193px;
+    left: 256px;
+    font-size: 52.5px;
+    font-weight: bold;
+  }
 
-  .login-container {
-    width: 100vw;
-    height: 100vh;
-    min-width: 1280px;
-    min-height: 800px;
-    background: url(../../assets/items/bg.png);
-    background-size: 100% 100%;
-    overflow: hidden;
+  .box_login {
+    position: absolute;
+    top: 223px;
+    left: 1286px;
+    padding: 65px 0;
+    box-sizing: border-box;
     display: flex;
-    justify-content: center;
+    flex-direction: column;
+    justify-content: space-between;
     align-items: center;
+    width: 426px;
+    height: 536px;
 
-    .contain {
-      width: 71%;
-      height: 65%;
-      display: flex;
-      justify-content: flex-end;
-      align-items: center;
-    }
-
-    .login-form {
-      width: 37%;
-      // margin-top: 310px;
-      // margin-left: 600px;
-      margin-right: 36px;
-    }
-
-    .el-form-item {
-
-      // border: 1px solid rgba(255, 255, 255, 0.1);
-      // background: rgba(0, 0, 0, 0.1);
-      // border-radius: 5px;
-      // color: #454545;
-
-      .el-input {
-        // display: inline-block;
-        // border: 1px solid red;
-
-        :deep(.el-input__wrapper) {
-          width: 92%;
-          height: 42px;
-          background: rgba(0, 0, 0, 0.1);
-          box-shadow: none;
-        }
-
-        img {
-          width: 25px;
-        }
-
-        .el-input__suffix {
-          img {
-            cursor: pointer;
-          }
-        }
-      }
+    .login_title {
+      font-size: 24px;
+      font-weight: bold;
     }
 
-    .svg-container {
-      padding: 6px 5px 6px 15px;
-      vertical-align: middle;
-      width: 30px;
-      color: $bg;
-      display: inline-block;
-
-      .user {
-        width: 20px;
-        height: 20px;
-        background: url(../../assets/items/user.png);
-        background-size: 100% 100%;
-      }
-
-      .password {
-        width: 20px;
-        height: 20px;
-        background: url(../../assets/items/password.png);
-        background-size: 100% 100%;
-      }
+    .login_tips {
+      color: #a6a6a6;
+      font-size: 16px;
     }
 
-    .title-container {
-      position: relative;
-
-      .title {
-        font-size: 28px;
-        margin: 0px auto 40px auto;
-        text-align: center;
-        font-weight: bold;
-      }
+    .login_code {
+      width: 200px;
+      height: 200px;
+      background-color: skyblue;
     }
 
-    .show-pwd {
-      position: absolute;
-      right: 10px;
-      top: 7px;
-      font-size: 16px;
-      cursor: pointer;
-      user-select: none;
-      color: $bg;
-
-      .eye_close {
-        margin-top: 7px;
-        width: 20px;
-        height: 20px;
-        background: url(../../assets/items/eye_close.png);
-        background-size: 100% 100%;
-      }
-
-      .eye {
-        margin-top: 7px;
-        width: 20px;
-        height: 20px;
-        background: url(../../assets/items/eye.png);
-        background-size: 100% 100%;
+    .login_btn {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      width: 210px;
+      height: 40px;
+
+      .btn {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        width: 98px;
+        height: 40px;
+        color: #fff;
+        font-size: 16px;
+        border-radius: 8px;
+        background-color: #0061ff;
       }
     }
   }