Browse Source

新增跳转后台管理系统功能

baiyanting 1 year ago
parent
commit
14b0e2c4a9

+ 6 - 6
.env.development

@@ -1,10 +1,10 @@
-# VUE_APP_API=http://10.81.3.155:8020
-# VUE_APP_API=http://192.168.1.105:6060
-VUE_APP_API=http://10.81.3.153:6060
 
-# 经济运行 安全监视 
-# VUE_APP_Matrix=http://192.168.1.105:6060
-VUE_APP_Matrix=http://10.81.3.153:6060
+VUE_APP_API=http://192.168.1.108:6060
+VUE_APP_Matrix=http://192.168.1.108:6060
+
+# VUE_APP_API=http://10.81.3.153:6060
+# # 经济运行 安全监视 
+# VUE_APP_Matrix=http://10.81.3.153:6060
 
 
 VUE_APP_ADAPTERURL=http://10.81.3.155:8011

+ 1 - 7
package.json

@@ -12,21 +12,16 @@
     "fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit"
   },
   "dependencies": {
-
     "14": "^3.1.6",
-
-
     "@antv/x6": "^1.24.4",
     "@arcgis/core": "^4.19.3",
     "@element-plus/icons-vue": "^0.2.4",
     "@open-wc/webpack-import-meta-loader": "git+https://github.com/KmjKoishi/webpack-import-meta-loader-fixed.git",
     "animate.css": "3.5",
     "axios": "^0.21.1",
-
     "cesium": "1.78.0",
     "core-js": "^3.6.5",
     "cross-env": "^7.0.3",
-
     "echarts": "^5.1.1",
     "echarts-gl": "^2.0.4",
     "echarts-stat": "^1.2.0",
@@ -34,10 +29,9 @@
     "file-saver": "^2.0.5",
     "font-awesome": "^4.7.0",
     "html2canvas": "^1.0.0-rc.7",
-
     "increase-memory-limit": "^1.0.7",
-
     "jquery": "^3.6.0",
+    "jsencrypt": "^3.3.2",
     "jspdf": "^2.3.1",
     "jszip": "^3.7.1",
     "papaparse": "^5.3.1",

File diff suppressed because it is too large
+ 1 - 0
src/assets/icon/svg/admin-set.svg


+ 29 - 0
src/utills/jsencrypt.js

@@ -0,0 +1,29 @@
+import JSEncrypt from 'jsencrypt/bin/jsencrypt.min'
+
+// 密钥对生成 http://web.chacuo.net/netrsakeypair
+
+const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' +
+  'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
+
+const privateKey = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' +
+  '7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n' +
+  'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n' +
+  'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n' +
+  'cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n' +
+  'DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n' +
+  'YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n' +
+  'UP8iWi1Qw0Y='
+
+// 加密
+export function encrypt(txt) {
+  const encryptor = new JSEncrypt()
+  encryptor.setPublicKey(publicKey) // 设置公钥
+  return encryptor.encrypt(txt) // 对数据进行加密
+}
+
+// 解密
+export function decrypt(txt) {
+  const encryptor = new JSEncrypt()
+  encryptor.setPrivateKey(privateKey) // 设置私钥
+  return encryptor.decrypt(txt) // 对数据进行解密
+}

+ 55 - 64
src/views/economicsOperation/analyse/standAloneAnalyse/windDetailDialog.vue

@@ -42,57 +42,51 @@
         <div class="query-items">
           <div class="query-item">
             <div class="label">风场:</div>
-            <div class="search-input">
-              <el-select
-                v-model="wpId"
-                clearable
-                placeholder="请选择"
-                popper-class="select"
-                @change="changeStationsVal"
-              >
-                <el-option
-                  v-for="item in wpArray"
-                  :key="item.id"
-                  :value="item.id"
-                  :label="item.name"
-                />
-              </el-select>
-            </div>
+            <el-select
+              v-model="wpId"
+              clearable
+              placeholder="请选择"
+              @change="changeStationsVal"
+            >
+              <el-option
+                v-for="item in wpArray"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              />
+            </el-select>
           </div>
           <div class="query-item">
             <div class="label">风机:</div>
-            <div class="search-input">
-              <el-select
-                v-model="wtId"
-                clearable
-                placeholder="请选择"
-                popper-class="select"
-              >
-                <el-option
-                  v-for="item in wtArray"
-                  :key="item.id"
-                  :value="item.id"
-                  :label="item.aname"
-                />
-              </el-select>
-            </div>
+            <el-select
+              v-model="wtId"
+              clearable
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in wtArray"
+                :key="item.id"
+                :value="item.id"
+                :label="item.aname"
+              />
+            </el-select>
           </div>
           <div class="query-item">
             <div class="label">日期:</div>
-            <div class="search-input ssTime">
-              <el-date-picker
-                v-model="recorddate"
-                type="date"
-                value-format="YYYY-MM-DD"
-                placeholder="选择日期"
-                popper-class="date-select"
-              >
-              </el-date-picker>
-            </div>
+            <el-date-picker
+              v-model="recorddate"
+              type="date"
+              value-format="YYYY-MM-DD"
+              placeholder="选择日期"
+              size="mini"
+              popper-class="date-select"
+            >
+            </el-date-picker>
           </div>
         </div>
         <div class="query-actions">
-          <el-button class="seach" @click="search">搜索</el-button>
+          <el-button class="seach" size="mini" @click="search">搜索</el-button>
         </div>
       </div>
     </div>
@@ -114,7 +108,7 @@
           :height="'15vh'"
           :newbarData="powerChartData"
           :newlineData="powerChartLineData"
-          :units="['(kWh)']"
+          :units="['(kWh)', '(m/s)']"
           :showLegend="true"
         />
       </panel>
@@ -1253,6 +1247,7 @@ export default {
         recorddate: that.recorddate,
       };
       const { data: datas } = await getApifindRealPowerCharBy24(params);
+      console.log(datas);
       if (datas && datas.data.length > 0) {
         const keyArray = ["value1", "value2", "value3", "value4", "value5"];
         let powerChartData = [
@@ -1297,6 +1292,7 @@ export default {
           let keyEle = keyArray[i];
           for (let j = 0; j < datas.data.length; j++) {
             let ele = datas.data[j];
+            // console.log(ele);
             powerChartData[i].value.push({
               text: new Date(ele.time).formatDate("hh:mm"),
               value: ele[keyEle],
@@ -1304,6 +1300,7 @@ export default {
             powerChartLineData.data.push(ele.value6);
           }
         }
+        console.log(powerChartData, powerChartLineData);
         that.powerChartData = powerChartData;
         that.powerChartLineData = powerChartLineData;
       }
@@ -1734,7 +1731,6 @@ export default {
 
     // 搜索
     search() {
-
       if (this.tabIndex === 0) {
         this.getLostChartData();
         this.getPowerChartData();
@@ -1795,51 +1791,46 @@ export default {
         height: 33px;
         line-height: 33px;
         margin-right: 8px;
-        color: #fff;
+        color: #b9b9b9;
         font-size: 1.296vh;
         background: fade(#606769, 20);
         border: 1px solid fade(#606769, 20);
         border-radius: 20px;
         &:hover,
         &.active {
-          background: fade(#0046c7, 80);
-          border: 1px solid #0046c7;
-          color: #b9b9b9;
+          background: rgba(5, 187, 76, 0.6);
+          //   border: 1px solid #0046c7;
+          color: #fff;
           cursor: pointer;
         }
       }
     }
     .windDetailseach {
       display: flex;
+
       .query-items {
         flex: 0 0 auto;
         display: flex;
+        align-items: center;
         .query-item {
           flex: 0 0 auto;
           display: flex;
-          margin: 0 1.4815vh;
+          align-items: center;
           .label {
             color: #fff;
-            position: relative;
-            top: 2px;
-          }
-          .ssTime {
-            position: relative;
-            top: -8px;
           }
         }
       }
       .query-actions {
         .el-button {
-          height: 25px;
-          line-height: 25px;
-          background: fade(#0046c7, 20);
-          border: 1px solid #0046c7;
-          color: #b9b9b9;
-          border-radius: 20px;
-          span {
-            position: relative;
-            top: -10px;
+          background: rgba(5, 187, 76, 0.6);
+          border: 1px solid #3b6c53;
+          border-radius: 13px;
+          color: #fff;
+          &:hover {
+            background: rgba(5, 187, 76, 0.9);
+            border-radius: 13px;
+            color: #fff;
           }
         }
       }

+ 21 - 1
src/views/layout/Header.vue

@@ -38,6 +38,13 @@
           </template>
         </el-dropdown>
       </li>
+      <li class="header-menu-user-title">
+        <el-tooltip effect="dark" content="后台管理系统" placement="bottom">
+          <i class="svg-icon svg-icon-sm svg-icon-white" @click="goToAdmin">
+            <SvgIcon svgid="svg-admin-set"></SvgIcon>
+          </i>
+        </el-tooltip>
+      </li>
     </ul>
   </div>
 </template>
@@ -46,6 +53,8 @@ import $ from "jquery";
 import { getCookie } from "@/utills/auth";
 import tools from "../../tools/encryption.js";
 import { logout } from "@/api/common.js";
+import { encrypt, decrypt } from "@/utills/jsencrypt.js";
+import SvgIcon from "@/components/coms/icon/svg-icon.vue";
 export default {
   data() {
     return {
@@ -130,6 +139,7 @@ export default {
       firsttime: 0,
     };
   },
+  components: { SvgIcon },
   mounted() {
     let that = this;
     $(document).keydown((event) => {
@@ -230,6 +240,15 @@ export default {
         });
       }
     },
+    // 跳转到管理系统
+    goToAdmin() {
+      let jiami = encrypt(getCookie("jiami")).replace(/\+/g, " ");
+    //   console.log(decrypt(jiami), jiami);
+      let url = `http://10.81.3.127:8083/#/check?username=${getCookie(
+        "username"
+      )}&jiami=${jiami}`;
+      window.open(url);
+    },
   },
 
   watch: {
@@ -386,7 +405,8 @@ export default {
     margin: 0;
     padding: 0;
     list-style: none;
-
+    display: flex;
+    align-items: center;
     .header-menu-user-title {
       display: flex;
       align-items: center;

+ 2 - 2
src/views/layout/login-page.vue

@@ -103,8 +103,9 @@ export default {
       that.$refs.loginRef.validate((valid) => {
         if (!valid) return;
         that.loading = true;
+        Cookies.set("username", that.loginForm.username, { expires: 300 });
+        Cookies.set("jiami", that.loginForm.password, { expires: 300 });
         if (that.loginForm.rememberMe) {
-          Cookies.set("username", that.loginForm.username, { expires: 300 });
           Cookies.set("password", Base64.encode(that.loginForm.password), {
             expires: 300,
           });
@@ -113,7 +114,6 @@ export default {
           });
         } else {
           // 否则移除
-          Cookies.remove("username");
           Cookies.remove("password");
           Cookies.remove("rememberMe");
         }