-
-
-
-
- {{ item.title }}
- {{ item.days }}
-
-
+
+
+ {{ item.name }}
+ {{ item.count }}天
-
-
-
+
+
+
+
diff --git a/src/views/Home/echarts-data.ts b/src/views/Home/echarts-data.ts
deleted file mode 100644
index fa78b2b..0000000
--- a/src/views/Home/echarts-data.ts
+++ /dev/null
@@ -1,148 +0,0 @@
-import { EChartsOption } from 'echarts'
-
-const { t } = useI18n()
-
-
-export const pieOptions: EChartsOption = {
- title: {
- text: '完成率90%',
- left: 'center',
- top: '35%',
- textStyle: {
- fontSize: 16,
- fontWeight: 'bold'
- }
- },
- tooltip: {
- trigger: 'item',
- formatter: '{a}
{b} : {c} ({d}%)'
- },
- legend: {
- orient: 'horizontal',
- bottom: 10,
- left: 'center',
-
- data: [
- '执法一队',
- '执法二队',
- '执法三队',
- '执法四队',
- '执法五队',
- ]
- },
- series: [
- {
- name: t('analysis.userAccessSource'),
- type: 'pie',
- radius: ['40%', '70%'],
- center: ['50%', '40%'],
- itemStyle: {
- borderRadius: 10,
- borderColor: '#fff',
- borderWidth: 2
- },
- data: [
- { value: 335, name: '执法一队' },
- { value: 310, name: '执法二队' },
- { value: 234, name:'执法三队' },
- { value: 135, name: '执法四队' },
- { value: 1548, name: '执法五队' }
- ]
- }
- ]
-}
-
-export const barOptions: EChartsOption = {
- title: {
- text: '月均执法任务数',
- left: 'center'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- }
- },
- grid: {
- left: 50,
- right: 20,
- bottom: 20
- },
- xAxis: {
- type: 'category',
- data: [
- '一月',
- '二月',
- '三月',
- '四月',
- '五月',
- '六月',
-
- ],
- axisTick: {
- alignWithLabel: true
- }
- },
- yAxis: {
- type: 'value'
- },
- series: [
- {
- name: t('analysis.activeQuantity'),
- data: [13253, 34235, 26321, 12340, 24643, 1322, 1324],
- type: 'bar'
- }
- ]
-}
-
-export const lineOptions: EChartsOption = {
- title: {
- text: '月均执法任务数',
- left: 'center'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- }
- },
- grid: {
- left: 50,
- right: 20,
- bottom: 20
- },
- xAxis: {
- type: 'category',
- data: [
- '一月',
- '二月',
- '三月',
- '四月',
- '五月',
- '六月',
-
- ],
- axisTick: {
- alignWithLabel: true
- }
- },
- yAxis: {
- type: 'value'
- },
- series: [
- {
- name: '任务数',
- data: [13253, 34235, 26321, 12340, 24643, 1322, 1324],
- type: 'line'
- },
- {
- name: '执法数',
- data: [15678, 28943, 31452, 19876, 22345, 25678, 18234],
- type: 'line'
- }
-
- ]
-}
-
-
-
diff --git a/src/views/Home/types.ts b/src/views/Home/types.ts
deleted file mode 100644
index 6ab1622..0000000
--- a/src/views/Home/types.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-export type WorkplaceTotal = {
- project: number
- access: number
- todo: number
-}
-
-export type Project = {
- name: string
- icon: string
- message: string
- personal: string
- time: Date | number | string
-}
-
-
-
-export type Shortcut = {
- name: string
- icon: string
- url: string
-}
-
-export type RadarData = {
- personal: number
- team: number
- max: number
- name: string
-}
-export type AnalysisTotalTypes = {
- users: number
- messages: number
- moneys: number
- shoppings: number
-}
-
-export type UserAccessSource = {
- value: number
- name: string
-}
-
-export type WeeklyUserActivity = {
- value: number
- name: string
-}
-
-export type MonthlySales = {
- name: string
- estimate: number
- actual: number
-}
diff --git a/src/views/Login/components/QrCodeForm.vue b/src/views/Login/components/QrCodeForm.vue
index 2df70af..2d0e7a0 100644
--- a/src/views/Login/components/QrCodeForm.vue
+++ b/src/views/Login/components/QrCodeForm.vue
@@ -3,15 +3,30 @@
-
-
-
+
+
-
-
+
+
-
-
+
+
@@ -24,104 +39,103 @@ import { LoginStateEnum, useLoginState } from './useLogin'
import router from '@/router'
defineOptions({ name: 'QrCodeForm' })
-const imageUrl = ref('');
-const uuuid =ref('')
+const imageUrl = ref('')
+const uuuid = ref('')
const refreshQR = ref(false)
const { t } = useI18n()
const { handleBackLogin, getLoginState } = useLoginState()
const getShow = computed(() => true)
// 存储定时器 ID,用于后续清除定时器
-let intervalId = ref();
+let intervalId = ref()
const handleRefresh = () => {
window.location.reload()
}
-const getimg =async ()=>{
-
- const array = new Uint32Array(4);
- crypto.getRandomValues(array);
- let result = '';
+const getimg = async () => {
+ const array = new Uint32Array(4)
+ crypto.getRandomValues(array)
+ let result = ''
array.forEach((value) => {
- result += value.toString(16).padStart(8, '0');
- });
- uuuid.value = result;
+ result += value.toString(16).padStart(8, '0')
+ })
+ uuuid.value = result
- var mockBinaryData = await LoginApi.getCodeWebPic({
- scene:uuuid.value,
+ var mockBinaryData = await LoginApi.getCodeWebPic({
+ scene: uuuid.value,
path: 'sub/common/waiting',
checkPath: false
- });
+ })
// 对 Base64 编码的字符串进行解码
- const binaryString = atob(mockBinaryData);
- const len = binaryString.length;
- const bytes = new Uint8Array(len);
- for (let i = 0; i < len; i++) {
- bytes[i] = binaryString.charCodeAt(i);
- }
+ const binaryString = atob(mockBinaryData)
+ const len = binaryString.length
+ const bytes = new Uint8Array(len)
+ for (let i = 0; i < len; i++) {
+ bytes[i] = binaryString.charCodeAt(i)
+ }
// 将二进制数据转换为Blob对象
- const blob = new Blob([bytes], { type: 'image/png' });
+ const blob = new Blob([bytes], { type: 'image/png' })
// 创建临时的URL
- imageUrl.value = URL.createObjectURL(blob);
+ imageUrl.value = URL.createObjectURL(blob)
//开始刷新扫码信息
- refaulst();
+ refaulst()
}
// 记录定时器开始的时间
-const startTime = Date.now();
+const startTime = Date.now()
// 10 分钟的毫秒数
-const tenMinutes = 10 *60 * 10000 ;
+const tenMinutes = 10 * 60 * 10000
//定时刷新 判断是否扫码允许
-const refaulst = ()=>{
- refreshQR.value = false;
- // 先清除之前的定时器,避免重复调用
- if (intervalId) {
- clearInterval(intervalId.value);
+const refaulst = () => {
+ refreshQR.value = false
+ // 先清除之前的定时器,避免重复调用
+ if (intervalId) {
+ clearInterval(intervalId.value)
}
// 设置定时器,每 5 秒(可根据实际需求调整)调用一次接口
intervalId.value = setInterval(async () => {
try {
-
// 检查是否已经过去了 10 分钟
- if (Date.now() - startTime >= tenMinutes) {
- clearInterval(intervalId.value);
- console.log('定时器已停止,已过去 10 分钟。');
- refreshQR.value = true;
+ if (Date.now() - startTime >= tenMinutes) {
+ clearInterval(intervalId.value)
+ console.log('定时器已停止,已过去 10 分钟。')
+ refreshQR.value = true
- return;
- }
+ return
+ }
- const res = await LoginApi.qrLoginCode({code:uuuid.value})
-
- if(res){
- clearInterval(intervalId.value);
- authUtil.setToken(res)
- router.push({ path: '/' })
+ const res = await LoginApi.qrLoginCode({ code: uuuid.value })
+
+ if (res) {
+ clearInterval(intervalId.value)
+ authUtil.setToken(res)
+ router.push({ path: '/' })
}
-
} catch (error) {
- console.error('获取扫码状态失败:', error);
+ console.error('获取扫码状态失败:', error)
}
- }, 5000);
+ }, 5000)
}
onMounted(() => {
// getCookie()
getimg()
})
+onUnmounted(() => {
+ // 组件销毁时清除定时器
+ clearInterval(intervalId.value)
+})
\ No newline at end of file
+.expired-text {
+ color: #ff0000;
+ margin-top: 40px;
+ margin-right: 10px;
+}
+.bottomImg {
+ width: 320px;
+}
+.topImg {
+ height: 200px;
+}
+