自动化立体仓库 - WMS系统
lty
2026-01-22 35b1b26f1fe16550b4ee2881a26d599456fe59b4
src/main/webapp/static/js/cool.js
@@ -33,7 +33,7 @@
    var inputDomVal = document.querySelector("input[data-key="+val+"]").value;
    var selectDom = document.querySelector("select[data-key="+val+"Select]");
    selectDom.length = 0;
    var defaultOption = new Option("取消选择", "");
    var defaultOption = new Option(typeof I18n !== 'undefined' ? I18n.t('cancel_selection') : "取消选择", "");
    defaultOption.title = "";
    selectDom.appendChild(defaultOption);
    selectDom.style.display='none';
@@ -47,7 +47,30 @@
            if (res.code === 200){
                var list = res.data;
                for (var i=0;i<list.length;i++){
                    var option = new Option(list[i].value, i);
                    var text = list[i].value;
                    var id = list[i].id;
                    // 尝试翻译
                    if (typeof I18n !== 'undefined' && typeof window.i18nEnumMap !== 'undefined') {
                        var mapper = window.i18nEnumMap[val];
                        if (mapper) {
                            var transKey = null;
                            if (typeof mapper === 'function') {
                                transKey = mapper(id);
                            } else {
                                transKey = mapper[id];
                            }
                            if (transKey) {
                                var trans = I18n.t(transKey);
                                if (trans !== transKey) {
                                    text = trans;
                                }
                            }
                        }
                    }
                    var option = new Option(text, i);
                    option.title = list[i].id;
                    selectDom.options[i+1] = option;
                }