Commit dc5e5949 by 李宁

1

1 parent 1a860758
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>web-admin</title> <title>web-admin</title>
</head> </head>
......
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
\ No newline at end of file \ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
\ No newline at end of file \ No newline at end of file
<script setup lang="ts">
import { ref } from 'vue'
defineProps<{ msg: string }>()
const count = ref(0)
</script>
<template>
<h1>{{ msg }}</h1>
<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
</p>
</div>
<p>
Check out
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
>create-vue</a
>, the official Vue + Vite starter
</p>
<p>
Learn more about IDE Support for Vue in the
<a
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
target="_blank"
>Vue Docs Scaling up Guide</a
>.
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>
<style scoped>
.read-the-docs {
color: #888;
}
</style>
import { createApp } from 'vue' import { createApp } from 'vue'
import { createPinia } from 'pinia' import { createPinia } from 'pinia'
import ElementPlus from 'element-plus' import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css' import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue' import * as ElementPlusIconsVue from '@element-plus/icons-vue'
......
import type { Order } from '../types/order'
const CITIES = ['南京市', '无锡市', '徐州市', '常州市', '苏州市', '南通市', '连云港市', '淮安市', '盐城市', '扬州市', '镇江市', '泰州市', '宿迁市']
const STATUSES = ['未开始', '进行中', '已完成', '无法质检'] as const
const CHEATING_REASONS = ['在家质检', '一直点击无法质检', '其他']
export const generateMockOrders = (count: number = 20): Order[] => {
return Array.from({ length: count }).map((_, index) => {
const isCheating = Math.random() > 0.8
const status = STATUSES[Math.floor(Math.random() * STATUSES.length)] || '未开始'
const city = CITIES[Math.floor(Math.random() * CITIES.length)] || '南京市'
return {
id: `APPLY_${Date.now()}_${index}`,
applyId: `APP${10000 + index}`,
workerId: `W${2000 + index}`,
businessAccount: `1${Math.floor(Math.random() * 10000000000)}`,
orderIds: [
{ orderCode: `ORD_${index}_1`, deviceNumber: `DEV_${index}_1` },
{ orderCode: `ORD_${index}_2`, deviceNumber: `DEV_${index}_2` }
],
city: city,
status: status,
cannotQcReason: status === '无法质检' ? '用户拒绝配合' : undefined,
startTime: '2023-10-01 10:00:00',
endTime: status === '已完成' ? '2023-10-01 11:30:00' : undefined,
noPhotoCount: Math.floor(Math.random() * 5),
manualInputCount: Math.floor(Math.random() * 3),
envAbnormalCount: Math.floor(Math.random() * 2),
isCheating: isCheating,
cheatingReason: isCheating ? CHEATING_REASONS[0] : undefined,
cheatingTime: isCheating ? '2023-10-01 12:00:00' : undefined
}
})
}
import type { OrderDetail, QcStep, QcVideo } from '../types/order'
export const getMockOrderDetail = (id: string): OrderDetail => {
const steps: QcStep[] = [
{ name: '工服检测', duration: '5s', result: '通过', imageUrl: 'https://placehold.co/100x100?text=Uniform', isAbnormal: 0 },
{ name: '光猫识别', duration: '12s', result: '通过', imageUrl: 'https://placehold.co/100x100?text=Modem', isAbnormal: 0 },
{ name: '机顶盒识别', duration: '8s', result: '通过', imageUrl: 'https://placehold.co/100x100?text=STB', isAbnormal: 0 },
{ name: '环境检测', duration: '15s', result: '通过', imageUrl: 'https://placehold.co/100x100?text=Env', isAbnormal: 1 }
]
const videos: QcVideo[] = [
{ id: 'v1', name: '全流程录像.mp4', thumbnailUrl: 'https://placehold.co/300x200?text=Video1', videoUrl: 'https://www.w3schools.com/html/mov_bbb.mp4' },
{ id: 'v2', name: '异常复核录像.mp4', thumbnailUrl: 'https://placehold.co/300x200?text=Video2', videoUrl: 'https://www.w3schools.com/html/movie.mp4' }
]
// Base random data
const baseOrder = generateMockOrders(1)[0]
if (!baseOrder) throw new Error('Failed to generate mock order')
return {
...baseOrder,
id: id,
installAddress: '江苏省南京市雨花台区软件大道101号',
orderType: '装机工单',
deviceType: 'FTTR全光组网',
completeTime: baseOrder.status === '已完成' ? '2023-10-01 11:30:00' : undefined,
totalDuration: '15分30秒',
steps: steps,
videos: videos
}
}
...@@ -40,9 +40,9 @@ service.interceptors.response.use( ...@@ -40,9 +40,9 @@ service.interceptors.response.use(
localStorage.removeItem('hzMgrtoken') localStorage.removeItem('hzMgrtoken')
// 延迟跳转到登录页 // 延迟跳转到登录页
// setTimeout(() => { setTimeout(() => {
// window.location.href = '/login' window.location.href = '/login'
// }, 1000) }, 1000)
return Promise.reject(new Error(errorData.msg || errorData.message || '登录已失效')) return Promise.reject(new Error(errorData.msg || errorData.message || '登录已失效'))
} }
...@@ -68,10 +68,10 @@ service.interceptors.response.use( ...@@ -68,10 +68,10 @@ service.interceptors.response.use(
// 清除本地存储的 token // 清除本地存储的 token
localStorage.removeItem('hzMgrtoken') localStorage.removeItem('hzMgrtoken')
// 延迟跳转到登录页,让用户看到提示信息 //延迟跳转到登录页,让用户看到提示信息
// setTimeout(() => { setTimeout(() => {
// window.location.href = '/login' window.location.href = '/login'
// }, 1500) }, 1500)
return Promise.reject(new Error(res.msg || res.message || '登录已失效')) return Promise.reject(new Error(res.msg || res.message || '登录已失效'))
} }
......
...@@ -6,6 +6,10 @@ export default defineConfig({ ...@@ -6,6 +6,10 @@ export default defineConfig({
base: './', base: './',
plugins: [vue()], plugins: [vue()],
server: { server: {
allowedHosts: [
"electrotactic-janine-cornily.ngrok-free.dev"
],
proxy: { proxy: {
'/zhijian': { '/zhijian': {
target: 'https://testznzl.lgyzpt.com', target: 'https://testznzl.lgyzpt.com',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!