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. 368
      src/components/DesignForm/app/index.vue
  2. 4
      src/components/DesignForm/assembly/index.ts
  3. 51
      src/components/DesignForm/formControlPropertiNew.vue
  4. 388
      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

368
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,7 +342,9 @@ function getAsfs() {
switchs.push(dataList.value[i])
} else if(dataList.value[i].type == "select"){
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 == "flex" ||
dataList.value[i].type == "div" ||
@ -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
@ -477,174 +522,195 @@ const setUpClick = (val: string, id: string) => {
text: '正在生成二维码,请稍候...' //
});
//console.log(props.formBasicConfig)
//
let getDetailQrCodesData: any = {}
let currentFieldsMapArrObj: any = {}
getDetailQrCodes(idArray).then(({ data }) => {
getDetailQrCodesData = JSON.parse(JSON.stringify(data));
if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"){
let asfQueryParams1: any[] = [];
for (let key in getDetailQrCodesData) {
currentFieldsMapArrObj[key] = getDetailQrCodesData[key]
if (getDetailQrCodesData.hasOwnProperty(key)) {
let currentFieldsMap = getDetailQrCodesData[key].fieldsMap
//console.log(currentFieldsMap)
//
for (let attr_name in currentFieldsMap) {
if (currentFieldsMap.hasOwnProperty(attr_name)) {
//console.log("attr_name------"+attr_name)
//console.log(`: ${attr_name}, : ${currentFieldsMap[attr_name]}`);
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(props.formBasicConfig.qrCodeFlag==true){
if(props.formBasicConfig.qrCodeInside==true){
if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"&&props.formBasicConfig.qrCodeShowFields.length==0){
alert("未选择表格展示字段")
return
}
//
let getDetailQrCodesData: any = {}
let currentFieldsMapArrObj: any = {}
getDetailQrCodes(idArray).then(({ data }) => {
getDetailQrCodesData = JSON.parse(JSON.stringify(data));
if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"){
let asfQueryParams1: any[] = [];
for (let key in getDetailQrCodesData) {
currentFieldsMapArrObj[key] = getDetailQrCodesData[key]
if (getDetailQrCodesData.hasOwnProperty(key)) {
let currentFieldsMap = getDetailQrCodesData[key].fieldsMap
//console.log(currentFieldsMap)
//
for (let attr_name in currentFieldsMap) {
if (currentFieldsMap.hasOwnProperty(attr_name)) {
//console.log("attr_name------"+attr_name)
//console.log(`: ${attr_name}, : ${currentFieldsMap[attr_name]}`);
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) {
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
});
selects.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]+"!@#@!"+""
}
}
});
switchs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
if(toConvertValue=="0"){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"禁用"
}else{
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"启用"
});
//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
}
}
});
checkboxs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let toConvertArr = convertStringToArray(toConvertValue);
let toAddStr = ""
if(toConvertArr.length>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
});
switchs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
if(toConvertValue=="0"){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"禁用"
}else{
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"启用"
}
}
}
});
asfs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
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++
});
checkboxs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let toConvertArr = convertStringToArray(toConvertValue);
let toAddStr = ""
if(toConvertArr.length>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
}
}
});
if(fieldCount>0){
//
//field
asfQueryParams1.forEach((item1: any) => {
if(item1.field==element.name){
});
asfs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
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 = {};
asfMasterAndAsfId1.asfId = toConvertValue+"";
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(()=>{
tablesData.value = getDetailQrCodesData
},810)
setTimeout(()=>{
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()
qrCodesPrintDialogFlag.value = true
},820)
}else if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="1"){
//fieldsMap = null
tablesData.value = getDetailQrCodesData
qrCodesPrintDialogFlag.value = true
loadingInstance1.close()
})
}else{
alert("内部二维码功能未启用")
}
}else{
alert("请先为本表单开启二维码功能")
}
})/* .finally(()=>{
loadingInstance1.close()
qrCodesPrintDialogFlag.value = true
}) */
}else{
alert("未选中任何一条,请先选择")
@ -889,6 +955,7 @@ const getPageData = () => {
switchs = [];
selects = [];
tables = [];
dofs = [];
getAsfs()
});
}
@ -1940,9 +2007,9 @@ const transformOption = (val: string | number, type?: string) => {
title="生成的二维码"
:show-close="false"
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
v-for="(tableData, tableKey) in tablesData"
:id="tableKey"
@ -1952,8 +2019,8 @@ const transformOption = (val: string | number, type?: string) => {
>
<table>
<tr>
<th style="font-weight: bold; font-size:medium;" colspan="2">{{ tablesData[tableKey].appName }}-{{ tablesData[tableKey].formName }}</th>
<th rowspan="6"><img :src="tableData.bufferedImage" alt="二维码" width="auto" height="100%"></th>
<th colspan="2">{{ tablesData[tableKey].appName }}-{{ tablesData[tableKey].formName }}</th>
<td rowspan="6" style="width: 240px;"><img :src="tableData.bufferedImage" alt="二维码" width="200px" style="margin-top: 5px;" ></td>
</tr>
<tr v-for="(item, fIndex) in tableData.fieldsMap" :key="fIndex">
<th>{{ item.key }}</th>
@ -2065,10 +2132,13 @@ const transformOption = (val: string | number, type?: string) => {
table {
border-collapse: collapse;
width: 100%;
font-size: 13px;
text-align: center
}
td, th {
border: 1px solid black;
padding: 8px;
vertical-align: middle; /* 设置文字上下居中 */
}
</style>

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

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

51
src/components/DesignForm/formControlPropertiNew.vue

@ -527,6 +527,7 @@ const attrList = computed(() => {
path: "config.append",
vShow: ["input", "password", "digitpage"],
},
// {
// label: '',
// value: control.activeValue,
@ -733,6 +734,14 @@ const attrList = computed(() => {
vIf: state.isSearch,
vShow: ["associatedForms"],
},
{
label: "移动端扫描输入",
value: config.scanInput,
path: "config.scanInput",
type: "input",
vIf: state.isSearch,
vShow: ["input"],
},
{
label: "隐藏条件",
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 asfsExpectCurrent: any[] = [];
@ -4233,6 +4255,35 @@ const updataBase = (val: any) => {
>
</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-button
v-if="controlData.control.dataRangeConditionHtml === ''"

388
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,7 +336,9 @@ function getAsfs() {
switchs.push(dataList.value[i])
} else if(dataList.value[i].type == "select"){
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 == "flex" ||
dataList.value[i].type == "div" ||
@ -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
@ -467,174 +521,202 @@ const setUpClick = (val: string, id: string) => {
text: '正在生成二维码,请稍候...' //
});
//console.log(props.formBasicConfig)
//
let getDetailQrCodesData: any = {}
let currentFieldsMapArrObj: any = {}
getDetailQrCodes(idArray).then(({ data }) => {
getDetailQrCodesData = JSON.parse(JSON.stringify(data));
if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"){
let asfQueryParams1: any[] = [];
for (let key in getDetailQrCodesData) {
currentFieldsMapArrObj[key] = getDetailQrCodesData[key]
if (getDetailQrCodesData.hasOwnProperty(key)) {
let currentFieldsMap = getDetailQrCodesData[key].fieldsMap
//console.log(currentFieldsMap)
//
for (let attr_name in currentFieldsMap) {
if (currentFieldsMap.hasOwnProperty(attr_name)) {
//console.log("attr_name------"+attr_name)
//console.log(`: ${attr_name}, : ${currentFieldsMap[attr_name]}`);
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(props.formBasicConfig.qrCodeFlag==true){
if(props.formBasicConfig.qrCodeInside==true){
if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"&&props.formBasicConfig.qrCodeShowFields.length==0){
alert("未选择表格展示字段")
return
}
//
let getDetailQrCodesData: any = {}
let currentFieldsMapArrObj: any = {}
getDetailQrCodes(idArray).then(({ data }) => {
getDetailQrCodesData = JSON.parse(JSON.stringify(data));
if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"){
let asfQueryParams1: any[] = [];
for (let key in getDetailQrCodesData) {
currentFieldsMapArrObj[key] = getDetailQrCodesData[key]
if (getDetailQrCodesData.hasOwnProperty(key)) {
let currentFieldsMap = getDetailQrCodesData[key].fieldsMap
//console.log(currentFieldsMap)
//
for (let attr_name in currentFieldsMap) {
if (currentFieldsMap.hasOwnProperty(attr_name)) {
//console.log("attr_name------"+attr_name)
//console.log(`: ${attr_name}, : ${currentFieldsMap[attr_name]}`);
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) {
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
});
selects.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]+"!@#@!"+""
}
}
});
switchs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
if(toConvertValue=="0"){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"禁用"
}else{
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"启用"
});
//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
}
}
}
});
checkboxs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let toConvertArr = convertStringToArray(toConvertValue);
let toAddStr = ""
if(toConvertArr.length>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
});
switchs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
if(toConvertValue=="0"){
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"禁用"
}else{
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+"启用"
}
}
}
});
asfs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
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++
});
checkboxs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
let toConvertArr = convertStringToArray(toConvertValue);
let toAddStr = ""
if(toConvertArr.length>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
}
}
});
if(fieldCount>0){
//
//field
asfQueryParams1.forEach((item1: any) => {
if(item1.field==element.name){
});
asfs.forEach(function(element) {
if(attr_name==element.name){
//,valueoptions
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1]
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 = {};
asfMasterAndAsfId1.asfId = toConvertValue+"";
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(()=>{
tablesData.value = getDetailQrCodesData
},810)
setTimeout(()=>{
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()
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()
qrCodesPrintDialogFlag.value = true
}) */
}else{
alert("内部二维码功能未启用")
}
}else{
alert("请先为本表单开启二维码功能")
}
}else{
alert("未选中任何一条,请先选择")
@ -1952,9 +2034,9 @@ const diGuiJilian = (val: any, options: any[]) => {
title="生成的二维码"
:show-close="false"
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
v-for="(tableData, tableKey) in tablesData"
:id="tableKey"
@ -1964,8 +2046,8 @@ const diGuiJilian = (val: any, options: any[]) => {
>
<table>
<tr>
<th style="font-weight: bold; font-size:medium;" colspan="2">{{ tablesData[tableKey].appName }}-{{ tablesData[tableKey].formName }}</th>
<th rowspan="6"><img :src="tableData.bufferedImage" alt="二维码" width="auto" height="100%"></th>
<th colspan="2">{{ tablesData[tableKey].appName }}-{{ tablesData[tableKey].formName }}</th>
<td rowspan="6" style="width: 240px;"><img :src="tableData.bufferedImage" alt="二维码" width="200px" style="margin-top: 5px;" ></td>
</tr>
<tr v-for="(item, fIndex) in tableData.fieldsMap" :key="fIndex">
<th>{{ item.key }}</th>
@ -2087,11 +2169,15 @@ const diGuiJilian = (val: any, options: any[]) => {
table {
border-collapse: collapse;
width: 100%;
font-size: 13px;
text-align: center;
}
td, th {
border: 1px solid black;
padding: 8px;
vertical-align: middle; /* 设置文字上下居中 */
}
</style>

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

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

@ -596,8 +596,97 @@ const initLoadData = () => {
}
};
<<<<<<< HEAD
function optionsValue3Get3(data: any, fieldName: string) {
/* 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("appTableFlow","optionsValue3Get3") */
for (let i = 0; i < stateForm.formData.list.length; i++) {
@ -611,6 +700,7 @@ function optionsValue3Get3(data: any, fieldName: string) {
}
</script>
<template>
<<<<<<< HEAD
<el-drawer
v-model="drawerOpenOrClose"
v-loading="loadingData"
@ -677,6 +767,22 @@ function optionsValue3Get3(data: any, fieldName: string) {
/>
</div>
<!-- <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"
:number="props.pickAppMenu.id"
@ -707,6 +813,7 @@ function optionsValue3Get3(data: any, fieldName: string) {
:after-submit="afterSubmit"
add-url="addData"
@optionsValue3Get3="optionsValue3Get3"
<<<<<<< HEAD
/> -->
</el-drawer>
</template>
@ -732,5 +839,69 @@ function optionsValue3Get3(data: any, fieldName: string) {
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>

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

@ -415,143 +415,211 @@ const closeAppSubmit = () => {
@ 时间: 2024-04-09 16:50:37
@ 功能: 保存草稿
*/
const saveDraftPage = (type: string, val?: any) => {
if (type === "success") {
emits("searchquery");
if (isFlowTable.value) {
if (val.code == 0) {
let sendInfo = {
id: val.data.uuid,
flowList: flowMap.value,
state: 1,
};
startRunFlow(sendInfo).then((data: any) => {
// console.log("--------1---------->",data)
});
}
}
}
closeAppSubmit();
};
const saveDraftPage = (type: string,val?:any) => {
if (type === 'success') {
emits("searchquery")
if(isFlowTable.value){
if(val.code == 0){
let sendInfo ={
id:val.data.uuid,
flowList:flowMap.value,
state:1
}
startRunFlow(sendInfo)
.then((data:any)=>{
// console.log("--------1---------->",data)
})
}
}
}
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) {
//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]);
}
}
}
}
}
function getQrCodeImgInside() {
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])
}
}
}
}
}
/*
*/
</script>
<template>
<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"
>
<div v-if="isFlowTable" class="common-layout">
<el-container>
<el-main v-loading="formLoading" element-loading-text="Loading...">
<ak-form
ref="formEl"
:numrun="formType"
:form-data="state.formData"
:type="formType"
:dict="state.dict"
request-url="getFormContent"
add-url="saveFormContent"
edit-url="editFormContent"
:before-submit="beforeSubmit"
:after-submit="afterSubmit"
:close-app-submit="closeAppSubmit"
:change-key-val="changeKeyVal"
:save-draft-page="saveDraftPage"
/>
</el-main>
<el-aside
v-loading="flowLoading"
element-loading-text="Loading..."
width="350px"
class="flowBox"
>
<el-text size="large">审批流程</el-text>
<FlowStep
v-model:flow-map="flowMap"
:next-step="nextStep"
:current-progress="currentProgress"
:node-key="nodeKey"
/>
</el-aside>
</el-container>
</div>
<!--无流程表单-->
<div v-else class="common-layout">
<ak-form
ref="formEl"
v-loading="formLoading"
element-loading-text="Loading..."
:form-data="state.formData"
:type="formType"
:numrun="formType"
:dict="state.dict"
request-url="getFormContent"
add-url="saveFormContent"
edit-url="editFormContent"
:before-submit="beforeSubmit"
:after-submit="afterSubmit"
:close-app-submit="closeAppSubmit"
:save-draft-page="saveDraftPage"
@optionsValue3Get3="optionsValue3Get3"
/>
</div>
</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" >
<!-- liwenxuan 20250206 在列表新增数据页增加扫码填单按钮显示填单二维码 start -->
<!-- 自定义抽屉头部 -->
<template #header>
<div v-if="state.formData.form.qrCodeFlag==true&&state.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 -->
<div v-if="isFlowTable" class="common-layout">
<el-container>
<el-main v-loading="formLoading" element-loading-text="Loading...">
<ak-form
ref="formEl"
:numrun="formType"
:form-data="state.formData"
:type="formType"
:dict="state.dict"
request-url="getFormContent"
add-url="saveFormContent"
edit-url="editFormContent"
:before-submit="beforeSubmit"
:after-submit="afterSubmit"
:close-app-submit="closeAppSubmit"
:change-key-val="changeKeyVal"
:save-draft-page="saveDraftPage"
/>
</el-main>
<el-aside v-loading="flowLoading" element-loading-text="Loading..." width="350px" class="flowBox">
<el-text size="large">审批流程</el-text>
<FlowStep v-model:flow-map="flowMap" :next-step="nextStep" :current-progress="currentProgress" :node-key="nodeKey" />
</el-aside>
</el-container>
</div>
<!--无流程表单-->
<div v-else class="common-layout">
<ak-form
ref="formEl"
v-loading="formLoading" element-loading-text="Loading..."
:form-data="state.formData"
:type="formType"
:numrun="formType"
:dict="state.dict"
request-url="getFormContent"
add-url="saveFormContent"
edit-url="editFormContent"
:before-submit="beforeSubmit"
:after-submit="afterSubmit"
:close-app-submit="closeAppSubmit"
:save-draft-page="saveDraftPage"
@optionsValue3Get3="optionsValue3Get3"
/>
</div>
</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;
}
}
<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;
}
}
</style>

37
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>
@ -356,7 +390,8 @@ function optionsValue3Get3(data: any, fieldName: string) {
:pickAppMenu="props.pickAppMenu"
:viewPage="stateList.view"
:form-basic-config="stateForm.formData.form"
:fields-detail-list="stateForm.formData.list"
:fields-detail-list="stateForm.formData.list"
:org-and-man-tree = "orgAndManTree"
/>
<!-- <AppFormPage
v-else

Loading…
Cancel
Save