diff --git a/.env.development b/.env.development
deleted file mode 100644
index 9e26dad..0000000
--- a/.env.development
+++ /dev/null
@@ -1,4 +0,0 @@
-NODE_ENV='development'
-# must start with VUE_APP_
-VUE_APP_ENV = 'development'
-
diff --git a/.env.production b/.env.production
deleted file mode 100644
index 4b2d764..0000000
--- a/.env.production
+++ /dev/null
@@ -1,4 +0,0 @@
-NODE_ENV='production'
-# must start with VUE_APP_
-VUE_APP_ENV = 'production'
-
\ No newline at end of file
diff --git a/.env.test b/.env.test
deleted file mode 100644
index e60a797..0000000
--- a/.env.test
+++ /dev/null
@@ -1,4 +0,0 @@
-NODE_ENV='test'
-# must start with VUE_APP_
-VUE_APP_ENV = 'test'
-
diff --git a/README.md b/README.md
index 8b9a234..44ef6cb 100644
--- a/README.md
+++ b/README.md
@@ -56,3 +56,8 @@ npm run lint
`2023年12月21日` FETURE
- 增加 情绪,情绪周报和体征详情页面
+
+`2023年12月25日` UPDATE
+
+- 修改 测试环境部署文件
+- 增加 洞悉 月报详情页面
diff --git a/package.json b/package.json
index 22dd2b3..0d960ee 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
- "build-test": "vue-cli-service build --mode test",
+ "build-test": "vue-cli-service build --mode testing",
"lint": "vue-cli-service lint",
"deps": "yarn upgrade-interactive --latest",
"dev": "vue-cli-service serve --mode development",
diff --git a/setup_test.sh b/setup_test.sh
index a84dd71..16a3d67 100644
--- a/setup_test.sh
+++ b/setup_test.sh
@@ -10,7 +10,7 @@
npm -v
npm config set registry https://registry.npm.taobao.org
npm install
-npm run build
+npm run build-test
image_version=$version;
# 删除镜像
docker rmi -f $(
diff --git a/src/config/appId.js b/src/config/appId.js
index d493db1..3543f08 100644
--- a/src/config/appId.js
+++ b/src/config/appId.js
@@ -1,3 +1,3 @@
// 微信公众号AppId
-const AppId = process.env.NODE_ENV === 'test' ? 'wx23f697736154110b' : 'wx5e26f0813859e5f6';
+const AppId = process.env.NODE_ENV === 'production' ? 'wx23f697736154110b' : 'wx5e26f0813859e5f6';
export default AppId;
diff --git a/src/config/env.development.js b/src/config/env.development.js
index cff186b..659756d 100644
--- a/src/config/env.development.js
+++ b/src/config/env.development.js
@@ -4,6 +4,5 @@ module.exports = {
baseUrl: 'https://id.ssjlai.com/webapi', // 项目地址
baseApi: 'https://id.ssjlai.com/webapi', // 本地api请求地址,注意:如果你使用了代理,请设置成'/'
APPID: 'xxx',
- APPSECRET: 'xxx',
- $cdn: 'https://www.sunniejs.cn/static'
+ APPSECRET: 'xxx'
};
diff --git a/src/config/env.production.js b/src/config/env.production.js
index dcda6da..c79fba3 100644
--- a/src/config/env.production.js
+++ b/src/config/env.production.js
@@ -4,6 +4,5 @@ module.exports = {
baseUrl: 'https://id.ssjlai.com/webapi', // 正式项目地址
baseApi: 'https://id.ssjlai.com/webapi', // 正式api请求地址
APPID: 'xxx',
- APPSECRET: 'xxx',
- $cdn: 'https://www.sunniejs.cn/static'
+ APPSECRET: 'xxx'
};
diff --git a/src/config/env.test.js b/src/config/env.testing.js
similarity index 76%
rename from src/config/env.test.js
rename to src/config/env.testing.js
index ab8dbcd..7e310d9 100644
--- a/src/config/env.test.js
+++ b/src/config/env.testing.js
@@ -3,6 +3,5 @@ module.exports = {
baseUrl: 'https://id.ssjlai.com/webapi', // 测试项目地址
baseApi: 'https://id.ssjlai.com/webapi', // 测试api请求地址
APPID: 'xxx',
- APPSECRET: 'xxx',
- $cdn: 'https://www.sunniejs.cn/static'
+ APPSECRET: 'xxx'
};
diff --git a/src/config/models.js b/src/config/models.js
index 792bf1f..7daa88b 100644
--- a/src/config/models.js
+++ b/src/config/models.js
@@ -128,4 +128,4 @@ export const EmotionModel = {
//心理健康相关接口地址
export const PsyBaseUrl =
- process.env.NODE_ENV === 'test' ? 'https://dbmq.rzliot.com/auth_heart' : 'https://dbmq.rzliot.com/heart';
+ process.env.NODE_ENV === 'production' ? 'https://dbmq.rzliot.com/auth_heart' : 'https://dbmq.rzliot.com/heart';
diff --git a/src/main.js b/src/main.js
index 17b3398..4dceb70 100644
--- a/src/main.js
+++ b/src/main.js
@@ -8,9 +8,6 @@ import App from './App.vue';
import router from './router';
import store from './store/index';
import request from './config/request';
-// 设置 js中可以访问 $cdn
-import { $cdn } from '@/config';
-Vue.prototype.$cdn = $cdn;
import dayjs from 'dayjs';
import own from '@/common/own.js';
// 引入echarts
diff --git a/src/router/router.config.js b/src/router/router.config.js
index bf0b071..51070f5 100644
--- a/src/router/router.config.js
+++ b/src/router/router.config.js
@@ -278,6 +278,12 @@ export const constantRouterMap = [
component: () => import('@/views/today/report'),
meta: { title: '心理监测周报', keepAlive: false }
},
+ {
+ path: '/monthReport',
+ name: 'monthReport',
+ component: () => import('@/views/insight/monthReport'),
+ meta: { title: '心理监测月报', keepAlive: false }
+ },
{
path: '/experts',
name: 'experts',
diff --git a/src/views/insight/index.vue b/src/views/insight/index.vue
index d03eb89..6d16e27 100644
--- a/src/views/insight/index.vue
+++ b/src/views/insight/index.vue
@@ -17,7 +17,7 @@
@@ -54,7 +54,7 @@
@@ -793,7 +793,7 @@ export default {
},
onRouterTo(name) {
this.$router.push({
- name: 'report',
+ name: name === 'emo' ? 'report' : 'monthReport',
query: {
name: name
}
diff --git a/src/views/insight/monthReport.vue b/src/views/insight/monthReport.vue
new file mode 100644
index 0000000..3544b37
--- /dev/null
+++ b/src/views/insight/monthReport.vue
@@ -0,0 +1,1258 @@
+
+
+
+
+
+
+
+
+
2023-11-15~2023-11-22
+
+
+
+
+
+
+
+
+
今日{{ pieTitle }}趋势
+
+ 检测次数:15次
+
+
+
+
+
+
+
+
+
+
+
+
{{ item.text || '--' }}
+
+
+
+ {{ item.count ? item.count + '次' : '0次' }}
+
+
+
+
+
![]()
+
{{
+ calcImg(item.percentage, item.lastPercentage, true)
+ ? Math.abs(calcImg(item.percentage, item.lastPercentage, true)) + '%'
+ : '持平'
+ }}
+
+
+
+
+
+
+
+
+
+ {{ item.label || '--' }}
+
+
+
+ {{ item.value || '--' }}
+
+
+
+ {{ item.time || '--' }}
+
+
+
+
+
+
+
+
+
+
+
运动步数
+
+
+
+
+
+
+
![]()
+
923
+
+
+
+
+
+
![]()
+
923
+
+
+
+
+
+
+
+
+
健康建议
+
+
若要健,天天练,运动是健康的源泉
+
+
+
+
+
+ 5
+ 天
+
+
{{ item.name }}
+
+
+
+
热量消耗
+
+
+
+
+
+
+
![]()
+
923
+
+
+
+
+
+
![]()
+
923
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/today/emotionDetails.vue b/src/views/today/emotionDetails.vue
index c3692f5..98660ce 100644
--- a/src/views/today/emotionDetails.vue
+++ b/src/views/today/emotionDetails.vue
@@ -1370,7 +1370,7 @@ export default {
getWeekResult() {
this.$toast.loading('数据加载中');
let baseUrl =
- process.env.NODE_ENV === 'test' ? 'https://dbmq.rzliot.com/auth_heart' : 'https://dbmq.rzliot.com/heart';
+ process.env.NODE_ENV === 'production' ? 'https://dbmq.rzliot.com/auth_heart' : 'https://dbmq.rzliot.com/heart';
let reqUrl = `${baseUrl}/api/Data/GetWeekResult`;
let reqParams = {
uid: this.uid /* '2023101521270090082 */,
diff --git a/src/views/today/report.vue b/src/views/today/report.vue
index aad1d45..fb82907 100644
--- a/src/views/today/report.vue
+++ b/src/views/today/report.vue
@@ -645,7 +645,7 @@ export default {
getWeekResultDetail() {
this.$toast.loading('数据加载中');
let baseUrl =
- process.env.NODE_ENV === 'test' ? 'https://dbmq.rzliot.com/auth_heart' : 'https://dbmq.rzliot.com/heart';
+ process.env.NODE_ENV === 'production' ? 'https://dbmq.rzliot.com/auth_heart' : 'https://dbmq.rzliot.com/heart';
let reqUrl = `${baseUrl}/api/Data/GetWeekResultDetail`;
let reqParams = {
recordId: /* this.params.recordId */ '1728096156447281486'
diff --git a/vue.config.js b/vue.config.js
index 687e4fe..58ab939 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,47 +1,18 @@
const path = require('path');
const defaultSettings = require('./src/config/index.js');
-const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
+/* const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; */
const resolve = dir => path.join(__dirname, dir);
// page title
-const name = defaultSettings.title || '';
+const name = defaultSettings.title || 'health-student';
// 生产环境,测试和正式
-const IS_PROD = ['test'].includes(process.env.NODE_ENV);
+const IS_PROD = ['production', 'test'].includes(process.env.NODE_ENV);
const { defineConfig } = require('@vue/cli-service');
-// externals
-// const externals = {
-// vue: 'Vue',
-// 'vue-router': 'VueRouter',
-// vuex: 'Vuex',
-// vant: 'vant',
-// axios: 'axios'
-// }
-// CDN外链,会插入到index.html中
-// const cdn = {
-// // 开发环境
-// dev: {
-// css: [],
-// js: []
-// },
-// // 生产环境
-// build: {
-// css: ['https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.css'],
-// js: [
-// 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
-// 'https://cdn.jsdelivr.net/npm/vue-router@3.1.5/dist/vue-router.min.js',
-// 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js',
-// 'https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js',
-// 'https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.min.js'
-// ]
-// }
-// }
-
module.exports = defineConfig({
publicPath: './', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/app/', //署应用包时的基本 URL。 vue-router history模式使用
outputDir: 'dist', // 生产环境构建文件的目录
- assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录
lintOnSave: !IS_PROD,
productionSourceMap: false, // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer: {
@@ -67,7 +38,7 @@ module.exports = defineConfig({
// }
},
css: {
- extract: IS_PROD, // 是否将组件中的 CSS 提取至一个独立的 CSS 文件中 (而不是动态注入到 JavaScript 中的 inline 代码)。
+ extract: true, // 是否将组件中的 CSS 提取至一个独立的 CSS 文件中 (而不是动态注入到 JavaScript 中的 inline 代码)。
sourceMap: false,
loaderOptions: {
scss: {
@@ -76,7 +47,6 @@ module.exports = defineConfig({
additionalData: `
@import "assets/css/mixin.scss";
@import "assets/css/variables.scss";
- $cdn: "${defaultSettings.$cdn}";
`
}
}
@@ -85,16 +55,9 @@ module.exports = defineConfig({
config.name = name;
// 为生产环境修改配置...
- // if (IS_PROD) {
- // // externals
- // config.externals = externals
- // }
},
chainWebpack: config => {
- /* config.plugins.delete('preload');
- config.plugins.delete('prefetch'); */
-
// 别名 alias
config.resolve.alias
.set('@', resolve('src'))
@@ -102,19 +65,6 @@ module.exports = defineConfig({
.set('api', resolve('src/api'))
.set('views', resolve('src/views'))
.set('components', resolve('src/components'));
-
- /**
- * 添加CDN参数到htmlWebpackPlugin配置中
- */
- // config.plugin('html').tap(args => {
- // if (IS_PROD) {
- // args[0].cdn = cdn.build
- // } else {
- // args[0].cdn = cdn.dev
- // }
- // return args
- // })
-
/**
* 设置保留空格
*/
@@ -131,16 +81,15 @@ module.exports = defineConfig({
* 打包分析
*/
if (IS_PROD) {
- config.plugin('webpack-report').use(BundleAnalyzerPlugin, [
+ /* config.plugin('webpack-report').use(BundleAnalyzerPlugin, [
{
analyzerMode: 'static'
}
- ]);
+ ]); */
}
config
// https://webpack.js.org/configuration/devtool/#development
.when(!IS_PROD, config => config.devtool('cheap-source-map'));
-
config.when(IS_PROD, config => {
config.optimization.splitChunks({
chunks: 'all',