|
@@ -1,7 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="tw-bg-white tw-p-5 tw-rounded-xl tw-mb-5">
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
<a-input
|
|
|
v-model:value="name"
|
|
|
class="tw-mr-4"
|
|
@@ -13,10 +12,13 @@
|
|
|
<span class="tw-mr-4"></span>
|
|
|
<ProjectStatusSelect v-model:value="projectStatus" />
|
|
|
<span class="tw-mr-4"></span>
|
|
|
- <a-button @click="search">查询</a-button>
|
|
|
+ <a-button @click="search" class="query-btn">查询</a-button>
|
|
|
|
|
|
- <div v-if="store.isGreaterThanEqualRootOrgAdmin" class="tw-mt-4">
|
|
|
- <a-button @click="newProject">新增</a-button>
|
|
|
+ <div
|
|
|
+ v-if="store.isGreaterThanEqualRootOrgAdmin"
|
|
|
+ class="tw-flex tw-gap-2 tw-mt-4"
|
|
|
+ >
|
|
|
+ <a-button type="primary" @click="newProject">新增</a-button>
|
|
|
<a-button @click="handleDeleteProjects(selectIds)"> 批量删除 </a-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -104,7 +106,7 @@
|
|
|
ok-text="确定"
|
|
|
cancel-text="取消"
|
|
|
>
|
|
|
- <a-form>
|
|
|
+ <a-form :labelCol="{ span: 4 }">
|
|
|
<a-form-item v-show="projectObj.id" label="项目id">
|
|
|
<a-input
|
|
|
:disabled="!!projectObj.id"
|
|
@@ -131,7 +133,7 @@ import {
|
|
|
import router from "@/router";
|
|
|
import { useMainStore } from "@/store";
|
|
|
import { goBack } from "@/utils/utils";
|
|
|
-import { message } from "ant-design-vue";
|
|
|
+import { message, Modal } from "ant-design-vue";
|
|
|
import { watch, onMounted, ref, reactive, toRaw } from "vue-demi";
|
|
|
|
|
|
const store = useMainStore();
|
|
@@ -249,8 +251,17 @@ function checkEmpty(selectIds: number[]): boolean {
|
|
|
}
|
|
|
async function handleDeleteProjects(ids: number[]) {
|
|
|
if (checkEmpty(ids)) return;
|
|
|
- await deleteProjects(ids);
|
|
|
- await search();
|
|
|
+ Modal.confirm({
|
|
|
+ title: "提示",
|
|
|
+ content: "确认删除?",
|
|
|
+ cancelText: "取消",
|
|
|
+ okText: "确定",
|
|
|
+ onOk: async () => {
|
|
|
+ await deleteProjects(ids);
|
|
|
+ await search();
|
|
|
+ message.success({ content: "操作成功" });
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
let selectIds = $ref<number[]>([]);
|
|
@@ -262,13 +273,31 @@ const rowSelection = {
|
|
|
};
|
|
|
|
|
|
async function handleCancelProject(id: number) {
|
|
|
- await cancelProject(id);
|
|
|
- message.success({ content: "操作成功" });
|
|
|
+ Modal.confirm({
|
|
|
+ title: "提示",
|
|
|
+ content: "确认取消计算?",
|
|
|
+ cancelText: "取消",
|
|
|
+ okText: "确定",
|
|
|
+ onOk: async () => {
|
|
|
+ await cancelProject(id);
|
|
|
+ await search();
|
|
|
+ message.success({ content: "操作成功" });
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
async function handleRestartProject(id: number) {
|
|
|
- await restartProject(id);
|
|
|
- message.success({ content: "操作成功" });
|
|
|
+ Modal.confirm({
|
|
|
+ title: "提示",
|
|
|
+ content: "确认重新计算?",
|
|
|
+ cancelText: "取消",
|
|
|
+ okText: "确定",
|
|
|
+ onOk: async () => {
|
|
|
+ await restartProject(id);
|
|
|
+ await search();
|
|
|
+ message.success({ content: "操作成功" });
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
async function handleLogsOfProject(id: number) {
|