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,
default: null
},
//
detailData: {
type: Object,
required: true,
default: null
}
// //
// masterParmas: {
// type: Object,
@ -127,14 +133,14 @@ const formSchema = ref(props.formAllSchemas?.formSchema)
// type type=tableForm
// searchCondition
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 = {}
//
if (searchCondition && searchCondition.length > 0) {
searchCondition.forEach(item => {
//
// row
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 {
_searchCondition[item.key] = item.value
}
@ -313,9 +319,9 @@ const inpuFocus = (headerItem, row, index) => {
headerItem.tableForm.searchTitle,
headerItem.tableForm.searchAllSchemas,
headerItem.tableForm.searchPage,
headerItem.tableForm.searchCondition,
'tableForm',
row,
headerItem.tableForm.searchCondition
)
}
</script>

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

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

Loading…
Cancel
Save