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.common.js
CHANGED
|
@@ -33279,10 +33279,10 @@ const check = element => {
|
|
|
33279
33279
|
checkResult.innerHTMLMatch = tempHTMLMatch;
|
|
33280
33280
|
return checkResult;
|
|
33281
33281
|
}
|
|
33282
|
-
if (innerHTML.includes("
|
|
33282
|
+
if (innerHTML.includes("确定") || innerHTML.includes("OK")) {
|
|
33283
33283
|
console.log("检查smardaten平台 Tip提问确认删除按钮:", innerHTML);
|
|
33284
33284
|
let tempHTMLMatch = {
|
|
33285
|
-
oldValue: '$L{
|
|
33285
|
+
oldValue: '$L{确定}'
|
|
33286
33286
|
};
|
|
33287
33287
|
checkResult.result = true;
|
|
33288
33288
|
checkResult.innerHTMLMatch = tempHTMLMatch;
|
|
@@ -33336,6 +33336,9 @@ const catalog_i18n_check = element => {
|
|
|
33336
33336
|
};
|
|
33337
33337
|
;// ./src/api/i18n/commom_i18n/common_i18n.js
|
|
33338
33338
|
|
|
33339
|
+
|
|
33340
|
+
|
|
33341
|
+
|
|
33339
33342
|
const common_i18n_check = element => {
|
|
33340
33343
|
const checkResult = {
|
|
33341
33344
|
result: false,
|
|
@@ -33344,33 +33347,46 @@ const common_i18n_check = element => {
|
|
|
33344
33347
|
// 检查目录列表 名称 列
|
|
33345
33348
|
if (element.tagName === 'BUTTON') {
|
|
33346
33349
|
let innerHTML = element.innerHTML;
|
|
33347
|
-
let oldValue =
|
|
33350
|
+
let oldValue = element.getAttribute("oldValue");
|
|
33351
|
+
if (!oldValue) {
|
|
33352
|
+
oldValue = innerHTML;
|
|
33353
|
+
}
|
|
33354
|
+
let firstCheck = checkTextFormat(oldValue);
|
|
33355
|
+
let firstCheckResult = firstCheck ? true : false;
|
|
33348
33356
|
console.log("检查 button 元素:", innerHTML);
|
|
33357
|
+
console.log("检查结果:", firstCheckResult);
|
|
33349
33358
|
let scriptFunction = (appID, lang) => {
|
|
33350
|
-
|
|
33351
|
-
|
|
33359
|
+
let elementsArray = [];
|
|
33360
|
+
element.childNodes.forEach(node => {
|
|
33361
|
+
let scriptNodeItem = node;
|
|
33352
33362
|
if (scriptNodeItem.nodeType === Node.TEXT_NODE) {
|
|
33353
33363
|
let text = element.getAttribute("oldValue");
|
|
33364
|
+
console.log("执行 button 文本节点翻译:", text);
|
|
33354
33365
|
let isTextMatch = checkTextFormat(text);
|
|
33355
33366
|
if (!isTextMatch) {
|
|
33356
|
-
|
|
33367
|
+
elementsArray.push(scriptNodeItem);
|
|
33357
33368
|
} else {
|
|
33358
|
-
|
|
33369
|
+
console.log("执行 button 脚本节点翻译isTextMatch:", isTextMatch ? true : false);
|
|
33370
|
+
// element.removeChild(scriptNodeItem);
|
|
33359
33371
|
let key = isTextMatch.key;
|
|
33360
33372
|
let textNode = document.createTextNode(i18n(key, appID, lang) || key);
|
|
33361
|
-
|
|
33373
|
+
elementsArray.push(textNode);
|
|
33362
33374
|
}
|
|
33363
33375
|
} else {
|
|
33364
|
-
|
|
33376
|
+
elementsArray.push(scriptNodeItem);
|
|
33365
33377
|
}
|
|
33366
|
-
}
|
|
33378
|
+
});
|
|
33379
|
+
element.innerHTML = '';
|
|
33380
|
+
elementsArray.forEach(el => {
|
|
33381
|
+
element.appendChild(el);
|
|
33382
|
+
});
|
|
33367
33383
|
};
|
|
33368
33384
|
let tempHTMLMatch = {
|
|
33369
33385
|
oldValue: oldValue,
|
|
33370
33386
|
isScriptAction: true,
|
|
33371
33387
|
scriptFunction: scriptFunction
|
|
33372
33388
|
};
|
|
33373
|
-
checkResult.result =
|
|
33389
|
+
checkResult.result = firstCheckResult;
|
|
33374
33390
|
checkResult.innerHTMLMatch = tempHTMLMatch;
|
|
33375
33391
|
return checkResult;
|
|
33376
33392
|
}
|