king
2022-04-15 21d92eff0e23974d76e3e5a79ba50e3fc1c0b879
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/**
 * @description Wrap表单配置信息
 */
export default function (wrap) {
  let menulist = sessionStorage.getItem('appMenus')
  if (menulist) {
    try {
      menulist = JSON.parse(menulist)
    } catch (e) {
      menulist = []
    }
  } else {
    menulist = []
  }
 
  const wrapForm = [
    {
      type: 'text',
      field: 'name',
      label: '导航栏名称',
      initval: wrap.name || '',
      required: true
    },
    {
      type: 'text',
      field: 'MenuNo',
      label: '菜单参数',
      initval: wrap.MenuNo || '',
      required: true
    },
    {
      type: 'number',
      field: 'width',
      label: '宽度',
      initval: wrap.width || 1200,
      tooltip: '导航栏主体内容宽度(包括logo、菜单、链接等)。',
      min: 400,
      max: 3000,
      precision: 0,
      required: true
    },
    {
      type: 'number',
      field: 'height',
      label: '高度',
      initval: wrap.height || 50,
      min: 50,
      max: 200,
      precision: 0,
      required: true
    },
    {
      type: 'source',
      field: 'logo',
      label: 'logo',
      initval: wrap.logo || '',
      required: false
    },
    {
      type: 'radio',
      field: 'property',
      label: 'logo属性',
      initval: wrap.property || '',
      required: false,
      options: [
        {value: '', label: '空'},
        {value: 'linkmenu', label: '关联菜单'},
        {value: 'link', label: '链接'}
      ],
      controlFields: [
        {field: 'linkmenu', values: ['linkmenu']},
        {field: 'link', values: ['link']},
      ]
    },
    {
      type: 'select',
      field: 'linkmenu',
      label: '关联菜单',
      initval: wrap.linkmenu || '',
      required: true,
      options: menulist
    },
    {
      type: 'textarea',
      field: 'link',
      label: '链接',
      initval: wrap.link || '',
      required: true,
      span: 24
    },
    {
      type: 'radio',
      field: 'user',
      label: '用户信息',
      initval: wrap.user || 'hidden',
      tooltip: '存在登录且取到登录信息时,显示用户头像、用户名及退出。',
      required: false,
      options: [
        {value: 'hidden', label: '隐藏'},
        {value: 'show', label: '显示'},
      ]
    },
    {
      type: 'radio',
      field: 'hover',
      label: '悬浮显示',
      initval: wrap.hover || 'false',
      tooltip: '默认隐藏菜单栏,鼠标在靠近顶部时显示。',
      required: false,
      options: [
        {value: 'false', label: '不启用'},
        {value: 'true', label: '启用'},
      ]
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || 'false',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ]
    },
  ]
 
  return wrapForm