刘洋 1 жил өмнө
parent
commit
84af0b4891

+ 2 - 2
src/api/my-workbenches.js

@@ -2,6 +2,6 @@ import { request } from '@/utils/request.js';
 
 export const getMyMessages = (data) =>
   request({
-    url: '/api/sys/message/countByTypes',
-    data,
+    url: '/api/sys/message/pageByTypes',
+    params: data,
   });

+ 12 - 0
src/config/constants.js

@@ -47,3 +47,15 @@ export const SERVICE_UNIT_STATUS = {
   FINISH: '已完结',
   CANCEL: '已作废',
 };
+
+export const MESSAGE_TYPE = {
+  BEFORE: '提前提醒',
+  AFTER: '延期提醒',
+  OFFICE_SOP: '教务处SOP',
+  CLOUD_MARK_SOP: '云阅卷SOP',
+  QUALITY: '质量问题提醒',
+  EXCEPTION_APPROVE: '异常审核提醒',
+  VIOLATION: '违规提醒',
+  SYSTEM_PLAN_CHANGE: '系统计划变更提醒',
+  SYSTEM: '系统公告',
+};

+ 43 - 42
src/router/asyncRoutes.js

@@ -36,46 +36,47 @@ export const routesNotMenu = [
   },
 ];
 
-// export const whiteMenuList = [
-//   {
-//     id: 100,
-//     title: '我的工作台',
-//     parentId: 0,
-//     url: '/my-workbenches',
-//     sort: 0,
-//     name: 'MyWorkbenches',
-//   },
-//   {
-//     id: 101,
-//     parentId: 100,
-//     url: '/my-workbenches/workbenches',
-//     title: '工作台',
-//     sort: 1,
-//     name: 'Workbenches',
-//   },
-//   {
-//     id: 102,
-//     parentId: 101,
-//     url: '/my-workbenches/workbenches/message-reminder',
-//     title: '消息提醒',
-//     sort: 2,
-//     name: 'MessageReminder',
-//   },
-//   {
-//     id: 103,
-//     parentId: 101,
-//     url: '/my-workbenches/workbenches/my-tasks',
-//     title: '待办任务',
-//     sort: 3,
-//     name: 'MyTasks',
-//   },
-//   {
-//     id: 104,
-//     parentId: 101,
-//     url: '/my-workbenches/workbenches/notice',
-//     title: '通知公告',
-//     sort: 4,
-//     name: 'Notice',
-//   },
-// ];
+//菜单的白名单,比如“我的工作台”,不依赖权限配置,只要登录,就能加入菜单
+export const whiteMenuList = [
+  {
+    id: '1000',
+    name: '我的工作台',
+    parentId: '-1',
+    url: 'workManage',
+    sort: 0,
+    type: 'MENU',
+  },
+  {
+    id: '1001',
+    parentId: '1000',
+    url: 'workChildManage',
+    name: '工作台',
+    sort: 1,
+    type: 'MENU',
+  },
+  {
+    id: '1002',
+    parentId: '1001',
+    url: 'message',
+    name: '消息提醒',
+    sort: 2,
+    type: 'MENU',
+  },
+  {
+    id: '1003',
+    parentId: '1001',
+    url: 'work',
+    name: '待办任务',
+    sort: 3,
+    type: 'MENU',
+  },
+  {
+    id: '1004',
+    parentId: '1001',
+    url: 'notice',
+    name: '通知公告',
+    sort: 4,
+    type: 'MENU',
+  },
+];
 export default asyncRoutes;

+ 3 - 3
src/store/modules/user.js

@@ -2,9 +2,10 @@ import { defineStore } from 'pinia';
 import { cloneDeep } from 'lodash';
 import { getMenus, logout, login } from '@/api/user';
 import router from '@/router/index';
-import asyncRoutes from '@/router/asyncRoutes';
+import asyncRoutes, { whiteMenuList } from '@/router/asyncRoutes';
 import { getTreeList, local, session, clear } from '@/utils/tool';
 import { routesNotMenu } from '@/router/asyncRoutes';
+
 // 路由扁平化
 const flatAsyncRoutes = (routes, breadcrumb = []) => {
   const res = [];
@@ -147,8 +148,7 @@ const useUserStore = defineStore('user', {
               router.push({ name: 'Login' });
               return;
             }
-            // let allMenus = [...whiteMenuList, ...(response.privileges || [])];
-            let allMenus = [...(response.privileges || [])];
+            let allMenus = [...whiteMenuList, ...(response.privileges || [])];
             this.setMenu(allMenus);
             this.setFinePermissionIds(allMenus);
             resolve(allMenus);

+ 4 - 4
src/style/reset.less

@@ -374,17 +374,17 @@ Ensure the default browser behavior of the `hidden` attribute.
 /*---滚动条默认显示样式--*/
 ::-webkit-scrollbar-thumb {
   background-color: #bbb;
-  border-radius: 4px;
+  border-radius: 3px;
 }
 /*---鼠标点击滚动条显示样式--*/
 ::-webkit-scrollbar-thumb:hover {
   background-color: #aaa;
-  border-radius: 4px;
+  border-radius: 3px;
 }
 /*---滚动条大小--*/
 ::-webkit-scrollbar {
-  width: 8px;
-  height: 8px;
+  width: 6px;
+  height: 6px;
 }
 
 /*---滚动框背景样式--*/

+ 9 - 0
src/style/tdesign-reset.less

@@ -54,3 +54,12 @@
     }
   }
 }
+
+.t-select {
+  &.t-select-input--multiple {
+    .t-input__prefix {
+      display: flex !important;
+      overflow: auto;
+    }
+  }
+}

+ 18 - 14
src/utils/request.js

@@ -75,9 +75,13 @@ function createService() {
       const err = (text) => {
         Message.error({
           content:
-            error.response && error.response.data && error.response.data.message
+            error?.config?.url +
+            ' ' +
+            (error.response &&
+            error.response.data &&
+            error.response.data.message
               ? error.response.data.message
-              : text,
+              : text),
         });
       };
       if (error.response) {
@@ -98,7 +102,7 @@ function createService() {
             err(`${error?.config?.url} 没有权限访问该资源`);
             break;
           default:
-            err('未知错误');
+            err(JSON.stringify(error?.response || '未知错误'));
         }
       } else {
         err('请求超时,服务器无响应!');
@@ -118,23 +122,23 @@ function createService() {
 function createRequest(service) {
   return function (config) {
     const env = import.meta.env;
+    let headers = {
+      'platform': 'WEB',
+      'deviceId': DEVICE_ID,
+      ...(config.headers || {}),
+      'Content-Type': get(
+        config,
+        'headers.Content-Type',
+        'application/json;charset=UTF-8'
+      ),
+    };
     const configDefault = {
-      headers: {
-        'platform': 'WEB',
-        'deviceId': DEVICE_ID,
-        // 'Authorization': `Bearer ${token}`,
-        'Content-Type': get(
-          config,
-          'headers.Content-Type',
-          'application/json;charset=UTF-8'
-        ),
-      },
       method: 'post',
       timeout: 380000,
       baseURL: env.VITE_HTTP_PROXY === 'Y' ? '' : env.VITE_APP_BASE_URL,
       data: {},
     };
-    const option = Object.assign(configDefault, config);
+    const option = Object.assign(configDefault, config, { headers: headers });
 
     return service(option);
   };

+ 3 - 3
src/views/login/index.vue

@@ -110,9 +110,9 @@ const userStore = useUserStore();
 
 const loginHandle = () => {
   form.value.validate().then(async (result) => {
-    const redirect = route.query.redirect;
-    // ? route.query.redirect
-    // : '/my-workbenches';
+    const redirect = route.query.redirect
+      ? route.query.redirect
+      : '/my-workbenches';
     if (result === true) {
       await userStore.login({
         loginName: formData.loginName,

+ 76 - 3
src/views/my-workbenches/workbenches/message-reminder/index.vue

@@ -1,12 +1,85 @@
 <template>
-  <div class="message-reminder">消息提醒</div>
+  <div class="message-reminder flex flex-col h-full">
+    <SearchForm :fields="fields" :params="params">
+      <template #service="{ item, params }">
+        <select-service-unit
+          v-model="params[item.prop]"
+          clearable
+        ></select-service-unit>
+      </template>
+    </SearchForm>
+    <div class="page-wrap flex-1">
+      <t-tabs v-model="status" class="m-t-20px">
+        <t-tab-panel value="0" label="全部">111</t-tab-panel>
+      </t-tabs>
+    </div>
+  </div>
 </template>
 
 <script setup name="MessageReminder">
+import { reactive, computed, ref } from 'vue';
 import useFetchTable from '@/hooks/useFetchTable';
 import { getMyMessages } from '@/api/my-workbenches';
-const { loading, pagination, tableData, fetchData, search } =
-  useFetchTable(getMyMessages);
+import { MESSAGE_TYPE } from '@/config/constants';
+import { dictToOptionList } from '@/utils/tool';
+const params = reactive({
+  types: [],
+  serviceId: '',
+  custom: '',
+});
+const transParams = computed(() => {
+  let types = params.types.join(',');
+  return { ...params, types };
+});
+const {
+  loading: loading1,
+  pagination: pagination1,
+  tableData: tableData1,
+  search: search1,
+} = useFetchTable(getMyMessages, {
+  params: transParams,
+});
+const fields = ref([
+  {
+    prop: 'types',
+    label: '消息类型',
+    type: 'multipleSelect',
+    labelWidth: 100,
+    colSpan: 8,
+    options: dictToOptionList(MESSAGE_TYPE),
+    attrs: {
+      clearable: true,
+    },
+  },
+  {
+    prop: 'serviceId',
+    label: '服务单元',
+    type: 'select',
+    labelWidth: 100,
+    colSpan: 5,
+    cell: 'service',
+  },
+  {
+    prop: 'custom',
+    label: '客户名称',
+    labelWidth: 100,
+    colSpan: 5,
+    cell: 'service',
+  },
+  {
+    type: 'buttons',
+    colSpan: 3,
+    children: [
+      {
+        type: 'button',
+        text: '查询',
+        onClick: () => {
+          search();
+        },
+      },
+    ],
+  },
+]);
 </script>
 
 <style></style>

+ 1 - 0
src/views/user/auth-manage/role-manage/add-role.vue

@@ -142,6 +142,7 @@ const getHasRoleIds = (data, arr = []) => {
 };
 const addHandler = () => {
   let checkIds = getHasRoleIds(treeFlatArr.value);
+  console.log('checkIds', checkIds, checkIds.length);
   addRole({
     name: formData.name,
     privilegeIds: checkIds,