From 6fd0640423189b4594b3fb56dba69ad957737d2c Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Thu, 16 Jan 2025 14:56:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=A1=B5=E8=A1=A8=E6=A0=BC=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignForm/formControlPropertiNew.vue | 10 +- .../DesignForm/tableListPage/index.vue | 132 +++++++++++++++++- .../appPage/appPageForm/openAppFormPage.vue | 1 + 3 files changed, 136 insertions(+), 7 deletions(-) diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index bbaaaea..930bb6d 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -2156,11 +2156,11 @@ function showQrCodeOutPrintConfig(){ qrCodeOutPrintConfigFlag.value = true } */ function handleMaxSelect(){ - console.log(formData.value.qrCodeShowFields.length) + //console.log(formData.value.qrCodeShowFields.length) if(formData.value.qrCodeShowFields.length>5){ alert("最多可选择5个字段") } - while (formData.value.qrCodeShowFields.length > 5) { + while (formData.value.qrCodeShowFields.length > 5) {// formData.value.qrCodeShowFields.pop(); } } @@ -2175,7 +2175,7 @@ const treeDefaultProps = {// children: "children", label: "label", }; -//拿到子组件AssociatedFormsTinyace的实例 +//拿到子组件AssociatedFormsTinyace的实例 const aft = ref(); const aftRange = ref(); @@ -2406,6 +2406,7 @@ let currentFormChildTableFieldsForFillRole = ref(); let associatedFormsCurrentFormFieldTree = ref(); let associatedFormsCurrentFormFieldTree1 = ref(); let associatedFormsCurrentFormFieldTreeNoTable = ref(); +let associatedFormsCurrentFormFieldTreeNoTable1 = ref<[]>(); let associatedFormsCurrentFormFieldTreeForGlxxsz = ref(); let associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf = ref(); let resDataForGlxxszExceptself: any[] = []; @@ -2480,6 +2481,7 @@ function getAssociatedFormsCurrentFieldTree1() { treeAttrs: data.treeAttrs, }, ]; + associatedFormsCurrentFormFieldTreeNoTable1.value = [...resDataNoTable] let resDataForGlxxsz = ref(data.children.slice(8)); @@ -4663,7 +4665,7 @@ const radioChangeSet = (val: any) => { > (), { showPage: true, @@ -101,6 +102,9 @@ const props = withDefaults( viewPage: () => { return []; }, + formBasicConfig: () => { + return {}; + }, } ); const emits = defineEmits<{ @@ -208,6 +212,36 @@ const resetFields = (formEl: FormInstance | undefined) => { }); } }; +const qrCodesPrintDialogFlag = ref(false) + +const qrCodesPrintDialogData = ref({}) +function getDetailQrCodes(val:any) { + return request({ + url: "/javasys/lowCode/QrCode/getDetailQrCodes", + method: "post", + data: { + cfid: props.formId, + idArray:val, + settings:props.formBasicConfig, + }, + }); +} + +function modifyFieldsMap4(fieldsMap: any): Array<{ key: string, value: string }> { + let result: Array<{ key: string, value: string }> = []; + // 使用 Object.entries 获取键值对数组,保留原始顺序 + for (const [key, value] of Object.entries(fieldsMap)) { + let parts = value.split("!@#@!"); + if (parts.length === 2) { + result.push({ key: parts[0], value: parts[1] }); + } else { + // 如果格式不符合,可进行错误处理,这里暂时不做处理,直接使用原属性名和属性值 + result.push({ key, value }); + } + } + return result; +} + /** @ 作者: 秦东 @ 时间: 2024-04-01 11:36:07 @@ -219,8 +253,42 @@ const setUpClick = (val: string, id: string) => { drawerWith.value = container.value?.clientWidth; openTaskDrawer.value = true; } else if(val.key == "showQrCode"){ - //alert(val) - console.log(idList) + //liwenxuan 20250114 二维码打印弹窗 start + //在此组装参数,以生成二维码图片 + + let idArray = state.selectionChecked.map(item => item.id); + if(idArray.length>0){ + //console.log(props.formBasicConfig) + //请求数据 + getDetailQrCodes(idArray).then(({ data }) => { + + + if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"){ + + for (let key in data) { + if (data.hasOwnProperty(key)) { + let currentFieldsMap = data[key].fieldsMap + data[key].fieldsMap = modifyFieldsMap4(currentFieldsMap) + //data[key].bufferedImage = "" + + + } + + } + qrCodesPrintDialogData.value = data + //console.log(qrCodesPrintDialogData.value) + qrCodesPrintDialogFlag.value = true + }else if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="1"){ + //fieldsMap = null + qrCodesPrintDialogFlag.value = true + } + + }) + }else{ + alert("未选中任何一条,请先选择") + } + //liwenxuan 20250114 二维码打印弹窗 end + }else { if (idList.value.length > 0) { ElMessageBox.confirm("确认删除此数据项?删除后不可恢复!", "警告", { @@ -1510,6 +1578,52 @@ const diGuiJilian = (val: any, options: any[]) => { :drawerwith="drawerWith" @searchquery="getListData" /> + + +
+
+ + + + + + + + + + +
{{tableData.groupName}}-{{qrCodesPrintDialogData[index].appName}}-{{qrCodesPrintDialogData[index].formName}}-{{ index }}二维码
{{ item.key }}{{ item.value }}
+
+
+ + +
{ .demo-image__error .image-slot .el-icon { font-size: 30px; } - + +table { + border-collapse: collapse; + width: 100%; + } + + td, th { + border: 1px solid black; + padding: 8px; + } + + + \ No newline at end of file diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue index dbac92e..7194dcc 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue @@ -483,6 +483,7 @@ defineExpose({ :versiontitle="versionTitle" v-model:look-page-is-show="lookPageIsShow" :viewPage="stateList.view" + :form-basic-config="stateForm.formData.form" @optionsValue5Get5="optionsValue5Get5" />