From a8ebb2518636b05332532dde5dc8076ea7b76a3c Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 22 Nov 2023 13:28:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 13 ++++++--- src/components/Form/src/Form.vue | 11 +++++--- src/components/Search/src/Search.vue | 2 +- .../SearchTable/src/SearchTable.vue | 25 +++++++++++++---- src/hooks/web/useTable.ts | 1 + .../count/countPlanMain/countPlanMain.data.ts | 27 +++++++++++++++++++ .../countManage/count/countPlanMain/index.vue | 23 ++++++++-------- 7 files changed, 78 insertions(+), 24 deletions(-) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index a34fc9985..bdc79ae0e 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -7,7 +7,11 @@ :schema="formSchema" :is-col="true" @opensearchTable="opensearchTable" - /> + > + +
{ +const opensearchTable = (formField, searchField, searchTitle, searchAllSchemas, searchPage, searchCondition,multiple, type, row ) => { const _searchCondition = {} // 判断查询条件中,是否存在指向主表的数据 if (searchCondition && searchCondition.length > 0) { @@ -157,7 +161,7 @@ const opensearchTable = (formField, searchField, searchTitle, searchAllSchemas, const _searchTableTitle = searchTitle const _searchTableAllSchemas = searchAllSchemas const _searchTablePage = searchPage - searchTableRef.value.open(_searchTableTitle, _searchTableAllSchemas, _searchTablePage, formField, searchField, type, row, _searchCondition) + searchTableRef.value.open(_searchTableTitle, _searchTableAllSchemas, _searchTablePage, formField, searchField,multiple, type, row, _searchCondition) } // 弹层确定返回所选数据 // val : 弹层列表row 数据 @@ -316,6 +320,8 @@ const handleAddTable = () => { } // 输入框聚焦 const inpuFocus = (headerItem, row, index) => { + console.log(headerItem.tableForm.multiple); + opensearchTable( headerItem.field, headerItem.tableForm.searchField, @@ -323,6 +329,7 @@ const inpuFocus = (headerItem, row, index) => { headerItem.tableForm.searchAllSchemas, headerItem.tableForm.searchPage, headerItem.tableForm.searchCondition, + headerItem.tableForm.multiple, 'tableForm', row, ) diff --git a/src/components/Form/src/Form.vue b/src/components/Form/src/Form.vue index d9430aca4..7fb04d062 100644 --- a/src/components/Form/src/Form.vue +++ b/src/components/Form/src/Form.vue @@ -120,8 +120,8 @@ export default defineComponent({ return unref(elFormRef) as ComponentRef } - const opensearchTable = (field, searchField,searchTitle,searchAllSchemas, searchPage, searchCondition) => { - emit('opensearchTable',field, searchField, searchTitle, searchAllSchemas, searchPage, searchCondition) + const opensearchTable = (field, searchField,searchTitle,searchAllSchemas, searchPage, searchCondition,multiple) => { + emit('opensearchTable',field, searchField, searchTitle, searchAllSchemas, searchPage, searchCondition,multiple) } expose({ @@ -226,14 +226,17 @@ export default defineComponent({ formItemSlotsSearchList[item.field] = () => { return ( <> - + + + { opensearchTable( item.field, item?.componentProps?.searchField, item?.componentProps?.searchTitle, item?.componentProps?.searchAllSchemas, item?.componentProps?.searchPage, - item?.componentProps?.searchCondition + item?.componentProps?.searchCondition, + item?.componentProps?.multiple, )}}/> ) diff --git a/src/components/Search/src/Search.vue b/src/components/Search/src/Search.vue index a71bb48e9..78865acf7 100644 --- a/src/components/Search/src/Search.vue +++ b/src/components/Search/src/Search.vue @@ -170,7 +170,7 @@ onMounted(() => {}) } .search ::v-deep(.el-form-item:nth-last-child(1)) { margin-right: 0px; - width: 16%; + width: auto; .el-form-item__content { flex: 1; >div{ diff --git a/src/components/SearchTable/src/SearchTable.vue b/src/components/SearchTable/src/SearchTable.vue index 1575a41a9..c173c536f 100644 --- a/src/components/SearchTable/src/SearchTable.vue +++ b/src/components/SearchTable/src/SearchTable.vue @@ -23,6 +23,8 @@ v-model:currentPage="tableObjectRef.currentPage" v-model:sort="tableObjectRef.sort" :selection="true" + :reserveSelection="true" + row-key="id" />