Browse Source

Merge branch 'lwx_v6'

lwx_v7
超级管理员 1 year ago
parent
commit
6fc3e8dcc5
  1. 32
      src/components/DesignForm/assembly/index.ts
  2. 202
      src/components/DesignForm/formControlPropertiNew.vue
  3. 4
      src/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue
  4. 27
      src/widget/associatedforms/associatedForms.vue
  5. 100
      src/widget/associatedforms/associatedFormsChildFillRole.vue
  6. 6
      src/widget/associatedforms/associatedFormsFillRole.vue
  7. 3
      src/widget/associatedforms/index.vue

32
src/components/DesignForm/assembly/index.ts

@ -906,13 +906,31 @@ export default [
}, },
saveFlag: false, saveFlag: false,
asfasfLabel:'', asfasfLabel:'',
fillRoles: [ fillRoles: {
{ master: [
leftValue: '', {
rightValue: '', leftValue: '',
id: '', rightValue: '',
} id: '',
], },
],
child: [
{
id: '',
tableKey: '',
filterCondition:{
conditionHtml: '',
conditionHtmlCopy: '',
gongShi:{
formulaHtml:'',
mathsFormula:'',
mathsString:'',
},
},
childRoles:[]
},
],
},
}, },
config: {} config: {}
}, },

202
src/components/DesignForm/formControlPropertiNew.vue

@ -1775,9 +1775,15 @@ const showImagePreview = ref(false)
} }
}); });
}else if(controlData.value.type==='associatedForms'){ }else if(controlData.value.type==='associatedForms'){
console.log(controlData.value.control.fillRoles) /* if(controlData.value.item.label){
if(controlData.value.control.fillRoles.length==0){
controlData.value.control.fillRoles = [ }else{
controlData.value.item.label = "关联表单"
}
controlData.value.item.showLabel = true */
console.log(controlData.value.control.fillRoles.master)
if(controlData.value.control.fillRoles&&controlData.value.control.fillRoles.master.length==0){
controlData.value.control.fillRoles.master = [
{ {
leftValue: '', leftValue: '',
rightValue: '', rightValue: '',
@ -1785,7 +1791,26 @@ const showImagePreview = ref(false)
} }
] ]
} }
controlData.value.control.fillRoles[0].id = uuidv4().replaceAll('-','').toString(); if(controlData.value.control.fillRoles&&controlData.value.control.fillRoles.child.length==0){
controlData.value.control.fillRoles.child = [
{
id: '',
tableKey: '',
filterCondition:{
conditionHtml: '',
conditionHtmlCopy: '',
gongShi:{
formulaHtml:'',
mathsFormula:'',
mathsString:'',
},
},
childRoles:[]
},
]
}
controlData.value.control.fillRoles.master[0].id = uuidv4().replaceAll('-','').toString();
controlData.value.control.fillRoles.child[0].id = uuidv4().replaceAll('-','').toString();
} }
// start // start
// console.log(controlData.value.name) // console.log(controlData.value.name)
@ -2005,6 +2030,7 @@ const transferDataSourceOptions = [
import AssociatedFormsTinyace from '@/widget/associatedforms/associatedFormsTinyace.vue' import AssociatedFormsTinyace from '@/widget/associatedforms/associatedFormsTinyace.vue'
import AssociatedFormsTinyaceRange from '@/widget/associatedforms/associatedFormsTinyaceRange.vue' import AssociatedFormsTinyaceRange from '@/widget/associatedforms/associatedFormsTinyaceRange.vue'
import AssociatedFormsFillRole from '@/widget/associatedforms/associatedFormsFillRole.vue' import AssociatedFormsFillRole from '@/widget/associatedforms/associatedFormsFillRole.vue'
import AssociatedFormsChildFillRole from '@/widget/associatedforms/associatedFormsChildFillRole.vue'
const treeDefaultProps = { const treeDefaultProps = {
children: 'children', children: 'children',
@ -2071,8 +2097,14 @@ function getAsfasfFieldTreeOptionsValue3() {
// //
const asfasfFieldTree = ref<Tree[]>() const asfasfFieldTree = ref<Tree[]>()
const asfasfMasterFieldTree = ref<Tree[]>()
const asfasfChildTableList = ref<Tree[]>()
const asfasfFieldTreeOptionsValue3 = ref<Tree[]>() const asfasfFieldTreeOptionsValue3 = ref<Tree[]>()
let currentChildTableCount = 0
function formidChanged(){ function formidChanged(){
if(controlData.value.control.formid===''){ if(controlData.value.control.formid===''){
@ -2084,12 +2116,44 @@ function formidChanged(){
//alert("cfid") //alert("cfid")
}else{ }else{
let resData = ref(data.children) let resData = ref(data.children)
//let rootid_ = data.value.label let dataExceptChild = JSON.parse(JSON.stringify(data.children))
let dataOnlyChild = JSON.parse(JSON.stringify(data.children))
dataExceptChild = dataExceptChild.filter((obj: { type: string }) => obj.type!== 'table');
dataOnlyChild = dataOnlyChild.filter((obj: { type: string }) => obj.type== 'table');
for(let m = 0;m<dataOnlyChild.length;m++){
dataOnlyChild[m].children = []
}
let resDataExceptChild = ref(dataExceptChild)
let resDataOnlyChild = ref(dataOnlyChild)
//console.log(resDataOnlyChild.value)
let childTableCount = 0
for(let n = 0;n<resDataOnlyChild.value.length;n++){
console.log(resDataOnlyChild.value[n])
resDataOnlyChild.value[n].disabled=false
childTableCount++
}
console.log(childTableCount)
currentChildTableCount = childTableCount
asfasfFieldTree.value = [{ asfasfFieldTree.value = [{
id: 'rootid_'+data.label, id: 'rootid_'+data.label,
label: '关联的表单-'+data.label, label: '关联的表单-'+data.label,
children: [...resData.value], children: [...resData.value],
treeAttrs: data.treeAttrs, treeAttrs: data.treeAttrs,
disabled:true,
}]
asfasfMasterFieldTree.value = [{
id: 'rootid_'+data.label,
label: '关联的表单-'+data.label,
children: [...resDataExceptChild.value],
treeAttrs: data.treeAttrs,
disabled:true,
}]
asfasfChildTableList.value = [{
id: 'rootid_'+data.label,
label: '关联的表单-'+data.label,
children: [...resDataOnlyChild.value],
treeAttrs: data.treeAttrs,
disabled:true,
}] }]
} }
controlData.value.control.asfasfLabel = data.label controlData.value.control.asfasfLabel = data.label
@ -2184,6 +2248,7 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
label: '当前表单-'+data.treeAttrs.show, label: '当前表单-'+data.treeAttrs.show,
children: [...resData.value], children: [...resData.value],
treeAttrs: data.treeAttrs, treeAttrs: data.treeAttrs,
disabled: true,
}] }]
resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table") resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table")
@ -2376,13 +2441,47 @@ function associatedFormsDataRangeDialoghandle(){
//alert("cfid") //alert("cfid")
}else{ }else{
let resData = ref(data.children) let resData = ref(data.children)
//let rootid_ = data.value.label let dataExceptChild = JSON.parse(JSON.stringify(data.children))
let dataOnlyChild = JSON.parse(JSON.stringify(data.children))
dataExceptChild = dataExceptChild.filter((obj: { type: string }) => obj.type!== 'table');
dataOnlyChild = dataOnlyChild.filter((obj: { type: string }) => obj.type== 'table');
for(let m = 0;m<dataOnlyChild.length;m++){
dataOnlyChild[m].children = []
}
let resDataExceptChild = ref(dataExceptChild)
let resDataOnlyChild = ref(dataOnlyChild)
//console.log(asfasfChildTableList.value)
//console.log(resDataOnlyChild.value)
let childTableCount = 0
for(let n = 0;n<resDataOnlyChild.value.length;n++){
console.log(resDataOnlyChild.value[n])
resDataOnlyChild.value[n].disabled=false
childTableCount = n;
}
console.log(childTableCount)
currentChildTableCount = childTableCount
asfasfFieldTree.value = [{ asfasfFieldTree.value = [{
id: 'rootid_'+data.label, id: 'rootid_'+data.label,
label: '关联的表单-'+data.label, label: '关联的表单-'+data.label,
children: [...resData.value], children: [...resData.value],
treeAttrs: data.treeAttrs, treeAttrs: data.treeAttrs,
disabled:true,
}]
asfasfMasterFieldTree.value = [{
id: 'rootid_'+data.label,
label: '关联的表单-'+data.label,
children: [...resDataExceptChild.value],
treeAttrs: data.treeAttrs,
disabled:true,
}]
asfasfChildTableList.value = [{
id: 'rootid_'+data.label,
label: '关联的表单-'+data.label,
children: [...resDataOnlyChild.value],
treeAttrs: data.treeAttrs,
disabled:true,
}] }]
} }
}); });
@ -2508,15 +2607,52 @@ watch(()=>store.activeKey, () => {
function addFillRole(){ function addFillRole(){
let onlyNumber = uuidv4().replaceAll('-','').toString(); // let onlyNumber = uuidv4().replaceAll('-','').toString(); //
controlData.value.control.fillRoles.push({ controlData.value.control.fillRoles.master.push({
leftValue:'', leftValue:'',
rightValue:'', rightValue:'',
id:onlyNumber, id:onlyNumber,
}) })
} }
function addChildFillRole(){
//
//currentChildTableCount
//controlData.value.control.fillRoles.child.length
if(controlData.value.control.fillRoles.child.length<currentChildTableCount){
let onlyNumber = uuidv4().replaceAll('-','').toString(); //
controlData.value.control.fillRoles.child.push({
id: onlyNumber,
tableKey: '',
filterCondition:{
conditionHtml: '',
conditionHtmlCopy: '',
gongShi:{
formulaHtml:'',
mathsFormula:'',
mathsString:'',
},
},
childRoles:[]
})
}else{
alert("当前关联表单共 "+controlData.value.control.fillRoles.child.length+" 张子表,不可再添加")
}
}
function delRole(id:String){ function delRole(id:String){
const delRoleData:any = controlData.value.control.fillRoles const delRoleData:any = controlData.value.control.fillRoles.master
for (var i = 0; i < delRoleData.length; i++) {
if(delRoleData[i].id===id){
delRoleData.splice(i, 1);
i--; //
}
}
}
function delChildRole(id:String){
const delRoleData:any = controlData.value.control.fillRoles.child
for (var i = 0; i < delRoleData.length; i++) { for (var i = 0; i < delRoleData.length; i++) {
if(delRoleData[i].id===id){ if(delRoleData[i].id===id){
delRoleData.splice(i, 1); delRoleData.splice(i, 1);
@ -4379,19 +4515,51 @@ 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: 800px" 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:800px" width="50%" >
<template v-if="controlData.type=='associatedForms'"> <template v-if="controlData.type=='associatedForms'">
<el-divider style="margin-top: 0px;" />
<div style="margin-top: -10px;"><span style="color: grey;">当选择具体数据后将按如下规则给当前表单字段填充数据 </span></div> <div style="height:300px;border:1px solid white;overflow-y:auto;">
<el-button style="font-size: large;margin-top: 3px;" 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>
<el-divider /> <div style="background-color: #E6F3FE;padding: 12px;border-radius: 10px;padding-left:45px;margin-bottom:20px;padding-bottom: 1px;"><!-- #F5F7FA -->
<div style="height:600px;border:1px solid white;overflow-y:auto"> <template v-for="(item, index) in controlData.control.fillRoles.master" :key="controlData.control.fillRoles.master[index].id">
<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>
</template>
</div>
<template v-for="(item, index) in controlData.control.fillRoles" :key="controlData.control.fillRoles[index].id"> <el-popover
<AssociatedFormsFillRole v-model:left-value="controlData.control.fillRoles[index].leftValue" v-model:right-value="controlData.control.fillRoles[index].rightValue" :left-tree-source = "asfasfFieldTree" :right-tree-source = "associatedFormsCurrentFormFieldTree" :current-key="controlData.control.fillRoles[index].id" @del-Role = "delRole" ></AssociatedFormsFillRole> v-if="currentChildTableCount>0"
placement="right-end"
title=""
:width="200"
trigger="hover"
content="【关联表单子表字段】暂不支持填充至【当前表单主表字段】; 若【设置筛选条件】,则仅填充满足筛选条件的子表数据"
>
<template #reference>
<el-button style="font-size: large;margin-top: 3px;margin-bottom: 15px;" type="primary" link append-to-body="true" modal="true" @click="addChildFillRole"> 子表填充规则</el-button>
</template>
</el-popover>
<div v-if="currentChildTableCount>0"><!-- asfasfChildTableList -->
<template v-for="(item, index) in controlData.control.fillRoles.child" :key="controlData.control.fillRoles.child[index].id">
<AssociatedFormsChildFillRole
v-model:selected-child-table="controlData.control.fillRoles.child[index].tableKey"
:current-key="controlData.control.fillRoles.child[index].id"
:child-table-list="asfasfChildTableList"
@del-role = "delChildRole"
>
</AssociatedFormsChildFillRole>
</template> </template>
<div style="height:2000px"></div> </div>
</div> </div>
</template> </template>

4
src/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue

@ -106,8 +106,8 @@ const getTaskFormData = () =>{
state.id=props.versionid state.id=props.versionid
state.formData = stringToObj(data.tableFormPage.mastesform) state.formData = stringToObj(data.tableFormPage.mastesform)
state.formData.config.hideField = []//:confighideField, state.formData.config.hideField = []//:confighideField,
console.log("tableFlow---echoTableFormPage---data.tableFormPage.mastesform",data.tableFormPage.mastesform) //console.log("tableFlow---echoTableFormPage---data.tableFormPage.mastesform",data.tableFormPage.mastesform)
state.dict = string2json(data.tableFormPage.dict) state.dict = string2json(data.tableFormPage.dict)
state.formData.powerstr = string2json(data.tableFormPage.powerstr) state.formData.powerstr = string2json(data.tableFormPage.powerstr)
judgeSubmitCancel({"name":data.tableFormPage.mastesformjson}) judgeSubmitCancel({"name":data.tableFormPage.mastesformjson})
.then((datajud:any) =>{ .then((datajud:any) =>{

27
src/widget/associatedforms/associatedForms.vue

@ -1,10 +1,12 @@
<template> <template>
<!-- <el-input v-model="input" style="width: 240px" placeholder="" /> --> <div class="container">
<el-select v-model="value1" placeholder="请选择" style="width: 240px" @change="asfValueChanged"> <!-- <span style="font-size: 14px; margin-right: 12px;padding-top: 4px;" class="small-span" >{{ props.data.item?props.data.item.label:"关联表单" }}</span> -->
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> <el-select v-model="value1" placeholder="请选择" class="big-span" @change="asfValueChanged">
</el-select> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</template> </template>
@ -97,4 +99,19 @@ function getAsfDataTitles() {
} }
</script> </script>
<style></style> <style>
/* style="font-size: 14px; margin-right: 12px;" */
.container {
display: flex;
}
.small-span {
width: auto; /* 您可以根据需要调整第一个 span 的宽度比例 */
}
.big-span {
flex: 1; /* 第二个 span 占据剩余的所有宽度 */
}
</style>

100
src/widget/associatedforms/associatedFormsChildFillRole.vue

@ -0,0 +1,100 @@
<template>
<div style="background-color: #E6F3FE;padding: 12px;border-radius: 10px;padding-left:45px;margin-bottom:20px;margin-right:11px;min-height: 65px;padding-top: 16px;">
<el-button :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;" :data="childTableList" placeholder="请选择关联表单子表"
check-strictly :render-after-expand="false" filterable @change="selectedChildTableChanged" /><!--
<span style="margin-left: 8px;margin-right: 8px;">的值填充到</span>
<el-tree-select
v-model="rightValue1" style="width: 290px;" :data="rightTreeSource"
check-strictly :render-after-expand="false" filterable @change="rightChanged" />
<Delete style="width: 22px; height: 22px; margin-right: 35px;cursor: pointer; color: #50A6FF;margin-top: 10px; display: block; float:right" @click="delRole" /> -->
<!-- <el-button type="primary" @click="innerVisible = true">
open
</el-button> -->
<el-button style="padding-top: 5px; width: 290px;margin-left: 85px;height: 30px;" type="info" plain append-to-body="true" modal="true" @click="filterConditionDialoghandle = true" >设置筛选条件选填</el-button>
<!-- <div v-if="selectedChildTable1!==''" style="width:100%; cursor: pointer;" @click="associatedFormsDataRangeDialoghandle" v-html="controlData.control.dataRangeConditionHtml"></div> -->
</div>
<el-dialog
v-model="filterConditionDialoghandle"
width="500"
:show-close="true"
title="筛选条件"
append-to-body
>
{{ currentKey }}
</el-dialog>
</template>
<script setup lang="ts">
import { Close } from '@element-plus/icons-vue'
const filterConditionDialoghandle = ref(false)
const props = defineProps({
childTableList: {
type: Object,
default() {
return {}
}
},
selectedChildTable: {
type: String,
default() {
return {}
}
},
/* rightTreeSource: {
type: Object,
default() {
return {}
}
},
rightValue: {
type: String,
default() {
return {}
}
},*/
currentKey: {
type: String,
default() {
return {}
}
},
})
const selectedChildTable1 = ref()
selectedChildTable1.value = props.selectedChildTable
/*const rightValue1 = ref()
rightValue1.value = props.rightValue
*/
let emit = defineEmits(["delRole","update:selectedChildTable",]);
function selectedChildTableChanged(){
emit('update:selectedChildTable',selectedChildTable1)
}
/*
function rightChanged(){
emit('update:rightValue',rightValue1)
} */
function delRole(){
//alert(props.currentKey)
emit('delRole',props.currentKey)
}
</script>
<style></style>

6
src/widget/associatedforms/associatedFormsFillRole.vue

@ -2,12 +2,12 @@
<div style="margin-bottom: 15px; height: 40px; line-height: 40px;"> <div style="margin-bottom: 15px; height: 40px; line-height: 40px;">
<el-tree-select <el-tree-select
v-model="leftValue1" style="width: 290px;" :data="leftTreeSource" v-model="leftValue1" style="width: 270px;" :data="leftTreeSource" placeholder="关联表单主表字段"
check-strictly :render-after-expand="false" filterable @change="leftChanged" /> check-strictly :render-after-expand="false" filterable @change="leftChanged" />
<span style="margin-left: 8px;margin-right: 8px;">的值填充到</span> <span style="margin-left: 8px;margin-right: 8px;">的值填充到</span>
<el-tree-select <el-tree-select
v-model="rightValue1" style="width: 290px;" :data="rightTreeSource" v-model="rightValue1" style="width: 270px;" :data="rightTreeSource"
check-strictly :render-after-expand="false" filterable @change="rightChanged" /> check-strictly :render-after-expand="false" placeholder="当前表单字段" filterable @change="rightChanged" />
<Delete style="width: 22px; height: 22px; margin-right: 35px;cursor: pointer; color: #50A6FF;margin-top: 10px; display: block; float:right" @click="delRole" /> <Delete style="width: 22px; height: 22px; margin-right: 35px;cursor: pointer; color: #50A6FF;margin-top: 10px; display: block; float:right" @click="delRole" />
</div> </div>

3
src/widget/associatedforms/index.vue

@ -12,9 +12,10 @@
:label="getLabel(data.item as FormItem)" :label="getLabel(data.item as FormItem)"
> >
<input v-model="value" type="hidden" > <input v-model="value" type="hidden" >
<AssociatedForms :data="props.data" :form-props="formProps" :tablekey="props.tablekey" @value-changed="valueChanged"></AssociatedForms>
</el-form-item> </el-form-item>
<AssociatedForms :data="props.data" :form-props="formProps" :tablekey="props.tablekey" @value-changed="valueChanged"></AssociatedForms>
</template> </template>
<script lang='ts' setup> <script lang='ts' setup>
import AssociatedForms from './associatedForms.vue'; import AssociatedForms from './associatedForms.vue';

Loading…
Cancel
Save