瀏覽代碼

框架完善

sunxuewei 2 年之前
父節點
當前提交
78dc1e089c

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
1 1
 # 若依管理系统/开发环境
2
-VUE_APP_BASE_URL = 'http://172.16.6.124:9098'
2
+VUE_APP_BASE_URL = 'http://172.16.6.217:9999'
3 3
 
4 4
 # 页面标题
5 5
 VUE_APP_TITLE = "应急物资系统"

+ 1 - 1
.env.production

@@ -1,5 +1,5 @@
1 1
 # 应急物资系统/生产环境
2
-VUE_APP_BASE_URL = '/api'
2
+VUE_APP_BASE_URL = ''
3 3
 
4 4
 # 页面标题
5 5
 VUE_APP_TITLE = 应急物资系统

+ 1 - 0
.gitignore

@@ -1,6 +1,7 @@
1 1
 .DS_Store
2 2
 node_modules
3 3
 /dist
4
+/dist.zip
4 5
 
5 6
 
6 7
 # local env files

+ 13 - 4
src/api/admin/index.ts

@@ -1,5 +1,15 @@
1 1
 import request from "@/api";
2 2
 
3
+// 获取系统菜单
4
+export function getMenu(id: string) {
5
+  return request({
6
+    url: "/admin/menu",
7
+    params: { parentId: id },
8
+    method: "get"
9
+  });
10
+}
11
+
12
+// 权限管理 —— 菜单管理 —— 获取列表
3 13
 export function fetchMenuTree(params: { menuName?: string }) {
4 14
   return request({
5 15
     url: "/admin/menu/tree",
@@ -8,11 +18,10 @@ export function fetchMenuTree(params: { menuName?: string }) {
8 18
   });
9 19
 }
10 20
 
11
-// 获取系统菜单
12
-export function getMenu(id: string) {
21
+// 权限管理 —— 菜单管理 —— 获取菜单详情
22
+export function getObj(id: string) {
13 23
   return request({
14
-    url: "/admin/menu",
15
-    params: { parentId: id },
24
+    url: "/admin/menu/" + id,
16 25
     method: "get"
17 26
   });
18 27
 }

+ 0 - 1
src/api/dataStatistics/index.ts

@@ -1,6 +1,5 @@
1 1
 import request from "@/api";
2 2
 
3
-/** 中央抗旱物资数量价值表 **/
4 3
 // 获取表头数据
5 4
 export function getDroughtResistantHeader(data: any) {
6 5
   return request({

+ 17 - 15
src/api/index.ts

@@ -28,11 +28,12 @@
28 28
 //   }
29 29
 // });
30 30
 
31
+import qs from "qs";
31 32
 import axios from "axios";
32 33
 import cache from "@/utils/cache";
33 34
 import errorCode from "@/utils/errorCode";
34
-import { getToken } from "@/utils/auth";
35
-import { tansParams } from "@/utils/util";
35
+import store from "@/store";
36
+import { serialize } from "@/utils/util";
36 37
 import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
37 38
 
38 39
 // 是否显示重新登录
@@ -41,12 +42,9 @@ export const isRelogin = { show: false };
41 42
 // 创建axios实例
42 43
 const request = axios.create({
43 44
   // axios中请求配置有baseURL选项,表示请求URL公共部分
44
-  baseURL: process.env.VUE_APP_BASE_URL,
45
+  // baseURL: process.env.VUE_APP_BASE_URL,
45 46
   // 超时
46
-  timeout: 10000,
47
-  headers: {
48
-    "Content-Type": "application/json;charset=utf-8"
49
-  }
47
+  timeout: 10000
50 48
 });
51 49
 
52 50
 // request拦截器
@@ -56,15 +54,19 @@ request.interceptors.request.use(
56 54
     const isToken = (config.headers || {}).isToken === false;
57 55
     // 是否需要防止数据重复提交
58 56
     const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
59
-    if (getToken() && !isToken && config.headers) {
60
-      config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
57
+    const token = store.getters.access_token;
58
+    if (token && !isToken && config.headers) {
59
+      config.headers["Authorization"] = "Bearer " + token; // token
60
+    }
61
+    if (config.method === "get") {
62
+      config.paramsSerializer = function (params) {
63
+        return qs.stringify(params, { arrayFormat: "repeat" });
64
+      };
61 65
     }
62
-    // get请求映射params参数
63
-    if (config.method === "get" && config.params) {
64
-      let url = config.url + "?" + tansParams(config.params);
65
-      url = url.slice(0, -1);
66
-      config.params = {};
67
-      config.url = url;
66
+    // headers中配置serialize为true开启序列化
67
+    if (config.method === "post" && config.headers.serialize) {
68
+      config.data = serialize(config.data);
69
+      delete config.data.serialize;
68 70
     }
69 71
     if (!isRepeatSubmit && (config.method === "post" || config.method === "put")) {
70 72
       const requestObj = {

+ 7 - 5
src/api/login/index.ts

@@ -6,12 +6,14 @@ import website from "@/const/website";
6 6
 
7 7
 const scope = "server";
8 8
 // 根据用户名密码登录
9
-// export const loginByUsername = ({ username, password, code, randomStr }: ILogin) => {
10
-export const loginByUsername = ({ username, password, randomStr }: ILogin) => {
9
+export const loginByUsername = ({ username, password, code, randomStr }: ILogin) => {
10
+  // export const loginByUsername = ({ username, password, randomStr }: ILogin) => {
11 11
   const grant_type = "password";
12 12
   const dataObj = qs.stringify({ username: username, password: password });
13
+  // const dataObj = new FormData();
14
+  // dataObj.append("username", username);
15
+  // dataObj.append("password", password);
13 16
   const basicAuth = "Basic " + window.btoa(website.formLoginClient);
14
-
15 17
   // 保存当前选中的 basic 认证信息
16 18
   cache.local.set("basicAuth", basicAuth);
17 19
   return request({
@@ -22,8 +24,8 @@ export const loginByUsername = ({ username, password, randomStr }: ILogin) => {
22 24
       Authorization: basicAuth
23 25
     },
24 26
     method: "post",
25
-    // params: { randomStr, code, grant_type, scope },
26
-    params: { randomStr, grant_type, scope },
27
+    params: { randomStr, code, grant_type, scope },
28
+    // params: { randomStr, grant_type, scope },
27 29
     data: dataObj
28 30
   });
29 31
 };

+ 1 - 1
src/const/interface_type.ts

@@ -2,7 +2,7 @@
2 2
 export interface ILogin {
3 3
   username: string;
4 4
   password: string;
5
-  // code: string;
5
+  code: string;
6 6
   randomStr: string;
7 7
 }
8 8
 

+ 2 - 2
src/const/website.ts

@@ -17,8 +17,8 @@ export default {
17 17
   whiteList: ["/login", "/404", "/401", "/lock"], // 配置无权限可以访问的页面
18 18
   whiteTagList: ["/login", "/404", "/401", "/lock"], // 配置不添加tags页面 ('/advanced-router/mutative-detail/*'——*为通配符)
19 19
   fistPage: {
20
-    label: "首页",
21
-    value: "/wel/index",
20
+    label: "出库信息填报",
21
+    value: "/InformationFilling/outWarehouseInfo",
22 22
     params: {},
23 23
     query: {},
24 24
     group: [],

+ 54 - 44
src/layout/components/sidebar/sidebar.vue

@@ -26,53 +26,63 @@
26 26
 import { reactive } from "vue";
27 27
 import { useRouter } from "vue-router";
28 28
 const menuList = reactive([
29
+  // {
30
+  //   path: "InformationFilling",
31
+  //   name: "信息填报",
32
+  //   children: [
33
+  //     {
34
+  //       path: "outWarehouseInfo",
35
+  //       name: "出库信息填报"
36
+  //     },
37
+  //     {
38
+  //       path: "enterWarehouseInfo",
39
+  //       name: "入库信息填报"
40
+  //     }
41
+  //   ]
42
+  // },
43
+  // {
44
+  //   path: "InformationAudit",
45
+  //   name: "信息审核",
46
+  //   children: [
47
+  //     {
48
+  //       path: "outWarehouseAudit",
49
+  //       name: "出库信息审核"
50
+  //     },
51
+  //     {
52
+  //       path: "enterWarehouseAudit",
53
+  //       name: "入库信息审核"
54
+  //     }
55
+  //   ]
56
+  // },
57
+  // {
58
+  //   path: "dataStatistics",
59
+  //   name: "数据统计",
60
+  //   children: [
61
+  //     {
62
+  //       path: "reliefMaterial",
63
+  //       name: "救灾物资数量价值表"
64
+  //     },
65
+  //     {
66
+  //       path: "floodPrevention",
67
+  //       name: "防汛物资储备价值表"
68
+  //     },
69
+  //     {
70
+  //       path: "droughtResistant",
71
+  //       name: "抗旱物资储备价值表"
72
+  //     },
73
+  //     {
74
+  //       path: "emergencySupplies",
75
+  //       name: "应急物资分类表"
76
+  //     }
77
+  //   ]
78
+  // }
29 79
   {
30
-    path: "InformationFilling",
31
-    name: "信息填报",
80
+    path: "admin",
81
+    name: "权限管理",
32 82
     children: [
33 83
       {
34
-        path: "outWarehouseInfo",
35
-        name: "出库信息填报"
36
-      },
37
-      {
38
-        path: "enterWarehouseInfo",
39
-        name: "入库信息填报"
40
-      }
41
-    ]
42
-  },
43
-  {
44
-    path: "InformationAudit",
45
-    name: "信息审核",
46
-    children: [
47
-      {
48
-        path: "outWarehouseAudit",
49
-        name: "出库信息审核"
50
-      },
51
-      {
52
-        path: "enterWarehouseAudit",
53
-        name: "入库信息审核"
54
-      }
55
-    ]
56
-  },
57
-  {
58
-    path: "dataStatistics",
59
-    name: "数据统计",
60
-    children: [
61
-      {
62
-        path: "reliefMaterial",
63
-        name: "救灾物资数量价值表"
64
-      },
65
-      {
66
-        path: "floodPrevention",
67
-        name: "防汛物资储备价值表"
68
-      },
69
-      {
70
-        path: "droughtResistant",
71
-        name: "抗旱物资储备价值表"
72
-      },
73
-      {
74
-        path: "emergencySupplies",
75
-        name: "应急物资分类表"
84
+        path: "menu",
85
+        name: "菜单管理"
76 86
       }
77 87
     ]
78 88
   }

+ 12 - 11
src/layout/components/topBar.vue

@@ -3,20 +3,17 @@
3 3
     <div class="topbar_title">
4 4
       <img src="~@/assets/img/top_title.png" />
5 5
     </div>
6
-    <div class="topbar_search">
7
-      <el-input placeholder="查询" v-model="topSearch" :suffix-icon="Search" clearable />
8
-    </div>
9
-    <div class="topbar_help">
6
+    <!-- <div class="topbar_help">
10 7
       <el-icon color="#767DEA"><QuestionFilled /></el-icon>
11 8
       帮助
12
-    </div>
9
+    </div> -->
13 10
     <div class="topbar_user">
14 11
       <el-dropdown @command="handleCommand" trigger="hover">
15 12
         <div class="avatar-wrapper">
16 13
           <div class="user_avatar">
17 14
             <el-icon><UserFilled /></el-icon>
18 15
           </div>
19
-          <span>{{ userId }}</span>
16
+          <span>{{ userInfo }}</span>
20 17
           <el-icon><ArrowDown /></el-icon>
21 18
         </div>
22 19
         <template #dropdown>
@@ -33,15 +30,19 @@
33 30
 
34 31
 <script setup lang="ts">
35 32
 import { ref } from "vue";
33
+import { useStore } from "vuex";
36 34
 import { useRouter } from "vue-router";
37 35
 import { ElMessageBox, ElMessage } from "element-plus";
38
-import { Search, QuestionFilled, UserFilled, ArrowDown } from "@element-plus/icons-vue";
39
-
40
-import cache from "@/utils/cache";
36
+import { QuestionFilled, UserFilled, ArrowDown } from "@element-plus/icons-vue";
41 37
 
42
-const userId = cache.session.get("userId");
43
-const topSearch = ref("");
44 38
 const router = useRouter();
39
+const store = useStore();
40
+const userInfo = ref("");
41
+
42
+store.dispatch("GetUserInfo").then((res: any) => {
43
+  userInfo.value = res;
44
+});
45
+
45 46
 const handleCommand = () => {
46 47
   ElMessageBox.confirm("即将退出登录,是否确定?", "提示", {
47 48
     confirmButtonText: "确定",

+ 2 - 0
src/main.ts

@@ -9,6 +9,8 @@ import ElementPlus from "element-plus";
9 9
 import "element-plus/dist/index.css";
10 10
 import zhCn from "element-plus/es/locale/lang/zh-cn";
11 11
 
12
+import "./permission";
13
+
12 14
 import basicContainer from "./components/basic-container/main.vue";
13 15
 import Pagination from "./components/Pagination/index.vue";
14 16
 

+ 15 - 5
src/permission.ts

@@ -2,21 +2,22 @@
2 2
 import router from "./router";
3 3
 import store from "./store";
4 4
 import { validatenull } from "@/utils/validate";
5
+import { ElMessage } from "element-plus";
5 6
 import NProgress from "nprogress"; // progress bar
6 7
 import "nprogress/nprogress.css"; // progress bar style
7 8
 
8 9
 NProgress.configure({ showSpinner: false });
9 10
 
10
-router.beforeEach((to, from) => {
11
+router.beforeEach((to, from, next) => {
11 12
   NProgress.start();
12
-  const meta = to.meta || {};
13 13
   if (store.getters.access_token) {
14
+    const meta = to.meta || {};
14 15
     if (to.path === "/login") {
15
-      return "/";
16
+      console.log(store.getters.tagWel.value);
17
+      next({ path: "/" });
16 18
     } else {
17 19
       const value = to.query.src || to.fullPath;
18 20
       const label = to.query.name || to.name;
19
-
20 21
       if (meta.isTab !== false && !validatenull(value) && !validatenull(label)) {
21 22
         store.commit("ADD_TAG", {
22 23
           label: label,
@@ -25,9 +26,18 @@ router.beforeEach((to, from) => {
25 26
           query: to.query
26 27
         });
27 28
       }
29
+      next();
28 30
     }
29 31
   } else {
30
-    return "/login";
32
+    if (to.path === "/login") {
33
+      next();
34
+    } else {
35
+      if (to.path !== "/") {
36
+        ElMessage.warning("请先登录后再访问其他页面!");
37
+      }
38
+      next(`/login`); // 否则全部重定向到登录页
39
+    }
40
+    NProgress.done();
31 41
   }
32 42
 });
33 43
 

+ 82 - 81
src/router/index.ts

@@ -4,98 +4,99 @@ const layout = () => import("@/layout/index.vue");
4 4
 const routes: Array<RouteRecordRaw> = [
5 5
   {
6 6
     path: "/",
7
-    redirect: "/login"
7
+    name: "主页",
8
+    redirect: "/admin"
8 9
   },
9 10
   {
10 11
     path: "/login",
11
-    name: "login",
12
+    name: "登录",
12 13
     component: () => import("@/views/login/index.vue")
13 14
   },
14
-  {
15
-    path: "/InformationFilling",
16
-    name: "InformationFilling",
17
-    redirect: "/InformationFilling/outWarehouseInfo",
18
-    component: layout,
19
-    children: [
20
-      {
21
-        path: "outWarehouseInfo",
22
-        name: "outWarehouseInfo",
23
-        component: () => import("@/views/InformationFilling/outWarehouseInfo/index.vue")
24
-      },
25
-      {
26
-        path: "enterWarehouseInfo",
27
-        name: "enterWarehouseInfo",
28
-        component: () => import("@/views/InformationFilling/enterWarehouseInfo/index.vue")
29
-      },
30
-      {
31
-        path: "enterWarehouseInfoDetail",
32
-        name: "enterWarehouseInfoDetail",
33
-        component: () => import("@/views/InformationFilling/enterWarehouseInfo/detail.vue")
34
-      }
35
-    ]
36
-  },
37
-  {
38
-    path: "/InformationAudit",
39
-    name: "InformationAudit",
40
-    component: layout,
41
-    children: [
42
-      {
43
-        path: "outWarehouseAudit",
44
-        name: "outWarehouseAudit",
45
-        component: () => import("@/views/InformationAudit/outWarehouseAudit/index.vue")
46
-      },
47
-      {
48
-        path: "outWarehouseAuditDetail",
49
-        name: "outWarehouseAuditDetail",
50
-        component: () => import("@/views/InformationAudit/outWarehouseAudit/detail.vue")
51
-      },
52
-      {
53
-        path: "enterWarehouseAudit",
54
-        name: "enterWarehouseAudit",
55
-        component: () => import("@/views/InformationAudit/enterWarehouseAudit/index.vue")
56
-      },
57
-      {
58
-        path: "enterWarehouseAuditDetail",
59
-        name: "enterWarehouseAuditDetail",
60
-        component: () => import("@/views/InformationAudit/enterWarehouseAudit/detail.vue")
61
-      },
62
-    ]
63
-  },
64
-  {
65
-    path: "/dataStatistics",
66
-    name: "dataStatistics",
67
-    component: layout,
68
-    children: [
69
-      {
70
-        path: "reliefMaterial",
71
-        name: "reliefMaterial",
72
-        component: () => import("@/views/dataStatistics/reliefMaterial/index.vue")
73
-      },
74
-      {
75
-        path: "floodPrevention",
76
-        name: "floodPrevention",
77
-        component: () => import("@/views/dataStatistics/floodPrevention/index.vue")
78
-      },
79
-      {
80
-        path: "droughtResistant",
81
-        name: "droughtResistant",
82
-        component: () => import("@/views/dataStatistics/droughtResistant/index.vue")
83
-      },
84
-      {
85
-        path: "emergencySupplies",
86
-        name: "emergencySupplies",
87
-        component: () => import("@/views/dataStatistics/emergencySupplies/index.vue")
88
-      }
89
-    ]
90
-  },
15
+  // {
16
+  //   path: "/InformationFilling",
17
+  //   name: "InformationFilling",
18
+  //   redirect: "/InformationFilling/outWarehouseInfo",
19
+  //   component: layout,
20
+  //   children: [
21
+  //     {
22
+  //       path: "outWarehouseInfo",
23
+  //       name: "outWarehouseInfo",
24
+  //       component: () => import("@/views/InformationFilling/outWarehouseInfo/index.vue")
25
+  //     },
26
+  //     {
27
+  //       path: "enterWarehouseInfo",
28
+  //       name: "enterWarehouseInfo",
29
+  //       component: () => import("@/views/InformationFilling/enterWarehouseInfo/index.vue")
30
+  //     },
31
+  //     {
32
+  //       path: "enterWarehouseInfoDetail",
33
+  //       name: "enterWarehouseInfoDetail",
34
+  //       component: () => import("@/views/InformationFilling/enterWarehouseInfo/detail.vue")
35
+  //     }
36
+  //   ]
37
+  // },
38
+  // {
39
+  //   path: "/InformationAudit",
40
+  //   name: "InformationAudit",
41
+  //   component: layout,
42
+  //   children: [
43
+  //     {
44
+  //       path: "outWarehouseAudit",
45
+  //       name: "outWarehouseAudit",
46
+  //       component: () => import("@/views/InformationAudit/outWarehouseAudit/index.vue")
47
+  //     },
48
+  //     {
49
+  //       path: "outWarehouseAuditDetail",
50
+  //       name: "outWarehouseAuditDetail",
51
+  //       component: () => import("@/views/InformationAudit/outWarehouseAudit/detail.vue")
52
+  //     },
53
+  //     {
54
+  //       path: "enterWarehouseAudit",
55
+  //       name: "enterWarehouseAudit",
56
+  //       component: () => import("@/views/InformationAudit/enterWarehouseAudit/index.vue")
57
+  //     },
58
+  //     {
59
+  //       path: "enterWarehouseAuditDetail",
60
+  //       name: "enterWarehouseAuditDetail",
61
+  //       component: () => import("@/views/InformationAudit/enterWarehouseAudit/detail.vue")
62
+  //     }
63
+  //   ]
64
+  // },
65
+  // {
66
+  //   path: "/dataStatistics",
67
+  //   name: "dataStatistics",
68
+  //   component: layout,
69
+  //   children: [
70
+  //     {
71
+  //       path: "reliefMaterial",
72
+  //       name: "reliefMaterial",
73
+  //       component: () => import("@/views/dataStatistics/reliefMaterial/index.vue")
74
+  //     },
75
+  //     {
76
+  //       path: "floodPrevention",
77
+  //       name: "floodPrevention",
78
+  //       component: () => import("@/views/dataStatistics/floodPrevention/index.vue")
79
+  //     },
80
+  //     {
81
+  //       path: "droughtResistant",
82
+  //       name: "droughtResistant",
83
+  //       component: () => import("@/views/dataStatistics/droughtResistant/index.vue")
84
+  //     },
85
+  //     {
86
+  //       path: "emergencySupplies",
87
+  //       name: "emergencySupplies",
88
+  //       component: () => import("@/views/dataStatistics/emergencySupplies/index.vue")
89
+  //     }
90
+  //   ]
91
+  // },
91 92
   {
92 93
     path: "/admin",
93
-    name: "admin",
94
+    name: "权限管理",
94 95
     component: layout,
95 96
     children: [
96 97
       {
97 98
         path: "menu",
98
-        name: "menu",
99
+        name: "菜单管理",
99 100
         component: () => import("@/views/admin/menu/index.vue")
100 101
       }
101 102
     ]

+ 2 - 1
src/store/getters.ts

@@ -1,4 +1,5 @@
1 1
 export default {
2 2
   access_token: (state: any) => state.user.access_token,
3
-  refresh_token: (state: any) => state.user.refresh_token
3
+  refresh_token: (state: any) => state.user.refresh_token,
4
+  tagWel: (state: any) => state.tag.tagWel
4 5
 };

+ 4 - 4
src/store/modules/tag.ts

@@ -30,18 +30,18 @@ function setFistTag(list: ITagType[]) {
30 30
 }
31 31
 export default {
32 32
   state: () => ({
33
-    tagList: cache.session.get("tagList") || [],
34
-    tag: cache.session.get("tag") || tagObj,
33
+    tagList: cache.session.getJSON("tagList") || [],
34
+    tag: cache.session.getJSON("tag") || tagObj,
35 35
     tagWel: tagWel
36 36
   }),
37 37
   mutations: {
38 38
     ADD_TAG: (state: any, action: ITagType) => {
39 39
       state.tag = action;
40
-      cache.session.set("tag", state.tag);
40
+      cache.session.setJSON("tag", state.tag);
41 41
       if (state.tagList.some((ele: any) => diff(ele, action))) return;
42 42
       state.tagList.push(action);
43 43
       setFistTag(state.tagList);
44
-      cache.session.set("tagList", state.tagList);
44
+      cache.session.setJSON("tagList", state.tagList);
45 45
     },
46 46
     DEL_TAG: (state: any, action: ITagType) => {
47 47
       state.tagList = state.tagList.filter((item: ITagType) => {

+ 8 - 9
src/store/modules/user.ts

@@ -40,10 +40,10 @@ export default {
40 40
   } => ({
41 41
     access_token: cache.session.get("access_token") || "",
42 42
     refresh_token: cache.session.get("refresh_token") || "",
43
-    userInfo: cache.session.get("userInfo") || {},
43
+    userInfo: cache.session.getJSON("userInfo") || {},
44 44
     roles: [],
45 45
 
46
-    permissions: cache.session.get("permissions") || {}
46
+    permissions: cache.session.getJSON("permissions") || {}
47 47
   }),
48 48
   mutations: {
49 49
     SET_ACCESS_TOKEN: (state: any, access_token: string) => {
@@ -57,7 +57,7 @@ export default {
57 57
     },
58 58
     SET_USER_INFO: (state: any, userInfo: any) => {
59 59
       state.userInfo = userInfo;
60
-      cache.session.set("userInfo", state.userInfo);
60
+      cache.session.setJSON("userInfo", state.userInfo);
61 61
     },
62 62
     SET_ROLES: (state: any, roles: string[]) => {
63 63
       state.roles = roles;
@@ -68,7 +68,7 @@ export default {
68 68
         list[permissions[i]] = true;
69 69
       }
70 70
       state.permissions = list;
71
-      cache.session.set("permissions", state.permissions);
71
+      cache.session.setJSON("permissions", state.permissions);
72 72
     }
73 73
   },
74 74
   actions: {
@@ -87,10 +87,9 @@ export default {
87 87
       return new Promise((resolve, reject) => {
88 88
         if (!user.value) return;
89 89
         loginByUsername(user.value)
90
-          .then((response) => {
91
-            const data = response.data;
92
-            commit("SET_ACCESS_TOKEN", data.access_token);
93
-            commit("SET_REFRESH_TOKEN", data.refresh_token);
90
+          .then((response: any) => {
91
+            commit("SET_ACCESS_TOKEN", response.access_token);
92
+            commit("SET_REFRESH_TOKEN", response.refresh_token);
94 93
             // commit("CLEAR_LOCK");
95 94
             resolve(response);
96 95
           })
@@ -124,7 +123,7 @@ export default {
124 123
             commit("SET_USER_INFO", data.sysUser);
125 124
             commit("SET_ROLES", data.roles || []);
126 125
             commit("SET_PERMISSIONS", data.permissions || []);
127
-            resolve(data);
126
+            resolve(data.sysUser);
128 127
           })
129 128
           .catch(() => {
130 129
             reject();

+ 8 - 8
src/styles/common.scss

@@ -1,12 +1,11 @@
1
-
2 1
 // 工具类函数
3
-@import './mixin.scss';
2
+@import "./mixin.scss";
4 3
 //适配
5
-@import './media.scss';
4
+@import "./media.scss";
6 5
 //通用配置
7
-@import './normalize.scss';
6
+@import "./normalize.scss";
8 7
 // 自定义class
9
-@import './diyClass.scss';
8
+@import "./diyClass.scss";
10 9
 
11 10
 a {
12 11
   text-decoration: none;
@@ -27,7 +26,8 @@ a {
27 26
   -moz-osx-font-smoothing: grayscale;
28 27
 }
29 28
 
30
-.avue-input-icon__item i, .avue-crud__icon--small {
29
+.avue-input-icon__item i,
30
+.avue-crud__icon--small {
31 31
   font-family: "iconfont" !important;
32 32
   /* 以下内容参照第三方图标库本身的规则 */
33 33
   font-size: 24px !important;
@@ -36,7 +36,7 @@ a {
36 36
   -moz-osx-font-smoothing: grayscale;
37 37
 }
38 38
 
39
-.el-menu-item [class^=icon-] {
39
+.el-menu-item [class^="icon-"] {
40 40
   margin-right: 5px;
41 41
   width: 24px;
42 42
   text-align: center;
@@ -44,7 +44,7 @@ a {
44 44
   vertical-align: middle;
45 45
 }
46 46
 
47
-.el-submenu [class^=icon-] {
47
+.el-submenu [class^="icon-"] {
48 48
   vertical-align: middle;
49 49
   margin-right: 5px;
50 50
   width: 24px;

+ 0 - 1
src/styles/diyClass.scss

@@ -19,4 +19,3 @@
19 19
   justify-content: center;
20 20
   margin-bottom: 20px;
21 21
 }
22
-

+ 4 - 5
src/styles/media.css

@@ -2,16 +2,15 @@
2 2
 .avue-header,
3 3
 .avue-top,
4 4
 .avue-logo,
5
-.avue-layout
6
-.login-logo,
5
+.avue-layout .login-logo,
7 6
 .avue-main {
8
-  transition: all .3s;
7
+  transition: all 0.3s;
9 8
 }
10 9
 
11 10
 .avue-contail {
12 11
   width: 100%;
13 12
   height: 100%;
14
-  background: #EDF4FE;
13
+  background: #edf4fe;
15 14
   background-size: 100%;
16 15
   background-repeat: no-repeat;
17 16
 }
@@ -66,7 +65,7 @@
66 65
 .mainContent {
67 66
   overflow-x: hidden;
68 67
   overflow-y: auto;
69
-  background: #FFF;
68
+  background: #fff;
70 69
 }
71 70
 
72 71
 .avue-footer {

File diff suppressed because it is too large
+ 152 - 1
src/styles/media.min.css


+ 124 - 127
src/styles/media.scss

@@ -2,170 +2,167 @@
2 2
 .avue-header,
3 3
 .avue-top,
4 4
 .avue-logo,
5
-.avue-layout
6
-.login-logo,
5
+.avue-layout .login-logo,
7 6
 .avue-main {
8
-    transition: all .3s;
7
+  transition: all 0.3s;
9 8
 }
10 9
 .avue-contail {
11
-    width: 100%;
12
-    height: 100%;
13
-    background: #EDF4FE;
14
-    background-size: 100%;
15
-    background-repeat: no-repeat;
10
+  width: 100%;
11
+  height: 100%;
12
+  background: #edf4fe;
13
+  background-size: 100%;
14
+  background-repeat: no-repeat;
16 15
 }
17 16
 
18
-
19 17
 .avue-left {
20
-    position: fixed;
21
-    left: 0;
22
-    top: 0;
23
-    width: 208px;
24
-    height: calc(100% + 17px);
25
-    z-index: 1025;
18
+  position: fixed;
19
+  left: 0;
20
+  top: 0;
21
+  width: 208px;
22
+  height: calc(100% + 17px);
23
+  z-index: 1025;
26 24
 }
27 25
 
28 26
 .avue--collapse {
29
-    .avue-left,
30
-    .avue-logo {
31
-        width: 60px;
32
-    }
33
-    .avue-header {
34
-        padding-left: 60px;
35
-    }
36
-    .avue-main {
37
-        width: calc(100% - 60px);
38
-        left: 60px;
39
-    }
27
+  .avue-left,
28
+  .avue-logo {
29
+    width: 60px;
30
+  }
31
+  .avue-header {
32
+    padding-left: 60px;
33
+  }
34
+  .avue-main {
35
+    width: calc(100% - 60px);
36
+    left: 60px;
37
+  }
40 38
 }
41 39
 
42 40
 .avue-header {
43
-    padding-left: 208px;
44
-    width: 100%;
45
-    background-color: #fff;
46
-    box-sizing: border-box;
41
+  padding-left: 208px;
42
+  width: 100%;
43
+  background-color: #fff;
44
+  box-sizing: border-box;
47 45
 }
48 46
 
49 47
 .avue-main {
50
-    position: absolute;
51
-    left: 208px;
52
-    padding: 0;
53
-    padding-bottom: 20px;
54
-    width: calc(100% - 208px);
55
-    height: calc(100% - 120px);
56
-    box-sizing: border-box;
57
-    overflow: hidden;
48
+  position: absolute;
49
+  left: 208px;
50
+  padding: 0;
51
+  padding-bottom: 20px;
52
+  width: calc(100% - 208px);
53
+  height: calc(100% - 120px);
54
+  box-sizing: border-box;
55
+  overflow: hidden;
58 56
 }
59 57
 
60 58
 .avue-view {
61
-    padding-bottom: 22px;
62
-    width: 100%;
63
-    box-sizing: border-box;
59
+  padding-bottom: 22px;
60
+  width: 100%;
61
+  box-sizing: border-box;
64 62
 }
65 63
 .mainContent {
66 64
   overflow-x: hidden;
67 65
   overflow-y: auto;
68
-  background: #FFF;
66
+  background: #fff;
69 67
 }
70 68
 
71
-
72 69
 .avue-footer {
73
-    margin: 0 auto;
74
-    padding: 0 22px;
75
-    width: 1300px;
76
-    display: flex;
77
-    align-items: center;
78
-    justify-content: space-between;
79
-    .logo {
80
-        margin-left: -50px;
81
-    }
82
-    .copyright {
83
-        color: #666;
84
-        line-height: 1.5;
85
-        font-size: 12px;
86
-    }
70
+  margin: 0 auto;
71
+  padding: 0 22px;
72
+  width: 1300px;
73
+  display: flex;
74
+  align-items: center;
75
+  justify-content: space-between;
76
+  .logo {
77
+    margin-left: -50px;
78
+  }
79
+  .copyright {
80
+    color: #666;
81
+    line-height: 1.5;
82
+    font-size: 12px;
83
+  }
87 84
 }
88 85
 
89 86
 .avue-shade {
90
-    position: fixed;
91
-    display: none;
92
-    width: 100%;
93
-    height: 100%;
94
-    left: 0;
95
-    right: 0;
96
-    top: 0;
97
-    bottom: 0;
98
-    background-color: rgba(0, 0, 0, .3);
99
-    z-index: 1024;
100
-    &--show {
101
-        display: block;
102
-    }
87
+  position: fixed;
88
+  display: none;
89
+  width: 100%;
90
+  height: 100%;
91
+  left: 0;
92
+  right: 0;
93
+  top: 0;
94
+  bottom: 0;
95
+  background-color: rgba(0, 0, 0, 0.3);
96
+  z-index: 1024;
97
+  &--show {
98
+    display: block;
99
+  }
103 100
 }
104 101
 
105 102
 @media screen and (max-width: 992px) {
106
-    $width: 240px;
107
-    // ele的自适应
108
-    .el-dialog,
109
-    .el-message-box {
110
-        width: 98% !important;
111
-    }
112
-    //登录页面
113
-    .login-left {
114
-        display: none !important;
115
-    }
116
-    .login-logo {
117
-        padding-top: 30px !important;
118
-        margin-left: -30px;
119
-    }
120
-    .login-weaper{
121
-        margin: 0 auto;
122
-        width: 96% !important;
123
-    }
124
-    .login-border {
125
-        border-radius: 5px;
126
-        padding: 40px;
127
-        margin: 0 auto;
128
-        float: none !important;
129
-        width: 100% !important;
130
-    }
131
-    .login-main {
132
-        width: 100% !important;
133
-    }
134
-    //主框架
135
-    .avue-tags {
136
-        display: none;
137
-    }
103
+  $width: 240px;
104
+  // ele的自适应
105
+  .el-dialog,
106
+  .el-message-box {
107
+    width: 98% !important;
108
+  }
109
+  //登录页面
110
+  .login-left {
111
+    display: none !important;
112
+  }
113
+  .login-logo {
114
+    padding-top: 30px !important;
115
+    margin-left: -30px;
116
+  }
117
+  .login-weaper {
118
+    margin: 0 auto;
119
+    width: 96% !important;
120
+  }
121
+  .login-border {
122
+    border-radius: 5px;
123
+    padding: 40px;
124
+    margin: 0 auto;
125
+    float: none !important;
126
+    width: 100% !important;
127
+  }
128
+  .login-main {
129
+    width: 100% !important;
130
+  }
131
+  //主框架
132
+  .avue-tags {
133
+    display: none;
134
+  }
135
+  .avue-left,
136
+  .avue-logo {
137
+    left: -$width;
138
+  }
139
+  .avue-main {
140
+    left: 0;
141
+    width: 100%;
142
+  }
143
+  .avue-header {
144
+    margin-bottom: 15px;
145
+    padding-left: 15px;
146
+  }
147
+  .top-bar__item {
148
+    display: none;
149
+  }
150
+  .avue--collapse {
138 151
     .avue-left,
139 152
     .avue-logo {
140
-        left: -$width;
153
+      width: $width;
154
+      left: 0;
141 155
     }
142 156
     .avue-main {
143
-        left: 0;
144
-        width: 100%;
157
+      left: $width;
158
+      width: 100%;
145 159
     }
146 160
     .avue-header {
147
-        margin-bottom: 15px;
148
-        padding-left: 15px;
149
-    }
150
-    .top-bar__item {
151
-        display: none;
161
+      padding: 0;
162
+      transform: translate3d(230px, 0, 0);
152 163
     }
153
-    .avue--collapse {
154
-        .avue-left,
155
-        .avue-logo {
156
-            width: $width;
157
-            left: 0;
158
-        }
159
-        .avue-main {
160
-            left: $width;
161
-            width: 100%;
162
-        }
163
-        .avue-header {
164
-            padding: 0;
165
-            transform: translate3d(230px, 0, 0);
166
-        }
167
-        .avue-shade {
168
-            display: block;
169
-        }
164
+    .avue-shade {
165
+      display: block;
170 166
     }
167
+  }
171 168
 }

+ 54 - 57
src/styles/mixin.scss

@@ -1,73 +1,70 @@
1 1
 @mixin clearfix {
2
-    &:after {
3
-        content: "";
4
-        display: table;
5
-        clear: both;
6
-    }
2
+  &:after {
3
+    content: "";
4
+    display: table;
5
+    clear: both;
6
+  }
7 7
 }
8 8
 
9 9
 @mixin scrollBar {
10
-     ::-webkit-scrollbar-track-piece {
11
-        background-color: transparent;
12
-    }
13
-     ::-webkit-scrollbar {
14
-        width: 7px;
15
-        height: 7px;
16
-        background-color: transparent;
17
-    }
18
-     ::-webkit-scrollbar-thumb {
19
-        border-radius: 5px;
20
-        background-color: hsla(220, 4%, 58%, .3);
21
-    }
10
+  ::-webkit-scrollbar-track-piece {
11
+    background-color: transparent;
12
+  }
13
+  ::-webkit-scrollbar {
14
+    width: 7px;
15
+    height: 7px;
16
+    background-color: transparent;
17
+  }
18
+  ::-webkit-scrollbar-thumb {
19
+    border-radius: 5px;
20
+    background-color: hsla(220, 4%, 58%, 0.3);
21
+  }
22 22
 }
23 23
 
24 24
 @mixin radius($width, $size, $color) {
25
-    width: $width;
26
-    height: $width;
27
-    line-height: $width;
28
-    border-radius: $width;
29
-    text-align: center;
30
-    border-width: $size;
31
-    border-style: solid;
32
-    border-color: $color;
25
+  width: $width;
26
+  height: $width;
27
+  line-height: $width;
28
+  border-radius: $width;
29
+  text-align: center;
30
+  border-width: $size;
31
+  border-style: solid;
32
+  border-color: $color;
33 33
 }
34 34
 
35 35
 @mixin relative {
36
-    position: relative;
37
-    width: 100%;
38
-    height: 100%;
36
+  position: relative;
37
+  width: 100%;
38
+  height: 100%;
39 39
 }
40 40
 
41 41
 @mixin pct($pct) {
42
-    width: #{$pct};
43
-    position: relative;
44
-    margin: 0 auto;
42
+  width: #{$pct};
43
+  position: relative;
44
+  margin: 0 auto;
45 45
 }
46 46
 
47 47
 @mixin triangle($width, $height, $color, $direction) {
48
-    $width: $width/2;
49
-    $color-border-style: $height solid $color;
50
-    $transparent-border-style: $width solid transparent;
51
-    height: 0;
52
-    width: 0;
53
-    @if $direction==up {
54
-        border-bottom: $color-border-style;
55
-        border-left: $transparent-border-style;
56
-        border-right: $transparent-border-style;
57
-    }
58
-    @else if $direction==right {
59
-        border-left: $color-border-style;
60
-        border-top: $transparent-border-style;
61
-        border-bottom: $transparent-border-style;
62
-    }
63
-    @else if $direction==down {
64
-        border-top: $color-border-style;
65
-        border-left: $transparent-border-style;
66
-        border-right: $transparent-border-style;
67
-    }
68
-    @else if $direction==left {
69
-        border-right: $color-border-style;
70
-        border-top: $transparent-border-style;
71
-        border-bottom: $transparent-border-style;
72
-    }
73
-}
48
+  $width: $width/2;
49
+  $color-border-style: $height solid $color;
50
+  $transparent-border-style: $width solid transparent;
51
+  height: 0;
52
+  width: 0;
53
+  @if $direction==up {
54
+    border-bottom: $color-border-style;
55
+    border-left: $transparent-border-style;
56
+    border-right: $transparent-border-style;
57
+  } @else if $direction==right {
58
+    border-left: $color-border-style;
59
+    border-top: $transparent-border-style;
60
+    border-bottom: $transparent-border-style;
61
+  } @else if $direction==down {
62
+    border-top: $color-border-style;
63
+    border-left: $transparent-border-style;
64
+    border-right: $transparent-border-style;
65
+  } @else if $direction==left {
66
+    border-right: $color-border-style;
67
+    border-top: $transparent-border-style;
68
+    border-bottom: $transparent-border-style;
69
+  }
70
+}

+ 281 - 282
src/styles/normalize.scss

@@ -15,63 +15,63 @@
15 15
  * 修正IE 8/9 中未定义的块级元素。
16 16
  */
17 17
 
18
- article,
19
- aside,
20
- details,
21
- figcaption,
22
- figure,
23
- footer,
24
- header,
25
- hgroup,
26
- main,
27
- nav,
28
- section,
29
- summary {
30
-     display: block;
31
- }
32
- 
33
- /**
18
+article,
19
+aside,
20
+details,
21
+figcaption,
22
+figure,
23
+footer,
24
+header,
25
+hgroup,
26
+main,
27
+nav,
28
+section,
29
+summary {
30
+  display: block;
31
+}
32
+
33
+/**
34 34
   * Correct `inline-block` display not defined in IE 8/9.
35 35
   *
36 36
   * 修正在 IE 8/9 中未定义的 'inline-block' 元素。
37 37
   */
38
- 
39
- audio,
40
- canvas,
41
- video {
42
-     display: inline-block;
43
- }
44
- 
45
- /**
38
+
39
+audio,
40
+canvas,
41
+video {
42
+  display: inline-block;
43
+}
44
+
45
+/**
46 46
   * Prevent modern browsers from displaying `audio` without controls.
47 47
   * Remove excess height in iOS 5 devices.
48 48
   *
49 49
   * 阻止现在浏览器显示未定义 control 播放控件的 'audio' 声音元素。
50 50
   * 删除 IOS 5 设备中显示的多余的高度。
51 51
   */
52
- 
53
- audio:not([controls]) {
54
-     display: none;
55
-     height: 0;
56
- }
57
- 
58
- /**
52
+
53
+audio:not([controls]) {
54
+  display: none;
55
+  height: 0;
56
+}
57
+
58
+/**
59 59
   * Address styling not present in IE 8/9.
60 60
   *
61 61
   * 处理 IE 8/9 中不存在的样式。
62 62
   */
63
- 
64
- [hidden] {
65
-     display: none;
66
- }
67
- 
68
- /* ==========================================================================
63
+
64
+[hidden] {
65
+  display: none;
66
+}
67
+
68
+/* ==========================================================================
69 69
     Base
70 70
  
71 71
     基本设置
72 72
     ========================================================================== */
73
- 
74
- /**
73
+
74
+/**
75 75
   * 1. Set default font family to sans-serif.
76 76
   * 2. Prevent iOS text size adjust after orientation change, without disabling
77 77
   *    user zoom.
@@ -79,250 +79,250 @@
79 79
   * 1. 设置默认字体类型为 sans-serif.
80 80
   * 2. 当用户放大或缩小页面时不改变字体大小。
81 81
   */
82
- 
83
- html {
84
-     font-family: sans-serif; /* 1 */
85
-     -ms-text-size-adjust: 100%; /* 2 */
86
-     -webkit-text-size-adjust: 100%; /* 2 */
87
- }
88
- 
89
- /**
82
+
83
+html {
84
+  font-family: sans-serif; /* 1 */
85
+  -ms-text-size-adjust: 100%; /* 2 */
86
+  -webkit-text-size-adjust: 100%; /* 2 */
87
+}
88
+
89
+/**
90 90
   * Remove default margin.
91 91
   *
92 92
   * 删除默认边距。
93 93
   */
94
- 
95
- body {
96
-     margin: 0;
97
- }
98
- 
99
- /* ==========================================================================
94
+
95
+body {
96
+  margin: 0;
97
+}
98
+
99
+/* ==========================================================================
100 100
     Links
101 101
  
102 102
     链接
103 103
     ========================================================================== */
104
- 
105
- /**
104
+
105
+/**
106 106
   * Address `outline` inconsistency between Chrome and other browsers.
107 107
   *
108 108
   * 处理 Chrome 与其它浏览器中关于 'outline' 的不一致性。
109 109
   */
110
- 
111
- a:focus {
112
-     outline: thin dotted;
113
- }
114
- 
115
- /**
110
+
111
+a:focus {
112
+  outline: thin dotted;
113
+}
114
+
115
+/**
116 116
   * Improve readability when focused and also mouse hovered in all browsers.
117 117
   *
118 118
   * 为所有浏览器改善当激活或悬停在元素上时元素内容的可读性。
119 119
   */
120
- 
121
- a:active,
122
- a:hover {
123
-     outline: 0;
124
- }
125
- 
126
- /* ==========================================================================
120
+
121
+a:active,
122
+a:hover {
123
+  outline: 0;
124
+}
125
+
126
+/* ==========================================================================
127 127
     Typography
128 128
  
129 129
     排版
130 130
     ========================================================================== */
131
- 
132
- /**
131
+
132
+/**
133 133
   * Address variable `h1` font-size and margin within `section` and `article`
134 134
   * contexts in Firefox 4+, Safari 5, and Chrome.
135 135
   *
136 136
   * 处理多变的 'h1' 字体大小及其在 Firefox 4+, Safari 5, 及 Chrome时浏览器中的 
137 137
   * 'section' 与 'article' 元素中的边距。
138 138
   */
139
- 
140
- h1 {
141
-     font-size: 2em;
142
-     margin: 0.67em 0;
143
- }
144
- 
145
- /**
139
+
140
+h1 {
141
+  font-size: 2em;
142
+  margin: 0.67em 0;
143
+}
144
+
145
+/**
146 146
   * Address styling not present in IE 8/9, Safari 5, and Chrome.
147 147
   *
148 148
   * 处理在 IE 8/9, Safari 5, 及 Chrome 没有的样式。
149 149
   */
150
- 
151
- abbr[title] {
152
-     border-bottom: 1px dotted;
153
- }
154
- 
155
- /**
150
+
151
+abbr[title] {
152
+  border-bottom: 1px dotted;
153
+}
154
+
155
+/**
156 156
   * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
157 157
   *
158 158
   * 处理 Firefox 4+, Safari 5, 及 Chrome 中默认的 'bolder' 样式为 'bold'.
159 159
   */
160
- 
161
- b,
162
- strong {
163
-     font-weight: bold;
164
- }
165
- 
166
- /**
160
+
161
+b,
162
+strong {
163
+  font-weight: bold;
164
+}
165
+
166
+/**
167 167
   * Address styling not present in Safari 5 and Chrome.
168 168
   *
169 169
   * 处理在 Safari 5 和 Chrome 没有的样式。
170 170
   */
171
- 
172
- dfn {
173
-     font-style: italic;
174
- }
175
- 
176
- /**
171
+
172
+dfn {
173
+  font-style: italic;
174
+}
175
+
176
+/**
177 177
   * Address differences between Firefox and other browsers.
178 178
   *
179 179
   * 处理 Firefox 与其它浏览器的差异。
180 180
   */
181
- 
182
- hr {
183
-     -moz-box-sizing: content-box;
184
-     box-sizing: content-box;
185
-     height: 0;
186
- }
187
- 
188
- /**
181
+
182
+hr {
183
+  -moz-box-sizing: content-box;
184
+  box-sizing: content-box;
185
+  height: 0;
186
+}
187
+
188
+/**
189 189
   * Address styling not present in IE 8/9.
190 190
   *
191 191
   * 处理在 IE 8/9 中没有的样式。
192 192
   */
193
- 
194
- mark {
195
-     background: #ff0;
196
-     color: #000;
197
- }
198
- 
199
- /**
193
+
194
+mark {
195
+  background: #ff0;
196
+  color: #000;
197
+}
198
+
199
+/**
200 200
   * Correct font family set oddly in Safari 5 and Chrome.
201 201
   *
202 202
   * 修正确 Safari 5 和 Chrome 中古怪的默认字体。
203 203
   */
204
- 
205
- code,
206
- kbd,
207
- pre,
208
- samp {
209
-     font-family: monospace, serif;
210
-     font-size: 1em;
211
- }
212
- 
213
- /**
204
+
205
+code,
206
+kbd,
207
+pre,
208
+samp {
209
+  font-family: monospace, serif;
210
+  font-size: 1em;
211
+}
212
+
213
+/**
214 214
   * Improve readability of pre-formatted text in all browsers.
215 215
   *
216 216
   * 为所有浏览器改善预格式化文本的可读性。
217 217
   */
218
- 
219
- pre {
220
-     white-space: pre-wrap;
221
- }
222
- 
223
- /**
218
+
219
+pre {
220
+  white-space: pre-wrap;
221
+}
222
+
223
+/**
224 224
   * Set consistent quote types.
225 225
   *
226 226
   * 设置一致的引用格式。
227 227
   */
228
- 
229
- q {
230
-     quotes: "\201C" "\201D" "\2018" "\2019";
231
- }
232
- 
233
- /**
228
+
229
+q {
230
+  quotes: "\201C""\201D""\2018""\2019";
231
+}
232
+
233
+/**
234 234
   * Address inconsistent and variable font size in all browsers.
235 235
   *
236 236
   * 处理所有浏览器中字体大小的不一致性[译者注:原文直译为:处理所有
237 237
   * 浏览器中的不一致和多变的字体大小]。
238 238
   */
239
- 
240
- small {
241
-     font-size: 80%;
242
- }
243
- 
244
- /**
239
+
240
+small {
241
+  font-size: 80%;
242
+}
243
+
244
+/**
245 245
   * Prevent `sub` and `sup` affecting `line-height` in all browsers.
246 246
   *
247 247
   * 阻止所有浏览器中 'sub' 和 'sup' 元素影响 'line-height'. 
248 248
   * [译者注:就是不让上标与下标影响行高。]
249 249
   */
250
- 
251
- sub,
252
- sup {
253
-     font-size: 75%;
254
-     line-height: 0;
255
-     position: relative;
256
-     vertical-align: baseline;
257
- }
258
- 
259
- sup {
260
-     top: -0.5em;
261
- }
262
- 
263
- sub {
264
-     bottom: -0.25em;
265
- }
266
- 
267
- /* ==========================================================================
250
+
251
+sub,
252
+sup {
253
+  font-size: 75%;
254
+  line-height: 0;
255
+  position: relative;
256
+  vertical-align: baseline;
257
+}
258
+
259
+sup {
260
+  top: -0.5em;
261
+}
262
+
263
+sub {
264
+  bottom: -0.25em;
265
+}
266
+
267
+/* ==========================================================================
268 268
     Embedded content
269 269
  
270 270
     嵌入的内容
271 271
     ========================================================================== */
272
- 
273
- /**
272
+
273
+/**
274 274
   * Remove border when inside `a` element in IE 8/9.
275 275
   *
276 276
   * 删除 IE 8/9 中当内容位于 'a' 中出现的边框。
277 277
   */
278
- 
279
- img {
280
-     border: 0;
281
- }
282
- 
283
- /**
278
+
279
+img {
280
+  border: 0;
281
+}
282
+
283
+/**
284 284
   * Correct overflow displayed oddly in IE 9.
285 285
   *
286 286
   * 修正 IE 9 中显示古怪的溢出内容。
287 287
   */
288
- 
289
- svg:not(:root) {
290
-     overflow: hidden;
291
- }
292
- 
293
- /* ==========================================================================
288
+
289
+svg:not(:root) {
290
+  overflow: hidden;
291
+}
292
+
293
+/* ==========================================================================
294 294
     Figures
295 295
  
296 296
     Figure 图像/图表/代码等
297 297
     ========================================================================== */
298
- 
299
- /**
298
+
299
+/**
300 300
   * Address margin not present in IE 8/9 and Safari 5.
301 301
   *
302 302
   * 处理在 IE 8/9 和 Safari 5 没有的边距。
303 303
   */
304
- 
305
- figure {
306
-     margin: 0;
307
- }
308
- 
309
- /* ==========================================================================
304
+
305
+figure {
306
+  margin: 0;
307
+}
308
+
309
+/* ==========================================================================
310 310
     Forms
311 311
     ========================================================================== */
312
- 
313
- /**
312
+
313
+/**
314 314
   * Define consistent border, margin, and padding.
315 315
   *
316 316
   * 定义一致的边框、外边距及内边距。
317 317
   */
318
- 
319
- fieldset {
320
-     border: 1px solid #c0c0c0;
321
-     margin: 0 2px;
322
-     padding: 0.35em 0.625em 0.75em;
323
- }
324
- 
325
- /**
318
+
319
+fieldset {
320
+  border: 1px solid #c0c0c0;
321
+  margin: 0 2px;
322
+  padding: 0.35em 0.625em 0.75em;
323
+}
324
+
325
+/**
326 326
   * 1. Correct `color` not being inherited in IE 8/9.
327 327
   * 2. Remove padding so people aren't caught out if they zero out fieldsets.
328 328
   * 1. 修正在 IE 8/9 中没有继承的 'color'. 
@@ -330,13 +330,13 @@
330 330
   *    [译者注:说是修正颜色嘛,可下面没有关于颜色的呀,这也行?求大神解释!]
331 331
   * 2. 去掉内边距,避免当用户清空表单组时认为出错了。
332 332
   */
333
- 
334
- legend {
335
-     border: 0; /* 1 */
336
-     padding: 0; /* 2 */
337
- }
338
- 
339
- /**
333
+
334
+legend {
335
+  border: 0; /* 1 */
336
+  padding: 0; /* 2 */
337
+}
338
+
339
+/**
340 340
   * 1. Correct font family not being inherited in all browsers.
341 341
   * 2. Correct font size not being inherited in all browsers.
342 342
   * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
@@ -345,29 +345,29 @@
345 345
   * 2. 修正所有浏览器中未被继承的字体大小。
346 346
   * 3. 处理 Firefox 4+, Safari 5, 及 Chrome 中默认设置不同的外边距。
347 347
   */
348
- 
349
- button,
350
- input,
351
- select,
352
- textarea {
353
-     font-family: inherit; /* 1 */
354
-     font-size: 100%; /* 2 */
355
-     margin: 0; /* 3 */
356
- }
357
- 
358
- /**
348
+
349
+button,
350
+input,
351
+select,
352
+textarea {
353
+  font-family: inherit; /* 1 */
354
+  font-size: 100%; /* 2 */
355
+  margin: 0; /* 3 */
356
+}
357
+
358
+/**
359 359
   * Address Firefox 4+ setting `line-height` on `input` using `!important` in
360 360
   * the UA stylesheet.
361 361
   *
362 362
   * 处理 Firefox 4+ 中的客户端样式表里使用 '!important' 设置的 'line-height'.
363 363
   */
364
- 
365
- button,
366
- input {
367
-     line-height: normal;
368
- }
369
- 
370
- /**
364
+
365
+button,
366
+input {
367
+  line-height: normal;
368
+}
369
+
370
+/**
371 371
   * Address inconsistent `text-transform` inheritance for `button` and `select`.
372 372
   * All other form control elements do not inherit `text-transform` values.
373 373
   * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
@@ -378,13 +378,13 @@
378 378
   * 修正 Chrome, Safari 5+, 及 IE 8+ 中 'button' 的继承样式。
379 379
   * 修正 Firefox 4+ 和 Opera 中 'select' 的继承样式。
380 380
   */
381
- 
382
- button,
383
- select {
384
-     text-transform: none;
385
- }
386
- 
387
- /**
381
+
382
+button,
383
+select {
384
+  text-transform: none;
385
+}
386
+
387
+/**
388 388
   * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
389 389
   *    and `video` controls.
390 390
   * 2. Correct inability to style clickable `input` types in iOS.
@@ -395,41 +395,41 @@
395 395
   * 2. 修正 iOS 中不可点击的 'input' 样式。
396 396
   * 3. 改善图片类型的 'input' 等光标样式的可用性与一致性。
397 397
   */
398
- 
399
- button,
398
+
399
+button,
400 400
  html input[type="button"], /* 1 */
401 401
  input[type="reset"],
402 402
  input[type="submit"] {
403
-     -webkit-appearance: button; /* 2 */
404
-     cursor: pointer; /* 3 */
405
- }
406
- 
407
- /**
403
+  -webkit-appearance: button; /* 2 */
404
+  cursor: pointer; /* 3 */
405
+}
406
+
407
+/**
408 408
   * Re-set default cursor for disabled elements.
409 409
   * 
410 410
   * 重置不可用元素的默认光标样式。
411 411
   */
412
- 
413
- button[disabled],
414
- html input[disabled] {
415
-     cursor: default;
416
- }
417
- 
418
- /**
412
+
413
+button[disabled],
414
+html input[disabled] {
415
+  cursor: default;
416
+}
417
+
418
+/**
419 419
   * 1. Address box sizing set to `content-box` in IE 8/9.
420 420
   * 2. Remove excess padding in IE 8/9.
421 421
   *
422 422
   * 1. 处理 IE 8/9 中设置为 'content-box' 的盒子模型。
423 423
   * 2. 删除 IE 8/9 中多余的内边距。
424 424
   */
425
- 
426
- input[type="checkbox"],
427
- input[type="radio"] {
428
-     box-sizing: border-box; /* 1 */
429
-     padding: 0; /* 2 */
430
- }
431
- 
432
- /**
425
+
426
+input[type="checkbox"],
427
+input[type="radio"] {
428
+  box-sizing: border-box; /* 1 */
429
+  padding: 0; /* 2 */
430
+}
431
+
432
+/**
433 433
   * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
434 434
   * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
435 435
   *    (include `-moz` to future-proof).
@@ -438,65 +438,64 @@
438 438
   * 2. 处理 Safari 5 和 Chrome 中默认设置为 'box-sizing' 的 'border-box'
439 439
   *    (包括不会过时的 '-moz').
440 440
   */
441
- 
442
- input[type="search"] {
443
-     -webkit-appearance: textfield; /* 1 */
444
-     -moz-box-sizing: content-box;
445
-     -webkit-box-sizing: content-box; /* 2 */
446
-     box-sizing: content-box;
447
- }
448
- 
449
- /**
441
+
442
+input[type="search"] {
443
+  -webkit-appearance: textfield; /* 1 */
444
+  -moz-box-sizing: content-box;
445
+  -webkit-box-sizing: content-box; /* 2 */
446
+  box-sizing: content-box;
447
+}
448
+
449
+/**
450 450
   * Remove inner padding and search cancel button in Safari 5 and Chrome
451 451
   * on OS X.
452 452
   *
453 453
   * 删除 Safari 5 和 OS X 上的 Chrome 中的输入框上的内边距和搜索取消按钮。
454 454
   */
455
- 
456
- input[type="search"]::-webkit-search-cancel-button,
457
- input[type="search"]::-webkit-search-decoration {
458
-     -webkit-appearance: none;
459
- }
460
- 
461
- /**
455
+
456
+input[type="search"]::-webkit-search-cancel-button,
457
+input[type="search"]::-webkit-search-decoration {
458
+  -webkit-appearance: none;
459
+}
460
+
461
+/**
462 462
   * Remove inner padding and border in Firefox 4+.
463 463
   *
464 464
   * 删除 Firefox 4+ button 与 input 上的内边距。
465 465
   */
466
- 
467
- button::-moz-focus-inner,
468
- input::-moz-focus-inner {
469
-     border: 0;
470
-     padding: 0;
471
- }
472
- 
473
- /**
466
+
467
+button::-moz-focus-inner,
468
+input::-moz-focus-inner {
469
+  border: 0;
470
+  padding: 0;
471
+}
472
+
473
+/**
474 474
   * 1. Remove default vertical scrollbar in IE 8/9.
475 475
   * 2. Improve readability and alignment in all browsers.
476 476
   *
477 477
   * 1. 删除 IE8/9 中默认的垂直滚动条。
478 478
   * 2. 改善所有浏览器中的可读性并使文本垂直对齐。
479 479
   */
480
- 
481
- textarea {
482
-     overflow: auto; /* 1 */
483
-     vertical-align: top; /* 2 */
484
- }
485
- 
486
- /* ==========================================================================
480
+
481
+textarea {
482
+  overflow: auto; /* 1 */
483
+  vertical-align: top; /* 2 */
484
+}
485
+
486
+/* ==========================================================================
487 487
     Tables
488 488
  
489 489
     表格
490 490
     ========================================================================== */
491
- 
492
- /**
491
+
492
+/**
493 493
   * Remove most spacing between table cells.
494 494
   *
495 495
   * 删除表格里单元格间的间距。
496 496
   */
497
- 
498
- table {
499
-     border-collapse: collapse;
500
-     border-spacing: 0;
501
- }
502
- 
497
+
498
+table {
499
+  border-collapse: collapse;
500
+  border-spacing: 0;
501
+}

+ 9 - 25
src/utils/util.ts

@@ -1,30 +1,5 @@
1 1
 import { ref } from "vue";
2 2
 import CryptoJS from "crypto-js";
3
-/**
4
- * 参数处理
5
- * @param {*} params  参数
6
- */
7
-export function tansParams(params: any) {
8
-  let result = "";
9
-  for (const propName of Object.keys(params)) {
10
-    const value = params[propName];
11
-    const part = encodeURIComponent(propName) + "=";
12
-    if (value !== null && value !== "" && typeof value !== "undefined") {
13
-      if (typeof value === "object") {
14
-        for (const key of Object.keys(value)) {
15
-          if (value[key] !== null && value[key] !== "" && typeof value[key] !== "undefined") {
16
-            const params = propName + "[" + key + "]";
17
-            const subPart = encodeURIComponent(params) + "=";
18
-            result += subPart + encodeURIComponent(value[key]) + "&";
19
-          }
20
-        }
21
-      } else {
22
-        result += part + encodeURIComponent(value) + "&";
23
-      }
24
-    }
25
-  }
26
-  return result;
27
-}
28 3
 
29 4
 // 构造树型结构数据
30 5
 export function handleTree(arr: any, id: string) {
@@ -165,3 +140,12 @@ export const getObjType = (obj: any) => {
165 140
   }
166 141
   return map[toString.call(obj)];
167 142
 };
143
+
144
+// 表单序列化
145
+export const serialize = (data: any) => {
146
+  const list: string[] = [];
147
+  Object.keys(data).forEach((ele) => {
148
+    list.push(`${ele}=${data[ele]}`);
149
+  });
150
+  return list.join("&");
151
+};

+ 6 - 6
src/views/InformationAudit/enterWarehouseAudit/detail.vue

@@ -47,7 +47,7 @@
47 47
               :limit="3"
48 48
               :on-exceed="handleExceed"
49 49
             >
50
-              <el-button style="margin-top:10px" type="primary">选择文件</el-button>
50
+              <el-button style="margin-top: 10px" type="primary">选择文件</el-button>
51 51
             </el-upload>
52 52
           </el-form-item></el-col
53 53
         >
@@ -65,9 +65,9 @@ import { reactive, toRefs } from "vue";
65 65
 import { getSuppliesType } from "@/api/dataStatistics/index";
66 66
 import { Search } from "@element-plus/icons-vue";
67 67
 import { ElMessage, ElMessageBox } from "element-plus";
68
-import { useRouter } from "vue-router"
68
+import { useRouter } from "vue-router";
69 69
 
70
-const router = useRouter()
70
+const router = useRouter();
71 71
 const data = reactive({
72 72
   tableData: []
73 73
 });
@@ -101,11 +101,11 @@ const getList = () => {
101 101
 };
102 102
 // 通过
103 103
 const handleAgree = () => {
104
-  router.push('enterWarehouseAudit')
104
+  router.push("enterWarehouseAudit");
105 105
 };
106 106
 // 退回
107 107
 const handleReturn = () => {
108
-  router.push('enterWarehouseAudit')
108
+  router.push("enterWarehouseAudit");
109 109
 };
110 110
 
111 111
 // 附件相关
@@ -147,7 +147,7 @@ getList();
147 147
 .bottom-btn + .bottom-btn {
148 148
   margin-left: 20px;
149 149
 }
150
-.el-form-item{
150
+.el-form-item {
151 151
   align-items: center;
152 152
 }
153 153
 </style>

+ 17 - 7
src/views/InformationAudit/enterWarehouseAudit/index.vue

@@ -47,10 +47,20 @@
47 47
       <el-table-column prop="moduleNum" label="当前审批节点" header-align="center" align="center" />
48 48
       <el-table-column label="操作" header-align="center" align="center" width="160">
49 49
         <template #default="scope">
50
-          <el-button size="" type="warning" style="backgroundColor: #dbc262" @click="handleProcess(scope.$index, scope.row)"
50
+          <el-button
51
+            size=""
52
+            type="warning"
53
+            style="backgroundcolor: #dbc262"
54
+            @click="handleProcess(scope.$index, scope.row)"
51 55
             >审核</el-button
52 56
           >
53
-          <el-button size="" type="primary" style="backgroundColor: #949aef" @click="handleShow(scope.$index, scope.row)">查看</el-button>
57
+          <el-button
58
+            size=""
59
+            type="primary"
60
+            style="backgroundcolor: #949aef"
61
+            @click="handleShow(scope.$index, scope.row)"
62
+            >查看</el-button
63
+          >
54 64
         </template>
55 65
       </el-table-column>
56 66
     </el-table>
@@ -69,13 +79,13 @@
69 79
 import { reactive, toRefs } from "vue";
70 80
 import { getSuppliesType } from "@/api/dataStatistics/index";
71 81
 import { Search } from "@element-plus/icons-vue";
72
-import { useRouter } from "vue-router"
82
+import { useRouter } from "vue-router";
73 83
 
74
-const router = useRouter()
84
+const router = useRouter();
75 85
 const data = reactive({
76 86
   tableData: [],
77 87
   cklxOptions: [],
78
-  spjdOptions: [],
88
+  spjdOptions: []
79 89
 });
80 90
 let page = reactive({
81 91
   currentPage: 1,
@@ -127,11 +137,11 @@ const handleReSearch = () => {
127 137
 };
128 138
 // 审核
129 139
 const handleProcess = () => {
130
-  router.push('enterWarehouseAuditDetail')
140
+  router.push("enterWarehouseAuditDetail");
131 141
 };
132 142
 // 查看
133 143
 const handleShow = () => {
134
-  router.push('enterWarehouseAuditDetail')
144
+  router.push("enterWarehouseAuditDetail");
135 145
 };
136 146
 
137 147
 getList();

+ 6 - 6
src/views/InformationAudit/outWarehouseAudit/detail.vue

@@ -47,7 +47,7 @@
47 47
               :limit="3"
48 48
               :on-exceed="handleExceed"
49 49
             >
50
-              <el-button style="margin-top:10px" type="primary">选择文件</el-button>
50
+              <el-button style="margin-top: 10px" type="primary">选择文件</el-button>
51 51
             </el-upload>
52 52
           </el-form-item></el-col
53 53
         >
@@ -65,9 +65,9 @@ import { reactive, toRefs } from "vue";
65 65
 import { getSuppliesType } from "@/api/dataStatistics/index";
66 66
 import { Search } from "@element-plus/icons-vue";
67 67
 import { ElMessage, ElMessageBox } from "element-plus";
68
-import { useRouter } from "vue-router"
68
+import { useRouter } from "vue-router";
69 69
 
70
-const router = useRouter()
70
+const router = useRouter();
71 71
 const data = reactive({
72 72
   tableData: []
73 73
 });
@@ -101,11 +101,11 @@ const getList = () => {
101 101
 };
102 102
 // 通过
103 103
 const handleAgree = () => {
104
-  router.push('enterWarehouseAuditDetail')
104
+  router.push("enterWarehouseAuditDetail");
105 105
 };
106 106
 // 退回
107 107
 const handleReturn = () => {
108
-  router.push('enterWarehouseAuditDetail')
108
+  router.push("enterWarehouseAuditDetail");
109 109
 };
110 110
 
111 111
 // 附件相关
@@ -147,7 +147,7 @@ getList();
147 147
 .bottom-btn + .bottom-btn {
148 148
   margin-left: 20px;
149 149
 }
150
-.el-form-item{
150
+.el-form-item {
151 151
   align-items: center;
152 152
 }
153 153
 </style>

+ 17 - 7
src/views/InformationAudit/outWarehouseAudit/index.vue

@@ -49,10 +49,20 @@
49 49
       <el-table-column prop="moduleNum" label="当前审批节点" header-align="center" align="center" />
50 50
       <el-table-column label="操作" header-align="center" align="center" width="160">
51 51
         <template #default="scope">
52
-          <el-button size="" type="warning" style="backgroundColor: #dbc262" @click="handleProcess(scope.$index, scope.row)"
52
+          <el-button
53
+            size=""
54
+            type="warning"
55
+            style="backgroundcolor: #dbc262"
56
+            @click="handleProcess(scope.$index, scope.row)"
53 57
             >审核</el-button
54 58
           >
55
-          <el-button size="" type="primary" style="backgroundColor: #949aef" @click="handleShow(scope.$index, scope.row)">查看</el-button>
59
+          <el-button
60
+            size=""
61
+            type="primary"
62
+            style="backgroundcolor: #949aef"
63
+            @click="handleShow(scope.$index, scope.row)"
64
+            >查看</el-button
65
+          >
56 66
         </template>
57 67
       </el-table-column>
58 68
     </el-table>
@@ -71,14 +81,14 @@
71 81
 import { reactive, toRefs } from "vue";
72 82
 import { getSuppliesType } from "@/api/dataStatistics/index";
73 83
 import { Search } from "@element-plus/icons-vue";
74
-import { useRouter } from "vue-router"
84
+import { useRouter } from "vue-router";
75 85
 
76
-const router = useRouter()
86
+const router = useRouter();
77 87
 const data = reactive({
78 88
   tableData: [],
79 89
   cklxOptions: [],
80 90
   dqspjdOptions: [],
81
-  spjdOptions: [],
91
+  spjdOptions: []
82 92
 });
83 93
 let page = reactive({
84 94
   currentPage: 1,
@@ -130,11 +140,11 @@ const handleReSearch = () => {
130 140
 };
131 141
 // 审核
132 142
 const handleProcess = () => {
133
-  router.push('outWarehouseAuditDetail')
143
+  router.push("outWarehouseAuditDetail");
134 144
 };
135 145
 // 查看
136 146
 const handleShow = () => {
137
-  router.push('outWarehouseAuditDetail')
147
+  router.push("outWarehouseAuditDetail");
138 148
 };
139 149
 
140 150
 getList();

+ 41 - 39
src/views/InformationFilling/enterWarehouseInfo/detail.vue

@@ -4,15 +4,15 @@
4 4
     <el-table :data="tableData" border>
5 5
       <el-table-column prop="type" label="物资名称" align="center" width="120">
6 6
         <template #default="scope">
7
-          <el-select v-model="scope.row.type" style="width:90px" size="small" clearable>
8
-            <el-option v-for="item in transType" :key="item.value" :label="item.label" :value="item.value"/>
7
+          <el-select v-model="scope.row.type" style="width: 90px" size="small" clearable>
8
+            <el-option v-for="item in transType" :key="item.value" :label="item.label" :value="item.value" />
9 9
           </el-select>
10 10
         </template>
11 11
       </el-table-column>
12 12
       <el-table-column prop="type" label="单位" align="center" width="120">
13 13
         <template #default="scope">
14
-          <el-select v-model="scope.row.type" style="width:90px" size="small" clearable>
15
-            <el-option v-for="item in transType" :key="item.value" :label="item.label" :value="item.value"/>
14
+          <el-select v-model="scope.row.type" style="width: 90px" size="small" clearable>
15
+            <el-option v-for="item in transType" :key="item.value" :label="item.label" :value="item.value" />
16 16
           </el-select>
17 17
         </template>
18 18
       </el-table-column>
@@ -43,8 +43,8 @@
43 43
       </el-table-column>
44 44
       <el-table-column prop="type" label="是否可用" align="center" width="120">
45 45
         <template #default="scope">
46
-          <el-select v-model="scope.row.type" style="width:90px" size="small" clearable>
47
-            <el-option v-for="item in transType" :key="item.value" :label="item.label" :value="item.value"/>
46
+          <el-select v-model="scope.row.type" style="width: 90px" size="small" clearable>
47
+            <el-option v-for="item in transType" :key="item.value" :label="item.label" :value="item.value" />
48 48
           </el-select>
49 49
         </template>
50 50
       </el-table-column>
@@ -74,56 +74,58 @@
74 74
 </template>
75 75
 
76 76
 <script setup lang="ts">
77
-import { ref } from 'vue';
78
-import { Delete, Plus } from '@element-plus/icons-vue'
79
-import { ElMessage } from 'element-plus'
80
-import router from '@/router';
77
+import { ref } from "vue";
78
+import { Delete, Plus } from "@element-plus/icons-vue";
79
+import { ElMessage } from "element-plus";
80
+import router from "@/router";
81 81
 const transType = [
82
-  {value: 1, label: '1'},
83
-  {value: 2, label: '2'},
84
-  {value: 3, label: '3'},
85
-  {value: 4, label: '4'}
86
-]
82
+  { value: 1, label: "1" },
83
+  { value: 2, label: "2" },
84
+  { value: 3, label: "3" },
85
+  { value: 4, label: "4" }
86
+];
87 87
 const tableData = ref([
88 88
   {
89 89
     type: 1,
90
-    days: '11',
91
-    amount: '111'
90
+    days: "11",
91
+    amount: "111"
92 92
   }
93
-])
93
+]);
94 94
 // 新增一行
95
-const addTableData = (rowIndex)=>{
95
+const addTableData = (rowIndex) => {
96 96
   const newRow = [
97 97
     {
98 98
       type: 3,
99
-      days: '22',
100
-      amount: '222'
99
+      days: "22",
100
+      amount: "222"
101 101
     }
102
-  ]
103
-  tableData.value.splice(rowIndex+1, 0, newRow);
104
-}
102
+  ];
103
+  tableData.value.splice(rowIndex + 1, 0, newRow);
104
+};
105 105
 // 删除
106
-const deleteTableData = (rowIndex) =>{
107
-  if(tableData.value.length > 1){
106
+const deleteTableData = (rowIndex) => {
107
+  if (tableData.value.length > 1) {
108 108
     tableData.value.splice(rowIndex, 1);
109
-  }else{
109
+  } else {
110 110
     ElMessage({
111
-      message: '最后一条不可删除!',
112
-      type: 'warning',
113
-    })
111
+      message: "最后一条不可删除!",
112
+      type: "warning"
113
+    });
114 114
   }
115
-}
115
+};
116 116
 
117 117
 /** 返回 */
118 118
 const returnPage = (row: any) => {
119
-    router.push({
120
-        path: '/InformationFilling/enterWarehouseInfo',
121
-        query: row
122
-    })
123
-}
119
+  router.push({
120
+    path: "/InformationFilling/enterWarehouseInfo",
121
+    query: row
122
+  });
123
+};
124 124
 </script>
125 125
 
126
-<style lang='scss' scoped>
127
-.operationbox{ text-align: center; margin-top: 30px;}
126
+<style lang="scss" scoped>
127
+.operationbox {
128
+  text-align: center;
129
+  margin-top: 30px;
130
+}
128 131
 </style>
129
-

+ 10 - 12
src/views/InformationFilling/enterWarehouseInfo/index.vue

@@ -33,9 +33,7 @@
33 33
       <el-table-column prop="dmUpname3" label="提交时间" align="center" />
34 34
       <el-table-column fixed="right" label="操作" width="150" align="center">
35 35
         <template #default>
36
-          <el-button link type="success" size="small" @click="handleClick"
37
-            >查看</el-button
38
-          >
36
+          <el-button link type="success" size="small" @click="handleClick">查看</el-button>
39 37
           <el-button link type="primary" size="small">编辑</el-button>
40 38
           <el-button link type="danger" size="small">删除</el-button>
41 39
         </template>
@@ -52,10 +50,10 @@
52 50
 </template>
53 51
 
54 52
 <script setup lang="ts">
55
-import { Plus } from '@element-plus/icons-vue'
53
+import { Plus } from "@element-plus/icons-vue";
56 54
 import { ref, reactive } from "vue";
57 55
 import { getSuppliesType } from "@/api/dataStatistics/index";
58
-import router from '@/router';
56
+import router from "@/router";
59 57
 
60 58
 const tableData: any = ref([]);
61 59
 const page = reactive({
@@ -64,15 +62,15 @@ const page = reactive({
64 62
   total: 0
65 63
 });
66 64
 const handleClick = () => {
67
-  console.log('click')
68
-}
65
+  console.log("click");
66
+};
69 67
 /** 添加/修改操作 */
70 68
 const openDetail = (row: any) => {
71
-    router.push({
72
-        path: '/InformationFilling/enterWarehouseInfoDetail',
73
-        query: row
74
-    })
75
-}
69
+  router.push({
70
+    path: "/InformationFilling/enterWarehouseInfoDetail",
71
+    query: row
72
+  });
73
+};
76 74
 const getList = () => {
77 75
   const data = reactive({
78 76
     size: page.pageSize,

+ 35 - 2
src/views/admin/menu/index.vue

@@ -51,6 +51,26 @@
51 51
         </template>
52 52
       </el-table-column>
53 53
     </el-table>
54
+
55
+    <el-dialog v-model="dialogVisible" :title="title" width="500" :before-close="handleClose">
56
+      <el-form :model="menuItem">
57
+        <el-row>
58
+          <el-col :span="12">
59
+            <el-form-item label="菜单类型">
60
+              <el-checkbox-group v-model="menuItem.menuType" size="large">
61
+                <el-checkbox-button label="左菜单" />
62
+              </el-checkbox-group>
63
+            </el-form-item>
64
+          </el-col>
65
+        </el-row>
66
+      </el-form>
67
+      <template #footer>
68
+        <div class="dialog-footer">
69
+          <el-button type="primary" @click="submitMenu">确 定</el-button>
70
+          <el-button @click="dialogVisible = false">取 消</el-button>
71
+        </div>
72
+      </template>
73
+    </el-dialog>
54 74
   </basic-container>
55 75
 </template>
56 76
 
@@ -66,6 +86,10 @@ const queryParams = ref<Params>({ menuName: "" }); // 搜索参数
66 86
 const menuList = ref([{}]); // 表格数据
67 87
 const loading = ref<boolean>(false); // 表格loading
68 88
 
89
+const dialogVisible = ref<boolean>(false); // 弹窗是否展开
90
+const title = ref<string>(""); // 弹窗标题
91
+const menuItem = ref<any>({}); // 菜单详情
92
+
69 93
 // 获取列表
70 94
 const getList = () => {
71 95
   loading.value = true;
@@ -74,15 +98,24 @@ const getList = () => {
74 98
   });
75 99
 };
76 100
 
77
-// 添加/修改菜单
101
+// 打开添加/修改菜单弹窗
78 102
 const addOrUpdateHandle = (isEdit: boolean, id?: string) => {
79
-  //
103
+  title.value = isEdit ? "修改" : "新增";
80 104
 };
81 105
 
82 106
 // 删除菜单
83 107
 const handleDelete = (row: any) => {
84 108
   //
85 109
 };
110
+
111
+// 提交新增/修改菜单
112
+const submitMenu = () => {
113
+  //
114
+};
115
+// 新增/修改弹窗关闭前
116
+const handleClose = (done: () => void) => {
117
+  done();
118
+};
86 119
 </script>
87 120
 
88 121
 <style lang="scss" scoped>

+ 0 - 0
src/views/admin/menu/menu-form.vue


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

@@ -72,16 +72,18 @@
72 72
 </template>
73 73
 <script setup lang="ts">
74 74
 import { ref } from "vue";
75
+import { useStore } from "vuex";
76
+import { useRouter } from "vue-router";
75 77
 import { randomLenNum } from "@/utils/util";
78
+import { ElMessage } from "element-plus";
76 79
 import type { FormInstance, FormRules } from "element-plus";
77 80
 import { ILogin, IVerificationCode } from "@/const/interface_type";
78 81
 import { UserFilled, Lock, Picture } from "@element-plus/icons-vue";
79
-import { useStore } from "vuex";
80 82
 
81 83
 const loginForm = ref<ILogin>({
82 84
   username: "",
83 85
   password: "",
84
-  // code: "",
86
+  code: "1890",
85 87
   randomStr: ""
86 88
 });
87 89
 const form = ref<FormInstance>();
@@ -97,6 +99,7 @@ const verificationCode = ref<IVerificationCode>({
97 99
 });
98 100
 
99 101
 const store = useStore();
102
+const router = useRouter();
100 103
 
101 104
 const refreshCode = () => {
102 105
   loginForm.value.randomStr = randomLenNum(verificationCode.value.lenth, true);
@@ -109,7 +112,15 @@ const loginSubmit = (formRef?: FormInstance) => {
109 112
   if (!formRef) return;
110 113
   formRef.validate((valid: boolean) => {
111 114
     if (valid) {
112
-      store.dispatch("LoginByUsername", loginForm.value);
115
+      store
116
+        .dispatch("LoginByUsername", loginForm.value)
117
+        .then(() => {
118
+          router.push(store.getters.tagWel.value);
119
+        })
120
+        .catch((err) => {
121
+          console.log(err);
122
+          ElMessage.warning("请检查用户名/密码后再次尝试");
123
+        });
113 124
     }
114 125
   });
115 126
 };

+ 1 - 7
tsconfig.json

@@ -18,12 +18,6 @@
18 18
     },
19 19
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
20 20
   },
21
-  "include": [
22
-    "src/**/*.ts",
23
-    "src/**/*.tsx",
24
-    "src/**/*.vue",
25
-    "tests/**/*.ts",
26
-    "tests/**/*.tsx"
27
-  ],
21
+  "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx"],
28 22
   "exclude": ["node_modules"]
29 23
 }