打包配置优化

This commit is contained in:
BianLzhaoMin 2024-09-12 11:50:05 +08:00
parent ad70d31465
commit ad676e57dc
5 changed files with 134 additions and 92 deletions

View File

@ -35,7 +35,7 @@ var proxyUrl = (module.exports = {
// Paths // Paths
assetsRoot: path.resolve(__dirname, '../dist'), assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static01', assetsSubDirectory: 'static01',
assetsPublicPath: '/', assetsPublicPath: '/bigScrap/',
productionSourceMap: false, productionSourceMap: false,
devtool: '#source-map', devtool: '#source-map',
productionGzip: false, productionGzip: false,

View File

@ -1,50 +1,61 @@
import { POST, GET } from './index.js' import { POST, GET } from './index.js'
const URL_TYPE_LIST = '/screen/material/returnOfMaterialsInfo/getTypeList' const URL_TYPE_LIST = '/bigScrap/material/returnOfMaterialsInfo/getTypeList'
const URL_DETAILS = '/screen/base/largeScreen/home/getMaterialReqData/details' const URL_DETAILS = '/bigScrap/base/largeScreen/home/getMaterialReqData/details'
const URL_RETURN_DETAILS = '/screen/base/largeScreen/home/getMaterialReturnData/details' const URL_RETURN_DETAILS =
const URL_UNIT_LIST = '/screen/material/agreementInfo/getUnitList' '/bigScrap/base/largeScreen/home/getMaterialReturnData/details'
const URL_PROJECT_LIST = '/screen/material/agreementInfo/getProjectList' const URL_UNIT_LIST = '/bigScrap/material/agreementInfo/getUnitList'
const URL_SCRAP_ANALYSIS = '/screen/base/largeScreen/home/getScrapAnalysisByMonth/details' const URL_PROJECT_LIST = '/bigScrap/material/agreementInfo/getProjectList'
const URL_TOTAL_OWNERSHIP = '/screen/base/largeScreen/home/getTotalOwnership/details' const URL_SCRAP_ANALYSIS =
const URL_ACCEPTANCE_STORAGE = '/screen/base/largeScreen/home/getAcceptanceStorage/details' '/bigScrap/base/largeScreen/home/getScrapAnalysisByMonth/details'
const URL_PICKING_ANALYSIS = '/screen/base/largeScreen/home/getPickingAnalysisByMonth/details' const URL_TOTAL_OWNERSHIP =
const URL_MATERIAL_RETURN_BY_MONTH = '/screen/base/largeScreen/home/getMaterialReturnByMonth/details' '/bigScrap/base/largeScreen/home/getTotalOwnership/details'
const URL_MAINTENANCE_BY_CHART = '/screen/base/largeScreen/home/getMaintenanceByMonth/chart' const URL_ACCEPTANCE_STORAGE =
const URL_MAINTENANCE_BY_MONTH_DETAILS = '/screen/base/largeScreen/home/getMaintenanceByMonth/details' '/bigScrap/base/largeScreen/home/getAcceptanceStorage/details'
const URL_PICKING_ANALYSIS =
'/bigScrap/base/largeScreen/home/getPickingAnalysisByMonth/details'
const URL_MATERIAL_RETURN_BY_MONTH =
'/bigScrap/base/largeScreen/home/getMaterialReturnByMonth/details'
const URL_MAINTENANCE_BY_CHART =
'/bigScrap/base/largeScreen/home/getMaintenanceByMonth/chart'
const URL_MAINTENANCE_BY_MONTH_DETAILS =
'/bigScrap/base/largeScreen/home/getMaintenanceByMonth/details'
// 设备类型 // 设备类型
export const getTypeList = params => GET(URL_TYPE_LIST, params) export const getTypeList = (params) => GET(URL_TYPE_LIST, params)
// 领料数据 // 领料数据
export const getDetails = data => POST(URL_DETAILS, data) export const getDetails = (data) => POST(URL_DETAILS, data)
// 退料数据 // 退料数据
export const getReturnDetails = data => POST(URL_RETURN_DETAILS, data) export const getReturnDetails = (data) => POST(URL_RETURN_DETAILS, data)
// 往来单位-下拉 // 往来单位-下拉
export const getUnitList = params => GET(URL_UNIT_LIST, params) export const getUnitList = (params) => GET(URL_UNIT_LIST, params)
// 工程名称-下拉 // 工程名称-下拉
export const getProjectList = params => GET(URL_PROJECT_LIST, params) export const getProjectList = (params) => GET(URL_PROJECT_LIST, params)
// 废料分析 // 废料分析
export const getScrapAnalysis = data => POST(URL_SCRAP_ANALYSIS, data) export const getScrapAnalysis = (data) => POST(URL_SCRAP_ANALYSIS, data)
// 总保有量 // 总保有量
export const getTotalOwnership = data => POST(URL_TOTAL_OWNERSHIP, data) export const getTotalOwnership = (data) => POST(URL_TOTAL_OWNERSHIP, data)
// 入库分析 // 入库分析
export const getAcceptanceStorage = data => POST(URL_ACCEPTANCE_STORAGE, data) export const getAcceptanceStorage = (data) => POST(URL_ACCEPTANCE_STORAGE, data)
// 领料分析 // 领料分析
export const getPickingAnalysis = data => POST(URL_PICKING_ANALYSIS, data) export const getPickingAnalysis = (data) => POST(URL_PICKING_ANALYSIS, data)
// 退料分析 // 退料分析
export const getMaterialReturnByMonth = data => POST(URL_MATERIAL_RETURN_BY_MONTH, data) export const getMaterialReturnByMonth = (data) =>
POST(URL_MATERIAL_RETURN_BY_MONTH, data)
// 维修分析-pie+bar // 维修分析-pie+bar
export const getMaintenanceByMonthChart = data => POST(URL_MAINTENANCE_BY_CHART, data) export const getMaintenanceByMonthChart = (data) =>
POST(URL_MAINTENANCE_BY_CHART, data)
// 维修分析 // 维修分析
export const getMaintenanceByMonthDetails = data => POST(URL_MAINTENANCE_BY_MONTH_DETAILS, data) export const getMaintenanceByMonthDetails = (data) =>
POST(URL_MAINTENANCE_BY_MONTH_DETAILS, data)

View File

@ -1,45 +1,75 @@
import { POST, GET } from './index' import { POST, GET } from './index'
// 领料数据 // 领料数据
export const getMaterialReqDataApi = params => POST(`/screen/base/largeScreen/home/getMaterialReqData`,) export const getMaterialReqDataApi = (params) =>
POST(`/bigScrap/base/largeScreen/home/getMaterialReqData`)
// 退料数据 // 退料数据
export const getMaterialReturnDataApi = params => POST(`/screen/base/largeScreen/home/getMaterialReturnData`) export const getMaterialReturnDataApi = (params) =>
POST(`/bigScrap/base/largeScreen/home/getMaterialReturnData`)
//当月报废分析 //当月报废分析
export const getScrapAnalysisByMonthApi = params => POST(`/screen/base/largeScreen/home/getScrapAnalysisByMonth?maType=${params.maType}`) export const getScrapAnalysisByMonthApi = (params) =>
POST(
`/bigScrap/base/largeScreen/home/getScrapAnalysisByMonth?maType=${params.maType}`
)
//新购验收入库分析 //新购验收入库分析
export const getAcceptanceStorageApi = params => POST(`/screen/base/largeScreen/home/getAcceptanceStorage?maType=${params.maType}`,) export const getAcceptanceStorageApi = (params) =>
POST(
`/bigScrap/base/largeScreen/home/getAcceptanceStorage?maType=${params.maType}`
)
//当月领料分析 //当月领料分析
export const getPickingAnalysisByMonthApi = params => POST(`/screen/base/largeScreen/home/getPickingAnalysisByMonth?maType=${params.maType}`,) export const getPickingAnalysisByMonthApi = (params) =>
POST(
`/bigScrap/base/largeScreen/home/getPickingAnalysisByMonth?maType=${params.maType}`
)
//当月退料分析 //当月退料分析
export const getMaterialReturnByMonthApi = params => POST(`/screen/base/largeScreen/home/getMaterialReturnByMonth?maType=${params.maType}`,) export const getMaterialReturnByMonthApi = (params) =>
POST(
`/bigScrap/base/largeScreen/home/getMaterialReturnByMonth?maType=${params.maType}`
)
//当月维修分析 //当月维修分析
export const getMaintenanceByMonthApi = params => POST(`/screen/base/largeScreen/home/getMaintenanceByMonth?maType=${params.maType}`,) export const getMaintenanceByMonthApi = (params) =>
POST(
`/bigScrap/base/largeScreen/home/getMaintenanceByMonth?maType=${params.maType}`
)
//设备分布图 //设备分布图
export const getEquipmentDisByMapApi = params => GET(`/screen/base/largeScreen/home/getEquipmentDisByMap`,) export const getEquipmentDisByMapApi = (params) =>
GET(`/bigScrap/base/largeScreen/home/getEquipmentDisByMap`)
//获取工程的位置信息 //获取工程的位置信息
export const getProjectByMapApi = params => GET(`/screen/base/largeScreen/home/getEquipmentDis`, params) export const getProjectByMapApi = (params) =>
GET(`/bigScrap/base/largeScreen/home/getEquipmentDis`, params)
//获取设备的位置信息 //获取设备的位置信息
export const getDeviceByMapApi = params => GET(`/screen/base/largeScreen/home/getIotMaCodeMachine`, params) export const getDeviceByMapApi = (params) =>
GET(`/bigScrap/base/largeScreen/home/getIotMaCodeMachine`, params)
//施工机具/ //施工机具/
export const getTotalOwnershipApi = params => POST(`/screen/base/largeScreen/home/getTotalOwnership`,) export const getTotalOwnershipApi = (params) =>
POST(`/bigScrap/base/largeScreen/home/getTotalOwnership`)
// 当月使用车辆 // 当月使用车辆
export const getCarUseByMonthApi = params => POST(`/screen/base/largeScreen/home/getCarUseByMonth?maType=${params.maType}`,) export const getCarUseByMonthApi = (params) =>
POST(
`/bigScrap/base/largeScreen/home/getCarUseByMonth?maType=${params.maType}`
)
// 当月使用车辆 // 当月使用车辆
export const getMaintenanceWarningApi = params => POST(`/screen/base/largeScreen/home/getMaintenanceWarning`,) export const getMaintenanceWarningApi = (params) =>
POST(`/bigScrap/base/largeScreen/home/getMaintenanceWarning`)
//各公司机具保有量 //各公司机具保有量
export const getTotalOwnershipByCompany = params => POST(`/screen/base/largeScreen/home/getTotalOwnershipByCompany`) export const getTotalOwnershipByCompany = (params) =>
POST(`/bigScrap/base/largeScreen/home/getTotalOwnershipByCompany`)
/** 获取机具设备的行程信息 */ /** 获取机具设备的行程信息 */
export const getIotDeviceTripApi = params => POST(`/screen/material/iotMachine/searchItinerary`, params) export const getIotDeviceTripApi = (params) =>
POST(`/bigScrap/material/iotMachine/searchItinerary`, params)
/** 获取机具设备的停留点信息 */ /** 获取机具设备的停留点信息 */
export const getIotDeviceParkDetailApi = params => POST(`/screen/material/iotMachine/reportParkDetailByTime`, params) export const getIotDeviceParkDetailApi = (params) =>
POST(`/bigScrap/material/iotMachine/reportParkDetailByTime`, params)
/** 获取工程领料的记录 */ /** 获取工程领料的记录 */
export const getProjectOutApi = params => GET(`/screen/base/largeScreen/home/getLeaseRecordListByLotId`, params) export const getProjectOutApi = (params) =>
GET(`/bigScrap/base/largeScreen/home/getLeaseRecordListByLotId`, params)
/** 获取工程退料的记录 */ /** 获取工程退料的记录 */
export const getProjectReturnApi = params => GET(`/screen/base/largeScreen/home/getBackRecordListByLotId`, params) export const getProjectReturnApi = (params) =>
GET(`/bigScrap/base/largeScreen/home/getBackRecordListByLotId`, params)
/** 获取工程退料的记录 */ /** 获取工程退料的记录 */
export const getProjectDeviceNumApi = params => GET(`/screen/base/largeScreen/home/getUseNumByLotId`, params) export const getProjectDeviceNumApi = (params) =>
GET(`/bigScrap/base/largeScreen/home/getUseNumByLotId`, params)
/** 获取单位数据 */ /** 获取单位数据 */
export const getUnitListApi = params => POST(`/screen/system/select/getUnitCbx`, params) export const getUnitListApi = (params) =>
POST(`/bigScrap/system/select/getUnitCbx`, params)

View File

@ -5,12 +5,12 @@ Vue.use(Router)
const originalPush = Router.prototype.push const originalPush = Router.prototype.push
Router.prototype.push = function push(location) { Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err) return originalPush.call(this, location).catch((err) => err)
} }
const Layout = () => import('@/views/layout'); const Layout = () => import('@/views/layout')
const Home = () => import('@/views/Home/index'); const Home = () => import('@/views/Home/index')
const Login = () => import('@/views/new-login/index.vue'); const Login = () => import('@/views/new-login/index.vue')
const routes = [ const routes = [
{ {
path: '*', path: '*',
@ -22,18 +22,18 @@ const routes = [
name: 'Login', name: 'Login',
meta: { meta: {
title: '登录', title: '登录',
requireLoginAuth: true requireLoginAuth: true,
} },
}, },
{ {
path: '/home-new', path: '/home-new',
name: 'home-new', name: 'home-new',
component: () => import('@/views/newHome/index.vue') component: () => import('@/views/newHome/index.vue'),
}, },
{ {
path: '/home-old', path: '/home-old',
name: 'home-old', name: 'home-old',
component: () => import('@/views/oldHome/index.vue') component: () => import('@/views/oldHome/index.vue'),
}, },
// { // {
@ -83,22 +83,20 @@ const routes = [
const router = new Router({ const router = new Router({
mode: 'history', mode: 'history',
routes, routes,
base: '/bigScrap',
}) })
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
if (to.path === '/bigScrap/login/index') {
if (to.path === '/login/index') { return next()
return next();
} }
const token = localStorage.getItem('token'); const token = localStorage.getItem('token')
if (!token) { if (!token) {
next('/login/index'); // 跳转到登录页 next('/bigScrap/login/index') // 跳转到登录页
} else { } else {
next(); // 放行 next() // 放行
} }
}); })
// if (to.matched.some(r => r.meta.requireLoginAuth)) { // if (to.matched.some(r => r.meta.requireLoginAuth)) {
// next(); // next();
@ -107,4 +105,3 @@ router.beforeEach(async (to, from, next) => {
// } // }
export default router export default router

View File

@ -4,32 +4,36 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
// url: '/new-page' // // url: '/new-page' //
jumpUrl: '', jumpUrl: '',
} }
},
created() {
const origin = window.location.origin
this.jumpUrl = origin
// const origin = window.location.origin
// if (origin == 'http://112.29.103.165:21624') {
// this.jumpUrl = origin
// } else {
// this.jumpUrl = 'http://192.168.0.14:21624'
// }
this.openNewWindow()
this.$tab.closePage().then(() => {})
},
methods: {
openNewWindow() {
window.open(
`${
this.jumpUrl
}//bigScrap/index01.html?token=${localStorage.getItem(
'token',
)}`,
'_blank',
)
}, },
created() { },
const origin = window.location.origin }
if (origin == 'http://112.29.103.165:21624') {
this.jumpUrl = origin
} else {
this.jumpUrl = 'http://192.168.0.14:21624'
}
this.openNewWindow()
this.$tab.closePage().then(() => {})
},
methods: {
openNewWindow() {
window.open(
`${this.jumpUrl}/index01.html?token=${localStorage.getItem(
'token',
)}`,
'_blank',
)
},
},
}
</script> </script>