feat: 完成MES工位终端系统全量功能迭代
本次提交包含以下核心变更: 1. 新增按钮级权限控制框架与前端权限校验 2. 新增工位管理、工艺流程、巡检终端等核心业务模块 3. 完善用户体系,支持工位终端专属登录权限 4. 新增文件上传下载、报表查询等配套功能 5. 修复多系统兼容性与交互体验问题 6. 完成所有文档与配置项的规范化更新
This commit is contained in:
@@ -7,8 +7,11 @@ export const login = (data) => request.post('/api/auth/login', data)
|
||||
export const getConfig = () => request.get('/api/config')
|
||||
|
||||
// 当前工单任务(代理 MES)
|
||||
export const getTaskCurrent = (dockCode) =>
|
||||
request.get('/api/task/current', { params: { dockCode } })
|
||||
export const getTaskCurrent = (stationNo) =>
|
||||
request.get('/api/task/current', { params: { stationNo } })
|
||||
|
||||
// 我的工作量(代理 MES,按当前登录人查询)
|
||||
export const getWorkload = (params) => request.get('/api/workload', { params })
|
||||
|
||||
// 拧紧结果列表(本地 SQLite)
|
||||
export const getTighteningList = (params) => request.get('/api/tightening/list', { params })
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="login-page">
|
||||
<div class="login-card">
|
||||
<h1 class="title">北京动力 · 工位终端</h1>
|
||||
<h1 class="title">工位终端</h1>
|
||||
<p class="subtitle">产线触屏终端(端口 8892)</p>
|
||||
|
||||
<div class="field">
|
||||
@@ -25,37 +25,73 @@
|
||||
@keyup.enter="submit"
|
||||
/>
|
||||
</div>
|
||||
<div class="field">
|
||||
<span class="lab">工位</span>
|
||||
<el-select
|
||||
v-if="!fixedStation"
|
||||
v-model="stationNo"
|
||||
size="large"
|
||||
class="station-el"
|
||||
placeholder="请选择工位"
|
||||
>
|
||||
<el-option v-for="n in 12" :key="n" :label="'工位 ' + n" :value="n" />
|
||||
</el-select>
|
||||
<span v-else class="station-fixed">工位 {{ fixedStation }}</span>
|
||||
</div>
|
||||
|
||||
<el-button class="btn-login" type="primary" size="large" :loading="loading" @click="submit">
|
||||
登 录
|
||||
</el-button>
|
||||
|
||||
<p class="hint">内置账号:admin / 123456 operator1 / 123456</p>
|
||||
<p class="hint">账号由 MES 统一管理</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { login } from '../api'
|
||||
import { getConfig, login } from '../api'
|
||||
import { setAuth } from '../utils/request'
|
||||
|
||||
const STATION_KEY = 'ws_station_no'
|
||||
const router = useRouter()
|
||||
const username = ref('')
|
||||
const password = ref('')
|
||||
const stationNo = ref(null)
|
||||
const fixedStation = ref(0)
|
||||
const loading = ref(false)
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const cfg = await getConfig()
|
||||
if (cfg?.stationNo > 0) fixedStation.value = cfg.stationNo
|
||||
} catch {
|
||||
// 网络异常时忽略,工位仍可自选
|
||||
}
|
||||
stationNo.value = fixedStation.value || Number(localStorage.getItem(STATION_KEY)) || null
|
||||
})
|
||||
|
||||
async function submit() {
|
||||
if (!username.value || !password.value) {
|
||||
ElMessage.warning('请输入账号和密码')
|
||||
return
|
||||
}
|
||||
const sn = fixedStation.value || stationNo.value
|
||||
if (!sn) {
|
||||
ElMessage.warning('请选择工位')
|
||||
return
|
||||
}
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await login({ username: username.value, password: password.value })
|
||||
setAuth(data.token, data.user)
|
||||
const data = await login({
|
||||
username: username.value,
|
||||
password: password.value,
|
||||
stationNo: sn
|
||||
})
|
||||
setAuth(data.accessToken, data.user)
|
||||
localStorage.setItem(STATION_KEY, String(sn))
|
||||
ElMessage.success('登录成功')
|
||||
router.push('/main')
|
||||
} catch (e) {
|
||||
@@ -85,7 +121,7 @@ async function submit() {
|
||||
|
||||
.title {
|
||||
margin: 0 0 8px;
|
||||
font-size: 30px;
|
||||
font-size: 34px;
|
||||
text-align: center;
|
||||
color: #16324f;
|
||||
}
|
||||
@@ -117,6 +153,28 @@ async function submit() {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.station-el {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.station-el :deep(.el-input__inner) {
|
||||
height: 52px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.station-fixed {
|
||||
flex: 1;
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
color: #16324f;
|
||||
line-height: 52px;
|
||||
background: #f2f6fb;
|
||||
border-radius: 8px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.btn-login {
|
||||
width: calc(100% - 80px);
|
||||
margin-left: 80px;
|
||||
@@ -131,4 +189,4 @@ async function submit() {
|
||||
font-size: 14px;
|
||||
color: #9aa7b8;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user