明树Git Lab

Commit 6825500b authored by yangyajing's avatar yangyajing

modify url

parent e890eeb2
......@@ -603,42 +603,43 @@
* @param {string} configKey - Key from modalConfigs.
*/
function showModal(configKey) {
currentConfigKey = configKey;
const config = modalConfigs[configKey];
// Reset form and status
contactForm.reset();
contactForm.classList.remove('hidden');
successMessage.classList.add('hidden');
roleSelection.innerHTML = ''; // Clear previous roles
roleSelection.classList.add('hidden'); // Hide by default
modalTitle.textContent = config.title;
modalSubtitle.textContent = config.subtitle;
// Handle role selection
if (config.roles.length > 0) {
roleSelection.classList.remove('hidden');
config.roles.forEach(role => {
const isChecked = role.id === config.defaultRole;
const radioHtml = `
<label class="flex items-center cursor-pointer flex-1 min-w-[45%]">
<input type="radio" name="role" value="${role.id}" id="${role.id}" class="form-radio text-primary h-4 w-4" ${isChecked ? 'checked' : ''} onchange="updatePlaceholder('${role.placeholder}')">
<span class="ml-2 text-white text-sm">${role.label}</span>
</label>
`;
roleSelection.insertAdjacentHTML('beforeend', radioHtml);
});
// Set initial placeholder for the default role
const defaultRoleConfig = config.roles.find(r => r.id === config.defaultRole);
updatePlaceholder(defaultRoleConfig ? defaultRoleConfig.placeholder : '');
} else {
// Handle fixed placeholders for other buttons
roleSelection.classList.add('hidden');
updatePlaceholder(config.defaultPlaceholder || '');
}
modal.classList.remove('hidden');
location.href = "https://xcnd4mpcx4em.feishu.cn/share/base/form/shrcnzkPrDRZ4v3aCGrnkaQarrh";
// currentConfigKey = configKey;
// const config = modalConfigs[configKey];
// // Reset form and status
// contactForm.reset();
// contactForm.classList.remove('hidden');
// successMessage.classList.add('hidden');
// roleSelection.innerHTML = ''; // Clear previous roles
// roleSelection.classList.add('hidden'); // Hide by default
// modalTitle.textContent = config.title;
// modalSubtitle.textContent = config.subtitle;
// // Handle role selection
// if (config.roles.length > 0) {
// roleSelection.classList.remove('hidden');
// config.roles.forEach(role => {
// const isChecked = role.id === config.defaultRole;
// const radioHtml = `
// <label class="flex items-center cursor-pointer flex-1 min-w-[45%]">
// <input type="radio" name="role" value="${role.id}" id="${role.id}" class="form-radio text-primary h-4 w-4" ${isChecked ? 'checked' : ''} onchange="updatePlaceholder('${role.placeholder}')">
// <span class="ml-2 text-white text-sm">${role.label}</span>
// </label>
// `;
// roleSelection.insertAdjacentHTML('beforeend', radioHtml);
// });
// // Set initial placeholder for the default role
// const defaultRoleConfig = config.roles.find(r => r.id === config.defaultRole);
// updatePlaceholder(defaultRoleConfig ? defaultRoleConfig.placeholder : '');
// } else {
// // Handle fixed placeholders for other buttons
// roleSelection.classList.add('hidden');
// updatePlaceholder(config.defaultPlaceholder || '');
// }
// modal.classList.remove('hidden');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment