Browse Source

Merge branch 'lwx_v8' into v8_master

v8_master
超级管理员 2 years ago
parent
commit
99c694adb9
  1. 20
      node_modules/.package-lock.json
  2. 22
      package-lock.json
  3. 2
      package.json
  4. 13
      src/components/DesignForm/assembly/index.ts
  5. 646
      src/components/DesignForm/formControlAttr.vue
  6. 79
      src/widget/associatedforms/associatedFormsFillRole.vue
  7. 107
      src/widget/associatedforms/associatedFormsTinyace.vue
  8. 108
      src/widget/associatedforms/associatedFormsTinyaceRange.vue

20
node_modules/.package-lock.json

@ -966,6 +966,15 @@
"resolved": "https://registry.npmmirror.com/@types/event-emitter/-/event-emitter-0.3.4.tgz",
"integrity": "sha512-q68CMfgGnlwrV6BFupIGNSitHbuFhGzA+uTBztFKAQuGCF/Xy0mi33jwEPQaHtnb89cLFlsc7AIxk/2gdtXrvw=="
},
"node_modules/@types/jquery": {
"version": "3.5.29",
"resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.29.tgz",
"integrity": "sha512-oXQQC9X9MOPRrMhPHHOsXqeQDnWeCDT3PelUIg/Oy8FAbzSZtFHRjc7IpbfFVmpLtJ+UOoywpRsuO5Jxjybyeg==",
"dev": true,
"dependencies": {
"@types/sizzle": "*"
}
},
"node_modules/@types/json-schema": {
"version": "7.0.14",
"resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.14.tgz",
@ -1027,6 +1036,12 @@
"integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==",
"dev": true
},
"node_modules/@types/sizzle": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz",
"integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==",
"dev": true
},
"node_modules/@types/spark-md5": {
"version": "3.0.4",
"resolved": "https://registry.npmmirror.com/@types/spark-md5/-/spark-md5-3.0.4.tgz",
@ -5265,6 +5280,11 @@
"jiti": "bin/jiti.js"
}
},
"node_modules/jquery": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz",
"integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg=="
},
"node_modules/js-base64": {
"version": "2.6.4",
"resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-2.6.4.tgz",

22
package-lock.json

@ -21,6 +21,7 @@
"echarts": "^5.4.3",
"element-plus": "^2.3.4",
"font-awesome": "^4.7.0",
"jquery": "^3.7.1",
"js-beautify": "^1.14.8",
"js-md5": "^0.7.3",
"mapv-three": "^1.0.18",
@ -46,6 +47,7 @@
"@commitlint/cli": "^17.6.3",
"@commitlint/config-conventional": "^17.6.3",
"@iconify-json/ep": "^1.1.10",
"@types/jquery": "^3.5.29",
"@types/md5": "^2.3.2",
"@types/nprogress": "^0.2.0",
"@types/path-browserify": "^1.0.0",
@ -1363,6 +1365,15 @@
"resolved": "https://registry.npmmirror.com/@types/event-emitter/-/event-emitter-0.3.4.tgz",
"integrity": "sha512-q68CMfgGnlwrV6BFupIGNSitHbuFhGzA+uTBztFKAQuGCF/Xy0mi33jwEPQaHtnb89cLFlsc7AIxk/2gdtXrvw=="
},
"node_modules/@types/jquery": {
"version": "3.5.29",
"resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.29.tgz",
"integrity": "sha512-oXQQC9X9MOPRrMhPHHOsXqeQDnWeCDT3PelUIg/Oy8FAbzSZtFHRjc7IpbfFVmpLtJ+UOoywpRsuO5Jxjybyeg==",
"dev": true,
"dependencies": {
"@types/sizzle": "*"
}
},
"node_modules/@types/json-schema": {
"version": "7.0.14",
"resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.14.tgz",
@ -1424,6 +1435,12 @@
"integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==",
"dev": true
},
"node_modules/@types/sizzle": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz",
"integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==",
"dev": true
},
"node_modules/@types/spark-md5": {
"version": "3.0.4",
"resolved": "https://registry.npmmirror.com/@types/spark-md5/-/spark-md5-3.0.4.tgz",
@ -5675,6 +5692,11 @@
"jiti": "bin/jiti.js"
}
},
"node_modules/jquery": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz",
"integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg=="
},
"node_modules/js-base64": {
"version": "2.6.4",
"resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-2.6.4.tgz",

2
package.json

@ -52,6 +52,7 @@
"echarts": "^5.4.3",
"element-plus": "^2.3.4",
"font-awesome": "^4.7.0",
"jquery": "^3.7.1",
"js-beautify": "^1.14.8",
"js-md5": "^0.7.3",
"mapv-three": "^1.0.18",
@ -77,6 +78,7 @@
"@commitlint/cli": "^17.6.3",
"@commitlint/config-conventional": "^17.6.3",
"@iconify-json/ep": "^1.1.10",
"@types/jquery": "^3.5.29",
"@types/md5": "^2.3.2",
"@types/nprogress": "^0.2.0",
"@types/path-browserify": "^1.0.0",

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

@ -599,6 +599,19 @@ const selectOption: any = [
iconFont: 'fa-wpforms',
control: {
modelValue: '',
hideConditionHtml:'',
hideConditionHtmlCopy:'',
formid: '',
dataRangeConditionHtml:'',
dataRangeConditionHtmlCopy:'',
saveFlag: false,
fillRoles: [
{
leftValue:'',
rightValue:'',
id:'',
}
],
},
config: {}
}

646
src/components/DesignForm/formControlAttr.vue

@ -626,6 +626,30 @@
vIf: state.isSearch,
vShow: ['associatedForms']
},
{
label: '关联表单',
value: config.associatedForms,
path: 'config.associatedForms',
type: 'associatedForms_form',
vIf: state.isSearch,
vShow: ['associatedForms']
},
{
label: '数据范围',
value: config.associatedForms,
path: 'config.associatedForms',
type: 'associatedForms_dataRange',
vIf: state.isSearch,
vShow: ['associatedForms']
},
{
label: '数据填充规则',
value: config.associatedForms,
path: 'config.associatedForms',
type: 'associatedForms_FillRoles',
vIf: state.isSearch,
vShow: ['associatedForms']
},
{
label: '轮播图设置',
value: config.carousel,
@ -1543,6 +1567,8 @@
element.imgId = onlyNumber;
}
});
}else if(controlData.value.type==='associatedForms'){
controlData.value.control.fillRoles[0].id = uuidv4().replaceAll('-','').toString();
}
})
//
@ -1654,6 +1680,7 @@ interface Tree {
[key: string]: any
}
const addRootNode = () => {
let onlyNumber = uuidv4().replaceAll('-','').toString();
controlData.value.control.fixedOptions.push({
@ -1741,20 +1768,26 @@ const transferDataSourceOptions = [
//liwenxuan20240403 associatedForms start
import AssociatedFormsTinyace from '@/widget/associatedforms/associatedFormsTinyace.vue'
import AssociatedFormsTinyaceRange from '@/widget/associatedforms/associatedFormsTinyaceRange.vue'
import AssociatedFormsFillRole from '@/widget/associatedforms/associatedFormsFillRole.vue'
const associatedFormsHideDialogFlag = ref(false)
const defaultProps = {
const treeDefaultProps = {
children: 'children',
label: 'label',
}
//AssociatedFormsTinyace
let aft = ref();
const aftRange = ref();
function getAssociatedFormsCurrentFieldTree() {
return request({
url: '/javasys/lowCode/AssociatedForms/getFieldTree',
method: 'post',
data: {
cfid:'1'
//cfid:'13'
cfid:props.customerformid
},
});
}
@ -1765,29 +1798,112 @@ function getAssociatedFormsOrgAndManTree() {
method: 'post',
});
}
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
getAssociatedFormsCurrentFieldTree().then(({ data }) => {
function getCustomerFormList() {
return request({
url: '/javasys/lowCode/AssociatedForms/getCustomerFormList',
method: 'post',
});
}
function getAssociatedFormsRoleTree() {
return request({
url: '/javasys/lowCode/AssociatedForms/getRoleList',
method: 'post',
});
}
function getAsfasfFieldTree() {
return request({
url: '/javasys/lowCode/AssociatedForms/getFieldTree',
method: 'post',
data: {
//cfid:'13'
cfid:controlData.value.control.formid
},
});
}
const asfasfFieldTree = ref<Tree[]>()
function formidChanged(){
if(controlData.value.control.formid===''){
}else{
getAsfasfFieldTree().then(({ data }) => {
if(data.id==="cfid为空"){
//alert("cfid")
}else{
let resData = ref(data.children)
//let rootid_ = data.value.label
asfasfFieldTree.value = [{
id: 'rootid_'+data.label,
label: '关联的表单-'+data.label,
children: [...resData.value],
treeAttrs: data.treeAttrs,
}]
}
});
}
}
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
getAssociatedFormsCurrentFieldTree().then(({ data }) => {
if(data.id==="cfid为空"){
//alert("cfid")
}else{
let resData = ref(data.children)
//let rootid_ = data.value.label
associatedFormsCurrentFormFieldTree.value = [{
//let rootid_ = data.value.label
associatedFormsCurrentFormFieldTree.value = [{
id: 'rootid_'+data.label,
label: '当前表单',
children: [...resData.value]
label: '当前表单',
children: [...resData.value],
treeAttrs: data.treeAttrs,
}]
}
});
const customerFormTree = ref<Tree[]>()
getCustomerFormList().then(({ data }) => {
let resData = ref(data.children)
customerFormTree.value = [{
id: data.id,
//value: data.value,
//label: data.label,
label: '请选择表单',
children: [...resData.value]
}]
});
const orgAndManTree = ref<Tree[]>()
getAssociatedFormsOrgAndManTree().then(({ data }) => {
let resData = ref(data.children)
orgAndManTree.value = [{
id: data.id,
//label: data.label,
label: '组织机构',
children: [...resData.value]
}]
getAssociatedFormsOrgAndManTree().then(({ data }) => {
let resData = ref(data.children)
orgAndManTree.value = [{
id: data.id,
//label: data.label,
label: '组织机构',
children: [...resData.value]
}]
});
const roleTree = ref<Tree[]>()
getAssociatedFormsRoleTree().then(({ data }) => {
let resData = ref(data.children)
//console.log("roleTree=============="+resData.value);
roleTree.value = [{
id: data.id,
//label: data.label,
label: '角色',
children: [...resData.value]
}]
});
// field
const fieldTreeSearchFlag = ref(false)
function handleFieldTreeExpand(){
@ -1799,29 +1915,245 @@ function handleFieldTreeCollapse(){
fieldTreeSearchFlag.value = false;
}
function handleFieldTreeNodeclick(){
function handleFieldTreeContextmenu(MouseEvent:any, object:any, Node:any, element:any){
aft.value.addIcon_field(object)
}
function handleFieldTreeContextmenuRange(MouseEvent:any, object:any, Node:any, element:any){
aftRange.value.addIcon_field(object)
}
//org
const orgTreeSearchFlag = ref(false)
function handleOrgTreeExpand(){
orgTreeSearchFlag.value = true;
}
function handleFieldTreeContextmenu(MouseEvent:any, object:any, Node:any, element:any){
//console.log(MouseEvent)
console.log(object)
//console.log(Node)
//console.log(element)
function handleOrgTreeCollapse(){
orgTreeSearchFlag.value = false;
}
function handleOrgTreeContextmenu(MouseEvent:any, object:any, Node:any, element:any){
aft.value.addIcon_org(object)
}
function handleOrgTreeContextmenuRange(MouseEvent:any, object:any, Node:any, element:any){
aftRange.value.addIcon_org(object)
}
//role
const roleTreeSearchFlag = ref(false)
function handleRoleTreeExpand(){
roleTreeSearchFlag.value = true;
}
function handleRoleTreeCollapse(){
roleTreeSearchFlag.value = false;
}
function handleRoleTreeContextmenu(MouseEvent:any, object:any, Node:any, element:any){
aft.value.addIcon(object)
}
function handleRoleTreeContextmenuRange(MouseEvent:any, object:any, Node:any, element:any){
aftRange.value.addIcon(object)
}
import { ElTree } from 'element-plus'
const fieldTreeFilterText = ref('')
const orgTreeFilterText = ref('')
const roleTreeFilterText = ref('')
const fieldTreeRef = ref<InstanceType<typeof ElTree>>()
const orgTreeRef = ref<InstanceType<typeof ElTree>>()
const roleTreeRef = ref<InstanceType<typeof ElTree>>()
watch(fieldTreeFilterText, (val) => {
fieldTreeRef.value!.filter(val)
})
watch(orgTreeFilterText, (val) => {
orgTreeRef.value!.filter(val)
})
watch(roleTreeFilterText, (val) => {
roleTreeRef.value!.filter(val)
})
const filterNode = (value: string, associatedFormsCurrentFormFieldTree: Tree) => {
if (!value) return true
return associatedFormsCurrentFormFieldTree.label.includes(value)
}
//flag
const associatedFormsHideDialogFlag = ref(false)
const associatedFormsDataRangeDialogFlag = ref(false)
//
function associatedFormsHideDialoghandle(){
associatedFormsHideDialogFlag.value = true
controlData.value.control.hideConditionHtmlCopy = controlData.value.control.hideConditionHtml
nextTick(() => {
aft.value.focusEditor()
})
}
function associatedFormsDataRangeDialoghandle(){
getAsfasfFieldTree().then(({ data }) => {
if(data.id==="cfid为空"){
//alert("cfid")
}else{
let resData = ref(data.children)
//let rootid_ = data.value.label
asfasfFieldTree.value = [{
id: 'rootid_'+data.label,
label: '关联的表单-'+data.label,
children: [...resData.value],
treeAttrs: data.treeAttrs,
}]
}
});
associatedFormsDataRangeDialogFlag.value = true
controlData.value.control.dataRangeConditionHtmlCopy = controlData.value.control.dataRangeConditionHtml
nextTick(() => {
aftRange.value.focusEditor()
})
}
//text
function aftTextChanged(str:string){
controlData.value.control.hideConditionHtml = str
}
function aftTextChangedRange(str:string){
controlData.value.control.dataRangeConditionHtml = str
}
//asf
function asfhTextCancel(){
determine.value = false
associatedFormsHideDialogFlag.value = false
controlData.value.control.hideConditionHtml = controlData.value.control.hideConditionHtmlCopy
//copy
aft.value.handelCancel(controlData.value.control.hideConditionHtmlCopy)
}
function asfhTextCancelRange(){
determineRange.value = false
associatedFormsDataRangeDialogFlag.value = false
controlData.value.control.dataRangeConditionHtml = controlData.value.control.dataRangeConditionHtmlCopy
//copy
aftRange.value.handelCancel(controlData.value.control.dataRangeConditionHtmlCopy)
}
//true
let determine = ref(true)
let determineRange = ref(true)
//associatedFormsHideDialogFlag true init tinymce
watch(associatedFormsHideDialogFlag, (val) => {
if(val===true&&determine.value===false){
setTimeout(() => {
aft.value.tinymceReInit()
}, 200);
}
})
watch(associatedFormsDataRangeDialogFlag, (val) => {
if(val===true&&determineRange.value===false){
setTimeout(() => {
aftRange.value.tinymceReInit()
}, 200);
}
})
//
function handleDetermine(){
associatedFormsHideDialogFlag.value = false
determine.value = true
controlData.value.control.hideConditionHtmlCopy = controlData.value.control.hideConditionHtml
}
function handleDetermineRange(){
associatedFormsDataRangeDialogFlag.value = false
determineRange.value = true
controlData.value.control.dataRangeConditionHtmlCopy = controlData.value.control.dataRangeConditionHtml
}
//
const associatedFormsFillRolesDialogFlag = ref(false)
//
function associatedFormsDataFillRolesDialoghandle(){
if(controlData.value.control.formid===''){
alert("请先选择要关联的表单")
}else{
associatedFormsFillRolesDialogFlag.value = true
}
}
function asfhTextCancelFillRoles(){
associatedFormsFillRolesDialogFlag.value = false
}
//
function handleDetermineFillRoles(){
associatedFormsFillRolesDialogFlag.value = false
}
watch(()=>store.activeKey, () => {
if(controlData.value.type==='associatedForms'){
setTimeout(() => {
formidChanged()
}, 800);
}
})
function addFillRole(){
let onlyNumber = uuidv4().replaceAll('-','').toString(); //
controlData.value.control.fillRoles.push({
leftValue:'',
rightValue:'',
id:onlyNumber,
})
}
function delRole(id:String){
const delRoleData:any = controlData.value.control.fillRoles
for (var i = 0; i < delRoleData.length; i++) {
if(delRoleData[i].id===id){
delRoleData.splice(i, 1);
i--; //
}
}
}
//liwenxuan20240403 associatedForms end
const optionsCss = [
@ -1907,6 +2239,9 @@ const gainFormGroupList = () =>{
})
}
onMounted(() => {
gainFormGroupList()
})
@ -2277,10 +2612,39 @@ const loadNextPage = () => {
</el-row>
<el-row v-else-if="item.type === 'associatedForms_hide'">
<el-button type="primary" append-to-body="true" modal="true" @click="associatedFormsHideDialogFlag = true" >设置隐藏条件</el-button>
<el-button v-if="controlData.control.hideConditionHtml===''" style="padding-top: 5px;" type="primary" link append-to-body="true" modal="true" @click="associatedFormsHideDialoghandle" >设置隐藏条件</el-button>
<div style="width:100%; cursor: pointer;" @click="associatedFormsHideDialoghandle" v-html="controlData.control.hideConditionHtml"></div>
</el-row>
<el-row v-else-if="item.type === 'associatedForms_form'">
<div style="margin-top: 25px;margin-left: -60px;">
<el-tree-select
v-model="controlData.control.formid"
style="width: 260px;"
:data="customerFormTree[0].children"
check-strictly
:render-after-expand="false"
filterable
@change="formidChanged"
/>
</div>
<!-- <div v-html="controlData.control.formid"></div> -->
</el-row>
<el-row v-else-if="item.type === 'associatedForms_dataRange'">
<el-button v-if="controlData.control.dataRangeConditionHtml===''" style="padding-top: 5px;" type="primary" link append-to-body="true" modal="true" @click="associatedFormsDataRangeDialoghandle" >设置数据范围</el-button>
<div style="width:100%; cursor: pointer;" @click="associatedFormsDataRangeDialoghandle" v-html="controlData.control.dataRangeConditionHtml"></div>
</el-row>
<el-row v-else-if="item.type === 'associatedForms_FillRoles'">
<el-button style="padding-top: 5px;" type="primary" link append-to-body="true" modal="true" @click="associatedFormsDataFillRolesDialoghandle" >设置数据填充规则</el-button>
</el-row>
<el-input
v-else
:type="item.inputStyle"
@ -2983,63 +3347,267 @@ const loadNextPage = () => {
<!-- 关联表单设置弹窗 liwenxuan 20240402 start -->
<el-dialog v-model="associatedFormsHideDialogFlag" title="隐藏条件" top="150px" style="margin-top:70px ;min-height: 500px" width="50%">
<el-dialog v-model="associatedFormsHideDialogFlag" title="隐藏条件" top="150px" :close-on-click-modal="false" :show-close="false" style="margin-top:70px ;min-height: 500px" width="50%" >
<template v-if="controlData.type=='associatedForms'">
<div class="common-layout">
<el-container>
<el-aside width="300px" style="height:400px;border: 1px solid gainsboro;margin-right: 5px;">
<el-aside width="300px" style="height:420px;border: 1px solid gainsboro;margin-right: 5px;">
<el-input
v-show="fieldTreeSearchFlag"
v-model="fieldTreeFilterText"
style="width:98%;margin: 3px;"
placeholder="搜索字段"
class="filter-tree"
/>
<el-tree
ref="fieldTreeRef"
node-key="id"
empty-text="请先保存当前表单,若需要展示本次编辑表单添加的字段,也需先保存"
:data="associatedFormsCurrentFormFieldTree"
:props="defaultProps"
:props="treeDefaultProps"
:filter-node-method="filterNode"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
@node-expand="handleFieldTreeExpand"
@node-collapse="handleFieldTreeCollapse"
@node-click="handleFieldTreeNodeclick"
@node-contextmenu="handleFieldTreeContextmenu"
/>
<el-input
v-show="orgTreeSearchFlag"
v-model="orgTreeFilterText"
style="width:98%;margin: 3px;"
placeholder="搜索字段"
class="filter-tree"
/>
<el-tree
ref="orgTreeRef"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
:data="orgAndManTree"
:props="defaultProps"
:props="treeDefaultProps"
:filter-node-method="filterNode"
@node-expand="handleOrgTreeExpand"
@node-collapse="handleOrgTreeCollapse"
@node-contextmenu="handleOrgTreeContextmenu"
/>
<el-input
v-show="roleTreeSearchFlag"
v-model="roleTreeFilterText"
style="width:98%;margin: 3px;"
placeholder="搜索字段"
class="filter-tree"
/>
<el-tree
ref="roleTreeRef"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
:data="roleTree"
:props="treeDefaultProps"
:filter-node-method="filterNode"
@node-expand="handleRoleTreeExpand"
@node-collapse="handleRoleTreeCollapse"
@node-contextmenu="handleRoleTreeContextmenu"
/>
</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: 63%; border-bottom: 0px;"></div>
<div style="border: 1px solid gainsboro; height: 30%;"></div>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;">
<AssociatedFormsTinyace ref="aft" :aft-text="controlData.control.hideConditionHtml" :aft-text-copy = "controlData.control.hideConditionHtmlCopy" @text-change = "aftTextChanged"></AssociatedFormsTinyace>
<!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;">
<span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数
</div> -->
</div>
<div style="border: 1px solid gainsboro; height: 30%; padding-top: 20px;">
<ul>
<li>请从左侧面板<span style="color: red">右击</span>选择字段或选项</li>
<li>支持<span style="color: red">英文</span>模式下运算符<!-- +-*/><== --></li>
<li>参考场景</li>
<span style="margin-left: 14px;">年龄控件输入的值大于10时需要隐藏当前控件则可将隐藏条件设置为年龄>10</span>
</ul>
</div>
</el-main>
</el-container>
</div>
</template>
<template #footer>
<div class="dialog-footer">
<el-button @click="asfhTextCancel">取消</el-button>
<el-button type="primary" @click="handleDetermine">
确定
</el-button>
</div>
</template>
</el-dialog>
<!-- 数据范围编辑弹窗 -->
<el-dialog v-model="associatedFormsDataRangeDialogFlag" title="数据范围" top="150px" :close-on-click-modal="false" :show-close="false" style="margin-top:70px ;min-height: 500px" width="50%" >
<template v-if="controlData.type=='associatedForms'">
<div class="common-layout">
<el-container>
<el-aside width="300px" style="height:420px;border: 1px solid gainsboro;margin-right: 5px;">
<el-tree
ref="fieldTreeRef"
node-key="id"
:data="asfasfFieldTree"
:props="treeDefaultProps"
:filter-node-method="filterNode"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
@node-expand="handleFieldTreeExpand"
@node-collapse="handleFieldTreeCollapse"
@node-contextmenu="handleFieldTreeContextmenuRange"
/>
<el-input
v-show="fieldTreeSearchFlag"
v-model="fieldTreeFilterText"
style="width:98%;margin: 3px;"
placeholder="搜索字段"
class="filter-tree"
/>
<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-expand="handleFieldTreeExpand"
@node-collapse="handleFieldTreeCollapse"
@node-contextmenu="handleFieldTreeContextmenuRange"
/>
<el-input
v-show="orgTreeSearchFlag"
v-model="orgTreeFilterText"
style="width:98%;margin: 3px;"
placeholder="搜索字段"
class="filter-tree"
/>
<el-tree
ref="orgTreeRef"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
:data="orgAndManTree"
:props="treeDefaultProps"
:filter-node-method="filterNode"
@node-expand="handleOrgTreeExpand"
@node-collapse="handleOrgTreeCollapse"
@node-contextmenu="handleOrgTreeContextmenuRange"
/>
<el-input
v-show="roleTreeSearchFlag"
v-model="roleTreeFilterText"
style="width:98%;margin: 3px;"
placeholder="搜索字段"
class="filter-tree"
/>
<el-tree
ref="roleTreeRef"
style="max-width: 600px; border: 1px solid gainsboro; margin: 3px;"
:data="roleTree"
:props="treeDefaultProps"
:filter-node-method="filterNode"
@node-expand="handleRoleTreeExpand"
@node-collapse="handleRoleTreeCollapse"
@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: 63%; border-bottom: 0px;">
<AssociatedFormsTinyaceRange ref="aftRange" :aft-text="controlData.control.dataRangeConditionHtml" :aft-text-copy = "controlData.control.dataRangeConditionHtmlCopy" @text-change = "aftTextChangedRange"></AssociatedFormsTinyaceRange>
<!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;">
<span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数
</div> -->
</div>
<div style="border: 1px solid gainsboro; height: 30%; padding-top: 20px;">
<ul>
<li>请从左侧面板<span style="color: red">右击</span>选择字段或选项</li>
<li>支持<span style="color: red">英文</span>模式下运算符<!-- +-*/><== --></li>
<li>参考场景</li>
<span style="margin-left: 14px;">仅可选择关联表单中年龄大于10的数据则可将数据范围设置为年龄>10</span>
</ul>
</div>
</el-main>
</el-container>
</div>
</template>
<template #footer>
<div class="dialog-footer">
<!-- <el-button @click="associatedFormsHideDialogFlag = false">取消</el-button> -->
<el-button type="primary" @click="associatedFormsHideDialogFlag = false">
<el-button @click="asfhTextCancelRange">取消</el-button>
<el-button type="primary" @click="handleDetermineRange">
确定
</el-button>
</div>
</template>
</el-dialog>
<!-- 数据填充规则弹窗 -->
<el-dialog v-model="associatedFormsFillRolesDialogFlag" title="数据填充规则" top="150px" :close-on-click-modal="false" :show-close="false" style="margin-top:70px ;min-height: 500px" width="40%" >
<template v-if="controlData.type=='associatedForms'">
<el-divider style="margin-top: 0px;" />
<div style="margin-top: -10px;"><span style="color: grey;">当选择具体数据后将按如下规则给当前表单字段填充数据 </span></div>
<el-button style="font-size: large;margin-top: 3px;" type="primary" link append-to-body="true" modal="true" @click="addFillRole"> 添加规则</el-button>
<el-divider />
<div style="height:300px;border:1px solid white;overflow-y:auto">
<template v-for="(item, index) in controlData.control.fillRoles" :key="controlData.control.fillRoles[index].id">
<AssociatedFormsFillRole v-model:left-value="controlData.control.fillRoles[index].leftValue" v-model:right-value="controlData.control.fillRoles[index].rightValue" :left-tree-source = "asfasfFieldTree[0].children" :right-tree-source = "associatedFormsCurrentFormFieldTree[0].children" :current-key="controlData.control.fillRoles[index].id" @del-Role = "delRole" ></AssociatedFormsFillRole>
</template>
</div>
</template>
<template #footer>
<div class="dialog-footer">
<!-- <el-button @click="asfhTextCancelFillRoles">取消</el-button> -->
<el-button type="primary" @click="handleDetermineFillRoles">
确定
</el-button>
</div>
</template>
</el-dialog>
<!-- 关联表单设置弹窗 liwenxuan 20240402 end -->
</template>
<style lang='scss' scoped>
<style lang='scss' scoped>
li::before {
content: "";
display: inline-block;
width: 4px;
height: 4px;
border-radius: 50%;
background-color: gray;
margin-right: 5px;
margin-left: 5px;
margin-bottom: 3.5px;
}
.sidebar-tools .el-tabs__content{
padding: 0;

79
src/widget/associatedforms/associatedFormsFillRole.vue

@ -0,0 +1,79 @@
<template>
<div style="margin-bottom: 15px; height: 40px; line-height: 40px;">
<el-tree-select
v-model="leftValue1" style="width: 290px;" :data="leftTreeSource"
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: 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" />
</div>
</template>
<script setup lang="ts">
const props = defineProps({
leftTreeSource: {
type: Object,
default() {
return {}
}
},
rightTreeSource: {
type: Object,
default() {
return {}
}
},
leftValue: {
type: String,
default() {
return {}
}
},
rightValue: {
type: String,
default() {
return {}
}
},
currentKey: {
type: String,
default() {
return {}
}
},
})
const leftValue1 = ref()
const rightValue1 = ref()
leftValue1.value = props.leftValue
rightValue1.value = props.rightValue
let emit = defineEmits(["update:leftValue", "update:rightValue","delRole"]);
function leftChanged(){
emit('update:leftValue',leftValue1)
}
function rightChanged(){
emit('update:rightValue',rightValue1)
}
function delRole(){
//alert(props.currentKey)
emit('delRole',props.currentKey)
}
</script>
<style></style>

107
src/widget/associatedforms/associatedFormsTinyace.vue

@ -0,0 +1,107 @@
<script lang='ts' setup>
import { ref, onMounted } from "vue";
import tinymce from "tinymce/tinymce";
import "tinymce/models/dom"; // tinymce 6.0.0
import "tinymce/themes/silver/theme";
import Editor from "@tinymce/tinymce-vue"; //
import { v4 as uuidv4 } from "uuid";
let onlyNumber = uuidv4().replaceAll('-','').toString(); //
/**
* 初始富文本组件
*/
const tinymceInit = {
selector: "#"+onlyNumber,
language_url: "/tinymce/langs/zh-Hans.js", // public
language: "zh-Hans", // zh-Hans.js
skin_url: "/tinymce/skins/ui/oxide", //
height: 260, //
statusbar:false,
toolbar:false,
branding: false, //Powered by TinyMCE
menubar: false, //
forced_root_block:'',
newline_behavior:"",
content_css: "/tinymce/skins/content/default/content.css", //csscsscss
auto_focus : true,
}
const props = defineProps({
aftText:{
type: String,
default(){
return {}
}
},
aftTextCopy:{
type: String,
default(){
return {}
}
},
})
let $emit = defineEmits(["textChange"]);
const tinymceHtml = ref("")
tinymceHtml.value = props.aftText
onMounted(() => {
tinymce.init({}); //
});
watch(()=>tinymceHtml.value, (val:any) => {
$emit('textChange',val);
},
{ deep: true }
)
const addIcon = (currentObject:any) =>{
tinymce.activeEditor?.execCommand('mceInsertContent', false, `<span style="margin:3px;background-color: #4189EF;border-radius: 5px; padding:3px" contenteditable="false" data-keyid= "${currentObject.id}" >${currentObject.label}</span>`);
}
const addIcon_field = (currentObject:any) =>{
tinymce.activeEditor?.execCommand('mceInsertContent', false, `<span style="margin:3px;background-color: #4189EF;border-radius: 5px; padding:3px" contenteditable="false" data-keyid= "${currentObject.id}" >${currentObject.treeAttrs.show}</span>`);
}
const addIcon_org = (currentObject:any) =>{
let id = "orgOrPerson:"+currentObject.id
tinymce.activeEditor?.execCommand('mceInsertContent', false, `<span style="margin:3px;background-color: #4189EF;border-radius: 5px; padding:3px" contenteditable="false" data-keyid= "${id}" >${currentObject.label}</span>`);
}
//
const handelCancel = (associatedFormsHideDialogTextCopy:any) =>{
tinymceHtml.value = associatedFormsHideDialogTextCopy
}
const tinymceReInit = ()=>{
let str:string = props.aftTextCopy
}
const focusEditor = ()=>{
tinymce.EditorManager.get(onlyNumber)?.focus(true)
}
defineExpose({
tinymceHtml,
addIcon,
addIcon_org,
addIcon_field,
handelCancel,
tinymceReInit,
focusEditor,
})
</script>
<template >
<div >
<editor :id="onlyNumber" v-model="tinymceHtml" :init="tinymceInit"></editor>
</div>
</template>
<style lang='scss' scoped>
</style>

108
src/widget/associatedforms/associatedFormsTinyaceRange.vue

@ -0,0 +1,108 @@
<script lang='ts' setup>
import { ref, onMounted } from "vue";
import tinymce from "tinymce/tinymce";
import "tinymce/models/dom"; // tinymce 6.0.0
import "tinymce/themes/silver/theme";
import Editor from "@tinymce/tinymce-vue"; //
import { v4 as uuidv4 } from "uuid";
let onlyNumber = uuidv4().replaceAll('-','').toString(); //
/**
* 初始富文本组件
*/
const tinymceInit = {
selector: "#"+onlyNumber,
language_url: "/tinymce/langs/zh-Hans.js", // public
language: "zh-Hans", // zh-Hans.js
skin_url: "/tinymce/skins/ui/oxide", //
height: 260, //
statusbar:false,
toolbar:false,
branding: false, //Powered by TinyMCE
menubar: false, //
forced_root_block:'',
newline_behavior:"",
content_css: "/tinymce/skins/content/default/content.css", //csscsscss
auto_focus : true,
}
const props = defineProps({
aftText:{
type: String,
default(){
return {}
}
},
aftTextCopy:{
type: String,
default(){
return {}
}
},
})
let $emit = defineEmits(["textChange"]);
const tinymceHtml = ref("")
tinymceHtml.value = props.aftText
onMounted(() => {
tinymce.init({}); //
});
watch(()=>tinymceHtml.value, (val:any) => {
$emit('textChange',val);
},
{ deep: true }
)
const addIcon = (currentObject:any) =>{
tinymce.activeEditor?.execCommand('mceInsertContent', false, `<span style="margin:3px;background-color: #4189EF;border-radius: 5px; padding:3px" contenteditable="false" data-keyid= "${currentObject.id}" >${currentObject.label}</span>`);
}
const addIcon_field = (currentObject:any) =>{
tinymce.activeEditor?.execCommand('mceInsertContent', false, `<span style="margin:3px;background-color: #4189EF;border-radius: 5px; padding:3px" contenteditable="false" data-keyid= "${currentObject.id}" >${currentObject.treeAttrs.show}</span>`);
}
const addIcon_org = (currentObject:any) =>{
let id = "orgOrPerson:"+currentObject.id
tinymce.activeEditor?.execCommand('mceInsertContent', false, `<span style="margin:3px;background-color: #4189EF;border-radius: 5px; padding:3px" contenteditable="false" data-keyid= "${id}" >${currentObject.label}</span>`);
}
//
const handelCancel = (associatedFormsHideDialogTextCopy:any) =>{
tinymceHtml.value = associatedFormsHideDialogTextCopy
}
const tinymceReInit = ()=>{
let str:string = props.aftTextCopy
}
const focusEditor = ()=>{
tinymce.EditorManager.get(onlyNumber)?.focus(true)
}
defineExpose({
tinymceHtml,
addIcon,
addIcon_org,
addIcon_field,
handelCancel,
tinymceReInit,
focusEditor,
})
</script>
<template >
<div >
<editor :id="onlyNumber" v-model="tinymceHtml" :init="tinymceInit"></editor>
</div>
</template>
<style lang='scss' scoped>
</style>
Loading…
Cancel
Save