This commit is contained in:
吴红兵
2025-12-02 10:37:49 +08:00
commit 1f645dad3e
1183 changed files with 147673 additions and 0 deletions

27
src/hooks/param.ts Normal file
View File

@@ -0,0 +1,27 @@
import { param } from '/@/stores/param';
import { getValue } from '/@/api/admin/param';
import { ref } from 'vue';
/**
* 获取参数数据
* @function
* @param {string} paramType - 参数类型
* @returns {object} - 返回参数数据引用对象
*/
export function useParam(paramType: string) {
const paramValue = ref('');
const cachedParams = param().getParam(paramType);
if (cachedParams) {
paramValue.value = cachedParams;
} else {
getValue(paramType).then(({ data }) => {
if (data) {
paramValue.value = data;
param().setParam(paramType, data);
}
});
}
return paramValue;
}