合并代码

This commit is contained in:
Dragon
2024-03-19 18:59:23 +08:00
parent 24ad849ffb
commit 4fee145865

View File

@@ -35,4 +35,16 @@ export function dateFormat (date, fmt) {
date = o = padLeftZero = null;
return fmt;
}
export function buildSelectOption(id, defVal, array) {
let $select = $(id);
for(let i in array) {
let obj = array[i];
let selected = false;
if (obj.value == defVal) {
selected = true;
}
$select.append('<option value="' + obj.value + '"' + (selected ? 'selected' : '') + '>' + obj.text + '</option>');
}
}