bug修改

This commit is contained in:
LHD_HY 2025-11-28 14:27:39 +08:00
parent 887b3ab82b
commit d8cf58f2c5
9 changed files with 660 additions and 461 deletions

View File

@ -105,6 +105,7 @@ export default {
this.$message.success('新增资质成功!'); // this.$message.success('新增资质成功!'); //
} else { } else {
await editDataAPI(submitData); await editDataAPI(submitData);
console.log('submitData',submitData)
this.$message.success('编辑资质成功!'); // this.$message.success('编辑资质成功!'); //
} }

View File

@ -64,7 +64,6 @@
<div class="qualification-card"> <div class="qualification-card">
<div class="qualification-header"> <div class="qualification-header">
<h3 class="certificate-name">{{ item.certificateName || '未命名证书' }}</h3> <h3 class="certificate-name">{{ item.certificateName || '未命名证书' }}</h3>
<span class="type-tag">{{ item.qualificationType || '未分类' }}</span>
</div> </div>
<div class="qualification-info"> <div class="qualification-info">
@ -479,7 +478,7 @@ export default {
.qualification-grid { .qualification-grid {
display: grid; display: grid;
grid-template-columns: repeat(5, 1fr); grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
gap: 24px; gap: 24px;
margin-bottom: 20px; /* 与分页保持间距 */ margin-bottom: 20px; /* 与分页保持间距 */
padding: 20px 6px 20px 0px; padding: 20px 6px 20px 0px;

View File

@ -207,15 +207,47 @@ export default {
// ID- // ID-
loadTreeData() { loadTreeData() {
// analysisIdsendParams const allItems = []; //
const pageSize = 10; //
let currentPage = 1; //
//
const fetchPage = () => {
listAnalysisLabelItem({ listAnalysisLabelItem({
analysisId: this.tableSendParams.analysisId analysisId: this.tableSendParams.analysisId,
pageNum: currentPage,
pageSize: pageSize
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.treeData = this.buildTree(res.rows) const { rows, total } = res;
this.buildLabelItemMap(res.rows) //
//
if (rows && rows.length > 0) {
allItems.push(...rows);
} }
})
//
const totalPages = Math.ceil(total / pageSize);
//
if (currentPage < totalPages) {
currentPage++;
fetchPage(); //
} else {
//
console.log('所有数据获取完毕,共', allItems.length, '条');
this.treeData = this.buildTree(allItems);
this.buildLabelItemMap(allItems); //
}
} else {
//
this.$modal.msgError('加载标签项数据失败');
}
});
};
//
fetchPage();
}, },
// //

View File

@ -407,10 +407,10 @@ export default {
analysisLabelItemId: this.type === 'edit' ? this.formData.analysisLabelItemId : '' analysisLabelItemId: this.type === 'edit' ? this.formData.analysisLabelItemId : ''
}; };
const uniqueRes = await checkLabelItemNameUnique(uniqueParams); const uniqueRes = await checkLabelItemNameUnique(uniqueParams);
if (uniqueRes.data > 0) { // if (uniqueRes.data > 0) {
this.$message.error('当前标签组下标签名称已存在'); // this.$message.error('');
return; // return;
} // }
if (this.type === 'add') { if (this.type === 'add') {
await addAnalysisLabelItem(this.formData); await addAnalysisLabelItem(this.formData);

File diff suppressed because it is too large Load Diff

View File

@ -136,6 +136,8 @@ export default {
this.$refs.analysisLabelRef.validate() this.$refs.analysisLabelRef.validate()
]); ]);
console.log('ProjectFileData',projectFileData)
// 2. // 2.
const formData = { const formData = {
...basicData, ...basicData,
@ -147,16 +149,20 @@ export default {
delFiles: [] // delFiles: [] //
}; };
// --- ---
// 3. (ProjectFile) // 3. (ProjectFile)
projectFileData.forEach(tab => { projectFileData.forEach(tab => {
// 3.1 compositionType // 3.1 compositionType
if (tab.fileList && tab.fileList.length > 0) { if (tab.fileList && tab.fileList.length > 0) {
const processedFiles = tab.fileList.map(file => { const processedFiles = tab.fileList.map(file => {
// fileRes // fileRes
const fileRes = file.response?.fileRes || {}; const fileRes = file.response?.fileRes; // fileRes undefined
// compositionType
// fileRes null filter
if (!fileRes) {
return null;
}
// fileRes
return { return {
...fileRes, ...fileRes,
businessType: 'project_file', businessType: 'project_file',
@ -164,8 +170,10 @@ export default {
compositionFileType: file.compositionFileType, compositionFileType: file.compositionFileType,
compositionType: tab.compositionType, // <-- Tab compositionType compositionType: tab.compositionType, // <-- Tab compositionType
}; };
}).filter(Boolean); // }).filter(Boolean); // map null
// console.log('processedFiles', ...processedFiles); //
console.log('processedFiles', processedFiles);
formData.files.push(...processedFiles); formData.files.push(...processedFiles);
} }
@ -180,7 +188,14 @@ export default {
// 4.1 compositionType // 4.1 compositionType
if (tab.fileList && tab.fileList.length > 0) { if (tab.fileList && tab.fileList.length > 0) {
const processedFiles = tab.fileList.map(file => { const processedFiles = tab.fileList.map(file => {
const fileRes = file.response?.fileRes || {}; const fileRes = file.response?.fileRes; // fileRes undefined
// fileRes null filter
if (!fileRes) {
return null;
}
// fileRes
return { return {
...fileRes, ...fileRes,
businessType: 'section_file', businessType: 'section_file',
@ -188,8 +203,9 @@ export default {
compositionFileType: file.compositionFileType, compositionFileType: file.compositionFileType,
compositionType: tab.compositionType, // <-- Tab compositionType compositionType: tab.compositionType, // <-- Tab compositionType
}; };
}).filter(Boolean); }).filter(Boolean); // map null
console.log('123123123',processedFiles)
// console.log('123123123', processedFiles);
formData.files.push(...processedFiles); formData.files.push(...processedFiles);
} }
@ -214,6 +230,7 @@ export default {
// 6. // 6.
if (this.type === 'add') { if (this.type === 'add') {
console.log('formData',formData)
await addTemplateInfo(formData); await addTemplateInfo(formData);
} else { } else {
console.log('12345678',formData) console.log('12345678',formData)

View File

@ -16,7 +16,6 @@
</el-button> </el-button>
</div> </div>
<!-- 核心修改添加 @tab-click 事件监听 -->
<el-tabs <el-tabs
v-model="activeTabIndex" v-model="activeTabIndex"
type="card" type="card"
@ -112,7 +111,6 @@ export default {
}, },
data() { data() {
return { return {
tabFiles: [],
uploadType: 'doc、docx、pdf、xls、xlsx、wps', uploadType: 'doc、docx、pdf、xls、xlsx、wps',
maxFileTips: '50MB', maxFileTips: '50MB',
fileUploadRule: { fileUploadType: 'project_file', suffix: 'template' }, fileUploadRule: { fileUploadType: 'project_file', suffix: 'template' },
@ -178,8 +176,10 @@ export default {
return return
} }
this.fileTabs.splice(index, 1) this.fileTabs.splice(index, 1)
// tab
if (this.activeTabIndex === index.toString()) { if (this.activeTabIndex === index.toString()) {
this.activeTabIndex = '0' // tab
this.activeTabIndex = this.fileTabs.length > 0 ? (this.fileTabs.length - 1).toString() : '0';
} }
}, },
@ -222,17 +222,15 @@ export default {
} }
}, },
// === tab === // Tab
handleTabChange(tab, event) { handleTabChange(tab, event) {
// tab.index tab //
const index = tab.index; const index = tab.index;
console.log(`切换到了第 ${index + 1} 个 tab`); console.log(`切换到了第 ${index + 1} 个 tab`);
this.setFormData(this.tabFiles)
}, },
setFormData(projectFiles) { setFormData(projectFiles) {
this.tabFiles = projectFiles // fileTabs
// 1. tabs
this.fileTabs = []; this.fileTabs = [];
if (!projectFiles || projectFiles.length === 0) { if (!projectFiles || projectFiles.length === 0) {
@ -249,7 +247,7 @@ export default {
return; return;
} }
// 2. tabs // tabs
projectFiles.forEach((file) => { projectFiles.forEach((file) => {
const formattedFile = { const formattedFile = {
name: file.fileName || file.name, name: file.fileName || file.name,
@ -263,9 +261,6 @@ export default {
compositionFileType: file.compositionFileType || '', compositionFileType: file.compositionFileType || '',
compositionType: '1', compositionType: '1',
businessType: 'project_file', businessType: 'project_file',
response: {
fileRes: file
}
}; };
this.fileTabs.push({ this.fileTabs.push({
@ -279,7 +274,7 @@ export default {
}); });
}); });
this.activeTabIndex = '0'; this.activeTabIndex = projectFiles.length > 0 ? '0' : '0';
}, },
validate() { validate() {

View File

@ -112,7 +112,6 @@ export default {
}, },
data() { data() {
return { return {
tabFiles: [],
uploadType: 'doc、docx、pdf、xls、xlsx、wps', uploadType: 'doc、docx、pdf、xls、xlsx、wps',
maxFileTips: '50MB', maxFileTips: '50MB',
fileUploadRule: { fileUploadType: 'section_file', suffix: 'template' }, fileUploadRule: { fileUploadType: 'section_file', suffix: 'template' },
@ -178,8 +177,9 @@ export default {
return return
} }
this.fileTabs.splice(index, 1) this.fileTabs.splice(index, 1)
// tab
if (this.activeTabIndex === index.toString()) { if (this.activeTabIndex === index.toString()) {
this.activeTabIndex = '0' this.activeTabIndex = this.fileTabs.length > 0 ? (this.fileTabs.length - 1).toString() : '0';
} }
}, },
@ -223,16 +223,16 @@ export default {
} }
}, },
// Tab
handleTabChange(tab, event) { handleTabChange(tab, event) {
// tab.index tab //
const index = tab.index; const index = tab.index;
console.log(`切换到了第 ${index + 1} 个 tab`); console.log(`切换到了第 ${index + 1} 个 tab`);
this.setFormData(this.tabFiles)
}, },
setFormData(sectionFiles) { setFormData(sectionFiles) {
this.tabFiles = sectionFiles // fileTabs
this.fileTabs = [] this.fileTabs = [];
if (!sectionFiles || sectionFiles.length === 0) { if (!sectionFiles || sectionFiles.length === 0) {
this.fileTabs.push({ this.fileTabs.push({
@ -244,8 +244,8 @@ export default {
delFileList: [] delFileList: []
} }
}) })
this.activeTabIndex = '0' this.activeTabIndex = '0';
return return;
} }
sectionFiles.forEach((file) => { sectionFiles.forEach((file) => {
@ -261,10 +261,6 @@ export default {
compositionFileType: file.compositionFileType || '', compositionFileType: file.compositionFileType || '',
compositionType: '2', compositionType: '2',
businessType: 'section_file', businessType: 'section_file',
// response ProjectFile
response: {
fileRes: file
}
}; };
this.fileTabs.push({ this.fileTabs.push({
@ -278,7 +274,7 @@ export default {
}) })
}) })
this.activeTabIndex = '0' this.activeTabIndex = sectionFiles.length > 0 ? '0' : '0';
}, },
validate() { validate() {

View File

@ -35,8 +35,8 @@
<template slot="useState" slot-scope="{ data }"> <template slot="useState" slot-scope="{ data }">
<el-switch <el-switch
v-model="data.useState" v-model="data.useState"
:active-value="'ON'" :active-value="'0'"
:inactive-value="'OFF'" :inactive-value="'1'"
@change="handleStateChange(data)" @change="handleStateChange(data)"
/> />
</template> </template>
@ -53,9 +53,9 @@
解析规则 解析规则
</el-button> </el-button>
<!-- 更多下拉菜单调整样式增加菜单项 --> <!-- 更多下拉菜单调整样式与解析规则按钮保持一致 -->
<el-dropdown trigger="click" class="more-dropdown"> <el-dropdown trigger="click" class="more-dropdown">
<span class="el-dropdown-link action-btn" style="color: #666;"> <span class="el-dropdown-link action-btn" style="color: #1F72EA;">
更多<i class="el-icon-arrow-down el-icon--right"></i> 更多<i class="el-icon-arrow-down el-icon--right"></i>
</span> </span>
<el-dropdown-menu> <el-dropdown-menu>
@ -65,7 +65,7 @@
@click.native="handleUpdate(data)" @click.native="handleUpdate(data)"
class="dropdown-item" class="dropdown-item"
> >
<i class="el-icon-edit" style="margin-right: 6px;"></i>编辑 编辑
</el-dropdown-item> </el-dropdown-item>
<!-- 复制 --> <!-- 复制 -->
<el-dropdown-item <el-dropdown-item
@ -73,18 +73,18 @@
@click.native="handleCopy(data)" @click.native="handleCopy(data)"
class="dropdown-item" class="dropdown-item"
> >
<i class="el-icon-copy" style="margin-right: 6px;"></i>复制 复制
</el-dropdown-item> </el-dropdown-item>
<!-- 发布 --> <!-- 发布 -->
<el-dropdown-item <el-dropdown-item
v-hasPermi="['template:info:publish']" v-hasPermi="['template:info:publish']"
@click.native="handlePublish(data)" @click.native="handlePublish(data)"
class="dropdown-item" class="dropdown-item"
:style="{ color: data.useState === 'ON' ? '#999' : '#1F72EA' }" :style="{ color: data.useState === '0' ? '#999' : '#1F72EA' }"
:disabled="data.useState === 'ON'" :disabled="data.useState === '0'"
> >
<i class="el-icon-upload2" style="margin-right: 6px;"></i>
{{ data.useState === 'ON' ? '已发布' : '发布' }} {{ data.useState === '0' ? '已发布' : '发布' }}
</el-dropdown-item> </el-dropdown-item>
<!-- 删除 --> <!-- 删除 -->
<el-dropdown-item <el-dropdown-item
@ -93,7 +93,7 @@
class="dropdown-item" class="dropdown-item"
style="color: #DB3E29;" style="color: #DB3E29;"
> >
<i class="el-icon-delete" style="margin-right: 6px;"></i>删除 删除
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@ -221,7 +221,7 @@ export default {
// //
handlePublish(data) { handlePublish(data) {
if (data.useState === 'ON') { if (data.useState === '0') {
this.$modal.msgInfo('该模板已发布'); this.$modal.msgInfo('该模板已发布');
return; return;
} }
@ -229,7 +229,7 @@ export default {
.then(() => { .then(() => {
publishTemplateInfo({ publishTemplateInfo({
templateId: encryptWithSM4(data.templateId.toString()), templateId: encryptWithSM4(data.templateId.toString()),
useState: 'ON' // useState: '0' //
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$modal.msgSuccess('发布成功'); this.$modal.msgSuccess('发布成功');
@ -257,6 +257,7 @@ export default {
handleStateChange(row) { handleStateChange(row) {
const originalState = row.useState; const originalState = row.useState;
const params = { ...row, useState: row.useState, templateId: row.templateId }; const params = { ...row, useState: row.useState, templateId: row.templateId };
console.log('params',params)
updateTemplateInfo(params) updateTemplateInfo(params)
.then(res => { .then(res => {
if (res.code === 200) { if (res.code === 200) {
@ -351,17 +352,17 @@ export default {
.action-btn { .action-btn {
margin-right: 8px; margin-right: 8px;
color: #666; color: #1F72EA; /* 改为与解析规则相同的蓝色 */
font-size: 14px;
transition: all 0.3s ease;
&:last-child { &:last-child {
margin-right: 0; margin-right: 0;
} }
}
.el-dropdown-link { /* 统一的hover效果 */
cursor: pointer;
/* 与解析规则按钮保持一致的hover样式 */
&:hover { &:hover {
color: #1F72EA; color: #4A8BFF; /* 稍浅的蓝色 */
text-decoration: underline; text-decoration: underline;
} }
} }
@ -370,17 +371,35 @@ export default {
::v-deep .more-dropdown { ::v-deep .more-dropdown {
.el-dropdown-menu { .el-dropdown-menu {
min-width: 140px; /* 固定下拉框宽度 */ min-width: 140px; /* 固定下拉框宽度 */
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
} }
.dropdown-item { .dropdown-item {
padding: 6px 16px; /* 调整内边距 */ padding: 8px 16px;
transition: background-color 0.2s; font-size: 14px;
transition: all 0.2s;
&:hover { &:hover {
background-color: #f5f7fa; /* hover背景色 */ background-color: #f5f7fa;
color: #1F72EA;
}
}
/* 确保下拉箭头颜色一致 */
.el-dropdown-link {
color: #1F72EA;
&:hover {
color: #4A8BFF;
text-decoration: underline;
} }
} }
} }
.el-dropdown-link { .el-dropdown-link {
cursor: pointer; cursor: pointer;
display: inline-flex;
align-items: center;
} }
</style> </style>