diff --git a/Code/Fe/README.md b/Code/Fe/README.md index df3021f..4208571 100644 --- a/Code/Fe/README.md +++ b/Code/Fe/README.md @@ -46,7 +46,7 @@ alertoldSkipCount 主列表-分页-当前页条数 alterResultCount 主列表-分页-每页最大页数 handleSelectionChange 主列表-选择-行数据方法 tablePagination ==> currenTable <----20230207添加 begin----> -buttonOperationClick 主列表-操作列按钮点击事件 +buttonOperationClick_left 主列表-操作列按钮点击事件 currentPageProps 主列表-当前页码值 使用的是@/mixins/TableMixins的oldSkipCount值 quicklySearchOption 主表查询-快速搜索数据配置 ==> 通用配置在@/utils/quicklySearchOption/index diff --git a/Code/Fe/public/config.js b/Code/Fe/public/config.js index 8a6e680..54c6435 100644 --- a/Code/Fe/public/config.js +++ b/Code/Fe/public/config.js @@ -1,35 +1,8 @@ // dev_win window.SITE_CONFIG['base'] = 'http://dev.ccwin-in.com:60069' -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['isAutoLogin'] = true window.SITE_CONFIG['isSinglePage'] = false window.SITE_CONFIG['userNameOrEmailAddress'] = 'admin' window.SITE_CONFIG['client_secret'] = '1q2w3E*' -// window.SITE_CONFIG['user'] = 'http://dev.ccwin-in.com:60069/api' -// // window.SITE_CONFIG['print'] = 'print'21384 -// window.SITE_CONFIG['print'] = 'http://dev.ccwin-in.com:60074' -// window.SITE_CONFIG['largeScreen'] = 'http://dev.ccwin-in.com:60073' -// window.SITE_CONFIG['warehouseCode'] = 'T8' -// window.SITE_CONFIG['company'] = 'DongYang' -// window.SITE_CONFIG['client_secret'] = '1q2w3E*' -// window.SITE_CONFIG['reportsUrl'] = 'http://dev.ccwin-in.com:60074/#/reports/' -// window.SITE_CONFIG['versionUrl'] = 'http://dev.ccwin-in.com:60070' -// window.SITE_CONFIG['companyName'] = '长春一汽富维东阳汽车塑料零部件(安徽)有限公司' -// 接口看板地址 -// window.SITE_CONFIG['interfaceBoardUrl'] = 'http://dev.ccwin-in.com:60090/' -// window.SITE_CONFIG['interfaceBoardUrl'] = 'http://dev.ccwin-in.com:60069/' -// 接口看板表头获取地址 -// window.SITE_CONFIG['interfaceBoardColumnsApi'] = 'api/abp/application-configuration' - -// mock -// window.SITE_CONFIG['apifoxToken'] = 'NXHNi5mp0dnUHGt0wkCrjvfcidsFKV33' -// window.SITE_CONFIG['base'] = 'https://mock.apifox.cn/m1/1773588-0-default' -// window.SITE_CONFIG['user'] = 'http://dev.ccwin-in.com:60099/api/auth' -// window.SITE_CONFIG['print'] = 'print' -// window.SITE_CONFIG['largeScreen'] = 'http://dev.ccwin-in.com:60073' -// window.SITE_CONFIG['warehouseCode'] = 'T8' -// window.SITE_CONFIG['company'] = 'DongYang' -// window.SITE_CONFIG['client_secret'] = '1q2w3E*' -// window.SITE_CONFIG['reportsUrl'] = 'http://10.164.0.227:59091/#/reports/' \ No newline at end of file +window.SITE_CONFIG['menuHiddenConfig'] = ['AsnDet','PoDet','ReceiptDet','ReturnDet','SodDet'] \ No newline at end of file diff --git a/Code/Fe/src/App.vue b/Code/Fe/src/App.vue index b84602c..b4a1936 100644 --- a/Code/Fe/src/App.vue +++ b/Code/Fe/src/App.vue @@ -9,12 +9,20 @@ export default { name: 'App' } localStorage.setItem('base',window.SITE_CONFIG['base']) -localStorage.setItem('columnsApiNames',window.SITE_CONFIG['columnsApiNames']) localStorage.setItem('columnsApiNamesZh',window.SITE_CONFIG['columnsApiNamesZh']) localStorage.setItem('isAutoLogin',window.SITE_CONFIG['isAutoLogin']) localStorage.setItem('isSinglePage',window.SITE_CONFIG['isSinglePage']) localStorage.setItem('userNameOrEmailAddress',window.SITE_CONFIG['userNameOrEmailAddress']) localStorage.setItem('client_secret',window.SITE_CONFIG['client_secret']) +localStorage.setItem('menuHiddenConfig',window.SITE_CONFIG['menuHiddenConfig']) +// 获取浏览器语言 +const language_brow = (navigator.language || navigator.browserLanguage) +console.log(21,language_brow) +if(language_brow.indexOf('zh') >= 0){ + localStorage.setItem('browserLanguage','zh-Hans') +}else{ + localStorage.setItem('browserLanguage','en') +} // localStorage.setItem('user',window.SITE_CONFIG['user']) // localStorage.setItem('print',window.SITE_CONFIG['print']) // localStorage.setItem('warehouseCode',window.SITE_CONFIG['warehouseCode']) diff --git a/Code/Fe/src/api/wms-api.js b/Code/Fe/src/api/wms-api.js index 4cd4c8c..835bfb5 100644 --- a/Code/Fe/src/api/wms-api.js +++ b/Code/Fe/src/api/wms-api.js @@ -12,7 +12,7 @@ export function postCreate(data, url) { data.warehouseCode = localStorage.getItem('warehouseCode') } if(Object.keys(data).includes('worker')) { - data.worker = store.getters.name.userName + data.worker = store.getters.currentUserInfo.userName } return request({ url: baseURL + url, @@ -162,81 +162,6 @@ export function postImportDown(url) { }) } -//开始计划 | 盘点计划 -export function planHandle(id, url, data) { - return request({ - url: baseURL + url + '/handle/' + id, - method: 'post', - params: data - }) -} -// 取消计划(生产计划为关闭) | 盘点计划 -export function postCancel(id, url) { - return request({ - url: baseURL + url + '/cancel/' + id, - method: 'post' - }) -} -// 中止 | 盘点计划 -export function postAbort(id, url) { - return request({ - url: baseURL + url + '/abort/' + id, - method: 'post' - }) -} -//完成 | 盘点计划 -export function postComplete(id,data,url) { - return request({ - url: baseURL + url + '/complete-by-type/' + id, - method: 'post', - params:data - }) -} -//阶段 - 校正库存 | 盘点计划 -export function ChangeStage(data, url) { - return request({ - url: baseURL + url + '/change-stage', - method: 'post', - params:data - }) -} -//拆分 | 盘点计划 -export function postCreateWithCondition(data, url) { - if (Object.keys(data).includes('company')) { - data.company = localStorage.getItem('company') - } - if (Object.keys(data).includes('warehouseCode')) { - data.warehouseCode =localStorage.getItem('warehouseCode') - } - return request({ - url: baseURL + url + '/create-with-condition', - method: 'post', - data - }) -} -//更新可用容量 -export function postUpdateAvailableCapacity(data, url) { - return request({ - url: baseURL + url + '/recalculate', - method: 'post', - params: data - }) -} -// 执行调整 | 盘点调整申请 -// export function ExecuteAdjusted(id) { -// return request({ -// url: baseURL + 'wms/store/count-adjust-note/ExecuteAdjusted/' + id, -// method: 'post', -// }) -// } -// 生成盘点调整申请 | 盘点记录 -export function StartAdjust(id) { - return request({ - // url: baseURL + 'wms/store/count-note/StartAdjust/' + id, - url: baseURL + 'wms/store/count-note/'+ id +'/generate-adjust-request', - method: 'post' - }) -} //---------------------------通用--------------------------- //获取详情 @@ -246,14 +171,6 @@ export function getDetailed(id, url) { method: 'get', }) } -//获取子表详情 -export function getDetailedSon(id, UrlData, url) { - return request({ - url: baseURL + url + '/detail/' + id, - method: 'get', - params: UrlData - }) -} //---------------------------只查询------------------------- //获取分页+筛选 export function getPage(data, url) { @@ -284,112 +201,6 @@ export function PrintServices(data) { data }) } -// 修改库存余额过期日期 | 库存余额 -export function updateExpireDate(data, url) { - return request({ - url: baseURL + url + '/update/expire-date', - method: 'post', - params: data - }) -} - -// 详情tabs页 通过code 获取列表 -export function getListByItemcode(data, url ){ - return request({ - url: baseURL + url + '/get-list-by-itemcode', - method: 'get', - params: data - }) -} - -// 详情tabs页 通过code 获取列表 -export function byItem(itemCode, url ){ - return request({ - url: baseURL + url + '/list/by-item/' + itemCode, - method: 'get' - }) -} - -// 详情tabs页 通过父物品号 获取列表 -export function byProduct(product, url ){ - return request({ - url: baseURL + url + '/get-list-by-product', - method: 'get', - params: product - }) -} - -// 详情tabs页 通过子物品号 获取列表 -export function byComponent(component, url ){ - return request({ - url: baseURL + url + '/get-list-by-component', - method: 'get', - params: component - }) -} - -// 详情tabs页 通过供应商 获取列表 -export function bySupplierCode(supplierCode, url ){ - return request({ - url: baseURL + url + '/get-list-by-supplier-code', - method: 'get', - params: supplierCode - }) -} - -// 详情tabs页 通过库位 获取列表 -export function byLocation(locationCode, url ){ - return request({ - url: baseURL + url + '/list/by-location/' + locationCode, - method: 'get', - }) -} - -// 详情tabs页 通过库位 获取列表 -export function byLocationCode(locationCode, url ){ - return request({ - url: baseURL + url + '/get-by-location-code', - method: 'get', - params: locationCode - }) -} - -// 详情tabs页 通过库位-零件关系 获取列表 -export function relationByLocationCode(locationCode, url ){ - return request({ - url: baseURL + url + '/by-location', - method: 'get', - params: locationCode - }) -} - -// 详情tabs页 通过子物品号 获取子层级列表 -export function byComponentCJ(component, url ){ - return request({ - url: baseURL + url + '/get-list-by-component-with-tree', - method: 'get', - params: component - }) -} - -//消息管理——用户消息类型关系——获取用户已有消息类型 -export function messageTypeSubscribe(id) { - return request({ - url: baseURL + 'message/message-type-subscribe/list/' + id, - method: 'get', - // params:id - }) -} - -//消息管理——用户消息类型关系——保存用户与消息类型关系 -export function messageTypeSubscribeCreateMany(data,id) { - return request({ - url: baseURL + 'message/message-type-subscribe/create-many', - method: 'post', - params:id, - data - }) -} //首页——获取当前用户未读消息 export function userNotifyNotReadList(userId) { @@ -424,185 +235,10 @@ export function notifyMessage(params, id) { }) } -// 库存-启用 | 库存余额 -// export function inventoryBalanceActive(id) { -// return request({ -// url: baseURL + 'wms/inventory/inventory-balance/active?id=' + id, -// method: 'post', -// }) -// } - -// 库存列表 -export function inventoryBalanceList(data) { - return request({ - url: baseURL + 'wms/inventory/Inventory-Balance/list', - method: 'post', - data - }) -} - -// 库存-启用 | 库存余额 改 -export function inventoryBalanceActive(params) { - return request({ - url: baseURL + 'wms/inventory/inventory-balance/' + params.id + '/active', - method: 'post', - params: params, - }) -} - -//库移——查询 | 库存转移日志 -export function byBalancesRequestManyParameter(data) { - return request({ - url: baseURL + 'wms/inventory/inventory-balance/by-balances-request-many-parameter', - method: 'post', - data - }) -} - -//库移——提交 | 库存转移日志 -export function inventoryTransferNote(data) { - return request({ - url: baseURL + 'wms/store/inventory-transfer-note', - method: 'post', - data - }) -} - -//库存管理——已占用库存——删除 -//库存管理——预填充库存——删除 -export function remove(id, url) { - return request({ - url: baseURL + url + '/remove/' + id, - method: 'post', - params: id - }) -} - -//发料任务——新增 | 自动发料任务 | 人工发料任务 -export function createAndHandle(data) { - return request({ - url: baseURL + 'wms/store/material-request/create-and-handle', - method: 'post', - data - }) -} - -// 人工叫料申请 | 人工发料任务 | 人工发料记录 | 自动叫料申请 | 自动发料任务 | 自动发料记录 | 直接发料记录 -// 完工收货缴库申请 | 线边仓缴库申请 | 线边仓缴库记录 | 线边仓报废申请 | 线边仓报废记录 | 原料报废记录 -export function materialRequestByType(data, url, params) { - let _type = params.type?params.type:params.requestType - return request({ - url: baseURL + url + '/' + _type, - method: 'post', - params: params, - data - }) -} - -// 采购收货——供应商发货通知——导入——确定(【批量创建】供应商发货通知) -export function supplierAsnCreateMany(data) { - return request({ - url: baseURL + 'wms/store/supplier-asn/create-many', - method: 'post', - data - }) -} - -// 调拨作废 -// export function transferRequestCancel(url, data ) { -// return request({ -// url: baseURL + url + '/cancel/' + data.id, -// method: 'post', -// params: data -// }) -// } - -// 打印之后调用 记录打印次数 | 原料直发客户记录 -export function sumPrint(number, url ) { - return request({ - url: baseURL + url + '/sum-print/' + number, - method: 'post' - }) -} - -// 线边仓调拨列表 | 上架前退货记录 | 采购上架记录 | 半成品上架记录 | 原料直发 -export function getPageListWip(data, url) { - return request({ - url: baseURL + url, - method: 'post', - data - }) -} - -// 线边仓调拨确认按钮 | 客户调拨确认按钮 | 自动发料记录 -export function confirm(id, url) { - return request({ - url: baseURL + url + '/confirm/' + id, - method: 'post', - }) -} - - // 采购收货记录-详情页TAB-不合格品收货明细/合格品收货明细/收货缺料明细 -export function purRecNoteCustomInfo( url,id ){ - return request({ - url: baseURL + 'wms/store/purchase-receipt-note/' + url + id, - method: 'get', - }) -} -// 质检-不合格转合格 -export function convertOk(data) { - return request({ - url: baseURL + 'wms/store/no-ok-convert-ok-notes', - method: 'post', - data - }) -} -// 获取全部供应商(codes)| 上架前退货记录 | 上架后退货记录 | 采购上架记录 -export function allSupplierByCodes(data) { - return request({ - url: baseURL + 'basedata/supplier/by-codes', - method: 'post', - data - }) -} - -// 根据code获取当前供应商信息 打印需要获取供应商信息(供应商简称等)相关位置 -export function getOneSupplierInfoByCode(code) { - return request({ - url: baseURL + 'basedata/supplier/by-code/' + code, - method: 'get' - }) -} - -// 根据code获取当前客户信息 打印需要获取供应商信息(客户地址等)相关位置 -export function getOneCustomerInfoByCode(code) { - return request({ - url: baseURL + 'basedata/customer/by-code/' + code, - method: 'get' - }) -} - // 获取版本编号 export function getVsersion() { return request({ url: window.SITE_CONFIG['versionUrl'] + `/version.json?t=${new Date().getTime()}`, method: 'get' }) -} - -// 安全库存预警 -export function getListPageSafety(data, url) { - return request({ - url: baseURL + url, - method: 'post', - data - }) -} - -// 根据编号获取字典信息 -// export function getDictByCode(code) { -// return request({ -// url: baseURL + 'basedata/dict/by-code/' + code, -// method: 'get', -// }) -// } \ No newline at end of file +} \ No newline at end of file diff --git a/Code/Fe/src/api/wms-auth.js b/Code/Fe/src/api/wms-auth.js index 5e8a635..7f88b9e 100644 --- a/Code/Fe/src/api/wms-auth.js +++ b/Code/Fe/src/api/wms-auth.js @@ -1,6 +1,5 @@ import request from '@/utils/request' let baseURL = localStorage.getItem('base') + '/api' -import axios from 'axios' export function login(data) { return request({ @@ -10,13 +9,6 @@ export function login(data) { }) } -export function getUsersByUserName(name) { - return request({ - url: baseURL + '/identity/users/by-username/'+name, - method: 'get', - }) -} - export function token(data) { return request({ // url: baseURL + '/token', @@ -39,15 +31,6 @@ export function logout() { }) } -//获取PC菜单 -export function getWebMenu(params) { - return request({ - url: baseURL + '/auth/user-menu/web-menu/' + params.userId, - method: 'get', - params: params - }) -} - //新建 export function postCreate(data) { return request({ @@ -228,39 +211,6 @@ export function getDetailed(id, url) { }) } -//新建 | 部门信息维护 -export function authCreate(data, url) { - if (Object.keys(data).includes('company')) { - data.company = localStorage.getItem('company') - } - if (Object.keys(data).includes('warehouseCode')) { - data.warehouseCode = localStorage.getItem('warehouseCode') - } - if(Object.keys(data).includes('worker')) { - data.worker = store.getters.name.userName - } - return request({ - url: baseURL + '/' + url, - method: 'post', - data - }) -} -//编辑 | 部门信息维护 -export function authUpdate(data, id, url) { - return request({ - url: baseURL + '/' + url + '/' + id, - method: 'put', - data - }) -} -//删除 | 部门信息维护 -export function authDelete(id, url) { - return request({ - url: baseURL + '/' + url + '/' + id, - method: 'delete', - }) -} - //------------------------------------- // 创建 | PC角色权限维护 export function postCreateRoles(data) { @@ -317,4 +267,12 @@ export function putpermissionsRoles(url, data) { method: 'put', data }) +} + +// faster-new +export function getUsersByUserName(name) { + return request({ + url: baseURL + '/identity/users/by-username/'+name, + method: 'get', + }) } \ No newline at end of file diff --git a/Code/Fe/src/api/wms-core.js b/Code/Fe/src/api/wms-core.js deleted file mode 100644 index d2e2a94..0000000 --- a/Code/Fe/src/api/wms-core.js +++ /dev/null @@ -1,56 +0,0 @@ -import request from '@/utils/request' -// let baseURL = localStorage.getItem('print') + '/api/' -let baseURL = localStorage.getItem('base') + '/api/' - -// 根据箱码获取标签相关信息 | 补打标签 -export function getOneInventoryLabelByCode(code) { - return request({ - url: baseURL + 'label/inventory-label/by-code/' + code, - method: 'get' - }) -} - -// 批量获取箱标签信息 | 到货请求 -export function getInventoryLabelByCodes(data) { - return request({ - url: baseURL + 'label/inventory-label/by-codes', - method: 'post', - data - }) -} - -//生产、采购生成标签(批量)| 标签管理模块 -export function postInventoryLabelCode(data) { - return request({ - url: baseURL + 'label/Inventory-label/generate-and-create/many', - method: 'post', - data - }) -} - -//生产、采购生成标签(一次多个)| 标签管理模块 -export function postInventoryLabelCode_count(params,data) { - return request({ - url: baseURL + 'label/inventory-label/generate-and-create/many/'+params.count, - method: 'post', - data - }) -} - -// 拆箱 | 标签管理-拆分箱标签 -export function postSplitPacking(data) { - return request({ - url: baseURL + 'wms/store/transfer-note/split-packing', - method: 'post', - data - }) -} - -// 拆箱记录列表 -export function splitPackingList(data) { - return request({ - url: baseURL + 'wms/store/transfer-note/get-split-packing-list', - method: 'post', - data - }) -} \ No newline at end of file diff --git a/Code/Fe/src/api/wms-interface.js b/Code/Fe/src/api/wms-interface.js index 8c28acf..a2a7b2c 100644 --- a/Code/Fe/src/api/wms-interface.js +++ b/Code/Fe/src/api/wms-interface.js @@ -1,18 +1,38 @@ // 接口监控看板相关api import request from '@/utils/request' let base_api = localStorage.getItem('base') -let colum_url = localStorage.getItem('columnsApiNames') -// 获取表头数据 +// 获取表头zh转义数据 export function getInterfaceBoard() { return request({ method:'get', - url: base_api + colum_url, - params:{CultureName:'zh-Hans'} + url: base_api + '/api/abp/application-localization', + params:{ + CultureName:localStorage.getItem('browserLanguage'), + OnlyDynamics:false + } // params:{IncludeLocalizationResources:true} }) } +// 获取菜单数据 +export function getDefinitionMenu(IncludeTypes) { + return request({ + method:'get', + url: base_api + '/api/abp/application-configuration', + params:{IncludeLocalizationResources:true} + }) +} + +// 获取枚举数据/dto列类型等所有配置 +export async function getApiDefinition() { + return request({ + method:'get', + url: base_api + '/api/abp/api-definition', + params:{IncludeTypes:true} + }) +} + // // 测试数据-明细-删除 // export function TestSchoolDetailList_delete(id) { // return request({ diff --git a/Code/Fe/src/api/wms-job.js b/Code/Fe/src/api/wms-job.js index 249c750..0f5407a 100644 --- a/Code/Fe/src/api/wms-job.js +++ b/Code/Fe/src/api/wms-job.js @@ -1,24 +1,8 @@ import request from '@/utils/request' // let baseURL = process.env.VUE_APP_BASE_API + '/' let baseURL = localStorage.getItem('base') + '/api/' -//分页+筛选 -export function getPageList(data, url) { - return request({ - url: baseURL + url + '/list', - method: 'post', - data - }) -} -//分页+筛选 -export function getPage(data, url) { - return request({ - url: baseURL + url + '/count', - method: 'post', - data - }) -} -//---------------------------通用--------------------------- +//---------------------------通用--------------------------- //任务流程——承接 export function accept(url, data) { return request({ @@ -55,16 +39,6 @@ export function cancelAccept(url, data) { }) } -//任务流程——执行 -export function handle(data, params, url) { - return request({ - url: baseURL + url + '/handle/'+params.id, - method: 'post', - // params: params, - data - }) -} - //任务流程——打开 export function open(url, data) { return request({ @@ -72,166 +46,4 @@ export function open(url, data) { method: 'post', // params: data }) -} - - -//获取详情 -export function getDetailed(id, url) { - return request({ - url: baseURL + url + '/' + id, - method: 'get', - }) -} -//获取子表详情 -export function getDetailedSon(id, UrlData, url) { - return request({ - url: baseURL + url + '/detail/' + id, - method: 'get', - params: UrlData - }) -} - -//收货任务-执行 - 目检 -export function visualInspection( params,data) { - return request({ - url: baseURL + 'wms/job/purchase-receipt-job/save-detail-inspect/' + params.id, - method: 'post', - data - }) -} -// 收货任务-执行-待处理全部转合格 -export function AllPendingToQualified( id,params) { - return request({ - // url: baseURL + 'wms/job/purchase-receipt-job/set-inspect-status-with-not-inspect/' + id, - url: baseURL + 'wms/job/purchase-receipt-job/set-inspect-status-ok-by-inspect/' + id, - method: 'post', - params: params, - }) -} -// 收货任务-执行-重置目检状态 -export function resetSelectToInspect( id,data) { - return request({ - url: baseURL + 'wms/job/purchase-receipt-job/reset-many-detail-inspect/' + id, - method: 'post', - data: data, - }) -} - -//作废任务 -export function Invalid(url, id) { - return request({ - url: baseURL + url + '/invalid', - method: 'post', - params: id, - }) -} -//检查任务 -export function Check(url, id, data) { - return request({ - url: baseURL + url + '/check', - method: 'post', - params: id, - data - }) -} - - -//上架任务——执行 -export function HandleJob(data, id, url) { - return request({ - url: baseURL + url + '/handle-job', - method: 'post', - params: id, - data - }) -} - -//质检执行任务 -export function InspectJobHandle(data, params, url) { - return request({ - url: baseURL + url + '/handle', - method: 'post', - params: params, - data - }) -} - -// //发料任务——执行 -// export function issueJobHandle(data, params, url) { -// return request({ -// url: baseURL + url + '/handle', -// method: 'post', -// params: params, -// data -// }) -// } - -//人工发料任务 | 自动发料任务 -export function materialRequestByType(data, url, params,includeDetails) { - let _type = params.type?params.type:params.requestType - return request({ - url: baseURL + url + '/' + _type + '?includeDetails=' + (includeDetails || false), - method: 'post', - params: params, - data - }) -} - -//生产计划——更新备料计划 -export function productionPlanUpdate(data, detailId, id) { - return request({ - url: baseURL + 'wms/store/preparation-plan/details/' + id, - method: 'put', - params: detailId, - data - }) -} - -//生产计划——生产备料计划后查询乐观锁 -export function preparationPlanByNumber(params) { - return request({ - url: baseURL + 'wms/store/preparation-plan/by-number', - method: 'get', - params: params, - }) -} - -//质检——完成质检 -export function completeSummaryDetailStatus(params, data) { - return request({ - url: baseURL + 'wms/store/inspect-job/complete-summary-detail-status/' + params.id, - method: 'post', - params: params, - data - }) -} - -//质检——设置默认状态(清除质检) -export function setDetailDefaultOkStatus(params, id, data) { - return request({ - url: baseURL + 'wms/store/inspect-job/set-detail-default-ok-status/' + id, - method: 'post', - params: params, - data - }) -} - -//质检——设置详情为合格 -export function setDetailOkStatus(params, id, data) { - return request({ - url: baseURL + 'wms/store/inspect-job/set-detail-ok-status/' + id, - method: 'post', - params: params, - data - }) -} - -//质检——设置详情为不合格 -export function setDetailNookStatus(params, id, data) { - return request({ - url: baseURL + 'wms/store/inspect-job/set-detail-nook-status/' + id, - method: 'post', - params: params, - data - }) -} +} \ No newline at end of file diff --git a/Code/Fe/src/components/News/dialogIndex.vue b/Code/Fe/src/components/News/dialogIndex.vue index 2cded50..7259be1 100644 --- a/Code/Fe/src/components/News/dialogIndex.vue +++ b/Code/Fe/src/components/News/dialogIndex.vue @@ -172,7 +172,7 @@ export default { } }, mounted () { - this.userId = this.$store.getters.name.id + this.userId = this.$store.getters.currentUserInfo.id // todo-new: // this.getList() }, diff --git a/Code/Fe/src/components/News/index.vue b/Code/Fe/src/components/News/index.vue index 531aa12..82ddeb3 100644 --- a/Code/Fe/src/components/News/index.vue +++ b/Code/Fe/src/components/News/index.vue @@ -25,7 +25,7 @@ export default { dialogIndex }, mounted () { - this.userId = this.$store.getters.name.id + this.userId = this.$store.getters.currentUserInfo.id this.getNoReadCount(this.userId) this.getSetInterval() // 检测版本是否有更新 diff --git a/Code/Fe/src/components/PanThumb/index.vue b/Code/Fe/src/components/PanThumb/index.vue deleted file mode 100644 index 1bcf417..0000000 --- a/Code/Fe/src/components/PanThumb/index.vue +++ /dev/null @@ -1,142 +0,0 @@ - - - - - diff --git a/Code/Fe/src/components/StepsCountPlanForm/_index.vue b/Code/Fe/src/components/StepsCountPlanForm/_index.vue deleted file mode 100644 index bf21d38..0000000 --- a/Code/Fe/src/components/StepsCountPlanForm/_index.vue +++ /dev/null @@ -1,654 +0,0 @@ - - - - \ No newline at end of file diff --git a/Code/Fe/src/components/StepsCountPlanForm/index.vue b/Code/Fe/src/components/StepsCountPlanForm/index.vue deleted file mode 100644 index 26990ac..0000000 --- a/Code/Fe/src/components/StepsCountPlanForm/index.vue +++ /dev/null @@ -1,723 +0,0 @@ - - - - \ No newline at end of file diff --git a/Code/Fe/src/components/StepsCountPlanForm/style/index.scss b/Code/Fe/src/components/StepsCountPlanForm/style/index.scss deleted file mode 100644 index 9901959..0000000 --- a/Code/Fe/src/components/StepsCountPlanForm/style/index.scss +++ /dev/null @@ -1,86 +0,0 @@ -#stepsForm { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - - ::v-deep .el-steps { - padding-bottom: 15px; - - .el-step__main { - .el-step__title { - line-height: 24px; - font-size: 14px; - } - } - } - - .page1 { - flex: 1; - display: flex; - flex-direction: column; - justify-content: space-between; - } - - .page2 { - flex: 1; - overflow: hidden; - position: relative; - - ::v-deep & >.el-dialog { - width: 100%; - height: 100%; - - & >.el-dialog__header { - padding: 0 !important; - } - - & > .el-dialog__body { - padding-top: 0; - } - } - } - - .page3 { - flex: 1; - display: flex; - flex-direction: column; - justify-content: space-between; - padding-bottom: 54px; - overflow: hidden; - overflow-y: auto; - - ::v-deep .el-form { - flex: 1; - display: flex; - flex-direction: column; - - .el-row { - flex: 1; - flex-wrap: wrap; - overflow: hidden; - overflow-y: auto; - } - - .formTable-box { - flex: 1; - overflow: hidden; - overflow-y: auto; - - .el-form-item__content { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - margin: 0 !important; - } - } - } - ::v-deep .formButton { - position: absolute; - bottom: 0; - right: 0; - z-index: 3; - } - } -} \ No newline at end of file diff --git a/Code/Fe/src/components/StepsForm/_index.vue b/Code/Fe/src/components/StepsForm/_index.vue deleted file mode 100644 index 1c1ebee..0000000 --- a/Code/Fe/src/components/StepsForm/_index.vue +++ /dev/null @@ -1,459 +0,0 @@ - - - \ No newline at end of file diff --git a/Code/Fe/src/components/StepsForm/index.vue b/Code/Fe/src/components/StepsForm/index.vue deleted file mode 100644 index 1465b64..0000000 --- a/Code/Fe/src/components/StepsForm/index.vue +++ /dev/null @@ -1,551 +0,0 @@ - - - \ No newline at end of file diff --git a/Code/Fe/src/components/StepsForm/style/index.scss b/Code/Fe/src/components/StepsForm/style/index.scss deleted file mode 100644 index 5169c0c..0000000 --- a/Code/Fe/src/components/StepsForm/style/index.scss +++ /dev/null @@ -1,134 +0,0 @@ -#stepsForm { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - - ::v-deep .el-steps { - padding-bottom: 15px; - - .el-step__main { - .el-step__title { - line-height: 24px; - font-size: 14px; - } - } - } - - .page1 { - flex: 1; - display: flex; - flex-direction: column; - justify-content: space-between; - overflow: hidden; - overflow-y: auto; - } - - .page2 { - flex: 1; - display: flex; - flex-direction: column; - justify-content: space-between; - padding-bottom: 54px; - overflow: hidden; - overflow-y: auto; - - ::v-deep .el-form { - flex: 1; - display: flex; - .el-row { - display: none; - } - - .formTable-box { - flex: 1; - overflow: hidden; - overflow-y: auto; - - .el-form-item__content { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - margin: 0 !important; - - .heder { - padding: 5px 0; - text-align: center; - font-size: 18px; - - button{ - margin: 0 10px; - } - } - - .el-table { - flex: 1; - - .childTable { - display: flex; - justify-content: space-around; - - span { - cursor: pointer; - - &:nth-child(1) { - color: red; - } - - &:nth-child(2) { - color: green; - } - } - } - } - } - } - } - - ::v-deep .formButton { - position: absolute; - bottom: 0; - right: 0; - z-index: 3; - } - } - - .page3 { - flex: 1; - display: flex; - flex-direction: column; - padding-bottom: 54px; - overflow: hidden; - overflow-y: auto; - - ::v-deep .el-form { - flex: 1; - display: flex; - flex-direction: column; - - .el-row { - flex: 1; - flex-wrap: wrap; - } - - .formTable-box { - flex: 1; - - .el-form-item__content { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - margin: 0 !important; - } - } - } - ::v-deep .formButton { - position: absolute; - bottom: 0; - right: 0; - z-index: 3; - } - } -} diff --git a/Code/Fe/src/components/UploadExcel/index.vue b/Code/Fe/src/components/UploadExcel/index.vue index e242060..bd1a0af 100644 --- a/Code/Fe/src/components/UploadExcel/index.vue +++ b/Code/Fe/src/components/UploadExcel/index.vue @@ -97,8 +97,6 @@ - \ No newline at end of file diff --git a/Code/Fe/src/components/commonTabel-drawer copy/style/index.scss b/Code/Fe/src/components/commonTabel-drawer copy/style/index.scss deleted file mode 100644 index 877fd49..0000000 --- a/Code/Fe/src/components/commonTabel-drawer copy/style/index.scss +++ /dev/null @@ -1,122 +0,0 @@ -.el-drawer__wrapper { - z-index: 10 !important; - position: absolute; - left: 32%; - overflow: visible; - // height:calc(100% - 28px); - // top: 14px; - // right:14px - - ::v-deep .el-drawer { - height: 100%; - overflow: visible; - box-shadow: 0 8px 10px -5px rgb(0 0 0 / 15%), 0 16px 24px 2px rgb(0 0 0 / 9%), 0 6px 30px 5px rgb(0 0 0 / 7%); - - .el-drawer__body { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - - .drawer-heder { - display: flex; - padding: 15px 10px; - justify-content: space-between; - align-items: center; - - .heder-left { - display: flex; - justify-content: space-between; - - .heder-img { - width: 40px; - height: 40px; - margin-right: 10px; - } - - .header-text { - padding:0 20px; - display: flex; - flex-direction: column; - justify-content: space-between; - - span:nth-child(1) { - color: #333; - font-size: 22px; - } - - span:nth-child(2) { - color: #999; - font-size: 16px; - } - } - } - } - - .Descriptions { - padding: 0 10px; - } - - .drawer-main { - // padding-top: 20px; - flex: 1; - overflow: hidden; - // background-color: #efefef; - padding: 10px 20px 20px 30px; - border-top: solid 5px #f6f6f6; - - .el-tabs { - height: 100%; - display: flex; - flex-direction: column; - .el-tabs__header{ - // padding-bottom: 5px ; - .el-tabs__nav{ - z-index: auto !important; - } - } - - .el-tabs__content { - flex: 1; - - .el-tab-pane { - width: 100%; - height: 100%; - overflow-y: auto; - } - - .el-descriptions-item__label { - padding-right: 40px; - } - } - } - } - - .drawer-Shut { - width: 35px; - height: 100px; - position: absolute; - top: 200px; - left: -35px; - - .el-button { - width: 100%; - height: 100%; - display: flex; - justify-content: center; - align-items: center; - - ::v-deep span { - font-size: 12px; - letter-spacing: 10px; - writing-mode: tb-rl; - } - } - } - } - } -} - -::v-deep .el-tabs__nav-wrap::after{ - content: unset !important; -} diff --git a/Code/Fe/src/components/commonTabel-drawer/index.vue b/Code/Fe/src/components/commonTabel-drawer/index.vue index b993a82..988db6d 100644 --- a/Code/Fe/src/components/commonTabel-drawer/index.vue +++ b/Code/Fe/src/components/commonTabel-drawer/index.vue @@ -11,13 +11,6 @@ >
-
{{ propsData[title[0].prop] }} {{ title[0].label }} @@ -66,79 +59,30 @@ :propsData="propsData" > - -
- 字段设置 - 筛选 -
- - - - - - - - - + - - - - + :currentPageProps="oldSkipCount" + @overallSearchFormClick="overallSearchClickForDetail" + :httpOverallSearchData="httpOverallSearchData" + @buttonOperationClick_left="buttonOperationClick_left" + :buttonOperationList_left="buttonOperationList_left" + :tableLoading="Loading.tableLoading" + > - - - -
关闭
+ + +
+ +
+
\ No newline at end of file + + \ No newline at end of file diff --git a/Code/Fe/src/components/currenForm/index.vue b/Code/Fe/src/components/currenForm/index.vue index 5e01ac9..572c11b 100644 --- a/Code/Fe/src/components/currenForm/index.vue +++ b/Code/Fe/src/components/currenForm/index.vue @@ -171,7 +171,7 @@ > -
+
+ + + + + @@ -44,6 +69,7 @@ @@ -350,11 +128,13 @@ :append-to-body="true" :show-close="true" :title="'内容详情'" + :close-on-click-modal="true" + :close-on-press-escape="true" > {{ showDetailData ? showDetailData + "" : showDetailData }} - + { - this.$message.success('复制成功'); - }) - .catch(err => { - this.$message.error('复制失败'); - }); - this.$nextTick(()=>{ - if(this.$refs.copyJsonTextarea_ref){ - this.$refs.copyJsonTextarea_ref.focus() - this.$nextTick(()=>{ + if (navigator.clipboard && window.isSecureContext) { + navigator.clipboard.writeText(this.showJsonData_str) + .then(() => { + this.$message.success('复制成功'); + this.$refs.copyJsonTextarea_ref.focus() document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0 }) - } - }) + .catch(err => { + this.$message.error('复制失败'); + this.$refs.copyJsonTextarea_ref.focus() + document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0 + }); + }else { + // 创建text area + const textArea = document.createElement('textarea') + textArea.value = this.showJsonData_str + // 使text area不在viewport,同时设置不可见 + document.body.appendChild(textArea) + textArea.focus() + textArea.select() + return new Promise((resolve, reject) => { + // 执行复制命令并移除文本框 + document.execCommand('copy') ? resolve() : reject(new Error('出错了')) + textArea.remove() + }).then(() => { + this.$nextTick(()=>{ + if(this.$refs.copyJsonTextarea_ref){ + this.$message.success('复制成功'); + this.$refs.copyJsonTextarea_ref.focus() + document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0 + } + }) + },() => { + this.$message.error('复制失败'); + this.$refs.copyJsonTextarea_ref.focus() + document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0 + }) + } + }, //点击按钮打开自定义弹窗 buttonClick(row, index, label) { this.$emit("buttonClick", row, index, label); }, - //点击table操作列按钮 - buttonOperationClick(row, item, index) { - this.$emit("buttonOperationClick", row, item, index); + //点击table操作列(左侧)按钮 + buttonOperationClick_left(row, item, index) { + this.$emit("buttonOperationClick_left", row, item, index); + }, + //点击table操作列(右侧)按钮 + buttonOperationClick_right(row, item, index) { + this.$emit("buttonOperationClick_right", row, item, index); + }, + // 转义枚举值 + initApiEnumList(item,data){ + let _item_enumList = {} + item.enums_list.forEach((item,key)=>{ + _item_enumList[item.value] = item.label + }) + return _item_enumList[data] || '未定义' + }, + // 其他类型转义,直接显示 | 点击可出详情 | 点击可点出json + initApiOtherType(data){ + try { + let _json = JSON.parse(data) + // 数值类型 + if(typeof _json == 'number' && _json){ + return [data,'show'] + }else{ + return [data,'json'] + } + } + // 直接显示 + catch(err){ + return [data,'detail'] + } + }, + // 判断操作 + showTypeHandle(type,row){ + if(type == 'detail')this.showDetailInfo(row) + if(type == 'json')this.showJsonTable(row) }, }, }; diff --git a/Code/Fe/src/filters/excelOrReportsOption.js b/Code/Fe/src/filters/excelOrReportsOption.js deleted file mode 100644 index b0c92cb..0000000 --- a/Code/Fe/src/filters/excelOrReportsOption.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * - * @returns {Array} '导入表格模板字段' - */ -// 供货商导入表格 -export const supplierAsnExcel = { - // poNumber:"订单号", - // number:"发货单号", - supplierCode:"供应商代码", - planUserCode:"筹措员代码", - planArriveDate:"要求到货时间", - shipDate:"发货日期", - details:{ - projectCode:"明细-项目编号", - itemCode:"明细-物品代码", - ctype:"明细-类型", - recommendErpCode:"明细-指定ERP储位", - qty:"明细-发货数量", - uom:"明细-物品单位", - lot:"明细-生产批次", - produceDate:"明细-生产时间", - expireDate:"明细-过期时间", - packingCode:"明细-箱标签", - }, - remark:"订单备注", -} - -// 报表地址 -// const reportsUrl = "http://10.164.1.39:59088/#/reports/"; -const reportsUrl = localStorage.getItem('reportsUrl') -// 报表文件地址 -export const reportsAddress = { - PurchaseReceiptSummary:reportsUrl + '202211300914188516.rdlx',//采购收货汇总表 - Inventory_Detail:reportsUrl + '202211291142233052.rdlx',//库存账龄明细 - InventoryAccountingPeriodDetails:reportsUrl + '202211300913580741.rdlx',//库存单据明细报表 - FinishedProductDeliverySummary:reportsUrl + '202211300920074461.rdlx',//成品发货汇总表 - CompletionReceiptSummary:reportsUrl + '202211300919413598.rdlx',//完工收货汇总表 - UnPlannedReceiptSummary:reportsUrl + '202211300921294414.rdlx',//非生产退料汇总(原计划外入库汇总) - UnplannedDeliverSummary:reportsUrl + '202211300921505958.rdlx',//非生产领料汇总(原计划外出库汇总) - Scrap_Detail:reportsUrl + '202211300912414755.rdlx',//报废明细表 - PurchaseSum:reportsUrl + '202211300913268367.rdlx',//订单汇总查询 - PurchaseReturnSummary:reportsUrl + '202211300925599696.rdlx',//采购退货汇总 - ProductionReturnSummary:reportsUrl + '202211300918259711.rdlx',//生产退料汇总表 - ProductionIssueSummary_dy:reportsUrl + '202211300917169689.rdlx',//生产发料汇总表 - InventoryBlanace:reportsUrl + '202211300922434081.rdlx',//库存余额报表 - InventorySummary:reportsUrl + '202211300921065163.rdlx',//盘点记录汇总表 - InventoryAgingSegmentSummary:reportsUrl + '202211300912101560.rdlx',//库存账龄分段汇总表 - InventoryBookDetail:reportsUrl + '202212162111466911.rdlx',//库存流水帐明细 - InventoryBookSummary:reportsUrl + '202212162112124488.rdlx',//库存流水帐汇总 - inventoryBalanceReportLocationCode:reportsUrl + '202211300922434082.rdlx',//库存余额报表按库位 - inventoryBalanceReportLocationErpCode:reportsUrl + '202211300922434083.rdlx',//库存余额报表按ERP库位 - InventoryBookSummaryLocation:reportsUrl + '202212162112124489.rdlx',//库存流水帐汇总(库位) -} diff --git a/Code/Fe/src/filters/options.js b/Code/Fe/src/filters/options.js deleted file mode 100644 index 2c27566..0000000 --- a/Code/Fe/src/filters/options.js +++ /dev/null @@ -1,267 +0,0 @@ -/** - * - * @returns {Array} '权限' - */ - -export function Roles(val){ - const role={ - // 通用 - "Create": "创建", - // "Edit": "修改", - "Update": "修改", - "Delete": "删除", - - // 身份标识管理(AbpIdentity) - "AbpIdentity": "身份标识管理", - - // 特性管理(FeatureManagement) - "FeatureManagement": "特性管理", - - // 设置管理(SettingManagement) - "SettingManagement": "设置管理", - - // 租户管理(AbpTenantManagement) - "AbpTenantManagement": "租户管理", - - // 认证(Auth) - "Auth": "认证", - //Auth-子集 - "Department": "部门", - /**/ - - // 基础数据(Basedata) - "Basedata": "基础数据", - //Basedata-子集 - "Currency": "货币", - "CurrencyExchange": "货币兑换", - "CustomerBom": "用户清单", - "InventoryRoute": "库存路径", - "TransactionType": "交易类型", - "ProductionLineItem": "产品类项目", - "Machine": "生产线", - "Param": "参数", - "PurchasePriceSheet": "采购价格表", - "Rule": "规则", - "Strategy": "战略", - "StrategyRule": "战略规则", - "Route": "路线", - "SalePriceSheet": "销售价格表", - "StdCostPriceSheet": "标准价格表", - "WorkShop": "车间", - "WorkGroup": "工作组", - "ItemGuideBook": "指导书", - /**/ - - // 库存(Inventory) - "Inventory": "库存", - //Inventory-子集 - "Container": "库存容量", - "LocationCapacity": "库存可用容量", - /**/ - - // 任务(Job) - "Job": "任务", - //Job-子集 - "CheckJob": "校验任务", - "UnplannedIssueJob":"计划外出库任务", - "UnplannedReceiptJob":"计划外入库任务", - "ProductionReturnJob":"生产退库任务", - /**/ - - // 仓库(Store) - "Store": "仓库", - //Store-子集 - "WorkOrder": "工作订单", - "ProductionReturnNote":"生产退库记录", - "InventoryTransferNote": "调拨发货", - "Print":"打印", - "Shipments": "发货任务(天津)", - "Instruments": "器具查询(天津)", - "ReceivingRecords": "收货记录(天津)", - "DeliveryRecord": "发货记录(天津)", - "CountAdjust": "库存调整", - "UnplannedIssueRequest":"非生产退料申请", - "UnplannedReceiptRequest":"非生产领料申请", - "ProductionReturnRequest":"生产退库申请", - "PurchaseReturnRequest": "采购退货申请", - "ProductRecycleRequest": "成品回收申请", - "NoOkConvertOkNote":"不合格转合格", - "PutawayRequest": "上架申请", - /**/ - - // 标签(Label) - "labelsList":"标签查询", - "Label": "标签", - //Label-子集 - "PalletLabel":"托盘标签", - "ProductionLabel":"生产标签", - "PurchaseLabel":"采购标签", - "SaleLabel":"销售标签", - "PalletCode":"托盘编码", - "SerialCode":"序列代码", - "CountLabel":"盘点标签", - /**/ - - // 消息通知(Message) - "Message": "消息通知", - //Message-子集 - "Announcement":"公告", - "NotifyMessage":"通知", - "PrivateMessage":"私人消息", - "MessageType":"消息类型", - "MessageTypeSubscribe":"消息订阅类型", - "UserNotifyMessage":"用户通知消息", - /**/ - - // 文件存储(FileStorage) - "FileStorage":"文件存储", - //FileStorage-子集 - "DataImportTask":"数据导入任务", - "DataExportTask":"数据导出任务", - /**/ - - // 以下数据为接口已翻译20221103 - /**/ - //Basedata基础数据-子集 - // "Warehouse": "仓库", - // "Area": "区域", - // "AreaItem": "区域零件", - // "Bom": "物品清单", - // "InterfaceCalendar": "日历接口", - // "Calendar": "日历", - // "Company": "公司", - // "Customer": "客户", - // "CustomerItem": "客户物品", - // "WorkStation": "工作中心", - // "Team": "班组", - // "Supplier": "供应商", - // "SupplierItem": "供应商物品", - // "Project": "项目", - // "Shift": "班次", - // "Uom": "计量单位", - // "ItemBasic": "物品基础信息", - // "ItemCategory": "物品分类信息", - // "ItemPack": "物品包装信息", - // "Category": "分类", - // "Dock": "收货口", - // "LocationGroup": "库位组", - // "Location": "库位", - // "ProductionLine": "生产线", - // "Configuration": "配置", - // "ItemQuality": "物品质量信息", - // "AQL": "物品质检标准", - // "SupplierTimeWindow": "供应商时间窗口", - // "ItemStoreRelation": "库位零件关系维护", - // "CustomerAddress": "客户地址", - /**/ - //Inventory库存-子集 - // "Balance": "库存余额", - // "Snapshot": "库存快照", - // "Transaction": "库存事务", - // "TransferLog": "库存转移日志", - /**/ - //Job任务-子集 - // "PurchaseReceiptJob": "采购收货任务", - // "InspectJob": "检验任务", - // "PutawayJob": "上架任务", - // "IssueJob": "发料任务", - // "DeliverJob": "发货任务", - // "PurchaseReturnJob": "采购退货任务", - // "ProductReceiveJob": "完工收货任务", - // "CountJob": "盘点任务", - /**/ - //Store仓库-子集 - // "PurchaseOrder": "采购订单", - // "SaleOrder": "销售订单", - // "SupplierAsn": "供应商ASN", - // "CustomerAsn": "客户发货通知", - // "ProductionPlan": "生产计划", - // "PreparationPlan": "备料计划", - // "ProductReceiptNote": "完工收货记录", - // "OfflineSettlementNote": "下线结算记录", - // "PurchaseReceiptRequest": "到货请求", - // "PurchaseReceiptNote": "采购收货记录", - // "ReceiptAbnormalNote": "收货异常记录", - // "PurchaseReturnNote": "采购退货记录", - // "PutawayNote": "上架记录", - // "MaterialRequest": "要料申请", - // "IssueNote": "发料记录", - // "UnplannedReceiptNote": "计划外入库记录", - // "UnplannedIssueNote": "计划外出库记录", - // "IsolationNote": "隔离记录", - // "ScrapNote": "报废记录", - // "DeliverPlan": "发货计划", - // "DeliverRequest": "发货申请", - // "DeliverNote": "发货记录", - // "CountPlan": "盘点计划", - // "CountNote": "盘点记录", - // "CountAdjustNote": "盘点差异调整记录", - // "InspectRequest": "报检单", - // "InspectNote": "检验记录", - // "InspectAbnormalNote": "质量异常记录", - // "ProductRecycleNote": "成品回收记录", - // "CustomerReturnNote": "客户退库记录", - /**/ - - // 以下数据接口数据不存在20221103 - /**/ - // "InventoryLocationCapacity": "库位可用容量", - // "Workshop": "车间", - // "FISDeliverRequest":"FIS发货申请", - // "FISDeliverNote":"FIS发货记录", - // "Occupied": "已占用库存", - // "Predictable": "预填充库存", - // "TracebackNote": "追溯记录", - // "StockReturnNote": "退库记录", - // "UserManage": "用户", - // "RoleManage": "权限控制", - // "Identity": "身份", - // "management": "管理", - // "Role management": "角色", - // // "Change": "修改", - // "Change permissions": "修改权限", - // "User management": "用户", - // "Manage Host features": "管理主机功能", - // "Tenant management": "租户", - // "Manage features": "管理功能", - // "Manage connection strings": "管理连接", - // "Permission": "权限", - // "PdaUserManage": "PDA控制", - // "Param": "参数", - // "Rule ": "规则", - // "DocumentSetting": "文档设置", - // "ItemSafetyStock": "物品安全库存", - // // "UserDepartment": "用户部门对应关系", - // "accountPeriodNote": "账期信息", - // "UserNotifyMessage":"用户消息类型关系", - // //调拨-线边仓 - // "lineSideWarehouseAllocationRequest":"线边仓调拨申请", - // "lineSideWarehouseAllocationConfirm":"线边仓调拨确认", - // "lineSideWarehouseAllocationNote":"线边仓调拨记录", - // //调拨-储位间 - // "interStorageAllocationApply":"储位间调拨申请", - // "interStorageAllocationConfirm":"储位间调拨确认", - // "interStorageAllocationNote":"储位间调拨记录", - // //调拨-客户储位 - // "customerStorageAllocationRequest":"客户储位调拨申请", - // "customerStorageAllocationConfirm":"客户储位调拨确认", - // "customerStorageAllocationNote":"客户储位调拨记录", - // //东阳-追溯记录 - // "backFlushNote":"追溯记录", - // //东阳-退拆 - // "customerDismantle":"退拆申请", - // "customerDismantleNote":"退拆记录", - // //回收料 - // "materialsAdjustment":"回收料调整记录", - // "recycledMaterialsAdjustmentApply":"回收料调整申请", - // "recycledMaterialsReceipt":"回收料收货记录", - // // 自定义 - // "beforeGroundingReturnNote": "上架前退货记录", - // // 非生产领料 - // "pickingRequest":"非生产领料申请", - // // 非生产退料 - // "materialReturnRequest":"非生产退料申请" - } - return role[val] -} - diff --git a/Code/Fe/src/filters/status.js b/Code/Fe/src/filters/status.js index 59dc1a1..b213bb4 100644 --- a/Code/Fe/src/filters/status.js +++ b/Code/Fe/src/filters/status.js @@ -1445,6 +1445,21 @@ export function whetherOrNot(index, prop) { } return Enum(filter, index, prop) } +export function whetherOrNotForNum(index, prop) { + let filter = { + 1: { + label: "是", + value: 1, + background:"#31BB99", + }, + 0: { + label: "否", + value: 0, + background:"#EC5B28", + }, + } + return Enum(filter, index, prop) +} /** * @returns {object} '基本状态' */ diff --git a/Code/Fe/src/filters/statusType.js b/Code/Fe/src/filters/statusType.js index 255e975..95abfe2 100644 --- a/Code/Fe/src/filters/statusType.js +++ b/Code/Fe/src/filters/statusType.js @@ -1,7 +1,5 @@ import * as status from "./status" -import * as options from "./options" const filters = { - ...status, - ...options + ...status } export default filters diff --git a/Code/Fe/src/layout/components/Navbar.vue b/Code/Fe/src/layout/components/Navbar.vue index d7fcd54..3523da9 100644 --- a/Code/Fe/src/layout/components/Navbar.vue +++ b/Code/Fe/src/layout/components/Navbar.vue @@ -38,10 +38,10 @@ 系统首页 - + + 退出登录 @@ -78,8 +78,10 @@ export default { this.$store.dispatch("app/toggleSideBar"); }, async logout() { - await this.$store.dispatch("user/logout"); - this.$router.push(`/login?redirect=${this.$route.fullPath}`); + await this.$store.dispatch("user/logout") + // this.$router.push(`/login?redirect=${this.$route.fullPath}`); + // this.$router.push(`/login?redirect=${this.$route.fullPath}&isAutoLogin=false`) + this.$router.push(`/login?isAutoLogin=false`) }, handleClick() { diff --git a/Code/Fe/src/mixins/LoadingMixins.js b/Code/Fe/src/mixins/LoadingMixins.js index efc9f06..ed8c1cd 100644 --- a/Code/Fe/src/mixins/LoadingMixins.js +++ b/Code/Fe/src/mixins/LoadingMixins.js @@ -21,6 +21,7 @@ export const LoadingMixins = { importDialog: false, //导入 exportDialog: false, //导出 handleFromDialog: false, //执行生成 + detailInfoDialog:false,//明细-查看详情弹窗 }, } } diff --git a/Code/Fe/src/mixins/TableHeaderMixins.js b/Code/Fe/src/mixins/TableHeaderMixins.js index 62808fb..72ee502 100644 --- a/Code/Fe/src/mixins/TableHeaderMixins.js +++ b/Code/Fe/src/mixins/TableHeaderMixins.js @@ -1,8 +1,6 @@ import { getPageList, postExport, - postUpdateAvailableCapacity, - fileStorage } from "@/api/wms-api" import * as allUrlOption from '@/utils/baseData/urlOption' @@ -40,7 +38,7 @@ export const TableHeaderMixins = { let _params = { isRedundance:Boolean(form.isRedundance), isDetailExport:Boolean(form.isDetail), - userId:JSON.parse(localStorage.getItem("currentUserInfo")).id + userId:this.$store.getters.currentUserInfo.id } let _exportUrl = this.URLOption_export ? this.URLOption_export : this.URLOption_base; let _special = this.URLOption_export ? true : false @@ -99,28 +97,6 @@ export const TableHeaderMixins = { else if (val == 'filterForDetail'){ this.changeFilterForDetailShow(true) } - //更新可用容量 - else if (val == 'refresh-capacity') { - this.Loading.appMainLoading = true - let count = 0 - this.tableData.forEach(element => { - postUpdateAvailableCapacity({ - locationCode: element.locationCode - }, this.URLOption_base).then(res => { - count += 1 - if (count == this.tableData.length) { - this.Loading.appMainLoading = false - this.paging() - } - }).catch(err => { - count += 1 - if (count == this.tableData.length) { - this.Loading.appMainLoading = false - this.paging() - } - }) - }) - } // 自定义按钮 // 批量打印 ; 不合格转合格 else if(val == 'custom'){ item.customHandle() @@ -301,12 +277,13 @@ export const TableHeaderMixins = { * 表头字段设置 * @param {*} data 数据 * @param {*} type 设置来源 - * list_api: 表头来自api的列表 detail_api: 表头来自api列表的明细 + * list_api: 表头来自api的列表 detail_api: 表头来自api列表的明细 detailPage_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 == 'detailPage_api'){ this.apiColumns_DetailsPage = data } if(type && type == 'list'){ this.tableColumns = data } if(type && type == 'detail'){ this.detailsTableColumns = data } } diff --git a/Code/Fe/src/mixins/TableMixins.js b/Code/Fe/src/mixins/TableMixins.js index 8e92b9e..1eedc15 100644 --- a/Code/Fe/src/mixins/TableMixins.js +++ b/Code/Fe/src/mixins/TableMixins.js @@ -1,9 +1,9 @@ import { getPageList, getDetailed, - allSupplierByCodes, postDelete } from '@/api/wms-api' +import { zhApiColumnsLable,firstWordSizeChange } from '@/utils/index' import * as allUrlOption from '@/utils/baseData/urlOption' export const tableMixins = { data() { @@ -42,36 +42,118 @@ export const tableMixins = { apiColumns_Table:null, apiColumns_DesTions:null, apiColumns_DetailsTable:null, + // apiColumns_DetailsPage:null, //主表-列表 URLOption_base:allUrlOption[this.$route.name].baseURL, //主表-明细 URLOption_detail:allUrlOption[this.$route.name].detailURL, + //明细列表(主表明细找枚举转义使用) + URLOption_detailList:allUrlOption[this.$route.name].detailListURL, // 主表-明细-筛选数据同步回显 detailSearchDataFE:null, // 主表-操作列 - operationButtonsTable:[{label:'查看详情',name:'info'}] + buttonOperationClick_leftBase:[{label:'查看详情',name:'info'}] } }, methods: { + // 主表-右侧操作列基础按钮 + buttonOperationList_rightBase(data){ + return [{ + label:'编辑', + name:'edit', + },{ + label:'删除', + name:'delete', + color:'red' + }] + }, + // 主表-右侧操作列基础按钮操作 + buttonOperationClick_right(row,item){ + // 编辑 + if (item.name == "edit") { + this.formTitle = this.$route.meta.title + "编辑"; + this.formReveal = false + this.theEvent = "edit" + const listAssign = (arr1, arr2) => { + Object.keys(arr1).forEach(item => { + arr1[item] = arr2[item] + }) + } + listAssign(this.editFormData, row) + this.displayDialog.editDialog = true + } + // 删除 + else if (item.name == "delete"){ + this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.Loading.tableLoading = true + let _url = this.URLOption_delete ? this.URLOption_delete : this.URLOption_base + '/delete-by-id' + postDelete(row.id, _url).then(res => { + this.$successMsg('删除成功!') + this.Loading.tableLoading = false + this.paging() + }).catch(err => { + this.Loading.tableLoading = false + }) + }).catch(() => { + this.Loading.tableLoading = false + }); + } + }, // 获取通过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') - + // initApiColumns(table,des,detailsTable,detailsPage){ + // // 赋值表头数据 + // // if(table && table[this.$route.name])this.apiColumns_Table = this.initTableColumns(table[this.$route.name]) + // if(des && des[this.$route.name])this.apiColumns_DesTions = des[this.$route.name] + // if(detailsTable && detailsTable[this.$route.name])this.apiColumns_DetailsTable = this.initTableColumns(detailsTable[this.$route.name],'detail_api') + // if(detailsPage && detailsPage[this.$route.name])this.apiColumns_DetailsPage = this.initTableColumns(detailsPage[this.$route.name],'detailPage_api') + // }, + // get-dto-column-type接口表头类型初始化 + initApiColumnsForDto(list,titleName){ + let data = this.$store.getters.dtoColumnTypes + let _coloums = data[titleName].S + let _Columns_Table = [] + if(_coloums){ + let _data = _coloums.dtoList + _data.forEach(item=>{ + let _item = item + _item.label = zhApiColumnsLable(titleName + item.name) || item.name + _item.prop = firstWordSizeChange(item.name) + // 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加 + let _if = firstWordSizeChange(item.name) != 'details' + if(list && list.length > 0){ + _if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details' + } + if(_if){ + _Columns_Table.push(_item) + } + }) + } + return _Columns_Table }, //渲染数据 paging(callback) { this.Loading.tableLoading = true; this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount - getPageList(this.PageListParams, this.URLOption_base).then(res => { - this.tableData = res.items - this.totalCount = res.totalCount - this.pagingCallback(callback) - }).catch(err => { - this.Loading.tableLoading = false - }) + getPageList(this.PageListParams, this.URLOption_base) + .then(res=>{ + // 表头处理 + let _Columns = this.initApiColumnsForDto(res,this.$route.name) + this.apiColumns_Table = this.initTableColumns(_Columns) + this.apiColumns_DesTions = _Columns + // 页面数据处理 + if(res){ + this.tableData = res.items + this.totalCount = res.totalCount + } + this.pagingCallback(callback) + }) + .catch(err=>{ + this.Loading.tableLoading = false + }) }, //接受排序信息并改变视图 sortChange(val) { @@ -103,6 +185,7 @@ export const tableMixins = { }, //点击Table行内名称 inlineDialog(val) { + if(this.$refs.currenDrawer_Ref)this.$refs.currenDrawer_Ref.closeDetailInfo() // 打开抽屉后,点击其他信息,默认回到详情位置上,避免特殊需要重新点击获取接口的tag页面数据不更新 this.firstTabs = 'xq' //打开抽屉 @@ -110,27 +193,38 @@ export const tableMixins = { this.Loading.DrawerLoading = true this.displayDialog.detailsDialog = true; let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base - getDetailed(val.id, _url).then(res => { + getDetailed(val.id, _url) + .then(res=>{ + // 表头处理 + let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/')) + this.apiColumns_DetailsTable = this.initTableColumns(this.initApiColumnsForDto(res.details[0],_parentName),'detail_api') + // 打印使用的全部数据存储 + this.tableDataDetails = JSON.parse(JSON.stringify(res)) + this.propsData = res if (res.details) { - this.tableDataDetails = JSON.parse(JSON.stringify(res)) - // 前端分页处理 - this.propsData = this.detailListPageFromFE(res) - } else { - this.propsData = res + if(this.$refs.currenDrawer_Ref){ + this.$refs.currenDrawer_Ref.getDetailList(res,()=>{ + this.inlineDialogCallback() + },()=>{ + this.Loading.DrawerLoading = false + }) + } + }else{ + this.Loading.DrawerLoading = false } - this.inlineDialogCallback() - }).catch(err => { - this.Loading.DrawerLoading = false - }) + }) + .catch(err=>{ + 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 - }, + // 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 @@ -159,70 +253,6 @@ export const tableMixins = { handleSelectionChange(val) { this.multipleSelection = val; }, - // 获取供应商信息过滤tableData - getSupplierByCodesHandle_table() { - for(let i=0;i{ - if(item.supplierCode && item.supplierCode.length > 0 && _allSuCode.indexOf(item.supplierCode) < 0){ - _allSuCode.push(item.supplierCode) - } - }) - if(_allSuCode.length <= 0){ - this.Loading.tableLoading = false - return - } - allSupplierByCodes(_allSuCode).then(res => { - let _all = [] - res.forEach(item=>{ - _all[item.code] = item - }) - this.tableData.forEach(item=>{ - if(_all[item.supplierCode]){ - this.$set(item,"supplierName", _all[item.supplierCode].name) - this.$set(item,"supplierAddress", _all[item.supplierCode].address) - this.$set(item,"supplierShortName", _all[item.supplierCode].shortName) - } - }) - this.Loading.tableLoading = false - }).catch(err => { - console.log(err) - this.Loading.tableLoading = false - }) - return - }else{ - this.Loading.tableLoading = false - } - } - }, - // 获取供应商信息过滤propsData - getSupplierByCodesHandle_props() { - for(let i=0;i { - this.Loading.DrawerLoading = false - if(res.length > 0){ - this.$set(this.propsData,"supplierName", res[0].name) - this.$set(this.propsData,"supplierAddress", res[0].address) - this.$set(this.propsData,"supplierShortName", res[0].shortName) - } - }).catch(err => { - console.log(err) - this.Loading.DrawerLoading = false - }) - return - }else{ - this.Loading.DrawerLoading = false - } - } - }, // 主列表操作列按钮执行方法 /** * @@ -230,7 +260,7 @@ export const tableMixins = { * @param {*} item 按钮信息 * @param {*} index 按钮索引 */ - buttonOperationClick(row, item, index) { + buttonOperationClick_left(row, item, index) { // 获取当前行数据,赋值给 propsData this.propsData = row // 查看详情 @@ -279,49 +309,46 @@ export const tableMixins = { pagingCallback(callback){ this.Loading.tableLoading = false 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 - }, + // 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; + // 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 - // this.getSupplierByCodesHandle_props() } } } diff --git a/Code/Fe/src/mixins/drawerMixins.js b/Code/Fe/src/mixins/drawerMixins.js index edbafc7..0daf18f 100644 --- a/Code/Fe/src/mixins/drawerMixins.js +++ b/Code/Fe/src/mixins/drawerMixins.js @@ -28,6 +28,8 @@ export const drawerMixins = { propsData: {}, URLOption_base:allUrlOption[this.$route.name].baseURL, URLOption_delete:allUrlOption[this.$route.name].deleteURL, + // 主表-明细-操作列 + operationButtonsDetail:[{label:'查看详情',name:'info'}], } }, methods: { diff --git a/Code/Fe/src/mixins/mixins.js b/Code/Fe/src/mixins/mixins.js index d18b46c..9ce7687 100644 --- a/Code/Fe/src/mixins/mixins.js +++ b/Code/Fe/src/mixins/mixins.js @@ -58,8 +58,8 @@ export const mixins = { let _list_defalut = columnsData ? columnsData : this.$isTableColumns[this.$route.name] let _type = type ? type : 'list_api' if(!_list_defalut)return - 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 _local = localStorage.getItem('file_Columns_' + _type + '_' + this.$store.getters.currentUserInfo.userName + '_' + this.$route.name) + let _list_local = JSON.parse(localStorage.getItem('file_Columns_' + _type + '_' + this.$store.getters.currentUserInfo.userName + '_' + this.$route.name)) let _new_list = [] //格式化后的数据 // 如果没有缓存则直接为默认值 if(!_local){ diff --git a/Code/Fe/src/mixins/newAndEdiDialogMixins.js b/Code/Fe/src/mixins/newAndEdiDialogMixins.js index 3b83cac..6f6dd13 100644 --- a/Code/Fe/src/mixins/newAndEdiDialogMixins.js +++ b/Code/Fe/src/mixins/newAndEdiDialogMixins.js @@ -71,7 +71,7 @@ export const newAndEdiDialogMixins = { break; case false: if(!_updata && !this.URLOption_updata){_url = _url + '/update-by-id'} - postUpdate(this.editFormData, this.propsData.id, _url).then(res => { + postUpdate(this.editFormData, this.editFormData.id, _url).then(res => { this.propsData = res this.Loading.newAndEdiLoading = false this.FormResult("success") diff --git a/Code/Fe/src/permission - 副本.js b/Code/Fe/src/permission - 副本.js deleted file mode 100644 index 13cf7b6..0000000 --- a/Code/Fe/src/permission - 副本.js +++ /dev/null @@ -1,90 +0,0 @@ -import router from './router' -import store from './store' -import { - Message -} from 'element-ui' -import NProgress from 'nprogress' // progress bar -import 'nprogress/nprogress.css' // progress bar style -import { - getToken -} from '@/utils/auth' // get token from cookie -import getPageTitle from '@/utils/get-page-title' -import { - asyncRoutes -} from '@/router' - -NProgress.configure({ - showSpinner: false -}) // NProgress Configuration - -const whiteList = ['/login', '/auth-redirect', '/testForm'] // no redirect whitelist - -router.beforeEach(async (to, from, next) => { - // 添加路由信息,方便代码修改定位 - // console.log('----------------' + to.meta.title + '-----------------------'+ to.fullPath.substring(to.fullPath.lastIndexOf('-')+1,to.fullPath.length) + '.vue' ); - // start progress bar - NProgress.start() - - // set page title - document.title = getPageTitle() - next() - // determine whether the user has logged in - // todo-new:等获取token接口恢复后做处理 - const hasRoles =await store.getters.roles && await store.getters.roles.length > 0 - if (hasRoles) { - next() - } else { - try { - // get user info - // note: roles must be a object array! such as: ['admin'] or ,['developer','editor'] - - // 如果缓存中没有 interfaceBoardColumnsNames(接口监控看板表头信息) 的缓存数据 则退出登录 - let _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") - if(!_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){ - await store.dispatch('user/logout') - next(`/login?redirect=${to.path}`) - NProgress.done() - } - - const { - roles - } = await store.dispatch('user/getInfo') - // generate accessible routes map based on roles - - // const accessRoutes = await store.dispatch('permission/generateRoutes', localStorage.getItem('userId')) - // router.addRoutes(accessRoutes) - - // 原码 防止刷新出现空白页(系统暂无出现所以注释) - // const accessRoutes = await store.dispatch('permission/generateRoutes', roles) - // router.addRoutes(accessRoutes) - - // hack method to ensure that addRoutes is complete - // set the replace: true, so the navigation will not leave a history record - next({ - ...to, - replace: true - }) - } catch (error) { - // remove token and go to login page to re-login - await store.dispatch('user/resetToken') - Message.error(error || 'Has Error') - next(`/login?redirect=${to.path}`) - NProgress.done() - } - } -}) - -router.afterEach(() => { - // element-ui 使用 Tooltip 提示时候,更换页面,提示依旧存在偶现bug处理。 - const mytooltipList = document.querySelectorAll('.el-tooltip__popper') // 获取页面所有tooltip的dom集合 - setTimeout(() => { - mytooltipList.forEach((value) => { - value.style.display = 'none' - if(value.parentElement){ - value.parentElement.removeChild(value) - } - }) - }, 1000) - // finish progress bar - NProgress.done() -}) diff --git a/Code/Fe/src/permission-0725.js b/Code/Fe/src/permission-0725.js new file mode 100644 index 0000000..17c6acc --- /dev/null +++ b/Code/Fe/src/permission-0725.js @@ -0,0 +1,178 @@ +import router from './router' +import store from './store' +import { Message } from 'element-ui' +import NProgress from 'nprogress' // progress bar +import 'nprogress/nprogress.css' // progress bar style +import { getToken } from '@/utils/auth' // get token from cookie +import getPageTitle from '@/utils/get-page-title' +import { asyncRoutes } from '@/router' +import { login,getUsersByUserName } from "@/api/wms-auth" + +NProgress.configure({ + showSpinner: false +}) // NProgress Configuration + +router.beforeEach(async (to, from, next) => { + // start progress bar + NProgress.start() + // set page title + document.title = getPageTitle() + + // 获取枚举数据 + if(!store.getters.enumList || store.getters.enumList.length <= 0){ + await store.dispatch('definition/getDefinitionConfig') + } + + // // 获取表头转义 + // if(!store.getters.columZHList || store.getters.columZHList.length <= 0){ + // await store.dispatch('definition/getColumZHList') + // } + + // 判断是否自动登录 + let isAutoLogin = JSON.parse(localStorage.getItem('isAutoLogin')) + const interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") + // 如果路径中有isAutoLogin参数则优先,否则读取配置文件中的isAutoLogin参数 + let _url_isAutoLogin = to.query.isAutoLogin + if( _url_isAutoLogin== 'false' || _url_isAutoLogin == 'true'){ + isAutoLogin = JSON.parse(_url_isAutoLogin) + } + // 是否有用户信息: + const userInfo = store.getters.currentUserInfo + // 1、如果没有判断是否为自动登录(是自动登录则自动执行登录,账号密码为配置信息中的值,不是自动登录则跳到登录页) + // 2、有/没有:则检查是否有api接口的表头数据,没有的话重新获取 + if(userInfo){ + console.log('有store.getters.currentUserInfo',store.getters.currentUserInfo) + if(store.getters.permission_routes && store.getters.permission_routes.length > 0){ + console.log('有store.getters.permission_routes',store.getters.permission_routes) + next() + } + else{ + console.log('没有store.getters.permission_routes',store.getters.permission_routes) + const accessRoutes = await store.dispatch('permission/getApiColumnsNames') + router.addRoutes(accessRoutes) + next({ + ...to, + query:{ + loginName:to.query.loginName, + isAutoLogin:to.query.isAutoLogin, + isSinglePage:to.query.isSinglePage + }, + replace: true + }) + } + }else{ + // console.log('没有store.getters.currentUserInfo',store.getters.currentUserInfo) + if(!interfaceBoardColumnsNames){ + console.log('没有interfaceBoardColumnsNames',interfaceBoardColumnsNames) + await store.dispatch('definition/getColumZHList') + // const accessRoutes = await store.dispatch('permission/getApiColumnsNames') + // router.addRoutes(accessRoutes) + next({ + ...to, + query:{ + loginName:to.query.loginName, + isAutoLogin:to.query.isAutoLogin, + isSinglePage:to.query.isSinglePage + }, + replace: true + }) + } + if(isAutoLogin || to.query.loginName){ + console.log('有自动登录',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(()=>{ + let _username = to.query.loginName || localStorage.getItem("isLoginName") || localStorage.getItem("userNameOrEmailAddress") + if(to.path != '/login'){ + await store.dispatch('user/getUserInfo',_username).then(()=>{ + next({ + ...to, + query:{ + loginName:to.query.loginName, + isAutoLogin:to.query.isAutoLogin, + isSinglePage:to.query.isSinglePage + }, + replace: true + }) + }).catch(()=>{ + next() + // next({ + // path:'/login', + // query:{ + // isAutoLogin:to.query.isAutoLogin, + // isSinglePage:to.query.isSinglePage + // }, + // replace: true + // }) + // next(`/login?loginName=${to.query.loginName}&isAutoLogin=${to.query.isAutoLogin}`) + // next(`/login`) + Message.error('获取用户信息失败,请重试!') + }) + }else{ + next() + // next({ + // ...to, + // query:{ + // loginName:to.query.loginName, + // isAutoLogin:to.query.isAutoLogin, + // isSinglePage:to.query.isSinglePage + // }, + // replace: true + // }) + } + // }) + // .catch((error) => { + // console.log('登录失败') + // }) + } + else{ + console.log('不自动登录',isAutoLogin,to.query.loginName) + if (to.path != '/login') { + Message.error('获取用户信息失败,请重新登录') + next({ + path:'/login', + query:{ + isAutoLogin:to.query.isAutoLogin, + loginName:to.query.loginName, + isSinglePage:to.query.isSinglePage + }, + replace: true + }) + // next(`/login?loginName=${to.query.loginName}&isAutoLogin=${to.query.isAutoLogin}`) + // next(`/login`) + }else{ + // next({ + // ...to, + // query:{ + // isAutoLogin:to.query.isAutoLogin, + // loginName:to.query.loginName, + // }, + // replace: true + // }) + next() + } + } + NProgress.done() + } +}) + +router.afterEach(() => { + // element-ui 使用 Tooltip 提示时候,更换页面,提示依旧存在偶现bug处理。 + const mytooltipList = document.querySelectorAll('.el-tooltip__popper') // 获取页面所有tooltip的dom集合 + setTimeout(() => { + mytooltipList.forEach((value) => { + value.style.display = 'none' + if(value.parentElement){ + value.parentElement.removeChild(value) + } + }) + }, 1000) + // finish progress bar + NProgress.done() +}) \ No newline at end of file diff --git a/Code/Fe/src/permission.js b/Code/Fe/src/permission.js index fc99b88..9424c1d 100644 --- a/Code/Fe/src/permission.js +++ b/Code/Fe/src/permission.js @@ -1,36 +1,41 @@ import router from './router' import store from './store' -import { - Message -} from 'element-ui' +import { Message } from 'element-ui' import NProgress from 'nprogress' // progress bar import 'nprogress/nprogress.css' // progress bar style -import { - getToken -} from '@/utils/auth' // get token from cookie +import { getToken } from '@/utils/auth' // get token from cookie import getPageTitle from '@/utils/get-page-title' -import { - asyncRoutes -} from '@/router' -import { getInterfaceBoard } from "@/api/wms-interface" +import { asyncRoutes } from '@/router' import { login,getUsersByUserName } from "@/api/wms-auth" NProgress.configure({ showSpinner: false }) // NProgress Configuration -const whiteList = ['/login', '/auth-redirect', '/testForm'] // no redirect whitelist - - router.beforeEach(async (to, from, next) => { - // 添加路由信息,方便代码修改定位 - // console.log('----------------' + to.meta.title + '-----------------------'+ to.fullPath.substring(to.fullPath.lastIndexOf('-')+1,to.fullPath.length) + '.vue' ); // start progress bar NProgress.start() - // set page title document.title = getPageTitle() + // 获取表头转义 + if(!store.getters.columZHList || store.getters.columZHList.length <= 0){ + await store.dispatch('definition/getColumZHList') + } + + // 获取菜单数据 + if(!store.getters.permission_routes || store.getters.permission_routes.length <= 0){ + const accessRoutes = await store.dispatch('permission/getApiColumnsNames') + router.addRoutes(accessRoutes) + } + + // 获取枚举数据 + if(!store.getters.enumList || store.getters.enumList.length <= 0){ + await store.dispatch('definition/getDefinitionConfig') + } + + // 是否有用户信息: + const userInfo = store.getters.currentUserInfo // 判断是否自动登录 let isAutoLogin = JSON.parse(localStorage.getItem('isAutoLogin')) // 如果路径中有isAutoLogin参数则优先,否则读取配置文件中的isAutoLogin参数 @@ -38,135 +43,72 @@ router.beforeEach(async (to, from, next) => { if( _url_isAutoLogin== 'false' || _url_isAutoLogin == 'true'){ isAutoLogin = JSON.parse(_url_isAutoLogin) } - let userInfo = localStorage.getItem('currentUserInfo') - let _zh = localStorage.getItem('columnsApiNamesZh') - // 是否有用户信息: - // 1、如果没有判断是否为自动登录(是自动登录则自动执行登录,账号密码为配置信息中的值,不是自动登录则跳到登录页) - // 2、如果有用户信息:则检查是否有api接口的表头数据,没有的话重新获取 - if(!userInfo){ - if(isAutoLogin || to.query.loginName){ - // let loginForm= { + if(to.path == '/login'){ + console.log('-------当前路由为登录页-------') + next() + }else{ + console.log('-------当前路由不是登录页-------') + if(userInfo){ + console.log('-------当前有用户信息-------',userInfo) + next() + }else{ + console.log('-------当前没有用户信息-------',userInfo) + if(isAutoLogin || to.query.loginName){ + let _username = to.query.loginName || localStorage.getItem("isLoginName") || localStorage.getItem("userNameOrEmailAddress") + console.log('-------要求自动登录-------',isAutoLogin,to.query.loginName,_username) + // 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(() => { + // // store.dispatch('user/login', loginForm).then(() => { // login(loginForm).then(()=>{ - getUsersByUserName(localStorage.getItem("userNameOrEmailAddress")).then(res=>{ - // todo:currentUserInfo全程需要优化 - localStorage.setItem("currentUserInfo", JSON.stringify(res)); - }) - .catch(err => { - console.log('获取用户信息失败,请重试') - }) - // 提前获取接口监控看板表头数据并存储 - getInterfaceBoard().then(result => { - localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts)); - next('/') - }) - .catch(err => { - console.log('获取表头失败,请重试') + await store.dispatch('user/getUserInfo',_username).then(()=>{ + console.log("-------用户信息获取成功-------") + next({ + ...to, + query:{ + loginName:to.query.loginName, + isAutoLogin:to.query.isAutoLogin, + isSinglePage:to.query.isSinglePage + }, + replace: true + }) + }).catch(()=>{ + next() + // next({ + // path:'/login', + // query:{ + // isAutoLogin:to.query.isAutoLogin, + // isSinglePage:to.query.isSinglePage + // }, + // replace: true + // }) + // next(`/login?loginName=${to.query.loginName}&isAutoLogin=${to.query.isAutoLogin}`) + // next(`/login`) + localStorage.removeItem("isLoginName") + Message.error('获取用户信息失败,请重试!') }) // }) // .catch((error) => { // console.log('登录失败') // }) - }else{ - if (to.path != '/login') { - next('/login') }else{ - next() + console.log('-------不需要自动登录-------',isAutoLogin,to.query.loginName) + next({ + path:'/login', + query:{ + loginName:to.query.loginName, + isAutoLogin:to.query.isAutoLogin, + isSinglePage:to.query.isSinglePage + }, + replace: true + }) } - NProgress.done() - } - }else{ - // 重新获取api接口表头 - const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") - if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){ - getInterfaceBoard().then(result => { - // todo-new:columnsApiNamesZh配置的地址补全(evel) - localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts)); - setTimeout(()=>{ - next() - },0) - }) - }else{ - next() } } - - - // determine whether the user has logged in - - // todo-new:如果token接口恢复做处理 - const hasToken = getToken() - // else if (hasToken) { - // // if(from.path != '/login'){ - // // let _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") - // // if(!_interfaceBoardColumnsNames){ - // // // next({ - // // // path: '/' - // // // }) - // // // NProgress.done() - // // } - // // } - // if (to.path === '/login') { - // // if is logged in, redirect to the home page - // next({ - // path: '/' - // }) - // NProgress.done() // hack: https://github.com/PanJiaChen/vue-element-admin/pull/2939 - // } else { - // // determine whether the user has obtained his permission roles through getInfo - // const hasRoles =await store.getters.roles && await store.getters.roles.length > 0 - // if (hasRoles) { - // next() - // } else { - // try { - // // get user info - // // note: roles must be a object array! such as: ['admin'] or ,['developer','editor'] - - // const { - // roles - // } = await store.dispatch('user/getInfo') - // // generate accessible routes map based on roles - - // // const accessRoutes = await store.dispatch('permission/generateRoutes', localStorage.getItem('userId')) - // // router.addRoutes(accessRoutes) - - // // 原码 防止刷新出现空白页(系统暂无出现所以注释) - // // const accessRoutes = await store.dispatch('permission/generateRoutes', roles) - // // router.addRoutes(accessRoutes) - - // // hack method to ensure that addRoutes is complete - // // set the replace: true, so the navigation will not leave a history record - // next({ - // ...to, - // replace: true - // }) - // } catch (error) { - // // remove token and go to login page to re-login - // await store.dispatch('user/resetToken') - // Message.error(error || 'Has Error') - // next(`/login?redirect=${to.path}`) - // NProgress.done() - // } - // } - // } - // } else { - // /* has no token*/ - - // if (whiteList.indexOf(to.path) !== -1) { - // // in the free login whitelist, go directly - // next() - // } else { - // // other pages that do not have permission to access are redirected to the login page. - // next(`/login?redirect=${to.path}`) - // NProgress.done() - // } - // } }) router.afterEach(() => { @@ -182,4 +124,4 @@ router.afterEach(() => { }, 1000) // finish progress bar NProgress.done() -}) +}) \ No newline at end of file diff --git a/Code/Fe/src/router/index-0718.js b/Code/Fe/src/router/index-0718.js new file mode 100644 index 0000000..789cb70 --- /dev/null +++ b/Code/Fe/src/router/index-0718.js @@ -0,0 +1,193 @@ +import Vue from 'vue' +import Router from 'vue-router' + + +Vue.use(Router) + +/* Layout */ +import Layout from '@/layout' + +/* Router Modules */ +import baseConfig from './modules/baseConfig' +import interfaceBoardRouter from './modules/interfaceBoard' +import systemManage from './modules/systemManage' + +/** + * Note: sub-menu only appear when route children.length >= 1 + * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html + * + * hidden: true if set true, item will not show in the sidebar(default is false) + * alwaysShow: true if set true, will always show the root menu + * if not set alwaysShow, when item has more than one children route, + * it will becomes nested mode, otherwise not show the root menu + * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb + * name:'router-name' the name is used by (must set!!!) + * meta : { + roles: ['admin','editor'] control the page roles (you can set multiple roles) + title: 'title' the name show in sidebar and breadcrumb (recommend set) + icon: 'svg-name'/'el-icon-x' the icon show in the sidebar + noCache: true if set true, the page will no be cached(default is false) + affix: true if set true, the tag will affix in the tags-view + breadcrumb: false if set false, the item will hidden in breadcrumb(default is true) + activeMenu: '/example/list' if set path, the sidebar will highlight the path you set + } + */ + +/** + * constantRoutes + * a base page that does not have permission requirements + * all roles can be accessed + */ +export let constantRoutes = [ + { + path: '/redirect', + component: Layout, + hidden: true, + children: [{ + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect/index') + }] + }, + { + path: '/login', + component: () => import('@/views/login/index'), + hidden: true + }, + { + path: '/404', + component: () => import('@/views/error-page/404'), + hidden: true + }, + { + path: '/401', + component: () => import('@/views/error-page/401'), + hidden: true + }, + { + path: '/profileuser', + component: Layout, + redirect: '/profileuser/index', + hidden: true, + children: [{ + path: 'index', + component: () => import('@/views/profileuser/index'), + name: 'Profileuser', + meta: { + title: '个人中心', + icon: 'user', + noCache: true + } + }] + }, + { + path: '/', + component: Layout, + redirect: '/dashboard', + // hidden: true, + children: [{ + path: 'dashboard', + component: () => import('@/views/dashboard/index'), + name: 'Dashboard', + meta: { + keepAlive : true, + title: '系统首页', + icon: '系统首页', + outerFirst:true + // affix: true + } + }] + }, + // 系统 + // { + // path: '/systemManage', + // component: Layout, + // redirect: 'noRedirect', + // meta: { + // title: '系统权限管理11111', + // icon: '系统权限控制', + // roles:'skip' + // }, + // children: [{ + // path: 'UserManage', + // name: 'userManage', + // component: () => import('@/views/systemManage/userManage'), + // meta: { + // title: '用户信息维护', + // icon: '用户', + // roles: 'AbpIdentity.Users' + // } + // }, + // { + // path: 'RoleManage', + // name: 'roleManage', + // component: () => import('@/views/systemManage/roleManage'), + // meta: { + // title: 'PC权限信息维护', + // icon: '权限控制', + // roles: 'AbpIdentity.Roles' + // } + // }, + // { + // path: 'pcMenu', + // name: 'pcMenu', + // // hidden: true, + // component: () => import('@/views/systemManage/pcMenu'), + // meta: { + // title: 'PC权限菜单', + // icon: 'PDA权限菜单', + // roles: 'Auth.Menu' + // } + // }, + // { + // path: 'UserWorkGroup', + // name: 'UserWorkGroup', + // // hidden: true, + // component: () => import('@/views/systemManage/userWorkGroup'), + // meta: { + // title: '用户工作组对应关系', + // icon: '用户工作组对应关系', + // roles: 'Auth.UserWorkGroup' + // } + // }, + // ] + // } +] + +/** + * asyncRoutes + * the routes that need to be dynamically loaded based on user roles + */ +// 动态获取菜单信息 +export let asyncRoutes = [ + /** when your routing map is too long, you can split it into small modules **/ + // 404 page must be placed at the end !!! + baseConfig, + interfaceBoardRouter, + systemManage, + { + path: '*', + redirect: '/404', + hidden: true + } +] + +const createRouter = () => new Router({ + // mode: 'history', // require service support + scrollBehavior: () => ({ + y: 0 + }), + // todo-new:有token后使用去掉下一行代码 + routes: constantRoutes.concat(asyncRoutes) + // todo-new:有token后使打开下方代码,并检查是否有效 + // routes: constantRoutes +}) + +const router = createRouter() + +// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 +export function resetRouter() { + const newRouter = createRouter() + router.matcher = newRouter.matcher // reset router +} + +export default router diff --git a/Code/Fe/src/router/index.js b/Code/Fe/src/router/index.js index 789cb70..f3a3c8b 100644 --- a/Code/Fe/src/router/index.js +++ b/Code/Fe/src/router/index.js @@ -8,9 +8,6 @@ Vue.use(Router) import Layout from '@/layout' /* Router Modules */ -import baseConfig from './modules/baseConfig' -import interfaceBoardRouter from './modules/interfaceBoard' -import systemManage from './modules/systemManage' /** * Note: sub-menu only appear when route children.length >= 1 @@ -90,67 +87,13 @@ export let constantRoutes = [ name: 'Dashboard', meta: { keepAlive : true, - title: '系统首页', + title: localStorage.getItem('browserLanguage') == 'zh-Hans' ? '系统首页' : 'Dashboard', icon: '系统首页', outerFirst:true // affix: true } }] }, - // 系统 - // { - // path: '/systemManage', - // component: Layout, - // redirect: 'noRedirect', - // meta: { - // title: '系统权限管理11111', - // icon: '系统权限控制', - // roles:'skip' - // }, - // children: [{ - // path: 'UserManage', - // name: 'userManage', - // component: () => import('@/views/systemManage/userManage'), - // meta: { - // title: '用户信息维护', - // icon: '用户', - // roles: 'AbpIdentity.Users' - // } - // }, - // { - // path: 'RoleManage', - // name: 'roleManage', - // component: () => import('@/views/systemManage/roleManage'), - // meta: { - // title: 'PC权限信息维护', - // icon: '权限控制', - // roles: 'AbpIdentity.Roles' - // } - // }, - // { - // path: 'pcMenu', - // name: 'pcMenu', - // // hidden: true, - // component: () => import('@/views/systemManage/pcMenu'), - // meta: { - // title: 'PC权限菜单', - // icon: 'PDA权限菜单', - // roles: 'Auth.Menu' - // } - // }, - // { - // path: 'UserWorkGroup', - // name: 'UserWorkGroup', - // // hidden: true, - // component: () => import('@/views/systemManage/userWorkGroup'), - // meta: { - // title: '用户工作组对应关系', - // icon: '用户工作组对应关系', - // roles: 'Auth.UserWorkGroup' - // } - // }, - // ] - // } ] /** @@ -161,14 +104,11 @@ export let constantRoutes = [ export let asyncRoutes = [ /** when your routing map is too long, you can split it into small modules **/ // 404 page must be placed at the end !!! - baseConfig, - interfaceBoardRouter, - systemManage, - { - path: '*', - redirect: '/404', - hidden: true - } + // { + // path: '*', + // redirect: '/404', + // hidden: true + // } ] const createRouter = () => new Router({ diff --git a/Code/Fe/src/router/modules/baseConfig.js b/Code/Fe/src/router/modules/baseConfig.js deleted file mode 100644 index 0106f56..0000000 --- a/Code/Fe/src/router/modules/baseConfig.js +++ /dev/null @@ -1,25 +0,0 @@ -import Layout from '@/layout' -import { initFromApiColumnsLable } from '@/utils/index' -const interfaceBoardRouter = { - path: '/basicConfig', - alwaysShow:true, - component: Layout, - redirect: 'noRedirect', - meta: { - title: '基础数据管理', - icon: '基础数据管理', - roles:'skip' - }, - children: [{ - path: 'ExportCustomUserSetting', - name: 'ExportCustomUserSetting', - component: () => import('@/views/basicConfig/ExportCustomUserSetting'), - meta: { - title: initFromApiColumnsLable('ExportCustomUserSetting'),//导出配置 - icon: '用户', - roles: 'skip' - } - }, - ] -} -export default interfaceBoardRouter diff --git a/Code/Fe/src/router/modules/interfaceBoard.js b/Code/Fe/src/router/modules/interfaceBoard.js deleted file mode 100644 index 536c1db..0000000 --- a/Code/Fe/src/router/modules/interfaceBoard.js +++ /dev/null @@ -1,25 +0,0 @@ -import Layout from '@/layout' -import { initFromApiColumnsLable } from '@/utils/index' -const interfaceBoardRouter = { - path: '/interfaceBoard', - alwaysShow:true, - component: Layout, - redirect: 'noRedirect', - meta: { - title: '接口看板管理', - icon: '报表查看', - roles:'skip' - }, - children: [{ - path: 'TestSchool', - name: 'TestSchool', - component: () => import('@/views/interfaceBoard/TestSchool'), - meta: { - title: initFromApiColumnsLable('TestSchool'), - icon: '用户', - roles: 'skip' - } - }, - ] -} -export default interfaceBoardRouter diff --git a/Code/Fe/src/router/modules/systemManage.js b/Code/Fe/src/router/modules/systemManage.js deleted file mode 100644 index a91c2fc..0000000 --- a/Code/Fe/src/router/modules/systemManage.js +++ /dev/null @@ -1,44 +0,0 @@ -import Layout from '@/layout' -const systemManageRouter = { - path: '/systemManage', - component: Layout, - redirect: 'noRedirect', - meta: { - title: '系统权限管理', - icon: '系统权限控制', - roles:'skip' - }, - children: [{ - path: 'UserManage', - name: 'userManage', - component: () => import('@/views/systemManage/userManage'), - meta: { - title: '用户信息维护', - icon: '用户', - roles: 'AbpIdentity.Users' - } - }, - { - path: 'RoleManage', - name: 'roleManage', - component: () => import('@/views/systemManage/roleManage'), - meta: { - title: '权限信息维护', - icon: '权限控制', - roles: 'AbpIdentity.Roles' - } - }, - // { - // path: 'pcMenu', - // name: 'pcMenu', - // // hidden: true, - // component: () => import('@/views/systemManage/pcMenu'), - // meta: { - // title: 'PC权限菜单', - // icon: 'PDA权限菜单', - // roles: 'Auth.Menu' - // } - // }, - ] -} -export default systemManageRouter diff --git a/Code/Fe/src/store/getters.js b/Code/Fe/src/store/getters.js index a73b4b3..f629256 100644 --- a/Code/Fe/src/store/getters.js +++ b/Code/Fe/src/store/getters.js @@ -7,11 +7,15 @@ const getters = { cachedViews: state => state.tagsView.cachedViews, token: state => state.user.token, avatar: state => state.user.avatar, - name: state => state.user.name, introduction: state => state.user.introduction, roles: state => state.user.roles, - permission_routes: state => state.permission.routes, + currentUserInfo: state => state.user.userInfo,//当前用户信息 + permission_routes: state => state.permission.routes,//接口获取的菜单 + tablesName:state => state.permission.tablesName,//接口获取所有的表名 errorLogs: state => state.errorLog.logs, - dictionaries: state => state.dictionaries.dict + dictionaries: state => state.dictionaries.dict, + enumList: state => state.definition.enumList,//接口获取的枚举 + columZHList: state => state.definition.columZHList,//接口转义的表头 + dtoColumnTypes: state => state.definition.dtoColumnTypes,//所有页面的dto类型 } export default getters diff --git a/Code/Fe/src/store/modules/definition.js b/Code/Fe/src/store/modules/definition.js new file mode 100644 index 0000000..354230d --- /dev/null +++ b/Code/Fe/src/store/modules/definition.js @@ -0,0 +1,124 @@ +import { getInterfaceBoard,getApiDefinition } from "@/api/wms-interface" + +const state = { + enumList: [],//枚举 + columZHList:null,//表头转义 + dtoColumnTypes:[],//所有页面的dto类型 +} + +const mutations = { + // 设置枚举 + SET_ENUM_LIST: (state, data) => { + state.enumList=data + }, + // 设置表头转义 + SET_COLUMZH_LIST: (state, data) => { + state.columZHList=data + }, + // 所有页面的dto类型 + SET_DTOCOLUMN_TYPES: (state, data) => { + state.dtoColumnTypes=data + }, +} + +// 通过url做方法处理转换(S/C/U/G等)目前只做了S查询。如果有需要在丰富 +export function initDtoTypeByUrl(url){ + if(url.indexOf('get-list-page-by-filter') >= 0){ + return "S" + }else{ + return url + } +} + +// DTO类型转义 +export function initDtoColumnTypes(res) { + // modules>app>controller>这里是所有的接口 + let _controller = res.modules.app.controllers + let _allData = {} + for(let item in _controller){ + let _com = 'AppService' + // 获取简单的api(路由,如:IncomingData) + let _api = item.substring(item.lastIndexOf('.') + 1,item.length - _com.length) + let _item = { + S:{ + dtoList:[], + dtoType: 'S', + dtoName:item.substring(0,item.length - _com.length), + columnsType:null + } + } + for(let ac in _controller[item].actions){ + let _actions = _controller[item].actions[ac] + // actions下通过URL匹配 做特殊处理 + // 查询处理 + if(initDtoTypeByUrl(_actions.url) == 'S'){ + let _type = _actions.returnValue.type + let _type_value = _type.substring(_type.indexOf('<') + 1,_type.indexOf('>')) + _item.S.columnsType=_type_value + // 通过returnValue.type 在 res.types 中获取全部的dto + let _dtos = res.types[_type_value].properties + _dtos.forEach(d=>{ + // 如果是枚举做处理(目前枚举只根据Enums做处理,todo:是否需要其他处理) + if(d.type.indexOf('Enums') >= 0){ + d.apiBaseType = 'enums' + d.isEnums = true + // -1 是去掉最后的'?'(todo:是否每个Enums类型都有?) + let enums_type = d.type.substring(0,d.type.length - 1) + // 通过type包含Enums的全字段-'?'匹配res.types中的值 + let enums_list = res.types[enums_type] + if(enums_list){ + d.enums_list = [] + enums_list.enumValues.forEach((e,key)=>{ + d.enums_list.push({value:e,label:enums_list.enumNames[key]}) + }) + } + }else{ + if(d.typeSimple == 'number' || d.typeSimple == 'number?'){ + d.apiBaseType='number' + }else{ + let _end_index = d.type.lastIndexOf('?') >= 0 ? d.type.lastIndexOf('?') : d.type.length + d.apiBaseType = d.type.substring(d.type.lastIndexOf('.') + 1, _end_index).toLowerCase() + } + if(d.type.indexOf('Guid') >= 0){ + d.apiBaseType='string' + } + } + }) + _item.S.dtoList=_dtos + } + } + _allData[_api] = _item + } + return _allData +} + +const actions = { + // 获取枚举 + getDefinitionConfig({ commit }) { + return new Promise(resolve => { + getApiDefinition().then(res=>{ + commit('SET_DTOCOLUMN_TYPES', initDtoColumnTypes(res)) + commit('SET_ENUM_LIST', res.types) + resolve(res) + }) + }) + }, + // 获取表头转义 + getColumZHList({ commit }) { + return new Promise(resolve => { + getInterfaceBoard().then(res=>{ + let _zh = res.resources[localStorage.getItem('columnsApiNamesZh')].texts; + commit('SET_COLUMZH_LIST', _zh) + resolve(res) + }) + }) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + \ No newline at end of file diff --git a/Code/Fe/src/store/modules/permission-0718.js b/Code/Fe/src/store/modules/permission-0718.js new file mode 100644 index 0000000..808cee0 --- /dev/null +++ b/Code/Fe/src/store/modules/permission-0718.js @@ -0,0 +1,163 @@ +import { + asyncRoutes, + constantRoutes +} from '@/router' +import Layout from '@/layout' +import { getWebMenu } from '@/api/wms-auth' +/** + * 静态路由懒加载 + * @param view 格式必须为 xxx/xxx 开头不要加斜杠 + * @returns + */ + export const loadView = (view) => { + return (resolve) => require([`@/views/${view}`], resolve) +} +/** + * 把从后端查询的菜单数据拼装成路由格式的数据 + * @param routes + * @param data 后端返回的菜单数据 + */ +export function generaMenu(routes, data) { + data.forEach(item => { + const menu = { + path: item.code, + component: item.component === '@/layout' ? Layout : loadView(item.component), + // hidden: item.status === 0, // 状态为0的隐藏 + children: [], + name: item.code, + // meta: item.meta + meta: { + title: item.name, + icon: item.icon || '', + roles: item.permission + }, + + } + // 一级菜单 二级菜单 特定属性 + if (item.component == '@/layout' || item.component == 'index') { + menu.alwaysShow = true + menu.redirect = 'noRedirect' + } + if (item.sort < 99) { + menu.level = 1 + } else if (item.sort > 99 && item.sort < 9999) { + menu.level = 2 + } else { + menu.level = 3 + } + // iframe页面处理 + // if (item.permission.indexOf('Report') > -1) { + // // delete menu.component + // menu.iframeComponent = item.component === '@/layout' ? Layout : loadView(item.component) + // menu.hasOpen = false // 是否打开过,默认false + // } + if (item.children && item.children.length > 0) { + generaMenu(menu.children, item.children) + } + // if (item.permission == 'skip' && item.children.length == 0) { + // } + routes.push(menu) + }) + return routes +} + +/** + * Use meta.role to determine if the current user has permission + * @param roles + * @param route + */ +function hasPermission(roles, route) { + if (route.meta && route.meta.roles) { + if (route.meta.roles == "skip") { + return true + } else { + return roles.some(role => route.meta.roles.includes(role)) + } + } else { + return false + } +} +const filterAccessedRoutes = (items,indexVal,childrenIndex) => { + const route = JSON.parse(JSON.stringify(items)) + route.forEach((val, index) => { + // debugger; + if(val.meta && val.meta.roles == "skip"){ + if (val.children && val.children.length != 0) { + filterAccessedRoutes(items[index-indexVal].children,childrenIndex) + } + if(items[index-indexVal].children && items[index-indexVal].children.length == 0){ + items.splice(index-indexVal, 1) + indexVal++ + } + } + }) + indexVal = 0 +} +/** + * Filter asynchronous routing tables by recursion + * @param routes asyncRoutes + * @param roles + */ +export function filterAsyncRoutes(routes, roles) { + const res = [] + routes.forEach(route => { + const tmp = { + ...route + } + if (hasPermission(roles, tmp)) { + if (tmp.children) { + tmp.children = filterAsyncRoutes(tmp.children, roles) + } + res.push(tmp) + } + }) + return res +} + +const state = { + routes: [], + addRoutes: [] +} + +const mutations = { + SET_ROUTES: (state, routes) => { + state.addRoutes = routes + state.routes = constantRoutes.concat(routes) + } +} +// todo-new:有token后使用generateRoutes,去掉下方一行代码 +state.routes = constantRoutes.concat(asyncRoutes) + +const actions = { + generateRoutes({ + commit + }, userId) { + return new Promise(resolve => { + // let accessedRoutes = asyncRoutes + // // accessedRoutes = filterAsyncRoutes(asyncRoutes, roles) + // let indexVal = 0 + // let childrenIndex = 0 + // filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex) + // commit('SET_ROUTES', accessedRoutes) + // resolve(accessedRoutes) + // todo-new:动态路由(等token接口恢复后处理) + getWebMenu({userId: userId}).then(res => { + let accessedRoutes = generaMenu(asyncRoutes, res) + let indexVal = 0 + let childrenIndex = 0 + filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex) + commit('SET_ROUTES', accessedRoutes) + resolve(accessedRoutes) + }).catch(err => { + console.log(err) + }) + }) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/Code/Fe/src/store/modules/permission.js b/Code/Fe/src/store/modules/permission.js index 808cee0..2d572fc 100644 --- a/Code/Fe/src/store/modules/permission.js +++ b/Code/Fe/src/store/modules/permission.js @@ -4,62 +4,8 @@ import { } from '@/router' import Layout from '@/layout' import { getWebMenu } from '@/api/wms-auth' -/** - * 静态路由懒加载 - * @param view 格式必须为 xxx/xxx 开头不要加斜杠 - * @returns - */ - export const loadView = (view) => { - return (resolve) => require([`@/views/${view}`], resolve) -} -/** - * 把从后端查询的菜单数据拼装成路由格式的数据 - * @param routes - * @param data 后端返回的菜单数据 - */ -export function generaMenu(routes, data) { - data.forEach(item => { - const menu = { - path: item.code, - component: item.component === '@/layout' ? Layout : loadView(item.component), - // hidden: item.status === 0, // 状态为0的隐藏 - children: [], - name: item.code, - // meta: item.meta - meta: { - title: item.name, - icon: item.icon || '', - roles: item.permission - }, - - } - // 一级菜单 二级菜单 特定属性 - if (item.component == '@/layout' || item.component == 'index') { - menu.alwaysShow = true - menu.redirect = 'noRedirect' - } - if (item.sort < 99) { - menu.level = 1 - } else if (item.sort > 99 && item.sort < 9999) { - menu.level = 2 - } else { - menu.level = 3 - } - // iframe页面处理 - // if (item.permission.indexOf('Report') > -1) { - // // delete menu.component - // menu.iframeComponent = item.component === '@/layout' ? Layout : loadView(item.component) - // menu.hasOpen = false // 是否打开过,默认false - // } - if (item.children && item.children.length > 0) { - generaMenu(menu.children, item.children) - } - // if (item.permission == 'skip' && item.children.length == 0) { - // } - routes.push(menu) - }) - return routes -} +import { getDefinitionMenu } from '@/api/wms-interface' +import store from '@/store' /** * Use meta.role to determine if the current user has permission @@ -116,43 +62,229 @@ export function filterAsyncRoutes(routes, roles) { const state = { routes: [], - addRoutes: [] + addRoutes: [], + tablesName:null,//所有的表名 } const mutations = { SET_ROUTES: (state, routes) => { state.addRoutes = routes state.routes = constantRoutes.concat(routes) + }, + SET_TABLESNAME: (state, data) => { + state.tablesName = data } } // todo-new:有token后使用generateRoutes,去掉下方一行代码 -state.routes = constantRoutes.concat(asyncRoutes) +// state.routes = constantRoutes.concat(asyncRoutes) +/** + * 静态路由懒加载 + * @param view 格式必须为 xxx/xxx 开头不要加斜杠 + * @returns + */ + export const loadView = (view) => { + return (resolve) => require([`@/views/menuList/${view}`], resolve) +} +/** + * 把从后端查询的菜单数据拼装成路由格式的数据 + * @param routes + * @param data 后端返回的菜单数据 + */ +export function generaMenu(routes, data, first) { + data.forEach(item => { + let _item = { + path: '/'+item.name, + component: loadView(item.name), + // hidden: item.status === 0, // 状态为0的隐藏 + name: item.name, + // meta: item.meta + meta: { + title: item.title, + icon: item.icon || '基础数据管理', + roles: item.permission, + outerFirst:first + }, + } + let menu = _item + if(first && item.component == '@/layout'){ + menu = { + path: '/', + component: Layout, + redirect: '/' + item.name, + children: [], + } + menu.children = [] + menu.children.push(_item) + } + // 一级菜单 二级菜单 特定属性 + // if (item.component == '@/layout' || item.component == 'index') { + // menu.alwaysShow = true + // menu.redirect = 'noRedirect' + // } + // if (item.sort < 99) { + // menu.level = 1 + // } else if (item.sort > 99 && item.sort < 9999) { + // menu.level = 2 + // } else { + // menu.level = 3 + // } + // iframe页面处理 + // if (item.permission.indexOf('Report') > -1) { + // // delete menu.component + // menu.iframeComponent = item.component === '@/layout' ? Layout : loadView(item.component) + // menu.hasOpen = false // 是否打开过,默认false + // } + if (item.children && item.children.length > 0) { + generaMenu(menu.children, item.children) + } + // if (item.permission == 'skip' && item.children.length == 0) { + // } + routes.push(menu) + }) + return routes +} +// todo:接口返回的层级菜单,与查重后最终显示的菜单数组做查重及组合处理 +export function initTreeMenusHandle(tree, list,first) { + let _res = [] + tree.forEach(item=>{ + if(list.indexOf(item.name) >= 0){ + item.title = store.getters.columZHList[item.name] || item.name + if(first)item.component = '@/layout' + if (item.children && item.children.length > 0) { + item.children = initTreeMenusHandle(item.children,list) + } + _res.push(item) + } + }) + return _res +} const actions = { - generateRoutes({ + getApiColumnsNames({ commit }, userId) { return new Promise(resolve => { - // let accessedRoutes = asyncRoutes - // // accessedRoutes = filterAsyncRoutes(asyncRoutes, roles) + let accessedRoutes = asyncRoutes + // accessedRoutes = filterAsyncRoutes(asyncRoutes, roles) // let indexVal = 0 // let childrenIndex = 0 // filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex) // commit('SET_ROUTES', accessedRoutes) // resolve(accessedRoutes) - // todo-new:动态路由(等token接口恢复后处理) - getWebMenu({userId: userId}).then(res => { - let accessedRoutes = generaMenu(asyncRoutes, res) - let indexVal = 0 - let childrenIndex = 0 - filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex) + getDefinitionMenu(true).then(res => { + let _allConfig = res.auth.grantedPolicies;//所有配置 + let _menuList = []//接口获取所有的菜单 + for(let item in _allConfig){ + let point_number = item.split('.').length - 1 + // 只选择配置项中的数据 + if(point_number == 1 && item.substring(0,item.indexOf('.')) == localStorage.getItem('columnsApiNamesZh')){ + _menuList.push(item.substring(item.indexOf('.') + 1,item.length)) + } + } + // 存储所有的表名 + commit('SET_TABLESNAME', _menuList) + // todo-new:接口获取 接口没有走配置文件 + let _noShowMenus = null//不显示的菜单 + _noShowMenus = localStorage.getItem('menuHiddenConfig').split(',') + // 去掉不显示的菜单后全部显示的菜单 + let _showMenus = _noShowMenus && _noShowMenus.length > 0 ? _menuList.filter(item1 => !_noShowMenus.some(item2 => item2 === item1)) : _menuList + // 数据模拟,todo-new:接口获取 + let _treeMenusAll = null//树形菜单 + // _treeMenusAll = [ + // {name:"aaaaaaa"}, + // {name:"ExportCustomUserSetting" + // // ,children:[ + // // {name:'OutgoingDataHistory',children:[ + // // {name:'IncomingData',children:[ + // // {name:'OutgoingDataHistory'}, + // // {name:'IncomingData'}, + // // {name:'333333'}, + // // ]}, + // // {name:'eee1111-bbb',children:[ + // // {name:'ExportCustomUserSetting'}, + // // {name:'MessageReceive'}, + // // ]}, + // // ]}, + // // {name:'eee222'}, + // // {name:'eee333'}, + // // {name:'eee444'}, + // // {name:'eee555'}, + // // ] + // }, + // {name:"OutgoingDataHistory"}, + // {name:"IncomingData"}, + // {name:"IncomingDataHistory"}, + // {name:"MesProductL7PartsNote"}, + // {name:"MessageReceive"}, + // {name:"OutgoingData"}, + // {name:"AsnDet"}, + // {name:"AsnMstr"}, + // {name:"Bom"}, + // {name:"CustPart"}, + // {name:"Cust"}, + // {name:"Inventory"}, + // {name:"Loc"}, + // {name:"Part"}, + // {name:"PoDet"}, + // {name:"PoMstr"}, + // {name:"PrhHist"}, + // {name:"ProdLine"}, + // {name:"ReceiptDet"}, + // {name:"ReceiptMstr"}, + // {name:"ReturnDet"}, + // {name:"ReturnMstr"}, + // {name:"SodDet"}, + // {name:"VendPart"}, + // {name:"Vend"}, + // ] + + let _initTreeMenus = [] + if(_treeMenusAll && _treeMenusAll.length > 0){ + _initTreeMenus = initTreeMenusHandle(_treeMenusAll,_showMenus,true) + }else{ + let _data = [] + for(let i in _showMenus){ + _data.push({name:_showMenus[i]}) + } + _initTreeMenus = initTreeMenusHandle(_data,_showMenus,true) + } + // 最后查重+层级查重后的菜单 + let _initEndMenus = generaMenu(asyncRoutes, _initTreeMenus,true) + let accessedRoutes = _initEndMenus + // let indexVal = 0 + // let childrenIndex = 0 + // filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex) commit('SET_ROUTES', accessedRoutes) resolve(accessedRoutes) }).catch(err => { console.log(err) }) }) - } + }, + // generateRoutes({ + // commit + // }, userId) { + // return new Promise(resolve => { + // // let accessedRoutes = asyncRoutes + // // // accessedRoutes = filterAsyncRoutes(asyncRoutes, roles) + // // let indexVal = 0 + // // let childrenIndex = 0 + // // filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex) + // // commit('SET_ROUTES', accessedRoutes) + // // resolve(accessedRoutes) + // // todo-new:动态路由(等token接口恢复后处理) + // getWebMenu({userId: userId}).then(res => { + // let accessedRoutes = generaMenu(asyncRoutes, res) + // let indexVal = 0 + // let childrenIndex = 0 + // filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex) + // commit('SET_ROUTES', accessedRoutes) + // resolve(accessedRoutes) + // }).catch(err => { + // console.log(err) + // }) + // }) + // } } export default { @@ -160,4 +292,4 @@ export default { state, mutations, actions -} +} \ No newline at end of file diff --git a/Code/Fe/src/store/modules/user.js b/Code/Fe/src/store/modules/user.js index c4ffea5..3d3df06 100644 --- a/Code/Fe/src/store/modules/user.js +++ b/Code/Fe/src/store/modules/user.js @@ -1,7 +1,8 @@ import { token, logout, - getInfo + getInfo, + getUsersByUserName } from '@/api/wms-auth' import { getToken, @@ -20,8 +21,10 @@ const state = { name: '', avatar: '', introduction: '', - roles: [] + roles: [], + userInfo:null } +import { Message } from 'element-ui' const mutations = { SET_TOKEN: (state, token) => { @@ -38,6 +41,9 @@ const mutations = { }, SET_ROLES: (state, roles) => { state.roles = roles + }, + SET_USERINFO: (state, data) => { + state.userInfo = data } } @@ -141,13 +147,14 @@ const actions = { dispatch }) { return new Promise((resolve, reject) => { - logout().then(() => { + // logout().then(() => { commit('SET_TOKEN', '') commit('SET_ROLES', []) - removeToken() - resetRouter() - removeCompany() - removeWarehouseCode() + // commit('SET_USERINFO', null) + // removeToken() + // resetRouter() + // removeCompany() + // removeWarehouseCode() // reset visited views and cached views // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485 dispatch('tagsView/delAllViews', null, { @@ -155,10 +162,10 @@ const actions = { }) resolve() // 防止路由叠加 - location.reload() - }).catch(error => { - reject(error) - }) + // location.reload() + // }).catch(error => { + // reject(error) + // }) }) }, @@ -202,7 +209,26 @@ const actions = { dispatch('tagsView/delAllViews', null, { root: true }) - } + }, + getUserInfo({ + commit + },username) { + return new Promise((resolve, reject) => { + getUsersByUserName(username).then(res=>{ + if(res && JSON.stringify(res).length > 0){ + localStorage.setItem('isLoginName',username) + commit('SET_USERINFO', res) + resolve(res) + }else{ + reject('获取用户信息失败,请重试') + } + }) + .catch(err => { + reject(error) + console.log('获取用户信息失败,请重试') + }) + }) + }, } export default { diff --git a/Code/Fe/src/utils/baseData/urlOption.js b/Code/Fe/src/utils/baseData/urlOption.js index fee01c4..3dfd657 100644 --- a/Code/Fe/src/utils/baseData/urlOption.js +++ b/Code/Fe/src/utils/baseData/urlOption.js @@ -2,6 +2,7 @@ export const TestSchool = { baseURL:'TestSchool/base',//主表-列表 detailURL:'app/test-school',//主表-明细 + 明细-查看主表 + // detailInfoName:'asnNbr',//主表-明细查看详情的title名称 detailListURL:'TestStudentDetail/base',//明细-列表, masterId:'masterId',//明细获取主表信息的masterId(默认) masterName:'studentName'//明细获取主表信息的title名称 diff --git a/Code/Fe/src/utils/defaultButtons.js b/Code/Fe/src/utils/defaultButtons.js index 2036d06..cbac76d 100644 --- a/Code/Fe/src/utils/defaultButtons.js +++ b/Code/Fe/src/utils/defaultButtons.js @@ -43,7 +43,7 @@ export function defaultExportBtn(option) { export function defaultFieldSettingBtn(option,source) { let _source = source ? source : 'list_api' // todo:监听已经配置过的字段按钮更改状态特殊显示 - let _local = localStorage.getItem('file_Columns_' + _source + '_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name) + let _local = localStorage.getItem('file_Columns_' + _source + '_' + this.$store.getters.currentUserInfo.userName + '_' + this.$route.name) let _type = '' let _num = 0 if(_local){ @@ -59,7 +59,7 @@ export function defaultFieldSettingBtn(option,source) { } } return __defaultBtnOption(option,{ - type: _type, + // type: _type,//暂不处理颜色 plain: true, icon: "el-icon-setting", label: "字段设置", diff --git a/Code/Fe/src/utils/detailsPageColumns_api/index.js b/Code/Fe/src/utils/detailsPageColumns_api/index.js new file mode 100644 index 0000000..c3b413b --- /dev/null +++ b/Code/Fe/src/utils/detailsPageColumns_api/index.js @@ -0,0 +1,9 @@ +// 此文件为【明细 - 列表】表头从接口缓存的表头 + +import { zhApiColumnsLable } from '@/utils/index' + +// 测试数据 +// export const TestSchool = [ +// { label: zhApiColumnsLable('TestStudentDetailStudentName'), prop: "studentName" }, +// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, +// ] \ No newline at end of file diff --git a/Code/Fe/src/utils/detailsTableColumns_api/index.js b/Code/Fe/src/utils/detailsTableColumns_api/index.js index dcbd804..29f6a92 100644 --- a/Code/Fe/src/utils/detailsTableColumns_api/index.js +++ b/Code/Fe/src/utils/detailsTableColumns_api/index.js @@ -1,9 +1,10 @@ // 此文件为【明细 - 列表】表头从接口缓存的表头 +// 如果有父级id字段,请设置showProp,避免明细列表内可查询其他主表的明细 -import { initFromApiColumnsLable } from '@/utils/index' +import { zhApiColumnsLable } from '@/utils/index' // 测试数据 -export const TestSchool = [ - { label: initFromApiColumnsLable('TestStudentDetailStudentName'), prop: "studentName" }, - { label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, -] \ No newline at end of file +// export const TestSchool = [ +// { label: zhApiColumnsLable('TestStudentDetailStudentName'), prop: "studentName" }, +// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, +// ] \ No newline at end of file diff --git a/Code/Fe/src/utils/index.js b/Code/Fe/src/utils/index.js index 257a8a8..c94bf7d 100644 --- a/Code/Fe/src/utils/index.js +++ b/Code/Fe/src/utils/index.js @@ -2,6 +2,7 @@ * Created by PanJiaChen on 16/11/18. */ import {fileStorage, getPageList, getDictByCode} from '@/api/wms-api' +import store from '@/store' /** * Parse the time to string * @param {(Object|string|number)} time @@ -557,23 +558,21 @@ export function createNewTabs (url) { window.open(url, "_blank") } -// 转义及读取api接口返回的表头信息 -export function initFromApiColumnsLable (data) { - //todo:待定:重新获取全局从接口缓存的表头(如:接口监控看板) - // import { getInterfaceBoard } from "@/api/wms-interface" - - // getList = () => { - // getInterfaceBoard().then(result => { - - // localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.data.localization.values.Dashboard)); - // }) - // .catch(err => { - // }) - // } - let _Dashboard = null - let _names = localStorage.getItem("interfaceBoardColumnsNames") - if(_names && _names != 'undefined' && _names != 'null') { - _Dashboard = JSON.parse(localStorage.getItem("interfaceBoardColumnsNames")) - } - return _Dashboard ? _Dashboard[data] : null +// faster-new +// 转义及读取api接口返回的表头信息 +export function zhApiColumnsLable (data) { + let _list = store.getters.columZHList + return _list ? _list[data] : data } + +// 首字母转换 type='Lower'(小写,默认) Upper(大写) +export function firstWordSizeChange (str,type='Lower') { + switch(type){ + case 'Lower': + return str.substring(0,1).toLowerCase() + str.substring(1,str.length); + + case 'Upper': + return str.substring(0,1).toUpperCase() + str.substring(1,str.length); + + } +} \ No newline at end of file diff --git a/Code/Fe/src/utils/tableColumns_api/index.js b/Code/Fe/src/utils/tableColumns_api/index.js index b4b0a73..b155133 100644 --- a/Code/Fe/src/utils/tableColumns_api/index.js +++ b/Code/Fe/src/utils/tableColumns_api/index.js @@ -1,9 +1,9 @@ // 此文件为【主表-列表】表头从接口缓存的表头 -import { initFromApiColumnsLable } from '@/utils/index' +import { zhApiColumnsLable } from '@/utils/index' // 测试数据 -export const TestSchool = [ - { label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left" }, - { label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, -] \ No newline at end of file +// export const TestSchool = [ +// { label: zhApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left" }, +// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, +// ] \ No newline at end of file diff --git a/Code/Fe/src/utils/tabsDesTions_api/index.js b/Code/Fe/src/utils/tabsDesTions_api/index.js index a9b3ea5..fdc5118 100644 --- a/Code/Fe/src/utils/tabsDesTions_api/index.js +++ b/Code/Fe/src/utils/tabsDesTions_api/index.js @@ -1,9 +1,9 @@ // 此文件为【主表-明细】表头从接口缓存的表头 -import { initFromApiColumnsLable } from '@/utils/index' +import { zhApiColumnsLable } from '@/utils/index' // 测试数据 -export const TestSchool = [ - { label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left", type: "name" }, - { label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, -] \ No newline at end of file +// export const TestSchool = [ +// { label: zhApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left", type: "name" }, +// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, +// ] \ No newline at end of file diff --git a/Code/Fe/src/utils/utils.js b/Code/Fe/src/utils/utils.js index 5493136..43be3e5 100644 --- a/Code/Fe/src/utils/utils.js +++ b/Code/Fe/src/utils/utils.js @@ -60,8 +60,6 @@ import pagination from "@/components/Pagination" //分页器 import conditionFilters from "@/components/conditionFilters" //高级筛选 import searchPage from '@/components/searchPage' //autocomplete拉取数据探弹窗 import newAndEdiDialog from '@/components/newAndEdiDialog' //普通新增与编辑 -import stepsForm from '@/components/StepsForm' //步骤新增 -import handelFrom from '@/components/handelFrom' //执行表单 import umyTable from '@/components/umyTable' // 用于数据量过大table import filterForDetailPage from '@/components/filterForDetailPage' //明细查询 import newAndEdiDialogForDetail from '@/components/newAndEdiDialogForDetail' //普通新增与编辑(带明细) @@ -115,8 +113,6 @@ Vue.component('conditionFilters', conditionFilters) Vue.component('searchPage', searchPage) Vue.component('newAndEdiDialog', newAndEdiDialog) Vue.component('newAndEdiDialogForDetail', newAndEdiDialogForDetail) -Vue.component('stepsForm', stepsForm) -Vue.component('handelFrom', handelFrom) Vue.component('umyTable', umyTable) Vue.component('filterForDetailPage', filterForDetailPage) Vue.prototype.$echarts = eCharts diff --git a/Code/Fe/src/views/basicConfig/ExportCustomUserSetting.vue b/Code/Fe/src/views/basicConfig/ExportCustomUserSetting.vue index 989a7d8..dc4148c 100644 --- a/Code/Fe/src/views/basicConfig/ExportCustomUserSetting.vue +++ b/Code/Fe/src/views/basicConfig/ExportCustomUserSetting.vue @@ -17,7 +17,7 @@ @alertoldSkipCount="alertoldSkipCount" @alterResultCount="alterResultCount" @handleSelectionChange="handleSelectionChange" - @buttonOperationClick="buttonOperationClick" + @buttonOperationClick_left="buttonOperationClick_left" :currentPageProps="oldSkipCount" :quicklySearchOption="quicklySearchOption" @quicklySearchClick="quicklySearchClick" @@ -108,7 +108,7 @@ import { filterSelectMixins } from '@/mixins/filter-Select' import * as tableColumns_api from "@/utils/tableColumns_api/index" //全局从接口缓存的表头 import * as tabsDesTions_api from "@/utils/tabsDesTions_api/index" //全局从接口缓存的详情 import * as detailsTableColumns_api from "@/utils/detailsTableColumns_api/index" //全局从接口缓存的详情 -import { initFromApiColumnsLable } from '@/utils/index' +import { zhApiColumnsLable } from '@/utils/index' // import { getExportConfigList } from '@/api/wms-interface' export default { @@ -157,14 +157,14 @@ export default { }, editOptions: {}, CreateForm: [ - { type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 }, - { type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 }, - { type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 }, + { type: "input", label: zhApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 }, + { type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 }, + { type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 }, ], editForm: [ - { type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 }, - { type: "input", label:initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 }, - { type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 }, + { type: "input", label: zhApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 }, + { type: "input", label:zhApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 }, + { type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 }, ], editRules: { cerateRule: { diff --git a/Code/Fe/src/views/dashboard/index copy.vue b/Code/Fe/src/views/dashboard/index copy.vue new file mode 100644 index 0000000..dab6cc1 --- /dev/null +++ b/Code/Fe/src/views/dashboard/index copy.vue @@ -0,0 +1,221 @@ + + + + \ No newline at end of file diff --git a/Code/Fe/src/views/dashboard/index.vue b/Code/Fe/src/views/dashboard/index.vue index 2f72066..a099f66 100644 --- a/Code/Fe/src/views/dashboard/index.vue +++ b/Code/Fe/src/views/dashboard/index.vue @@ -1,221 +1,60 @@ +
+ +
+ - - \ No newline at end of file +} + + \ No newline at end of file diff --git a/Code/Fe/src/views/demo/demo_base_handle.vue b/Code/Fe/src/views/demo/demo_base_handle.vue new file mode 100644 index 0000000..8c860cf --- /dev/null +++ b/Code/Fe/src/views/demo/demo_base_handle.vue @@ -0,0 +1,196 @@ + + + + \ No newline at end of file diff --git a/Code/Fe/src/views/interfaceBoard/TestSchool_read.vue b/Code/Fe/src/views/demo/demo_mst_det.vue similarity index 69% rename from Code/Fe/src/views/interfaceBoard/TestSchool_read.vue rename to Code/Fe/src/views/demo/demo_mst_det.vue index 2dd946f..e6e4a53 100644 --- a/Code/Fe/src/views/interfaceBoard/TestSchool_read.vue +++ b/Code/Fe/src/views/demo/demo_mst_det.vue @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/Code/Fe/src/views/interfaceBoard/TestSchool_all.vue b/Code/Fe/src/views/interfaceBoard/TestSchool_all.vue deleted file mode 100644 index fd50f68..0000000 --- a/Code/Fe/src/views/interfaceBoard/TestSchool_all.vue +++ /dev/null @@ -1,466 +0,0 @@ - - - \ No newline at end of file diff --git a/Code/Fe/src/views/login/index.vue b/Code/Fe/src/views/login/index.vue index 2db65e4..624a6eb 100644 --- a/Code/Fe/src/views/login/index.vue +++ b/Code/Fe/src/views/login/index.vue @@ -70,7 +70,6 @@