@flexem/fc-gui 3.0.0-alpha.142 → 3.0.0-alpha.144
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/bundles/@flexem/fc-gui.umd.js +115 -117
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/scroll-alarm/scroll-alarm-element.js +4 -4
- package/elements/shared/text/text-element.js +1 -1
- package/elements/shared/text/text-state-element.d.ts +4 -3
- package/elements/shared/text/text-state-element.js +33 -16
- package/elements/static-elements/hyperlink-element.js +22 -29
- package/elements/static-elements/text-element.js +22 -29
- package/elements/view-operation/view-operation.element.d.ts +1 -0
- package/elements/view-operation/view-operation.element.js +33 -38
- package/elements/view-operation/view-operation.element.metadata.json +1 -1
- package/model/shared/text/text.d.ts +3 -0
- package/package.json +1 -1
|
@@ -35836,7 +35836,7 @@ class text_element_TextElementModal {
|
|
|
35836
35836
|
const minFontSize = 12;
|
|
35837
35837
|
lineHeight = parseInt(font.fontSize, 10) + 5;
|
|
35838
35838
|
fontString += font.fontSize + '/' + lineHeight.toString() + 'px ' + font.fontFamily;
|
|
35839
|
-
textDiv.style.cssText = `color: ${font.color};word-break: break-all;font: ${fontString};`;
|
|
35839
|
+
textDiv.style.cssText = `color: ${font.color};word-break: break-all;font: ${fontString};text-align: ${textAlign};`;
|
|
35840
35840
|
if (font.isUnderline) {
|
|
35841
35841
|
textDiv.style.textDecoration = 'underline';
|
|
35842
35842
|
}
|
|
@@ -39173,7 +39173,7 @@ class text_element_TextElement extends conditional_dynamic_display_element_Condi
|
|
|
39173
39173
|
* 否则返回默认文本
|
|
39174
39174
|
*/
|
|
39175
39175
|
getDisplayText() {
|
|
39176
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
39176
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39177
39177
|
// 检查是否使用文本库
|
|
39178
39178
|
if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
|
|
39179
39179
|
const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
|
|
@@ -39218,37 +39218,30 @@ class text_element_TextElement extends conditional_dynamic_display_element_Condi
|
|
|
39218
39218
|
return '';
|
|
39219
39219
|
}
|
|
39220
39220
|
// 处理自定义文本(支持多语种)
|
|
39221
|
-
if (this.model.text) {
|
|
39222
|
-
//
|
|
39223
|
-
|
|
39224
|
-
|
|
39225
|
-
|
|
39226
|
-
const
|
|
39227
|
-
// 确定要使用的语种代码(culture)
|
|
39228
|
-
let targetLanguage;
|
|
39229
|
-
const defaultLanguage = ((_k = this.languageService) === null || _k === void 0 ? void 0 : _k.getDefaultLanguage()) || 'zh-CN';
|
|
39221
|
+
if (this.model.text || this.model.textCultures) {
|
|
39222
|
+
// 获取目标语种(公共逻辑)
|
|
39223
|
+
const getTargetLanguage = () => {
|
|
39224
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39225
|
+
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
39226
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
39230
39227
|
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
39231
|
-
|
|
39232
|
-
targetLanguage = defaultLanguage;
|
|
39228
|
+
return defaultLanguage;
|
|
39233
39229
|
}
|
|
39234
|
-
|
|
39235
|
-
|
|
39236
|
-
|
|
39237
|
-
|
|
39238
|
-
|
|
39239
|
-
|
|
39240
|
-
|
|
39241
|
-
|
|
39242
|
-
}
|
|
39243
|
-
}
|
|
39244
|
-
// 返回对应语种的文本,如果没有则根据当前语言环境显示默认文本
|
|
39245
|
-
// 获取当前语言环境
|
|
39246
|
-
const language = ((_q = (_p = (_o = window.abp) === null || _o === void 0 ? void 0 : _o.localization) === null || _p === void 0 ? void 0 : _p.currentLanguage) === null || _q === void 0 ? void 0 : _q.name) || 'zh-Hans';
|
|
39247
|
-
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
39248
|
-
return this.model.text.cultures[targetLanguage] || (isChinese ? '文本' : 'Text');
|
|
39230
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
39231
|
+
};
|
|
39232
|
+
const language = ((_j = (_h = (_g = window.abp) === null || _g === void 0 ? void 0 : _g.localization) === null || _h === void 0 ? void 0 : _h.currentLanguage) === null || _j === void 0 ? void 0 : _j.name) || 'zh-Hans';
|
|
39233
|
+
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
39234
|
+
const fallback = isChinese ? '文本' : 'Text';
|
|
39235
|
+
// 新格式:textCultures 在顶层(与 text 字段并列)
|
|
39236
|
+
if (this.model.textCultures && typeof this.model.textCultures === 'object') {
|
|
39237
|
+
return this.model.textCultures[getTargetLanguage()] || fallback;
|
|
39249
39238
|
}
|
|
39250
|
-
|
|
39251
|
-
|
|
39239
|
+
// 中间格式(兼容):text 为 { cultures: {...} }
|
|
39240
|
+
if (typeof this.model.text === 'object' && this.model.text.cultures) {
|
|
39241
|
+
return this.model.text.cultures[getTargetLanguage()] || fallback;
|
|
39242
|
+
}
|
|
39243
|
+
// 旧格式:字符串
|
|
39244
|
+
if (typeof this.model.text === 'string') {
|
|
39252
39245
|
return this.model.text;
|
|
39253
39246
|
}
|
|
39254
39247
|
}
|
|
@@ -39301,7 +39294,7 @@ class text_state_element_TextStateElement {
|
|
|
39301
39294
|
return;
|
|
39302
39295
|
}
|
|
39303
39296
|
// 获取显示文本(支持文本库)
|
|
39304
|
-
const content = this.getDisplayText(stateId, textState.text
|
|
39297
|
+
const content = this.getDisplayText(stateId, textState.text);
|
|
39305
39298
|
if (content === '' || content == null) {
|
|
39306
39299
|
this.removeForeignObjectlement();
|
|
39307
39300
|
return;
|
|
@@ -39422,24 +39415,41 @@ class text_state_element_TextStateElement {
|
|
|
39422
39415
|
}
|
|
39423
39416
|
/**
|
|
39424
39417
|
* 获取显示文本
|
|
39425
|
-
*
|
|
39426
|
-
*
|
|
39427
|
-
*
|
|
39418
|
+
* 支持三种格式:
|
|
39419
|
+
* 1. 新格式:textData.cultures 在顶层(与 content 并列)
|
|
39420
|
+
* 2. 中间格式:textData.content 为 { cultures: {...} }(已废弃,向下兼容)
|
|
39421
|
+
* 3. 旧格式:textData.content 为字符串
|
|
39428
39422
|
*/
|
|
39429
|
-
getDisplayText(stateId,
|
|
39430
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
39431
|
-
|
|
39432
|
-
|
|
39423
|
+
getDisplayText(stateId, textData) {
|
|
39424
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
39425
|
+
const getTargetLanguage = () => {
|
|
39426
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39433
39427
|
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
39434
39428
|
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
39435
|
-
let targetLanguage;
|
|
39436
39429
|
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
39437
|
-
|
|
39430
|
+
return defaultLanguage;
|
|
39431
|
+
}
|
|
39432
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
39433
|
+
};
|
|
39434
|
+
const defaultContent = textData === null || textData === void 0 ? void 0 : textData.content;
|
|
39435
|
+
// 新格式:cultures 在 text 顶层
|
|
39436
|
+
if (textData && textData.cultures && typeof textData.cultures === 'object') {
|
|
39437
|
+
const targetLanguage = getTargetLanguage();
|
|
39438
|
+
if (textData.cultures[targetLanguage]) {
|
|
39439
|
+
return textData.cultures[targetLanguage];
|
|
39440
|
+
}
|
|
39441
|
+
else if (this.allowEmpty) {
|
|
39442
|
+
return '';
|
|
39438
39443
|
}
|
|
39439
39444
|
else {
|
|
39440
|
-
const
|
|
39441
|
-
|
|
39445
|
+
const language = ((_c = (_b = (_a = window.abp) === null || _a === void 0 ? void 0 : _a.localization) === null || _b === void 0 ? void 0 : _b.currentLanguage) === null || _c === void 0 ? void 0 : _c.name) || 'zh-Hans';
|
|
39446
|
+
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
39447
|
+
return isChinese ? '文本' : 'Text';
|
|
39442
39448
|
}
|
|
39449
|
+
}
|
|
39450
|
+
// 中间格式(兼容):content 为 { cultures: {...} }
|
|
39451
|
+
if (defaultContent && typeof defaultContent === 'object' && defaultContent.cultures) {
|
|
39452
|
+
const targetLanguage = getTargetLanguage();
|
|
39443
39453
|
if (defaultContent.cultures[targetLanguage]) {
|
|
39444
39454
|
return defaultContent.cultures[targetLanguage];
|
|
39445
39455
|
}
|
|
@@ -39447,7 +39457,7 @@ class text_state_element_TextStateElement {
|
|
|
39447
39457
|
return '';
|
|
39448
39458
|
}
|
|
39449
39459
|
else {
|
|
39450
|
-
const language = ((
|
|
39460
|
+
const language = ((_f = (_e = (_d = window.abp) === null || _d === void 0 ? void 0 : _d.localization) === null || _e === void 0 ? void 0 : _e.currentLanguage) === null || _f === void 0 ? void 0 : _f.name) || 'zh-Hans';
|
|
39451
39461
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
39452
39462
|
return isChinese ? '文本' : 'Text';
|
|
39453
39463
|
}
|
|
@@ -39463,17 +39473,17 @@ class text_state_element_TextStateElement {
|
|
|
39463
39473
|
const textEntry = textLibraryData.data.find(entry => entry.value === stateId.toString());
|
|
39464
39474
|
if (textEntry) {
|
|
39465
39475
|
// 获取当前语种ID
|
|
39466
|
-
const currentLanguageId = (
|
|
39476
|
+
const currentLanguageId = (_j = (_h = (_g = this.guiContext) === null || _g === void 0 ? void 0 : _g.getCurrentLanguageId) === null || _h === void 0 ? void 0 : _h.call(_g)) !== null && _j !== void 0 ? _j : null;
|
|
39467
39477
|
// 确定要使用的语种代码(culture)
|
|
39468
39478
|
let targetLanguage;
|
|
39469
|
-
const defaultLanguage = ((
|
|
39479
|
+
const defaultLanguage = ((_k = this.languageService) === null || _k === void 0 ? void 0 : _k.getDefaultLanguage()) || 'zh-CN';
|
|
39470
39480
|
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
39471
39481
|
// 设备未设置当前语种,使用默认语种
|
|
39472
39482
|
targetLanguage = defaultLanguage;
|
|
39473
39483
|
}
|
|
39474
39484
|
else {
|
|
39475
39485
|
// 设备已设置当前语种,获取对应的语种代码
|
|
39476
|
-
const currentLanguage = (
|
|
39486
|
+
const currentLanguage = (_m = (_l = this.guiContext) === null || _l === void 0 ? void 0 : _l.getLanguageCultureById) === null || _m === void 0 ? void 0 : _m.call(_l, currentLanguageId);
|
|
39477
39487
|
if (currentLanguage) {
|
|
39478
39488
|
// 直接使用设备设置的语种,不再fallback
|
|
39479
39489
|
targetLanguage = currentLanguage;
|
|
@@ -40509,6 +40519,7 @@ var view_service = __webpack_require__(27);
|
|
|
40509
40519
|
|
|
40510
40520
|
|
|
40511
40521
|
|
|
40522
|
+
|
|
40512
40523
|
class view_operation_element_ViewOperationElement extends conditional_enable_element_ConditionalEnableElement {
|
|
40513
40524
|
constructor(element, injector, modalService, variableCommunicator, variableStore, graphStore, permissionChecker, operationRecordService, securityChecker, localization, popupViewService, hostContainerId, el, signalRAppId, textLibraryService, languageService, guiContext) {
|
|
40514
40525
|
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
@@ -40532,14 +40543,14 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40532
40543
|
initElement() {
|
|
40533
40544
|
const width = this.model.size.width;
|
|
40534
40545
|
const height = this.model.size.height;
|
|
40546
|
+
// 在 initGraph 之前移除模板原有的 SVG <text>(改用 foreignObject 渲染,支持换行居中)
|
|
40547
|
+
// 必须在 initGraph 前执行,否则会误删图形状态内部后续添加的文字节点
|
|
40548
|
+
this.$element.find('text').remove();
|
|
40535
40549
|
this.initGraph(width, height);
|
|
40536
40550
|
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', height).attr('fill', 'transparent');
|
|
40537
|
-
|
|
40538
|
-
|
|
40539
|
-
|
|
40540
|
-
$dateTimeText.css('font', fontStyle + ',msyh');
|
|
40541
|
-
// 设置初始文本内容(支持文本库)
|
|
40542
|
-
this.updateTextContent($dateTimeText);
|
|
40551
|
+
const font = Object.assign(Object.assign({}, this.model.label.font), { fontFamily: this.model.label.font.fontFamily || 'msyh' });
|
|
40552
|
+
this.textElementModal = new text_element_TextElementModal(this.getDisplayText(), font, width, height);
|
|
40553
|
+
this.$element.append(this.textElementModal.Element);
|
|
40543
40554
|
this.switchToState(0);
|
|
40544
40555
|
this.rootElement.on('mousedown', () => {
|
|
40545
40556
|
if (!this.isInitialized) {
|
|
@@ -40713,24 +40724,23 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40713
40724
|
subscribeLanguageChange() {
|
|
40714
40725
|
if (this.guiContext && this.guiContext.languageChanged$) {
|
|
40715
40726
|
this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
|
|
40716
|
-
|
|
40717
|
-
const $dateTimeText = this.$element.find('text').last();
|
|
40718
|
-
this.updateTextContent($dateTimeText);
|
|
40727
|
+
this.updateTextContent();
|
|
40719
40728
|
});
|
|
40720
40729
|
}
|
|
40721
40730
|
}
|
|
40722
40731
|
/**
|
|
40723
40732
|
* 更新文本内容(支持文本库和语种切换)
|
|
40724
40733
|
*/
|
|
40725
|
-
updateTextContent(
|
|
40726
|
-
|
|
40727
|
-
|
|
40734
|
+
updateTextContent() {
|
|
40735
|
+
if (this.textElementModal) {
|
|
40736
|
+
this.textElementModal.updateText(this.getDisplayText());
|
|
40737
|
+
}
|
|
40728
40738
|
}
|
|
40729
40739
|
/**
|
|
40730
40740
|
* 获取显示文本
|
|
40731
40741
|
*/
|
|
40732
40742
|
getDisplayText() {
|
|
40733
|
-
var _a, _b, _c, _d, _e, _f
|
|
40743
|
+
var _a, _b, _c, _d, _e, _f;
|
|
40734
40744
|
// 检查是否使用文本库
|
|
40735
40745
|
if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
|
|
40736
40746
|
const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
|
|
@@ -40775,35 +40785,30 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40775
40785
|
return '';
|
|
40776
40786
|
}
|
|
40777
40787
|
// 处理自定义文本(支持多语种)
|
|
40778
|
-
if (this.model.label
|
|
40779
|
-
//
|
|
40780
|
-
|
|
40781
|
-
|
|
40782
|
-
|
|
40783
|
-
const
|
|
40784
|
-
// 确定要使用的语种代码(culture)
|
|
40785
|
-
let targetLanguage;
|
|
40786
|
-
const defaultLanguage = ((_k = this.languageService) === null || _k === void 0 ? void 0 : _k.getDefaultLanguage()) || 'zh-CN';
|
|
40788
|
+
if (this.model.label) {
|
|
40789
|
+
// 获取目标语种(公共逻辑)
|
|
40790
|
+
const getTargetLanguage = () => {
|
|
40791
|
+
var _a, _b, _c, _d, _e, _f;
|
|
40792
|
+
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
40793
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
40787
40794
|
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
40788
|
-
|
|
40789
|
-
targetLanguage = defaultLanguage;
|
|
40795
|
+
return defaultLanguage;
|
|
40790
40796
|
}
|
|
40791
|
-
|
|
40792
|
-
|
|
40793
|
-
|
|
40794
|
-
|
|
40795
|
-
|
|
40796
|
-
|
|
40797
|
-
|
|
40798
|
-
|
|
40799
|
-
|
|
40797
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
40798
|
+
};
|
|
40799
|
+
// 新格式:cultures 在 label 顶层
|
|
40800
|
+
if (this.model.label.cultures && typeof this.model.label.cultures === 'object') {
|
|
40801
|
+
return this.model.label.cultures[getTargetLanguage()] || '';
|
|
40802
|
+
}
|
|
40803
|
+
if (this.model.label.content) {
|
|
40804
|
+
// 中间格式(兼容):content 为 { cultures: {...} }
|
|
40805
|
+
if (typeof this.model.label.content === 'object' && this.model.label.content.cultures) {
|
|
40806
|
+
return this.model.label.content.cultures[getTargetLanguage()] || '';
|
|
40800
40807
|
}
|
|
40801
|
-
// toggle-view 找不到语种内容时默认为空字符串
|
|
40802
|
-
return this.model.label.content.cultures[targetLanguage] || '';
|
|
40803
|
-
}
|
|
40804
|
-
else if (typeof this.model.label.content === 'string') {
|
|
40805
40808
|
// 旧格式:字符串
|
|
40806
|
-
|
|
40809
|
+
if (typeof this.model.label.content === 'string') {
|
|
40810
|
+
return this.model.label.content;
|
|
40811
|
+
}
|
|
40807
40812
|
}
|
|
40808
40813
|
}
|
|
40809
40814
|
return '';
|
|
@@ -40981,7 +40986,7 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
|
|
|
40981
40986
|
* 否则返回默认文本
|
|
40982
40987
|
*/
|
|
40983
40988
|
getDisplayText() {
|
|
40984
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
40989
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40985
40990
|
// 检查是否使用文本库
|
|
40986
40991
|
if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
|
|
40987
40992
|
const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
|
|
@@ -41026,37 +41031,30 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
|
|
|
41026
41031
|
return '';
|
|
41027
41032
|
}
|
|
41028
41033
|
// 处理自定义文本(支持多语种)
|
|
41029
|
-
if (this.model.text) {
|
|
41030
|
-
//
|
|
41031
|
-
|
|
41032
|
-
|
|
41033
|
-
|
|
41034
|
-
const
|
|
41035
|
-
// 确定要使用的语种代码(culture)
|
|
41036
|
-
let targetLanguage;
|
|
41037
|
-
const defaultLanguage = ((_k = this.languageService) === null || _k === void 0 ? void 0 : _k.getDefaultLanguage()) || 'zh-CN';
|
|
41034
|
+
if (this.model.text || this.model.textCultures) {
|
|
41035
|
+
// 获取目标语种(公共逻辑)
|
|
41036
|
+
const getTargetLanguage = () => {
|
|
41037
|
+
var _a, _b, _c, _d, _e, _f;
|
|
41038
|
+
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
41039
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
41038
41040
|
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
41039
|
-
|
|
41040
|
-
targetLanguage = defaultLanguage;
|
|
41041
|
+
return defaultLanguage;
|
|
41041
41042
|
}
|
|
41042
|
-
|
|
41043
|
-
|
|
41044
|
-
|
|
41045
|
-
|
|
41046
|
-
|
|
41047
|
-
|
|
41048
|
-
|
|
41049
|
-
|
|
41050
|
-
}
|
|
41051
|
-
}
|
|
41052
|
-
// 返回对应语种的文本,如果没有则根据当前语言环境显示默认文本
|
|
41053
|
-
// 获取当前语言环境
|
|
41054
|
-
const language = ((_q = (_p = (_o = window.abp) === null || _o === void 0 ? void 0 : _o.localization) === null || _p === void 0 ? void 0 : _p.currentLanguage) === null || _q === void 0 ? void 0 : _q.name) || 'zh-Hans';
|
|
41055
|
-
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
41056
|
-
return this.model.text.cultures[targetLanguage] || (isChinese ? '超链接' : 'Hyperlink');
|
|
41043
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
41044
|
+
};
|
|
41045
|
+
const language = ((_j = (_h = (_g = window.abp) === null || _g === void 0 ? void 0 : _g.localization) === null || _h === void 0 ? void 0 : _h.currentLanguage) === null || _j === void 0 ? void 0 : _j.name) || 'zh-Hans';
|
|
41046
|
+
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
41047
|
+
const fallback = isChinese ? '超链接' : 'Hyperlink';
|
|
41048
|
+
// 新格式:textCultures 在顶层(与 text 字段并列)
|
|
41049
|
+
if (this.model.textCultures && typeof this.model.textCultures === 'object') {
|
|
41050
|
+
return this.model.textCultures[getTargetLanguage()] || fallback;
|
|
41057
41051
|
}
|
|
41058
|
-
|
|
41059
|
-
|
|
41052
|
+
// 中间格式(兼容):text 为 { cultures: {...} }
|
|
41053
|
+
if (typeof this.model.text === 'object' && this.model.text.cultures) {
|
|
41054
|
+
return this.model.text.cultures[getTargetLanguage()] || fallback;
|
|
41055
|
+
}
|
|
41056
|
+
// 旧格式:字符串
|
|
41057
|
+
if (typeof this.model.text === 'string') {
|
|
41060
41058
|
return this.model.text;
|
|
41061
41059
|
}
|
|
41062
41060
|
}
|
|
@@ -42532,7 +42530,7 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
|
|
|
42532
42530
|
this.container = document.createElement('div');
|
|
42533
42531
|
this.container.style.cssText = `
|
|
42534
42532
|
height: ${elementHeight}px;
|
|
42535
|
-
width:
|
|
42533
|
+
width: 100%;
|
|
42536
42534
|
background-color: ${((_a = this.model.generalSetting) === null || _a === void 0 ? void 0 : _a.headerFillColor) || '#ffffff'};
|
|
42537
42535
|
display: flex;
|
|
42538
42536
|
align-items: center;
|
|
@@ -42543,11 +42541,11 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
|
|
|
42543
42541
|
`;
|
|
42544
42542
|
this.element.appendChild(this.container);
|
|
42545
42543
|
// 创建一个大容器来包含所有告警项,初始位置在容器右侧(从右边开始滚入)
|
|
42546
|
-
// 使用 position: relative 而非 absolute,避免 iOS Safari foreignObject 内 absolute 定位逃逸到页面左上角的 bug
|
|
42547
42544
|
this.allAlarmsContainer = document.createElement('div');
|
|
42548
42545
|
this.allAlarmsContainer.style.cssText = `
|
|
42549
|
-
position:
|
|
42550
|
-
|
|
42546
|
+
position: absolute;
|
|
42547
|
+
top: 50%;
|
|
42548
|
+
transform: translateY(-50%);
|
|
42551
42549
|
display: flex;
|
|
42552
42550
|
align-items: center;
|
|
42553
42551
|
gap: 80px;
|