Browse Source

科目管理

zhangjie 1 year ago
parent
commit
171f087d50

+ 2 - 1
src/App.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-config-provider :theme="theme">
+  <a-config-provider :theme="theme" :locale="zhCN">
     <router-view> </router-view>
     <a-spin
       v-if="spinning"
@@ -13,6 +13,7 @@
 </template>
 
 <script setup lang="ts">
+import zhCN from "ant-design-vue/es/locale/zh_CN";
 import { watch, watchEffect } from "vue";
 import { useMainStore } from "@/store";
 import { useTimers } from "./setups/useTimers";

+ 14 - 0
src/assets/svgs/course-manage.svg

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>icon-科目管理-off</title>
+    <g id="管理员" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="02.01-项目列表" transform="translate(-310, -20)">
+            <g id="编组-3" transform="translate(294, 12)">
+                <g id="icon-科目管理-off" transform="translate(16, 8)">
+                    <rect id="view-module-(Background)" opacity="0" x="0" y="0" width="16" height="16"></rect>
+                    <path d="M11,7.5 L11,8.5 L4,8.5 L4,7.5 L11,7.5 Z M4,10 L4,11 L10,11 L10,10 L4,10 Z M3,2 L13,2 C13.5522852,2 14,2.44771528 14,3 L14,13 C14,13.5522852 13.5522842,14 13,14 L3,14 C2.44771504,14 2,13.5522842 2,13 L2,3 C2,2.44771504 2.44771528,2 3,2 Z M13,3 L13,5 L3,5 L3,3 L13,3 Z M3,13 L13,13 L13,6 L3,6 L3,13 Z" id="view-module" fill="#262626"></path>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 0 - 14
src/assets/svgs/project-list.svg

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <title>icon-项目列表-off</title>
-    <g id="管理员" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-        <g id="03.01-科目管理" transform="translate(-190, -20)">
-            <g id="编组-3" transform="translate(174, 12)">
-                <g id="icon-项目列表-off" transform="translate(16, 8)">
-                    <rect id="wallet-(Background)" opacity="0" x="0" y="0" width="16" height="16"></rect>
-                    <path d="M13.5,4.5 C14.0522852,4.5 14.5,4.94771528 14.5,5.5 L14.5,12 C14.5,12.5522852 14.0522842,13 13.5,13 L2.5,13 C1.94771522,13 1.5,12.5522852 1.5,12 L1.5,3 C1.5,2.44771498 1.94771528,2 2.5,2 L10.5,2 C11.0522842,2 11.5,2.44771498 11.5,3 L11.5,4.5 L13.5,4.5 Z M2.5,3 L2.5,4.5 L10.5,4.5 L10.5,3 L2.5,3 Z M2.5,5.5 L2.5,12 L13.5,12 L13.5,5.5 L2.5,5.5 Z" id="wallet" fill="#262626"></path>
-                </g>
-            </g>
-        </g>
-    </g>
-</svg>

+ 6 - 6
src/assets/svgs/project-manage.svg

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <title>icon-科目管理-off</title>
+    <title>icon-项目列表-off</title>
     <g id="管理员" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-        <g id="02.01-项目列表" transform="translate(-310, -20)">
-            <g id="编组-3" transform="translate(294, 12)">
-                <g id="icon-科目管理-off" transform="translate(16, 8)">
-                    <rect id="view-module-(Background)" opacity="0" x="0" y="0" width="16" height="16"></rect>
-                    <path d="M11,7.5 L11,8.5 L4,8.5 L4,7.5 L11,7.5 Z M4,10 L4,11 L10,11 L10,10 L4,10 Z M3,2 L13,2 C13.5522852,2 14,2.44771528 14,3 L14,13 C14,13.5522852 13.5522842,14 13,14 L3,14 C2.44771504,14 2,13.5522842 2,13 L2,3 C2,2.44771504 2.44771528,2 3,2 Z M13,3 L13,5 L3,5 L3,3 L13,3 Z M3,13 L13,13 L13,6 L3,6 L3,13 Z" id="view-module" fill="#262626"></path>
+        <g id="03.01-科目管理" transform="translate(-190, -20)">
+            <g id="编组-3" transform="translate(174, 12)">
+                <g id="icon-项目列表-off" transform="translate(16, 8)">
+                    <rect id="wallet-(Background)" opacity="0" x="0" y="0" width="16" height="16"></rect>
+                    <path d="M13.5,4.5 C14.0522852,4.5 14.5,4.94771528 14.5,5.5 L14.5,12 C14.5,12.5522852 14.0522842,13 13.5,13 L2.5,13 C1.94771522,13 1.5,12.5522852 1.5,12 L1.5,3 C1.5,2.44771498 1.94771528,2 2.5,2 L10.5,2 C11.0522842,2 11.5,2.44771498 11.5,3 L11.5,4.5 L13.5,4.5 Z M2.5,3 L2.5,4.5 L10.5,4.5 L10.5,3 L2.5,3 Z M2.5,5.5 L2.5,12 L13.5,12 L13.5,5.5 L2.5,5.5 Z" id="wallet" fill="#262626"></path>
                 </g>
             </g>
         </g>

+ 2 - 2
src/components/CourseTypeSelect.vue

@@ -1,10 +1,10 @@
 <template>
   <a-select
-    placeholder="科目类型"
+    title="科目类型"
+    placeholder="请选择"
     allowClear
     :disabled="props.disabled"
     :value="valueStr"
-    style="width: 120px"
     @change="handleChange"
   >
     <a-select-option value="PUBLIC">公共科目</a-select-option>

+ 14 - 10
src/components/Layout.vue

@@ -20,16 +20,20 @@
           <svg-icon name="user" color="#BFBFBF"></svg-icon>
           <span>{{ store.userInfo.displayName }}</span>
         </div>
-        <a-button type="text" @click="toModifyPwd">
-          <template #icon>
-            <svg-icon name="password"></svg-icon>
-          </template>
-        </a-button>
-        <a-button type="text" @click="doLogout">
-          <template #icon>
-            <svg-icon name="logout"></svg-icon>
-          </template>
-        </a-button>
+        <a-tooltip title="修改密码">
+          <a-button type="text" @click="toModifyPwd">
+            <template #icon>
+              <svg-icon name="password"></svg-icon>
+            </template>
+          </a-button>
+        </a-tooltip>
+        <a-tooltip title="退出">
+          <a-button type="text" @click="doLogout">
+            <template #icon>
+              <svg-icon name="logout"></svg-icon>
+            </template>
+          </a-button>
+        </a-tooltip>
       </div>
     </div>
     <div class="home-body">

+ 7 - 7
src/constants/menu.ts

@@ -36,12 +36,12 @@ export const menuList = [
     url: "ProjectManagement",
     privileges: ["ORG_ADMIN", "ROOT_ORG_ADMIN", "COURSE_ADMIN"],
   },
-  {
-    name: "关联分析",
-    icon: "project-compare-manage",
-    url: "ProjectCompareManagement",
-    privileges: ["ORG_ADMIN", "ROOT_ORG_ADMIN", "COURSE_ADMIN"],
-  },
+  // {
+  //   name: "关联分析",
+  //   icon: "project-compare-manage",
+  //   url: "ProjectCompareManagement",
+  //   privileges: ["ORG_ADMIN", "ROOT_ORG_ADMIN", "COURSE_ADMIN"],
+  // },
 ];
 
 export const menuRelative = {
@@ -50,5 +50,5 @@ export const menuRelative = {
   UserManagement: ["UserManagement"],
   CourseManagement: ["CourseManagement"],
   ProjectManagement: ["ProjectManagement"],
-  ProjectCompareManagement: ["ProjectCompareManagement"],
+  // ProjectCompareManagement: ["ProjectCompareManagement"],
 };

+ 84 - 61
src/features/courseManagement/CourseManagement.vue

@@ -1,49 +1,68 @@
 <template>
   <div>
-    <div class="tw-bg-white tw-p-5 tw-rounded-xl tw-mb-5">
-      <RootOrgSelect v-if="store.isSuperAdmin" v-model:value="rootOrgId" />
-
-      <span class="tw-mr-4"></span>
-      <a-input
-        v-model:value="code"
-        style="width: 178px"
-        placeholder="科目代码"
-        allowClear
-      ></a-input>
-      <span class="tw-mr-4"></span>
-      <a-input
-        v-model:value="name"
-        class="tw-mr-4"
-        style="width: 178px"
-        placeholder="科目名称"
-        allowClear
-      ></a-input>
-
-      <span class="tw-mr-4"></span>
-      <CourseTypeSelect v-model:value="type" />
-      <span class="tw-mr-4"></span>
-      <StateSelect v-model:value="enable" />
-      <span class="tw-mr-4"></span>
-      <a-button class="query-btn" @click="clickSearch">查询</a-button>
+    <div class="part-box">
+      <a-space class="filter-line" :size="12">
+        <RootOrgSelect v-if="store.isSuperAdmin" v-model:value="rootOrgId" />
+        <a-input
+          v-model:value="code"
+          placeholder="请输入"
+          allowClear
+          prefix="科目代码"
+        ></a-input>
+        <a-input
+          v-model:value="name"
+          class="tw-mr-4"
+          placeholder="请输入"
+          prefix="科目名称"
+          allowClear
+        ></a-input>
+        <CourseTypeSelect v-model:value="type" />
+        <StateSelect v-model:value="enable" />
+        <a-button type="primary" @click="clickSearch">查询</a-button>
+      </a-space>
     </div>
 
-    <div
-      v-if="store.isGreaterThanEqualRootOrgAdmin"
-      class="tw-flex tw-gap-2 tw-my-4"
-    >
-      <a-button type="primary" @click="newCourse">新增</a-button>
-      <a-button @click="importModalVisible = true">批量导入</a-button>
-      <a-button @click="handleExport">批量导出</a-button>
-      <a-button @click="handleToggleCourses(true, selectIds)">
-        批量启用
-      </a-button>
-      <a-button @click="handleToggleCourses(false, selectIds)">
-        批量禁用
-      </a-button>
-    </div>
+    <div class="part-box">
+      <a-space
+        v-if="store.isGreaterThanEqualRootOrgAdmin"
+        class="part-action"
+        :size="6"
+      >
+        <a-button type="text" @click="newCourse">
+          <template #icon>
+            <svg-icon name="add"></svg-icon>
+          </template>
+          新增
+        </a-button>
+        <a-divider type="vertical" />
+        <a-button type="text" @click="importModalVisible = true">
+          <template #icon>
+            <svg-icon name="import"></svg-icon>
+          </template>
+          导入
+        </a-button>
+        <a-button type="text" @click="handleExport">
+          <template #icon>
+            <svg-icon name="export"></svg-icon>
+          </template>
+          导出
+        </a-button>
+        <a-button type="text" @click="handleToggleCourses(true, selectIds)">
+          <template #icon>
+            <svg-icon name="enable"></svg-icon>
+          </template>
+          启用
+        </a-button>
+        <a-button type="text" @click="handleToggleCourses(false, selectIds)">
+          <template #icon>
+            <svg-icon name="disable"></svg-icon>
+          </template>
+          禁用
+        </a-button>
+      </a-space>
 
-    <div class="tw-bg-white tw-p-5 tw-rounded-xl">
       <a-table
+        class="page-table"
         rowKey="id"
         :columns="columns"
         :scroll="{ x: 1500 }"
@@ -56,8 +75,10 @@
           pageSize: pageSize,
           current: pageNo,
           total: totalElements,
-          showTotal: () => ``,
-          onChange: (pageNoChanged, pageSizeChanged) => {
+          showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
             selectIds = [];
             pageNo = pageNoChanged;
             pageSize = pageSizeChanged;
@@ -71,7 +92,6 @@
             >
             {{ record.rootOrgName }}({{ record.rootOrgCode }})
           </a-tooltip>
-          <!-- <a>{{ record.rootOrgName }}({{ record.rootOrgCode }})</a> -->
         </template>
         <template #name="{ record }">
           <a-tooltip placement="topLeft">
@@ -80,18 +100,22 @@
           </a-tooltip>
         </template>
         <template #type="{ text }">
-          <a>{{ $filters.courseTypeFilter(text) }}</a>
+          <span>{{ $filters.courseTypeFilter(text) }}</span>
         </template>
         <template #enable="{ text }">
-          <a>{{ $filters.booleanEnableDisableFilter(text) }}</a>
+          <status-tag :value="text" type="enable"></status-tag>
         </template>
         <template #action="{ record }">
-          <span v-if="store.isGreaterThanEqualRootOrgAdmin">
-            <a-button @click="showModal(record)">编辑</a-button>
-            <a-button @click="handleToggleCourses(!record.enable, [record.id])">
+          <div v-if="store.isGreaterThanEqualRootOrgAdmin" class="action-cell">
+            <a-button type="text" @click="showModal(record)">编辑</a-button>
+            <a-button
+              type="text"
+              :danger="record.enable"
+              @click="handleToggleCourses(!record.enable, [record.id])"
+            >
               {{ record.enable ? "禁用" : "启用" }}
             </a-button>
-          </span>
+          </div>
         </template>
       </a-table>
     </div>
@@ -101,6 +125,7 @@
       title="科目信息页"
       okText="确定"
       cancelText="取消"
+      :width="438"
       @ok="handleOk"
     >
       <a-form :labelCol="{ span: 4 }">
@@ -136,14 +161,12 @@
       title="批量科目导入"
       okText="确定"
       cancelText="取消"
+      :width="438"
       @ok="handleImport"
     >
       <a-form>
-        <a-form-item label="学校">
-          <RootOrgSelect
-            v-show="store.isSuperAdmin"
-            v-model:value="courseObj.rootOrgId"
-          />
+        <a-form-item v-if="store.isSuperAdmin" label="学校">
+          <RootOrgSelect v-model:value="courseObj.rootOrgId" />
         </a-form-item>
         <a-form-item label="文件地址">
           <input id="file-input" :multiple="false" type="file" />
@@ -218,20 +241,20 @@ const columns = [
   {
     title: "学校",
     dataIndex: "rootOrgName",
-    width: 200,
+    minWidth: 200,
     slots: { customRender: "rootOrgName" },
     ellipses: true,
   },
   {
     title: "科目代码",
     dataIndex: "code",
-    width: 100,
+    width: 120,
   },
   {
     title: "科目名称",
     dataIndex: "name",
     slots: { customRender: "name" },
-    width: 180,
+    minWidth: 120,
   },
   {
     title: "科目类型",
@@ -243,7 +266,7 @@ const columns = [
     title: "状态",
     dataIndex: "enable",
     slots: { customRender: "enable" },
-    width: 60,
+    width: 120,
   },
   {
     title: "创建时间",
@@ -253,7 +276,7 @@ const columns = [
   {
     title: "创建人",
     dataIndex: "creator",
-    width: 90,
+    minWidth: 120,
   },
   {
     title: "更新时间",
@@ -263,14 +286,14 @@ const columns = [
   {
     title: "更新人",
     dataIndex: "updater",
-    width: 90,
+    minWidth: 120,
   },
   {
     title: "操作",
     key: "action",
     slots: { customRender: "action" },
     fixed: "right",
-    width: 180,
+    width: 120,
   },
 ];
 

+ 4 - 2
src/features/projectCompareManagement/ProjectCompareManagement.vue

@@ -31,8 +31,10 @@
           pageSize: pageSize,
           current: pageNo,
           total: totalElements,
-          showTotal: () => ``,
-          onChange: (pageNoChanged, pageSizeChanged) => {
+          showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
             pageNo = pageNoChanged;
             pageSize = pageSizeChanged;
           },

+ 4 - 2
src/features/projectManagement/ProjectManagement.vue

@@ -37,8 +37,10 @@
           pageSize: pageSize,
           current: pageNo,
           total: totalElements,
-          showTotal: () => ``,
-          onChange: (pageNoChanged, pageSizeChanged) => {
+          showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
             selectIds = [];
             pageNo = pageNoChanged;
             pageSize = pageSizeChanged;

+ 4 - 2
src/features/projectPapersManagement/ProjectPapersManagement.vue

@@ -26,8 +26,10 @@
           pageSize: pageSize,
           current: pageNo,
           total: totalElements,
-          showTotal: () => ``,
-          onChange: (pageNoChanged, pageSizeChanged) => {
+          showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
             pageNo = pageNoChanged;
             pageSize = pageSizeChanged;
           },

+ 4 - 2
src/features/projectParamsManagement/ProjectParamsManagement.vue

@@ -21,8 +21,10 @@
           pageSize: pageSize,
           current: pageNo,
           total: totalElements,
-          showTotal: () => ``,
-          onChange: (pageNoChanged, pageSizeChanged) => {
+          showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
             pageNo = pageNoChanged;
             pageSize = pageSizeChanged;
           },

+ 4 - 2
src/features/subOrg/SubOrg.vue

@@ -48,8 +48,10 @@
           pageSize: pageSize,
           current: pageNo,
           total: totalElements,
-          showTotal: () => ``,
-          onChange: (pageNoChanged, pageSizeChanged) => {
+          showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
             selectIds = [];
             pageNo = pageNoChanged;
             pageSize = pageSizeChanged;

+ 4 - 2
src/features/taskManagement/TaskManagement.vue

@@ -14,8 +14,10 @@
           pageSize: pageSize,
           current: pageNo,
           total: totalElements,
-          showTotal: () => ``,
-          onChange: (pageNoChanged, pageSizeChanged) => {
+          showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
             pageNo = pageNoChanged;
             pageSize = pageSizeChanged;
           },

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

@@ -77,7 +77,9 @@
           pageSize: pageSize,
           current: pageNo,
           total: totalElements,
-          showTotal: () => ``,
+          showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
           onChange: (pageNoChanged:number, pageSizeChanged:number) => {
             selectIds = [];
             pageNo = pageNoChanged;

+ 8 - 4
src/features/userManagement/UserPrivilegeCourse.vue

@@ -21,8 +21,10 @@
           pageSize: pageSize,
           current: pageNo,
           total: totalElements,
-          showTotal: () => ``,
-          onChange: (pageNoChanged, pageSizeChanged) => {
+          showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
             selectIds = [];
             pageNo = pageNoChanged;
             pageSize = pageSizeChanged;
@@ -65,8 +67,10 @@
             pageSize: pageSize2,
             current: pageNo2,
             total: totalElements2,
-            showTotal: () => ``,
-            onChange: (pageNoChanged, pageSizeChanged) => {
+            showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
               selectIds2 = [];
               pageNo2 = pageNoChanged;
               pageSize2 = pageSizeChanged;

+ 8 - 4
src/features/userManagement/UserPrivilegeOrg.vue

@@ -21,8 +21,10 @@
           pageSize: pageSize,
           current: pageNo,
           total: totalElements,
-          showTotal: () => ``,
-          onChange: (pageNoChanged, pageSizeChanged) => {
+          showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
             selectIds = [];
             pageNo = pageNoChanged;
             pageSize = pageSizeChanged;
@@ -65,8 +67,10 @@
             pageSize: pageSize2,
             current: pageNo2,
             total: totalElements2,
-            showTotal: () => ``,
-            onChange: (pageNoChanged, pageSizeChanged) => {
+            showQuickJumper:true,
+          showSizeChanger:true,
+          showTotal: (total:number) => `共 ${total} 项数据`,
+          onChange: (pageNoChanged:number, pageSizeChanged:number) => {
               selectIds2 = [];
               pageNo2 = pageNoChanged;
               pageSize2 = pageSizeChanged;

+ 25 - 0
src/styles/ant-custom.less

@@ -86,3 +86,28 @@
     }
   }
 }
+
+// .ant-pagination
+.ant-pagination {
+  .ant-pagination-item,
+  .ant-pagination-prev .ant-pagination-item-link,
+  .ant-pagination-next .ant-pagination-item-link {
+    border-color: var(--color-border);
+  }
+  .ant-pagination-item-active {
+    background-color: var(--color-primary);
+    a {
+      color: #fff !important;
+    }
+  }
+}
+
+.ant-pagination {
+  &.ant-table-pagination-right {
+    justify-content: space-between;
+
+    .ant-pagination-total-text {
+      flex-grow: 2;
+    }
+  }
+}

+ 1 - 1
src/styles/base.less

@@ -47,7 +47,7 @@
 .filter-line {
   .ant-input-affix-wrapper,
   .ant-select {
-    width: 180px;
+    width: 200px;
   }
 
   .ant-input-affix-wrapper {