Merge branch 'developer' of ssh://code.cyweb.top:30033/scj/zhxy/v3/cloud-ui into developer
This commit is contained in:
89
src/api/professional/stayschool/outercompany.ts
Normal file
89
src/api/professional/stayschool/outercompany.ts
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018-2025, cyweb All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||||
|
* contributors may be used to endorse or promote products derived from
|
||||||
|
* this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import request from '/@/utils/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表
|
||||||
|
* @param query
|
||||||
|
*/
|
||||||
|
export const fetchList = (query?: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompany/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
* @param obj
|
||||||
|
*/
|
||||||
|
export const addObj = (obj: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompany',
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取详情
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const getObj = (id: string | number) => {
|
||||||
|
return request({
|
||||||
|
url: `/professional/outercompany/${id}`,
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const delObj = (id: string | number) => {
|
||||||
|
return request({
|
||||||
|
url: `/professional/outercompany/${id}`,
|
||||||
|
method: 'delete',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
* @param obj
|
||||||
|
*/
|
||||||
|
export const putObj = (obj: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompany',
|
||||||
|
method: 'put',
|
||||||
|
data: obj,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表(不分页)
|
||||||
|
* @param query
|
||||||
|
*/
|
||||||
|
export const getList = (query?: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompany/getList',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
125
src/api/professional/stayschool/outercompanyemployee.ts
Normal file
125
src/api/professional/stayschool/outercompanyemployee.ts
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018-2025, cyweb All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||||
|
* contributors may be used to endorse or promote products derived from
|
||||||
|
* this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import request from '/@/utils/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表
|
||||||
|
* @param query
|
||||||
|
*/
|
||||||
|
export const fetchList = (query?: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompanyemployee/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
* @param obj
|
||||||
|
*/
|
||||||
|
export const addObj = (obj: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompanyemployee',
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存第二步
|
||||||
|
* @param obj
|
||||||
|
*/
|
||||||
|
export const saveSecond = (obj: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompanyemployee/saveSecond',
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取详情
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const getObj = (id: string | number) => {
|
||||||
|
return request({
|
||||||
|
url: `/professional/outercompanyemployee/${id}`,
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const delObj = (id: string | number) => {
|
||||||
|
return request({
|
||||||
|
url: `/professional/outercompanyemployee/${id}`,
|
||||||
|
method: 'delete',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
* @param obj
|
||||||
|
*/
|
||||||
|
export const putObj = (obj: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompanyemployee',
|
||||||
|
method: 'put',
|
||||||
|
data: obj,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
* @param obj
|
||||||
|
*/
|
||||||
|
export const batchDel = (obj: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompanyemployee/batchDel',
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置密码
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const resetPassWord = (data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompanyemployee/resetPassWord',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 远程模糊检索
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const remoteInfo = (params?: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/outercompanyemployee/remoteInfo',
|
||||||
|
method: 'get',
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="shouldShow"
|
v-if="shouldShow"
|
||||||
|
:prop="prop"
|
||||||
|
:label="label"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
>
|
>
|
||||||
<template v-for="(_, name) in $slots" :key="name" #[name]="slotProps">
|
<template v-for="(_, name) in $slots" :key="name" #[name]="slotProps">
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
>
|
>
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
:label="column.prop || column.label"
|
:label="column.prop || column.label"
|
||||||
:disabled="column.fixed !== undefined || column.alwaysShow"
|
:disabled="!!column.fixed || column.alwaysShow"
|
||||||
>
|
>
|
||||||
{{ column.label }}
|
{{ column.label }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
@@ -113,9 +113,99 @@ const emit = defineEmits<{
|
|||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const checkedColumns = ref<string[]>([])
|
const checkedColumns = ref<string[]>([])
|
||||||
|
|
||||||
|
// 如果提供了 tableRef,使用自动提取;否则使用手动配置的 columns
|
||||||
|
const tableColumnsResult = props.tableRef
|
||||||
|
? useTableColumns(props.tableRef, props.storageKey, props.autoExtractOptions)
|
||||||
|
: {
|
||||||
|
columns: computed(() => []),
|
||||||
|
visibleColumns: computed(() => []),
|
||||||
|
updateVisibleColumns: () => {},
|
||||||
|
refreshColumns: () => {},
|
||||||
|
isColumnVisible: () => true
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
columns: autoColumns,
|
||||||
|
visibleColumns: autoVisibleColumns,
|
||||||
|
updateVisibleColumns: updateAutoVisibleColumns,
|
||||||
|
refreshColumns: refreshAutoColumns,
|
||||||
|
isColumnVisible: autoIsColumnVisible
|
||||||
|
} = tableColumnsResult
|
||||||
|
|
||||||
|
// 实际使用的列配置
|
||||||
|
const actualColumns = computed(() => {
|
||||||
|
const result = props.tableRef && autoColumns.value.length > 0
|
||||||
|
? autoColumns.value
|
||||||
|
: props.columns || []
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
|
// 获取所有列(包括固定列和 alwaysShow 列)
|
||||||
|
const getAllColumns = (): string[] => {
|
||||||
|
return actualColumns.value.map(col => col.prop || col.label)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化选中的列
|
||||||
|
const initCheckedColumns = () => {
|
||||||
|
if (props.modelValue && props.modelValue.length > 0) {
|
||||||
|
checkedColumns.value = [...props.modelValue]
|
||||||
|
} else if (props.tableRef && autoVisibleColumns.value.length > 0) {
|
||||||
|
// 使用自动提取的可见列,但需要确保包含所有列(包括固定列)
|
||||||
|
// 合并已保存的可见列和固定列/alwaysShow列
|
||||||
|
const fixedAndAlwaysShow = actualColumns.value
|
||||||
|
.filter(col => col.alwaysShow || !!col.fixed)
|
||||||
|
.map(col => col.prop || col.label)
|
||||||
|
checkedColumns.value = [...new Set([...autoVisibleColumns.value, ...fixedAndAlwaysShow])]
|
||||||
|
} else if (props.storageKey) {
|
||||||
|
// 从 localStorage 读取
|
||||||
|
const saved = localStorage.getItem(props.storageKey)
|
||||||
|
if (saved) {
|
||||||
|
try {
|
||||||
|
const savedColumns = JSON.parse(saved)
|
||||||
|
// 确保固定列和 alwaysShow 列始终在选中列表中
|
||||||
|
const fixedAndAlwaysShow = actualColumns.value
|
||||||
|
.filter(col => col.alwaysShow || !!col.fixed)
|
||||||
|
.map(col => col.prop || col.label)
|
||||||
|
checkedColumns.value = [...new Set([...savedColumns, ...fixedAndAlwaysShow])]
|
||||||
|
} catch (e) {
|
||||||
|
// 如果解析失败,使用默认值(所有列)
|
||||||
|
checkedColumns.value = getAllColumns()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
checkedColumns.value = getAllColumns()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
checkedColumns.value = getAllColumns()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听 actualColumns 变化,更新选中状态
|
||||||
|
watch(actualColumns, (newColumns) => {
|
||||||
|
if (newColumns.length > 0 && checkedColumns.value.length === 0) {
|
||||||
|
// 如果列数据已加载但选中列表为空,初始化选中所有列
|
||||||
|
initCheckedColumns()
|
||||||
|
} else if (newColumns.length > 0) {
|
||||||
|
// 确保固定列和 alwaysShow 列始终在选中列表中
|
||||||
|
const fixedAndAlwaysShow = newColumns
|
||||||
|
.filter(col => col.alwaysShow || !!col.fixed)
|
||||||
|
.map(col => col.prop || col.label)
|
||||||
|
const currentChecked = checkedColumns.value
|
||||||
|
const missingFixed = fixedAndAlwaysShow.filter(col => !currentChecked.includes(col))
|
||||||
|
if (missingFixed.length > 0) {
|
||||||
|
checkedColumns.value = [...currentChecked, ...missingFixed]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, { deep: true })
|
||||||
|
|
||||||
// 监听弹窗打开,触发列配置重新提取
|
// 监听弹窗打开,触发列配置重新提取
|
||||||
watch(visible, (newVal) => {
|
watch(visible, (newVal) => {
|
||||||
console.log('[TableColumnControl] 弹窗状态变化:', newVal)
|
console.log('[TableColumnControl] 弹窗状态变化:', newVal)
|
||||||
|
if (newVal) {
|
||||||
|
// 弹窗打开时,确保选中状态正确初始化
|
||||||
|
if (actualColumns.value.length > 0) {
|
||||||
|
initCheckedColumns()
|
||||||
|
}
|
||||||
|
}
|
||||||
if (newVal && props.tableRef) {
|
if (newVal && props.tableRef) {
|
||||||
console.log('[TableColumnControl] 弹窗打开,tableRef 存在:', props.tableRef)
|
console.log('[TableColumnControl] 弹窗打开,tableRef 存在:', props.tableRef)
|
||||||
console.log('[TableColumnControl] tableRef.value:', props.tableRef.value)
|
console.log('[TableColumnControl] tableRef.value:', props.tableRef.value)
|
||||||
@@ -225,25 +315,6 @@ watch(visible, (newVal) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 如果提供了 tableRef,使用自动提取;否则使用手动配置的 columns
|
|
||||||
const tableColumnsResult = props.tableRef
|
|
||||||
? useTableColumns(props.tableRef, props.storageKey, props.autoExtractOptions)
|
|
||||||
: {
|
|
||||||
columns: computed(() => []),
|
|
||||||
visibleColumns: computed(() => []),
|
|
||||||
updateVisibleColumns: () => {},
|
|
||||||
refreshColumns: () => {},
|
|
||||||
isColumnVisible: () => true
|
|
||||||
}
|
|
||||||
|
|
||||||
const {
|
|
||||||
columns: autoColumns,
|
|
||||||
visibleColumns: autoVisibleColumns,
|
|
||||||
updateVisibleColumns: updateAutoVisibleColumns,
|
|
||||||
refreshColumns: refreshAutoColumns,
|
|
||||||
isColumnVisible: autoIsColumnVisible
|
|
||||||
} = tableColumnsResult
|
|
||||||
|
|
||||||
// 监听 tableRef.value 的变化,当它被赋值时触发列配置提取
|
// 监听 tableRef.value 的变化,当它被赋值时触发列配置提取
|
||||||
if (props.tableRef) {
|
if (props.tableRef) {
|
||||||
// 尝试多种方式监听 tableRef.value 的变化
|
// 尝试多种方式监听 tableRef.value 的变化
|
||||||
@@ -270,10 +341,6 @@ if (props.tableRef) {
|
|||||||
}, { immediate: true }) // 立即检查一次,如果 tableRef.value 已经有值,立即触发
|
}, { immediate: true }) // 立即检查一次,如果 tableRef.value 已经有值,立即触发
|
||||||
}
|
}
|
||||||
|
|
||||||
// 调试:检查 tableRef 传递
|
|
||||||
console.log('[TableColumnControl] props.tableRef:', props.tableRef)
|
|
||||||
console.log('[TableColumnControl] props.tableRef?.value:', props.tableRef?.value)
|
|
||||||
|
|
||||||
// 暴露给父组件使用
|
// 暴露给父组件使用
|
||||||
defineExpose({
|
defineExpose({
|
||||||
isColumnVisible: autoIsColumnVisible,
|
isColumnVisible: autoIsColumnVisible,
|
||||||
@@ -281,56 +348,17 @@ defineExpose({
|
|||||||
refreshColumns: refreshAutoColumns
|
refreshColumns: refreshAutoColumns
|
||||||
})
|
})
|
||||||
|
|
||||||
// 实际使用的列配置
|
// 获取默认显示的列(所有可隐藏的列)- 用于重置功能
|
||||||
const actualColumns = computed(() => {
|
|
||||||
const result = props.tableRef && autoColumns.value.length > 0
|
|
||||||
? autoColumns.value
|
|
||||||
: props.columns || []
|
|
||||||
console.log('[TableColumnControl] actualColumns 计算:', {
|
|
||||||
hasTableRef: !!props.tableRef,
|
|
||||||
autoColumnsLength: autoColumns.value.length,
|
|
||||||
propsColumnsLength: props.columns?.length || 0,
|
|
||||||
resultLength: result.length
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
})
|
|
||||||
|
|
||||||
// 初始化选中的列
|
|
||||||
const initCheckedColumns = () => {
|
|
||||||
if (props.modelValue && props.modelValue.length > 0) {
|
|
||||||
checkedColumns.value = [...props.modelValue]
|
|
||||||
} else if (props.tableRef && autoVisibleColumns.value.length > 0) {
|
|
||||||
// 使用自动提取的可见列
|
|
||||||
checkedColumns.value = [...autoVisibleColumns.value]
|
|
||||||
} else if (props.storageKey) {
|
|
||||||
// 从 localStorage 读取
|
|
||||||
const saved = localStorage.getItem(props.storageKey)
|
|
||||||
if (saved) {
|
|
||||||
try {
|
|
||||||
checkedColumns.value = JSON.parse(saved)
|
|
||||||
} catch (e) {
|
|
||||||
// 如果解析失败,使用默认值(所有列)
|
|
||||||
checkedColumns.value = getDefaultColumns()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
checkedColumns.value = getDefaultColumns()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
checkedColumns.value = getDefaultColumns()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取默认显示的列(所有可隐藏的列)
|
|
||||||
const getDefaultColumns = (): string[] => {
|
const getDefaultColumns = (): string[] => {
|
||||||
return actualColumns.value
|
return actualColumns.value
|
||||||
.filter(col => !col.alwaysShow && col.fixed === undefined)
|
.filter(col => !col.alwaysShow && !col.fixed)
|
||||||
.map(col => col.prop || col.label)
|
.map(col => col.prop || col.label)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取所有可选择的列
|
// 获取所有可选择的列
|
||||||
const selectableColumns = computed(() => {
|
const selectableColumns = computed(() => {
|
||||||
return actualColumns.value
|
return actualColumns.value
|
||||||
.filter(col => !col.alwaysShow && col.fixed === undefined)
|
.filter(col => !col.alwaysShow && !col.fixed)
|
||||||
.map(col => col.prop || col.label)
|
.map(col => col.prop || col.label)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -344,11 +372,14 @@ const isAllSelected = computed(() => {
|
|||||||
// 切换全选/全不选
|
// 切换全选/全不选
|
||||||
const handleToggleSelectAll = () => {
|
const handleToggleSelectAll = () => {
|
||||||
if (isAllSelected.value) {
|
if (isAllSelected.value) {
|
||||||
// 当前全选,执行全不选
|
// 当前全选,执行全不选(但保留固定列和 alwaysShow 列)
|
||||||
checkedColumns.value = []
|
const fixedAndAlwaysShow = actualColumns.value
|
||||||
|
.filter(col => col.alwaysShow || !!col.fixed)
|
||||||
|
.map(col => col.prop || col.label)
|
||||||
|
checkedColumns.value = [...fixedAndAlwaysShow]
|
||||||
} else {
|
} else {
|
||||||
// 当前未全选,执行全选
|
// 当前未全选,执行全选(所有列)
|
||||||
checkedColumns.value = [...selectableColumns.value]
|
checkedColumns.value = getAllColumns()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,16 +397,30 @@ const handleConfirm = () => {
|
|||||||
|
|
||||||
// 列变化处理
|
// 列变化处理
|
||||||
const handleColumnChange = (value: string[]) => {
|
const handleColumnChange = (value: string[]) => {
|
||||||
emit('update:modelValue', value)
|
// 确保固定列和 alwaysShow 列始终在选中列表中
|
||||||
emit('change', value)
|
const fixedAndAlwaysShow = actualColumns.value
|
||||||
|
.filter(col => col.alwaysShow || !!col.fixed)
|
||||||
|
.map(col => col.prop || col.label)
|
||||||
|
const finalValue = [...new Set([...value, ...fixedAndAlwaysShow])]
|
||||||
|
|
||||||
// 如果使用自动提取,同步更新
|
emit('update:modelValue', finalValue)
|
||||||
|
emit('change', finalValue)
|
||||||
|
|
||||||
|
// 如果使用自动提取,同步更新(只更新可选择的列)
|
||||||
if (props.tableRef) {
|
if (props.tableRef) {
|
||||||
updateAutoVisibleColumns(value)
|
const selectableValue = finalValue.filter(col => {
|
||||||
|
const column = actualColumns.value.find(c => (c.prop || c.label) === col)
|
||||||
|
return column && !column.alwaysShow && !column.fixed
|
||||||
|
})
|
||||||
|
updateAutoVisibleColumns(selectableValue)
|
||||||
} else {
|
} else {
|
||||||
// 保存到 localStorage
|
// 保存到 localStorage(只保存可选择的列)
|
||||||
if (props.storageKey) {
|
if (props.storageKey) {
|
||||||
localStorage.setItem(props.storageKey, JSON.stringify(value))
|
const selectableValue = finalValue.filter(col => {
|
||||||
|
const column = actualColumns.value.find(c => (c.prop || c.label) === col)
|
||||||
|
return column && !column.alwaysShow && !column.fixed
|
||||||
|
})
|
||||||
|
localStorage.setItem(props.storageKey, JSON.stringify(selectableValue))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -459,3 +504,4 @@ onMounted(() => {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,23 +76,50 @@ export function useTableColumns(
|
|||||||
|
|
||||||
if (store.states && store.states.columns) {
|
if (store.states && store.states.columns) {
|
||||||
tableColumns = store.states.columns.value || []
|
tableColumns = store.states.columns.value || []
|
||||||
|
console.log('[useTableColumns] 从 store.states.columns 获取到列数:', tableColumns.length)
|
||||||
|
console.log('[useTableColumns] store.states.columns 内容:', tableColumns)
|
||||||
} else if (store.columns) {
|
} else if (store.columns) {
|
||||||
tableColumns = Array.isArray(store.columns) ? store.columns : (store.columns.value || [])
|
tableColumns = Array.isArray(store.columns) ? store.columns : (store.columns.value || [])
|
||||||
|
console.log('[useTableColumns] 从 store.columns 获取到列数:', tableColumns.length)
|
||||||
} else if ((table as any).columns) {
|
} else if ((table as any).columns) {
|
||||||
tableColumns = Array.isArray((table as any).columns) ? (table as any).columns : ((table as any).columns.value || [])
|
tableColumns = Array.isArray((table as any).columns) ? (table as any).columns : ((table as any).columns.value || [])
|
||||||
|
console.log('[useTableColumns] 从 table.columns 获取到列数:', tableColumns.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tableColumns.length > 0) {
|
if (tableColumns.length > 0) {
|
||||||
tableColumns.forEach((col: any) => {
|
tableColumns.forEach((col: any, idx: number) => {
|
||||||
// 跳过序号列和没有 label 的列
|
console.log(`[useTableColumns] store 列 ${idx}:`, {
|
||||||
if (!col.label || col.type === 'index') return
|
type: col.type,
|
||||||
|
label: col.label,
|
||||||
|
property: col.property,
|
||||||
|
prop: col.prop,
|
||||||
|
fixed: col.fixed,
|
||||||
|
fullCol: col
|
||||||
|
})
|
||||||
|
|
||||||
|
// 跳过序号列
|
||||||
|
if (col.type === 'index' || col.type === 'selection') {
|
||||||
|
console.log(`[useTableColumns] 列 ${idx} 被跳过(类型: ${col.type})`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 尝试多种方式获取 label
|
||||||
|
const label = col.label || col.columnKey || col.property || col.prop || ''
|
||||||
|
|
||||||
|
// 如果没有 label,尝试从其他属性推断
|
||||||
|
if (!label) {
|
||||||
|
console.log(`[useTableColumns] 列 ${idx} 没有 label,尝试从其他属性推断`)
|
||||||
|
// 如果还是没有,跳过这一列
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const config: ColumnConfig = {
|
const config: ColumnConfig = {
|
||||||
prop: col.property || col.prop || '',
|
prop: col.property || col.prop || '',
|
||||||
label: col.label || '',
|
label: label,
|
||||||
width: col.width,
|
width: col.width,
|
||||||
minWidth: col.minWidth,
|
minWidth: col.minWidth,
|
||||||
fixed: col.fixed,
|
// Element Plus 中非固定列的 fixed 通常是 false,这里统一将 false 归一为 undefined
|
||||||
|
fixed: col.fixed ? col.fixed : undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 应用自定义映射
|
// 应用自定义映射
|
||||||
@@ -111,12 +138,16 @@ export function useTableColumns(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`[useTableColumns] 从 store 提取到列配置:`, config)
|
||||||
extracted.push(config)
|
extracted.push(config)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log('[useTableColumns] 从 store 总共提取到列数:', extracted.length)
|
||||||
if (extracted.length > 0) {
|
if (extracted.length > 0) {
|
||||||
return extracted
|
return extracted
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
console.warn('[useTableColumns] store 中没有找到列数据')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,8 +205,45 @@ export function useTableColumns(
|
|||||||
}
|
}
|
||||||
|
|
||||||
columnHeaders.forEach((th: HTMLElement, index: number) => {
|
columnHeaders.forEach((th: HTMLElement, index: number) => {
|
||||||
const label = th.textContent?.trim() || ''
|
// 尝试多种方式获取 label 文本
|
||||||
console.log(`[useTableColumns] 列 ${index}: label="${label}"`)
|
// 1. 从 .cell 元素
|
||||||
|
const cell = th.querySelector('.cell') as HTMLElement | null
|
||||||
|
// 2. 从所有可能的文本节点
|
||||||
|
let rawLabel = ''
|
||||||
|
|
||||||
|
if (cell) {
|
||||||
|
rawLabel = cell.innerText || cell.textContent || ''
|
||||||
|
} else {
|
||||||
|
// 尝试从 th 的所有子元素中查找文本
|
||||||
|
const textNodes: string[] = []
|
||||||
|
const walker = document.createTreeWalker(
|
||||||
|
th,
|
||||||
|
NodeFilter.SHOW_TEXT,
|
||||||
|
null
|
||||||
|
)
|
||||||
|
let node: Node | null
|
||||||
|
while ((node = walker.nextNode())) {
|
||||||
|
const text = node.textContent?.trim()
|
||||||
|
if (text) {
|
||||||
|
textNodes.push(text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rawLabel = textNodes.join(' ') || th.innerText || th.textContent || ''
|
||||||
|
}
|
||||||
|
|
||||||
|
const label = rawLabel.trim()
|
||||||
|
|
||||||
|
// 调试:打印 th 的完整结构
|
||||||
|
console.log(`[useTableColumns] DOM 列 ${index}:`, {
|
||||||
|
label,
|
||||||
|
rawLabel,
|
||||||
|
thHTML: th.innerHTML.substring(0, 100),
|
||||||
|
hasCell: !!cell,
|
||||||
|
cellText: cell?.innerText || cell?.textContent || '',
|
||||||
|
thInnerText: th.innerText,
|
||||||
|
thTextContent: th.textContent
|
||||||
|
})
|
||||||
|
|
||||||
// 排除序号列和空列
|
// 排除序号列和空列
|
||||||
if (!label || label === '序号') {
|
if (!label || label === '序号') {
|
||||||
console.log(`[useTableColumns] 列 ${index} 被跳过(序号列或空列)`)
|
console.log(`[useTableColumns] 列 ${index} 被跳过(序号列或空列)`)
|
||||||
@@ -234,7 +302,8 @@ export function useTableColumns(
|
|||||||
prop: prop || `column_${index}`,
|
prop: prop || `column_${index}`,
|
||||||
label,
|
label,
|
||||||
width,
|
width,
|
||||||
fixed,
|
// DOM 提取的 fixed 只有 left/right,这里也归一为 undefined 或 'left'/'right'
|
||||||
|
fixed: fixed ? fixed : undefined,
|
||||||
}
|
}
|
||||||
console.log(`[useTableColumns] 提取到列配置:`, columnConfig)
|
console.log(`[useTableColumns] 提取到列配置:`, columnConfig)
|
||||||
extracted.push(columnConfig)
|
extracted.push(columnConfig)
|
||||||
@@ -304,12 +373,13 @@ export function useTableColumns(
|
|||||||
// 初始化默认可见列
|
// 初始化默认可见列
|
||||||
const initDefaultVisibleColumns = () => {
|
const initDefaultVisibleColumns = () => {
|
||||||
const defaultHidden = options?.defaultHidden || []
|
const defaultHidden = options?.defaultHidden || []
|
||||||
// 默认显示所有列(除了默认隐藏的列)
|
// 默认显示所有列(除了默认隐藏的列和固定列/alwaysShow列)
|
||||||
|
// 注意:固定列和 alwaysShow 列不需要在 visibleColumns 中,因为它们始终显示
|
||||||
visibleColumns.value = columns.value
|
visibleColumns.value = columns.value
|
||||||
.filter(col => {
|
.filter(col => {
|
||||||
const key = col.prop || col.label
|
const key = col.prop || col.label
|
||||||
return !col.alwaysShow &&
|
return !col.alwaysShow &&
|
||||||
col.fixed === undefined &&
|
!col.fixed &&
|
||||||
!defaultHidden.includes(key)
|
!defaultHidden.includes(key)
|
||||||
})
|
})
|
||||||
.map(col => col.prop || col.label)
|
.map(col => col.prop || col.label)
|
||||||
@@ -317,7 +387,7 @@ export function useTableColumns(
|
|||||||
// 如果所有列都被隐藏了,至少显示所有非固定列
|
// 如果所有列都被隐藏了,至少显示所有非固定列
|
||||||
if (visibleColumns.value.length === 0 && columns.value.length > 0) {
|
if (visibleColumns.value.length === 0 && columns.value.length > 0) {
|
||||||
visibleColumns.value = columns.value
|
visibleColumns.value = columns.value
|
||||||
.filter(col => !col.alwaysShow && col.fixed === undefined)
|
.filter(col => !col.alwaysShow && !col.fixed)
|
||||||
.map(col => col.prop || col.label)
|
.map(col => col.prop || col.label)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -339,7 +409,7 @@ export function useTableColumns(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 固定列和始终显示的列始终显示
|
// 固定列和始终显示的列始终显示
|
||||||
if (column.fixed !== undefined || column.alwaysShow) {
|
if (column.fixed || column.alwaysShow) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ import { useUserInfo } from '/@/stores/userInfo'
|
|||||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||||
import { useMessage } from '/@/hooks/message'
|
import { useMessage } from '/@/hooks/message'
|
||||||
import { useMessageBox } from '/@/hooks/message'
|
import { useMessageBox } from '/@/hooks/message'
|
||||||
import { fetchList, addObj, putObj, delObj, getObj } from '/@/api/professional/outercompany'
|
import { fetchList, addObj, putObj, delObj, getObj } from '/@/api/professional/stayschool/outercompany'
|
||||||
|
|
||||||
// 使用 Pinia store
|
// 使用 Pinia store
|
||||||
const userInfoStore = useUserInfo()
|
const userInfoStore = useUserInfo()
|
||||||
@@ -153,7 +153,7 @@ import { useUserInfo } from '/@/stores/userInfo'
|
|||||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||||
import { useMessage } from '/@/hooks/message'
|
import { useMessage } from '/@/hooks/message'
|
||||||
import { useMessageBox } from '/@/hooks/message'
|
import { useMessageBox } from '/@/hooks/message'
|
||||||
import { fetchList, addObj, putObj, delObj, getObj } from '/@/api/professional/outercompany'
|
import { fetchList, addObj, putObj, delObj, getObj } from '/@/api/professional/stayschool/outercompany'
|
||||||
|
|
||||||
// 使用 Pinia store
|
// 使用 Pinia store
|
||||||
const userInfoStore = useUserInfo()
|
const userInfoStore = useUserInfo()
|
||||||
@@ -100,7 +100,7 @@ import { ref, reactive, computed } from 'vue'
|
|||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useUserInfo } from '/@/stores/userInfo'
|
import { useUserInfo } from '/@/stores/userInfo'
|
||||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||||
import { fetchList } from '/@/api/professional/outercompany'
|
import { fetchList } from '/@/api/professional/stayschool/outercompany'
|
||||||
|
|
||||||
// 使用 Pinia store
|
// 使用 Pinia store
|
||||||
const userInfoStore = useUserInfo()
|
const userInfoStore = useUserInfo()
|
||||||
@@ -405,8 +405,8 @@ import {
|
|||||||
delObj,
|
delObj,
|
||||||
batchDel,
|
batchDel,
|
||||||
resetPassWord
|
resetPassWord
|
||||||
} from '/@/api/professional/outercompanyemployee'
|
} from '/@/api/professional/stayschool/outercompanyemployee'
|
||||||
import { getList as getCompanyList } from '/@/api/professional/outercompany'
|
import { getList as getCompanyList } from '/@/api/professional/stayschool/outercompany'
|
||||||
|
|
||||||
// 使用 Pinia store
|
// 使用 Pinia store
|
||||||
const userInfoStore = useUserInfo()
|
const userInfoStore = useUserInfo()
|
||||||
@@ -406,8 +406,8 @@ import {
|
|||||||
delObj,
|
delObj,
|
||||||
batchDel,
|
batchDel,
|
||||||
resetPassWord
|
resetPassWord
|
||||||
} from '/@/api/professional/outercompanyemployee'
|
} from '/@/api/professional/stayschool/outercompanyemployee'
|
||||||
import { getList as getCompanyList } from '/@/api/professional/outercompany'
|
import { getList as getCompanyList } from '/@/api/professional/stayschool/outercompany'
|
||||||
|
|
||||||
// 使用 Pinia store
|
// 使用 Pinia store
|
||||||
const userInfoStore = useUserInfo()
|
const userInfoStore = useUserInfo()
|
||||||
@@ -385,8 +385,8 @@ import {
|
|||||||
delObj,
|
delObj,
|
||||||
batchDel,
|
batchDel,
|
||||||
resetPassWord
|
resetPassWord
|
||||||
} from '/@/api/professional/outercompanyemployee'
|
} from '/@/api/professional/stayschool/outercompanyemployee'
|
||||||
import { getList as getCompanyList } from '/@/api/professional/outercompany'
|
import { getList as getCompanyList } from '/@/api/professional/stayschool/outercompany'
|
||||||
|
|
||||||
// 使用 Pinia store
|
// 使用 Pinia store
|
||||||
const userInfoStore = useUserInfo()
|
const userInfoStore = useUserInfo()
|
||||||
@@ -96,8 +96,8 @@
|
|||||||
import { ref, reactive, computed } from 'vue'
|
import { ref, reactive, computed } from 'vue'
|
||||||
import { Session } from '/@/utils/storage'
|
import { Session } from '/@/utils/storage'
|
||||||
import { useMessage } from '/@/hooks/message'
|
import { useMessage } from '/@/hooks/message'
|
||||||
import { getMyTeacherNo, updateOtherInfo } from '/@/api/professional/professionaluser/teacherbase'
|
import { getMyTeacherNo } from '/@/api/professional/professionaluser/teacherbase'
|
||||||
import { putObj } from '/@/api/professional/professionaluser/professionalqualificationrelation'
|
import { addObj } from '/@/api/professional/professionaluser/professionalqualificationrelation'
|
||||||
import { checkLocked } from '/@/api/professional/professionalstatuslock'
|
import { checkLocked } from '/@/api/professional/professionalstatuslock'
|
||||||
import { getLevelList } from '/@/api/professional/rsbase/professionalqualificationconfig'
|
import { getLevelList } from '/@/api/professional/rsbase/professionalqualificationconfig'
|
||||||
import { getWorkTypeList } from '/@/api/professional/rsbase/professionalworktype'
|
import { getWorkTypeList } from '/@/api/professional/rsbase/professionalworktype'
|
||||||
@@ -284,34 +284,26 @@ const dialogSubmit = async () => {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
submitLoading.value = true
|
submitLoading.value = true
|
||||||
try {
|
try {
|
||||||
if (dataForm.id) {
|
// 统一使用 addObj 接口(新增和编辑都使用同一个接口)
|
||||||
// 编辑:使用 putObj 接口(管理员编辑)
|
// 确保 evidenceA 或 materialA 有值
|
||||||
dataForm.state = '0'
|
if (!dataForm.evidenceA && dataForm.materialA) {
|
||||||
await putObj(dataForm)
|
dataForm.evidenceA = dataForm.materialA
|
||||||
message.success("修改成功")
|
|
||||||
} else {
|
|
||||||
// 新增:使用 updateOtherInfo 接口(与 MultiDialog 保持一致)
|
|
||||||
const submitData: any = {
|
|
||||||
type: 3, // 职业资格类型
|
|
||||||
teacherNo: dataForm.teacherNo,
|
|
||||||
worker: dataForm.worker,
|
|
||||||
qualificationConfigId: dataForm.qualificationConfigId,
|
|
||||||
certificateTime: dataForm.certificateTime,
|
|
||||||
certificateNumber: dataForm.certificateNumber,
|
|
||||||
mateA: dataForm.evidenceA || dataForm.materialA // 使用 mateA 字段(与 MultiDialog 一致)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await updateOtherInfo(submitData)
|
if (dataForm.id) {
|
||||||
if (res.data == '-1') {
|
// 编辑模式
|
||||||
message.warning("当前不允许提交")
|
dataForm.state = '0'
|
||||||
|
await addObj(dataForm)
|
||||||
|
message.success("修改成功")
|
||||||
} else {
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addObj(dataForm)
|
||||||
message.success("提交成功")
|
message.success("提交成功")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('refreshData')
|
emit('refreshData')
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
message.error(error?.msg || '操作失败')
|
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||||
} finally {
|
} finally {
|
||||||
submitLoading.value = false
|
submitLoading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,8 +147,8 @@
|
|||||||
import { ref, reactive, computed } from 'vue'
|
import { ref, reactive, computed } from 'vue'
|
||||||
import { Session } from '/@/utils/storage'
|
import { Session } from '/@/utils/storage'
|
||||||
import { useMessage } from '/@/hooks/message'
|
import { useMessage } from '/@/hooks/message'
|
||||||
import { getMyTeacherNo, updateOtherInfo } from '/@/api/professional/professionaluser/teacherbase'
|
import { getMyTeacherNo } from '/@/api/professional/professionaluser/teacherbase'
|
||||||
import { putObj } from '/@/api/professional/professionaluser/professionalteacheracademicrelation'
|
import { addObj } from '/@/api/professional/professionaluser/professionalteacheracademicrelation'
|
||||||
import { getAllTypeList } from '/@/api/professional/rsbase/professionalacademiceducationtypeconfig'
|
import { getAllTypeList } from '/@/api/professional/rsbase/professionalacademiceducationtypeconfig'
|
||||||
import { getQualificationList } from '/@/api/professional/rsbase/academicqualificationsconfig'
|
import { getQualificationList } from '/@/api/professional/rsbase/academicqualificationsconfig'
|
||||||
import { getDegreeList } from '/@/api/professional/rsbase/professionalacademicdegreeconfig'
|
import { getDegreeList } from '/@/api/professional/rsbase/professionalacademicdegreeconfig'
|
||||||
@@ -370,42 +370,30 @@ const dialogSubmit = async () => {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
submitLoading.value = true
|
submitLoading.value = true
|
||||||
try {
|
try {
|
||||||
|
// 统一使用 addObj 接口(新增和编辑都使用同一个接口)
|
||||||
|
// 确保 qualificationImg 或 materialA 有值
|
||||||
|
if (!dataForm.qualificationImg && dataForm.materialA) {
|
||||||
|
dataForm.qualificationImg = dataForm.materialA
|
||||||
|
}
|
||||||
|
// 确保 degreeImg 或 materialB 有值
|
||||||
|
if (!dataForm.degreeImg && dataForm.materialB) {
|
||||||
|
dataForm.degreeImg = dataForm.materialB
|
||||||
|
}
|
||||||
|
|
||||||
if (dataForm.id) {
|
if (dataForm.id) {
|
||||||
// 编辑:使用 putObj 接口(管理员编辑)
|
// 编辑模式
|
||||||
dataForm.state = '0'
|
dataForm.state = '0'
|
||||||
await putObj(dataForm)
|
await addObj(dataForm)
|
||||||
message.success("修改成功")
|
message.success("修改成功")
|
||||||
} else {
|
} else {
|
||||||
// 新增:使用 updateOtherInfo 接口(与 MultiDialog 保持一致)
|
// 新增模式
|
||||||
// 注意:MultiDialog 中 type 字段在提交时会被设置为 val(1),但表单中也有 type 字段用于教育类型
|
await addObj(dataForm)
|
||||||
// 这里直接使用 dataForm 的所有字段,后端应该能够处理
|
|
||||||
const submitData: any = {
|
|
||||||
type: 1, // 学历更新类型(固定值,会覆盖表单中的 type)
|
|
||||||
teacherNo: dataForm.teacherNo,
|
|
||||||
graduateTime: dataForm.graduateTime,
|
|
||||||
qualificationConfigId: dataForm.qualificationConfigId,
|
|
||||||
degreeConfigId: dataForm.degreeConfigId,
|
|
||||||
graduateSchool: dataForm.graduateSchool,
|
|
||||||
major: dataForm.major,
|
|
||||||
certificateNumber: dataForm.certificateNumber,
|
|
||||||
mateA: dataForm.qualificationImg || dataForm.materialA, // 学历证书
|
|
||||||
mateB: dataForm.degreeImg || dataForm.materialB // 学位证书
|
|
||||||
}
|
|
||||||
|
|
||||||
// 注意:MultiDialog 中教育类型字段也是 type,但在提交时会被覆盖为 val(1)
|
|
||||||
// 如果后端需要教育类型,可能需要单独传递,这里先不传,保持与 MultiDialog 一致
|
|
||||||
|
|
||||||
const res = await updateOtherInfo(submitData)
|
|
||||||
if (res.data == '-1') {
|
|
||||||
message.warning("当前不允许提交")
|
|
||||||
} else {
|
|
||||||
message.success("提交成功")
|
message.success("提交成功")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('refreshData')
|
emit('refreshData')
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
message.error(error?.msg || '操作失败')
|
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||||
} finally {
|
} finally {
|
||||||
submitLoading.value = false
|
submitLoading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,8 +97,8 @@
|
|||||||
import { ref, reactive, computed } from 'vue'
|
import { ref, reactive, computed } from 'vue'
|
||||||
import { Session } from '/@/utils/storage'
|
import { Session } from '/@/utils/storage'
|
||||||
import { useMessage } from '/@/hooks/message'
|
import { useMessage } from '/@/hooks/message'
|
||||||
import { getMyTeacherNo, updateOtherInfo } from '/@/api/professional/professionaluser/teacherbase'
|
import { getMyTeacherNo } from '/@/api/professional/professionaluser/teacherbase'
|
||||||
import { putObj } from '/@/api/professional/professionaluser/professionalteachercertificaterelation'
|
import { addObj } from '/@/api/professional/professionaluser/professionalteachercertificaterelation'
|
||||||
import { getTeacherCertificateList } from '/@/api/professional/rsbase/professionalteachercertificateconf'
|
import { getTeacherCertificateList } from '/@/api/professional/rsbase/professionalteachercertificateconf'
|
||||||
import { checkLocked } from '/@/api/professional/professionalstatuslock'
|
import { checkLocked } from '/@/api/professional/professionalstatuslock'
|
||||||
|
|
||||||
@@ -280,33 +280,30 @@ const dialogSubmit = async () => {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
submitLoading.value = true
|
submitLoading.value = true
|
||||||
try {
|
try {
|
||||||
if (dataForm.id) {
|
// 统一使用 addObj 接口(新增和编辑都使用同一个接口)
|
||||||
// 编辑:使用 putObj 接口(管理员编辑)
|
// 确保 evidenceA 或 materialA 有值
|
||||||
dataForm.state = '0'
|
if (!dataForm.evidenceA && dataForm.materialA) {
|
||||||
await putObj(dataForm)
|
dataForm.evidenceA = dataForm.materialA
|
||||||
message.success("修改成功")
|
}
|
||||||
} else {
|
// 确保 evidenceB 或 materialB 有值
|
||||||
// 新增:使用 updateOtherInfo 接口(与 MultiDialog 保持一致)
|
if (!dataForm.evidenceB && dataForm.materialB) {
|
||||||
// 注意:MultiDialog 的 type=0 表单只有 certificateConfId 和 certificateNumber,没有 certificateTime
|
dataForm.evidenceB = dataForm.materialB
|
||||||
const submitData: any = {
|
|
||||||
type: 0, // 教师资格证类型
|
|
||||||
teacherNo: dataForm.teacherNo,
|
|
||||||
certificateConfId: dataForm.certificateConfId,
|
|
||||||
certificateNumber: dataForm.certificateNumber,
|
|
||||||
mateA: dataForm.evidenceA || dataForm.materialA // 使用 mateA 字段(与 MultiDialog 一致)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await updateOtherInfo(submitData)
|
if (dataForm.id) {
|
||||||
if (res.data == '-1') {
|
// 编辑模式
|
||||||
message.warning("当前不允许提交")
|
dataForm.state = '0'
|
||||||
|
await addObj(dataForm)
|
||||||
|
message.success("修改成功")
|
||||||
} else {
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addObj(dataForm)
|
||||||
message.success("提交成功")
|
message.success("提交成功")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('refreshData')
|
emit('refreshData')
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
message.error(error?.msg || '操作失败')
|
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||||
} finally {
|
} finally {
|
||||||
submitLoading.value = false
|
submitLoading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,8 +64,8 @@
|
|||||||
import { ref, reactive, computed } from 'vue'
|
import { ref, reactive, computed } from 'vue'
|
||||||
import { Session } from '/@/utils/storage'
|
import { Session } from '/@/utils/storage'
|
||||||
import { useMessage } from '/@/hooks/message'
|
import { useMessage } from '/@/hooks/message'
|
||||||
import { getMyTeacherNo, updateOtherInfo } from '/@/api/professional/professionaluser/teacherbase'
|
import { getMyTeacherNo } from '/@/api/professional/professionaluser/teacherbase'
|
||||||
import { putObj } from '/@/api/professional/professionaluser/professionalteacherhonor'
|
import { addObj } from '/@/api/professional/professionaluser/professionalteacherhonor'
|
||||||
import { checkLocked } from '/@/api/professional/professionalstatuslock'
|
import { checkLocked } from '/@/api/professional/professionalstatuslock'
|
||||||
|
|
||||||
// Emits
|
// Emits
|
||||||
@@ -215,33 +215,26 @@ const dialogSubmit = async () => {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
submitLoading.value = true
|
submitLoading.value = true
|
||||||
try {
|
try {
|
||||||
if (dataForm.id) {
|
// 统一使用 addObj 接口(新增和编辑都使用同一个接口)
|
||||||
// 编辑:使用 putObj 接口(管理员编辑)
|
// 确保 attachment 或 materialA 有值
|
||||||
dataForm.state = '0'
|
if (!dataForm.attachment && dataForm.materialA) {
|
||||||
await putObj(dataForm)
|
dataForm.attachment = dataForm.materialA
|
||||||
message.success("修改成功")
|
|
||||||
} else {
|
|
||||||
// 新增:使用 updateOtherInfo 接口(与 MultiDialog 保持一致)
|
|
||||||
const submitData: any = {
|
|
||||||
type: 4, // 综合表彰类型
|
|
||||||
teacherNo: dataForm.teacherNo,
|
|
||||||
honor: dataForm.honor,
|
|
||||||
honorCompany: dataForm.honorCompany,
|
|
||||||
year: dataForm.year,
|
|
||||||
mateA: dataForm.attachment || dataForm.materialA // 使用 mateA 字段(与 MultiDialog 一致)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await updateOtherInfo(submitData)
|
if (dataForm.id) {
|
||||||
if (res.data == '-1') {
|
// 编辑模式
|
||||||
message.warning("当前不允许提交")
|
dataForm.state = '0'
|
||||||
|
await addObj(dataForm)
|
||||||
|
message.success("修改成功")
|
||||||
} else {
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addObj(dataForm)
|
||||||
message.success("提交成功")
|
message.success("提交成功")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('refreshData')
|
emit('refreshData')
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
message.error(error?.msg || '操作失败')
|
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||||
} finally {
|
} finally {
|
||||||
submitLoading.value = false
|
submitLoading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ const openDialog = async (row?: any) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error('操作失败')
|
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -306,7 +306,7 @@ const dialogSubmit = async () => {
|
|||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('refreshData')
|
emit('refreshData')
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
message.error(error?.msg || '操作失败')
|
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||||
} finally {
|
} finally {
|
||||||
submitLoading.value = false
|
submitLoading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -369,18 +369,20 @@
|
|||||||
<el-tab-pane label="基本信息" name="first">
|
<el-tab-pane label="基本信息" name="first">
|
||||||
<div class="base-info-form">
|
<div class="base-info-form">
|
||||||
<el-form ref="baseForm" :model="form" label-width="120px" :rules="mergedRules">
|
<el-form ref="baseForm" :model="form" label-width="120px" :rules="mergedRules">
|
||||||
<!-- 照片区域 -->
|
<!-- 子标签页 -->
|
||||||
|
<el-tabs v-model="subActiveName" type="card" class="sub-tabs">
|
||||||
|
<!-- 基本信息子标签 -->
|
||||||
|
<el-tab-pane label="基本信息" name="subBaseInfo">
|
||||||
|
<!-- 照片区域和基本信息分组 -->
|
||||||
|
<div class="base-info-layout">
|
||||||
|
<!-- 左侧:照片区域 -->
|
||||||
<div v-if="isAdd==false && imageUrl" class="photo-section">
|
<div v-if="isAdd==false && imageUrl" class="photo-section">
|
||||||
<div class="photo-wrapper">
|
<div class="photo-wrapper">
|
||||||
<img :src="imageUrl" class="avatar-photo" alt="照片">
|
<img :src="imageUrl" class="avatar-photo" alt="照片">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 子标签页 -->
|
<!-- 右侧:基本信息分组 -->
|
||||||
<el-tabs v-model="subActiveName" type="card" class="sub-tabs">
|
|
||||||
<!-- 基本信息子标签 -->
|
|
||||||
<el-tab-pane label="基本信息" name="subBaseInfo">
|
|
||||||
<!-- 基本信息分组 -->
|
|
||||||
<div class="form-section">
|
<div class="form-section">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<el-icon><User /></el-icon>
|
<el-icon><User /></el-icon>
|
||||||
@@ -443,6 +445,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 联系方式分组 -->
|
<!-- 联系方式分组 -->
|
||||||
<div class="form-section">
|
<div class="form-section">
|
||||||
@@ -886,19 +889,23 @@
|
|||||||
|
|
||||||
<el-tab-pane label="政治面貌" name="politicsPane">
|
<el-tab-pane label="政治面貌" name="politicsPane">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
<div class="table-header" v-if="permissions.professional_teacherbase_edit">
|
<div class="table-header">
|
||||||
<div class="table-title">
|
<div class="table-title">
|
||||||
<el-icon><Flag /></el-icon>
|
<el-icon><Flag /></el-icon>
|
||||||
<span>政治面貌信息</span>
|
<span>政治面貌信息</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary" size="default" @click="handleAddPolitics">
|
<el-button v-if="permissions.professional_teacherbase_edit" type="primary" size="default" @click="handleAddPolitics">
|
||||||
<el-icon><Plus /></el-icon>
|
<el-icon><Plus /></el-icon>
|
||||||
<span>新增</span>
|
<span>新增</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="dataPolitics" border stripe class="data-table">
|
<el-table :data="dataPolitics" border stripe class="data-table">
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="politicsStatus" label="政治面貌" min-width="120" align="center" />
|
<el-table-column prop="politicsStatus" label="政治面貌" min-width="120" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ getPoliticsStatusName(scope.row.politicsStatusId || scope.row.politicsStatus) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="joinTime" label="加入时间" min-width="120" align="center">
|
<el-table-column prop="joinTime" label="加入时间" min-width="120" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.joinTime ? new Date(scope.row.joinTime).toLocaleDateString() : '-' }}
|
{{ scope.row.joinTime ? new Date(scope.row.joinTime).toLocaleDateString() : '-' }}
|
||||||
@@ -932,12 +939,12 @@
|
|||||||
|
|
||||||
<el-tab-pane label="社会关系" name="third">
|
<el-tab-pane label="社会关系" name="third">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
<div class="table-header" v-if="permissions.professional_teacherbase_edit">
|
<div class="table-header">
|
||||||
<div class="table-title">
|
<div class="table-title">
|
||||||
<el-icon><Connection /></el-icon>
|
<el-icon><Connection /></el-icon>
|
||||||
<span>社会关系信息</span>
|
<span>社会关系信息</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary" size="default" @click="handleAddRelation">
|
<el-button v-if="permissions.professional_teacherbase_edit" type="primary" size="default" @click="handleAddRelation">
|
||||||
<el-icon><Plus /></el-icon>
|
<el-icon><Plus /></el-icon>
|
||||||
<span>新增</span>
|
<span>新增</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -951,7 +958,11 @@
|
|||||||
{{ scope.row.birthday ? new Date(scope.row.birthday).toLocaleDateString() : '-' }}
|
{{ scope.row.birthday ? new Date(scope.row.birthday).toLocaleDateString() : '-' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="politicsStatus" label="政治面貌" min-width="120" align="center" />
|
<el-table-column prop="politicsStatus" label="政治面貌" min-width="120" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ getPoliticsStatusName(scope.row.politicsStatusId || scope.row.politicsStatus) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="workStation" label="工作单位及职务" min-width="200" align="center" show-overflow-tooltip />
|
<el-table-column prop="workStation" label="工作单位及职务" min-width="200" align="center" show-overflow-tooltip />
|
||||||
<el-table-column label="操作" width="150" align="center" v-if="permissions.professional_teacherbase_edit">
|
<el-table-column label="操作" width="150" align="center" v-if="permissions.professional_teacherbase_edit">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
@@ -971,15 +982,11 @@
|
|||||||
|
|
||||||
<el-tab-pane label="学历" name="second">
|
<el-tab-pane label="学历" name="second">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
<div class="table-header" v-if="permissions.professional_teacherbase_edit">
|
<div class="table-header">
|
||||||
<div class="table-title">
|
<div class="table-title">
|
||||||
<el-icon><School /></el-icon>
|
<el-icon><School /></el-icon>
|
||||||
<span>学历信息</span>
|
<span>学历信息</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary" size="default" @click="handleAddEducation">
|
|
||||||
<el-icon><Plus /></el-icon>
|
|
||||||
<span>新增</span>
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="dataEducation" border stripe class="data-table">
|
<el-table :data="dataEducation" border stripe class="data-table">
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
@@ -1024,18 +1031,6 @@
|
|||||||
{{ scope.row.createTime ? new Date(scope.row.createTime).toLocaleDateString() : '-' }}
|
{{ scope.row.createTime ? new Date(scope.row.createTime).toLocaleDateString() : '-' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="150" align="center" v-if="permissions.professional_teacherbase_edit">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button type="primary" link size="small" @click="handleEditEducation(scope.row, scope.$index)">
|
|
||||||
<el-icon><Edit /></el-icon>
|
|
||||||
<span>编辑</span>
|
|
||||||
</el-button>
|
|
||||||
<el-button type="danger" link size="small" @click="handleDeleteEducation(scope.row, scope.$index)">
|
|
||||||
<el-icon><Delete /></el-icon>
|
|
||||||
<span>删除</span>
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -1043,15 +1038,11 @@
|
|||||||
<!--职称表单-->
|
<!--职称表单-->
|
||||||
<el-tab-pane label="职称" name="fourth">
|
<el-tab-pane label="职称" name="fourth">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
<div class="table-header" v-if="permissions.professional_teacherbase_edit">
|
<div class="table-header">
|
||||||
<div class="table-title">
|
<div class="table-title">
|
||||||
<el-icon><Medal /></el-icon>
|
<el-icon><Medal /></el-icon>
|
||||||
<span>职称信息</span>
|
<span>职称信息</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary" size="default" @click="handleAddPro">
|
|
||||||
<el-icon><Plus /></el-icon>
|
|
||||||
<span>新增</span>
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="proData" border stripe class="data-table">
|
<el-table :data="proData" border stripe class="data-table">
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
@@ -1086,18 +1077,6 @@
|
|||||||
{{ scope.row.createTime ? new Date(scope.row.createTime).toLocaleDateString() : '-' }}
|
{{ scope.row.createTime ? new Date(scope.row.createTime).toLocaleDateString() : '-' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="150" align="center" v-if="permissions.professional_teacherbase_edit">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button type="primary" link size="small" @click="handleEditPro(scope.row, scope.$index)">
|
|
||||||
<el-icon><Edit /></el-icon>
|
|
||||||
<span>编辑</span>
|
|
||||||
</el-button>
|
|
||||||
<el-button type="danger" link size="small" @click="handleDeletePro(scope.row, scope.$index)">
|
|
||||||
<el-icon><Delete /></el-icon>
|
|
||||||
<span>删除</span>
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -1105,15 +1084,11 @@
|
|||||||
<!--职业资格表单-->
|
<!--职业资格表单-->
|
||||||
<el-tab-pane label="职业资格" name="five">
|
<el-tab-pane label="职业资格" name="five">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
<div class="table-header" v-if="permissions.professional_teacherbase_edit">
|
<div class="table-header">
|
||||||
<div class="table-title">
|
<div class="table-title">
|
||||||
<el-icon><Medal /></el-icon>
|
<el-icon><Medal /></el-icon>
|
||||||
<span>职业资格信息</span>
|
<span>职业资格信息</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary" size="default" @click="handleAddWork">
|
|
||||||
<el-icon><Plus /></el-icon>
|
|
||||||
<span>新增</span>
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="workData" border stripe class="data-table">
|
<el-table :data="workData" border stripe class="data-table">
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
@@ -1143,18 +1118,6 @@
|
|||||||
{{ scope.row.createTime ? new Date(scope.row.createTime).toLocaleDateString() : '-' }}
|
{{ scope.row.createTime ? new Date(scope.row.createTime).toLocaleDateString() : '-' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="150" align="center" v-if="permissions.professional_teacherbase_edit">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button type="primary" link size="small" @click="handleEditWork(scope.row, scope.$index)">
|
|
||||||
<el-icon><Edit /></el-icon>
|
|
||||||
<span>编辑</span>
|
|
||||||
</el-button>
|
|
||||||
<el-button type="danger" link size="small" @click="handleDeleteWork(scope.row, scope.$index)">
|
|
||||||
<el-icon><Delete /></el-icon>
|
|
||||||
<span>删除</span>
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -1198,6 +1161,12 @@
|
|||||||
|
|
||||||
<el-tab-pane label="岗位变更" name="stationChange">
|
<el-tab-pane label="岗位变更" name="stationChange">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
|
<div class="table-header">
|
||||||
|
<div class="table-title">
|
||||||
|
<el-icon><Switch /></el-icon>
|
||||||
|
<span>岗位变更信息</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<el-table :data="stationChange" border stripe class="data-table">
|
<el-table :data="stationChange" border stripe class="data-table">
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="oldDeptName" label="原部门名称" min-width="180" align="center" show-overflow-tooltip />
|
<el-table-column prop="oldDeptName" label="原部门名称" min-width="180" align="center" show-overflow-tooltip />
|
||||||
@@ -1213,6 +1182,12 @@
|
|||||||
|
|
||||||
<el-tab-pane label="党员调动" name="partyChange">
|
<el-tab-pane label="党员调动" name="partyChange">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
|
<div class="table-header">
|
||||||
|
<div class="table-title">
|
||||||
|
<el-icon><Flag /></el-icon>
|
||||||
|
<span>党员调动信息</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<el-table :data="partyChange" border stripe class="data-table">
|
<el-table :data="partyChange" border stripe class="data-table">
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="oldBranchName" label="原支部名称" min-width="180" align="center" show-overflow-tooltip />
|
<el-table-column prop="oldBranchName" label="原支部名称" min-width="180" align="center" show-overflow-tooltip />
|
||||||
@@ -1236,6 +1211,12 @@
|
|||||||
<!--综合表彰-->
|
<!--综合表彰-->
|
||||||
<el-tab-pane label="综合表彰" name="teacherHonor">
|
<el-tab-pane label="综合表彰" name="teacherHonor">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
|
<div class="table-header">
|
||||||
|
<div class="table-title">
|
||||||
|
<el-icon><Medal /></el-icon>
|
||||||
|
<span>综合表彰信息</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<el-table :data="honorVOList" border stripe class="data-table">
|
<el-table :data="honorVOList" border stripe class="data-table">
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="honor" label="荣誉" min-width="180" align="center" show-overflow-tooltip />
|
<el-table-column prop="honor" label="荣誉" min-width="180" align="center" show-overflow-tooltip />
|
||||||
@@ -1251,6 +1232,12 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="教师论文" name="nine">
|
<el-tab-pane label="教师论文" name="nine">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
|
<div class="table-header">
|
||||||
|
<div class="table-title">
|
||||||
|
<el-icon><Document /></el-icon>
|
||||||
|
<span>教师论文信息</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<el-table :data="paperVOList" border stripe class="data-table">
|
<el-table :data="paperVOList" border stripe class="data-table">
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="author" label="作者" min-width="100" align="center" />
|
<el-table-column prop="author" label="作者" min-width="100" align="center" />
|
||||||
@@ -1285,6 +1272,12 @@
|
|||||||
|
|
||||||
<el-tab-pane label="教材列表" name="ten">
|
<el-tab-pane label="教材列表" name="ten">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
|
<div class="table-header">
|
||||||
|
<div class="table-title">
|
||||||
|
<el-icon><Document /></el-icon>
|
||||||
|
<span>教材列表信息</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<el-table :data="materialVOList" border stripe class="data-table">
|
<el-table :data="materialVOList" border stripe class="data-table">
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="materialName" label="教材名称" min-width="180" align="center" show-overflow-tooltip />
|
<el-table-column prop="materialName" label="教材名称" min-width="180" align="center" show-overflow-tooltip />
|
||||||
@@ -1312,6 +1305,12 @@
|
|||||||
|
|
||||||
<el-tab-pane label="课题列表" name="eleven">
|
<el-tab-pane label="课题列表" name="eleven">
|
||||||
<div class="table-section">
|
<div class="table-section">
|
||||||
|
<div class="table-header">
|
||||||
|
<div class="table-title">
|
||||||
|
<el-icon><Document /></el-icon>
|
||||||
|
<span>课题列表信息</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<el-table :data="topicListVOList" border stripe class="data-table">
|
<el-table :data="topicListVOList" border stripe class="data-table">
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="deptName" label="课题所属部门" min-width="180" align="center" show-overflow-tooltip />
|
<el-table-column prop="deptName" label="课题所属部门" min-width="180" align="center" show-overflow-tooltip />
|
||||||
@@ -1342,6 +1341,7 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="activeName === 'first'"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="saveSubmit"
|
@click="saveSubmit"
|
||||||
:disabled="!canSave"
|
:disabled="!canSave"
|
||||||
@@ -1908,12 +1908,6 @@
|
|||||||
if (politicsRes && politicsRes.data) {
|
if (politicsRes && politicsRes.data) {
|
||||||
searchPoliticsStatusList.value = politicsRes.data
|
searchPoliticsStatusList.value = politicsRes.data
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载授课类型字典
|
|
||||||
const teacherCateRes: any = await getDicts(global.TEACHER_CATE)
|
|
||||||
if (teacherCateRes && teacherCateRes.data) {
|
|
||||||
searchTeacherCateList.value = teacherCateRes.data
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载搜索字典数据失败:', error)
|
console.error('加载搜索字典数据失败:', error)
|
||||||
}
|
}
|
||||||
@@ -2023,18 +2017,17 @@
|
|||||||
const exportExcelA = (head: string[], val: string[], fileName: string) => {
|
const exportExcelA = (head: string[], val: string[], fileName: string) => {
|
||||||
exportNoImgUser().then((response: any) => {
|
exportNoImgUser().then((response: any) => {
|
||||||
if (response.data.msg == "fail") {
|
if (response.data.msg == "fail") {
|
||||||
alert(JSON.stringify(response.data.data));
|
alert(JSON.stringify(response.data));
|
||||||
} else {
|
} else {
|
||||||
import('/@/excel/Export2Excel.js').then(({ export_json_to_excel }) => {
|
import('/@/excel/Export2Excel.js').then(({ export_json_to_excel }) => {
|
||||||
const tHeader = head;
|
const tHeader = head;
|
||||||
const filterVal = val;
|
const filterVal = val;
|
||||||
const list = response.data.data;
|
const list = response.data;
|
||||||
const data = formatJson(filterVal, list);
|
const data = formatJson(filterVal, list);
|
||||||
export_json_to_excel(tHeader, data, fileName);
|
export_json_to_excel(tHeader, data, fileName);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
}).catch((error: any) => {
|
||||||
.catch((error: any) => {
|
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -2253,6 +2246,13 @@
|
|||||||
const politicsForm = ref<any>({})
|
const politicsForm = ref<any>({})
|
||||||
const politicsEditIndex = ref(-1)
|
const politicsEditIndex = ref(-1)
|
||||||
|
|
||||||
|
// 根据政治面貌ID获取名称
|
||||||
|
const getPoliticsStatusName = (id: string | number | undefined) => {
|
||||||
|
if (!id) return '-'
|
||||||
|
const item = searchPoliticsStatusList.value.find((item: any) => item.id === id || item.id === String(id))
|
||||||
|
return item ? item.politicsStatus : '-'
|
||||||
|
}
|
||||||
|
|
||||||
const handleAddPolitics = () => {
|
const handleAddPolitics = () => {
|
||||||
politicsForm.value = {}
|
politicsForm.value = {}
|
||||||
politicsEditIndex.value = -1
|
politicsEditIndex.value = -1
|
||||||
@@ -2285,7 +2285,8 @@
|
|||||||
politicsDialogVisible.value = false
|
politicsDialogVisible.value = false
|
||||||
// 刷新数据
|
// 刷新数据
|
||||||
getObj(form.baseInfo.id).then((res: any) => {
|
getObj(form.baseInfo.id).then((res: any) => {
|
||||||
const baseInfo = res.data.data;
|
const baseInfo = res.data;
|
||||||
|
if (!baseInfo) return;
|
||||||
dataPolitics.value = baseInfo.poList;
|
dataPolitics.value = baseInfo.poList;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -2367,7 +2368,8 @@
|
|||||||
educationDialogVisible.value = false
|
educationDialogVisible.value = false
|
||||||
// 刷新数据
|
// 刷新数据
|
||||||
getObj(form.baseInfo.id).then((res: any) => {
|
getObj(form.baseInfo.id).then((res: any) => {
|
||||||
const baseInfo = res.data.data;
|
const baseInfo = res.data;
|
||||||
|
if (!baseInfo) return;
|
||||||
dataEducation.value = baseInfo.acadeList
|
dataEducation.value = baseInfo.acadeList
|
||||||
dataEducation.value.forEach((v: any) => {
|
dataEducation.value.forEach((v: any) => {
|
||||||
v.qiList = []
|
v.qiList = []
|
||||||
@@ -2460,7 +2462,8 @@
|
|||||||
relationDialogVisible.value = false
|
relationDialogVisible.value = false
|
||||||
// 刷新数据
|
// 刷新数据
|
||||||
getObj(form.baseInfo.id).then((res: any) => {
|
getObj(form.baseInfo.id).then((res: any) => {
|
||||||
const baseInfo = res.data.data;
|
const baseInfo = res.data;
|
||||||
|
if (!baseInfo) return;
|
||||||
relationData.value = baseInfo.socialList;
|
relationData.value = baseInfo.socialList;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -2541,7 +2544,8 @@
|
|||||||
proDialogVisible.value = false
|
proDialogVisible.value = false
|
||||||
// 刷新数据
|
// 刷新数据
|
||||||
getObj(form.baseInfo.id).then((res: any) => {
|
getObj(form.baseInfo.id).then((res: any) => {
|
||||||
const baseInfo = res.data.data;
|
const baseInfo = res.data;
|
||||||
|
if (!baseInfo) return;
|
||||||
proData.value = baseInfo.titleList
|
proData.value = baseInfo.titleList
|
||||||
proData.value.forEach((v: any) => {
|
proData.value.forEach((v: any) => {
|
||||||
v.srcList = []
|
v.srcList = []
|
||||||
@@ -2626,7 +2630,8 @@
|
|||||||
workDialogVisible.value = false
|
workDialogVisible.value = false
|
||||||
// 刷新数据
|
// 刷新数据
|
||||||
getObj(form.baseInfo.id).then((res: any) => {
|
getObj(form.baseInfo.id).then((res: any) => {
|
||||||
const baseInfo = res.data.data;
|
const baseInfo = res.data;
|
||||||
|
if (!baseInfo) return;
|
||||||
workData.value = baseInfo.quaList
|
workData.value = baseInfo.quaList
|
||||||
workData.value.forEach((v: any) => {
|
workData.value.forEach((v: any) => {
|
||||||
v.srcList = []
|
v.srcList = []
|
||||||
@@ -2698,32 +2703,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
|
// 获取一级部门
|
||||||
fetchSecondTree()
|
fetchSecondTree()
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
// 健康状况
|
// 批量获取字典数据 religious_belief宗教信仰 health健康状况 teacher_cate授课类型
|
||||||
getDicts(global.HEATH).then((response: any) => {
|
|
||||||
healthList.value = response.data;
|
|
||||||
}),
|
|
||||||
// 授课类型
|
|
||||||
getDicts(global.TEACHER_CATE).then((response: any) => {
|
|
||||||
teacherCateList.value = response.data;
|
|
||||||
}),
|
|
||||||
// 宗教信仰
|
|
||||||
getDicts(religiousBelief).then((response: any) => {
|
|
||||||
religiousBeliefDic.value = response.data;
|
|
||||||
}),
|
|
||||||
// 批量获取字典数据
|
|
||||||
getDictsByTypes(['religious_belief', 'heath', 'teacher_cate']).then((response: any) => {
|
getDictsByTypes(['religious_belief', 'heath', 'teacher_cate']).then((response: any) => {
|
||||||
religiousBeliefDic.value = response.data.religious_belief;
|
religiousBeliefDic.value = response.data.religious_belief;
|
||||||
healthList.value = response.data.heath;
|
healthList.value = response.data.heath;
|
||||||
teacherCateList.value = response.data.teacher_cate;
|
teacherCateList.value = response.data.teacher_cate;
|
||||||
|
|
||||||
}),
|
}),
|
||||||
// 民族
|
// 民族
|
||||||
getNationalList().then((response: any) => {
|
getNationalList().then((response: any) => {
|
||||||
nationalList.value = response.data;
|
nationalList.value = response.data;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// 岗位类型部门树
|
// 岗位类型部门树
|
||||||
treeForCascader().then((response: any) => {
|
treeForCascader().then((response: any) => {
|
||||||
deptTreeList.value = response.data;
|
deptTreeList.value = response.data;
|
||||||
@@ -2809,6 +2801,7 @@
|
|||||||
workData.value = [];
|
workData.value = [];
|
||||||
dialogFromVisible.value = true;
|
dialogFromVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleEdit = (row: any, index: any) => {
|
const handleEdit = (row: any, index: any) => {
|
||||||
isAdd.value = false
|
isAdd.value = false
|
||||||
nowUserInfo.uploadUrl = '/professional/file/upload?teacherNo=' + row.teacherNo;
|
nowUserInfo.uploadUrl = '/professional/file/upload?teacherNo=' + row.teacherNo;
|
||||||
@@ -2819,7 +2812,12 @@
|
|||||||
imageUrl.value = ''
|
imageUrl.value = ''
|
||||||
//查询基础信息
|
//查询基础信息
|
||||||
getObj(row.id).then((response: any) => {
|
getObj(row.id).then((response: any) => {
|
||||||
const baseInfo = response.data.data;
|
const baseInfo = response.data;
|
||||||
|
if (!baseInfo || !baseInfo.teacherBase) {
|
||||||
|
console.error('[teacherbase] 获取教师详情失败,返回数据异常:', response);
|
||||||
|
message.error('获取教师详情失败,请稍后重试');
|
||||||
|
return;
|
||||||
|
}
|
||||||
form.baseInfo.teacherPhoto = "";
|
form.baseInfo.teacherPhoto = "";
|
||||||
nowImage.value = baseInfo.teacherBase.teacherPhoto;
|
nowImage.value = baseInfo.teacherBase.teacherPhoto;
|
||||||
imgList.value = [];
|
imgList.value = [];
|
||||||
@@ -2919,7 +2917,7 @@
|
|||||||
}
|
}
|
||||||
if (row.deptCode != null && row.deptCode != '') {
|
if (row.deptCode != null && row.deptCode != '') {
|
||||||
getDeptByCode(row.deptCode).then((response: any) => {
|
getDeptByCode(row.deptCode).then((response: any) => {
|
||||||
const dept = response.data.data
|
const dept = response.data
|
||||||
if (dept) {
|
if (dept) {
|
||||||
form.professionalStationRelation.deptCodeList = [];
|
form.professionalStationRelation.deptCodeList = [];
|
||||||
form.professionalStationRelation.deptCodeList[0] = dept.parentCode
|
form.professionalStationRelation.deptCodeList[0] = dept.parentCode
|
||||||
@@ -3173,28 +3171,59 @@
|
|||||||
.base-info-form {
|
.base-info-form {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
|
|
||||||
|
// 基本信息布局(照片+表单)
|
||||||
|
.base-info-layout {
|
||||||
|
display: flex;
|
||||||
|
gap: 18px;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
|
||||||
// 照片区域
|
// 照片区域
|
||||||
.photo-section {
|
.photo-section {
|
||||||
margin-bottom: 24px;
|
flex-shrink: 0;
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.photo-wrapper {
|
.photo-wrapper {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
height: 120px;
|
height: 160px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 2px solid #e4e7ed;
|
border: 1px solid #e4e7ed;
|
||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
|
||||||
|
|
||||||
.avatar-photo {
|
.avatar-photo {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单区域
|
||||||
|
.form-section {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0; // 防止 flex 子元素溢出
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 照片区域(独立显示,当没有表单时)
|
||||||
|
.photo-section {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.photo-wrapper {
|
||||||
|
width: 120px;
|
||||||
|
height: 160px;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
border: 1px solid #e4e7ed;
|
||||||
|
background: #fafafa;
|
||||||
|
|
||||||
|
.avatar-photo {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3214,9 +3243,10 @@
|
|||||||
// 表单分组样式优化 - 保持当前间距,添加背景
|
// 表单分组样式优化 - 保持当前间距,添加背景
|
||||||
.form-section {
|
.form-section {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
padding: 16px;
|
padding: 20px;
|
||||||
background: #fafbfc;
|
background: #fafbfc;
|
||||||
border-radius: 6px;
|
border-radius: 8px;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@@ -3248,11 +3278,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格模块样式优化
|
// 表格模块样式优化
|
||||||
.table-section {
|
.table-section {
|
||||||
padding: 24px;
|
// padding: 24px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
|
|
||||||
.table-header {
|
.table-header {
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
v-model="form.joinTime"
|
v-model="form.joinTime"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
format="yyyy-MM-dd"
|
format="YYYY-MM-DD"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
v-model="form.correctionTime"
|
v-model="form.correctionTime"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
format="yyyy-MM-dd"
|
format="YYYY-MM-DD"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="visible" title="社会关系" width="600px" @close="handleClose">
|
<el-dialog v-model="visible" title="社会关系" width="600px" @close="handleClose">
|
||||||
<el-form :model="form" label-width="120px" ref="formRef">
|
<el-form :model="form" :rules="rules" label-width="130px" ref="formRef">
|
||||||
<el-form-item label="称谓" required>
|
<el-form-item label="称谓" prop="title" required>
|
||||||
<el-select v-model="form.title" placeholder="请选择称谓" style="width: 100%">
|
<el-select v-model="form.title" placeholder="请选择称谓" style="width: 100%">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in titleOptions"
|
v-for="item in titleOptions"
|
||||||
@@ -11,20 +11,20 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="姓名" required>
|
<el-form-item label="姓名" prop="realName" required>
|
||||||
<el-input v-model="form.realName" placeholder="请输入姓名" />
|
<el-input v-model="form.realName" placeholder="请输入姓名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="出生年月" required>
|
<el-form-item label="出生年月" prop="birthday" required>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.birthday"
|
v-model="form.birthday"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
format="yyyy-MM-dd"
|
format="YYYY-MM-DD"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="政治面貌">
|
<el-form-item label="政治面貌" prop="politicsStatusId" required>
|
||||||
<el-select v-model="form.politicsStatusId" placeholder="请选择政治面貌" style="width: 100%">
|
<el-select v-model="form.politicsStatusId" placeholder="请选择政治面貌" style="width: 100%">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in politicsStatusList"
|
v-for="item in politicsStatusList"
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工作单位及职务">
|
<el-form-item label="工作单位及职务" prop="workStation" required>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.workStation"
|
v-model="form.workStation"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@@ -104,8 +104,31 @@ const handleClose = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
|
formRef.value?.validate((valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
emit('submit', { ...form.value })
|
emit('submit', { ...form.value })
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = {
|
||||||
|
title: [
|
||||||
|
{ required: true, message: '请选择称谓', trigger: 'change' }
|
||||||
|
],
|
||||||
|
realName: [
|
||||||
|
{ required: true, message: '请输入姓名', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
birthday: [
|
||||||
|
{ required: true, message: '请选择出生年月', trigger: 'change' }
|
||||||
|
],
|
||||||
|
politicsStatusId: [
|
||||||
|
{ required: true, message: '请选择政治面貌', trigger: 'change' }
|
||||||
|
],
|
||||||
|
workStation: [
|
||||||
|
{ required: true, message: '请输入工作单位及职务', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user