明树Git Lab

Commit 6825500b authored by yangyajing's avatar yangyajing

modify url

parent e890eeb2
...@@ -603,42 +603,43 @@ ...@@ -603,42 +603,43 @@
* @param {string} configKey - Key from modalConfigs. * @param {string} configKey - Key from modalConfigs.
*/ */
function showModal(configKey) { function showModal(configKey) {
currentConfigKey = configKey; location.href = "https://xcnd4mpcx4em.feishu.cn/share/base/form/shrcnzkPrDRZ4v3aCGrnkaQarrh";
const config = modalConfigs[configKey]; // currentConfigKey = configKey;
// const config = modalConfigs[configKey];
// Reset form and status // // Reset form and status
contactForm.reset(); // contactForm.reset();
contactForm.classList.remove('hidden'); // contactForm.classList.remove('hidden');
successMessage.classList.add('hidden'); // successMessage.classList.add('hidden');
roleSelection.innerHTML = ''; // Clear previous roles // roleSelection.innerHTML = ''; // Clear previous roles
roleSelection.classList.add('hidden'); // Hide by default // roleSelection.classList.add('hidden'); // Hide by default
modalTitle.textContent = config.title; // modalTitle.textContent = config.title;
modalSubtitle.textContent = config.subtitle; // modalSubtitle.textContent = config.subtitle;
// Handle role selection // // Handle role selection
if (config.roles.length > 0) { // if (config.roles.length > 0) {
roleSelection.classList.remove('hidden'); // roleSelection.classList.remove('hidden');
config.roles.forEach(role => { // config.roles.forEach(role => {
const isChecked = role.id === config.defaultRole; // const isChecked = role.id === config.defaultRole;
const radioHtml = ` // const radioHtml = `
<label class="flex items-center cursor-pointer flex-1 min-w-[45%]"> // <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}')"> // <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> // <span class="ml-2 text-white text-sm">${role.label}</span>
</label> // </label>
`; // `;
roleSelection.insertAdjacentHTML('beforeend', radioHtml); // roleSelection.insertAdjacentHTML('beforeend', radioHtml);
}); // });
// Set initial placeholder for the default role // // Set initial placeholder for the default role
const defaultRoleConfig = config.roles.find(r => r.id === config.defaultRole); // const defaultRoleConfig = config.roles.find(r => r.id === config.defaultRole);
updatePlaceholder(defaultRoleConfig ? defaultRoleConfig.placeholder : ''); // updatePlaceholder(defaultRoleConfig ? defaultRoleConfig.placeholder : '');
} else { // } else {
// Handle fixed placeholders for other buttons // // Handle fixed placeholders for other buttons
roleSelection.classList.add('hidden'); // roleSelection.classList.add('hidden');
updatePlaceholder(config.defaultPlaceholder || ''); // updatePlaceholder(config.defaultPlaceholder || '');
} // }
modal.classList.remove('hidden'); // 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