Merge pull request !153 from xingyu/dev
pull/155/MERGE
xingyu 2025-06-21 09:11:36 +00:00 committed by Gitee
commit 273577c6d3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
25 changed files with 1281 additions and 55 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
export { default as CronTab } from './cron-tab.vue';

View File

@ -75,7 +75,7 @@ defineExpose({
<div class="inline-block text-center" :style="getStyle">
<!-- 图片包装器 -->
<div
class="group relative cursor-pointer overflow-hidden rounded-full border border-gray-200 bg-white"
class="bg-card group relative cursor-pointer overflow-hidden rounded-full border border-gray-200"
:style="getImageWrapperStyle"
@click="openModal"
>

View File

@ -1,9 +1,10 @@
<script setup lang="ts">
import { computed } from 'vue';
import { isValidColor, TinyColor } from '@vben/utils';
import { Tag } from 'ant-design-vue';
// import { isHexColor } from '@/utils/color' // TODO @ cssClass https://gitee.com/yudaocode/yudao-ui-admin-vben/blob/v2.4.1/src/components/DictTag/src/DictTag.vue#L60
import { getDictObj } from '#/utils';
interface DictTagProps {
@ -23,11 +24,6 @@ interface DictTagProps {
const props = defineProps<DictTagProps>();
function isHexColor(color: string) {
const reg = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
return reg.test(color);
}
/** 获取字典标签 */
const dictTag = computed(() => {
//
@ -63,6 +59,10 @@ const dictTag = computed(() => {
}
}
if (isValidColor(dict.cssClass)) {
colorType = new TinyColor(dict.cssClass).toHexString();
}
return {
label: dict.label || '',
colorType,
@ -74,13 +74,7 @@ const dictTag = computed(() => {
<template>
<Tag
v-if="dictTag"
:color="
dictTag.colorType
? dictTag.colorType
: dictTag.cssClass && isHexColor(dictTag.cssClass)
? dictTag.cssClass
: ''
"
:color="dictTag.colorType ? dictTag.colorType : dictTag.cssClass"
>
{{ dictTag.label }}
</Tag>

View File

@ -238,7 +238,7 @@ defineExpose({ validate });
<ErrorModal title="流程设计校验不通过" class="w-2/5">
<div class="mb-2 text-base">以下节点配置不完善请修改相关配置</div>
<div
class="mb-3 rounded-md bg-gray-100 p-2 text-sm"
class="mb-3 rounded-md p-2 text-sm"
v-for="(item, index) in errorModalApi.getData()"
:key="index"
>

View File

@ -201,7 +201,7 @@ onMounted(() => {
</script>
<template>
<div class="simple-process-model-container">
<div class="absolute right-0 top-0 bg-white">
<div class="bg-card absolute right-0 top-0">
<Row type="flex" justify="end">
<ButtonGroup key="scale-control">
<Button v-if="!readonly" @click="exportJson">
@ -258,7 +258,7 @@ onMounted(() => {
>
<div class="mb-2">以下节点内容不完善请修改后保存</div>
<div
class="line-height-normal mb-3 rounded bg-gray-100 p-2"
class="line-height-normal mb-3 rounded p-2"
v-for="(item, index) in errorNodes"
:key="index"
>

View File

@ -237,7 +237,7 @@ function getTooltipProps(tooltip: any | string) {
}
function handleMenuClick(e: any) {
const action = unref(getDropdownList)[e.key];
const action = getDropdownList.value[e.key];
if (action.onClick && isFunction(action.onClick)) {
action.onClick();
}
@ -293,10 +293,12 @@ function getActionKey(action: ActionItem, index: number) {
</Button>
</slot>
<template #overlay>
<Menu @click="handleMenuClick">
<Menu>
<Menu.Item
v-for="(action, index) in getDropdownList"
:key="`dropdown-${index}`"
:key="index"
:disabled="action.disabled"
@click="!action.popConfirm && handleMenuClick({ key: index })"
>
<template v-if="action.popConfirm">
<Popconfirm v-bind="getPopConfirmProps(action.popConfirm)">

View File

@ -66,7 +66,7 @@ function handleClick(doc: any) {
<div
v-for="(doc, index) in documentList"
:key="index"
class="cursor-pointer rounded-lg bg-white p-2 px-3 transition-all hover:bg-blue-50"
class="bg-card cursor-pointer rounded-lg p-2 px-3 transition-all hover:bg-blue-50"
@click="handleClick(doc)"
>
<div class="mb-1 text-sm text-gray-600">
@ -89,7 +89,7 @@ function handleClick(doc: any) {
class="border-b-solid border-b-gray-200 p-3 last:border-b-0"
>
<div
class="mb-2 block w-fit rounded-sm bg-gray-50 px-2 py-1 text-xs text-gray-400"
class="mb-2 block w-fit rounded-sm px-2 py-1 text-xs text-gray-400"
>
分段 {{ segment.id }}
</div>

View File

@ -204,7 +204,7 @@ onUnmounted(async () => {
</div>
<div
class="sticky bottom-0 z-50 flex h-16 items-center justify-center bg-white shadow-sm"
class="bg-card sticky bottom-0 z-50 flex h-16 items-center justify-center shadow-sm"
>
<Pagination
:total="pageTotal"

View File

@ -231,7 +231,7 @@ defineExpose({ settingValues });
@click="handleSizeClick(imageSize)"
>
<div
class="flex h-12 w-12 flex-col items-center justify-center rounded-lg border bg-white p-0"
class="bg-card flex h-12 w-12 flex-col items-center justify-center rounded-lg border p-0"
:class="[
selectSize === imageSize.key ? 'border-blue-500' : 'border-white',
]"

View File

@ -182,7 +182,7 @@ defineExpose({ settingValues });
@click="handleSizeClick(imageSize)"
>
<div
class="flex h-12 w-12 items-center justify-center rounded-lg border bg-white p-0"
class="bg-card flex h-12 w-12 items-center justify-center rounded-lg border p-0"
:class="[
selectSize === imageSize.key ? 'border-blue-500' : 'border-white',
]"

View File

@ -90,13 +90,12 @@ onMounted(async () => {
<template>
<Page auto-content-height>
<div class="absolute inset-0 flex h-full w-full flex-row bg-gray-50">
<div class="bg-card absolute inset-0 flex h-full w-full flex-row">
<div class="left-0 flex w-96 flex-col p-4">
<div class="segmented flex justify-center">
<Segmented
v-model:value="selectPlatform"
:options="platformOptions"
class="bg-gray-100"
/>
</div>
<div class="mt-8 h-full overflow-y-auto">
@ -126,7 +125,7 @@ onMounted(async () => {
/>
</div>
</div>
<div class="ml-4 flex-1 bg-white">
<div class="bg-card ml-4 flex-1">
<ImageList ref="imageListRef" @on-regeneration="handleRegeneration" />
</div>
</div>

View File

@ -45,7 +45,7 @@ onMounted(async () => {
</script>
<template>
<Page auto-content-height>
<div class="bg-white p-5">
<div class="bg-card p-5">
<Input.Search
v-model="queryParams.prompt"
class="mb-5 w-full"
@ -54,12 +54,12 @@ onMounted(async () => {
@keyup.enter="handleQuery"
/>
<div
class="grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-2.5 bg-white shadow-sm"
class="bg-card grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-2.5 shadow-sm"
>
<div
v-for="item in list"
:key="item.id"
class="relative cursor-pointer overflow-hidden bg-white transition-transform duration-300 hover:scale-105"
class="bg-card relative cursor-pointer overflow-hidden transition-transform duration-300 hover:scale-105"
>
<Image
:src="item.picUrl"

View File

@ -237,7 +237,7 @@ onMounted(async () => {
<div v-else class="text-gray-400">暂无上传文件</div>
</div>
<!-- 文件内容预览 -->
<div class="max-h-[600px] overflow-y-auto rounded-md bg-gray-50 p-4">
<div class="max-h-[600px] overflow-y-auto rounded-md p-4">
<div v-if="splitLoading" class="flex items-center justify-center py-5">
<IconifyIcon icon="lucide:loader" class="is-loading" />
<span class="ml-2.5">正在加载分段内容...</span>
@ -258,7 +258,7 @@ onMounted(async () => {
分片-{{ index + 1 }} · {{ segment.contentLength || 0 }} 字符数 ·
{{ segment.tokens || 0 }} Token
</div>
<div class="rounded-md bg-white p-2">
<div class="bg-card rounded-md p-2">
{{ segment.content }}
</div>
</div>

View File

@ -131,7 +131,7 @@ defineExpose({
<div class="mx-auto">
<!-- 头部导航栏 -->
<div
class="absolute left-0 right-0 top-0 z-10 flex h-12 items-center border-b bg-white px-4"
class="bg-card absolute left-0 right-0 top-0 z-10 flex h-12 items-center border-b px-4"
>
<!-- 左侧标题 -->
<div class="flex w-48 items-center overflow-hidden">

View File

@ -147,7 +147,7 @@ onMounted(() => {
</template>
<template #expand_content="{ row }">
<div
class="whitespace-pre-wrap border-l-4 border-blue-500 bg-gray-100 px-2.5 py-5 leading-5"
class="whitespace-pre-wrap border-l-4 border-blue-500 px-2.5 py-5 leading-5"
>
<div class="mb-2 text-sm font-bold text-gray-600">完整内容</div>
{{ row.content }}

View File

@ -23,7 +23,7 @@ defineExpose({
});
</script>
<template>
<div class="flex w-80 flex-col bg-gray-50 p-5">
<div class="bg-card flex w-80 flex-col rounded-lg p-5">
<h3 class="text-primary h-7 w-full text-center text-xl leading-7">
思维导图创作中心
</h3>

View File

@ -40,7 +40,7 @@ function audioTimeUpdate(args: any) {
<template>
<div
class="b-1 b-l-none h-18 flex items-center justify-between border border-solid border-rose-100 bg-white px-2"
class="b-1 b-l-none h-18 bg-card flex items-center justify-between border border-solid border-rose-100 px-2"
>
<!-- 歌曲信息 -->
<div class="flex gap-2.5">

View File

@ -207,7 +207,7 @@ onBeforeUnmount(() => {
<div class="mx-auto">
<!-- 头部导航栏 -->
<div
class="absolute inset-x-0 top-0 z-10 flex h-12 items-center border-b bg-white px-5"
class="bg-card absolute inset-x-0 top-0 z-10 flex h-12 items-center border-b px-5"
>
<!-- 左侧标题 -->
<div class="flex w-48 items-center overflow-hidden">

View File

@ -400,7 +400,7 @@ onBeforeUnmount(() => {
<div class="mx-auto">
<!-- 头部导航栏 -->
<div
class="absolute inset-x-0 top-0 z-10 flex h-12 items-center border-b bg-white px-5"
class="bg-card absolute inset-x-0 top-0 z-10 flex h-12 items-center border-b px-5"
>
<!-- 左侧标题 -->
<div class="flex w-48 items-center overflow-hidden">

View File

@ -335,7 +335,7 @@ defineExpose({ validate });
<div
v-for="user in selectedStartUsers"
:key="user.id"
class="relative flex h-9 items-center rounded-full bg-gray-100 pr-2 hover:bg-gray-200"
class="relative flex h-9 items-center rounded-full pr-2 hover:bg-gray-200"
>
<Avatar
class="m-1"
@ -371,7 +371,7 @@ defineExpose({ validate });
<div
v-for="dept in selectedStartDepts"
:key="dept.id"
class="relative flex h-9 items-center rounded-full bg-gray-100 pr-2 shadow-sm hover:bg-gray-200"
class="relative flex h-9 items-center rounded-full pr-2 shadow-sm hover:bg-gray-200"
>
<IconifyIcon icon="lucide:building" class="size-6 px-1" />
{{ dept.name }}
@ -398,7 +398,7 @@ defineExpose({ validate });
<div
v-for="user in selectedManagerUsers"
:key="user.id"
class="relative flex h-9 items-center rounded-full bg-gray-100 pr-2 hover:bg-gray-200"
class="hover:bg-primary-500 relative flex h-9 items-center rounded-full pr-2"
>
<Avatar
class="m-1"

View File

@ -122,13 +122,11 @@ getDetail();
<template>
<Page auto-content-height v-loading="loading">
<div
class="flex h-[95%] flex-col rounded-md bg-white p-4 dark:bg-gray-800 dark:text-gray-300"
>
<div class="bg-card flex h-[95%] flex-col rounded-md p-4">
<Steps
type="navigation"
v-model:current="currentStep"
class="mb-8 rounded shadow-sm dark:bg-gray-700"
class="mb-8 rounded shadow-sm"
>
<Steps.Step
v-for="(step, index) in steps"

View File

@ -2,12 +2,13 @@ import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
import { h, markRaw } from 'vue';
import { formatDateTime } from '@vben/utils';
import { Timeline } from 'ant-design-vue';
import { CronTab } from '#/components/cron-tab';
import { DictTag } from '#/components/dict-tag';
import { DICT_TYPE, getDictOptions } from '#/utils';
@ -37,10 +38,12 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Input',
componentProps: {
placeholder: '请输入处理器的名字',
// readonly: ({ values }) => !!values.id,
},
dependencies: {
triggerFields: ['id'],
disabled: (values) => !!values.id,
},
rules: 'required',
// TODO @芋艿:在修改场景下,禁止调整
},
{
fieldName: 'handlerParam',
@ -53,12 +56,8 @@ export function useFormSchema(): VbenFormSchema[] {
{
fieldName: 'cronExpression',
label: 'CRON 表达式',
component: 'Input',
componentProps: {
placeholder: '请输入 CRON 表达式',
},
component: markRaw(CronTab),
rules: 'required',
// TODO @芋艿:未来支持动态的 CRON 表达式选择
},
{
fieldName: 'retryCount',

View File

@ -317,10 +317,12 @@ export function useDataGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'colorType',
title: '颜色类型',
slots: { default: 'colorType' },
},
{
field: 'cssClass',
title: 'CSS Class',
slots: { default: 'cssClass' },
},
{
title: '创建时间',

View File

@ -7,7 +7,7 @@ import { ref, watch } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
import { message } from 'ant-design-vue';
import { message, Tag } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
@ -177,6 +177,12 @@ watch(
]"
/>
</template>
<template #colorType="{ row }">
<Tag :color="row.colorType">{{ row.colorType }}</Tag>
</template>
<template #cssClass="{ row }">
<Tag :color="row.cssClass">{{ row.cssClass }}</Tag>
</template>
<template #actions="{ row }">
<TableAction
:actions="[