明树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
contactForm.reset(); // // Reset form and status
contactForm.classList.remove('hidden'); // contactForm.reset();
successMessage.classList.add('hidden'); // contactForm.classList.remove('hidden');
roleSelection.innerHTML = ''; // Clear previous roles // successMessage.classList.add('hidden');
roleSelection.classList.add('hidden'); // Hide by default // roleSelection.innerHTML = ''; // Clear previous roles
// roleSelection.classList.add('hidden'); // Hide by default
modalTitle.textContent = config.title;
modalSubtitle.textContent = config.subtitle; // modalTitle.textContent = config.title;
// modalSubtitle.textContent = config.subtitle;
// Handle role selection
if (config.roles.length > 0) { // // Handle role selection
roleSelection.classList.remove('hidden'); // if (config.roles.length > 0) {
config.roles.forEach(role => { // roleSelection.classList.remove('hidden');
const isChecked = role.id === config.defaultRole; // config.roles.forEach(role => {
const radioHtml = ` // const isChecked = role.id === config.defaultRole;
<label class="flex items-center cursor-pointer flex-1 min-w-[45%]"> // const radioHtml = `
<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}')"> // <label class="flex items-center cursor-pointer flex-1 min-w-[45%]">
<span class="ml-2 text-white text-sm">${role.label}</span> // <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}')">
</label> // <span class="ml-2 text-white text-sm">${role.label}</span>
`; // </label>
roleSelection.insertAdjacentHTML('beforeend', radioHtml); // `;
}); // roleSelection.insertAdjacentHTML('beforeend', radioHtml);
// Set initial placeholder for the default role // });
const defaultRoleConfig = config.roles.find(r => r.id === config.defaultRole); // // Set initial placeholder for the default role
updatePlaceholder(defaultRoleConfig ? defaultRoleConfig.placeholder : ''); // const defaultRoleConfig = config.roles.find(r => r.id === config.defaultRole);
} else { // updatePlaceholder(defaultRoleConfig ? defaultRoleConfig.placeholder : '');
// Handle fixed placeholders for other buttons // } else {
roleSelection.classList.add('hidden'); // // Handle fixed placeholders for other buttons
updatePlaceholder(config.defaultPlaceholder || ''); // roleSelection.classList.add('hidden');
} // 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