| | |
| | | import React from 'react' |
| | | import MkIcon from '@/components/mk-icon' |
| | | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap) { |
| | | let menulist = sessionStorage.getItem('appMenus') |
| | | let searchable = true |
| | | window.GLOB.customMenu.components.forEach(item => { |
| | | if (item.type === 'search') { |
| | | searchable = false |
| | | } |
| | | }) |
| | | |
| | | if (menulist) { |
| | | try { |
| | |
| | | required: false, |
| | | options: [ |
| | | {value: 'navbar', label: '导航栏'}, |
| | | {value: 'search', label: '搜索框'}, |
| | | {value: 'searchIcon', label: '搜索标'}, |
| | | {value: 'search', label: '搜索框', disabled: !searchable}, |
| | | {value: 'searchIcon', label: '搜索标', disabled: !searchable}, |
| | | ], |
| | | }, |
| | | { |
| | |
| | | label: '刷新' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'table', |
| | | field: 'menus', |
| | | label: '自定义菜单', |
| | | initval: wrap.menus || [], |
| | | required: false, |
| | | span: 24, |
| | | columns: [ |
| | | { |
| | | title: '图标', |
| | | dataIndex: 'icon', |
| | | inputType: 'icon', |
| | | editable: true, |
| | | required: true, |
| | | render: (text, record) => <MkIcon type={text}/>, |
| | | width: '35%' |
| | | }, |
| | | { |
| | | title: '菜单', |
| | | dataIndex: 'menu', |
| | | inputType: 'select', |
| | | editable: true, |
| | | required: true, |
| | | extends: [{key: 'label', value: 'label'}], |
| | | width: '35%', |
| | | render: (text, record) => record.label, |
| | | options: menulist |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | |
| | | return topbarWrapForm |