Browse Source

关联表单-数据填充规则-v0.35

lwx_v7
liwenxuan 1 year ago
parent
commit
7761fb519a
  1. 41
      src/components/DesignForm/formControlPropertiNew.vue
  2. 2
      src/components/DesignForm/public/form/formItem.vue
  3. 16
      src/widget/associatedforms/associatedFormsChildFillRole.vue

41
src/components/DesignForm/formControlPropertiNew.vue

@ -1781,7 +1781,7 @@ const showImagePreview = ref(false)
controlData.value.item.label = "关联表单"
}
controlData.value.item.showLabel = true */
console.log(controlData.value.control.fillRoles.master)
//console.log(controlData.value.control.fillRoles.master)
if(controlData.value.control.fillRoles&&controlData.value.control.fillRoles.master.length==0){
controlData.value.control.fillRoles.master = [
{
@ -2129,11 +2129,11 @@ function formidChanged(){
let dataOnlyChild = JSON.parse(JSON.stringify(data.children))
let dataOnlyChild1 = JSON.parse(JSON.stringify(data.children))
dataExceptChild = dataExceptChild.filter((obj: { type: string }) => obj.type!== 'table');
console.log(dataExceptChild)
//console.log(dataExceptChild)
dataExceptChild = removeFirstNumElements(dataExceptChild,8);
dataOnlyChild = dataOnlyChild.filter((obj: { type: string }) => obj.type== 'table');
dataOnlyChild1 = dataOnlyChild1.filter((obj: { type: string }) => obj.type== 'table');
console.log(dataOnlyChild1)
//console.log(dataOnlyChild1)
dataOnlyChild1.forEach((element: any) => {
element.children = removeFirstNumElements(element.children,6);
});
@ -2145,15 +2145,15 @@ function formidChanged(){
let resDataExceptChild = ref(dataExceptChild)
let resDataOnlyChild = ref(dataOnlyChild)
let resDataOnlyChild1 = ref(dataOnlyChild1)
console.log(resDataOnlyChild1.value)
//console.log(resDataOnlyChild1.value)
//console.log(resDataOnlyChild.value)
let childTableCount = 0
for(let n = 0;n<resDataOnlyChild.value.length;n++){
console.log(resDataOnlyChild.value[n])
//console.log(resDataOnlyChild.value[n])
resDataOnlyChild.value[n].disabled=false
childTableCount++
}
console.log(childTableCount)
//console.log(childTableCount)
currentChildTableCount = childTableCount
asfasfFieldTree.value = [{
id: 'rootid_'+data.label,
@ -2252,7 +2252,7 @@ function formidChangedOptionsValue3(){
});
}
}
const currentFormChildTableFieldsForFillRole = ref<Tree[]>()
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
const associatedFormsCurrentFormFieldTree1 = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeNoTable = ref<Tree[]>()
@ -2270,8 +2270,9 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
}else{
let resData = ref(data.children)
let resDataExceptSystemFields = JSON.parse(JSON.stringify(data.children))
let currentFormChildTableFields = JSON.parse(JSON.stringify(data.children))
let resDataNoTable = JSON.parse(JSON.stringify(data.children))
console.log("fdsfdsasdfahjdsaflksjl;kjsdolkfjlksdjiofweklsdjknfsadkoljsfdao")
resDataExceptSystemFields = removeFirstNumElements(resDataExceptSystemFields,8)
resDataExceptSystemFields.forEach((element: any) => {
if(element.type=="table"){
@ -2279,8 +2280,12 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
element.children = removeFirstNumElements(element.children,6)
}
});
console.log(resDataExceptSystemFields)
//let rootid_ = data.value.label
//
currentFormChildTableFields = currentFormChildTableFields.filter( (item: { type: string }) => item.type == "table" )
currentFormChildTableFields.forEach((element: any) => {
element.children = removeFirstNumElements(element.children,6)
});
associatedFormsCurrentFormFieldTree.value = [{
id: 'rootid_'+data.label,
label: '当前表单-'+data.treeAttrs.show,
@ -2288,8 +2293,6 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
treeAttrs: data.treeAttrs,
disabled: true,
}]
associatedFormsCurrentFormFieldTree1.value = [{
id: 'rootid_'+data.label,
label: '当前表单-'+data.treeAttrs.show,
@ -2297,6 +2300,13 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
treeAttrs: data.treeAttrs,
disabled: true,
}]
currentFormChildTableFieldsForFillRole.value = [{
id: 'rootid_'+data.label,
label: '当前表单-'+data.treeAttrs.show,
children: [...currentFormChildTableFields],
treeAttrs: data.treeAttrs,
disabled: true,
}]
resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table")
@ -2646,7 +2656,10 @@ function selectedOrDelChildRole(){
}
}
//
function childRoleRightChanged(){
alert(1)
}
//
function handleDetermine(){
@ -4663,7 +4676,9 @@ const radioChangeSet = (val:any) => {
:associated-forms-current-form-field-tree= "associatedFormsCurrentFormFieldTree"
:asfasf-child-table-fields = "asfasfChildTableFields"
:current-key="controlData.control.fillRoles.child[index].id"
:current-form-child-table-fields-for-fill-role = "currentFormChildTableFieldsForFillRole"
@selected-or-del-child-role = "selectedOrDelChildRole"
@child-role-right-changed = "childRoleRightChanged"
@del-role = "delChildRole"
>
</AssociatedFormsChildFillRole>

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

@ -293,7 +293,7 @@ const getAxiosOptions = debounce((data?: any) => {
/*
在这里请求后台获取字段
*/
console.log("formItem---291",props.data.control.optionsValue3Field)
//console.log("formItem---291",props.data.control.optionsValue3Field)
if(props.data.control.optionsValue3Field && props.data.control.optionsValue3Field != "" && props.data.control.optionsValue3Field != null && props.data.control.optionsValue3Field != "undefined"){
getFieldRecord(props.data.control.optionsValue3Field).then(({ data }) => {

16
src/widget/associatedforms/associatedFormsChildFillRole.vue

@ -32,8 +32,8 @@
check-strictly :render-after-expand="false" filterable />
<span style="margin-left: 8px;margin-right: 8px;">的值填充到</span>
<el-tree-select
v-model="childRoles1[index].rightValue" style="width: 270px;" :data="rightTreeSource"
check-strictly :render-after-expand="false" placeholder="当前表单子表字段" filterable @change="rightChanged" />
v-model="childRoles1[index].rightValue" style="width: 270px;" :data="currentFormChildTableFieldsForFillRole[0].children"
check-strictly :render-after-expand="false" placeholder="当前表单子表字段" filterable @change="childRoleRightChanged" />
<Delete v-if="childRoles1.length>1" style="width: 22px; height: 22px;cursor: pointer; color: #50A6FF; display: block; float:right;margin-left: 35px;margin-top: 4px;" @click="delChildRole(item)" />
</div>
@ -112,8 +112,14 @@
import { Close } from '@element-plus/icons-vue'
import AsfTmFillRoleFilterCondi from '@/widget/associatedforms/asfTmFillRoleFilterCondi.vue'
import { v4 as uuidv4 } from "uuid";
let emit = defineEmits(["delRole", "update:selectedChildTable","update:childTableList","selectedOrDelChildRole"]);
let emit = defineEmits(["delRole", "update:selectedChildTable","update:childTableList","selectedOrDelChildRole","childRoleRightChanged"]);
const props = defineProps({
currentFormChildTableFieldsForFillRole: {
type: Object,
default() {
return {}
}
},
asfasfChildTableFields: {
type: Object,
default() {
@ -227,6 +233,10 @@ function selectedChildTableChanged(event:any) {
emit('selectedOrDelChildRole')
}
function childRoleRightChanged(){
emit('childRoleRightChanged')
}
function delChildRole(item: any) {
let id = item.id
for (var i = 0; i < childRoles1.value.length; i++) {

Loading…
Cancel
Save