<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('移动/复制')" />
	<link th:href="@{/css/use/css1.css}" rel="stylesheet"/>
	<link th:href="@{/ruoyi/css/address.css}" rel="stylesheet"/>
	<th:block th:include="include :: bootstrap-duallistbox-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<!--    <ul class="nav head_top" id="tab">-->
	<!--        <div class="text-right hidden-print" style="float: right">-->
	<!--            <button class="btn btn-unite" onclick="submitHandler()">保存</button>-->
	<!--        </div>-->
	<!--    </ul>-->

	<form class="form-group" id="form-group">
		<input hidden type="text" name="addressIds" id="addressIds" th:value="${addressIds}">
		<input hidden type="text" name="byGroupId" id="byGroupId" th:value="${byGroupId}">
		<input hidden type="text" name="groupIds" id="groupIds" >
		<div class="col-md-12">
			<div class="col-md-3">
				<div id="groups" class="group-list">
					<ul>
						<li class="click" th:onclick="setgroupids([[${item.id}]],this)"   th:if="${groups != null}" th:each="item : ${groups}">
							<div>[[${item.groupName}]]</div>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
	var prefix = ctx + "system/addressbook";
	let groupids = "";

	function setgroupids(id,object) {
		groupids=id;
		$('.click-bg').removeClass("click-bg");
		object.classList.add("click-bg");
	}

	function hasClass (ele, className) {
		var reg = new RegExp('(^|\\s)' + className + '(\\s|$)')
		return reg.test(ele.className)
	}

	function submitHandler() {
		if (groupids.length==0){
			$.modal.alertWarning("请选择组名再提交！");
			return;
		}else {
			$('#groupIds').val(groupids.toString());
			$.operate.update(prefix + "/address/move", $('#form-group').serialize());
		}
	}

</script>
</body>
</html>