@oinone/kunlun-vue-admin-base 7.2.1 → 7.2.3

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.
@@ -43,6 +43,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
43
43
  direction: {
44
44
  type: StringConstructor;
45
45
  };
46
+ overflow: {
47
+ type: BooleanConstructor;
48
+ default: undefined;
49
+ };
46
50
  operatorColumnDirection: {
47
51
  type: PropType<OperationColumnDirection | keyof typeof OperationColumnDirection>;
48
52
  };
@@ -126,6 +130,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
126
130
  direction: {
127
131
  type: StringConstructor;
128
132
  };
133
+ overflow: {
134
+ type: BooleanConstructor;
135
+ default: undefined;
136
+ };
129
137
  operatorColumnDirection: {
130
138
  type: PropType<OperationColumnDirection | keyof typeof OperationColumnDirection>;
131
139
  };
@@ -163,6 +171,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
163
171
  }>> & Readonly<{}>, {
164
172
  invisible: boolean;
165
173
  inline: boolean;
174
+ overflow: boolean;
166
175
  isFloat: boolean;
167
176
  }, {}, {
168
177
  DownOutlined: import("@ant-design/icons-vue/lib/icons/DownOutlined").DownOutlinedIconType;
@@ -14,6 +14,7 @@ export declare class BaseActionGroupWidget<T extends ActiveRecordsWidgetProps =
14
14
  */
15
15
  protected refreshCallChaining: CallChaining<boolean> | undefined;
16
16
  protected showActionNames: string[] | undefined;
17
+ protected get overflow(): boolean | undefined;
17
18
  protected showActionNamesProcess(): string[];
18
19
  protected resetShowActionNames(): void;
19
20
  protected $$mounted(): void;
@@ -204,6 +204,9 @@ declare const __default__: import("vue").DefineComponent<import("vue").ExtractPr
204
204
  footerMethod: {
205
205
  type: FunctionConstructor;
206
206
  };
207
+ contentMethod: {
208
+ type: FunctionConstructor;
209
+ };
207
210
  spanMethod: {
208
211
  type: FunctionConstructor;
209
212
  };
@@ -534,6 +537,9 @@ declare const __default__: import("vue").DefineComponent<import("vue").ExtractPr
534
537
  footerMethod: {
535
538
  type: FunctionConstructor;
536
539
  };
540
+ contentMethod: {
541
+ type: FunctionConstructor;
542
+ };
537
543
  spanMethod: {
538
544
  type: FunctionConstructor;
539
545
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oinone/kunlun-vue-admin-base",
3
- "version": "7.2.1",
3
+ "version": "7.2.3",
4
4
  "type": "module",
5
5
  "main": "dist/oinone-kunlun-vue-admin-base.esm.js",
6
6
  "scripts": {
@@ -17,13 +17,13 @@
17
17
  "doc": "typedoc --out docs src/index.ts"
18
18
  },
19
19
  "dependencies": {
20
- "@oinone/kunlun-vue-admin-layout": "7.2.1",
21
- "@oinone/kunlun-vue-router": "7.2.1",
22
- "@oinone/kunlun-vue-ui": "7.2.1",
23
- "@oinone/kunlun-vue-ui-antd": "7.2.1",
24
- "@oinone/kunlun-vue-ui-common": "7.2.1",
25
- "@oinone/kunlun-vue-ui-el": "7.2.1",
26
- "@oinone/kunlun-vue-widget": "7.2.1",
20
+ "@oinone/kunlun-vue-admin-layout": "7.2.3",
21
+ "@oinone/kunlun-vue-router": "7.2.3",
22
+ "@oinone/kunlun-vue-ui": "7.2.3",
23
+ "@oinone/kunlun-vue-ui-antd": "7.2.3",
24
+ "@oinone/kunlun-vue-ui-common": "7.2.3",
25
+ "@oinone/kunlun-vue-ui-el": "7.2.3",
26
+ "@oinone/kunlun-vue-widget": "7.2.3",
27
27
  "@wangeditor/editor": "5.1.23",
28
28
  "@wangeditor/editor-for-vue": "5.1.11",
29
29
  "@wangeditor/plugin-upload-attachment": "1.1.0",
@@ -149,6 +149,10 @@ export default defineComponent({
149
149
  direction: {
150
150
  type: String
151
151
  },
152
+ overflow: {
153
+ type: Boolean,
154
+ default: undefined
155
+ },
152
156
  operatorColumnDirection: {
153
157
  type: String as PropType<OperationColumnDirection | keyof typeof OperationColumnDirection>
154
158
  },
@@ -338,6 +342,9 @@ export default defineComponent({
338
342
  if (this.justify) {
339
343
  classList.push(`${actionBarClassName}-${this.justify}`);
340
344
  }
345
+ if (this.overflow !== false) {
346
+ classList.push(`${actionBarClassName}-overflow`);
347
+ }
341
348
  if (this.isFloat) {
342
349
  classList.push(`${actionBarClassName}-float`);
343
350
  }
@@ -8,7 +8,16 @@
8
8
  display: flex;
9
9
  align-items: center;
10
10
  flex-flow: row nowrap;
11
- overflow: auto hidden;
11
+
12
+ &.action-bar-overflow {
13
+ overflow: auto hidden;
14
+
15
+ .action-bar-left,
16
+ .action-bar-center,
17
+ .action-bar-right {
18
+ overflow: auto hidden;
19
+ }
20
+ }
12
21
 
13
22
  &.action-bar-flatten {
14
23
  gap: 12px var(--oio-margin-md);
@@ -40,7 +49,6 @@
40
49
  display: flex;
41
50
  flex-flow: row nowrap;
42
51
  align-items: center;
43
- overflow: auto hidden;
44
52
  gap: 12px var(--oio-margin-md);
45
53
  }
46
54
 
@@ -1,4 +1,4 @@
1
- import { CallChaining, CastHelper } from '@oinone/kunlun-shared';
1
+ import { BooleanHelper, CallChaining, CastHelper } from '@oinone/kunlun-shared';
2
2
  import { type ActiveRecordsWidgetProps, executeInvisible, Widget } from '@oinone/kunlun-vue-widget';
3
3
  import { BaseActionWidget, BaseElementWidget } from './token';
4
4
 
@@ -26,6 +26,11 @@ export class BaseActionGroupWidget<
26
26
  @Widget.Reactive()
27
27
  protected showActionNames: string[] | undefined;
28
28
 
29
+ @Widget.Reactive()
30
+ protected get overflow() {
31
+ return BooleanHelper.toBoolean(this.getDsl().overflow);
32
+ }
33
+
29
34
  protected showActionNamesProcess(): string[] {
30
35
  const showActionNames: Set<string> = new Set();
31
36
  this.getChildren().forEach((widget) => {
@@ -50,9 +50,9 @@
50
50
  </template>
51
51
 
52
52
  <script lang="ts">
53
- import { ref, computed, watch, defineComponent, PropType } from 'vue';
54
- import { isString } from 'lodash-es';
55
53
  import { OioIcon, OioSelect } from '@oinone/kunlun-vue-ui-antd';
54
+ import { isString } from 'lodash-es';
55
+ import { computed, defineComponent, PropType, ref, watch } from 'vue';
56
56
 
57
57
  interface JsonLine {
58
58
  indent: number;
@@ -98,6 +98,19 @@ export default defineComponent({
98
98
  */
99
99
  const URL_REGEX = /\b(https?:\/\/|ftp:\/\/|sftp:\/\/)([^\s<>"]+)(\.[a-zA-Z0-9]{2,10})([^\s<>"]*)?\b/g;
100
100
 
101
+ const escapeHtml = (value: string): string => {
102
+ return value
103
+ .replace(/&/g, '&amp;')
104
+ .replace(/</g, '&lt;')
105
+ .replace(/>/g, '&gt;')
106
+ .replace(/"/g, '&quot;')
107
+ .replace(/'/g, '&#039;');
108
+ };
109
+
110
+ const stringifyJsonText = (value: unknown): string => {
111
+ return escapeHtml(JSON.stringify(value) ?? String(value));
112
+ };
113
+
101
114
  /**
102
115
  * 将JSON对象解析为带语法高亮和链接的HTML行数据
103
116
  * @param obj 要解析的JSON对象
@@ -113,13 +126,25 @@ export default defineComponent({
113
126
  * @returns 处理后的HTML字符串
114
127
  */
115
128
  const replaceUrlWithLink = (str: string): string => {
116
- // 先通过JSON.stringify转义,再替换URL
117
- const escapedStr = JSON.stringify(str).slice(1, -1); // 去掉首尾的引号
118
- return escapedStr.replace(URL_REGEX, (match) => {
119
- // 对匹配到的URL进行转义,防止XSS
120
- const encodedUrl = encodeURI(match);
121
- return `<a href="${encodedUrl}" target="_blank" class="text-blue-500 underline hover:text-blue-700">${match}</a>`;
122
- });
129
+ // 先通过JSON.stringify处理JSON转义,再对要注入v-html的文本做HTML转义。
130
+ const stringifiedStr = JSON.stringify(str).slice(1, -1);
131
+ let result = '';
132
+ let lastIndex = 0;
133
+ let matchResult: RegExpExecArray | null;
134
+
135
+ URL_REGEX.lastIndex = 0;
136
+ matchResult = URL_REGEX.exec(stringifiedStr);
137
+ while (matchResult) {
138
+ const url = matchResult[0];
139
+ result += escapeHtml(stringifiedStr.slice(lastIndex, matchResult.index));
140
+ result += `<a href="${escapeHtml(encodeURI(url))}" target="_blank" class="text-blue-500 underline hover:text-blue-700">${escapeHtml(
141
+ url
142
+ )}</a>`;
143
+ lastIndex = matchResult.index + url.length;
144
+ matchResult = URL_REGEX.exec(stringifiedStr);
145
+ }
146
+
147
+ return result + escapeHtml(stringifiedStr.slice(lastIndex));
123
148
  };
124
149
 
125
150
  if (Array.isArray(obj)) {
@@ -143,7 +168,7 @@ export default defineComponent({
143
168
  itemHtml = `<span class="text-green-600">"${replaceUrlWithLink(item)}"</span>`;
144
169
  } else {
145
170
  // 非字符串类型:直接JSON.stringify
146
- itemHtml = `<span class="text-green-600">${JSON.stringify(item)}</span>`;
171
+ itemHtml = `<span class="text-green-600">${stringifyJsonText(item)}</span>`;
147
172
  }
148
173
  // 添加逗号
149
174
  itemHtml += isLast ? '' : '<span class="text-gray-600">,</span>';
@@ -186,11 +211,13 @@ export default defineComponent({
186
211
  // 处理嵌套对象/数组
187
212
  lines.push({
188
213
  indent: indent + 1,
189
- html: `<span class="text-blue-600">"${key}"</span><span class="text-gray-600">: </span>`,
214
+ html: `<span class="text-blue-600">${stringifyJsonText(key)}</span><span class="text-gray-600">: </span>`,
190
215
  collapsible: false
191
216
  });
192
217
  const childLines = parseJSON(value, indent + 1);
193
- childLines[0].html = `<span class="text-blue-600">"${key}"</span><span class="text-gray-600">: </span>${childLines[0].html}`;
218
+ childLines[0].html = `<span class="text-blue-600">${stringifyJsonText(
219
+ key
220
+ )}</span><span class="text-gray-600">: </span>${childLines[0].html}`;
194
221
  childLines[childLines.length - 1].html += isLast ? '' : '<span class="text-gray-600">,</span>';
195
222
  lines.pop();
196
223
  lines.push(...childLines);
@@ -204,13 +231,15 @@ export default defineComponent({
204
231
  valueHtml = `"${replaceUrlWithLink(value)}"`;
205
232
  } else {
206
233
  // 非字符串类型:直接序列化
207
- valueHtml = JSON.stringify(value);
234
+ valueHtml = stringifyJsonText(value);
208
235
  }
209
236
 
210
237
  // 拼接最终HTML
211
238
  lines.push({
212
239
  indent: indent + 1,
213
- html: `<span class="text-blue-600">"${key}"</span><span class="text-gray-600">: </span><span class="${valueColor}">${valueHtml}</span>${
240
+ html: `<span class="text-blue-600">${stringifyJsonText(
241
+ key
242
+ )}</span><span class="text-gray-600">: </span><span class="${valueColor}">${valueHtml}</span>${
214
243
  isLast ? '' : '<span class="text-gray-600">,</span>'
215
244
  }`,
216
245
  collapsible: false
@@ -258,12 +287,7 @@ export default defineComponent({
258
287
  const regx = /<[^/]*?>/g;
259
288
  const closeAble = regx.test(line);
260
289
 
261
- const lineHtml = line
262
- .replace(/&/g, '&amp;')
263
- .replace(/</g, '&lt;')
264
- .replace(/>/g, '&gt;')
265
- .replace(/"/g, '&quot;')
266
- .replace(/'/g, '&#039;');
290
+ const lineHtml = escapeHtml(line);
267
291
 
268
292
  lines.push({
269
293
  indent,
@@ -282,7 +306,7 @@ export default defineComponent({
282
306
  const lines: JsonLine[] = [];
283
307
  lines.push({
284
308
  indent: 1,
285
- html: `<span class="text-gray-600">${str}</span>`,
309
+ html: `<span class="text-gray-600">${escapeHtml(str)}</span>`,
286
310
  collapsible: false
287
311
  });
288
312
  return lines;
@@ -1,4 +1,4 @@
1
- import { OINONE_HOMEPAGE_KEY, translateValueByKey } from '@oinone/kunlun-engine';
1
+ import { ClearCache, OINONE_HOMEPAGE_KEY, translateValueByKey } from '@oinone/kunlun-engine';
2
2
  import { SYSTEM_MODULE_NAME } from '@oinone/kunlun-meta';
3
3
  import {
4
4
  gql,
@@ -394,7 +394,7 @@ export class LoginWidget extends BaseLoginWidget {
394
394
  } else {
395
395
  const parameters = (await homepageMaybeRuntimeContext(undefined, true)) as any;
396
396
  localStorage.setItem(OINONE_HOMEPAGE_KEY, JSON.stringify(parameters));
397
-
397
+ ClearCache.clear();
398
398
  this.router.push({
399
399
  segments: [
400
400
  {
@@ -327,6 +327,9 @@ export default defineComponent({
327
327
  footerMethod: {
328
328
  type: Function
329
329
  },
330
+ contentMethod: {
331
+ type: Function
332
+ },
330
333
  spanMethod: {
331
334
  type: Function
332
335
  },
@@ -900,6 +903,7 @@ export default defineComponent({
900
903
 
901
904
  showFooter,
902
905
  footerMethod,
906
+ contentMethod,
903
907
  spanMethod,
904
908
  mergeCells,
905
909
 
@@ -1090,7 +1094,7 @@ export default defineComponent({
1090
1094
  data: showDataSource,
1091
1095
  scrollX,
1092
1096
  scrollY,
1093
- tooltipConfig: { enterable: true },
1097
+ tooltipConfig: { enterable: true, contentMethod },
1094
1098
  height: 'auto',
1095
1099
  rowConfig: { isCurrent, isHover },
1096
1100
  sortConfig,