Browse Source

二维码表格组织部门名称显示

lwx_v17
liwenxuan 10 months ago
parent
commit
f7e2c64e43
  1. 67
      src/components/DesignForm/app/index.vue
  2. 82
      src/components/DesignForm/tableListPage/index.vue
  3. 50
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue
  4. 35
      src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue

67
src/components/DesignForm/app/index.vue

@ -74,6 +74,7 @@ const props = withDefaults(
viewPage?: viewPageType;
formBasicConfig?: any;
fieldsDetailList?:any;
orgAndManTree?:any;
}>(),
{
showPage: true,
@ -119,6 +120,9 @@ const props = withDefaults(
fieldsDetailList: () => {
return {};
},
orgAndManTree: () => {
return {};
},
}
);
const emits = defineEmits<{
@ -321,6 +325,7 @@ let checkboxs: any[] = [];
let switchs: any[] = [];
let selects: any[] = [];
let tables: any[] = [];
let dofs: any[] = [];//deptOrgAndOrgCententAndFounderArr
function getAsfs() {
//setTimeout(() => {
let dataList = ref({});
@ -337,6 +342,8 @@ function getAsfs() {
switchs.push(dataList.value[i])
} else if(dataList.value[i].type == "select"){
selects.push(dataList.value[i])
} else if(dataList.value[i].type == "deptOrg"||dataList.value[i].type == "orgCentent"||dataList.value[i].type == "founder"){//||dataList.value[i].type == "owner","expand-user"
dofs.push(dataList.value[i])
}else if (
dataList.value[i].type == "card" ||
dataList.value[i].type == "flex" ||
@ -358,6 +365,8 @@ function getAsfs() {
switchs.push(element)
}else if(element.type == "select"){
selects.push(element)
}else if(element.type == "deptOrg"||element.type == "orgCentent"||element.type == "founder"){
dofs.push(element)
}
});
} else if (dataList.value[i].type == "grid") {
@ -378,6 +387,8 @@ function getAsfs() {
switchs.push(a)
}else if(a.type == "select"){
selects.push(a)
}else if(a.type == "deptOrg"||a.type == "orgCentent"||a.type == "founder"){
dofs.push(a)
}
}
}
@ -400,6 +411,8 @@ function getAsfs() {
switchs.push(a)
}else if(a.type == "select"){
selects.push(a)
}else if(a.type == "deptOrg"||a.type == "orgCentent"||a.type == "founder"){
dofs.push(a)
}else if (a.type == "flex" || a.type == "table") {
if (a.type == "table") {
tables.push(dataList.value[i]);
@ -419,6 +432,8 @@ function getAsfs() {
switchs.push(q)
}else if(q.type == "select"){
selects.push(q)
}else if(q.type == "deptOrg"||q.type == "orgCentent"||q.type == "founder"){
dofs.push(q)
}
}
}
@ -448,6 +463,36 @@ function convertStringToArray(str: string) {
let parts = str.split(',');
return parts.map(part => parseFloat(part));
}
interface Tree {
id?: string;
label: string;
disabled?: boolean;
children?: Tree[];
parentId?: string;
[key: string]: any;
}
function getLabelById(id: string): string | undefined {
//console.log(id)
const treeNodes = props.orgAndManTree;
const findLabel = (nodes: Tree[]): string | undefined => {
for (const node of nodes) {
// id
if (node.id === id) {
return node.label;
}
//
if (node.children?.length) {
const found = findLabel(node.children);
if (found) return found;
}
}
return undefined;
};
return findLabel(treeNodes);
}
//liwenxuan 20250120 end
@ -472,11 +517,11 @@ const setUpClick = (val: string, id: string) => {
//,
let idArray = state.selectionChecked.map(item => item.id);
if(idArray.length>0){
/* const loadingInstance1 = ElLoading.service({
const loadingInstance1 = ElLoading.service({
fullscreen: true,
text: '正在生成二维码,请稍候...' //
}); */
console.log(props.formBasicConfig)
});
//console.log(props.formBasicConfig)
if(props.formBasicConfig.qrCodeFlag==true){
if(props.formBasicConfig.qrCodeInside==true){
if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"&&props.formBasicConfig.qrCodeShowFields.length==0){
@ -532,6 +577,15 @@ const setUpClick = (val: string, id: string) => {
}
}
});
//console.log(dofs)
dofs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let orgName = getLabelById(toConvertValue)
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+orgName
}
});
switchs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
@ -636,7 +690,7 @@ const setUpClick = (val: string, id: string) => {
setTimeout(()=>{
//loadingInstance1.close()
loadingInstance1.close()
qrCodesPrintDialogFlag.value = true
},820)
@ -644,9 +698,11 @@ const setUpClick = (val: string, id: string) => {
//fieldsMap = null
tablesData.value = getDetailQrCodesData
qrCodesPrintDialogFlag.value = true
//loadingInstance1.close()
loadingInstance1.close()
}
}).finally(()=>{
loadingInstance1.close()
})
}else{
alert("内部二维码功能未启用")
@ -899,6 +955,7 @@ const getPageData = () => {
switchs = [];
selects = [];
tables = [];
dofs = [];
getAsfs()
});
}

82
src/components/DesignForm/tableListPage/index.vue

@ -70,6 +70,7 @@ const props = withDefaults(
viewPage?: viewPageType;
formBasicConfig?: any;
fieldsDetailList?:any;
orgAndManTree?:any;
}>(),
{
showPage: true,
@ -112,6 +113,9 @@ const props = withDefaults(
fieldsDetailList: () => {
return {};
},
orgAndManTree: () => {
return {};
},
}
);
const emits = defineEmits<{
@ -314,6 +318,8 @@ let checkboxs: any[] = [];
let switchs: any[] = [];
let selects: any[] = [];
let tables: any[] = [];
let dofs: any[] = [];//deptOrgAndOrgCententAndFounderArr
function getAsfs() {
//setTimeout(() => {
let dataList = ref({});
@ -330,6 +336,8 @@ function getAsfs() {
switchs.push(dataList.value[i])
} else if(dataList.value[i].type == "select"){
selects.push(dataList.value[i])
} else if(dataList.value[i].type == "deptOrg"||dataList.value[i].type == "orgCentent"||dataList.value[i].type == "founder"){//||dataList.value[i].type == "owner","expand-user"
dofs.push(dataList.value[i])
}else if (
dataList.value[i].type == "card" ||
dataList.value[i].type == "flex" ||
@ -351,6 +359,8 @@ function getAsfs() {
switchs.push(element)
}else if(element.type == "select"){
selects.push(element)
}else if(element.type == "deptOrg"||element.type == "orgCentent"||element.type == "founder"){
dofs.push(element)
}
});
} else if (dataList.value[i].type == "grid") {
@ -371,6 +381,8 @@ function getAsfs() {
switchs.push(a)
}else if(a.type == "select"){
selects.push(a)
}else if(a.type == "deptOrg"||a.type == "orgCentent"||a.type == "founder"){
dofs.push(a)
}
}
}
@ -393,6 +405,8 @@ function getAsfs() {
switchs.push(a)
}else if(a.type == "select"){
selects.push(a)
}else if(a.type == "deptOrg"||a.type == "orgCentent"||a.type == "founder"){
dofs.push(a)
}else if (a.type == "flex" || a.type == "table") {
if (a.type == "table") {
tables.push(dataList.value[i]);
@ -412,6 +426,8 @@ function getAsfs() {
switchs.push(q)
}else if(q.type == "select"){
selects.push(q)
}else if(q.type == "deptOrg"||q.type == "orgCentent"||q.type == "founder"){
dofs.push(q)
}
}
}
@ -425,7 +441,6 @@ function getAsfs() {
//}, 500);
}
function convertStringToArray(str: string) {
if (typeof str!== 'string') {
throw new Error('Input must be a string.');
@ -442,6 +457,45 @@ function convertStringToArray(str: string) {
return parts.map(part => parseFloat(part));
}
interface Tree {
id?: string;
label: string;
disabled?: boolean;
children?: Tree[];
parentId?: string;
[key: string]: any;
}
function getLabelById(id: string): string | undefined {
//console.log(id)
const treeNodes = props.orgAndManTree;
const findLabel = (nodes: Tree[]): string | undefined => {
for (const node of nodes) {
// id
if (node.id === id) {
return node.label;
}
//
if (node.children?.length) {
const found = findLabel(node.children);
if (found) return found;
}
}
return undefined;
};
return findLabel(treeNodes);
}
function isAllCharactersNumbers(str: string) {
//
for (let i = 0; i < str.length; i++) {
//
if (isNaN(parseInt(str[i], 10))) {
return false;
}
}
return true;
}
//liwenxuan 20250120 end
@ -462,11 +516,11 @@ const setUpClick = (val: string, id: string) => {
//,
let idArray = state.selectionChecked.map(item => item.id);
if(idArray.length>0){
/* const loadingInstance1 = ElLoading.service({
const loadingInstance1 = ElLoading.service({
fullscreen: true,
text: '正在生成二维码,请稍候...' //
}); */
console.log(props.formBasicConfig)
});
//console.log(props.formBasicConfig)
if(props.formBasicConfig.qrCodeFlag==true){
if(props.formBasicConfig.qrCodeInside==true){
@ -524,6 +578,20 @@ const setUpClick = (val: string, id: string) => {
}
}
});
//console.log(dofs)
dofs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
//console.log(toConvertValue)
if(isAllCharactersNumbers(toConvertValue)){
let orgName = getLabelById(toConvertValue)
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+orgName
}
}
});
switchs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
@ -628,7 +696,7 @@ const setUpClick = (val: string, id: string) => {
setTimeout(()=>{
//loadingInstance1.close()
loadingInstance1.close()
qrCodesPrintDialogFlag.value = true
},820)
@ -636,9 +704,11 @@ const setUpClick = (val: string, id: string) => {
//fieldsMap = null
tablesData.value = getDetailQrCodesData
qrCodesPrintDialogFlag.value = true
//loadingInstance1.close()
loadingInstance1.close()
}
}).finally(()=>{
loadingInstance1.close()
})
}else{

50
src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue

@ -5,6 +5,7 @@
-->
<script lang='ts' setup>
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form'
import request from "@/utils/request";
import { gainAppPageInfo,getFieldRecord } from '@/api/DesignForm/requestapi'
import { Edit,Picture as IconPicture } from '@element-plus/icons-vue'
import { appPageDataInit,appWorkFlow } from "@/api/date/type"
@ -207,6 +208,7 @@ const handleAppPageClick = () =>{
@ 功能: 获取表单初始化信息
*/
const gainAppFormPageInit = () =>{
if(props.menusInfo.id){
@ -380,6 +382,36 @@ const gainAppFormPageInit = () =>{
}
}
//liwenxuan start
interface Tree {
id?: string;
label: string;
disabled?: boolean;
children?: Tree[];
parentId?: string;
[key: string]: any;
}
const orgAndManTree = ref<Tree[]>();
function getAssociatedFormsOrgAndManTree() {
return request({
url: "/javasys/lowCode/transfer/getOrgAndManTree",
method: "post",
});
}
getAssociatedFormsOrgAndManTree().then(({ data }) => {
let resData = ref(data.children);
orgAndManTree.value = [
{
id: data.id,
//label: data.label,
label: "组织机构",
children: [...resData.value],
},
];
});
//liwenxuan end
function optionsValue3Get3(data: any,fieldName: string){
//console.log("openAppFormPage","optionsValue3Get3")
@ -415,11 +447,24 @@ function optionsValue3Get3(data: any,fieldName: string){
//}
}
defineExpose({
gainAppFormPageInit
})
/* onMounted(() => {
getAssociatedFormsOrgAndManTree().then(({ data }) => {
let resData = ref(data.children);
orgAndManTree.value = [
{
id: data.id,
//label: data.label,
label: "组织机构",
children: [...resData.value],
},
];
});
});
*/
/* function optionsValue5Get5(data:any,fieldName:any){
//console.log("openAppFormPage","optionsValue5Get5")
@ -485,6 +530,7 @@ defineExpose({
:viewPage="stateList.view"
:form-basic-config="stateForm.formData.form"
:fields-detail-list="stateForm.formData.list"
:org-and-man-tree = "orgAndManTree"
@optionsValue5Get5="optionsValue5Get5"
/>
<ak-form

35
src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue

@ -15,6 +15,7 @@ import {
gainAppPageInfo,
getFieldRecord,
} from "@/api/DesignForm/requestapi";
import request from "@/utils/request";
import { Edit, Picture as IconPicture } from "@element-plus/icons-vue";
import { appPageDataInit, appWorkFlow } from "@/api/date/type";
import {
@ -324,6 +325,37 @@ watch(
}
);
//liwenxuan start
interface Tree {
id?: string;
label: string;
disabled?: boolean;
children?: Tree[];
parentId?: string;
[key: string]: any;
}
const orgAndManTree = ref<Tree[]>();
function getAssociatedFormsOrgAndManTree() {
return request({
url: "/javasys/lowCode/transfer/getOrgAndManTree",
method: "post",
});
}
getAssociatedFormsOrgAndManTree().then(({ data }) => {
let resData = ref(data.children);
orgAndManTree.value = [
{
id: data.id,
//label: data.label,
label: "组织机构",
children: [...resData.value],
},
];
});
//liwenxuan end
function optionsValue3Get3(data: any, fieldName: string) {
console.log("runAppForm", "optionsValue3Get3");
for (let i = 0; i < stateForm.formData.list.length; i++) {
@ -335,6 +367,8 @@ function optionsValue3Get3(data: any, fieldName: string) {
}
}
}
</script>
<template>
<el-row>
@ -357,6 +391,7 @@ function optionsValue3Get3(data: any, fieldName: string) {
:viewPage="stateList.view"
:form-basic-config="stateForm.formData.form"
:fields-detail-list="stateForm.formData.list"
:org-and-man-tree = "orgAndManTree"
/>
<!-- <AppFormPage
v-else

Loading…
Cancel
Save