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('新增资质成功!'); //
} else {
await editDataAPI(submitData);
console.log('submitData',submitData)
this.$message.success('编辑资质成功!'); //
}

View File

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

View File

@ -207,15 +207,47 @@ export default {
// ID-
loadTreeData() {
// analysisIdsendParams
listAnalysisLabelItem({
analysisId: this.tableSendParams.analysisId
}).then(res => {
if (res.code === 200) {
this.treeData = this.buildTree(res.rows)
this.buildLabelItemMap(res.rows) //
}
})
const allItems = []; //
const pageSize = 10; //
let currentPage = 1; //
//
const fetchPage = () => {
listAnalysisLabelItem({
analysisId: this.tableSendParams.analysisId,
pageNum: currentPage,
pageSize: pageSize
}).then(res => {
if (res.code === 200) {
const { rows, total } = res;
//
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 : ''
};
const uniqueRes = await checkLabelItemNameUnique(uniqueParams);
if (uniqueRes.data > 0) {
this.$message.error('当前标签组下标签名称已存在');
return;
}
// if (uniqueRes.data > 0) {
// this.$message.error('');
// return;
// }
if (this.type === 'add') {
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()
]);
console.log('ProjectFileData',projectFileData)
// 2.
const formData = {
...basicData,
@ -147,16 +149,20 @@ export default {
delFiles: [] //
};
// --- ---
// 3. (ProjectFile)
projectFileData.forEach(tab => {
// 3.1 compositionType
if (tab.fileList && tab.fileList.length > 0) {
const processedFiles = tab.fileList.map(file => {
// fileRes
const fileRes = file.response?.fileRes || {};
// compositionType
const fileRes = file.response?.fileRes; // fileRes undefined
// fileRes null filter
if (!fileRes) {
return null;
}
// fileRes
return {
...fileRes,
businessType: 'project_file',
@ -164,8 +170,10 @@ export default {
compositionFileType: file.compositionFileType,
compositionType: tab.compositionType, // <-- Tab compositionType
};
}).filter(Boolean); //
}).filter(Boolean); // map null
// console.log('processedFiles', ...processedFiles); //
console.log('processedFiles', processedFiles);
formData.files.push(...processedFiles);
}
@ -175,12 +183,19 @@ export default {
}
});
// 4. / (SectionFile)
// 4. / (SectionFile)
sectionFileData.forEach(tab => {
// 4.1 compositionType
if (tab.fileList && tab.fileList.length > 0) {
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 {
...fileRes,
businessType: 'section_file',
@ -188,8 +203,9 @@ export default {
compositionFileType: file.compositionFileType,
compositionType: tab.compositionType, // <-- Tab compositionType
};
}).filter(Boolean);
console.log('123123123',processedFiles)
}).filter(Boolean); // map null
// console.log('123123123', processedFiles);
formData.files.push(...processedFiles);
}
@ -214,6 +230,7 @@ export default {
// 6.
if (this.type === 'add') {
console.log('formData',formData)
await addTemplateInfo(formData);
} else {
console.log('12345678',formData)

View File

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

View File

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

View File

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