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: '', formid: '',
dataRangeConditionHtml:'', dataRangeConditionHtml:'',
dataRangeConditionHtmlCopy:'', dataRangeConditionHtmlCopy:'',
saveFlag: false,
}, },
config: {} config: {}
} }

144
src/components/DesignForm/formControlAttr.vue

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

Loading…
Cancel
Save