From 01f5f22e178071cac15f12d588e4ac8559b22e31 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Fri, 20 Dec 2024 17:12:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AC=E5=8F=91=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 6 +- settings.js | 32 +- .../components/ModelLoading.vue | 268 ++++++++-------- src/views/system/model/deploy/ModelUpdata.vue | 285 ++++++++++-------- vue.config.js | 156 +++++----- 5 files changed, 384 insertions(+), 363 deletions(-) diff --git a/.env.development b/.env.development index e44e4cc..1368825 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,8 @@ # base api # VUE_APP_API_URL = 'http://192.168.145.232:8884/frame-boot-control' # VUE_APP_API_URL = 'http://192.168.129.88:8882/frame-boot-control' -VUE_APP_BASE_API = '/dev-api' -VUE_APP_MODEL_API = '/api/modelFile' +# VUE_APP_BASE_API = '/dev-api' +#VUE_APP_MODEL_API = '/api/modelFile' +VUE_APP_BASE_API = '/jkpg-api' +VUE_APP_MODEL_API = '/api/api/modelFile' VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/settings.js b/settings.js index 5699d14..a031001 100644 --- a/settings.js +++ b/settings.js @@ -2,8 +2,8 @@ module.exports = { /** * @description 系统标题,icon */ - title: '欣影大数据', - logo: 'http://www.huatek.com/imgs/home_logo.png', + title: "欣影大数据", + logo: "http://www.huatek.com/imgs/home_logo.png", /** * @type {boolean} true | false * @description 是否固定导航栏到顶部 @@ -20,11 +20,10 @@ module.exports = { * 是否使用阿里云OSS文件存储 */ OSSConfig: { - accessKeyId: 'LTAILVNVeJZkF4PV', - accessKeySecret: 'YKBrFuyEQQJBXRklt4kIVS3vwS5q4U', - region: 'huatek-oss.oss-cn-beijing.aliyuncs.com', - bucket: 'huatek-oss' - + accessKeyId: "LTAILVNVeJZkF4PV", + accessKeySecret: "YKBrFuyEQQJBXRklt4kIVS3vwS5q4U", + region: "huatek-oss.oss-cn-beijing.aliyuncs.com", + bucket: "huatek-oss", }, InfraredPic: "http://192.168.135.81:88", @@ -36,7 +35,7 @@ module.exports = { development: { // VUE_APP_API_URL: 'http://172.16.12.215:7000',//佳佳 // VUE_APP_API_URL: 'http://172.16.12.81:7000',//定海 - VUE_APP_API_URL: 'http://127.0.0.1:7000', + VUE_APP_API_URL: "/jkpg-api", // VUE_APP_API_URL: 'http://172.16.12.226:7000', // VUE_APP_API_URL: 'http://222.90.232.142:8171/prod-api', // VUE_APP_API_URL: 'http://192.168.1.22:8084', @@ -47,7 +46,8 @@ module.exports = { // VUE_APP_API_URL_TOW: 'http://127.0.0.1:8080/busi-back-control' }, - production: { //h后台代码的访问接口 + production: { + //h后台代码的访问接口 // VUE_APP_API_URL: 'http://10.78.34.40:8085' // 测试环境 @@ -57,7 +57,8 @@ module.exports = { // VUE_APP_API_URL: 'http://127.0.0.1:7000', // 宜兴 - VUE_APP_API_URL: 'http://192.168.1.22:8084', + //VUE_APP_API_URL: "http://192.168.1.22:8084", + VUE_APP_API_URL: "/jkpg-api", //中广核 // VUE_APP_API_URL: 'http://192.168.1.47:8080', @@ -78,12 +79,11 @@ module.exports = { //洪屏 // VUE_APP_API_URL: 'http://192.168.1.12:7000', - - // VUE_APP_API_URL: 'http://192.168.128.25:8084', + // VUE_APP_API_URL: 'http://192.168.128.25:8084', }, test: { - VUE_APP_API_URL: 'http://192.168.1.161:8088', - } - } -} + VUE_APP_API_URL: "http://192.168.1.161:8088", + }, + }, +}; diff --git a/src/views/healthAssessment/components/ModelLoading.vue b/src/views/healthAssessment/components/ModelLoading.vue index 171bed7..f6efeda 100644 --- a/src/views/healthAssessment/components/ModelLoading.vue +++ b/src/views/healthAssessment/components/ModelLoading.vue @@ -17,23 +17,23 @@ diff --git a/vue.config.js b/vue.config.js index 8d9049d..15d9ba9 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,32 +1,32 @@ -'use strict' -const path = require('path') -const defaultSettings = require('./settings.js') +"use strict"; +const path = require("path"); +const defaultSettings = require("./settings.js"); -const ENV = process.env.NODE_ENV.toLowerCase() -console.log(ENV) -const API_CONFIG = defaultSettings.API[ENV] || {} -console.log(API_CONFIG) +const ENV = process.env.NODE_ENV.toLowerCase(); +console.log(ENV); +const API_CONFIG = defaultSettings.API[ENV] || {}; +console.log(API_CONFIG); // https://cli.vuejs.org/guide/mode-and-env.html#using-env-variables-in-client-side-code -Object.keys(API_CONFIG).forEach(key => { - if (!key.startsWith('VUE_APP_')) { - throw new Error(`${key} 必须以【VUE_APP_】开始;API.${ENV}.${key}`) +Object.keys(API_CONFIG).forEach((key) => { + if (!key.startsWith("VUE_APP_")) { + throw new Error(`${key} 必须以【VUE_APP_】开始;API.${ENV}.${key}`); } - process.env[key] = API_CONFIG[key] -}) + process.env[key] = API_CONFIG[key]; +}); function resolve(dir) { - return path.join(__dirname, dir) + return path.join(__dirname, dir); } -const name = defaultSettings.title || 'Huatek Frontend Template' +const name = defaultSettings.title || "Huatek Frontend Template"; -const port = process.env.port || process.env.npm_config_port || 9528 // 端口 +const port = process.env.port || process.env.npm_config_port || 9528; // 端口 module.exports = { - publicPath: '/', - outputDir: 'dist', - assetsDir: 'static', + publicPath: "/", + outputDir: "dist", + assetsDir: "static", // lintOnSave: true, lintOnSave: false, // lintOnSave: process.env.NODE_ENV === 'development', @@ -35,138 +35,138 @@ module.exports = { compress: true, disableHostCheck: true, port: port, - host: '0.0.0.0', + host: "0.0.0.0", open: true, overlay: { warnings: false, - erors: true + erors: true, }, proxy: { [process.env.VUE_APP_BASE_API]: { // target: `http://192.168.1.161:${port}/mock`, - target: `http://127.0.0.1:8084/`, + target: `http://192.168.1.190:92/`, changeOrigin: true, // logger: 'debug', pathRewrite: { - ['^' + process.env.VUE_APP_BASE_API]: '' - } + ["^" + process.env.VUE_APP_BASE_API]: "/jkpg-api", + }, }, + // 加载莫模型 [process.env.VUE_APP_MODEL_API]: { // target: `http://127.0.0.1:8082/`, // cac token获取ip - target: `http://192.168.1.21:8022/`, + target: `http://192.168.1.190:92/`, changeOrigin: true, pathRewrite: { - ['^' + process.env.VUE_APP_MODEL_API]: '' + ["^" + process.env.VUE_APP_MODEL_API]: "", }, // logLevel: 'debug' }, // 一键登录升级振动 - '/sysLoginRemoteController/login': { + "/sysLoginRemoteController/login": { // target: `http://192.168.1.12:8081/`, // target: `http://192.168.41.24:8081/`, // target: `http://192.168.1.24:8081/`, target: `http://192.168.135.81:8081/`, changeOrigin: true, pathRewrite: { - '^/api': '' + "^/api": "", }, // logLevel: 'debug' }, // 一键登录CAC - '/cacRemote/login': { + "/cacRemote/login": { // target: `http://127.0.0.1:8082/`, // cac token获取ip target: `http://192.168.145.147:8082/`, changeOrigin: true, pathRewrite: { - '^/api': '' + "^/api": "", }, // logLevel: 'debug' }, }, - after: require('./mock/mock-server.js') + after: require("./mock/mock-server.js"), }, configureWebpack: { name: name, resolve: { alias: { - '@': resolve('src') - } - } + "@": resolve("src"), + }, + }, }, chainWebpack(config) { - config.plugins.delete('preload') - config.plugins.delete('prefetch') + config.plugins.delete("preload"); + config.plugins.delete("prefetch"); // set svg-sprite-loader + config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end(); config.module - .rule('svg') - .exclude.add(resolve('src/assets/icons')) - .end() - config.module - .rule('icons') + .rule("icons") .test(/\.svg$/) - .include.add(resolve('src/assets/icons')) + .include.add(resolve("src/assets/icons")) .end() - .use('svg-sprite-loader') - .loader('svg-sprite-loader') + .use("svg-sprite-loader") + .loader("svg-sprite-loader") .options({ - symbolId: 'icon-[name]' + symbolId: "icon-[name]", }) - .end() + .end(); // set preserveWhitespace config.module - .rule('vue') - .use('vue-loader') - .loader('vue-loader') - .tap(options => { - options.compilerOptions.preserveWhitespace = true - return options + .rule("vue") + .use("vue-loader") + .loader("vue-loader") + .tap((options) => { + options.compilerOptions.preserveWhitespace = true; + return options; }) - .end() + .end(); config // https://webpack.js.org/configuration/devtool/#development - .when(process.env.NODE_ENV === 'development', config => - config.devtool('cheap-module-eval-source-map') - ) + .when(process.env.NODE_ENV === "development", (config) => + config.devtool("cheap-module-eval-source-map") + ); - config.when(process.env.NODE_ENV !== 'development', config => { + config.when(process.env.NODE_ENV !== "development", (config) => { config - .plugin('ScriptExtHtmlWebpackPlugin') - .after('html') - .use('script-ext-html-webpack-plugin', [{ - // `runtime` must same as runtimeChunk name. default is `runtime` - inline: /runtime\..*\.js$/ - }]) - .end() + .plugin("ScriptExtHtmlWebpackPlugin") + .after("html") + .use("script-ext-html-webpack-plugin", [ + { + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/, + }, + ]) + .end(); config.optimization.splitChunks({ - chunks: 'all', + chunks: "all", cacheGroups: { libs: { - name: 'chunk-libs', + name: "chunk-libs", test: /[\\/]node_modules[\\/]/, priority: 10, - chunks: 'initial' // only package third parties that are initially dependent + chunks: "initial", // only package third parties that are initially dependent }, elementUI: { - name: 'chunk-elementUI', // split elementUI into a single package + name: "chunk-elementUI", // split elementUI into a single package priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app - test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm + test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm }, commons: { - name: 'chunk-commons', - test: resolve('src/components'), // can customize your rules + name: "chunk-commons", + test: resolve("src/components"), // can customize your rules minChunks: 3, // minimum common number priority: 5, - reuseExistingChunk: true - } - } - }) - config.optimization.runtimeChunk('single') - }) - } -} + reuseExistingChunk: true, + }, + }, + }); + config.optimization.runtimeChunk("single"); + }); + }, +};