Browse Source

feat: 登录页增redirect跳转

sunxiao 2 weeks ago
parent
commit
72c4284176
2 changed files with 17 additions and 8 deletions
  1. 9 0
      src/views/login.vue
  2. 8 8
      src/views/report/components/RecordDrawer.vue

+ 9 - 0
src/views/login.vue

@@ -32,9 +32,18 @@ function handleLogin() {
         const otherQueryParams = Object.keys(query).reduce((acc, cur) => {
           if (cur !== "redirect") {
             acc[cur] = query[cur];
+          } 
+          if (cur === "redirect" && redirect.value.includes('?') ) {
+            const [path, queryString] = redirect.value.split('?');
+            const query = queryString 
+              ? Object.fromEntries(new URLSearchParams(queryString))
+              : {};
+
+            return query;
           }
           return acc;
         }, {});
+
         router.push({ path: redirect.value || "/", query: otherQueryParams });
       }).catch(() => {
         loading.value = false;

+ 8 - 8
src/views/report/components/RecordDrawer.vue

@@ -40,7 +40,7 @@ const columns = [
   {
     label: '高COD',
     children: [
-      { label: "标称值", prop: 'highCodStandardVal', width: 100 },
+      { label: "质控值", prop: 'highCodStandardVal', width: 100 },
       { label: "化验值", prop: 'highCodResultConcentration', width: 100 },
       { label: "偏差度", prop: 'highCodDeviationRate', width: 100 }
     ]
@@ -48,7 +48,7 @@ const columns = [
   {
     label: '低COD',
     children: [
-      { label: "标称值", prop: 'lowCodStandardVal', width: 100 },
+      { label: "质控值", prop: 'lowCodStandardVal', width: 100 },
       { label: "化验值", prop: 'lowCodResultConcentration', width: 100 },
       { label: "偏差度", prop: 'lowCodDeviationRate', width: 100 }
     ]
@@ -56,7 +56,7 @@ const columns = [
   {
     label: '氨氮',
     children: [
-      { label: "标称值", prop: 'anDanStandardVal', width: 100 },
+      { label: "质控值", prop: 'anDanStandardVal', width: 100 },
       { label: "化验值", prop: 'anDanResultConcentration', width: 100 },
       { label: "偏差度", prop: 'anDanDeviationRate', width: 100 }
     ]
@@ -64,7 +64,7 @@ const columns = [
   {
     label: '总氮',
     children: [
-      { label: "标称值", prop: 'tnStandardVal', width: 100 },
+      { label: "质控值", prop: 'tnStandardVal', width: 100 },
       { label: "化验值", prop: 'tnResultConcentration', width: 100 },
       { label: "偏差度", prop: 'tnDeviationRate', width: 100 }
     ]
@@ -72,7 +72,7 @@ const columns = [
   {
     label: '总磷',
     children: [
-      { label: "标称值", prop: 'tpStandardVal', width: 100 },
+      { label: "质控值", prop: 'tpStandardVal', width: 100 },
       { label: "化验值", prop: 'tpResultConcentration', width: 100 },
       { label: "偏差度", prop: 'tpDeviationRate', width: 100 }
     ]
@@ -80,7 +80,7 @@ const columns = [
   {
     label: '硝酸盐氮',
     children: [
-      { label: "标称值", prop: 'name', width: 100 },
+      { label: "质控值", prop: 'name', width: 100 },
       { label: "化验值", prop: 'name', width: 100 },
       { label: "偏差度", prop: 'name', width: 100 }
     ]
@@ -88,7 +88,7 @@ const columns = [
   {
     label: '亚硝酸盐',
     children: [
-      { label: "标称值", prop: 'xsydStandardVal', width: 100 },
+      { label: "质控值", prop: 'xsydStandardVal', width: 100 },
       { label: "化验值", prop: 'xsydResultConcentration', width: 100 },
       { label: "偏差度", prop: 'xsydDeviationRate', width: 100 }
     ]
@@ -96,7 +96,7 @@ const columns = [
   {
     label: '正磷酸盐',
     children: [
-      { label: "标称值", prop: 'yxsyStandardVal', width: 100 },
+      { label: "质控值", prop: 'yxsyStandardVal', width: 100 },
       { label: "化验值", prop: 'yxsyResultConcentration', width: 100 },
       { label: "偏差度", prop: 'yxsyDeviationRate', width: 100 }
     ]