Files
flow-center-front/src/views/flow/MyInstances.vue
T
chenxing 43753f4f59
build / build (push) Successful in 2m9s
refactor(theme): A 类主题通道接入+本地样式回收、操作列统一 actionColumn、顶栏三态头像
- P1 通道:view-ui-plus 锁 1.3.24(A 类 loader + vite /static dev 代理核验,五档/断源降级走查)
- P2 回收:删本地 layout.css/icons.css(+bak) 并清 main.ts import;骨架六类对齐 + 品牌色 var(--brand) 化;index CSS 779→393kB
- P3 操作列:新增 utils/tableActions.ts(同构 UserBase,7 函数+2 表,无 AUTO_MODE);7 页迁 actionColumn text 形态;旧 operatingHandle/operatingTextHandle 薄封装保留、签名不变
- P4 外观:接入三态头像 avatar.ts+UserAvatar.vue(同步自 YschTheme),顶栏裸 img 替换;外观三键红线零写
- 失效注释订正(layout.vue/def-editor)
2026-10-10 21:24:39 +08:00

87 lines
3.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
// 我的办件(提交人视角):列表 + 撤回/催办/详情
import { ref } from "vue";
import { useRouter } from "vue-router";
import { Message } from "view-ui-plus";
import MyConfirm from "@/components/MyConfirm";
import TablePageAlovaNew from "@/components/TablePageAlovaNew.vue";
import { OperatorEnum } from "@/types";
import { flowApi, INSTANCE_STATUS, INSTANCE_STATUS_COLOR } from "@/api/module/flow";
import { actionColumn } from "@/utils/tableActions";
import Utils from "@/utils";
const router = useRouter();
const tableRef = ref<InstanceType<typeof TablePageAlovaNew> | null>(null);
const tableHeight = ref(Utils.useTableHeight({ isSearch: true, isPage: true }));
const dataParams = ref<{ status?: number }>({ status: undefined });
const columns = [
{ title: "序号", type: "index", width: 70, align: "center" },
{ title: "办件标题", key: "bizTitle", minWidth: 220 },
{ title: "业务类型", key: "bizType", width: 110 },
{ title: "状态", width: 100, align: "center", render: (h: any, p: any) =>
h("Tag", { color: INSTANCE_STATUS_COLOR[p.row.status] || "gray" }, () => INSTANCE_STATUS[p.row.status] || p.row.status) },
{ title: "当前节点", key: "currentNodes", width: 150 },
{ title: "提交时间", width: 170, render: (h: any, p: any) => h("span", (p.row.submitTime || "").replace("T", " ")) },
{ title: "办结时间", width: 170, render: (h: any, p: any) => h("span", (p.row.finishTime || "").replace("T", " ") || "-") },
actionColumn(
[
{ key: "detail", label: "详情", icon: "icon-browse", on: (r: any) => router.push(`/instance/${r.instanceId}?pid=101`) },
{ key: "withdraw", label: "撤回", icon: "icon-yaohao", on: (r: any) => onWithdraw(r), when: (r: any) => r.status === 10, danger: true },
{ key: "urge", label: "催办", icon: "icon-fasong", on: (r: any) => onUrge(r), when: (r: any) => r.status === 10 },
],
{ mode: "text", width: 180, fixed: "right" },
),
];
// dataApi 返回 Method(alova usePagination 负责发送与解包),不能调 .send()
const tableApi = (p: { pageIndex: number; pageSize: number }) =>
flowApi.my({ status: dataParams.value.status || undefined, page: p.pageIndex, size: p.pageSize });
function onSearch() {
tableRef.value?.refreshData();
}
async function onWithdraw(row: any) {
await MyConfirm({
title: "撤回",
msg: `确定撤回办件「${row.bizTitle}」吗?`,
info: "撤回后流程终止,不可恢复",
async onOk() {
try {
await flowApi.withdraw(row.instanceId).send();
Message.success("已撤回");
tableRef.value?.reloadData(OperatorEnum.edit);
} catch (e: any) {
Message.error(e?.message || "撤回失败(可能已有任务被办理)");
}
},
});
}
async function onUrge(row: any) {
try {
await flowApi.urge(row.instanceId).send();
Message.success("已催办");
} catch (e: any) {
Message.error(e?.message || "催办失败");
}
}
</script>
<template>
<div class="page-wrapper">
<div class="main-container">
<div class="search-wrap fix">
<Select v-model="dataParams.status" class="search-wrap_sel" clearable placeholder="状态" @on-change="onSearch">
<Option :value="10" label="审批中" />
<Option :value="20" label="已完成" />
<Option :value="30" label="已拒绝" />
<Option :value="40" label="已撤回" />
</Select>
</div>
<TablePageAlovaNew ref="tableRef" :dataApi="tableApi" :columns="columns" :tableHeight="tableHeight" />
</div>
</div>
</template>