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(); IWorkbook workbook = new XSSFWorkbook();
var sheet = workbook.CreateSheet(typeof(TEntityDto).Name); var sheet = workbook.CreateSheet(typeof(TEntityDto).Name);
var splitDetailsColumnNumber = 1; //分割主表和从表的列数量 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(); var mainAllProperties = typeof(TEntityDto).GetProperties();
@ -305,13 +308,15 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
#endregion #endregion
var headerRow = sheet.CreateRow(0); var headerRow = sheet.CreateRow(0);//标头列
for (var i = 0; i < mainProperties.Length; i++) for (var i = 0; i < mainProperties.Length; i++)
{ {
var englishName = mainProperties[i].Name; var englishName = mainProperties[i].Name;
//本地化 //本地化
var localizerName = _localizer[typeof(TEntity).Name + englishName]; 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) if (isHasDetail)
{ {
headerRow.CreateCell(mainProperties.Length).SetCellValue("---分割---"); headerRow.CreateCell(mainProperties.Length).SetCellValue("---分割---");
#region 用户个性导出 从表 #region 用户个性导出 从表
@ -355,7 +360,7 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
headerRow.CreateCell(mainProperties.Length + splitDetailsColumnNumber + i) headerRow.CreateCell(mainProperties.Length + splitDetailsColumnNumber + i)
.SetCellValue(detailProperties[i].Name); .SetCellValue(detailProperties[i].Name);
var headCell = headerRow.GetCell(mainProperties.Length + splitDetailsColumnNumber + i); 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 detailsIndex = mainAllProperties.FindIndex(p => p.Name == "Details");
// //
var detailList = (IEnumerable<object>)mainAllProperties[detailsIndex].GetValue(mainDto); var detailList = (IEnumerable<object>)mainAllProperties[detailsIndex].GetValue(mainDto);
var startMainRowIndex = rowIndex; var startMainRowIndex = rowIndex;
for (var datailCount = 0; datailCount < detailList.Count(); datailCount++) 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 detailRow = sheet.GetRow(startMainRowIndex);
var splitCell = detailRow.CreateCell(mainProperties.Length);
splitCell.CellStyle = excelSplitCellStyle;
for (var i = 0; i < detailProperties.Length; i++) for (var i = 0; i < detailProperties.Length; i++)
{ {
var value = detailProperties[i].GetValue(detail); var value = detailProperties[i].GetValue(detail);
detailRow.CreateCell(mainProperties.Length + splitDetailsColumnNumber + i) detailRow.CreateCell(mainProperties.Length + splitDetailsColumnNumber + i)
.SetCellValue(value?.ToString()); .SetCellValue(value?.ToString());
var detailCell = detailRow.GetCell(mainProperties.Length + splitDetailsColumnNumber + i); 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); var value = mainProperties[i].GetValue(mainDto);
dataRow.CreateCell(i).SetCellValue(value?.ToString()); dataRow.CreateCell(i).SetCellValue(value?.ToString());
} }
if (rowIndex % 2 == 0)
{
dataRow.RowStyle = excelOnlyMainCellStyle;
}
} }
//添加1个空行将2条数据分割开 //添加1个空行将2条数据分割开
@ -440,9 +453,11 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
if (isHasDetail) 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 else
@ -451,6 +466,7 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
for (var i = 0; i < mainProperties.Length; i++) for (var i = 0; i < mainProperties.Length; i++)
{ {
sheet.AutoSizeColumn(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) bool includeDetails = false, CancellationToken cancellationToken = default)
{ {
var query = await Repository.WithDetailsAsync(); var query = await Repository.WithDetailsAsync();
//var query = await Repository.GetQueryableAsync();
var entities = query.Where(expression); var entities = query.Where(expression);
entities = GetSortingQueryable(entities, sorting); entities = GetSortingQueryable(entities, sorting);
@ -548,7 +565,53 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
/// </summary> /// </summary>
/// <param name="workbook"></param> /// <param name="workbook"></param>
/// <returns></returns> /// <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(); var cellStyle = workbook.CreateCellStyle();
cellStyle.FillBackgroundColor = IndexedColors.LightOrange.Index; cellStyle.FillBackgroundColor = IndexedColors.LightOrange.Index;

3
Code/Fe/public/config.js

@ -1,6 +1,7 @@
// dev_win // dev_win
window.SITE_CONFIG['base'] = 'http://dev.ccwin-in.com:60069' 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['columnsApiNamesZh'] = 'Winin'
window.SITE_CONFIG['isAutoLogin'] = false window.SITE_CONFIG['isAutoLogin'] = false
window.SITE_CONFIG['isSinglePage'] = 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() { export function getInterfaceBoard() {
return request({ return request({
method:'get', 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" :propsData="propsData"
> >
</curren-descriptions> </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 组件 明细中带分页功能 --> <!-- currenTableDetails 组件 明细中带分页功能 -->
<umyTable <umyTable
v-if="scope.value == 'mx'" v-if="scope.value == 'mx'"
:isUpdate="isUpdate"
:tableBorder="true" :tableBorder="true"
:tableData="propsData.details" :tableData="propsData.details"
:propsData="propsData" :propsData="propsData"
:tableColumns="tableColumns" :tableColumns="tableColumns"
:selectionTable="selectionTable" :selectionTable="selectionTable"
:requiredRules="false" :requiredRules="false"
:setUTableHeight="260" :setUTableHeight="showDetailColumnsSet ? 300 : 260"
@sortChange="sortChange" @sortChange="sortChange"
@handleSelectionChange="handleSelectionChange" @handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog" @inlineDialog="inlineDialog"
@ -167,6 +212,7 @@
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
import searchOverall from "@/components/searchOverall"
import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode, import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode,
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect
} from "@/api/wms-api" } from "@/api/wms-api"
@ -175,6 +221,8 @@ import currenDescriptions from "@/components/currenDescriptions"
import currenTabs from "@/components/currenTabs" import currenTabs from "@/components/currenTabs"
import currenTable from "@/components/currenTable" import currenTable from "@/components/currenTable"
import pagination from "@/components/Pagination" import pagination from "@/components/Pagination"
import rowDrop from "@/components/rowDrop/index.vue"
import { getParentNode } from '@/utils'
export default { export default {
name: 'currenTabel-drawer', name: 'currenTabel-drawer',
components: { components: {
@ -183,8 +231,25 @@ export default {
currenDescriptions, currenDescriptions,
currenTabs, currenTabs,
currenTable, currenTable,
searchOverall,
rowDrop
}, },
props: { props: {
// -
showDetailColumnsSet:{
type: Boolean,
default: true
},
// -
showDetailFilters:{
type: Boolean,
default: true
},
// --
detailSearchDataFE:{
type: Object,
default: null
},
title: { title: {
type: Array, type: Array,
default: () => { default: () => {
@ -291,36 +356,24 @@ export default {
return this.dropdownTabsData return this.dropdownTabsData
} else { } else {
// //
if (Object.keys(this.propsData).length != 0) { // if (Object.keys(this.propsData).length != 0) {
if (Object.keys(this.propsData)) {
this.initDropdownTabsData = [{ this.initDropdownTabsData = [{
label: "详情", label: "详情",
name: 'xq' name: 'xq'
}, }]
{ // 使
if(this.propsData.details){
this.initDropdownTabsData.push({
label: "明细", label: "明细",
name: 'mx' name: 'mx'
}, })
{ }
if(this.propsData.summaryDetails && this.propsData.summaryDetails.length > 0){
this.initDropdownTabsData.push({
label: "汇总", label: "汇总",
name: 'hz' 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 return this.initDropdownTabsData
@ -328,9 +381,24 @@ export default {
}, },
}, },
mounted () { 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 () { data () {
return { return {
// table key
isUpdate: false,
// -
rowDropVisible: false,
otherData:[], // tabs otherData:[], // tabs
zdyTableColumns:[], // zdyTableColumns:[], //
zdyValue:'', // zdyValue:'', //
@ -348,11 +416,42 @@ export default {
label: "汇总", label: "汇总",
name: 'hz' name: 'hz'
} }
] ],
detailFiltersVisible:false,//
filterActionOptions:[{
value: '==',
label: '等于'
}, {
value: '!=',
label: '不等于'
}],
} }
}, },
methods: { 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) { handleCommand (command) {
this.$emit('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{ ::v-deep .el-tabs__nav-wrap::after{
content: unset !important; 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="操作" label="操作"
:align="'center'" :align="'center'"
width="150" width="150"
fixed="right"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="item in operaButtons" style="margin: 0 10px;"> <span v-for="item in operaButtons" style="margin: 0 10px;">
@ -198,6 +199,8 @@ data () {
return { return {
dialogShow:true, dialogShow:true,
URLOption_detailList:allUrlOption[this.$route.name].detailListURL,//- 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,//- URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,//-
currenButtonData: [],// currenButtonData: [],//
operaButtons:[],// operaButtons:[],//
@ -256,10 +259,10 @@ methods: {
}, },
// //
showParentHandleForDetail(data){ showParentHandleForDetail(data){
this.showParentTitle = `[${data.studentName}] 主表信息` this.showParentTitle = `${data[this.URLOption_masterName]} 主表信息`
this.showParentDialog = true this.showParentDialog = true
this.showParentLoading = true this.showParentLoading = true
getListDesById(this.URLOption_parent,data.masterId) getListDesById(this.URLOption_parent,data[this.URLOption_masterId])
.then(res => { .then(res => {
this.showParentTableData = res this.showParentTableData = res
this.showParentLoading = false 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> <i class="el-icon-success icon" v-if="allSeletType == 'NoSelect'" style="color:#999" ></i>
全选 全选
</div> </div>
<transition-group class="transition-wrapper" name="sort"> <transition-group class="transition-wrapper" :style="{maxHeight:innerMaxHeight}" name="sort">
<div <div
v-for="(item,index) in dataList" v-for="(item,index) in dataList"
:key='index+item.label' :key='index+item.label'
@ -54,31 +54,43 @@ export default {
}, },
data() { data() {
return { return {
historyTableColumns:null,
name: null, name: null,
oldData: null, oldData: null,
newData: null, newData: null,
dataList: [], dataList: [],
// allSelect hasSelect NoSelect // allSelect hasSelect NoSelect
allSeletType:'NoSelect', allSeletType:'NoSelect',
userName:JSON.parse(localStorage.getItem('currentUserInfo')).userName
} }
}, },
props: { props: {
visible: { innerMaxHeight:{
type: Boolean, type:String,
default: () => { default:'calc(90vh - 280px)'
return false },
} visible: {
}, type: Boolean,
tableColumns: { default: () => {
type: Array, return false
default: () => { }
return []; },
}, tableColumns: {
}, type: Array,
default: () => {
return [];
},
},
// list_api detail_api detailPage_api list detail detailPage
source:{
type:String,
default:'list_api'
}
}, },
mounted() { mounted() {
this.formatData(this.tableColumns) this.historyTableColumns = JSON.parse(JSON.stringify(this.tableColumns))
this.initSelectSta() this.formatData(this.tableColumns)
this.initSelectSta()
}, },
methods: { methods: {
reset() { reset() {
@ -88,16 +100,17 @@ export default {
type: 'warning', type: 'warning',
cancelButtonClass:'rowDropNotHideItem' cancelButtonClass:'rowDropNotHideItem'
}).then(() => { }).then(() => {
// set // set this.$store.getters.name.userName
localStorage.setItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name, JSON.stringify([])) localStorage.setItem('file_Columns_' + this.source + '_' + this.userName + '_' + this.$route.name, JSON.stringify([]))
localStorage.removeItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name) localStorage.removeItem('file_Columns_' + this.source + '_' +this.userName + '_' + this.$route.name)
let _resetCol = this.$isTableColumns[this.$route.name] // let _resetCol = this.$isTableColumns[this.$route.name]
let _resetCol = this.historyTableColumns
_resetCol.forEach(item => { _resetCol.forEach(item => {
item.istrue = true item.istrue = true
}) })
this.dataList = _resetCol this.dataList = _resetCol
this.initSelectSta() this.initSelectSta()
this.$emit('radio',_resetCol) this.$emit('radio',_resetCol,this.source)
this.close() this.close()
}).catch(() => { }).catch(() => {
@ -110,16 +123,16 @@ export default {
formatData (val) { formatData (val) {
this.dataList = JSON.parse(JSON.stringify(val)) this.dataList = JSON.parse(JSON.stringify(val))
this.dataList.forEach(item => { this.dataList.forEach(item => {
if (item.istrue == undefined) { if (item.istrue == undefined) {
item.istrue = true item.istrue = true
} }
}) })
}, },
save () { save () {
this.$forceUpdate() 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) { dragstart(value) {
this.oldData = value this.oldData = value
@ -149,9 +162,12 @@ export default {
}, },
// item // item
rediochange(index){ 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.initSelectSta()
this.save() this.$nextTick(()=>{
this.save()
})
}, },
// //
initSelectSta(){ initSelectSta(){
@ -187,7 +203,7 @@ $paddingSize:20px;
} }
.transition-wrapper { .transition-wrapper {
display: block; display: block;
max-height: calc(90vh - 280px); // max-height: calc(90vh - 280px);
overflow: auto; overflow: auto;
padding: 0 0 $paddingSize $paddingSize; padding: 0 0 $paddingSize $paddingSize;

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

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

10
Code/Fe/src/components/tablePagination/index.vue

@ -49,6 +49,7 @@
@sortChange="sortChange" @sortChange="sortChange"
@handleSelectionChange="handleSelectionChange" @handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog" @inlineDialog="inlineDialog"
:buttonOperationList="buttonOperationList"
@buttonOperationClick="buttonOperationClick" @buttonOperationClick="buttonOperationClick"
:tableBorder="true" :tableBorder="true"
:firstFixed="true" :firstFixed="true"
@ -107,6 +108,11 @@ export default {
return [] return []
} }
}, },
//
buttonOperationList:{
type: Array,
default: null,
},
// //
tableData: { tableData: {
type: Array, type: Array,
@ -325,6 +331,10 @@ export default {
buttonOperationClick(row, index, label) { buttonOperationClick(row, index, label) {
this.$emit("buttonOperationClick", row, index, label); this.$emit("buttonOperationClick", row, index, label);
}, },
//table
buttonOperationClick(row, item, index) {
this.$emit("buttonOperationClick", row, item, index);
},
// //
// /showSearchOverall // /showSearchOverall
getShowSearchOverall(val){ getShowSearchOverall(val){

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

@ -19,6 +19,27 @@
header-row-class-name="uTableHeader" header-row-class-name="uTableHeader"
> >
<!-- :tree-props="treeProps" height 不能共存 此组件暂不支持tree的格式--> <!-- :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="selectionTable" fixed="left" type="selection" :reserve-selection="true" />
<u-table-column v-if="isShowIndex" type="index" fixed="left" label="序号" width="50" /> <u-table-column v-if="isShowIndex" type="index" fixed="left" label="序号" width="50" />
<template v-for="(item, index) in TableSize"> <template v-for="(item, index) in TableSize">
@ -257,18 +278,6 @@
>{{item.label}}</el-button> >{{item.label}}</el-button>
</div> </div>
<!-- </el-form-item> --> <!-- </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'"> <span v-if="item.type == 'object'">
{{ scope.row[item.prop] ? scope.row[item.prop][item.showProp] : "" }} {{ scope.row[item.prop] ? scope.row[item.prop][item.showProp] : "" }}
</span> </span>
@ -345,6 +354,27 @@
{{ showDetailData ? showDetailData + "" : showDetailData }} {{ showDetailData ? showDetailData + "" : showDetailData }}
</el-dialog> </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弹窗 --> <!-- 点开查看Json转换后table弹窗 -->
<el-dialog <el-dialog
:visible.sync="showJsonDialog" :visible.sync="showJsonDialog"
@ -355,6 +385,11 @@
:close-on-press-escape="true" :close-on-press-escape="true"
:title="'内容详情'" :title="'内容详情'"
> >
<el-button
@click="copyJsonHandle()"
type="primary"
style="margin-bottom: 10px;float: right;"
>复制JSON</el-button>
<el-table <el-table
:data="showJsonData" :data="showJsonData"
:border="true" :border="true"
@ -369,7 +404,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- DETAILS todo:DETAILS判断条件需要优化使用传参的方式 --> <!-- 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 <el-table
v-else v-else
height="300" height="300"
@ -406,6 +441,11 @@ export default {
}, },
}, },
props: { props: {
//
buttonOperationList:{
type: Array,
default: null,
},
// //
showOverflowTooltip:{ showOverflowTooltip:{
type: Boolean, type: Boolean,
@ -502,6 +542,8 @@ export default {
showDetailData:null,// showDetailData:null,//
showJsonDialog:false,//Jsontable showJsonDialog:false,//Jsontable
showJsonData:null,//Json showJsonData:null,//Json
showJsonData_str:null,//Json
showJsonCopy:false,//jsonDialog
}; };
}, },
computed: { computed: {
@ -795,7 +837,7 @@ export default {
// //
if(Array.isArray(_json[item])){ if(Array.isArray(_json[item])){
// DETAILS todo:DETAILS使 // 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}) _arr.push({name:item,value:_value})
} }
// //
@ -812,15 +854,35 @@ export default {
} }
} }
this.showJsonData = _arr this.showJsonData = _arr
this.showJsonData_str = JSON.stringify(JSON.parse(JSON.stringify(this.showJsonData)), null, '\t')
this.$emit("showJsonTable", row); 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) { buttonClick(row, index, label) {
this.$emit("buttonClick", row, index, label); this.$emit("buttonClick", row, index, label);
}, },
//table //table
buttonOperationClick(row, label) { buttonOperationClick(row, item, index) {
this.$emit("buttonOperationClick", row, label); this.$emit("buttonOperationClick", row, item, index);
}, },
}, },
}; };
@ -863,9 +925,6 @@ export default {
.el-table__fixed-right::before { .el-table__fixed-right::before {
z-index: auto !important; z-index: auto !important;
} }
.buttonOperation-btn{
padding: 0;
}
.spamHover { .spamHover {
color: #409eff; color: #409eff;
cursor: pointer; cursor: pointer;

3
Code/Fe/src/mixins/LoadingMixins.js

@ -18,7 +18,8 @@ export const LoadingMixins = {
screenDialog: false, //筛选 screenDialog: false, //筛选
AddNewDialog: false, //选择数据弹出框 AddNewDialog: false, //选择数据弹出框
scanningDialog: false, //扫描 scanningDialog: false, //扫描
importDialog: false, //导出 importDialog: false, //导入
exportDialog: false, //导出
handleFromDialog: false, //执行生成 handleFromDialog: false, //执行生成
}, },
} }

88
Code/Fe/src/mixins/TableHeaderMixins.js

@ -30,6 +30,32 @@ export const TableHeaderMixins = {
} }
}, },
methods: { 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) { topbutton(val,item) {
// 更新 // 更新
@ -63,52 +89,7 @@ export const TableHeaderMixins = {
// } // }
// 导出 // 导出
else if (val == 'export') { else if (val == 'export') {
const name = this.$route.meta.title this.displayDialog.exportDialog = true
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
})
}
});
} }
// 导入 // 导入
else if (val == 'import') { 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, MaxResultCountDetails: 20,
// 明细数据临时存储 // 明细数据临时存储
tableDataDetails:[], tableDataDetails:null,
//默认tag //默认tag
firstTabs:'xq', firstTabs:'xq',
// api的表头数据 // api的表头数据
@ -46,9 +46,21 @@ export const tableMixins = {
URLOption_base:allUrlOption[this.$route.name].baseURL, URLOption_base:allUrlOption[this.$route.name].baseURL,
//主表-明细 //主表-明细
URLOption_detail:allUrlOption[this.$route.name].detailURL, URLOption_detail:allUrlOption[this.$route.name].detailURL,
// 主表-明细-筛选数据同步回显
detailSearchDataFE:null,
// 主表-操作列
operationButtonsTable:[{label:'查看详情',name:'info'}]
} }
}, },
methods: { 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) { paging(callback) {
this.Loading.tableLoading = true; this.Loading.tableLoading = true;
@ -100,14 +112,9 @@ export const tableMixins = {
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
getDetailed(val.id, _url).then(res => { getDetailed(val.id, _url).then(res => {
if (res.details) { if (res.details) {
// 前端分页处理
this.tableDataDetails = JSON.parse(JSON.stringify(res)) this.tableDataDetails = JSON.parse(JSON.stringify(res))
let linshiTableDataDetails = JSON.parse(JSON.stringify(this.tableDataDetails)) // 前端分页处理
this.totalCountDetails = res.details.length this.propsData = this.detailListPageFromFE(res)
// 删除除当前页面最大数以外数据
linshiTableDataDetails.details.splice(this.MaxResultCountDetails,this.totalCountDetails);
// this.oldSkipCountDetails = 1
this.propsData = linshiTableDataDetails
} else { } else {
this.propsData = res this.propsData = res
} }
@ -116,6 +123,14 @@ export const tableMixins = {
this.Loading.DrawerLoading = false 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改变每页最大页数 // 明细 分页 接收分页组件emit改变每页最大页数
alterResultCountDetails(val) { alterResultCountDetails(val) {
this.Loading.DrawerLoading = true this.Loading.DrawerLoading = true
@ -212,13 +227,18 @@ export const tableMixins = {
/** /**
* *
* @param {*} row 当前行数据 * @param {*} row 当前行数据
* @param {*} label 按钮name * @param {*} item 按钮信息
* @param {*} index 按钮索引
*/ */
buttonOperationClick(row, label) { buttonOperationClick(row, item, index) {
// 获取当前行数据,赋值给 propsData // 获取当前行数据,赋值给 propsData
this.propsData = row this.propsData = row
// 查看详情
if (label == "edit") { if (item.name == "info") {
this.inlineDialog(row)
}
// 编辑
if (item.name == "edit") {
this.formTitle = this.$route.meta.title + "编辑"; this.formTitle = this.$route.meta.title + "编辑";
this.formReveal = false this.formReveal = false
this.theEvent = "edit" this.theEvent = "edit"
@ -234,7 +254,8 @@ export const tableMixins = {
} }
this.displayDialog.editDialog = true this.displayDialog.editDialog = true
} }
if (label == 'delete') { // 删除
if (item.name == 'delete') {
this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', { this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -260,6 +281,43 @@ export const tableMixins = {
if(callback)callback() if(callback)callback()
// this.getSupplierByCodesHandle_table() // 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(){ inlineDialogCallback(){
this.Loading.DrawerLoading = false this.Loading.DrawerLoading = false

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

@ -54,11 +54,12 @@ export const mixins = {
}, },
methods: { methods: {
// 结合默认及缓存中的列表tableColumns数据做初始化 // 结合默认及缓存中的列表tableColumns数据做初始化
initTableColumns(){ initTableColumns(columnsData,type){
let _list_defalut = this.$isTableColumns[this.$route.name] let _list_defalut = columnsData ? columnsData : this.$isTableColumns[this.$route.name]
let _type = type ? type : 'list_api'
if(!_list_defalut)return if(!_list_defalut)return
let _local = 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('tableColumns_' + this.$store.getters.name.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 = [] //格式化后的数据 let _new_list = [] //格式化后的数据
// 如果没有缓存则直接为默认值 // 如果没有缓存则直接为默认值
if(!_local){ if(!_local){
@ -71,14 +72,16 @@ export const mixins = {
else{ else{
// 先处理缓存数据,设置索引 // 先处理缓存数据,设置索引
let _locals = {} let _locals = {}
_list_local.forEach((localItem,index) => { if(_list_local){
localItem.itemIndex = index _list_local.forEach((localItem,index) => {
if(localItem.showProp && typeof localItem.showProp == 'string'){ localItem.itemIndex = index
_locals[localItem.showProp] = localItem if(localItem.showProp && typeof localItem.showProp == 'string'){
}else{ _locals[localItem.showProp] = localItem
_locals[localItem.prop] = localItem }else{
} _locals[localItem.prop] = localItem
}) }
})
}
// 将缓存与默认设置合并,索引同步 // 将缓存与默认设置合并,索引同步
let _number = 0 let _number = 0
_list_defalut.forEach((defalutItem) => { _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) isAutoLogin = JSON.parse(_url_isAutoLogin)
} }
let userInfo = localStorage.getItem('currentUserInfo') let userInfo = localStorage.getItem('currentUserInfo')
let _zh = localStorage.getItem('columnsApiNamesZh')
// 是否有用户信息: // 是否有用户信息:
// 1、如果没有判断是否为自动登录(是自动登录则自动执行登录,账号密码为配置信息中的值,不是自动登录则跳到登录页) // 1、如果没有判断是否为自动登录(是自动登录则自动执行登录,账号密码为配置信息中的值,不是自动登录则跳到登录页)
// 2、如果有用户信息:则检查是否有api接口的表头数据,没有的话重新获取 // 2、如果有用户信息:则检查是否有api接口的表头数据,没有的话重新获取
if(!userInfo){ if(!userInfo){
if(isAutoLogin){ if(isAutoLogin || to.query.loginName){
let loginForm= { // let loginForm= {
userNameOrEmailAddress:localStorage.getItem("userNameOrEmailAddress"), // userNameOrEmailAddress:localStorage.getItem("userNameOrEmailAddress"),
password:localStorage.getItem("client_secret"), // password:localStorage.getItem("client_secret"),
// rememberMe:true, // // rememberMe:true,
// grant_type: 'password', // // grant_type: 'password',
// client_id: 'Auth_App', // // client_id: 'Auth_App',
} // }
// store.dispatch('user/login', loginForm).then(() => { // store.dispatch('user/login', loginForm).then(() => {
login(loginForm).then(()=>{ // login(loginForm).then(()=>{
getUsersByUserName(localStorage.getItem("userNameOrEmailAddress")).then(res=>{ getUsersByUserName(localStorage.getItem("userNameOrEmailAddress")).then(res=>{
// todo:currentUserInfo全程需要优化
localStorage.setItem("currentUserInfo", JSON.stringify(res)); localStorage.setItem("currentUserInfo", JSON.stringify(res));
}) })
.catch(err => { .catch(err => {
@ -61,16 +63,16 @@ router.beforeEach(async (to, from, next) => {
}) })
// 提前获取接口监控看板表头数据并存储 // 提前获取接口监控看板表头数据并存储
getInterfaceBoard().then(result => { getInterfaceBoard().then(result => {
localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.localization.values.Winin)); localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts));
next() next('/')
}) })
.catch(err => { .catch(err => {
console.log('获取表头失败,请重试') console.log('获取表头失败,请重试')
}) })
}) // })
.catch((error) => { // .catch((error) => {
console.log('登录失败') // console.log('登录失败')
}) // })
}else{ }else{
if (to.path != '/login') { if (to.path != '/login') {
next('/login') next('/login')
@ -83,13 +85,13 @@ router.beforeEach(async (to, from, next) => {
// 重新获取api接口表头 // 重新获取api接口表头
const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames")
if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){ if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){
getInterfaceBoard().then(result => { getInterfaceBoard().then(result => {
let _zh = localStorage.getItem('columnsApiNamesZh') // todo-new:columnsApiNamesZh配置的地址补全(evel)
localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.localization.values[_zh])); localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts));
setTimeout(()=>{ setTimeout(()=>{
next() next()
},0) },0)
}) })
}else{ }else{
next() next()
} }

2
Code/Fe/src/utils/baseData/urlOption.js

@ -3,6 +3,8 @@ export const TestSchool = {
baseURL:'TestSchool/base',//主表-列表 baseURL:'TestSchool/base',//主表-列表
detailURL:'app/test-school',//主表-明细 + 明细-查看主表 detailURL:'app/test-school',//主表-明细 + 明细-查看主表
detailListURL:'TestStudentDetail/base',//明细-列表, detailListURL:'TestStudentDetail/base',//明细-列表,
masterId:'masterId',//明细获取主表信息的masterId(默认)
masterName:'studentName'//明细获取主表信息的title名称
// parentURL:null,//明细-查看主表:特殊接口,如果没有则走detailURL // parentURL:null,//明细-查看主表:特殊接口,如果没有则走detailURL
// deleteURL:null,//删除特殊URL // deleteURL:null,//删除特殊URL
// updataURL: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:监听已经配置过的字段按钮更改状态特殊显示 // 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 _type = ''
let _num = 0 let _num = 0
if(_local){ if(_local){

2
Code/Fe/src/utils/tableColumns_api/index.js

@ -4,6 +4,6 @@ import { initFromApiColumnsLable } from '@/utils/index'
// 测试数据 // 测试数据
export const TestSchool = [ export const TestSchool = [
{ label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left", type: "name" }, { label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left" },
{ label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, { 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 currenButton from "@/components/currenButton" //按钮
import currenTable from "@/components/currenTable" //table import currenTable from "@/components/currenTable" //table
import tablePagination from "@/components/tablePagination"; //第一视图集成 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 pagination from "@/components/Pagination" //分页器
import conditionFilters from "@/components/conditionFilters" //高级筛选 import conditionFilters from "@/components/conditionFilters" //高级筛选
import searchPage from '@/components/searchPage' //autocomplete拉取数据探弹窗 import searchPage from '@/components/searchPage' //autocomplete拉取数据探弹窗
@ -108,6 +109,7 @@ Vue.component('currenButton', currenButton)
Vue.component('currenTable', currenTable) Vue.component('currenTable', currenTable)
Vue.component('tablePagination', tablePagination) Vue.component('tablePagination', tablePagination)
Vue.component('importFile', importFile) Vue.component('importFile', importFile)
Vue.component('exportDrop', exportDrop)
Vue.component('pagination', pagination) Vue.component('pagination', pagination)
Vue.component('conditionFilters', conditionFilters) Vue.component('conditionFilters', conditionFilters)
Vue.component('searchPage', searchPage) Vue.component('searchPage', searchPage)

2
Code/Fe/src/views/dashboard/index.vue

@ -178,7 +178,7 @@
display: flex; display: flex;
padding-top: 10px; padding-top: 10px;
.title{ .title{
width: 180px; width: 240px;
text-align: right; text-align: right;
font-weight: bold; font-weight: bold;
flex-shrink: 0; flex-shrink: 0;

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

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

Loading…
Cancel
Save