焊接日报
This commit is contained in:
+3
-1
@@ -22,6 +22,7 @@ export const defaultApps = [{
|
||||
name: '试压管理',
|
||||
icon: 'shiyabao',
|
||||
menuId: '55976B16-2C33-406E-B514-2FE42D031071',
|
||||
path: '/pipe/pressure/index',
|
||||
prefix: 'nbd-icon',
|
||||
selected: false
|
||||
},
|
||||
@@ -29,6 +30,7 @@ export const defaultApps = [{
|
||||
name: '包装管理',
|
||||
icon: 'baozhuangguanli',
|
||||
menuId: "25DED954-10C9-47CC-99F2-C44FDE9E0A81",
|
||||
path: "/pipe/packaging/list",
|
||||
prefix: 'nbd-icon',
|
||||
selected: false
|
||||
},
|
||||
@@ -46,4 +48,4 @@ export const defaultApps = [{
|
||||
prefix: 'nbd-icon',
|
||||
selected: false
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
+22
-2
@@ -137,11 +137,31 @@ export function request(options) {
|
||||
}
|
||||
|
||||
// GET 快捷方法
|
||||
export function get(url, params = {}) {
|
||||
export const get = (url, params = {}) => {
|
||||
return request({ url, method: 'GET', data: params })
|
||||
}
|
||||
|
||||
// POST 快捷方法
|
||||
export function post(url, data = {}) {
|
||||
export const post = (url, data = {}) => {
|
||||
return request({ url, method: 'POST', data })
|
||||
}
|
||||
|
||||
|
||||
export const getUrlParam = (url, name) => {
|
||||
if (!url || !name) return null;
|
||||
|
||||
// 构造正则:匹配 ?name= 或 &name= 后面的值
|
||||
// [?&] : 匹配起始分隔符
|
||||
// ${name}: 匹配具体的参数名
|
||||
// = : 匹配等号
|
||||
// ([^&]*) : 捕获组,匹配直到下一个 & 或字符串结束的内容
|
||||
const regex = new RegExp(`[?&]${name}=([^&]*)`, 'i'); // 'i' 表示忽略大小写
|
||||
|
||||
const match = url.match(regex);
|
||||
|
||||
if (match && match[1]) {
|
||||
return decodeURIComponent(match[1]);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
import {getUrlParam} from './request'
|
||||
export const scanToSkipUrl = (str)=>{
|
||||
// 焊接日报跳转
|
||||
if(str.includes('weldjoint')){
|
||||
return `/pipe/weld/daily_paper?id=${getUrlParam(str,"id")}`
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user