From 8612e07c47e84752e53db1615656d4efe0aec758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Wed, 9 Aug 2023 17:02:44 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=89=B9=E6=AE=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=202=E3=80=81Sorting=EF=BC=9A=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=AE=B5=E5=80=92=E5=8F=99=203=E3=80=81=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E4=BD=8D=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/currenButton/innerButton.vue | 7 +- PC/InterFace.Dash/src/mixins/TableMixins.js | 92 ++++++++++++++++++- PC/InterFace.Dash/src/router/index.js | 18 ++++ PC/InterFace.Dash/src/utils/defaultButtons.js | 6 +- PC/UI.WinIn.FasterZ.Store/public/config.js | 5 +- .../components/currenButton/innerButton.vue | 7 +- .../src/mixins/TableMixins.js | 80 +++++++++++++++- .../src/utils/defaultButtons.js | 6 +- 8 files changed, 202 insertions(+), 19 deletions(-) diff --git a/PC/InterFace.Dash/src/components/currenButton/innerButton.vue b/PC/InterFace.Dash/src/components/currenButton/innerButton.vue index 5f08da7..9dab791 100644 --- a/PC/InterFace.Dash/src/components/currenButton/innerButton.vue +++ b/PC/InterFace.Dash/src/components/currenButton/innerButton.vue @@ -57,4 +57,9 @@ export default { } } } - \ No newline at end of file + + \ No newline at end of file diff --git a/PC/InterFace.Dash/src/mixins/TableMixins.js b/PC/InterFace.Dash/src/mixins/TableMixins.js index 2878f20..af113a0 100644 --- a/PC/InterFace.Dash/src/mixins/TableMixins.js +++ b/PC/InterFace.Dash/src/mixins/TableMixins.js @@ -145,7 +145,15 @@ export const tableMixins = { }); } }, - // 获取通过api的表头转义数据 + // 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题 + // initApiColumns(table,des,detailsTable,detailsPage){ + // // 赋值表头数据 + // // if(table && table[this.$route.name])this.apiColumns_Table = this.initTableColumns(table[this.$route.name]) + // if(des && des[this.$route.name])this.apiColumns_DesTions = des[this.$route.name] + // if(detailsTable && detailsTable[this.$route.name])this.apiColumns_DetailsTable = this.initTableColumns(detailsTable[this.$route.name],'detail_api') + // if(detailsPage && detailsPage[this.$route.name])this.apiColumns_DetailsPage = this.initTableColumns(detailsPage[this.$route.name],'detailPage_api') + // }, + // get-dto-column-type接口表头类型初始化 initApiColumnsForDto(list,titleName){ let data = this.$store.getters.dtoColumnTypes let _coloums = data[titleName].S @@ -155,7 +163,7 @@ export const tableMixins = { _data.forEach(item=>{ // 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加 let _if = firstWordSizeChange(item.name) != 'details' - if(list && list.length > 0){ + if(list){ _if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details' } if(_if){ @@ -163,16 +171,85 @@ export const tableMixins = { } }) } + if(list && list.length > 0){ + _Columns_Table = _Columns_Table.concat(this.specialAddColumns(list,titleName)) + } return _Columns_Table }, + // 添加特殊字段(api中没有的字段特殊处理) + specialAddColumns(list,titleName){ + let _apiName = titleName + let _special_list=[] + // creationTime + if('creationTime' in list){ + _special_list.push( + { + "name": "CreationTime", + "apiBaseType": "datetime", + "baseApiName": _apiName + 'CreationTime', + "label": zhApiColumnsLable(_apiName + 'CreationTime') || _apiName + 'CreationTime', + "prop": "creationTime", + } + ) + } + // creatorId + if('creatorId' in list){ + _special_list.push( + { + "name": "CreatorId", + "apiBaseType": "string", + "baseApiName": _apiName + 'CreatorId', + "label": zhApiColumnsLable(_apiName + 'CreatorId') || _apiName + 'CreatorId', + "prop": "creatorId", + } + ) + } + // lastModificationTime + if('lastModificationTime' in list){ + _special_list.push( + { + "name": "LastModificationTime", + "apiBaseType": "datetime", + "baseApiName": _apiName + 'LastModificationTime', + "label": zhApiColumnsLable(_apiName + 'LastModificationTime') || _apiName + 'LastModificationTime', + "prop": "lastModificationTime", + } + ) + } + // lastModifierId + if('lastModifierId' in list){ + _special_list.push( + { + "name": "LastModifierId", + "apiBaseType": "string", + "baseApiName": _apiName + 'LastModifierId', + "label": zhApiColumnsLable(_apiName + 'LastModifierId') || _apiName + 'LastModifierId', + "prop": "lastModifierId", + } + ) + } + // tenantId + if('tenantId' in list){ + _special_list.push( + { + "name": "TenantId", + "apiBaseType": "string", + "baseApiName": _apiName + 'TenantId', + "label": zhApiColumnsLable(_apiName + 'TenantId') || _apiName + 'TenantId', + "prop": "tenantId", + } + ) + } + return _special_list + }, //渲染数据 - paging(callback) { + paging(callback,repeat) { this.Loading.tableLoading = true; this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount getPageList(this.PageListParams, this.URLOption_base) .then(res=>{ // 表头处理 - let _Columns = this.initApiColumnsForDto(res,this.$route.name) + let _Columns = this.initApiColumnsForDto(res.items[0],this.$route.name) this.apiColumns_Table = this.initTableColumns(_Columns) this.apiColumns_DesTions = _Columns // 页面数据处理 @@ -180,6 +257,11 @@ export const tableMixins = { this.tableData = res.items this.totalCount = res.totalCount } + // 如果返回数据中有creationTime,则默认按时间段倒叙重新查一遍 + // if('creationTime' in res.items[0] && !repeat){ + // this.PageListParams.Sorting = "CreationTime DESC" + // this.paging(callback,true) + // } this.pagingCallback(callback) }) .catch(err=>{ @@ -231,7 +313,7 @@ export const tableMixins = { // 数据处理 this.propsData = res if (res.details) { - // 表头处理 + // 表头处理 let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/')) this.apiColumns_DetailsTable = this.initTableColumns(this.initApiColumnsForDto(res.details[0],_parentName),'detail_api') if(this.$refs.currenDrawer_Ref){ diff --git a/PC/InterFace.Dash/src/router/index.js b/PC/InterFace.Dash/src/router/index.js index 59c9491..aa4880d 100644 --- a/PC/InterFace.Dash/src/router/index.js +++ b/PC/InterFace.Dash/src/router/index.js @@ -78,6 +78,24 @@ export let constantRoutes = [ } }] }, + { + path: '/', + component: Layout, + redirect: '/menuAll', + hidden: true, + children: [{ + path: 'menuAll', + component: () => import('@/views/menuAll/index'), + name: 'menuAll', + meta: { + keepAlive : true, + title: 'menuAll', + icon: 'svg_dashboard', + outerFirst:true + // affix: true + } + }] + }, ] /** diff --git a/PC/InterFace.Dash/src/utils/defaultButtons.js b/PC/InterFace.Dash/src/utils/defaultButtons.js index d88391f..dc9a1fc 100644 --- a/PC/InterFace.Dash/src/utils/defaultButtons.js +++ b/PC/InterFace.Dash/src/utils/defaultButtons.js @@ -86,12 +86,12 @@ export function defaultFreshBtn(option) { // 筛选按钮 export function defaultFilterBtn(option) { return __defaultBtnOption(option,{ - type: "primary", + // type: "primary", icon: "el-icon-finished", label: i18n.t('btns.filter'), name: "filter", size: "mini", - float: 'right' + float: 'left' }) } @@ -103,7 +103,7 @@ export function defaultFilterForDetailBtn(option) { label: i18n.t('btns.DetailedQuery'), name: "filterForDetail", size: "mini", - float: 'right', + float: 'left', }) } diff --git a/PC/UI.WinIn.FasterZ.Store/public/config.js b/PC/UI.WinIn.FasterZ.Store/public/config.js index ce11607..8278ca4 100644 --- a/PC/UI.WinIn.FasterZ.Store/public/config.js +++ b/PC/UI.WinIn.FasterZ.Store/public/config.js @@ -1,7 +1,7 @@ // dev_win // window.SITE_CONFIG['baseApi'] = 'http://192.168.0.190:30001' // window.SITE_CONFIG['authApi'] = 'http://192.168.0.190:30001' -// window.SITE_CONFIG['userApi'] = 'http://192.168.0.190:30001' +// window.SITE_CONFIG['userApi'] = 'http://192.168.0.190:30000' window.SITE_CONFIG['baseApi'] = 'http://dev.ccwin-in.com:60065' window.SITE_CONFIG['authApi'] = 'http://dev.ccwin-in.com:60065' window.SITE_CONFIG['userApi'] = 'http://dev.ccwin-in.com:60064' @@ -31,7 +31,6 @@ window.SITE_CONFIG['menuHiddenConfig'] = [ 'ScrapOutNoteDetail','SingleDoorPanelCustomerReturnNoteDetail','SingleDoorPanelDeliverNoteDetail', 'SingleDoorPanelProductAdjustNoteDetail','SingleDoorPanelProductReceiptNoteDetail','SingleDoorPanelProductTransferNoteDetail', 'StockReturnNoteDetail','SupplierAsnDetail','TracebackNoteDetail', - 'UnplannedIssueNoteDetail','SaleOrderDetail','ScrapNoteDetail', - 'ReworkNoteDetail','UnplannedReceiptNoteDetail','WarehouseTransferNoteDetail', + 'UnplannedIssueNoteDetail','UnplannedReceiptNoteDetail','WarehouseTransferNoteDetail', 'WorkOrderDetail' ] diff --git a/PC/UI.WinIn.FasterZ.Store/src/components/currenButton/innerButton.vue b/PC/UI.WinIn.FasterZ.Store/src/components/currenButton/innerButton.vue index 5f08da7..9dab791 100644 --- a/PC/UI.WinIn.FasterZ.Store/src/components/currenButton/innerButton.vue +++ b/PC/UI.WinIn.FasterZ.Store/src/components/currenButton/innerButton.vue @@ -57,4 +57,9 @@ export default { } } } - \ No newline at end of file + + \ No newline at end of file diff --git a/PC/UI.WinIn.FasterZ.Store/src/mixins/TableMixins.js b/PC/UI.WinIn.FasterZ.Store/src/mixins/TableMixins.js index 2d7ad18..af113a0 100644 --- a/PC/UI.WinIn.FasterZ.Store/src/mixins/TableMixins.js +++ b/PC/UI.WinIn.FasterZ.Store/src/mixins/TableMixins.js @@ -163,7 +163,7 @@ export const tableMixins = { _data.forEach(item=>{ // 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加 let _if = firstWordSizeChange(item.name) != 'details' - if(list && list.length > 0){ + if(list){ _if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details' } if(_if){ @@ -171,16 +171,85 @@ export const tableMixins = { } }) } + if(list && list.length > 0){ + _Columns_Table = _Columns_Table.concat(this.specialAddColumns(list,titleName)) + } return _Columns_Table }, + // 添加特殊字段(api中没有的字段特殊处理) + specialAddColumns(list,titleName){ + let _apiName = titleName + let _special_list=[] + // creationTime + if('creationTime' in list){ + _special_list.push( + { + "name": "CreationTime", + "apiBaseType": "datetime", + "baseApiName": _apiName + 'CreationTime', + "label": zhApiColumnsLable(_apiName + 'CreationTime') || _apiName + 'CreationTime', + "prop": "creationTime", + } + ) + } + // creatorId + if('creatorId' in list){ + _special_list.push( + { + "name": "CreatorId", + "apiBaseType": "string", + "baseApiName": _apiName + 'CreatorId', + "label": zhApiColumnsLable(_apiName + 'CreatorId') || _apiName + 'CreatorId', + "prop": "creatorId", + } + ) + } + // lastModificationTime + if('lastModificationTime' in list){ + _special_list.push( + { + "name": "LastModificationTime", + "apiBaseType": "datetime", + "baseApiName": _apiName + 'LastModificationTime', + "label": zhApiColumnsLable(_apiName + 'LastModificationTime') || _apiName + 'LastModificationTime', + "prop": "lastModificationTime", + } + ) + } + // lastModifierId + if('lastModifierId' in list){ + _special_list.push( + { + "name": "LastModifierId", + "apiBaseType": "string", + "baseApiName": _apiName + 'LastModifierId', + "label": zhApiColumnsLable(_apiName + 'LastModifierId') || _apiName + 'LastModifierId', + "prop": "lastModifierId", + } + ) + } + // tenantId + if('tenantId' in list){ + _special_list.push( + { + "name": "TenantId", + "apiBaseType": "string", + "baseApiName": _apiName + 'TenantId', + "label": zhApiColumnsLable(_apiName + 'TenantId') || _apiName + 'TenantId', + "prop": "tenantId", + } + ) + } + return _special_list + }, //渲染数据 - paging(callback) { + paging(callback,repeat) { this.Loading.tableLoading = true; this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount getPageList(this.PageListParams, this.URLOption_base) .then(res=>{ // 表头处理 - let _Columns = this.initApiColumnsForDto(res,this.$route.name) + let _Columns = this.initApiColumnsForDto(res.items[0],this.$route.name) this.apiColumns_Table = this.initTableColumns(_Columns) this.apiColumns_DesTions = _Columns // 页面数据处理 @@ -188,6 +257,11 @@ export const tableMixins = { this.tableData = res.items this.totalCount = res.totalCount } + // 如果返回数据中有creationTime,则默认按时间段倒叙重新查一遍 + // if('creationTime' in res.items[0] && !repeat){ + // this.PageListParams.Sorting = "CreationTime DESC" + // this.paging(callback,true) + // } this.pagingCallback(callback) }) .catch(err=>{ diff --git a/PC/UI.WinIn.FasterZ.Store/src/utils/defaultButtons.js b/PC/UI.WinIn.FasterZ.Store/src/utils/defaultButtons.js index d88391f..536fda2 100644 --- a/PC/UI.WinIn.FasterZ.Store/src/utils/defaultButtons.js +++ b/PC/UI.WinIn.FasterZ.Store/src/utils/defaultButtons.js @@ -86,12 +86,12 @@ export function defaultFreshBtn(option) { // 筛选按钮 export function defaultFilterBtn(option) { return __defaultBtnOption(option,{ - type: "primary", + // type: "primary", icon: "el-icon-finished", label: i18n.t('btns.filter'), name: "filter", size: "mini", - float: 'right' + float: 'left' }) } @@ -103,7 +103,7 @@ export function defaultFilterForDetailBtn(option) { label: i18n.t('btns.DetailedQuery'), name: "filterForDetail", size: "mini", - float: 'right', + float: 'left' }) }