fix(frontend): 修复操作日志与数据转换类型错误,修正普通用户角色取值

- OperationLogView: showDetail 调用补充 OperationLog 类型断言
- DataConvertView: beforeUpload 参数类型改为 UploadRawFile 并直接读取 file.type
- UserCreateView: 普通用户角色值 user 修正为 operator

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
wuyongtao
2026-08-19 11:33:45 +08:00
parent 9379f93633
commit 93449b7f0e
3 changed files with 6 additions and 6 deletions

View File

@@ -313,7 +313,7 @@ onMounted(() => {
</el-table-column>
<el-table-column label="操作" width="80" align="center" fixed="right">
<template #default="{ row }">
<el-button link type="primary" size="small" @click="showDetail(row)">详情</el-button>
<el-button link type="primary" size="small" @click="showDetail(row as OperationLog)">详情</el-button>
</template>
</el-table-column>
</el-table>

View File

@@ -2,7 +2,7 @@
import { onMounted, ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Plus, Delete, Refresh } from '@element-plus/icons-vue'
import type { TagProps, UploadRequestOptions, UploadFile } from 'element-plus'
import type { TagProps, UploadRequestOptions, UploadFile, UploadRawFile } from 'element-plus'
import PageCard from '@/components/PageCard.vue'
import {
getDataConvertTasks,
@@ -30,9 +30,9 @@ async function load() {
}
// 文件上传前的校验(仅校验文件格式)
function beforeUpload(file: UploadFile) {
function beforeUpload(file: UploadRawFile) {
// 检查文件类型
const isJson = file.name.endsWith('.json') || file.raw?.type === 'application/json'
const isJson = file.name.endsWith('.json') || file.type === 'application/json'
if (!isJson) {
ElMessage.error('只能上传 .json 格式的文件')
return false

View File

@@ -12,7 +12,7 @@ const form = reactive<CreateUserPayload>({
username: '',
display_name: '',
password: 'platform123',
role: 'user',
role: 'operator',
status: 'active',
permissions: [],
})
@@ -45,7 +45,7 @@ async function submit() {
<el-form-item label="角色">
<el-select v-model="form.role" style="width: 100%">
<el-option label="管理员" value="admin" />
<el-option label="普通用户" value="user" />
<el-option label="普通用户" value="operator" />
</el-select>
</el-form-item>
<el-form-item label="状态">