diff --git a/Code/Fe/src/components/currenButton/innerButton.vue b/Code/Fe/src/components/currenButton/innerButton.vue index 5f08da7..9dab791 100644 --- a/Code/Fe/src/components/currenButton/innerButton.vue +++ b/Code/Fe/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/Code/Fe/src/mixins/TableMixins.js b/Code/Fe/src/mixins/TableMixins.js index 2d7ad18..7f54736 100644 --- a/Code/Fe/src/mixins/TableMixins.js +++ b/Code/Fe/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,83 @@ export const tableMixins = { } }) } + _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 +255,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/Code/Fe/src/utils/defaultButtons.js b/Code/Fe/src/utils/defaultButtons.js index d88391f..dc9a1fc 100644 --- a/Code/Fe/src/utils/defaultButtons.js +++ b/Code/Fe/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', }) }