Merge remote-tracking branch 'yudao/dev' into dev

This commit is contained in:
jason
2025-11-20 16:27:47 +08:00
31 changed files with 219 additions and 243 deletions

View File

@@ -254,14 +254,13 @@ function open() {
function set() {
defaultValue.value = props.modelValue;
let arr = (props.modelValue || '* * * * * ?').split(' ');
/** 简单检查 */
// 简单检查
if (arr.length < 6) {
message.warning('cron表达式错误已转换为默认表达式');
arr = '* * * * * ?'.split(' ');
}
/** 秒 */
// 秒
if (arr[0] === '*') {
cronValue.second.type = '0';
} else if (arr[0]?.includes('-')) {
@@ -277,7 +276,7 @@ function set() {
cronValue.second.appoint = arr[0]?.split(',') || [];
}
/** 分 */
// 分
if (arr[1] === '*') {
cronValue.minute.type = '0';
} else if (arr[1]?.includes('-')) {
@@ -293,7 +292,7 @@ function set() {
cronValue.minute.appoint = arr[1]?.split(',') || [];
}
/** 小时 */
// 小时
if (arr[2] === '*') {
cronValue.hour.type = '0';
} else if (arr[2]?.includes('-')) {
@@ -309,21 +308,18 @@ function set() {
cronValue.hour.appoint = arr[2]?.split(',') || [];
}
/** 日 */
// 日
switch (arr[3]) {
case '*': {
cronValue.day.type = '0';
break;
}
case '?': {
cronValue.day.type = '5';
break;
}
case 'L': {
cronValue.day.type = '4';
break;
}
default: {
@@ -342,7 +338,7 @@ function set() {
}
}
/** 月 */
// 月
if (arr[4] === '*') {
cronValue.month.type = '0';
} else if (arr[4]?.includes('-')) {
@@ -358,7 +354,7 @@ function set() {
cronValue.month.appoint = arr[4]?.split(',') || [];
}
/** 周 */
// 周
if (arr[5] === '*') {
cronValue.week.type = '0';
} else if (arr[5] === '?') {
@@ -379,7 +375,7 @@ function set() {
cronValue.week.appoint = arr[5]?.split(',') || [];
}
/** 年 */
// 年
if (!arr[6]) {
cronValue.year.type = '-1';
} else if (arr[6] === '*') {

View File

@@ -284,7 +284,6 @@ async function handleOk() {
class="h-full w-full object-cover"
/>
</div>
<!-- 头像组合预览 -->
<template v-if="previewSource">
<div

View File

@@ -8,37 +8,24 @@ import type { Recordable } from '@vben/types';
export interface DescriptionItemSchema {
labelMinWidth?: number;
contentMinWidth?: number;
// 自定义标签样式
labelStyle?: CSSProperties;
// 对应 data 中的字段名
field: string;
// 内容的描述
label: JSX.Element | string | VNode;
// 包含列的数量
span?: number;
// 是否显示
show?: (...arg: any) => boolean;
// 插槽名称
slot?: string;
// 自定义需要展示的内容
labelStyle?: CSSProperties; // 自定义标签样式
field: string; // 对应 data 中的字段名
label: JSX.Element | string | VNode; // 内容的描述
span?: number; // 包含列的数量
show?: (...arg: any) => boolean; // 是否显示
slot?: string; // 插槽名称
render?: (
val: any,
data?: Recordable<any>,
) => Element | JSX.Element | number | string | undefined | VNode;
) => Element | JSX.Element | number | string | undefined | VNode; // 自定义需要展示的内容
}
export interface DescriptionProps extends DescriptionsProps {
// 是否包含卡片组件
useCard?: boolean;
// 描述项配置
schema: DescriptionItemSchema[];
// 数据
data: Recordable<any>;
// 标题
title?: string;
// 是否包含边框
bordered?: boolean;
// 列数
useCard?: boolean; // 是否包含卡片组件
schema: DescriptionItemSchema[]; // 描述项配置
data: Recordable<any>; // 数据
title?: string; // 标题
bordered?: boolean; // 是否包含边框
column?:
| number
| {
@@ -48,7 +35,7 @@ export interface DescriptionProps extends DescriptionsProps {
xl: number;
xs: number;
xxl: number;
};
}; // 列数
}
export interface DescInstance {

View File

@@ -7,18 +7,9 @@ import { isValidColor, TinyColor } from '@vben/utils';
import { Tag } from 'ant-design-vue';
interface DictTagProps {
/**
* 字典类型
*/
type: string;
/**
* 字典值
*/
value: any;
/**
* 图标
*/
icon?: string;
type: string; // 字典类型
value: any; // 字典
icon?: string; // 图标
}
const props = defineProps<DictTagProps>();

View File

@@ -24,7 +24,7 @@ const props = withDefaults(defineProps<DictSelectProps>(), {
const attrs = useAttrs();
// 获得字典配置
/** 获得字典配置 */
const getDictOption = computed(() => {
switch (props.valueType) {
case 'bool': {

View File

@@ -16,7 +16,7 @@ export function useImagesUpload() {
},
},
setup() {
// TODO: @dhb52 其实还是靠 props 默认参数起作用,没能从 formCreate 传递
// TODO: @puhui999@dhb52 其实还是靠 props 默认参数起作用,没能从 formCreate 传递
return (props: { maxNumber?: number; multiple?: boolean }) => (
<ImageUpload maxNumber={props.maxNumber} multiple={props.multiple} />
);

View File

@@ -19,12 +19,12 @@ import {
useUploadImagesRule,
} from './rules';
// 编码表单 Conf
/** 编码表单 Conf */
export function encodeConf(designerRef: any) {
return JSON.stringify(designerRef.value.getOption());
}
// 编码表单 Fields
/** 编码表单 Fields */
export function encodeFields(designerRef: any) {
const rule = JSON.parse(designerRef.value.getJson());
const fields: string[] = [];
@@ -34,7 +34,7 @@ export function encodeFields(designerRef: any) {
return fields;
}
// 解码表单 Fields
/** 解码表单 Fields */
export function decodeFields(fields: string[]) {
const rule: Rule[] = [];
fields.forEach((item) => {
@@ -43,7 +43,7 @@ export function decodeFields(fields: string[]) {
return rule;
}
// 设置表单的 Conf 和 Fields适用 FcDesigner 场景
/** 设置表单的 Conf 和 Fields适用 FcDesigner 场景 */
export function setConfAndFields(
designerRef: any,
conf: string,
@@ -55,7 +55,7 @@ export function setConfAndFields(
designerRef.value.setRule(decodeFields(fieldsArray));
}
// 设置表单的 Conf 和 Fields适用 form-create 场景
/** 设置表单的 Conf 和 Fields适用 form-create 场景 */
export function setConfAndFields2(
detailPreview: any,
conf: string,
@@ -155,9 +155,7 @@ export async function useFormCreateDesigner(designer: Ref) {
const uploadImageRule = useUploadImageRule();
const uploadImagesRule = useUploadImagesRule();
/**
* 构建表单组件
*/
/** 构建表单组件 */
function buildFormComponents() {
// 移除自带的上传组件规则,使用 uploadFileRule、uploadImgRule、uploadImgsRule 替代
designer.value?.removeMenuItem('upload');
@@ -200,9 +198,7 @@ export async function useFormCreateDesigner(designer: Ref) {
event: ['click', 'change', 'visibleChange', 'clear', 'blur', 'focus'],
});
/**
* 构建系统字段菜单
*/
/** 构建系统字段菜单 */
function buildSystemMenu() {
// 移除自带的下拉选择器组件,使用 currencySelectRule 替代
// designer.value?.removeMenuItem('select')

View File

@@ -11,9 +11,7 @@ import {
} from '#/components/form-create/helpers';
import { selectRule } from '#/components/form-create/rules/data';
/**
* 字典选择器规则,如果规则使用到动态数据则需要单独配置不能使用 useSelectRule
*/
/** 字典选择器规则,如果规则使用到动态数据则需要单独配置不能使用 useSelectRule */
export function useDictSelectRule() {
const label = '字典选择器';
const name = 'DictSelect';

View File

@@ -137,11 +137,11 @@ function handleButtonClick(action: ActionItem) {
}
}
/** 监听props变化强制重新计算 */
/** 监听 props 变化,强制重新计算 */
watch(
() => [props.actions, props.dropDownActions],
() => {
// 这里不需要额外处理computed会自动重新计算
// 这里不需要额外处理computed 会自动重新计算
},
{ deep: true },
);

View File

@@ -17,10 +17,9 @@ const props = defineProps({
type: Boolean,
},
fullscreen: {
// 图片上传,是否放到全屏的位置
default: false,
type: Boolean,
},
}, // 图片上传,是否放到全屏的位置
});
const emit = defineEmits(['uploading', 'done', 'error']);