<%@page import="com.dgt.graphdemo.utils.SysUser"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp" %>
<!--标记-->
<div class="backg" style="display:none;" id="markStatus">
	<div class="filterType" style="height: 395px;">
		<p class="filter_title overflowEllipsis"><span class="filter_titleCon"></span><span class="filter_people"></span></p>
		<div class="options markCon" data-choose="">
		    <span class="" data-type="10">正常</span>
			<span data-type="11" class="suspicious">可疑</span>
			<!-- <span data-type="12">欺诈</span> -->
		</div>
		<div style="display:none;">
			<label class="label1"></label><label class="label2"></label>
		</div>
		<div style="overflow:hidden;position:relative;">
			<div class="optFor agencyShow" hidden>
				<div style="overflow:hidden;">
					<span class="optForSpan agencySelect" id="agencySelect2">
						<span>
							<input type="radio" name="2" value="0" checked="checked" data-key="jg">
							<label>机构</label>
						</span>
						<span>
							<input type="radio" name="2" value="1" data-key="gr">
							<label>个人</label>
						</span>
					</span>						
				</div>
				<div style="overflow:hidden;margin-top:5px;" id="nameShow2">
					<span class="optForSpan">系列案名称:</span>
					<!-- <span class="star" style="position:absolute;top:30px;left: 30%;display:none;"></span> -->
					<textarea class="input_txt mark_custom" id="customName2" data-isnew="true" data-flag="0" placeholder="请输入系列案名称(如:xxx维修厂20180101xxx案)" style="width:73%;height:30px;font-size: 14px;margin-left: 1em;"></textarea>
					<!-- <input class="input_txt mark_custom" id="customName2" data-isnew="true" data-flag="0" type="text" placeholder="请输入系列案名称(如:xxx维修厂20180101xxx案)" style="width:73%;margin-left: 1em;"> -->
				</div>
			</div>
			<div class="optFor">
				<span class="optForSpan">标注描述:</span>
				<span class="star" style="position:absolute;top:0px;left: 8em;display:none;"></span>
				<textarea id="markReason" class="markRe" placeholder="请输入需要标注的内容,最多不超过2000字" maxlength="2000" style="width:73%;margin-left: 1.8em;height: 190px;"></textarea>
				<p class="djMoney" hidden><label>打假检出金额:</label><input type="number" style="width:75%;margin-left:5px;"></p>
			</div>
			<ul class="newUl" style="position:absolute;background-color:#337ab7;top:56px;left:7.3em;max-height: 140px;border:none;" hidden></ul>
		</div>
		<div class="confirmBtn">
			<input type="button" class="confirm_btn" value="确定">
			<input type="button" class="btn delete_btn" value="取消">
		</div>
	</div>
</div>

<!--框选标注-->
<div class="backg" id="selectLabel2" style="display:none">
	<div class="filterType" style="width: 750px;height: 395px;">
		<p class="filter_title overflowEllipsis">框选标注</p>
		
			<div class="options markCon" data-choose="0">
			    <span class="" data-type="10">正常</span>
				<span data-type="11" class="suspicious">可疑</span>
				<!-- <span data-type="12">欺诈</span> -->
			</div>
		<div style="overflow:hidden">
			<div style="float: left;width:45%;">
				
				<div style="display:none;">
					<label class="label1"></label><label class="label2"></label>
				</div>
				<div class="optFor" style="position:relative;">
					<div style="overflow:hidden;" class="agencyShow" hidden>
						<span class="optForSpan agencySelect" id="agencySelect">
							<span>
								<input type="radio" name="1" value="0" checked="checked" data-key="jg">
								<label>机构</label>
							</span>
							<span>
								<input type="radio" name="1" value="1" data-key="gr">
								<label>个人</label>
							</span>
						</span>						
					</div>
					<div style="overflow:hidden;margin-top:5px;" id="nameShow" class="agencyShow" hidden>
						<span class="optForSpan">系列案名称:</span>
						<!-- <span class="star" style="position:absolute;top:30px;left: 30%;display:none;"></span> -->
						<textarea class="input_txt mark_custom" id="customName" data-isnew="true" data-flag="0" placeholder="请输入系列案名称(如:xxx维修厂20180101xxx案)" style="width:56%;height:30px;margin-left: 0.1em;"></textarea>
						<!-- <input class="input_txt mark_custom" id="customName" data-isnew="true" data-flag="0" type="text" placeholder="xxx维修厂20180101xxx案" style="width:56%;height:30px;margin-left: 0em;"> -->
					</div>
					<!-- <div style="overflow:hidden;margin-top:5px;margin-left:1em;" class="nameShow gr"  hidden>
						<span class="optForSpan">人员姓名:</span>
						<span class="star" style="position:absolute;top:30px;left: 30%;display:none;"></span>
						<input class="input_txt" id="renName" type="text" placeholder="请输入系列案名称" style="">
					</div> -->
					<div style="overflow:hidden;margin-top:5px;">
						<span class="optForSpan">标注描述:</span>
						<span class="star" style="position:absolute;top:86px;left: 30%;display:none;"></span>
						<textarea id="markReason2" class="markRe" placeholder="请输入需要标注的内容,最多不超过2000字" maxlength="2000" style="height: 170px;width:56%;margin-left: 1em;"></textarea>	
					</div>	
					<ul class="newUl" style="position:absolute;background-color:#337ab7;top:56px;left:6.3em;max-height: 140px;border:none;" hidden></ul>		
				</div>
			</div>
			<div class="selectedTab2" style="float: left;">
				<table id="selectedTabCon2" style="position: relative;height: 220px;display: block;">
					<tr data-id="12">
						<td>12</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="confirmBtn" style="margin-top: 10px;">
			<input type="button" class="confirm_btn" value="确定">
			<input type="button" class="btn delete_btn" value="取消">
		</div>
	</div>
</div>

<script>
	(function(){
		/*联想查询,2018-04-02*/
		$(".mark_custom").bind("keyup",function(){
			var flag=$(this).data("flag");//1是个人，0是机构
			if($(this).data("flag")=="1"){
				return;
			}
			
			var inp=$(this);
			inp.data("isnew",true);
			obj=inp.val();
			if(obj.trim()!=""){
				/*var k=event.keyCode;
				if(k==32 || (k<=57&&k>=48) || (k<=105&&k>=96) || k==8){*/
					//请求数据
					$.ajax({
						type:"POST",
						url:urlPath+"/graph/searchSeriesCaseName.do",
						data:{keywords:obj,flag:flag},
						success:function(result){
							$(".newUl").html("");
							if(typeof(result)=="string"){
								var result=JSON.parse(result); //字符串转json
							}
							if(result.caseNames.length>0){
								var str='';
								for(var k=0;k<result.caseNames.length;k++){
									str+='<li>'+result.caseNames[k]+'<li>';
								}
								$(".newUl").html(str);
								$(".newUl").show();
								$(".newUl").css("width",inp.width()+20+'px');
								$(".newUl").perfectScrollbar();
								$(".newUl").scrollTop(0);
							}
						},
						error:function(){

						}
					});
				//}
			}else{
				$(".newUl").html("");
				$(".newUl").hide();
			}
		});
	 	$(".newUl").delegate("li","click",function(){
	 		$(".mark_custom").data("isnew",false);
	 		$(".mark_custom").val($(this).text());
	 		$(".newUl").hide();
	 	});
	 	$("body").bind("click",function(){
	 		$(".newUl").hide();
	 	});

	 	//点击机构和个人是切换选择，2018-04-13
		$("#agencySelect2").delegate("span input","click",function(){
			$("#customName2").val("");
			var key = $("#agencySelect2 span input:checked").data("key");
			var jgName=[{"key":"jg","name":"系列案名称","left":"1em","flag":"0"},{"key":"gr","name":"人员姓名","left":"2em","flag":"1"}];
			for(var i=0;i<jgName.length;i++){
				if(jgName[i].key==key){
					$("#nameShow2 .optForSpan").text(jgName[i].name+":");
					if(key=="jg"){
						$("#customName2").attr("placeholder","请输入"+jgName[i].name+"(如:xxx维修厂20180101xxx案)");
					}else{
						$("#customName2").attr("placeholder","请输入"+jgName[i].name+"");
					}
					
					$("#customName2").css("margin-left",jgName[i].left);
					$("#customName2").data("flag",jgName[i].flag);
				}
			}
		})

		//框选标注时，点击机构和个人是切换选择，2018-04-13
		$("#agencySelect").delegate("span input","click",function(){
			$("#customName").val("");
			var key = $("#agencySelect span input:checked").data("key");			
			var jgName=[{"key":"jg","name":"系列案名称","left":"0.1em","flag":"0"},{"key":"gr","name":"人员姓名","left":"1em","flag":"1"}];
			for(var i=0;i<jgName.length;i++){
				if(jgName[i].key==key){
					$("#nameShow .optForSpan").text(jgName[i].name+":");
					if(key=="jg"){
						$("#customName").attr("placeholder","xxx维修厂20180101xxx案");
					}else{
						$("#customName").attr("placeholder","请输入"+jgName[i].name+"");
					}
					$("#customName").css("margin-left",jgName[i].left);
					$("#customName").data("flag",jgName[i].flag);
				}
			}
		})
		
	})();
</script>