Browse Source

关联表单组件下拉选项--新增可提交

lwx_14
liwenxuan 1 year ago
parent
commit
379190f070
  1. 1
      src/components/DesignForm/app/formPage.vue
  2. 1
      src/components/DesignForm/public/form/formGroup.vue
  3. 11
      src/widget/associatedforms/associatedForms.vue
  4. 7
      src/widget/associatedforms/index.vue

1
src/components/DesignForm/app/formPage.vue

@ -690,6 +690,7 @@ const appFormSubmit = (params = {}) => {
}
return
}
console.log(params)
validate((valid: boolean, fields: any) => {
if (valid) {
const formatParams = Object.assign({}, fields, params)

1
src/components/DesignForm/public/form/formGroup.vue

@ -353,6 +353,7 @@ const linksIf = (obj: FormList) => {
//
const injectBtnEvent:any = inject(constFormBtnEvent)
const clickBtn = (control: any) => {
console.log(control)
// 0: '',
// 1: '',
// 2: '',

11
src/widget/associatedforms/associatedForms.vue

@ -2,7 +2,7 @@
<!-- <el-input v-model="input" style="width: 240px" placeholder="" /> -->
<el-select v-model="value1" placeholder="请选择" style="width: 240px">
<el-select v-model="value1" placeholder="请选择" style="width: 240px" @change="asfValueChanged">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
@ -34,7 +34,7 @@ const props = withDefaults(
}>(),
{}
)
const emits = defineEmits(["valueChanged"]);
const value1 = ref('')
const options = ref([])
@ -42,13 +42,18 @@ onMounted(()=>{
console.log(props.data.control)
if(props.data.control.formid!=null&&props.data.control.formid!=""){
getAsfDataTitles().then(({ data }) => {
console.log(data)
//console.log(data)
options.value = data
});
}
})
function asfValueChanged(){
emits("valueChanged",value1.value)
}
function getAsfDataTitles() {
let dataTitle = ''
if(props.tablekey.dataTitle!=null&&props.tablekey.dataTitle.length>0){

7
src/widget/associatedforms/index.vue

@ -14,7 +14,7 @@
<input v-model="value" type="hidden" >
</el-form-item>
<AssociatedForms :data="props.data" :form-props="formProps" :tablekey="props.tablekey"></AssociatedForms>
<AssociatedForms :data="props.data" :form-props="formProps" :tablekey="props.tablekey" @value-changed="valueChanged"></AssociatedForms>
</template>
<script lang='ts' setup>
import AssociatedForms from './associatedForms.vue';
@ -154,7 +154,12 @@ const formatCustomRules = () => {
const valueChanged = (val:any) =>{
console.log("关联表单选择--->",val)
value.value = val
}

Loading…
Cancel
Save