style: lint auto-fix formatting

This commit is contained in:
向宁 2026-05-25 20:36:16 +08:00
parent 7d941bafe6
commit bb97af32e7
15 changed files with 110 additions and 88 deletions

View File

@ -27,9 +27,9 @@ import {
Spin, Spin,
} from 'ant-design-vue'; } from 'ant-design-vue';
import { createGroupApi } from '#/api';
import { uploadFileApi } from '#/api/core/file-management'; import { uploadFileApi } from '#/api/core/file-management';
import { fileRequestClient } from '#/api/request'; import { fileRequestClient } from '#/api/request';
import { createGroupApi } from '#/api';
import { useImStore } from '#/store'; import { useImStore } from '#/store';
const InputSearch = Input.Search; const InputSearch = Input.Search;
@ -741,7 +741,7 @@ onUnmounted(() => {
placeholder="输入消息... (Shift+Enter 换行)" placeholder="输入消息... (Shift+Enter 换行)"
:rows="1" :rows="1"
@keydown.enter="handleSend" @keydown.enter="handleSend"
/> ></textarea>
<Button <Button
type="primary" type="primary"
:loading="sending || uploading" :loading="sending || uploading"

View File

@ -1,12 +1,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { SchemaField } from '../composables/useFormSchema';
import { computed } from 'vue'; import { computed } from 'vue';
import { Descriptions, DescriptionsItem, Tag } from 'ant-design-vue'; import { Descriptions, DescriptionsItem, Tag } from 'ant-design-vue';
import type { SchemaField } from '../composables/useFormSchema';
const props = defineProps<{ const props = defineProps<{
dataJson: string | null; dataJson: null | string;
fields: SchemaField[]; fields: SchemaField[];
}>(); }>();

View File

@ -1,10 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { SchemaField } from '../composables/useFormSchema';
import { reactive } from 'vue'; import { reactive } from 'vue';
import { DatePicker, Form, Input, InputNumber, Select } from 'ant-design-vue'; import { DatePicker, Form, Input, InputNumber, Select } from 'ant-design-vue';
import type { SchemaField } from '../composables/useFormSchema';
const props = defineProps<{ const props = defineProps<{
fields: SchemaField[]; fields: SchemaField[];
}>(); }>();

View File

@ -1,4 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { SchemaField } from '../composables/useFormSchema';
import type { FormDefinitionDto } from '#/api/core/form-management';
import type { WorkflowDefinitionDto } from '#/api/core/workflow';
import { h, onMounted, ref } from 'vue'; import { h, onMounted, ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
@ -19,7 +24,6 @@ import {
} from 'ant-design-vue'; } from 'ant-design-vue';
import { getFormDefinitionsApi } from '#/api/core/form-management'; import { getFormDefinitionsApi } from '#/api/core/form-management';
import type { FormDefinitionDto } from '#/api/core/form-management';
import { import {
createWorkflowDefinitionApi, createWorkflowDefinitionApi,
DefinitionStatus, DefinitionStatus,
@ -30,11 +34,9 @@ import {
startWorkflowInstanceApi, startWorkflowInstanceApi,
updateWorkflowDefinitionApi, updateWorkflowDefinitionApi,
} from '#/api/core/workflow'; } from '#/api/core/workflow';
import type { WorkflowDefinitionDto } from '#/api/core/workflow';
import SchemaFormRenderer from '../components/SchemaFormRenderer.vue'; import SchemaFormRenderer from '../components/SchemaFormRenderer.vue';
import { parseFormSchema } from '../composables/useFormSchema'; import { parseFormSchema } from '../composables/useFormSchema';
import type { SchemaField } from '../composables/useFormSchema';
const router = useRouter(); const router = useRouter();
@ -460,7 +462,7 @@ onMounted(() => {
<Form.Item label="流程变量JSON"> <Form.Item label="流程变量JSON">
<Input.TextArea <Input.TextArea
v-model:value="startFormState.variables" v-model:value="startFormState.variables"
placeholder='可选,例如:{"reason": "出差申请", "amount": 5000}' placeholder="可选,例如:{&quot;reason&quot;: &quot;出差申请&quot;, &quot;amount&quot;: 5000}"
:rows="4" :rows="4"
/> />
</Form.Item> </Form.Item>

View File

@ -12,13 +12,28 @@ import {
Selection, Selection,
Snapline, Snapline,
} from '@antv/x6'; } from '@antv/x6';
import { register, getTeleport } from '@antv/x6-vue-shape'; import { getTeleport, register } from '@antv/x6-vue-shape';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { EdgeType, NodeType, createEdgeApi, updateNodeApi } from '#/api/core'; import { createEdgeApi, EdgeType, NodeType, updateNodeApi } from '#/api/core';
import WorkflowNodeVue from './WorkflowNode.vue'; import WorkflowNodeVue from './WorkflowNode.vue';
const props = defineProps<{
definitionId: string;
edges: WorkflowEdgeDto[];
nodes: WorkflowNodeDto[];
}>();
const emit = defineEmits<{
canvasClick: [];
edgeClick: [edgeId: string];
edgeConnected: [edge: WorkflowEdgeDto];
nodeClick: [nodeId: string];
nodeCreated: [];
nodeMoved: [nodeId: string, x: number, y: number];
}>();
const TeleportContainer = getTeleport(); const TeleportContainer = getTeleport();
register({ register({
@ -56,21 +71,6 @@ register({
}, },
}); });
const props = defineProps<{
definitionId: string;
edges: WorkflowEdgeDto[];
nodes: WorkflowNodeDto[];
}>();
const emit = defineEmits<{
canvasClick: [];
edgeClick: [edgeId: string];
edgeConnected: [edge: WorkflowEdgeDto];
nodeClick: [nodeId: string];
nodeCreated: [];
nodeMoved: [nodeId: string, x: number, y: number];
}>();
const containerRef = ref<HTMLDivElement>(); const containerRef = ref<HTMLDivElement>();
const minimapRef = ref<HTMLDivElement>(); const minimapRef = ref<HTMLDivElement>();
let graph: Graph | null = null; let graph: Graph | null = null;
@ -345,7 +345,7 @@ function bindEvents() {
graph.bindKey(['delete', 'backspace'], () => { graph.bindKey(['delete', 'backspace'], () => {
const cells = graph?.getSelectedCells(); const cells = graph?.getSelectedCells();
if (cells.length) { if (cells.length > 0) {
cells.forEach((cell) => cell.remove()); cells.forEach((cell) => cell.remove());
} }
return false; return false;

View File

@ -1,4 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { UserListItem, WorkflowNodeDto } from '#/api/core';
import { computed, onMounted, ref, watch } from 'vue'; import { computed, onMounted, ref, watch } from 'vue';
import { import {
@ -10,11 +12,14 @@ import {
Popconfirm, Popconfirm,
Radio, Radio,
Select, Select,
Tag,
} from 'ant-design-vue'; } from 'ant-design-vue';
import { deleteNodeApi, getUsersApi, NodeType, updateNodeApi } from '#/api/core'; import {
import type { UserListItem, WorkflowNodeDto } from '#/api/core'; deleteNodeApi,
getUsersApi,
NodeType,
updateNodeApi,
} from '#/api/core';
const props = defineProps<{ const props = defineProps<{
definitionId: string; definitionId: string;
@ -32,7 +37,7 @@ const name = ref('');
const assigneeRule = ref<'role' | 'user'>('role'); const assigneeRule = ref<'role' | 'user'>('role');
const assigneeRole = ref(''); const assigneeRole = ref('');
const assigneeUserId = ref(''); const assigneeUserId = ref('');
const approvalType = ref<'any' | 'all'>('any'); const approvalType = ref<'all' | 'any'>('any');
const recipients = ref<string[]>([]); const recipients = ref<string[]>([]);
const subDefinitionId = ref(''); const subDefinitionId = ref('');
const onEnter = ref(''); const onEnter = ref('');
@ -65,7 +70,7 @@ const nodeTypeLabels: Record<number, string> = {
[NodeType.SubProcess]: '子流程节点', [NodeType.SubProcess]: '子流程节点',
}; };
function parseConfig(config: string | null) { function parseConfig(config: null | string) {
if (!config) { if (!config) {
assigneeRule.value = 'role'; assigneeRule.value = 'role';
assigneeRole.value = ''; assigneeRole.value = '';

View File

@ -50,7 +50,7 @@ const typeLabel = computed(() => node?.getData()?.typeLabel ?? '');
</div> </div>
<div <div
:style="{ :style="{
color: color, color,
fontSize: '11px', fontSize: '11px',
marginTop: '2px', marginTop: '2px',
}" }"

View File

@ -1,6 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from 'vue'; import type { FormDefinitionDetailDto } from '#/api/core';
import { onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { Button, message } from 'ant-design-vue'; import { Button, message } from 'ant-design-vue';
@ -10,7 +11,6 @@ import {
getFormDefinitionByIdApi, getFormDefinitionByIdApi,
updateFormDefinitionApi, updateFormDefinitionApi,
} from '#/api/core'; } from '#/api/core';
import type { FormDefinitionDetailDto } from '#/api/core';
import ComponentPanel from './components/ComponentPanel.vue'; import ComponentPanel from './components/ComponentPanel.vue';
import PropertyPanel from './components/PropertyPanel.vue'; import PropertyPanel from './components/PropertyPanel.vue';
@ -25,8 +25,8 @@ const definition = ref<FormDefinitionDetailDto | null>(null);
const containerRef = ref<HTMLElement | null>(null); const containerRef = ref<HTMLElement | null>(null);
const saving = ref(false); const saving = ref(false);
const selectedNodeData = ref<Record<string, any> | null>(null); const selectedNodeData = ref<null | Record<string, any>>(null);
const selectedNodeId = ref<string | null>(null); const selectedNodeId = ref<null | string>(null);
const { graph, initGraph, TeleportContainer } = useGraph(containerRef); const { graph, initGraph, TeleportContainer } = useGraph(containerRef);
const { const {
@ -151,7 +151,7 @@ onMounted(async () => {
<!-- Center: Canvas --> <!-- Center: Canvas -->
<div class="relative flex-1"> <div class="relative flex-1">
<div ref="containerRef" class="h-full w-full" /> <div ref="containerRef" class="h-full w-full"></div>
<TeleportContainer /> <TeleportContainer />
<div <div
class="absolute bottom-0 left-0 right-0 flex items-center gap-4 border-t bg-white px-4 py-1 text-xs text-gray-500" class="absolute bottom-0 left-0 right-0 flex items-center gap-4 border-t bg-white px-4 py-1 text-xs text-gray-500"

View File

@ -1,10 +1,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { FormDefinitionDetailDto } from '#/api/core';
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { Page } from '@vben/common-ui'; import { Page } from '@vben/common-ui';
import { useRoute, useRouter } from 'vue-router';
import { import {
Button, Button,
Descriptions, Descriptions,
@ -15,11 +16,10 @@ import {
} from 'ant-design-vue'; } from 'ant-design-vue';
import { import {
FormStatus,
getFormDefinitionByIdApi, getFormDefinitionByIdApi,
updateFormDefinitionApi, updateFormDefinitionApi,
FormStatus,
} from '#/api/core'; } from '#/api/core';
import type { FormDefinitionDetailDto } from '#/api/core';
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();

View File

@ -1,4 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { FormDefinitionDto } from '#/api/core';
import { h, onMounted, ref } from 'vue'; import { h, onMounted, ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
@ -24,7 +26,6 @@ import {
getFormDefinitionsApi, getFormDefinitionsApi,
publishFormDefinitionApi, publishFormDefinitionApi,
} from '#/api/core'; } from '#/api/core';
import type { FormDefinitionDto } from '#/api/core';
const router = useRouter(); const router = useRouter();

View File

@ -1,9 +1,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { SchemaField } from '../../composables/useFormSchema';
import type { WorkflowInstanceDetailDto } from '#/api/core/workflow';
import { computed, h, onMounted, ref } from 'vue'; import { computed, h, onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { Page } from '@vben/common-ui'; import { Page } from '@vben/common-ui';
import { useUserStore } from '@vben/stores'; import { useUserStore } from '@vben/stores';
import { import {
@ -28,11 +31,9 @@ import {
TokenStatus, TokenStatus,
withdrawWorkflowInstanceApi, withdrawWorkflowInstanceApi,
} from '#/api/core/workflow'; } from '#/api/core/workflow';
import type { WorkflowInstanceDetailDto } from '#/api/core/workflow';
import FormDataDisplay from '../../components/FormDataDisplay.vue'; import FormDataDisplay from '../../components/FormDataDisplay.vue';
import { parseFormSchema } from '../../composables/useFormSchema'; import { parseFormSchema } from '../../composables/useFormSchema';
import type { SchemaField } from '../../composables/useFormSchema';
import { useUserNames } from '../../composables/useUserNames'; import { useUserNames } from '../../composables/useUserNames';
const route = useRoute(); const route = useRoute();
@ -43,10 +44,10 @@ const instanceId = computed(() => route.params.id as string);
const { getUserName, resolveUserNames } = useUserNames(); const { getUserName, resolveUserNames } = useUserNames();
const loading = ref(false); const loading = ref(false);
const detail = ref<WorkflowInstanceDetailDto | null>(null); const detail = ref<null | WorkflowInstanceDetailDto>(null);
// Form data display // Form data display
const formDataJson = ref<string | null>(null); const formDataJson = ref<null | string>(null);
const schemaFields = ref<SchemaField[]>([]); const schemaFields = ref<SchemaField[]>([]);
const formLoading = ref(false); const formLoading = ref(false);
@ -99,7 +100,7 @@ const tokenColumns = [
dataIndex: 'completedAt', dataIndex: 'completedAt',
key: 'completedAt', key: 'completedAt',
width: 180, width: 180,
customRender: ({ text }: { text: string | null }) => customRender: ({ text }: { text: null | string }) =>
text ? new Date(text).toLocaleString() : '-', text ? new Date(text).toLocaleString() : '-',
}, },
]; ];
@ -112,7 +113,7 @@ const taskColumns = [
key: 'assigneeId', key: 'assigneeId',
ellipsis: true, ellipsis: true,
width: 200, width: 200,
customRender: ({ text }: { text: string | null }) => customRender: ({ text }: { text: null | string }) =>
text ? getUserName(text) : '-', text ? getUserName(text) : '-',
}, },
{ {
@ -130,7 +131,7 @@ const taskColumns = [
dataIndex: 'completedAt', dataIndex: 'completedAt',
key: 'completedAt', key: 'completedAt',
width: 180, width: 180,
customRender: ({ text }: { text: string | null }) => customRender: ({ text }: { text: null | string }) =>
text ? new Date(text).toLocaleString() : '-', text ? new Date(text).toLocaleString() : '-',
}, },
]; ];
@ -257,20 +258,28 @@ onMounted(() => {
{{ instanceStatusMap[detail.status]?.text ?? '未知' }} {{ instanceStatusMap[detail.status]?.text ?? '未知' }}
</Tag> </Tag>
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="发起人">{{ <DescriptionsItem label="发起人">
{{
getUserName(detail.initiatorId) getUserName(detail.initiatorId)
}}</DescriptionsItem> }}
<DescriptionsItem label="启动时间">{{ </DescriptionsItem>
<DescriptionsItem label="启动时间">
{{
new Date(detail.startedAt).toLocaleString() new Date(detail.startedAt).toLocaleString()
}}</DescriptionsItem> }}
<DescriptionsItem label="定义 ID">{{ </DescriptionsItem>
<DescriptionsItem label="定义 ID">
{{
detail.definitionId detail.definitionId
}}</DescriptionsItem> }}
<DescriptionsItem label="完成时间">{{ </DescriptionsItem>
<DescriptionsItem label="完成时间">
{{
detail.completedAt detail.completedAt
? new Date(detail.completedAt).toLocaleString() ? new Date(detail.completedAt).toLocaleString()
: '-' : '-'
}}</DescriptionsItem> }}
</DescriptionsItem>
</Descriptions> </Descriptions>
<Spin v-if="formLoading" class="mb-6" /> <Spin v-if="formLoading" class="mb-6" />

View File

@ -1,9 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { WorkflowInstanceDto } from '#/api/core';
import { computed, h, onMounted, ref } from 'vue'; import { computed, h, onMounted, ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { Page } from '@vben/common-ui'; import { Page } from '@vben/common-ui';
import { useUserStore } from '@vben/stores'; import { useUserStore } from '@vben/stores';
import { import {
@ -23,7 +24,6 @@ import {
suspendWorkflowInstanceApi, suspendWorkflowInstanceApi,
withdrawWorkflowInstanceApi, withdrawWorkflowInstanceApi,
} from '#/api/core'; } from '#/api/core';
import type { WorkflowInstanceDto } from '#/api/core';
import { useUserNames } from '../composables/useUserNames'; import { useUserNames } from '../composables/useUserNames';
@ -37,7 +37,7 @@ const data = ref<WorkflowInstanceDto[]>([]);
const total = ref(0); const total = ref(0);
const pageIndex = ref(1); const pageIndex = ref(1);
const pageSize = ref(20); const pageSize = ref(20);
const statusFilter = ref<number | null>(null); const statusFilter = ref<null | number>(null);
const instanceStatusMap: Record<number, { color: string; text: string }> = { const instanceStatusMap: Record<number, { color: string; text: string }> = {
[InstanceStatus.Pending]: { color: 'blue', text: '待启动' }, [InstanceStatus.Pending]: { color: 'blue', text: '待启动' },
@ -89,7 +89,7 @@ const columns = [
dataIndex: 'completedAt', dataIndex: 'completedAt',
key: 'completedAt', key: 'completedAt',
width: 180, width: 180,
customRender: ({ text }: { text: string | null }) => customRender: ({ text }: { text: null | string }) =>
text ? new Date(text).toLocaleString() : '-', text ? new Date(text).toLocaleString() : '-',
}, },
{ title: '操作', key: 'actions', width: 240 }, { title: '操作', key: 'actions', width: 240 },
@ -171,9 +171,9 @@ onMounted(() => loadData());
@change="onFilterChange" @change="onFilterChange"
/> />
</Space> </Space>
<Button type="primary" @click="router.push('/workflow/start')" <Button type="primary" @click="router.push('/workflow/start')">
>发起流程</Button 发起流程
> </Button>
</div> </div>
<Table <Table
@ -196,8 +196,9 @@ onMounted(() => loadData());
<Button <Button
size="small" size="small"
@click="router.push(`/workflow/instances/detail/${record.id}`)" @click="router.push(`/workflow/instances/detail/${record.id}`)"
>详情</Button
> >
详情
</Button>
<Popconfirm <Popconfirm
v-if="record.status === InstanceStatus.Running" v-if="record.status === InstanceStatus.Running"
title="确定挂起此流程?" title="确定挂起此流程?"

View File

@ -1,4 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { WorkflowMonitorDto, WorkflowTaskListItemDto } from '#/api/core';
import { computed, h, onMounted, ref } from 'vue'; import { computed, h, onMounted, ref } from 'vue';
import { Page } from '@vben/common-ui'; import { Page } from '@vben/common-ui';
@ -6,7 +8,6 @@ import { Page } from '@vben/common-ui';
import { Button, Card, message, Space, Statistic, Table } from 'ant-design-vue'; import { Button, Card, message, Space, Statistic, Table } from 'ant-design-vue';
import { getOverdueTasksApi, getWorkflowMonitorApi } from '#/api/core'; import { getOverdueTasksApi, getWorkflowMonitorApi } from '#/api/core';
import type { WorkflowMonitorDto, WorkflowTaskListItemDto } from '#/api/core';
const monitorLoading = ref(false); const monitorLoading = ref(false);
const overdueLoading = ref(false); const overdueLoading = ref(false);
@ -101,8 +102,9 @@ onMounted(() => {
loadMonitor(); loadMonitor();
loadOverdue(); loadOverdue();
" "
>刷新</Button
> >
刷新
</Button>
</Space> </Space>
</div> </div>

View File

@ -1,4 +1,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { SchemaField } from '../composables/useFormSchema';
import type { WorkflowDefinitionDto } from '#/api/core/workflow';
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import { Page } from '@vben/common-ui'; import { Page } from '@vben/common-ui';
@ -16,22 +20,20 @@ import {
import { getFormDefinitionByIdApi } from '#/api/core/form-management'; import { getFormDefinitionByIdApi } from '#/api/core/form-management';
import { import {
DefinitionStatus,
getWorkflowDefinitionsApi, getWorkflowDefinitionsApi,
startWorkflowInstanceApi, startWorkflowInstanceApi,
DefinitionStatus,
} from '#/api/core/workflow'; } from '#/api/core/workflow';
import type { WorkflowDefinitionDto } from '#/api/core/workflow';
import SchemaFormRenderer from '../components/SchemaFormRenderer.vue'; import SchemaFormRenderer from '../components/SchemaFormRenderer.vue';
import { parseFormSchema } from '../composables/useFormSchema'; import { parseFormSchema } from '../composables/useFormSchema';
import type { SchemaField } from '../composables/useFormSchema';
const loading = ref(false); const loading = ref(false);
const definitions = ref<WorkflowDefinitionDto[]>([]); const definitions = ref<WorkflowDefinitionDto[]>([]);
const startVisible = ref(false); const startVisible = ref(false);
const startFormState = ref({ title: '', variables: '' }); const startFormState = ref({ title: '', variables: '' });
const currentDef = ref<WorkflowDefinitionDto | null>(null); const currentDef = ref<null | WorkflowDefinitionDto>(null);
const schemaFields = ref<SchemaField[]>([]); const schemaFields = ref<SchemaField[]>([]);
const schemaLoading = ref(false); const schemaLoading = ref(false);
@ -141,10 +143,10 @@ onMounted(() => loadDefinitions());
</p> </p>
<div class="mt-2 flex items-center justify-between"> <div class="mt-2 flex items-center justify-between">
<Tag v-if="def.formName" color="blue">{{ def.formName }}</Tag> <Tag v-if="def.formName" color="blue">{{ def.formName }}</Tag>
<span v-else /> <span v-else></span>
<Button type="primary" size="small" @click="openStartForm(def)" <Button type="primary" size="small" @click="openStartForm(def)">
>发起</Button 发起
> </Button>
</div> </div>
</Card> </Card>
</div> </div>
@ -178,7 +180,7 @@ onMounted(() => loadDefinitions());
<Form.Item label="流程变量JSON"> <Form.Item label="流程变量JSON">
<Input.TextArea <Input.TextArea
v-model:value="startFormState.variables" v-model:value="startFormState.variables"
placeholder='可选,例如:{"reason": "出差申请", "amount": 5000}' placeholder="可选,例如:{&quot;reason&quot;: &quot;出差申请&quot;, &quot;amount&quot;: 5000}"
:rows="4" :rows="4"
/> />
</Form.Item> </Form.Item>

View File

@ -1,8 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { WorkflowTaskListItemDto } from '#/api/core';
import { computed, h, onMounted, ref } from 'vue'; import { computed, h, onMounted, ref } from 'vue';
import { Page } from '@vben/common-ui'; import { Page } from '@vben/common-ui';
import { useUserStore } from '@vben/stores'; import { useUserStore } from '@vben/stores';
import { import {
@ -28,7 +29,6 @@ import {
transferTaskApi, transferTaskApi,
urgeTaskApi, urgeTaskApi,
} from '#/api/core'; } from '#/api/core';
import type { WorkflowTaskListItemDto } from '#/api/core';
const userStore = useUserStore(); const userStore = useUserStore();
const userId = computed(() => userStore.userInfo?.userId ?? ''); const userId = computed(() => userStore.userInfo?.userId ?? '');
@ -125,7 +125,7 @@ const historyColumns = [
dataIndex: 'completedAt', dataIndex: 'completedAt',
key: 'completedAt', key: 'completedAt',
width: 180, width: 180,
customRender: ({ text }: { text: string | null }) => customRender: ({ text }: { text: null | string }) =>
text ? new Date(text).toLocaleString() : '-', text ? new Date(text).toLocaleString() : '-',
}, },
]; ];
@ -175,7 +175,7 @@ const ccColumns = [
dataIndex: 'completedAt', dataIndex: 'completedAt',
key: 'completedAt', key: 'completedAt',
width: 180, width: 180,
customRender: ({ text }: { text: string | null }) => customRender: ({ text }: { text: null | string }) =>
text ? new Date(text).toLocaleString() : '-', text ? new Date(text).toLocaleString() : '-',
}, },
]; ];
@ -205,7 +205,7 @@ function handleCcTableChange(pagination: any) {
// Tab switch // Tab switch
function handleTabChange(key: string | number) { function handleTabChange(key: number | string) {
activeTab.value = String(key); activeTab.value = String(key);
if (key === 'pending' && pendingData.value.length === 0) loadPending(); if (key === 'pending' && pendingData.value.length === 0) loadPending();
if (key === 'history' && historyData.value.length === 0) loadHistory(); if (key === 'history' && historyData.value.length === 0) loadHistory();
@ -320,7 +320,7 @@ onMounted(() => loadPending());
<template> <template>
<Page auto-content-height> <Page auto-content-height>
<Tabs v-model:activeKey="activeTab" @change="handleTabChange"> <Tabs v-model:active-key="activeTab" @change="handleTabChange">
<Tabs.TabPane key="pending" tab="我的待办"> <Tabs.TabPane key="pending" tab="我的待办">
<Table <Table
:columns="pendingColumns" :columns="pendingColumns"