anxiao_web/pages/cmddispatch/js/schoolSearch.js

26 lines
782 B
JavaScript
Raw Normal View History

2024-07-24 09:22:32 +08:00
import {layuiObj,stationInfoTableList} from "./index.js"
//获取所有的设备
function getSchoolOptions(){
var options="<option value='000'>请选择学校</option>"
for(var i=0;i<stationInfoTableList.length;i++){
var name=stationInfoTableList[i]["name"];
options+=`<option value="${name}">${name}</option>`
}
return options;
}
//监听select变化
function schoolSearchSelectChange(){
layuiObj.layuiForm.on('select(mainContentC_schoolSelect)', function(data){
var name=data["value"];
for(var i=0;i<stationInfoTableList.length;i++){
if(name==stationInfoTableList[i]["name"]){
console.log(stationInfoTableList[i]);
break;
}
}
})
}
export {getSchoolOptions}