mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-12-27 01:46:02 +08:00
v3.14.0 更新;【新增】EasyExcel重磅升级为FastExcel;【新增】使用最强Argon2算法作为密码存储;【新增】大家吐槽的数据字典改为可重复;【新增】前端布局再增加多种样式;【优化】升级SaToken到最新版本;【优化】token使用Sa-Token的Bearer类型;【优化】优化其他
This commit is contained in:
22
smart-admin-web-javascript/src/utils/dict.js
Normal file
22
smart-admin-web-javascript/src/utils/dict.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { useDictStore } from '/@/store/modules/system/dict';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
|
||||
/**
|
||||
* 获取字典数据
|
||||
*/
|
||||
|
||||
export function useDict(...args) {
|
||||
let res = {};
|
||||
args.forEach(async (keyCode, index) => {
|
||||
res[keyCode] = [];
|
||||
const dicts = useDictStore().getDict(keyCode);
|
||||
if (dicts) {
|
||||
res[keyCode] = dicts;
|
||||
} else {
|
||||
let result = await dictApi.valueList(keyCode);
|
||||
res[keyCode] = result.data;
|
||||
useDictStore().setDict(keyCode, res[keyCode]);
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
14
smart-admin-web-javascript/src/utils/ployfill.js
Normal file
14
smart-admin-web-javascript/src/utils/ployfill.js
Normal file
@@ -0,0 +1,14 @@
|
||||
//去除谷歌浏览器的scroll、wheel等事件警告
|
||||
(function () {
|
||||
if (typeof EventTarget !== 'undefined') {
|
||||
let func = EventTarget.prototype.addEventListener;
|
||||
EventTarget.prototype.addEventListener = function (type, fn, capture) {
|
||||
this.func = func;
|
||||
if (typeof capture !== 'boolean') {
|
||||
capture = capture || {};
|
||||
capture.passive = false;
|
||||
}
|
||||
this.func(type, fn, capture);
|
||||
};
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user