fix: 修复管理端前端类型校验问题
- 修正知识库与 Bot 设置页相关组件的类型定义和空值处理 - 补齐工作流与公开聊天页的前端类型约束和动态导入类型 - 收敛本次改动文件的局部格式与样式规范,确保 pnpm check:type 通过
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import {computed} from 'vue';
|
||||
import type { TagProps } from 'element-plus';
|
||||
|
||||
import {useAccess} from '@easyflow/access';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import {MoreFilled} from '@element-plus/icons-vue';
|
||||
import { useAccess } from '@easyflow/access';
|
||||
|
||||
import { MoreFilled } from '@element-plus/icons-vue';
|
||||
import {
|
||||
ElAvatar,
|
||||
ElButton,
|
||||
@@ -48,7 +50,7 @@ export interface CardListProps {
|
||||
actions?: ActionButton[];
|
||||
cornerTagField?: string;
|
||||
cornerTagMap?: Record<string, string>;
|
||||
cornerTagTypeMap?: Record<string, string>;
|
||||
cornerTagTypeMap?: Record<string, TagProps['type']>;
|
||||
defaultIcon: any;
|
||||
data: any[];
|
||||
primaryAction?: CardPrimaryAction;
|
||||
@@ -97,7 +99,9 @@ const resolvedActions = computed<ResolvedActionButton[]>(() => {
|
||||
});
|
||||
|
||||
const inlineActions = computed(() => {
|
||||
return resolvedActions.value.filter((action) => action.placement === 'inline');
|
||||
return resolvedActions.value.filter(
|
||||
(action) => action.placement === 'inline',
|
||||
);
|
||||
});
|
||||
|
||||
const menuActions = computed(() => {
|
||||
@@ -128,7 +132,10 @@ function handleActionClick(event: Event, action: ActionButton, item: any) {
|
||||
v-for="(item, index) in props.data"
|
||||
:key="item.id ?? index"
|
||||
shadow="never"
|
||||
:class="['card-item', { 'card-item--interactive': resolvedPrimaryAction }]"
|
||||
:class="[
|
||||
'card-item',
|
||||
{ 'card-item--interactive': resolvedPrimaryAction },
|
||||
]"
|
||||
:role="resolvedPrimaryAction ? 'button' : undefined"
|
||||
:tabindex="resolvedPrimaryAction ? 0 : undefined"
|
||||
@click="handlePrimaryAction(item)"
|
||||
@@ -171,9 +178,7 @@ function handleActionClick(event: Event, action: ActionButton, item: any) {
|
||||
:type="cornerTagTypeMap[item[cornerTagField]] || 'info'"
|
||||
round
|
||||
>
|
||||
{{
|
||||
cornerTagMap[item[cornerTagField]] || item[cornerTagField]
|
||||
}}
|
||||
{{ cornerTagMap[item[cornerTagField]] || item[cornerTagField] }}
|
||||
</ElTag>
|
||||
</slot>
|
||||
</div>
|
||||
@@ -232,7 +237,9 @@ function handleActionClick(event: Event, action: ActionButton, item: any) {
|
||||
<ElDropdownItem
|
||||
v-for="action in menuActions"
|
||||
:key="action.text"
|
||||
:class="{ 'card-menu-item--danger': action.tone === 'danger' }"
|
||||
:class="{
|
||||
'card-menu-item--danger': action.tone === 'danger',
|
||||
}"
|
||||
@click="action.onClick(item)"
|
||||
>
|
||||
<div class="menu-action-content">
|
||||
|
||||
@@ -77,10 +77,10 @@ const props = defineProps({
|
||||
const emit = defineEmits(['update:modelValue', 'change', 'check']);
|
||||
|
||||
// 响应式数据
|
||||
const treeData = ref([]);
|
||||
const treeData = ref<any[]>([]);
|
||||
const loading = ref(false);
|
||||
const treeRef = ref<TreeV2Instance>();
|
||||
const nodeMap = ref(new Map()); // 用于存储节点键到节点数据的映射
|
||||
const nodeMap = ref<Map<any, any>>(new Map()); // 用于存储节点键到节点数据的映射
|
||||
|
||||
watch(
|
||||
[() => props.modelValue, () => treeData.value],
|
||||
@@ -253,12 +253,12 @@ onMounted(() => {
|
||||
.tree-select {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
background:
|
||||
linear-gradient(
|
||||
180deg,
|
||||
color-mix(in srgb, var(--el-color-primary-light-9) 32%, var(--el-bg-color)) 0%,
|
||||
var(--el-bg-color) 72%
|
||||
);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
color-mix(in srgb, var(--el-color-primary-light-9) 32%, var(--el-bg-color))
|
||||
0%,
|
||||
var(--el-bg-color) 72%
|
||||
);
|
||||
border: 1px solid var(--el-border-color-lighter);
|
||||
border-radius: 14px;
|
||||
box-shadow: var(--el-box-shadow-lighter);
|
||||
@@ -269,12 +269,11 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.tree-select--disabled {
|
||||
background:
|
||||
linear-gradient(
|
||||
180deg,
|
||||
var(--el-fill-color-extra-light) 0%,
|
||||
var(--el-fill-color-blank) 72%
|
||||
);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
var(--el-fill-color-extra-light) 0%,
|
||||
var(--el-fill-color-blank) 72%
|
||||
);
|
||||
}
|
||||
|
||||
.tree-node {
|
||||
|
||||
Reference in New Issue
Block a user