feat : 修改菜单状态
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="icon" href="/favicon.ico">
|
<link rel="icon" href="/favicon.ico">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>科研管理平台</title>
|
<!-- <title>科研管理平台</title>-->
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
@@ -12,13 +12,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import {useRoute, useRouter} from 'vue-router';
|
||||||
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
watch(route, ()=> {
|
watch(route, () => {
|
||||||
getBreadcrumb()
|
getBreadcrumb()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ const breadcrumbList = ref([])
|
|||||||
const getBreadcrumb = () => {
|
const getBreadcrumb = () => {
|
||||||
let matched = route.matched.filter(item => item.meta && item.meta.title)
|
let matched = route.matched.filter(item => item.meta && item.meta.title)
|
||||||
const first = matched[0]
|
const first = matched[0]
|
||||||
if(!isDashboard(first)) {
|
if (!isDashboard(first)) {
|
||||||
matched = [{path: '/home', meta: {title: '首页'}}].concat(matched)
|
matched = [{path: '/home', meta: {title: '首页'}}].concat(matched)
|
||||||
}
|
}
|
||||||
breadcrumbList.value.length = 0;
|
breadcrumbList.value.length = 0;
|
||||||
@@ -39,7 +39,7 @@ const getBreadcrumb = () => {
|
|||||||
|
|
||||||
const isDashboard = (meta) => {
|
const isDashboard = (meta) => {
|
||||||
const name = meta && meta.name
|
const name = meta && meta.name
|
||||||
if(!name) {
|
if (!name) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return name.trim().toLocaleLowerCase() === 'Home'.toLocaleLowerCase()
|
return name.trim().toLocaleLowerCase() === 'Home'.toLocaleLowerCase()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 有子菜单 -->
|
<!-- 有子菜单 -->
|
||||||
<template v-for="item in menuItem" :key="item.path">
|
<template v-for="item in menuItem" :key="item.path">
|
||||||
<el-sub-menu v-if="item?.children?.length>0 && !item.hidden" :index="item.path">
|
<el-sub-menu v-if="checkMenuItem(item)" :index="item.path">
|
||||||
<template #title>
|
<template #title>
|
||||||
<svg-icon :name="item.icon"/>
|
<svg-icon :name="item.icon"/>
|
||||||
<span>{{ item.title }}</span>
|
<span>{{ item.title }}</span>
|
||||||
@@ -44,5 +44,19 @@ const handleGo = (path) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkMenuItem = (item) => {
|
||||||
|
let children = item.children
|
||||||
|
let childState = false;
|
||||||
|
if (children){
|
||||||
|
for (let child of children) {
|
||||||
|
if (!child.hidden) {
|
||||||
|
childState = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return item?.children?.length>0 && !item.hidden && childState
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="logo" ref="logo">
|
<div class="logo" ref="logo">
|
||||||
<span v-if="!siderbarStore.isCollapse">科研管理平台</span>
|
<!-- <span v-if="!siderbarStore.isCollapse">科研管理平台</span>-->
|
||||||
|
<span v-if="!siderbarStore.isCollapse"></span>
|
||||||
</div>
|
</div>
|
||||||
<el-scrollbar :height="`calc(100vh - ${logoHeight}px)`" style="background-color: #ffffff">
|
<el-scrollbar :height="`calc(100vh - ${logoHeight}px)`" style="background-color: #ffffff">
|
||||||
<el-menu
|
<el-menu
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
label-width="70px"
|
label-width="70px"
|
||||||
>
|
>
|
||||||
<h2>科研管理平台</h2>
|
<!-- <h2>科研管理平台</h2>-->
|
||||||
<el-form-item prop="username" label="账号">
|
<el-form-item prop="username" label="账号">
|
||||||
<el-input v-model="loginForm.username" :prefix-icon="User"></el-input>
|
<el-input v-model="loginForm.username" :prefix-icon="User"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ const schame = computed(()=>{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '角色权限',
|
label: '角色标识',
|
||||||
prop: 'roleKey',
|
prop: 'roleKey',
|
||||||
component: 'el-input',
|
component: 'el-input',
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ const loadInitFrom = () => {
|
|||||||
let design = {
|
let design = {
|
||||||
processDefinitionKey: 'pro' + getRandomId(),
|
processDefinitionKey: 'pro' + getRandomId(),
|
||||||
deploymentName: "未命名表单",
|
deploymentName: "未命名表单",
|
||||||
processKey:'',
|
processKey: '',
|
||||||
// logo: {
|
// logo: {
|
||||||
// icon: "el-icon-eleme",
|
// icon: "el-icon-eleme",
|
||||||
// background: "#1e90ff"
|
// background: "#1e90ff"
|
||||||
@@ -191,7 +191,7 @@ const getRandomId = () => {
|
|||||||
d = Math.floor(d / 16)
|
d = Math.floor(d / 16)
|
||||||
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16)
|
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16)
|
||||||
})
|
})
|
||||||
return 'node_' + id
|
return id
|
||||||
}
|
}
|
||||||
|
|
||||||
const getProcessInfo = async () => {
|
const getProcessInfo = async () => {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-input v-model="processData.deploymentName" placeholder="请输入流程名称"/>
|
<el-input v-model="processData.deploymentName" placeholder="请输入流程名称"/>
|
||||||
<div v-if="!processData.processDefinitionKey">
|
<!-- <div v-if="!processData.processDefinitionKey">-->
|
||||||
<el-select v-model="processData.processKey" placeholder="请选择流程环节">
|
<el-select v-model="processData.processKey" placeholder="请选择流程环节">
|
||||||
<el-option v-for="item in optionList" :label="item.label" :value="item.value"/>
|
<el-option v-for="item in optionList" :label="item.label" :value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div v-else>
|
<!-- <div v-else>-->
|
||||||
{{processData.processName}}
|
<!-- {{processData.processName}}-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
|
|
||||||
流程设置{{ processData.deploymentName }}
|
流程设置{{ processData.deploymentName }}
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -53,11 +53,11 @@
|
|||||||
<el-button type="primary" size="mini"
|
<el-button type="primary" size="mini"
|
||||||
@click="handleEdit(scope.row.deploymentId)" link>编辑
|
@click="handleEdit(scope.row.deploymentId)" link>编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" size="mini"
|
<!-- <el-button type="primary" size="mini"-->
|
||||||
@click="viewHistoricalVersion(scope.row)" link>历史
|
<!-- @click="viewHistoricalVersion(scope.row)" link>历史-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
<popover-delete :name="scope.row.version" :type="'版本'"
|
<!-- <popover-delete :name="scope.row.version" :type="'版本'"-->
|
||||||
@delete="handleDelete(scope.row.deploymentId)"/>
|
<!-- @delete="handleDelete(scope.row.deploymentId)"/>-->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
Reference in New Issue
Block a user