Commit 46004cbb by 李伟康

refactor(router): 重构移动端路由配置并调整组件结构

- 修改移动端路由路径配置,新增完整的页面路径定义
- 更新路由匹配逻辑,支持自定义路径映射到组件
- 移动端组件迁移至子目录结构,优化代码组织
- 配置中心URL更新,指向正确的模块配置地址
- PostCSS配置扩展选择器黑名单,添加正则表达式过滤规则
- 客户端API新增报表数据获取接口方法
- 移除冗余的诊断报告空页面文件
1 parent 84cbd7e9
...@@ -13,7 +13,7 @@ module.exports = ({file}) => { ...@@ -13,7 +13,7 @@ module.exports = ({file}) => {
viewportWidth: 375, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750 viewportWidth: 375, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750
unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除) unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw
selectorBlackList: ['.ignore', '.hairlines', 'ign-','pc-'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名 selectorBlackList: ['.ignore', '.hairlines', 'ign-','pc-', /shrink/, /flex-/], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值 minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值
mediaQuery: false, // 允许在媒体查询中转换`px` mediaQuery: false, // 允许在媒体查询中转换`px`
......
...@@ -21,4 +21,8 @@ export default { ...@@ -21,4 +21,8 @@ export default {
data, data,
}) })
}, },
getReportData(id){
const {reportRequestUrl} = window.$fetchConfig
return window.fetch(`${reportRequestUrl}/api/recording/${id}`,{}).then(res => res.json())
}
} }
...@@ -15,7 +15,7 @@ export const fetchConfig = function (isEnv = true) { ...@@ -15,7 +15,7 @@ export const fetchConfig = function (isEnv = true) {
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(config) // return Promise.resolve(config)
// } // }
let url = 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=glsk-ai-data-assistant-config' let url = 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=glsk-ww-message-config'
return window.fetch(url, {}).then(res => res.json()) return window.fetch(url, {}).then(res => res.json())
} }
export const cfg = { export const cfg = {
......
...@@ -2,21 +2,24 @@ export const mobilePages = { ...@@ -2,21 +2,24 @@ export const mobilePages = {
mobile: [ mobile: [
{ {
name: 'customerFile', name: 'customerFile',
path: 'mobile/customerFile/index',
meta: { meta: {
noAuth: true noAuth: true
} }
}, },
{ {
name: 'diagnosisReport', name: 'diagnosisReport',
path: 'mobile/diagnosisReport/index',
meta: { meta: {
noAuth: true noAuth: true
} }
}, },
{ {
name:'customerFileSuccess', name:'customerFileSuccess',
path:'mobile/customerFile/customerFileSuccess',
meta: { meta: {
noAuth: true noAuth: true
} }
} }
] ]
} }
\ No newline at end of file \ No newline at end of file
...@@ -16,11 +16,12 @@ Object.keys(pages).map(parent => { ...@@ -16,11 +16,12 @@ Object.keys(pages).map(parent => {
pages[parent].map(val => { pages[parent].map(val => {
let childrenPath = `${parent}/${val.name}` let childrenPath = `${parent}/${val.name}`
let { meta } = val let { meta } = val
const path = val.path || `/${val.name == 'index' ? parent : childrenPath}` const path = val.path ? `/${val.path}` : `/${val.name == 'index' ? parent : childrenPath}`
const name = val.name == 'index' ? parent : val.name const name = val.name == 'index' ? parent : val.name
if (meta && meta.keepAlive) keepAlives.push(name) if (meta && meta.keepAlive) keepAlives.push(name)
let componentName =`${val.path ? val.path : childrenPath}`
let route = { let route = {
component: resolve => require([`views/${childrenPath}.vue`], resolve), component: resolve => require([`views/${componentName}.vue`], resolve),
path, path,
name, name,
meta meta
...@@ -28,7 +29,6 @@ Object.keys(pages).map(parent => { ...@@ -28,7 +29,6 @@ Object.keys(pages).map(parent => {
routes.push(route) routes.push(route)
}) })
}) })
export const keeps = keepAlives export const keeps = keepAlives
export default routes export default routes
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!