From 146caf1178ce149465a5ea8f2cc00546e490fa55 Mon Sep 17 00:00:00 2001 From: liangkun Date: Wed, 22 Mar 2023 10:41:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E8=A1=A8=E5=8D=95=E5=90=AB=E5=AD=90=E8=A1=A8?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E6=8A=A5from=E9=99=84=E8=BF=91?= =?UTF-8?q?=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scheme/FormSchemeBLL.cs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs index 2964baaf7..4cff056d4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs @@ -1070,22 +1070,25 @@ namespace Learun.Application.Form string querySql = " SELECT "; if (tableComponts.ContainsKey(tableItem.data.name) && !res.ContainsKey(tableItem.data.name)) { - foreach (var compont in tableComponts[tableItem.data.name]) + DataTable dt = null; + if (tableComponts[tableItem.data.name].Count > 0) { - querySql += compont.field + " , "; - } - - if (string.IsNullOrEmpty(keyValue)) - { - keyValue = pData[tableItem.data.relationField]; - } + foreach (var compont in tableComponts[tableItem.data.name]) + { + querySql += compont.field + " , "; + } - querySql = querySql.Remove(querySql.Length - 2, 2); - querySql += " FROM " + tableItem.data.name + " WHERE " + tableItem.data.field + " = @keyValue"; + if (string.IsNullOrEmpty(keyValue)) + { + keyValue = pData[tableItem.data.relationField]; + } - DataTable dt = databaseLinkIBLL.FindTable(dbId, querySql, new { keyValue = keyValue }); - res.Add(tableItem.data.name, dt); + querySql = querySql.Remove(querySql.Length - 2, 2); + querySql += " FROM " + tableItem.data.name + " WHERE " + tableItem.data.field + " = @keyValue"; + dt = databaseLinkIBLL.FindTable(dbId, querySql, new { keyValue = keyValue }); + res.Add(tableItem.data.name, dt); + } // 获取它的从表数据 if (tableItem.ChildNodes.Count > 0 && dt.Rows.Count > 0) { From 455fd66b5dec95256fffcb87548a05bd57243f33 Mon Sep 17 00:00:00 2001 From: "CAO_RENXING\\19348" Date: Wed, 22 Mar 2023 16:49:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?app2.0=20=E6=89=AB=E7=A0=81=E7=AD=BE?= =?UTF-8?q?=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LearunApp-2.2.0/components/scanCode.vue | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/scanCode.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/scanCode.vue index 1df50df26..7f1daeb33 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/scanCode.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/scanCode.vue @@ -8,7 +8,7 @@ props:{}, data() { return { - scanCodeReady:false, + wxObject:null, }; }, mounted() { @@ -17,12 +17,15 @@ methods: { setConfig() { const promise = new Promise((resolve, reject) => { - this.HTTP_GET("weixinapi/getweixinwebaccess_token?url=" + encodeURIComponent(window.location.href)).then((success)=>{ + // let url = window.location.href + let url = /(Android)/i.test(navigator.userAgent) ? location.href.split('#')[0] : window.localStorage.getItem('scanUrl') + this.HTTP_GET("weixinapi/getweixinwebaccess_token?url=" + encodeURIComponent(url)).then((success)=>{ if(!success){ resolve(false) return } - wx.config({ + this.wxObject = wx + this.wxObject.config({ debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: success.appid, // 必填,公众号的唯一标识 timestamp: success.timestamp, // 必填,生成签名的时间戳 @@ -30,8 +33,11 @@ signature: success.certificate, // 必填,签名 jsApiList: ["scanQRCode"] // 必填,需要使用的JS接口列表 }); - wx.ready(() => { - this.scanCodeReady = true + this.wxObject.ready(() => { + this.TOAST("扫码初始化成功") + }) + this.wxObject.error(() => { + this.TOAST("扫码初始化失败") }) }) }) @@ -39,19 +45,23 @@ }, scanCode(){ return new Promise((resolve)=>{ - if(!this.scanCodeReady){ + if(!this.wxObject||!this.wxObject.scanQRCode){ + this.TOAST("无效方法") resolve(false) + }else{ + this.TOAST("正在调用扫码...") } - wx.scanQRCode({ + this.wxObject.scanQRCode({ needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果, scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有 - success: function (res) { + success: (res) => { + this.TOAST("方法调用成功") var result = res.resultStr; // 当 needResult 为 1 时,扫码返回的结果 var resultArr = result.split(','); // 扫描结果以逗号分割数组 var codeContent = resultArr[resultArr.length - 1]; // 获取数组最后一个元素,也就是最终的内容 resolve({result:codeContent}) }, - fail: function (res) { + fail: (res) =>{ this.TOAST("调用扫码失败") resolve(false) }