فهرست منبع

工业工程、市政工程页面首次进入根据url直接获取type

吕宣芝 1 سال پیش
والد
کامیت
96fcc06320
2فایلهای تغییر یافته به همراه12 افزوده شده و 15 حذف شده
  1. 10 2
      src/api/zdsz/engineeringIndustry.js
  2. 2 13
      src/views/zdsz/engineeringIndustry/index.vue

+ 10 - 2
src/api/zdsz/engineeringIndustry.js

@@ -1,6 +1,14 @@
-import request from "@/utils/request";
+import request from '@/utils/request'
 
-export function getEngineeIndustryList({type, enginType ='',}) {
+// 根据url直接获取type
+function getTypeFromUrl(url) {
+  // 使用正则表达式或其他方法从 URL 中提取 type 参数
+  const params = new URLSearchParams(url.split('?')[1]);
+  return params.get('type');
+}
+
+export function getEngineeIndustryList({enginType ='',}) {
+  const type = getTypeFromUrl(window.location.href);
   return request({
     url: `/zdsz/engineeringIndustry/list?type=${type}&enginType=${enginType}`,
     method: 'get',

+ 2 - 13
src/views/zdsz/engineeringIndustry/index.vue

@@ -274,7 +274,6 @@
         DelEngineeEngineeIndustry                          // 删除工程
       } from "@/api/zdsz/engineeringIndustry"
       import EngineePipe from "@/components/EngineePipe"
-      import {addEnginee} from "@/api/zdsz/enginee";
 
       export default {
         name: "openrepair",
@@ -283,17 +282,6 @@
           EngineePipe
         },
         data() {
-            var validatePass = (rule, value, callback) => {
-                console.log('校验值', value)
-                if (value === '') {
-                    callback(new Error('请输入密码'));
-                } else {
-                if (this.ruleForm.checkPass !== '') {
-                    this.$refs.ruleForm.validateField('checkPass');
-                }
-                    callback();
-                }
-            };
           return {
             // 按钮loading
             buttonLoading: false,
@@ -499,7 +487,8 @@
           // 新增顶管工程
           addNewPipe(data){
             this.$refs.enginPipe.openDialog({
-              id:data.id,type:'工业工程'
+              id:data.id,
+              type:(this.form.type === '1' ? "工业工程":"市政工程")
             },'add')
           },
           nodeCancel(){