From a8bc5e07ea3ee09e51005b764ed3f2dba74f5ed4 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Fri, 17 Jan 2025 16:53:34 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=89=AB=E6=8F=8F=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E7=A0=81=E8=B7=B3=E8=BD=AC=E8=A1=A8=E5=8D=95=E5=8D=95=E6=9D=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=AF=A6=E6=83=85=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/formTable/page/cardPage.vue | 144 +++++++++++++++++++++++++- 1 file changed, 141 insertions(+), 3 deletions(-) diff --git a/src/views/formTable/page/cardPage.vue b/src/views/formTable/page/cardPage.vue index 60db50a..dab8100 100644 --- a/src/views/formTable/page/cardPage.vue +++ b/src/views/formTable/page/cardPage.vue @@ -358,7 +358,125 @@ const columnsFilter = computed(() => { const searchQuery = computed(() => { return json2string(props.stateListInfo.searchData); }); +//liwenxuan 20250117 二维码跳转表单单条数据详情展示 start +const qrJumpGetPageData = (qrDetailId: string) => { + let qrJumpSearchData = [{"id":"id","label":"Id","field":"id","type":"bigint(20)","attribute":"","pattern":"bigint","fieldClass":"id","activeValue":"","inactiveValue":"","config":{"optionsType":0},"control":{"optionsValue3Formid":"","optionsValue3Field":""},"options":[],"isSearch":true,"value":qrDetailId}] + loadText.value = "数据加载中,请稍后......" + loadingList.value = true + console.log(searchQuery.value) + let sendData = { + formId: props.appId, + page:1, + pagesize:1, + searchData:json2string(qrJumpSearchData) + } + + state.loading = true; + gainFormPageListCont(sendData) + .then((data) => { + console.log("获取列表详细信息----------ee------->",data.data) + // tableDataList.value = data.data.list; + if(Array.isArray(data.data.list)){ + + //liwenxuan 关联表单 start + + //liwenxuan 关联表单数据获取 start + let dataList = data; + //console.log(dataList) + asfDetails = props.stateListInfo.tableData.columns.filter((item: any) => { + return item.fieldClass == "associatedForms"; + }); + + if (asfDetails.length > 0 && data.data.list != null) { + //console.log(data.data.list) + //拼装参数,asf值对象数组 + asfQueryParams = []; + for (let j = 0; j < asfDetails.length; j++) { + let asfQueryParamsItem: any = {}; + //console.log(asfDetails[j]) + asfQueryParamsItem.formId = asfDetails[j].control.formid; + asfQueryParamsItem.field = asfDetails[j].field; + + let asfToSelectIds = []; + // console.log(data.data.list) + for (let i = 0; i < data.data.list.length; i++) { + let asfMasterAndAsfId: any = {}; + asfMasterAndAsfId.asfId = data.data.list[i][asfDetails[j].field]; + asfMasterAndAsfId.asfMasterId = data.data.list[i].id; + + asfToSelectIds.push(asfMasterAndAsfId); + } + asfQueryParamsItem.asfToSelectIds = asfToSelectIds; + asfQueryParams.push(asfQueryParamsItem); + } + let queryCount = 0; + for (let i = 0; i < asfQueryParams[0].asfToSelectIds.length; i++) { + if (asfQueryParams[0].asfToSelectIds[i].asfId != "") { + queryCount++; + } + } + //console.log(asfQueryParams) + if (queryCount > 0) { + getAsfDataTitlesByIds(asfQueryParams).then(({ data }) => { + //console.log(data) + for (let i = 0; i < dataList.data.list.length; i++) { + //console.log(dataList.data.list[i]) + for (let j = 0; j < data.length; j++) { + //console.log(data[j]) + for (let n = 0; n < data[j].list.length; n++) { + if (dataList.data.list[i].id == data[j].list[n].asfMasterId) { + dataList.data.list[i][data[j].field] = data[j].list[n].label; + } + //console.log(data[j].list[n]) + } + } + } + //tableDataList.value = dataList.data.list; + tableDataList.value.push(... dataList.data.list) + }); + } else { + //tableDataList.value = data.data.list; + tableDataList.value.push(...data.data.list) + } + } else { + //tableDataList.value = data.data.list; + tableDataList.value.push(...data.data.list) + } + + //tableDataList.value = data.data.list + //liwenxuan 关联表单数据获取 end + + //liwenxuan 关联表单 end + + /* tableDataList.value.push(...data.data.list) + console.log(tableDataList.value) */ + } + + pageTotal.value = pageTotal.value + data.data.count + if(data.data.total > 0){ + if(pageTotal.value < data.data.total){ + let pagenum = state.pagesize - data.data.count + if (pagenum > 0) { + loadText.value = "" + loadingList.value = true + }else{ + loadText.value = "" + loadingList.value = false + } + }else{ + loadText.value = "" + loadingList.value = true + } + + }else{ + loadText.value = "此选项没有数据!" + loadingList.value = true + } + + }) +} +//liwenxuan 20250117 二维码跳转表单单条数据详情展示 end /** @ 作者: 秦东 @ 时间: 2024-11-05 10:15:38 @@ -367,6 +485,7 @@ const searchQuery = computed(() => { const getPageData = () => { loadText.value = "数据加载中,请稍后......" loadingList.value = true + console.log(searchQuery.value) let sendData = { formId: props.appId, page: state.page, @@ -479,10 +598,28 @@ const getPageData = () => { }) } +// 使用 ref 来存储 URL 信息 +const fullUrl = ref(window.location.href); + onMounted(()=>{ nextTick(()=>{ - requeryList() + console.log(fullUrl.value) + if(fullUrl.value.includes("&qrDetailId=")){ + let urlSplitArray = fullUrl.value.split("&qrDetailId=") + let qrDetailId = urlSplitArray[1] + qrJumpGetPageData(qrDetailId) + + // + setTimeout(() => { + openLook(tableDataList.value[0]) + }, 500); + + }else{ + requeryList() + } }) + + }) @@ -715,11 +852,12 @@ defineExpose({ tableDataList =========> {{ tableDataList }}



--> - + - + +
状态 From 6b58d051f9264709a4a06764e9662c7817c1d372 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Thu, 23 Jan 2025 13:21:43 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E7=A0=81=E8=B7=B3=E8=BD=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/formTable/page/cardPage.vue | 16 ++++++++++------ src/views/formTable/taskListPage.vue | 7 ++++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/views/formTable/page/cardPage.vue b/src/views/formTable/page/cardPage.vue index dab8100..4368648 100644 --- a/src/views/formTable/page/cardPage.vue +++ b/src/views/formTable/page/cardPage.vue @@ -175,7 +175,8 @@ const asfGetPageData = (asfFormId: any,asfToSelectMastersKey: any) => { console.log(data.data.list) for(let i = 0;i { /* tablePageClass.value = 4; drawerWith.value = container.value?.clientWidth */ - props.stateForm.type=3 - //lookInfo.value = itval - asflookPageInfoIsShow.value = true; + setTimeout(()=>{ + props.stateForm.type=3 + //lookInfo.value = itval + asflookPageInfoIsShow.value = true; + },500) + }) @@ -485,7 +489,7 @@ const qrJumpGetPageData = (qrDetailId: string) => { const getPageData = () => { loadText.value = "数据加载中,请稍后......" loadingList.value = true - console.log(searchQuery.value) + //console.log(searchQuery.value) let sendData = { formId: props.appId, page: state.page, @@ -603,7 +607,7 @@ const fullUrl = ref(window.location.href); onMounted(()=>{ nextTick(()=>{ - console.log(fullUrl.value) + //console.log(fullUrl.value) if(fullUrl.value.includes("&qrDetailId=")){ let urlSplitArray = fullUrl.value.split("&qrDetailId=") let qrDetailId = urlSplitArray[1] diff --git a/src/views/formTable/taskListPage.vue b/src/views/formTable/taskListPage.vue index e072442..720b9a0 100644 --- a/src/views/formTable/taskListPage.vue +++ b/src/views/formTable/taskListPage.vue @@ -245,7 +245,13 @@ const initLoadData = () => { } } } + //liwenxuan 二维码 20250123 start + stateData.tableData.controlBtn = stateData.tableData.controlBtn.filter( + (item: any) => item.key != "showQrCode" + ); + //liwenxuan 二维码 20250123 end stateList.tableData = stateData.tableData + stateList.searchData = stateData.searchData if(stateList.searchData == null){ stateList.searchData = new Array() @@ -502,7 +508,6 @@ const performAction = (val) => {}
Date: Mon, 27 Jan 2025 09:06:52 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=89=AB=E7=A0=81=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/scanQrCode.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/views/home/scanQrCode.vue b/src/views/home/scanQrCode.vue index 51fe5e9..95418e8 100644 --- a/src/views/home/scanQrCode.vue +++ b/src/views/home/scanQrCode.vue @@ -71,6 +71,9 @@ }, (decodedText, decodedResult) => { window.location.href = decodedText; + if (state.html5QrCode&&state.html5QrCode.isScanning) { + stop(); + } console.log("decodedText", decodedText); console.log("decodedResult", decodedResult); } @@ -107,6 +110,9 @@ }; const clickBack = () => { //console.log(1) + if (state.html5QrCode&&state.html5QrCode.isScanning) { + stop(); + } router.back(); } const getCameras = () => { @@ -118,6 +124,7 @@ } }) .catch((err) => { + console.log(err) alert("摄像头无访问权限!"); }); }; From 8e4fea1cc8bed2b102507daa4c17899888910aab Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Sun, 9 Feb 2025 11:01:02 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C=E4=BC=98=E5=8C=96?= =?UTF-8?q?v0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/lowCode/formItem.vue | 80 ++++++++++- src/views/home/scanQrCode.vue | 113 ++++++++++++--- src/views/home/scanQrCode1.vue | 212 ++++++++++++++++++++++++++++ 3 files changed, 384 insertions(+), 21 deletions(-) create mode 100644 src/views/home/scanQrCode1.vue diff --git a/src/components/lowCode/formItem.vue b/src/components/lowCode/formItem.vue index 46447c2..1144343 100644 --- a/src/components/lowCode/formItem.vue +++ b/src/components/lowCode/formItem.vue @@ -497,7 +497,7 @@ const currentComponent = computed(() => { - + { :type="data.type === 'password' ? 'password' : 'text'" :style="getFormItemInputStyle(configStyle,2)" :input-style="getFormItemInputStyle(configStyle,3)" - v-if="['input', 'password'].includes(data.type)" + v-if="['password'].includes(data.type)" :placeholder="data.control.placeholder?data.control.placeholder:'请输入'+getLabel(data.item)" > + + + + + + + + + + + + + + + +
+ +
+
+
+
+
@@ -171,32 +179,99 @@ + ​ \ No newline at end of file From 13a80732bffd15d9b553a4c07ea6ea11545aacad Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Sun, 9 Feb 2025 11:49:39 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C=E4=BC=98=E5=8C=96?= =?UTF-8?q?v0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 57 +++++ package.json | 1 + src/views/home/scanQrCode.vue | 426 +++++++++++++--------------------- 3 files changed, 218 insertions(+), 266 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7d61c22..587d4f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "ts-md5": "^1.3.1", "vue": "^3.5.10", "vue-pdf-embed": "^1.2.1", + "vue-qrcode-reader": "^5.7.0", "vue-router": "^4.4.5", "vue3-pdf-embed": "^1.1.7", "vue3-pdfjs": "^0.1.6" @@ -1458,6 +1459,16 @@ "node": ">=10.13.0" } }, + "node_modules/@types/dom-webcodecs": { + "version": "0.1.13", + "resolved": "https://registry.npmmirror.com/@types/dom-webcodecs/-/dom-webcodecs-0.1.13.tgz", + "integrity": "sha512-O5hkiFIcjjszPIYyUSyvScyvrBoV3NOEEZx/pMlsu44TKzWNkLVBBxnxJz42in5n3QIolYOcBYFCPZZ0h8SkwQ==" + }, + "node_modules/@types/emscripten": { + "version": "1.40.0", + "resolved": "https://registry.npmmirror.com/@types/emscripten/-/emscripten-1.40.0.tgz", + "integrity": "sha512-MD2JJ25S4tnjnhjWyalMS6K6p0h+zQV6+Ylm+aGbiS8tSn/aHLSGNzBgduj6FB4zH0ax2GRMGYi/8G1uOxhXWA==" + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.6.tgz", @@ -1955,6 +1966,15 @@ "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/barcode-detector": { + "version": "2.2.2", + "resolved": "https://registry.npmmirror.com/barcode-detector/-/barcode-detector-2.2.2.tgz", + "integrity": "sha512-JcSekql+EV93evfzF9zBr+Y6aRfkR+QFvgyzbwQ0dbymZXoAI9+WgT7H1E429f+3RKNncHz2CW98VQtaaKpmfQ==", + "dependencies": { + "@types/dom-webcodecs": "^0.1.11", + "zxing-wasm": "1.1.3" + } + }, "node_modules/base": { "version": "0.11.2", "resolved": "https://registry.npmmirror.com/base/-/base-0.11.2.tgz", @@ -5981,6 +6001,11 @@ "resolved": "https://registry.npmmirror.com/scule/-/scule-1.3.0.tgz", "integrity": "sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==" }, + "node_modules/sdp": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/sdp/-/sdp-3.2.0.tgz", + "integrity": "sha512-d7wDPgDV3DDiqulJjKiV2865wKsJ34YI+NDREbm+FySq6WuKOikwyNQcm+doLAZ1O6ltdO0SeKle2xMpN3Brgw==" + }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.3.tgz", @@ -7693,6 +7718,18 @@ "vue": "^2.x || ^3.x" } }, + "node_modules/vue-qrcode-reader": { + "version": "5.7.0", + "resolved": "https://registry.npmmirror.com/vue-qrcode-reader/-/vue-qrcode-reader-5.7.0.tgz", + "integrity": "sha512-NuLBK3madyMhM35n2libd0i5GH3Rcvq2d7qB1Qyf5FqdIdC6GaMEC8Wi8v0HFuv5V5aptOLhHVBfSczBpO3lvA==", + "dependencies": { + "barcode-detector": "2.2.2", + "webrtc-adapter": "8.2.3" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/vue-router": { "version": "4.4.5", "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.4.5.tgz", @@ -7774,6 +7811,18 @@ "resolved": "https://registry.npmmirror.com/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz", "integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==" }, + "node_modules/webrtc-adapter": { + "version": "8.2.3", + "resolved": "https://registry.npmmirror.com/webrtc-adapter/-/webrtc-adapter-8.2.3.tgz", + "integrity": "sha512-gnmRz++suzmvxtp3ehQts6s2JtAGPuDPjA1F3a9ckNpG1kYdYuHWYpazoAnL9FS5/B21tKlhkorbdCXat0+4xQ==", + "dependencies": { + "sdp": "^3.2.0" + }, + "engines": { + "node": ">=6.0.0", + "npm": ">=3.10.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", @@ -7969,6 +8018,14 @@ "version": "4.0.0", "resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/zxing-wasm": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/zxing-wasm/-/zxing-wasm-1.1.3.tgz", + "integrity": "sha512-MYm9k/5YVs4ZOTIFwlRjfFKD0crhefgbnt1+6TEpmKUDFp3E2uwqGSKwQOd2hOIsta/7Usq4hnpNRYTLoljnfA==", + "dependencies": { + "@types/emscripten": "^1.39.10" + } } } } diff --git a/package.json b/package.json index bd95f16..d755b5e 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "ts-md5": "^1.3.1", "vue": "^3.5.10", "vue-pdf-embed": "^1.2.1", + "vue-qrcode-reader": "^5.7.0", "vue-router": "^4.4.5", "vue3-pdf-embed": "^1.1.7", "vue3-pdfjs": "^0.1.6" diff --git a/src/views/home/scanQrCode.vue b/src/views/home/scanQrCode.vue index 9e42ef6..635dc82 100644 --- a/src/views/home/scanQrCode.vue +++ b/src/views/home/scanQrCode.vue @@ -1,287 +1,181 @@ + + // 定义变量 + const dataList = ref('') + const result = ref(true) + const error = ref('') - - ​ \ No newline at end of file + + 100% { + transform: translateY(0); + } +} + + \ No newline at end of file From b7adf187a75eabafde4f811aee43df4d03396048 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Sun, 9 Feb 2025 13:45:37 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C=E4=BC=98=E5=8C=96?= =?UTF-8?q?v1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/scanQrCode.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/home/scanQrCode.vue b/src/views/home/scanQrCode.vue index 635dc82..38d2f6c 100644 --- a/src/views/home/scanQrCode.vue +++ b/src/views/home/scanQrCode.vue @@ -6,7 +6,9 @@
- + + +
@@ -36,9 +38,10 @@ const onDecode = (res: any) => { dataList.value = res result.value = false - console.log('你好',dataList.value) - alert(dataList.value) + //console.log('你好',dataList.value) + //alert(dataList.value) //showSuccessToast('扫描成功')--------------------------------------- + window.location.href = dataList.value[0].rawValue; // 调用后台接口存入数据库 // 数据存入数据库后跳转页面 } From 083a6d9281d92e6a378c936e916c87469cc8d5a1 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Mon, 10 Feb 2025 10:40:01 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C=E4=BC=98=E5=8C=96?= =?UTF-8?q?v1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/scanQrCode.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/home/scanQrCode.vue b/src/views/home/scanQrCode.vue index 38d2f6c..ca246f9 100644 --- a/src/views/home/scanQrCode.vue +++ b/src/views/home/scanQrCode.vue @@ -104,7 +104,7 @@ height: 213px; position: absolute; left: 50%; - top: 50%; + top: 40%; transform: translate(-50%, -50%); overflow: hidden; border: 1px solid #3aa5ff; @@ -118,7 +118,7 @@ /* color: #f9f9f9; */ margin: 0 auto; position: absolute; - top: 70%; + top: 60%; left: 0; } .qr-scanner .myQrcode { From 17f7aa4c38257e64a5b5e1478ec083a3b533681a Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 18 Feb 2025 08:53:16 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E5=8D=95=E8=A1=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E6=89=AB=E7=A0=81=E5=BD=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/lowCode/formItem.vue | 40 +++++- src/views/home/scanQrCodeInput.vue | 195 ++++++++++++++++++++++++++++ 2 files changed, 231 insertions(+), 4 deletions(-) create mode 100644 src/views/home/scanQrCodeInput.vue diff --git a/src/components/lowCode/formItem.vue b/src/components/lowCode/formItem.vue index 1144343..c09bf5d 100644 --- a/src/components/lowCode/formItem.vue +++ b/src/components/lowCode/formItem.vue @@ -5,6 +5,7 @@ --> + \ No newline at end of file From d64feb39496ca186cb11f28c7fcff2d21dea17ad Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 18 Feb 2025 09:35:07 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=95=E8=A1=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=89=AB=E6=8F=8F=E5=BD=95=E5=85=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/lowCode/formItem.vue | 3 ++- src/views/home/scanQrCodeInput.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/lowCode/formItem.vue b/src/components/lowCode/formItem.vue index c09bf5d..3406feb 100644 --- a/src/components/lowCode/formItem.vue +++ b/src/components/lowCode/formItem.vue @@ -119,8 +119,9 @@ const handleQrScaning = (val: any) => { } const handleScanResult = (val: any) => { - console.log('传值成功'+val) + //console.log('传值成功'+val) updateModel(val) + qrScaning.value = false } //liwenxuan 20250217 扫描录入 end //获取值 diff --git a/src/views/home/scanQrCodeInput.vue b/src/views/home/scanQrCodeInput.vue index a312b51..32fa3b3 100644 --- a/src/views/home/scanQrCodeInput.vue +++ b/src/views/home/scanQrCodeInput.vue @@ -43,7 +43,7 @@ const onDecode = (res: any) => { //console.log('你好',dataList.value) //alert(dataList.value) //showSuccessToast('扫描成功')--------------------------------------- - console.log('扫描成功'+dataList.value[0].rawValue) + //console.log('扫描成功'+dataList.value[0].rawValue) emits('update-scanResult', dataList.value[0].rawValue) // 触发父组件事件 // 调用后台接口存入数据库 // 数据存入数据库后跳转页面 From b48ca4dd737d0655d7a72306f56c81d96d347298 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 18 Feb 2025 09:52:31 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=95=E8=A1=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=89=AB=E6=8F=8F=E5=BD=95=E5=85=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/lowCode/formItem.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/lowCode/formItem.vue b/src/components/lowCode/formItem.vue index 3406feb..b1553cf 100644 --- a/src/components/lowCode/formItem.vue +++ b/src/components/lowCode/formItem.vue @@ -926,7 +926,7 @@ const currentComponent = computed(() => { :with-header="false" size="100%" > - + From e11ff85be8850dd686ce81be75cf2c389ce96cbb Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Wed, 19 Feb 2025 14:38:33 +0800 Subject: [PATCH 11/11] =?UTF-8?q?1.=E5=AE=9E=E7=8E=B0=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1=E6=89=AB=E4=B8=80=E6=89=AB?= =?UTF-8?q?=202.=E5=BC=80=E5=8F=91=E5=9F=BA=E4=BA=8Ezxing/library=E7=9A=84?= =?UTF-8?q?=E6=97=A2=E6=94=AF=E6=8C=81=E6=89=AB=E4=BA=8C=E7=BB=B4=E7=A0=81?= =?UTF-8?q?=E4=B9=9F=E6=94=AF=E6=8C=81=E6=89=AB=E6=9D=A1=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E6=89=AB=E7=A0=81=E7=BB=84=E4=BB=B6=203.=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E8=87=AA=E7=A0=94zxing=E7=BB=84=E4=BB=B6=E5=B0=8F=E7=B1=B3?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E4=B8=AD=E7=9A=84=E4=BC=81=E4=B8=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=8F=AA=E8=83=BD=E8=8E=B7=E5=8F=96=E5=88=B0=E5=89=8D?= =?UTF-8?q?=E7=BD=AE=E6=91=84=E5=83=8F=E5=A4=B4,=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E6=8C=89=E9=9C=80=E5=8A=A0=E8=BD=BD=E5=8A=9F=E8=83=BD,?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1=E7=8E=AF=E5=A2=83=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1=E6=89=AB=E4=B8=80?= =?UTF-8?q?=E6=89=AB,=E5=85=B6=E5=AE=83=E7=8E=AF=E5=A2=83=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E8=87=AA=E7=A0=94zxing=E6=89=AB=E7=A0=81=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- package-lock.json | 49 ++- package.json | 5 +- src/components/lowCode/formItem.vue | 62 +++- src/views/home/scanQrCode.vue | 267 +++++++-------- src/views/home/scanQrCode1.vue | 368 ++++++++++---------- src/views/home/scanQrCodeInput.vue | 497 +++++++++++++++++++--------- src/views/home/scanQrCodeInput1.vue | 195 +++++++++++ 8 files changed, 965 insertions(+), 480 deletions(-) create mode 100644 src/views/home/scanQrCodeInput1.vue diff --git a/index.html b/index.html index 4a71864..eb8814f 100644 --- a/index.html +++ b/index.html @@ -6,11 +6,11 @@ - 数通智联化工云平台
+ diff --git a/package-lock.json b/package-lock.json index 587d4f8..ded01cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "0.0.0", "dependencies": { "@element-plus/icons-vue": "^2.3.1", + "@zxing/browser": "^0.1.5", + "@zxing/library": "^0.21.3", "axios": "^1.7.7", "element-plus": "^2.8.6", "font-awesome": "^4.7.0", @@ -29,7 +31,8 @@ "vue-qrcode-reader": "^5.7.0", "vue-router": "^4.4.5", "vue3-pdf-embed": "^1.1.7", - "vue3-pdfjs": "^0.1.6" + "vue3-pdfjs": "^0.1.6", + "weixin-js-sdk": "^1.6.5" }, "devDependencies": { "@types/js-beautify": "^1.14.3", @@ -1780,6 +1783,37 @@ } } }, + "node_modules/@zxing/browser": { + "version": "0.1.5", + "resolved": "https://registry.npmmirror.com/@zxing/browser/-/browser-0.1.5.tgz", + "integrity": "sha512-4Lmrn/il4+UNb87Gk8h1iWnhj39TASEHpd91CwwSJtY5u+wa0iH9qS0wNLAWbNVYXR66WmT5uiMhZ7oVTrKfxw==", + "optionalDependencies": { + "@zxing/text-encoding": "^0.9.0" + }, + "peerDependencies": { + "@zxing/library": "^0.21.0" + } + }, + "node_modules/@zxing/library": { + "version": "0.21.3", + "resolved": "https://registry.npmmirror.com/@zxing/library/-/library-0.21.3.tgz", + "integrity": "sha512-hZHqFe2JyH/ZxviJZosZjV+2s6EDSY0O24R+FQmlWZBZXP9IqMo7S3nb3+2LBWxodJQkSurdQGnqE7KXqrYgow==", + "dependencies": { + "ts-custom-error": "^3.2.1" + }, + "engines": { + "node": ">= 10.4.0" + }, + "optionalDependencies": { + "@zxing/text-encoding": "~0.9.0" + } + }, + "node_modules/@zxing/text-encoding": { + "version": "0.9.0", + "resolved": "https://registry.npmmirror.com/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", + "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", + "optional": true + }, "node_modules/abbrev": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/abbrev/-/abbrev-2.0.0.tgz", @@ -7038,6 +7072,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/ts-custom-error": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/ts-custom-error/-/ts-custom-error-3.3.1.tgz", + "integrity": "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/ts-md5": { "version": "1.3.1", "resolved": "https://registry.npmmirror.com/ts-md5/-/ts-md5-1.3.1.tgz", @@ -7823,6 +7865,11 @@ "npm": ">=3.10.0" } }, + "node_modules/weixin-js-sdk": { + "version": "1.6.5", + "resolved": "https://registry.npmmirror.com/weixin-js-sdk/-/weixin-js-sdk-1.6.5.tgz", + "integrity": "sha512-Gph1WAWB2YN/lMOFB/ymb+hbU/wYazzJgu6PMMktCy9cSCeW5wA6Zwt0dpahJbJ+RJEwtTv2x9iIu0U4enuVSQ==" + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index d755b5e..1a486ae 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ }, "dependencies": { "@element-plus/icons-vue": "^2.3.1", + "@zxing/browser": "^0.1.5", + "@zxing/library": "^0.21.3", "axios": "^1.7.7", "element-plus": "^2.8.6", "font-awesome": "^4.7.0", @@ -31,7 +33,8 @@ "vue-qrcode-reader": "^5.7.0", "vue-router": "^4.4.5", "vue3-pdf-embed": "^1.1.7", - "vue3-pdfjs": "^0.1.6" + "vue3-pdfjs": "^0.1.6", + "weixin-js-sdk": "^1.6.5" }, "devDependencies": { "@types/js-beautify": "^1.14.3", diff --git a/src/components/lowCode/formItem.vue b/src/components/lowCode/formItem.vue index b1553cf..bf992e7 100644 --- a/src/components/lowCode/formItem.vue +++ b/src/components/lowCode/formItem.vue @@ -16,6 +16,8 @@ import { } from '@/api/lowCode/utils'; import { AnalysisCss,AnalysisInputCss } from '@/api/common/cssInfo' import validate from "@/api/lowCode/form/validate" +import wx from 'weixin-js-sdk' +import request from '@/utils/axios/index' import { Md5 } from 'ts-md5' import { debounce } from '@/utils/lowCode/item/index' @@ -123,6 +125,62 @@ const handleScanResult = (val: any) => { updateModel(val) qrScaning.value = false } + +const isQywx = ref(false) +onMounted(()=>{ + if (/wxwork\//.test(navigator.userAgent)) { + isQywx.value = true + } +}) +const handelScan = ()=>{ + if(isQywx.value == true){//企业微信环境 + initWxConfig() + }else{//浏览器环境 + qrScaning.value=true + } + +} +function getQyWxSignature() { + let url = window.location.href.split("#")[0]; + var req = {url:"1"}; + req.url = url; + return request({ + url: "/javasys/lowCode/QrCode/QyWxSignature", + method: "get", + data: req, + }); +} +async function initWxConfig() { + getQyWxSignature().then(({ data }) => { + //alert(data.corpid) + wx.config({ + beta: true,// 必须这么写,否则wx.invoke调用形式的jsapi会有问题 + debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 + appId: data.corpid, // 必填,企业微信的corpID + timestamp: data.timestamp, // 必填,生成签名的时间戳 + nonceStr: data.noncestr, // 必填,生成签名的随机串 + signature: data.jsapi_ticket_enterprises,// 必填,签名,见 附录-JS-SDK使用权限签名算法 + jsApiList: ['scanQRCode'] // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来 + }); + startScan() + }); +} +// 触发扫码 +function startScan() { + wx.ready(() => { + wx.scanQRCode({ + needResult: 1, // 返回扫码结果 + scanType: ['qrCode','barCode'], // 扫码类型:二维码 条码 + success: (res) => { + const result = res.resultStr; + handleScanResult(result); + }, + fail: (err) => { + alert(err.errMsg) + } + }); + }); +} //liwenxuan 20250217 扫描录入 end //获取值 const value = computed({ @@ -579,7 +637,7 @@ const currentComponent = computed(() => { {{ config.append }} diff --git a/src/views/home/scanQrCode.vue b/src/views/home/scanQrCode.vue index ca246f9..8cea4b6 100644 --- a/src/views/home/scanQrCode.vue +++ b/src/views/home/scanQrCode.vue @@ -1,41 +1,43 @@ - +} + - \ No newline at end of file + \ No newline at end of file diff --git a/src/views/home/scanQrCode1.vue b/src/views/home/scanQrCode1.vue index 95418e8..ca246f9 100644 --- a/src/views/home/scanQrCode1.vue +++ b/src/views/home/scanQrCode1.vue @@ -1,212 +1,184 @@ + + // 定义变量 + const dataList = ref('') + const result = ref(true) + const error = ref('') - - ​ \ No newline at end of file +} + + \ No newline at end of file diff --git a/src/views/home/scanQrCodeInput.vue b/src/views/home/scanQrCodeInput.vue index 32fa3b3..7c5ee26 100644 --- a/src/views/home/scanQrCodeInput.vue +++ b/src/views/home/scanQrCodeInput.vue @@ -1,186 +1,343 @@ - - \ No newline at end of file + +@keyframes Heightchange { + 0% { + height: 0; + } + + 100% { + height: 100%; + } +} + +.txt { + width: 100%; + height: 35px; + line-height: 35px; + font-size: 14px; + text-align: center; + /* color: #f9f9f9; */ + margin: 0 auto; + position: absolute; + top: 63%; + left: 0; + color: white; + z-index: 1001; +} + +.close-icon { + position: absolute; + top: 15px; + left: 15px; + width: 20px; + height: 20px; + color: white; + z-index: 1001; + cursor: pointer; + background: rgba(0, 0, 0, 0.3); /* 可选背景 */ + border-radius: 50%; /* 圆形背景 */ + padding: 5px; + /* 点击区域扩大 */ +} +.Qr_scanner { + z-index: 999; /* 低于图标容器 */ + /* 其他原有样式保持不变 */ +} + diff --git a/src/views/home/scanQrCodeInput1.vue b/src/views/home/scanQrCodeInput1.vue new file mode 100644 index 0000000..32fa3b3 --- /dev/null +++ b/src/views/home/scanQrCodeInput1.vue @@ -0,0 +1,195 @@ + + + \ No newline at end of file