增加配置项
值变更回调事件增加传参 移动端不绑表字段报错修正 子组件将formModel传给父组件
This commit is contained in:
@ -16,6 +16,8 @@ VITE_DROP_CONSOLE = false
|
||||
# 接口地址
|
||||
# 如果没有跨域问题,直接在这里配置即可
|
||||
VITE_GLOB_API_URL=http://10.133.96.105:8077
|
||||
# 报表系统地址
|
||||
VITE_GLOB_REPORT_URL=http://10.133.96.105:3100
|
||||
|
||||
# 文件上传接口 可选
|
||||
VITE_GLOB_UPLOAD_URL = /system/oss/upload
|
||||
@ -31,3 +33,6 @@ VITE_GLOB_PRINT_BASE_URL = http://114.116.210.204:3300
|
||||
|
||||
# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换
|
||||
VITE_GLOB_API_URL_PREFIX =
|
||||
|
||||
# 屏蔽通知消息的轮询
|
||||
VITE_DISABLE_NEWS=false
|
||||
|
||||
@ -259,7 +259,7 @@
|
||||
const val = Array.isArray(value) ? value.join(',') : value;
|
||||
emitData.value = args;
|
||||
emit('update:value', val);
|
||||
emit('change', val);
|
||||
emit('change', val, args);
|
||||
selectedValue.value = props.value === undefined ? val : (((typeof props.value === 'string' && !!props.value ? props.value?.split(',') : props.value) || undefined) as any);
|
||||
updateSepTextField(Array.isArray(value) ? value : [value]);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -84,7 +84,17 @@
|
||||
:wrapperCol="itemLabelWidthProp.wrapperCol"
|
||||
>
|
||||
<template v-if="getDisable && readonlySupport(schema.component)">
|
||||
<readonly :schema="schema" :model="formModel" />
|
||||
<readonly :schema="schema" :model="formModel"/>
|
||||
<component
|
||||
:is="componentMap.get(schema.component)"
|
||||
v-show="false"
|
||||
v-model:endField="schema.field.split(',')[1]"
|
||||
v-model:startField="schema.field.split(',')[0]"
|
||||
v-model:value="formModel![schema.field]"
|
||||
:disabled="getDisable"
|
||||
:size="formProps?.size"
|
||||
v-bind="schema.componentProps"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<component
|
||||
@ -303,13 +313,13 @@
|
||||
} else if (typeof fun === 'function') {
|
||||
event = fun;
|
||||
}
|
||||
componentProps['on' + upperFirst(eventKey)] = function () {
|
||||
componentProps['on' + upperFirst(eventKey)] = function (value, selectedOptions) {
|
||||
let cloneFormModel = cloneDeep(formModel);
|
||||
for (let item in cloneFormModel) {
|
||||
let field = camelCaseString(item);
|
||||
if (field) cloneFormModel[field] = cloneFormModel[item];
|
||||
}
|
||||
event(props.schema, isCamelCase ? cloneFormModel : formModel, props.formApi, { formData });
|
||||
event(props.schema, isCamelCase ? cloneFormModel : formModel, props.formApi, { formData, value, selectedOptions });
|
||||
|
||||
if (isCamelCase) {
|
||||
for (let item in formModel) {
|
||||
|
||||
@ -5,50 +5,40 @@ import pkg from '../../package.json';
|
||||
import { getConfigFileName } from '../../build/getConfigFileName';
|
||||
|
||||
export function getCommonStoragePrefix() {
|
||||
const { VITE_GLOB_APP_SHORT_NAME } = getAppEnvConfig();
|
||||
return `${VITE_GLOB_APP_SHORT_NAME}__${getEnv()}`.toUpperCase();
|
||||
const { VITE_GLOB_APP_SHORT_NAME } = getAppEnvConfig();
|
||||
return `${VITE_GLOB_APP_SHORT_NAME}__${getEnv()}`.toUpperCase();
|
||||
}
|
||||
|
||||
// Generate cache key according to version
|
||||
export function getStorageShortName() {
|
||||
return `${getCommonStoragePrefix()}${`__${pkg.version}`}__`.toUpperCase();
|
||||
return `${getCommonStoragePrefix()}${`__${pkg.version}`}__`.toUpperCase();
|
||||
}
|
||||
|
||||
export function getAppEnvConfig() {
|
||||
const ENV_NAME = getConfigFileName(import.meta.env);
|
||||
const ENV_NAME = getConfigFileName(import.meta.env);
|
||||
|
||||
const ENV = (import.meta.env.DEV
|
||||
? // Get the global configuration (the configuration will be extracted independently when packaging)
|
||||
(import.meta.env as unknown as GlobEnvConfig)
|
||||
: window[ENV_NAME as any]) as unknown as GlobEnvConfig;
|
||||
const ENV = (import.meta.env.DEV
|
||||
? // Get the global configuration (the configuration will be extracted independently when packaging)
|
||||
(import.meta.env as unknown as GlobEnvConfig)
|
||||
: window[ENV_NAME as any]) as unknown as GlobEnvConfig;
|
||||
|
||||
const {
|
||||
VITE_GLOB_APP_TITLE,
|
||||
VITE_GLOB_API_URL,
|
||||
VITE_GLOB_APP_SHORT_NAME,
|
||||
VITE_GLOB_API_URL_PREFIX,
|
||||
VITE_GLOB_UPLOAD_URL,
|
||||
VITE_GLOB_UPLOAD_PREVIEW,
|
||||
VITE_GLOB_OUT_LINK_URL,
|
||||
VITE_GLOB_PRINT_BASE_URL,
|
||||
} = ENV;
|
||||
const { VITE_GLOB_APP_TITLE, VITE_GLOB_API_URL, VITE_GLOB_APP_SHORT_NAME, VITE_GLOB_API_URL_PREFIX, VITE_GLOB_UPLOAD_URL, VITE_GLOB_UPLOAD_PREVIEW, VITE_GLOB_OUT_LINK_URL, VITE_GLOB_REPORT_URL, VITE_GLOB_PRINT_BASE_URL } = ENV;
|
||||
|
||||
if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
|
||||
warn(
|
||||
`VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.`,
|
||||
);
|
||||
}
|
||||
if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
|
||||
warn(`VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.`);
|
||||
}
|
||||
|
||||
return {
|
||||
VITE_GLOB_APP_TITLE,
|
||||
VITE_GLOB_API_URL,
|
||||
VITE_GLOB_APP_SHORT_NAME,
|
||||
VITE_GLOB_API_URL_PREFIX,
|
||||
VITE_GLOB_UPLOAD_URL,
|
||||
VITE_GLOB_UPLOAD_PREVIEW,
|
||||
VITE_GLOB_OUT_LINK_URL,
|
||||
VITE_GLOB_PRINT_BASE_URL,
|
||||
};
|
||||
return {
|
||||
VITE_GLOB_APP_TITLE,
|
||||
VITE_GLOB_API_URL,
|
||||
VITE_GLOB_APP_SHORT_NAME,
|
||||
VITE_GLOB_API_URL_PREFIX,
|
||||
VITE_GLOB_UPLOAD_URL,
|
||||
VITE_GLOB_UPLOAD_PREVIEW,
|
||||
VITE_GLOB_OUT_LINK_URL,
|
||||
VITE_GLOB_REPORT_URL,
|
||||
VITE_GLOB_PRINT_BASE_URL
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@ -67,7 +57,7 @@ export const prodMode = 'production';
|
||||
* @example:
|
||||
*/
|
||||
export function getEnv(): string {
|
||||
return import.meta.env.MODE;
|
||||
return import.meta.env.MODE;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -76,7 +66,7 @@ export function getEnv(): string {
|
||||
* @example:
|
||||
*/
|
||||
export function isDevMode(): boolean {
|
||||
return import.meta.env.DEV;
|
||||
return import.meta.env.DEV;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,5 +75,5 @@ export function isDevMode(): boolean {
|
||||
* @example:
|
||||
*/
|
||||
export function isProdMode(): boolean {
|
||||
return import.meta.env.PROD;
|
||||
return import.meta.env.PROD;
|
||||
}
|
||||
|
||||
@ -498,7 +498,8 @@
|
||||
}
|
||||
// TODO 这里继续写各组件自己特有的一些验证
|
||||
|
||||
if (!component.bindTable) {
|
||||
if ((component.type == 'input' && !component.options!.isSave && !component.bindTable) ||
|
||||
(component.type !== 'input' && !component.bindTable)) {
|
||||
return t(`{name}未绑定表`, { name: component.label });
|
||||
}
|
||||
|
||||
|
||||
288
types/config.d.ts
vendored
288
types/config.d.ts
vendored
@ -1,179 +1,173 @@
|
||||
import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum';
|
||||
import {
|
||||
ContentEnum,
|
||||
PermissionModeEnum,
|
||||
ThemeEnum,
|
||||
RouterTransitionEnum,
|
||||
SettingButtonPositionEnum,
|
||||
SessionTimeoutProcessingEnum,
|
||||
} from '/@/enums/appEnum';
|
||||
import { ContentEnum, PermissionModeEnum, ThemeEnum, RouterTransitionEnum, SettingButtonPositionEnum, SessionTimeoutProcessingEnum } from '/@/enums/appEnum';
|
||||
|
||||
import { CacheTypeEnum } from '/@/enums/cacheEnum';
|
||||
|
||||
export type LocaleType = 'zh_CN' | 'zh_TW' | 'en' | 'ru' | 'ja' | 'ko';
|
||||
|
||||
export interface MenuSetting {
|
||||
bgColor: string;
|
||||
fixed: boolean;
|
||||
collapsed: boolean;
|
||||
canDrag: boolean;
|
||||
show: boolean;
|
||||
hidden: boolean;
|
||||
split: boolean;
|
||||
menuWidth: number;
|
||||
mode: MenuModeEnum;
|
||||
type: MenuTypeEnum;
|
||||
theme: ThemeEnum;
|
||||
topMenuAlign: 'start' | 'center' | 'end';
|
||||
trigger: TriggerEnum;
|
||||
accordion: boolean;
|
||||
closeMixSidebarOnChange: boolean;
|
||||
collapsedShowTitle: boolean;
|
||||
mixSideTrigger: MixSidebarTriggerEnum;
|
||||
mixSideFixed: boolean;
|
||||
bgColor: string;
|
||||
fixed: boolean;
|
||||
collapsed: boolean;
|
||||
canDrag: boolean;
|
||||
show: boolean;
|
||||
hidden: boolean;
|
||||
split: boolean;
|
||||
menuWidth: number;
|
||||
mode: MenuModeEnum;
|
||||
type: MenuTypeEnum;
|
||||
theme: ThemeEnum;
|
||||
topMenuAlign: 'start' | 'center' | 'end';
|
||||
trigger: TriggerEnum;
|
||||
accordion: boolean;
|
||||
closeMixSidebarOnChange: boolean;
|
||||
collapsedShowTitle: boolean;
|
||||
mixSideTrigger: MixSidebarTriggerEnum;
|
||||
mixSideFixed: boolean;
|
||||
}
|
||||
|
||||
export interface MultiTabsSetting {
|
||||
cache: boolean;
|
||||
show: boolean;
|
||||
showQuick: boolean;
|
||||
canDrag: boolean;
|
||||
showRedo: boolean;
|
||||
showFold: boolean;
|
||||
cache: boolean;
|
||||
show: boolean;
|
||||
showQuick: boolean;
|
||||
canDrag: boolean;
|
||||
showRedo: boolean;
|
||||
showFold: boolean;
|
||||
}
|
||||
|
||||
export interface HeaderSetting {
|
||||
bgColor: string;
|
||||
fixed: boolean;
|
||||
show: boolean;
|
||||
theme: ThemeEnum;
|
||||
// Turn on full screen
|
||||
showFullScreen: boolean;
|
||||
// Whether to show the lock screen
|
||||
useLockPage: boolean;
|
||||
// Show document button
|
||||
showDoc: boolean;
|
||||
// Show message center button
|
||||
showNotice: boolean;
|
||||
showSearch: boolean;
|
||||
bgColor: string;
|
||||
fixed: boolean;
|
||||
show: boolean;
|
||||
theme: ThemeEnum;
|
||||
// Turn on full screen
|
||||
showFullScreen: boolean;
|
||||
// Whether to show the lock screen
|
||||
useLockPage: boolean;
|
||||
// Show document button
|
||||
showDoc: boolean;
|
||||
// Show message center button
|
||||
showNotice: boolean;
|
||||
showSearch: boolean;
|
||||
}
|
||||
|
||||
export interface LocaleSetting {
|
||||
showPicker: boolean;
|
||||
// Current language
|
||||
locale: LocaleType;
|
||||
// default language
|
||||
fallback: LocaleType;
|
||||
// available Locales
|
||||
availableLocales: LocaleType[];
|
||||
showPicker: boolean;
|
||||
// Current language
|
||||
locale: LocaleType;
|
||||
// default language
|
||||
fallback: LocaleType;
|
||||
// available Locales
|
||||
availableLocales: LocaleType[];
|
||||
}
|
||||
|
||||
export interface TransitionSetting {
|
||||
// Whether to open the page switching animation
|
||||
enable: boolean;
|
||||
// Route basic switching animation
|
||||
basicTransition: RouterTransitionEnum;
|
||||
// Whether to open page switching loading
|
||||
openPageLoading: boolean;
|
||||
// Whether to open the top progress bar
|
||||
openNProgress: boolean;
|
||||
// Whether to open the page switching animation
|
||||
enable: boolean;
|
||||
// Route basic switching animation
|
||||
basicTransition: RouterTransitionEnum;
|
||||
// Whether to open page switching loading
|
||||
openPageLoading: boolean;
|
||||
// Whether to open the top progress bar
|
||||
openNProgress: boolean;
|
||||
}
|
||||
|
||||
export interface ProjectConfig {
|
||||
// Storage location of permission related information
|
||||
permissionCacheType: CacheTypeEnum;
|
||||
// Whether to show the configuration button
|
||||
showSettingButton: boolean;
|
||||
// Whether to show the theme switch button
|
||||
showDarkModeToggle: boolean;
|
||||
// Configure where the button is displayed
|
||||
settingButtonPosition: SettingButtonPositionEnum;
|
||||
// Permission mode
|
||||
permissionMode: PermissionModeEnum;
|
||||
// Session timeout processing
|
||||
sessionTimeoutProcessing: SessionTimeoutProcessingEnum;
|
||||
// Website gray mode, open for possible mourning dates
|
||||
grayMode: boolean;
|
||||
// Whether to turn on the color weak mode
|
||||
colorWeak: boolean;
|
||||
// Theme color
|
||||
themeColor: string;
|
||||
// Storage location of permission related information
|
||||
permissionCacheType: CacheTypeEnum;
|
||||
// Whether to show the configuration button
|
||||
showSettingButton: boolean;
|
||||
// Whether to show the theme switch button
|
||||
showDarkModeToggle: boolean;
|
||||
// Configure where the button is displayed
|
||||
settingButtonPosition: SettingButtonPositionEnum;
|
||||
// Permission mode
|
||||
permissionMode: PermissionModeEnum;
|
||||
// Session timeout processing
|
||||
sessionTimeoutProcessing: SessionTimeoutProcessingEnum;
|
||||
// Website gray mode, open for possible mourning dates
|
||||
grayMode: boolean;
|
||||
// Whether to turn on the color weak mode
|
||||
colorWeak: boolean;
|
||||
// Theme color
|
||||
themeColor: string;
|
||||
|
||||
// The main interface is displayed in full screen, the menu is not displayed, and the top
|
||||
fullContent: boolean;
|
||||
// content width
|
||||
contentMode: ContentEnum;
|
||||
// Whether to display the logo
|
||||
showLogo: boolean;
|
||||
// Whether to show the global footer
|
||||
showFooter: boolean;
|
||||
// menuType: MenuTypeEnum;
|
||||
headerSetting: HeaderSetting;
|
||||
// menuSetting
|
||||
menuSetting: MenuSetting;
|
||||
// Multi-tab settings
|
||||
multiTabsSetting: MultiTabsSetting;
|
||||
// Animation configuration
|
||||
transitionSetting: TransitionSetting;
|
||||
// pageLayout whether to enable keep-alive
|
||||
openKeepAlive: boolean;
|
||||
// Lock screen time
|
||||
lockTime: number;
|
||||
// Show breadcrumbs
|
||||
showBreadCrumb: boolean;
|
||||
// Show breadcrumb icon
|
||||
showBreadCrumbIcon: boolean;
|
||||
// Use error-handler-plugin
|
||||
useErrorHandle: boolean;
|
||||
// Whether to open back to top
|
||||
useOpenBackTop: boolean;
|
||||
// Is it possible to embed iframe pages
|
||||
canEmbedIFramePage: boolean;
|
||||
// Whether to delete unclosed messages and notify when switching the interface
|
||||
closeMessageOnSwitch: boolean;
|
||||
// Whether to cancel the http request that has been sent but not responded when switching the interface.
|
||||
removeAllHttpPending: boolean;
|
||||
// The main interface is displayed in full screen, the menu is not displayed, and the top
|
||||
fullContent: boolean;
|
||||
// content width
|
||||
contentMode: ContentEnum;
|
||||
// Whether to display the logo
|
||||
showLogo: boolean;
|
||||
// Whether to show the global footer
|
||||
showFooter: boolean;
|
||||
// menuType: MenuTypeEnum;
|
||||
headerSetting: HeaderSetting;
|
||||
// menuSetting
|
||||
menuSetting: MenuSetting;
|
||||
// Multi-tab settings
|
||||
multiTabsSetting: MultiTabsSetting;
|
||||
// Animation configuration
|
||||
transitionSetting: TransitionSetting;
|
||||
// pageLayout whether to enable keep-alive
|
||||
openKeepAlive: boolean;
|
||||
// Lock screen time
|
||||
lockTime: number;
|
||||
// Show breadcrumbs
|
||||
showBreadCrumb: boolean;
|
||||
// Show breadcrumb icon
|
||||
showBreadCrumbIcon: boolean;
|
||||
// Use error-handler-plugin
|
||||
useErrorHandle: boolean;
|
||||
// Whether to open back to top
|
||||
useOpenBackTop: boolean;
|
||||
// Is it possible to embed iframe pages
|
||||
canEmbedIFramePage: boolean;
|
||||
// Whether to delete unclosed messages and notify when switching the interface
|
||||
closeMessageOnSwitch: boolean;
|
||||
// Whether to cancel the http request that has been sent but not responded when switching the interface.
|
||||
removeAllHttpPending: boolean;
|
||||
}
|
||||
|
||||
export interface GlobConfig {
|
||||
// Site title
|
||||
title: string;
|
||||
// Service interface url
|
||||
apiUrl: string;
|
||||
// Upload url
|
||||
uploadUrl?: string;
|
||||
// Service interface url prefix
|
||||
urlPrefix?: string;
|
||||
// Project abbreviation
|
||||
shortName: string;
|
||||
// outlink
|
||||
outLink?: string;
|
||||
//print url
|
||||
printBaseUrl?: string;
|
||||
// Site title
|
||||
title: string;
|
||||
// Service interface url
|
||||
apiUrl: string;
|
||||
// Upload url
|
||||
uploadUrl?: string;
|
||||
// Service interface url prefix
|
||||
urlPrefix?: string;
|
||||
// Project abbreviation
|
||||
shortName: string;
|
||||
// outlink
|
||||
outLink?: string;
|
||||
//print url
|
||||
printBaseUrl?: string;
|
||||
}
|
||||
export interface GlobEnvConfig {
|
||||
// Site title
|
||||
VITE_GLOB_APP_TITLE: string;
|
||||
// Service interface url
|
||||
VITE_GLOB_API_URL: string;
|
||||
// Service interface url prefix
|
||||
VITE_GLOB_API_URL_PREFIX?: string;
|
||||
// Project abbreviation
|
||||
VITE_GLOB_APP_SHORT_NAME: string;
|
||||
// Upload url
|
||||
VITE_GLOB_UPLOAD_URL?: string;
|
||||
VITE_GLOB_OUT_LINK_URL?: string;
|
||||
VITE_GLOB_PRINT_BASE_URL?: string;
|
||||
//file preview
|
||||
VITE_GLOB_UPLOAD_PREVIEW?: string;
|
||||
// Site title
|
||||
VITE_GLOB_APP_TITLE: string;
|
||||
// Service interface url
|
||||
VITE_GLOB_API_URL: string;
|
||||
// Service interface url prefix
|
||||
VITE_GLOB_API_URL_PREFIX?: string;
|
||||
// Project abbreviation
|
||||
VITE_GLOB_APP_SHORT_NAME: string;
|
||||
// Upload url
|
||||
VITE_GLOB_UPLOAD_URL?: string;
|
||||
VITE_GLOB_OUT_LINK_URL?: string;
|
||||
VITE_GLOB_PRINT_BASE_URL?: string;
|
||||
//file preview
|
||||
VITE_GLOB_UPLOAD_PREVIEW?: string;
|
||||
VITE_GLOB_REPORT_URL: string;
|
||||
}
|
||||
|
||||
export interface LogoConfig {
|
||||
companyName?: string;
|
||||
shortName?: string;
|
||||
refreshLogoUrl?: string;
|
||||
backgroundLogoUrl?: string;
|
||||
designerLogoUrl?: string;
|
||||
loginLogoUrl?: string;
|
||||
menuLogoUrl?: string;
|
||||
companyName?: string;
|
||||
shortName?: string;
|
||||
refreshLogoUrl?: string;
|
||||
backgroundLogoUrl?: string;
|
||||
designerLogoUrl?: string;
|
||||
loginLogoUrl?: string;
|
||||
menuLogoUrl?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user