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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
  | const components = [ 
 |      { 
 |          id: 1, 
 |          name: "输入框", 
 |          type: "text", 
 |          value: "", 
 |          icon: "el-icon-document", 
 |      }, 
 |      { 
 |          id: 2, 
 |          name: "textarea", 
 |          type: "textarea", 
 |          value: "", 
 |          icon: "el-icon-document-copy", 
 |      }, 
 |      { 
 |          id: 3, 
 |          name: "日期", 
 |          type: "date", 
 |          icon: "el-icon-date", 
 |          value: null, 
 |      }, 
 |      { 
 |          id: 4, 
 |          name: "switch", 
 |          type: "switch", 
 |          icon: "el-icon-turn-off", 
 |          value: 0, 
 |      }, 
 |      { id: 5, name: "单选", type: "radio", icon: "el-icon-aim", value: 0, data: [{ label: "0", value: "请设置数据源1" }, { label: "1", value: "请设置数据源2" }], key: "" }, 
 |      { 
 |          id: 6, 
 |          name: "多选", 
 |          values: [], 
 |          type: "checkbox", 
 |          key: "", 
 |          data: [{ label: "请设置数据源", value: "请设置数据源" }], 
 |          icon: "el-icon-circle-check", 
 |      }, 
 |      { 
 |          id: 7, 
 |          name: "下拉框", 
 |          value: null, 
 |          key: "", 
 |          data: [{ label: "请设置数据源", value: "请设置数据源" }], 
 |          type: "select", 
 |          icon: "el-icon-arrow-down", 
 |      }, 
 |      { 
 |          id: 8, 
 |          name: "下拉框多选", 
 |          type: "selectList", 
 |          key: "", 
 |          values: [], 
 |          data: [{ label: "请设置数据源", value: "请设置数据源" }], 
 |          icon: "el-icon-arrow-down", 
 |      }, 
 |      { 
 |          id: 81, 
 |          name: "级联", 
 |          type: "cascader", 
 |          icon: "el-icon-share", 
 |          values: [], 
 |          key: "", 
 |          data: [ 
 |              { 
 |                  value: "请配置数据源", 
 |                  label: "请配置数据源", 
 |                  children: [ 
 |                      { 
 |                          value: "具体", 
 |                          label: "菜单:下拉框绑定设置", 
 |                      }, 
 |                      { 
 |                          value: "color", 
 |                          label: "可参照字典编号[tree_roles]", 
 |                      } 
 |                  ], 
 |              }, 
 |          ], 
 |      }, 
 |      { 
 |          id: 9, 
 |          name: "图片上传", 
 |          type: "img", 
 |          url: "", 
 |          maxSize: 3, 
 |          fileInfo: [], 
 |          multiple: false, 
 |          autoUpload: false, 
 |          maxFile: 5, 
 |          icon: "el-icon-picture-outline", 
 |      }, 
 |      { 
 |          id: 10, 
 |          name: "excel上传", 
 |          url: "", 
 |          maxSize: 3, 
 |          multiple: false, 
 |          autoUpload: false, 
 |          maxFile: 5, //最多可上传5个文件  
 |          fileInfo: [], 
 |          type: "excel", 
 |          icon: "el-icon-upload", 
 |      }, 
 |      { 
 |          id: 11, 
 |          name: "文件上传", 
 |          type: "file", 
 |          url: "", 
 |          maxSize: 3, 
 |          multiple: false, 
 |          autoUpload: false, 
 |          maxFile: 5, 
 |          fileInfo: [], 
 |          icon: "el-icon-folder-opened", 
 |      }, 
 |      { 
 |          id: 12, 
 |          name: "分段信息", 
 |          type: "line", 
 |          icon: "el-icon-guide", 
 |      }, 
 |      { 
 |          id: 13, 
 |          name: "编辑器", 
 |          type: "editor", 
 |          value: "", 
 |          url: "", 
 |          height: 200, 
 |          icon: "el-icon-notebook-2", 
 |      }, 
 |      { 
 |          id: 13, 
 |          name: "弹出框", 
 |          type: "box", 
 |          value: "", 
 |          url: "", 
 |          height: 250, 
 |          icon: "el-icon-notebook-2", 
 |      }, 
 |      { 
 |          id: 13, 
 |          name: "表格", 
 |          type: "table", 
 |          tabs: false, 
 |          columns: [ 
 |              { title: "字段1", field: "field1", show: true, required: false, edit: false, dataType: null, dataSource: null, width: 120, orderNo: null }, 
 |              { title: "字段2", field: "field2", show: true, required: false, edit: false, dataType: null, dataSource: null, width: 120, orderNo: null }, 
 |              { title: "字段3", field: "field3", show: true, required: false, edit: false, dataType: null, dataSource: null, width: 120, orderNo: null }, 
 |              { title: "字段4", field: "field4", show: true, required: false, edit: false, dataType: null, dataSource: null, width: 120, orderNo: null }, 
 |              // { title: "字段5", field: "Field5", width: 120 }, 
 |          ], 
 |          tableData: [ 
 |              { 
 |                  field1: "field1", 
 |                  field2: "field2", 
 |                  field3: "field3", 
 |                  field4: "field4", 
 |              }, 
 |              { 
 |                  field1: "field1", 
 |                  field2: "field2", 
 |                  field3: "field3", 
 |                  field4: "field4", 
 |              }, 
 |              { 
 |                  field1: "field1", 
 |                  field2: "field2", 
 |                  field3: "field3", 
 |                  field4: "field4", 
 |              }, 
 |          ], 
 |          height: 150, 
 |          icon: "el-icon-c-scale-to-original", 
 |          url: null, 
 |          index: false, //item.index, 
 |          height: 200, 
 |          index: false, 
 |          columnIndex: false, 
 |          ck: true, 
 |          buttons: [ 
 |              { name: '添加行', ck: false, icon: 'el-icon-plus',value:'add' }, 
 |          { name: '删除行', ck: false, icon: 'el-icon-delete',value:'del' },  
 |          { name: '刷新', ck: false ,icon:'el-icon-refresh-right',value:'ref'}], 
 |      }, 
 |  ] 
 |  const tableOption = [ 
 |      { field: 'field', title: '字段', edit: { type: "text", keep: true }, width: 160 }, 
 |      { field: 'title', title: '字段中文名', edit: { type: "text", keep: true }, width: 120 }, 
 |      { field: 'show', title: '是否显示', edit: { type: "switch", keep: true }, width: 90 }, 
 |      { 
 |          field: 'dataType', title: '显示类型', edit: { type: "select", keep: true }, width: 120, bind: { 
 |              key: '', data: [ 
 |                  { "key": "switch", "value": "单选" }, 
 |                  { "key": "date", "value": "年月日" }, 
 |                  { "key": "img", "value": "图片" }, 
 |                  { "key": "excel", "value": "excel" }, 
 |                  { "key": "file", "value": "文件" } 
 |              ] 
 |          } 
 |      }, 
 |    
 |      { field: 'required', title: '是否必填', edit: { type: "switch", keep: true }, width: 90 }, 
 |      { field: 'edit', title: '是否可编辑', edit: { type: "switch", keep: true }, width: 90 }, 
 |      { 
 |          field: 'editType', title: '编辑类型', edit: { type: "select", keep: true, }, width: 120, bind: { 
 |              key: '', data: [{ "key": "text", "value": "输入框" }, 
 |              { "key": "switch", "value": "单选" }, 
 |              { "key": "select", "value": "下拉框" }, 
 |              { "key": "selectList", "value": "下拉框多选" }, 
 |              { "key": "date", "value": "日期" }, 
 |              { "key": "datetime", "value": "日期时分秒" }, 
 |              { "key": "checkbox", "value": "复选框多选" }, 
 |              { "key": "mail", "value": "邮箱地址" }, 
 |              { "key": "number", "value": "数字" }, 
 |              { "key": "decimal", "value": "小数" }, 
 |              { "key": "phone", "value": "手机号" }, 
 |              ] 
 |          } 
 |      }, 
 |      { field: 'dataSource', title: '数据源', edit: { type: "select", keep: true, data: [] }, bind: { key: '', data: [] }, width: 120 }, 
 |      { field: 'width', title: '列宽度', edit: { type: "text", keep: true }, width: 80 }, 
 |      { field: 'orderNo', title: '列显示顺序', edit: { type: "text", keep: true }, width: 100 } 
 |  ]; 
 |  export { components, tableOption } 
 |  
  |