|
@@ -880,68 +880,32 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- // top.$.jBox.tip('删除成功', 'success');
|
|
|
- // window.location.reload();
|
|
|
- return;
|
|
|
- },{buttonsFocus:1,persistent: true});
|
|
|
- }
|
|
|
- //编辑资料
|
|
|
- function upMaterial(mid){
|
|
|
- if (mid==null){
|
|
|
- return
|
|
|
- }
|
|
|
- $.ajax({
|
|
|
- url : "${ctx}/baike/cmBaikeProduct/getMaterialinfo",
|
|
|
- data : {"mid":mid},
|
|
|
- type : 'post',
|
|
|
- success : function(data){
|
|
|
- $("#info").val(data.referenceType);
|
|
|
- var content=$("#info").val();
|
|
|
- // $("#info option[value='3']").prop("selected",true);
|
|
|
- if(2 == content){
|
|
|
- document.getElementById("wlzl").style.display='none';
|
|
|
- document.getElementById("zzzl").style.display='block';
|
|
|
- document.getElementById("qtzl").style.display='none';
|
|
|
- }else if(3 == content){
|
|
|
- document.getElementById("wlzl").style.display='none';
|
|
|
- document.getElementById("zzzl").style.display='none';
|
|
|
- document.getElementById("qtzl").style.display='block';
|
|
|
- }else{
|
|
|
- document.getElementById("wlzl").style.display='block';
|
|
|
- document.getElementById("zzzl").style.display='none';
|
|
|
- document.getElementById("qtzl").style.display='none';
|
|
|
- }
|
|
|
- //判断是编辑还是添加 1添加 2编辑
|
|
|
- if(data.referenceType==1){
|
|
|
- $("#website").val(data.website);
|
|
|
- $("#articleName").val(data.articleName);
|
|
|
- $("#websiteName").val(data.websiteName);
|
|
|
- $("#publishTimeStr").val(data.publishTimeStr);
|
|
|
- $("#acitationTimeStr").val(data.acitationTimeStr);
|
|
|
- document.getElementById("dig").style.display='block';
|
|
|
- }
|
|
|
- if(data.referenceType==2){
|
|
|
- $("#author").val(data.author);
|
|
|
- $("#workName").val(data.workName);
|
|
|
- $("#publicationPlace").val(data.publicationPlace);
|
|
|
- $("#press").val(data.press);
|
|
|
- $("#publicationYearStr").val(data.publicationYearStr);
|
|
|
- $("#acitationWeb").val(data.acitationWeb);
|
|
|
- document.getElementById("dig").style.display='block';
|
|
|
- }
|
|
|
- document.getElementById("dig").tabIndex=2;
|
|
|
- document.getElementById("dig").lang=mid;
|
|
|
- },
|
|
|
- error : function(){
|
|
|
- alert(222);
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- </script>
|
|
|
+ // top.$.jBox.tip('删除成功', 'success');
|
|
|
+ // window.location.reload();
|
|
|
+ return;
|
|
|
+ }, {buttonsFocus: 1, persistent: true});
|
|
|
+ }
|
|
|
+
|
|
|
+ //编辑资料
|
|
|
+ function upMaterial(mid) {
|
|
|
+ if (mid == null) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 编辑
|
|
|
+ referenceEditTyp = 'edit'
|
|
|
+ referenceData = referenceList.find(function (item) {
|
|
|
+ return item.id == mid
|
|
|
+ })
|
|
|
+ if (!referenceData) return
|
|
|
+ initRefrenceFormData(referenceData)
|
|
|
+ $('#dialogmask').fadeIn()
|
|
|
+ $('#dig').fadeIn()
|
|
|
+ }
|
|
|
+ </script>
|
|
|
</head>
|
|
|
<body>
|
|
|
- <ul class="nav nav-tabs">
|
|
|
- <li><a href="${ctx}/baike/cmBaikeProduct/?commodityType=${cmBaikeProduct.commodityType}&publishSource=1">采美词条</a></li>
|
|
|
+<ul class="nav nav-tabs">
|
|
|
+ <li><a href="${ctx}/baike/cmBaikeProduct/?commodityType=${cmBaikeProduct.commodityType}&publishSource=1">采美词条</a></li>
|
|
|
<li class="active"><a id="createEntryGuidance" href="${ctx}/baike/cmBaikeProduct/form?id=${cmBaikeProduct.id}&commodityType=${cmBaikeProduct.commodityType}">${not empty cmBaikeProduct.id?'编辑':'添加'}</a></li>
|
|
|
</ul><br/>
|
|
|
<%-- <div>--%>
|
|
@@ -1498,26 +1462,29 @@
|
|
|
var referenceEditTyp = 'add'
|
|
|
// 引用资料列表
|
|
|
var referenceList = []
|
|
|
- // 资料标记数量
|
|
|
- var markCount = referenceList.length || 1
|
|
|
- // 正文列表
|
|
|
- var textInfoList = [{}]
|
|
|
- var textInfoItemIndex = 0
|
|
|
- // 信息栏列表
|
|
|
- var paramList = [{}]
|
|
|
- var paramItemIndex = 0
|
|
|
- // 创建内容编辑器
|
|
|
- function createContentEdit(el, value) {
|
|
|
- const contentEdit = new ContentEditInput({
|
|
|
- el: el,
|
|
|
- initValue: value,
|
|
|
- toolbarClick(edit) {
|
|
|
- // 添加
|
|
|
- referenceEditTyp = 'add'
|
|
|
- currentContentEdit = edit
|
|
|
- console.log(currentContentEdit)
|
|
|
- createReferenceList()
|
|
|
- $('#dialogmask').fadeIn()
|
|
|
+ // 资料标记数量
|
|
|
+ var markCount = referenceList.length || 1
|
|
|
+ // 正文列表
|
|
|
+ var textInfoList = [{}]
|
|
|
+ var textInfoItemIndex = 0
|
|
|
+ // 信息栏列表
|
|
|
+ var paramList = [{}]
|
|
|
+ var paramItemIndex = 0
|
|
|
+
|
|
|
+ // 创建内容编辑器
|
|
|
+ function createContentEdit(el, value) {
|
|
|
+ console.log("referenceList====================================================")
|
|
|
+ console.log(referenceList)
|
|
|
+ const contentEdit = new ContentEditInput({
|
|
|
+ el: el,
|
|
|
+ initValue: value,
|
|
|
+ toolbarClick(edit) {
|
|
|
+ // 添加
|
|
|
+ referenceEditTyp = 'add'
|
|
|
+ currentContentEdit = edit
|
|
|
+ console.log(currentContentEdit)
|
|
|
+ createReferenceList()
|
|
|
+ $('#dialogmask').fadeIn()
|
|
|
$('#dig').fadeIn()
|
|
|
},
|
|
|
referenceEdit(ctrid) {
|
|
@@ -1804,20 +1771,22 @@
|
|
|
var item = createReferenceItem(refData)
|
|
|
$('.check-reference-list').append(item)
|
|
|
})
|
|
|
- $('.check-reference-list').find('.controls').on('click', function(){
|
|
|
- var index = $(this).index() + 1
|
|
|
- var result = referenceList[$(this).index()]
|
|
|
- console.log(result)
|
|
|
- if(!result) return
|
|
|
- var con= createReferenceItem(result)
|
|
|
- result.ctrlId = currentContentEdit.confirm(con, result.ctrlId, index)
|
|
|
- $('#dialogmask').fadeOut()
|
|
|
- $('#dig').fadeOut()
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- $(function(){
|
|
|
- var cccc='${SearchFrequencyVo}';
|
|
|
+ $('.check-reference-list').find('.controls').on('click', function () {
|
|
|
+ var index = $(this).index() + 1
|
|
|
+ var result = referenceList[$(this).index()]
|
|
|
+ console.log(result)
|
|
|
+ if (!result) return
|
|
|
+ var con = createReferenceItem(result)
|
|
|
+ result.ctrlId = currentContentEdit.confirm(con, result.ctrlId, index)
|
|
|
+ $('#dialogmask').fadeOut()
|
|
|
+ $('#dig').fadeOut()
|
|
|
+ })
|
|
|
+ console.log("referenceList")
|
|
|
+ console.log(referenceList)
|
|
|
+ }
|
|
|
+
|
|
|
+ $(function () {
|
|
|
+ var cccc = '${SearchFrequencyVo}';
|
|
|
console.log(cccc);
|
|
|
var labelSelectBox = $('#labelSelectBox');
|
|
|
labelSelectBox.selectpicker({
|
|
@@ -1854,29 +1823,28 @@
|
|
|
if(referenceEditTyp === 'add'){
|
|
|
markCount++
|
|
|
var result = setRefrenceData({})
|
|
|
- var con=createReferenceItem(result)
|
|
|
- result.ctrlId = currentContentEdit.confirm(con)
|
|
|
- referenceList.push(result)
|
|
|
- $(this).parents('#dig').siblings('#dialogmask').fadeOut()
|
|
|
- $(this).parents('#dig').fadeOut()
|
|
|
- initRefrenceFormData({})
|
|
|
- var item = createAllReferenceItem(result)
|
|
|
- $('.bk-reference-list').append(item)
|
|
|
- }else{
|
|
|
- var result = setRefrenceData(referenceData)
|
|
|
- const index = referenceList.findIndex(function(item){
|
|
|
- return item.ctrlId == referenceData.ctrlId
|
|
|
- })
|
|
|
- referenceList.splice(index, 1, result)
|
|
|
- $(this).parents('#dig').siblings('#dialogmask').fadeOut()
|
|
|
- $(this).parents('#dig').fadeOut()
|
|
|
- initRefrenceFormData({})
|
|
|
- }
|
|
|
- var referen=JSON.stringify(referenceList)
|
|
|
- $('#referenceList').val(referen);
|
|
|
- })
|
|
|
- $('#dig .cancel').on('click', function(){
|
|
|
- $(this).parents('#dig').fadeOut()
|
|
|
+ var con = createReferenceItem(result)
|
|
|
+ result.ctrlId = currentContentEdit.confirm(con)
|
|
|
+ referenceList.push(result)
|
|
|
+ $(this).parents('#dig').siblings('#dialogmask').fadeOut()
|
|
|
+ $(this).parents('#dig').fadeOut()
|
|
|
+ initRefrenceFormData({})
|
|
|
+ var item = createAllReferenceItem(result)
|
|
|
+ $('.bk-reference-list').append(item)
|
|
|
+ } else {
|
|
|
+ var result = setRefrenceData(referenceData)
|
|
|
+ console.log(result)
|
|
|
+ const index = referenceList.findIndex((item) => item.ctrlId == referenceData.ctrlId)
|
|
|
+ referenceList.splice(index, 1, result)
|
|
|
+ $(this).parents('#dig').siblings('#dialogmask').fadeOut()
|
|
|
+ $(this).parents('#dig').fadeOut()
|
|
|
+ initRefrenceFormData({})
|
|
|
+ }
|
|
|
+ var referen = JSON.stringify(referenceList)
|
|
|
+ $('#referenceList').val(referen);
|
|
|
+ })
|
|
|
+ $('#dig .cancel').on('click', function () {
|
|
|
+ $(this).parents('#dig').fadeOut()
|
|
|
$(this).parents('#dig').siblings('#dialogmask').fadeOut()
|
|
|
initRefrenceFormData({})
|
|
|
})
|