增加vue相关配置文件
This commit is contained in:
parent
27ff842418
commit
660a1f0ebd
|
|
@ -0,0 +1,5 @@
|
||||||
|
VITE_APP_TITLE=西安智慧应急
|
||||||
|
VITE_APP_SUB_TITLE=综合执法
|
||||||
|
VITE_APP_VERSION=v2.0
|
||||||
|
VITE_BASE_URL=https://10.22.245.209:19190
|
||||||
|
VITE_SSO_SECRET_KEY=2aVphzD769T07e/gfqzh7WsD+ow1DYeZmfUXkVyohcE=
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
VITE_BASE_URL=http://218.77.106.90:16166
|
||||||
|
VITE_SSO_SECRET_KEY=2aVphzD769T07e/gfqzh7WsD+ow1DYeZmfUXkVyohcE=
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
VITE_BASE_URL=http://10.22.245.219:16165
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
sass_binary_site=https://registry.npmmirror.com/mirrors/node-sass/
|
||||||
|
phantomjs_cdnurl=https://registry.npmmirror.com/mirrors/phantomjs/
|
||||||
|
electron_mirror=https://registry.npmmirror.com/mirrors/electron/
|
||||||
|
registry=https://registry.npmmirror.com/
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Vue 3 + Vite
|
||||||
|
|
||||||
|
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
||||||
|
|
||||||
|
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
|
||||||
|
<!-- 预加载优化 -->
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link rel="dns-prefetch" href="//cdn.example.com">
|
||||||
|
|
||||||
|
<!-- 动态标题 -->
|
||||||
|
<title data-fallback="子系统">%VITE_APP_SUB_TITLE%</title>
|
||||||
|
|
||||||
|
<!-- 图标缓存策略 -->
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" crossorigin="anonymous">
|
||||||
|
<link rel="preload" href="/favicon.svg" as="image">
|
||||||
|
|
||||||
|
<!-- 异步加载样式 -->
|
||||||
|
<link rel="stylesheet" href="/styles/loading.css" media="print" onload="this.media='all'">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="app">
|
||||||
|
<!-- 增强可访问性的加载状态 -->
|
||||||
|
<div class="first-loading-wrp">
|
||||||
|
<div class="loading-wrp" role="status" aria-live="polite" aria-label="加载中">
|
||||||
|
<span class="dot dot-spin" aria-hidden="true">
|
||||||
|
<i role="presentation"></i>
|
||||||
|
<i role="presentation"></i>
|
||||||
|
<i role="presentation"></i>
|
||||||
|
<i role="presentation"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 语义化标题 -->
|
||||||
|
<h1 class="visually-hidden">%VITE_APP_SUB_TITLE%</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 环境变量处理 -->
|
||||||
|
<script type="module">
|
||||||
|
// 设置标题和内容
|
||||||
|
document.title = import.meta.env.VITE_APP_SUB_TITLE || document.querySelector('title').getAttribute('data-fallback');
|
||||||
|
document.querySelector('h1').textContent = import.meta.env.VITE_APP_SUB_TITLE || '子系统';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- 异步加载主脚本 -->
|
||||||
|
<script type="module" src="/main.js" defer async></script>
|
||||||
|
<script type="text/javascript" src="/js/ZLMRTCClient.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/webrtc.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/egis-2d.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/h5player.min.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/littleLemon.js"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "./",
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["src/*"],
|
||||||
|
"@pages/*": ["src/views/*"],
|
||||||
|
"@views/*": ["src/views/*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"dist"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
import { createApp } from 'vue'
|
||||||
|
import App from '@/views/App.vue'
|
||||||
|
import ElementPlus from 'element-plus'
|
||||||
|
import { zhCn } from 'element-plus/es/locales'
|
||||||
|
import IndexTitle from '@/components/IndexTitle/index.vue'
|
||||||
|
import PublicChart from '@/components/PublicChart/index.vue'
|
||||||
|
import IndustryTitle from '@/components/IndustryTradeComponents/IndustryTitle.vue'
|
||||||
|
import { setupStore } from '@/stores'
|
||||||
|
import { setupRouter } from '@/router'
|
||||||
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
||||||
|
import { fas } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
|
// 引入样式文件
|
||||||
|
import '@/assets/styles/frontend.css'
|
||||||
|
import '@/assets/styles/gzt.css'
|
||||||
|
import '@/assets/styles/normalize.css'
|
||||||
|
import 'element-plus/dist/index.css'
|
||||||
|
import '@/assets/styles/reset.css'
|
||||||
|
import '@/assets/styles/index.scss'
|
||||||
|
// import '@/assets/styles/themes/cvi.scss'
|
||||||
|
// import '@/assets/styles/themes/svi.scss'
|
||||||
|
import '@/assets/styles/themes/classPublic.scss'
|
||||||
|
import 'echarts-liquidfill/src/liquidFill.js'
|
||||||
|
import 'echarts-gl'
|
||||||
|
import '@/assets/styles/Browser.scss'
|
||||||
|
import '@/assets/styles/BusinessTable.scss'
|
||||||
|
import '@/assets/styles/TreeSelector.scss'
|
||||||
|
import ElTable from '@/components/ElTable.vue'
|
||||||
|
import './public/styles/fonts.scss'
|
||||||
|
|
||||||
|
const app = createApp(App)
|
||||||
|
// ui
|
||||||
|
app.use(ElementPlus,{locale: zhCn, size: 'large'})
|
||||||
|
// font awesome icon
|
||||||
|
library.add(fas)
|
||||||
|
app.component('font-awesome-icon', FontAwesomeIcon)
|
||||||
|
// 使用自定义的ElTable组件注册全局的el-table
|
||||||
|
app.component('el-table', ElTable)
|
||||||
|
|
||||||
|
// store
|
||||||
|
setupStore(app)
|
||||||
|
// router
|
||||||
|
setupRouter(app)
|
||||||
|
app.component('IndexTitle', IndexTitle)
|
||||||
|
app.component('PublicChart', PublicChart)
|
||||||
|
app.component('IndustryTitle', IndustryTitle)
|
||||||
|
app.mount('#app')
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,75 @@
|
||||||
|
{
|
||||||
|
"name": "xian-zazh-client",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.2.14",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite --mode development",
|
||||||
|
"build": "vite build",
|
||||||
|
"build:dev": "vite build --mode development",
|
||||||
|
"build:test": "vite build --mode test",
|
||||||
|
"preview": "vite preview"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions",
|
||||||
|
"not dead",
|
||||||
|
"not ie > 0",
|
||||||
|
"Android >= 4.0",
|
||||||
|
"iOS >= 8"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
||||||
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
||||||
|
"@fortawesome/vue-fontawesome": "^3.0.8",
|
||||||
|
"@vueup/vue-quill": "^1.2.0",
|
||||||
|
"axios": "^1.7.7",
|
||||||
|
"crypto-js": "^4.2.0",
|
||||||
|
"dayjs": "^1.11.13",
|
||||||
|
"docxtemplater": "^3.61.0",
|
||||||
|
"echarts": "^5.6.0",
|
||||||
|
"echarts-gl": "^2.0.9",
|
||||||
|
"echarts-liquidfill": "^3.1.0",
|
||||||
|
"element-plus": "^2.5.2",
|
||||||
|
"file-saver": "^2.0.5",
|
||||||
|
"html2canvas": "^1.4.1",
|
||||||
|
"jose": "^6.1.0",
|
||||||
|
"js-cookie": "^3.0.5",
|
||||||
|
"js-file-download": "^0.4.12",
|
||||||
|
"jspdf": "^3.0.1",
|
||||||
|
"jszip-utils": "^0.1.0",
|
||||||
|
"leaflet": "^1.9.4",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
|
"lodash-es": "^4.17.21",
|
||||||
|
"moment": "^2.30.1",
|
||||||
|
"pinia": "^2.1.6",
|
||||||
|
"pizzip": "^3.1.8",
|
||||||
|
"print-js": "^1.6.0",
|
||||||
|
"qrcode.vue": "^3.6.0",
|
||||||
|
"qs": "^6.11.2",
|
||||||
|
"quill": "^2.0.3",
|
||||||
|
"resize-detector": "^0.3.0",
|
||||||
|
"screenfull": "^6.0.2",
|
||||||
|
"uuid": "^11.1.0",
|
||||||
|
"vue": "^3.5.13",
|
||||||
|
"vue-grid-layout": "^2.3.1",
|
||||||
|
"vue-router": "^4.2.4",
|
||||||
|
"vue-treeselect": "^1.0.7",
|
||||||
|
"vue3-print-nb": "^0.1.4",
|
||||||
|
"xlsx": "^0.18.5"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@vitejs/plugin-vue": "^5.2.1",
|
||||||
|
"autoprefixer": "^10.4.20",
|
||||||
|
"postcss": "^8.4.47",
|
||||||
|
"postcss-html": "1.8.0",
|
||||||
|
"postcss-pxtorem": "^6.0.0",
|
||||||
|
"prettier": "^3.5.2",
|
||||||
|
"sass": "^1.66.1",
|
||||||
|
"sass-loader": "^13.3.2",
|
||||||
|
"vite": "^6.1.0",
|
||||||
|
"vite-plugin-compression": "^0.5.0",
|
||||||
|
"vite-plugin-static-copy": "^3.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,14 @@
|
||||||
|
module.exports = {
|
||||||
|
plugins: {
|
||||||
|
autoprefixer: {},
|
||||||
|
'postcss-pxtorem': {
|
||||||
|
rootValue: 16,
|
||||||
|
unitPrecision: 5,
|
||||||
|
propList: ['*'],
|
||||||
|
selectorBlackList: [],
|
||||||
|
replace: true,
|
||||||
|
mediaQuery: false,
|
||||||
|
minPixelValue: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
module.exports = {
|
||||||
|
printWidth: 130,
|
||||||
|
tabWidth: 2,
|
||||||
|
useTabs: false,
|
||||||
|
semi: false,
|
||||||
|
singleQuote: true,
|
||||||
|
quoteProps: 'as-needed',
|
||||||
|
jsxSingleQuote: false,
|
||||||
|
trailingComma: 'es5',
|
||||||
|
bracketSpacing: true,
|
||||||
|
jsxBracketSameLine: false,
|
||||||
|
arrowParens: 'always',
|
||||||
|
htmlWhitespaceSensitivity: 'ignore',
|
||||||
|
vueIndentScriptAndStyle: true,
|
||||||
|
endOfLine: 'lf',
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
import { defineConfig, loadEnv } from 'vite'
|
||||||
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
import vitePluginCompression from 'vite-plugin-compression'
|
||||||
|
import path from 'path'
|
||||||
|
|
||||||
|
// https://vite.dev/config/
|
||||||
|
export default defineConfig(({ mode, command }) => {
|
||||||
|
// 加载环境变量
|
||||||
|
const env = loadEnv(mode, process.cwd())
|
||||||
|
return {
|
||||||
|
// 服务器配置
|
||||||
|
server: {
|
||||||
|
host: '0.0.0.0',
|
||||||
|
port: 5173,
|
||||||
|
open: false,
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://localhost:9091',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/lawenforcement': {
|
||||||
|
target: 'http://localhost:9091',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/rest': {
|
||||||
|
target: 'http://222.91.125.86:8090',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/pangu': {
|
||||||
|
target: 'http://222.91.125.86:8090',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/dah-login': {
|
||||||
|
target: 'http://10.22.245.227:1084',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/dah-api': {
|
||||||
|
target: 'http://10.22.245.227:1084',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
publicDir: path.resolve(__dirname, 'public'),
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': path.resolve(__dirname, 'src'),
|
||||||
|
'@pages': path.resolve(__dirname, 'src/views'),
|
||||||
|
'@views': path.resolve(__dirname, 'src/views'),
|
||||||
|
'@css': path.resolve(__dirname, 'src/styles'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
vue(),
|
||||||
|
vitePluginCompression({
|
||||||
|
// 可以指定压缩的文件类型,例如只压缩图片文件
|
||||||
|
include: /\.(png|jpg|jpeg|gif|svg)$/i,
|
||||||
|
// 压缩算法选项,如gzip、brotli等,这里以gzip为例
|
||||||
|
algorithm: 'gzip',
|
||||||
|
// 压缩阈值,只有文件大小大于此值时才进行压缩
|
||||||
|
threshold: 1024,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
css: {
|
||||||
|
preprocessorOptions: {
|
||||||
|
scss: {
|
||||||
|
prependData: `@import "./src/styles/variables.scss";`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
outDir: path.resolve(__dirname, `dist`), // 指定输出路径
|
||||||
|
assetsInlineLimit: 4096, //小于此阈值的导入或引用资源将内联为 base64 编码,以避免额外的 http 请求
|
||||||
|
emptyOutDir: true, //Vite 会在构建时清空该目录
|
||||||
|
rollupOptions: {
|
||||||
|
input: {
|
||||||
|
main: path.resolve(__dirname, 'index.html'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
assetFileNames: '[ext]/[name]-[hash].[ext]',
|
||||||
|
chunkFileNames: 'js/[name]-[hash].js',
|
||||||
|
entryFileNames: 'js/[name]-[hash].js',
|
||||||
|
compact: true,
|
||||||
|
manualChunks: (id) => {
|
||||||
|
if (id.includes('node_modules')) {
|
||||||
|
return id.toString().split('node_modules/')[1].split('/')[0].toString() // 拆分多个vendors
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
Loading…
Reference in New Issue