diff --git a/PC/InterFace.Dash/src/components/commonTabel-drawer/index.vue b/PC/InterFace.Dash/src/components/commonTabel-drawer/index.vue index f0bd575..60c0de5 100644 --- a/PC/InterFace.Dash/src/components/commonTabel-drawer/index.vue +++ b/PC/InterFace.Dash/src/components/commonTabel-drawer/index.vue @@ -75,12 +75,14 @@ v-if="showDetailColumnsSet" class="rowDropNotHideItem" @click="columnsSettingHandle()" + size="mini" >字段设置 - + size="mini" + >筛选 + + + + + { @@ -330,36 +356,24 @@ export default { return this.dropdownTabsData } else { // 正常普通 详情,明细,汇总 - if (Object.keys(this.propsData).length != 0) { + // if (Object.keys(this.propsData).length != 0) { + if (Object.keys(this.propsData)) { this.initDropdownTabsData = [{ - label: "详情", - name: 'xq' - }, - { + label: "详情", + name: 'xq' + }] + // 明细可以为空数组,前端分页使用 + if(this.propsData.details){ + this.initDropdownTabsData.push({ label: "明细", name: 'mx' - }, - { + }) + } + if(this.propsData.summaryDetails && this.propsData.summaryDetails.length > 0){ + this.initDropdownTabsData.push({ label: "汇总", name: 'hz' - }] - if (this.propsData.details == undefined || !this.propsData.details.length) { - this.initDropdownTabsData = [{ - label: "详情", - name: 'xq' - }] - return this.initDropdownTabsData - } - if (this.propsData.summaryDetails == undefined || !this.propsData.summaryDetails.length ) { - this.initDropdownTabsData = [{ - label: "详情", - name: 'xq' - }, - { - label: "明细", - name: 'mx' - }] - return this.initDropdownTabsData + }) } } return this.initDropdownTabsData @@ -402,7 +416,15 @@ export default { label: "汇总", name: 'hz' } - ] + ], + detailFiltersVisible:false,//筛选显示 + filterActionOptions:[{ + value: '==', + label: '等于' + }, { + value: '!=', + label: '不等于' + }], } }, methods: { @@ -416,9 +438,17 @@ export default { }, // 明细-筛选 detailFiltersHandle(){ - + this.detailFiltersVisible = !this.detailFiltersVisible + }, + // 明细-全面筛选组件内部显示/隐藏更改触发,同步当前的showSearchOverall值 + getShowSearchOverall(val){ + this.detailFiltersVisible = val || false + }, + // 明细-全面筛选所有按钮操作集 + detailFiltersSearch(options){ + this.$emit('detailFiltersSearch', options) }, - // 关闭字段设置 + // 明细-关闭字段设置 closeRowDrop() { this.rowDropVisible = false }, diff --git a/PC/InterFace.Dash/src/components/commonTabel-drawer/style/index.scss b/PC/InterFace.Dash/src/components/commonTabel-drawer/style/index.scss index 2856abf..4451c6f 100644 --- a/PC/InterFace.Dash/src/components/commonTabel-drawer/style/index.scss +++ b/PC/InterFace.Dash/src/components/commonTabel-drawer/style/index.scss @@ -124,4 +124,14 @@ .currenTabel-drawer-mx-header{ text-align: right; padding: 0 10px 10px 0; +} + +.detailFiltersPopPage{ + position: absolute; + right: 0; + left: 0; + height: 240px; + .fullPageCover{ + height: calc(100vh - 300px) !important; + } } \ No newline at end of file diff --git a/PC/InterFace.Dash/src/components/searchOverall/index.vue b/PC/InterFace.Dash/src/components/searchOverall/index.vue index 4a7255d..2a2d7e9 100644 --- a/PC/InterFace.Dash/src/components/searchOverall/index.vue +++ b/PC/InterFace.Dash/src/components/searchOverall/index.vue @@ -70,7 +70,7 @@ { if (res.details) { - // 前端分页处理 this.tableDataDetails = JSON.parse(JSON.stringify(res)) - let linshiTableDataDetails = JSON.parse(JSON.stringify(this.tableDataDetails)) - this.totalCountDetails = res.details.length - // 删除除当前页面最大数以外数据 - linshiTableDataDetails.details.splice(this.MaxResultCountDetails,this.totalCountDetails); - // this.oldSkipCountDetails = 1 - this.propsData = linshiTableDataDetails + // 前端分页处理 + this.propsData = this.detailListPageFromFE(res) } else { this.propsData = res } @@ -125,6 +122,14 @@ export const tableMixins = { this.Loading.DrawerLoading = false }) }, + // 前端分页处理 + detailListPageFromFE(data){ + let linshiTableDataDetails = JSON.parse(JSON.stringify(data)) + this.totalCountDetails = data.details.length + // 删除除当前页面最大数以外数据 + linshiTableDataDetails.details.splice(this.MaxResultCountDetails,this.totalCountDetails); + return linshiTableDataDetails + }, // 明细 分页 接收分页组件emit改变每页最大页数 alterResultCountDetails(val) { this.Loading.DrawerLoading = true @@ -275,6 +280,43 @@ export const tableMixins = { if(callback)callback() // this.getSupplierByCodesHandle_table() }, + // 筛选前端查询 + detailFiltersSearch(options){ + let _item = options.item; + // 重置 + if(_item.name == 'reset' || _item.name == 'moreList-reset'){ + this.propsData = this.detailListPageFromFE(this.tableDataDetails) + //关闭高级筛选 + if(options.vm_moreList){options.vm_moreList.changeMoreListShow(false)} + // 同步当前列表数据请求接口的筛选条件 + this.detailSearchDataFE = {} + this.detailSearchDataFE.moreList = {filters:JSON.parse(JSON.stringify([]))} + } + // 查询 + if( _item.name == 'search' || _item.name == 'moreList-search'){ + let _searchObj = {} + let searchData = options.data_moreList.filters; + console.log(299,searchData) + searchData.forEach(item=>{ + _searchObj[item.column] = item.value + }) + const productFilter = (data, params) => data.filter(function(item){ + return Object.keys(params).every(function(key){ + return item[key]!=undefined && item[key]==params[key] //可以相应修改条件 + }) + }) + let _allData = JSON.parse(JSON.stringify(this.tableDataDetails)) + let _filterList = productFilter(_allData.details,_searchObj) + _allData.details = _filterList + this.propsData = this.detailListPageFromFE(_allData) + //关闭高级筛选 + if(options.vm_moreList){options.vm_moreList.changeMoreListShow(false)} + // 同步当前列表数据请求接口的筛选条件 + this.detailSearchDataFE = {} + this.detailSearchDataFE.moreList = {filters:JSON.parse(JSON.stringify(searchData))} + } + // return res + }, // 点击抽屉,获取明细后全局通用操作 inlineDialogCallback(){ this.Loading.DrawerLoading = false diff --git a/PC/InterFace.Dash/src/views/interfaceBoard/AsnMstr.vue b/PC/InterFace.Dash/src/views/interfaceBoard/AsnMstr.vue index 534402a..f7f1315 100644 --- a/PC/InterFace.Dash/src/views/interfaceBoard/AsnMstr.vue +++ b/PC/InterFace.Dash/src/views/interfaceBoard/AsnMstr.vue @@ -34,6 +34,8 @@ :DrawerLoading="Loading.DrawerLoading" :drawer="displayDialog.detailsDialog" :propsData="propsData" + @detailFiltersSearch="detailFiltersSearch" + :detailSearchDataFE="detailSearchDataFE" :Butttondata="[]" @drawerShut="(val) => (displayDialog.detailsDialog = val)" @drawerbutton="drawerbutton" @@ -45,6 +47,7 @@ @alterResultCountDetails="alterResultCountDetails" @alertoldSkipCountDetails="alertoldSkipCountDetails" > +