mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-27 14:52:56 +00:00
refactor: 将组件前缀从Art统一替换为Fa
- 更新所有FA前缀的组件文件 - 新增Fa前缀的对应组件 - 更新所有引用路径和组件名 - 修改相关样式和变量名 - 调整部分组件目录结构
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<!-- 调度任务:Art + useTable(主列表卡片;抽屉内表格) -->
|
||||
<template>
|
||||
<div class="art-full-height job-page flex flex-col min-h-0">
|
||||
<ArtSearchBar
|
||||
<FaSearchBar
|
||||
v-show="showSearchBar"
|
||||
ref="searchBarRef"
|
||||
v-model="searchForm"
|
||||
@@ -21,7 +21,7 @@
|
||||
class="flex flex-1 min-h-0 flex-col art-table-card"
|
||||
:style="{ 'margin-top': showSearchBar ? '12px' : '0' }"
|
||||
>
|
||||
<ArtTableHeader
|
||||
<FaTableHeader
|
||||
v-model:columns="jobColumnChecks"
|
||||
v-model:showSearchBar="showSearchBar"
|
||||
layout="search,refresh"
|
||||
@@ -120,7 +120,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</ArtTableHeader>
|
||||
</FaTableHeader>
|
||||
|
||||
<div v-loading="jobLoading" class="job-cards-container min-h-0 flex-1 overflow-auto">
|
||||
<ElEmpty
|
||||
@@ -254,7 +254,7 @@
|
||||
</div>
|
||||
</ElCard>
|
||||
|
||||
<ArtDialog v-model="consoleVisible" title="调度器控制台" width="900px">
|
||||
<FaDialog v-model="consoleVisible" title="调度器控制台" width="900px">
|
||||
<div class="terminal-wrapper">
|
||||
<Terminal name="scheduler-console" :show-header="false" theme="dark" />
|
||||
</div>
|
||||
@@ -263,11 +263,11 @@
|
||||
<ElButton @click="handleClearConsole">清空</ElButton>
|
||||
<ElButton type="primary" @click="consoleVisible = false">关闭</ElButton>
|
||||
</template>
|
||||
</ArtDialog>
|
||||
</FaDialog>
|
||||
|
||||
<ArtDrawer v-model="executionLogDrawerVisible" title="执行记录" direction="rtl" size="80%">
|
||||
<FaDrawer v-model="executionLogDrawerVisible" title="执行记录" direction="rtl" size="80%">
|
||||
<div class="execution-log-drawer flex flex-col min-h-0">
|
||||
<ArtSearchBar
|
||||
<FaSearchBar
|
||||
ref="logSearchBarRef"
|
||||
v-model="logSearchForm"
|
||||
:items="logSearchItems"
|
||||
@@ -282,23 +282,23 @@
|
||||
@reset="onLogResetSearch"
|
||||
/>
|
||||
<ElCard class="art-table-card log-table-card mt-3 flex flex-1 min-h-0 flex-col">
|
||||
<ArtTableHeader
|
||||
<FaTableHeader
|
||||
v-model:columns="logColumnChecks"
|
||||
layout="search,refresh"
|
||||
:loading="logLoading"
|
||||
@refresh="refreshLogData"
|
||||
>
|
||||
<template #left>
|
||||
<ArtTableHeaderLeft
|
||||
<FaTableHeaderLeft
|
||||
:remove-ids="logSelectedIds"
|
||||
:perm-delete="['module_task:cronjob:job:delete']"
|
||||
:delete-loading="logBatchDeleting"
|
||||
@delete="handleLogBatchDelete"
|
||||
/>
|
||||
</template>
|
||||
</ArtTableHeader>
|
||||
<ArtTable
|
||||
ref="logArtTableRef"
|
||||
</FaTableHeader>
|
||||
<FaTable
|
||||
ref="logFaTableRef"
|
||||
row-key="id"
|
||||
:loading="logLoading"
|
||||
:data="logTableData"
|
||||
@@ -331,17 +331,17 @@
|
||||
删除
|
||||
</ElButton>
|
||||
</template>
|
||||
</ArtTable>
|
||||
</FaTable>
|
||||
</ElCard>
|
||||
</div>
|
||||
</ArtDrawer>
|
||||
</FaDrawer>
|
||||
|
||||
<ArtDialog v-model="jobStateVisible" title="执行元数据" width="800px">
|
||||
<FaDialog v-model="jobStateVisible" title="执行元数据" width="800px">
|
||||
<JsonPretty :value="jobStateData" height="400px" />
|
||||
<template #footer>
|
||||
<ElButton type="primary" @click="jobStateVisible = false">关闭</ElButton>
|
||||
</template>
|
||||
</ArtDialog>
|
||||
</FaDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -352,13 +352,13 @@ defineOptions({
|
||||
});
|
||||
|
||||
import JobAPI, { SchedulerStatus, SchedulerJob, JobLogTable } from "@/api/module_task/cronjob/job";
|
||||
import ArtDialog from "@/components/Core/modal/art-dialog/index.vue";
|
||||
import ArtDrawer from "@/components/Core/modal/art-drawer/index.vue";
|
||||
import ArtSearchBar from "@/components/Core/forms/art-search-bar/index.vue";
|
||||
import type { SearchFormItem } from "@/components/Core/forms/art-search-bar/index.vue";
|
||||
import ArtTable from "@/components/Core/tables/art-table/index.vue";
|
||||
import ArtTableHeader from "@/components/Core/tables/art-table-header/index.vue";
|
||||
import ArtTableHeaderLeft from "@/components/Core/tables/art-table-header-left/index.vue";
|
||||
import FaDialog from "@/components/modal/fa-dialog/index.vue";
|
||||
import FaDrawer from "@/components/modal/fa-drawer/index.vue";
|
||||
import FaSearchBar from "@/components/forms/fa-search-bar/index.vue";
|
||||
import type { SearchFormItem } from "@/components/forms/fa-search-bar/index.vue";
|
||||
import FaTable from "@/components/tables/fa-table/index.vue";
|
||||
import FaTableHeader from "@/components/tables/fa-table-header/index.vue";
|
||||
import FaTableHeaderLeft from "@/components/tables/fa-table-header-left/index.vue";
|
||||
import JsonPretty from "@/components/JsonPretty/index.vue";
|
||||
import { useTable } from "@/hooks/core/useTable";
|
||||
import type { ColumnOption } from "@/types/component";
|
||||
@@ -391,7 +391,7 @@ const searchForm = ref<JobSearchForm>({
|
||||
});
|
||||
|
||||
const showSearchBar = ref(true);
|
||||
const searchBarRef = ref<InstanceType<typeof ArtSearchBar> | null>(null);
|
||||
const searchBarRef = ref<InstanceType<typeof FaSearchBar> | null>(null);
|
||||
const searchBarRules: Record<string, unknown> = {};
|
||||
|
||||
const jobSearchItems = computed<SearchFormItem[]>(() => [
|
||||
@@ -429,39 +429,50 @@ async function loadSchedulerStatus() {
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
data: jobList,
|
||||
loading: jobLoading,
|
||||
columnChecks: jobColumnChecks,
|
||||
getData: getJobList,
|
||||
replaceSearchParams: replaceJobSearchParams,
|
||||
resetSearchParams: resetJobSearchParams,
|
||||
refreshData: refreshJobList,
|
||||
} = useTable({
|
||||
core: {
|
||||
apiFn: JobAPI.getSchedulerJobs,
|
||||
apiParams: {
|
||||
page_no: 1,
|
||||
page_size: 10,
|
||||
},
|
||||
columnsFactory: (): ColumnOption<SchedulerJob>[] => [
|
||||
{ type: "selection", width: 48, fixed: "left" },
|
||||
{ type: "globalIndex", width: 56, label: "序号" },
|
||||
{ prop: "id", label: "任务ID", minWidth: 80, showOverflowTooltip: true },
|
||||
{ prop: "name", label: "任务名称", minWidth: 140, showOverflowTooltip: true },
|
||||
{ prop: "trigger", label: "触发器", minWidth: 120, showOverflowTooltip: true },
|
||||
{ prop: "next_run_time", label: "下次执行时间", minWidth: 200, showOverflowTooltip: true },
|
||||
{ prop: "status", label: "状态", minWidth: 80, showOverflowTooltip: true },
|
||||
],
|
||||
},
|
||||
hooks: {
|
||||
onSuccess: () => {
|
||||
void loadSchedulerStatus();
|
||||
},
|
||||
},
|
||||
});
|
||||
/** 调度器任务列表为全量列表接口,无分页;筛选在前端完成 */
|
||||
const jobList = ref<SchedulerJob[]>([]);
|
||||
const jobLoading = ref(false);
|
||||
/** 主区域为卡片列表无表格列配置,仅占位满足 FaTableHeader v-model */
|
||||
const jobColumnChecks = ref<ColumnOption<SchedulerJob>[]>([]);
|
||||
|
||||
async function handleJobSearchBarSearch(params: JobSearchForm) {
|
||||
function matchesJobStatusFilter(jobStatus: string | undefined, filter?: string): boolean {
|
||||
if (!filter) return true;
|
||||
const map: Record<string, string[]> = {
|
||||
运行中: ["运行中"],
|
||||
暂停: ["暂停", "暂停中"],
|
||||
停止: ["停止", "已停止"],
|
||||
};
|
||||
const aliases = map[filter];
|
||||
if (!aliases) return true;
|
||||
const s = jobStatus ?? "";
|
||||
return aliases.some((a) => s === a || s.includes(a));
|
||||
}
|
||||
|
||||
async function fetchSchedulerJobs() {
|
||||
jobLoading.value = true;
|
||||
try {
|
||||
const res = await JobAPI.getSchedulerJobs();
|
||||
const raw = res.data?.data;
|
||||
const list: SchedulerJob[] = Array.isArray(raw) ? raw : [];
|
||||
const nameQ = searchForm.value.name?.trim();
|
||||
const statusQ = searchForm.value.status;
|
||||
jobList.value = list.filter((j) => {
|
||||
if (nameQ && !(j.name ?? "").includes(nameQ)) return false;
|
||||
if (!matchesJobStatusFilter(j.status, statusQ)) return false;
|
||||
return true;
|
||||
});
|
||||
await loadSchedulerStatus();
|
||||
} catch (error: unknown) {
|
||||
console.error(error);
|
||||
jobList.value = [];
|
||||
} finally {
|
||||
jobLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const refreshJobList = fetchSchedulerJobs;
|
||||
|
||||
async function handleJobSearchBarSearch() {
|
||||
await searchBarRef.value?.validate?.();
|
||||
replaceJobSearchParams(buildJobReplaceParams(params));
|
||||
getJobList();
|
||||
@@ -492,7 +503,7 @@ const logSearchForm = ref<LogSearchForm>({
|
||||
trigger_type: undefined,
|
||||
});
|
||||
|
||||
const logSearchBarRef = ref<InstanceType<typeof ArtSearchBar> | null>(null);
|
||||
const logSearchBarRef = ref<InstanceType<typeof FaSearchBar> | null>(null);
|
||||
const logSearchBarRules: Record<string, unknown> = {};
|
||||
|
||||
const logSearchItems = computed<SearchFormItem[]>(() => [
|
||||
@@ -533,7 +544,7 @@ const logSearchItems = computed<SearchFormItem[]>(() => [
|
||||
]);
|
||||
|
||||
const currentLogJobId = ref<string | undefined>(undefined);
|
||||
const logArtTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
|
||||
const logFaTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
|
||||
const logSelectedRows = ref<JobLogTable[]>([]);
|
||||
const logSelectedIds = computed(() =>
|
||||
logSelectedRows.value.map((r) => r.id).filter((id): id is number => typeof id === "number")
|
||||
@@ -659,7 +670,7 @@ function deleteLogRow(id: number | undefined) {
|
||||
.then(async () => {
|
||||
await JobAPI.deleteJobLog([id]);
|
||||
ElMessage.success("删除成功");
|
||||
logArtTableRef.value?.elTableRef?.clearSelection();
|
||||
logFaTableRef.value?.elTableRef?.clearSelection();
|
||||
await refreshLogRemove();
|
||||
})
|
||||
.catch(() => {});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 定时任务节点:Art + useTable -->
|
||||
<template>
|
||||
<div class="art-full-height">
|
||||
<ArtSearchBar
|
||||
<FaSearchBar
|
||||
v-show="showSearchBar"
|
||||
ref="searchBarRef"
|
||||
v-model="searchForm"
|
||||
@@ -18,14 +18,14 @@
|
||||
/>
|
||||
|
||||
<ElCard class="art-table-card" :style="{ 'margin-top': showSearchBar ? '12px' : '0' }">
|
||||
<ArtTableHeader
|
||||
<FaTableHeader
|
||||
v-model:columns="columnChecks"
|
||||
v-model:showSearchBar="showSearchBar"
|
||||
:loading="loading"
|
||||
@refresh="refreshData"
|
||||
>
|
||||
<template #left>
|
||||
<ArtTableHeaderLeft
|
||||
<FaTableHeaderLeft
|
||||
:remove-ids="selectedIds"
|
||||
:perm-create="['module_task:cronjob:node:create']"
|
||||
:perm-delete="['module_task:cronjob:node:delete']"
|
||||
@@ -34,10 +34,10 @@
|
||||
@delete="handleBatchDelete"
|
||||
/>
|
||||
</template>
|
||||
</ArtTableHeader>
|
||||
</FaTableHeader>
|
||||
|
||||
<ArtTable
|
||||
ref="artTableRef"
|
||||
<FaTable
|
||||
ref="FaTableRef"
|
||||
row-key="id"
|
||||
:loading="loading"
|
||||
:data="data"
|
||||
@@ -49,7 +49,7 @@
|
||||
/>
|
||||
</ElCard>
|
||||
|
||||
<ArtDialog
|
||||
<FaDialog
|
||||
v-model="dialogVisible.visible"
|
||||
:title="dialogVisible.title"
|
||||
width="1000px"
|
||||
@@ -59,7 +59,7 @@
|
||||
<ElSplitter direction="horizontal" style="height: 500px">
|
||||
<ElSplitterPanel size="300px" :min="200" :max="400">
|
||||
<ElScrollbar style="height: 100%">
|
||||
<ArtForm
|
||||
<FaForm
|
||||
:key="nodeFormRenderKey"
|
||||
ref="dataFormRef"
|
||||
v-model="formData"
|
||||
@@ -144,7 +144,7 @@
|
||||
:max="10"
|
||||
/>
|
||||
</template>
|
||||
</ArtForm>
|
||||
</FaForm>
|
||||
</ElScrollbar>
|
||||
</ElSplitterPanel>
|
||||
|
||||
@@ -172,15 +172,15 @@
|
||||
<ElButton type="primary" :loading="submitLoading" @click="handleSubmit">确定</ElButton>
|
||||
</div>
|
||||
</template>
|
||||
</ArtDialog>
|
||||
</FaDialog>
|
||||
|
||||
<ArtDialog
|
||||
<FaDialog
|
||||
v-model="executeDialogVisible"
|
||||
title="调试节点"
|
||||
width="700px"
|
||||
@close="handleCloseExecuteDialog"
|
||||
>
|
||||
<ArtForm
|
||||
<FaForm
|
||||
:key="executeFormRenderKey"
|
||||
ref="executeFormRef"
|
||||
v-model="executeFormData"
|
||||
@@ -255,13 +255,13 @@
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</ArtForm>
|
||||
</FaForm>
|
||||
|
||||
<template #footer>
|
||||
<ElButton @click="handleCloseExecuteDialog">取消</ElButton>
|
||||
<ElButton type="primary" :loading="submitLoading" @click="handleExecuteNode">确认</ElButton>
|
||||
</template>
|
||||
</ArtDialog>
|
||||
</FaDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -273,14 +273,14 @@ defineOptions({
|
||||
|
||||
import NodeAPI, { NodeTable, NodeForm, TriggerType } from "@/api/module_task/cronjob/node";
|
||||
import { useDictStore } from "@stores/index";
|
||||
import ArtDialog from "@/components/Core/modal/art-dialog/index.vue";
|
||||
import ArtForm from "@/components/Core/forms/art-form/index.vue";
|
||||
import type { FormItem } from "@/components/Core/forms/art-form/index.vue";
|
||||
import ArtTable from "@/components/Core/tables/art-table/index.vue";
|
||||
import ArtTableHeader from "@/components/Core/tables/art-table-header/index.vue";
|
||||
import ArtTableHeaderLeft from "@/components/Core/tables/art-table-header-left/index.vue";
|
||||
import ArtSearchBar from "@/components/Core/forms/art-search-bar/index.vue";
|
||||
import type { SearchFormItem } from "@/components/Core/forms/art-search-bar/index.vue";
|
||||
import FaDialog from "@/components/modal/fa-dialog/index.vue";
|
||||
import FaForm from "@/components/forms/fa-form/index.vue";
|
||||
import type { FormItem } from "@/components/forms/fa-form/index.vue";
|
||||
import FaTable from "@/components/tables/fa-table/index.vue";
|
||||
import FaTableHeader from "@/components/tables/fa-table-header/index.vue";
|
||||
import FaTableHeaderLeft from "@/components/tables/fa-table-header-left/index.vue";
|
||||
import FaSearchBar from "@/components/forms/fa-search-bar/index.vue";
|
||||
import type { SearchFormItem } from "@/components/forms/fa-search-bar/index.vue";
|
||||
import type { ColumnOption } from "@/types/component";
|
||||
import { useAuth } from "@/hooks/core/useAuth";
|
||||
import { renderTableOperationCell, type TableOperationAction } from "@utils/table";
|
||||
@@ -321,7 +321,7 @@ const searchForm = ref<NodeSearchForm>({
|
||||
});
|
||||
|
||||
const showSearchBar = ref(true);
|
||||
const searchBarRef = ref<InstanceType<typeof ArtSearchBar> | null>(null);
|
||||
const searchBarRef = ref<InstanceType<typeof FaSearchBar> | null>(null);
|
||||
const searchBarRules: Record<string, unknown> = {};
|
||||
|
||||
const nodeSearchItems = computed<SearchFormItem[]>(() => [
|
||||
@@ -343,7 +343,7 @@ const nodeSearchItems = computed<SearchFormItem[]>(() => [
|
||||
},
|
||||
]);
|
||||
|
||||
const artTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
|
||||
const FaTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
|
||||
const selectedRows = ref<NodeTable[]>([]);
|
||||
const selectedIds = computed(() =>
|
||||
selectedRows.value.map((r) => r.id).filter((id): id is number => typeof id === "number")
|
||||
@@ -364,7 +364,7 @@ function deleteNodeRow(id: number | undefined) {
|
||||
.then(async () => {
|
||||
await NodeAPI.deleteNode([id]);
|
||||
ElMessage.success("删除成功");
|
||||
artTableRef.value?.elTableRef?.clearSelection();
|
||||
FaTableRef.value?.elTableRef?.clearSelection();
|
||||
await refreshRemove();
|
||||
})
|
||||
.catch(() => {});
|
||||
@@ -539,8 +539,8 @@ const codeEditorOptions: EditorConfiguration = {
|
||||
autofocus: false,
|
||||
};
|
||||
|
||||
const dataFormRef = ref<InstanceType<typeof ArtForm> | null>(null);
|
||||
const executeFormRef = ref<InstanceType<typeof ArtForm> | null>(null);
|
||||
const dataFormRef = ref<InstanceType<typeof FaForm> | null>(null);
|
||||
const executeFormRef = ref<InstanceType<typeof FaForm> | null>(null);
|
||||
const nodeFormRenderKey = ref(0);
|
||||
const executeFormRenderKey = ref(0);
|
||||
const submitLoading = ref(false);
|
||||
@@ -598,7 +598,7 @@ const defaultCodeBlock = `def handler(*args, **kwargs):
|
||||
}
|
||||
`;
|
||||
|
||||
const formData = reactive<NodeForm>({
|
||||
const formData = ref<NodeForm>({
|
||||
id: undefined,
|
||||
name: "",
|
||||
code: undefined,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
|
||||
<div class="panel-content">
|
||||
<ArtForm
|
||||
<FaForm
|
||||
v-model="formData"
|
||||
:items="edgeFormItems"
|
||||
label-width="80px"
|
||||
@@ -23,7 +23,7 @@
|
||||
<template #color>
|
||||
<ElColorPicker v-model="formData.color" />
|
||||
</template>
|
||||
</ArtForm>
|
||||
</FaForm>
|
||||
|
||||
<div class="panel-actions">
|
||||
<ElButton type="primary" size="small" @click="handleSave">保存</ElButton>
|
||||
@@ -37,7 +37,7 @@
|
||||
import { ref, watch, computed } from "vue";
|
||||
import { ElButton, ElColorPicker, ElMessage, ElIcon } from "element-plus";
|
||||
import { Close } from "@element-plus/icons-vue";
|
||||
import ArtForm from "@/components/Core/forms/art-form/index.vue";
|
||||
import FaForm from "@/components/forms/fa-form/index.vue";
|
||||
|
||||
const props = defineProps({
|
||||
edge: {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
|
||||
<div class="panel-content">
|
||||
<ArtForm
|
||||
<FaForm
|
||||
v-model="formData"
|
||||
:items="nodePanelFormItems"
|
||||
label-width="80px"
|
||||
@@ -45,7 +45,7 @@
|
||||
<div class="field-hint">JSON 格式的关键字参数</div>
|
||||
</div>
|
||||
</template>
|
||||
</ArtForm>
|
||||
</FaForm>
|
||||
|
||||
<div class="panel-actions">
|
||||
<ElButton type="primary" size="small" @click="handleSave">保存</ElButton>
|
||||
@@ -59,8 +59,8 @@
|
||||
import { ref, watch, onMounted, computed } from "vue";
|
||||
import { ElButton, ElInput, ElSelect, ElOption, ElMessage, ElIcon } from "element-plus";
|
||||
import { Close } from "@element-plus/icons-vue";
|
||||
import ArtForm from "@/components/Core/forms/art-form/index.vue";
|
||||
import type { FormItem } from "@/components/Core/forms/art-form/index.vue";
|
||||
import FaForm from "@/components/forms/fa-form/index.vue";
|
||||
import type { FormItem } from "@/components/forms/fa-form/index.vue";
|
||||
import WorkflowNodeTypeAPI, {
|
||||
type WorkflowNodeTypeOption,
|
||||
} from "@/api/module_task/workflow/node-type";
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<ElScrollbar style="height: 100%">
|
||||
<div class="panel-section">
|
||||
<div class="section-title">基础信息</div>
|
||||
<ArtForm
|
||||
<FaForm
|
||||
ref="formRef"
|
||||
v-model="formData"
|
||||
:items="workflowBaseFormItems"
|
||||
@@ -201,8 +201,8 @@ import "element-plus/dist/index.css";
|
||||
import DynamicNode from "./DynamicNode.vue";
|
||||
import NodeConfigPanel from "./NodeConfigPanel.vue";
|
||||
import EdgeConfigPanel from "./EdgeConfigPanel.vue";
|
||||
import ArtForm from "@/components/Core/forms/art-form/index.vue";
|
||||
import type { FormItem } from "@/components/Core/forms/art-form/index.vue";
|
||||
import FaForm from "@/components/forms/fa-form/index.vue";
|
||||
import type { FormItem } from "@/components/forms/fa-form/index.vue";
|
||||
import WorkflowDefinitionAPI, {
|
||||
type WorkflowTable,
|
||||
type WorkflowForm,
|
||||
@@ -227,10 +227,10 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(["update:visible", "refresh"]);
|
||||
|
||||
const formRef = ref<InstanceType<typeof ArtForm> | null>(null);
|
||||
const formRef = ref<InstanceType<typeof FaForm> | null>(null);
|
||||
const workflowId = ref<number>();
|
||||
|
||||
const formData = reactive<Partial<WorkflowForm>>({
|
||||
const formData = ref<Partial<WorkflowForm>>({
|
||||
code: "",
|
||||
name: "",
|
||||
description: "",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 工作流定义:Art + useTable -->
|
||||
<template>
|
||||
<div class="art-full-height">
|
||||
<ArtSearchBar
|
||||
<FaSearchBar
|
||||
v-show="showSearchBar"
|
||||
ref="searchBarRef"
|
||||
v-model="searchForm"
|
||||
@@ -18,14 +18,14 @@
|
||||
/>
|
||||
|
||||
<ElCard class="art-table-card" :style="{ 'margin-top': showSearchBar ? '12px' : '0' }">
|
||||
<ArtTableHeader
|
||||
<FaTableHeader
|
||||
v-model:columns="columnChecks"
|
||||
v-model:showSearchBar="showSearchBar"
|
||||
:loading="loading"
|
||||
@refresh="refreshData"
|
||||
>
|
||||
<template #left>
|
||||
<ArtTableHeaderLeft
|
||||
<FaTableHeaderLeft
|
||||
:remove-ids="selectedIds"
|
||||
:perm-create="['module_task:workflow:definition:create']"
|
||||
:perm-delete="['module_task:workflow:definition:delete']"
|
||||
@@ -34,10 +34,10 @@
|
||||
@delete="handleBatchDelete"
|
||||
/>
|
||||
</template>
|
||||
</ArtTableHeader>
|
||||
</FaTableHeader>
|
||||
|
||||
<ArtTable
|
||||
ref="artTableRef"
|
||||
<FaTable
|
||||
ref="FaTableRef"
|
||||
row-key="id"
|
||||
:loading="loading"
|
||||
:data="data"
|
||||
@@ -97,7 +97,7 @@
|
||||
</ElButton>
|
||||
</ElSpace>
|
||||
</template>
|
||||
</ArtTable>
|
||||
</FaTable>
|
||||
</ElCard>
|
||||
|
||||
<WorkflowDesignDrawer
|
||||
@@ -115,11 +115,11 @@ defineOptions({
|
||||
});
|
||||
|
||||
import WorkflowDefinitionAPI, { type WorkflowTable } from "@/api/module_task/workflow/definition";
|
||||
import ArtSearchBar from "@/components/Core/forms/art-search-bar/index.vue";
|
||||
import type { SearchFormItem } from "@/components/Core/forms/art-search-bar/index.vue";
|
||||
import ArtTable from "@/components/Core/tables/art-table/index.vue";
|
||||
import ArtTableHeader from "@/components/Core/tables/art-table-header/index.vue";
|
||||
import ArtTableHeaderLeft from "@/components/Core/tables/art-table-header-left/index.vue";
|
||||
import FaSearchBar from "@/components/forms/fa-search-bar/index.vue";
|
||||
import type { SearchFormItem } from "@/components/forms/fa-search-bar/index.vue";
|
||||
import FaTable from "@/components/tables/fa-table/index.vue";
|
||||
import FaTableHeader from "@/components/tables/fa-table-header/index.vue";
|
||||
import FaTableHeaderLeft from "@/components/tables/fa-table-header-left/index.vue";
|
||||
import { useTable } from "@/hooks/core/useTable";
|
||||
import type { ColumnOption } from "@/types/component";
|
||||
import { ArrowDown } from "@element-plus/icons-vue";
|
||||
@@ -150,7 +150,7 @@ const searchForm = ref<WorkflowSearchForm>({
|
||||
});
|
||||
|
||||
const showSearchBar = ref(true);
|
||||
const searchBarRef = ref<InstanceType<typeof ArtSearchBar> | null>(null);
|
||||
const searchBarRef = ref<InstanceType<typeof FaSearchBar> | null>(null);
|
||||
const searchBarRules: Record<string, unknown> = {};
|
||||
|
||||
const workflowSearchItems = computed<SearchFormItem[]>(() => [
|
||||
@@ -187,7 +187,7 @@ const workflowSearchItems = computed<SearchFormItem[]>(() => [
|
||||
},
|
||||
]);
|
||||
|
||||
const artTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
|
||||
const FaTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
|
||||
const selectedRows = ref<WorkflowTable[]>([]);
|
||||
const selectedIds = computed(() =>
|
||||
selectedRows.value.map((r) => r.id).filter((id): id is number => typeof id === "number")
|
||||
@@ -208,7 +208,7 @@ function deleteWorkflowRow(id: number | undefined) {
|
||||
.then(async () => {
|
||||
await WorkflowDefinitionAPI.deleteWorkflow([id]);
|
||||
ElMessage.success("删除成功");
|
||||
artTableRef.value?.elTableRef?.clearSelection();
|
||||
FaTableRef.value?.elTableRef?.clearSelection();
|
||||
await refreshRemove();
|
||||
})
|
||||
.catch(() => {});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 工作流节点类型:Art + useTable -->
|
||||
<template>
|
||||
<div class="art-full-height">
|
||||
<ArtSearchBar
|
||||
<FaSearchBar
|
||||
v-show="showSearchBar"
|
||||
ref="searchBarRef"
|
||||
v-model="searchForm"
|
||||
@@ -18,14 +18,14 @@
|
||||
/>
|
||||
|
||||
<ElCard class="art-table-card" :style="{ 'margin-top': showSearchBar ? '12px' : '0' }">
|
||||
<ArtTableHeader
|
||||
<FaTableHeader
|
||||
v-model:columns="columnChecks"
|
||||
v-model:showSearchBar="showSearchBar"
|
||||
:loading="loading"
|
||||
@refresh="refreshData"
|
||||
>
|
||||
<template #left>
|
||||
<ArtTableHeaderLeft
|
||||
<FaTableHeaderLeft
|
||||
:remove-ids="selectedIds"
|
||||
:perm-create="['module_task:workflow:node-type:create']"
|
||||
:perm-delete="['module_task:workflow:node-type:delete']"
|
||||
@@ -34,10 +34,10 @@
|
||||
@delete="handleBatchDelete"
|
||||
/>
|
||||
</template>
|
||||
</ArtTableHeader>
|
||||
</FaTableHeader>
|
||||
|
||||
<ArtTable
|
||||
ref="artTableRef"
|
||||
<FaTable
|
||||
ref="FaTableRef"
|
||||
row-key="id"
|
||||
:loading="loading"
|
||||
:data="data"
|
||||
@@ -71,17 +71,17 @@
|
||||
</ElButton>
|
||||
</ElSpace>
|
||||
</template>
|
||||
</ArtTable>
|
||||
</FaTable>
|
||||
</ElCard>
|
||||
|
||||
<ArtDialog
|
||||
<FaDialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="720px"
|
||||
destroy-on-close
|
||||
@close="handleCloseDialog"
|
||||
>
|
||||
<ArtForm
|
||||
<FaForm
|
||||
:key="nodeTypeFormRenderKey"
|
||||
ref="formRef"
|
||||
v-model="form"
|
||||
@@ -99,7 +99,7 @@
|
||||
<ElButton @click="dialogVisible = false">取消</ElButton>
|
||||
<ElButton type="primary" :loading="submitting" @click="submitForm">保存</ElButton>
|
||||
</template>
|
||||
</ArtDialog>
|
||||
</FaDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -113,14 +113,14 @@ import WorkflowNodeTypeAPI, {
|
||||
type WorkflowNodeTypeForm,
|
||||
type WorkflowNodeTypeTable,
|
||||
} from "@/api/module_task/workflow/node-type";
|
||||
import ArtSearchBar from "@/components/Core/forms/art-search-bar/index.vue";
|
||||
import type { SearchFormItem } from "@/components/Core/forms/art-search-bar/index.vue";
|
||||
import ArtTable from "@/components/Core/tables/art-table/index.vue";
|
||||
import ArtTableHeader from "@/components/Core/tables/art-table-header/index.vue";
|
||||
import ArtTableHeaderLeft from "@/components/Core/tables/art-table-header-left/index.vue";
|
||||
import ArtDialog from "@/components/Core/modal/art-dialog/index.vue";
|
||||
import ArtForm from "@/components/Core/forms/art-form/index.vue";
|
||||
import type { FormItem } from "@/components/Core/forms/art-form/index.vue";
|
||||
import FaSearchBar from "@/components/forms/fa-search-bar/index.vue";
|
||||
import type { SearchFormItem } from "@/components/forms/fa-search-bar/index.vue";
|
||||
import FaTable from "@/components/tables/fa-table/index.vue";
|
||||
import FaTableHeader from "@/components/tables/fa-table-header/index.vue";
|
||||
import FaTableHeaderLeft from "@/components/tables/fa-table-header-left/index.vue";
|
||||
import FaDialog from "@/components/modal/fa-dialog/index.vue";
|
||||
import FaForm from "@/components/forms/fa-form/index.vue";
|
||||
import type { FormItem } from "@/components/forms/fa-form/index.vue";
|
||||
import { useTable } from "@/hooks/core/useTable";
|
||||
import type { ColumnOption } from "@/types/component";
|
||||
import { ElMessage, ElMessageBox, ElTag } from "element-plus";
|
||||
@@ -150,7 +150,7 @@ const searchForm = ref<NodeTypeSearchForm>({
|
||||
});
|
||||
|
||||
const showSearchBar = ref(true);
|
||||
const searchBarRef = ref<InstanceType<typeof ArtSearchBar> | null>(null);
|
||||
const searchBarRef = ref<InstanceType<typeof FaSearchBar> | null>(null);
|
||||
const searchBarRules: Record<string, unknown> = {};
|
||||
|
||||
const nodeTypeSearchItems = computed<SearchFormItem[]>(() => [
|
||||
@@ -188,7 +188,7 @@ const nodeTypeSearchItems = computed<SearchFormItem[]>(() => [
|
||||
},
|
||||
]);
|
||||
|
||||
const artTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
|
||||
const FaTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
|
||||
const selectedRows = ref<WorkflowNodeTypeTable[]>([]);
|
||||
const selectedIds = computed(() =>
|
||||
selectedRows.value.map((r) => r.id).filter((id): id is number => typeof id === "number")
|
||||
@@ -219,7 +219,7 @@ function deleteNodeTypeRow(id: number | undefined) {
|
||||
.then(async () => {
|
||||
await WorkflowNodeTypeAPI.deleteWorkflowNodeType([id]);
|
||||
ElMessage.success("删除成功");
|
||||
artTableRef.value?.elTableRef?.clearSelection();
|
||||
FaTableRef.value?.elTableRef?.clearSelection();
|
||||
await refreshRemove();
|
||||
})
|
||||
.catch(() => {});
|
||||
@@ -365,7 +365,7 @@ const dialogVisible = ref(false);
|
||||
const dialogTitle = ref("新增节点类型");
|
||||
const editingId = ref<number | null>(null);
|
||||
const submitting = ref(false);
|
||||
const formRef = ref<InstanceType<typeof ArtForm> | null>(null);
|
||||
const formRef = ref<InstanceType<typeof FaForm> | null>(null);
|
||||
const nodeTypeFormRenderKey = ref(0);
|
||||
|
||||
const nodeTypeDialogFormItems = computed<FormItem[]>(() => [
|
||||
|
||||
Reference in New Issue
Block a user