<div style="padding-top: 40px; font-size:28px; font-weight: bold;">会社一覧 ({% _m.message %})</div>
<div>
	<table border="2" style="border-collapse: collapse; border-color: blue">
		<tr>
			<th width="100px;">会社id</th>
			<th width="300px;">会社名</th>
			<th width="600px;">住所</th>
			<th>操作</th>
		</tr>
		<tr d7="for(let idx in _m.companyList) let row = _m.companyList[idx];">
			<td style="text-align:center;">{% row.id %}</td>
			<td>{% row.name %}</td>
			<td>{% row.address %}</td>
			<td><button style="margin: 2px 10px;" onclick="clickDetail(idx)">詳細</button></td>
		</tr>
	</table>
<div>
<script>
_m.message = query.message || '_NONE_';

const init = async () => {
	let response = await app.api.get('/company');
	_m.companyList = response.companyList;
}

const clickDetail = (idx) => {
	let company = _m.companyList[idx];
	app.route('group', {companyId: company.id});
	return false;
}
</script>
