Browse Source

详情 基础form表单 组件修改优化

master
陈薪名 1 year ago
parent
commit
cc08afc16a
  1. 14
      src/components/BasicForm/src/BasicForm.vue
  2. 1
      src/components/Detail/src/Detail.vue

14
src/components/BasicForm/src/BasicForm.vue

@ -102,6 +102,12 @@ const props = defineProps({
required: true, required: true,
default: null default: null
}, },
//
detailData: {
type: Object,
required: true,
default: null
}
// // // //
// masterParmas: { // masterParmas: {
// type: Object, // type: Object,
@ -127,14 +133,14 @@ const formSchema = ref(props.formAllSchemas?.formSchema)
// type type=tableForm // type type=tableForm
// searchCondition // searchCondition
const searchTableRef = ref() const searchTableRef = ref()
const opensearchTable = (formField, searchField, searchTitle, searchAllSchemas, searchPage, type, row, searchCondition) => { const opensearchTable = (formField, searchField, searchTitle, searchAllSchemas, searchPage, searchCondition, type, row ) => {
const _searchCondition = {} const _searchCondition = {}
// //
if (searchCondition && searchCondition.length > 0) { if (searchCondition && searchCondition.length > 0) {
searchCondition.forEach(item => { searchCondition.forEach(item => {
// // row
if (item.isMainValue) { if (item.isMainValue) {
_searchCondition[item.key] = formRef.value.formModel[item.value] _searchCondition[item.key] = formRef.value.formModel[item.value]?formRef.value.formModel[item.value]:props.detailData[item.value]
} else { } else {
_searchCondition[item.key] = item.value _searchCondition[item.key] = item.value
} }
@ -313,9 +319,9 @@ const inpuFocus = (headerItem, row, index) => {
headerItem.tableForm.searchTitle, headerItem.tableForm.searchTitle,
headerItem.tableForm.searchAllSchemas, headerItem.tableForm.searchAllSchemas,
headerItem.tableForm.searchPage, headerItem.tableForm.searchPage,
headerItem.tableForm.searchCondition,
'tableForm', 'tableForm',
row, row,
headerItem.tableForm.searchCondition
) )
} }
</script> </script>

1
src/components/Detail/src/Detail.vue

@ -60,6 +60,7 @@
:apiUpdate="apiUpdate" :apiUpdate="apiUpdate"
:apiCreate="apiCreate" :apiCreate="apiCreate"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:detailData="detailData"
/> />
</div> </div>
</template> </template>

Loading…
Cancel
Save