From 0481353111afb43a2322e18530dde26f1d841ead Mon Sep 17 00:00:00 2001 From: yanghb <yanghb> Date: 星期五, 21 四月 2023 11:15:34 +0800 Subject: [PATCH] 代码调整 --- ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tOrderPrivateCar/tOrderPrivateCar.js | 87 +++++++++++++++++++++++-------------------- 1 files changed, 46 insertions(+), 41 deletions(-) diff --git a/ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tOrderPrivateCar/tOrderPrivateCar.js b/ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tOrderPrivateCar/tOrderPrivateCar.js index 0408993..b25fd7a 100644 --- a/ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tOrderPrivateCar/tOrderPrivateCar.js +++ b/ManagementTravel/guns-admin/src/main/webapp/static/modular/system/tOrderPrivateCar/tOrderPrivateCar.js @@ -1,5 +1,5 @@ /** - * 快车订单管理初始化 + * 专车订单管理初始化 */ var TOrderPrivateCar = { id: "TOrderPrivateCarTable", //表格id @@ -53,21 +53,6 @@ return btn; } }, - {title: '订单类型', field: 'rideType', visible: true, align: 'center', valign: 'middle', - formatter: function (value, row) { - var btn = ""; - if(row.rideType != '' && row.rideType != null) { - if (row.rideType == 1){ - btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="独享订单" onfocus="TUser.tooltip()">独享订单</p>'] - } else if (row.rideType == 2){ - btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="一口价订单" onfocus="TUser.tooltip()">一口价订单</p>'] - } else if (row.rideType == 3){ - btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="拼车订单" onfocus="TUser.tooltip()">拼车订单</p>'] - } - } - return btn; - } - }, {title: '乘车时间', field: 'travelTime', visible: true, align: 'center', valign: 'middle',width:'10%', formatter: function (value, row) { var btn = ""; @@ -92,7 +77,7 @@ formatter: function (value, row) { var btn = ""; if(row.userPhone != '' && row.userPhone != null) { - btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.userPhone + '" onfocus="TUser.tooltip()">' + row.userPhone + '</p>'] + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + decryptAES(row.userPhone) + '" onfocus="TUser.tooltip()">' + decryptAES(row.userPhone) + '</p>'] } return btn; } @@ -242,29 +227,13 @@ }; /** - * 添加快车订单 - */ -TOrderPrivateCar.addOrder =function(){ - var index = layer.open({ - type: 2, - title: '添加快车订单', - area: ['100%', '100%'], //宽高 - fix: false, //不固定 - maxmin: true, - content: Feng.ctxPath + '/tOrderPrivateCar/tOrderPrivateCar_addOrder' - }); - this.layerIndex = index; - -}; - -/** - * 打开查看快车订单详情 + * 打开查看专车订单详情 */ TOrderPrivateCar.orderDetail = function () { if (this.check()) { var index = layer.open({ type: 2, - title: '快车订单详情', + title: '专车订单详情', area: ['100%', '100%'], //宽高 fix: false, //不固定 maxmin: true, @@ -323,7 +292,7 @@ if (this.check()) { var index = layer.open({ type: 2, - title: '快车订单轨迹', + title: '专车订单轨迹', area: ['100%', '100%'], //宽高 fix: false, //不固定 maxmin: true, @@ -335,7 +304,7 @@ /** - * 删除快车订单 + * 删除专车订单 */ TOrderPrivateCar.deleteOrder = function () { if (this.check()) { @@ -370,8 +339,46 @@ } }; + +var key = CryptoJS.enc.Utf8.parse("xqT86jictTPpHMem"); +var iv = CryptoJS.enc.Utf8.parse("xqT86jicxqT86jic"); + +//aes加密 +function encryptAES(context) { + if(null == context || '' == context){ + return context; + } + var encrypted = ''; + if (typeof(context) == 'string') { + + }else if(typeof(context) == 'object'){ + context = JSON.stringify(context); + } + var srcs = CryptoJS.enc.Utf8.parse(context); + encrypted = CryptoJS.AES.encrypt(srcs, key, { + iv: iv, + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7 + }); + return encrypted.toString(); +} +// aes解密 +function decryptAES(context) { + if(null == context || '' == context){ + return context; + } + var decrypt = CryptoJS.AES.decrypt(context, key, { + iv: iv, + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7 + }); + var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8); + return decryptedStr.toString(); +} + + /** - * 查询快车订单列表 + * 查询专车订单列表 */ TOrderPrivateCar.search = function () { var queryData = {}; @@ -379,13 +386,12 @@ queryData['orderNum'] = $("#orderNum").val(); queryData['orderSource'] = $("#orderSource").val(); queryData['userName'] = $("#userName").val(); - queryData['userPhone'] = $("#userPhone").val(); + queryData['userPhone'] = encryptAES($("#userPhone").val()); queryData['passengers'] = $("#passengers").val(); queryData['passengersPhone'] = $("#passengersPhone").val(); queryData['serverCarModelId'] = $("#serverCarModelId").val(); queryData['driver'] = $("#driver").val(); queryData['state'] = $("#state").val(); - queryData['rideType'] = $('#rideType').val(); TOrderPrivateCar.table.refresh({query: queryData}); }; @@ -400,7 +406,6 @@ $("#serverCarModelId").val(""); $("#driver").val(""); $("#state").val(""); - $('#rideType').val(''); TOrderPrivateCar.search(); }; -- Gitblit v1.7.1