Browse Source

明细按照后端分页及查询功能暂存

master
安虹睿 1 year ago
parent
commit
7650d89e44
  1. 217
      Code/Fe/src/components/commonTabel-drawer copy/index.vue
  2. 15
      Code/Fe/src/components/commonTabel-drawer copy/style/index.scss
  3. 402
      Code/Fe/src/components/commonTabel-drawer/index.vue
  4. 15
      Code/Fe/src/components/commonTabel-drawer/style/index.scss
  5. 2
      Code/Fe/src/components/filterForDetailPage/index.vue
  6. 106
      Code/Fe/src/mixins/TableMixins.js
  7. 1
      Code/Fe/src/utils/detailsTableColumns_api/index.js
  8. 1
      Code/Fe/src/views/interfaceBoard/TestSchool.vue

217
Code/Fe/src/components/commonTabel-drawer copy/index.vue

@ -66,20 +66,59 @@
:propsData="propsData"
>
</curren-descriptions>
<!-- 明细头部按钮 -->
<div
class="currenTabel-drawer-mx-header"
v-if="scope.value == 'mx' && (showDetailColumnsSet || showDetailFilters)"
>
<curren-Button
:Butttondata="detailHeaderButton"
@tableButtonClick="detailHeaderClick"
></curren-Button>
</div>
<!-- 字段设置弹窗 -->
<rowDrop
@radio="rowDrop"
:tableColumns="tableColumns"
:visible="rowDropVisible"
@closeRowDrop="closeRowDrop"
:source="'detail_api'"
:innerMaxHeight="'calc(90vh - 400px)'"
></rowDrop>
<!-- 全面搜索普通+高级整合 -->
<searchOverall
ref="searchOverallRef"
class="detailFiltersPopPage"
:showSearchOverall="detailFiltersVisible"
@getShowSearchOverall="getShowSearchOverall"
:showMoreSearch="true"
:tableColumns="tableColumns"
@overallSearchFormClick="detailFiltersSearch"
:filterActionOptions="filterActionOptions"
:httpOverallSearchData="detailSearchDataFE"
:disabledAction="true"
:disabledLogic="true"
>
<!-- 插槽预留 -->
<slot name="searchPrimarySlot"></slot>
</searchOverall>
<!-- currenTableDetails 组件 明细中带分页功能 -->
<umyTable
v-if="scope.value == 'mx'"
:isUpdate="isUpdate"
:tableBorder="true"
:tableData="propsData.details"
:propsData="propsData"
:tableColumns="tableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
:setUTableHeight="260"
:setUTableHeight="showDetailColumnsSet ? 300 : 260"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:buttonOperationList="buttonOperationList"
@buttonOperationClick="buttonOperationClick"
>
<template>
<slot></slot>
@ -164,9 +203,32 @@
<div class="drawer-Shut" @click="drawerShut">
<el-button type="danger" size="mini">关闭</el-button>
</div>
<!-- 明细-查看详情 -->
<el-dialog
width="90%"
:modal-append-to-body="false"
:append-to-body="false"
:title="detailInfoTitle"
:visible.sync="displayDialog.detailInfoDialog"
:show-close="true"
>
<div>
<curren-descriptions
v-if="detailInfoTableData"
border
:column="column"
:direction="direction"
:colon="false"
:tabsDesTions="tableColumns"
:propsData="detailInfoTableData"
style="padding-bottom: 20px;"
></curren-descriptions>
</div>
</el-dialog>
</el-drawer>
</template>
<script>
import searchOverall from "@/components/searchOverall"
import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode,
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect
} from "@/api/wms-api"
@ -175,6 +237,10 @@ import currenDescriptions from "@/components/currenDescriptions"
import currenTabs from "@/components/currenTabs"
import currenTable from "@/components/currenTable"
import pagination from "@/components/Pagination"
import rowDrop from "@/components/rowDrop/index.vue"
import { getParentNode } from '@/utils'
import * as allUrlOption from '@/utils/baseData/urlOption'
import { LoadingMixins } from "@/mixins/LoadingMixins";
export default {
name: 'currenTabel-drawer',
components: {
@ -183,8 +249,33 @@ export default {
currenDescriptions,
currenTabs,
currenTable,
searchOverall,
rowDrop
},
mixins: [
LoadingMixins,
],
props: {
//
buttonOperationList:{
type: Array,
default: null,
},
// -
showDetailColumnsSet:{
type: Boolean,
default: true
},
// -
showDetailFilters:{
type: Boolean,
default: true
},
// --
detailSearchDataFE:{
type: Object,
default: null
},
title: {
type: Array,
default: () => {
@ -291,36 +382,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
@ -328,9 +407,28 @@ export default {
},
},
mounted () {
this.initDetailHeaderButton()
//
document.addEventListener('click',(e)=>{
if(!this.rowDropVisible)return
let _class = "rowDropNotHideItem"
let _hasParent = getParentNode(e.target,_class)
let _current_class = e.target._prevClass || e.target.className
let _hasCurrent = _current_class ? String(_current_class).includes(_class) : false
if(!_hasParent && !_hasCurrent){
this.closeRowDrop()
}
})
},
data () {
return {
detailHeaderButton:null,//-
detailInfoTableData:null,//-
detailInfoTitle:null,//-title
// table key
isUpdate: false,
// -
rowDropVisible: false,
otherData:[], // tabs
zdyTableColumns:[], //
zdyValue:'', //
@ -348,15 +446,78 @@ export default {
label: "汇总",
name: 'hz'
}
]
],
detailFiltersVisible:false,//
filterActionOptions:[{
value: '==',
label: '等于'
}, {
value: '!=',
label: '不等于'
}],
}
},
methods: {
// -
initDetailHeaderButton(){
this.detailHeaderButton = []
if(this.showDetailColumnsSet){this.detailHeaderButton.push(this.defaultFieldSettingBtn())}
if(this.showDetailFilters){this.detailHeaderButton.push(this.defaultFilterBtn())}
},
detailHeaderClick(val,item){
//
if(val == 'field'){
this.columnsSettingHandle()
}
//
if(val == 'filter'){
this.detailFiltersHandle()
}
},
// -
closeDetailInfo(val){
this.displayDialog.detailInfoDialog = val || false
},
// -
buttonOperationClick(row, item, index){
//
if(item.name == "info"){
this.displayDialog.detailInfoDialog = true
this.detailInfoTableData = row
let _name = allUrlOption[this.$route.name].detailInfoName
this.detailInfoTitle = _name ? row[_name] + ' 详情' : '详情'
}
this.$emit('buttonOperationClick',row, item, index)
},
rowDrop(data,type) {
this.$emit('rowDrop',data,type)
this.isUpdate = !this.isUpdate
},
// -
columnsSettingHandle(){
this.rowDropVisible = !this.rowDropVisible
},
// -
detailFiltersHandle(){
this.detailFiltersVisible = !this.detailFiltersVisible
},
// -/showSearchOverall
getShowSearchOverall(val){
this.detailFiltersVisible = val || false
},
// -
detailFiltersSearch(options){
this.$emit('detailFiltersSearch', options)
},
// -
closeRowDrop() {
this.rowDropVisible = false
},
handleCommand (command) {
this.$emit('handleCommand', command)
},
drawerShut () {
this.closeDetailInfo(false)
this.$emit('drawerShut', false)
},
tableButtonClick (val) {

15
Code/Fe/src/components/commonTabel-drawer copy/style/index.scss

@ -120,3 +120,18 @@
::v-deep .el-tabs__nav-wrap::after{
content: unset !important;
}
.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;
}
}

402
Code/Fe/src/components/commonTabel-drawer/index.vue

@ -11,13 +11,6 @@
>
<div class="drawer-heder">
<div class="heder-left">
<!-- <div class="heder-img">
<img
src="@/assets/img/drawerHeader.png"
alt=""
style="width: 100%; height: 100%"
/>
</div> -->
<div class="header-text">
<span>{{ propsData[title[0].prop] }}</span>
<span>{{ title[0].label }}</span>
@ -66,73 +59,28 @@
:propsData="propsData"
>
</curren-descriptions>
<!-- 明细头部按钮 -->
<div
class="currenTabel-drawer-mx-header"
v-if="scope.value == 'mx' && (showDetailColumnsSet || showDetailFilters)"
>
<curren-Button
:Butttondata="detailHeaderButton"
@tableButtonClick="detailHeaderClick"
></curren-Button>
</div>
<!-- 字段设置弹窗 -->
<rowDrop
@radio="rowDrop"
:tableColumns="tableColumns"
:visible="rowDropVisible"
@closeRowDrop="closeRowDrop"
:source="'detail_api'"
:innerMaxHeight="'calc(90vh - 400px)'"
></rowDrop>
<!-- 全面搜索普通+高级整合 -->
<searchOverall
ref="searchOverallRef"
class="detailFiltersPopPage"
:showSearchOverall="detailFiltersVisible"
@getShowSearchOverall="getShowSearchOverall"
:showMoreSearch="true"
:tableColumns="tableColumns"
@overallSearchFormClick="detailFiltersSearch"
:filterActionOptions="filterActionOptions"
:httpOverallSearchData="detailSearchDataFE"
:disabledAction="true"
:disabledLogic="true"
>
<!-- 插槽预留 -->
<slot name="searchPrimarySlot"></slot>
</searchOverall>
<!-- currenTableDetails 组件 明细中带分页功能 -->
<umyTable
<!-- 明细 包含分页 头部按钮等 -->
<tablePagination
v-if="scope.value == 'mx'"
:isUpdate="isUpdate"
:tableBorder="true"
:currenButtonData="detailHeaderButton"
:tableData="propsData.details"
:propsData="propsData"
:tableColumns="tableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
:setUTableHeight="showDetailColumnsSet ? 300 : 260"
@sortChange="sortChange"
:setUTableHeight="showDetailColumnsSet && showDetailFilters ? 300 : 260"
@rowDrop="rowDrop"
:rowSource="'detail_api'"
:totalCount="totalCount"
:MaxResultCount="MaxResultCount"
@sortChange="sortChangeForDetail"
@alertoldSkipCount="alertoldSkipCountForDetail"
@alterResultCount="alterResultCountForDetail"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:buttonOperationList="buttonOperationList"
:currentPageProps="oldSkipCount"
@overallSearchFormClick="overallSearchClickForDetail"
:httpOverallSearchData="httpOverallSearchData"
@buttonOperationClick="buttonOperationClick"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 明细页码 -->
<pagination
v-if="scope.value == 'mx'"
:totalCount="totalCount"
:pagesizeProps="MaxResultCount"
@SizeChange="alterResultCountDetails"
@CurrentChange="alertoldSkipCountDetails"
:currentPageProps="currentPage"
></pagination>
:buttonOperationList="buttonOperationList"
:tableLoading="Loading.tableLoading"
></tablePagination>
<!-- 新增汇总 表头 区分明细表头使用 summaryTableColumns -->
<umyTable
v-if="scope.value == 'hz'"
@ -228,17 +176,16 @@
</el-drawer>
</template>
<script>
import searchOverall from "@/components/searchOverall"
import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode,
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,getPageListForDetail
} from "@/api/wms-api"
import searchOverall from "@/components/searchOverall"
import currenButton from "@/components/currenButton"
import currenDescriptions from "@/components/currenDescriptions"
import currenTabs from "@/components/currenTabs"
import currenTable from "@/components/currenTable"
import pagination from "@/components/Pagination"
import rowDrop from "@/components/rowDrop/index.vue"
import { getParentNode } from '@/utils'
import * as allUrlOption from '@/utils/baseData/urlOption'
import { LoadingMixins } from "@/mixins/LoadingMixins";
export default {
@ -271,11 +218,6 @@ export default {
type: Boolean,
default: true
},
// --
detailSearchDataFE:{
type: Object,
default: null
},
title: {
type: Array,
default: () => {
@ -383,7 +325,7 @@ export default {
} else {
//
// if (Object.keys(this.propsData).length != 0) {
if (Object.keys(this.propsData)) {
if (Object.keys(this.propsData)) {
this.initDropdownTabsData = [{
label: "详情",
name: 'xq'
@ -408,27 +350,12 @@ export default {
},
mounted () {
this.initDetailHeaderButton()
//
document.addEventListener('click',(e)=>{
if(!this.rowDropVisible)return
let _class = "rowDropNotHideItem"
let _hasParent = getParentNode(e.target,_class)
let _current_class = e.target._prevClass || e.target.className
let _hasCurrent = _current_class ? String(_current_class).includes(_class) : false
if(!_hasParent && !_hasCurrent){
this.closeRowDrop()
}
})
},
data () {
return {
detailHeaderButton:null,//-
detailInfoTableData:null,//-
detailInfoTitle:null,//-title
// table key
isUpdate: false,
// -
rowDropVisible: false,
otherData:[], // tabs
zdyTableColumns:[], //
zdyValue:'', //
@ -447,33 +374,154 @@ export default {
name: 'hz'
}
],
detailFiltersVisible:false,//
filterActionOptions:[{
value: '==',
label: '等于'
}, {
value: '!=',
label: '不等于'
}],
//-
oldSkipCount: 1,
// -
httpOverallSearchData:null,
//-
PageListParams: {
condition: {
filters: []
},
Sorting: "",
SkipCount: 0,
MaxResultCount: 20,
},
//-id
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId',
//-
URLOption_detailList:allUrlOption[this.$route.name].detailListURL,
}
},
methods: {
// -
getDetailList(data,successFn,errorFn){
//
let _hasId = false
this.PageListParams.condition.filters.forEach(item=>{
if(item.column == this.URLOption_masterId){
_hasId = true
}
})
if(!_hasId){
this.PageListParams.condition.filters.push({
logic: "And",
column: this.URLOption_masterId,
action: "==",
value: data ? data.id : this.propsData.id
})
}
this.Loading.tableLoading = true
getPageListForDetail(this.PageListParams,this.URLOption_detailList)
.then(result => {
this.propsData.details = result.items
this.totalCount = result.totalCount
this.Loading.tableLoading = false
if(successFn)successFn()
})
.catch(err => {
this.Loading.tableLoading = false
if(errorFn)errorFn()
this.$message.error("数据获取失败")
})
},
// -
overallSearchForDetailHandle(options){
let _data_primary = options.data_primary,
_data_moreList = options.data_moreList,
_option_primary = options.option_primary,
_vm_quickly = options.vm_quickly,
_vm_moreList = options.vm_moreList
//
let _primary_filters = []
_option_primary.forEach(item=>{
if(_data_primary[item.prop] && String(_data_primary[item.prop]).length > 0){
let _item = {
action:item.action || '==',
column:item.prop,
logic:'And',
value:String(_data_primary[item.prop])
}
_primary_filters.push(_item)
}
})
//
let _moreList_filters = []
_data_moreList.filters.forEach(item=>{
if(String(item.column).length > 0 && String(item.value).length > 0){
_moreList_filters.push(item)
}
})
//
let _all_filters = []
_all_filters = _primary_filters.concat(_moreList_filters)
//
this.oldSkipCount = 1
this.Loading.tableLoading = true;
this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount;
this.PageListParams.condition = {filters:_all_filters}
this.getDetailList(null,()=>{
//
if(_vm_quickly){_vm_quickly.searchNormalClear(true)}
//
if(_vm_moreList){_vm_moreList.changeMoreListShow(false)}
//
this.httpOverallSearchData = {}
this.httpOverallSearchData.params = JSON.parse(JSON.stringify(_data_primary))
this.httpOverallSearchData.moreList = JSON.parse(JSON.stringify(_data_moreList))
},()=>{
//
if(_vm_quickly){_vm_quickly.searchNormalClear(true)}
//
if(_vm_moreList){_vm_moreList.changeMoreListShow(false)}
})
},
// -
overallSearchClickForDetail(options){
let _item = options.item;
// + + +
if(
_item.name == 'search' || _item.name == 'moreList-search' ||
_item.name == 'reset' || _item.name == 'moreList-reset'
){
this.overallSearchForDetailHandle(options)
}
},
// -emit
alertoldSkipCountForDetail(val) {
this.oldSkipCount = val;
this.getDetailList();
},
// -emit
alterResultCountForDetail(val) {
this.PageListParams.MaxResultCount = val;
this.getDetailList();
},
// -
sortChangeForDetail(val) {
const {
prop,
order
} = val;
if (!prop || !order) {
this.PageListParams.Sorting = "";
this.oldSkipCount = 1;
this.getDetailList();
return;
}
let orderdata = order.substr(0, order.indexOf("c") + 1);
const props = prop.charAt(0).toUpperCase() + prop.slice(1)
this.PageListParams.Sorting = props + " " + orderdata.toUpperCase();
this.oldSkipCount = 1;
this.getDetailList();
},
// -
initDetailHeaderButton(){
this.detailHeaderButton = []
if(this.showDetailColumnsSet){this.detailHeaderButton.push(this.defaultFieldSettingBtn())}
if(this.showDetailFilters){this.detailHeaderButton.push(this.defaultFilterBtn())}
},
detailHeaderClick(val,item){
//
if(val == 'field'){
this.columnsSettingHandle()
}
//
if(val == 'filter'){
this.detailFiltersHandle()
}
},
// -
closeDetailInfo(val){
this.displayDialog.detailInfoDialog = val || false
@ -491,27 +539,6 @@ export default {
},
rowDrop(data,type) {
this.$emit('rowDrop',data,type)
this.isUpdate = !this.isUpdate
},
// -
columnsSettingHandle(){
this.rowDropVisible = !this.rowDropVisible
},
// -
detailFiltersHandle(){
this.detailFiltersVisible = !this.detailFiltersVisible
},
// -/showSearchOverall
getShowSearchOverall(val){
this.detailFiltersVisible = val || false
},
// -
detailFiltersSearch(options){
this.$emit('detailFiltersSearch', options)
},
// -
closeRowDrop() {
this.rowDropVisible = false
},
handleCommand (command) {
this.$emit('handleCommand', command)
@ -579,117 +606,6 @@ export default {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byItem') {
byItem(this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byProduct') {
byProduct({product:this.propsData.product}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byComponent') {
byComponent({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ----
else if (item.functionName == 'byComponentCJ') {
this.otherData = []
byComponentCJ({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.recursion(this.otherData)
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'bySupplierCode') {
bySupplierCode({supplierCode:this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocation') {
byLocation(this.propsData.code==null?this.propsData.locationCode:this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.o
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocationCode') {
byLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let itemData = []
itemData.push(res)
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = itemData
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ---
else if (item.functionName == 'relationByLocationCode') {
relationByLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// -, ,
else if(item.functionName == "purRecNoteCustomInfo"){
parent.Loading.DrawerLoading = true
purRecNoteCustomInfo( item.url,this.propsData.id).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.Loading.DrawerLoading = false
}).catch(err => {
console.log(err)
parent.Loading.DrawerLoading = false
})
}
// 退-TAB-
else if(item.functionName == "customerDismantleBackFlushNote"){

15
Code/Fe/src/components/commonTabel-drawer/style/index.scss

@ -119,19 +119,4 @@
::v-deep .el-tabs__nav-wrap::after{
content: unset !important;
}
.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;
}
}

2
Code/Fe/src/components/filterForDetailPage/index.vue

@ -227,9 +227,9 @@ methods: {
//
let _arr_header = []
if(this.showHandleButtons.indexOf('add') >= 0){_arr_header.push(this.defaultAddBtn())}
if(this.showHandleButtons.indexOf('field') >= 0){_arr_header.push(this.defaultFieldSettingBtn())}
if(this.showHandleButtons.indexOf('fresh') >= 0){_arr_header.push(this.defaultFreshBtn())}
if(this.showHandleButtons.indexOf('filter') >= 0){_arr_header.push(this.defaultFilterBtn())}
if(this.showHandleButtons.indexOf('field') >= 0){_arr_header.push(this.defaultFieldSettingBtn())}
this.currenButtonData = _arr_header
//

106
Code/Fe/src/mixins/TableMixins.js

@ -113,26 +113,32 @@ export const tableMixins = {
this.displayDialog.detailsDialog = true;
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
getDetailed(val.id, _url).then(res => {
if (res.details) {
this.tableDataDetails = JSON.parse(JSON.stringify(res))
// 前端分页处理
this.propsData = this.detailListPageFromFE(res)
} else {
this.propsData = res
// 打印使用的全部数据存储
this.tableDataDetails = JSON.parse(JSON.stringify(res))
this.propsData = res
if (res.details) {
if(this.$refs.currenDrawer_Ref){
this.$refs.currenDrawer_Ref.getDetailList(res,()=>{
this.inlineDialogCallback()
},()=>{
this.Loading.DrawerLoading = false
})
}
this.inlineDialogCallback()
// 前端分页处理
// this.propsData = this.detailListPageFromFE(res)
}
}).catch(err => {
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
},
// 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
@ -284,42 +290,42 @@ export const tableMixins = {
// 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
},
// 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

1
Code/Fe/src/utils/detailsTableColumns_api/index.js

@ -1,4 +1,5 @@
// 此文件为【明细 - 列表】表头从接口缓存的表头
// 如果有父级id字段,请设置showProp,避免明细列表内可查询其他主表的明细
import { initFromApiColumnsLable } from '@/utils/index'

1
Code/Fe/src/views/interfaceBoard/TestSchool.vue

@ -36,7 +36,6 @@
:drawer="displayDialog.detailsDialog"
:dropdownData="dropdownData"
:propsData="propsData"
@detailFiltersSearch="detailFiltersSearch"
:detailSearchDataFE="detailSearchDataFE"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"

Loading…
Cancel
Save