zhangjie 1 gadu atpakaļ
vecāks
revīzija
90d60110e6

+ 5 - 3
src/components/Layout.vue

@@ -62,6 +62,7 @@ import type { MenuItem } from "@/constants/menu";
 import { useRoute, useRouter } from "vue-router";
 import { ref, watch } from "vue";
 import ModifyPwd from "../features/userManagement/ModifyPwd.vue";
+import { message } from "ant-design-vue";
 
 const route = useRoute();
 const router = useRouter();
@@ -103,8 +104,9 @@ function toModifyPwd() {
 }
 
 async function doLogout() {
-  await logout().then(() =>
-    routeLogout({ cause: "主动退出", redirectTo: "/" })
-  );
+  await logout().then(() => {
+    message.success("退出成功");
+    routeLogout({ cause: "主动退出", redirectTo: "/" });
+  });
 }
 </script>

+ 2 - 1
src/components/RootOrgSelect.vue

@@ -24,7 +24,7 @@ const props = defineProps<{
   value?: null | number | string;
   selectFirst?: boolean;
 }>();
-const emit = defineEmits(["update:value"]);
+const emit = defineEmits(["update:value", "first-selected"]);
 
 let optionList = $ref<{ id: number; name: string }[]>([]);
 
@@ -34,6 +34,7 @@ onMounted(async () => {
 
   if (optionList.length && props.selectFirst) {
     handleChange(optionList[0].id);
+    emit("first-selected", optionList[0].id);
   }
 });
 

+ 14 - 1
src/features/login/Login.vue

@@ -3,7 +3,11 @@
     <div class="login-box">
       <div class="login-theme">
         <h1></h1>
-        <p>Copyright ©启明泰和 Rights Reserved.</p>
+        <p>
+          <a href="http://www.qmth.com.cn" target="_blank">
+            Copyright ©启明泰和 </a
+          >V1.2.1 Rights Reserved.
+        </p>
       </div>
       <div class="login-body" @keyup.enter="submit">
         <div class="login-title">
@@ -52,6 +56,7 @@ import { useRouter } from "vue-router";
 import { useMainStore } from "@/store";
 import useLoading from "@/hooks/loading";
 import useAuth from "@/hooks/auth";
+import { message } from "ant-design-vue";
 
 import { reactive } from "vue";
 import type { Rule } from "ant-design-vue/es/form";
@@ -87,12 +92,20 @@ async function submit() {
 
   if (loading.value) return;
   setLoading(true);
+  const hide = message.loading({
+    content: "登录中...",
+    duration: 0,
+    style: {
+      marginTop: "100px",
+    },
+  });
   const loginRootOrgId = parseInt(rootOrgId?.toString() ?? "1");
   const res = await loginByUsername({
     accountValue: formData.accountValue,
     password: formData.password,
     rootOrgId: loginRootOrgId,
   }).catch(() => {});
+  hide();
   setLoading(false);
   if (!res) return;
 

+ 8 - 35
src/features/projectManagement/ProjectManagement.vue

@@ -60,7 +60,7 @@
             </a-tooltip>
           </template>
           <template v-if="column.dataIndex === 'status'">
-            <span>{{ $filters.projectStatusFilter(text) }}</span>
+            <status-tag :value="text" type="projectStatus"></status-tag>
           </template>
           <template v-if="column.dataIndex === 'needCompute'">
             <span>{{ $filters.booleanYesNoFilter(text) }}</span>
@@ -158,26 +158,6 @@
       </a-table>
     </div>
 
-    <a-modal
-      v-model:open="showRestartModalVisible"
-      title="重新计算"
-      okText="确定"
-      cancelText="取消"
-      :width="438"
-      @ok="handleRestartProject"
-    >
-      <ul class="tw-ml-4 tw-list-disc">
-        <li v-if="selectedProject.changeInfo?.ITEM1">单科线</li>
-        <li v-if="selectedProject.changeInfo?.ITEM2">题型分布</li>
-        <li v-if="selectedProject.changeInfo?.ITEM3">试题难度分组分段分布</li>
-        <li v-if="selectedProject.changeInfo?.ITEM4">客观题高低分组</li>
-        <li v-if="selectedProject.changeInfo?.ITEM5">科目分数线分组分段</li>
-        <li v-if="selectedProject.changeInfo?.ITEM6">
-          本科目成绩占初试总分权重分段
-        </li>
-      </ul>
-    </a-modal>
-
     <!-- ModifyProject -->
     <ModifyProject
       ref="modifyProjectRef"
@@ -326,8 +306,8 @@ function checkEmpty(selectIds: number[]): boolean {
 function handleDeleteProjects(ids: number[]) {
   if (checkEmpty(ids)) return;
   Modal.confirm({
-    title: "提示",
-    content: "确认删除?",
+    title: "系统通知",
+    content: "确认删除该项目?",
     cancelText: "取消",
     okText: "确定",
     onOk: async () => {
@@ -343,8 +323,8 @@ let selectIds = $ref<number[]>([]);
 
 function handleCancelProject(id: number) {
   Modal.confirm({
-    title: "提示",
-    content: "确认取消计算?",
+    title: "系统通知",
+    content: "确认取消计算该项目?",
     cancelText: "取消",
     okText: "确定",
     onOk: async () => {
@@ -355,22 +335,15 @@ function handleCancelProject(id: number) {
   });
 }
 
-let showRestartModalVisible = $ref(false);
-let selectedProject = reactive<Project>({ id: 0 } as Project);
 function selectRestartProject(p: Project) {
-  Object.assign(selectedProject, p);
-  showRestartModalVisible = true;
-}
-function handleRestartProject() {
   Modal.confirm({
-    title: "提示",
-    content: "确认重新计算?",
+    title: "系统通知",
+    content: "是否重新计算该项目?",
     cancelText: "取消",
     okText: "确定",
     onOk: async () => {
-      await restartProject(selectedProject.id);
+      await restartProject(p.id);
       await search();
-      showRestartModalVisible = false;
       void message.success({ content: "操作成功" });
     },
   });

+ 1 - 22
src/features/projectParamsManagement/ImportScoreLine.vue

@@ -8,12 +8,6 @@
     @ok="handleImport"
   >
     <a-form :labelCol="{ style: { width: '72px' } }">
-      <a-form-item label="下载模板">
-        <a-button :loading="downLoading" @click="downloadTpl">
-          <template #icon> <svg-icon name="download"></svg-icon> </template>
-          下载模板
-        </a-button>
-      </a-form-item>
       <a-form-item label="批量导出">
         <a-button :loading="exportLoading" @click="toExport">
           <template #icon> <svg-icon name="download"></svg-icon> </template>
@@ -46,7 +40,6 @@ import {
   exportProjectParams,
   importProjectParams,
 } from "@/api/projectParamsManagementPage";
-import { downloadFileURL } from "@/utils/utils";
 import { h } from "vue";
 import { message } from "ant-design-vue";
 import type { UploadProps } from "ant-design-vue";
@@ -104,7 +97,7 @@ async function handleImport() {
 /* download */
 const { loading: exportLoading, setLoading: setExportLoading } = useLoading();
 async function toExport() {
-  if (downLoading.value) return;
+  if (exportLoading.value) return;
   setExportLoading(true);
   let err = false;
   await exportProjectParams(props.projectId).catch(() => {
@@ -115,18 +108,4 @@ async function toExport() {
 
   message.success("导出成功!");
 }
-
-const { loading: downLoading, setLoading: setDownLoading } = useLoading();
-async function downloadTpl() {
-  if (downLoading.value) return;
-  setDownLoading(true);
-  let err = false;
-  await downloadFileURL("/api/ess/projectCourse/template").catch(() => {
-    err = true;
-  });
-  setDownLoading(false);
-  if (err) return;
-
-  message.success("下载成功!");
-}
 </script>

+ 1 - 1
src/features/report/ReportCompare.vue

@@ -361,7 +361,7 @@ function scoreChartOption() {
     {
       lineStyleColor: "rgba(141, 78, 218, 1)",
       areaStyleColor: "rgba(141, 78, 218, 0.1)",
-      symbol: "emptyPin",
+      symbol: "emptyRect",
     },
   ];
 

+ 1 - 5
src/features/userManagement/ModifyUser.vue

@@ -7,11 +7,7 @@
       :rules="rules"
     >
       <a-form-item v-if="store.isSuperAdmin" label="学校" name="rootOrgId">
-        <RootOrgSelect
-          v-model:value="formData.rootOrgId"
-          :disabled="isEdit"
-          selectFirst
-        />
+        <RootOrgSelect v-model:value="formData.rootOrgId" :disabled="isEdit" />
       </a-form-item>
       <a-form-item label="姓名" name="name">
         <a-input v-model:value="formData.name"></a-input>

+ 6 - 1
src/features/userManagement/UserManagement.vue

@@ -2,7 +2,12 @@
   <div>
     <div class="part-box">
       <a-space class="filter-line" :size="12">
-        <RootOrgSelect v-if="store.isSuperAdmin" v-model:value="rootOrgId" />
+        <RootOrgSelect
+          v-if="store.isSuperAdmin"
+          v-model:value="rootOrgId"
+          selectFirst
+          @first-selected="clickSearch"
+        />
         <a-input
           v-model:value="name"
           prefix="姓名"

+ 2 - 0
src/styles/base.less

@@ -81,6 +81,8 @@
       flex-grow: 2;
       box-shadow: none !important;
       position: relative;
+      width: auto;
+      overflow: hidden;
 
       &::before {
         content: "";

+ 6 - 0
src/styles/login.less

@@ -71,6 +71,12 @@
     left: 48px;
     bottom: 48px;
   }
+
+  a {
+    &:hover {
+      color: var(--color-primary);
+    }
+  }
 }
 .login-body {
   margin-left: 400px;

+ 1 - 0
vite.config.ts

@@ -12,6 +12,7 @@ const resolvePath = (...args) => {
 // const SERVER_URL = "http://192.168.10.108:7180";
 // const SERVER_URL = "http://192.168.10.138:13800";
 const SERVER_URL = "http://192.168.10.39:7100";
+// const SERVER_URL = "http://192.168.10.152:7100";
 // const SERVER_URL = "http://192.168.10.106:7100";
 
 // https://vitejs.dev/config/