Browse Source

Merge branch 'lwx_v17'

# Conflicts:
#	src/views/sysworkflow/lowcodepage/pageFlow/appTableFlow.vue
#	src/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue
#	src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue
qin_15
hreenshan112 9 months ago
parent
commit
8986d779d1
  1. 380
      src/components/DesignForm/app/index.vue
  2. 4
      src/components/DesignForm/assembly/index.ts
  3. 51
      src/components/DesignForm/formControlPropertiNew.vue
  4. 396
      src/components/DesignForm/tableListPage/index.vue
  5. 50
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue
  6. 171
      src/views/sysworkflow/lowcodepage/pageFlow/appTableFlow.vue
  7. 332
      src/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue
  8. 37
      src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue

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

@ -74,6 +74,7 @@ const props = withDefaults(
viewPage?: viewPageType; viewPage?: viewPageType;
formBasicConfig?: any; formBasicConfig?: any;
fieldsDetailList?:any; fieldsDetailList?:any;
orgAndManTree?:any;
}>(), }>(),
{ {
showPage: true, showPage: true,
@ -119,6 +120,9 @@ const props = withDefaults(
fieldsDetailList: () => { fieldsDetailList: () => {
return {}; return {};
}, },
orgAndManTree: () => {
return {};
},
} }
); );
const emits = defineEmits<{ const emits = defineEmits<{
@ -321,6 +325,7 @@ let checkboxs: any[] = [];
let switchs: any[] = []; let switchs: any[] = [];
let selects: any[] = []; let selects: any[] = [];
let tables: any[] = []; let tables: any[] = [];
let dofs: any[] = [];//deptOrgAndOrgCententAndFounderArr
function getAsfs() { function getAsfs() {
//setTimeout(() => { //setTimeout(() => {
let dataList = ref({}); let dataList = ref({});
@ -337,7 +342,9 @@ function getAsfs() {
switchs.push(dataList.value[i]) switchs.push(dataList.value[i])
} else if(dataList.value[i].type == "select"){ } else if(dataList.value[i].type == "select"){
selects.push(dataList.value[i]) selects.push(dataList.value[i])
} else if ( } 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 == "card" ||
dataList.value[i].type == "flex" || dataList.value[i].type == "flex" ||
dataList.value[i].type == "div" || dataList.value[i].type == "div" ||
@ -358,6 +365,8 @@ function getAsfs() {
switchs.push(element) switchs.push(element)
}else if(element.type == "select"){ }else if(element.type == "select"){
selects.push(element) selects.push(element)
}else if(element.type == "deptOrg"||element.type == "orgCentent"||element.type == "founder"){
dofs.push(element)
} }
}); });
} else if (dataList.value[i].type == "grid") { } else if (dataList.value[i].type == "grid") {
@ -378,6 +387,8 @@ function getAsfs() {
switchs.push(a) switchs.push(a)
}else if(a.type == "select"){ }else if(a.type == "select"){
selects.push(a) 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) switchs.push(a)
}else if(a.type == "select"){ }else if(a.type == "select"){
selects.push(a) 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") { }else if (a.type == "flex" || a.type == "table") {
if (a.type == "table") { if (a.type == "table") {
tables.push(dataList.value[i]); tables.push(dataList.value[i]);
@ -419,6 +432,8 @@ function getAsfs() {
switchs.push(q) switchs.push(q)
}else if(q.type == "select"){ }else if(q.type == "select"){
selects.push(q) 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(','); let parts = str.split(',');
return parts.map(part => parseFloat(part)); 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 //liwenxuan 20250120 end
@ -477,174 +522,195 @@ const setUpClick = (val: string, id: string) => {
text: '正在生成二维码,请稍候...' // text: '正在生成二维码,请稍候...' //
}); });
//console.log(props.formBasicConfig) //console.log(props.formBasicConfig)
// if(props.formBasicConfig.qrCodeFlag==true){
let getDetailQrCodesData: any = {} if(props.formBasicConfig.qrCodeInside==true){
let currentFieldsMapArrObj: any = {} if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"&&props.formBasicConfig.qrCodeShowFields.length==0){
getDetailQrCodes(idArray).then(({ data }) => { alert("未选择表格展示字段")
getDetailQrCodesData = JSON.parse(JSON.stringify(data)); return
if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"){ }
let asfQueryParams1: any[] = []; //
for (let key in getDetailQrCodesData) { let getDetailQrCodesData: any = {}
currentFieldsMapArrObj[key] = getDetailQrCodesData[key] let currentFieldsMapArrObj: any = {}
if (getDetailQrCodesData.hasOwnProperty(key)) { getDetailQrCodes(idArray).then(({ data }) => {
let currentFieldsMap = getDetailQrCodesData[key].fieldsMap getDetailQrCodesData = JSON.parse(JSON.stringify(data));
//console.log(currentFieldsMap) if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"){
// let asfQueryParams1: any[] = [];
for (let attr_name in currentFieldsMap) { for (let key in getDetailQrCodesData) {
if (currentFieldsMap.hasOwnProperty(attr_name)) { currentFieldsMapArrObj[key] = getDetailQrCodesData[key]
//console.log("attr_name------"+attr_name) if (getDetailQrCodesData.hasOwnProperty(key)) {
//console.log(`: ${attr_name}, : ${currentFieldsMap[attr_name]}`); let currentFieldsMap = getDetailQrCodesData[key].fieldsMap
radios.forEach(function(element) { //console.log(currentFieldsMap)
if(attr_name==element.name){ //
//,valueoptions for (let attr_name in currentFieldsMap) {
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] if (currentFieldsMap.hasOwnProperty(attr_name)) {
let optionsHasCurrentValue = false //console.log("attr_name------"+attr_name)
element.options.forEach((element1: any) => { //console.log(`: ${attr_name}, : ${currentFieldsMap[attr_name]}`);
if(toConvertValue==element1.value){ radios.forEach(function(element) {
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+element1.label if(attr_name==element.name){
optionsHasCurrentValue = true //,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let optionsHasCurrentValue = false
element.options.forEach((element1: any) => {
if(toConvertValue==element1.value){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+element1.label
optionsHasCurrentValue = true
}
});
if(optionsHasCurrentValue==false){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+""
} }
});
if(optionsHasCurrentValue==false){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+""
} }
} });
}); selects.forEach(function(element) {
selects.forEach(function(element) { if(attr_name==element.name){
if(attr_name==element.name){ //,valueoptions
//,valueoptions let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] let optionsHasCurrentValue = false
let optionsHasCurrentValue = false element.options.forEach((element1: any) => {
element.options.forEach((element1: any) => { if(toConvertValue==element1.value){
if(toConvertValue==element1.value){ currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+element1.label
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+element1.label optionsHasCurrentValue = true
optionsHasCurrentValue = true }
});
if(optionsHasCurrentValue==false){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+""
} }
});
if(optionsHasCurrentValue==false){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+""
} }
} });
}); //console.log(dofs)
switchs.forEach(function(element) { dofs.forEach(function(element) {
if(attr_name==element.name){ if(attr_name==element.name){
//,valueoptions //,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
if(toConvertValue=="0"){ let orgName = getLabelById(toConvertValue)
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"禁用" currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+orgName
}else{
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"启用"
} }
} });
}); switchs.forEach(function(element) {
checkboxs.forEach(function(element) { if(attr_name==element.name){
if(attr_name==element.name){ //,valueoptions
//,valueoptions let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] if(toConvertValue=="0"){
let toConvertArr = convertStringToArray(toConvertValue); currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"禁用"
let toAddStr = "" }else{
if(toConvertArr.length>0){ currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"启用"
toConvertArr.forEach((element1: any) => { }
element.options.forEach((element2: any) => {
if(element1==element2.value){
toAddStr = toAddStr+element2.label+","
}
});
});
toAddStr = toAddStr.slice(0, -1)
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+toAddStr
} }
} });
}); checkboxs.forEach(function(element) {
asfs.forEach(function(element) { if(attr_name==element.name){
if(attr_name==element.name){ //,valueoptions
//,valueoptions let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] let toConvertArr = convertStringToArray(toConvertValue);
if(toConvertValue.length>0){ let toAddStr = ""
//console.log(element) if(toConvertArr.length>0){
let fieldCount = 0;//>0field toConvertArr.forEach((element1: any) => {
asfQueryParams1.forEach((item1: any) => { element.options.forEach((element2: any) => {
//field asfQueryParamsItem1,fieldasfQueryParamsItem1.asfToSelectIds1asfMasterAndAsfId1 if(element1==element2.value){
// pushasfQueryParamsItem1 toAddStr = toAddStr+element2.label+","
if(item1.field==element.name){ }
fieldCount++ });
});
toAddStr = toAddStr.slice(0, -1)
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+toAddStr
}
} }
}); });
if(fieldCount>0){ asfs.forEach(function(element) {
// if(attr_name==element.name){
//field //,valueoptions
asfQueryParams1.forEach((item1: any) => { let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
if(item1.field==element.name){ if(toConvertValue.length>0){
//console.log(element)
let fieldCount = 0;//>0field
asfQueryParams1.forEach((item1: any) => {
//field asfQueryParamsItem1,fieldasfQueryParamsItem1.asfToSelectIds1asfMasterAndAsfId1
// pushasfQueryParamsItem1
if(item1.field==element.name){
fieldCount++
}
});
if(fieldCount>0){
//
//field
asfQueryParams1.forEach((item1: any) => {
if(item1.field==element.name){
let asfMasterAndAsfId1: any = {};
asfMasterAndAsfId1.asfId = toConvertValue+"";
asfMasterAndAsfId1.asfMasterId = key+"";
item1.asfToSelectIds.push(asfMasterAndAsfId1)
}
});
}else{
//
let asfQueryParamsItem1: any = {};
asfQueryParamsItem1.formId = element.control.formid;
asfQueryParamsItem1.field = element.name;
let asfToSelectIds1: any[] = [];
asfQueryParamsItem1.asfToSelectIds = asfToSelectIds1;
let asfMasterAndAsfId1: any = {}; let asfMasterAndAsfId1: any = {};
asfMasterAndAsfId1.asfId = toConvertValue+""; asfMasterAndAsfId1.asfId = toConvertValue+"";
asfMasterAndAsfId1.asfMasterId = key+""; asfMasterAndAsfId1.asfMasterId = key+"";
item1.asfToSelectIds.push(asfMasterAndAsfId1) asfToSelectIds1.push(asfMasterAndAsfId1)
asfQueryParams1.push(asfQueryParamsItem1)
} }
}); }
}else{
//
let asfQueryParamsItem1: any = {};
asfQueryParamsItem1.formId = element.control.formid;
asfQueryParamsItem1.field = element.name;
let asfToSelectIds1: any[] = [];
asfQueryParamsItem1.asfToSelectIds = asfToSelectIds1;
let asfMasterAndAsfId1: any = {};
asfMasterAndAsfId1.asfId = toConvertValue+"";
asfMasterAndAsfId1.asfMasterId = key+"";
asfToSelectIds1.push(asfMasterAndAsfId1)
asfQueryParams1.push(asfQueryParamsItem1)
} }
} })
} }
})
} }
setTimeout(()=>{
getDetailQrCodesData[key].fieldsMap = modifyFieldsMap4(currentFieldsMap)
},800)
} }
setTimeout(()=>{
getDetailQrCodesData[key].fieldsMap = modifyFieldsMap4(currentFieldsMap)
},800)
}
}
getAsfDataTitlesByIds(asfQueryParams1).then(({ data }) => {
let getAsfDataTitlesByIdsData = JSON.parse(JSON.stringify(data));
for (let key in currentFieldsMapArrObj) {
if (getDetailQrCodesData.hasOwnProperty(key)) {
let currentFieldsMap = getDetailQrCodesData[key].fieldsMap
getAsfDataTitlesByIdsData.forEach((element1: any) => {
element1.list.forEach((element2: any) => {
if(key==element2.asfMasterId){
currentFieldsMap[element1.field] = currentFieldsMap[element1.field].split("!@#@!")[0]+"!@#@!"+element2.label
}
})
})
} }
}
})
getAsfDataTitlesByIds(asfQueryParams1).then(({ data }) => {
let getAsfDataTitlesByIdsData = JSON.parse(JSON.stringify(data));
setTimeout(()=>{ for (let key in currentFieldsMapArrObj) {
tablesData.value = getDetailQrCodesData if (getDetailQrCodesData.hasOwnProperty(key)) {
},810) let currentFieldsMap = getDetailQrCodesData[key].fieldsMap
getAsfDataTitlesByIdsData.forEach((element1: any) => {
element1.list.forEach((element2: any) => {
if(key==element2.asfMasterId){
setTimeout(()=>{ currentFieldsMap[element1.field] = currentFieldsMap[element1.field].split("!@#@!")[0]+"!@#@!"+element2.label
}
})
})
}
}
})
setTimeout(()=>{
tablesData.value = getDetailQrCodesData
},810)
setTimeout(()=>{
loadingInstance1.close()
qrCodesPrintDialogFlag.value = true
},820)
}else if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="1"){
//fieldsMap = null
tablesData.value = getDetailQrCodesData
qrCodesPrintDialogFlag.value = true
loadingInstance1.close()
}
}).finally(()=>{
loadingInstance1.close() loadingInstance1.close()
qrCodesPrintDialogFlag.value = true })
},820) }else{
alert("内部二维码功能未启用")
}else if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="1"){
//fieldsMap = null
tablesData.value = getDetailQrCodesData
qrCodesPrintDialogFlag.value = true
loadingInstance1.close()
} }
}else{
})/* .finally(()=>{ alert("请先为本表单开启二维码功能")
loadingInstance1.close() }
qrCodesPrintDialogFlag.value = true
}) */
}else{ }else{
alert("未选中任何一条,请先选择") alert("未选中任何一条,请先选择")
@ -889,6 +955,7 @@ const getPageData = () => {
switchs = []; switchs = [];
selects = []; selects = [];
tables = []; tables = [];
dofs = [];
getAsfs() getAsfs()
}); });
} }
@ -1940,9 +2007,9 @@ const transformOption = (val: string | number, type?: string) => {
title="生成的二维码" title="生成的二维码"
:show-close="false" :show-close="false"
style="margin-top: 10px" style="margin-top: 10px"
width="50%" width="40%"
> >
<div v-if="formBasicConfig.qrCodePrintStyle == '2'" style="min-height: 50px; max-height: 750px; overflow-y: auto"> <div v-if="formBasicConfig.qrCodePrintStyle == '2'" style="max-width: 600px;min-height: 50px; max-height: 750px; overflow-y: auto">
<div <div
v-for="(tableData, tableKey) in tablesData" v-for="(tableData, tableKey) in tablesData"
:id="tableKey" :id="tableKey"
@ -1952,8 +2019,8 @@ const transformOption = (val: string | number, type?: string) => {
> >
<table> <table>
<tr> <tr>
<th style="font-weight: bold; font-size:medium;" colspan="2">{{ tablesData[tableKey].appName }}-{{ tablesData[tableKey].formName }}</th> <th colspan="2">{{ tablesData[tableKey].appName }}-{{ tablesData[tableKey].formName }}</th>
<th rowspan="6"><img :src="tableData.bufferedImage" alt="二维码" width="auto" height="100%"></th> <td rowspan="6" style="width: 240px;"><img :src="tableData.bufferedImage" alt="二维码" width="200px" style="margin-top: 5px;" ></td>
</tr> </tr>
<tr v-for="(item, fIndex) in tableData.fieldsMap" :key="fIndex"> <tr v-for="(item, fIndex) in tableData.fieldsMap" :key="fIndex">
<th>{{ item.key }}</th> <th>{{ item.key }}</th>
@ -2065,10 +2132,13 @@ const transformOption = (val: string | number, type?: string) => {
table { table {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
font-size: 13px;
text-align: center
} }
td, th { td, th {
border: 1px solid black; border: 1px solid black;
padding: 8px; padding: 8px;
vertical-align: middle; /* 设置文字上下居中 */
} }
</style> </style>

4
src/components/DesignForm/assembly/index.ts

@ -217,7 +217,9 @@ export default [
iconFont: 'fa-text-width', iconFont: 'fa-text-width',
control: { control: {
// 组件所有属性 // 组件所有属性
modelValue: '' modelValue: '',
scanInputFlag: false,
scanType:'',
}, },
config: {}, // 其他配置信息 config: {}, // 其他配置信息
styles: { styles: {

51
src/components/DesignForm/formControlPropertiNew.vue

@ -527,6 +527,7 @@ const attrList = computed(() => {
path: "config.append", path: "config.append",
vShow: ["input", "password", "digitpage"], vShow: ["input", "password", "digitpage"],
}, },
// { // {
// label: '', // label: '',
// value: control.activeValue, // value: control.activeValue,
@ -733,6 +734,14 @@ const attrList = computed(() => {
vIf: state.isSearch, vIf: state.isSearch,
vShow: ["associatedForms"], vShow: ["associatedForms"],
}, },
{
label: "移动端扫描输入",
value: config.scanInput,
path: "config.scanInput",
type: "input",
vIf: state.isSearch,
vShow: ["input"],
},
{ {
label: "隐藏条件", label: "隐藏条件",
value: config.associatedForms, value: config.associatedForms,
@ -3377,6 +3386,19 @@ const gainFormGroupList = () => {
} }
}); });
}; };
//liwenxuan 2025 start
const scanTypes = [
{
value: 'QrCode',
label: '二维码',
},
{
value: 'OCR',
label: '光学字符识别',
},
]
//liwenxuan 2025 end
let asfs: any[] = []; let asfs: any[] = [];
let asfsExpectCurrent: any[] = []; let asfsExpectCurrent: any[] = [];
@ -4233,6 +4255,35 @@ const updataBase = (val: any) => {
> >
</el-row> </el-row>
<el-row v-else-if="item.type === 'input'"><!-- 移动端扫描输入 -->
<el-switch v-model="controlData.control.scanInputFlag" />
<div
v-if="controlData.control.scanInputFlag"
style="
display: flex;
width: auto;
margin-top: 33px;
margin-left: -125px;
padding-bottom: 6px;
"
>
<div style="margin-right: 12px;">扫描方式</div>
<el-select
v-model="controlData.control.scanType"
style="width: 150px; height:20px">
<el-option
v-for="scanType in scanTypes"
:key="scanType.value"
:label="scanType.label"
:value="scanType.value"
/>
</el-select>
</div>
</el-row>
<el-row v-else-if="item.type === 'associatedForms_dataRange'"> <el-row v-else-if="item.type === 'associatedForms_dataRange'">
<el-button <el-button
v-if="controlData.control.dataRangeConditionHtml === ''" v-if="controlData.control.dataRangeConditionHtml === ''"

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

@ -70,6 +70,7 @@ const props = withDefaults(
viewPage?: viewPageType; viewPage?: viewPageType;
formBasicConfig?: any; formBasicConfig?: any;
fieldsDetailList?:any; fieldsDetailList?:any;
orgAndManTree?:any;
}>(), }>(),
{ {
showPage: true, showPage: true,
@ -112,6 +113,9 @@ const props = withDefaults(
fieldsDetailList: () => { fieldsDetailList: () => {
return {}; return {};
}, },
orgAndManTree: () => {
return {};
},
} }
); );
const emits = defineEmits<{ const emits = defineEmits<{
@ -314,6 +318,8 @@ let checkboxs: any[] = [];
let switchs: any[] = []; let switchs: any[] = [];
let selects: any[] = []; let selects: any[] = [];
let tables: any[] = []; let tables: any[] = [];
let dofs: any[] = [];//deptOrgAndOrgCententAndFounderArr
function getAsfs() { function getAsfs() {
//setTimeout(() => { //setTimeout(() => {
let dataList = ref({}); let dataList = ref({});
@ -330,7 +336,9 @@ function getAsfs() {
switchs.push(dataList.value[i]) switchs.push(dataList.value[i])
} else if(dataList.value[i].type == "select"){ } else if(dataList.value[i].type == "select"){
selects.push(dataList.value[i]) selects.push(dataList.value[i])
} else if ( } 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 == "card" ||
dataList.value[i].type == "flex" || dataList.value[i].type == "flex" ||
dataList.value[i].type == "div" || dataList.value[i].type == "div" ||
@ -351,6 +359,8 @@ function getAsfs() {
switchs.push(element) switchs.push(element)
}else if(element.type == "select"){ }else if(element.type == "select"){
selects.push(element) selects.push(element)
}else if(element.type == "deptOrg"||element.type == "orgCentent"||element.type == "founder"){
dofs.push(element)
} }
}); });
} else if (dataList.value[i].type == "grid") { } else if (dataList.value[i].type == "grid") {
@ -371,6 +381,8 @@ function getAsfs() {
switchs.push(a) switchs.push(a)
}else if(a.type == "select"){ }else if(a.type == "select"){
selects.push(a) 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) switchs.push(a)
}else if(a.type == "select"){ }else if(a.type == "select"){
selects.push(a) 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") { }else if (a.type == "flex" || a.type == "table") {
if (a.type == "table") { if (a.type == "table") {
tables.push(dataList.value[i]); tables.push(dataList.value[i]);
@ -412,6 +426,8 @@ function getAsfs() {
switchs.push(q) switchs.push(q)
}else if(q.type == "select"){ }else if(q.type == "select"){
selects.push(q) selects.push(q)
}else if(q.type == "deptOrg"||q.type == "orgCentent"||q.type == "founder"){
dofs.push(q)
} }
} }
} }
@ -425,7 +441,6 @@ function getAsfs() {
//}, 500); //}, 500);
} }
function convertStringToArray(str: string) { function convertStringToArray(str: string) {
if (typeof str!== 'string') { if (typeof str!== 'string') {
throw new Error('Input must be a string.'); throw new Error('Input must be a string.');
@ -442,6 +457,45 @@ function convertStringToArray(str: string) {
return parts.map(part => parseFloat(part)); 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 //liwenxuan 20250120 end
@ -467,174 +521,202 @@ const setUpClick = (val: string, id: string) => {
text: '正在生成二维码,请稍候...' // text: '正在生成二维码,请稍候...' //
}); });
//console.log(props.formBasicConfig) //console.log(props.formBasicConfig)
//
let getDetailQrCodesData: any = {} if(props.formBasicConfig.qrCodeFlag==true){
let currentFieldsMapArrObj: any = {} if(props.formBasicConfig.qrCodeInside==true){
getDetailQrCodes(idArray).then(({ data }) => { if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"&&props.formBasicConfig.qrCodeShowFields.length==0){
getDetailQrCodesData = JSON.parse(JSON.stringify(data)); alert("未选择表格展示字段")
if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"){ return
let asfQueryParams1: any[] = []; }
for (let key in getDetailQrCodesData) {
currentFieldsMapArrObj[key] = getDetailQrCodesData[key] //
if (getDetailQrCodesData.hasOwnProperty(key)) { let getDetailQrCodesData: any = {}
let currentFieldsMap = getDetailQrCodesData[key].fieldsMap let currentFieldsMapArrObj: any = {}
//console.log(currentFieldsMap) getDetailQrCodes(idArray).then(({ data }) => {
// getDetailQrCodesData = JSON.parse(JSON.stringify(data));
for (let attr_name in currentFieldsMap) { if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"){
if (currentFieldsMap.hasOwnProperty(attr_name)) { let asfQueryParams1: any[] = [];
//console.log("attr_name------"+attr_name) for (let key in getDetailQrCodesData) {
//console.log(`: ${attr_name}, : ${currentFieldsMap[attr_name]}`); currentFieldsMapArrObj[key] = getDetailQrCodesData[key]
radios.forEach(function(element) { if (getDetailQrCodesData.hasOwnProperty(key)) {
if(attr_name==element.name){ let currentFieldsMap = getDetailQrCodesData[key].fieldsMap
//,valueoptions //console.log(currentFieldsMap)
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] //
let optionsHasCurrentValue = false for (let attr_name in currentFieldsMap) {
element.options.forEach((element1: any) => { if (currentFieldsMap.hasOwnProperty(attr_name)) {
if(toConvertValue==element1.value){ //console.log("attr_name------"+attr_name)
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+element1.label //console.log(`: ${attr_name}, : ${currentFieldsMap[attr_name]}`);
optionsHasCurrentValue = true radios.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let optionsHasCurrentValue = false
element.options.forEach((element1: any) => {
if(toConvertValue==element1.value){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+element1.label
optionsHasCurrentValue = true
}
});
if(optionsHasCurrentValue==false){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+""
} }
});
if(optionsHasCurrentValue==false){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+""
} }
} });
}); selects.forEach(function(element) {
selects.forEach(function(element) { if(attr_name==element.name){
if(attr_name==element.name){ //,valueoptions
//,valueoptions let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] let optionsHasCurrentValue = false
let optionsHasCurrentValue = false element.options.forEach((element1: any) => {
element.options.forEach((element1: any) => { if(toConvertValue==element1.value){
if(toConvertValue==element1.value){ currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+element1.label
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+element1.label optionsHasCurrentValue = true
optionsHasCurrentValue = true }
});
if(optionsHasCurrentValue==false){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+""
} }
});
if(optionsHasCurrentValue==false){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+""
} }
} });
}); //console.log(dofs)
switchs.forEach(function(element) { dofs.forEach(function(element) {
if(attr_name==element.name){ if(attr_name==element.name){
//,valueoptions //,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
if(toConvertValue=="0"){ //console.log(toConvertValue)
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"禁用" if(isAllCharactersNumbers(toConvertValue)){
}else{ let orgName = getLabelById(toConvertValue)
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"启用" currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+orgName
}
} }
} });
}); switchs.forEach(function(element) {
checkboxs.forEach(function(element) { if(attr_name==element.name){
if(attr_name==element.name){ //,valueoptions
//,valueoptions let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] if(toConvertValue=="0"){
let toConvertArr = convertStringToArray(toConvertValue); currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"禁用"
let toAddStr = "" }else{
if(toConvertArr.length>0){ currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"启用"
toConvertArr.forEach((element1: any) => { }
element.options.forEach((element2: any) => {
if(element1==element2.value){
toAddStr = toAddStr+element2.label+","
}
});
});
toAddStr = toAddStr.slice(0, -1)
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+toAddStr
} }
} });
}); checkboxs.forEach(function(element) {
asfs.forEach(function(element) { if(attr_name==element.name){
if(attr_name==element.name){ //,valueoptions
//,valueoptions let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] let toConvertArr = convertStringToArray(toConvertValue);
if(toConvertValue.length>0){ let toAddStr = ""
//console.log(element) if(toConvertArr.length>0){
let fieldCount = 0;//>0field toConvertArr.forEach((element1: any) => {
asfQueryParams1.forEach((item1: any) => { element.options.forEach((element2: any) => {
//field asfQueryParamsItem1,fieldasfQueryParamsItem1.asfToSelectIds1asfMasterAndAsfId1 if(element1==element2.value){
// pushasfQueryParamsItem1 toAddStr = toAddStr+element2.label+","
if(item1.field==element.name){ }
fieldCount++ });
});
toAddStr = toAddStr.slice(0, -1)
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+toAddStr
}
} }
}); });
if(fieldCount>0){ asfs.forEach(function(element) {
// if(attr_name==element.name){
//field //,valueoptions
asfQueryParams1.forEach((item1: any) => { let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
if(item1.field==element.name){ if(toConvertValue.length>0){
//console.log(element)
let fieldCount = 0;//>0field
asfQueryParams1.forEach((item1: any) => {
//field asfQueryParamsItem1,fieldasfQueryParamsItem1.asfToSelectIds1asfMasterAndAsfId1
// pushasfQueryParamsItem1
if(item1.field==element.name){
fieldCount++
}
});
if(fieldCount>0){
//
//field
asfQueryParams1.forEach((item1: any) => {
if(item1.field==element.name){
let asfMasterAndAsfId1: any = {};
asfMasterAndAsfId1.asfId = toConvertValue+"";
asfMasterAndAsfId1.asfMasterId = key+"";
item1.asfToSelectIds.push(asfMasterAndAsfId1)
}
});
}else{
//
let asfQueryParamsItem1: any = {};
asfQueryParamsItem1.formId = element.control.formid;
asfQueryParamsItem1.field = element.name;
let asfToSelectIds1: any[] = [];
asfQueryParamsItem1.asfToSelectIds = asfToSelectIds1;
let asfMasterAndAsfId1: any = {}; let asfMasterAndAsfId1: any = {};
asfMasterAndAsfId1.asfId = toConvertValue+""; asfMasterAndAsfId1.asfId = toConvertValue+"";
asfMasterAndAsfId1.asfMasterId = key+""; asfMasterAndAsfId1.asfMasterId = key+"";
item1.asfToSelectIds.push(asfMasterAndAsfId1) asfToSelectIds1.push(asfMasterAndAsfId1)
asfQueryParams1.push(asfQueryParamsItem1)
} }
}); }
}else{
//
let asfQueryParamsItem1: any = {};
asfQueryParamsItem1.formId = element.control.formid;
asfQueryParamsItem1.field = element.name;
let asfToSelectIds1: any[] = [];
asfQueryParamsItem1.asfToSelectIds = asfToSelectIds1;
let asfMasterAndAsfId1: any = {};
asfMasterAndAsfId1.asfId = toConvertValue+"";
asfMasterAndAsfId1.asfMasterId = key+"";
asfToSelectIds1.push(asfMasterAndAsfId1)
asfQueryParams1.push(asfQueryParamsItem1)
} }
} })
} }
})
} }
setTimeout(()=>{
getDetailQrCodesData[key].fieldsMap = modifyFieldsMap4(currentFieldsMap)
},800)
} }
setTimeout(()=>{
getDetailQrCodesData[key].fieldsMap = modifyFieldsMap4(currentFieldsMap)
},800)
}
}
getAsfDataTitlesByIds(asfQueryParams1).then(({ data }) => {
let getAsfDataTitlesByIdsData = JSON.parse(JSON.stringify(data));
for (let key in currentFieldsMapArrObj) {
if (getDetailQrCodesData.hasOwnProperty(key)) {
let currentFieldsMap = getDetailQrCodesData[key].fieldsMap
getAsfDataTitlesByIdsData.forEach((element1: any) => {
element1.list.forEach((element2: any) => {
if(key==element2.asfMasterId){
currentFieldsMap[element1.field] = currentFieldsMap[element1.field].split("!@#@!")[0]+"!@#@!"+element2.label
}
})
})
} }
getAsfDataTitlesByIds(asfQueryParams1).then(({ data }) => {
let getAsfDataTitlesByIdsData = JSON.parse(JSON.stringify(data));
for (let key in currentFieldsMapArrObj) {
if (getDetailQrCodesData.hasOwnProperty(key)) {
let currentFieldsMap = getDetailQrCodesData[key].fieldsMap
getAsfDataTitlesByIdsData.forEach((element1: any) => {
element1.list.forEach((element2: any) => {
if(key==element2.asfMasterId){
currentFieldsMap[element1.field] = currentFieldsMap[element1.field].split("!@#@!")[0]+"!@#@!"+element2.label
}
})
})
}
}
})
setTimeout(()=>{
tablesData.value = getDetailQrCodesData
},810)
setTimeout(()=>{
loadingInstance1.close()
qrCodesPrintDialogFlag.value = true
},820)
}else if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="1"){
//fieldsMap = null
tablesData.value = getDetailQrCodesData
qrCodesPrintDialogFlag.value = true
loadingInstance1.close()
} }
}).finally(()=>{
loadingInstance1.close()
}) })
}else{
alert("内部二维码功能未启用")
setTimeout(()=>{
tablesData.value = getDetailQrCodesData
},810)
setTimeout(()=>{
loadingInstance1.close()
qrCodesPrintDialogFlag.value = true
},820)
}else if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="1"){
//fieldsMap = null
tablesData.value = getDetailQrCodesData
qrCodesPrintDialogFlag.value = true
loadingInstance1.close()
} }
}else{
})/* .finally(()=>{ alert("请先为本表单开启二维码功能")
loadingInstance1.close() }
qrCodesPrintDialogFlag.value = true
}) */
}else{ }else{
alert("未选中任何一条,请先选择") alert("未选中任何一条,请先选择")
@ -1952,9 +2034,9 @@ const diGuiJilian = (val: any, options: any[]) => {
title="生成的二维码" title="生成的二维码"
:show-close="false" :show-close="false"
style="margin-top: 10px" style="margin-top: 10px"
width="50%" width="40%"
> >
<div v-if="formBasicConfig.qrCodePrintStyle == '2'" style="min-height: 50px; max-height: 750px; overflow-y: auto"> <div v-if="formBasicConfig.qrCodePrintStyle == '2'" style="max-width: 600px;min-height: 50px; max-height: 750px; overflow-y: auto">
<div <div
v-for="(tableData, tableKey) in tablesData" v-for="(tableData, tableKey) in tablesData"
:id="tableKey" :id="tableKey"
@ -1964,8 +2046,8 @@ const diGuiJilian = (val: any, options: any[]) => {
> >
<table> <table>
<tr> <tr>
<th style="font-weight: bold; font-size:medium;" colspan="2">{{ tablesData[tableKey].appName }}-{{ tablesData[tableKey].formName }}</th> <th colspan="2">{{ tablesData[tableKey].appName }}-{{ tablesData[tableKey].formName }}</th>
<th rowspan="6"><img :src="tableData.bufferedImage" alt="二维码" width="auto" height="100%"></th> <td rowspan="6" style="width: 240px;"><img :src="tableData.bufferedImage" alt="二维码" width="200px" style="margin-top: 5px;" ></td>
</tr> </tr>
<tr v-for="(item, fIndex) in tableData.fieldsMap" :key="fIndex"> <tr v-for="(item, fIndex) in tableData.fieldsMap" :key="fIndex">
<th>{{ item.key }}</th> <th>{{ item.key }}</th>
@ -2087,11 +2169,15 @@ const diGuiJilian = (val: any, options: any[]) => {
table { table {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
font-size: 13px;
text-align: center;
} }
td, th { td, th {
border: 1px solid black; border: 1px solid black;
padding: 8px; padding: 8px;
vertical-align: middle; /* 设置文字上下居中 */
} }
</style> </style>

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

@ -5,6 +5,7 @@
--> -->
<script lang='ts' setup> <script lang='ts' setup>
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form' import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form'
import request from "@/utils/request";
import { gainAppPageInfo,getFieldRecord } from '@/api/DesignForm/requestapi' import { gainAppPageInfo,getFieldRecord } from '@/api/DesignForm/requestapi'
import { Edit,Picture as IconPicture } from '@element-plus/icons-vue' import { Edit,Picture as IconPicture } from '@element-plus/icons-vue'
import { appPageDataInit,appWorkFlow } from "@/api/date/type" import { appPageDataInit,appWorkFlow } from "@/api/date/type"
@ -207,6 +208,7 @@ const handleAppPageClick = () =>{
@ 功能: 获取表单初始化信息 @ 功能: 获取表单初始化信息
*/ */
const gainAppFormPageInit = () =>{ const gainAppFormPageInit = () =>{
if(props.menusInfo.id){ 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){ function optionsValue3Get3(data: any,fieldName: string){
//console.log("openAppFormPage","optionsValue3Get3") //console.log("openAppFormPage","optionsValue3Get3")
@ -415,11 +447,24 @@ function optionsValue3Get3(data: any,fieldName: string){
//} //}
} }
defineExpose({ defineExpose({
gainAppFormPageInit 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){ /* function optionsValue5Get5(data:any,fieldName:any){
//console.log("openAppFormPage","optionsValue5Get5") //console.log("openAppFormPage","optionsValue5Get5")
@ -485,6 +530,7 @@ defineExpose({
:viewPage="stateList.view" :viewPage="stateList.view"
:form-basic-config="stateForm.formData.form" :form-basic-config="stateForm.formData.form"
:fields-detail-list="stateForm.formData.list" :fields-detail-list="stateForm.formData.list"
:org-and-man-tree = "orgAndManTree"
@optionsValue5Get5="optionsValue5Get5" @optionsValue5Get5="optionsValue5Get5"
/> />
<ak-form <ak-form

171
src/views/sysworkflow/lowcodepage/pageFlow/appTableFlow.vue

@ -596,8 +596,97 @@ const initLoadData = () => {
} }
}; };
<<<<<<< HEAD
function optionsValue3Get3(data: any, fieldName: string) { function optionsValue3Get3(data: any, fieldName: string) {
/* console.log(data) /* console.log(data)
=======
Promise.all(getFieldRecordPromise).then(()=>{
console.log(gainAppPageInfoData)
let objMastesformStr = JSON.stringify(objMastesform);
gainAppPageInfoData.data.appForm.mastesform = objMastesform
gainAppPageInfoData.data.appForm.mastesformjson = objMastesformStr
appInitData.value = gainAppPageInfoData.data
// console.log("---!",appInitData.value)
mastesformjson.value = gainAppPageInfoData.data.appForm.mastesformjson
isFlow.value = gainAppPageInfoData.data.appForm.flowIsOpen
versionId.value = gainAppPageInfoData.data.appForm.id.toString()
versionTitle.value = gainAppPageInfoData.data.appForm.name
if(gainAppPageInfoData.data.page){
// console.log("data.data.mastesform", data.data)
stateForm.id=gainAppPageInfoData.data.appForm.version.toString()
stateForm.formId =gainAppPageInfoData.data.appForm.cfid.toString()
stateForm.versionId =gainAppPageInfoData.data.appForm.id.toString()
stateForm.formData = objMastesform
stateForm.formData.config.hideField = []//:confighideField,
stateForm.dict = string2json(gainAppPageInfoData.data.appForm.dict)
stateForm.formData.powerstr = string2json(gainAppPageInfoData.data.appForm.powerstr)
// console.log("data.data.mastesform", stateForm.formData)
judgeSubmitCancel({"name":gainAppPageInfoData.data.appForm.mastesformjson})
.then((datajud:any) =>{
if(datajud.code == 0){
if (datajud.data == 3 || datajud.data == 4){
stateForm.formData.list.push(submitButton)
}
}
})
}
});
});
}
}
//liwenxuan 20250206 start
let qrCodeImgInside = ""
const qrCodeInsideDialogFlag = ref(false)
function showFillFormQrCode(){
//,,app,,
//,,,
//cfid
if(stateForm.formData.form.qrCodeFlag==true&&stateForm.formData.form.qrCodeInside==true){
getQrCodeImgInside().then(({ data }) => {
qrCodeImgInside = data
if(qrCodeInsideDialogFlag.value==false){
//console.log(qrCodeImgInside)
qrCodeInsideDialogFlag.value = true
}
})
}else{
alert("请先开启表单二维码功能")
}
}
function getQrCodeImgInside() {
return request({
url: "/javasys/lowCode/QrCode/getQrCodeImgInside",
method: "post",
data: {
cfid: stateForm.formId,
},
});
}
//liwenxuan 20250206 end
function optionsValue3Get3(data: any,fieldName: string){
/* console.log(data)
>>>>>>> lwx_v17
console.log(fileName) console.log(fileName)
console.log("appTableFlow","optionsValue3Get3") */ console.log("appTableFlow","optionsValue3Get3") */
for (let i = 0; i < stateForm.formData.list.length; i++) { for (let i = 0; i < stateForm.formData.list.length; i++) {
@ -611,6 +700,7 @@ function optionsValue3Get3(data: any, fieldName: string) {
} }
</script> </script>
<template> <template>
<<<<<<< HEAD
<el-drawer <el-drawer
v-model="drawerOpenOrClose" v-model="drawerOpenOrClose"
v-loading="loadingData" v-loading="loadingData"
@ -677,6 +767,22 @@ function optionsValue3Get3(data: any, fieldName: string) {
/> />
</div> </div>
<!-- <AppFormPage <!-- <AppFormPage
=======
<el-drawer v-model="drawerOpenOrClose" v-loading="loadingData" :title="versiontitle" :close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true" :size="drawbox" class="drawerClass" >
<!-- liwenxuan 20250206 在列表新增数据页增加扫码填单按钮显示填单二维码 start -->
<!-- 自定义抽屉头部 -->
<template #header>
<div v-if="stateForm.formData.form.qrCodeFlag==true&&stateForm.formData.form.qrCodeInside==true" class="drawer-header" >
{{versiontitle}}
<div class="flex-grow"></div>
<el-button size="small" style="margin-right: 15px" @click="showFillFormQrCode" >扫码填单</el-button>
</div>
</template>
<!-- liwenxuan 20250206 在列表新增数据页增加扫码填单按钮显示填单二维码 end -->
<!-- <AppFormPage
>>>>>>> lwx_v17
ref="formEl" ref="formEl"
:number="props.pickAppMenu.id" :number="props.pickAppMenu.id"
@ -707,6 +813,7 @@ function optionsValue3Get3(data: any, fieldName: string) {
:after-submit="afterSubmit" :after-submit="afterSubmit"
add-url="addData" add-url="addData"
@optionsValue3Get3="optionsValue3Get3" @optionsValue3Get3="optionsValue3Get3"
<<<<<<< HEAD
/> --> /> -->
</el-drawer> </el-drawer>
</template> </template>
@ -732,5 +839,69 @@ function optionsValue3Get3(data: any, fieldName: string) {
cursor: pointer; cursor: pointer;
} }
} }
=======
/>
</el-drawer>
<el-dialog
v-model="qrCodeInsideDialogFlag"
class="glxxsztc"
top="150px"
:close-on-click-modal="false"
title="内部二维码"
:show-close="false"
style="margin-top: 70px"
width="25%"
>
<img :src="qrCodeImgInside" style="width: 80%;height: 50%;" />
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="qrCodeInsideDialogFlag = false">
确定
</el-button>
</div>
</template>
</el-dialog>
</template>
<style lang='scss' scoped>
.common-layout{
height: calc(100vh - 55px);
padding: 0 15px;
.el-main{
height: calc(100vh - 55px);
padding:0;
}
.flowBox{
height: calc(100vh - 55px);
border-left: 1px solid #ccc;
padding: 0 15px;
}
.el-header{
padding:0 10px;
line-height:30px;
text-align:right;
font-size:20px;
i{
cursor:pointer;
}
}
.drawer-header {
display: flex;
align-items: center;
//padding: 12px;
}
.flex-grow {
/* 占据剩余的可用空间,将后面的元素推到右边 */
flex-grow: 1;
}
.drawer-close {
cursor: pointer;
//margin-left: 8px;
}
>>>>>>> lwx_v17
} }
</style> </style>

332
src/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue

@ -415,143 +415,211 @@ const closeAppSubmit = () => {
@ 时间: 2024-04-09 16:50:37 @ 时间: 2024-04-09 16:50:37
@ 功能: 保存草稿 @ 功能: 保存草稿
*/ */
const saveDraftPage = (type: string, val?: any) => { const saveDraftPage = (type: string,val?:any) => {
if (type === "success") { if (type === 'success') {
emits("searchquery"); emits("searchquery")
if (isFlowTable.value) { if(isFlowTable.value){
if (val.code == 0) { if(val.code == 0){
let sendInfo = { let sendInfo ={
id: val.data.uuid, id:val.data.uuid,
flowList: flowMap.value, flowList:flowMap.value,
state: 1, state:1
}; }
startRunFlow(sendInfo).then((data: any) => { startRunFlow(sendInfo)
// console.log("--------1---------->",data) .then((data:any)=>{
}); // console.log("--------1---------->",data)
} })
} }
} }
closeAppSubmit(); }
}; closeAppSubmit()
}
//liwenxuan 20250206 start
let qrCodeImgInside = ""
const qrCodeInsideDialogFlag = ref(false)
function showFillFormQrCode(){
//,,app,,
//,,,
//cfid
if(state.formData.form.qrCodeFlag==true&&state.formData.form.qrCodeInside==true){
getQrCodeImgInside().then(({ data }) => {
qrCodeImgInside = data
if(qrCodeInsideDialogFlag.value==false){
//console.log(qrCodeImgInside)
qrCodeInsideDialogFlag.value = true
}
})
}else{
alert("请先开启表单二维码功能")
}
}
function optionsValue3Get3(data: any, fieldName: string) { function getQrCodeImgInside() {
//console.log("tableFlow","optionsValue3Get3") return request({
url: "/javasys/lowCode/QrCode/getQrCodeImgInside",
method: "post",
data: {
cfid: state.id,
},
});
}
//liwenxuan 20250206 end
function optionsValue3Get3(data: any,fieldName: string){
//console.log("tableFlow","optionsValue3Get3")
if(fieldName.startsWith("childTable---")){
let tableAndFieldNameArr = fieldName.split("---")
for(let i = 0; i < state.formData.list.length; i++){
if(state.formData.list[i].name==tableAndFieldNameArr[1]){
for(let u = 0; u < state.formData.list[i].list.length; u++){
if(state.formData.list[i].list[u].name==tableAndFieldNameArr[2]){
state.formData.list[i].list[u].options = []
for(let j = 0;j<data.length;j++){
state.formData.list[i].list[u].options.push(data[j])
}
}
}
}
}
}else{
for(let i = 0; i < state.formData.list.length; i++){
if(state.formData.list[i].name==fieldName){
state.formData.list[i].options = []
for(let j = 0;j<data.length;j++){
state.formData.list[i].options.push(data[j])
}
}
}
}
if (fieldName.startsWith("childTable---")) {
let tableAndFieldNameArr = fieldName.split("---");
for (let i = 0; i < state.formData.list.length; i++) {
if (state.formData.list[i].name == tableAndFieldNameArr[1]) {
for (let u = 0; u < state.formData.list[i].list.length; u++) {
if (state.formData.list[i].list[u].name == tableAndFieldNameArr[2]) {
state.formData.list[i].list[u].options = [];
for (let j = 0; j < data.length; j++) {
state.formData.list[i].list[u].options.push(data[j]);
}
}
}
}
}
} else {
for (let i = 0; i < state.formData.list.length; i++) {
if (state.formData.list[i].name == fieldName) {
state.formData.list[i].options = [];
for (let j = 0; j < data.length; j++) {
state.formData.list[i].options.push(data[j]);
}
}
}
}
} }
/*
*/
</script> </script>
<template> <template>
<el-drawer <el-drawer v-model="drawerOpenOrClose" v-loading="loadingData" :title="versiontitle" :close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true" :size="drawbox" class="drawerClass" >
v-model="drawerOpenOrClose" <!-- liwenxuan 20250206 在列表新增数据页增加扫码填单按钮显示填单二维码 start -->
v-loading="loadingData" <!-- 自定义抽屉头部 -->
:title="versiontitle" <template #header>
:close-on-click-modal="false" <div v-if="state.formData.form.qrCodeFlag==true&&state.formData.form.qrCodeInside==true" class="drawer-header" >
:close-on-press-escape="false" {{versiontitle}}
:destroy-on-close="true" <div class="flex-grow"></div>
:size="drawbox" <el-button size="small" style="margin-right: 15px" @click="showFillFormQrCode" >扫码填单</el-button>
class="drawerClass" </div>
> </template>
<div v-if="isFlowTable" class="common-layout"> <!-- liwenxuan 20250206 在列表新增数据页增加扫码填单按钮显示填单二维码 end -->
<el-container>
<el-main v-loading="formLoading" element-loading-text="Loading..."> <div v-if="isFlowTable" class="common-layout">
<ak-form <el-container>
ref="formEl" <el-main v-loading="formLoading" element-loading-text="Loading...">
:numrun="formType" <ak-form
:form-data="state.formData" ref="formEl"
:type="formType" :numrun="formType"
:dict="state.dict" :form-data="state.formData"
request-url="getFormContent" :type="formType"
add-url="saveFormContent" :dict="state.dict"
edit-url="editFormContent" request-url="getFormContent"
:before-submit="beforeSubmit" add-url="saveFormContent"
:after-submit="afterSubmit" edit-url="editFormContent"
:close-app-submit="closeAppSubmit" :before-submit="beforeSubmit"
:change-key-val="changeKeyVal" :after-submit="afterSubmit"
:save-draft-page="saveDraftPage" :close-app-submit="closeAppSubmit"
/> :change-key-val="changeKeyVal"
</el-main> :save-draft-page="saveDraftPage"
<el-aside />
v-loading="flowLoading" </el-main>
element-loading-text="Loading..." <el-aside v-loading="flowLoading" element-loading-text="Loading..." width="350px" class="flowBox">
width="350px" <el-text size="large">审批流程</el-text>
class="flowBox" <FlowStep v-model:flow-map="flowMap" :next-step="nextStep" :current-progress="currentProgress" :node-key="nodeKey" />
> </el-aside>
<el-text size="large">审批流程</el-text> </el-container>
<FlowStep </div>
v-model:flow-map="flowMap" <!--无流程表单-->
:next-step="nextStep" <div v-else class="common-layout">
:current-progress="currentProgress"
:node-key="nodeKey" <ak-form
/> ref="formEl"
</el-aside> v-loading="formLoading" element-loading-text="Loading..."
</el-container> :form-data="state.formData"
</div> :type="formType"
<!--无流程表单--> :numrun="formType"
<div v-else class="common-layout"> :dict="state.dict"
<ak-form request-url="getFormContent"
ref="formEl" add-url="saveFormContent"
v-loading="formLoading" edit-url="editFormContent"
element-loading-text="Loading..." :before-submit="beforeSubmit"
:form-data="state.formData" :after-submit="afterSubmit"
:type="formType" :close-app-submit="closeAppSubmit"
:numrun="formType" :save-draft-page="saveDraftPage"
:dict="state.dict" @optionsValue3Get3="optionsValue3Get3"
request-url="getFormContent" />
add-url="saveFormContent" </div>
edit-url="editFormContent"
:before-submit="beforeSubmit"
:after-submit="afterSubmit"
:close-app-submit="closeAppSubmit" </el-drawer>
:save-draft-page="saveDraftPage" <el-dialog
@optionsValue3Get3="optionsValue3Get3" v-model="qrCodeInsideDialogFlag"
/> class="glxxsztc"
</div> top="150px"
</el-drawer> :close-on-click-modal="false"
title="内部二维码"
:show-close="false"
style="margin-top: 70px"
width="25%"
>
<img :src="qrCodeImgInside" style="width: 80%;height: 50%;" />
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="qrCodeInsideDialogFlag = false">
确定
</el-button>
</div>
</template>
</el-dialog>
</template> </template>
<style lang="scss" scoped> <style lang='scss' scoped>
.common-layout { .common-layout{
height: calc(100vh - 55px); height: calc(100vh - 55px);
padding: 0 15px; padding: 0 15px;
.el-main { .el-main{
height: calc(100vh - 55px); height: calc(100vh - 55px);
padding: 0; padding:0;
} }
.flowBox { .flowBox{
height: calc(100vh - 55px); height: calc(100vh - 55px);
border-left: 1px solid #ccc; border-left: 1px solid #ccc;
padding: 0 15px; padding: 0 15px;
} }
.el-header { .el-header{
padding: 0 10px; padding:0 10px;
line-height: 30px; line-height:30px;
text-align: right; text-align:right;
font-size: 20px; font-size:20px;
i { i{
cursor: pointer; cursor:pointer;
} }
} }
.drawer-header {
display: flex;
align-items: center;
//padding: 12px;
}
.flex-grow {
/* 占据剩余的可用空间,将后面的元素推到右边 */
flex-grow: 1;
}
.drawer-close {
cursor: pointer;
//margin-left: 8px;
}
} }
</style> </style>

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

@ -15,6 +15,7 @@ import {
gainAppPageInfo, gainAppPageInfo,
getFieldRecord, getFieldRecord,
} from "@/api/DesignForm/requestapi"; } from "@/api/DesignForm/requestapi";
import request from "@/utils/request";
import { Edit, Picture as IconPicture } from "@element-plus/icons-vue"; import { Edit, Picture as IconPicture } from "@element-plus/icons-vue";
import { appPageDataInit, appWorkFlow } from "@/api/date/type"; import { appPageDataInit, appWorkFlow } from "@/api/date/type";
import { 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) { function optionsValue3Get3(data: any, fieldName: string) {
console.log("runAppForm", "optionsValue3Get3"); console.log("runAppForm", "optionsValue3Get3");
for (let i = 0; i < stateForm.formData.list.length; i++) { for (let i = 0; i < stateForm.formData.list.length; i++) {
@ -335,6 +367,8 @@ function optionsValue3Get3(data: any, fieldName: string) {
} }
} }
} }
</script> </script>
<template> <template>
<el-row> <el-row>
@ -356,7 +390,8 @@ function optionsValue3Get3(data: any, fieldName: string) {
:pickAppMenu="props.pickAppMenu" :pickAppMenu="props.pickAppMenu"
:viewPage="stateList.view" :viewPage="stateList.view"
:form-basic-config="stateForm.formData.form" :form-basic-config="stateForm.formData.form"
:fields-detail-list="stateForm.formData.list" :fields-detail-list="stateForm.formData.list"
:org-and-man-tree = "orgAndManTree"
/> />
<!-- <AppFormPage <!-- <AppFormPage
v-else v-else

Loading…
Cancel
Save