zhangtao 2 лет назад
Родитель
Сommit
b225781cd2
4 измененных файлов: 16 добавлений и 25 удалений
  1. +7
    -21
      src/components/Modal/index.vue
  2. +3
    -3
      src/layout/components/Tags/index.vue
  3. +5
    -0
      src/store/modules/permission.js
  4. +1
    -1
      src/views/system/menu/components/RoleModal.vue

+ 7
- 21
src/components/Modal/index.vue Просмотреть файл

@@ -1,5 +1,5 @@
<template>
<n-modal v-model:show="getModalOptions" preset="dialog">
<n-modal v-bind="getModalOptions" preset="dialog">
<n-card>
<slot name="Context" />
</n-card>
@@ -8,28 +8,13 @@

<script>

import { defineComponent, computed } from 'vue'
import { defineComponent, computed, unref } from 'vue'
export default defineComponent({
name: 'ModalModules',
props: {
/* 弹窗可见 */
visible: {
type: Boolean,
default: false
},
/* 弹窗标题 */
title: {
type: String,
default: ''
},
/* 确定按钮的loading */
confirmLoading: {
type: Boolean,
default: false
},
maskClosable: {
type: Boolean,
default: true
options: {
type: Object,
default: () => {}
}
},
emits: {
@@ -40,8 +25,9 @@ export default defineComponent({
},
setup(props, { emit }) {
const getModalOptions = computed(() => {
return props.visible
return unref(props.options)
})
console.log(getModalOptions)
const handleClick = function() {
emit('click')
}

+ 3
- 3
src/layout/components/Tags/index.vue Просмотреть файл

@@ -132,7 +132,7 @@ cacheRoutes.forEach((cacheRoute) => {
const findRoute = routes.find((route) => route.path === cacheRoute.path)
if (route) {
cacheRoute.meta = findRoute.meta || cacheRoute.meta
cacheRoute.title = (findRoute.title || cacheRoute.title)
cacheRoute.name = (findRoute.name || cacheRoute.name)
}
})

@@ -163,8 +163,8 @@ watch(
* @return { Object }
*/
function getSimpleRoute(route) {
const { fullPath, hash, meta, title, params, path, query } = route
return { fullPath, hash, meta, title, params, path, query }
const { fullPath, hash, meta, name, params, path, query } = route
return { fullPath, hash, meta, name, params, path, query }
}

/**

+ 5
- 0
src/store/modules/permission.js Просмотреть файл

@@ -79,6 +79,11 @@ function dataArrayToRoutes(routes) {
const component = `../${sub_view}.vue`
tmp.component = modules[component]
}
tmp.name = tmp.title
tmp.meta = {
...tmp.meta,
title: tmp.title
}
res.push(tmp)
})
return res

+ 1
- 1
src/views/system/menu/components/RoleModal.vue Просмотреть файл

@@ -7,7 +7,7 @@
</template>

<script>
import { defineComponent, reactive, computed } from 'vue'
import { defineComponent, computed } from 'vue'
import Modal from '@/components/Modal/index.vue'
export default defineComponent({
name: 'MenuModal',

Загрузка…
Отмена
Сохранить