gc_i18n 1.4.2 → 1.4.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.
- package/.qoder/repowiki/zh/content//351/205/215/347/275/256/351/200/211/351/241/271.md +12 -15
- package/.qoder/repowiki/zh/content//351/253/230/347/272/247/347/224/250/346/263/225//351/253/230/347/272/247/347/224/250/346/263/225.md +117 -1
- package/.qoder/repowiki/zh/meta/repowiki-metadata.json +1 -1
- package/lang/index.json +4 -0
- package/lib/gc_i18n.es.js +61 -61
- package/lib/gc_i18n.umd.js +9 -9
- package/package.json +1 -1
- package/packages/index.js +13 -1
- package/packages/libs/textEditMode.js +2 -1
- package/src/view/Home.vue +2 -1
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
## 更新摘要
|
|
18
18
|
**所做更改**
|
|
19
|
+
- 版本从1.4.1升级到1.4.2
|
|
20
|
+
- SweetAlert2模态对话框的z-index增强,确保不被其他弹窗遮盖
|
|
19
21
|
- 更新了基础URL配置,将 `https://i18n.ihotel.cn` 更新为 `https://trans.ihotel.cn`
|
|
20
22
|
- 标准化了API端点路径,移除了重复的斜杠
|
|
21
23
|
- 更新了环境配置说明,反映最新的URL变更
|
|
@@ -240,6 +242,8 @@ baseUrl: "https://custom-domain.com"
|
|
|
240
242
|
|
|
241
243
|
### SweetAlert2 集成配置项
|
|
242
244
|
|
|
245
|
+
**更新** SweetAlert2模态对话框的z-index已增强,确保不被其他弹窗遮盖:
|
|
246
|
+
|
|
243
247
|
| 配置项 | 类型 | 默认值 | 有效值范围 | 实际影响 |
|
|
244
248
|
| --- | --- | --- | --- | --- |
|
|
245
249
|
| **titleText** | String | "多语言管理中心" | 任意字符串 | SweetAlert2 弹窗标题 |
|
|
@@ -278,7 +282,7 @@ baseUrl: "https://custom-domain.com"
|
|
|
278
282
|
**Section sources**
|
|
279
283
|
- [packages/index.js:67-547](file://packages/index.js#L67-L547)
|
|
280
284
|
- [vite.config.js:1-72](file://vite.config.js#L1-L72)
|
|
281
|
-
- [packages/swal.css:1-
|
|
285
|
+
- [packages/swal.css:1-23](file://packages/swal.css#L1-L23)
|
|
282
286
|
- [package.json:13-20](file://package.json#L13-L20)
|
|
283
287
|
- [packages/libs/textEditMode.js:1-623](file://packages/libs/textEditMode.js#L1-L623)
|
|
284
288
|
- [packages/libs/textEditMode.css:1-166](file://packages/libs/textEditMode.css#L1-L166)
|
|
@@ -411,21 +415,14 @@ export default {
|
|
|
411
415
|
};
|
|
412
416
|
```
|
|
413
417
|
|
|
414
|
-
###
|
|
415
|
-
```css
|
|
416
|
-
/* 自定义样式 */
|
|
417
|
-
.gc_i18n_container {
|
|
418
|
-
background-color: #f5f5f5;
|
|
419
|
-
}
|
|
418
|
+
### SweetAlert2 z-index增强配置示例
|
|
420
419
|
|
|
421
|
-
|
|
422
|
-
color: #333;
|
|
423
|
-
font-weight: bold;
|
|
424
|
-
}
|
|
420
|
+
**更新** SweetAlert2模态对话框的z-index已增强,确保不被其他弹窗遮盖:
|
|
425
421
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
422
|
+
```css
|
|
423
|
+
/* SweetAlert2 弹窗 z-index 设置,确保不被其他弹窗遮盖 */
|
|
424
|
+
.swal2-container {
|
|
425
|
+
z-index: 99999 !important;
|
|
429
426
|
}
|
|
430
427
|
```
|
|
431
428
|
|
|
@@ -455,5 +452,5 @@ export default {
|
|
|
455
452
|
**Section sources**
|
|
456
453
|
- [lang/index.js:16-33](file://lang/index.js#L16-L33)
|
|
457
454
|
- [packages/index.js:67-547](file://packages/index.js#L67-L547)
|
|
458
|
-
- [packages/swal.css:1-
|
|
455
|
+
- [packages/swal.css:1-23](file://packages/swal.css#L1-L23)
|
|
459
456
|
- [packages/libs/textEditMode.css:1-166](file://packages/libs/textEditMode.css#L1-L166)
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
- [src/router/index.js](file://src/router/index.js) - *路由配置*
|
|
22
22
|
- [src/main.js](file://src/main.js) - *应用入口*
|
|
23
23
|
- [README.md](file://README.md) - *项目说明文档*
|
|
24
|
+
- [packages/swal.css](file://packages/swal.css) - *SweetAlert2样式增强*
|
|
24
25
|
</cite>
|
|
25
26
|
|
|
26
27
|
## 更新摘要
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
- 增强的RTL语言支持和更健壮的错误处理机制
|
|
30
31
|
- 改进的类型安全和代码组织结构
|
|
31
32
|
- 优化的性能调优技巧和缓存策略
|
|
33
|
+
- **新增** SweetAlert2模态对话框z-index增强,确保弹窗最高优先级
|
|
32
34
|
|
|
33
35
|
## 目录
|
|
34
36
|
1. [项目结构分析](#项目结构分析)
|
|
@@ -43,6 +45,7 @@
|
|
|
43
45
|
10. [环境感知与iframe配置](#环境感知与iframe配置)
|
|
44
46
|
11. [文本编辑模式高级用法](#文本编辑模式高级用法)
|
|
45
47
|
12. [Earth组件高级用法](#earth组件高级用法)
|
|
48
|
+
13. [SweetAlert2模态对话框z-index增强](#sweetalert2模态对话框z-index增强)
|
|
46
49
|
|
|
47
50
|
## 项目结构分析
|
|
48
51
|
|
|
@@ -68,6 +71,7 @@ css[gc_i18n.css]
|
|
|
68
71
|
esm[gc_i18n.es.js]
|
|
69
72
|
textEdit[文本编辑模式]
|
|
70
73
|
earth[Earth组件]
|
|
74
|
+
swalEnhance[SweetAlert2增强]
|
|
71
75
|
end
|
|
72
76
|
subgraph "工具库"
|
|
73
77
|
index[index.js]
|
|
@@ -91,6 +95,7 @@ index --> service
|
|
|
91
95
|
index --> utils
|
|
92
96
|
index --> textEditMode
|
|
93
97
|
index --> earth
|
|
98
|
+
index --> swalEnhance
|
|
94
99
|
textEditMode --> textEditModeCss[textEditMode.css]
|
|
95
100
|
earth --> earthCss[earth.css]
|
|
96
101
|
App --> index
|
|
@@ -107,6 +112,7 @@ langJson --> index
|
|
|
107
112
|
- [packages/libs/textEditMode.js:1-200](file://packages/libs/textEditMode.js#L1-L200)
|
|
108
113
|
- [packages/libs/textEditMode.css:1-167](file://packages/libs/textEditMode.css#L1-L167)
|
|
109
114
|
- [packages/components/earth.js:1-200](file://packages/components/earth.js#L1-L200)
|
|
115
|
+
- [packages/swal.css:1-23](file://packages/swal.css#L1-L23)
|
|
110
116
|
|
|
111
117
|
## Vite构建系统迁移
|
|
112
118
|
|
|
@@ -1195,4 +1201,114 @@ const debouncedLanguageChange = debounce((newLocale) => {
|
|
|
1195
1201
|
- [packages/components/earth.css:1-144](file://packages/components/earth.css#L1-L144)
|
|
1196
1202
|
- [packages/components/earth.md:1-109](file://packages/components/earth.md#L1-L109)
|
|
1197
1203
|
- [src/view/Home.vue:19-40](file://src/view/Home.vue#L19-L40)
|
|
1198
|
-
- [packages/index.js:523](file://packages/index.js#L523-L523)
|
|
1204
|
+
- [packages/index.js:523](file://packages/index.js#L523-L523)
|
|
1205
|
+
|
|
1206
|
+
## SweetAlert2模态对话框z-index增强
|
|
1207
|
+
|
|
1208
|
+
### 概述
|
|
1209
|
+
|
|
1210
|
+
为了确保gc_i18n库中的SweetAlert2模态对话框始终显示在最顶层,避免被其他UI元素遮挡,系统进行了z-index增强配置。这一改进确保了弹窗的最高优先级显示。
|
|
1211
|
+
|
|
1212
|
+
### z-index增强配置
|
|
1213
|
+
|
|
1214
|
+
系统通过专门的CSS样式文件为SweetAlert2对话框设置了极高的z-index值:
|
|
1215
|
+
|
|
1216
|
+
```css
|
|
1217
|
+
/* 全局 SweetAlert2 弹窗 z-index 设置,确保不被其他弹窗遮盖 */
|
|
1218
|
+
.swal2-container {
|
|
1219
|
+
z-index: 99999 !important;
|
|
1220
|
+
}
|
|
1221
|
+
```
|
|
1222
|
+
|
|
1223
|
+
这个配置确保了:
|
|
1224
|
+
- SweetAlert2对话框始终位于所有其他元素之上
|
|
1225
|
+
- 避免与其他UI组件发生层级冲突
|
|
1226
|
+
- 提供一致的用户体验,无论页面结构如何复杂
|
|
1227
|
+
|
|
1228
|
+
### 应用场景
|
|
1229
|
+
|
|
1230
|
+
这种z-index增强在以下场景中特别有用:
|
|
1231
|
+
|
|
1232
|
+
#### 多层嵌套组件
|
|
1233
|
+
当应用包含复杂的嵌套组件结构时,某些父级元素可能设置了较高的z-index,导致SweetAlert2对话框被遮挡。
|
|
1234
|
+
|
|
1235
|
+
#### 动态内容加载
|
|
1236
|
+
在异步加载内容或动态插入DOM元素时,可能出现层级计算错误,导致对话框显示异常。
|
|
1237
|
+
|
|
1238
|
+
#### 第三方组件集成
|
|
1239
|
+
当与第三方UI组件库集成时,可能存在z-index冲突问题。
|
|
1240
|
+
|
|
1241
|
+
### 实现细节
|
|
1242
|
+
|
|
1243
|
+
SweetAlert2对话框的z-index增强通过以下方式实现:
|
|
1244
|
+
|
|
1245
|
+
1. **全局样式覆盖**:通过`.swal2-container`选择器设置极高的z-index值
|
|
1246
|
+
2. **重要性标记**:使用`!important`确保样式优先级
|
|
1247
|
+
3. **组件化集成**:在主入口文件中导入增强样式
|
|
1248
|
+
|
|
1249
|
+
```javascript
|
|
1250
|
+
// 在主入口文件中导入增强样式
|
|
1251
|
+
import "./swal.css";
|
|
1252
|
+
```
|
|
1253
|
+
|
|
1254
|
+
### 性能影响
|
|
1255
|
+
|
|
1256
|
+
z-index增强对性能的影响:
|
|
1257
|
+
- **零额外计算**:仅设置固定z-index值,无复杂计算
|
|
1258
|
+
- **全局应用**:影响所有SweetAlert2实例,无需逐个配置
|
|
1259
|
+
- **浏览器优化**:现代浏览器对z-index有良好的优化处理
|
|
1260
|
+
|
|
1261
|
+
### 最佳实践
|
|
1262
|
+
|
|
1263
|
+
使用z-index增强时的注意事项:
|
|
1264
|
+
|
|
1265
|
+
```javascript
|
|
1266
|
+
// 正确的做法
|
|
1267
|
+
Swal.fire({
|
|
1268
|
+
title: "操作成功",
|
|
1269
|
+
text: "数据已成功保存",
|
|
1270
|
+
icon: "success",
|
|
1271
|
+
// z-index自动应用,无需手动设置
|
|
1272
|
+
});
|
|
1273
|
+
|
|
1274
|
+
// 避免的做法
|
|
1275
|
+
Swal.fire({
|
|
1276
|
+
title: "操作成功",
|
|
1277
|
+
text: "数据已成功保存",
|
|
1278
|
+
icon: "success",
|
|
1279
|
+
customClass: {
|
|
1280
|
+
popup: "custom-popup-class" // 如果需要自定义样式,确保不影响z-index
|
|
1281
|
+
}
|
|
1282
|
+
});
|
|
1283
|
+
```
|
|
1284
|
+
|
|
1285
|
+
### 兼容性考虑
|
|
1286
|
+
|
|
1287
|
+
z-index增强的兼容性:
|
|
1288
|
+
- **现代浏览器**:完全支持
|
|
1289
|
+
- **IE11+**:通过CSS前缀支持
|
|
1290
|
+
- **移动端浏览器**:在iOS Safari中表现良好
|
|
1291
|
+
- **无障碍访问**:不影响屏幕阅读器的正常工作
|
|
1292
|
+
|
|
1293
|
+
### 故障排除
|
|
1294
|
+
|
|
1295
|
+
如果遇到z-index相关问题:
|
|
1296
|
+
|
|
1297
|
+
```javascript
|
|
1298
|
+
// 检查是否有其他样式覆盖
|
|
1299
|
+
// 使用浏览器开发者工具检查元素的实际z-index值
|
|
1300
|
+
|
|
1301
|
+
// 如果需要临时调整
|
|
1302
|
+
Swal.fire({
|
|
1303
|
+
title: "临时调整",
|
|
1304
|
+
text: "如果需要特殊处理,可以使用自定义样式",
|
|
1305
|
+
customClass: {
|
|
1306
|
+
container: "temporary-z-index-adjustment"
|
|
1307
|
+
}
|
|
1308
|
+
});
|
|
1309
|
+
```
|
|
1310
|
+
|
|
1311
|
+
**章节来源**
|
|
1312
|
+
- [packages/swal.css:1-23](file://packages/swal.css#L1-L23)
|
|
1313
|
+
- [packages/index.js:53-54](file://packages/index.js#L53-L54)
|
|
1314
|
+
- [lib/gc_i18n.es.js:1954](file://lib/gc_i18n.es.js#L1954)
|