JiangChongBo 2 lat temu
rodzic
commit
6bf1ecc0e6

+ 67 - 74
src/main/webapp/WEB-INF/views/modules/baikePage/auditBaikeProductPage.jsp

@@ -78,6 +78,7 @@
 		}
 		.content-edit .bk-literature li{
 			list-style-type: none;
+			margin-left: -190px;
 			padding: 8px 16px;
 			display: flex;
 			justify-content: space-between;
@@ -515,26 +516,27 @@
 					// })
 					var status = $("input[name='status']:checked").val();
 					// 计算空数据条数
+					debugger
 					var propertyArr = [];
 					var name = $("#name").val();
-					var alias = $("#alias").val();
-					var discription = $("#discription").val();
+					// var alias = $("#alias").val();
+					// var discription = $("#discription").val();
 					var shopId = $("#shopId").val();
-					var param0 = $('input[name="paramList[0].name"]').val();
+					// var param0 = $('input[name="paramList[0].name"]').val();
 					var seoKeyword = $("#seoKeyword").val();
 					var publishTime = $('input[name="publishTime"]').val();
 					var basePv = $("#basePv").val();
 					var typeId = $("#typeId").val();
 
 					propertyArr[0] = name;
-					propertyArr[1] = discription;
-					propertyArr[2] = param0;
-					propertyArr[3] = seoKeyword;
-					propertyArr[4] = shopId;
-					propertyArr[5] = publishTime;
-					propertyArr[6] = basePv;
-					propertyArr[7] = typeId;
-					propertyArr[8] = alias;
+					// propertyArr[1] = discription;
+					// propertyArr[1] = param0;
+					propertyArr[1] = seoKeyword;
+					propertyArr[2] = shopId;
+					propertyArr[3] = publishTime;
+					propertyArr[4] = basePv;
+					propertyArr[5] = typeId;
+					// propertyArr[8] = alias;
 					// propertyArr[9] = image;
 					// alert("1111111111111111");
 					var emptyNum = 0;
@@ -549,8 +551,8 @@
 					// 检测敏感词
 					var propertyMap = new Map();
 					propertyMap.set("name", name);
-					propertyMap.set("alias", alias);
-					propertyMap.set("discription", discription);
+					// propertyMap.set("alias", alias);
+					// propertyMap.set("discription", discription);
 					// propertyMap.set("productLink", productLink);
 					for (var i = 0; i <= 9; i++) {
 						var paramName = "\"paramList[" + i + "].name\"";
@@ -916,12 +918,12 @@
 				<div class="control-group" style="margin-left: 100px;margin-top: 30px">
 					<label class="red">*</label>
 					<label class="control-label keyClass">输入网址:</label>
-					<input id="website" style="margin-left: 45px" htmlEscape="false" class="input-xlarge " placeholder="请以http(s)开头"/>
+					<input id="website" required="true" style="margin-left: 45px" htmlEscape="false" class="input-xlarge " placeholder="请以http(s)开头"/>
 				</div>
 				<div class="control-group" style="margin-left: 100px;margin-top: 30px">
 					<label class="red">*</label>
 					<label class="control-label keyClass">文章名字:</label>
-					<input id="articleName" style="margin-left: 45px" htmlEscape="false" class="input-xlarge " placeholder="请输入文章名字"/>
+					<input id="articleName" required="true" style="margin-left: 45px" htmlEscape="false" class="input-xlarge " placeholder="请输入文章名字"/>
 				</div>
 				<div class="control-group" style="margin-left: 100px;margin-top: 30px">
 					<label class="red">*</label>
@@ -930,14 +932,12 @@
 				</div>
 				<div class="control-group" style="margin-left: 100px;margin-top: 30px">
 					<label class="control-label keyClass">发表日期:</label>
-					<input id="publishTimeStr" name="publishTime" style="margin-left: 55px" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
-						   value="<fmt:formatDate value="${cmBaikeProduct.publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
+					<input id="publishTimeStr" name="publishTimeStr" style="margin-left: 55px" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
 						   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
 				</div>
 				<div class="control-group" style="margin-left: 100px;margin-top: 30px">
 					<label class="control-label keyClass">引文日期:</label>
-					<input id="acitationTimeStr" name="publishTime" style="margin-left: 55px" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
-						   value="<fmt:formatDate value="${cmBaikeProduct.publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
+					<input id="acitationTimeStr" name="publishTimeStr" style="margin-left: 55px" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
 						   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
 				</div>
 			</div>
@@ -964,8 +964,7 @@
 				</div>
 				<div class="control-group" style="margin-left: 100px;margin-top: 30px">
 					<label class="control-label keyClass">出版年:</label>
-					<input id="publicationYearStr" name="publishTime" style="margin-left: 65px" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
-						   value="<fmt:formatDate value="${cmBaikeProduct.publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
+					<input id="publicationYearStr" name="publicationYearStr" style="margin-left: 65px" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
 						   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
 				</div>
 				<div class="control-group" style="margin-left: 100px;margin-top: 30px">
@@ -1000,6 +999,7 @@
 					</div>
 				</div>
 			</div>
+
 		</div>
 	</div>
 	<div class="form-actions">
@@ -1279,7 +1279,6 @@
 			<label id="seoKeywordSensitiveWords" class="red"></label>
 		</div>
 	</div>
-
 	<div class="control-group">
 		<label class="control-label keyClass">添加时间:</label>
 		<div class="controls">
@@ -1538,7 +1537,46 @@
 		}
 		// $('#textInfolist .controls')
 	}
+
+	function createReferenceItem(referenceData){
+		var text=null
+		if(referenceData.referenceType == 1){
+			text = 	"<div class=\"controls applicationsan\">"+
+					<%--"<span class=\"del\">[${statusIndex.index}]</span>"+--%>
+					"<span class=\"del\"><a href=\""+referenceData.website+"\" target=\"_blank\">${videoFile.articleName}(文章名称)</a></span>"+
+					"<span class=\"del\">\""+referenceData.websiteName+"\"(网站名称)</span>"+
+					"<span class=\"del\">\""+referenceData.publishTimeStr+"\"(发表日期)</span>"+
+					"<span class=\"del\">\""+referenceData.acitationTimeStr+"\"(引文日期)</span>"+
+					<%--"<a onclick=\"saveMataInfo(${videoFile.id})\">引用资料</a>"+--%>
+					"</div>"
+		}
+		if(referenceData.referenceType == 2){
+			text=		"<div class=\"controls applicationsan\">"+
+					"<span class=\"del\">\""+referenceData.author+"\"(作者)</span>"+
+					"<span class=\"del\">\""+referenceData.workName+"\"(著作名)</span>"+
+					"<span class=\"del\">\""+referenceData.publicationPlace+"\"(出版地)</span>"+
+					"<span class=\"del\">\""+referenceData.press+"\"(出版社)</span>"+
+					"<span class=\"del\">\""+referenceData.publicationYearStr+"\"(出版年)</span>"+
+					"<span class=\"del\">\""+referenceData.acitationWeb+"\"(引文页码)</span>"+
+					"</div>"
+		}
+		if(referenceData.referenceType == 3){
+			text=		"<div class=\"controls applicationsan\">"+
+					"<span class=\"del\">\""+referenceData.referenceDescription+"\"(参考资料说明)</span>"+
+					"<span class=\"del\">\""+referenceData.imageDescription+"\"(图片描述)</span>"+
+					"<div class=\"conList\">"+
+					"<img id=\"imgaa\"  src=\""+referenceData.imageUrl+"\"height=\"50px\" width=\"50px\" >(图片)</input>"+
+					"</div>"+
+					"</div>"
+		}
+		return text;
+	}
 	$(function(){
+		var refren='${cmBaikeProduct.referenceList}'
+		if(''==refren|| null==refren){
+		}else{
+			referenceList=JSON.parse(refren)
+		}
 		//初始化 义项名,词条概述
 		createContentEdit('#bk-name','${cmBaikeProduct.alias}')
 		createContentEdit('#discription','${cmBaikeProduct.discription}')
@@ -1553,55 +1591,9 @@
 			if(referenceEditTyp === 'add'){
 				markCount++
 				var result = setRefrenceData({})
-				var con=null;
-				if(result.referenceType == 1){
-					con= "<div id=\"zl\" style=\"margin-top: 10px\">"+
-							"<div class=\"control-group\" style=\"margin-left: 100px\">"+
-							"<label class=\"red\">*</label>"+
-							"<label class=\"control-label\">参考资料类型:</label>"+
-							"<select id=\"info\" style=\"margin-left: 20px\" onchange=\"ckzl_change()\">"+
-							"<option id=\"zllx1\" value=\"1\">网络资料</option>"+
-							"<option id=\"zllx2\" value=\"2\">著作资料</option>"+
-							"<option id=\"zllx3\" value=\"3\">其他资料</option>" +
-							"</select>"+
-							"</div>" +
-							"<div class=\"wlzl\" style=\"display: block\" id=\"wlzl\">"+
-							"<div class=\"control-group\" style=\"margin-left: 100px;margin-top: 30px\">"+
-							"<label class=\"red\">*</label>"+
-							"<label class=\"control-label keyClass\">输入网址:</label>" +
-							"<input id=\"website\" style=\"margin-left: 45px\" htmlEscape=\"false\" class=\"input-xlarge \" placeholder=\"请以http(s)开头\"/>" +
-							"</div>"	+
-							"</div>"+
-							"<div class=\"control-group\" style=\"margin-left: 100px;margin-top: 30px\">" +
-							"<label class=\"red\">*</label>" +
-							"<label class=\"control-label keyClass\">文章名字:</label>"+
-							"<input id=\"articleName\" style=\"margin-left: 45px\" htmlEscape=\"false\" class=\"input-xlarge \" placeholder=\"请输入文章名字\"/>"+
-							"</div>" +
-							"<div class=\"control-group\" style=\"margin-left: 100px;margin-top: 30px\">"+
-							"<label class=\"red\">*</label>"+
-							"<label class=\"control-label keyClass\">网站名称:</label>"+
-							"<input  id=\"websiteName\" style=\"margin-left: 45px\" htmlEscape=\"false\" class=\"input-xlarge \" placeholder=\"请输入网站名称 如:新华网\"/>"+
-							"</div>"+
-
-
-							<%--"<div class=\"control-group\" style=\"margin-left: 100px;margin-top: 30px\">"+--%>
-							<%--	"<label class=\"control-label keyClass\">发表日期:</label>"+--%>
-							<%--	"<input id=\"publishTimeStr\" name=\"publishTime\" style=\"margin-left: 55px\" type=\"text\" readonly=\"readonly\" maxlength=\"20\" class=\"input-medium Wdate \""+--%>
-							<%--	"value=\"<fmt:formatDate value=\"\" pattern=\"yyyy-MM-dd HH:mm:ss\"/>\" "+--%>
-							<%--	"onclick=\"WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});\"/>"+--%>
-							<%--"</div>"+--%>
-
-							<%--"<div class=\"control-group\" style=\"margin-left: 100px;margin-top: 30px\">"+--%>
-							<%--	"<label class=\"control-label keyClass\">引文日期:</label>"+--%>
-							<%--	"<input id=\"acitationTimeStr\" name=\"publishTime\" style=\"margin-left: 55px\" type=\"text\" readonly=\"readonly\" maxlength=\"20\" class=\"input-medium Wdate \" "+--%>
-							<%--	"value=\"<fmt:formatDate value=\"${cmBaikeProduct.publishTime}\" pattern=\"yyyy-MM-dd HH:mm:ss\"/>\" "+--%>
-							<%--	"onclick=\"WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});\"/>"+--%>
-							<%--"</div>"+--%>
-							"</div>"
-				}
-				result.ctrlId = currentContentEdit.confirm('<span>这是资料名称</span>.<span>这是资料来源</span>')
+				var con=createReferenceItem(result)
+				result.ctrlId = currentContentEdit.confirm(con)
 				referenceList.push(result)
-				console.log(referenceList);
 				$(this).parents('#dig').hide()
 				initRefrenceFormData({})
 			}else{
@@ -1620,8 +1612,8 @@
 			$(this).parents('#dig').hide()
 			initRefrenceFormData({})
 		})
-		var referenceList = [{ctrlId: 'FDIEKABKKNJEEJAN'}]
-		console.log('${cmBaikeProduct.materialInfo}')
+		<%-- referenceList = [{ctrlId: 'FDIEKABKKNJEEJAN'}] // referenceList[0].reyt = 1 // referenceList:'[{"type": 1}]'--%>
+		<%--console.log('${cmBaikeProduct.materialInfo}')--%>
 		// 初始化编辑框引用资料列表
 		contentEditMap.forEach(function(item){
 			item.edit.ctridList.forEach(function(ctrlId){
@@ -1629,7 +1621,9 @@
 					return ref.ctrlId == ctrlId
 				})
 				if(!data) return
-				var text = '111111'
+				<%--				<c:forEach items="${cmBaikeProduct.materialInfo}" var="videoFile" varStatus="statusIndex">--%>
+				<%--				</c:forEach>--%>
+				var text = createReferenceItem(data)
 				item.addLiteratureItem(ctrlId, text)
 			})
 		})
@@ -1643,7 +1637,6 @@
 	$(function () {
 		$('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
 		$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
-		$('.upload-content .conList').find('.cancel-upload').hide();
 		var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
 		var MutationObserverConfig = {
 			childList: true,