合并代码
This commit is contained in:
@@ -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>');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user