king
2023-01-17 d5ce81026882ada34e5d49411be7c90ee96cc102
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
import MenuUtils from '@/utils/utils-custom.js'
 
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, id) {
  let menu = window.GLOB.customMenu
  let modules = MenuUtils.getSupModules(menu.components, id, menu.interfaces)
  let books = []
  let bookids = []
  menu.components.forEach(item => {
    if (item.subtype === 'account') {
      books.push({
        value: item.uuid,
        label: item.name
      })
      bookids.push(item.uuid)
    }
  })
 
  modules = modules.filter(item => !bookids.includes(item.value))
 
  const wrapForm = [
    // {
    //   type: 'text',
    //   field: 'title',
    //   label: '标题',
    //   initval: wrap.title || '',
    //   required: false
    // },
    {
      type: 'radio',
      field: 'type',
      label: '类型',
      initval: wrap.type || 'edit',
      required: true,
      options: [
        {value: 'edit', label: '编辑'},
        {value: 'check', label: '查看'},
      ]
    },
    {
      type: 'text',
      field: 'name',
      label: '组件名称',
      initval: wrap.name || '',
      tooltip: '用于组件间的区分。',
      required: true
    },
    {
      type: 'number',
      field: 'width',
      label: '宽度',
      initval: wrap.width || 24,
      tooltip: '栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    {
      type: 'select',
      field: 'supBook',
      label: '账套',
      initval: wrap.supBook || '',
      required: true,
      options: books,
      allowClear: true
    },
    {
      type: 'cascader',
      field: 'supModule',
      label: '上级组件',
      initval: wrap.supModule || [],
      required: false,
      options: modules,
      allowClear: true,
    },
  ]
 
  return wrapForm