From 4531e7a9d31099627e1b08fc524f59939fd21f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Thu, 13 Jul 2023 14:25:09 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=8D=E5=88=B6json?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/Fe/src/components/umyTable/index.vue | 52 ++++++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/Code/Fe/src/components/umyTable/index.vue b/Code/Fe/src/components/umyTable/index.vue index 8e0fff9..bd19b88 100644 --- a/Code/Fe/src/components/umyTable/index.vue +++ b/Code/Fe/src/components/umyTable/index.vue @@ -345,6 +345,26 @@ {{ showDetailData ? showDetailData + "" : showDetailData }} + + + + + + + 复制JSON - {{scope.row.value}} + {{scope.row.value}} { + this.$message.success('复制成功'); + }) + .catch(err => { + this.$message.error('复制失败'); + }); + this.$nextTick(()=>{ + if(this.$refs.copyJsonTextarea_ref){ + this.$refs.copyJsonTextarea_ref.focus() + // this.$nextTick(()=>{ + // this.$refs.copyJsonTextarea_ref.scrollTop = 0 + // }) + } + }) + }, //点击按钮打开自定义弹窗 buttonClick(row, index, label) { this.$emit("buttonClick", row, index, label); From 5c61ae9fca75111c512157b30b55eb6e050ba11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Thu, 13 Jul 2023 15:18:20 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/Fe/src/components/umyTable/index.vue | 8 ++++---- Code/Fe/src/permission.js | 24 +++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Code/Fe/src/components/umyTable/index.vue b/Code/Fe/src/components/umyTable/index.vue index bd19b88..d708364 100644 --- a/Code/Fe/src/components/umyTable/index.vue +++ b/Code/Fe/src/components/umyTable/index.vue @@ -347,6 +347,7 @@ { this.$message.success('复制成功'); @@ -856,9 +856,9 @@ export default { this.$nextTick(()=>{ if(this.$refs.copyJsonTextarea_ref){ this.$refs.copyJsonTextarea_ref.focus() - // this.$nextTick(()=>{ - // this.$refs.copyJsonTextarea_ref.scrollTop = 0 - // }) + this.$nextTick(()=>{ + document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0 + }) } }) }, diff --git a/Code/Fe/src/permission.js b/Code/Fe/src/permission.js index f41ba68..10cb5ce 100644 --- a/Code/Fe/src/permission.js +++ b/Code/Fe/src/permission.js @@ -81,18 +81,18 @@ router.beforeEach(async (to, from, next) => { } }else{ // 重新获取api接口表头 - const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") - if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){ - getInterfaceBoard().then(result => { - let _zh = localStorage.getItem('columnsApiNamesZh') - localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.localization.values[_zh])); - setTimeout(()=>{ - next() - },0) - }) - }else{ - next() - } + // const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") + // if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){ + getInterfaceBoard().then(result => { + let _zh = localStorage.getItem('columnsApiNamesZh') + localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.localization.values[_zh])); + setTimeout(()=>{ + next() + },0) + }) + // }else{ + // next() + // } } From 2d7941c2f9754b291de41a8e6c0a96f8b9382797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B8=A4=E6=97=AD=5BIrelia=5D?= <366601522@qq.com> Date: Thu, 13 Jul 2023 23:07:08 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppBase/ZbxBase.cs | 89 ++++++++++++++++--- 1 file changed, 76 insertions(+), 13 deletions(-) diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs index 55fb94d..e011fc4 100644 --- a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs @@ -33,8 +33,6 @@ public class ZbxBase { private readonly IRepository _repository; - private readonly IMapper _mapper; - private Func _mapFunc; protected IStringLocalizer _localizer => LazyServiceProvider.LazyGetRequiredService>(); @@ -42,7 +40,6 @@ public class ZbxBase LazyServiceProvider.LazyGetRequiredService(); - public ZbxBase(IRepository repository) : base(repository) { _repository = repository; @@ -61,6 +58,8 @@ public class ZbxBase> GetPageListByFilterAsync(SfsRequestInputBase sfsRequestInputBase, bool includeDetails = false, CancellationToken cancellationToken = default) { + await CheckGetListPolicyAsync(); + var expression = sfsRequestInputBase.Condition.Filters?.Count > 0 ? sfsRequestInputBase.Condition.Filters.ToLambda() : p => true; @@ -286,7 +285,10 @@ public class ZbxBase p.Name == "Details"); - //从表 + // 子表 var detailList = (IEnumerable)mainAllProperties[detailsIndex].GetValue(mainDto); var startMainRowIndex = rowIndex; for (var datailCount = 0; datailCount < detailList.Count(); datailCount++) @@ -408,13 +412,17 @@ public class ZbxBase /// /// - private static ICellStyle SetExcelDetailsColor(IWorkbook workbook) + private static ICellStyle SetExcelDetailsCellStyle(IWorkbook workbook) + { + var cellStyle = workbook.CreateCellStyle(); + cellStyle.FillBackgroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillForegroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillPattern = FillPattern.SolidForeground; + return cellStyle; + } + + /// + /// 导出设置只有主表时的交替行 单元格样式 + /// + /// + /// + private static ICellStyle SetExcelOnlyMainCellStyle(IWorkbook workbook) + { + var cellStyle = workbook.CreateCellStyle(); + cellStyle.FillBackgroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillForegroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillPattern = FillPattern.SolidForeground; + return cellStyle; + } + + /// + /// 设置分割单元格的演示 + /// + /// + /// + private static ICellStyle SetSplitCellStyle(IWorkbook workbook) + { + var cellStyle = workbook.CreateCellStyle(); + cellStyle.BorderLeft = BorderStyle.MediumDashed; + cellStyle.BorderRight = BorderStyle.MediumDashed; + cellStyle.LeftBorderColor = IndexedColors.BrightGreen.Index; + cellStyle.RightBorderColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillBackgroundColor = IndexedColors.White.Index; + cellStyle.FillForegroundColor = IndexedColors.White.Index; + cellStyle.FillPattern = FillPattern.ThickVerticalBands; + return cellStyle; + } + + /// + /// 导出设置表头单元格样式 + /// + /// + /// + private static ICellStyle SetExcelHeadCellStyle(IWorkbook workbook) { var cellStyle = workbook.CreateCellStyle(); cellStyle.FillBackgroundColor = IndexedColors.LightOrange.Index; @@ -559,4 +621,5 @@ public class ZbxBase Date: Thu, 13 Jul 2023 23:07:25 +0800 Subject: [PATCH 4/9] 1 --- .../src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs index e011fc4..ebe5e9d 100644 --- a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs @@ -621,5 +621,4 @@ public class ZbxBase Date: Fri, 14 Jul 2023 17:02:37 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=B8=BB=E8=A1=A8=E5=B8=A6=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=89=88=E6=9C=AC=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/Fe/public/config.js | 3 +- Code/Fe/src/api/wms-interface.js | 4 +- .../commonTabel-drawer copy/index.vue | 559 ++++++++++++++++++ .../commonTabel-drawer copy/style/index.scss | 122 ++++ .../components/commonTabel-drawer/index.vue | 30 +- .../components/filterForDetailPage/index.vue | 7 +- Code/Fe/src/components/rowDrop/index.vue | 31 +- .../src/components/tablePagination/index.vue | 10 + Code/Fe/src/components/umyTable/index.vue | 45 +- Code/Fe/src/mixins/TableMixins.js | 45 +- Code/Fe/src/mixins/mixins.js | 6 +- Code/Fe/src/permission.js | 36 +- Code/Fe/src/utils/baseData/urlOption.js | 2 + Code/Fe/src/utils/defaultButtons.js | 2 +- Code/Fe/src/utils/tableColumns_api/index.js | 2 +- Code/Fe/src/views/dashboard/index.vue | 2 +- .../src/views/interfaceBoard/TestSchool.vue | 13 +- 17 files changed, 848 insertions(+), 71 deletions(-) create mode 100644 Code/Fe/src/components/commonTabel-drawer copy/index.vue create mode 100644 Code/Fe/src/components/commonTabel-drawer copy/style/index.scss diff --git a/Code/Fe/public/config.js b/Code/Fe/public/config.js index f150e76..8a6e680 100644 --- a/Code/Fe/public/config.js +++ b/Code/Fe/public/config.js @@ -1,6 +1,7 @@ // dev_win window.SITE_CONFIG['base'] = 'http://dev.ccwin-in.com:60069' -window.SITE_CONFIG['columnsApiNames'] = '/api/abp/application-configuration' +window.SITE_CONFIG['columnsApiNames'] = '/api/abp/application-localization' +// window.SITE_CONFIG['columnsApiNames'] = '/api/abp/application-configuration' window.SITE_CONFIG['columnsApiNamesZh'] = 'Winin' window.SITE_CONFIG['isAutoLogin'] = false window.SITE_CONFIG['isSinglePage'] = false diff --git a/Code/Fe/src/api/wms-interface.js b/Code/Fe/src/api/wms-interface.js index a11d6a2..8c28acf 100644 --- a/Code/Fe/src/api/wms-interface.js +++ b/Code/Fe/src/api/wms-interface.js @@ -7,7 +7,9 @@ let colum_url = localStorage.getItem('columnsApiNames') export function getInterfaceBoard() { return request({ method:'get', - url: base_api + colum_url + url: base_api + colum_url, + params:{CultureName:'zh-Hans'} + // params:{IncludeLocalizationResources:true} }) } diff --git a/Code/Fe/src/components/commonTabel-drawer copy/index.vue b/Code/Fe/src/components/commonTabel-drawer copy/index.vue new file mode 100644 index 0000000..6d9e66d --- /dev/null +++ b/Code/Fe/src/components/commonTabel-drawer copy/index.vue @@ -0,0 +1,559 @@ + + + + + + + {{ propsData[title[0].prop] }} + {{ title[0].label }} + + + + + + + + + {{ item.label }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 关闭 + + + + + \ No newline at end of file diff --git a/Code/Fe/src/components/commonTabel-drawer copy/style/index.scss b/Code/Fe/src/components/commonTabel-drawer copy/style/index.scss new file mode 100644 index 0000000..877fd49 --- /dev/null +++ b/Code/Fe/src/components/commonTabel-drawer copy/style/index.scss @@ -0,0 +1,122 @@ +.el-drawer__wrapper { + z-index: 10 !important; + position: absolute; + left: 32%; + overflow: visible; + // height:calc(100% - 28px); + // top: 14px; + // right:14px + + ::v-deep .el-drawer { + height: 100%; + overflow: visible; + box-shadow: 0 8px 10px -5px rgb(0 0 0 / 15%), 0 16px 24px 2px rgb(0 0 0 / 9%), 0 6px 30px 5px rgb(0 0 0 / 7%); + + .el-drawer__body { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + + .drawer-heder { + display: flex; + padding: 15px 10px; + justify-content: space-between; + align-items: center; + + .heder-left { + display: flex; + justify-content: space-between; + + .heder-img { + width: 40px; + height: 40px; + margin-right: 10px; + } + + .header-text { + padding:0 20px; + display: flex; + flex-direction: column; + justify-content: space-between; + + span:nth-child(1) { + color: #333; + font-size: 22px; + } + + span:nth-child(2) { + color: #999; + font-size: 16px; + } + } + } + } + + .Descriptions { + padding: 0 10px; + } + + .drawer-main { + // padding-top: 20px; + flex: 1; + overflow: hidden; + // background-color: #efefef; + padding: 10px 20px 20px 30px; + border-top: solid 5px #f6f6f6; + + .el-tabs { + height: 100%; + display: flex; + flex-direction: column; + .el-tabs__header{ + // padding-bottom: 5px ; + .el-tabs__nav{ + z-index: auto !important; + } + } + + .el-tabs__content { + flex: 1; + + .el-tab-pane { + width: 100%; + height: 100%; + overflow-y: auto; + } + + .el-descriptions-item__label { + padding-right: 40px; + } + } + } + } + + .drawer-Shut { + width: 35px; + height: 100px; + position: absolute; + top: 200px; + left: -35px; + + .el-button { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + + ::v-deep span { + font-size: 12px; + letter-spacing: 10px; + writing-mode: tb-rl; + } + } + } + } + } +} + +::v-deep .el-tabs__nav-wrap::after{ + content: unset !important; +} diff --git a/Code/Fe/src/components/commonTabel-drawer/index.vue b/Code/Fe/src/components/commonTabel-drawer/index.vue index 6d9e66d..cd64cba 100644 --- a/Code/Fe/src/components/commonTabel-drawer/index.vue +++ b/Code/Fe/src/components/commonTabel-drawer/index.vue @@ -66,7 +66,20 @@ :propsData="propsData" > + + + @@ -198,6 +199,8 @@ data () { return { dialogShow:true, URLOption_detailList:allUrlOption[this.$route.name].detailListURL,//明细-列表 + URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId',//明细-查看主表的连接id + URLOption_masterName:allUrlOption[this.$route.name].masterName,//明细-列表//明细-查看主表的连接title名称 URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,//明细-查看主表 currenButtonData: [],//头部按钮 operaButtons:[],//操作列按钮 @@ -256,10 +259,10 @@ methods: { }, // 查看主表信息 showParentHandleForDetail(data){ - this.showParentTitle = `[${data.studentName}] 主表信息` + this.showParentTitle = `${data[this.URLOption_masterName]} 主表信息` this.showParentDialog = true this.showParentLoading = true - getListDesById(this.URLOption_parent,data.masterId) + getListDesById(this.URLOption_parent,data[this.URLOption_masterId]) .then(res => { this.showParentTableData = res this.showParentLoading = false diff --git a/Code/Fe/src/components/rowDrop/index.vue b/Code/Fe/src/components/rowDrop/index.vue index 5df37ed..1e7b8a3 100644 --- a/Code/Fe/src/components/rowDrop/index.vue +++ b/Code/Fe/src/components/rowDrop/index.vue @@ -54,12 +54,14 @@ export default { }, data() { return { + historyTableColumns:null, name: null, oldData: null, newData: null, dataList: [], // 全选 allSelect hasSelect NoSelect allSeletType:'NoSelect', + userName:JSON.parse(localStorage.getItem('currentUserInfo')).userName } }, props: { @@ -77,8 +79,9 @@ export default { }, }, mounted() { - this.formatData(this.tableColumns) - this.initSelectSta() + this.historyTableColumns = JSON.parse(JSON.stringify(this.tableColumns)) + this.formatData(this.tableColumns) + this.initSelectSta() }, methods: { reset() { @@ -88,10 +91,11 @@ export default { type: 'warning', cancelButtonClass:'rowDropNotHideItem' }).then(() => { - // 先set是为了字段设置按钮可以监听到缓存变化,之后在移除缓存 - localStorage.setItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name, JSON.stringify([])) - localStorage.removeItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name) - let _resetCol = this.$isTableColumns[this.$route.name] + // 先set是为了字段设置按钮可以监听到缓存变化,之后在移除缓存 this.$store.getters.name.userName + localStorage.setItem('tableColumns_' + this.userName + '_' + this.$route.name, JSON.stringify([])) + localStorage.removeItem('tableColumns_' + this.userName + '_' + this.$route.name) + // let _resetCol = this.$isTableColumns[this.$route.name] + let _resetCol = this.historyTableColumns _resetCol.forEach(item => { item.istrue = true }) @@ -110,16 +114,16 @@ export default { formatData (val) { this.dataList = JSON.parse(JSON.stringify(val)) this.dataList.forEach(item => { - if (item.istrue == undefined) { - item.istrue = true - } + if (item.istrue == undefined) { + item.istrue = true + } }) }, save () { this.$forceUpdate() this.$emit('radio',this.dataList) // 本地缓存 当前用户名 + 路由名称 - localStorage.setItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name, JSON.stringify(this.dataList)) + localStorage.setItem('tableColumns_' + this.userName + '_' + this.$route.name, JSON.stringify(this.dataList)) }, dragstart(value) { this.oldData = value @@ -149,9 +153,12 @@ export default { }, // item元素点击眼睛事件 rediochange(index){ - this.dataList[index].istrue = !this.dataList[index].istrue + // this.dataList[index].istrue = !this.dataList[index].istrue + this.$set(this.dataList[index],'istrue', !this.dataList[index].istrue) this.initSelectSta() - this.save() + this.$nextTick(()=>{ + this.save() + }) }, // 初始化当前全选状态 initSelectSta(){ diff --git a/Code/Fe/src/components/tablePagination/index.vue b/Code/Fe/src/components/tablePagination/index.vue index df69402..8c826c6 100644 --- a/Code/Fe/src/components/tablePagination/index.vue +++ b/Code/Fe/src/components/tablePagination/index.vue @@ -49,6 +49,7 @@ @sortChange="sortChange" @handleSelectionChange="handleSelectionChange" @inlineDialog="inlineDialog" + :buttonOperationList="buttonOperationList" @buttonOperationClick="buttonOperationClick" :tableBorder="true" :firstFixed="true" @@ -107,6 +108,11 @@ export default { return [] } }, + // 操作列按钮 + buttonOperationList:{ + type: Array, + default: null, + }, // 列表数据 tableData: { type: Array, @@ -325,6 +331,10 @@ export default { buttonOperationClick(row, index, label) { this.$emit("buttonOperationClick", row, index, label); }, + //点击table操作列按钮 + buttonOperationClick(row, item, index) { + this.$emit("buttonOperationClick", row, item, index); + }, // 全面筛选组件配置 // 全面筛选组件内部显示/隐藏更改触发,同步当前的showSearchOverall值 getShowSearchOverall(val){ diff --git a/Code/Fe/src/components/umyTable/index.vue b/Code/Fe/src/components/umyTable/index.vue index d708364..9b0ccab 100644 --- a/Code/Fe/src/components/umyTable/index.vue +++ b/Code/Fe/src/components/umyTable/index.vue @@ -19,6 +19,27 @@ header-row-class-name="uTableHeader" > + + + + 操作 + + + {{itemButton.label}} + + @@ -257,18 +278,6 @@ >{{item.label}} - - - - {{itemButton}} - {{ scope.row[item.prop] ? scope.row[item.prop][item.showProp] : "" }} @@ -432,6 +441,11 @@ export default { }, }, props: { + // 操作列按钮 + buttonOperationList:{ + type: Array, + default: null, + }, // 超出内容是否提示 showOverflowTooltip:{ type: Boolean, @@ -867,8 +881,8 @@ export default { this.$emit("buttonClick", row, index, label); }, //点击table操作列按钮 - buttonOperationClick(row, label) { - this.$emit("buttonOperationClick", row, label); + buttonOperationClick(row, item, index) { + this.$emit("buttonOperationClick", row, item, index); }, }, }; @@ -911,9 +925,6 @@ export default { .el-table__fixed-right::before { z-index: auto !important; } -.buttonOperation-btn{ - padding: 0; -} .spamHover { color: #409eff; cursor: pointer; diff --git a/Code/Fe/src/mixins/TableMixins.js b/Code/Fe/src/mixins/TableMixins.js index 9147252..c3d2d08 100644 --- a/Code/Fe/src/mixins/TableMixins.js +++ b/Code/Fe/src/mixins/TableMixins.js @@ -38,6 +38,10 @@ export const tableMixins = { tableDataDetails:[], //默认tag firstTabs:'xq', + // api的表头原始数据 + apiColumns_Table_copy:null, + apiColumns_DesTions_copy:null, + apiColumns_DetailsTable_copy:null, // api的表头数据 apiColumns_Table:null, apiColumns_DesTions:null, @@ -46,9 +50,34 @@ export const tableMixins = { URLOption_base:allUrlOption[this.$route.name].baseURL, //主表-明细 URLOption_detail:allUrlOption[this.$route.name].detailURL, + // 主表-操作列 + operationButtonsTable:[{label:'查看详情',name:'info'}] } }, + mounted() { + // 用于api表头的字段设置监听同步 + window.addEventListener('setItemEvent', (item) => { + if (item.key.indexOf('tableColumns') > -1) { + if(JSON.parse(item.newValue).length <= 0){ + this.apiColumns_Table = this.apiColumns_Table_copy[this.$route.name] + }else{ + this.apiColumns_Table = JSON.parse(item.newValue) + } + } + }) + }, methods: { + // 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题 + initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api){ + // 复制一份原始数据(目的:字段设置恢复) + this.apiColumns_Table_copy = JSON.parse(JSON.stringify(tableColumns_api)) + this.apiColumns_DesTions_copy = JSON.parse(JSON.stringify(tabsDesTions_api)) + this.apiColumns_DetailsTable_copy = JSON.parse(JSON.stringify(detailsTableColumns_api)) + // 赋值表头数据 + this.apiColumns_Table = this.initTableColumns(tableColumns_api[this.$route.name]) + this.apiColumns_DesTions = tabsDesTions_api[this.$route.name] + this.apiColumns_DetailsTable = detailsTableColumns_api[this.$route.name] + }, //渲染数据 paging(callback) { this.Loading.tableLoading = true; @@ -212,13 +241,18 @@ export const tableMixins = { /** * * @param {*} row 当前行数据 - * @param {*} label 按钮name + * @param {*} item 按钮信息 + * @param {*} index 按钮索引 */ - buttonOperationClick(row, label) { + buttonOperationClick(row, item, index) { // 获取当前行数据,赋值给 propsData this.propsData = row - - if (label == "edit") { + // 查看详情 + if (item.name == "info") { + this.inlineDialog(row) + } + // 编辑 + if (item.name == "edit") { this.formTitle = this.$route.meta.title + "编辑"; this.formReveal = false this.theEvent = "edit" @@ -234,7 +268,8 @@ export const tableMixins = { } this.displayDialog.editDialog = true } - if (label == 'delete') { + // 删除 + if (item.name == 'delete') { this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', diff --git a/Code/Fe/src/mixins/mixins.js b/Code/Fe/src/mixins/mixins.js index e39638a..441c825 100644 --- a/Code/Fe/src/mixins/mixins.js +++ b/Code/Fe/src/mixins/mixins.js @@ -55,10 +55,10 @@ export const mixins = { methods: { // 结合默认及缓存中的列表tableColumns数据做初始化 initTableColumns(){ - let _list_defalut = this.$isTableColumns[this.$route.name] + let _list_defalut = columnsData ? columnsData : this.$isTableColumns[this.$route.name] if(!_list_defalut)return - let _local = localStorage.getItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name) - let _list_local = JSON.parse(localStorage.getItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name)) + let _local = localStorage.getItem('tableColumns_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name) + let _list_local = JSON.parse(localStorage.getItem('tableColumns_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name)) let _new_list = [] //格式化后的数据 // 如果没有缓存则直接为默认值 if(!_local){ diff --git a/Code/Fe/src/permission.js b/Code/Fe/src/permission.js index 10cb5ce..fc684ad 100644 --- a/Code/Fe/src/permission.js +++ b/Code/Fe/src/permission.js @@ -39,21 +39,23 @@ router.beforeEach(async (to, from, next) => { isAutoLogin = JSON.parse(_url_isAutoLogin) } let userInfo = localStorage.getItem('currentUserInfo') + let _zh = localStorage.getItem('columnsApiNamesZh') // 是否有用户信息: // 1、如果没有判断是否为自动登录(是自动登录则自动执行登录,账号密码为配置信息中的值,不是自动登录则跳到登录页) // 2、如果有用户信息:则检查是否有api接口的表头数据,没有的话重新获取 if(!userInfo){ - if(isAutoLogin){ - let loginForm= { - userNameOrEmailAddress:localStorage.getItem("userNameOrEmailAddress"), - password:localStorage.getItem("client_secret"), - // rememberMe:true, - // grant_type: 'password', - // client_id: 'Auth_App', - } + if(isAutoLogin || to.query.loginName){ + // let loginForm= { + // userNameOrEmailAddress:localStorage.getItem("userNameOrEmailAddress"), + // password:localStorage.getItem("client_secret"), + // // rememberMe:true, + // // grant_type: 'password', + // // client_id: 'Auth_App', + // } // store.dispatch('user/login', loginForm).then(() => { - login(loginForm).then(()=>{ + // login(loginForm).then(()=>{ getUsersByUserName(localStorage.getItem("userNameOrEmailAddress")).then(res=>{ + // todo:currentUserInfo全程需要优化 localStorage.setItem("currentUserInfo", JSON.stringify(res)); }) .catch(err => { @@ -61,16 +63,16 @@ router.beforeEach(async (to, from, next) => { }) // 提前获取接口监控看板表头数据并存储 getInterfaceBoard().then(result => { - localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.localization.values.Winin)); - next() + localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts)); + next('/') }) .catch(err => { console.log('获取表头失败,请重试') }) - }) - .catch((error) => { - console.log('登录失败') - }) + // }) + // .catch((error) => { + // console.log('登录失败') + // }) }else{ if (to.path != '/login') { next('/login') @@ -84,8 +86,8 @@ router.beforeEach(async (to, from, next) => { // const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") // if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){ getInterfaceBoard().then(result => { - let _zh = localStorage.getItem('columnsApiNamesZh') - localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.localization.values[_zh])); + // todo-new:columnsApiNamesZh配置的地址补全(evel) + localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts)); setTimeout(()=>{ next() },0) diff --git a/Code/Fe/src/utils/baseData/urlOption.js b/Code/Fe/src/utils/baseData/urlOption.js index db30f20..fee01c4 100644 --- a/Code/Fe/src/utils/baseData/urlOption.js +++ b/Code/Fe/src/utils/baseData/urlOption.js @@ -3,6 +3,8 @@ export const TestSchool = { baseURL:'TestSchool/base',//主表-列表 detailURL:'app/test-school',//主表-明细 + 明细-查看主表 detailListURL:'TestStudentDetail/base',//明细-列表, + masterId:'masterId',//明细获取主表信息的masterId(默认) + masterName:'studentName'//明细获取主表信息的title名称 // parentURL:null,//明细-查看主表:特殊接口,如果没有则走detailURL // deleteURL:null,//删除特殊URL // updataURL:null,//新增+编辑特殊URL(新增+编辑使用一个) diff --git a/Code/Fe/src/utils/defaultButtons.js b/Code/Fe/src/utils/defaultButtons.js index d5fba58..d952763 100644 --- a/Code/Fe/src/utils/defaultButtons.js +++ b/Code/Fe/src/utils/defaultButtons.js @@ -42,7 +42,7 @@ export function defaultExportBtn(option) { // 字段设置 export function defaultFieldSettingBtn(option) { // todo:监听已经配置过的字段按钮更改状态特殊显示 - let _local = localStorage.getItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name) + let _local = localStorage.getItem('tableColumns_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name) let _type = '' let _num = 0 if(_local){ diff --git a/Code/Fe/src/utils/tableColumns_api/index.js b/Code/Fe/src/utils/tableColumns_api/index.js index 48248df..b4b0a73 100644 --- a/Code/Fe/src/utils/tableColumns_api/index.js +++ b/Code/Fe/src/utils/tableColumns_api/index.js @@ -4,6 +4,6 @@ import { initFromApiColumnsLable } from '@/utils/index' // 测试数据 export const TestSchool = [ - { label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left", type: "name" }, + { label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left" }, { label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, ] \ No newline at end of file diff --git a/Code/Fe/src/views/dashboard/index.vue b/Code/Fe/src/views/dashboard/index.vue index ca5d4ba..2f72066 100644 --- a/Code/Fe/src/views/dashboard/index.vue +++ b/Code/Fe/src/views/dashboard/index.vue @@ -178,7 +178,7 @@ display: flex; padding-top: 10px; .title{ - width: 180px; + width: 240px; text-align: right; font-weight: bold; flex-shrink: 0; diff --git a/Code/Fe/src/views/interfaceBoard/TestSchool.vue b/Code/Fe/src/views/interfaceBoard/TestSchool.vue index d861436..8a98178 100644 --- a/Code/Fe/src/views/interfaceBoard/TestSchool.vue +++ b/Code/Fe/src/views/interfaceBoard/TestSchool.vue @@ -23,6 +23,8 @@ :primarySearchOption="primarySearchOption" @overallSearchFormClick="overallSearchFormClick" :httpOverallSearchData="httpOverallSearchData" + @buttonOperationClick="buttonOperationClick" + :buttonOperationList="operationButtonsTable" > \ No newline at end of file diff --git a/Code/Fe/src/mixins/LoadingMixins.js b/Code/Fe/src/mixins/LoadingMixins.js index ef83937..efc9f06 100644 --- a/Code/Fe/src/mixins/LoadingMixins.js +++ b/Code/Fe/src/mixins/LoadingMixins.js @@ -18,7 +18,8 @@ export const LoadingMixins = { screenDialog: false, //筛选 AddNewDialog: false, //选择数据弹出框 scanningDialog: false, //扫描 - importDialog: false, //导出 + importDialog: false, //导入 + exportDialog: false, //导出 handleFromDialog: false, //执行生成 }, } diff --git a/Code/Fe/src/mixins/TableHeaderMixins.js b/Code/Fe/src/mixins/TableHeaderMixins.js index 370ca0a..6a1e19e 100644 --- a/Code/Fe/src/mixins/TableHeaderMixins.js +++ b/Code/Fe/src/mixins/TableHeaderMixins.js @@ -30,6 +30,32 @@ export const TableHeaderMixins = { } }, methods: { + // 关闭导出弹窗 + closeExportDrop(){ + this.displayDialog.exportDialog = false + }, + // 导出功能 + exportDropSubmit(type,form){ + const name = this.$route.meta.title + let _params = { + isRedundance:Boolean(form.isRedundance), + isDetailExport:Boolean(form.isDetail), + userId:JSON.parse(localStorage.getItem("currentUserInfo")).id + } + let _exportUrl = this.URLOption_export ? this.URLOption_export : this.URLOption_base; + let _special = this.URLOption_export ? true : false + let _data = JSON.parse(JSON.stringify(this.PageListParams)) + // 全部导出处理 + if(type && type == 'all'){ _data.MaxResultCount = this.totalCount} + this.closeExportDrop() + this.Loading.appMainLoading = true + postExport(_params,_data, _exportUrl, _special).then(res => { + this.blob(res, name)//使用前端导出名称 + this.Loading.appMainLoading = false + }).catch(err => { + this.Loading.appMainLoading = false + }) + }, // 点击常用按钮 topbutton(val,item) { // 更新 @@ -63,52 +89,7 @@ export const TableHeaderMixins = { // } // 导出 else if (val == 'export') { - const name = this.$route.meta.title - let _params = { - isRedundance:Boolean(item.isRedundance), - isDetailExport:Boolean(item.isDetailExport), - userId:JSON.parse(localStorage.getItem("currentUserInfo")).id - } - let _exportUrl = this.URLOption_export ? this.URLOption_export : this.URLOption_base; - let _special = this.URLOption_export ? true : false - this.$confirm('您将进行导出操作, 是否继续?', '提示', { - confirmButtonText: '本页导出', - cancelButtonText: '全部导出', - distinguishCancelAndClose: true, - closeOnClickModal: false, - closeOnPressEscape: false, - type: 'warning' - }).then(() => { - // 本页导出 - this.Loading.appMainLoading = true - // this.PageListParams.company = window.SITE_CONFIG['company'] - // this.PageListParams.function = name - //自定义导出url - // this.PageListParams.route = item.url ? item.url : this.URLOption_base + '/export'; - postExport(_params,this.PageListParams, _exportUrl, _special).then(res => { - this.blob(res, name)//使用前端导出名称 - this.Loading.appMainLoading = false - }).catch(err => { - this.Loading.appMainLoading = false - }) - }).catch((action) => { - if (action === 'cancel') { - // 全部导出 - this.Loading.appMainLoading = true - let params = JSON.parse(JSON.stringify(this.PageListParams)) - params.MaxResultCount = this.totalCount - this.Loading.appMainLoading = true - // params.company = window.SITE_CONFIG['company'] - // params.route = this.URLOption_base + '/export' - // params.function = name - postExport(_params,params, _exportUrl, _special).then(res => { - this.blob(res, name)//使用前端导出名称 - this.Loading.appMainLoading = false - }).catch(err => { - this.Loading.appMainLoading = false - }) - } - }); + this.displayDialog.exportDialog = true } // 导入 else if (val == 'import') { diff --git a/Code/Fe/src/utils/utils.js b/Code/Fe/src/utils/utils.js index 4555d89..5493136 100644 --- a/Code/Fe/src/utils/utils.js +++ b/Code/Fe/src/utils/utils.js @@ -54,7 +54,8 @@ import currenDrawer from "@/components/commonTabel-drawer"; //抽屉 import currenButton from "@/components/currenButton" //按钮 import currenTable from "@/components/currenTable" //table import tablePagination from "@/components/tablePagination"; //第一视图集成 -import importFile from "@/components/importFile" //导出 +import importFile from "@/components/importFile" //导入 +import exportDrop from "@/components/exportDrop" //导出 import pagination from "@/components/Pagination" //分页器 import conditionFilters from "@/components/conditionFilters" //高级筛选 import searchPage from '@/components/searchPage' //autocomplete拉取数据探弹窗 @@ -108,6 +109,7 @@ Vue.component('currenButton', currenButton) Vue.component('currenTable', currenTable) Vue.component('tablePagination', tablePagination) Vue.component('importFile', importFile) +Vue.component('exportDrop', exportDrop) Vue.component('pagination', pagination) Vue.component('conditionFilters', conditionFilters) Vue.component('searchPage', searchPage) diff --git a/Code/Fe/src/views/interfaceBoard/TestSchool.vue b/Code/Fe/src/views/interfaceBoard/TestSchool.vue index 8a98178..b31e52f 100644 --- a/Code/Fe/src/views/interfaceBoard/TestSchool.vue +++ b/Code/Fe/src/views/interfaceBoard/TestSchool.vue @@ -69,6 +69,12 @@ > + +