设备点检记录新增

This commit is contained in:
2026-05-21 17:54:57 +08:00
parent c09ca584c3
commit 2496d05349
25 changed files with 2188 additions and 12 deletions

View File

@@ -1,4 +1,3 @@
import { useGlobSetting } from '/@/hooks/setting';
import { merge, random } from 'lodash-es';
import { isArray } from '/@/utils/is';
import { FormSchema } from '/@/components/Form';
@@ -14,11 +13,10 @@ import { useI18n } from "@/hooks/web/useI18n";
import {$electron} from "@/electron";
import {router} from "@/router";
import {encryptByBase64} from "@/utils/cipher";
import { resolveApiBaseUrl } from '/@/utils/env/apiBaseUrl';
//存放部门路径的数组
const departNamePath = ref<Record<string, string>>({});
const globSetting = useGlobSetting();
const baseApiUrl = globSetting.domainUrl;
/**
* 获取文件服务访问路径
* @param fileUrl 文件路径
@@ -31,10 +29,10 @@ export const getFileAccessHttpUrl = (fileUrl, prefix = 'http') => {
//判断是否是数组格式
let isArray = fileUrl.indexOf('[') != -1;
if (!isArray) {
let prefix = `${baseApiUrl}/sys/common/static/`;
const staticPrefix = `${resolveApiBaseUrl()}/sys/common/static/`;
// 判断是否已包含前缀
if (!fileUrl.startsWith(prefix)) {
result = `${prefix}${fileUrl}`;
if (!fileUrl.startsWith(staticPrefix)) {
result = `${staticPrefix}${fileUrl}`;
}
}
}

View File

@@ -0,0 +1,18 @@
import { useGlobSetting } from '/@/hooks/setting';
/**
* 后端 API 根地址(含 servlet.context-path如 /jeecg-boot
* 开发环境 VITE_GLOB_DOMAIN_URL 常为 http://host:port需与 VITE_GLOB_API_URL 拼接
*/
export function resolveApiBaseUrl(): string {
const { domainUrl, apiUrl } = useGlobSetting();
const domain = (domainUrl || '').replace(/\/$/, '');
const api = apiUrl || '';
if (!domain) {
return api;
}
if (!api || domain.endsWith(api) || domain.includes(`${api}/`)) {
return domain;
}
return `${domain}${api}`;
}