Sfoglia il codice sorgente

Merge branch 'master' of http://120.26.64.82:3000/BFFE/CABaggageData2.0

chenjun 2 anni fa
parent
commit
c7c94166b5

+ 0 - 7
src/config/util.js

@@ -67,13 +67,6 @@ export const insertAfter = (newElement, targetElement) => {
   }
 }
 
-/**
- * 生成随机数字
- */
-
-export const createRandom = (lower, upper, fix = 0) => {
-  return ((Math.random() * (upper - lower)) + lower).toFixed(fix)
-}
 /**
  * 格式化时间
  * @param {格式化格式} fmt 如 yyyy-MM-dd hh:mm:ss

+ 0 - 13
src/utils/des.js

@@ -1,18 +1,5 @@
 import cryptoJs from "crypto-js";
 
-//生成唯一标识符
-export const getUuid = () => {
-  let s = [];
-  let hexDigits = "0123456789abcdef";
-  for (let i = 0; i < 36; i++) {
-    s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
-  }
-  s[14] = "4";
-  s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
-  s[8] = s[13] = s[18] = s[23] = "-";
-  return s.join("");
-};
-
 export const sha1_to_base64 = sha1 => {
   let digits =
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

+ 0 - 173
src/utils/socket.js

@@ -1,173 +0,0 @@
-/* eslint-disable no-unused-vars */
-import { Message } from "element-ui";
-import { encryptDes, getUuid, sha1_to_base64 } from "./des.js";
-import { getToken, setToken } from "@/utils/auth";
-class socketClient {
-  wsUrl = "";
-  wsAuto = {};
-  websocket = null;
-  heartBeatTimer = null;
-  lockReconnect = false;
-  errTimer = null;
-  isLoad = true;
-  constructor(wsUrl, wsAuto) {
-    this.wsUrl = wsUrl;
-    this.wsAuto = wsAuto;
-  }
-  // 初始化socket
-  initWebSocket () {
-    return new Promise((resolve, reject) => {
-      this.websocket = new WebSocket(this.wsUrl);
-      this.wsOpen().then((res) => {
-        this.isLoad = true;
-        this.wsSend(this.wsAuto);
-        this.lockReconnect = true;
-        resolve(true)
-        if (this.isLoad == true) {
-          Message({
-            message: "客户端连接成功",
-            type: "success",
-            duration: 5 * 1000,
-          });
-        }
-        // this.heartBeat();
-      });
-      this.websocket.onerror = (evt) => {
-        this.wsReconnect();
-      };
-
-      this.websocket.onclose = (evt) => {
-        if (this.isLoad == true) {
-          Message({
-            message: "客户端断开连接",
-            type: "error",
-            center: true,
-            duration: 5 * 1000,
-          });
-        }
-        this.isLoad = false;
-        this.lockReconnect = false;
-        this.wsReconnect();
-      };
-
-    })
-  }
-  // 重新连接
-  wsReconnect () {
-    if (this.heartBeatTimer) clearInterval(this.heartBeatTimer);
-    if (this.errTimer) clearTimeout(this.errTimer);
-    if (this.lockReconnect) return;
-    let that = this;
-    this.errTimer = setTimeout(() => {
-      that.initWebSocket();
-    }, 1000);
-  }
-  heartBeat () {
-    this.lockReconnect = false;
-    if (this.heartBeatTimer) clearInterval(this.heartBeatTimer);
-    const wsToken = getToken();
-    // if (wsToken) {
-    //   this.heartBeatTimer = setInterval(() => {
-    //     const heatBeat = `{ MN: "Heart", Token: wsToken }`;
-    //     this.wsSend(heatBeat);
-    //   }, 20000);
-    // }
-  }
-  // 打开连接
-  wsOpen () {
-    if (this.websocket) {
-      return new Promise((resolve, reject) => {
-        try {
-          this.websocket.onopen = (evt) => {
-            resolve(evt);
-          };
-        } catch (err) {
-          this.$message.error('连接已经关闭,正在重新连接中...');
-          reject(err);
-        }
-      });
-    }
-  }
-  // 关闭连接
-  wsClose () {
-    if (this.websocket) {
-      this.websocket.close();
-      return new Promise((resolve, reject) => {
-        try {
-          this.websocket.onclose = (evt) => {
-            this.$message.error('客户端断开连接');
-            resolve(evt);
-          };
-        } catch (err) {
-          reject(err);
-        }
-      });
-    }
-  }
-  // 监听消息
-  wsMessage (callback) {
-    // 需要监听的消息路径
-    if (this.websocket) {
-      try {
-        this.websocket.onmessage = (evt) => {
-          // 判断是否有 data 数据
-          if (evt.data) {
-            let data = evt.data;
-            if (this.isJsonString(data)) {
-              callback(JSON.parse(data));
-            }
-          }
-        };
-      } catch (err) {
-        callback(err);
-      }
-    }
-  }
-  // 发送消息
-  wsSend (options, isFile = false) {
-    if (this.websocket && this.websocket.readyState === 1) {
-      try {
-        if (isFile) {
-          let params = { ...options };
-          params.RequestId = getUuid();
-          this.websocket.send(params);
-        } else {
-          this.websocket.send(JSON.stringify(options));
-        }
-      } catch (e) {
-        Message({
-          message: e.message,
-          type: "error",
-          duration: 5 * 1000,
-        });
-      }
-    }
-  }
-  // 连接因错误而关闭时触发
-  wsOnerror () {
-    if (this.websocket) {
-      return new Promise((resolve, reject) => {
-        try {
-          this.websocket.onerror = (evt) => {
-            resolve(evt);
-          };
-        } catch (err) {
-          reject(err);
-        }
-      });
-    }
-  }
-  // 判断是否是json字符串
-  isJsonString (str) {
-    try {
-      if (typeof JSON.parse(str) == "object") {
-        return true;
-      }
-    } catch (e) {
-
-    }
-    return false;
-  }
-}
-
-export { socketClient };

+ 0 - 100
src/utils/validate.js

@@ -181,106 +181,6 @@ export function findarrays (ar, feature, v) {
   return arr
 }
 
-// 随机长度
-function randomNum (start, end) {
-  return Math.floor(Math.random() * (Number(end) - Number(start)) + start)
-}
-
-// 字母随机
-function randomAlp (arr, count) {
-  let shuffled = arr.slice(0),
-    i = arr.length,
-    min = i - count,
-    temp,
-    index
-  while (i-- > min) {
-    index = Math.floor((i + 1) * Math.random())
-    temp = shuffled[index]
-    shuffled[index] = shuffled[i]
-    shuffled[i] = temp
-  }
-  return shuffled.slice(min)
-}
-
-/**
- * @param {minLen} 密码最小长度
- * @param {maxLen} 密码最大长度
- * @param {struc} 密码规则
- * @returns {Object}
- * 4位密码规则 1111 = 大写 小写 特殊字符 数字 都开启
- */
-export function pwdProduce (minLen, maxLen, struc) {
-  // 密码规则转化
-  const pwdStruc = typeof struc === 'string' ? struc.split('') : `${struc}`.split('')
-  // 字母
-  const alphabet = 'abcdefghijklmnopqrstuvwxyz'
-  // 特殊字符
-  const special = ['~', '!', '@', '#', '$', '%', '^', '&', '*', '_', '+', '.']
-  // 数字
-  const numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
-  // 密码随机长度
-  const pwdLen = randomNum(minLen, maxLen)
-  const datas = []
-
-  if (pwdStruc.length) {
-    let typeLong = Number(pwdStruc[0]) + Number(pwdStruc[1]) + Number(pwdStruc[2]) + Number(pwdStruc[3])
-    let passLong = Math.ceil(pwdLen / typeLong)
-    let dis = ''
-    if (pwdStruc[0] == 1) {
-      let arr = alphabet.toLocaleUpperCase().split('')
-      let v = randomAlp(arr, passLong)
-      for (let i = 0; i < passLong; i++) {
-        dis += v[i]
-      }
-    }
-    if (pwdStruc[1] == 1) {
-      let arr = alphabet.split('')
-      let v = randomAlp(arr, passLong)
-      for (let i = 0; i < passLong; i++) {
-        dis += v[i]
-      }
-    }
-    if (pwdStruc[2] == 1) {
-      let arr = special
-      let v = randomAlp(arr, passLong)
-      for (let i = 0; i < passLong; i++) {
-        dis += v[i]
-      }
-    }
-    if (pwdStruc[3] == 1) {
-      let arr = numbers
-      let v = randomAlp(arr, passLong)
-      for (let i = 0; i < passLong; i++) {
-        dis += v[i]
-      }
-    }
-    return dis
-    // 缓存当前的密码规则
-    // pwdStruc.forEach((item, index) => {
-    //   if (item == 1) {
-    //     datas.push(index)
-    //   }
-    // })
-    // // 只有一种规则时
-    // if (datas.length === 1) {
-    //   const num = datas[0]
-    //   const dis = randomAlp(alphabet.split('')).splice(0, pwdLen).join('')
-    //   switch (num) {
-    //     case 0:
-    //       return dis.toLocaleUpperCase()
-    //       break;
-    //     case 1:
-    //       return dis
-    //       break;
-    //     default:
-    //       break;
-    //   }
-    // }
-  } else {
-    return new Error('密码规则转换失败')
-  }
-}
-
 // 表单输入长度验证
 function getRealLength (string) {
   let realLength = 0,

+ 0 - 5
src/views/accountGroupManagement/components/accountHome.vue

@@ -91,7 +91,6 @@ import Search from "@/layout/components/Search";
 import Dialog from "@/layout/components/Dialog";
 import NoData from "@/components/nodata";
 import { GetAccountList, ChangeUserStatus, delAccount, getAccountDetails, editAccount, addAccount } from "@/api/Account";
-import { pwdProduce } from "@/utils/validate";
 import { mapGetters } from "vuex";
 import { GeneralDataReception, Query } from "@/api/dataIntegration";
 import MD5 from "blueimp-md5";
@@ -168,10 +167,6 @@ export default {
     }
   },
   methods: {
-    // 随机生成密码
-    resetPwd () {
-      this.ruleForm.PassWord = pwdProduce(this.pwdLengthBegin, this.pwdLengthEnd, this.pwdStruc);
-    },
     // 编辑账号
     async saveEditAccount () {
       try {

+ 1 - 7
src/views/accountManagement/components/accountEdit.vue

@@ -33,7 +33,7 @@
             <el-input v-model="accountForm.pwd" placeholder="*******" size="small" disabled />
           </el-form-item>
           <el-form-item>
-            <el-button v-is="doesAccountExist ? ['userupdate_btn_re_pwd'] : []" size="small" type="primary" class="btn-reset-pwd" @click="resetPwd">重置密码</el-button>
+            <el-button v-is="doesAccountExist ? ['userupdate_btn_re_pwd'] : []" size="small" type="primary" class="btn-reset-pwd">重置密码</el-button>
           </el-form-item>
           <el-form-item label="描述" prop="desc">
             <el-input v-model="accountForm.desc" class="desc" maxlength="128" placeholder="描述内容···" size="small" />
@@ -156,7 +156,6 @@ import PermissionList from "@/components/permissionlist/index.vue";
 
 import { RoleAuths } from "@/api/apiAuthority";
 import { getAccountDetails, editAccount, addAccount } from "@/api/Account.js";
-import { pwdProduce } from "@/utils/validate";
 import { mapGetters } from "vuex";
 
 export default {
@@ -240,7 +239,6 @@ export default {
       this.userId = this.$route.query.userId;
       this.getAccountInfo();
     } else {
-      this.resetPwd();
       this.roleType = "onlyRole";
       this.queryType = "all";
     }
@@ -298,10 +296,6 @@ export default {
 
       }
     },
-    // 随机生成密码
-    resetPwd () {
-      this.accountForm.pwd = pwdProduce(this.pwdLengthBegin, this.pwdLengthEnd, this.pwdStruc);
-    },
     // 获取当前权限树勾选项
     getPermissionTreeChecked (arr) {
       this.permissionTreeChckedTemp = arr.map((auth) => auth.AuthList);

+ 1 - 5
src/views/accountManagement/components/accountHome.vue

@@ -130,7 +130,7 @@ import Search from "@/layout/components/Search";
 import Dialog from "@/layout/components/Dialog";
 import NoData from "@/components/nodata";
 import { GetAccountList, ChangeUserStatus, delAccount, getAccountDetails, editAccount, addAccount } from "@/api/Account";
-import { pwdProduce, translateDataToTreeAll } from "@/utils/validate";
+import { translateDataToTreeAll } from "@/utils/validate";
 import { mapGetters } from "vuex";
 import { GeneralDataReception, Query } from "@/api/dataIntegration";
 import MD5 from "blueimp-md5";
@@ -220,10 +220,6 @@ export default {
     this.getGroupSelect();
   },
   methods: {
-    // 随机生成密码
-    resetPwd () {
-      this.ruleForm.PassWord = pwdProduce(this.pwdLengthBegin, this.pwdLengthEnd, this.pwdStruc);
-    },
     //
     async getGroupSelect () {
       const res = await Query({

+ 4 - 16
src/views/systemSettings/views/warningSet/warningEdit.vue

@@ -24,10 +24,6 @@
             <el-col :span="6">
               <div class="aviName">
                 <span class="aviP">航司二字码</span>
-                <!-- <el-input
-                  v-model="tableFormer.IATACode"
-                  placeholder="请输入航司二字码"
-                ></el-input> -->
                 <el-select
                   v-model="tableFormer.IATACode"
                   class="input-shadow"
@@ -63,10 +59,6 @@
                     :value="item.planDepartureApt"
                   />
                 </el-select>
-                <!-- <el-input
-                  v-model="tableFormer.departmentAirport"
-                  placeholder="请输入起飞机场"
-                ></el-input> -->
               </div>
             </el-col>
             <el-col :span="6">
@@ -87,10 +79,6 @@
                     :value="item.planDepartureApt"
                   />
                 </el-select>
-                <!-- <el-input
-                  v-model="tableFormer.landingAirport"
-                  placeholder="请输入起飞机场"
-                ></el-input> -->
               </div>
             </el-col>
             <el-col :span="6">
@@ -315,9 +303,9 @@
                     >
                       <el-option
                         v-for="item in tableOptions[item.columnName]"
-                        :key="item.v"
-                        :label="item.k"
-                        :value="item.v"
+                        :key="item.v ? item.v : item.planDepartureApt"
+                        :label="item.k ? item.k : item.planDepartureApt"
+                        :value="item.v ? item.v : item.planDepartureApt"
                       >
                       </el-option>
                     </el-select>
@@ -487,6 +475,7 @@ export default {
       dataContent: [],
       tableCols: [],
       tableColsCopy: [],
+      tableColsCopys: [],
       tableForm: {}, //弹框表单
       width: "560px",
       flag: false,
@@ -537,7 +526,6 @@ export default {
         arr.push(this.$route.query.id);
         const { code, returnData } = await Query({
           id: DATACONTENT_ID.sysServiceWarnId,
-          needPage: ++this.page,
           dataContent: arr,
         });
         if (code == 0) {

+ 3 - 4
src/views/systemSettings/views/warningSet/warningSet.vue

@@ -78,9 +78,9 @@
                     >
                       <el-option
                         v-for="item in tableOptions[item.columnName]"
-                        :key="item.v"
-                        :label="item.k"
-                        :value="item.v"
+                        :key="item.v ? item.v : item.planDepartureApt"
+                        :label="item.k ? item.k : item.planDepartureApt"
+                        :value="item.v ? item.v : item.planDepartureApt"
                       >
                       </el-option>
                     </el-select>
@@ -416,7 +416,6 @@ export default {
     handleAdd() {
       this.flag = true;
       this.tableType = "add";
-      this.getAirPortData();
     },
     //获取航司信息列表
     async getAirlines() {