gxd-uni-library-editx 1.0.203 → 1.0.205
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/package.json
CHANGED
|
@@ -244,6 +244,8 @@
|
|
|
244
244
|
msgIcon:'',
|
|
245
245
|
msgIconColor:'',
|
|
246
246
|
msgIconSize:'70',
|
|
247
|
+
isBindClose: true, //是否绑定确认|取消按钮自动关闭事件
|
|
248
|
+
isAllowRepeat: false, //是否相邻俩次调用可以进行覆盖操作
|
|
247
249
|
maskBackgroundColor: 'rgba(0, 0, 0, .5)',
|
|
248
250
|
},
|
|
249
251
|
uiStyle: {},
|
|
@@ -297,7 +299,6 @@
|
|
|
297
299
|
this.$xdUniHelper.cloneDeep(this.defaultConfirm),
|
|
298
300
|
value,
|
|
299
301
|
);
|
|
300
|
-
console.log('xdInputConfirm', this.confirm);
|
|
301
302
|
this.show = true;
|
|
302
303
|
}
|
|
303
304
|
},
|
|
@@ -315,7 +316,19 @@
|
|
|
315
316
|
},
|
|
316
317
|
|
|
317
318
|
close() {
|
|
318
|
-
|
|
319
|
+
//确认|取消按钮绑定关闭事件
|
|
320
|
+
if(this.confirm.isBindClose) {
|
|
321
|
+
this.setXdInputConfirm(null);
|
|
322
|
+
}
|
|
323
|
+
//不绑定关闭事件
|
|
324
|
+
else {
|
|
325
|
+
//强制显示后,不许后面确认配置弹层进行覆盖操作,需要自己延时关闭,否则就永远无法开启下一个弹层
|
|
326
|
+
if(this.confirm.isAllowRepeat) {
|
|
327
|
+
setTimeout(() => {
|
|
328
|
+
this.setXdInputConfirm(null);
|
|
329
|
+
}, 2000);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
319
332
|
if (typeof this.confirm.onClose === 'function') {
|
|
320
333
|
this.confirm.onClose()
|
|
321
334
|
}
|
package/src/utils/helper.js
CHANGED
|
@@ -1814,6 +1814,26 @@ class Helpers {
|
|
|
1814
1814
|
return data.splice(start, len);
|
|
1815
1815
|
}
|
|
1816
1816
|
|
|
1817
|
+
/**
|
|
1818
|
+
* @description 自定义trim去掉首尾指定的字符集
|
|
1819
|
+
* @param {string} str 原字符串
|
|
1820
|
+
* @param {string} chars 要去除的首尾字符集;传 '' 时使用系统原生 trim(去空白)
|
|
1821
|
+
* @returns {string}
|
|
1822
|
+
*/
|
|
1823
|
+
strTrim(str, chars){
|
|
1824
|
+
if ([undefined,null,''].includes(str)) return str;
|
|
1825
|
+
const s = String(str);
|
|
1826
|
+
|
|
1827
|
+
// chars 为空 → 走系统原生 trim(去除首尾空白)
|
|
1828
|
+
if (!chars) return s.trim();
|
|
1829
|
+
|
|
1830
|
+
let start = 0;
|
|
1831
|
+
let end = s.length;
|
|
1832
|
+
while (start < end && chars.includes(s[start])) start++;
|
|
1833
|
+
while (end > start && chars.includes(s[end - 1])) end--;
|
|
1834
|
+
|
|
1835
|
+
return s.slice(start, end);
|
|
1836
|
+
}
|
|
1817
1837
|
|
|
1818
1838
|
}
|
|
1819
1839
|
|