Browse Source

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

lwx_v6
liwenxuan 1 year ago
parent
commit
5eb98c91e5
  1. 183
      src/widget/associatedforms/associatedFormsChildFillRole.vue

183
src/widget/associatedforms/associatedFormsChildFillRole.vue

@ -1,47 +1,33 @@
<!-- eslint-disable vue/no-v-html --> <!-- eslint-disable vue/no-v-html -->
<template> <template>
<div <div
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;"> 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 <el-button
: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: 290px;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="若【设置筛选条件】,则仅填充满足筛选条件的子表数据">
<template #reference>
<el-popover <el-button
v-if="selectedChildTable1 !== '' && filterCondition1.conditionHtml === ''"
placement="top-end" style="padding-top: 8px; width: 290px;margin-left: 85px;height: 30px;" type="primary" plain
title="" append-to-body="true" modal="true" @click="filterConditionDialogFlag = true">设置筛选条件选填</el-button>
:width="200" </template>
trigger="hover" </el-popover>
content="若【设置筛选条件】,则仅填充满足筛选条件的子表数据"
>
<template #reference>
<el-button
v-if="selectedChildTable1 !== '' && filterCondition1.conditionHtml === ''"
style="padding-top: 8px; width: 290px;margin-left: 85px;height: 30px;" type="primary" plain append-to-body="true"
modal="true" @click="filterConditionDialogFlag = true">设置筛选条件选填</el-button>
</template>
</el-popover>
<div <div
v-if="selectedChildTable1 !== '' && filterCondition1.conditionHtml !== ''" v-if="selectedChildTable1 !== '' && filterCondition1.conditionHtml !== ''"
style="padding-top: 5px; width: auto;margin-left: 85px;height: 30px;cursor: pointer;display: inline-block;margin-top: 3px;" 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> @click="filterConditionDialogHandle" v-html="filterCondition1.conditionHtml"></div>
<el-divider v-if="selectedChildTable1 !== ''" /> <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--> <div
<template v-for="(item, index) in childRoles" :key="childRoles[index].id"> v-if="selectedChildTable1 !== ''"
{{ item }} 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-->
<!-- <AssociatedFormsFillRole <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:left-value="controlData.control.fillRoles.master[index].leftValue"
v-model:right-value="controlData.control.fillRoles.master[index].rightValue" v-model:right-value="controlData.control.fillRoles.master[index].rightValue"
:left-tree-source = "asfasfMasterFieldTree" :left-tree-source = "asfasfMasterFieldTree"
@ -50,78 +36,65 @@
@del-role = "delRole" @del-role = "delRole"
> >
</AssociatedFormsFillRole> --> </AssociatedFormsFillRole> -->
</template> </template>
</div> </div>
</div> </div>
<el-dialog v-model="filterConditionDialogFlag" style="margin-top:70px ;min-height: 500px" width="50%" :show-close="false" title="筛选条件" append-to-body> <el-dialog
v-model="filterConditionDialogFlag" style="margin-top:70px ;min-height: 500px" width="50%"
<div class="common-layout"> :show-close="false" title="筛选条件" append-to-body>
<el-container> <div class="common-layout">
<el-aside width="300px" style="height:420px;border: 1px solid gainsboro;margin-right: 5px;"> <el-container>
<el-tree <el-aside width="300px" style="height:420px;border: 1px solid gainsboro;margin-right: 5px;">
ref="fieldTreeRef" node-key="id" empty-text="选择关联的表单后展示" :data="asfasfFieldTree" <el-tree
:props="treeDefaultProps" :filter-node-method="filterNode" ref="fieldTreeRef" node-key="id" empty-text="选择关联的表单后展示" :data="asfasfFieldTree"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;" @node-contextmenu="handleFieldTreeContextmenuRange" /> :props="treeDefaultProps" :filter-node-method="filterNode"
<!-- <el-input style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
v-show="fieldTreeSearchFlag" v-model="fieldTreeFilterText" style="width:98%;margin: 3px;" @node-contextmenu="handleFieldTreeContextmenuRange" />
placeholder="搜索字段" class="filter-tree" /> --> <el-tree
<el-tree ref="fieldTreeRef" node-key="id" empty-text="请先保存当前表单" :data="associatedFormsCurrentFormFieldTree"
ref="fieldTreeRef" node-key="id" empty-text="请先保存当前表单" :data="associatedFormsCurrentFormFieldTree" :props="treeDefaultProps" :filter-node-method="filterNode"
:props="treeDefaultProps" :filter-node-method="filterNode" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;" @node-contextmenu="handleFieldTreeContextmenuRange" /> @node-contextmenu="handleFieldTreeContextmenuRange" />
<!-- <el-input <el-tree
v-show="orgTreeSearchFlag" v-model="orgTreeFilterText" style="width:98%;margin: 3px;" ref="orgTreeRef" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
placeholder="搜索字段" class="filter-tree" /> --> :data="orgAndManTree" :props="treeDefaultProps" :filter-node-method="filterNode"
<el-tree @node-contextmenu="handleOrgTreeContextmenuRange" />
ref="orgTreeRef" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;" <el-tree
:data="orgAndManTree" :props="treeDefaultProps" :filter-node-method="filterNode" ref="roleTreeRef" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
:data="roleTree" :props="treeDefaultProps" :filter-node-method="filterNode"
@node-contextmenu="handleOrgTreeContextmenuRange" /> @node-contextmenu="handleRoleTreeContextmenuRange" />
</el-aside>
<!--<el-input <el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain">
v-show="roleTreeSearchFlag" v-model="roleTreeFilterText" style="width:98%;margin: 3px;" <div
placeholder="搜索字段" class="filter-tree" />--> style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">
<el-tree 仅可选择符合以下条件的数据</div>
ref="roleTreeRef" style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;" <div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 38%; border-bottom: 0px;">
:data="roleTree" :props="treeDefaultProps" :filter-node-method="filterNode" <AssociatedFormsTinyaceFillRoleFilterCondition
ref="tinymceRef" :aft-text="filterCondition1.conditionHtml"
@node-contextmenu="handleRoleTreeContextmenuRange" /> :aft-text-copy="filterCondition1.conditionHtmlCopy" @text-change="aftTextChangedRange"
</el-aside> @gongshi-change="aftGongshiChangedRange"></AssociatedFormsTinyaceFillRoleFilterCondition>
<el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain"> </div>
<div <div style="border: 1px solid gainsboro; height: 55%; padding-top: 20px;">
style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;"> <ul>
仅可选择符合以下条件的数据</div> <li>请从左侧面板<span style="color: red">右击</span>选择字段或选项</li>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 38%; border-bottom: 0px;"> <li>支持的符号<span style="color: red">'==', '>=', '>', '<=', '<' , '!=' </span>
<AssociatedFormsTinyaceFillRoleFilterCondition </li>
ref="tinymceRef" <li>支持<span style="color: red">"包含,不包含,数据拥有者,数据所属部门"</span>关键字,用于组织机构条件,角色条件,==运算符和!=运算符</li>
:aft-text="filterCondition1.conditionHtml" <li>参考举例</li>
:aft-text-copy="filterCondition1.conditionHtmlCopy" <span style="margin-left: 14px;">年龄>10</span><br>
@text-change="aftTextChangedRange" @gongshi-change="aftGongshiChangedRange" <span style="margin-left: 14px;">企管部==数据所属部门</span><br>
></AssociatedFormsTinyaceFillRoleFilterCondition> <span style="margin-left: 14px;">绩效考核执行人包含数据拥有者</span><br>
<span style="margin-left: 14px;">生产部包含数据所属部门</span>
</div> </ul>
<div style="border: 1px solid gainsboro; height: 55%; padding-top: 20px;"> </div>
<ul> </el-main>
<li>请从左侧面板<span style="color: red">右击</span>选择字段或选项</li> </el-container>
<li>支持的符号<span style="color: red">'==', '>=', '>', '<=', '<' , '!=' </span> </div>
</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> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<!-- <el-button @click="asfhTextCancelRange">取消</el-button> -->
<el-button type="primary" @click="filterConditionDialogHandle"> <el-button type="primary" @click="filterConditionDialogHandle">
确定 确定
</el-button> </el-button>
@ -138,39 +111,39 @@ import AssociatedFormsTinyaceFillRoleFilterCondition from '@/widget/associatedfo
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() {
return {} return {}
} }
}, },
roleTree:{ roleTree: {
type: Object, type: Object,
default() { default() {
return {} return {}
} }
}, },
associatedFormsCurrentFormFieldTree:{ associatedFormsCurrentFormFieldTree: {
type: Object, type: Object,
default() { default() {
return {} return {}
} }
}, },
filterNode:{ filterNode: {
type: Object, type: Object,
default() { default() {
return {} return {}
} }
}, },
treeDefaultProps:{ treeDefaultProps: {
type: Object, type: Object,
default() { default() {
return {} return {}
} }
}, },
asfasfFieldTree:{ asfasfFieldTree: {
type: Object, type: Object,
default() { default() {
return {} return {}
@ -201,7 +174,7 @@ const props = defineProps({
return {} return {}
} }
}, },
childRoles:{ childRoles: {
type: Object, type: Object,
default() { default() {
return {} return {}
@ -229,11 +202,11 @@ function filterConditionDialogHandle() {
filterConditionDialogFlag.value = !filterConditionDialogFlag.value filterConditionDialogFlag.value = !filterConditionDialogFlag.value
} }
function aftTextChangedRange(str:string){ function aftTextChangedRange(str: string) {
filterCondition1.value.conditionHtml = str filterCondition1.value.conditionHtml = str
} }
function aftGongshiChangedRange(gongshi:any){ function aftGongshiChangedRange(gongshi: any) {
filterCondition1.value.gongShi.formulaHtml = gongshi.formulaHtml filterCondition1.value.gongShi.formulaHtml = gongshi.formulaHtml
filterCondition1.value.gongShi.mathsFormula = gongshi.mathsFormula filterCondition1.value.gongShi.mathsFormula = gongshi.mathsFormula
filterCondition1.value.gongShi.mathsString = gongshi.mathsString filterCondition1.value.gongShi.mathsString = gongshi.mathsString
@ -247,13 +220,13 @@ function selectedChildTableChanged() {
function delRole() { function delRole() {
emit('delRole', props.currentKey) emit('delRole', props.currentKey)
} }
function handleOrgTreeContextmenuRange(MouseEvent:any, object:any, Node:any, element:any){ function handleOrgTreeContextmenuRange(MouseEvent: any, object: any, Node: any, element: any) {
tinymceRef.value.addIcon_org(object) tinymceRef.value.addIcon_org(object)
} }
function handleRoleTreeContextmenuRange(MouseEvent:any, object:any, Node:any, element:any){ function handleRoleTreeContextmenuRange(MouseEvent: any, object: any, Node: any, element: any) {
tinymceRef.value.addIcon(object) tinymceRef.value.addIcon(object)
} }
function handleFieldTreeContextmenuRange(MouseEvent:any, object:any, Node:any, element:any){ function handleFieldTreeContextmenuRange(MouseEvent: any, object: any, Node: any, element: any) {
tinymceRef.value.addIcon(object) tinymceRef.value.addIcon(object)
} }
</script> </script>

Loading…
Cancel
Save