14 Commits 61698e6f20 ... 7fbf15c623

Autor SHA1 Mensagem Data
  sunxiao 7fbf15c623 feat: 调整数据资产 2 semanas atrás
  sunxiao 0fd5fff4b0 Merge commit '98438c584ee4d3a6ce39ef854cd3f2d17d415765' into dataAsset 2 semanas atrás
  sunxiao e2cf38dc0e Merge branch '2024-10-24/fetaure-AES' into dataAsset 2 semanas atrás
  sunxiao 98438c584e feat: 退出登录问题修改 3 semanas atrás
  sunxiao 3c15b84cf6 Merge branch '2024-10-24/fetaure-AES' 3 semanas atrás
  sunxiao 70294c7751 feat: 登录问题修改 3 semanas atrás
  sunxiao 1d7e73658e feat: 变更日报请求地址 3 semanas atrás
  sunxiao 84e4e9593e feat: 调整项目配置 1 mês atrás
  sunxiao 14d346221a feat: 新增密码加密 1 mês atrás
  sunxiao bd46ce1f38 还原配置 2 meses atrás
  sunxiao 05efa0b8e8 feat: 修改预测取值,最后一位是null的原因 2 meses atrás
  sunxiao 35abc9b8d9 feat: 修改预测数值截取 2 meses atrás
  sunxiao fc39936151 feat: 预测效果增加4个选项 2 meses atrás
  sunxiao 0f80aaf936 feat: 预测效果增加点位显示 2 meses atrás

+ 4 - 3
.env.development

@@ -5,7 +5,8 @@ VITE_APP_TITLE = 数据资产管理系统
 VITE_APP_ENV = 'development'
 
 # 管理系统/开发环境
-VITE_APP_BASE_API =  http://10.0.0.28:8080/
+VITE_APP_BASE_API =  'http://192.168.40.21:8080/'
+# VITE_APP_BASE_API = 'http://192.168.9.54:8080/'
 
-VITE_APP_BASE_TEST = http://10.0.0.28:8080/
-VITE_APP_BASE_PROD = http://192.168.9.54:8080/
+VITE_APP_BASE_TEST = http://192.168.40.21:8080/
+VITE_APP_BASE_PROD = http://192.168.40.18:8080/

+ 3 - 3
.env.production

@@ -5,10 +5,10 @@ VITE_APP_TITLE = 数据资产管理系统
 VITE_APP_ENV = 'production'
 
 # 管理系统/生产环境
-VITE_APP_BASE_API = 'http://192.168.9.54:8080/'
+VITE_APP_BASE_API =  'http://192.168.40.18:8080/'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VITE_BUILD_COMPRESS = gzip
 
-VITE_APP_BASE_TEST = http://10.0.0.28:8080/
-VITE_APP_BASE_PROD = http://192.168.9.54:8080/
+VITE_APP_BASE_TEST = http://192.168.40.21:8080/
+VITE_APP_BASE_PROD = http://192.168.40.18:8080/

+ 4 - 3
.env.test

@@ -3,9 +3,10 @@ VITE_APP_TITLE = 数据资产管理系统
 
 # 开发环境配置
 VITE_APP_ENV = 'development'
+VITE_APP_BASE_API = ''
 
 # 管理系统/开发环境
-VITE_APP_BASE_API = http://10.0.0.28:8080/
+VITE_APP_BASE_API = http://192.168.40.21:8080/
 
-VITE_APP_BASE_TEST = http://10.0.0.28:8080/
-VITE_APP_BASE_PROD = http://192.168.9.54:8080/
+VITE_APP_BASE_TEST = http://192.168.40.21:8080/
+VITE_APP_BASE_PROD = http://192.168.40.18:8080/

+ 6 - 6
deploy/config.js

@@ -4,23 +4,23 @@ export const config = [
     nodeEnv: "test",
     name: "测试环境",
     domain: "",
-    host: "10.0.0.28",
+    host: "192.168.40.21",
     port: "22",
     username: "root",
     password: "hsmysql",
-    path: "/data/node_web/modelAdmin",
-    removepath: "/data/node_web/modelAdmin"
+    path: "/usr/share/nginx/admin-html",
+    removepath: "/usr/share/nginx/admin-html"
   },
   {
     id: 1,
     nodeEnv: "prod",
     name: "生产环境",
     domain: "",
-    host: "192.168.9.54",
+    host: "192.168.40.18",
     port: "22",
     username: "root",
     password: "admin1,xxh",
-    path: "/data/node_web/modelAdmin",
-    removepath: "/data/node_web/modelAdmin"
+    path: "/data/node_web/big_model_admin",
+    removepath: "/data/node_web/big_model_admin"
   },
 ];

+ 4 - 3
deploy/index.js

@@ -93,10 +93,11 @@ const connectShell = async () => {
       spinner.stop();
 
       // if (filterStage === 'prod') {
-      execRemoteCommand()
+      // execRemoteCommand()
       // }
-
-      printMsg({ color: 'green', text: '上传完成,准备指令中' });
+      
+      printMsg({ color: 'green', text: '部署完成' });
+      // printMsg({ color: 'green', text: '上传完成,准备指令中' });
       sftp.end();
     })
     .catch((err) => {

+ 1 - 0
package.json

@@ -24,6 +24,7 @@
     "@vueup/vue-quill": "1.2.0",
     "@vueuse/core": "10.6.1",
     "axios": "0.27.2",
+    "crypto-js": "^4.2.0",
     "echarts": "^5.5.0",
     "element-plus": "2.4.3",
     "file-saver": "2.0.5",

+ 1 - 1
src/layout/components/Navbar.vue

@@ -92,7 +92,7 @@ function logout() {
     type: 'warning'
   }).then(() => {
     userStore.logOut().then(() => {
-      location.href = '/index';
+      location.href = '/admin/';
     })
   }).catch(() => { });
 }

+ 12 - 1
src/store/modules/user.js

@@ -1,6 +1,17 @@
 import { login, logout, getInfo } from '@/api/login'
 import { getToken, setToken, removeToken } from '@/utils/auth'
 import defAva from '@/assets/images/profile.jpg'
+import CryptoJS from 'crypto-js';
+
+const SECRET_KEY = 'qwertasdfg159753'
+function AES_ECB_ENCRYPT(text) {
+  var keyHex = CryptoJS.enc.Utf8.parse(SECRET_KEY);
+  var messageHex = CryptoJS.enc.Utf8.parse(text);
+  var encrypted = CryptoJS.AES.encrypt(messageHex, keyHex, {
+    "mode": CryptoJS.mode.ECB
+  });
+  return encrypted.toString();
+}
 
 const useUserStore = defineStore(
   'user',
@@ -17,7 +28,7 @@ const useUserStore = defineStore(
       // 登录
       login(userInfo) {
         const username = userInfo.username.trim()
-        const password = userInfo.password
+        const password = AES_ECB_ENCRYPT(userInfo.password)
         const code = userInfo.code
         const uuid = userInfo.uuid
         return new Promise((resolve, reject) => {

+ 40 - 8
src/views/business/comparison/components/echartConfig.js

@@ -1,18 +1,48 @@
-export const getEchartLineOption = ({ xAxisData, echartData }) => {
-  const series = echartData.map(({ name, val: data }) => ({
+export const getEchartLineOption = ({ xAxisData, echartData, specificData }) => {
+  const colors = ["#5B8FF9", "#82c370", "#ffbf59"];
+  const series = echartData.map(({ name, val: data }, index) => ({
     name,
     data,
     type: "line",
     showSymbol: false,
+    lineStyle: {
+      width: 2,
+      color: colors[index],
+    },
     smooth: true,
+    xAxisIndex: 0,
   }));
 
+  series.push({
+    tooltip: {
+      show: false
+    },
+    type: "line",
+    symbolSize: 8,
+    itemStyle: {
+      color: "red",
+    },
+    itemStyle: {
+      color: colors[0],
+    },
+    xAxisIndex: 0,
+    data: specificData,
+  });
+
   const option = {
+    dataZoom: [{
+      bottom: 10,
+      height: 20,
+      show: true,
+      start: 0,
+      end: 100,
+      xAxisIndex: [0],
+    }],
     grid: {
       left: "5%",
       top: "2%",
       right: "12%",
-      bottom: "2%",
+      bottom: 30,
       containLabel: true,
     },
     legend: {
@@ -39,11 +69,13 @@ export const getEchartLineOption = ({ xAxisData, echartData }) => {
     tooltip: {
       trigger: "axis",
     },
-    xAxis: {
-      type: "category",
-      boundaryGap: false,
-      data: xAxisData,
-    },
+    xAxis: [
+      {
+        type: "category",
+        boundaryGap: false,
+        data: xAxisData,
+      },
+    ],
     yAxis: {
       type: "value",
     },

+ 35 - 14
src/views/business/comparison/index.vue

@@ -188,7 +188,11 @@ export default {
         { label: "PO₄³⁻ ", value: 'zlsy' },
         { label: "NH₃-N ", value: 'nh3' },
         { label: "COD ", value: 'cod' },
-        { label: "SS ", value: 'ss' }
+        { label: "SS ", value: 'ss' },
+        { label: "#1缺氧硝酸盐 ", value: 'qyxsy1' },
+        { label: "#2缺氧硝酸盐 ", value: 'qyxsy2' },
+        { label: "#1缺氧氨氮 ", value: 'qynh31' },
+        { label: "#2缺氧氨氮 ", value: 'qynh32' }
       ],
       // 查询参数
       queryParams: {
@@ -244,17 +248,28 @@ export default {
       }
       
       const data = await getEchartData({ category: this.activeItem.value, timeBegin, timeEnd });
-      console.log(data);
+      
+      Object.keys(data).forEach(key => {
+        const len = data[key].data.length;
+        console.log( data[key].data[len - 1] );
+        if ( !data[key].data[len - 1] ) {
+          data[key].data.pop()
+        }
+      })
+
+      const reusltData = data.hs.data.splice(data.real.data.length, data.hs.data.length - data.real.data.length);
+      // const reusltTime = data.hs.time.splice(data.real.time.length, data.hs.time.length - data.real.time.length);
+      // console.log( reusltData, reusltTime );
       let xAxisData = [];
-      const realOneList = [];
-      const realTwoList = [];
-      const realThreeList = [];
-      const hsForecastOneList = [];
-      const hsForecastTwoList = [];
-      const hsForecastThreeList = [];
-      const yyForecastOneList = [];
-      const yyForecastTwoList = [];
-      const yyForecastThreeList = [];
+      // const realOneList = [];
+      // const realTwoList = [];
+      // const realThreeList = [];
+      // const hsForecastOneList = [];
+      // const hsForecastTwoList = [];
+      // const hsForecastThreeList = [];
+      // const yyForecastOneList = [];
+      // const yyForecastTwoList = [];
+      // const yyForecastThreeList = [];
 
       // data.map(item => {
       //   const {
@@ -275,10 +290,10 @@ export default {
       //   yyForecastThreeList.push(yyForecastThree);
       // })
     
-      xAxisData = data.yy.time
+      xAxisData = [...data.yy.time];
 
       const echartData = [
-        { name: 'TFT', val: data.hs.data },
+        { name: 'TFT', val: [...data.hs.data, ...reusltData] },
         { name: '真实值', val: data.real.data },
         { name: 'LSTM', val: data.yy.data },
         // { name: 'TFTpre_1', val: hsForecastOneList },
@@ -289,7 +304,9 @@ export default {
         // { name: 'LSTMpre_3', val: yyForecastThreeList }
       ]
 
-      const option = getEchartLineOption({ xAxisData, echartData });
+      const specificData = new Array(data.hs.data.length).fill(null).concat( reusltData );
+
+      const option = getEchartLineOption({ xAxisData, echartData, specificData:specificData });
 
       echart.setOption(option);
 
@@ -356,6 +373,10 @@ export default {
           nh3: 'NH₃',
           cod: 'COD',
           ss: 'SS',
+          qyxsy1: '#1缺氧硝酸盐',
+          qyxsy2: '#2缺氧硝酸盐',
+          qynh31: '#1缺氧氨氮',
+          qynh32: '#2缺氧氨氮'
         }
         this.comparisonList = response.rows.map(item => ({ ...item, category: whiteList[item.category] }));
         this.total = response.total;

+ 1 - 1
src/views/daily/index.vue

@@ -47,7 +47,7 @@ const onSubmit = async () => {
       proxy.$modal.confirm('是否确认提交?').then(async () => {
 
         const dateTime = holidays.value.find(({ testDate: day }) => day === unref(testDate));
-
+        
         await postDaily({
           id: dateTime?.id,
           testDate: unref(testDate),

+ 2 - 2
src/views/login.vue

@@ -74,8 +74,8 @@ const router = useRouter();
 const { proxy } = getCurrentInstance();
 
 const loginForm = ref({
-  username: "admin",
-  password: "admin123",
+  username: "",
+  password: "",
   rememberMe: false,
   code: "",
   uuid: ""

+ 2 - 1
vite.config.js

@@ -8,10 +8,11 @@ export default defineConfig(({ mode, command }) => {
   const env = loadEnv(mode, process.cwd())
   const { VITE_APP_ENV } = env
   return {
+    // publicPath: '/admin/',
     // 部署生产环境和开发环境下的URL。
     // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
     // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
-    base: VITE_APP_ENV === 'production' ? './' : '/',
+    base: VITE_APP_ENV === 'production' ? '/sjzc/' : '/sjzc/',
     plugins: createVitePlugins(env, command === 'build'),
     resolve: {
       // https://cn.vitejs.dev/config/#resolve-alias