Browse Source

表单 详情 查询页 table 组件修改

master
陈薪名 1 year ago
parent
commit
4334710e35
  1. 13
      src/components/BasicForm/src/BasicForm.vue
  2. 4
      src/components/Detail/src/Detail.vue
  3. 10
      src/components/SearchTable/src/SearchTable.vue
  4. 11
      src/components/TableForm/src/TableForm.vue

13
src/components/BasicForm/src/BasicForm.vue

@ -210,18 +210,19 @@ const formSchema = ref(props.formAllSchemas.formSchema)
/** 弹层操作 */
// formField form
// searchField
// type type=tableForm
const searchTableRef = ref()
const opensearchTable = (formField, searchField) => {
const opensearchTable = (formField, searchField, type, row) => {
const _searchTableParamsObject:any = props.searchTableParams.find((item:any) => (item.formField == formField))
const _searchTableTitle = _searchTableParamsObject.searchTableTitle
const _searchTableAllSchemas = _searchTableParamsObject.searchTableAllSchemas
const _searchTablePage = _searchTableParamsObject.searchTablePage
searchTableRef.value.open(_searchTableTitle, _searchTableAllSchemas, _searchTablePage, formField, searchField)
searchTableRef.value.open(_searchTableTitle, _searchTableAllSchemas, _searchTablePage, formField, searchField, type, row)
}
//
// val row
const searchTableSuccess = (formField,searchField, val) => {
emit('searchTableSuccess', formField, searchField, val, formRef.value )
const searchTableSuccess = (formField,searchField, val, type, row) => {
emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row )
}
/** 打开弹窗 */
@ -357,8 +358,8 @@ const handleAddTable = () => {
emit('handleAddTable')
}
//
const inpuFocus = (headerItem) => {
opensearchTable()
const inpuFocus = (headerItem, row, index) => {
opensearchTable(headerItem.field, 'poNumber', 'tableForm', row)
}
</script>
<style lang="scss" scoped>

4
src/components/Detail/src/Detail.vue

@ -155,7 +155,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
tableId: row.id,
tableName: tableName,
}
getList() //
if(!props.isBasic) getList() //
isShowDrawer.value = true
if (row) {
detailLoading.value = true
@ -190,8 +190,8 @@ const remarksSubmitScuess = async (remark) => {
//
const getChangeRecordList = async () => {
changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data)
}
const { tableObject, tableMethods } = useTable({
getListApi: props.detailApi?.getDetasListPage // APIID
})

10
src/components/SearchTable/src/SearchTable.vue

@ -39,13 +39,17 @@ const searchSchema = ref()
const tableColumns = ref()
const formFieldRef = ref()
const searchFieldRef = ref()
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any ) => {
const typeRef = ref()
const rowRef = ref()
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any, type: any, row: any ) => {
searchDialogVisible.value = true
formFieldRef.value = formField
searchFieldRef.value = searchField
searchSchema.value = allSchemas.searchSchema
tableColumns.value = allSchemas.tableColumns
getPage.value = getApiPage
typeRef.value = type
rowRef.value = row
// dialogTitle.value = t('action.' + type)
dialogTitle.value = titleName
const {tableObject, tableMethods } = useTable({
@ -75,11 +79,9 @@ const submitForm = async () => {
return
}
try {
searchDialogVisible.value = false
//
emit('searchTableSuccess', formFieldRef.value, searchFieldRef.value, selections)
searchDialogVisible.value = false
emit('searchTableSuccess', formFieldRef.value, searchFieldRef.value, selections, typeRef.value, rowRef.value)
} finally {
formLoading.value = false
}

11
src/components/TableForm/src/TableForm.vue

@ -40,12 +40,12 @@
/>
<el-table-column
v-slot="{ row }"
v-for="headerItem in tableFields"
v-for="(headerItem,index) in tableFields"
:key="headerItem"
:fixed="headerItem.tableForm?.fixed"
:label="headerItem.label" :prop="headerItem.field"
:align="headerItem?.tableForm?.align || 'center'"
:sortable="headerItem?.tableForm?.sortable || ''"
:sortable="headerItem?.tableForm?.sortable || false"
:width="headerItem?.tableForm?.width || '200'"
:min-width="headerItem?.tableForm?.minWidth || 'auto'">
<el-form
@ -65,7 +65,7 @@
:placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label"
:disabled="itemIsDisabled(headerItem, row)"
style="width: 100%;"
@focus="inpuFocus(headerItem)"
@click="inpuFocus(headerItem,row,index)"
/>
</el-form-item>
<!-- 金额输入框 -->
@ -387,10 +387,9 @@ const handleAddTable = () => {
emit('handleAddTable')
}
//
const inpuFocus = (headerItem)=>{
const inpuFocus = (headerItem, row, index)=>{
if(headerItem?.tableForm?.isInpuFocusShow){
emit('inpuFocus')
emit('inpuFocus', headerItem, row, index)
}
}

Loading…
Cancel
Save