police页面下拉

detached
王宇航 2024-01-04 16:51:13 +08:00
parent 8873cd0cc5
commit 59271cef2f
3 changed files with 20 additions and 2 deletions

View File

@ -12,7 +12,7 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">工位:</label>
<div class="col-sm-8">
<input name="station" placeholder="请输入工位" class="form-control" type="text" maxlength="30" required>
<option name="station" placeholder="请输入工位" class="form-control" type="text" maxlength="30" required>
</div>
</div>
</div>
@ -72,6 +72,18 @@
//刷新父页面
parent.location.reload();
}
fetch(ctx +'/system/radar/list') // 替换为你的后端接口地址
.then(response => response.json())
.then(data => {
const select = document.querySelector('select[name="station"]');
data.forEach(station => {
const option = document.createElement('option');
option.value = station.id;
option.textContent = station.name;
select.appendChild(option);
});
});
</script>
</body>
</html>

View File

@ -1,7 +1,9 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.domain.entity.SysIdentifier;
import com.ruoyi.common.core.domain.entity.SysPolice;
import com.ruoyi.system.mapper.SysIdentifierMapper;
import com.ruoyi.system.mapper.SysPoliceMapper;
import com.ruoyi.system.service.ISysIdentifierService;
import com.ruoyi.system.service.IdentifierStatusService;
import org.slf4j.Logger;
@ -24,9 +26,13 @@ public class IdentifierStatusServiceImpl implements IdentifierStatusService
@Autowired
private SysIdentifierMapper identifierMapper;
@Autowired
private SysPoliceMapper sysPoliceMapper;
@Override
public List<SysIdentifier> selectIdentifierStatus() {
List<SysIdentifier> sysIdentifiers = identifierMapper.selectAllIdentifierList();
List<SysPolice> sysPolices = sysPoliceMapper.selectSysPoliceList(new SysPolice());
return sysIdentifiers;
}
}

View File

@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<select id="selectSysPoliceById" resultMap="SysPoliceResult">
select p.* from sys_police p where p.del_flag = '0'
select p.* from sys_police p where p.del_flag = '0'
and p.id = #{id}
</select>