Browse Source

清理:第 5 批,管理后台与 deploy 零碎

- admin:chipVendorLabel、auth 里无人读的 isSuperAdmin/isLoggedIn getter、device.vue 撤销上下文里
  不再提交的 brandid、console.css 无页面使用的 .stat-card、tailwind 里不存在的 ./components 扫描路径、
  meettemplates.vue 指向不存在文件的注释
- deploy:admin/env 下三份无脚本引用的旧模板(dev/local/prod.env.example)、.gitignore 里已改名目录的规则
- apps/proto/google/protobuf/any.proto(无 .proto import,protoc 自带)、apps/client/preview/yidong.html、
  .vscode/settings.json(与本项目无关的 Java 设置)

验证:npm run build 通过。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 38bb009a8b5d863d18fa35d4443392ba01ea7636)
main
Rodger-Wang 2 weeks ago
parent
commit
8b06de5a47
  1. 24
      apps/admin/app/assets/css/console.css
  2. 7
      apps/admin/app/pages/device.vue
  3. 2
      apps/admin/app/pages/meettemplates.vue
  4. 6
      apps/admin/app/stores/auth.ts
  5. 8
      apps/admin/app/utils/chipvendors.ts
  6. 1
      apps/admin/tailwind.config.ts
  7. 2
      deploy/.gitignore

24
apps/admin/app/assets/css/console.css

@ -79,30 +79,6 @@ header {
border-color: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.04) !important;
} }
/* ========== 统计卡片 ========== */
.stat-card {
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
border: 1px solid rgba(0,0,0,0.04);
position: relative;
overflow: hidden;
}
.stat-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background: linear-gradient(90deg, #6366F1, #8B5CF6);
opacity: 0;
transition: opacity 0.3s;
}
.stat-card:hover {
transform: translateY(-4px);
box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
}
.stat-card:hover::before { opacity: 1; }
/* ========== 表格 ========== */ /* ========== 表格 ========== */
.table { font-size: 13px; } .table { font-size: 13px; }
.table th { .table th {

7
apps/admin/app/pages/device.vue

@ -206,7 +206,7 @@
<td> <td>
<div class="flex gap-1"> <div class="flex gap-1">
<button class="btn btn-ghost btn-xs text-indigo-500" @click.stop="viewBatchCodes(n.productid, String(n.batchno || ''))">查看MAC</button> <button class="btn btn-ghost btn-xs text-indigo-500" @click.stop="viewBatchCodes(n.productid, String(n.batchno || ''))">查看MAC</button>
<button v-if="isSuperAdmin" class="btn btn-ghost btn-xs text-red-500" @click.stop="openRevokeDialog(n.brandid, n.productid, String(n.batchno || ''), n.devicenum || 0)">撤销</button> <button v-if="isSuperAdmin" class="btn btn-ghost btn-xs text-red-500" @click.stop="openRevokeDialog(n.productid, String(n.batchno || ''), n.devicenum || 0)">撤销</button>
</div> </div>
</td> </td>
</tr> </tr>
@ -566,7 +566,6 @@ interface PreviewResult {
importsample?: string[] // 导入模式的前几条 MAC 样例;生产模式为空 importsample?: string[] // 导入模式的前几条 MAC 样例;生产模式为空
} }
interface RevokeCtx { interface RevokeCtx {
brandid: number
productid: number productid: number
batchno: string batchno: string
devicenum: number devicenum: number
@ -915,8 +914,8 @@ async function loadNotes() {
} }
// ========== 撤销生产批次(仅超管) ========== // ========== 撤销生产批次(仅超管) ==========
function openRevokeDialog(brandid: number, productid: number, batchno: string, devicenum: number) { function openRevokeDialog(productid: number, batchno: string, devicenum: number) {
revokeCtx.value = { brandid, productid, batchno, devicenum } revokeCtx.value = { productid, batchno, devicenum }
revokeConfirmInput.value = '' revokeConfirmInput.value = ''
revokeError.value = '' revokeError.value = ''
revokeModal.value?.showModal() revokeModal.value?.showModal()

2
apps/admin/app/pages/meettemplates.vue

@ -4,7 +4,7 @@
<script setup lang="ts"> <script setup lang="ts">
// 2026-09-17:「会议模板」并入「会议配置」(/meetconfig)的一个标签页,页面本体已拆成 // 2026-09-17:「会议模板」并入「会议配置」(/meetconfig)的一个标签页,页面本体已拆成
// components/MeetTemplateTab.vue。这里只留重定向——后台里这个地址被收藏/直接输入的不在少数, // components/MeetTemplatePanel.vue。这里只留重定向——后台里这个地址被收藏/直接输入的不在少数,
// 直接删文件会变成 404(同「全局环境配置」下线时的处理)。 // 直接删文件会变成 404(同「全局环境配置」下线时的处理)。
definePageMeta({ title: '会议配置' }) definePageMeta({ title: '会议配置' })
onMounted(() => { navigateTo('/meetconfig', { replace: true }) }) onMounted(() => { navigateTo('/meetconfig', { replace: true }) })

6
apps/admin/app/stores/auth.ts

@ -79,9 +79,6 @@ export const useAuthStore = defineStore('auth', {
}), }),
getters: { getters: {
isSuperAdmin(): boolean {
return this.identity === 1
},
isAdmin(): boolean { isAdmin(): boolean {
return this.identity === IDENTITY_ADMIN || this.identity === IDENTITY_MANAGER return this.identity === IDENTITY_ADMIN || this.identity === IDENTITY_MANAGER
}, },
@ -92,9 +89,6 @@ export const useAuthStore = defineStore('auth', {
identityLabel(): string { identityLabel(): string {
return IDENTITY_LABELS[this.identity] ?? '' return IDENTITY_LABELS[this.identity] ?? ''
}, },
isLoggedIn(): boolean {
return !!this.token
},
}, },
actions: { actions: {

8
apps/admin/app/utils/chipvendors.ts

@ -69,11 +69,3 @@ export function chipVendorName(v?: number | null): string {
if (!n) return '未分组' if (!n) return '未分组'
return chipVendors.value.find((x) => x.id === n)?.name ?? ('厂商#' + n) return chipVendors.value.find((x) => x.id === n)?.name ?? ('厂商#' + n)
} }
/** 「名称 (0xCID)」,下拉里用——同名难辨时靠 CID 区分,也让人一眼看到要烧进固件的那个值。 */
export function chipVendorLabel(v?: number | null): string {
const n = Number(v || 0)
if (!n) return '未分组'
const hit = chipVendors.value.find((x) => x.id === n)
return hit ? `${hit.name} (0x${n.toString(16).toUpperCase()})` : ('厂商#' + n)
}

1
apps/admin/tailwind.config.ts

@ -3,7 +3,6 @@ import type { Config } from 'tailwindcss'
export default { export default {
content: [ content: [
'./app/**/*.{vue,ts,tsx}', './app/**/*.{vue,ts,tsx}',
'./components/**/*.{vue,ts,tsx}',
], ],
theme: { extend: {} }, theme: { extend: {} },
plugins: [require('daisyui')], plugins: [require('daisyui')],

2
deploy/.gitignore

@ -8,4 +8,4 @@
# 运行时日志 # 运行时日志
console/log/ console/log/
voitrans/log/ app/log/

Loading…
Cancel
Save