boxu.zheng 1 year ago
parent
commit
a8041cc5ec
  1. 83
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs
  2. 3
      Code/Fe/public/config.js
  3. 4
      Code/Fe/src/api/wms-interface.js
  4. 559
      Code/Fe/src/components/commonTabel-drawer copy/index.vue
  5. 122
      Code/Fe/src/components/commonTabel-drawer copy/style/index.scss
  6. 155
      Code/Fe/src/components/commonTabel-drawer/index.vue
  7. 15
      Code/Fe/src/components/commonTabel-drawer/style/index.scss
  8. 89
      Code/Fe/src/components/exportDrop/index.vue
  9. 7
      Code/Fe/src/components/filterForDetailPage/index.vue
  10. 72
      Code/Fe/src/components/rowDrop/index.vue
  11. 26
      Code/Fe/src/components/searchOverall/index.vue
  12. 10
      Code/Fe/src/components/tablePagination/index.vue
  13. 97
      Code/Fe/src/components/umyTable/index.vue
  14. 3
      Code/Fe/src/mixins/LoadingMixins.js
  15. 88
      Code/Fe/src/mixins/TableHeaderMixins.js
  16. 84
      Code/Fe/src/mixins/TableMixins.js
  17. 27
      Code/Fe/src/mixins/mixins.js
  18. 46
      Code/Fe/src/permission.js
  19. 2
      Code/Fe/src/utils/baseData/urlOption.js
  20. 5
      Code/Fe/src/utils/defaultButtons.js
  21. 2
      Code/Fe/src/utils/tableColumns_api/index.js
  22. 4
      Code/Fe/src/utils/utils.js
  23. 2
      Code/Fe/src/views/dashboard/index.vue
  24. 23
      Code/Fe/src/views/interfaceBoard/TestSchool.vue

83
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs

@ -285,7 +285,10 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
IWorkbook workbook = new XSSFWorkbook();
var sheet = workbook.CreateSheet(typeof(TEntityDto).Name);
var splitDetailsColumnNumber = 1; //分割主表和从表的列数量
var excelDetailsColor = SetExcelDetailsColor(workbook); //字表样式
var excelDetailsCellStyle = SetExcelDetailsCellStyle(workbook); //子表单元格样式
var excelSplitCellStyle = SetSplitCellStyle(workbook); //分割单元格样式
var excelOnlyMainCellStyle = SetExcelOnlyMainCellStyle(workbook);
var excelHeadCellStyle = SetExcelHeadCellStyle(workbook);
// 获取主表的属性 创建主表 表头
var mainAllProperties = typeof(TEntityDto).GetProperties();
@ -305,13 +308,15 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
#endregion
var headerRow = sheet.CreateRow(0);
var headerRow = sheet.CreateRow(0);//标头列
for (var i = 0; i < mainProperties.Length; i++)
{
var englishName = mainProperties[i].Name;
//本地化
var localizerName = _localizer[typeof(TEntity).Name + englishName];
headerRow.CreateCell(i).SetCellValue(localizerName);
var headCell = headerRow.CreateCell(i);
headCell.SetCellValue(localizerName);
headCell.CellStyle = excelHeadCellStyle;
}
// 获取从表的属性 创建从表 表头
@ -332,7 +337,7 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
if (isHasDetail)
{
headerRow.CreateCell(mainProperties.Length).SetCellValue("---分割---");
headerRow.CreateCell(mainProperties.Length).SetCellValue("---分割---");
#region 用户个性导出 从表
@ -355,7 +360,7 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
headerRow.CreateCell(mainProperties.Length + splitDetailsColumnNumber + i)
.SetCellValue(detailProperties[i].Name);
var headCell = headerRow.GetCell(mainProperties.Length + splitDetailsColumnNumber + i);
headCell.CellStyle = excelDetailsColor;
headCell.CellStyle = excelHeadCellStyle;
}
}
}
@ -368,7 +373,7 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
{
// 获取从表数据
var detailsIndex = mainAllProperties.FindIndex(p => p.Name == "Details");
//
//
var detailList = (IEnumerable<object>)mainAllProperties[detailsIndex].GetValue(mainDto);
var startMainRowIndex = rowIndex;
for (var datailCount = 0; datailCount < detailList.Count(); datailCount++)
@ -407,13 +412,17 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
{
//填充子表数据
var detailRow = sheet.GetRow(startMainRowIndex);
var splitCell = detailRow.CreateCell(mainProperties.Length);
splitCell.CellStyle = excelSplitCellStyle;
for (var i = 0; i < detailProperties.Length; i++)
{
var value = detailProperties[i].GetValue(detail);
detailRow.CreateCell(mainProperties.Length + splitDetailsColumnNumber + i)
.SetCellValue(value?.ToString());
var detailCell = detailRow.GetCell(mainProperties.Length + splitDetailsColumnNumber + i);
detailCell.CellStyle = excelDetailsColor;
detailCell.CellStyle = excelDetailsCellStyle;
}
}
@ -429,6 +438,10 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
var value = mainProperties[i].GetValue(mainDto);
dataRow.CreateCell(i).SetCellValue(value?.ToString());
}
if (rowIndex % 2 == 0)
{
dataRow.RowStyle = excelOnlyMainCellStyle;
}
}
//添加1个空行将2条数据分割开
@ -440,9 +453,11 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
if (isHasDetail)
{
// 自动调整列宽
for (var i = 0; i < mainProperties.Length + detailProperties.Length; i++)
for (var i = 0; i < mainProperties.Length + splitDetailsColumnNumber + detailProperties.Length; i++)
{
sheet.AutoSizeColumn(i + splitDetailsColumnNumber);
sheet.AutoSizeColumn(i);
sheet.SetColumnWidth(i, Math.Max(sheet.GetColumnWidth(i) + 150, 265 * 15));
sheet.SetColumnWidth(mainProperties.Length, 3600);
}
}
else
@ -451,6 +466,7 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
for (var i = 0; i < mainProperties.Length; i++)
{
sheet.AutoSizeColumn(i);
sheet.SetColumnWidth(i, Math.Max(sheet.GetColumnWidth(i) + 150, 265 * 15));
}
}
@ -490,6 +506,7 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
bool includeDetails = false, CancellationToken cancellationToken = default)
{
var query = await Repository.WithDetailsAsync();
//var query = await Repository.GetQueryableAsync();
var entities = query.Where(expression);
entities = GetSortingQueryable(entities, sorting);
@ -548,7 +565,53 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
/// </summary>
/// <param name="workbook"></param>
/// <returns></returns>
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;
}
/// <summary>
/// 导出设置只有主表时的交替行 单元格样式
/// </summary>
/// <param name="workbook"></param>
/// <returns></returns>
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;
}
/// <summary>
/// 设置分割单元格的演示
/// </summary>
/// <param name="workbook"></param>
/// <returns></returns>
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;
}
/// <summary>
/// 导出设置表头单元格样式
/// </summary>
/// <param name="workbook"></param>
/// <returns></returns>
private static ICellStyle SetExcelHeadCellStyle(IWorkbook workbook)
{
var cellStyle = workbook.CreateCellStyle();
cellStyle.FillBackgroundColor = IndexedColors.LightOrange.Index;

3
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

4
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}
})
}

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

@ -0,0 +1,559 @@
<template>
<el-drawer
v-loading="DrawerLoading"
v-if="drawer"
:visible="true"
:close-on-press-escape="false"
:wrapperClosable="false"
:with-header="false"
:modal="false"
size="100%"
>
<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>
</div>
</div>
<div class="heder-right">
<curren-Button
:Butttondata="Butttondata"
@tableButtonClick="tableButtonClick"
>
<template>
<el-dropdown
trigger="click"
@command="handleCommand"
v-if="JSON.stringify(dropdownData) != '{}'"
>
<el-button size="mini" icon="el-icon-more"></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(item, index) in dropdownData"
:key="index"
:command="item.command"
>{{ item.label }}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</template>
</curren-Button>
</div>
</div>
<div class="drawer-main">
<curren-tabs
:tabsData="dropdownTabs"
:activeName="firstTabs"
type="border-card"
@handleClick="handleClick"
>
<template slot-scope="scope">
<curren-descriptions
border
v-if="scope.value == 'xq'"
:column="column"
:direction="direction"
:colon="false"
:tabsDesTions="tabsDesTions"
:propsData="propsData"
>
</curren-descriptions>
<!-- currenTableDetails 组件 明细中带分页功能 -->
<umyTable
v-if="scope.value == 'mx'"
:tableBorder="true"
:tableData="propsData.details"
:propsData="propsData"
:tableColumns="tableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
:setUTableHeight="260"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 明细页码 -->
<pagination
v-if="scope.value == 'mx'"
:totalCount="totalCount"
:pagesizeProps="MaxResultCount"
@SizeChange="alterResultCountDetails"
@CurrentChange="alertoldSkipCountDetails"
:currentPageProps="currentPage"
></pagination>
<!-- 新增汇总 表头 区分明细表头使用 summaryTableColumns -->
<umyTable
v-if="scope.value == 'hz'"
:tableBorder="true"
:tableData="propsData.summaryDetails"
:tableColumns="summaryTableColumns.length == 0 ? tableColumns : summaryTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:setUTableHeight="210"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 自定义扩展 -->
<umyTable
v-if="
scope.value == zdyValue &&
scope.value != 'xq' &&
scope.value != 'mx' &&
scope.value != 'hz' &&
scope.value != 'zwlcj'
"
:tableBorder="true"
:tableLoading="tableLoading"
:tableData="otherData"
:tableColumns="zdyTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:setUTableHeight="210"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 自定义扩展tree的形式 目前使用位置物品清单信息-子物品层级 todo:待优化-->
<currenTable
v-if="
scope.value == zdyValue &&
scope.value == 'zwlcj'
"
:tableLoading="tableLoading"
:tableData="otherData"
:tableColumns="zdyTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
:treeProps="{children: 'children', hasChildren: 'hasChildren'}"
@buttonClick="buttonClick"
>
<template>
<slot></slot>
</template>
</currenTable>
</template>
</curren-tabs>
</div>
<div class="drawer-Shut" @click="drawerShut">
<el-button type="danger" size="mini">关闭</el-button>
</div>
</el-drawer>
</template>
<script>
import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode,
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect
} from "@/api/wms-api"
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"
export default {
name: 'currenTabel-drawer',
components: {
pagination,
currenButton,
currenDescriptions,
currenTabs,
currenTable,
},
props: {
title: {
type: Array,
default: () => {
return []
}
},
DrawerLoading: {
type: Boolean,
default: true
},
drawer: {
type: Boolean,
default: false
},
dropdownData: {
type: Object,
default: () => {
return {}
}
},
propsData: {
type: Object,
default: () => {
return {}
}
},
tabsDesTions: {
type: Array,
default: () => {
return []
}
},
dropdownTabsData: {
type: Array,
default: () => {
return []
}
},
tableLoading: {
type: Boolean,
default: false
},
tableColumns: {
type: Array,
default: () => {
return []
}
},
summaryTableColumns: {
type: Array,
default: () => {
return []
}
},
Butttondata: {
type: Array,
default: () => {
return [{
type: 'warning',
icon: 'el-icon-edit',
label: '编辑',
name: 'edit',
size: 'mini'
}]
}
},
selectionTable: {
type: Boolean,
default: false
},
MaxResultCount: {
type: Number,
default: 0
},
totalCount: {
type: Number,
default: 0
},
currentPage: {
type: Number,
default: 0
},
// 2
column: {
type: Number,
default: 2
},
//
direction: {
type: String,
default: 'horizontal'
},
// tabs
firstTabs: {
type: String,
default: 'xq'
}
},
computed: {
dropdownTabs () {
// tabs
if (this.dropdownTabsData.length !== 0) {
return this.dropdownTabsData
} else {
//
if (Object.keys(this.propsData).length != 0) {
this.initDropdownTabsData = [{
label: "详情",
name: 'xq'
},
{
label: "明细",
name: 'mx'
},
{
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
}
},
},
mounted () {
},
data () {
return {
otherData:[], // tabs
zdyTableColumns:[], //
zdyValue:'', //
// firstTabs:'xq',
initDropdownTabsData:[
{
label: "详情",
name: 'xq'
},
{
label: "明细",
name: 'mx'
},
{
label: "汇总",
name: 'hz'
}
]
}
},
methods: {
handleCommand (command) {
this.$emit('handleCommand', command)
},
drawerShut () {
this.$emit('drawerShut', false)
},
tableButtonClick (val) {
this.$emit('drawerbutton', val)
},
//
sortChange (data) {
this.$emit('sortChange', data)
},
//selection
handleSelectionChange (val) {
this.$emit("handleSelectionChange", val)
},
//nameemit
inlineDialog (row) {
this.$emit("inlineDialog", row)
},
//emit
alterResultCountDetails (val) {
this.$emit('alterResultCountDetails', val)
},
//emit
alertoldSkipCountDetails (val) {
this.$emit('alertoldSkipCountDetails', val)
},
buttonClick(row) {
this.$emit("buttonClick", row);
},
// tabs
handleClick (val) {
this.$emit("currenTabsChange", val);//tab
this.zdyValue = val.name
this.dropdownTabsData.forEach( item => {
if (item.name == val.name) {
let parent = this.$parent
parent.tableLoading = true
//
parent.firstTabs = val.name
if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') {
this.zdyTableColumns = []
this.otherData = []
parent.tableLoading = false
} else {
this.zdyTableColumns = []
this.otherData = []
// this.firstTabs = val.name
// tab
if (item.functionName == 'getListByItemcode') {
let params = {
itemCode: this.propsData.code
}
getListByItemcode(params, 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 == '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"){
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = this.propsData.noteAndBackFlushDetails
}
}
}
})
},
//
recursion(val){
val.forEach(item => {
if(item.componentDTOs) {
item.children = item.componentDTOs
this.recursion(item.componentDTOs)
}
})
}
}
}
</script>
<style lang="scss" scoped>
// el-drawer
@import "./style/index.scss";
</style>

122
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;
}

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

@ -66,16 +66,61 @@
:propsData="propsData"
>
</curren-descriptions>
<!-- todo-new 代码整理-->
<div
class="currenTabel-drawer-mx-header"
v-if="scope.value == 'mx' && (showDetailColumnsSet || showDetailFilters)"
>
<el-button
v-if="showDetailColumnsSet"
class="rowDropNotHideItem"
@click="columnsSettingHandle()"
size="mini"
>字段设置</el-button>
<el-button
type="primary"
v-if="showDetailFilters"
@click="detailFiltersHandle()"
size="mini"
>筛选</el-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"
@ -167,6 +212,7 @@
</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 +221,8 @@ 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'
export default {
name: 'currenTabel-drawer',
components: {
@ -183,8 +231,25 @@ export default {
currenDescriptions,
currenTabs,
currenTable,
searchOverall,
rowDrop
},
props: {
// -
showDetailColumnsSet:{
type: Boolean,
default: true
},
// -
showDetailFilters:{
type: Boolean,
default: true
},
// --
detailSearchDataFE:{
type: Object,
default: null
},
title: {
type: Array,
default: () => {
@ -291,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
@ -328,9 +381,24 @@ export default {
},
},
mounted () {
//
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 {
// table key
isUpdate: false,
// -
rowDropVisible: false,
otherData:[], // tabs
zdyTableColumns:[], //
zdyValue:'', //
@ -348,11 +416,42 @@ export default {
label: "汇总",
name: 'hz'
}
]
],
detailFiltersVisible:false,//
filterActionOptions:[{
value: '==',
label: '等于'
}, {
value: '!=',
label: '不等于'
}],
}
},
methods: {
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)
},

15
Code/Fe/src/components/commonTabel-drawer/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;
}
}

89
Code/Fe/src/components/exportDrop/index.vue

@ -0,0 +1,89 @@
<template>
<div>
<el-dialog
title="导出"
:visible.sync="show"
:append-to-body="true"
:modal-append-to-body="false"
width="800px"
:show-close="true"
@close="close"
>
<div class="formItem">
<span class="title">是否显示明细</span>
<el-radio-group v-model="form.isDetail" >
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</div>
<div class="formItem">
<span class="title">是否冗余主表数据</span>
<el-radio-group v-model="form.isRedundance" >
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="submit('page')">本页导出</el-button>
<el-button
:spinner="'el-icon-loading'"
type="primary"
@click="submit('all')"
>全部导出</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'exportDrop',
props: {
//
isDetail:{
type: Boolean,
default: true,
},
//
isRedundance:{
type: Boolean,
default: true,
},
},
data () {
return {
show:true,
form:{
isDetail:null,
isRedundance:null,
}
}
},
mounted () {
this.form={
isDetail:this.isDetail,
isRedundance:this.isRedundance,
}
},
methods: {
close() {
this.show = false
this.$emit("closeDialog")
},
submit(type){
this.$emit("exportDropSubmit",type,this.form)
}
}
}
</script>
<style lang="scss" scoped>
.formItem{
padding-bottom: 15px;
display: flex;
.title{
width: 180px;
text-align: right;
padding-right: 10px;
}
}
</style>

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

@ -46,6 +46,7 @@
label="操作"
:align="'center'"
width="150"
fixed="right"
>
<template slot-scope="scope">
<span v-for="item in operaButtons" style="margin: 0 10px;">
@ -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

72
Code/Fe/src/components/rowDrop/index.vue

@ -15,7 +15,7 @@
<i class="el-icon-success icon" v-if="allSeletType == 'NoSelect'" style="color:#999" ></i>
全选
</div>
<transition-group class="transition-wrapper" name="sort">
<transition-group class="transition-wrapper" :style="{maxHeight:innerMaxHeight}" name="sort">
<div
v-for="(item,index) in dataList"
:key='index+item.label'
@ -54,31 +54,43 @@ 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: {
visible: {
type: Boolean,
default: () => {
return false
}
},
tableColumns: {
type: Array,
default: () => {
return [];
},
},
innerMaxHeight:{
type:String,
default:'calc(90vh - 280px)'
},
visible: {
type: Boolean,
default: () => {
return false
}
},
tableColumns: {
type: Array,
default: () => {
return [];
},
},
// list_api detail_api detailPage_api list detail detailPage
source:{
type:String,
default:'list_api'
}
},
mounted() {
this.formatData(this.tableColumns)
this.initSelectSta()
this.historyTableColumns = JSON.parse(JSON.stringify(this.tableColumns))
this.formatData(this.tableColumns)
this.initSelectSta()
},
methods: {
reset() {
@ -88,16 +100,17 @@ 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('file_Columns_' + this.source + '_' + this.userName + '_' + this.$route.name, JSON.stringify([]))
localStorage.removeItem('file_Columns_' + this.source + '_' +this.userName + '_' + this.$route.name)
// let _resetCol = this.$isTableColumns[this.$route.name]
let _resetCol = this.historyTableColumns
_resetCol.forEach(item => {
item.istrue = true
})
this.dataList = _resetCol
this.initSelectSta()
this.$emit('radio',_resetCol)
this.$emit('radio',_resetCol,this.source)
this.close()
}).catch(() => {
@ -110,16 +123,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)
this.$emit('radio',this.dataList,this.source)
// +
localStorage.setItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name, JSON.stringify(this.dataList))
localStorage.setItem('file_Columns_' + this.source + '_' + this.userName + '_' + this.$route.name, JSON.stringify(this.dataList))
},
dragstart(value) {
this.oldData = value
@ -149,9 +162,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(){
@ -187,7 +203,7 @@ $paddingSize:20px;
}
.transition-wrapper {
display: block;
max-height: calc(90vh - 280px);
// max-height: calc(90vh - 280px);
overflow: auto;
padding: 0 0 $paddingSize $paddingSize;

26
Code/Fe/src/components/searchOverall/index.vue

@ -70,7 +70,7 @@
<el-select
v-model="item.action"
placeholder="请选择条件"
:disabled="item.column == '' || item.hide ? true : false"
:disabled="disabledAction || item.column == '' || item.hide ? true : false"
>
<!-- moreListOptions.action -->
<el-option
@ -137,7 +137,7 @@
<el-select
v-model="item.logic"
placeholder="请选择关系"
:disabled="item.column == '' || item.hide ? true : false"
:disabled="disabledLogic || item.column == '' || item.hide ? true : false"
>
<el-option
v-for="item in moreListOptions.logic"
@ -233,6 +233,16 @@ export default {
}
},
props: {
//
disabledAction:{
type: Boolean,
default: false
},
//
disabledLogic:{
type: Boolean,
default: false
},
//
showSearchOverall:{
type: Boolean,
@ -268,7 +278,12 @@ export default {
httpOverallSearchData:{
type: Object,
default: null
}
},
//
filterActionOptions:{
type: Array,
default: null
},
},
data() {
return {
@ -419,6 +434,11 @@ export default {
},
//
formatMoreListOptions(val) {
// filterActionOptions
if(this.filterActionOptions){
this.moreListOptions.action = this.filterActionOptions
return this.moreListOptions.action
}
if (val) {
for(var i =0; i< this.tableColumns.length; i++) {
if (val == this.tableColumns[i].prop) {

10
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){

97
Code/Fe/src/components/umyTable/index.vue

@ -19,6 +19,27 @@
header-row-class-name="uTableHeader"
>
<!-- :tree-props="treeProps" height 不能共存 此组件暂不支持tree的格式-->
<!-- 操作列 -->
<u-table-column
v-if="buttonOperationList"
:fixed="'left'"
:width="120"
:align="'center'"
:header-align="'center'"
>
<template #header>
<span>操作</span>
</template>
<template slot-scope="scope">
<el-button
v-for="(itemButton, indexButton) in buttonOperationList"
:key="indexButton"
type="text"
size="mini"
@click="buttonOperationClick(scope.row, itemButton, indexButton)"
>{{itemButton.label}}</el-button>
</template>
</u-table-column>
<u-table-column v-if="selectionTable" fixed="left" type="selection" :reserve-selection="true" />
<u-table-column v-if="isShowIndex" type="index" fixed="left" label="序号" width="50" />
<template v-for="(item, index) in TableSize">
@ -257,18 +278,6 @@
>{{item.label}}</el-button>
</div>
<!-- </el-form-item> -->
<!-- table表添加操作列 -->
<div v-if="item.type == 'buttonOperation'">
<el-button
class="buttonOperation-btn"
v-for="(itemButton, indexButton) in item.buttonText.split('|')"
:key="indexButton"
type="text"
size="mini"
@click="buttonOperationClick(scope.row, item.buttonName.split('|')[indexButton])"
>{{itemButton}}</el-button>
</div>
<span v-if="item.type == 'object'">
{{ scope.row[item.prop] ? scope.row[item.prop][item.showProp] : "" }}
</span>
@ -345,6 +354,27 @@
{{ showDetailData ? showDetailData + "" : showDetailData }}
</el-dialog>
<!-- json弹窗复制的json内容 -->
<el-dialog
id="copyJsonTextarea_dialog_ref"
:visible.sync="showJsonCopy"
:modal-append-to-body="false"
:append-to-body="true"
:show-close="true"
:close-on-click-modal="true"
:close-on-press-escape="true"
:title="'JSON详情'"
>
<el-input
ref="copyJsonTextarea_ref"
type="textarea"
readonly
autosize
placeholder="请输入内容"
v-model="showJsonData_str">
</el-input>
</el-dialog>
<!-- 点开查看Json转换后table弹窗 -->
<el-dialog
:visible.sync="showJsonDialog"
@ -355,6 +385,11 @@
:close-on-press-escape="true"
:title="'内容详情'"
>
<el-button
@click="copyJsonHandle()"
type="primary"
style="margin-bottom: 10px;float: right;"
>复制JSON</el-button>
<el-table
:data="showJsonData"
:border="true"
@ -369,7 +404,7 @@
>
<template slot-scope="scope">
<!-- DETAILS todo:DETAILS判断条件需要优化使用传参的方式 -->
<span v-if="(scope.row.name).toUpperCase != 'DETAILS'">{{scope.row.value}}</span>
<span v-if="(scope.row.name).toUpperCase() != 'DETAILS'">{{scope.row.value}}</span>
<el-table
v-else
height="300"
@ -406,6 +441,11 @@ export default {
},
},
props: {
//
buttonOperationList:{
type: Array,
default: null,
},
//
showOverflowTooltip:{
type: Boolean,
@ -502,6 +542,8 @@ export default {
showDetailData:null,//
showJsonDialog:false,//Jsontable
showJsonData:null,//Json
showJsonData_str:null,//Json
showJsonCopy:false,//jsonDialog
};
},
computed: {
@ -795,7 +837,7 @@ export default {
//
if(Array.isArray(_json[item])){
// DETAILS todo:DETAILS使
let _value = (item).toUpperCase == 'DETAILS' ? __initJson(_json[item][0]) : (_json[item]).join(",")
let _value = (item).toUpperCase() == 'DETAILS' ? __initJson(_json[item][0]) : (_json[item]).join(",")
_arr.push({name:item,value:_value})
}
//
@ -812,15 +854,35 @@ export default {
}
}
this.showJsonData = _arr
this.showJsonData_str = JSON.stringify(JSON.parse(JSON.stringify(this.showJsonData)), null, '\t')
this.$emit("showJsonTable", row);
},
// Json
copyJsonHandle(){
this.showJsonCopy = true
navigator.clipboard.writeText(this.showJsonData_str)
.then(() => {
this.$message.success('复制成功');
})
.catch(err => {
this.$message.error('复制失败');
});
this.$nextTick(()=>{
if(this.$refs.copyJsonTextarea_ref){
this.$refs.copyJsonTextarea_ref.focus()
this.$nextTick(()=>{
document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0
})
}
})
},
//
buttonClick(row, index, label) {
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);
},
},
};
@ -863,9 +925,6 @@ export default {
.el-table__fixed-right::before {
z-index: auto !important;
}
.buttonOperation-btn{
padding: 0;
}
.spamHover {
color: #409eff;
cursor: pointer;

3
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, //执行生成
},
}

88
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') {
@ -316,9 +297,18 @@ export const TableHeaderMixins = {
});
}
},
// 表头字段设置
rowDrop(data) {
this.tableColumns = data
/**
* 表头字段设置
* @param {*} data 数据
* @param {*} type 设置来源
* list_api: 表头来自api的列表 detail_api: 表头来自api列表的明细
* list: 表头固定的列表 detail: 表头固定列表的明细
*/
rowDrop(data,type) {
if(!type || type == 'list_api'){ this.apiColumns_Table = data }
if(type && type == 'detail_api'){ this.apiColumns_DetailsTable = data }
if(type && type == 'list'){ this.tableColumns = data }
if(type && type == 'detail'){ this.detailsTableColumns = data }
}
}
}

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

@ -35,7 +35,7 @@ export const tableMixins = {
//每页最大显示数
MaxResultCountDetails: 20,
// 明细数据临时存储
tableDataDetails:[],
tableDataDetails:null,
//默认tag
firstTabs:'xq',
// api的表头数据
@ -46,9 +46,21 @@ export const tableMixins = {
URLOption_base:allUrlOption[this.$route.name].baseURL,
//主表-明细
URLOption_detail:allUrlOption[this.$route.name].detailURL,
// 主表-明细-筛选数据同步回显
detailSearchDataFE:null,
// 主表-操作列
operationButtonsTable:[{label:'查看详情',name:'info'}]
}
},
methods: {
// 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题
initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api){
// 赋值表头数据
this.apiColumns_Table = this.initTableColumns(tableColumns_api[this.$route.name])
this.apiColumns_DesTions = tabsDesTions_api[this.$route.name]
this.apiColumns_DetailsTable = this.initTableColumns(detailsTableColumns_api[this.$route.name],'detail_api')
},
//渲染数据
paging(callback) {
this.Loading.tableLoading = true;
@ -100,14 +112,9 @@ export const tableMixins = {
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))
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
}
@ -116,6 +123,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
@ -212,13 +227,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 +254,8 @@ export const tableMixins = {
}
this.displayDialog.editDialog = true
}
if (label == 'delete') {
// 删除
if (item.name == 'delete') {
this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -260,6 +281,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

27
Code/Fe/src/mixins/mixins.js

@ -54,11 +54,12 @@ export const mixins = {
},
methods: {
// 结合默认及缓存中的列表tableColumns数据做初始化
initTableColumns(){
let _list_defalut = this.$isTableColumns[this.$route.name]
initTableColumns(columnsData,type){
let _list_defalut = columnsData ? columnsData : this.$isTableColumns[this.$route.name]
let _type = type ? type : 'list_api'
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('file_Columns_' + _type + '_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name)
let _list_local = JSON.parse(localStorage.getItem('file_Columns_' + _type + '_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name))
let _new_list = [] //格式化后的数据
// 如果没有缓存则直接为默认值
if(!_local){
@ -71,14 +72,16 @@ export const mixins = {
else{
// 先处理缓存数据,设置索引
let _locals = {}
_list_local.forEach((localItem,index) => {
localItem.itemIndex = index
if(localItem.showProp && typeof localItem.showProp == 'string'){
_locals[localItem.showProp] = localItem
}else{
_locals[localItem.prop] = localItem
}
})
if(_list_local){
_list_local.forEach((localItem,index) => {
localItem.itemIndex = index
if(localItem.showProp && typeof localItem.showProp == 'string'){
_locals[localItem.showProp] = localItem
}else{
_locals[localItem.prop] = localItem
}
})
}
// 将缓存与默认设置合并,索引同步
let _number = 0
_list_defalut.forEach((defalutItem) => {

46
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')
@ -83,13 +85,13 @@ router.beforeEach(async (to, from, next) => {
// 重新获取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)
})
getInterfaceBoard().then(result => {
// todo-new:columnsApiNamesZh配置的地址补全(evel)
localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts));
setTimeout(()=>{
next()
},0)
})
}else{
next()
}

2
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(新增+编辑使用一个)

5
Code/Fe/src/utils/defaultButtons.js

@ -40,9 +40,10 @@ export function defaultExportBtn(option) {
}
// 字段设置
export function defaultFieldSettingBtn(option) {
export function defaultFieldSettingBtn(option,source) {
let _source = source ? source : 'list_api'
// todo:监听已经配置过的字段按钮更改状态特殊显示
let _local = localStorage.getItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name)
let _local = localStorage.getItem('file_Columns_' + _source + '_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name)
let _type = ''
let _num = 0
if(_local){

2
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" },
]

4
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)

2
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;

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

@ -23,15 +23,20 @@
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
@buttonOperationClick="buttonOperationClick"
:buttonOperationList="operationButtonsTable"
></tablePagination>
<curren-Drawer
:title="apiColumns_DesTions"
@rowDrop="rowDrop"
:tableColumns="apiColumns_DetailsTable"
:tabsDesTions="apiColumns_DesTions"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:dropdownData="dropdownData"
:propsData="propsData"
@detailFiltersSearch="detailFiltersSearch"
:detailSearchDataFE="detailSearchDataFE"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle"
@ -59,6 +64,7 @@
@close="FormClose"
@goBack="goBack"
></newAndEdiDialog>
<!-- 明细查询页面 -->
<filterForDetailPage
v-if="filterForDetailShow"
:listColumns="apiColumns_DetailsTable"
@ -67,6 +73,12 @@
></filterForDetailPage>
<!-- DeleteApi="TestSchoolDetailList_delete" -->
<!-- todo: 明细查询中的parentColumns 是否需要独立表头现与列表页面一致-->
<!-- 导出弹窗 -->
<exportDrop
v-if="displayDialog.exportDialog"
@closeDialog="closeExportDrop"
@exportDropSubmit="exportDropSubmit"
></exportDrop>
</div>
</template>
<script>
@ -110,6 +122,7 @@ export default {
isRedundance:true,
isDetailExport:true
}),//
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
this.defaultFilterForDetailBtn()//
@ -163,17 +176,9 @@ export default {
};
},
mounted() {
this.initApiColumns()
this.initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api)
this.paging();
},
methods: {
// api
initApiColumns(){
this.apiColumns_Table = tableColumns_api[this.$route.name]
this.apiColumns_DesTions = tabsDesTions_api[this.$route.name]
this.apiColumns_DetailsTable = detailsTableColumns_api[this.$route.name]
},
}
}
</script>
<style lang="scss" scoped>

Loading…
Cancel
Save