centaline-data-driven 1.3.24 → 1.3.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven",
3
- "version": "1.3.24",
3
+ "version": "1.3.25",
4
4
  "description": "ccai",
5
5
  "author": "hjc <3226136347@qq.com>",
6
6
  "private": false,
@@ -166,7 +166,9 @@ const Base = function (source) {
166
166
  return bind;
167
167
  },
168
168
  reset() {
169
- if(this.type!==Enum.ControlType.Hidden){
169
+ if(this.type!==Enum.ControlType.Hidden
170
+ && this.type!==Enum.ControlType.Label
171
+ && this.type!==Enum.ControlType.MultiLineLabel){
170
172
  this.value = this.defaultValue;
171
173
  }
172
174
  },
@@ -4,7 +4,7 @@ const Enum = {
4
4
  //组件类型
5
5
  ControlType: {
6
6
  /// <summary>
7
- /// 文本标签
7
+ /// 单行文本标签
8
8
  /// </summary>
9
9
  Label: 1,
10
10
 
@@ -24,7 +24,7 @@ const Enum = {
24
24
  NumericTextBox: 4,
25
25
 
26
26
  /// <summary>
27
- ///
27
+ /// 文本框+高级搜索
28
28
  /// </summary>
29
29
  TextBoxWithButton: 5,
30
30
 
@@ -38,7 +38,6 @@ const Enum = {
38
38
  /// </summary>
39
39
  EmailText: 7,
40
40
 
41
-
42
41
  /// <summary>
43
42
  /// 下拉框
44
43
  /// </summary>
@@ -144,7 +143,6 @@ const Enum = {
144
143
  /// </summary>
145
144
  MultiSelectNoSearch: 28,
146
145
 
147
-
148
146
  /// <summary>
149
147
  /// 分组间的分隔线
150
148
  /// </summary>
@@ -209,32 +207,44 @@ const Enum = {
209
207
  /// 敏感数据小眼睛控件
210
208
  /// </summary>
211
209
  SensitiveEye: 41,
210
+
212
211
  /// <summary>
213
212
  /// 复选
214
213
  /// </summary>
215
214
  CheckBox: 43,
215
+
216
216
  /*带标签的超链接列表*/
217
217
  HyperlinkListWithLabel: 44,
218
+
218
219
  /// <summary>
219
220
  /// 图片选择
220
221
  /// </summary>
221
222
  PhotoSelect: 45,
223
+
222
224
  /// <summary>
223
225
  /// 年份-月份控件
224
226
  /// </summary>
225
227
  DateYearMonth: 46,
228
+
226
229
  /// <summary>
227
230
  /// 重复控件
228
231
  /// </summary>
229
232
  Repeat: 47,
233
+
230
234
  /// <summary>
231
235
  /// 复合控件
232
236
  /// </summary>
233
237
  Compound: 48,
238
+
234
239
  /// <summary>
235
240
  /// 表单
236
241
  /// </summary>
237
242
  From: 49,
243
+ /// <summary>
244
+ /// 列表的的自定义列
245
+ /// </summary>
246
+ CustomizeColumns: 50,
247
+
238
248
  },
239
249
 
240
250
  //返回状态码
@@ -35,10 +35,12 @@ import PhotoSelect from '../PhotoSelect';
35
35
  import Repeat from '../Repeat';
36
36
  import Compound from '../Compound';
37
37
  import RichText from '../RichText';
38
+ import DragSort from '../DragSort';
39
+
40
+
38
41
 
39
42
  const LibFunction = {
40
- install(Vue) {
41
- },
43
+ install(Vue) {},
42
44
  GetControl(field, source, showLabel, isList) {
43
45
 
44
46
  let item;
@@ -62,32 +64,25 @@ const LibFunction = {
62
64
  if (isList) {
63
65
  if (field.controlType === Enum.ControlType.Date) {
64
66
  field.width = field.width || 250;
65
- }
66
- else if (field.controlType === Enum.ControlType.DateTime) {
67
+ } else if (field.controlType === Enum.ControlType.DateTime) {
67
68
  field.width = field.width || 280;
68
- }
69
- else if (field.controlType === Enum.ControlType.DateRange) {
69
+ } else if (field.controlType === Enum.ControlType.DateRange) {
70
70
  field.width = field.width || 300;
71
- }
72
- else if (field.controlType === Enum.ControlType.DateTimeRange) {
71
+ } else if (field.controlType === Enum.ControlType.DateTimeRange) {
73
72
  field.width = field.width || 350;
74
- }
75
- else if (field.controlType === Enum.ControlType.ButtonSearch ||
73
+ } else if (field.controlType === Enum.ControlType.ButtonSearch ||
76
74
  field.controlType === Enum.ControlType.ButtonReset ||
77
75
  field.controlType === Enum.ControlType.ButtonAdvancedSearch) {
78
76
  field.width = '';
79
- }
80
- else if (field.controlType === Enum.ControlType.NumericRange) {
77
+ } else if (field.controlType === Enum.ControlType.NumericRange) {
81
78
  field.width = field.width || 280;
82
- }
83
- else if (field.controlType === Enum.ControlType.RadioButton) {
79
+ } else if (field.controlType === Enum.ControlType.RadioButton) {
84
80
  if (!field.displayLabelAfterSelected) {
85
81
  showLabel = false;
86
82
  }
87
83
  field.width = field.width || 300;
88
84
  field.placeholder1 = field.placeholder1 || field.controlLabel || '';
89
- }
90
- else {
85
+ } else {
91
86
  showLabel = false;
92
87
  field.width = field.width || 200;
93
88
  field.placeholder1 = field.placeholder1 || field.controlLabel || '';
@@ -96,24 +91,24 @@ const LibFunction = {
96
91
 
97
92
  let moreActionRouter;
98
93
  switch (field.controlType) {
99
- case Enum.ControlType.Photo://图片
100
- case Enum.ControlType.TextBoxWithButton://带按钮的文本框
101
- case Enum.ControlType.EmailText://电子邮件编辑框
102
- case Enum.ControlType.Time://时间控件
94
+ case Enum.ControlType.Photo: //图片
95
+ case Enum.ControlType.TextBoxWithButton: //带按钮的文本框
96
+ case Enum.ControlType.EmailText: //电子邮件编辑框
97
+ case Enum.ControlType.Time: //时间控件
103
98
  item = L(field);
104
99
  item.is = 'ct-labelText';
105
100
  item.value = "暂不支持该组件";
106
101
  break;
107
- case Enum.ControlType.PhoneNumberText://电话号码编辑框
102
+ case Enum.ControlType.PhoneNumberText: //电话号码编辑框
108
103
  moreActionRouter = LibFunction.getRouter(source.actionRouters, field.moreActionRouterKey);
109
104
  item = SosTt(field, moreActionRouter);
110
105
  item.is = 'ct-sosTt';
111
106
  break;
112
- case Enum.ControlType.GroupSplitLine://分割线
107
+ case Enum.ControlType.GroupSplitLine: //分割线
113
108
  item = Gp(field);
114
109
  item.is = 'ct-group-line';
115
110
  break;
116
- case Enum.ControlType.SearchListBox://搜索下拉框
111
+ case Enum.ControlType.SearchListBox: //搜索下拉框
117
112
  moreActionRouter = LibFunction.getRouter(source.actionRouters, field.moreActionRouterKey);
118
113
  item = Sos(field, moreActionRouter);
119
114
  item.is = 'ct-sos';
@@ -122,80 +117,85 @@ const LibFunction = {
122
117
  // item = Ttts(field);
123
118
  // item.is = 'ct-iti';
124
119
  // break;
125
- case Enum.ControlType.NumericRange:
120
+ case Enum.ControlType.NumericRange://数字区间
121
+
126
122
  item = Iti(field);
127
123
  item.is = 'ct-iti';
128
124
  break;
129
- case Enum.ControlType.ComboBox://下拉框
125
+ case Enum.ControlType.ComboBox: //下拉框
130
126
  moreActionRouter = LibFunction.getRouter(source.actionRouters, field.moreActionRouterKey);
131
127
  item = So(field, moreActionRouter);
132
128
  item.is = 'ct-so';
133
129
  break;
134
- case Enum.ControlType.TextBox://单行文本框
130
+ case Enum.ControlType.TextBox: //单行文本框
135
131
  item = T(field, "text");
136
132
  item.is = 'ct-text';
137
133
  break;
138
- case Enum.ControlType.MultiLineText://多行文本框
134
+ case Enum.ControlType.MultiLineText: //多行文本框
139
135
  item = T(field, "textarea");
140
136
  item.is = 'ct-text';
141
137
  break;
142
- case Enum.ControlType.MultiLineLabel://多行文本框(Label,不可编辑)
138
+ case Enum.ControlType.MultiLineLabel: //多行文本框(Label,不可编辑)
143
139
  item = T(field, "textarea", true);
144
140
  item.is = 'ct-text';
145
141
  break;
146
- case Enum.ControlType.MultiSelectWithSearch://带搜索多选
142
+ case Enum.ControlType.MultiSelectWithSearch: //带搜索多选
147
143
  moreActionRouter = LibFunction.getRouter(source.actionRouters, field.moreActionRouterKey);
148
144
  item = Tags(field, moreActionRouter);
149
145
  item = base.copy(item, {
150
- attrs: { collapseTags: true }
146
+ attrs: {
147
+ collapseTags: true
148
+ }
151
149
  });
152
150
  item.is = 'ct-tags';
153
151
  break;
154
- case Enum.ControlType.MultiSelectNoSearch://不带搜索多选
152
+ case Enum.ControlType.MultiSelectNoSearch: //不带搜索多选
155
153
  moreActionRouter = LibFunction.getRouter(source.actionRouters, field.moreActionRouterKey);
156
154
  item = Mo(field, moreActionRouter);
157
155
  item = base.copy(item, {
158
- attrs: { collapseTags: true }
156
+ attrs: {
157
+ collapseTags: true
158
+ }
159
159
  });
160
160
  item.is = 'ct-mo';
161
161
  break;
162
- case Enum.ControlType.RadioButton://单选
162
+ case Enum.ControlType.RadioButton: //单选
163
163
  item = Seg(field);
164
164
  item.is = 'ct-seg';
165
165
  break;
166
- case Enum.ControlType.Switch://开关
166
+ case Enum.ControlType.Switch: //开关
167
167
  item = Sw(field);
168
168
  item.is = 'ct-sw';
169
169
  break;
170
- case Enum.ControlType.TimeRange://时间区间
170
+ case Enum.ControlType.TimeRange: //时间区间
171
171
  item = TimeSelect(field, true, 'time');
172
172
  item.is = 'ct-time-select';
173
173
  break;
174
- case Enum.ControlType.Date://日期
174
+ case Enum.ControlType.Date: //日期
175
175
  item = D(field, 'date');
176
176
  item.is = 'ct-date';
177
177
  break;
178
- case Enum.ControlType.DateYearMonth://年份-月份
178
+ case Enum.ControlType.DateYearMonth: //年份-月份
179
179
  item = D(field, 'month');
180
180
  item.is = 'ct-date';
181
181
  break;
182
- case Enum.ControlType.DateTime://日期时间
182
+ case Enum.ControlType.DateTime: //日期时间
183
183
  item = D(field, 'datetime');
184
184
  item.is = 'ct-date';
185
185
  break;
186
- case Enum.ControlType.DateRange://日期区间
186
+ case Enum.ControlType.DateRange: //日期区间
187
187
  item = Dtd(field);
188
188
  item.is = 'ct-dtd';
189
189
  break;
190
- case Enum.ControlType.DateTimeRange://日期时间区间
190
+ case Enum.ControlType.DateTimeRange: //日期时间区间
191
191
  item = Dtd(field, 'datetime');
192
192
  item.is = 'ct-dtd';
193
193
  break;
194
- //case 'mt':
195
- // item = Mt(field);
196
- // item.is = 'ct-mt';
197
- // break;
198
- case Enum.ControlType.List://列表
194
+ //case 'mt':
195
+ // item = Mt(field);
196
+ // item.is = 'ct-mt';
197
+ // break;
198
+ case Enum.ControlType.List: //列表
199
199
  var listobj = source.list.find((v1) => {
200
200
  return v1.name === field.fieldName1;
201
201
  });
@@ -209,7 +209,7 @@ const LibFunction = {
209
209
  //item.is = 'ct-form-list';
210
210
  item.is = 'ct-form-list-table';
211
211
  break;
212
- case Enum.ControlType.Repeat://重复
212
+ case Enum.ControlType.Repeat: //重复
213
213
  var listobj = source.list.find((v1) => {
214
214
  return v1.name === field.fieldName1;
215
215
  });
@@ -220,53 +220,53 @@ const LibFunction = {
220
220
  item = Repeat(listobj, field);
221
221
  item.is = 'ct-repeat';
222
222
  break;
223
- case Enum.ControlType.Compound://复合
224
- item = Compound(field,source);
223
+ case Enum.ControlType.Compound: //复合
224
+ item = Compound(field, source);
225
225
  item.is = 'ct-compound';
226
226
  break;
227
- case Enum.ControlType.Hidden://隐藏控件
227
+ case Enum.ControlType.Hidden: //隐藏控件
228
228
  item = Hd(field);
229
229
  break;
230
- case Enum.ControlType.Group://分组
230
+ case Enum.ControlType.Group: //分组
231
231
  item = GM(field);
232
232
  item.is = 'ct-group';
233
233
  break;
234
- case Enum.ControlType.IndependentGroup://独立分组 最后的分组
234
+ case Enum.ControlType.IndependentGroup: //独立分组 最后的分组
235
235
  item = GM(field);
236
236
  item.is = 'ct-independentGroup';
237
237
  break;
238
- case Enum.ControlType.Label://文本
238
+ case Enum.ControlType.Label://单行文本标签
239
239
  item = L(field);
240
240
  item.is = 'ct-labelText';
241
241
  break;
242
- case Enum.ControlType.CheckBoxList://复选列表
242
+ case Enum.ControlType.CheckBoxList: //复选列表
243
243
  item = Checkbox(field);
244
244
  item.is = 'ct-checkbox';
245
245
  break;
246
- case Enum.ControlType.NumericTextBox://数字文本框
246
+ case Enum.ControlType.NumericTextBox: //数字文本框
247
247
  item = InputNumber(field);
248
248
  item.is = 'ct-inputNumber';
249
249
  break;
250
- case Enum.ControlType.ButtonCommon://普通按钮
250
+ case Enum.ControlType.ButtonCommon: //普通按钮
251
251
  moreActionRouter = LibFunction.getRouter(source.actionRouters, field.fieldName1);
252
252
  item = Button(field, moreActionRouter);
253
253
  item.is = 'ct-btn';
254
254
  // item.attrs.class=item.attrs.class+' max-btn-gray ';
255
255
  break;
256
- case Enum.ControlType.ButtonSearch://查询按钮
256
+ case Enum.ControlType.ButtonSearch: //查询按钮
257
257
  item = Button(field);
258
258
  item.is = 'ct-btn';
259
259
  item.action = 'search';
260
260
  item.attrs.class = item.attrs.class + ' max-search-btn ';
261
261
  break;
262
- case Enum.ControlType.ButtonAdvancedSearch://高级查询按钮
262
+ case Enum.ControlType.ButtonAdvancedSearch: //高级查询按钮
263
263
  item = Button(field);
264
264
  item.is = 'ct-btn';
265
265
  item.action = 'showHigh';
266
266
  item.attrs.class = item.attrs.class + ' max-search-btn ';
267
267
  item.icon = 'max-open';
268
268
  break;
269
- case Enum.ControlType.ButtonReset://重置查询按钮
269
+ case Enum.ControlType.ButtonReset: //重置查询按钮
270
270
  item = Button(field);
271
271
  item.is = 'ct-btn';
272
272
  item.action = 'reset';
@@ -274,7 +274,7 @@ const LibFunction = {
274
274
  item.borderColor = '#519DA6';
275
275
  item.attrs.class = item.attrs.class + ' max-reset-btn ';
276
276
  break;
277
- case Enum.ControlType.File://文件
277
+ case Enum.ControlType.File: //文件
278
278
  var router = source.actionRouters.find((v1) => {
279
279
  return v1.key === field.fieldName1;
280
280
  });
@@ -284,15 +284,14 @@ const LibFunction = {
284
284
  if (v.GroupID == field.fieldName1) {
285
285
  files.push(v);
286
286
  }
287
- }
288
- else {
287
+ } else {
289
288
  files.push(v);
290
289
  }
291
290
  })
292
291
  item = File(field, files, router, source.parameterAction);
293
292
  item.is = 'ct-file';
294
293
  break;
295
- case Enum.ControlType.PhotoSelect://图片选择
294
+ case Enum.ControlType.PhotoSelect: //图片选择
296
295
  var router = source.actionRouters.find((v1) => {
297
296
  return v1.key === field.fieldName1;
298
297
  });
@@ -302,21 +301,20 @@ const LibFunction = {
302
301
  if (v.GroupID == field.fieldName1) {
303
302
  files.push(v);
304
303
  }
305
- }
306
- else {
304
+ } else {
307
305
  files.push(v);
308
306
  }
309
307
  })
310
308
  item = PhotoSelect(field, files, router, source.parameterAction);
311
309
  item.is = 'ct-photoselect';
312
310
  break;
313
- case Enum.ControlType.PasswordTextBox://密码
311
+ case Enum.ControlType.PasswordTextBox: //密码
314
312
  item = T(field, "text", false, true);
315
313
  item.is = 'ct-text';
316
314
  break;
317
- case Enum.ControlType.RichText://富文本框
318
- var router ={};
319
- if(source.actionRouters){
315
+ case Enum.ControlType.RichText: //富文本框
316
+ var router = {};
317
+ if (source.actionRouters) {
320
318
  router = source.actionRouters.find((v1) => {
321
319
  return v1.key === field.fieldName1;
322
320
  });
@@ -324,11 +322,11 @@ const LibFunction = {
324
322
  item = RichText(field, router);
325
323
  item.is = 'ct-rich-text';
326
324
  break;
327
- case Enum.ControlType.MultiComboBoxWithTextBox://多个下拉框后面带1个文本框,下拉框最多支持3个
325
+ case Enum.ControlType.MultiComboBoxWithTextBox: //多个下拉框后面带1个文本框,下拉框最多支持3个
328
326
  item = ComboBoxWithTextBox(field);
329
327
  item.is = 'ct-combobox-with-textbox';
330
328
  break;
331
- case Enum.ControlType.SearchPage://搜索列表页面
329
+ case Enum.ControlType.SearchPage: //搜索列表页面
332
330
  item = {};
333
331
  item.is = 'ct-searchlist';
334
332
  item.bindPara = {
@@ -338,31 +336,35 @@ const LibFunction = {
338
336
  apiParam: field.code3 ? JSON.parse(field.code3) : {}
339
337
  };
340
338
  break;
341
- case Enum.ControlType.LineFeed://分组
339
+ case Enum.ControlType.LineFeed: //分组
342
340
  item = Base(field);
343
341
  item.is = 'ct-linefeed';
344
342
  break;
345
- case Enum.ControlType.HyperLinkWithLabel://带标签的超链接
343
+ case Enum.ControlType.HyperLinkWithLabel: //带标签的超链接
346
344
  moreActionRouter = LibFunction.getRouter(source.actionRouters, field.fieldName1);
347
345
  item = HyperLink(field, moreActionRouter);
348
346
  item.is = 'ct-hyperLink';
349
347
  break;
350
- case Enum.ControlType.HyperlinkListWithLabel://带标签的超链接列表
348
+ case Enum.ControlType.HyperlinkListWithLabel: //带标签的超链接列表
351
349
  item = HyperLinkList(field);
352
350
  item.is = 'ct-hyperLinkList';
353
351
  break;
354
- case Enum.ControlType.PlaceHolder://占位控件
352
+ case Enum.ControlType.PlaceHolder: //占位控件
355
353
  item = PlaceHolder(field);
356
354
  item.is = 'ct-ph';
357
355
  break;
358
- case Enum.ControlType.SensitiveEye://敏感数据小眼睛控
356
+ case Enum.ControlType.SensitiveEye: //敏感数据小眼睛控
359
357
  item = SensitiveEye(field);
360
358
  item.is = 'ct-sensitiveeye';
361
359
  break;
362
- case Enum.ControlType.CheckBox://复选框
360
+ case Enum.ControlType.CheckBox: //复选框
363
361
  item = Cb(field);
364
362
  item.is = 'ct-cb';
365
363
  break;
364
+ case Enum.ControlType.CustomizeColumns: //拖拽排序
365
+ item = DragSort(field);
366
+ item.is = 'ct-dragSort';
367
+ break;
366
368
  default:
367
369
  item = L(field);
368
370
  item.is = 'ct-labelText';
@@ -377,11 +379,9 @@ const LibFunction = {
377
379
  var colNum = source.colSpan ? source.colSpan : 3;
378
380
  if (item1.excLine) {
379
381
  num = 24;
380
- }
381
- else if (field.spanCols > 0) {
382
+ } else if (field.spanCols > 0) {
382
383
  num = field.spanCols * (24 / colNum);
383
- }
384
- else {
384
+ } else {
385
385
  num = 24 / colNum;
386
386
  }
387
387
  return num;
@@ -399,9 +399,9 @@ const LibFunction = {
399
399
  //size: 'mini'
400
400
  },
401
401
  get excLine() {
402
- return field.singleLine === true || field.controlType === Enum.ControlType.GroupSplitLine
403
- || field.controlType === Enum.ControlType.List || field.controlType === Enum.ControlType.File
404
- || field.controlType === Enum.ControlType.SearchPage;
402
+ return field.singleLine === true || field.controlType === Enum.ControlType.GroupSplitLine ||
403
+ field.controlType === Enum.ControlType.List || field.controlType === Enum.ControlType.File ||
404
+ field.controlType === Enum.ControlType.SearchPage;
405
405
  },
406
406
  showLabel: showLabel
407
407
  };
@@ -425,4 +425,3 @@ if (typeof window !== 'undefined' && window.Vue) {
425
425
  window.Vue.use(LibFunction);
426
426
  }
427
427
  export default LibFunction;
428
-