import type { RouteRecordRaw } from 'vue-router' import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue' import XReport from '@af-mobile-client-vue3/components/data/XReportGrid/XReport.vue' import GridView from '@af-mobile-client-vue3/layout/GridView/index.vue' import Forbidden from '@af-mobile-client-vue3/views/common/Forbidden.vue' import NotFound from '@af-mobile-client-vue3/views/common/NotFound.vue' import EvaluateRecordView from '@af-mobile-client-vue3/views/component/EvaluateRecordView/index.vue' import FilePreview from '@af-mobile-client-vue3/views/component/FilePreviewView/index.vue' import IconifyView from '@af-mobile-client-vue3/views/component/IconifyView/index.vue' import ComponentView from '@af-mobile-client-vue3/views/component/index.vue' import MateChatView from '@af-mobile-client-vue3/views/component/MateChat/MateChatView.vue' import OtherChargeForm from '@af-mobile-client-vue3/views/component/OtherCharge/index.vue' import StepView from '@af-mobile-client-vue3/views/component/StepView/index.vue' import UserDetailView from '@af-mobile-client-vue3/views/component/UserDetailView/index.vue' import UserDetailPage from '@af-mobile-client-vue3/views/component/UserDetailView/UserDetailPage.vue' import XCellDetailView from '@af-mobile-client-vue3/views/component/XCellDetailView/index.vue' import XCellListView from '@af-mobile-client-vue3/views/component/XCellListView/index.vue' import XFormAppraiseView from '@af-mobile-client-vue3/views/component/XFormAppraiseView/index.vue' import XFormGroupView from '@af-mobile-client-vue3/views/component/XFormGroupView/index.vue' import XFormView from '@af-mobile-client-vue3/views/component/XFormView/index.vue' import XOlMapView from '@af-mobile-client-vue3/views/component/XOlMapView/index.vue' import XLocationPicker from '@af-mobile-client-vue3/views/component/XOlMapView/XLocationPicker/index.vue' import XReportFormIframeView from '@af-mobile-client-vue3/views/component/XReportFormIframeView/index.vue' import XReportFormView from '@af-mobile-client-vue3/views/component/XReportFormView/index.vue' import XReportGridView from '@af-mobile-client-vue3/views/component/XReportGridView/index.vue' import XRequestView from '@af-mobile-client-vue3/views/component/XRequestView/index.vue' import XSignatureView from '@af-mobile-client-vue3/views/component/XSignatureView/index.vue' import AuthLoading from '@af-mobile-client-vue3/views/loading/AuthLoading.vue' import employeeBinding from '@af-mobile-client-vue3/views/user/employeeBinding/index.vue' import login from '@af-mobile-client-vue3/views/user/login/index.vue' import my from '@af-mobile-client-vue3/views/user/my/index.vue' import register from '@af-mobile-client-vue3/views/user/register/index.vue' import AbnormalAlarmRecords from '@af-mobile-client-vue3/views/userRecords/AbnormalAlarmRecords.vue' import CardReplacementRecords from '@af-mobile-client-vue3/views/userRecords/CardReplacementRecords.vue' import ChangeRecords from '@af-mobile-client-vue3/views/userRecords/ChangeRecords.vue' import CommandViewRecords from '@af-mobile-client-vue3/views/userRecords/CommandViewRecords.vue' import GasCompensationRecords from '@af-mobile-client-vue3/views/userRecords/GasCompensationRecords.vue' import InstrumentCollectionRecords from '@af-mobile-client-vue3/views/userRecords/InstrumentCollectionRecords.vue' import MeterRecords from '@af-mobile-client-vue3/views/userRecords/MeterRecords.vue' import OperateRecords from '@af-mobile-client-vue3/views/userRecords/OperateRecords.vue' import OtherChargeRecords from '@af-mobile-client-vue3/views/userRecords/OtherChargeRecords.vue' import PaymentRecords from '@af-mobile-client-vue3/views/userRecords/PaymentRecords.vue' import PriceAdjustmentRecords from '@af-mobile-client-vue3/views/userRecords/PriceAdjustmentRecords.vue' import ReplacementRecords from '@af-mobile-client-vue3/views/userRecords/ReplacementRecords.vue' import SafetyRecords from '@af-mobile-client-vue3/views/userRecords/SafetyRecords.vue' import TransactionRecords from '@af-mobile-client-vue3/views/userRecords/TransactionRecords.vue' import TransferRecords from '@af-mobile-client-vue3/views/userRecords/TransferRecords.vue' import externalUserRoutes from './external-routes' const routes: Array = [ { path: '/', name: 'root', redirect: () => { // 默认重定向到 Component(系统用户或未登录用户) return { name: 'Component' } }, children: [ { path: '/XReportFormIframeView', name: 'XReportFormIframeView', component: XReportFormIframeView, meta: { requiresAuth: true, allowExternalUser: false, title: '表单iframe视图', }, }, { path: '/Components/XForm', name: 'XForm', component: XForm, props: route => ({ groupFormItems: JSON.parse(decodeURIComponent(route.query.groupFormItems as string)), serviceName: route.query.serviceName, formData: JSON.parse(decodeURIComponent(route.query.formData as string)), mode: route.query.mode, }), meta: { requiresAuth: true, allowExternalUser: false, title: '新增/修改表单', }, }, ], }, { path: '/Component', name: 'Component', redirect: { name: 'ComponentView' }, children: [ { path: '/Component/main', name: 'ComponentView', component: ComponentView, }, { path: '/Component/XCellListView', name: 'XCellListView', component: XCellListView, }, { path: '/Component/XCellDetailView/:id', name: 'XCellDetailView', component: XCellDetailView, }, { path: '/Component/XFormGroupView', name: 'XFormGroupView', component: XFormGroupView, }, { path: '/Component/XReportFormView', name: 'XReportFormView', component: XReportFormView, }, { path: '/Component/XOlMapView', name: 'XOlMapView', component: XOlMapView, }, { path: '/Component/XOlMapView/XLocationPicker', name: 'XLocationPicker', component: XLocationPicker, }, // { // path: '/Components/XForm', // name: 'XForm', // component: XForm, // props: route => ({ // groupFormItems: JSON.parse(decodeURIComponent(route.query.groupFormItems as string)), // serviceName: route.query.serviceName, // formData: JSON.parse(decodeURIComponent(route.query.formData as string)), // mode: route.query.mode, // }), // meta:{ title: '新增/修改表单' } // }, { path: '/Component/XFormAppraiseView/:id/:openid', name: 'XFormAppraiseView', component: XFormAppraiseView, }, { path: '/Component/XFormView', name: 'XFormView', component: XFormView, }, { path: '/Component/OtherCharge', name: 'OtherChargeForm', component: OtherChargeForm, }, { path: '/Component/EvaluateRecordView', name: 'EvaluateRecordView', component: EvaluateRecordView, }, { path: '/Component/XSignatureView', name: 'XSignatureView', component: XSignatureView, }, { path: '/Component/XReportGridView', name: 'XReportGridView', component: XReportGridView, }, { path: '/Component/XReport', name: 'XReport', component: XReport, }, { path: '/GridView', name: 'GridView', component: GridView, }, { path: '/Component/XRequestView', name: 'XRequestView', component: XRequestView, }, { path: '/Component/IconifyView', name: 'IconifyView', component: IconifyView, }, { path: '/Component/UserDetailView', name: 'UserDetailView', component: UserDetailView, }, { path: '/Component/UserDetail/:userInfoId', name: 'UserDetailRoute', component: UserDetailPage, meta: { title: '用户详情' }, }, { path: '/Component/MateChatView', name: 'MateChatView', component: MateChatView, }, { path: '/Component/FilePreview', name: 'FilePreview', component: FilePreview, }, { path: '/Component/StepView', name: 'StepView', component: StepView, }, ], }, // 用户记录相关路由 { path: '/OperateRecords', name: 'OperateRecords', component: OperateRecords, meta: { title: '操作记录', keepAlive: false, }, }, { path: '/PaymentRecords', name: 'PaymentRecords', component: PaymentRecords, meta: { title: '缴费记录', keepAlive: false, }, }, { path: '/MeterRecords', name: 'MeterRecords', component: MeterRecords, meta: { title: '抄表记录', keepAlive: false, }, }, { path: '/TransferRecords', name: 'TransferRecords', component: TransferRecords, meta: { title: '过户记录', keepAlive: false, }, }, { path: '/SafetyRecords', name: 'SafetyRecords', component: SafetyRecords, meta: { title: '安检记录', keepAlive: false, }, }, { path: '/ReplacementRecords', name: 'ReplacementRecords', component: ReplacementRecords, meta: { title: '换表记录', keepAlive: false, }, }, { path: '/OtherChargeRecords', name: 'OtherChargeRecords', component: OtherChargeRecords, meta: { title: '其他收费记录', keepAlive: false, }, }, { path: '/TransactionRecords', name: 'TransactionRecords', component: TransactionRecords, meta: { title: '流水记录', keepAlive: false, }, }, { path: '/AbnormalAlarmRecords', name: 'AbnormalAlarmRecords', component: AbnormalAlarmRecords, meta: { title: '异常报警记录', keepAlive: false, }, }, { path: '/CardReplacementRecords', name: 'CardReplacementRecords', component: CardReplacementRecords, meta: { title: '补卡记录', keepAlive: false, }, }, { path: '/ChangeRecords', name: 'ChangeRecords', component: ChangeRecords, meta: { title: '变更记录', keepAlive: false, }, }, { path: '/CommandViewRecords', name: 'CommandViewRecords', component: CommandViewRecords, meta: { title: '指令查看记录', keepAlive: false, }, }, { path: '/GasCompensationRecords', name: 'GasCompensationRecords', component: GasCompensationRecords, meta: { title: '补气记录', keepAlive: false, }, }, { path: '/InstrumentCollectionRecords', name: 'InstrumentCollectionRecords', component: InstrumentCollectionRecords, meta: { title: '表具采集记录', keepAlive: false, }, }, { path: '/PriceAdjustmentRecords', name: 'PriceAdjustmentRecords', component: PriceAdjustmentRecords, meta: { title: '价格调整记录', keepAlive: false, }, }, { path: '/XCellListView', name: 'ComponentView', component: ComponentView, meta: { title: '组件工具列表', keepAlive: false, }, }, { path: '/login', name: 'login', component: login, meta: { requiresAuth: false, allowExternalUser: true, title: '用户登录', }, }, { path: '/loading', name: 'AuthLoading', component: AuthLoading, meta: { requiresAuth: false, allowExternalUser: true, title: '正在登录中...', }, }, { path: '/user/my', name: 'userProfile', component: my, meta: { requiresAuth: true, allowExternalUser: false, title: '个人中心', }, }, { path: '/register/:strategyId?/:openId?', name: 'register', component: register, meta: { requiresAuth: false, allowExternalUser: true, title: '用户注册', }, }, { path: '/wechat/employeeBinding', name: 'employeeBinding', component: employeeBinding, meta: { title: '关联系统', keepAlive: false, requiresAuth: false, allowExternalUser: true, }, }, ...externalUserRoutes, { path: '/403', name: '403', component: Forbidden, meta: { requiresAuth: false, allowExternalUser: true, title: '禁止访问', }, }, { path: '/404', name: '404', component: NotFound, meta: { requiresAuth: false, allowExternalUser: true, title: '页面未找到', }, }, { path: '/:pathMatch(.*)', redirect: { name: '404', }, meta: { requiresAuth: false, allowExternalUser: true, }, }, ] export default routes