Browse Source

修改bug

lwx_v8
liwenxuan 1 year ago
parent
commit
b747b843c2
  1. 2
      src/components/DesignForm/formControlPropertiNew.vue
  2. 72
      src/components/DesignForm/public/form/formGroup.vue
  3. 4
      src/widget/associatedforms/associatedForms.vue

2
src/components/DesignForm/formControlPropertiNew.vue

@ -4704,7 +4704,7 @@ const radioChangeSet = (val:any) => {
<!-- 数据填充规则弹窗 --> <!-- 数据填充规则弹窗 -->
<el-dialog v-model="associatedFormsFillRolesDialogFlag" title="数据填充规则" top="150px" :close-on-click-modal="false" :show-close="false" style="margin-top:70px ;min-height: 300px;max-height:900px" width="80%" > <el-dialog v-model="associatedFormsFillRolesDialogFlag" title="数据填充规则" top="150px" :close-on-click-modal="false" :show-close="false" style="margin-top:70px ;min-height: 300px;max-height:900px" width="50%" >
<template v-if="controlData.type=='associatedForms'"> <template v-if="controlData.type=='associatedForms'">
<el-button style="font-size: large;margin-top: 10px;margin-bottom: 15px;" type="primary" link append-to-body="true" modal="true" @click="addFillRole"> 主表填充规则</el-button> <el-button style="font-size: large;margin-top: 10px;margin-bottom: 15px;" type="primary" link append-to-body="true" modal="true" @click="addFillRole"> 主表填充规则</el-button>
<div style="max-height:230px;border:1px solid white;overflow-y:auto;"> <div style="max-height:230px;border:1px solid white;overflow-y:auto;">

72
src/components/DesignForm/public/form/formGroup.vue

@ -18,7 +18,7 @@ import {
} from '@/api/DesignForm/utils' } from '@/api/DesignForm/utils'
import { Md5 } from 'ts-md5'; import { Md5 } from 'ts-md5';
import { jsonParseStringify } from '@/utils/DesignForm' import { jsonParseStringify } from '@/utils/DesignForm'
import request from '@/utils/request';
import { AnalysisCss } from '@/components/DesignForm/public/form/calculate/cssInfo.ts' import { AnalysisCss } from '@/components/DesignForm/public/form/calculate/cssInfo.ts'
const props = withDefaults( const props = withDefaults(
@ -471,6 +471,28 @@ function asfValueChanged(val:any){
}) })
} }
if(val.fillFieldsChild.length>0){
/* console.log(val.asfFormId)
console.log(val.masterOnField) */
let fillFieldsChild = JSON.parse(val.fillFieldsChild);
if (fillFieldsChild && fillFieldsChild.length > 0) {
fillFieldsChild = fillFieldsChild.filter((element:any)=>{
if(containsDangerousWords(element.filterCondition.gongShi.mathsFormula)){
//alert("")
console.log("筛选条件非法===>"+element.filterCondition.conditionHtml)
}else{
return element
}
})
}
//console.log(fillFieldsChild)
getAsfTableFill(val.asfFormId,val.glbbddbd,val.currentVal,fillFieldsChild).then(({ data }) => {
console.log(data)
});
}
//emits("asfValueChanged",val) //emits("asfValueChanged",val)
if(val.options.length>0){ if(val.options.length>0){
//console.log(val.options) //console.log(val.options)
@ -508,6 +530,54 @@ function asfValueChanged(val:any){
} }
} }
} }
function getAsfTableFill(asfFormId:any,glbbddbd:any,currentVal:any,fillFieldsChild:any){
/* console.log(asfFormId)
console.log(glbbddbd)
console.log(fillFieldsChild) */
/* asfFormId = JSON.stringify(asfFormId)
glbbddbd = JSON.stringify(glbbddbd)
currentVal = JSON.stringify(currentVal) */
fillFieldsChild = JSON.stringify(fillFieldsChild)
return request({
url: '/javasys/lowCode/AssociatedForms/getAsfTableFill',
method: 'post',
data: {
asfFormId:asfFormId,
glbbddbd:glbbddbd,
currentVal:currentVal,
fillFieldsChild:fillFieldsChild,
},
});
}
function containsDangerousWords(str: string | undefined): boolean {
if (str === undefined) {
return false;
}
const dangerousWords = new Set<string>([
"drop",
"table",
"where",
"select",
"insert",
"update",
"delete",
"and",
"or",
"union",
"order by",
"group by",
"having",
"exec",
"execute",
]);
const words = str.split(" ");
for (const word of words) {
if (dangerousWords.has(word.toLowerCase())) {
return true;
}
}
return false;
}
function isString(value: any): value is string { function isString(value: any): value is string {
return typeof value === 'string'; return typeof value === 'string';
} }

4
src/widget/associatedforms/associatedForms.vue

@ -60,7 +60,9 @@ function asfValueChanged(){
options:options.value, options:options.value,
currentVal:value1.value, currentVal:value1.value,
fillFieldsMaster:fillFieldsMaster, fillFieldsMaster:fillFieldsMaster,
fillFieldsChild:fillFieldsChild fillFieldsChild:fillFieldsChild,
asfFormId:props.data.control.formid,
glbbddbd:props.data.control.glbbddbd,
} }
emits("valueChanged",val) emits("valueChanged",val)

Loading…
Cancel
Save