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

57
src/widget/associatedforms/associatedFormsChildFillRole.vue

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

Loading…
Cancel
Save