feat: 新增预警定时扫描器,移除附件归档字段并为角色表补充更新时间

This commit is contained in:
SunYF
2026-10-31 15:41:27 +08:00
parent 11dbdaae75
commit 0c03d32682
107 changed files with 10790 additions and 1844 deletions
+38 -3
View File
@@ -1,7 +1,7 @@
<template>
<el-card>
<el-alert type="info" :closable="false" style="margin-bottom:12px"
title="工位数以数据库为准。本页可新增工位与编辑;每个工位在下方下拉选择启用的工艺即完成绑定;一个工位只能绑定一个工艺;内置工位不允许删除。" />
title="工位数以数据库为准。新增/停用/绑定工艺在此完成;虚拟工位(线下位)可在「工位名称」列直接点选重命名;内置工位名称锁定不可改、不可删除。" />
<div style="margin-bottom:12px">
<el-button v-if="can('produce.station:add')" type="primary" @click="openAdd">新增工位</el-button>
@@ -33,7 +33,15 @@
<el-table :data="rows" border size="small">
<el-table-column prop="stationNo" label="工位号" width="90" align="center" />
<el-table-column prop="name" label="工位名称" min-width="170" show-overflow-tooltip />
<el-table-column label="工位名称" min-width="170">
<template #default="{ row }">
<el-input v-if="row.stationType === 'OFFLINE' && renamingId === row.id" v-model="renameVal" size="small"
@blur="commitRename(row)" @keyup.enter="commitRename(row)" />
<span v-else-if="row.stationType === 'OFFLINE'" style="cursor:pointer;color:#409eff"
@click="startRename(row)">{{ row.name }} ✎</span>
<span v-else>{{ row.name }}</span>
</template>
</el-table-column>
<el-table-column label="类型" width="90" align="center">
<template #default="{ row }">
<el-tag size="small" :type="row.stationType === 'OFFLINE' ? 'info' : 'success'">
@@ -89,7 +97,7 @@
<el-table-column label="操作" width="120" align="center" fixed="right">
<template #default="{ row }">
<div style="display:flex;align-items:center;justify-content:center;gap:8px">
<el-button v-if="can('produce.station:edit')" link type="primary" size="small" @click="openName(row)">编辑</el-button>
<el-button v-if="can('produce.station:edit') && !row.isBuiltin && row.stationType !== 'OFFLINE'" link type="primary" size="small" @click="openName(row)">编辑</el-button>
<el-dropdown trigger="click" @command="(c) => stationCommand(row, c)">
<el-button link type="primary" size="small">更多 ▾</el-button>
<template #dropdown>
@@ -265,6 +273,33 @@ function openName(row) {
Object.assign(dlg, { show: true, isAdd: false, title: `工位${row.stationNo} - 修改`, id: row.id, stationNo: row.stationNo, name: row.name, stationType: row.stationType || 'LINE', isBuiltin: !!row.isBuiltin })
}
// 虚拟工位(线下位)行内重命名:点名称旁 ✎ 进入编辑,失焦或回车提交
const renamingId = ref(0)
const renameVal = ref('')
function startRename(row) {
renamingId.value = row.id
renameVal.value = row.name
}
async function commitRename(row) {
if (renamingId.value !== row.id) return
const v = (renameVal.value || '').trim()
renamingId.value = 0
if (!v) {
ElMessage.warning('名称不能为空')
await load()
return
}
if (v === row.name) return
try {
await request.post('/stations', { id: row.id, stationNo: row.stationNo, name: v, stationType: row.stationType || 'LINE' })
ElMessage.success('名称已更新')
} catch {
// 拦截器已提示
} finally {
await load()
}
}
async function save() {
if (!dlg.name) return ElMessage.warning('请输入工位名称')
if (dlg.isAdd && dlg.stationNo >= 1 && dlg.stationNo <= 12) {