gis-common 5.1.15 → 5.1.16
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/gis-common.es.js
CHANGED
|
@@ -247,8 +247,6 @@ const Util = {
|
|
|
247
247
|
return !value.length;
|
|
248
248
|
case "Object":
|
|
249
249
|
return !Object.keys(value).length;
|
|
250
|
-
case "Boolean":
|
|
251
|
-
return !value;
|
|
252
250
|
default:
|
|
253
251
|
return false;
|
|
254
252
|
}
|
|
@@ -2821,10 +2819,6 @@ class MessageUtil {
|
|
|
2821
2819
|
static resetWarned() {
|
|
2822
2820
|
this.warned = {};
|
|
2823
2821
|
}
|
|
2824
|
-
static changeVoice() {
|
|
2825
|
-
this.isMute = !!Number(!this.isMute);
|
|
2826
|
-
localStorage.setItem("mute", Number(this.isMute).toString());
|
|
2827
|
-
}
|
|
2828
2822
|
static _call(method, message, options) {
|
|
2829
2823
|
if (!this.warned[message]) {
|
|
2830
2824
|
method(message, options);
|
|
@@ -2840,10 +2834,9 @@ class MessageUtil {
|
|
|
2840
2834
|
* @returns 无返回值
|
|
2841
2835
|
*/
|
|
2842
2836
|
static msg(type, message, options = {}) {
|
|
2843
|
-
|
|
2844
|
-
const typename = Util.decodeDict(type, "success", "恭喜", "error", "发生错误", "warning", "警告", "info", "友情提示") + ":";
|
|
2837
|
+
this.speechSynthesisUtterance.lang = options.lang || this.LANG;
|
|
2838
|
+
const typename = this.speechSynthesisUtterance.lang === "zh-CN" ? Util.decodeDict(type, "success", "恭喜", "error", "发生错误", "warning", "警告", "info", "友情提示") + ":" : Util.decodeDict(type, "success", "congratulation", "error", "Error occurred", "warning", "Warning", "info", "Tips") + ":";
|
|
2845
2839
|
this.speechSynthesisUtterance.text = typename + message;
|
|
2846
|
-
this.speechSynthesisUtterance.lang = options.lang || "zh-CN";
|
|
2847
2840
|
this.speechSynthesisUtterance.volume = options.volume || 1;
|
|
2848
2841
|
this.speechSynthesisUtterance.rate = options.rate || 1;
|
|
2849
2842
|
this.speechSynthesisUtterance.pitch = options.pitch || 1;
|
|
@@ -2886,8 +2879,8 @@ class MessageUtil {
|
|
|
2886
2879
|
this._call(this.success.bind(this), message, options);
|
|
2887
2880
|
}
|
|
2888
2881
|
}
|
|
2882
|
+
__publicField(MessageUtil, "LANG", "zh-CN");
|
|
2889
2883
|
__publicField(MessageUtil, "warned", {});
|
|
2890
|
-
__publicField(MessageUtil, "isMute", !!Number(localStorage.getItem("mute")) || false);
|
|
2891
2884
|
__publicField(MessageUtil, "speechSynthesis", window.speechSynthesis);
|
|
2892
2885
|
__publicField(MessageUtil, "speechSynthesisUtterance", new SpeechSynthesisUtterance());
|
|
2893
2886
|
const OptimizeUtil = {
|