@ganwei-web/ganwei-pc-cli 6.3.1 → 6.3.3
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/ganwei-iotcenter-index-6.2.3/configuration/moduleConfiguration.json +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/public/static/js/getLanguage.js +9 -10
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/public/static/themes/dark-6-1.css +425 -0
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/public/static/themes/light-6-1.css +419 -0
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/App.vue +10 -35
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/components/indexRightContent/headerRight/expirationReminder/index.vue +7 -3
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/components/layouts/Navigation/AsideMenu.vue +4 -3
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/router.js +120 -18
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/date.ts +2 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/dom.ts +2 -2
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/env.ts +6 -0
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/file.ts +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/number.ts +6 -6
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/performance.ts +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/string.ts +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/xss-filter.ts +4 -0
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/views/jumpIframe/index.vue +2 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-template/.eslintrc.cjs +2 -2
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-template/package.json +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-template/src/App.vue +1 -2
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-template/src/views/template.vue +5 -1
- package/package.json +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/mixins/judgePermission.js +0 -65
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-template/src/request/models/request/index.ts +0 -0
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-template/src/request/models/response/index.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import dayjs from 'dayjs'
|
|
2
2
|
import relativeTime from 'dayjs/plugin/relativeTime'
|
|
3
|
+
|
|
3
4
|
import 'dayjs/locale/zh-cn'
|
|
4
5
|
|
|
5
6
|
dayjs.extend(relativeTime)
|
|
@@ -16,7 +17,7 @@ dayjs.locale('zh-cn')
|
|
|
16
17
|
*/
|
|
17
18
|
export function formatDate(
|
|
18
19
|
date: Date | number | string,
|
|
19
|
-
format
|
|
20
|
+
format = 'YYYY-MM-DD HH:mm:ss'
|
|
20
21
|
): string {
|
|
21
22
|
return dayjs(date).format(format)
|
|
22
23
|
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
export const ENV = {
|
|
2
|
+
|
|
2
3
|
/** 应用标题 */
|
|
3
4
|
APP_TITLE: import.meta.env.VITE_APP_TITLE,
|
|
5
|
+
|
|
4
6
|
/** 应用端口 */
|
|
5
7
|
APP_VERSION: import.meta.env.VITE_APP_PORT,
|
|
8
|
+
|
|
6
9
|
/** proxy代理配置 */
|
|
7
10
|
APP_ENV: import.meta.env.VITE_APP_TARGET_URL,
|
|
11
|
+
|
|
8
12
|
/** 本地地址 */
|
|
9
13
|
API_URL: import.meta.env.VITE_APP_THIS_URL,
|
|
14
|
+
|
|
10
15
|
/** 是否开发环境 */
|
|
11
16
|
IS_DEV: import.meta.env.DEV,
|
|
17
|
+
|
|
12
18
|
/** 是否生产环境 */
|
|
13
19
|
IS_PROD: import.meta.env.PROD
|
|
14
20
|
} as const
|
|
@@ -36,7 +36,7 @@ export function fileToBase64(file: File): Promise<string> {
|
|
|
36
36
|
*/
|
|
37
37
|
export function base64ToBlob(
|
|
38
38
|
base64: string,
|
|
39
|
-
mimeType
|
|
39
|
+
mimeType = 'application/octet-stream'
|
|
40
40
|
): Blob {
|
|
41
41
|
const byteString = atob(base64.split(',')[1])
|
|
42
42
|
const arrayBuffer = new ArrayBuffer(byteString.length)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param decimals - 小数位数,默认 0
|
|
5
5
|
* @returns 格式化后的数字字符串
|
|
6
6
|
*/
|
|
7
|
-
export function formatNumber(num: number | string, decimals
|
|
7
|
+
export function formatNumber(num: number | string, decimals = 0): string {
|
|
8
8
|
const number = Number(num)
|
|
9
9
|
if (isNaN(number)) return '0'
|
|
10
10
|
|
|
@@ -22,8 +22,8 @@ export function formatNumber(num: number | string, decimals: number = 0): string
|
|
|
22
22
|
*/
|
|
23
23
|
export function formatMoney(
|
|
24
24
|
amount: number | string,
|
|
25
|
-
currency
|
|
26
|
-
decimals
|
|
25
|
+
currency = '¥',
|
|
26
|
+
decimals = 2
|
|
27
27
|
): string {
|
|
28
28
|
const number = Number(amount)
|
|
29
29
|
if (isNaN(number)) return `${currency}0.00`
|
|
@@ -38,7 +38,7 @@ export function formatMoney(
|
|
|
38
38
|
*/
|
|
39
39
|
export function formatPercent(
|
|
40
40
|
value: number | string,
|
|
41
|
-
decimals
|
|
41
|
+
decimals = 2
|
|
42
42
|
): string {
|
|
43
43
|
const number = Number(value)
|
|
44
44
|
if (isNaN(number)) return '0%'
|
|
@@ -51,7 +51,7 @@ export function formatPercent(
|
|
|
51
51
|
* @param bytes - 字节数
|
|
52
52
|
* @param decimals - 小数位数,默认 2
|
|
53
53
|
*/
|
|
54
|
-
export function formatFileSize(bytes: number, decimals
|
|
54
|
+
export function formatFileSize(bytes: number, decimals = 2): string {
|
|
55
55
|
if (bytes === 0) return '0 B'
|
|
56
56
|
|
|
57
57
|
const k = 1024
|
|
@@ -78,6 +78,6 @@ export function random(min: number, max: number): number {
|
|
|
78
78
|
/**
|
|
79
79
|
* 生成随机 ID
|
|
80
80
|
*/
|
|
81
|
-
export function generateId(prefix
|
|
81
|
+
export function generateId(prefix = ''): string {
|
|
82
82
|
return `${prefix}${Date.now()}${Math.random().toString(36).substr(2, 9)}`
|
|
83
83
|
}
|
package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/performance.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export function debounce<T extends (...args: any[]) => any>(
|
|
8
8
|
func: T,
|
|
9
9
|
wait: number,
|
|
10
|
-
immediate
|
|
10
|
+
immediate = false
|
|
11
11
|
): (...args: Parameters<T>) => ReturnType<T> | undefined {
|
|
12
12
|
let timeout: ReturnType<typeof setTimeout> | null = null
|
|
13
13
|
|
|
@@ -64,7 +64,7 @@ export function maskAddress(address: string): string {
|
|
|
64
64
|
/**
|
|
65
65
|
* 截断字符串
|
|
66
66
|
*/
|
|
67
|
-
export function truncate(str: string, length: number, suffix
|
|
67
|
+
export function truncate(str: string, length: number, suffix = '...'): string {
|
|
68
68
|
if (str.length <= length) return str
|
|
69
69
|
return str.substring(0, length) + suffix
|
|
70
70
|
}
|
package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/xss-filter.ts
CHANGED
|
@@ -109,12 +109,16 @@ export function stripJavascriptProtocol(str: string): string {
|
|
|
109
109
|
* @returns 过滤后的安全字符串
|
|
110
110
|
*/
|
|
111
111
|
export interface XssFilterOptions {
|
|
112
|
+
|
|
112
113
|
/** 是否转义 HTML,默认 true */
|
|
113
114
|
escapeHtml?: boolean
|
|
115
|
+
|
|
114
116
|
/** 是否移除危险标签,默认 true */
|
|
115
117
|
stripDangerousTags?: boolean
|
|
118
|
+
|
|
116
119
|
/** 是否移除危险属性,默认 true */
|
|
117
120
|
stripDangerousAttrs?: boolean
|
|
121
|
+
|
|
118
122
|
/** 是否移除 javascript 协议,默认 true */
|
|
119
123
|
stripJavascriptProtocol?: boolean
|
|
120
124
|
}
|
|
@@ -26,12 +26,12 @@ module.exports = {
|
|
|
26
26
|
plugins: ['vue', '@typescript-eslint'],
|
|
27
27
|
|
|
28
28
|
/*
|
|
29
|
-
|
|
29
|
+
下面这些rules是用来设置从插件来的规范代码的规则,使用必须去掉前缀eslint-plugin-
|
|
30
30
|
主要有如下的设置规则,可以设置字符串也可以设置数字,两者效果一致
|
|
31
31
|
"off" -> 0 关闭规则
|
|
32
32
|
"warn" -> 1 开启警告规则
|
|
33
33
|
"error" -> 2 开启错误规则
|
|
34
|
-
|
|
34
|
+
*/
|
|
35
35
|
// 参数说明:
|
|
36
36
|
// 参数1 : 错误等级
|
|
37
37
|
// 参数2 : 处理方式
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@babel/eslint-parser": "^7.25.9",
|
|
15
15
|
"@element-plus/icons-vue": "^2.3.1",
|
|
16
16
|
"@ganwei-web/gw-base-api-plus": "^1.0.1",
|
|
17
|
-
"@ganwei-web/gw-base-components-plus": "^1.0.
|
|
17
|
+
"@ganwei-web/gw-base-components-plus": "^1.0.21",
|
|
18
18
|
"@ganwei-web/gw-base-style-plus": "^1.0.0",
|
|
19
19
|
"@ganwei-web/gw-base-utils-plus": "^1.0.1",
|
|
20
20
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script setup lang="ts">
|
|
10
|
-
import { computed } from 'vue'
|
|
10
|
+
import { computed, onMounted } from 'vue'
|
|
11
11
|
import { ElConfigProvider } from 'element-plus'
|
|
12
12
|
import enUs from 'element-plus/es/locale/lang/en'
|
|
13
13
|
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
|
14
14
|
import muduleObserve from '@ganwei-web/gw-base-utils-plus/moduleObserve/dist/index.es.js'
|
|
15
15
|
import { setTheme } from './utils/storage'
|
|
16
|
-
import { onMounted } from 'vue'
|
|
17
16
|
// ==================== 语言配置 ====================
|
|
18
17
|
const locale = computed(() => {
|
|
19
18
|
return localStorage.languageType !== 'zh-CN' ? enUs : zhCn
|
package/package.json
CHANGED
package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/mixins/judgePermission.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export default {
|
|
3
|
-
data: () => ({
|
|
4
|
-
isLogin: false,
|
|
5
|
-
requestTimeout: 3000 // 请求超时时间
|
|
6
|
-
}),
|
|
7
|
-
created() {
|
|
8
|
-
let isLgStatus = window.getParameterMap().get('isLgStatus')
|
|
9
|
-
if (isLgStatus) {
|
|
10
|
-
sessionStorage.setItem('isLgStatus', isLgStatus);
|
|
11
|
-
}
|
|
12
|
-
if (isLgStatus == 'false') {
|
|
13
|
-
this.jumpLogin()
|
|
14
|
-
return
|
|
15
|
-
}
|
|
16
|
-
console.time("getSystemInfo")
|
|
17
|
-
this.checkLoginStatus()
|
|
18
|
-
let map = window?.getParameterMap() || {}
|
|
19
|
-
if (process.env.NODE_ENV == "development" && map) {
|
|
20
|
-
if (map.get("languageType")) { sessionStorage.languageType = localStorage.languageType = map.get("languageType") }
|
|
21
|
-
sessionStorage.userName = map.get("userName")
|
|
22
|
-
sessionStorage.passwordPolicy = map.get("passwordPolicy")
|
|
23
|
-
if (map.get("multiPark")) { localStorage.multiPark = map.get("multiPark") }
|
|
24
|
-
if (!sessionStorage.getItem('theme') || sessionStorage.getItem('theme') == 'null' || sessionStorage.getItem('theme') == 'undefined') {
|
|
25
|
-
sessionStorage.setItem('theme', map.get("theme"))
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
methods: {
|
|
30
|
-
// 带超时的请求
|
|
31
|
-
fetchWithTimeout(promise, timeout) {
|
|
32
|
-
return Promise.race([
|
|
33
|
-
promise,
|
|
34
|
-
new Promise((_, reject) =>
|
|
35
|
-
setTimeout(() => reject(new Error('请求超时')), timeout)
|
|
36
|
-
)
|
|
37
|
-
])
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
// 检查登录状态
|
|
41
|
-
async checkLoginStatus() {
|
|
42
|
-
try {
|
|
43
|
-
const res = await this.fetchWithTimeout(
|
|
44
|
-
this.$api.getSystemInfo(),
|
|
45
|
-
this.requestTimeout
|
|
46
|
-
)
|
|
47
|
-
console.timeEnd("getSystemInfo")
|
|
48
|
-
|
|
49
|
-
if (res?.data?.code == 200 || res?.data?.code == -99999) {
|
|
50
|
-
this.isLogin = true
|
|
51
|
-
} else {
|
|
52
|
-
this.jumpLogin()
|
|
53
|
-
}
|
|
54
|
-
} catch (err) {
|
|
55
|
-
console.log('登录验证失败:', err?.message || err)
|
|
56
|
-
this.jumpLogin()
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
jumpLogin() {
|
|
61
|
-
let url = (process.env.NODE_ENV === "development" ? this.$hostMap('ganwei-iotcenter-login') : '/ganwei-iotcenter-login/#/')
|
|
62
|
-
window.location.href = url
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
File without changes
|
|
File without changes
|