Browse Source

Merge branch 'lwx_v6'

lwx_v7
超级管理员 1 year ago
parent
commit
0bcb3df8f0
  1. 8
      src/components/DesignForm/assembly/index.ts
  2. 123
      src/components/DesignForm/formControlPropertiNew.vue
  3. 251
      src/widget/associatedforms/associatedFormsChildFillRole.vue
  4. 2
      src/widget/associatedforms/associatedFormsFillRole.vue

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

@ -927,7 +927,13 @@ export default [
mathsString:'', mathsString:'',
}, },
}, },
childRoles:[] childRoles:[
{
leftValue: '',
rightValue: '',
id: '',
},
]
}, },
], ],
}, },

123
src/components/DesignForm/formControlPropertiNew.vue

@ -2618,8 +2618,9 @@ function addChildFillRole(){
// //
//currentChildTableCount //currentChildTableCount
//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 @@ function addChildFillRole(){
mathsString:'', mathsString:'',
}, },
}, },
childRoles:[] childRoles:[{
leftValue: '',
rightValue: '',
id: onlyNumber1,
}]
}) })
}else{ }else{
alert("当前关联表单共 "+controlData.value.control.fillRoles.child.length+" 张子表,不可再添加") alert("当前关联表单共 "+controlData.value.control.fillRoles.child.length+" 张子表,不可再添加")
@ -4298,13 +4303,13 @@ const radioChangeSet = (val:any) => {
<div class="common-layout"> <div class="common-layout">
<el-container> <el-container>
<el-aside width="300px" style="height:420px;border: 1px solid gainsboro;margin-right: 5px;"> <el-aside width="300px" style="height:420px;border: 1px solid gainsboro;margin-right: 5px;">
<el-input <!-- <el-input
v-show="fieldTreeSearchFlag" v-show="fieldTreeSearchFlag"
v-model="fieldTreeFilterText" v-model="fieldTreeFilterText"
style="width:98%;margin: 3px;" style="width:98%;margin: 3px;"
placeholder="搜索字段" placeholder="搜索字段"
class="filter-tree" class="filter-tree"
/> /> -->
<el-tree <el-tree
ref="fieldTreeRef" ref="fieldTreeRef"
node-key="id" node-key="id"
@ -4320,13 +4325,13 @@ const radioChangeSet = (val:any) => {
/> />
<el-input <!-- <el-input
v-show="orgTreeSearchFlag" v-show="orgTreeSearchFlag"
v-model="orgTreeFilterText" v-model="orgTreeFilterText"
style="width:98%;margin: 3px;" style="width:98%;margin: 3px;"
placeholder="搜索字段" placeholder="搜索字段"
class="filter-tree" class="filter-tree"
/> /> -->
<el-tree <el-tree
ref="orgTreeRef" ref="orgTreeRef"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
@ -4338,13 +4343,13 @@ const radioChangeSet = (val:any) => {
@node-contextmenu="handleOrgTreeContextmenu" @node-contextmenu="handleOrgTreeContextmenu"
/> />
<el-input <!-- <el-input
v-show="roleTreeSearchFlag" v-show="roleTreeSearchFlag"
v-model="roleTreeFilterText" v-model="roleTreeFilterText"
style="width:98%;margin: 3px;" style="width:98%;margin: 3px;"
placeholder="搜索字段" placeholder="搜索字段"
class="filter-tree" class="filter-tree"
/> /> -->
<el-tree <el-tree
ref="roleTreeRef" ref="roleTreeRef"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
@ -4415,13 +4420,13 @@ const radioChangeSet = (val:any) => {
@node-collapse="handleFieldTreeCollapse" @node-collapse="handleFieldTreeCollapse"
@node-contextmenu="handleFieldTreeContextmenuRange" @node-contextmenu="handleFieldTreeContextmenuRange"
/> />
<el-input <!-- <el-input
v-show="fieldTreeSearchFlag" v-show="fieldTreeSearchFlag"
v-model="fieldTreeFilterText" v-model="fieldTreeFilterText"
style="width:98%;margin: 3px;" style="width:98%;margin: 3px;"
placeholder="搜索字段" placeholder="搜索字段"
class="filter-tree" class="filter-tree"
/> /> -->
<el-tree <el-tree
ref="fieldTreeRef" ref="fieldTreeRef"
node-key="id" node-key="id"
@ -4434,13 +4439,13 @@ const radioChangeSet = (val:any) => {
@node-collapse="handleFieldTreeCollapse" @node-collapse="handleFieldTreeCollapse"
@node-contextmenu="handleFieldTreeContextmenuRange" @node-contextmenu="handleFieldTreeContextmenuRange"
/> />
<el-input <!-- <el-input
v-show="orgTreeSearchFlag" v-show="orgTreeSearchFlag"
v-model="orgTreeFilterText" v-model="orgTreeFilterText"
style="width:98%;margin: 3px;" style="width:98%;margin: 3px;"
placeholder="搜索字段" placeholder="搜索字段"
class="filter-tree" class="filter-tree"
/> /> -->
<el-tree <el-tree
ref="orgTreeRef" ref="orgTreeRef"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
@ -4452,13 +4457,13 @@ const radioChangeSet = (val:any) => {
@node-contextmenu="handleOrgTreeContextmenuRange" @node-contextmenu="handleOrgTreeContextmenuRange"
/> />
<el-input <!-- <el-input
v-show="roleTreeSearchFlag" v-show="roleTreeSearchFlag"
v-model="roleTreeFilterText" v-model="roleTreeFilterText"
style="width:98%;margin: 3px;" style="width:98%;margin: 3px;"
placeholder="搜索字段" placeholder="搜索字段"
class="filter-tree" class="filter-tree"
/> /> -->
<el-tree <el-tree
ref="roleTreeRef" ref="roleTreeRef"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
@ -4512,16 +4517,11 @@ 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="50%" >
<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-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="height:300px;border:1px solid white;overflow-y:auto;"> <div style="max-height:230px;border:1px solid white;overflow-y:auto;">
<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="background-color: #F0F0F0;padding: 12px;border-radius: 5px;padding-left:45px;padding-bottom: 10px;margin-right: 10px;"><!-- #F5F7FA #E6F3FE #F0F0F0 #F5F7FA-->
<div style="background-color: #E6F3FE;padding: 12px;border-radius: 10px;padding-left:45px;margin-bottom:20px;padding-bottom: 1px;"><!-- #F5F7FA -->
<template v-for="(item, index) in controlData.control.fillRoles.master" :key="controlData.control.fillRoles.master[index].id"> <template v-for="(item, index) in controlData.control.fillRoles.master" :key="controlData.control.fillRoles.master[index].id">
<AssociatedFormsFillRole <AssociatedFormsFillRole
v-model:left-value="controlData.control.fillRoles.master[index].leftValue" v-model:left-value="controlData.control.fillRoles.master[index].leftValue"
@ -4533,44 +4533,51 @@ const radioChangeSet = (val:any) => {
> >
</AssociatedFormsFillRole> </AssociatedFormsFillRole>
</template> </template>
</div> </div>
</div>
<el-popover
v-if="currentChildTableCount>0"
<el-popover placement="right-start"
v-if="currentChildTableCount>0" title=""
placement="right-end" :width="200"
title="" trigger="hover"
:width="200" content="【关联表单子表字段】暂不支持填充至【当前表单主表字段】"
trigger="hover" >
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>
<template #reference> </template>
<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> </el-popover>
</template> <div v-if="currentChildTableCount>0" style="max-height: 330px;overflow-y:auto;padding-top: 7px;">
</el-popover> <template v-for="(item, index) in controlData.control.fillRoles.child" :key="controlData.control.fillRoles.child[index].id">
<div v-if="currentChildTableCount>0"><!-- asfasfChildTableList --> <AssociatedFormsChildFillRole
<template v-for="(item, index) in controlData.control.fillRoles.child" :key="controlData.control.fillRoles.child[index].id"> v-model:selected-child-table="controlData.control.fillRoles.child[index].tableKey"
<AssociatedFormsChildFillRole v-model:filter-condition="controlData.control.fillRoles.child[index].filterCondition"
v-model:selected-child-table="controlData.control.fillRoles.child[index].tableKey" v-model:child-roles = "controlData.control.fillRoles.child[index].childRoles"
:current-key="controlData.control.fillRoles.child[index].id" :asfasf-field-tree="asfasfFieldTree"
:child-table-list="asfasfChildTableList" :tree-default-props="treeDefaultProps"
@del-role = "delChildRole" :filter-node="filterNode"
> :handle-field-tree-contextmenu-range="handleFieldTreeContextmenuRange"
</AssociatedFormsChildFillRole> :org-and-man-tree="orgAndManTree"
</template> :handle-org-tree-contextmenu-range = "handleOrgTreeContextmenuRange"
</div> :role-tree="roleTree"
:handle-role-tree-contextmenu-range="handleRoleTreeContextmenuRange"
:associated-forms-current-form-field-tree= "associatedFormsCurrentFormFieldTree"
:current-key="controlData.control.fillRoles.child[index].id"
:child-table-list="asfasfChildTableList"
@del-role = "delChildRole"
>
</AssociatedFormsChildFillRole>
</template>
</div> </div>
</template> </template>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<!-- <el-button @click="asfhTextCancelFillRoles">取消</el-button> --> <!-- <el-button @click="asfhTextCancelFillRoles">取消</el-button> -->
<el-button type="primary" @click="handleDetermineFillRoles"> <el-button type="primary" @click="handleDetermineFillRoles">
确定 确定
</el-button> </el-button>
</div> </div>
</template> </template>
</el-dialog> </el-dialog>

251
src/widget/associatedforms/associatedFormsChildFillRole.vue

@ -1,42 +1,155 @@
<!-- eslint-disable vue/no-v-html -->
<template> <template>
<div
<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;"> style="background-color: #F0F0F0;padding: 12px;border-radius: 5px;padding-left:45px;margin-bottom:20px;margin-right:11px;min-height: 65px;padding-top: 16px;color: black;">
<el-button :icon="Close" size="small" circle type="info" plain style="float: right;margin-top: -22px;margin-right: -22px" @click="delRole"/> <el-button
:icon="Close" size="small" circle type="info" plain
<el-tree-select style="float: right;margin-top: -22px;margin-right: -22px" @click="delRole" />
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 <el-tree-select
v-model="rightValue1" style="width: 290px;" :data="rightTreeSource" v-model="selectedChildTable1" style="width: 270px;margin-bottom: -1px" :data="childTableList"
check-strictly :render-after-expand="false" filterable @change="rightChanged" /> placeholder="请选择关联表单子表" check-strictly :render-after-expand="false" filterable
<Delete style="width: 22px; height: 22px; margin-right: 35px;cursor: pointer; color: #50A6FF;margin-top: 10px; display: block; float:right" @click="delRole" /> --> @change="selectedChildTableChanged" />
<el-popover placement="top-end" title="" :width="200" trigger="hover" content="若【设置筛选条件】,则仅填充满足筛选条件的子表数据">
<!-- <el-button type="primary" @click="innerVisible = true"> <template #reference>
open <el-button
</el-button> --> v-if="selectedChildTable1 !== '' && filterCondition1.conditionHtml === ''"
style="padding-top: 8px; width: 270px;margin-left: 85px;height: 30px;" type="primary" plain
<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> append-to-body="true" modal="true" @click="filterConditionDialogFlag = true">设置筛选条件选填</el-button>
<!-- <div v-if="selectedChildTable1!==''" style="width:100%; cursor: pointer;" @click="associatedFormsDataRangeDialoghandle" v-html="controlData.control.dataRangeConditionHtml"></div> --> </template>
</el-popover>
<div
v-if="selectedChildTable1 !== '' && filterCondition1.conditionHtml !== ''"
style="padding-top: 5px; width: auto;margin-left: 85px;height: 30px;cursor: pointer;display: inline-block;margin-top: 3px;"
@click="filterConditionDialogHandle" v-html="filterCondition1.conditionHtml"></div>
<el-divider v-if="selectedChildTable1 !== ''" />
<div
v-if="selectedChildTable1 !== ''"
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">
<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 v-if="selectedChildTable1 !== ''" type="primary" @click="addChildRole"> 添加规则</el-link>
</div> </div>
<el-dialog
v-model="filterConditionDialoghandle" <el-dialog
width="500" v-model="filterConditionDialogFlag" style="margin-top:70px ;min-height: 500px" width="50%"
:show-close="true" :show-close="false" title="筛选条件" append-to-body>
title="筛选条件" <div class="common-layout">
append-to-body <el-container>
> <el-aside width="300px" style="height:420px;border: 1px solid gainsboro;margin-right: 5px;">
{{ currentKey }} <el-tree
ref="fieldTreeRef" node-key="id" empty-text="选择关联的表单后展示" :data="asfasfFieldTree"
:props="treeDefaultProps" :filter-node-method="filterNode"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
@node-contextmenu="handleFieldTreeContextmenuRange" />
<el-tree
ref="fieldTreeRef" node-key="id" empty-text="请先保存当前表单" :data="associatedFormsCurrentFormFieldTree"
:props="treeDefaultProps" :filter-node-method="filterNode"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
@node-contextmenu="handleFieldTreeContextmenuRange" />
<el-tree
ref="orgTreeRef" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
:data="orgAndManTree" :props="treeDefaultProps" :filter-node-method="filterNode"
@node-contextmenu="handleOrgTreeContextmenuRange" />
<el-tree
ref="roleTreeRef" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
:data="roleTree" :props="treeDefaultProps" :filter-node-method="filterNode"
@node-contextmenu="handleRoleTreeContextmenuRange" />
</el-aside>
<el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain">
<div
style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">
仅可选择符合以下条件的数据</div>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 38%; border-bottom: 0px;">
<AssociatedFormsTinyaceFillRoleFilterCondition
ref="tinymceRef" :aft-text="filterCondition1.conditionHtml"
:aft-text-copy="filterCondition1.conditionHtmlCopy" @text-change="aftTextChangedRange"
@gongshi-change="aftGongshiChangedRange"></AssociatedFormsTinyaceFillRoleFilterCondition>
</div>
<div style="border: 1px solid gainsboro; height: 55%; padding-top: 20px;">
<ul>
<li>请从左侧面板<span style="color: red">右击</span>选择字段或选项</li>
<li>支持的符号<span style="color: red">'==', '>=', '>', '<=', '<' , '!=' </span>
</li>
<li>支持<span style="color: red">"包含,不包含,数据拥有者,数据所属部门"</span>关键字,用于组织机构条件,角色条件,==运算符和!=运算符</li>
<li>参考举例</li>
<span style="margin-left: 14px;">年龄>10</span><br>
<span style="margin-left: 14px;">企管部==数据所属部门</span><br>
<span style="margin-left: 14px;">绩效考核执行人包含数据拥有者</span><br>
<span style="margin-left: 14px;">生产部包含数据所属部门</span>
</ul>
</div>
</el-main>
</el-container>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="filterConditionDialogHandle">
确定
</el-button>
</div>
</template>
</el-dialog> </el-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { Close } from '@element-plus/icons-vue' import { Close } from '@element-plus/icons-vue'
const filterConditionDialoghandle = ref(false) import AssociatedFormsTinyaceFillRoleFilterCondition from '@/widget/associatedforms/associatedFormsTinyaceFillRoleFilterCondition.vue'
import { v4 as uuidv4 } from "uuid";
let emit = defineEmits(["delRole", "update:selectedChildTable",]);
const props = defineProps({ const props = defineProps({
orgAndManTree: {
type: Object,
default() {
return {}
}
},
roleTree: {
type: Object,
default() {
return {}
}
},
associatedFormsCurrentFormFieldTree: {
type: Object,
default() {
return {}
}
},
filterNode: {
type: Object,
default() {
return {}
}
},
treeDefaultProps: {
type: Object,
default() {
return {}
}
},
asfasfFieldTree: {
type: Object,
default() {
return {}
}
},
childTableList: { childTableList: {
type: Object, type: Object,
default() { default() {
@ -49,52 +162,90 @@ const props = defineProps({
return {} return {}
} }
}, },
/* rightTreeSource: { filterCondition: {
type: Object, type: Object,
default() { default() {
return {} return {}
} }
}, },
currentKey: {
rightValue: {
type: String, type: String,
default() { default() {
return {} return {}
} }
},*/ },
currentKey: { childRoles: {
type: String, type: Object,
default() { default() {
return {} return {}
} }
}, },
}) })
//AssociatedFormsTinyace
const tinymceRef = ref();
const filterConditionDialogFlag = ref(false)
const selectedChildTable1 = ref() const selectedChildTable1 = ref()
selectedChildTable1.value = props.selectedChildTable selectedChildTable1.value = props.selectedChildTable
/*const rightValue1 = ref()
const childRoles1 = ref()
childRoles1.value = props.childRoles
rightValue1.value = props.rightValue const filterCondition1 = ref()
*/ filterCondition1.value = props.filterCondition
let emit = defineEmits(["delRole","update:selectedChildTable",]);
function selectedChildTableChanged(){ function filterConditionDialogHandle() {
emit('update:selectedChildTable',selectedChildTable1) filterConditionDialogFlag.value = !filterConditionDialogFlag.value
} }
/*
function rightChanged(){ function aftTextChangedRange(str: string) {
emit('update:rightValue',rightValue1) filterCondition1.value.conditionHtml = str
} */
function delRole(){
//alert(props.currentKey)
emit('delRole',props.currentKey)
} }
function aftGongshiChangedRange(gongshi: any) {
filterCondition1.value.gongShi.formulaHtml = gongshi.formulaHtml
filterCondition1.value.gongShi.mathsFormula = gongshi.mathsFormula
filterCondition1.value.gongShi.mathsString = gongshi.mathsString
}
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)
}
function handleOrgTreeContextmenuRange(MouseEvent: any, object: any, Node: any, element: any) {
tinymceRef.value.addIcon_org(object)
}
function handleRoleTreeContextmenuRange(MouseEvent: any, object: any, Node: any, element: any) {
tinymceRef.value.addIcon(object)
}
function handleFieldTreeContextmenuRange(MouseEvent: any, object: any, Node: any, element: any) {
tinymceRef.value.addIcon(object)
}
</script> </script>
<style></style> <style></style>

2
src/widget/associatedforms/associatedFormsFillRole.vue

@ -1,6 +1,6 @@
<template> <template>
<div style="margin-bottom: 15px; height: 40px; line-height: 40px;"> <div style="margin-bottom: 3px; height: 40px; line-height: 40px;">
<el-tree-select <el-tree-select
v-model="leftValue1" style="width: 270px;" :data="leftTreeSource" placeholder="关联表单主表字段" 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" />

Loading…
Cancel
Save