Browse Source

Merge branch 'master' into 'master'

跳转路径优化

See merge request lighter/vue-intergration-platform!29
huangshuhua 2 năm trước cách đây
mục cha
commit
3f20dd053a
1 tập tin đã thay đổi với 14 bổ sung1 xóa
  1. 14 1
      src/views/operate-monitoring/OperateMonitoringDate.vue

+ 14 - 1
src/views/operate-monitoring/OperateMonitoringDate.vue

@@ -54,8 +54,10 @@ const queryTerm = ref({})
 const kssj = ref('')
 const jssj = ref('')
 onMounted(() => {
+    let path = router.currentRoute.value.path
+    let _path = interceptStr(path, '/', 2)
     let val = router.options.routes.filter(e => e.path === '/operateMonitoring')[0].children;
-    let param = val.filter(f => f.path === 'inpatient/outHospital' || f.path === 'outpatient/outpatientDept')[0].params
+    let param = val.filter(f => f.path === _path)[0].params
     queryTerm.value = param
     kssj.value = start
     jssj.value = end
@@ -119,6 +121,17 @@ const reportFirstInfo = (row) => {
         reportFirst.value.params = clone(params)
     })
 }
+
+function interceptStr(str, ele, index) {
+    let num = str.indexOf(ele) + 1;
+    if (index <= 1) {
+        str = str.substring(num);
+        return str
+    };
+    str = str.substring(num);
+    index--;
+    return interceptStr(str, ele, index);
+}
 </script>
 <style scoped>
 .index_common {