文档分类
@@ -153,7 +150,6 @@
-
-
-
@@ -74,7 +72,6 @@
-
-
-
-
@@ -24,7 +23,6 @@
员工信息
支持图片 / PDF,单个不超过 10MB,可多选批量上传,数量不限
@@ -242,18 +238,12 @@ import {
} from '@/views/apps/organization/composables';
import RecordEditDialog from './recordEditDialog.vue';
-/**
- * 员工档案详情抽屉:基本资料 + 教育/工作/合同/证照四类子记录管理。
- * 档案编辑(基本资料)通过 edit 事件交给父页面打开编辑弹窗。
- */
-
const emit = defineEmits(['edit', 'refresh']);
const visible = ref(false);
const loading = ref(false);
const recordDialogRef = ref();
const certSaving = ref('');
-/** 批量上传状态:pending 为并发中的文件数,全部结束后统一刷新 */
const certUploading = ref(false);
const certPending = ref(0);
const certDone = ref(0);
@@ -267,7 +257,6 @@ const file = ref({});
const records = ref([]);
const activeTab = ref('basic');
-/** 教育经历/工作经历/合同信息三类同构表格的列配置 */
const recordTabs = [
{ type: 1, name: 'education', label: '教育经历', nameLabel: '学校', subLabel: '专业', extraLabel: '学历' },
{ type: 2, name: 'work', label: '工作经历', nameLabel: '公司', subLabel: '职位', extraLabel: '所在部门' },
@@ -293,7 +282,6 @@ const beforeCertUpload = (uploadedFile) => {
return isImageOrPdf && isLt10M;
};
-/** 批量上传时用「文件名(去扩展名)」作为默认证照名称,便于后续辨认 */
const certTitleFromFile = (name) =>
String(name || '').replace(/\.[^.]+$/, '').trim() || '证照附件';
@@ -303,11 +291,6 @@ const saveCertificates = async () => {
emit('refresh');
};
-/**
- * 批量上传证照:统一入口,不再区分学历照片 / 身份证等细分类别。
- * 每个文件独立上传并生成一条「证照附件」记录,数量不限;
- * el-upload 开启 multiple 后会对每个文件各调用一次本方法,全部结束后统一刷新列表。
- */
const handleCertUpload = async ({ file: uploadedFile }) => {
const employeeId = Number(file.value.employee_id) || 0;
if (!employeeId) {
@@ -379,10 +362,6 @@ const removePrimaryCertificate = async (item) => {
const recordsOf = (type) => records.value.filter((item) => Number(item.type) === Number(type));
-/**
- * 主档案证照字段同步展示在“证照附件”中。
- * 只读标志用于隐藏子记录的编辑/删除按钮,实际更新请通过证照附件页完成。
- */
const certificateAttachments = computed(() => {
const manualRecords = recordsOf(4);
const primaryFiles = [
@@ -422,7 +401,6 @@ const certificateAttachments = computed(() => {
const recordsForTab = (type) => recordsOf(type);
const recordCount = (type) => recordsForTab(type).length;
-/** 后端可能返回 RFC3339 时间戳,经历列表仅展示日期部分。 */
const formatDateOnly = (value) => {
if (!value) return '';
const matched = String(value).match(/^\d{4}-\d{2}-\d{2}/);
@@ -436,12 +414,6 @@ const dateRangeText = (row) => {
return `${startDate || '?'} ~ ${endDate || '至今'}`;
};
-/**
- * 合同档案状态:按起止日期自动推导三态。
- * - 过期:结束日期已过
- * - 废弃:开始日期尚未到来(签订后未生效)
- * - 正常:履行中 / 无固定期限 / 仅一端有日期等其余场景
- */
const contractStatus = (row) => {
const startDate = formatDateOnly(row.start_date);
const endDate = formatDateOnly(row.end_date);
@@ -473,7 +445,6 @@ const loadDetail = async () => {
}
};
-/** 打开抽屉;row 为列表行(至少含 id) */
const open = (row) => {
const id = typeof row === 'object' ? row?.id : row;
if (!id) {
diff --git a/backend/src/views/apps/oa/employeefile/components/fileEditDialog.vue b/backend/src/views/apps/oa/employeefile/components/fileEditDialog.vue
index aa4ac00..28d6bd4 100644
--- a/backend/src/views/apps/oa/employeefile/components/fileEditDialog.vue
+++ b/backend/src/views/apps/oa/employeefile/components/fileEditDialog.vue
@@ -8,7 +8,6 @@
>
-
{
const filed = new Set(filedIds.value.map(Number));
return allEmployees.value.filter((emp) => !filed.has(Number(emp.id)));
});
-/** 新建档案时选择员工,自动带出员工已有数据,避免重复录入 */
watch(
() => form.employee_id,
(id) => {
@@ -295,7 +286,6 @@ const resetForm = () => {
formRef.value?.clearValidate();
};
-/** 加载员工下拉选项:全部员工 + 已建档ID并行请求 */
const loadEmployeeOptions = async () => {
employeesLoading.value = true;
try {
@@ -314,19 +304,16 @@ const loadEmployeeOptions = async () => {
}
};
-/** 打开弹窗;file 为空表示新建,否则回填编辑 */
const open = async (file = null) => {
resetForm();
isEdit.value = !!file?.id;
editId.value = file?.id || 0;
if (isEdit.value) {
- // 编辑前先并行刷新选项数据,再回填表单
await loadEmployeeOptions();
editEmployeeLabel.value = file.employee_name
? `${file.employee_name}(${file.employee_account || '-'})`
: `员工 #${file.employee_id}`;
- // 编辑时员工归属不可修改,但必须回填校验字段,避免保存时触发“请选择员工”。
form.employee_id = file.employee_id ? Number(file.employee_id) : null;
form.file_no = file.file_no || '';
form.id_card = file.id_card || '';
diff --git a/backend/src/views/apps/oa/employeefile/components/recordEditDialog.vue b/backend/src/views/apps/oa/employeefile/components/recordEditDialog.vue
index 8572b7b..4ad6b5c 100644
--- a/backend/src/views/apps/oa/employeefile/components/recordEditDialog.vue
+++ b/backend/src/views/apps/oa/employeefile/components/recordEditDialog.vue
@@ -100,15 +100,6 @@ import { Document, Plus } from '@element-plus/icons-vue';
import { createFileRecord, updateFileRecord } from '@/api/employeeFile';
import { uploadFile } from '@/api/file';
-/**
- * 档案子记录编辑弹窗:教育经历 / 工作经历 / 合同信息 / 证照附件共用。
- * 字段语义随 type 变化(与后端建表注释保持一致):
- * 教育经历(1):title=学校 sub_title=专业 extra=学历
- * 工作经历(2):title=公司 sub_title=职位 extra=所在部门
- * 合同信息(3):title=合同名称 sub_title=合同类型 extra=签订主体
- * 证照附件(4):title=证照名称 sub_title=证件号码 extra 不展示
- */
-
const TYPE_META = {
1: { type: 1, title: '教育经历', nameLabel: '学校名称', subLabel: '专业', extraLabel: '学历' },
2: { type: 2, title: '工作经历', nameLabel: '公司名称', subLabel: '职位', extraLabel: '所在部门' },
@@ -175,19 +166,11 @@ const resetForm = () => {
formRef.value?.clearValidate();
};
-/** 兼容后端 time.Time 返回的 RFC3339 时间戳,提交时统一使用 DATE 格式。 */
const normalizeDate = (value) => {
const matched = String(value || '').match(/^\d{4}-\d{2}-\d{2}/);
return matched ? matched[0] : '';
};
-/**
- * 打开弹窗。
- * @param {object} options
- * @param {number} options.employeeId 员工ID(记录挂载主体)
- * @param {number} options.type 记录类型 1-4
- * @param {object} [options.record] 编辑时传入的记录;缺省为新增
- */
const open = (options = {}) => {
employeeId.value = Number(options.employeeId) || 0;
meta.value = TYPE_META[options.type] || TYPE_META[1];
diff --git a/backend/src/views/apps/oa/employeefile/index.vue b/backend/src/views/apps/oa/employeefile/index.vue
index 385f525..187528d 100644
--- a/backend/src/views/apps/oa/employeefile/index.vue
+++ b/backend/src/views/apps/oa/employeefile/index.vue
@@ -11,7 +11,6 @@
{{ stats[item.key] ?? 0 }}
@@ -136,12 +135,6 @@ import { buildOrgTree, genderText } from '@/views/apps/organization/composables'
import FileEditDialog from './components/fileEditDialog.vue';
import FileDetailDrawer from './components/fileDetailDrawer.vue';
-/**
- * 员工档案页面(OA 人事档案)。
- * 列表后端分页;档案编辑/详情通过弹窗与抽屉完成,
- * 档案详情内直接管理教育经历、工作经历、合同与证照子记录。
- */
-
const editDialogRef = ref();
const detailDrawerRef = ref();
@@ -216,7 +209,6 @@ const loadDepartments = async () => {
}
};
-/** 列表 + 统计一起刷新(增删改后调用) */
const loadAll = () => {
loadData();
loadStats();
@@ -340,7 +332,6 @@ onMounted(() => {
justify-content: flex-end;
margin-top: 14px;
}
-// ===== 暗色主题适配 =====
html.dark & {
.page-header {
h2 {
diff --git a/backend/src/views/apps/oa/notice/components/edit.vue b/backend/src/views/apps/oa/notice/components/edit.vue
index 286e815..c66d66e 100644
--- a/backend/src/views/apps/oa/notice/components/edit.vue
+++ b/backend/src/views/apps/oa/notice/components/edit.vue
@@ -66,7 +66,6 @@ const props = defineProps({
type: Boolean,
default: false
},
- // 编辑时传入的公告对象;null 表示新建
notice: {
type: Object,
default: null
@@ -98,7 +97,6 @@ const rules = {
};
const isEdit = computed(() => !!props.notice);
-// 已发布的公告保存时不再显示"立即发布"勾选框
const isPublished = computed(() => props.notice?.status === 1);
watch(
diff --git a/backend/src/views/apps/oa/notice/index.vue b/backend/src/views/apps/oa/notice/index.vue
index 7207749..cb11ed8 100644
--- a/backend/src/views/apps/oa/notice/index.vue
+++ b/backend/src/views/apps/oa/notice/index.vue
@@ -118,7 +118,6 @@
@@ -194,7 +193,6 @@ function resetFilters() {
loadList();
}
-// ---------- 发布/编辑 ----------
const editVisible = ref(false);
const editingItem = ref(null);
@@ -208,7 +206,6 @@ function openEdit(item) {
editVisible.value = true;
}
-// ---------- 详情 ----------
const detailVisible = ref(false);
const detailItem = ref(null);
@@ -221,7 +218,6 @@ async function openDetail(row) {
}
}
-// ---------- 操作 ----------
async function togglePublish(row) {
const res = await publishNotice(row.id);
if (res?.code === 200) {
@@ -261,7 +257,6 @@ async function handleDelete(row) {
}
}
-// ---------- 展示辅助 ----------
function typeLabel(type) {
return { 1: "公告", 2: "活动" }[type] || "通知";
}
@@ -386,7 +381,6 @@ onMounted(loadList);
overflow-y: auto;
}
}
-// ===== 暗色主题适配 =====
html.dark & {
.page-header p {
color: var(--el-text-color-secondary);
diff --git a/backend/src/views/apps/oa/reimburse/components/detail.vue b/backend/src/views/apps/oa/reimburse/components/detail.vue
index 0b4e3e8..8390ceb 100644
--- a/backend/src/views/apps/oa/reimburse/components/detail.vue
+++ b/backend/src/views/apps/oa/reimburse/components/detail.vue
@@ -322,16 +322,6 @@
>
确认到账
-
@@ -351,7 +341,6 @@ import {
} from '../utils/invoiceAmount'
import ItemForm from './itemForm.vue'
import InvoicePicker from './invoicePicker.vue'
-// 时间显示统一为:YYYY-MM-DD HH:mm:ss
import { formatDateTime } from '@/utils/datetime'
const props = defineProps({
@@ -381,14 +370,10 @@ const visible = computed({
set: value => emit('update:modelValue', value)
})
const isDraft = computed(() => Number(props.detail?.status) === 0)
-// 可编辑状态:草稿、已驳回、已撤回;审批中需先撤回
const isEditable = computed(() => [0, 3, 4].includes(Number(props.detail?.status)))
-// 审批中:可撤回到草稿后继续编辑
const isApproving = computed(() => Number(props.detail?.status) === 1)
-// 审批通过(等待报销人确认款项到账)
const isApproved = computed(() => Number(props.detail?.status) === 2)
-// 非可编辑状态时说明原因,避免按钮置灰后无从判断
const editLockTip = computed(() => {
switch (Number(props.detail?.status)) {
case 1:
@@ -448,7 +433,6 @@ onBeforeUnmount(() => {
window.removeEventListener('resize', checkMobile)
})
-// 本单挂靠发票的已使用额度:仅用于面板提示,不重复计入整单票据金额
const compareLinkedTotal = computed(() =>
(props.detail?.items || []).reduce(
(sum, item) => sum + Number(item.invoice_use_amount || 0),
@@ -471,7 +455,6 @@ const compareSummary = computed(() => {
(sum, item) => sum + Number(item.amount || 0),
0
)
- // 与顶部基础信息保持同一口径:挂靠不增加整单票据总额
return summarizeReceiptAmountRows(amountCompare.value.details, claimTotal)
})
@@ -622,8 +605,6 @@ const getItemReceiptFiles = item => {
const itemHasReceipt = item => getItemReceiptFiles(item).length > 0
-// 「发票」列三态:有(本行上传发票)/ 挂靠(用本单其它明细上传的发票)/ 无。
-// 挂靠优先展示;数量为本行关联的发票凭证张数(上传张数 + 挂靠张数)。
const itemLinkedInvoiceCount = item =>
Number(item?.invoice_file_id || 0) > 0 && Number(item?.invoice_use_amount || 0) > 0 ? 1 : 0
@@ -643,11 +624,8 @@ const getItemReceiptAmountTotal = item => {
return amounts.reduce((sum, amount) => sum + Number(amount), 0)
}
-// 本条明细挂靠本单其它明细上传的发票时,本次分到的额度
const getItemLinkedAmount = item => Number(item?.invoice_use_amount || 0)
-// 按发票文件 ID 统计「被挂靠走」的额度。一张票的票面只在上传它的那条
-// 明细计入一次,挂靠出去的部分要从宿主明细划出,否则同一张票会被重复计算。
const linkedOutByFile = computed(() => {
const map = {}
for (const item of props.detail?.items || []) {
@@ -666,7 +644,6 @@ const getItemLinkedOutAmount = item =>
0
)
-// 本行可用发票金额 = 上传票面(扣除已划出给挂靠明细的部分)+ 本行挂靠分到的额度
const getItemInvoiceAmount = item => {
const uploaded = getItemReceiptAmountTotal(item)
const linked = getItemLinkedAmount(item)
@@ -676,8 +653,6 @@ const getItemInvoiceAmount = item => {
return own + linked
}
-// 统一口径:本行发票金额 − 本行明细金额。所有明细、顶部整单完全一致,
-// 明细行差额之和就等于顶部整单差额。
const getItemReceiptDiff = item => {
const invoiceTotal = getItemInvoiceAmount(item)
if (invoiceTotal == null) return null
@@ -703,7 +678,6 @@ const itemReceiptDiffClass = item => {
return diff > 0 ? 'receipt-diff-over' : 'receipt-diff-short'
}
-// 悬停说明差额构成:票面、划出的挂靠额度、分入的挂靠额度
const itemReceiptDiffTip = item => {
const uploaded = getItemReceiptAmountTotal(item)
const linked = getItemLinkedAmount(item)
@@ -717,8 +691,6 @@ const itemReceiptDiffTip = item => {
return parts.join(';')
}
-// 顶部整单 = 各明细可用发票金额之和。挂靠额度只是同一张票在明细之间划转,
-// 「划出」与「分入」相互抵消,因此总额等于实际上传票据的票面合计,不重复计算。
const detailReceiptTotal = computed(() => {
const items = props.detail?.items || []
let hasAny = false
@@ -844,8 +816,6 @@ const handleItemsSaved = reimbursementId => {
emit('changed', reimbursementId)
}
-// 发票挂靠:对已有明细直接挂靠 / 更换 / 解挂,复用明细更新接口,
-// 请求里带上原发票附件字段,避免更新时把已上传的票据清掉。
const saveInvoiceLink = async (row, fileId, useAmount) => {
try {
await updateReimbursementItem(props.detail?.id, row.id, {
@@ -913,7 +883,6 @@ const handleSubmit = async () => {
}
}
-// 撤回审批中的单据:回到草稿后可继续编辑费用条目,再重新提交
const handleWithdraw = async () => {
if (!props.detail?.id) return
try {
@@ -942,7 +911,6 @@ const handleWithdraw = async () => {
}
}
-// 审批通过后由报销人本人确认款项到账,单据置为「已打款」
const confirmPaid = async () => {
if (!props.detail?.id) return
try {
@@ -982,7 +950,6 @@ const uploadFileToSystem = async rawFile => {
const formData = new FormData()
formData.append('file', rawFile)
formData.append('cate', 'reimbursement-invoice')
- // 报销票据归属到当前用户个人目录:backend/{tid}/{uid}/年月日/
const uploadResponse = await uploadFile(formData, { scope: 'user' })
if (uploadResponse?.code !== 200 && uploadResponse?.code !== 201) {
throw new Error(uploadResponse?.msg || `「${rawFile.name}」上传失败`)
@@ -1146,7 +1113,6 @@ const removeReceipt = async receipt => {
}
const actionLabel = value => ({ 1: '提交申请', 2: '审批通过', 3: '审批驳回', 4: '转审', 5: '撤回' })[value] || '审批操作'
-// 老记录没有审批意见时,用动作补一条可读的说明,避免时间线只显示 “-”
const defaultRecordReason = record => {
switch (Number(record?.action)) {
case 1:
@@ -1475,7 +1441,6 @@ const money = value => Number(value || 0).toFixed(2)
diff --git a/backend/src/views/settings/systeminfo/index.vue b/backend/src/views/settings/systeminfo/index.vue
index 48d031e..d38037d 100644
--- a/backend/src/views/settings/systeminfo/index.vue
+++ b/backend/src/views/settings/systeminfo/index.vue
@@ -9,7 +9,6 @@
-
{{ systemInfo.name || '温新云平台' }}
@@ -31,7 +30,6 @@
-
{{ systemInfo.serverHost || '-' }}
@@ -61,7 +59,6 @@
-
{{ systemInfo.dbType || 'MySQL' }}
@@ -79,7 +76,6 @@
-
{{ clientInfo.browser }}
@@ -103,7 +99,6 @@
-
Vue 3
@@ -119,7 +114,6 @@
-
@@ -141,21 +135,17 @@ import { ElMessage } from 'element-plus';
import { InfoFilled, Refresh, DocumentCopy } from '@element-plus/icons-vue';
import { formatDateTime } from '@/utils/datetime';
-// 系统信息数据
const loading = ref(false);
const systemInfo = ref({});
const currentTime = ref(formatDateTime(new Date()));
-// API基础地址
const apiBaseUrl = computed(() => {
return import.meta.env.VITE_API_BASE_URL || window.location.origin;
});
-// 客户端信息
const clientInfo = computed(() => {
const ua = navigator.userAgent;
- // 检测浏览器
let browser = 'Unknown';
let browserVersion = '';
if (ua.includes('Chrome') && !ua.includes('Edg')) {
@@ -176,7 +166,6 @@ const clientInfo = computed(() => {
browserVersion = match ? match[1] : '';
}
- // 检测操作系统
let os = 'Unknown';
if (ua.includes('Win')) os = 'Windows';
else if (ua.includes('Mac')) os = 'macOS';
@@ -184,7 +173,6 @@ const clientInfo = computed(() => {
else if (ua.includes('Android')) os = 'Android';
else if (ua.includes('iOS')) os = 'iOS';
- // 检测是否为移动设备
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(ua);
return {
@@ -195,11 +183,10 @@ const clientInfo = computed(() => {
isMobile,
userAgent: ua,
cpuCores: navigator.hardwareConcurrency || '-',
- nodeVersion: '-', // Node.js 版本在浏览器环境中不可用
+ nodeVersion: '-',
};
});
-// 获取内存使用颜色
const getMemoryColor = (usage: number | undefined) => {
if (!usage) return '#3973ff';
if (usage >= 90) return '#f56c6c';
@@ -207,7 +194,6 @@ const getMemoryColor = (usage: number | undefined) => {
return '#67c23a';
};
-// 获取磁盘使用颜色
const getDiskColor = (usage: number | undefined) => {
if (!usage) return '#3973ff';
if (usage >= 90) return '#f56c6c';
@@ -215,17 +201,10 @@ const getDiskColor = (usage: number | undefined) => {
return '#67c23a';
};
-// 获取系统信息
async function fetchSystemInfo() {
loading.value = true;
try {
- // 如果有后端API,可以在这里调用
- // const res = await getSystemInfo();
- // if (res.success && res.data) {
- // systemInfo.value = res.data;
- // }
- // 模拟数据(如果有API会替换)
systemInfo.value = {
name: '温新云平台',
version: '1.0.0',
@@ -249,14 +228,12 @@ async function fetchSystemInfo() {
}
}
-// 刷新信息
function refreshInfo() {
fetchSystemInfo();
currentTime.value = formatDateTime(new Date());
ElMessage.success('信息已刷新');
}
-// 复制系统信息
function copySystemInfo() {
const infoText = `系统信息报告
==================
@@ -295,7 +272,6 @@ function copySystemInfo() {
ElMessage.error('复制失败,请手动复制');
});
} else {
- // 降级方案
const textarea = document.createElement('textarea');
textarea.value = infoText;
document.body.appendChild(textarea);
@@ -310,11 +286,9 @@ function copySystemInfo() {
}
}
-// 更新时间
let timeInterval: NodeJS.Timeout | null = null;
onMounted(() => {
fetchSystemInfo();
- // 每秒更新时间
timeInterval = setInterval(() => {
currentTime.value = formatDateTime(new Date());
}, 1000);
diff --git a/backend/src/views/system/approval/index.vue b/backend/src/views/system/approval/index.vue
index bd6b777..9a4ec2c 100644
--- a/backend/src/views/system/approval/index.vue
+++ b/backend/src/views/system/approval/index.vue
@@ -12,7 +12,6 @@
-
@@ -48,10 +47,8 @@
-
-
@@ -89,7 +86,6 @@
@change="onDeptChange"
placeholder="留空表示全公司通用(选公司=全员;选部门=覆及子部门)"
style="width:100%" />
-
@@ -141,8 +137,6 @@ const pools = reactive<{ users: any[]; roles: any[]; orgs: any[]; positions: any
positions: []
})
-// 将平面部门列表拼成树(复用组织管理页的 buildOrgTree,内部做 Number 强转)
-// 去除空 children 数组,避免 el-tree-select 叶节点渲染异常导致无法点击选中
function stripEmptyChildren(nodes: any[]): any[] {
return nodes.map((n) => {
const node = { ...n }
@@ -156,7 +150,6 @@ function stripEmptyChildren(nodes: any[]): any[] {
}
const orgTree = computed(() => stripEmptyChildren(buildOrgTree(pools.orgs)))
-// 祖先剪枝:若某选中节点的上级(含公司)也已被勾选,则子节点冗余,自动剔除
function pruneRedundantDepts(ids: any[]): number[] {
if (!ids || !ids.length) return []
const numIds = ids.map((v) => Number(v))
@@ -167,7 +160,7 @@ function pruneRedundantDepts(ids: any[]): number[] {
let p = parentOf.get(id) || 0
const guard = new Set([id])
while (p && parentOf.has(p) && !guard.has(p)) {
- if (set.has(p)) return false // 祖先已选 → 冗余
+ if (set.has(p)) return false
guard.add(p)
p = parentOf.get(p) || 0
}
@@ -179,7 +172,6 @@ function onDeptChange(ids: any[]) {
if (current.value) current.value.apply_dept_ids = pruneRedundantDepts(ids)
}
-// 租户侧 6 种审批人类型
const approverTypes = [
{ value: 1, label: '指定用户', needsSelection: true, selectLabel: '审批人', poolKey: 'users' },
{ value: 2, label: '按角色', needsSelection: true, selectLabel: '角色', poolKey: 'roles' },
@@ -227,7 +219,6 @@ async function selectFlow(id: number) {
const res: any = await getApprovalFlowDetail(id)
if (res.code === 200) {
const d = res.data || {}
- // 回显时对历史冗余选择做一次剪枝
d.apply_dept_ids = pruneRedundantDepts(d.apply_dept_ids || [])
current.value = d
graphModel.value = { nodes: d.nodes || [], edges: d.edges || [] }
@@ -246,7 +237,6 @@ function openNewFlow() {
status: 1,
apply_dept_ids: [] as number[]
}
- // 预置开始/结束,方便用户直接拖审批节点连线
graphModel.value = {
nodes: [
{ node_key: 'start', node_name: '开始', node_type: 1, pos_x: 60, pos_y: 200 },
diff --git a/backend/src/views/system/dict/components/DictItemEdit.vue b/backend/src/views/system/dict/components/DictItemEdit.vue
index 4fb0f04..952e82e 100644
--- a/backend/src/views/system/dict/components/DictItemEdit.vue
+++ b/backend/src/views/system/dict/components/DictItemEdit.vue
@@ -57,14 +57,11 @@ import { ref, reactive, computed, watch } from 'vue'
import { ElMessage } from 'element-plus'
import { createDictItem, updateDictItem } from '@/api/dict'
-/** 与 el-tag 的 type 对齐,存入 yz_*_dict_item.tag_type */
const TAG_TYPES = ['primary', 'success', 'warning', 'danger', 'info']
const props = defineProps({
visible: { type: Boolean, default: false },
- /** 所属字典ID */
dictId: { type: [Number, String], default: null },
- /** 传入表示编辑,null 表示新增 */
dictItem: { type: Object, default: null }
})
@@ -145,7 +142,6 @@ async function handleSubmit() {
remark: form.remark
}
if (isEdit.value) {
- // 字典项值不可改,避免历史数据里的存量值对不上
payload.id = form.id
} else {
payload.dict_id = props.dictId
diff --git a/backend/src/views/system/dict/components/DictTypeEdit.vue b/backend/src/views/system/dict/components/DictTypeEdit.vue
index 18dbf5b..c16fd35 100644
--- a/backend/src/views/system/dict/components/DictTypeEdit.vue
+++ b/backend/src/views/system/dict/components/DictTypeEdit.vue
@@ -46,7 +46,6 @@ import { createDictType, updateDictType } from '@/api/dict'
const props = defineProps({
visible: { type: Boolean, default: false },
- /** 传入表示编辑,null 表示新增 */
dictType: { type: Object, default: null }
})
@@ -121,7 +120,6 @@ async function handleSubmit() {
status: form.status,
remark: form.remark
}
- // 新增时才提交编码;编辑时编码不可改,由后端忽略
if (!isEdit.value) payload.dict_code = form.dict_code
submitting.value = true
diff --git a/backend/src/views/system/dict/index.vue b/backend/src/views/system/dict/index.vue
index 279fb8b..9e1315a 100644
--- a/backend/src/views/system/dict/index.vue
+++ b/backend/src/views/system/dict/index.vue
@@ -1,6 +1,5 @@
-
@@ -35,7 +34,6 @@
{{ row.dict_name }}
-
内置
@@ -84,7 +82,6 @@
-
@@ -210,11 +207,8 @@ import DictTypeEdit from './components/DictTypeEdit.vue'
import DictItemEdit from './components/DictItemEdit.vue'
import { formatDateTime } from '@/utils/datetime'
-/** 当前视图:list 字典列表 / items 字典项列表 */
const view = ref('list')
-/* ---------------- 字典列表 ---------------- */
-
const typeLoading = ref(false)
const types = ref([])
const typeKeyword = ref('')
@@ -222,8 +216,6 @@ const typeDialogVisible = ref(false)
const currentDictType = ref(null)
const typePage = reactive({ page: 1, pageSize: 15, total: 0 })
-/* ---------------- 字典项 ---------------- */
-
const itemLoading = ref(false)
const items = ref([])
const itemKeyword = ref('')
@@ -231,15 +223,12 @@ const itemDialogVisible = ref(false)
const currentDictItem = ref(null)
const itemPage = reactive({ page: 1, pageSize: 15, total: 0 })
-/** 进入字典项页时选中的字典 */
const currentType = ref(null)
-/** 后端失败时优先透出业务提示(兼容 {code,msg} 与 HTTP 错误两种形态) */
function errMsg(e, fallback) {
return e?.response?.data?.msg || e?.message || fallback
}
-/** 全局内置字典:只读(平台端字段为 undefined,自然放开) */
const isGlobalDict = computed(() => !!currentType.value?.is_global)
onMounted(loadTypes)
@@ -280,7 +269,6 @@ function openTypeEdit(row) {
typeDialogVisible.value = true
}
-/** 字典保存后刷新列表;新增的字典直接进入它的字典项 */
async function handleTypeSaved(created) {
await loadTypes()
if (created?.id) {
@@ -312,9 +300,6 @@ async function handleTypeDelete(row) {
}
}
-/* ---------------- 字典项 ---------------- */
-
-/** 进入某个字典的字典项列表 */
function openItems(row) {
currentType.value = { ...row }
itemKeyword.value = ''
@@ -326,7 +311,7 @@ function openItems(row) {
function goBackToList() {
view.value = 'list'
if (currentType.value) {
- loadTypes() // 回列表时同步一下(字典项数量可能变了)
+ loadTypes()
}
}
@@ -482,7 +467,6 @@ async function handleItemDelete(row) {
width: 300px;
}
-/* 表格高度自适应:行数少时按内容收缩,行数多时封顶并在表格内部滚动(表头常驻) */
.dict-table {
:deep(.el-table__body-wrapper) {
max-height: calc(100vh - 440px);
@@ -506,7 +490,6 @@ async function handleItemDelete(row) {
margin-left: 6px;
}
-/* 屏幕很矮 / 窄屏时放宽封顶高度,交给页面滚动 */
@media (max-height: 620px), (max-width: 900px) {
.dict-table {
:deep(.el-table__body-wrapper) {
diff --git a/backend/src/views/system/fileManager/components/createCategory.vue b/backend/src/views/system/fileManager/components/createCategory.vue
index 569056c..bdb1844 100644
--- a/backend/src/views/system/fileManager/components/createCategory.vue
+++ b/backend/src/views/system/fileManager/components/createCategory.vue
@@ -51,7 +51,6 @@ const form = ref({
name: "",
});
-// 表单验证规则
const rules = {
name: [
{ required: true, message: "请输入文件分组名称", trigger: "blur" },
@@ -59,15 +58,12 @@ const rules = {
],
};
-// 监听 modelValue 变化
watch(
() => props.modelValue,
(newVal) => {
visible.value = newVal;
if (newVal) {
- // 打开对话框时,清空表单数据
form.value.name = "";
- // 清除表单验证
if (formRef.value) {
formRef.value.clearValidate();
}
@@ -75,14 +71,12 @@ watch(
}
);
-// 监听 visible 变化
watch(visible, (newVal) => {
if (!newVal) {
emit("update:modelValue", false);
}
});
-// 取消
const handleCancel = () => {
visible.value = false;
form.value.name = "";
@@ -92,13 +86,11 @@ const handleCancel = () => {
emit("close");
};
-// 提交
const handleSubmit = async () => {
if (!formRef.value) {
return;
}
- // 表单验证
try {
await formRef.value.validate();
} catch (error) {
@@ -106,7 +98,6 @@ const handleSubmit = async () => {
return;
}
- // 验证名称是否为空
if (!form.value.name || form.value.name.trim() === "") {
ElMessage.error("文件分组名称不能为空");
return;
@@ -136,7 +127,6 @@ const handleSubmit = async () => {
}
};
-// 暴露方法给父组件
defineExpose({
open: () => {
form.value.name = "";
diff --git a/backend/src/views/system/fileManager/components/moveFile.vue b/backend/src/views/system/fileManager/components/moveFile.vue
index 3268ded..1a01292 100644
--- a/backend/src/views/system/fileManager/components/moveFile.vue
+++ b/backend/src/views/system/fileManager/components/moveFile.vue
@@ -41,7 +41,6 @@ interface Cate {
name: string
}
-// Props
const props = defineProps<{
visible: boolean
fileId: number | null
@@ -49,26 +48,21 @@ const props = defineProps<{
cateList: Cate[]
}>()
-// Emits
const emit = defineEmits(['update:visible', 'moved'])
-// Data
const targetCate = ref(null)
const loading = ref(false)
-// 未分类分组
const uncategorizedOption: Cate = {
id: 0,
name: '未分类'
}
-// 计算属性:添加未分类选项,并标记当前分组为禁用
const filteredCateList = computed(() => {
const list = [uncategorizedOption, ...(props.cateList || [])]
return list
})
-// 重置
watch(
() => props.visible,
(val) => {
@@ -78,26 +72,21 @@ watch(
}
)
-// 关闭对话框
function handleClose() {
emit('update:visible', false)
targetCate.value = null
}
-// 选择分组
function handleCateChange(value: number) {
targetCate.value = value
}
-// 移动文件
async function handleMove() {
- // 校验文件ID和目标分组ID的有效性
if (!props.fileId) {
ElMessage.error('请选择要移动的文件')
return
}
- // 修复:0 是有效的分组ID(未分类),需要检查 null 或 undefined
if (targetCate.value === null || targetCate.value === undefined) {
ElMessage.error('请选择目标分组')
return
@@ -109,8 +98,8 @@ async function handleMove() {
if (res && res.code === 200) {
ElMessage.success('文件移动成功')
- handleClose() // 先关闭对话框
- emit('moved') // 然后触发移动成功事件,刷新列表
+ handleClose()
+ emit('moved')
} else {
ElMessage.error(res?.msg || '文件移动失败')
}
diff --git a/backend/src/views/system/fileManager/components/renameCategory.vue b/backend/src/views/system/fileManager/components/renameCategory.vue
index de97f87..a480cf0 100644
--- a/backend/src/views/system/fileManager/components/renameCategory.vue
+++ b/backend/src/views/system/fileManager/components/renameCategory.vue
@@ -59,7 +59,6 @@ const form = ref({
name: "",
});
-// 表单验证规则
const rules = {
name: [
{ required: true, message: "请输入文件分组名称", trigger: "blur" },
@@ -67,15 +66,12 @@ const rules = {
],
};
-// 监听 modelValue 变化
watch(
() => props.modelValue,
(newVal) => {
visible.value = newVal;
if (newVal) {
- // 打开对话框时,初始化表单数据
form.value.name = props.categoryName || "";
- // 清除表单验证
if (formRef.value) {
formRef.value.clearValidate();
}
@@ -83,14 +79,12 @@ watch(
}
);
-// 监听 visible 变化
watch(visible, (newVal) => {
if (!newVal) {
emit("update:modelValue", false);
}
});
-// 取消
const handleCancel = () => {
visible.value = false;
form.value.name = "";
@@ -100,13 +94,11 @@ const handleCancel = () => {
emit("close");
};
-// 提交
const handleSubmit = async () => {
if (!formRef.value) {
return;
}
- // 表单验证
try {
await formRef.value.validate();
} catch (error) {
@@ -114,19 +106,16 @@ const handleSubmit = async () => {
return;
}
- // 验证名称是否为空
if (!form.value.name || form.value.name.trim() === "") {
ElMessage.error("文件分组名称不能为空");
return;
}
- // 验证名称是否与原来相同
if (form.value.name.trim() === props.categoryName) {
ElMessage.warning("名称未发生变化");
return;
}
- // 验证 categoryId
if (!props.categoryId) {
ElMessage.error("分组ID不能为空");
return;
@@ -156,7 +145,6 @@ const handleSubmit = async () => {
}
};
-// 暴露方法给父组件
defineExpose({
open: (categoryId: number, categoryName: string) => {
form.value.name = categoryName || "";
diff --git a/backend/src/views/system/fileManager/components/uploadFile.vue b/backend/src/views/system/fileManager/components/uploadFile.vue
index 941920e..5548ecf 100644
--- a/backend/src/views/system/fileManager/components/uploadFile.vue
+++ b/backend/src/views/system/fileManager/components/uploadFile.vue
@@ -79,9 +79,8 @@ const visible = computed({
const uploadRef = ref();
const fileList = ref([]);
const uploading = ref(false);
-const uploadAction = ref(""); // 不使用action,手动上传
+const uploadAction = ref("");
-// 上传请求头
const uploadHeaders = computed(() => {
const token = localStorage.getItem("token");
return {
@@ -89,21 +88,17 @@ const uploadHeaders = computed(() => {
};
});
-// 上传额外数据
const uploadData = computed(() => ({
cate: props.categoryId || 0,
}));
-// 文件变化监听
const handleChange = (file: UploadFile, files: UploadFiles) => {
- // 更新文件列表
fileList.value = files;
};
-// 文件上传前的验证
const beforeUpload = (file: File) => {
- const maxSize = 50 * 1024 * 1024; // 50MB
- const isValidType = true; // 可以根据需要限制文件类型
+ const maxSize = 50 * 1024 * 1024;
+ const isValidType = true;
if (file.size > maxSize) {
ElMessage.error(`文件 ${file.name} 大小超过50MB限制`);
@@ -113,7 +108,6 @@ const beforeUpload = (file: File) => {
return true;
};
-// 移除文件
const handleRemove = (file: UploadFile) => {
const index = fileList.value.findIndex((item) => item.uid === file.uid);
if (index > -1) {
@@ -121,15 +115,12 @@ const handleRemove = (file: UploadFile) => {
}
};
-// 上传进度
const handleProgress = (event: any, file: UploadFile) => {
file.status = "uploading";
file.percentage = Math.round(event.percent);
};
-// 上传成功
const handleSuccess = (response: any, file: UploadFile) => {
- // 只要 code === 200 或 201 都视作已成功(存在或新上传)
if (response.code === 200) {
file.status = "success";
ElMessage.success(`文件 ${file.name} 上传成功`);
@@ -142,7 +133,6 @@ const handleSuccess = (response: any, file: UploadFile) => {
}
};
-// 上传失败
const handleError = (error: any, file: UploadFile) => {
file.status = "fail";
let msg = error?.message || error?.msg || '';
@@ -153,11 +143,9 @@ const handleError = (error: any, file: UploadFile) => {
ElMessage.error(msg ? `文件 ${file.name} 上传失败:${msg}` : `文件 ${file.name} 上传失败`);
};
-// 手动提交上传
const submitUpload = async () => {
if (!uploadRef.value) return;
- // 从 upload 组件实例获取文件列表
const uploadFiles = uploadRef.value.uploadFiles || fileList.value;
const filesToUpload = uploadFiles.filter(
@@ -172,7 +160,6 @@ const submitUpload = async () => {
uploading.value = true;
try {
- // 逐个上传文件,显示进度
const uploadPromises = filesToUpload.map(async (file) => {
file.status = "uploading";
file.percentage = 0;
@@ -184,7 +171,6 @@ const submitUpload = async () => {
formData.append("cate", props.categoryId.toString());
}
- // 模拟上传进度
const progressInterval = setInterval(() => {
if (file.percentage < 90) {
file.percentage = Math.min(file.percentage + 10, 90);
@@ -196,7 +182,6 @@ const submitUpload = async () => {
clearInterval(progressInterval);
file.percentage = 100;
- // code 200 表示新上传成功,code 201 表示文件已存在(也视为成功)
if (res.code === 200 || res.code === 201) {
file.status = "success";
return { success: true, file, res };
@@ -216,7 +201,6 @@ const submitUpload = async () => {
const successCount = results.filter((r) => r.status === "fulfilled").length;
const failCount = results.filter((r) => r.status === "rejected").length;
- // 统计新上传和已存在的文件数量
let newUploadCount = 0;
let existCount = 0;
results.forEach((result) => {
@@ -243,7 +227,6 @@ const submitUpload = async () => {
ElMessage.success(message);
}
if (failCount > 0) {
- // 附件空间不足(后端业务码 4032):引导购买扩容
const quotaRejected = results.find(
(r) =>
r.status === "rejected" &&
@@ -268,7 +251,6 @@ const submitUpload = async () => {
ElMessage.warning(`${failCount} 个文件上传失败`);
}
- // 如果所有文件都上传成功,关闭对话框并刷新列表
if (failCount === 0) {
emit("success");
handleClose();
@@ -281,7 +263,6 @@ const submitUpload = async () => {
}
};
-// 关闭对话框
const handleClose = () => {
fileList.value = [];
uploading.value = false;
diff --git a/backend/src/views/system/fileManager/index.vue b/backend/src/views/system/fileManager/index.vue
index 2b33872..77827f0 100644
--- a/backend/src/views/system/fileManager/index.vue
+++ b/backend/src/views/system/fileManager/index.vue
@@ -8,7 +8,6 @@
文件管理系统
-
-
@@ -103,7 +101,6 @@
-
-
-
-
-
-
-
-
-
-
>({});
@@ -550,13 +535,11 @@ const loadStorageInfo = async () => {
const res = await getStorageInfo();
if (res?.code === 200) storageInfo.value = res.data || {};
} catch {
- // 空间用量属于辅助信息,失败不影响文件管理
}
};
const goStorage = () => router.push("/basicSettings/storage");
-// 分组相关
interface Group {
id: number;
name: string;
@@ -568,7 +551,6 @@ const groups = ref([]);
const groupSearchQuery = ref("");
const selectedGroup = ref(null);
-// 文件相关
interface FileItem {
id: number;
name: string;
@@ -583,55 +565,44 @@ const files = ref([]);
const fileSearchQuery = ref("");
const loading = ref(false);
-// 分页相关
const currentPage = ref(1);
const pageSize = ref(20);
const total = ref(0);
-// 上传对话框
const showUploadDialog = ref(false);
-// 移动文件对话框
const showMoveDialog = ref(false);
const selectedFile = ref(null);
-// 批量选择
const selectedFileIds = ref([]);
-// 批量移动对话框
const showBatchMoveDialog = ref(false);
const batchMoveTargetCate = ref(0);
const batchMoveLoading = ref(false);
-// 图片预览
const showImagePreview = ref(false);
const previewImageUrl = ref("");
const previewFile = ref(null);
const previewContainerRef = ref(null);
-// 图片缩放和位置
const imageScale = ref(1);
const imagePosition = ref({ x: 0, y: 0 });
const isDragging = ref(false);
const dragStart = ref({ x: 0, y: 0 });
const isFullscreen = ref(false);
-// 重命名文件分组对话框
const showRenameCategoryDialog = ref(false);
const renameCategoryRef = ref(null);
const currentRenameCategoryId = ref(null);
const currentRenameCategoryName = ref("");
-// 创建文件分组对话框
const showCreateCategoryDialog = ref(false);
const createCategoryRef = ref(null);
-//获取用户分类
const getUserCateData = async () => {
try {
const res = await getUserCate();
if (res.code === 200) {
- // 为每个分类添加文件数量(初始为0,后续可以通过接口获取)
groups.value = res.data.map((item: any) => ({
id: item.id,
name: item.name,
@@ -639,7 +610,6 @@ const getUserCateData = async () => {
description: item.description,
}));
- // 默认选择"未分类"组
selectGroup(uncategorizedGroup.value);
}
} catch (error) {
@@ -648,8 +618,6 @@ const getUserCateData = async () => {
}
};
-// 图片拼接接口地址
-// 七牛云等云存储会返回完整 http/https 地址,直接使用;本地存储返回相对路径时再拼接接口地址
const getFileUrl = (url: string) => {
if (!url) return "";
@@ -664,7 +632,6 @@ const getFileUrl = (url: string) => {
return `${baseUrl}${path}`;
};
-// 未分类分组(固定,不可编辑)
const uncategorizedGroup = ref({
id: 0,
name: "未分类",
@@ -672,7 +639,6 @@ const uncategorizedGroup = ref({
description: "未分类的文件",
});
-// 过滤后的分组列表(未分类组置顶)
const filteredGroups = computed(() => {
let result = [uncategorizedGroup.value, ...groups.value];
@@ -684,39 +650,32 @@ const filteredGroups = computed(() => {
return result;
});
-// 搜索文件(触发重新加载)
const handleFileSearch = () => {
- currentPage.value = 1; // 搜索时重置到第一页
+ currentPage.value = 1;
loadFiles();
};
-// 选择分组
const selectGroup = (group: Group) => {
selectedGroup.value = group;
- currentPage.value = 1; // 切换分组时重置到第一页
+ currentPage.value = 1;
loadFiles();
};
-// 打开创建分组对话框
const handleCreateCategory = () => {
showCreateCategoryDialog.value = true;
- // 如果组件有 open 方法,调用它
if (createCategoryRef.value && createCategoryRef.value.open) {
createCategoryRef.value.open();
}
};
-// 创建分组成功回调
const handleCreateCategorySuccess = () => {
getUserCateData();
};
-// 关闭创建分组对话框
const handleCreateCategoryClose = () => {
showCreateCategoryDialog.value = false;
};
-//重命名文件分组
const renameFileCateData = async (id: number, data: any) => {
const res = await renameFileCate(id, data);
if (res.code === 200) {
@@ -724,7 +683,6 @@ const renameFileCateData = async (id: number, data: any) => {
}
};
-// 打开重命名对话框
const handleRenameCategory = (group: any) => {
if (!group || !group.id) {
ElMessage.error("分组信息不完整");
@@ -733,16 +691,13 @@ const handleRenameCategory = (group: any) => {
currentRenameCategoryId.value = group.id;
currentRenameCategoryName.value = group.name || "";
showRenameCategoryDialog.value = true;
- // 如果组件有 open 方法,调用它
if (renameCategoryRef.value && renameCategoryRef.value.open) {
renameCategoryRef.value.open(group.id, group.name);
}
};
-// 重命名成功回调
const handleRenameCategorySuccess = () => {
getUserCateData();
- // 如果当前选中的是重命名的分组,更新选中分组信息
if (
selectedGroup.value &&
selectedGroup.value.id === currentRenameCategoryId.value
@@ -756,14 +711,12 @@ const handleRenameCategorySuccess = () => {
}
};
-// 关闭重命名对话框
const handleRenameCategoryClose = () => {
showRenameCategoryDialog.value = false;
currentRenameCategoryId.value = null;
currentRenameCategoryName.value = "";
};
-//删除文件分组
const deleteFileCateData = async (id: number) => {
ElMessageBox.confirm("确定删除该文件分组吗?", "提示", {
confirmButtonText: "确定",
@@ -780,7 +733,6 @@ const deleteFileCateData = async (id: number) => {
});
};
-// 加载文件列表
const loadFiles = async () => {
if (!selectedGroup.value) {
files.value = [];
@@ -790,7 +742,6 @@ const loadFiles = async () => {
loading.value = true;
try {
- // 如果是未分类组(id === 0),传递 0 作为分类ID
const cateId = selectedGroup.value.id === 0 ? 0 : selectedGroup.value.id;
const res = await getCateFiles(
@@ -800,15 +751,11 @@ const loadFiles = async () => {
fileSearchQuery.value,
);
if (res.code === 200 && res.data) {
- // 更新总数
total.value = res.data.total || 0;
- // 更新分组的文件数量
if (selectedGroup.value.id === 0) {
- // 更新未分类组的文件数量
uncategorizedGroup.value.total = res.data.total || 0;
} else {
- // 更新普通分组的文件数量
const group = groups.value.find(
(g) => g.id === selectedGroup.value!.id,
);
@@ -817,42 +764,32 @@ const loadFiles = async () => {
}
}
- // 处理文件数据,将type数字转换为MIME类型
files.value = (res.data.list || []).map((file: any) => {
- // 根据文件扩展名判断MIME类型
const fileName = file.name || "";
const ext = fileName.split(".").pop()?.toLowerCase() || "";
let mimeType = "application/octet-stream";
- // 图片类型
if (["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(ext)) {
mimeType = `image/${ext === "jpg" ? "jpeg" : ext}`;
}
- // 视频类型
else if (["mp4", "webm", "mov", "avi"].includes(ext)) {
mimeType = `video/${ext}`;
}
- // 音频类型
else if (["mp3", "wav", "ogg"].includes(ext)) {
mimeType = `audio/${ext}`;
}
- // PDF
else if (ext === "pdf") {
mimeType = "application/pdf";
}
- // Word文档
else if (["doc", "docx"].includes(ext)) {
mimeType = "application/msword";
}
- // Excel
else if (["xls", "xlsx"].includes(ext)) {
mimeType = "application/vnd.ms-excel";
}
- // PowerPoint
else if (["ppt", "pptx"].includes(ext)) {
mimeType = "application/vnd.ms-powerpoint";
}
- // 文本文件
else if (ext === "txt") {
mimeType = "text/plain";
}
@@ -882,26 +819,22 @@ const loadFiles = async () => {
}
};
-//刷新数据
const refushData = () => {
getUserCateData();
loadFiles();
};
-// 分页大小改变
const handleSizeChange = (size: number) => {
pageSize.value = size;
- currentPage.value = 1; // 改变每页数量时重置到第一页
+ currentPage.value = 1;
loadFiles();
};
-// 页码改变
const handlePageChange = (page: number) => {
currentPage.value = page;
loadFiles();
};
-// 判断文件类型
const isImage = (file: FileItem) => {
return file.type.startsWith("image/");
};
@@ -921,7 +854,6 @@ const isDocument = (file: FileItem) => {
);
};
-// 格式化文件大小
const formatFileSize = (bytes: number): string => {
if (bytes === 0) return "0 B";
const k = 1024;
@@ -930,16 +862,11 @@ const formatFileSize = (bytes: number): string => {
return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + " " + sizes[i];
};
-// 格式化日期
-
-
-// 文件操作
const handleFileClick = (file: FileItem) => {
console.log("点击文件:", file);
// TODO: 实现文件预览或打开
};
-// 图片预览
const handleImagePreview = (file: FileItem) => {
previewFile.value = file;
previewImageUrl.value = getFileUrl(file.url);
@@ -947,17 +874,14 @@ const handleImagePreview = (file: FileItem) => {
resetZoom();
};
-// 预览对话框打开后
const handlePreviewOpened = () => {
resetZoom();
};
-// 图片加载完成
const handleImageLoad = () => {
resetZoom();
};
-// 关闭预览
const handlePreviewClose = () => {
showImagePreview.value = false;
previewImageUrl.value = "";
@@ -968,27 +892,23 @@ const handlePreviewClose = () => {
}
};
-// 放大
const zoomIn = () => {
if (imageScale.value < 3) {
imageScale.value = Math.min(imageScale.value + 0.25, 3);
}
};
-// 缩小
const zoomOut = () => {
if (imageScale.value > 0.5) {
imageScale.value = Math.max(imageScale.value - 0.25, 0.5);
}
};
-// 重置缩放
const resetZoom = () => {
imageScale.value = 1;
imagePosition.value = { x: 0, y: 0 };
};
-// 鼠标滚轮缩放
const handleWheel = (e: WheelEvent) => {
e.preventDefault();
const delta = e.deltaY > 0 ? -0.1 : 0.1;
@@ -996,7 +916,6 @@ const handleWheel = (e: WheelEvent) => {
imageScale.value = newScale;
};
-// 鼠标按下开始拖拽
const handleMouseDown = (e: MouseEvent) => {
if (imageScale.value > 1) {
isDragging.value = true;
@@ -1009,7 +928,6 @@ const handleMouseDown = (e: MouseEvent) => {
}
};
-// 鼠标移动拖拽
const handleMouseMove = (e: MouseEvent) => {
if (isDragging.value) {
imagePosition.value = {
@@ -1019,14 +937,12 @@ const handleMouseMove = (e: MouseEvent) => {
}
};
-// 鼠标释放结束拖拽
const handleMouseUp = () => {
isDragging.value = false;
document.removeEventListener("mousemove", handleMouseMove);
document.removeEventListener("mouseup", handleMouseUp);
};
-// 全屏切换
const toggleFullscreen = () => {
if (!isFullscreen.value) {
enterFullscreen();
@@ -1035,7 +951,6 @@ const toggleFullscreen = () => {
}
};
-// 进入全屏
const enterFullscreen = () => {
const element = previewContainerRef.value;
if (element) {
@@ -1052,7 +967,6 @@ const enterFullscreen = () => {
}
};
-// 退出全屏
const exitFullscreen = () => {
if (document.exitFullscreen) {
document.exitFullscreen();
@@ -1072,18 +986,14 @@ const handleDownload = (file: FileItem) => {
// TODO: 实现文件下载
};
-// 点击移动按钮
const handleMoveClick = (file: FileItem) => {
selectedFile.value = file;
showMoveDialog.value = true;
};
-// 移动成功回调
const handleMoveSuccess = () => {
- // 关闭对话框
showMoveDialog.value = false;
selectedFile.value = null;
- // 刷新文件列表
loadFiles();
getUserCateData();
};
@@ -1111,7 +1021,6 @@ function handleDelete(row) {
});
}
-// 彻底删除文件
function handlePermanentDelete(row) {
ElMessageBox.confirm("确定要彻底删除文件吗?此操作不可恢复,服务器上的文件也会被删除!", "警告", {
confirmButtonText: "确定删除",
@@ -1143,13 +1052,10 @@ const handleUpload = () => {
showUploadDialog.value = true;
};
-// 上传成功回调
const handleUploadSuccess = () => {
- // 刷新文件列表
loadFiles();
};
-// 切换文件选择
const toggleFileSelection = (file: FileItem) => {
const index = selectedFileIds.value.indexOf(file.id);
if (index > -1) {
@@ -1159,7 +1065,6 @@ const toggleFileSelection = (file: FileItem) => {
}
};
-// 全选/反选切换
const toggleSelectAll = () => {
const allFileIds = files.value.map(file => file.id);
const isAllSelected = allFileIds.length === selectedFileIds.value.length && allFileIds.length > 0;
@@ -1171,12 +1076,10 @@ const toggleSelectAll = () => {
}
};
-// 清除选择
const clearSelection = () => {
selectedFileIds.value = [];
};
-// 批量移动
const handleBatchMove = () => {
if (selectedFileIds.value.length === 0) {
ElMessage.warning('请先选择要移动的文件');
@@ -1186,7 +1089,6 @@ const handleBatchMove = () => {
showBatchMoveDialog.value = true;
};
-// 确认批量移动
const confirmBatchMove = async () => {
if (selectedFileIds.value.length === 0) {
ElMessage.warning('请先选择要移动的文件');
@@ -1223,7 +1125,6 @@ const confirmBatchMove = async () => {
}
};
-// 批量删除
const handleBatchDelete = () => {
if (selectedFileIds.value.length === 0) {
ElMessage.warning('请先选择要删除的文件');
@@ -1262,7 +1163,6 @@ const handleBatchDelete = () => {
});
};
-// 批量永久删除
const handleBatchDeletePermanently = () => {
if (selectedFileIds.value.length === 0) {
ElMessage.warning('请先选择要永久删除的文件');
@@ -1301,7 +1201,6 @@ const handleBatchDeletePermanently = () => {
});
};
-// 初始化
onMounted(() => {
getUserCateData();
loadStorageInfo();
@@ -1335,7 +1234,6 @@ onMounted(() => {
gap: 16px;
}
- // 附件空间用量(点击进入扩容页)
.storage-usage {
display: flex;
flex-direction: column;
@@ -1365,7 +1263,6 @@ onMounted(() => {
.group-card,
.file-content-card {
- // height: 100%;
.card-title {
display: flex;
@@ -1397,13 +1294,11 @@ onMounted(() => {
justify-content: space-between;
padding: 12px 16px;
margin-bottom: 8px;
- // background: #f5f7fa;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s;
&:hover {
- // background: #e6f0ff;
transform: translateX(4px);
}
@@ -1493,7 +1388,6 @@ onMounted(() => {
.file-card {
cursor: pointer;
transition: all 0.3s;
- // height: 100%;
display: flex;
flex-direction: column;
position: relative;
@@ -1610,7 +1504,6 @@ onMounted(() => {
}
}
-// 图片预览对话框
:deep(.image-preview-dialog) {
.preview-header {
display: flex;
@@ -1638,7 +1531,6 @@ onMounted(() => {
}
}
-// 图片预览容器
.preview-container {
display: flex;
flex-direction: column;
@@ -1648,7 +1540,6 @@ onMounted(() => {
max-height: 80vh;
overflow: hidden;
position: relative;
- // background: #f5f7fa;
border-radius: 8px;
.preview-image-wrapper {
diff --git a/backend/src/views/system/loginLog/components/detail.vue b/backend/src/views/system/loginLog/components/detail.vue
index ad52941..e88cfdb 100644
--- a/backend/src/views/system/loginLog/components/detail.vue
+++ b/backend/src/views/system/loginLog/components/detail.vue
@@ -82,7 +82,6 @@ const emit = defineEmits(["update:modelValue"]);
const visible = ref(false);
const log = ref(null);
-// 登录方式标签
const getLoginTypeLabel = (type: string): string => {
const typeMap: Record = {
password: "密码登录",
@@ -92,14 +91,13 @@ const getLoginTypeLabel = (type: string): string => {
return typeMap[type] || type;
};
-// 获取日志详情
const fetchLogDetail = async (logId?: number) => {
const targetId = logId || props.logId;
if (!targetId) {
return;
}
- log.value = null; // 清空之前的数据
+ log.value = null;
try {
const res = await getLoginLogDetail(targetId);
if (res.code === 200) {
@@ -114,7 +112,6 @@ const fetchLogDetail = async (logId?: number) => {
}
};
-// 监听 modelValue 变化
watch(
() => props.modelValue,
(newVal) => {
@@ -125,7 +122,6 @@ watch(
}
);
-// 监听 visible 变化
watch(visible, (newVal) => {
if (!newVal) {
emit("update:modelValue", false);
@@ -133,7 +129,6 @@ watch(visible, (newVal) => {
}
});
-// 暴露方法给父组件
defineExpose({
open: (logId: number) => {
if (logId) {
diff --git a/backend/src/views/system/loginLog/index.vue b/backend/src/views/system/loginLog/index.vue
index 498136a..393cb8d 100644
--- a/backend/src/views/system/loginLog/index.vue
+++ b/backend/src/views/system/loginLog/index.vue
@@ -12,7 +12,6 @@
-
@@ -73,15 +72,12 @@
-
-
详情
-
-
-
-
-
-
([]);
const selectedLogs = ref([]);
-// 筛选表单
const filterForm = ref({
keyword: "",
status: "",
@@ -224,12 +201,10 @@ const filterForm = ref({
const dateRange = ref<[string, string] | null>(null);
-// 详情对话框
const detailDialogVisible = ref(false);
const detailDialogRef = ref(null);
const currentLogId = ref(undefined);
-// 登录方式标签
const getLoginTypeLabel = (type: string): string => {
const typeMap: Record = {
password: "密码登录",
@@ -239,7 +214,6 @@ const getLoginTypeLabel = (type: string): string => {
return typeMap[type] || type;
};
-// 获取登录日志列表
const fetchLogs = async () => {
loading.value = true;
try {
@@ -278,18 +252,15 @@ const fetchLogs = async () => {
}
};
-// 刷新
const refresh = () => {
fetchLogs();
};
-// 搜索
const handleSearch = () => {
page.value = 1;
fetchLogs();
};
-// 重置
const handleReset = () => {
filterForm.value = {
keyword: "",
@@ -303,7 +274,6 @@ const handleReset = () => {
fetchLogs();
};
-// 时间范围变化
const handleDateRangeChange = (val: [string, string] | null) => {
if (val && val.length === 2) {
filterForm.value.startTime = val[0];
@@ -315,25 +285,21 @@ const handleDateRangeChange = (val: [string, string] | null) => {
handleSearch();
};
-// 分页改变
const handlePageChange = (val: number) => {
page.value = val;
fetchLogs();
};
-// 每页数量改变
const handleSizeChange = (val: number) => {
pageSize.value = val;
page.value = 1;
fetchLogs();
};
-// 选择改变
const handleSelectionChange = (selection: LoginLog[]) => {
selectedLogs.value = selection;
};
-// 删除单条
const handleDelete = (log: LoginLog) => {
ElMessageBox.confirm("确定删除该条登录日志吗?", "提示", {
confirmButtonText: "确定",
@@ -354,7 +320,6 @@ const handleDelete = (log: LoginLog) => {
});
};
-// 批量删除
const handleBatchDelete = () => {
const ids = selectedLogs.value.map((item) => item.id);
ElMessageBox.confirm(
@@ -380,7 +345,6 @@ const handleBatchDelete = () => {
});
};
-// 查看详情
const handleViewDetail = (log: LoginLog) => {
currentLogId.value = log.id;
detailDialogVisible.value = true;
diff --git a/backend/src/views/system/menus/components/edit.vue b/backend/src/views/system/menus/components/edit.vue
index 3e03a2b..053c7b7 100644
--- a/backend/src/views/system/menus/components/edit.vue
+++ b/backend/src/views/system/menus/components/edit.vue
@@ -1,5 +1,4 @@
-
| null;
@@ -141,17 +138,14 @@ const props = withDefaults(defineProps(), {
parentTitle: ''
});
-// Emits
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void;
(e: 'save', menu: Partial
@@ -280,7 +275,6 @@
/>
-
-
{{ systemInfo.name || '温新云平台' }}
@@ -31,7 +30,6 @@
-
{{ systemInfo.serverHost || '-' }}
@@ -61,7 +59,6 @@
-
{{ systemInfo.dbType || 'MySQL' }}
@@ -79,7 +76,6 @@
-
{{ clientInfo.browser }}
@@ -103,7 +99,6 @@
-
Vue 3
@@ -119,7 +114,6 @@
-
@@ -140,21 +134,17 @@ import { ref, computed, onMounted, onUnmounted } from 'vue';
import { ElMessage } from 'element-plus';
import { InfoFilled, Refresh, DocumentCopy } from '@element-plus/icons-vue';
-// 系统信息数据
const loading = ref(false);
const systemInfo = ref({});
const currentTime = ref(new Date().toLocaleString('zh-CN'));
-// API基础地址
const apiBaseUrl = computed(() => {
return import.meta.env.VITE_API_BASE_URL || window.location.origin;
});
-// 客户端信息
const clientInfo = computed(() => {
const ua = navigator.userAgent;
- // 检测浏览器
let browser = 'Unknown';
let browserVersion = '';
if (ua.includes('Chrome') && !ua.includes('Edg')) {
@@ -175,7 +165,6 @@ const clientInfo = computed(() => {
browserVersion = match ? match[1] : '';
}
- // 检测操作系统
let os = 'Unknown';
if (ua.includes('Win')) os = 'Windows';
else if (ua.includes('Mac')) os = 'macOS';
@@ -183,7 +172,6 @@ const clientInfo = computed(() => {
else if (ua.includes('Android')) os = 'Android';
else if (ua.includes('iOS')) os = 'iOS';
- // 检测是否为移动设备
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(ua);
return {
@@ -194,11 +182,10 @@ const clientInfo = computed(() => {
isMobile,
userAgent: ua,
cpuCores: navigator.hardwareConcurrency || '-',
- nodeVersion: '-', // Node.js 版本在浏览器环境中不可用
+ nodeVersion: '-',
};
});
-// 获取内存使用颜色
const getMemoryColor = (usage: number | undefined) => {
if (!usage) return '#3973ff';
if (usage >= 90) return '#f56c6c';
@@ -206,7 +193,6 @@ const getMemoryColor = (usage: number | undefined) => {
return '#67c23a';
};
-// 获取磁盘使用颜色
const getDiskColor = (usage: number | undefined) => {
if (!usage) return '#3973ff';
if (usage >= 90) return '#f56c6c';
@@ -214,17 +200,10 @@ const getDiskColor = (usage: number | undefined) => {
return '#67c23a';
};
-// 获取系统信息
async function fetchSystemInfo() {
loading.value = true;
try {
- // 如果有后端API,可以在这里调用
- // const res = await getSystemInfo();
- // if (res.success && res.data) {
- // systemInfo.value = res.data;
- // }
- // 模拟数据(如果有API会替换)
systemInfo.value = {
name: '温新云平台',
version: '1.0.0',
@@ -248,14 +227,12 @@ async function fetchSystemInfo() {
}
}
-// 刷新信息
function refreshInfo() {
fetchSystemInfo();
currentTime.value = new Date().toLocaleString('zh-CN');
ElMessage.success('信息已刷新');
}
-// 复制系统信息
function copySystemInfo() {
const infoText = `系统信息报告
==================
@@ -294,7 +271,6 @@ function copySystemInfo() {
ElMessage.error('复制失败,请手动复制');
});
} else {
- // 降级方案
const textarea = document.createElement('textarea');
textarea.value = infoText;
document.body.appendChild(textarea);
@@ -309,11 +285,9 @@ function copySystemInfo() {
}
}
-// 更新时间
let timeInterval: NodeJS.Timeout | null = null;
onMounted(() => {
fetchSystemInfo();
- // 每秒更新时间
timeInterval = setInterval(() => {
currentTime.value = new Date().toLocaleString('zh-CN');
}, 1000);
diff --git a/platform/src/views/system/aisettings/components/ocrSettings.vue b/platform/src/views/system/aisettings/components/ocrSettings.vue
index aed9cbe..f1a03d3 100644
--- a/platform/src/views/system/aisettings/components/ocrSettings.vue
+++ b/platform/src/views/system/aisettings/components/ocrSettings.vue
@@ -4,7 +4,6 @@
-
OCR 识别配置
-
@@ -97,7 +96,6 @@ const modelOptions = computed(() => {
});
const onProviderChange = () => {
- // 切换服务商后,若当前模型不在新列表中则清空
const ids = modelOptions.value.map((m) => m.id);
if (form.ocr_model && !ids.includes(form.ocr_model)) {
form.ocr_model = "";
diff --git a/platform/src/views/system/aisettings/components/providerDialog.vue b/platform/src/views/system/aisettings/components/providerDialog.vue
index ce50e64..5c664b0 100644
--- a/platform/src/views/system/aisettings/components/providerDialog.vue
+++ b/platform/src/views/system/aisettings/components/providerDialog.vue
@@ -101,7 +101,6 @@ import { createAiProvider, updateAiProvider, testAiProvider, deleteAiProvider }
const props = defineProps({
modelValue: { type: Boolean, default: false },
- /** null/undefined = 新增;有 id = 编辑 */
item: { type: Object, default: null },
presetApiType: { type: String, default: "chat_completions" },
});
diff --git a/platform/src/views/system/aisettings/index.vue b/platform/src/views/system/aisettings/index.vue
index 41d3e33..2b20fba 100644
--- a/platform/src/views/system/aisettings/index.vue
+++ b/platform/src/views/system/aisettings/index.vue
@@ -7,7 +7,6 @@
统一 AI 能力中台
@@ -26,7 +25,6 @@
-
-
-
模型配置
@@ -58,13 +56,11 @@
-
对话列表
@@ -89,7 +88,6 @@
>
{{ m.role === 'user' ? '我' : 'AI' }}
-