cloud-web-corejs 1.0.91 → 1.0.93

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.
@@ -14,9 +14,22 @@
14
14
  <div>
15
15
  <template v-if="formItemProp=='false'">
16
16
  <template v-if="!field.options.hidden">
17
- <template v-if="showType === 0">
17
+ <template v-if="isShowWidget()">
18
18
  <slot></slot>
19
19
  </template>
20
+ <template v-else-if="field.options.widgetTextFlag===3 && field.options.widgetTextLinkConfig">
21
+ <div class="ellipsis">
22
+ <a class="a-link" :class="getWidgetClass()" @click.native="handleClick">
23
+ <span>
24
+ <i :class="field.options.widgetTextLinkConfig.options.prefixIcon"
25
+ v-if="!!field.options.widgetTextLinkConfig.options.prefixIcon"></i>
26
+ <span>{{ getWidgetValue() }}</span>
27
+ <i :class="field.options.widgetTextLinkConfig.options.suffixIcon"
28
+ v-if="!!field.options.widgetTextLinkConfig.options.suffixIcon"></i>
29
+ </span>
30
+ </a>
31
+ </div>
32
+ </template>
20
33
  <template v-else>
21
34
  <span>{{ getShowValue() }}</span>
22
35
  </template>
@@ -50,9 +63,22 @@
50
63
  <span v-if="!!field.options.labelColor" slot="label" :style="{'color':field.options.labelColor}">
51
64
  {{ label }}
52
65
  </span>
53
- <template v-if="showType === 0">
66
+ <template v-if="isShowWidget()">
54
67
  <slot></slot>
55
68
  </template>
69
+ <template v-else-if="field.options.widgetTextFlag===3 && field.options.widgetTextLinkConfig">
70
+ <div class="ellipsis">
71
+ <a class="a-link" :class="getWidgetClass()" @click="handleClick">
72
+ <span>
73
+ <i :class="field.options.widgetTextLinkConfig.options.prefixIcon"
74
+ v-if="!!field.options.widgetTextLinkConfig.options.prefixIcon"></i>
75
+ <span>{{ getWidgetValue() }}</span>
76
+ <i :class="field.options.widgetTextLinkConfig.options.suffixIcon"
77
+ v-if="!!field.options.widgetTextLinkConfig.options.suffixIcon"></i>
78
+ </span>
79
+ </a>
80
+ </div>
81
+ </template>
56
82
  <template v-else>
57
83
  <span>{{ getShowValue() }}</span>
58
84
  </template>
@@ -150,6 +176,9 @@ export default {
150
176
  },
151
177
 
152
178
  labelAlign() {
179
+ if (!this?.field?.options?.labelAlign) {
180
+ return ""
181
+ }
153
182
  if (!!this.field.options.labelAlign) {
154
183
  return this.field.options.labelAlign
155
184
  }
@@ -174,11 +203,6 @@ export default {
174
203
  },
175
204
 
176
205
  },
177
- data() {
178
- return {
179
- showType: 0
180
- }
181
- },
182
206
  created() {
183
207
  //
184
208
  this.initShowType();
@@ -274,9 +298,16 @@ export default {
274
298
  return !this.designState && label ? this.$t2(label, path, param) : label;
275
299
  },
276
300
  initShowType() {
277
- if (!!this.designer)return
301
+ if (!!this.designer) return
278
302
  let that = this.$parent
279
- let formRef = that.getFormRef?that.getFormRef():that;
303
+ let formRef = that.getFormRef ? that.getFormRef() : that;
304
+
305
+ if(!formRef)return
306
+ //详情页,新增页面不加密
307
+ let fJson = formRef.formJson;
308
+ let formConfig = fJson.formConfig;
309
+ if (formConfig.isLoadEntity && !formRef.dataId) return
310
+
280
311
  let bdService = formRef.bdService;
281
312
  let companyCode = this.$store.getters.companyCode;
282
313
  let loginAccount = this.$store.getters.loginAccount;
@@ -294,6 +325,8 @@ export default {
294
325
  flag = 1;
295
326
  } else if (optionModel.showEncryptTextEnabled) {
296
327
  flag = 2;
328
+ } else if (optionModel.showLinkTextEnabled) {
329
+ flag = 3;
297
330
  }
298
331
  if (optionModel.userTextRuleEnabled) {
299
332
  let userTextRuleConfig = optionModel.userTextRuleConfig || [];
@@ -302,14 +335,14 @@ export default {
302
335
  if (type !== null && type !== "") {
303
336
  let companyCodeStr = item.companyCodes;
304
337
  let companyCodes = companyCodeStr ? companyCodeStr.split(",").filter(item => !!item) : [];
305
- /*
338
+ /*
306
339
 
307
- let loginAccountStr = item.loginAccounts;
308
- let loginAccounts = loginAccountStr ? loginAccountStr.split(",").filter(item => !!item) : [];
340
+ let loginAccountStr = item.loginAccounts;
341
+ let loginAccounts = loginAccountStr ? loginAccountStr.split(",").filter(item => !!item) : [];
309
342
 
310
- let saleOrgCodeStr = item.saleOrgCodes;
311
- let saleOrgCodes = saleOrgCodeStr ? saleOrgCodeStr.split(",").filter(item => !!item) : [];
312
- */
343
+ let saleOrgCodeStr = item.saleOrgCodes;
344
+ let saleOrgCodes = saleOrgCodeStr ? saleOrgCodeStr.split(",").filter(item => !!item) : [];
345
+ */
313
346
 
314
347
  let roleCodeStr = item.roleCodes;
315
348
  let roleCodes = roleCodeStr ? roleCodeStr.split(",").filter(item => !!item) : [];
@@ -319,14 +352,15 @@ export default {
319
352
  // let flag3 = !loginAccounts.length || loginAccounts.includes(loginAccount)
320
353
  // let flag4 = this.compareToList(saleOrgCodes, saleOrgCodeList)
321
354
  let flag5 = this.compareToList(roleCodes, roleCodeList)
322
- let result = flag1 && flag2 && flag5 ;
355
+ let result = flag1 && flag2 && flag5;
323
356
  if (result) {
324
357
  flag = type;
325
358
  }
326
359
  }
327
360
  })
328
361
  }
329
- this.showType = flag;
362
+ this.field.options.widgetTextFlag = flag
363
+ // this.showType = flag;
330
364
  },
331
365
  compareToList(list1, list2) {
332
366
  if (!list1.length) {
@@ -339,10 +373,16 @@ export default {
339
373
  return list2.some(item2 => item == item2)
340
374
  });
341
375
  },
376
+ isShowWidget() {
377
+ let widgetTextFlag = this.field.options.widgetTextFlag;
378
+ return widgetTextFlag === undefined || widgetTextFlag === null || widgetTextFlag === 0
379
+ },
342
380
  getShowValue() {
381
+ let widgetTextFlag = this.field.options.widgetTextFlag;
343
382
  let fieldModel = this.$parent.fieldModel;
383
+ if (this.$parent.fieldModelLabel) fieldModel = this.$parent.fieldModelLabel();
344
384
  let showValue = fieldModel
345
- if (this.showType == 2) {
385
+ if (widgetTextFlag == 2) {
346
386
  let optionModel = this.field.options;
347
387
  showValue = "*******";
348
388
  if ((optionModel.textRule1 || optionModel.textRule2 || optionModel.textRule3)) {
@@ -385,7 +425,26 @@ export default {
385
425
 
386
426
  return showValue;
387
427
  },
388
-
428
+ getWidgetClass() {
429
+ let list = [];
430
+ let optionModel = this.field.options.widgetTextLinkConfig?.options || {};
431
+ if (optionModel.coloClass) list.push(optionModel.coloClass);
432
+ if (optionModel.underline) list.push('underLine');
433
+ if (this.field.options.disabled) list.push('is-disabled');
434
+ return list
435
+ },
436
+ handleClick(event) {
437
+ if(this.field.options.disabled) return;
438
+ this.$parent.handleButtonWidgetClick(event, true)
439
+ if (!this.designState && this.field.options.widgetTextLinkConfig?.options.href) {
440
+ window.open(this.field.options.widgetTextLinkConfig?.options.href);
441
+ }
442
+ },
443
+ getWidgetValue() {
444
+ let fieldModel = this.$parent.fieldModel;
445
+ if (this.$parent.fieldModelLabel) fieldModel = this.$parent.fieldModelLabel();
446
+ return fieldModel;
447
+ }
389
448
  }
390
449
  }
391
450
  </script>
@@ -507,5 +566,8 @@ export default {
507
566
  text-align: right;
508
567
  }
509
568
 
569
+ .a-link.is-disabled {
570
+ cursor: no-drop;
571
+ }
510
572
 
511
573
  </style>