Browse Source

关联表单-数据填充规则-v0.3页面样式确定

lwx_v6
liwenxuan 1 year ago
parent
commit
d808eae8de
  1. 13
      src/components/DesignForm/formControlPropertiNew.vue
  2. 57
      src/widget/associatedforms/associatedFormsChildFillRole.vue

13
src/components/DesignForm/formControlPropertiNew.vue

@ -2620,6 +2620,7 @@ function addChildFillRole(){
//controlData.value.control.fillRoles.child.length
if(controlData.value.control.fillRoles.child.length<currentChildTableCount){
let onlyNumber = uuidv4().replaceAll('-','').toString(); //
let onlyNumber1 = uuidv4().replaceAll('-','').toString(); //
controlData.value.control.fillRoles.child.push({
id: onlyNumber,
tableKey: '',
@ -2632,7 +2633,11 @@ if(controlData.value.control.fillRoles.child.length<currentChildTableCount){
mathsString:'',
},
},
childRoles:[]
childRoles:[{
leftValue: '',
rightValue: '',
id: onlyNumber1,
}]
})
}else{
alert("当前关联表单共 "+controlData.value.control.fillRoles.child.length+" 张子表,不可再添加")
@ -4512,7 +4517,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'">
<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;">
@ -4536,7 +4541,7 @@ const radioChangeSet = (val:any) => {
title=""
:width="200"
trigger="hover"
content="【关联表单子表字段】暂不支持填充至【当前表单主表字段】; 若【设置筛选条件】,则仅填充满足筛选条件的子表数据"
content="【关联表单子表字段】暂不支持填充至【当前表单主表字段】"
>
<template #reference>
<el-button style="font-size: large;margin-top: 23px;margin-bottom: 15px;" type="primary" link append-to-body="true" modal="true" @click="addChildFillRole"> 子表填充规则</el-button>
@ -4547,6 +4552,7 @@ const radioChangeSet = (val:any) => {
<AssociatedFormsChildFillRole
v-model:selected-child-table="controlData.control.fillRoles.child[index].tableKey"
v-model:filter-condition="controlData.control.fillRoles.child[index].filterCondition"
v-model:child-roles = "controlData.control.fillRoles.child[index].childRoles"
:asfasf-field-tree="asfasfFieldTree"
:tree-default-props="treeDefaultProps"
:filter-node="filterNode"
@ -4558,7 +4564,6 @@ const radioChangeSet = (val:any) => {
:associated-forms-current-form-field-tree= "associatedFormsCurrentFormFieldTree"
:current-key="controlData.control.fillRoles.child[index].id"
:child-table-list="asfasfChildTableList"
:child-roles = "controlData.control.fillRoles.child[index].childRoles"
@del-role = "delChildRole"
>
</AssociatedFormsChildFillRole>

57
src/widget/associatedforms/associatedFormsChildFillRole.vue

@ -6,14 +6,14 @@
:icon="Close" size="small" circle type="info" plain
style="float: right;margin-top: -22px;margin-right: -22px" @click="delRole" />
<el-tree-select
v-model="selectedChildTable1" style="width: 290px;margin-bottom: -1px" :data="childTableList"
v-model="selectedChildTable1" style="width: 270px;margin-bottom: -1px" :data="childTableList"
placeholder="请选择关联表单子表" check-strictly :render-after-expand="false" filterable
@change="selectedChildTableChanged" />
<el-popover placement="top-end" title="" :width="200" trigger="hover" content="若【设置筛选条件】,则仅填充满足筛选条件的子表数据">
<template #reference>
<el-button
v-if="selectedChildTable1 !== '' && filterCondition1.conditionHtml === ''"
style="padding-top: 8px; width: 290px;margin-left: 85px;height: 30px;" type="primary" plain
style="padding-top: 8px; width: 270px;margin-left: 85px;height: 30px;" type="primary" plain
append-to-body="true" modal="true" @click="filterConditionDialogFlag = true">设置筛选条件选填</el-button>
</template>
</el-popover>
@ -24,20 +24,24 @@
<el-divider v-if="selectedChildTable1 !== ''" />
<div
v-if="selectedChildTable1 !== ''"
style="background-color: #F0F0F0;padding: 12px;border-radius: 10px;padding-left:45px;margin-bottom:20px;padding-bottom: 1px;margin-right: 10px;"><!-- #F5F7FA #E6F3FE #F0F0F0 #F5F7FA-->
style="background-color: #F0F0F0;border-radius: 5px;padding-bottom: 1px;margin-right: 10px;"><!-- #F5F7FA #E6F3FE #F0F0F0 #F5F7FA-->
<template v-for="(item, index) in childRoles" :key="childRoles[index].id">
{{ item }}
<!-- <AssociatedFormsFillRole
v-model:left-value="controlData.control.fillRoles.master[index].leftValue"
v-model:right-value="controlData.control.fillRoles.master[index].rightValue"
:left-tree-source = "asfasfMasterFieldTree"
:right-tree-source = "associatedFormsCurrentFormFieldTree"
:current-key="controlData.control.fillRoles.master[index].id"
@del-role = "delRole"
>
</AssociatedFormsFillRole> -->
<div style="display: flex;margin-bottom: 10px;">
<el-tree-select
v-model="leftValue1" style="width: 270px;" :data="leftTreeSource" placeholder="关联表单主表字段"
check-strictly :render-after-expand="false" filterable @change="leftChanged" />
<span style="margin-left: 8px;margin-right: 8px;">的值填充到</span>
<el-tree-select
v-model="rightValue1" style="width: 270px;" :data="rightTreeSource"
check-strictly :render-after-expand="false" placeholder="当前表单字段" filterable @change="rightChanged" />
<Delete style="width: 22px; height: 22px;cursor: pointer; color: #50A6FF; display: block; float:right;margin-left: 35px;margin-top: 4px;" @click="delChildRole(item)" />
</div>
</template>
</div>
<el-link type="primary" @click="addChildRole"> 添加规则</el-link>
</div>
@ -107,10 +111,9 @@
<script setup lang="ts">
import { Close } from '@element-plus/icons-vue'
import AssociatedFormsTinyaceFillRoleFilterCondition from '@/widget/associatedforms/associatedFormsTinyaceFillRoleFilterCondition.vue'
import { v4 as uuidv4 } from "uuid";
let emit = defineEmits(["delRole", "update:selectedChildTable",]);
const props = defineProps({
orgAndManTree: {
type: Object,
default() {
@ -123,14 +126,12 @@ const props = defineProps({
return {}
}
},
associatedFormsCurrentFormFieldTree: {
type: Object,
default() {
return {}
}
},
filterNode: {
type: Object,
default() {
@ -167,7 +168,6 @@ const props = defineProps({
return {}
}
},
currentKey: {
type: String,
default() {
@ -191,7 +191,8 @@ const filterConditionDialogFlag = ref(false)
const selectedChildTable1 = ref()
selectedChildTable1.value = props.selectedChildTable
const childRoles1 = ref()
childRoles1.value = props.childRoles
const filterCondition1 = ref()
filterCondition1.value = props.filterCondition
@ -216,7 +217,23 @@ function selectedChildTableChanged() {
emit('update:selectedChildTable', selectedChildTable1)
}
function delChildRole(item: any) {
let id = item.id
for (var i = 0; i < childRoles1.value.length; i++) {
if(childRoles1.value[i].id===id){
childRoles1.value.splice(i, 1);
i--; //
}
}
}
function addChildRole(){
let onlyNumber = uuidv4().replaceAll('-','').toString(); //
childRoles1.value.push({
leftValue: '',
rightValue: '',
id: onlyNumber,
})
}
function delRole() {
emit('delRole', props.currentKey)
}

Loading…
Cancel
Save