|
@@ -36,6 +36,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { MENU_TYPE } from '@/utils/dict'
|
|
export default {
|
|
export default {
|
|
name: 'menu-edit',
|
|
name: 'menu-edit',
|
|
data () {
|
|
data () {
|
|
@@ -70,24 +71,24 @@ export default {
|
|
options: {
|
|
options: {
|
|
size: 'small',
|
|
size: 'small',
|
|
items: [
|
|
items: [
|
|
- { text: '目录', label: 0 },
|
|
|
|
- { text: '菜单', label: 1 },
|
|
|
|
- { text: '按钮', label: 2 },
|
|
|
|
- { text: '组件', label: 3 }
|
|
|
|
|
|
+ { text: '目录', label: MENU_TYPE.DIRECTORY },
|
|
|
|
+ { text: '菜单', label: MENU_TYPE.MENU },
|
|
|
|
+ { text: '按钮', label: MENU_TYPE.BUTTON },
|
|
|
|
+ { text: '组件', label: MENU_TYPE.COMPONENT }
|
|
]
|
|
]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '菜单图标',
|
|
label: '菜单图标',
|
|
prop: 'icon',
|
|
prop: 'icon',
|
|
- hidden: [2].includes(type),
|
|
|
|
|
|
+ hidden: [MENU_TYPE.BUTTON].includes(type),
|
|
type: 'input',
|
|
type: 'input',
|
|
options: { placeholder: '请输入菜单图标' }
|
|
options: { placeholder: '请输入菜单图标' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '路由地址',
|
|
label: '路由地址',
|
|
prop: 'path',
|
|
prop: 'path',
|
|
- hidden: [2, 3].includes(type),
|
|
|
|
|
|
+ hidden: [MENU_TYPE.BUTTON, MENU_TYPE.COMPONENT].includes(type),
|
|
type: 'input',
|
|
type: 'input',
|
|
options: { placeholder: '请输入路由地址' },
|
|
options: { placeholder: '请输入路由地址' },
|
|
rules: [{ required: true, message: '请输入路由地址', trigger: 'change' }]
|
|
rules: [{ required: true, message: '请输入路由地址', trigger: 'change' }]
|
|
@@ -95,7 +96,7 @@ export default {
|
|
{
|
|
{
|
|
label: '组件地址',
|
|
label: '组件地址',
|
|
prop: 'component',
|
|
prop: 'component',
|
|
- hidden: [2].includes(type),
|
|
|
|
|
|
+ hidden: [MENU_TYPE.BUTTON].includes(type),
|
|
type: 'input',
|
|
type: 'input',
|
|
options: { placeholder: '请输入组件地址' },
|
|
options: { placeholder: '请输入组件地址' },
|
|
rules: [{ required: type !== 0, message: '请输入组件地址', trigger: 'change' }]
|
|
rules: [{ required: type !== 0, message: '请输入组件地址', trigger: 'change' }]
|
|
@@ -103,7 +104,7 @@ export default {
|
|
{
|
|
{
|
|
label: '组件名称',
|
|
label: '组件名称',
|
|
prop: 'name',
|
|
prop: 'name',
|
|
- hidden: [2].includes(type),
|
|
|
|
|
|
+ hidden: [MENU_TYPE.BUTTON].includes(type),
|
|
type: 'input',
|
|
type: 'input',
|
|
options: { placeholder: '请输入组件名称' },
|
|
options: { placeholder: '请输入组件名称' },
|
|
rules: [{ required: true, message: '请输入组件名称', trigger: 'change' }]
|
|
rules: [{ required: true, message: '请输入组件名称', trigger: 'change' }]
|
|
@@ -111,7 +112,7 @@ export default {
|
|
{
|
|
{
|
|
label: '权限标识',
|
|
label: '权限标识',
|
|
prop: 'code',
|
|
prop: 'code',
|
|
- hidden: [0, 1, 3].includes(type),
|
|
|
|
|
|
+ hidden: [MENU_TYPE.DIRECTORY, MENU_TYPE.MENU, MENU_TYPE.COMPONENT].includes(type),
|
|
type: 'input',
|
|
type: 'input',
|
|
options: { placeholder: '请输入权限标识' },
|
|
options: { placeholder: '请输入权限标识' },
|
|
rules: [{ required: true, message: '请输入权限标识', trigger: 'change' }]
|
|
rules: [{ required: true, message: '请输入权限标识', trigger: 'change' }]
|
|
@@ -138,7 +139,7 @@ export default {
|
|
label: '缓存状态',
|
|
label: '缓存状态',
|
|
prop: 'keepAlive',
|
|
prop: 'keepAlive',
|
|
type: 'radioGroup',
|
|
type: 'radioGroup',
|
|
- hidden: [0, 2, 3].includes(type),
|
|
|
|
|
|
+ hidden: [MENU_TYPE.DIRECTORY, MENU_TYPE.BUTTON, MENU_TYPE.COMPONENT].includes(type),
|
|
options: {
|
|
options: {
|
|
items: [
|
|
items: [
|
|
{ text: '缓存', label: true },
|
|
{ text: '缓存', label: true },
|
|
@@ -150,7 +151,7 @@ export default {
|
|
label: '开启新窗口',
|
|
label: '开启新窗口',
|
|
prop: 'window',
|
|
prop: 'window',
|
|
type: 'radioGroup',
|
|
type: 'radioGroup',
|
|
- hidden: [0, 2, 3].includes(type),
|
|
|
|
|
|
+ hidden: [MENU_TYPE.DIRECTORY, MENU_TYPE.BUTTON, MENU_TYPE.COMPONENT].includes(type),
|
|
options: {
|
|
options: {
|
|
items: [
|
|
items: [
|
|
{ text: '开启', label: true },
|
|
{ text: '开启', label: true },
|
|
@@ -162,7 +163,7 @@ export default {
|
|
label: '全景视图',
|
|
label: '全景视图',
|
|
prop: 'panorama',
|
|
prop: 'panorama',
|
|
type: 'radioGroup',
|
|
type: 'radioGroup',
|
|
- hidden: [2].includes(type),
|
|
|
|
|
|
+ hidden: [MENU_TYPE.BUTTON].includes(type),
|
|
options: {
|
|
options: {
|
|
items: [
|
|
items: [
|
|
{ text: '加入', label: true },
|
|
{ text: '加入', label: true },
|