Browse Source

Merge branch 'feat' into test

test
chenJinxu 1 year ago
parent
commit
540201d3c0
18 changed files with 1287 additions and 87 deletions
  1. +0
    -4
      .env.development
  2. +0
    -4
      .env.production
  3. +0
    -4
      .env.test
  4. +5
    -0
      README.md
  5. +1
    -1
      package.json
  6. +1
    -1
      setup_test.sh
  7. +1
    -1
      src/config/appId.js
  8. +1
    -2
      src/config/env.development.js
  9. +1
    -2
      src/config/env.production.js
  10. +1
    -2
      src/config/env.testing.js
  11. +1
    -1
      src/config/models.js
  12. +0
    -3
      src/main.js
  13. +6
    -0
      src/router/router.config.js
  14. +3
    -3
      src/views/insight/index.vue
  15. +1258
    -0
      src/views/insight/monthReport.vue
  16. +1
    -1
      src/views/today/emotionDetails.vue
  17. +1
    -1
      src/views/today/report.vue
  18. +6
    -57
      vue.config.js

+ 0
- 4
.env.development View File

@@ -1,4 +0,0 @@
NODE_ENV='development'
# must start with VUE_APP_
VUE_APP_ENV = 'development'

+ 0
- 4
.env.production View File

@@ -1,4 +0,0 @@
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'production'

+ 0
- 4
.env.test View File

@@ -1,4 +0,0 @@
NODE_ENV='test'
# must start with VUE_APP_
VUE_APP_ENV = 'test'

+ 5
- 0
README.md View File

@@ -56,3 +56,8 @@ npm run lint
`2023年12月21日` FETURE

- 增加 情绪,情绪周报和体征详情页面

`2023年12月25日` UPDATE

- 修改 测试环境部署文件
- 增加 洞悉 月报详情页面

+ 1
- 1
package.json View File

@@ -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",


+ 1
- 1
setup_test.sh View File

@@ -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 $(


+ 1
- 1
src/config/appId.js View File

@@ -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;

+ 1
- 2
src/config/env.development.js View File

@@ -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'
};

+ 1
- 2
src/config/env.production.js View File

@@ -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'
};

src/config/env.test.js → src/config/env.testing.js View File

@@ -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'
};

+ 1
- 1
src/config/models.js View File

@@ -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';

+ 0
- 3
src/main.js View File

@@ -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


+ 6
- 0
src/router/router.config.js View File

@@ -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',


+ 3
- 3
src/views/insight/index.vue View File

@@ -17,7 +17,7 @@
<div class="label">
<div class="left">情绪感知</div>
<div class="right">
<span @click="onRouterTo()">详情 ></span>
<span @click="onRouterTo('emo')">详情 ></span>
</div>
</div>
<div class="periodNav">
@@ -54,7 +54,7 @@
<div class="label">
<div class="left">体征感知</div>
<div class="right">
<span>详情 ></span>
<span @click="onRouterTo('signs')">详情 ></span>
</div>
</div>

@@ -793,7 +793,7 @@ export default {
},
onRouterTo(name) {
this.$router.push({
name: 'report',
name: name === 'emo' ? 'report' : 'monthReport',
query: {
name: name
}


+ 1258
- 0
src/views/insight/monthReport.vue
File diff suppressed because it is too large
View File


+ 1
- 1
src/views/today/emotionDetails.vue View File

@@ -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 */,


+ 1
- 1
src/views/today/report.vue View File

@@ -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'


+ 6
- 57
vue.config.js View File

@@ -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',


Loading…
Cancel
Save