修改组件
This commit is contained in:
parent
a986369529
commit
c53cb5bbd1
|
|
@ -15,7 +15,8 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :flex="$mk.config.ui.toolbarFlex">
|
<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-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
|
|
@ -441,6 +442,7 @@ export default {
|
||||||
this.openSettingPage();
|
this.openSettingPage();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.$emit("toolbarClick", e)
|
||||||
},
|
},
|
||||||
openSettingPage() {
|
openSettingPage() {
|
||||||
this.$mk.dialog.open({
|
this.$mk.dialog.open({
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<basic-page-list :desc="desc" :options="pageOptions">
|
<basic-page-list :desc="desc" :options="pageOptions" @toolbarClick="toolbarClick">
|
||||||
<template v-slot:column1="{ row }">
|
<template v-slot:column1="{ row }">
|
||||||
<img v-if="row && row.avatar" :src="row.avatar" style="width: 100px;" />
|
<img v-if="row && row.avatar" :src="row.avatar" style="width: 100px;" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -43,7 +43,9 @@ export default {
|
||||||
},
|
},
|
||||||
// 动作
|
// 动作
|
||||||
methods: {
|
methods: {
|
||||||
|
toolbarClick(e) {
|
||||||
|
console.log(e)
|
||||||
|
},
|
||||||
optionsInit() {
|
optionsInit() {
|
||||||
// 页面数据
|
// 页面数据
|
||||||
var pageData = { // 页面数据变量
|
var pageData = { // 页面数据变量
|
||||||
|
|
@ -51,6 +53,9 @@ export default {
|
||||||
keyName: 'id', // 主键字段名
|
keyName: 'id', // 主键字段名
|
||||||
listFieldName: 'MesStaff',
|
listFieldName: 'MesStaff',
|
||||||
|
|
||||||
|
toolbarButtons: [
|
||||||
|
{ name: 'aa', label: 'aa' }
|
||||||
|
],
|
||||||
addPageUrl: "/MesStaff/MesStaffAdd",
|
addPageUrl: "/MesStaff/MesStaffAdd",
|
||||||
editPageUrl: "/MesStaff/MesStaffUpdate/",
|
editPageUrl: "/MesStaff/MesStaffUpdate/",
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,209 +1,209 @@
|
||||||
// 视图组件
|
// 视图组件
|
||||||
const view = {
|
const view = {
|
||||||
tabs: () => import('@/layouts/tabs'),
|
tabs: () => import('@/layouts/tabs'),
|
||||||
blank: () => import('@/layouts/BlankView'),
|
blank: () => import('@/layouts/BlankView'),
|
||||||
page: () => import('@/layouts/PageView')
|
page: () => import('@/layouts/PageView')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 路由组件注册
|
// 路由组件注册
|
||||||
const BaseRouterMap = {
|
const BaseRouterMap = {
|
||||||
login: {
|
login: {
|
||||||
authority: '*',
|
authority: '*',
|
||||||
path: '/login',
|
path: '/login',
|
||||||
component: () => import('@/pages/login')
|
component: () => import('@/pages/login')
|
||||||
},
|
},
|
||||||
root: {
|
root: {
|
||||||
path: '/',
|
path: '/',
|
||||||
name: '首页',
|
name: '首页',
|
||||||
redirect: '/login',
|
redirect: '/login',
|
||||||
component: view.tabs
|
component: view.tabs
|
||||||
},
|
},
|
||||||
touch: {
|
touch: {
|
||||||
path: '/touch',
|
path: '/touch',
|
||||||
name: '首页',
|
name: '首页',
|
||||||
component: view.blank
|
component: view.blank
|
||||||
},
|
},
|
||||||
dashboard: {
|
dashboard: {
|
||||||
name: '仪表盘',
|
name: '仪表盘',
|
||||||
redirect: '/dashboard/workplace',
|
redirect: '/dashboard/workplace',
|
||||||
component: view.blank
|
component: view.blank
|
||||||
},
|
},
|
||||||
workplace: {
|
workplace: {
|
||||||
name: '工作台',
|
name: '工作台',
|
||||||
path:'/dashboard/workplace',
|
path: '/dashboard/workplace',
|
||||||
icon: 'idcard',
|
icon: 'idcard',
|
||||||
component: () => import('@/pages/dashboard/workplace')
|
component: () => import('@/pages/dashboard/workplace')
|
||||||
},
|
},
|
||||||
Middle: {
|
Middle: {
|
||||||
name: '中台管理',
|
name: '中台管理',
|
||||||
icon: 'idcard',
|
icon: 'idcard',
|
||||||
component: view.blank
|
component: view.blank
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
exp403: {
|
exp403: {
|
||||||
authority: '*',
|
authority: '*',
|
||||||
name: 'exp403',
|
name: 'exp403',
|
||||||
path: '403',
|
path: '403',
|
||||||
component: () => import('@/pages/base/exception/403')
|
component: () => import('@/pages/base/exception/403')
|
||||||
},
|
},
|
||||||
exp404: {
|
exp404: {
|
||||||
name: 'exp404',
|
name: 'exp404',
|
||||||
path: '404',
|
path: '404',
|
||||||
component: () => import('@/pages/base/exception/404')
|
component: () => import('@/pages/base/exception/404')
|
||||||
},
|
},
|
||||||
exp500: {
|
exp500: {
|
||||||
name: 'exp500',
|
name: 'exp500',
|
||||||
path: '500',
|
path: '500',
|
||||||
component: () => import('@/pages/base/exception/500')
|
component: () => import('@/pages/base/exception/500')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
components: {
|
// components: {
|
||||||
name: '小组件',
|
// name: '小组件',
|
||||||
icon: 'appstore-o',
|
// icon: 'appstore-o',
|
||||||
component: view.page
|
// component: view.page
|
||||||
},
|
// },
|
||||||
taskCard: {
|
// taskCard: {
|
||||||
name: '任务卡片',
|
// name: '任务卡片',
|
||||||
component: () => import('@/pages/base/components/TaskCard')
|
// component: () => import('@/pages/base/components/TaskCard')
|
||||||
},
|
// },
|
||||||
palette: {
|
// palette: {
|
||||||
name: '颜色复选框',
|
// name: '颜色复选框',
|
||||||
component: () => import('@/pages/base/components/Palette')
|
// component: () => import('@/pages/base/components/Palette')
|
||||||
},
|
// },
|
||||||
analysis: {
|
// analysis: {
|
||||||
name: '分析页',
|
// name: '分析页',
|
||||||
component: () => import('@/pages/dashboard/analysis')
|
// component: () => import('@/pages/dashboard/analysis')
|
||||||
},
|
// },
|
||||||
form: {
|
// form: {
|
||||||
name: '表单页',
|
// name: '表单页',
|
||||||
icon: 'form',
|
// icon: 'form',
|
||||||
component: view.page
|
// component: view.page
|
||||||
},
|
// },
|
||||||
basicForm: {
|
// basicForm: {
|
||||||
path: 'basic',
|
// path: 'basic',
|
||||||
name: '基础表单',
|
// name: '基础表单',
|
||||||
component: () => import('@/pages/base/form/basic')
|
// component: () => import('@/pages/base/form/basic')
|
||||||
},
|
// },
|
||||||
stepForm: {
|
// stepForm: {
|
||||||
path: 'step',
|
// path: 'step',
|
||||||
name: '分步表单',
|
// name: '分步表单',
|
||||||
component: () => import('@/pages/base/form/step')
|
// component: () => import('@/pages/base/form/step')
|
||||||
},
|
// },
|
||||||
advanceForm: {
|
// advanceForm: {
|
||||||
path: 'advance',
|
// path: 'advance',
|
||||||
name: '高级表单',
|
// name: '高级表单',
|
||||||
component: () => import('@/pages/base/form/advance')
|
// component: () => import('@/pages/base/form/advance')
|
||||||
},
|
// },
|
||||||
list: {
|
// list: {
|
||||||
name: '列表页',
|
// name: '列表页',
|
||||||
icon: 'table',
|
// icon: 'table',
|
||||||
component: view.page
|
// component: view.page
|
||||||
},
|
// },
|
||||||
queryList: {
|
// queryList: {
|
||||||
path: 'query',
|
// path: 'query',
|
||||||
name: '查询表格',
|
// name: '查询表格',
|
||||||
component: () => import('@/pages/base/list/QueryList')
|
// component: () => import('@/pages/base/list/QueryList')
|
||||||
},
|
// },
|
||||||
primaryList: {
|
// primaryList: {
|
||||||
path: 'primary',
|
// path: 'primary',
|
||||||
name: '标准列表',
|
// name: '标准列表',
|
||||||
component: () => import('@/pages/base/list/StandardList')
|
// component: () => import('@/pages/base/list/StandardList')
|
||||||
},
|
// },
|
||||||
cardList: {
|
// cardList: {
|
||||||
path: 'card',
|
// path: 'card',
|
||||||
name: '卡片列表',
|
// name: '卡片列表',
|
||||||
component: () => import('@/pages/base/list/CardList')
|
// component: () => import('@/pages/base/list/CardList')
|
||||||
},
|
// },
|
||||||
searchList: {
|
// searchList: {
|
||||||
path: 'search',
|
// path: 'search',
|
||||||
name: '搜索列表',
|
// name: '搜索列表',
|
||||||
component: () => import('@/pages/base/list/search/SearchLayout')
|
// component: () => import('@/pages/base/list/search/SearchLayout')
|
||||||
},
|
// },
|
||||||
article: {
|
// article: {
|
||||||
name: '文章',
|
// name: '文章',
|
||||||
component: () => import('@/pages/base/list/search/ArticleList')
|
// component: () => import('@/pages/base/list/search/ArticleList')
|
||||||
},
|
// },
|
||||||
application: {
|
// application: {
|
||||||
name: '应用',
|
// name: '应用',
|
||||||
component: () => import('@/pages/base/list/search/ApplicationList')
|
// component: () => import('@/pages/base/list/search/ApplicationList')
|
||||||
},
|
// },
|
||||||
project: {
|
// project: {
|
||||||
name: '项目',
|
// name: '项目',
|
||||||
component: () => import('@/pages/base/list/search/ProjectList')
|
// component: () => import('@/pages/base/list/search/ProjectList')
|
||||||
},
|
// },
|
||||||
details: {
|
// details: {
|
||||||
name: '详情页',
|
// name: '详情页',
|
||||||
icon: 'profile',
|
// icon: 'profile',
|
||||||
component: view.blank
|
// component: view.blank
|
||||||
},
|
// },
|
||||||
basicDetails: {
|
// basicDetails: {
|
||||||
path: 'basic',
|
// path: 'basic',
|
||||||
name: '基础详情页',
|
// name: '基础详情页',
|
||||||
component: () => import('@/pages/base/detail/BasicDetail')
|
// component: () => import('@/pages/base/detail/BasicDetail')
|
||||||
},
|
// },
|
||||||
advanceDetails: {
|
// advanceDetails: {
|
||||||
path: 'advance',
|
// path: 'advance',
|
||||||
name: '高级详情页',
|
// name: '高级详情页',
|
||||||
component: () => import('@/pages/base/detail/AdvancedDetail')
|
// component: () => import('@/pages/base/detail/AdvancedDetail')
|
||||||
},
|
// },
|
||||||
result: {
|
// result: {
|
||||||
name: '结果页',
|
// name: '结果页',
|
||||||
icon: 'check-circle-o',
|
// icon: 'check-circle-o',
|
||||||
component: view.page
|
// component: view.page
|
||||||
},
|
// },
|
||||||
success: {
|
// success: {
|
||||||
name: '成功',
|
// name: '成功',
|
||||||
component: () => import('@/pages/base/result/Success')
|
// component: () => import('@/pages/base/result/Success')
|
||||||
},
|
// },
|
||||||
error: {
|
// error: {
|
||||||
name: '失败',
|
// name: '失败',
|
||||||
component: () => import('@/pages/base/result/Error')
|
// component: () => import('@/pages/base/result/Error')
|
||||||
},
|
// },
|
||||||
exception: {
|
// exception: {
|
||||||
name: '异常页',
|
// name: '异常页',
|
||||||
icon: 'warning',
|
// icon: 'warning',
|
||||||
component: view.blank
|
// component: view.blank
|
||||||
},
|
// },
|
||||||
|
|
||||||
//================================================================================================================================
|
//================================================================================================================================
|
||||||
// 以上为自动生成的路由,以下为手动添加的路由
|
// 以上为自动生成的路由,以下为手动添加的路由
|
||||||
//================================================================================================================================
|
//================================================================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//================================================================================================================================
|
//================================================================================================================================
|
||||||
// 以下为项目的路由
|
// 以下为项目的路由
|
||||||
//================================================================================================================================
|
//================================================================================================================================
|
||||||
|
|
||||||
TouchMesReporting : {
|
TouchMesReporting: {
|
||||||
name: '报工',
|
name: '报工',
|
||||||
path: '/touch/mesreporting',
|
path: '/touch/mesreporting',
|
||||||
component: () => import('@/pages/Middle/Mes/MesReporting/MesReporting')
|
component: () => import('@/pages/Middle/Mes/MesReporting/MesReporting')
|
||||||
},
|
},
|
||||||
TouchMoldHome : {
|
TouchMoldHome: {
|
||||||
name: '触摸屏首页',
|
name: '触摸屏首页',
|
||||||
path: '/touch/moldhome',
|
path: '/touch/moldhome',
|
||||||
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
|
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
|
||||||
},
|
},
|
||||||
TouchMoldReporting : {
|
TouchMoldReporting: {
|
||||||
name: '报工',
|
name: '报工',
|
||||||
path: '/touch/moldreporting',
|
path: '/touch/moldreporting',
|
||||||
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
|
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
|
||||||
},
|
},
|
||||||
TouchMoldSend : {
|
TouchMoldSend: {
|
||||||
name: '发料',
|
name: '发料',
|
||||||
path: '/touch/moldsend',
|
path: '/touch/moldsend',
|
||||||
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
|
component: () => import('@/pages/Middle/Mold/Touch/Reporting')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(BaseRouterMap)
|
// console.log(BaseRouterMap)
|
||||||
|
|
||||||
export default BaseRouterMap
|
export default BaseRouterMap
|
||||||
|
|
@ -37,7 +37,7 @@ function parseRoutes(routesConfig, routerMap) { // 解析路由
|
||||||
router = routerMap[item] // 从 routerMap 中获取路由
|
router = routerMap[item] // 从 routerMap 中获取路由
|
||||||
routeCfg = { path: (router && router.path) || item, router: item } // 路由配置获取路由的 path 和 router
|
routeCfg = { path: (router && router.path) || item, router: item } // 路由配置获取路由的 path 和 router
|
||||||
} else if (typeof item === 'object') { // 如果路由配置是对象
|
} else if (typeof item === 'object') { // 如果路由配置是对象
|
||||||
if(!item.router){
|
if (!item.router) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
router = routerMap[item.router] // 从 routerMap 中获取路由
|
router = routerMap[item.router] // 从 routerMap 中获取路由
|
||||||
|
|
@ -192,11 +192,11 @@ function loadRoutes(routesConfig) { // 加载路由
|
||||||
// console.log("=================routesConfig:"+routesConfig)
|
// console.log("=================routesConfig:"+routesConfig)
|
||||||
//routesConfig = mergeMenus(routesConfig);
|
//routesConfig = mergeMenus(routesConfig);
|
||||||
if (!routesConfig) {
|
if (!routesConfig) {
|
||||||
var routesconfig = store.getters['account/routesConfig']
|
var routesconfig = store.getters['account/routesConfig']
|
||||||
// console.log("=================routesConfig:", routesconfig)
|
// console.log("=================routesConfig:", routesconfig)
|
||||||
if (!routesconfig) {
|
if (!routesconfig) {
|
||||||
return;
|
return;
|
||||||
}else{
|
} else {
|
||||||
routesConfig = routesconfig
|
routesConfig = routesconfig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -229,7 +229,6 @@ function loadRoutes(routesConfig) { // 加载路由
|
||||||
formatRoutes(finalRoutes)
|
formatRoutes(finalRoutes)
|
||||||
|
|
||||||
router.options = { ...router.options, routes: finalRoutes } // 路由配置
|
router.options = { ...router.options, routes: finalRoutes } // 路由配置
|
||||||
|
|
||||||
router.matcher = new Router({ ...router.options, routes: [] }).matcher // 重置路由
|
router.matcher = new Router({ ...router.options, routes: [] }).matcher // 重置路由
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue