ljr-cli 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/demo1.js +39 -0
- package/lib/demo2.js +87 -0
- package/lib/index.js +220 -14
- package/lib/templates/flutter//346/210/221/346/230/257flutter.txt +0 -0
- package/lib/templates/java//346/210/221/346/230/257java.txt +0 -0
- package/lib/templates/monorepo//346/210/221/346/230/257monorepo.txt +0 -0
- package/lib/templates/mysql//346/210/221/346/230/257mysql.txt +0 -0
- package/lib/templates/node//346/210/221/346/230/257node.txt +0 -0
- package/lib/templates/qiankun//346/210/221/346/230/257qiankun.txt +0 -0
- package/lib/templates/react//346/210/221/346/230/257react.txt +0 -0
- package/lib/templates/uni-app//346/210/221/346/230/257uni-app.txt +0 -0
- package/lib/templates/vue2.7.16/.browserslistrc +3 -0
- package/lib/templates/vue2.7.16/.env +4 -0
- package/lib/templates/vue2.7.16/.env.development +7 -0
- package/lib/templates/vue2.7.16/.env.production +7 -0
- package/lib/templates/vue2.7.16/.eslintignore +3 -0
- package/lib/templates/vue2.7.16/.eslintrc.js +21 -0
- package/lib/templates/vue2.7.16/.prettierrc.js +11 -0
- package/lib/templates/vue2.7.16/.vscode/settings.json +10 -0
- package/lib/templates/vue2.7.16/README.md +71 -0
- package/lib/templates/vue2.7.16/babel.config.js +3 -0
- package/lib/templates/vue2.7.16/jsconfig.json +19 -0
- package/lib/templates/vue2.7.16/package.json +41 -0
- package/lib/templates/vue2.7.16/pnpm-lock.yaml +8171 -0
- package/lib/templates/vue2.7.16/public/favicon.svg +14 -0
- package/lib/templates/vue2.7.16/public/index.html +20 -0
- package/lib/templates/vue2.7.16/src/App.vue +14 -0
- package/lib/templates/vue2.7.16/src/api/interface/index.js +6 -0
- package/lib/templates/vue2.7.16/src/api/request.js +121 -0
- package/lib/templates/vue2.7.16/src/api/server/index.js +6 -0
- package/lib/templates/vue2.7.16/src/assets/logo.png +0 -0
- package/lib/templates/vue2.7.16/src/components/README.md +5 -0
- package/lib/templates/vue2.7.16/src/components/baseInfo/index.vue +29 -0
- package/lib/templates/vue2.7.16/src/components/baseInfo/item.vue +64 -0
- package/lib/templates/vue2.7.16/src/components/index.js +14 -0
- package/lib/templates/vue2.7.16/src/components/layout/left-menu-and-top-info.vue +121 -0
- package/lib/templates/vue2.7.16/src/components/pagination/index.vue +52 -0
- package/lib/templates/vue2.7.16/src/css/coverage-style.css +6 -0
- package/lib/templates/vue2.7.16/src/directive/index.js +16 -0
- package/lib/templates/vue2.7.16/src/directive/input-number.js +18 -0
- package/lib/templates/vue2.7.16/src/directive/permission.js +52 -0
- package/lib/templates/vue2.7.16/src/directive/re-click.js +12 -0
- package/lib/templates/vue2.7.16/src/global-config.js +12 -0
- package/lib/templates/vue2.7.16/src/main.js +79 -0
- package/lib/templates/vue2.7.16/src/prototype/README.md +1 -0
- package/lib/templates/vue2.7.16/src/prototype/el-dialog.js +127 -0
- package/lib/templates/vue2.7.16/src/prototype/index.js +53 -0
- package/lib/templates/vue2.7.16/src/router/index.js +257 -0
- package/lib/templates/vue2.7.16/src/store/index.js +50 -0
- package/lib/templates/vue2.7.16/src/store/modules/dd.js +128 -0
- package/lib/templates/vue2.7.16/src/store/modules/permissions.js +24 -0
- package/lib/templates/vue2.7.16/src/views/404.vue +7 -0
- package/lib/templates/vue2.7.16/src/views/Pitfalls//345/206/205/345/255/230/346/272/242/345/207/272/index.vue +56 -0
- package/lib/templates/vue2.7.16/src/views/Pitfalls//345/206/205/345/255/230/346/272/242/345/207/272//351/200/240/346/210/220vue2/345/206/205/345/255/230/346/272/242/345/207/272/347/232/204/345/257/271/350/261/241.js +33518 -0
- package/lib/templates/vue2.7.16/src/views/about.vue +5 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200store/346/225/260/346/215/256/345/255/227/345/205/270/index.vue +85 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200/345/274/271/347/252/227/ce.vue +42 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200/345/274/271/347/252/227/index.vue +24 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200/346/214/207/344/273/244/index.vue +78 -0
- package/lib/templates/vue2.7.16/src/views/demo//350/257/267/346/261/202/347/244/272/344/276/213/index.vue +51 -0
- package/lib/templates/vue2.7.16/src/views/home.vue +3 -0
- package/lib/templates/vue2.7.16/src/views/login.vue +67 -0
- package/lib/templates/vue2.7.16/src/views/template/base-info.vue +29 -0
- package/lib/templates/vue2.7.16/src/views/template/base-info2.vue +56 -0
- package/lib/templates/vue2.7.16/src/views/template/list/ce.vue +58 -0
- package/lib/templates/vue2.7.16/src/views/template/list/index.vue +111 -0
- package/lib/templates/vue2.7.16/src/views/template/list/search.vue +60 -0
- package/lib/templates/vue2.7.16/vue.config.js +26 -0
- package/lib/templates/vue3.5.25-2025.12.4/.editorconfig +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/.gitattributes +1 -0
- package/lib/templates/vue3.5.25-2025.12.4/.prettierrc.json +11 -0
- package/lib/templates/vue3.5.25-2025.12.4/.vscode/extensions.json +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/.vscode/settings.json +13 -0
- package/lib/templates/vue3.5.25-2025.12.4/README.md +93 -0
- package/lib/templates/vue3.5.25-2025.12.4/auto-imports.d.ts +78 -0
- package/lib/templates/vue3.5.25-2025.12.4/components.d.ts +28 -0
- package/lib/templates/vue3.5.25-2025.12.4/env.d.ts +1 -0
- package/lib/templates/vue3.5.25-2025.12.4/eslint.config.ts +32 -0
- package/lib/templates/vue3.5.25-2025.12.4/index.html +13 -0
- package/lib/templates/vue3.5.25-2025.12.4/package.json +47 -0
- package/lib/templates/vue3.5.25-2025.12.4/pnpm-lock.yaml +3515 -0
- package/lib/templates/vue3.5.25-2025.12.4/public/favicon.svg +14 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/App.vue +12 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/assets/vue.svg +1 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/index.ts +14 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/pinia.ts +10 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/router.ts +10 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/style.ts +9 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/css/coverage-style.css +6 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/directive/index.js +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/directive/rememberScrollPosition.ts +17 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/main.ts +7 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/router/index.ts +20 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/stores/counter.ts +12 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/views/AboutView.vue +3 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/views/HomeView.vue +14 -0
- package/lib/templates/vue3.5.25-2025.12.4/tsconfig.app.json +12 -0
- package/lib/templates/vue3.5.25-2025.12.4/tsconfig.json +11 -0
- package/lib/templates/vue3.5.25-2025.12.4/tsconfig.node.json +19 -0
- package/lib/templates/vue3.5.25-2025.12.4/vite.config.ts +31 -0
- package/lib/templates/wx-miniapp//346/210/221/346/230/257wx-miniapp.txt +0 -0
- package/package.json +16 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg width="178" height="163" viewBox="0 0 178 163" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_7002_5844)">
|
|
3
|
+
<path d="M170.41 58.9201C163.95 62.5901 160.77 63.0901 159.13 63.4801C148.67 65.9301 154.69 60.7301 155.82 60.0001C186.84 40.0601 176.7 23.8901 173 18.8101C169.25 13.6601 167.33 10.7601 165.53 6.99014C163.82 3.40014 163.09 1.93014 162.36 2.58014C161.03 3.76014 162.39 10.2501 166.08 17.6401C169.12 23.7301 169.53 27.7101 166.7 29.1501C164.18 30.4401 160.27 30.3101 156.07 27.2601C150.6 23.5301 149.32 10.8801 149.66 3.85014C149.87 -0.489863 148.68 -0.809863 147.95 1.14014C146.49 5.04014 145.68 11.8401 146.03 18.3501C146.46 26.2901 150.68 31.9501 156.94 38.1701C163.69 45.2201 159.21 51.6801 149.22 55.4001C133.29 61.3301 123.69 54.4301 118.69 46.8601C116.7 43.8401 114.93 43.5501 115.22 46.3201C115.59 49.7601 117.95 53.9501 119.97 58.3601C123.61 66.3001 119.82 71.6501 112.62 74.5401C106.6 76.9601 100.42 73.0201 97.28 69.4601C95.68 67.6501 93.25 69.1801 100.27 80.3901C101.83 82.8901 101.83 84.0301 100.68 85.3301C98.41 83.3601 96.41 82.4501 96.41 82.4501C98 79.5201 95.27 76.3201 95.27 76.3201C95.27 76.3201 95.47 77.7001 93.86 78.8901C94.02 75.5001 90.38 73.2501 90.38 73.2501C90.38 73.2501 91.54 77.4701 86.77 79.0501C85.17 79.5801 84.06 80.4101 83.5 81.7001C82.26 82.0201 81.05 82.4601 79.9 83.0001C78.69 83.4401 77.59 84.0901 76.6 84.9101C75.8 83.7601 75.94 82.6201 77.33 80.3801C84.35 69.1701 81.92 67.6401 80.32 69.4501C77.17 73.0201 71 76.9501 64.97 74.5301C57.77 71.6401 53.99 66.2901 57.62 58.3501C59.64 53.9401 62 49.7501 62.37 46.3101C62.66 43.5401 60.89 43.8301 58.9 46.8501C53.91 54.4301 44.3 61.3201 28.37 55.3901C18.37 51.6701 13.89 45.2201 20.65 38.1601C26.91 31.9501 31.13 26.2801 31.56 18.3401C31.91 11.8301 31.1 5.03014 29.64 1.13014C28.91 -0.819863 27.71 -0.499863 27.92 3.84014C28.26 10.8801 26.98 23.5301 21.51 27.2501C17.31 30.3001 13.41 30.4301 10.88 29.1401C8.05 27.6901 8.45 23.7201 11.5 17.6301C15.19 10.2501 16.55 3.76014 15.22 2.57014C14.49 1.92014 13.76 3.39014 12.05 6.98014C10.26 10.7501 8.34 13.6501 4.59 18.8001C0.889998 23.8701 -9.25 40.0501 21.77 59.9901C22.9 60.7101 28.92 65.9201 18.46 63.4701C16.82 63.0901 13.63 62.5801 7.18 58.9101C5.59 58.0101 1.81 56.8501 3.63 59.4101C7.28 64.5401 18.44 69.6701 34.37 70.6301C39.5 70.7601 54.01 76.4201 63.74 85.8501C63.68 85.8301 63.63 85.8001 63.57 85.7701C57.47 83.5301 55.22 85.7701 55.22 85.7701C53.45 87.3201 57.63 89.7701 60.2 95.0501C63.93 101.84 69.69 101.74 70.89 101.64C71.01 102.1 71.16 102.53 71.35 102.92C70.95 104.04 70.65 105.33 70.59 106.73C70.38 111.66 67.34 112.75 65.29 113.85C65.29 113.85 67.61 116.59 70.08 115.6C70.08 115.6 68.43 120.42 64.22 122.17C64.22 122.17 65.66 124.03 68.13 122.72C68.13 122.72 61.8 130.36 58.57 135.02L54.27 136.77H54.25V150.48H71.34C78.05 156.52 86.06 162.55 91.32 162.55C96.58 162.55 104.59 156.52 111.3 150.48H126.49V136.77H126.47L117.79 133.24C114.41 128.64 109.5 122.72 109.5 122.72C111.97 124.03 113.41 122.17 113.41 122.17C109.19 120.42 107.55 115.6 107.55 115.6C110.02 116.58 112.34 113.85 112.34 113.85C110.28 112.75 107.24 111.66 107.03 106.73C106.97 105.33 106.67 104.04 106.27 102.92C106.45 102.51 106.6 102.09 106.74 101.66C108.59 101.69 113.58 101.15 116.93 95.0501C119.5 89.7701 123.68 87.3101 121.91 85.7701C121.91 85.7701 119.81 83.7001 114.18 85.5601C123.9 76.3001 138.17 70.7601 143.25 70.6201C159.17 69.6601 170.34 64.5401 173.99 59.4001C175.81 56.8401 172.03 58.0001 170.44 58.9001L170.41 58.9201ZM79.52 87.2701C71.62 100.48 86.02 94.0401 85.51 102.99C85.01 111.94 85.3 117 88.93 119.01C92.56 121.02 96.49 120.72 91.75 121.62C87.01 122.53 86 118.5 84.59 124.94C83.18 131.38 95.58 129.46 93.06 131.27C90.54 133.08 85.9 131.87 83.38 131.27C80.86 130.66 81.77 129.36 80.56 126.24C79.35 123.12 75.52 120.91 75.52 120.91C76.23 118.6 74.71 113.77 76.23 114.98C77.74 116.19 82.38 118.2 82.28 117.6C82.18 116.99 81.47 117.1 80.37 114.98C79.26 112.87 77.38 111.39 75.9 109.92C74.42 108.44 77.65 106.43 76.57 103.89C75.49 101.34 72.4 101.34 72.4 101.34C69.44 89.8101 79.53 87.2601 79.53 87.2601L79.52 87.2701ZM124.13 139.11V148.19H122.74V146.21H121.27V148.19H118.52V147.01H117.05V148.19H114.3V147.01H112.83V148.19H110.08V147.01H108.61V148.19H105.86V147.01H104.39V148.19H101.64V146.21H100.17V148.19H97.42V147.01H95.95V148.19H93.2V147.01H91.73V148.19H88.98V147.01H87.51V148.19H84.76V147.01H83.29V148.19H80.54V146.21H79.07V148.19H76.32V147.01H74.85V148.19H72.1V147.01H70.63V148.19H67.88V147.01H66.41V148.19H63.66V147.01H62.19V148.19H59.44V146.21H57.97V148.19H56.58V139.11H124.17H124.13Z" fill="black"/>
|
|
4
|
+
<path d="M76.5 145.55H75.47V140.99L74.24 141.63V140.55L75.66 139.83H76.5V145.55Z" fill="black"/>
|
|
5
|
+
<path d="M84.86 139.97C85.17 140.13 85.41 140.36 85.59 140.65C85.76 140.94 85.85 141.27 85.85 141.65C85.85 141.89 85.83 142.1 85.78 142.28C85.73 142.46 85.67 142.63 85.6 142.79C85.53 142.95 85.39 143.18 85.21 143.49L84.03 145.55H82.81L84.07 143.46L84.05 143.44C83.89 143.51 83.7 143.54 83.5 143.54C83.18 143.54 82.88 143.46 82.61 143.31C82.34 143.16 82.12 142.94 81.97 142.65C81.82 142.36 81.73 142.04 81.73 141.68C81.73 141.3 81.82 140.96 82 140.66C82.18 140.36 82.42 140.13 82.74 139.97C83.06 139.81 83.41 139.72 83.81 139.72C84.21 139.72 84.55 139.8 84.86 139.97ZM84.5 142.35C84.69 142.17 84.79 141.94 84.79 141.65C84.79 141.36 84.7 141.12 84.51 140.93C84.32 140.74 84.08 140.65 83.78 140.65C83.48 140.65 83.25 140.74 83.06 140.93C82.87 141.12 82.78 141.35 82.78 141.65C82.78 141.95 82.87 142.17 83.05 142.35C83.23 142.53 83.46 142.62 83.75 142.62C84.05 142.62 84.3 142.53 84.5 142.35Z" fill="black"/>
|
|
6
|
+
<path d="M93.67 139.97C93.98 140.13 94.22 140.36 94.4 140.65C94.57 140.94 94.66 141.27 94.66 141.65C94.66 141.89 94.64 142.1 94.59 142.28C94.54 142.46 94.48 142.63 94.41 142.79C94.34 142.95 94.2 143.18 94.02 143.49L92.84 145.55H91.62L92.88 143.46L92.86 143.44C92.7 143.51 92.51 143.54 92.31 143.54C91.99 143.54 91.69 143.46 91.42 143.31C91.15 143.16 90.93 142.94 90.78 142.65C90.63 142.36 90.54 142.04 90.54 141.68C90.54 141.3 90.63 140.96 90.81 140.66C90.99 140.36 91.23 140.13 91.55 139.97C91.87 139.81 92.22 139.72 92.62 139.72C93.02 139.72 93.36 139.8 93.67 139.97ZM93.31 142.35C93.5 142.17 93.6 141.94 93.6 141.65C93.6 141.36 93.51 141.12 93.32 140.93C93.13 140.74 92.89 140.65 92.59 140.65C92.29 140.65 92.06 140.74 91.87 140.93C91.68 141.12 91.59 141.35 91.59 141.65C91.59 141.95 91.68 142.17 91.86 142.35C92.04 142.53 92.27 142.62 92.56 142.62C92.86 142.62 93.11 142.53 93.31 142.35Z" fill="black"/>
|
|
7
|
+
<path d="M101.59 142.09H101.72C102 142.09 102.26 142.15 102.51 142.29C102.76 142.43 102.95 142.63 103.1 142.88C103.25 143.13 103.32 143.44 103.32 143.79C103.32 144.14 103.24 144.48 103.07 144.76C102.9 145.04 102.67 145.26 102.37 145.41C102.07 145.56 101.73 145.64 101.34 145.64C100.88 145.64 100.48 145.53 100.14 145.31C99.8 145.09 99.55 144.8 99.38 144.44L100.19 143.89C100.32 144.16 100.48 144.36 100.66 144.5C100.85 144.64 101.07 144.71 101.34 144.71C101.61 144.71 101.85 144.63 102.02 144.46C102.19 144.29 102.28 144.07 102.28 143.79C102.28 143.51 102.19 143.28 102.02 143.11C101.85 142.94 101.61 142.86 101.32 142.84C101.13 142.84 100.93 142.9 100.73 143.02L100.17 142.29L101.66 140.77H99.57V139.81H103.02V140.65L101.56 142.03L101.58 142.07L101.59 142.09Z" fill="black"/>
|
|
8
|
+
</g>
|
|
9
|
+
<defs>
|
|
10
|
+
<clipPath id="clip0_7002_5844">
|
|
11
|
+
<rect width="177.56" height="162.58" fill="white"/>
|
|
12
|
+
</clipPath>
|
|
13
|
+
</defs>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
7
|
+
<link rel="shortcut icon" type="image/svg" href="./favicon.svg" />
|
|
8
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<noscript>
|
|
12
|
+
<strong
|
|
13
|
+
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please
|
|
14
|
+
enable it to continue.</strong
|
|
15
|
+
>
|
|
16
|
+
</noscript>
|
|
17
|
+
<div id="app"></div>
|
|
18
|
+
<!-- built files will be auto injected -->
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import axios from "axios"
|
|
2
|
+
import { Message, MessageBox } from "element-ui"
|
|
3
|
+
import globalConfig from "@/global-config.js"
|
|
4
|
+
|
|
5
|
+
// 请求头
|
|
6
|
+
axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8" // json类型
|
|
7
|
+
|
|
8
|
+
// 创建axios实例
|
|
9
|
+
const service = axios.create({
|
|
10
|
+
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
|
11
|
+
// 比如:process.env.VUE_APP_BASE_API = '/api' 或者 process.env.VUE_APP_BASE_API = 'http://www.xxxxx.com/api'
|
|
12
|
+
baseURL: process.env.VUE_APP_BASE_API,
|
|
13
|
+
timeout: 1000 * 30, // 超时时间
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
// 请求拦截器
|
|
17
|
+
service.interceptors.request.use(
|
|
18
|
+
(config) => {
|
|
19
|
+
// 在发送请求之前做些什么
|
|
20
|
+
config.headers["token"] = "abcdefg" // token存放的地方,让每个请求携带自定义token 请根据实际情况自行修改
|
|
21
|
+
|
|
22
|
+
return config
|
|
23
|
+
},
|
|
24
|
+
(error) => {
|
|
25
|
+
// 对请求错误做些什么
|
|
26
|
+
console.log("请求拦截器报错信息:", error)
|
|
27
|
+
return Promise.reject(new Error(error || "接口请求拦截报错"))
|
|
28
|
+
},
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
// 响应拦截器
|
|
32
|
+
service.interceptors.response.use(
|
|
33
|
+
(res) => {
|
|
34
|
+
// 对响应数据做点什么
|
|
35
|
+
const { message, code } = res.data
|
|
36
|
+
|
|
37
|
+
if (code === 200) {
|
|
38
|
+
return res.data
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (globalConfig.promptLogin && [401, 402, 403].includes(code)) {
|
|
42
|
+
MessageBox.confirm("登录状态已过期,您可以继续留在该页面,或者重新登录", "系统提示", {
|
|
43
|
+
confirmButtonText: "重新登录",
|
|
44
|
+
cancelButtonText: "取消",
|
|
45
|
+
type: "warning",
|
|
46
|
+
})
|
|
47
|
+
.then(() => {
|
|
48
|
+
// 跳转到登录页面
|
|
49
|
+
})
|
|
50
|
+
.catch(() => {
|
|
51
|
+
// 取消则什么都不做
|
|
52
|
+
})
|
|
53
|
+
return
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Message({
|
|
57
|
+
message,
|
|
58
|
+
type: "error",
|
|
59
|
+
})
|
|
60
|
+
return Promise.reject(new Error(message || "接口报错"))
|
|
61
|
+
},
|
|
62
|
+
(error) => {
|
|
63
|
+
// 对响应错误做点什么
|
|
64
|
+
// 这里指服务器的接口异常,不是指后端的代码报错
|
|
65
|
+
let { message } = error
|
|
66
|
+
|
|
67
|
+
if (message === "Network Error") {
|
|
68
|
+
message = "网络异常!"
|
|
69
|
+
}
|
|
70
|
+
if (message.includes("timeout")) {
|
|
71
|
+
message = "服务器请求超时!"
|
|
72
|
+
}
|
|
73
|
+
if (message.includes("Request failed with status code")) {
|
|
74
|
+
message = "服务器" + message.substr(message.length - 3) + "异常!"
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
Message({
|
|
78
|
+
message,
|
|
79
|
+
type: "error",
|
|
80
|
+
duration: 5 * 1000,
|
|
81
|
+
})
|
|
82
|
+
return Promise.reject(new Error(message || "服务器报错"))
|
|
83
|
+
},
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
const get = (url, params, otherConfig) => {
|
|
87
|
+
return service({
|
|
88
|
+
url,
|
|
89
|
+
method: "get",
|
|
90
|
+
headers: {
|
|
91
|
+
...otherConfig?.headers,
|
|
92
|
+
},
|
|
93
|
+
params: params,
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
const post = (url, params, otherConfig) => {
|
|
97
|
+
return service({
|
|
98
|
+
url,
|
|
99
|
+
method: "post",
|
|
100
|
+
headers: {
|
|
101
|
+
...otherConfig?.headers,
|
|
102
|
+
},
|
|
103
|
+
data: params,
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
const postFormData = (url, params, otherConfig) => {
|
|
107
|
+
return service({
|
|
108
|
+
url,
|
|
109
|
+
method: "post",
|
|
110
|
+
headers: {
|
|
111
|
+
"Content-Type": "application/x-www-form-urlencoded", // 窗体数据被编码为名称/值对。这是标准的编码格式。
|
|
112
|
+
// "Content-Type": "multiple/form-data", // 窗体数据被编码为一条消息,页上的每个控件对应消息中的一个部分。 formData格式也可以用这个
|
|
113
|
+
...otherConfig?.headers,
|
|
114
|
+
},
|
|
115
|
+
data: params,
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { service, get, post, postFormData }
|
|
120
|
+
|
|
121
|
+
export default { service, get, post, postFormData }
|
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container">
|
|
3
|
+
<slot :style="{ width: 100 / column + '%' }"></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: "BaseInfo",
|
|
10
|
+
props: {
|
|
11
|
+
/** 几列,注意:label跟value合起来是一列 */
|
|
12
|
+
column: {
|
|
13
|
+
type: [String, Number],
|
|
14
|
+
default: 4,
|
|
15
|
+
required: false,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style scoped>
|
|
22
|
+
.container {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
border-left: 1px solid var(--border-2, #e5e6eb);
|
|
26
|
+
border-top: 1px solid var(--border-2, #e5e6eb);
|
|
27
|
+
min-height: 50px;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container-item" :style="{ width: getWidth }">
|
|
3
|
+
<div class="container-item-label c-flex-cc">
|
|
4
|
+
<slot name="label">{{ label }}</slot>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="container-item-value c-flex-cc">
|
|
7
|
+
<slot name="value">{{ value }}</slot>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
export default {
|
|
14
|
+
name: "BaseInfoItem",
|
|
15
|
+
props: {
|
|
16
|
+
label: {
|
|
17
|
+
type: [String],
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
value: {
|
|
21
|
+
type: [String],
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
/** 几列,注意:label跟value合起来是一列 */
|
|
25
|
+
column: {
|
|
26
|
+
type: [String, Number],
|
|
27
|
+
default: 4,
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
computed: {
|
|
32
|
+
getWidth() {
|
|
33
|
+
return 100 / this.column + "%"
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style scoped>
|
|
40
|
+
.container-item {
|
|
41
|
+
/* 需要几个字段就用100%/几得出,比如一行显示4个字段,则为25% */
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
line-height: 1.25em;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
border-right: 1px solid var(--border-2, #e5e6eb);
|
|
47
|
+
border-bottom: 1px solid var(--border-2, #e5e6eb);
|
|
48
|
+
display: flex;
|
|
49
|
+
}
|
|
50
|
+
.container-item:last-child {
|
|
51
|
+
flex: 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.container-item-label {
|
|
55
|
+
padding: 10px;
|
|
56
|
+
border-right: 1px solid var(--border-2, #e5e6eb);
|
|
57
|
+
width: 150px;
|
|
58
|
+
background-color: var(--fill-2, #f2f3f5);
|
|
59
|
+
}
|
|
60
|
+
.container-item-value {
|
|
61
|
+
padding: 10px;
|
|
62
|
+
flex: 1;
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Vue from "vue"
|
|
2
|
+
import globalConfig from "@/global-config.js"
|
|
3
|
+
|
|
4
|
+
const requireComponent = require.context(
|
|
5
|
+
"../components", // 其组件目录的相对路径
|
|
6
|
+
true, // 是否查询其子目录
|
|
7
|
+
/\.vue$/, // 匹配基础组件文件名的正则表达式
|
|
8
|
+
)
|
|
9
|
+
requireComponent.keys().forEach((fileName) => {
|
|
10
|
+
const componentConfig = requireComponent(fileName)
|
|
11
|
+
// 兼容 import export 和 require module.export 两种规范
|
|
12
|
+
const comp = componentConfig.default || componentConfig
|
|
13
|
+
comp.name && Vue.component(globalConfig.prefix + comp.name, comp)
|
|
14
|
+
})
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout">
|
|
3
|
+
<!-- 左侧 -->
|
|
4
|
+
<div class="c-rightLine left c-box-shadow">
|
|
5
|
+
<el-scrollbar style="width: 100%; height: 100%" wrap-class="scrollbar-wrapper">
|
|
6
|
+
<el-menu
|
|
7
|
+
:default-active="$route.path"
|
|
8
|
+
:collapse="isCollapse"
|
|
9
|
+
class="el-menu-vertical-demo"
|
|
10
|
+
@select="changeMenu"
|
|
11
|
+
>
|
|
12
|
+
<template v-for="(menu1, index) in menu">
|
|
13
|
+
<!-- 没有子级 -->
|
|
14
|
+
<el-menu-item v-if="!menu1.children?.length" :key="index" :index="menu1.fullPath">
|
|
15
|
+
<i v-if="menu1.titleIcon" :class="menu1.titleIcon"></i>
|
|
16
|
+
<span slot="title">{{ menu1.title }}</span>
|
|
17
|
+
</el-menu-item>
|
|
18
|
+
|
|
19
|
+
<!-- 有子级 -->
|
|
20
|
+
<template v-if="menu1.children?.length">
|
|
21
|
+
<el-submenu :key="index" :index="menu1.fullPath">
|
|
22
|
+
<template slot="title">
|
|
23
|
+
<i v-if="menu1.titleIcon" :class="menu1.titleIcon"></i>
|
|
24
|
+
<span>{{ menu1.title }}</span>
|
|
25
|
+
</template>
|
|
26
|
+
<el-menu-item v-for="(menu2, menu2Index) in menu1.children" :key="menu2Index" :index="menu2.fullPath">
|
|
27
|
+
<i v-if="menu2.titleIcon" :class="menu2.titleIcon"></i>
|
|
28
|
+
<span>{{ menu2.title }}</span>
|
|
29
|
+
</el-menu-item>
|
|
30
|
+
</el-submenu>
|
|
31
|
+
</template>
|
|
32
|
+
</template>
|
|
33
|
+
</el-menu>
|
|
34
|
+
</el-scrollbar>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<!-- 右侧 -->
|
|
38
|
+
<div class="right">
|
|
39
|
+
<div class="top c-underline c-box-shadow">
|
|
40
|
+
<i v-show="!isCollapse" class="el-icon-s-fold" title="收起" @click="isCollapse = true"></i>
|
|
41
|
+
<i v-show="isCollapse" class="el-icon-s-unfold" title="展开" @click="isCollapse = false"></i>
|
|
42
|
+
</div>
|
|
43
|
+
<!-- 这里默认是有加padding的,除非路由有配置needPadding: false -->
|
|
44
|
+
<div class="content" :style="{ padding: $route.meta.needPadding === false ? '' : '10px' }">
|
|
45
|
+
<transition name="el-fade-in-linear" mode="out-in">
|
|
46
|
+
<router-view></router-view>
|
|
47
|
+
</transition>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script>
|
|
54
|
+
import { getMenu } from "@/router/index.js"
|
|
55
|
+
|
|
56
|
+
export default {
|
|
57
|
+
name: "LeftMenuAndTopInfo",
|
|
58
|
+
data() {
|
|
59
|
+
return {
|
|
60
|
+
menu: [],
|
|
61
|
+
isCollapse: false, // 是否折叠菜单
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
created() {
|
|
65
|
+
this.menu = getMenu()
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
changeMenu(index, indexPath) {
|
|
69
|
+
// 判断当前路由跟要去的路由是否一样
|
|
70
|
+
if (this.$route.path === index) return
|
|
71
|
+
this.$router.push({ path: index })
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style scoped>
|
|
78
|
+
:deep .scrollbar-wrapper {
|
|
79
|
+
overflow-x: hidden;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:deep .el-menu-vertical-demo:not(.el-menu--collapse) {
|
|
83
|
+
width: 240px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.layout {
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 100%;
|
|
89
|
+
position: relative;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
display: flex;
|
|
92
|
+
.left {
|
|
93
|
+
height: 100%;
|
|
94
|
+
position: relative;
|
|
95
|
+
transition: width 0.2s;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.right {
|
|
99
|
+
flex: 1;
|
|
100
|
+
height: 100%;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
.top {
|
|
105
|
+
height: 50px;
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
padding: 0 10px;
|
|
109
|
+
}
|
|
110
|
+
.content {
|
|
111
|
+
flex: 1;
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.el-icon-s-fold,
|
|
118
|
+
.el-icon-s-unfold {
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 分页 -->
|
|
3
|
+
<el-pagination
|
|
4
|
+
:current-page="currentPage"
|
|
5
|
+
:page-size="pageSize"
|
|
6
|
+
:page-sizes="pageSizes"
|
|
7
|
+
:layout="layout"
|
|
8
|
+
:total="total"
|
|
9
|
+
@size-change="handleSizeChange"
|
|
10
|
+
@current-change="handleCurrentChange"
|
|
11
|
+
>
|
|
12
|
+
</el-pagination>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: "Pagination",
|
|
18
|
+
props: {
|
|
19
|
+
currentPage: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 1,
|
|
22
|
+
},
|
|
23
|
+
pageSize: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 20,
|
|
26
|
+
},
|
|
27
|
+
pageSizes: {
|
|
28
|
+
type: [Array],
|
|
29
|
+
default: () => [20, 50, 100, 200],
|
|
30
|
+
},
|
|
31
|
+
layout: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "total, sizes, prev, pager, next, jumper",
|
|
34
|
+
},
|
|
35
|
+
total: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 0,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
methods: {
|
|
41
|
+
handleSizeChange(val) {
|
|
42
|
+
this.$emit("update:currentPage", 1)
|
|
43
|
+
this.$emit("update:pageSize", val)
|
|
44
|
+
this.$emit("change")
|
|
45
|
+
},
|
|
46
|
+
handleCurrentChange(val) {
|
|
47
|
+
this.$emit("update:currentPage", val)
|
|
48
|
+
this.$emit("change")
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import permission from "./permission.js"
|
|
2
|
+
import inputNumber from "./input-number.js"
|
|
3
|
+
import reClick from "./re-click.js"
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
install(Vue) {
|
|
7
|
+
// 权限指令
|
|
8
|
+
Vue.directive("permission", permission)
|
|
9
|
+
|
|
10
|
+
// 输入框只允许数字指令
|
|
11
|
+
Vue.directive("input-number", inputNumber)
|
|
12
|
+
|
|
13
|
+
// 防止重复点击
|
|
14
|
+
Vue.directive("re-click", reClick)
|
|
15
|
+
},
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
bind(el, binding) {
|
|
3
|
+
const elNode = el.tagName === "INPUT" ? el : el.querySelector("input")
|
|
4
|
+
elNode.addEventListener("input", function () {
|
|
5
|
+
let value = elNode.value
|
|
6
|
+
if (binding.modifiers.float) {
|
|
7
|
+
// 浮点数修饰符
|
|
8
|
+
// 替换数字和点, 补充0
|
|
9
|
+
value = value.replace(/[^\d.]/g, "")
|
|
10
|
+
value = value.replace(/\.{2,}/g, ".")
|
|
11
|
+
value = value.replace(/^\./g, "0.")
|
|
12
|
+
} else {
|
|
13
|
+
value = elNode.value.replace(/[^\d]/g, "")
|
|
14
|
+
}
|
|
15
|
+
elNode.value = value
|
|
16
|
+
})
|
|
17
|
+
},
|
|
18
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import store from "@/store"
|
|
2
|
+
|
|
3
|
+
/** 检查权限 */
|
|
4
|
+
function checkPermission(el, binding) {
|
|
5
|
+
const { value } = binding
|
|
6
|
+
const permissions = store?.getters?.permissions
|
|
7
|
+
|
|
8
|
+
// 为空则报错
|
|
9
|
+
if (!value || (Array.isArray(value) && value.length === 0)) {
|
|
10
|
+
throw new Error(
|
|
11
|
+
`v-permission指令需要数组或者字符串格式! 像 v-permission="['permissionName','permissionName']" || v-permission="'permissionName'"`,
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// 如果没有任何权限则直接移除
|
|
16
|
+
if (!permissions.length) {
|
|
17
|
+
el?.parentNode?.removeChild(el)
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// 如果权限包含 -1 则表示拥有管理员权限,什么都不做
|
|
22
|
+
if (permissions.includes(-1)) {
|
|
23
|
+
return true
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 字符串
|
|
27
|
+
if (typeof value === "string") {
|
|
28
|
+
if (!permissions.includes(value)) {
|
|
29
|
+
el?.parentNode?.removeChild(el)
|
|
30
|
+
}
|
|
31
|
+
return
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 数组
|
|
35
|
+
if (Array.isArray(value)) {
|
|
36
|
+
if (!permissions.some((s) => value.includes(s))) {
|
|
37
|
+
el?.parentNode?.removeChild(el)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
/** 插入后 */
|
|
44
|
+
inserted(el, binding) {
|
|
45
|
+
checkPermission(el, binding)
|
|
46
|
+
},
|
|
47
|
+
/** 更新,权限一般在登录的时候记录,在页面的时候不会做修改,所以这里不需要更新 */
|
|
48
|
+
update(el, binding) {
|
|
49
|
+
// checkPermission(el, binding)
|
|
50
|
+
},
|
|
51
|
+
// 还有其他钩子函数,如 bind,unbind 等,可根据需要添加
|
|
52
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
inserted(el, binding) {
|
|
3
|
+
el.addEventListener("click", () => {
|
|
4
|
+
if (el.style["pointer-events"] !== "none") {
|
|
5
|
+
el.style["pointer-events"] = "none"
|
|
6
|
+
setTimeout(() => {
|
|
7
|
+
el.style["pointer-events"] = "all"
|
|
8
|
+
}, binding.value || 1500)
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
},
|
|
12
|
+
}
|