Browse Source

1.数据标题配置消除子表选项

2.关联表单获取数据标题方法
lwx_14
liwenxuan 1 year ago
parent
commit
1bc49b327e
  1. 13
      src/components/DesignForm/formControlAttr.vue
  2. 17
      src/components/DesignForm/formControlPropertiNew.vue
  3. 2
      src/components/DesignForm/public/form/formGroup.vue
  4. 61
      src/widget/associatedforms/associatedForms.vue
  5. 2
      src/widget/associatedforms/index.vue

13
src/components/DesignForm/formControlAttr.vue

@ -2034,6 +2034,7 @@ function formidChangedOptionsValue3(){
}
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeNoTable = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeForGlxxsz = ref<Tree[]>()
let associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf = ref<Tree[]>()
let resDataForGlxxszExceptself: any[] = []
@ -2047,6 +2048,7 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
//alert("cfid")
}else{
let resData = ref(data.children)
let resDataNoTable = JSON.parse(JSON.stringify(data.children))
//let rootid_ = data.value.label
associatedFormsCurrentFormFieldTree.value = [{
id: 'rootid_'+data.label,
@ -2056,6 +2058,15 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
treeAttrs: data.treeAttrs,
}]
resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table")
associatedFormsCurrentFormFieldTreeNoTable.value = [{
id: 'rootid_'+data.label,
label: '当前表单-'+data.treeAttrs.show,
children: [...resDataNoTable],
treeAttrs: data.treeAttrs,
}]
let resDataForGlxxsz = ref(data.children.slice(8))
resDataForGlxxszExceptself = JSON.parse(JSON.stringify(resDataForGlxxsz.value));
@ -3477,7 +3488,7 @@ const disabledIstrue = (val:string) => {
multiple
clearable
collapse-tags
:data="associatedFormsCurrentFormFieldTree"
:data="associatedFormsCurrentFormFieldTreeNoTable"
:render-after-expand="false"
style="width: 240px"
/>

17
src/components/DesignForm/formControlPropertiNew.vue

@ -2076,6 +2076,7 @@ function formidChangedOptionsValue3(){
}
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeNoTable = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeForGlxxsz = ref<Tree[]>()
let associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf = ref<Tree[]>()
let resDataForGlxxszExceptself: any[] = []
@ -2089,20 +2090,30 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
//alert("cfid")
}else{
let resData = ref(data.children)
let resDataNoTable = JSON.parse(JSON.stringify(data.children))
//let rootid_ = data.value.label
associatedFormsCurrentFormFieldTree.value = [{
id: 'rootid_'+data.label,
//label: '',
label: '当前表单-'+data.treeAttrs.show,
children: [...resData.value],
treeAttrs: data.treeAttrs,
}]
resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table")
associatedFormsCurrentFormFieldTreeNoTable.value = [{
id: 'rootid_'+data.label,
label: '当前表单-'+data.treeAttrs.show,
children: [...resDataNoTable],
treeAttrs: data.treeAttrs,
}]
let resDataForGlxxsz = ref(data.children.slice(8))
resDataForGlxxszExceptself = JSON.parse(JSON.stringify(resDataForGlxxsz.value));
// console.log(resDataForGlxxszExceptself)
@ -3526,7 +3537,7 @@ const disabledIstrue = (val:string) => {
multiple
clearable
collapse-tags
:data="associatedFormsCurrentFormFieldTree"
:data="associatedFormsCurrentFormFieldTreeNoTable"
:render-after-expand="false"
style="width: 240px"
/>

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

@ -576,7 +576,7 @@ function optionsValue3Get1(data: any,fieldName: string){
<AssociatedForms v-else-if="element.type === 'associatedForms'" :data="element" />
<AssociatedForms v-else-if="element.type === 'associatedForms'" :data="element" :form-props="formProps" :tablekey="props.tableinfo" />
<LowcodeImage v-else-if="element.type === 'lowcodeImage'" :data="element" />
<LowcodeTransfer v-else-if="element.type === 'lowcodeTransfer'" :data="element" />

61
src/widget/associatedforms/associatedForms.vue

@ -8,15 +8,32 @@
</template>
<script setup>
<script lang='ts' setup>
import request from '@/utils/request';
import { formProps } from 'element-plus';
const props = defineProps({
import { FormItem, FormList } from '@/api/DesignForm/types'
/* const props = defineProps({
// eslint-disable-next-line vue/require-default-prop
data: {
type: Object,
}
})
},
formProps:{
type: Object,
},
tableKey:{
type: Object,
},
}) */
const props = withDefaults(
defineProps<{
data: FormList
formProps:Object
tablekey: any
}>(),
{}
)
const value1 = ref('')
@ -43,10 +60,38 @@ const options = [
},
]
onMounted(()=>{
console.log(props.data.control.hideConditionHtml)
console.log(props.data.control.dataRangeConditionHtml)
console.log(props.data.control)
if(props.data.control.formid!=null&&props.data.control.formid!=""){
getAsfDataTitles().then(({ data }) => {
console.log(data)
});
}
})
function getAsfDataTitles() {
let dataTitle = ''
if(props.tablekey.dataTitle!=null&&props.tablekey.dataTitle.length>0){
for(let i = 0;i<props.tablekey.dataTitle.length;i++){
dataTitle = dataTitle+props.tablekey.dataTitle[i]+"###"
}
}
return request({
url: '/javasys/lowCode/AssociatedForms/getAsfDataTitles',
method: 'post',
data: {
formId:props.data.control.formid,
dataTitle:dataTitle,
rangeFormula:props.data.control.dataRangeGongShi.mathsFormula,
rangeString:props.data.control.dataRangeGongShi.mathsString,
hideFormula:props.data.control.hideGongShi.mathsFormula,
hideString:props.data.control.hideGongShi.mathsString,
},
});
}
</script>
<style></style>

2
src/widget/associatedforms/index.vue

@ -14,7 +14,7 @@
<input v-model="value" type="hidden" >
</el-form-item>
<AssociatedForms :data="props.data"></AssociatedForms>
<AssociatedForms :data="props.data" :form-props="formProps" :tablekey="props.tablekey"></AssociatedForms>
</template>
<script lang='ts' setup>
import AssociatedForms from './associatedForms.vue';

Loading…
Cancel
Save