添加文件

This commit is contained in:
WmjXiaoJun 2025-03-10 07:06:09 +08:00
parent a876bcc4ef
commit 1ec5cd41a7
39 changed files with 4815 additions and 0 deletions

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

40
index.html Normal file
View File

@ -0,0 +1,40 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>27_earth_web</title>
<script type="text/javascript" src="/lib/include-lib.js" libpath="lib/" include="jquery,jquery.range,bootstrap,bootstrap-checkbox,font-awesome,web-icons,layer,haoutil,nprogress,toastr,admui,turf,xjsdk"></script>
<script type="text/javascript" src="/jmmap/JmMap.js"></script>
<script type="text/javascript" src="/cesiumvectortile/dist/CesiumVectorTile.js"></script>
<script type="text/javascript" src="/config/componentUrl.js"></script>
<script src="config/xjsdkUrl.js"></script>
<script src="/widgets/plot/js/vew.work.js"></script>
<style>
*{
margin: 0;
padding: 0;
}
html,body{
width: 100%;
height: 100%;
font-size: 12px;
overflow:hidden;
min-width:1280px;
margin:0;
padding:0;
}
#app{
width: 100%;
height: 100%;
overflow:hidden;
min-width:1280px;
}
</style>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

3814
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

30
package.json Normal file
View File

@ -0,0 +1,30 @@
{
"name": "vite-project",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.4.0",
"echarts": "^5.4.3",
"element-plus": "^2.3.4",
"linq": "^4.0.2",
"mitt": "^3.0.1",
"naive-ui": "^2.34.4",
"path": "^0.12.7",
"vite-project": "file:",
"vue": "^3.3.4",
"vue-router": "^4.2.4",
"ws": "^8.18.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
"nodemon": "^3.1.7",
"vfonts": "^0.0.3",
"vite": "^4.4.5"
}
}

40
src/App.vue Normal file
View File

@ -0,0 +1,40 @@
<template>
<div id="app">
<el-config-provider :locale="locale">
<router-view />
</el-config-provider>
</div>
</template>
<script>
import "../src/assets/style/index.css";
import { defineComponent } from 'vue'
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
export default defineComponent({
components: {
ElConfigProvider,
},
setup() {
return {
locale: zhCn,
}
},
})
</script>
<style scoped>
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
filter: drop-shadow(0 0 2em #42b883aa);
}
</style>

175
src/api/111.json Normal file
View File

@ -0,0 +1,175 @@
{
"code": 200,
"msg": "操作成功",
"data": [
{
"zcRadar": {
"id": "1718581372408426497",
"elecType": "0",
"elecId": "1707032945988841474",
"type": 1,
"platId": "1699372623793758209",
"nationMode": "156",
"freqType": "0",
"freqAverage": null,
"freqValue": "100",
"periodType": null,
"frameCyc": null,
"periodAverage": null,
"periodValue": null,
"pulseWidthType": "1",
"pulseWidthAverage": null,
"pulseWidthValue": null,
"pulseModuType": null,
"contiWaveFlag": null,
"scanChara": null,
"scanCyc": null,
"mainAuxRatio": null,
"longitude": 116.640522,
"latitude": 39.648602,
"directId": "1",
"findTime": "2023-10-29 18:51:44",
"findTimeEnd": "2023-10-29 18:51:44",
"startTime": null,
"endTime": null,
"updateTime": "2023-10-29 18:51:44",
"updatePerson": "admin",
"remark": null,
"rhPlattargetgenattri": null,
"rhEstaTarget": null,
"rhElecequip": null
},
"model": "test",
"platID": "1699372623793758209",
"elecModel": "测试",
"elecID": "1707032945988841474"
},
{
"zcRadar": {
"id": "1731342901809528833",
"elecType": "0",
"elecId": "1707032945988841474",
"type": 1,
"platId": "1723264814106648577",
"nationMode": "156",
"freqType": "0",
"freqAverage": null,
"freqValue": "200",
"periodType": null,
"frameCyc": null,
"periodAverage": null,
"periodValue": null,
"pulseWidthType": "1",
"pulseWidthAverage": null,
"pulseWidthValue": null,
"pulseModuType": null,
"contiWaveFlag": null,
"scanChara": null,
"scanCyc": null,
"mainAuxRatio": null,
"longitude": 115.367072,
"latitude": 38.995495,
"directId": "1",
"findTime": "2023-10-27 18:51:44",
"findTimeEnd": "2023-10-29 18:51:44",
"startTime": null,
"endTime": null,
"updateTime": "2023-12-04 00:01:29",
"updatePerson": "admin",
"remark": null,
"rhPlattargetgenattri": null,
"rhEstaTarget": null,
"rhElecequip": null
},
"model": null,
"platID": null,
"elecModel": "测试",
"elecID": "1707032945988841474"
},
{
"zcRadar": {
"id": "1731342901809528833",
"elecType": "0",
"elecId": "1707032945988841474",
"type": 1,
"platId": "1723264814106648577",
"nationMode": "156",
"freqType": "0",
"freqAverage": null,
"freqValue": "200",
"periodType": null,
"frameCyc": null,
"periodAverage": null,
"periodValue": null,
"pulseWidthType": "2",
"pulseWidthAverage": null,
"pulseWidthValue": null,
"pulseModuType": null,
"contiWaveFlag": null,
"scanChara": null,
"scanCyc": null,
"mainAuxRatio": null,
"longitude": 115.367072,
"latitude": 38.995495,
"directId": "1",
"findTime": "2023-10-29 18:51:50",
"findTimeEnd": "2023-10-29 18:51:44",
"startTime": null,
"endTime": null,
"updateTime": "2023-12-04 00:01:29",
"updatePerson": "admin",
"remark": null,
"rhPlattargetgenattri": null,
"rhEstaTarget": null,
"rhElecequip": null
},
"model": null,
"platID": null,
"elecModel": "测试",
"elecID": "1707032945988841474"
},
{
"zcRadar": {
"id": "1731342901809528833",
"elecType": "0",
"elecId": "1707032945988841474",
"type": 1,
"platId": "1723264814106648577",
"nationMode": "156",
"freqType": "0",
"freqAverage": null,
"freqValue": "200",
"periodType": null,
"frameCyc": null,
"periodAverage": null,
"periodValue": null,
"pulseWidthType": "2",
"pulseWidthAverage": null,
"pulseWidthValue": null,
"pulseModuType": null,
"contiWaveFlag": null,
"scanChara": null,
"scanCyc": null,
"mainAuxRatio": null,
"longitude": 115.367072,
"latitude": 38.995495,
"directId": "1",
"findTime": "2023-10-31 18:51:50",
"findTimeEnd": "2023-10-29 18:51:44",
"startTime": null,
"endTime": null,
"updateTime": "2023-12-04 00:01:29",
"updatePerson": "admin",
"remark": null,
"rhPlattargetgenattri": null,
"rhEstaTarget": null,
"rhElecequip": null
},
"model": null,
"platID": null,
"elecModel": "测试",
"elecID": "1707032945988841474"
}
],
"ext": null
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/img/时间.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

BIN
src/assets/img/机场.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/img/机场01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

BIN
src/assets/img/雷达.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
src/assets/img/雷达01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/assets/img/雷达02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

View File

@ -0,0 +1,71 @@
/*滚动条*/
::-webkit-scrollbar {
width: 5px;
height: 5px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #535353;
}
p {
margin: 0 0 0px;
}
ul {
list-style: none;
}
.el-popper.is-light{
background: rgba(0,0,0,0.8) !important;
border:1px solid #409eff !important;
}
.el-select-dropdown__item{
color: #fff !important;
}
.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover {
background-color: #409eff !important;
}
.el-select-dropdown__item.hover, .el-select-dropdown__item:hover {
background-color: #409eff !important;
}
.el-select-dropdown.is-multiple .el-select-dropdown__item.selected {
background-color: #409eff !important;
}
.el-select__tags .el-tag--info {
background-color: #409eff !important;
}
.el-select .el-select__tags-text{
color: #fff;
}
.el-picker-panel {
color: #fff !important;
background: rgba(0,0,0,0.8) !important;
border-radius: var(--el-border-radius-base) !important;
line-height: 30px !important;
}
.el-picker-panel__footer {
background: rgba(0,0,0,0.8) !important;
}
.el-date-picker__header-label {
color: #fff !important;
}
/* .el-icon {
color: #fff !important;
} */
.el-date-table th {
color: #fff !important;
}
.el-button.is-text {
color: #fff !important;
}

1
src/assets/vue.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

After

Width:  |  Height:  |  Size: 496 B

View File

@ -0,0 +1,143 @@
import { createApp } from 'vue'
const app = createApp({})
import axios from "axios";
export default {
name: "X_Cesium",
props: {
// 初始化配置参数
url: String,
widgetUrl: String,
// 地图唯一性标识
mapKey: {
type: String,
default: ""
},
// 自定义参数
options1: Object,
// 是否分屏显示
compare: {
type: Boolean,
default: false
},
// 是否插入到body元素上
appendToBody: {
type: Boolean,
default: false
},
// 自定义css类名
customClass: {
type: String,
default: ""
}
},
mounted() {
this.initMap();
},
methods: {
initMap() {
if (this.mapKey) {
this.initXJSDK(this.options);
} else {
this.getMapConfig(this.url).then(data => {
this.initXJSDK(data);
});
}
},
getMapConfig(url) {
return new Promise((resolve, reject) => {
axios
.get(url)
.then(res => {
resolve(res.data);
})
.then(error => {
reject(error);
});
});
},
initXJSDK(options) {
return new Promise((resolve) => {
if (this[`viewer${this.mapKey}`]) {
resolve();
return;
}
const viewer = xjsdk.createMap({
id: `xj3d-container${this.mapKey ? `-${this.mapKey}` : ""}`,
data: options.xj3d,
serverURL: options.serverURL,
...this.options
});
//widget处理
this.getMapConfig(this.widgetUrl).then(data => {
this.initStaticWidget(viewer, data);
});
// Cesium 1.61以后默认关闭反走样对面端而言还是开启好,
viewer.scene.postProcessStages.fxaa.enabled = true;
//鼠标滚轮放大的步参
viewer.scene.screenSpaceCameraController._zoomFactor = 2.0;
//IE览器优化
if (window.navigator.userAgent.toLowerCase().indexOf("msie") >= 0) {
viewer.targetFrameRate = 20; //限制帧率
viewer.requestRenderMode = true; //取消实时渲染
}
// 二三维切换不用动画
if (viewer.sceneModePicker) {
viewer.sceneModePicker.viewModel.duration = 0.0;
}
this[`viewer${this.mapKey}`] = viewer;
// 挂载到全局对象下所有组件通过this.$viewer访问
app.config.globalProperties.$viewer = viewer
this.$emit("onload", viewer);
resolve();
});
},
//初始化外部静态widget功能兼容使用传统模式开发的一些widget
initStaticWidget(viewer, widget) {
xjsdk.widget.init(viewer, widget);
//绑定图层管理
window.bindToLayerControl = function (options) {
var layer = viewer.xjsdk.addOperationalLayer(options);
var manageLayersWidget = xjsdk.widget.getClass(
"widgets/manageLayers/widget.js"
);
if (manageLayersWidget) {
manageLayersWidget.addOverlay(options);
}
return layer;
};
//取消绑定图层管理 参数为bindToLayerControl返回的图层
window.unbindLayerControl = function (layer) {
viewer.xjsdk.removeOperationalLayer(layer.config.id);
var manageLayersWidget = xjsdk.widget.getClass(
"widgets/manageLayers/widget.js"
);
if (manageLayersWidget) {
manageLayersWidget.removeLayer(layer.config.name);
}
};
}
}
};

View File

@ -0,0 +1,47 @@
<template>
<div class="x-cesium-container">
<div :id="`xj3d-container${mapKey ? '-' + mapKey : ''}`" :class="['xj3d-container', customClass, { 'xj3d-container-compare-rh': compare }]">
</div>
</div>
</template>
<script>
import X_Cesium from './index.js'
export default {
...X_Cesium,
mounted() {
this.initMap();
}
}
</script>
<style scoped>
.x-cesium-container {
position: relative;
width: 100%;
height: 100%;
}
.xj3d-container {
width: 100%;
height: 100%;
}
</style>

View File

@ -0,0 +1,18 @@
import axios from "axios";
export default {
name: "X_Head",
props: {},
data() {
return {
};
},
mounted() {
},
methods: {
}
};

View File

@ -0,0 +1,16 @@
<template>
<div style="position: absolute; top: 0; width: 100%; height: 50px; line-height: 50px;">
<p style="font-size: 30px; color: #fff; margin-left: 30px;"></p>
<!-- <button @click="ceshi">1111</button> -->
</div>
</template>
<script>
import X_Head from './index.js'
export default X_Head
</script>
<style >
</style>

View File

@ -0,0 +1,40 @@
import axios from "axios";
export default {
name: "MB_Head",
props: {},
data() {
return {
tabPosition: 'bottom',
btntype:1,
bottomsapn:[
{
name:'标号',
index:1
},
{
name:'列表',
index:2
}
]
};
},
mounted() {
document.getElementsByClassName("bottombtn")[0].classList.add("bottombtn1")
},
methods: {
plotCutBtn(type){
let a = document.getElementsByClassName("bottombtn")
for(var i=0;i<a.length;i++){
a[i].classList.remove("bottombtn1")
}
this.bottomsapn.forEach(element => {
if(element.index == type){
a[type-1].classList.add("bottombtn1")
}
});
this.btntype = type
},
}
};

View File

@ -0,0 +1,50 @@
<template>
<div style="position: absolute; top: 120px; left: 40px; width: 15%; height: 70%;background: #483e3e;border-radius: 6px;border: 1px solid red;">
<div style="height: 50px; border-bottom: 1px solid red;">
<span style="font-size: 30px; color: #fff; margin-left: 15px;">27_earth_web</span>
<span style="font-size: 30px; color: #fff; margin-right: 15px;float: right;cursor: pointer;">X</span>
</div>
<div style="height: calc(100% - 100px);">
<p style="font-size: 30px; color: #fff; margin-left: 30px;" v-if="btntype == 1">27_earth_web111</p>
<p style="font-size: 30px; color: #fff; margin-left: 30px;" v-if="btntype == 2">27_earth_web222</p>
</div>
<div style="height: 50px; border-top: 1px solid red;" class="bottomClass">
<div style="margin-left: 10px;">
<span class="bottombtn" v-for="item in bottomsapn" @click="plotCutBtn(item.index)">{{item.name}}</span>
</div>
<!-- <span class="bottombtn" style="margin-left: 0px;" @click="plotCutBtn(2)">列表</span> -->
</div>
<!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="标号" name="first">标号</el-tab-pane>
<el-tab-pane label="列表" name="second">列表</el-tab-pane>
</el-tabs> -->
</div>
</template>
<script>
import X_Plot from './index.js'
export default X_Plot
</script>
<style >
.bottombtn{
color: rgb(145 140 140);
cursor: pointer;
/* margin-left: 10px; */
padding: 3px 5px 3px 5px;
font-size: 15px;
border-top: none;
}
.bottombtn1{
border: 1px solid;
border-top: none;
color: #fff;
border-radius: 5px;
}
/* .el-tabs{
--el-tabs-header-height: 20px;
} */
</style>

11
src/components/index.js Normal file
View File

@ -0,0 +1,11 @@
import X_Cesium from "../components/X_Cesium/index.vue";
import X_Head from "./X_Head/index.vue";
import X_Plot from "./X_Plot/index.vue";
export const componentPlign = {
install(app) {
app.component('X_Cesium', X_Cesium)
app.component('X_Head', X_Head)
app.component('X_Plot', X_Plot)
}
}

33
src/main.js Normal file
View File

@ -0,0 +1,33 @@
import { createApp } from 'vue'
import router from './router'
import './style.css'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//echarts
import * as echarts from "echarts";
import naive from 'naive-ui'
//公共组件
import { componentPlign } from './components/index.js'
//封装公共接口
// import jm_api from './utils/requet.js'
//组件之间传参
import mitt from 'mitt'
const mitter = mitt()
const app = createApp(App)
// app.config.globalProperties.$Cesium
//调用后台Api
//app.config.globalProperties.$jm_api = jm_api
//组件之间传参
app.config.globalProperties.$mitt = mitter
//echarts
app.config.globalProperties.$echarts = echarts
app.use(router).use(ElementPlus).use(naive).use(componentPlign)
app.mount('#app')

18
src/router/index.js Normal file
View File

@ -0,0 +1,18 @@
import { createRouter, createWebHashHistory } from "vue-router"
const routes = [
{
path: '/',
name: 'layout_guide',
component: () => import('../views/X_LayoutGuide/index.vue')
},
// {
// path: '/HelloWorld',
// name: 'HelloWorld',
// component: () => import('../components/HelloWorld.vue')
// }
]
const router = createRouter({
history: createWebHashHistory(),
routes
})
export default router

89
src/style.css Normal file
View File

@ -0,0 +1,89 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
body {
/* margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh; */
}
h1 {
font-size: 3.2em;
line-height: 1.1;
}
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
.card {
padding: 2em;
}
#app {
/* max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center; */
}
@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}

18
src/style/reset.css Normal file
View File

@ -0,0 +1,18 @@
* {
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
width: 100%;
font-size: 14px;
}
#app {
width: 100%;
height: 100%;
background-color: #ecf5ff;
overflow: hidden;
}

42
src/utils/requet.js Normal file
View File

@ -0,0 +1,42 @@
import axios from "axios";
//全局配置
// axios.defaults.baseURL = "http://139.159.228.85:8080"
// axios.defaults.timeout = 5000
// //拦截器
// axios.interceptors.request.use(config => {
// return config
// }, error => {
// return Promise.error(error)
// })
// axios.interceptors.response.use(response => {
// return response.data
// }, error => {
// return Promise.error(error)
// })
export function request(url = '', params = {}, type = 'POST') {
//设置 url params type 的默认值
return new Promise((resolve, reject) => {
let promise
if (type.toUpperCase() === 'GET') {
promise = axios({
url,
params
})
} else if (type.toUpperCase() === 'POST') {
promise = axios({
method: 'POST',
url,
data: params
})
}
//处理返回
promise.then(res => {
resolve(res)
}).catch(err => {
reject(err)
})
})
}

View File

@ -0,0 +1,36 @@
export default {
name: 'X_LayoutGuide',
data() {
return {
isMenuShow:false,
fontcolor:"",
fonts:"",
fontsize:0,
fornum: 1,
clonum: 24,
dialogFormVisible: false,
videoclass:"padding-bottom: 40.25%; position: relative; margin: 0px auto; overflow: hidden;",
configUrl: "config/config.json",
widgetUrl:"config/widget.json",
titleTypeName:"",
realName:'',
titleName:'',
style:{
'position': 'absolute',
},
type:'',
};
},
methods: {
},
components: {
Map
},
mounted(){
}
};

View File

@ -0,0 +1,13 @@
<template>
<div id="centerDiv" class="mapcontainer" style="height: 100%;">
<X_Cesium :url="configUrl" :widgetUrl="widgetUrl" />
</div>
<X_Head />
<!-- <X_Plot /> -->
</template>
<script>
import X_LayoutGuide from './index.js'
export default X_LayoutGuide
</script>

View File

View File

46
vite.config.js Normal file
View File

@ -0,0 +1,46 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// // https://vitejs.dev/config/
// export default defineConfig({
// plugins: [vue()],
// })
import { resolve } from 'path';
export default defineConfig({
base: './',
plugins: [
vue(),
],
// publicDir:'pubilc/',
//开发模式 默认:'development'(开发模式),'production'(生产模式)
mode : 'development',
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
server: {
// 是否开启 https
https: false,
// 端口号
port: 10110,
// 监听所有地址
host: '0.0.0.0',
// 服务启动时是否自动打开浏览器
open: true,
// 允许跨域
cors: true,
},
build: {
// 设置最终构建的浏览器兼容目标
target: 'es2015',
// 构建后是否生成 source map 文件
sourcemap: false,
// chunk 大小警告的限制(以 kbs 为单位)
chunkSizeWarningLimit: 2000,
// 启用/禁用 gzip 压缩大小报告
reportCompressedSize: false,
},
})