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:
@@ -313,7 +313,7 @@ onMounted(() => {
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="80" align="center" fixed="right">
|
<el-table-column label="操作" width="80" align="center" fixed="right">
|
||||||
<template #default="{ row }">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { Plus, Delete, Refresh } from '@element-plus/icons-vue'
|
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 PageCard from '@/components/PageCard.vue'
|
||||||
import {
|
import {
|
||||||
getDataConvertTasks,
|
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) {
|
if (!isJson) {
|
||||||
ElMessage.error('只能上传 .json 格式的文件')
|
ElMessage.error('只能上传 .json 格式的文件')
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const form = reactive<CreateUserPayload>({
|
|||||||
username: '',
|
username: '',
|
||||||
display_name: '',
|
display_name: '',
|
||||||
password: 'platform123',
|
password: 'platform123',
|
||||||
role: 'user',
|
role: 'operator',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
permissions: [],
|
permissions: [],
|
||||||
})
|
})
|
||||||
@@ -45,7 +45,7 @@ async function submit() {
|
|||||||
<el-form-item label="角色">
|
<el-form-item label="角色">
|
||||||
<el-select v-model="form.role" style="width: 100%">
|
<el-select v-model="form.role" style="width: 100%">
|
||||||
<el-option label="管理员" value="admin" />
|
<el-option label="管理员" value="admin" />
|
||||||
<el-option label="普通用户" value="user" />
|
<el-option label="普通用户" value="operator" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
|
|||||||
Reference in New Issue
Block a user