refactor: 统一项目中状态字段类型为数字类型

这是一个大规模的类型对齐优化:
1.  将多处字符串类型的status字段统一改为数字类型,包括前后端接口定义、数据模型、页面组件
2.  重构编排节点相关的命名和注释,统一改为"节点类型"替代"编排节点类型"
3.  移除了过时的忘记密码相关接口和模板代码
4.  优化搜索栏组件,支持展开仅显示次要字段
5.  调整部分接口参数和路由逻辑,对齐前后端参数格式
This commit is contained in:
zhangtao
2026-06-23 00:30:40 +08:00
parent 134337b502
commit 414d5c80c3
95 changed files with 561 additions and 883 deletions
@@ -83,6 +83,7 @@ export default DemoAPI;
export interface DemoPageQuery extends PageQuery, UserByQueryParams, TenantByQueryParams {
name?: string;
status?: number;
}
export interface DemoTable extends BaseType {
@@ -170,6 +170,7 @@ export interface GenTableColumnSchema extends BaseType {
export interface GenTablePageQuery extends PageQuery, UserByQueryParams {
table_name?: string;
table_comment?: string;
status?: number;
}
/** 查询参数:DB 表 */
@@ -209,6 +209,7 @@ export interface EmailLogPageQuery extends PageQuery, UserByQueryParams {
to_email?: string;
biz_type?: string;
template_code?: string;
status?: number;
}
export interface EmailLogTable {
@@ -56,6 +56,13 @@ export default MenuAPI;
export interface MenuPageQuery extends BaseQueryParams {
name?: string;
menu_client?: "pc" | "app";
status?: number;
type?: number;
permission?: string;
route_path?: string;
component_path?: string;
description?: string;
scope?: "platform" | "tenant";
}
export interface MenuTable extends BaseType {
@@ -127,6 +127,7 @@ export default OrderAPI;
export interface OrderPageQuery extends PageQuery, TenantByQueryParams {
order_type?: string;
status?: number;
}
export interface OrderTable {
@@ -168,7 +169,9 @@ export interface PaymentRecordTable {
// ─── Refund 类型 ─────────────────────────────────────────
export interface RefundPageQuery extends PageQuery, UserByQueryParams, TenantByQueryParams {}
export interface RefundPageQuery extends PageQuery, UserByQueryParams, TenantByQueryParams {
status?: number;
}
export interface RefundTable {
id: number;
@@ -86,6 +86,7 @@ export default PackageAPI;
export interface PackagePageQuery extends PageQuery, UserByQueryParams, TenantByQueryParams {
name?: string;
code?: string;
status?: number;
}
export interface PackageTable extends BaseType {
@@ -105,6 +105,7 @@ export default PluginAPI;
export interface PluginQueryParam extends PageQuery, UserByQueryParams, TenantByQueryParams {
name?: string;
category?: string;
status?: number;
}
export interface PluginTable extends BaseType {
@@ -116,7 +116,7 @@ export interface WorkspaceData {
id: number;
name: string;
code: string;
status: string;
status: number;
status_label: string;
start_time: string | null;
end_time: string | null;
@@ -133,6 +133,7 @@ export default TenantAPI;
export interface TenantPageQuery extends PageQuery, UserByQueryParams, TenantByQueryParams {
name?: string;
code?: string;
status?: number;
}
export interface TenantTable extends BaseType {
+7 -43
View File
@@ -23,7 +23,7 @@ const AuthAPI = {
},
refreshToken(body: RefreshToekenBody) {
return request<ApiResponse<LoginResult>>({
return request<ApiResponse<JWTOut>>({
url: `${API_PATH}/token/refresh`,
method: "post",
data: body,
@@ -45,32 +45,6 @@ const AuthAPI = {
});
},
/** 获取免登录用户列表 */
getAutoLoginUsers() {
return request<ApiResponse<AutoLoginUser[]>>({
url: `${API_PATH}/auto-login/users`,
method: "get",
});
},
/** 获取免登录Token */
getAutoLoginToken(userId: number) {
return request<ApiResponse<AutoLoginToken>>({
url: `${API_PATH}/auto-login/token`,
method: "post",
params: { user_id: userId },
});
},
/** 免登录 */
autoLogin(token: string) {
return request<ApiResponse<LoginResult>>({
url: `${API_PATH}/auto-login`,
method: "post",
params: { token },
});
},
/** 获取当前用户的可选租户列表 */
getTenants() {
return request<ApiResponse<TenantOption[]>>({
@@ -129,12 +103,16 @@ export interface LoginFormData {
login_type?: string;
}
/** 登录成功返回 (JWTOutSchema) */
export interface LoginResult {
/** JWT 响应 (JWTOutSchema) */
export interface JWTOut {
access_token: string;
refresh_token: string;
token_type: string;
expires_in: number;
}
/** 登录成功返回 */
export interface LoginResult extends JWTOut {
tenants?: TenantOption[];
}
@@ -148,20 +126,6 @@ export interface LogoutBody {
token: string;
}
/** 免登录用户 (AutoLoginUserSchema) */
export interface AutoLoginUser {
id: number;
username: string;
name: string;
avatar?: string | null;
}
/** 免登录 Token (AutoLoginTokenSchema) */
export interface AutoLoginToken {
token: string;
user: AutoLoginUser;
}
/** 租户选项 */
export interface TenantOption {
id: number;
+4 -3
View File
@@ -11,9 +11,9 @@ const DeptAPI = {
});
},
detailDept(query: number) {
detailDept(id: number) {
return request<ApiResponse<DeptTable>>({
url: `${API_PATH}/detail/${query}`,
url: `${API_PATH}/detail/${id}`,
method: "get",
});
},
@@ -53,8 +53,9 @@ const DeptAPI = {
export default DeptAPI;
export interface DeptPageQuery extends UserByQueryParams {
export interface DeptPageQuery extends UserByQueryParams, TenantByQueryParams {
name?: string;
status?: number;
}
export interface DeptTable extends BaseType {
@@ -135,12 +135,14 @@ export default DictAPI;
export interface DictPageQuery extends PageQuery, UserByQueryParams {
dict_name?: string;
dict_type?: string;
status?: number;
}
export interface DictDataPageQuery extends PageQuery, UserByQueryParams {
dict_label?: string;
dict_type?: string;
dict_type_id?: number;
status?: number;
}
export interface DictTable extends BaseType {
+4 -2
View File
@@ -40,9 +40,10 @@ const OperationLogAPI = {
export default OperationLogAPI;
export interface OperationLogPageQuery extends PageQuery {
export interface OperationLogPageQuery extends PageQuery, UserByQueryParams, TenantByQueryParams {
request_path?: string;
creator_name?: string;
status?: number;
}
export interface OperationLogTable {
@@ -86,8 +87,9 @@ export const LoginLogAPI = {
},
};
export interface LoginLogPageQuery extends PageQuery {
export interface LoginLogPageQuery extends PageQuery, UserByQueryParams, TenantByQueryParams {
username?: string;
status?: number;
}
export interface LoginLogTable {
@@ -100,6 +100,7 @@ export default NoticeAPI;
export interface NoticePageQuery extends PageQuery, UserByQueryParams {
notice_title?: string;
notice_type?: string;
status?: number;
}
export interface NoticeTable extends BaseType {
@@ -86,6 +86,7 @@ export interface ConfigPageQuery extends PageQuery, UserByQueryParams {
config_name?: string;
config_key?: string;
config_type?: boolean;
status?: number;
}
export interface ConfigTable extends BaseType {
@@ -64,6 +64,7 @@ export default PositionAPI;
export interface PositionPageQuery extends PageQuery, UserByQueryParams {
name?: string;
status?: number;
}
export interface PositionTable extends BaseType {
+1 -1
View File
@@ -114,7 +114,7 @@ export interface permissionMenuType {
type: number;
permission: string;
parent_id?: number;
status: string;
status: number;
description?: string;
children?: permissionMenuType[];
}
@@ -41,6 +41,7 @@ export interface TicketPageQuery extends PageQuery, UserByQueryParams {
title?: string;
ticket_type?: string;
assigned_id?: number;
status?: number;
}
export interface TicketTable extends BaseType {
+10 -11
View File
@@ -36,16 +36,16 @@ export const UserAPI = {
});
},
resetUserPassword(body: ResetPasswordForm) {
resetUserPassword(id: number, body: ResetPasswordForm) {
return request<ApiResponse>({
url: `${API_PATH}/reset/password`,
url: `${API_PATH}/password/reset/${id}`,
method: "put",
data: body,
});
},
registerUser(body: RegisterForm) {
return request<ApiResponse>({
return request<ApiResponse<UserInfo>>({
url: `${API_PATH}/register`,
method: "post",
data: body,
@@ -54,7 +54,7 @@ export const UserAPI = {
forgetPassword(body: ForgetPasswordForm) {
return request<ApiResponse>({
url: `${API_PATH}/forget/password`,
url: `${API_PATH}/password/forget`,
method: "post",
data: body,
});
@@ -68,9 +68,9 @@ export const UserAPI = {
});
},
detailUser(query: number) {
detailUser(id: number) {
return request<ApiResponse<UserInfo>>({
url: `${API_PATH}/detail/${query}`,
url: `${API_PATH}/detail/${id}`,
method: "get",
});
},
@@ -107,11 +107,11 @@ export const UserAPI = {
});
},
exportUser(body: UserPageQuery) {
exportUser(query: UserPageQuery) {
return request<Blob>({
url: `${API_PATH}/export`,
method: "post",
data: body,
method: "get",
params: query,
responseType: "blob",
});
},
@@ -119,7 +119,7 @@ export const UserAPI = {
downloadTemplateUser() {
return request<ApiResponse>({
url: `${API_PATH}/import/template`,
method: "post",
method: "get",
responseType: "blob",
});
},
@@ -244,7 +244,6 @@ export interface PasswordFormState {
}
export interface ResetPasswordForm {
id: number;
password: string;
}
@@ -121,7 +121,7 @@ const JobAPI = {
export default JobAPI;
export interface SchedulerStatus {
status: string;
status: number;
is_running: boolean;
job_count: number;
}
@@ -138,6 +138,7 @@ export interface JobLogPageQuery extends PageQuery, UserByQueryParams {
job_id?: string;
job_name?: string;
trigger_type?: string;
status?: number;
}
export interface JobLogTable extends BaseType {
@@ -78,6 +78,7 @@ export default NodeAPI;
export interface NodePageQuery extends PageQuery, UserByQueryParams {
name?: string;
code?: string;
status?: number;
}
export type TriggerType = "now" | "cron" | "interval" | "date";
@@ -91,7 +92,7 @@ export interface ExecuteNodeParams {
export interface ExecuteNodeResult {
job_id: number;
status: string;
status: number;
trigger: TriggerType;
}
@@ -66,6 +66,7 @@ export { WorkflowDefinitionAPI };
export interface WorkflowPageQuery extends PageQuery, UserByQueryParams {
name?: string;
code?: string;
status?: number;
}
export interface WorkflowTable extends BaseType {
@@ -100,7 +101,7 @@ export interface WorkflowExecuteForm {
export interface WorkflowExecuteResult {
workflow_id: number;
workflow_name: string;
status: string;
status: number;
start_time?: string;
end_time?: string;
variables?: Record<string, any>;
@@ -61,7 +61,7 @@ const WorkflowNodeTypeAPI = {
export default WorkflowNodeTypeAPI;
export { WorkflowNodeTypeAPI };
/** 编排节点类型选项(对应后端 task_workflow_node_type */
/** 节点类型选项(对应后端 task_workflow_node_type */
export interface WorkflowNodeTypeOption {
id: number;
code: string;
@@ -76,6 +76,7 @@ export interface WorkflowNodeTypePageQuery extends PageQuery, UserByQueryParams
code?: string;
category?: string;
is_active?: boolean;
status?: number;
}
export interface WorkflowNodeTypeTable extends BaseType {
@@ -6,6 +6,7 @@ export type AuditSearchFormParams = {
updated_id?: number | null;
created_time?: string[];
updated_time?: string[];
tenant_id?: number | null;
};
export interface GetAuditSearchFormItemsOptions {
@@ -15,18 +16,30 @@ export interface GetAuditSearchFormItemsOptions {
updatedByLabel?: string;
createdTimeLabel?: string;
updatedTimeLabel?: string;
tenantIdLabel?: string;
createdByPlaceholder?: string;
updatedByPlaceholder?: string;
tenantIdPlaceholder?: string;
/** 日期时间范围 valueFormat,默认 YYYY-MM-DD HH:mm:ss */
valueFormat?: string;
rangeSeparator?: string;
startPlaceholder?: string;
endPlaceholder?: string;
/** 是否显示租户ID字段,默认 false */
showTenantId?: boolean;
/** 是否显示创建人字段,默认 true */
showCreatedBy?: boolean;
/** 是否显示更新人字段,默认 true */
showUpdatedBy?: boolean;
/** 是否显示创建时间字段,默认 true */
showCreatedTime?: boolean;
/** 是否显示更新时间字段,默认 true */
showUpdatedTime?: boolean;
}
/**
* 常见「创建人 / 更新人 / 创建时间 / 更新时间」搜索项,供 FaSearchBar `items` 使用。
* 当 FaSearchBar 设置 `includeAudit` 为 true 时,会自动追加这四个字段。
* 常见「创建人 / 更新人 / 创建时间 / 更新时间 / 租户ID」搜索项,供 FaSearchBar `items` 使用。
* 当 FaSearchBar 设置 `includeAudit` 为 true 时,会自动追加这字段。
* 创建人、更新人插槽由 FaSearchBar 内置提供,也可通过 `#created_id`、`#updated_id` 覆盖。
*/
export function getAuditSearchFormItems(
@@ -37,9 +50,14 @@ export function getAuditSearchFormItems(
const rangeSep = options?.rangeSeparator ?? "至";
const sp = options?.startPlaceholder ?? "开始";
const ep = options?.endPlaceholder ?? "结束";
const showTenantId = options?.showTenantId ?? false;
const showCreatedBy = options?.showCreatedBy ?? true;
const showUpdatedBy = options?.showUpdatedBy ?? true;
const showCreatedTime = options?.showCreatedTime ?? true;
const showUpdatedTime = options?.showUpdatedTime ?? true;
return [
{
const fieldMap: Record<string, SearchFormItem> = {
created_id: {
label: options?.createdByLabel ?? "创建人",
key: "created_id",
type: "input",
@@ -48,8 +66,9 @@ export function getAuditSearchFormItems(
style: { width: "100%" },
},
span,
expandOnly: true, // 标记为展开专属字段
},
{
updated_id: {
label: options?.updatedByLabel ?? "更新人",
key: "updated_id",
type: "input",
@@ -58,8 +77,9 @@ export function getAuditSearchFormItems(
style: { width: "100%" },
},
span,
expandOnly: true, // 标记为展开专属字段
},
{
created_time: {
label: options?.createdTimeLabel ?? "创建时间",
key: "created_time",
type: "datetimerange",
@@ -72,8 +92,9 @@ export function getAuditSearchFormItems(
valueFormat,
},
span,
expandOnly: true, // 标记为展开专属字段
},
{
updated_time: {
label: options?.updatedTimeLabel ?? "更新时间",
key: "updated_time",
type: "datetimerange",
@@ -86,6 +107,27 @@ export function getAuditSearchFormItems(
valueFormat,
},
span,
expandOnly: true, // 标记为展开专属字段
},
];
tenant_id: {
label: options?.tenantIdLabel ?? "租户ID",
key: "tenant_id",
type: "input",
props: {
placeholder: options?.tenantIdPlaceholder ?? "请输入租户ID",
style: { width: "100%" },
},
span,
expandOnly: true, // 标记为展开专属字段
},
};
const fieldOrder: string[] = [];
if (showCreatedBy) fieldOrder.push("created_id");
if (showUpdatedBy) fieldOrder.push("updated_id");
if (showCreatedTime) fieldOrder.push("created_time");
if (showUpdatedTime) fieldOrder.push("updated_time");
if (showTenantId) fieldOrder.push("tenant_id");
return fieldOrder.map((key) => fieldMap[key]).filter((item): item is SearchFormItem => Boolean(item));
}
@@ -209,6 +209,8 @@ export interface SearchFormItem {
render?: (() => VNode) | Component;
/** 是否隐藏该表单项 */
hidden?: boolean;
/** 是否仅在展开状态下显示(用于审计字段等次要字段) */
expandOnly?: boolean;
/** 表单项占据的列宽,基于24格栅格系统 */
span?: number;
/** 选项数据,用于 select、checkbox-group、radio-group 等 */
@@ -280,7 +282,7 @@ const props = withDefaults(defineProps<Props>(), {
labelWidth: "70px",
showExpand: true,
defaultExpanded: false,
buttonLeftLimit: 2,
buttonLeftLimit: 0,
showReset: true,
showSearch: true,
disabledSearch: false,
@@ -492,18 +494,26 @@ const visibleFormItems = computed(() => {
const shouldShowLess = !props.isExpand && !isExpanded.value;
if (shouldShowLess) {
const maxItemsPerRow = Math.floor(24 / props.span) - 1;
return filteredItems.slice(0, maxItemsPerRow);
// 收起时:只显示非 expandOnly 的字段,且不超过最大数量
const nonExpandOnlyItems = filteredItems.filter((item) => !item.expandOnly);
return nonExpandOnlyItems.slice(0, maxItemsPerRow);
}
// 展开时:显示所有字段
return filteredItems;
});
/**
* 非隐藏表单项总数(包含审计字段)
*/
const visibleItemCount = computed(() => mergedItems.value.filter((item) => !item.hidden).length);
/**
* 是否应该显示展开/收起按钮
* 当合并后的总字段数超过一行可展示数量时显示展开按钮
*/
const shouldShowExpandToggle = computed(() => {
const filteredItems = props.items.filter((item) => !item.hidden);
return (
!props.isExpand && props.showExpand && filteredItems.length > Math.floor(24 / props.span) - 1
!props.isExpand && props.showExpand && visibleItemCount.value > Math.floor(24 / props.span) - 1
);
});
@@ -57,6 +57,18 @@
</ElInput>
</ElFormItem>
</ElTooltip>
<ElFormItem v-if="showEmail" prop="email">
<ElInput
class="custom-height"
v-model.trim="registerForm.email"
clearable
:placeholder="$t('login.placeholder.email')"
>
<template #prefix>
<ElIcon><Message /></ElIcon>
</template>
</ElInput>
</ElFormItem>
<ElFormItem>
<div class="flex flex-wrap items-center gap-2">
<ElCheckbox v-model="registerAgreementReadModel">
@@ -96,7 +108,7 @@
</template>
<script setup lang="ts">
import { Lock, User } from "@element-plus/icons-vue";
import { Lock, Message, User } from "@element-plus/icons-vue";
import type { RegisterForm } from "@/api/module_system/user";
import type { FormRules } from "element-plus";
@@ -105,13 +117,14 @@ const registerForm = defineModel<RegisterForm>("registerForm", { required: true
defineOptions({ name: "FaLoginRegisterPanel" });
interface Props {
registerRules: FormRules<RegisterForm>;
registerRules: FormRules<RegisterForm & { email: string }>;
formKey: number | string;
registerLoading: boolean;
userAgreementHref: string;
showEmail?: boolean;
}
withDefaults(defineProps<Props>(), {});
withDefaults(defineProps<Props>(), { showEmail: false });
const registerAgreementReadModel = defineModel<boolean>("registerAgreementRead", {
required: true,
+2 -1
View File
@@ -466,7 +466,8 @@
"placeholder": {
"username": "Please enter account",
"password": "Please enter password",
"confirmPassword": "Please enter password again"
"confirmPassword": "Please enter password again",
"email": "Please enter email"
},
"rule": {
"confirmPasswordRequired": "Please enter your password again",
+2 -1
View File
@@ -466,7 +466,8 @@
"placeholder": {
"username": "请输入账号",
"password": "请输入密码",
"confirmPassword": "请再次输入密码"
"confirmPassword": "请再次输入密码",
"email": "请输入邮箱"
},
"rule": {
"confirmPasswordRequired": "请再次输入密码",
-1
View File
@@ -104,7 +104,6 @@ function mapMenuNode(item: MenuTable, depth = 0): AppRouteRecord {
title: item.title ?? "",
icon: item.icon || undefined,
hidden: !!item.hidden,
/** 与菜单 API `keep_alive` 一致;缺省 true 仅在后端未下发该字段时兜底 */
keepAlive: item.keep_alive ?? true,
affix: !!item.affix,
fixedTab: !!item.affix,
+1 -2
View File
@@ -106,7 +106,6 @@ declare global {
* 基础查询参数(基础层:状态 + 时间范围)
*/
interface BaseQueryParams {
status?: number;
created_time?: string[];
updated_time?: string[];
}
@@ -273,7 +272,7 @@ declare global {
interface UserListItem {
id: number;
avatar: string;
status: string;
status: number;
userName: string;
userGender: string;
nickName: string;
@@ -192,7 +192,7 @@
</ElLink>
·
<ElLink href="#page-nodetype" type="primary" underline="never">
编排节点类型
节点类型
</ElLink>
</div>
</li>
@@ -921,7 +921,7 @@ const MANUAL_TOC: ManualModule[] = [
{ anchor: "page-cronjob", title: "调度器监控" },
{ anchor: "page-cronnode", title: "节点管理" },
{ anchor: "page-workflow", title: "流程编排" },
{ anchor: "page-nodetype", title: "编排节点类型" },
{ anchor: "page-nodetype", title: "节点类型" },
],
},
{
@@ -214,7 +214,7 @@ export const MANUAL_MODULES_AFTER_SYSTEM: ManualModuleSection[] = [
},
{
anchor: "page-nodetype",
title: "编排节点类型",
title: "节点类型",
path: "module_task/workflow/node-type/index.vue",
notes: [
"检索:FaSearchBar(可展开)。",
@@ -13,6 +13,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -196,36 +197,6 @@ const memorySearchItems = computed<SearchFormItem[]>(() => [
clearable: true,
span: 6,
},
{
label: "创建时间",
key: "created_at",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
{
label: "更新时间",
key: "updated_at",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
const dataFormRef = ref<InstanceType<typeof FaForm> | null>(null);
@@ -13,7 +13,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
:include-audit="true"
include-audit
@search="handleSearch"
@reset="onResetSearch"
/>
@@ -12,7 +12,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
:button-left-limit="0"
include-audit
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -833,6 +833,20 @@ const gencodeSearchItems = computed<SearchFormItem[]>(() => [
clearable: true,
span: 6,
},
{
label: "状态",
key: "status",
type: "select",
props: {
placeholder: "请选择状态",
options: [
{ label: "未生成", value: 0 },
{ label: "已生成", value: 1 },
],
clearable: true,
},
span: 6,
},
]);
const {
@@ -14,7 +14,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
:button-left-limit="0"
include-audit
@search="handleConfigSearch"
@reset="onConfigResetSearch"
/>
@@ -68,7 +68,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
:button-left-limit="0"
include-audit
@search="handleTemplateSearch"
@reset="onTemplateResetSearch"
/>
@@ -122,7 +122,8 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
:button-left-limit="0"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleLogSearch"
@reset="onLogResetSearch"
/>
@@ -317,6 +318,20 @@ const configSearchItems = computed<SearchFormItem[]>(() => [
clearable: true,
span: 6,
},
{
label: "状态",
key: "status",
type: "select",
props: {
placeholder: "请选择状态",
options: [
{ label: "启用", value: 0 },
{ label: "停用", value: 1 },
],
clearable: true,
},
span: 6,
},
]);
const configTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
@@ -443,6 +458,20 @@ const templateSearchItems = computed<SearchFormItem[]>(() => [
clearable: true,
span: 6,
},
{
label: "状态",
key: "status",
type: "select",
props: {
placeholder: "请选择状态",
options: [
{ label: "启用", value: 0 },
{ label: "停用", value: 1 },
],
clearable: true,
},
span: 6,
},
]);
const templateTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
@@ -553,6 +582,21 @@ const logSearchItems = computed<SearchFormItem[]>(() => [
clearable: true,
span: 6,
},
{
label: "状态",
key: "status",
type: "select",
props: {
placeholder: "请选择状态",
options: [
{ label: "待发送", value: 0 },
{ label: "成功", value: 1 },
{ label: "失败", value: 2 },
],
clearable: true,
},
span: 6,
},
]);
const {
@@ -15,7 +15,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
:button-left-limit="0"
include-audit
@search="handlePlatformSearch"
@reset="handlePlatformReset"
/>
@@ -165,6 +165,36 @@ const platformSearchItems = computed<SearchFormItem[]>(() => [
],
},
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
{
label: "更新时间",
key: "updated_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
const platformSearchBarRef = ref();
@@ -13,6 +13,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -470,21 +471,6 @@ const menuSearchItems = computed<SearchFormItem[]>(() => [
},
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
const tableRef = ref<{
@@ -15,7 +15,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
:button-left-limit="0"
include-audit
@search="handleOrderSearch"
@reset="handleOrderReset"
/>
@@ -13,6 +13,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -12,6 +12,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -13,6 +13,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -335,21 +336,6 @@ const tenantSearchItems = computed<SearchFormItem[]>(() => [
},
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
const faTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
@@ -414,7 +414,7 @@ const validateRegisterConfirm = (_rule: unknown, value: string, callback: (e?: E
callback();
};
const registerRules = computed<FormRules<RegisterForm>>(() => ({
const registerRules = computed<FormRules<RegisterForm & { email: string }>>(() => ({
username: [{ required: true, message: t("login.message.username.required"), trigger: "blur" }],
password: [
{ required: true, validator: validateRegisterPassword, trigger: "blur" },
@@ -425,6 +425,14 @@ const registerRules = computed<FormRules<RegisterForm>>(() => ({
{ min: 6, message: t("login.message.password.min"), trigger: "blur" },
{ validator: validateRegisterConfirm, trigger: "blur" },
],
email: [
{ required: true, message: t("login.email.required"), trigger: "blur" },
{
type: "email",
message: t("login.email.invalid"),
trigger: "blur",
},
],
}));
const validateForgetConfirm = (_rule: unknown, value: string, callback: (e?: Error) => void) => {
@@ -13,6 +13,8 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -240,21 +242,6 @@ const deptSearchItems = computed<SearchFormItem[]>(() => [
},
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
const tableRef = ref<{
@@ -13,6 +13,8 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -164,6 +166,7 @@ type DictTypeSearchForm = {
dict_type?: string;
status?: number;
created_time?: string[];
updated_time?: string[];
};
const dictStore = useDictStore();
@@ -174,6 +177,7 @@ const searchForm = ref<DictTypeSearchForm>({
dict_type: undefined,
status: undefined,
created_time: undefined,
updated_time: undefined,
});
const showSearchBar = ref(true);
@@ -213,21 +217,6 @@ const dictTypeSearchItems = computed<SearchFormItem[]>(() => [
},
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
const faTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
@@ -15,18 +15,11 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleOpSearch"
@reset="onOpResetSearch"
>
<template #created_id>
<FaUserTableSelect
:model-value="opSearchForm.created_id == null ? undefined : opSearchForm.created_id"
@update:model-value="(v: number | undefined) => (opSearchForm.created_id = v)"
@confirm-click="afterOpUserSelectSearch"
@clear-click="afterOpUserSelectSearch"
/>
</template>
</FaSearchBar>
/>
<ElCard
shadow="hover"
@@ -126,7 +119,8 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
:button-left-limit="0"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleLoginSearch"
@reset="onLoginResetSearch"
/>
@@ -255,22 +249,6 @@ const opSearchItems = computed<SearchFormItem[]>(() => [
clearable: true,
span: 6,
},
{ label: "创建人", key: "created_id", type: "input", span: 6 },
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
function buildOpReplaceParams(p: OpSearchForm): Record<string, unknown> {
@@ -398,17 +376,6 @@ async function handleOpSearch(params: OpSearchForm) {
opGetData();
}
async function applyOpSearchFromForm() {
await opSearchBarRef.value?.validate?.();
opReplaceSearchParams(buildOpReplaceParams(opSearchForm.value));
opGetData();
}
async function afterOpUserSelectSearch() {
await nextTick();
await applyOpSearchFromForm();
}
function onOpResetSearch() {
opSearchForm.value = { request_path: undefined, created_id: undefined, created_time: undefined };
void opResetSearchParams();
@@ -486,9 +453,9 @@ async function handleOpBatchDelete() {
// ==================== ====================
type LoginSearchForm = { username?: string; status?: number };
type LoginSearchForm = { username?: string; status?: number; created_time?: string[] };
const loginSearchForm = ref<LoginSearchForm>({ username: undefined, status: undefined });
const loginSearchForm = ref<LoginSearchForm>({ username: undefined, status: undefined, created_time: undefined });
const loginShowSearchBar = ref(true);
const loginSearchBarRef = ref<InstanceType<typeof FaSearchBar> | null>(null);
const loginSearchBarRules: Record<string, unknown> = {};
@@ -514,6 +481,21 @@ const loginSearchItems = computed<SearchFormItem[]>(() => [
props: { placeholder: "请选择状态", options: loginStatusOptions.value, clearable: true },
span: 6,
},
{
label: "登录时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
function buildLoginReplaceParams(p: LoginSearchForm): Record<string, unknown> {
@@ -523,6 +505,8 @@ function buildLoginReplaceParams(p: LoginSearchForm): Record<string, unknown> {
p.status !== undefined && p.status !== null && p.status !== ("" as unknown as number)
? Number(p.status)
: undefined,
created_time:
Array.isArray(p.created_time) && p.created_time.length === 2 ? p.created_time : undefined,
};
}
@@ -614,7 +598,7 @@ async function handleLoginSearch(params: LoginSearchForm) {
}
function onLoginResetSearch() {
loginSearchForm.value = { username: undefined, status: undefined };
loginSearchForm.value = { username: undefined, status: undefined, created_time: undefined };
void loginResetSearchParams();
}
@@ -13,6 +13,8 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleSearchBarSearch"
@reset="onResetSearch"
>
@@ -257,27 +259,6 @@ const noticeSearchItems = computed<SearchFormItem[]>(() => [
},
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
{
label: "创建人",
key: "created_id",
type: "input",
span: 6,
},
]);
const faTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
@@ -13,6 +13,8 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -212,19 +214,18 @@ const paramSearchItems = computed<SearchFormItem[]>(() => [
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
label: "状态",
key: "status",
type: "select",
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
placeholder: "请选择状态",
options: [
{ label: "启用", value: 0 },
{ label: "停用", value: 1 },
],
clearable: true,
},
span: 6,
},
]);
@@ -13,18 +13,11 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleSearchBarSearch"
@reset="onResetSearch"
>
<template #created_id>
<FaUserTableSelect
:model-value="searchForm.created_id == null ? undefined : searchForm.created_id"
@update:model-value="(v: number | undefined) => (searchForm.created_id = v)"
@confirm-click="afterUserSelectSearch"
@clear-click="afterUserSelectSearch"
/>
</template>
</FaSearchBar>
/>
<ElCard
shadow="hover"
@@ -330,27 +323,6 @@ const positionSearchItems = computed<SearchFormItem[]>(() => [
},
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
{
label: "创建人",
key: "created_id",
type: "input",
span: 6,
},
]);
const faTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
@@ -596,17 +568,6 @@ async function handleSearchBarSearch(params: PositionSearchForm) {
getData();
}
async function applyPositionSearchFromForm() {
await searchBarRef.value?.validate?.();
replaceSearchParams(buildPositionReplaceParams(searchForm.value));
getData();
}
async function afterUserSelectSearch() {
await nextTick();
await applyPositionSearchFromForm();
}
function onResetSearch() {
searchForm.value = {
name: undefined,
@@ -13,6 +13,8 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -339,21 +341,6 @@ const roleSearchItems = computed<SearchFormItem[]>(() => [
},
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
const faTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
@@ -13,26 +13,11 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleSearchBarSearch"
@reset="onResetSearch"
>
<template #created_id>
<FaUserTableSelect
:model-value="searchForm.created_id == null ? undefined : searchForm.created_id"
@update:model-value="(v: number | undefined) => (searchForm.created_id = v)"
@confirm-click="afterUserSelectSearch"
@clear-click="afterUserSelectSearch"
/>
</template>
<template #assigned_id>
<FaUserTableSelect
:model-value="searchForm.assigned_id == null ? undefined : searchForm.assigned_id"
@update:model-value="(v: number | undefined) => (searchForm.assigned_id = v)"
@confirm-click="afterUserSelectSearch"
@clear-click="afterUserSelectSearch"
/>
</template>
</FaSearchBar>
/>
<ElCard
shadow="hover"
@@ -325,27 +310,6 @@ const ticketSearchItems = computed<SearchFormItem[]>(() => [
},
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
{
label: "创建人",
key: "created_id",
type: "input",
span: 6,
},
{
label: "处理人",
key: "assigned_id",
@@ -656,17 +620,6 @@ async function handleSearchBarSearch(params: TicketSearchForm) {
getData();
}
async function applyTicketSearchFromForm() {
await searchBarRef.value?.validate?.();
replaceSearchParams(buildTicketReplaceParams(searchForm.value));
getData();
}
async function afterUserSelectSearch() {
await nextTick();
await applyTicketSearchFromForm();
}
function onResetSearch() {
searchForm.value = {
title: undefined,
@@ -32,18 +32,11 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
:audit-item-options="{ showTenantId: true }"
@search="handleSearchBarSearch"
@reset="onResetSearch"
>
<template #created_id>
<FaUserTableSelect
:model-value="searchForm.created_id == null ? undefined : searchForm.created_id"
@update:model-value="(v: number | undefined) => (searchForm.created_id = v)"
@confirm-click="afterUserSelectSearch"
@clear-click="afterUserSelectSearch"
/>
</template>
</FaSearchBar>
/>
<ElCard
shadow="hover"
@@ -514,27 +507,6 @@ const userSearchItems = computed<SearchFormItem[]>(() => [
},
span: 6,
},
{
label: "创建人",
key: "created_id",
type: "input",
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
const faTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
@@ -552,7 +524,7 @@ async function handleResetPassword(row: UserInfo) {
ElMessage.warning("密码至少需要6位字符,请重新输入");
return;
}
await UserAPI.resetUserPassword({ id: row.id!, password: value });
await UserAPI.resetUserPassword(row.id!, { password: value });
} catch {
//
}
@@ -789,17 +761,6 @@ async function handleSearchBarSearch(params: UserSearchForm) {
await getData();
}
async function applyUserSearchFromForm() {
await searchBarRef.value?.validate?.();
replaceSearchParams(buildUserReplaceParams(searchForm.value));
await getData();
}
async function afterUserSelectSearch() {
await nextTick();
await applyUserSearchFromForm();
}
function onResetSearch() {
searchForm.value = {
username: undefined,
@@ -917,7 +878,7 @@ async function handleSubmit() {
const id = formData.value.id;
try {
if (id) {
await UserAPI.updateUser(id, { id, ...formData.value });
await UserAPI.updateUser(id, formData.value);
await refreshUpdate();
} else {
await UserAPI.createUser(formData.value);
@@ -13,9 +13,9 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
:button-left-limit="0"
@search="handleJobSearchBarSearch"
@reset="onJobResetSearch"
include-audit
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
<ElCard
@@ -65,7 +65,7 @@
v-hasPerm="['module_task:cronjob:job:scheduler']"
type="success"
icon="VideoPlay"
:disabled="schedulerStatus.status !== '停止'"
:disabled="schedulerStatus.status !== 0"
size="small"
@click="handleStartScheduler"
>
@@ -75,7 +75,7 @@
v-hasPerm="['module_task:cronjob:job:scheduler']"
type="warning"
icon="VideoPause"
:disabled="schedulerStatus.status !== '运行中'"
:disabled="schedulerStatus.status !== 1"
size="small"
@click="handlePauseScheduler"
>
@@ -85,7 +85,7 @@
v-hasPerm="['module_task:cronjob:job:scheduler']"
type="primary"
icon="RefreshRight"
:disabled="schedulerStatus.status !== '暂停'"
:disabled="schedulerStatus.status !== 2"
size="small"
@click="handleResumeScheduler"
>
@@ -95,7 +95,7 @@
v-hasPerm="['module_task:cronjob:job:scheduler']"
type="danger"
icon="SwitchButton"
:disabled="schedulerStatus.status === '停止'"
:disabled="schedulerStatus.status === 0"
size="small"
@click="handleShutdownScheduler"
>
@@ -350,7 +350,7 @@ import { computed, nextTick, onMounted, ref } from "vue";
import { Terminal, TerminalApi } from "vue-web-terminal";
const schedulerStatus = ref<SchedulerStatus>({
status: "未知",
status: 0,
is_running: false,
job_count: 0,
});
@@ -386,9 +386,9 @@ const jobSearchItems = computed<SearchFormItem[]>(() => [
placeholder: "请选择状态",
clearable: true,
options: [
{ label: "运行中", value: "运行中" },
{ label: "暂停", value: "暂停" },
{ label: "停止", value: "停止" },
{ label: "运行中", value: 0 },
{ label: "暂停", value: 1 },
{ label: "停止", value: 2 },
],
},
span: 6,
@@ -410,17 +410,16 @@ const jobLoading = ref(false);
/** 主区域为卡片列表无表格列配置,仅占位满足 FaTableHeader v-model */
const jobColumnChecks = ref<ColumnOption<SchedulerJob>[]>([]);
function matchesJobStatusFilter(jobStatus: string | undefined, filter?: string): boolean {
if (!filter) return true;
const map: Record<string, string[]> = {
运行中: ["运行中"],
暂停: ["暂停", "暂停中"],
停止: ["停止", "已停止"],
function matchesJobStatusFilter(jobStatus: number | undefined, filter?: number): boolean {
if (filter === undefined) return true;
const map: Record<number, number[]> = {
0: [0], //
1: [1], //
2: [2], //
};
const aliases = map[filter];
if (!aliases) return true;
const s = jobStatus ?? "";
return aliases.some((a) => s === a || s.includes(a));
const allowed = map[filter];
if (!allowed) return true;
return allowed.includes(jobStatus ?? -1);
}
async function fetchSchedulerJobs() {
@@ -433,7 +432,7 @@ async function fetchSchedulerJobs() {
const statusQ = searchForm.value.status;
jobList.value = list.filter((j) => {
if (nameQ && !(j.name ?? "").includes(nameQ)) return false;
if (!matchesJobStatusFilter(j.status.toString(), statusQ?.toString())) return false;
if (!matchesJobStatusFilter(j.status, statusQ)) return false;
return true;
});
await loadSchedulerStatus();
@@ -447,12 +446,12 @@ async function fetchSchedulerJobs() {
const refreshJobList = fetchSchedulerJobs;
async function handleJobSearchBarSearch() {
async function handleSearchBarSearch() {
await searchBarRef.value?.validate?.();
await fetchSchedulerJobs();
}
async function onJobResetSearch() {
async function onResetSearch() {
searchForm.value = {
name: undefined,
status: undefined,
@@ -725,13 +724,13 @@ const executionLogDrawerVisible = ref(false);
const jobStateVisible = ref(false);
const jobStateData = ref<any>(null);
function getSchedulerStatusType(status: string) {
function getSchedulerStatusType(status: number) {
switch (status) {
case "运行中":
case 1:
return "success";
case "暂停":
case 2:
return "warning";
case "停止":
case 0:
return "danger";
default:
return "info";
@@ -13,7 +13,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
:button-left-limit="0"
include-audit
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -343,6 +343,20 @@ const nodeSearchItems = computed<SearchFormItem[]>(() => [
clearable: true,
span: 6,
},
{
label: "状态",
key: "status",
type: "select",
props: {
placeholder: "请选择状态",
options: [
{ label: "启用", value: 0 },
{ label: "停用", value: 1 },
],
clearable: true,
},
span: 6,
},
]);
const faTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);
@@ -13,6 +13,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -55,7 +56,7 @@
<template #workflow-operation="{ row }">
<ElSpace class="flex">
<ElButton
v-if="row.status === 'draft'"
v-if="row.status === 0"
v-hasPerm="['module_task:workflow:definition:update']"
type="success"
size="small"
@@ -66,7 +67,7 @@
发布
</ElButton>
<ElDropdown
v-if="row.status === 'published'"
v-if="row.status === 1"
v-hasPerm="['module_task:workflow:definition:execute']"
@command="(e: string) => handleExecute(e, row)"
>
@@ -180,9 +181,9 @@ const workflowSearchItems = computed<SearchFormItem[]>(() => [
placeholder: "请选择状态",
clearable: true,
options: [
{ label: "草稿", value: "draft" },
{ label: "已发布", value: "published" },
{ label: "已归档", value: "archived" },
{ label: "草稿", value: 0 },
{ label: "已发布", value: 1 },
{ label: "已归档", value: 2 },
],
},
span: 6,
@@ -285,9 +286,9 @@ const {
minWidth: 100,
align: "center",
status: {
draft: { type: "info", text: "草稿" },
published: { type: "success", text: "已发布" },
archived: { type: "warning", text: "已归档" },
0: { type: "info", text: "草稿" },
1: { type: "success", text: "已发布" },
2: { type: "warning", text: "已归档" },
},
},
{
@@ -392,7 +393,7 @@ async function handleExecute(action: string, record: WorkflowTable) {
});
if (res.data?.data) {
const result = res.data.data;
ElMessage.success(`工作流执行${result.status === "completed" ? "成功" : "失败"}`);
ElMessage.success(`工作流执行${result.status === 0 ? "成功" : "失败"}`);
}
await refreshUpdate();
} catch {
@@ -13,6 +13,7 @@
:show-search="true"
:disabled-search="false"
:default-expanded="false"
include-audit
@search="handleSearchBarSearch"
@reset="onResetSearch"
/>
@@ -197,7 +198,7 @@ import type { EditorConfiguration } from "codemirror";
import "codemirror/mode/python/python.js";
import "codemirror/theme/dracula.css";
const BATCH_DELETE_MSG = "确认删除选中的编排节点类型吗?";
const BATCH_DELETE_MSG = "确认删除选中的节点类型吗?";
type NodeTypeSearchForm = {
name?: string;
@@ -256,6 +257,35 @@ const nodeTypeSearchItems = computed<SearchFormItem[]>(() => [
},
span: 6,
},
{
label: "状态",
key: "status",
type: "select",
props: {
placeholder: "请选择状态",
clearable: true,
options: [
{ label: "启用", value: 0 },
{ label: "停用", value: 1 },
],
},
span: 6,
},
{
label: "创建时间",
key: "created_time",
type: "datetimerange",
span: 6,
props: {
type: "datetimerange",
rangeSeparator: "至",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
format: "YYYY-MM-DD HH:mm:ss",
valueFormat: "YYYY-MM-DD HH:mm:ss",
style: { width: "100%" },
},
},
]);
const faTableRef = ref<{ elTableRef?: { clearSelection: () => void } } | null>(null);