cloud-web-corejs 1.0.54-dev.704 → 1.0.54-dev.705

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,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.704",
4
+ "version": "1.0.54-dev.705",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -84,7 +84,11 @@
84
84
  >
85
85
  <template v-if="field.options.labelIconPosition === 'front'">
86
86
  <template v-if="!!field.options.labelTooltip">
87
- <el-tooltip :content="field.options.labelTooltip" effect="dark">
87
+ <el-tooltip
88
+ :content="field.options.labelTooltip"
89
+ effect="dark"
90
+ popper-class="label-tooltip-pre-line"
91
+ >
88
92
  <i :class="field.options.labelIconClass"></i></el-tooltip
89
93
  ><span :style="{ color: field.options.labelColor }">{{
90
94
  label
@@ -105,6 +109,7 @@
105
109
  ><el-tooltip
106
110
  :content="field.options.labelTooltip"
107
111
  effect="dark"
112
+ popper-class="label-tooltip-pre-line"
108
113
  >
109
114
  <i :class="field.options.labelIconClass"></i></el-tooltip
110
115
  ></template>
@@ -647,14 +647,56 @@
647
647
  :label="i18nt('designer.setting.labelTooltip')"
648
648
  class="form-item-full"
649
649
  >
650
- <el-input
651
- type="text"
652
- v-model="rowData.labelTooltip"
653
- clearable
654
- ></el-input>
650
+ <a
651
+ href="javascript:void(0);"
652
+ class="a-link link-oneLind"
653
+ @click="openLabelTooltipDialog"
654
+ >
655
+ <span>{{ rowData.labelTooltip }}</span>
656
+ <i class="el-icon-edit"></i>
657
+ </a>
655
658
  </el-form-item>
656
659
  </el-form>
657
660
  </div>
661
+ <el-dialog
662
+ v-if="labelTooltipDialogVisible"
663
+ custom-class="dialog-style"
664
+ :title="i18nt('designer.setting.labelTooltip')"
665
+ :visible.sync="labelTooltipDialogVisible"
666
+ :show-close="true"
667
+ :append-to-body="true"
668
+ :modal="false"
669
+ :close-on-click-modal="false"
670
+ :close-on-press-escape="false"
671
+ :destroy-on-close="true"
672
+ width="520px"
673
+ v-dialog-drag
674
+ >
675
+ <el-input
676
+ type="textarea"
677
+ :rows="14"
678
+ class="label-tooltip-textarea"
679
+ v-model="labelTooltipValue"
680
+ clearable
681
+ ></el-input>
682
+ <div class="dialog-footer" slot="footer">
683
+ <el-button
684
+ @click="labelTooltipDialogVisible = false"
685
+ class="button-sty"
686
+ icon="el-icon-close"
687
+ >
688
+ {{ i18nt("designer.hint.cancel") }}
689
+ </el-button>
690
+ <el-button
691
+ type="primary"
692
+ @click="submitLabelTooltipDialog"
693
+ class="button-sty"
694
+ icon="el-icon-check"
695
+ >
696
+ {{ i18nt("designer.hint.confirm") }}
697
+ </el-button>
698
+ </div>
699
+ </el-dialog>
658
700
  <div class="dialog-footer" slot="footer">
659
701
  <el-button
660
702
  @click="closeRowEditDialog"
@@ -985,6 +1027,8 @@ export default {
985
1027
  rowData: null,
986
1028
  rowDataIndex: 0,
987
1029
  showRowEditDialog: false,
1030
+ labelTooltipDialogVisible: false,
1031
+ labelTooltipValue: "",
988
1032
  sourceTableColumnsSnapshot: null,
989
1033
  };
990
1034
  },
@@ -1964,9 +2008,20 @@ export default {
1964
2008
  this.editRowData.widgetList = this.rowData.widgetList;
1965
2009
  }
1966
2010
  this.showRowEditDialog = false;
2011
+ this.labelTooltipDialogVisible = false;
1967
2012
  },
1968
2013
  closeRowEditDialog() {
1969
2014
  this.showRowEditDialog = false;
2015
+ this.labelTooltipDialogVisible = false;
2016
+ },
2017
+ openLabelTooltipDialog() {
2018
+ this.labelTooltipValue = this.rowData.labelTooltip || "";
2019
+ this.labelTooltipDialogVisible = true;
2020
+ },
2021
+ submitLabelTooltipDialog() {
2022
+ const value = (this.labelTooltipValue || "").trim();
2023
+ this.rowData.labelTooltip = value || null;
2024
+ this.labelTooltipDialogVisible = false;
1970
2025
  },
1971
2026
  },
1972
2027
  };
@@ -2037,4 +2092,8 @@ export default {
2037
2092
  margin: 10px 0;
2038
2093
  }
2039
2094
  }
2095
+
2096
+ ::v-deep .label-tooltip-textarea textarea {
2097
+ min-height: 320px;
2098
+ }
2040
2099
  </style>
@@ -1,7 +1,42 @@
1
1
  <template>
2
- <el-form-item :label="i18nt('designer.setting.labelTooltip')">
3
- <el-input type="text" v-model="optionModel.labelTooltip"></el-input>
4
- </el-form-item>
2
+ <div>
3
+ <el-form-item :label="i18nt('designer.setting.labelTooltip')">
4
+ <a href="javascript:void(0);" class="a-link link-oneLind" @click="openDialog">
5
+ <span>{{ optionModel.labelTooltip }}</span>
6
+ <i class="el-icon-edit"></i>
7
+ </a>
8
+ </el-form-item>
9
+ <el-dialog
10
+ v-if="dialogVisible"
11
+ custom-class="dialog-style"
12
+ :title="i18nt('designer.setting.labelTooltip')"
13
+ :visible.sync="dialogVisible"
14
+ :show-close="true"
15
+ :append-to-body="true"
16
+ :modal="false"
17
+ :close-on-click-modal="false"
18
+ :close-on-press-escape="false"
19
+ :destroy-on-close="true"
20
+ width="520px"
21
+ v-dialog-drag
22
+ >
23
+ <el-input
24
+ type="textarea"
25
+ :rows="14"
26
+ class="label-tooltip-textarea"
27
+ v-model="labelTooltipValue"
28
+ clearable
29
+ ></el-input>
30
+ <div class="dialog-footer" slot="footer">
31
+ <el-button @click="dialogVisible = false" class="button-sty" icon="el-icon-close">
32
+ {{ i18nt("designer.hint.cancel") }}
33
+ </el-button>
34
+ <el-button type="primary" @click="submitDialog" class="button-sty" icon="el-icon-check">
35
+ {{ i18nt("designer.hint.confirm") }}
36
+ </el-button>
37
+ </div>
38
+ </el-dialog>
39
+ </div>
5
40
  </template>
6
41
 
7
42
  <script>
@@ -15,7 +50,28 @@ export default {
15
50
  selectedWidget: Object,
16
51
  optionModel: Object,
17
52
  },
53
+ data() {
54
+ return {
55
+ dialogVisible: false,
56
+ labelTooltipValue: "",
57
+ };
58
+ },
59
+ methods: {
60
+ openDialog() {
61
+ this.labelTooltipValue = this.optionModel.labelTooltip || "";
62
+ this.dialogVisible = true;
63
+ },
64
+ submitDialog() {
65
+ const value = (this.labelTooltipValue || "").trim();
66
+ this.optionModel.labelTooltip = value || null;
67
+ this.dialogVisible = false;
68
+ },
69
+ },
18
70
  };
19
71
  </script>
20
72
 
21
- <style scoped></style>
73
+ <style scoped>
74
+ ::v-deep .label-tooltip-textarea textarea {
75
+ min-height: 320px;
76
+ }
77
+ </style>
@@ -17,14 +17,22 @@
17
17
  <span v-if="!!subWidget.options.labelIconClass" class="custom-label">
18
18
  <template v-if="subWidget.options.labelIconPosition === 'front'">
19
19
  <template v-if="!!subWidget.options.labelTooltip">
20
- <el-tooltip :content="subWidget.options.labelTooltip" effect="light">
20
+ <el-tooltip
21
+ :content="subWidget.options.labelTooltip"
22
+ effect="light"
23
+ popper-class="label-tooltip-pre-line"
24
+ >
21
25
  <i :class="subWidget.options.labelIconClass"></i></el-tooltip>{{subWidget.options.label}}</template>
22
26
  <template v-else>
23
27
  <i :class="subWidget.options.labelIconClass"></i>{{subWidget.options.label}}</template>
24
28
  </template>
25
29
  <template v-else-if="subWidget.options.labelIconPosition === 'rear'">
26
30
  <template v-if="!!subWidget.options.labelTooltip">
27
- {{subWidget.options.label}}<el-tooltip :content="subWidget.options.labelTooltip" effect="light">
31
+ {{subWidget.options.label}}<el-tooltip
32
+ :content="subWidget.options.labelTooltip"
33
+ effect="light"
34
+ popper-class="label-tooltip-pre-line"
35
+ >
28
36
  <i :class="subWidget.options.labelIconClass"></i></el-tooltip></template>
29
37
  <template v-else>
30
38
  {{subWidget.options.label}}<i :class="subWidget.options.labelIconClass"></i></template>
@@ -389,12 +389,12 @@ export function buildFieldWidget(widget, formConfig) {
389
389
  let customLabelDom =
390
390
  `<template #label><span class="custom-label">${wop.labelIconPosition === 'front' ?
391
391
  (!!wop.labelTooltip ?
392
- `<el-tooltip content="${wop.labelTooltip}" effect="light"><i class="${wop.labelIconClass}"></i></el-tooltip>${wop.label}` :
392
+ `<el-tooltip content="${wop.labelTooltip}" effect="light" popper-class="label-tooltip-pre-line"><i class="${wop.labelIconClass}"></i></el-tooltip>${wop.label}` :
393
393
  `<i class="${wop.labelIconClass}"></i>${wop.label}`
394
394
  )
395
395
  :
396
396
  (!!wop.labelTooltip ?
397
- `${wop.label}<el-tooltip content="${wop.labelTooltip}" effect="light"><i class="${wop.labelIconClass}"></i></el-tooltip>` :
397
+ `${wop.label}<el-tooltip content="${wop.labelTooltip}" effect="light" popper-class="label-tooltip-pre-line"><i class="${wop.labelIconClass}"></i></el-tooltip>` :
398
398
  `${wop.label}<i class="${wop.labelIconClass}"></i>`
399
399
  )
400
400
  }
@@ -63,6 +63,24 @@ export function resolveColumnRequiredFlag(columnConfig) {
63
63
  return !!(widgetOptions?.required || editWidgetOptions?.required);
64
64
  }
65
65
 
66
+ function buildVxeTitlePrefixTooltip(tooltip) {
67
+ if (!tooltip) {
68
+ return {};
69
+ }
70
+ if (/\r?\n/.test(tooltip)) {
71
+ return {
72
+ content: tooltip
73
+ .replace(/&/g, "&amp;")
74
+ .replace(/</g, "&lt;")
75
+ .replace(/>/g, "&gt;")
76
+ .replace(/\r\n/g, "\n")
77
+ .replace(/\n/g, "<br/>"),
78
+ useHTML: true,
79
+ };
80
+ }
81
+ return { content: tooltip };
82
+ }
83
+
66
84
  export function applyColumnLabelIcon(col, columnConfig) {
67
85
  if (!col || !columnConfig) {
68
86
  return col;
@@ -86,7 +104,12 @@ export function applyColumnLabelIcon(col, columnConfig) {
86
104
  return h(
87
105
  "el-tooltip",
88
106
  {
89
- props: { content: tooltip, effect: "dark", placement: "top" },
107
+ props: {
108
+ content: tooltip,
109
+ effect: "dark",
110
+ placement: "top",
111
+ popperClass: "label-tooltip-pre-line",
112
+ },
90
113
  },
91
114
  [icon]
92
115
  );
@@ -95,7 +118,7 @@ export function applyColumnLabelIcon(col, columnConfig) {
95
118
  if (iconClass && position === "front" && !required) {
96
119
  col.titlePrefix = {
97
120
  icon: iconClass,
98
- ...(tooltip ? { content: tooltip } : {}),
121
+ ...buildVxeTitlePrefixTooltip(tooltip),
99
122
  };
100
123
  return col;
101
124
  }