ocpview-plus 1.1.9 → 1.2.1

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": "ocpview-plus",
3
- "version": "1.1.9",
3
+ "version": "1.2.1",
4
4
  "title": "ocpviewPlus",
5
5
  "description": "A high quality Service UI components Library with Vue.js",
6
6
  "homepage": "",
@@ -1,12 +1,14 @@
1
1
  <template>
2
2
  <div style="padding-left:10px;padding-right:10px">
3
- <Tree v-if="hackReset" :data="data" :render="renderContent" class="demo-tree-render"></Tree>
3
+ <CompatTree v-if="hackReset" :data="data" :render="renderContent" class="demo-tree-render"></CompatTree>
4
4
  </div>
5
5
  </template>
6
6
  <script>
7
+ import CompatTree from '../tree/CompatTree.vue';
7
8
  import { resolveComponent } from 'vue';
8
9
  export default {
9
10
  name:'conditionfilterbox',
11
+ components : {CompatTree},
10
12
  props:{
11
13
  config: {
12
14
  type: Object,
@@ -100,7 +102,7 @@ import { resolveComponent } from 'vue';
100
102
  root.expand =true;
101
103
  root.selector = this.myConfig.selector[0].code;
102
104
  root.selectorClass = 1;
103
- root.render = this.renderRootStaticContent;
105
+ root.render = this.renderRootStaticContent;
104
106
  root.children = [];
105
107
  let obj = {
106
108
  title:'连接关系',
@@ -129,7 +131,7 @@ import { resolveComponent } from 'vue';
129
131
  root.title = this.myConfig.rootName;
130
132
  } else {
131
133
  root.title = '筛选条件';
132
- }
134
+ }
133
135
  root.expand =true;
134
136
  root.children = [];
135
137
  root.render = this.renderRootStaticContent;
@@ -180,9 +182,9 @@ import { resolveComponent } from 'vue';
180
182
  this.data.push(root);
181
183
  this.$nextTick(() =>{
182
184
  this.hackReset = true;
183
- });
185
+ });
184
186
  },
185
-
187
+
186
188
  // eslint-disable-next-line no-unused-vars
187
189
  renderRootContent (h, {root, node, data }) {
188
190
  let buttonConfig = Object.assign({}, this.buttonProps, {icon: 'ios-add',type: 'primary'});
@@ -218,7 +220,7 @@ import { resolveComponent } from 'vue';
218
220
  'vertical-align':'middle'
219
221
  }
220
222
  },data.title),
221
- h('span',{
223
+ h('span',{
222
224
  style: {
223
225
  display: 'inline-block',
224
226
  float: 'right',
@@ -233,10 +235,10 @@ import { resolveComponent } from 'vue';
233
235
  onDoAction:(val) =>{
234
236
  if (val.name === 'doAdd') {
235
237
  this.append(data);
236
- }
238
+ }
237
239
  if (val.name === 'doDel') {
238
240
  this.remove(root, node, data);
239
- }
241
+ }
240
242
  },
241
243
  onClick:(form) => {
242
244
  if (!data.form) {
@@ -293,7 +295,7 @@ import { resolveComponent } from 'vue';
293
295
  return this.myConfig.setOperData(el, tempData);
294
296
  } else {
295
297
  return tempData;
296
- }
298
+ }
297
299
  },
298
300
  remove (root, node, data) {
299
301
  const parentKey = root.find(el => el === node).parent;
@@ -301,14 +303,14 @@ import { resolveComponent } from 'vue';
301
303
  const index = parent.children.indexOf(data);
302
304
  parent.children.splice(index, 1);
303
305
  },
304
- getQuerySearchParam () {
306
+ getQuerySearchParam () {
305
307
  let para = {};
306
308
  if (this.myConfig.selector.length === 1){
307
309
  if (this.data[0].children === undefined) {
308
310
  return para;
309
311
  } else {
310
312
  this.creatSearchParam(this.data[0],para,1);
311
- }
313
+ }
312
314
  } else {
313
315
  if (this.data[0].children[0].children === undefined) {
314
316
  return para;
@@ -368,9 +370,9 @@ import { resolveComponent } from 'vue';
368
370
  let str = pro ;
369
371
  for(let temp in obj) {
370
372
  if (temp === '==') {
371
- str =str + ' = ';
373
+ str =str + ' = ';
372
374
  } else {
373
- str =str +' ' + temp + ' ';
375
+ str =str +' ' + temp + ' ';
374
376
  }
375
377
  let v = obj[temp];
376
378
  let index = this.myConfig.items.findIndex(el => el.name === pro);
@@ -409,11 +411,11 @@ import { resolveComponent } from 'vue';
409
411
  } else {
410
412
  param[obj.field] = {};
411
413
  if (obj.value.value !== undefined) {
412
- param[obj.field][obj.oper] = obj.value.value;
414
+ param[obj.field][obj.oper] = obj.value.value;
413
415
  } else {
414
- param[obj.field][obj.oper] = obj.value;
416
+ param[obj.field][obj.oper] = obj.value;
415
417
  }
416
- }
418
+ }
417
419
  return param;
418
420
  },
419
421
  creatSearchParam(data,obj,flag) {
@@ -451,7 +453,7 @@ import { resolveComponent } from 'vue';
451
453
  temp[data[i].children[0].form.connector] = [];
452
454
  this.creatSearchParamCommon(data[i].children[0].children,temp[data[i].children[0].form.connector]);
453
455
  if (temp[data[i].children[0].form.connector].length > 0) {
454
- temp[data[i].children[0].form.connector].push(this.getCommomParam(data[i].form));
456
+ temp[data[i].children[0].form.connector].push(this.getCommomParam(data[i].form));
455
457
  obj.push(temp);
456
458
  } else {
457
459
  obj.push(this.getCommomParam(data[i].form));
@@ -462,7 +464,7 @@ import { resolveComponent } from 'vue';
462
464
  }
463
465
  }
464
466
  }
465
- }
467
+ }
466
468
  },
467
469
  clearData() {
468
470
  this.initData();
@@ -39,7 +39,7 @@
39
39
  } else {
40
40
  span = this.myConfig.itemSpan * Number(el.colNum);
41
41
  }
42
- }
42
+ }
43
43
  }
44
44
  if (span > 24) {
45
45
  span = 24;
@@ -47,6 +47,7 @@
47
47
  return span;
48
48
  },
49
49
  initFormItem(el) {
50
+ // el.label = el.label + "::";
50
51
  el.status = true;
51
52
  // 处理事件
52
53
  if (el.valueChanged) {
@@ -87,7 +88,7 @@
87
88
  el.data = this.dictData[dictkey];
88
89
  }
89
90
  }
90
- }
91
+ }
91
92
  // 处理共同属性
92
93
  this.setFormItemCommonPro(el);
93
94
  return el;
@@ -108,16 +109,16 @@
108
109
  this.items.push(item);
109
110
  });
110
111
  }
111
-
112
+
112
113
  if (this.customInit){
113
114
  this.customInit();
114
115
  }
115
116
  Object.assign(this.form , this.initForm);
116
- Object.assign(this.oldForm , this.form);
117
+ Object.assign(this.oldForm , this.form);
117
118
  },
118
-
119
+
119
120
  setData(obj) {
120
- if (obj) {
121
+ if (obj) {
121
122
  this.$refs.form.resetFields();
122
123
  if (obj.flag === 'I') {
123
124
  this.form = Object.assign({}, this.initForm, obj);
@@ -148,7 +149,7 @@
148
149
  }
149
150
  this.oldForm = this.$Method.copy(this.form);
150
151
  }
151
- },
152
+ },
152
153
  isChange () {
153
154
  if (JSON.stringify(this.form) !== JSON.stringify(this.oldForm)) {
154
155
  return true;
@@ -171,12 +172,12 @@
171
172
  }
172
173
  if (obj.sname) {
173
174
  temp[obj.sname] = obj.svalue;
174
- }
175
+ }
175
176
  if (obj.ename) {
176
177
  temp[obj.ename] = obj.evalue;
177
- }
178
+ }
178
179
  this.form = Object.assign({}, this.form, temp);
179
- this.$emit('inputValue', obj);
180
+ this.$emit('inputValue', obj);
180
181
  },
181
182
  validatorIsNull(rule, value, callbacks) {
182
183
  if (this.isArrayFn(this.form[rule.field])) {
@@ -270,8 +271,8 @@
270
271
  }
271
272
  });
272
273
  }
273
-
274
-
274
+
275
+
275
276
  },
276
277
  isError() {
277
278
  return this.errorFlag;
@@ -292,7 +293,7 @@
292
293
  trigger = 'change';
293
294
  break;
294
295
  }
295
- return trigger;
296
+ return trigger;
296
297
  },
297
298
  getValue(name) {
298
299
  return this.form[name];
@@ -342,7 +343,7 @@
342
343
  } else {
343
344
  this.setReadOnly(name,value);
344
345
  }
345
-
346
+
346
347
  });
347
348
  },
348
349
  setPro(name,value) {
@@ -372,7 +373,7 @@
372
373
  if (el.type === 'PopTagBox' ){
373
374
  let updateData = [];
374
375
  let oldData = this.oldForm[el.name];
375
- let newData = this.$Method.copy(form[el.name]);
376
+ let newData = this.$Method.copy(form[el.name]);
376
377
  if (oldData && oldData.length > 0) {
377
378
  oldData.forEach(el2 =>{
378
379
  if (el2.ph_key) {
@@ -399,13 +400,13 @@
399
400
  updateData.push(el);
400
401
  });
401
402
  }
402
- form[el.name] = updateData;
403
+ form[el.name] = updateData;
403
404
  }
404
-
405
+
405
406
  });
406
407
  }
407
408
  return form;
408
-
409
+
409
410
  },
410
411
  setCommonRequired(name,value,config) {
411
412
  let ename = '';
@@ -417,26 +418,26 @@
417
418
  if (value === true) {
418
419
  this.formRules[ename] = [{
419
420
  required: true,
420
- validator: this.validatorIsNull,
421
- trigger: this.getTrigger(config.type)
421
+ validator: this.validatorIsNull,
422
+ trigger: this.getTrigger(config.type)
422
423
  }];
423
- }
424
+ }
424
425
  } else {
425
426
  if (!value) {
426
427
  delete this.formRules[ename];
427
428
  }
428
429
  }
429
430
  }
430
-
431
+
431
432
  if (this.formRules[name] === undefined) {
432
433
  if (value === true) {
433
434
  this.formRules[name] = [{
434
435
  required: true,
435
- validator: this.validatorIsNull,
436
- trigger: this.getTrigger(config.type)
436
+ validator: this.validatorIsNull,
437
+ trigger: this.getTrigger(config.type)
437
438
  }];
438
439
  return true;
439
- }
440
+ }
440
441
  } else {
441
442
  if (!value) {
442
443
  delete this.formRules[name];
@@ -457,7 +458,7 @@
457
458
  this.items[index].status = true;
458
459
  });
459
460
  }
460
-
461
+
461
462
  }
462
463
  },
463
464
  updateCommonConfig(name, config) {
@@ -501,7 +502,7 @@
501
502
  this.$refs[obj[index].name][0].reset();
502
503
  }
503
504
  this.updateConfigReset(index+1,obj);
504
- });
505
+ });
505
506
  });
506
507
  } else {
507
508
  this.$nextTick(() => {
@@ -510,9 +511,9 @@
510
511
  if (this.$refs[obj[index].name] && this.$refs[obj[index].name].length > 0) {
511
512
  this.$refs[obj[index].name][0].reset();
512
513
  }
513
- });
514
+ });
514
515
  });
515
-
516
+
516
517
  }
517
518
  },
518
519
  updateItemsConfig(obj) {
@@ -524,11 +525,11 @@
524
525
  updateConfig.push(temp);
525
526
  }
526
527
  });
527
-
528
+
528
529
  if (updateConfig.length > 0) {
529
530
  this.updateConfigReset(0,updateConfig);
530
531
  }
531
-
532
+
532
533
  }
533
534
  },
534
535
  clearData() {
@@ -580,7 +581,7 @@
580
581
  let min = '';
581
582
  if (el.min !== undefined) {
582
583
  min = el.min;
583
- }
584
+ }
584
585
  if (el.smin !== undefined) {
585
586
  min = el.smin;
586
587
  }
@@ -607,8 +608,8 @@
607
608
  if (this.formRules[name] === undefined) {
608
609
  this.formRules[name] = [{
609
610
  required: true,
610
- validator: this.validatorIsNull,
611
- trigger: this.getTrigger(el.type)
611
+ validator: this.validatorIsNull,
612
+ trigger: this.getTrigger(el.type)
612
613
  }];
613
614
  }
614
615
  } else {
@@ -674,4 +675,4 @@
674
675
  },
675
676
  }
676
677
  };
677
- </script>
678
+ </script>