isdata-customer-sdk 0.2.4 → 0.2.6
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/dist/index.common.js +27 -11
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +27 -11
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +3 -3
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -33297,10 +33297,10 @@ const check = element => {
|
|
|
33297
33297
|
checkResult.innerHTMLMatch = tempHTMLMatch;
|
|
33298
33298
|
return checkResult;
|
|
33299
33299
|
}
|
|
33300
|
-
if (innerHTML.includes("
|
|
33300
|
+
if (innerHTML.includes("确定") || innerHTML.includes("OK")) {
|
|
33301
33301
|
console.log("检查smardaten平台 Tip提问确认删除按钮:", innerHTML);
|
|
33302
33302
|
let tempHTMLMatch = {
|
|
33303
|
-
oldValue: '$L{
|
|
33303
|
+
oldValue: '$L{确定}'
|
|
33304
33304
|
};
|
|
33305
33305
|
checkResult.result = true;
|
|
33306
33306
|
checkResult.innerHTMLMatch = tempHTMLMatch;
|
|
@@ -33354,6 +33354,9 @@ const catalog_i18n_check = element => {
|
|
|
33354
33354
|
};
|
|
33355
33355
|
;// ./src/api/i18n/commom_i18n/common_i18n.js
|
|
33356
33356
|
|
|
33357
|
+
|
|
33358
|
+
|
|
33359
|
+
|
|
33357
33360
|
const common_i18n_check = element => {
|
|
33358
33361
|
const checkResult = {
|
|
33359
33362
|
result: false,
|
|
@@ -33362,33 +33365,46 @@ const common_i18n_check = element => {
|
|
|
33362
33365
|
// 检查目录列表 名称 列
|
|
33363
33366
|
if (element.tagName === 'BUTTON') {
|
|
33364
33367
|
let innerHTML = element.innerHTML;
|
|
33365
|
-
let oldValue =
|
|
33368
|
+
let oldValue = element.getAttribute("oldValue");
|
|
33369
|
+
if (!oldValue) {
|
|
33370
|
+
oldValue = innerHTML;
|
|
33371
|
+
}
|
|
33372
|
+
let firstCheck = checkTextFormat(oldValue);
|
|
33373
|
+
let firstCheckResult = firstCheck ? true : false;
|
|
33366
33374
|
console.log("检查 button 元素:", innerHTML);
|
|
33375
|
+
console.log("检查结果:", firstCheckResult);
|
|
33367
33376
|
let scriptFunction = (appID, lang) => {
|
|
33368
|
-
|
|
33369
|
-
|
|
33377
|
+
let elementsArray = [];
|
|
33378
|
+
element.childNodes.forEach(node => {
|
|
33379
|
+
let scriptNodeItem = node;
|
|
33370
33380
|
if (scriptNodeItem.nodeType === Node.TEXT_NODE) {
|
|
33371
33381
|
let text = element.getAttribute("oldValue");
|
|
33382
|
+
console.log("执行 button 文本节点翻译:", text);
|
|
33372
33383
|
let isTextMatch = checkTextFormat(text);
|
|
33373
33384
|
if (!isTextMatch) {
|
|
33374
|
-
|
|
33385
|
+
elementsArray.push(scriptNodeItem);
|
|
33375
33386
|
} else {
|
|
33376
|
-
|
|
33387
|
+
console.log("执行 button 脚本节点翻译isTextMatch:", isTextMatch ? true : false);
|
|
33388
|
+
// element.removeChild(scriptNodeItem);
|
|
33377
33389
|
let key = isTextMatch.key;
|
|
33378
33390
|
let textNode = document.createTextNode(i18n(key, appID, lang) || key);
|
|
33379
|
-
|
|
33391
|
+
elementsArray.push(textNode);
|
|
33380
33392
|
}
|
|
33381
33393
|
} else {
|
|
33382
|
-
|
|
33394
|
+
elementsArray.push(scriptNodeItem);
|
|
33383
33395
|
}
|
|
33384
|
-
}
|
|
33396
|
+
});
|
|
33397
|
+
element.innerHTML = '';
|
|
33398
|
+
elementsArray.forEach(el => {
|
|
33399
|
+
element.appendChild(el);
|
|
33400
|
+
});
|
|
33385
33401
|
};
|
|
33386
33402
|
let tempHTMLMatch = {
|
|
33387
33403
|
oldValue: oldValue,
|
|
33388
33404
|
isScriptAction: true,
|
|
33389
33405
|
scriptFunction: scriptFunction
|
|
33390
33406
|
};
|
|
33391
|
-
checkResult.result =
|
|
33407
|
+
checkResult.result = firstCheckResult;
|
|
33392
33408
|
checkResult.innerHTMLMatch = tempHTMLMatch;
|
|
33393
33409
|
return checkResult;
|
|
33394
33410
|
}
|