Browse Source

关联表单优化-app

lwx_v9
liwenxuan 1 year ago
parent
commit
c18afd50bf
  1. 4
      src/components/DesignForm/assembly/index.ts
  2. 136
      src/components/DesignForm/formControlAttr.vue

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

@ -99,6 +99,7 @@ export default [
control: { control: {
modelValue: '', modelValue: '',
glxxsz: [], glxxsz: [],
optionsValue3Formid:'',
}, },
options: selectOption, // 下拉选项数据集合 options: selectOption, // 下拉选项数据集合
config: config, config: config,
@ -116,6 +117,7 @@ export default [
control: { control: {
modelValue: [], modelValue: [],
glxxszForCheckBox: [], glxxszForCheckBox: [],
optionsValue3Formid:'',
}, },
options: selectOption, options: selectOption,
config: config, config: config,
@ -134,6 +136,7 @@ export default [
modelValue: '', modelValue: '',
appendToBody: true, appendToBody: true,
glxxsz: [], glxxsz: [],
optionsValue3Formid:'',
}, },
options: selectOption, options: selectOption,
config: config, config: config,
@ -700,6 +703,7 @@ export default [
dataRangeConditionHtml: '', dataRangeConditionHtml: '',
dataRangeConditionHtmlCopy: '', dataRangeConditionHtmlCopy: '',
saveFlag: false, saveFlag: false,
asfasfLabel:'',
fillRoles: [ fillRoles: [
{ {
leftValue: '', leftValue: '',

136
src/components/DesignForm/formControlAttr.vue

@ -620,18 +620,18 @@
vShow: ['component'] vShow: ['component']
}, },
{ {
label: '隐藏条件', label: '关联表单',
value: config.associatedForms, value: config.associatedForms,
path: 'config.associatedForms', path: 'config.associatedForms',
type: 'associatedForms_hide', type: 'associatedForms_form',
vIf: state.isSearch, vIf: state.isSearch,
vShow: ['associatedForms'] vShow: ['associatedForms']
}, },
{ {
label: '关联表单', label: '隐藏条件',
value: config.associatedForms, value: config.associatedForms,
path: 'config.associatedForms', path: 'config.associatedForms',
type: 'associatedForms_form', type: 'associatedForms_hide',
vIf: state.isSearch, vIf: state.isSearch,
vShow: ['associatedForms'] vShow: ['associatedForms']
}, },
@ -1906,9 +1906,22 @@ function getAsfasfFieldTree() {
}); });
} }
function getAsfasfFieldTreeOptionsValue3() {
return request({
url: '/javasys/lowCode/AssociatedForms/getFieldTree',
method: 'post',
data: {
//cfid:'13'
cfid:controlData.value.control.optionsValue3Formid
},
});
}
const asfasfFieldTree = ref<Tree[]>() const asfasfFieldTree = ref<Tree[]>()
const asfasfFieldTreeOptionsValue3 = ref<Tree[]>()
function formidChanged(){ function formidChanged(){
if(controlData.value.control.formid===''){ if(controlData.value.control.formid===''){
@ -1928,6 +1941,31 @@ function formidChanged(){
treeAttrs: data.treeAttrs, treeAttrs: data.treeAttrs,
}] }]
} }
controlData.value.control.asfasfLabel = data.label
});
}
}
function formidChangedOptionsValue3(){
if(controlData.value.control.optionsValue3Formid===''){
}else{
getAsfasfFieldTreeOptionsValue3().then(({ data }) => {
if(data.id==="cfid为空"){
//alert("cfid")
}else{
let resData = ref(data.children)
//let rootid_ = data.value.label
asfasfFieldTreeOptionsValue3.value = [{
id: 'rootid_'+data.label,
label: '关联的表单-'+data.label,
children: [...resData.value],
treeAttrs: data.treeAttrs,
}]
}
}); });
} }
} }
@ -2263,6 +2301,14 @@ function delRole(id:String){
} }
} }
} }
const associatedFormsChooseDialogFlag = ref(false)
function chooseAssociatedForm(){
associatedFormsChooseDialogFlag.value = true
}
function handleDetermineAssociatedFormsChooseDialog(){
associatedFormsChooseDialogFlag.value = false
}
//liwenxuan20240403 associatedForms end //liwenxuan20240403 associatedForms end
@ -2373,6 +2419,14 @@ function deleteRowForGlxxsz(row: { id: any }){
} }
/* */ /* */
const optionsValue3SettingDialogOpenFlag = ref(false)
function optionsValue3Setting(){
optionsValue3SettingDialogOpenFlag.value = true
}
function handleDetermineoptionsValue3(){
optionsValue3SettingDialogOpenFlag.value = false
}
//liwenxuan20240426 end //liwenxuan20240426 end
@ -2842,18 +2896,8 @@ const loadNextPage = () => {
<el-row v-else-if="item.type === 'associatedForms_form'"> <el-row v-else-if="item.type === 'associatedForms_form'">
<div style="margin-top: 25px;margin-left: -60px;"> <el-button type="primary" link style="display:block;cursor: pointer;" @click="chooseAssociatedForm">{{ controlData.control.asfasfLabel==''?'选择关联表单':controlData.control.asfasfLabel }}</el-button>
<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>
<el-row v-else-if="item.type === 'associatedForms_dataRange'"> <el-row v-else-if="item.type === 'associatedForms_dataRange'">
@ -3035,6 +3079,7 @@ const loadNextPage = () => {
@change="controlData.config.optionsFun = ''" @change="controlData.config.optionsFun = ''"
> >
<el-option :value="0" label="固定选项" /> <el-option :value="0" label="固定选项" />
<el-option :value="3" label="系统表单字段"/>
<el-option :value="1" label="数据源" /> <el-option :value="1" label="数据源" />
<el-option :value="2" label="接口字典" /> <el-option :value="2" label="接口字典" />
</el-select> </el-select>
@ -3064,6 +3109,9 @@ const loadNextPage = () => {
<el-button @click="addSelectOption">{{ controlData.type === 'cascader' ? '编辑' : '新增' }}</el-button> <el-button @click="addSelectOption">{{ controlData.type === 'cascader' ? '编辑' : '新增' }}</el-button>
</el-form-item> </el-form-item>
</template> </template>
<template v-if="controlData.config.optionsType === 3">
<el-button style="padding-top: 5px;" type="primary" link append-to-body="true" modal="true" @click="optionsValue3Setting" >选择系统表单字段</el-button>
</template>
<template v-else> <template v-else>
<el-form-item class="form_cont"> <el-form-item class="form_cont">
<el-input <el-input
@ -3582,6 +3630,32 @@ const loadNextPage = () => {
<el-dialog v-model="associatedFormsChooseDialogFlag" class="glxxsztc" top="150px" :close-on-click-modal="false" title="选择关联表单" :show-close="false" style="margin-top:70px;" width="50%" >
<template v-if="controlData.type=='associatedForms'">
<div style="display:flex;margin-bottom: 2px;margin-top:28px"><span style="font-size: larger;margin-left: 35px;margin-right: 15px;">请选择表单</span>
<el-tree-select
v-model="controlData.control.formid"
style="width: 390px;"
:data="customerFormTree[0].children"
check-strictly
:render-after-expand="false"
filterable
@change="formidChanged"
/>
</div>
<!-- asfasfFieldTreeOptionsValue3 -->
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleDetermineAssociatedFormsChooseDialog">
确定
</el-button>
</div>
</template>
</el-dialog>
<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%" > <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'"> <template v-if="controlData.type=='associatedForms'">
@ -3938,7 +4012,37 @@ const loadNextPage = () => {
</template> </template>
</el-dialog> </el-dialog>
<!-- 关联选项设置弹窗 liwenxuan 20240426 end --> <!-- 关联选项设置弹窗 liwenxuan 20240426 end -->
<!-- 单选下拉多选选项来源value3--系统表单字段 start-->
<el-dialog v-model="optionsValue3SettingDialogOpenFlag" class="glxxsztc" top="150px" :close-on-click-modal="false" title="选择表单字段" :show-close="false" style="margin-top:70px;" width="50%" >
<template v-if="controlData.type=='radio'||controlData.type=='select'||controlData.type=='checkbox'">
<div style="display:flex;margin-bottom: 20px;margin-top:20px"><span style="font-size: larger;margin-left: 35px;margin-right: 15px;">请选择表单</span>
<el-tree-select
v-model="controlData.control.optionsValue3Formid"
style="width: 390px;"
:data="customerFormTree[0].children"
check-strictly
:render-after-expand="false"
filterable
@change="formidChangedOptionsValue3"
/>
</div>
<!-- <div style="display:flex"><span style="font-size: larger;margin-left: 35px;margin-right: 15px;">当开关关闭时显示</span>
<el-tree-select v-model="controlData.control.glxxszSwitch[1].showFields" style="width: 60%" :data="associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf[0].children" multiple />
</div> -->
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleDetermineoptionsValue3">
确定
</el-button>
</div>
</template>
</el-dialog>
<!-- 单选下拉多选选项来源value3--系统表单字段 end-->
</template> </template>
<style lang='scss' scoped> <style lang='scss' scoped>

Loading…
Cancel
Save