Compare commits
2 Commits
cd327898f5
...
32aecd8b1d
| Author | SHA1 | Date |
|---|---|---|
|
|
32aecd8b1d | |
|
|
d8cf58f2c5 |
|
|
@ -105,6 +105,7 @@ export default {
|
|||
this.$message.success('新增资质成功!'); // 新增成功提示
|
||||
} else {
|
||||
await editDataAPI(submitData);
|
||||
console.log('submitData',submitData)
|
||||
this.$message.success('编辑资质成功!'); // 编辑成功提示
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -207,15 +207,47 @@ export default {
|
|||
|
||||
// 加载树形结构数据,并构建ID-名称映射表
|
||||
loadTreeData() {
|
||||
// 调用列表接口时,传递analysisId参数(与sendParams保持一致)
|
||||
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();
|
||||
},
|
||||
|
||||
// 构建树形结构
|
||||
|
|
|
|||
|
|
@ -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
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue