Browse Source

关联表单v0.8 13改为活数据

lwx_v8
liwenxuan 2 years ago
parent
commit
f1b398d04c
  1. 1
      src/components/DesignForm/assembly/index.ts
  2. 144
      src/components/DesignForm/formControlAttr.vue

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

@ -604,6 +604,7 @@ const selectOption: any = [
formid: '',
dataRangeConditionHtml:'',
dataRangeConditionHtmlCopy:'',
saveFlag: false,
},
config: {}
}

144
src/components/DesignForm/formControlAttr.vue

@ -642,6 +642,14 @@
vIf: state.isSearch,
vShow: ['associatedForms']
},
{
label: '数据填充规则',
value: config.associatedForms,
path: 'config.associatedForms',
type: 'associatedForms_FillRoles',
vIf: state.isSearch,
vShow: ['associatedForms']
},
{
label: '轮播图设置',
value: config.carousel,
@ -1770,13 +1778,16 @@ let aft = ref();
const aftRange = ref();
function getAssociatedFormsCurrentFieldTree() {
return request({
url: '/javasys/lowCode/AssociatedForms/getFieldTree',
method: 'post',
data: {
cfid:'13'
//cfid:'13'
cfid:props.customerformid
},
});
}
function getAssociatedFormsOrgAndManTree() {
@ -1798,18 +1809,35 @@ function getAssociatedFormsRoleTree() {
method: 'post',
});
}
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
getAssociatedFormsCurrentFieldTree().then(({ data }) => {
let resData = ref(data.children)
//let rootid_ = data.value.label
associatedFormsCurrentFormFieldTree.value = [{
id: 'rootid_'+data.label,
label: '当前表单',
children: [...resData.value],
treeAttrs: data.treeAttrs,
}]
});
getAssociatedFormsCurrentFieldTree().then(({ data }) => {
if(data.id==="cfid为空"){
//alert("cfid")
}else{
let resData = ref(data.children)
//let rootid_ = data.value.label
associatedFormsCurrentFormFieldTree.value = [{
id: 'rootid_'+data.label,
label: '当前表单',
children: [...resData.value],
treeAttrs: data.treeAttrs,
}]
}
});
const customerFormTree = ref<Tree[]>()
getCustomerFormList().then(({ data }) => {
@ -1948,21 +1976,43 @@ const associatedFormsDataRangeDialogFlag = ref(false)
//
function associatedFormsHideDialoghandle(){
associatedFormsHideDialogFlag.value = true
controlData.value.control.hideConditionHtmlCopy = controlData.value.control.hideConditionHtml
nextTick(() => {
aft.value.focusEditor()
})
/* if(controlData.value.control.saveFlag===true){
associatedFormsHideDialogFlag.value = true
controlData.value.control.hideConditionHtmlCopy = controlData.value.control.hideConditionHtml
//alert("")
nextTick(() => {
aft.value.focusEditor()
})
}else{ */
associatedFormsHideDialogFlag.value = true
controlData.value.control.hideConditionHtmlCopy = controlData.value.control.hideConditionHtml
nextTick(() => {
aft.value.focusEditor()
})
//}
}
function associatedFormsDataRangeDialoghandle(){
associatedFormsDataRangeDialogFlag.value = true
controlData.value.control.dataRangeConditionHtmlCopy = controlData.value.control.dataRangeConditionHtml
/* if(controlData.value.control.saveFlag===true){
associatedFormsDataRangeDialogFlag.value = true
controlData.value.control.dataRangeConditionHtmlCopy = controlData.value.control.dataRangeConditionHtml
//alert("")
nextTick(() => {
aftRange.value.focusEditor()
})
}else{ */
associatedFormsDataRangeDialogFlag.value = true
controlData.value.control.dataRangeConditionHtmlCopy = controlData.value.control.dataRangeConditionHtml
nextTick(() => {
aftRange.value.focusEditor()
})
//}
nextTick(() => {
aftRange.value.focusEditor()
})
}
@ -2497,7 +2547,7 @@ const loadNextPage = () => {
<div style="margin-top: 25px;margin-left: -60px;">
<el-tree-select
v-model="controlData.control.formid"
style="width: 280px;"
style="width: 260px;"
:data="customerFormTree[0].children"
check-strictly
:render-after-expand="false"
@ -2511,6 +2561,14 @@ const loadNextPage = () => {
<div style="width:100%; cursor: pointer;" v-html="controlData.control.dataRangeConditionHtml" @click="associatedFormsDataRangeDialoghandle"></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"
@ -3231,6 +3289,7 @@ const loadNextPage = () => {
<el-tree
ref="fieldTreeRef"
node-key="id"
empty-text="请先保存当前表单,若需要展示本次编辑表单添加的字段,也需先保存"
:data="associatedFormsCurrentFormFieldTree"
:props="treeDefaultProps"
:filter-node-method="filterNode"
@ -3319,6 +3378,19 @@ const loadNextPage = () => {
<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"
@ -3329,16 +3401,14 @@ const loadNextPage = () => {
<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"
@ -3411,6 +3481,30 @@ const loadNextPage = () => {
<!-- 数据填充规则弹窗 -->
<!-- <el-dialog v-model="associatedFormsFillRolesDialogFlag" 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'">
fdsaafsdfsda
</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>

Loading…
Cancel
Save