0
0

修复显示bug和项目回读bug

This commit is contained in:
xubing
2025-11-21 16:07:48 +08:00
parent 6d3d020f8a
commit 925024bce1
17 changed files with 193 additions and 243 deletions

View File

@@ -7,14 +7,14 @@ class ConfigView extends BaseView_1.BaseView {
render(data) {
const container = data?.container;
const configs = data?.configs || [];
// 生成配置列表的 HTML - 添加文件名编辑功能
// 生成配置列表的 HTML - 移除文件名编辑功能
const configsHtml = configs.map((config) => `
<tr>
<td>
<span class="editable" onclick="editConfigName('${config.id}', '${config.name}')">🔧 ${config.name}</span>
</td>
<td>
<span class="editable" onclick="editFileName('${config.id}', '${config.fileName}')">📄 ${config.fileName}</span>
<span class="clickable" onclick="openConfigFile('${config.id}')">📄 ${config.fileName}</span>
</td>
<td>
<button class="btn-delete" onclick="deleteConfig('${config.id}')">删除</button>
@@ -84,23 +84,6 @@ class ConfigView extends BaseView_1.BaseView {
);
}
function editFileName(configId, currentFileName) {
showPromptDialog(
'修改文件名',
'请输入新的文件名(包含扩展名):',
currentFileName,
function(newFileName) {
if (newFileName && newFileName !== currentFileName) {
vscode.postMessage({
type: 'updateConfigFileName',
configId: configId,
fileName: newFileName
});
}
}
);
}
function openConfigFile(configId) {
currentConfigId = configId;
document.getElementById('configEditor').style.display = 'block';
@@ -249,19 +232,7 @@ class ConfigView extends BaseView_1.BaseView {
}
});
// 修改:点击文件名时打开编辑器
document.addEventListener('click', function(event) {
if (event.target.classList.contains('editable') && event.target.textContent.includes('📄')) {
const row = event.target.closest('tr');
if (row) {
const configNameCell = row.querySelector('td:first-child .editable');
if (configNameCell) {
const configId = configNameCell.onclick.toString().match(/'([^']+)'/)[1];
openConfigFile(configId);
}
}
}
});
// 移除原来的复杂点击事件处理,现在文件名直接调用 openConfigFile
</script>
</body>
</html>`;