修改组件

This commit is contained in:
zxx 2023-11-14 09:52:03 +08:00
parent a986369529
commit c53cb5bbd1
4 changed files with 218 additions and 212 deletions

View File

@ -15,7 +15,8 @@
</a-col>
<a-col :flex="$mk.config.ui.toolbarFlex">
<!-- 工具条 -->
<mk-toolbar :isShowAdd="options.disabledAdd !== true" @toolbarClick="toolbarClick"></mk-toolbar>
<mk-toolbar :buttons="options.toolbarButtons" :isShowAdd="options.disabledAdd !== true"
@toolbarClick="toolbarClick"></mk-toolbar>
</a-col>
</a-row>
@ -441,6 +442,7 @@ export default {
this.openSettingPage();
}
this.$emit("toolbarClick", e)
},
openSettingPage() {
this.$mk.dialog.open({

View File

@ -1,5 +1,5 @@
<template>
<basic-page-list :desc="desc" :options="pageOptions">
<basic-page-list :desc="desc" :options="pageOptions" @toolbarClick="toolbarClick">
<template v-slot:column1="{ row }">
<img v-if="row && row.avatar" :src="row.avatar" style="width: 100px;" />
</template>
@ -43,7 +43,9 @@ export default {
},
//
methods: {
toolbarClick(e) {
console.log(e)
},
optionsInit() {
//
var pageData = { //
@ -51,6 +53,9 @@ export default {
keyName: 'id', //
listFieldName: 'MesStaff',
toolbarButtons: [
{ name: 'aa', label: 'aa' }
],
addPageUrl: "/MesStaff/MesStaffAdd",
editPageUrl: "/MesStaff/MesStaffUpdate/",

View File

@ -1,209 +1,209 @@
// 视图组件
const view = {
tabs: () => import('@/layouts/tabs'),
blank: () => import('@/layouts/BlankView'),
page: () => import('@/layouts/PageView')
}
tabs: () => import('@/layouts/tabs'),
blank: () => import('@/layouts/BlankView'),
page: () => import('@/layouts/PageView')
}
// 路由组件注册
const BaseRouterMap = {
login: {
authority: '*',
path: '/login',
component: () => import('@/pages/login')
},
root: {
path: '/',
name: '首页',
redirect: '/login',
component: view.tabs
},
touch: {
path: '/touch',
name: '首页',
component: view.blank
},
dashboard: {
name: '仪表盘',
redirect: '/dashboard/workplace',
component: view.blank
},
workplace: {
name: '工作台',
path:'/dashboard/workplace',
icon: 'idcard',
component: () => import('@/pages/dashboard/workplace')
},
Middle: {
name: '中台管理',
icon: 'idcard',
component: view.blank
},
// 路由组件注册
const BaseRouterMap = {
login: {
authority: '*',
path: '/login',
component: () => import('@/pages/login')
},
root: {
path: '/',
name: '首页',
redirect: '/login',
component: view.tabs
},
touch: {
path: '/touch',
name: '首页',
component: view.blank
},
dashboard: {
name: '仪表盘',
redirect: '/dashboard/workplace',
component: view.blank
},
workplace: {
name: '工作台',
path: '/dashboard/workplace',
icon: 'idcard',
component: () => import('@/pages/dashboard/workplace')
},
Middle: {
name: '中台管理',
icon: 'idcard',
component: view.blank
},
exp403: {
authority: '*',
name: 'exp403',
path: '403',
component: () => import('@/pages/base/exception/403')
},
exp404: {
name: 'exp404',
path: '404',
component: () => import('@/pages/base/exception/404')
},
exp500: {
name: 'exp500',
path: '500',
component: () => import('@/pages/base/exception/500')
},
exp403: {
authority: '*',
name: 'exp403',
path: '403',
component: () => import('@/pages/base/exception/403')
},
exp404: {
name: 'exp404',
path: '404',
component: () => import('@/pages/base/exception/404')
},
exp500: {
name: 'exp500',
path: '500',
component: () => import('@/pages/base/exception/500')
},
components: {
name: '小组件',
icon: 'appstore-o',
component: view.page
},
taskCard: {
name: '任务卡片',
component: () => import('@/pages/base/components/TaskCard')
},
palette: {
name: '颜色复选框',
component: () => import('@/pages/base/components/Palette')
},
analysis: {
name: '分析页',
component: () => import('@/pages/dashboard/analysis')
},
form: {
name: '表单页',
icon: 'form',
component: view.page
},
basicForm: {
path: 'basic',
name: '基础表单',
component: () => import('@/pages/base/form/basic')
},
stepForm: {
path: 'step',
name: '分步表单',
component: () => import('@/pages/base/form/step')
},
advanceForm: {
path: 'advance',
name: '高级表单',
component: () => import('@/pages/base/form/advance')
},
list: {
name: '列表页',
icon: 'table',
component: view.page
},
queryList: {
path: 'query',
name: '查询表格',
component: () => import('@/pages/base/list/QueryList')
},
primaryList: {
path: 'primary',
name: '标准列表',
component: () => import('@/pages/base/list/StandardList')
},
cardList: {
path: 'card',
name: '卡片列表',
component: () => import('@/pages/base/list/CardList')
},
searchList: {
path: 'search',
name: '搜索列表',
component: () => import('@/pages/base/list/search/SearchLayout')
},
article: {
name: '文章',
component: () => import('@/pages/base/list/search/ArticleList')
},
application: {
name: '应用',
component: () => import('@/pages/base/list/search/ApplicationList')
},
project: {
name: '项目',
component: () => import('@/pages/base/list/search/ProjectList')
},
details: {
name: '详情页',
icon: 'profile',
component: view.blank
},
basicDetails: {
path: 'basic',
name: '基础详情页',
component: () => import('@/pages/base/detail/BasicDetail')
},
advanceDetails: {
path: 'advance',
name: '高级详情页',
component: () => import('@/pages/base/detail/AdvancedDetail')
},
result: {
name: '结果页',
icon: 'check-circle-o',
component: view.page
},
success: {
name: '成功',
component: () => import('@/pages/base/result/Success')
},
error: {
name: '失败',
component: () => import('@/pages/base/result/Error')
},
exception: {
name: '异常页',
icon: 'warning',
component: view.blank
},
// components: {
// name: '小组件',
// icon: 'appstore-o',
// component: view.page
// },
// taskCard: {
// name: '任务卡片',
// component: () => import('@/pages/base/components/TaskCard')
// },
// palette: {
// name: '颜色复选框',
// component: () => import('@/pages/base/components/Palette')
// },
// analysis: {
// name: '分析页',
// component: () => import('@/pages/dashboard/analysis')
// },
// form: {
// name: '表单页',
// icon: 'form',
// component: view.page
// },
// basicForm: {
// path: 'basic',
// name: '基础表单',
// component: () => import('@/pages/base/form/basic')
// },
// stepForm: {
// path: 'step',
// name: '分步表单',
// component: () => import('@/pages/base/form/step')
// },
// advanceForm: {
// path: 'advance',
// name: '高级表单',
// component: () => import('@/pages/base/form/advance')
// },
// list: {
// name: '列表页',
// icon: 'table',
// component: view.page
// },
// queryList: {
// path: 'query',
// name: '查询表格',
// component: () => import('@/pages/base/list/QueryList')
// },
// primaryList: {
// path: 'primary',
// name: '标准列表',
// component: () => import('@/pages/base/list/StandardList')
// },
// cardList: {
// path: 'card',
// name: '卡片列表',
// component: () => import('@/pages/base/list/CardList')
// },
// searchList: {
// path: 'search',
// name: '搜索列表',
// component: () => import('@/pages/base/list/search/SearchLayout')
// },
// article: {
// name: '文章',
// component: () => import('@/pages/base/list/search/ArticleList')
// },
// application: {
// name: '应用',
// component: () => import('@/pages/base/list/search/ApplicationList')
// },
// project: {
// name: '项目',
// component: () => import('@/pages/base/list/search/ProjectList')
// },
// details: {
// name: '详情页',
// icon: 'profile',
// component: view.blank
// },
// basicDetails: {
// path: 'basic',
// name: '基础详情页',
// component: () => import('@/pages/base/detail/BasicDetail')
// },
// advanceDetails: {
// path: 'advance',
// name: '高级详情页',
// component: () => import('@/pages/base/detail/AdvancedDetail')
// },
// result: {
// name: '结果页',
// icon: 'check-circle-o',
// component: view.page
// },
// success: {
// name: '成功',
// component: () => import('@/pages/base/result/Success')
// },
// error: {
// name: '失败',
// component: () => import('@/pages/base/result/Error')
// },
// exception: {
// name: '异常页',
// icon: 'warning',
// component: view.blank
// },
//================================================================================================================================
// 以上为自动生成的路由,以下为手动添加的路由
//================================================================================================================================
//================================================================================================================================
// 以上为自动生成的路由,以下为手动添加的路由
//================================================================================================================================
//================================================================================================================================
// 以下为项目的路由
//================================================================================================================================
//================================================================================================================================
// 以下为项目的路由
//================================================================================================================================
TouchMesReporting : {
name: '报工',
path: '/touch/mesreporting',
component: () => import('@/pages/Middle/Mes/MesReporting/MesReporting')
},
TouchMoldHome : {
name: '触摸屏首页',
path: '/touch/moldhome',
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
},
TouchMoldReporting : {
name: '报工',
path: '/touch/moldreporting',
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
},
TouchMoldSend : {
name: '发料',
path: '/touch/moldsend',
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
},
TouchMesReporting: {
name: '报工',
path: '/touch/mesreporting',
component: () => import('@/pages/Middle/Mes/MesReporting/MesReporting')
},
TouchMoldHome: {
name: '触摸屏首页',
path: '/touch/moldhome',
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
},
TouchMoldReporting: {
name: '报工',
path: '/touch/moldreporting',
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
},
TouchMoldSend: {
name: '发料',
path: '/touch/moldsend',
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
},
}
}
// console.log(BaseRouterMap)
export default BaseRouterMap
export default BaseRouterMap

View File

@ -37,7 +37,7 @@ function parseRoutes(routesConfig, routerMap) { // 解析路由
router = routerMap[item] // 从 routerMap 中获取路由
routeCfg = { path: (router && router.path) || item, router: item } // 路由配置获取路由的 path 和 router
} else if (typeof item === 'object') { // 如果路由配置是对象
if(!item.router){
if (!item.router) {
return;
}
router = routerMap[item.router] // 从 routerMap 中获取路由
@ -192,11 +192,11 @@ function loadRoutes(routesConfig) { // 加载路由
// console.log("=================routesConfig:"+routesConfig)
//routesConfig = mergeMenus(routesConfig);
if (!routesConfig) {
var routesconfig = store.getters['account/routesConfig']
var routesconfig = store.getters['account/routesConfig']
// console.log("=================routesConfig:", routesconfig)
if (!routesconfig) {
return;
}else{
} else {
routesConfig = routesconfig
}
}
@ -229,7 +229,6 @@ function loadRoutes(routesConfig) { // 加载路由
formatRoutes(finalRoutes)
router.options = { ...router.options, routes: finalRoutes } // 路由配置
router.matcher = new Router({ ...router.options, routes: [] }).matcher // 重置路由