12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129 |
- <%@ page import="com.thinkgem.jeesite.common.config.Global" %>
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
- <html>
- <head>
- <title>采美词条</title>
- <meta name="decorator" content="default"/>
- <style>
- .applicationsan{
- user-select: none;
- cursor: pointer;
- }
- .controls{
- width: 520px;
- }
- .controls.not-overflow{
- overflow: initial !important;
- }
- .content-edit{
- position: relative;
- width: 100%;
- z-index: 999;
- }
- .content-edit .bk-input{
- padding: 4px 6px;
- font-size: 14px;
- line-height: 20px;
- color: #555;
- border-radius: 4px;
- background-color: #fff;
- border: 1px solid #ccc
- }
- .content-edit .bk-input img.scapegoat{
- width: 16px;
- height: 16px;
- vertical-align: -3px;
- }
- .content-edit .bk-toolbar{
- position: absolute;
- padding: 6px 12px;
- border: 1px solid #f1f1f1;
- left: 0;
- top: 0;
- transform: translateY(-100%);
- font-size: 14px;
- text-align: center;
- background: #fff;
- color: #999;
- cursor: pointer;
- display: none;
- }
- .content-edit .bk-bubble{
- font-size: 14px;
- padding: 0 4px;
- line-height: 18px;
- border-radius: 12px;
- position: absolute;
- right: 0;
- top: 0;
- transform: translate(50%, -50%);
- background: #ddd;
- color: #fff;
- box-sizing: border-box;
- min-width: 18px;
- text-align: center;
- display: none;
- cursor: pointer;
- }
- .content-edit .bk-literature{
- position: absolute;
- bottom: 0;
- left: 0;
- transform: translateY(100%);
- background: #fff;
- border: 1px solid #ddd;
- padding: 0;
- margin: 0;
- width: 100%;
- box-sizing: border-box;
- display: none;
- }
- .content-edit .bk-literature li{
- list-style-type: none;
- padding: 8px 16px;
- display: flex;
- justify-content: space-between;
- z-index: 200;
- }
- .content-edit .bk-literature li .controls{
- margin-left: initial;
- width: inherit;
- }
- .content-edit .bk-literature .bk-control{
- max-width: 80%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .content-edit .bk-literature .bk-control span{
- cursor: pointer;
- }
- .content-edit .bk-literature .bk-control span:hover{
- text-decoration: underline;
- }
- .content-edit .bk-literature .bk-literature-control span{
- margin-left: 12px;
- cursor: pointer;
- color: #2fa4e7;
- }
- .bk-textInfo-item{
- position: relative;
- display: flex;
- align-items: center;
- margin-bottom: 16px;
- }
- .bk-textInfo-item input{
- display: block;
- width: 100%;
- }
- .bk-textInfo-item .bk-textInfo-control{
- flex: 1;
- display: flex;
- flex-wrap: nowrap;
- column-gap: 8px;
- margin-left: 16px;
- position: absolute;
- right: 0;
- top: 5px;
- transform: translateX(105%);
- }
- .bk-textInfo-item .bk-textInfo-control span{
- font-size: 12px;
- text-decoration: underline;
- white-space: nowrap;
- cursor: pointer;
- color:#2fa4e7;
- }
- .paramList{
- position: relative;
- }
- .paramList .param-item{
- display: flex;
- align-items: center;
- column-gap: 16px;
- position: relative;
- margin-bottom: 16px;
- }
- .paramList .param-name input{
- display: block;
- width: initial;
- }
- .paramList .param-name{
- width: 30%;
- }
- .paramList .param-content{
- flex: 1;
- }
- .paramList a{
- position: absolute;
- right: 0;
- top: 10%;
- transform: translateX(130%);
- }
- .paramList .control-group{
- position: relative;
- }
- .paramList .add-button{
- margin-bottom: 16px;
- }
- .controls .conList{
- display: inline-block;
- margin-right: 15px;
- }
- .conList .btn:nth-of-type(1){
- margin-left: 25px;
- }
- .select2-choice{
- width: 100px;
- }
- .upload-content {
- float: left;
- margin-top: -100px;
- margin-right: -40px;
- }
- .upload-content .conList .btn:nth-of-type(1) {
- width: 90px;
- height: 100px;
- border: 2px solid #eee;
- background: #fff;
- position: relative;
- }
- .upload-content .conList .btn:nth-of-type(1)>div {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- color: #666;
- }
- .upload-content .conList .btn:nth-of-type(1) span {
- font-size: 35px;
- }
- .upload-content .conList .btn:nth-of-type(1) h5 {
- color: #666;
- }
- .cancel-upload {
- background: transparent;
- border: none;
- box-shadow: none;
- position: relative;
- top: -38px;
- left: -25px;
- cursor: pointer;
- z-index: 100;
- }
- .upload-content .conList ol li {
- width: 114px;
- min-height: 80px;
- text-align: center;
- background: #fff;
- position: relative;
- top: 120px;
- margin-left: 2px;
- height: 100px;
- display: flex;
- justify-content: center;
- align-items: center;
- box-sizing: border-box;
- }
- .hide-pic {
- display: none !important;
- }
- .upload-image-list{
- width: 660px;
- float: left;
- }
- .iconBox{
- font-size: 0;
- }
- .controls .conList{
- display: inline-block;
- margin-right: 15px;
- }
- .conList .btn:nth-of-type(1){
- margin-left: 25px;
- }
- .select2-choice{
- width: 100px;
- }
- .upload-content {
- float: left;
- margin-top: -70px;
- margin-left: 20px !important;
- }
- .upload-content .conList .btn:nth-of-type(1) {
- width: 90px;
- height: 100px;
- border: 2px solid #eee;
- background: #fff;
- position: relative;
- }
- .upload-content .conList .btn:nth-of-type(1)>div {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- color: #666;
- }
- .upload-content .conList .btn:nth-of-type(1) span {
- font-size: 35px;
- }
- .upload-content .conList .btn:nth-of-type(1) h5 {
- color: #666;
- }
- .cancel-upload {
- background: transparent;
- border: none;
- box-shadow: none;
- position: relative;
- top: -38px;
- left: -25px;
- cursor: pointer;
- z-index: 100;
- }
- .display-image-list .cancel-upload{
- top: -106px;
- left: 114px;
- }
- .display-image-list .conList{
- position: relative;
- }
- .hide-pic {
- display: none !important;
- }
- .select2-choice{
- width: 200px
- }
- .red {
- color: red;
- }
- .upload {
- position: relative;
- display: inline-block;
- background: #D0EEFF;
- border: 1px solid #99D3F5;
- border-radius: 4px;
- padding: 4px 12px;
- color: #1E88C7;
- text-decoration: none;
- text-indent: 0;
- line-height: 20px;
- margin-left: 20px;
- cursor: pointer;
- width: 52px;
- height: 20px;
- }
- .upload input {
- position: absolute;
- width: 170px;
- font-size: 20px;
- right: 0;
- top: 0;
- opacity: 0;
- cursor: pointer;
- }
- .upload:hover {
- background: #AADFFD;
- border-color: #78C3F3;
- color: #004974;
- text-decoration: none;
- }
- .add-submit {
- position: relative;
- display: inline;
- background: #D0EEFF;
- border: 1px solid #99D3F5;
- border-radius: 4px;
- padding: 4px 12px;
- color: #1E88C7;
- text-decoration: none;
- text-indent: 0;
- line-height: 20px;
- margin-left: 20px;
- cursor: pointer;
- width: 52px;
- height: 30px;
- }
- .add-submit input {
- position: absolute;
- width: 50px;
- font-size: 20px;
- right: 0;
- top: 0;
- opacity: 0;
- cursor: pointer;
- }
- .add-submit:hover {
- background: #AADFFD;
- border-color: #78C3F3;
- color: #004974;
- text-decoration: none;
- }
- .upload-loading{
- display: none;
- width: 32px;
- height: 32px;
- margin-left: 10px;
- }
- .upload-loading img{
- width: 16px;
- height: 16px;
- margin: 0 auto 0;
- }
- #file-list-display {
- width: 600px;
- height: auto;
- float: left;
- margin-left: 20px;
- }
- #file-list-display p {
- line-height: 30px;
- font-size: 14px;
- color: #333333;
- margin: 0;
- }
- #file-list-display p .del {
- color: #2fa4e7;
- font-size: 12px;
- cursor: pointer;
- margin-left: 20px;
- }
- .Main-content{
- height: 100px;
- }
- .dialogmask {
- position: fixed;
- top: 0px;
- height: 100%;
- width: 100%;
- z-index: 1000;
- display: none;
- }
- .opacity { /*遮罩浑浊处理*/
- opacity: 0.3;
- filter: alpha(opacity=30);
- background-color: #000;
- }
- .box {
- overflow: hidden;
- position: fixed;
- width: 55%;
- height: 60%;
- z-index: 1005; /*值越大,和其他层层叠时越在上面*/
- left: 20%;
- top: 15%;
- background-color: #fff;
- border: 1px solid rgb(0, 153, 153);
- }
- .ckzl {
- overflow: hidden;
- position: fixed;
- width: 600px;
- max-height: 600px;
- z-index: 1000; /*值越大,和其他层层叠时越在上面*/
- left: 50%;
- top: 50%;
- background-color: #fff;
- transform: translate(-50%, -50%);
- padding: 32px;
- border: 1px solid #ddd;
- }
- .ckzl .digcontent .dig-tab{
- display: flex;
- align-items: center;
- padding-bottom: 24px;
- }
- .ckzl .digcontent .dig-tab a{
- margin-right: 16px;
- }
- .ckzl .digcontent .control-group{
- margin-left: 0 !important;
- margin-top: 12px;
- }
- .ckzl .form-actions{
- display: flex;
- align-items: center;
- background: transparent;
- padding: 0;
- padding-top: 20px;
- background-color: transparent;
- margin-bottom: 0;
- border-top: 1px solid #e5e5e5
- }
- .ckzl .form-actions button{
- margin-left: 16px;
- }
- .ckzl .auth-qrCode-list{
- margin-top: -60px;
- margin-left: 30px;
- }
- .ckzl .bk-upload-tip{
- margin-left: 24px;
- margin-top: 16px;
- font-size: 12px;
- color: #999;
- }
- .ckzl .bk-input-tip{
- margin-left: 100px;
- font-size: 12px;
- color: #999;
- }
- .dialogtitle {
- width: 100%;
- height: 30px;
- line-height: 30px;
- position: absolute;
- font-size: 18px;
- top: 0px;
- background-color: lightgrey;
- }
- .dialogcontent {
- padding-top: 20px;
- OVERFLOW: scroll;
- height: calc(100% - 20px);
- height: -webkit-calc(100% - 20px);
- margin-left: 30px;
- }
- .logcontent {
- padding: 10px;
- }
- .pla::-webkit-input-placeholder{
- color: green;
- }
- #mainIgeBox{
- margin-top: -174px;
- margin-left: 0 !important;
- }
- #mainIgeBox label{
- margin-left: 27px !important;
- margin-top: 14px;
- }
- .video{
- margin-left: 95px;
- margin-top: 80px;
- }
- </style>
- <script type="text/javascript">
- //显示弹框,并且根据结果是true或false来更改标题部分的颜色
- function showlog_result(result, info) {//展示具体弹框内容,以及根据结果是否正确变更title的颜色
- $("#dialog").css({display: "block"});//通过Jquery的css()更改样式
- $("#dialogmask").css({display: "block"});
- // var s=document.getElementById("logcontent").innerHTML;
- // $("#logcontent").html(s);
- }
- //关闭弹窗
- function dialog(){
- document.getElementById("dialog").style.display='none';
- document.getElementById("dialogmask").style.display='none';
- }
- //显示资料弹窗
- function digCk(type){
- document.getElementById("dig").style.display='block';
- document.getElementById("dig").title=type;
- }
- //隐藏资料弹窗
- function cantral(){
- document.getElementById("dig").style.display='none';
- }
- //添加资料
- function addZl(){
- document.getElementById("zl").style.display='block';
- document.getElementById("yyzl").style.display='none';
- document.getElementById("confimRefrence").style.display='block';
- }
- function removeZl(){
- document.getElementById("zl").style.display='none';
- document.getElementById("yyzl").style.display='block';
- document.getElementById("confimRefrence").style.display='none';
- }
- //不同资料显示不同的内容
- function ckzl_change(){
- var content=$("#info").val();
- 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';
- }
- }
- //信息栏只读设置
- function readflag(index){
- var info=document.getElementById("name["+index+"]").value;
- //标题为空则内容只读
- if(undefined != info && null!=info && '' !=info){
- document.getElementById("content["+index+"]").readOnly=false;
- }else{
- document.getElementById("content["+index+"]").readOnly=true;
- }
- }
- $(document).ready(function() {
- var flag=document.getElementById("createEntryGuidance").innerHTML;
- if('添加'==flag){
- showlog_result(null,null);
- }
- $("#inputForm").validate({
- submitHandler: function(form){
- // $('.xxl-name').each(function (index, item) {
- // $(item).attr('name', 'paramList['+ index +'].name')
- // })
- var status = $("input[name='status']:checked").val();
- // 计算空数据条数
- debugger
- var propertyArr = [];
- var name = $("#name").val();
- // var alias = $("#alias").val();
- // var discription = $("#discription").val();
- var shopId = $("#shopId").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[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;
- for (var i = 0; i < propertyArr.length; i++) {
- var property = propertyArr[i].trim();
- if ("" === property) {
- emptyNum++;
- }
- }
- $("#emptyNum").val(emptyNum);
- // 检测敏感词
- var propertyMap = new Map();
- propertyMap.set("name", name);
- // propertyMap.set("alias", alias);
- // propertyMap.set("discription", discription);
- // propertyMap.set("productLink", productLink);
- for (var i = 0; i <= 9; i++) {
- var paramName = "\"paramList[" + i + "].name\"";
- var contentName = "\"paramList[" + i + "].content\"";
- var param = $('input[name=' + paramName + ']').val();
- var content = $('input[name=' + contentName + ']').val();
- if ( param === undefined || param === '') {
- break;
- } else {
- propertyMap.set("param" + i, param);
- propertyMap.set("content" + i, content);
- }
- }
- // propertyMap.set("advantage", advantage);
- // propertyMap.set("disadvantage", disadvantage);
- // propertyMap.set("principle", principle);
- propertyMap.set("seoKeyword", seoKeyword);
- // propertyMap.set("brand", brand);
- // propertyMap.set("producePlace", producePlace);
- // propertyMap.set("company", company);
- // propertyMap.set("adaptiveMan", adaptiveMan);
- // propertyMap.set("unAdaptiveMan", unAdaptiveMan);
- // propertyMap.set("aroundOperation", aroundOperation);
- // if (2 == commodityType) {
- // propertyMap.set("authLink", authLink);
- // }
- <%--for (var i = 0; i <= 20; i++) {--%>
- <%-- var questionName = "\"questionList[" + i + "].question\"";--%>
- <%-- var answerName = "\"questionList[" + i + "].answer\"";--%>
- <%-- var question = $('input[name=' + questionName + ']').val();--%>
- <%-- var answer = $('input[name=' + answerName + ']').val();--%>
- <%-- if (question === undefined || question === '') {--%>
- <%-- break;--%>
- <%-- } else {--%>
- <%-- propertyMap.set("question" + i, question);--%>
- <%-- propertyMap.set("answer" + i, answer);--%>
- <%-- }--%>
- <%--}--%>
- var sensitiveWords = '${sensitiveWords}';
- const mint = new MintFilter(sensitiveWords.split('|'));
- var filterSync = '';
- var touchWords = '';
- var touchNum = 0;
- <%--debugger--%>
- propertyMap.forEach(function (value,key,map) {
- filterSync = mint.filterSync(value);
- filterSync.words.forEach(word=>{
- touchWords += touchWords === '' ? word : "," + word;
- })
- if (touchWords !== '') {
- // 增加敏感词触发数量
- touchNum++;
- // 设置敏感词提示
- $("#" + key + "SensitiveWords").text("敏感词:" + touchWords);
- touchWords = '';
- }
- });
- if (1 == status && emptyNum > 0) {
- var msg = "您还剩余" + emptyNum + "项未完善,将会导致用户对您产品/仪器的认识度不够,确认是否提交?";
- top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
- if (v == 'ok') {
- if (touchNum > 0) {
- var msg = 1 == status?"当前发布内容存在敏感词,已为您标记在输入框下方," +
- "请修改后,再进行保存发布,强行保存发布将会导致审核不通过!":
- "当前内容存在敏感词,已为您标记在输入框下方,建议修改后再进行保存!否则," +
- "将会影响发布时审核不通过!";
- top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
- if (v == 'ok') {
- loading('正在提交,请稍等...');
- form.submit();
- }
- }, {buttonsFocus: 1, persistent: true});
- } else{
- loading('正在提交,请稍等...');
- form.submit();
- }
- }
- }, {buttonsFocus: 1, persistent: true});
- } else {
- if (touchNum > 0) {
- var msg = 1 == status?"当前发布内容存在敏感词,已为您标记在输入框下方," +
- "请修改后,再进行保存发布,强行保存发布将会导致审核不通过!":
- "当前内容存在敏感词,已为您标记在输入框下方,建议修改后再进行保存!否则," +
- "将会影响发布时审核不通过!";
- top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
- if (v == 'ok') {
- loading('正在提交,请稍等...');
- form.submit();
- }
- }, {buttonsFocus: 1, persistent: true});
- } else{
- loading('正在提交,请稍等...');
- form.submit();
- }
- }
- },
- errorContainer: "#messageBox",
- errorPlacement: function(error, element) {
- $("#messageBox").text("输入有误,请先更正。");
- if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
- error.appendTo(element.parent().parent());
- } else {
- error.insertAfter(element);
- }
- }
- });
- });
- function saveInfo(){
- var content=$("#info").val();//参考资料类型
- var website=$("#website").val();//网址
- var articleName=$("#articleName").val();//文章名字
- var websiteName=$("#websiteName").val();//网站名称
- var publishTimeStr=$("#publishTimeStr").val();//发布日期
- var acitationTimeStr=$("#acitationTimeStr").val();//引文日期
- var productId="";
- <c:if test="${cmBaikeProduct.entryId eq 2}">
- productId=${cmBaikeProduct.id}
- </c:if>
- var zlid=document.getElementById("dig").lang;
- var params={}
- if(content==1){
- params={
- //网络资料
- "referenceType":content,
- "website":website,
- "articleName":articleName,
- "websiteName":websiteName,
- "publishTimeStr":publishTimeStr,
- "acitationTimeStr":acitationTimeStr,
- //公共
- "productId":productId,//词条id
- "productType":document.getElementById("dig").title,//词条内容
- "flagId":document.getElementById("dig").tabIndex,//添加修改标识 1添加 2修改
- "zlId":zlid//资料id 用于修改
- }
- }else if(content=2){
- params={
- "referenceType":content,
- "author":$("#author").val(),//作者
- "workName":$("#workName").val(),//著作名
- "publicationPlace":$("#publicationPlace").val(),//出版地
- "press":$("#press").val(),//出版社
- "publicationYearStr":$("#publicationYearStr").val(),//出版年
- "acitationWeb":$("#acitationWeb").val(),//引文页码
- //公共
- "productId":productId,//词条id
- "productType":document.getElementById("dig").title,//词条内容
- "flagId":document.getElementById("dig").tabIndex,//添加修改标识 1添加 2修改
- "zlId":zlid//资料id 用于修改
- }
- }else if(content=3){
- params={
- //其他资料
- "referenceDescription":$("#referenceDescription").val(),//参考资料说明
- "imageDescription":$("#imageDescription").val(),//图片描述
- "imageUrl":$("#image").val(),//图片地址
- //公共
- "productId":productId,//词条id
- "productType":document.getElementById("dig").title,//词条内容
- "flagId":document.getElementById("dig").tabIndex,//添加修改标识 1添加 2修改
- "zlId":zlid//资料id 用于修改
- }
- }
- // alert(content+"---"+website+"---"+articleName+"---"+websiteName+"---"+publishTime+"---"+acitationTime);
- // var params={
- // //网络资料
- // "referenceType":content,
- // "website":website,
- // "articleName":articleName,
- // "websiteName":websiteName,
- // "publishTimeStr":publishTimeStr,
- // "acitationTimeStr":acitationTimeStr,
- // //著作资料
- // "author":$("#author").val(),//作者
- // "workName":$("#workName").val(),//著作名
- // "publicationPlace":$("#publicationPlace").val(),//出版地
- // "press":$("#press").val(),//出版社
- // "publicationYearStr":$("#publicationYearStr").val(),//出版年
- // "acitationWeb":$("#acitationWeb").val(),//引文页码
- // //其他资料
- // "referenceDescription":$("#referenceDescription").val(),//参考资料说明
- // "imageDescription":$("#imageDescription").val(),//图片描述
- // "imageUrl":$("#image").val(),//图片地址
- // //公共
- // "productId":productId,//词条id
- // "productType":document.getElementById("dig").title,//词条内容
- // "flagId":document.getElementById("dig").tabIndex,//添加修改标识 1添加 2修改
- // "zlId":zlid//资料id 用于修改
- // }
- $.ajax({
- url : "${ctx}/baike/cmBaikeProduct/saveMaterialinfo",
- data : params,
- type : 'post',
- success : function(data){
- document.getElementById("dig").style.display='none';
- alert("保存资料成功");
- $("#dig").load(location.href+" #dig>*","");
- <%--window.location.href = "${ctx}/baike/cmBaikeProduct/form?commodityType=1";--%>
- },
- error : function(){
- alert(222);
- }
- })
- }
- function saveMataInfo(){
- }
- function imgSizeChange(){
- // if($("#img"+size).width==){
- //
- // }
- // alert();
- // document.getElementById("imgaa").style.width=100px;
- parent.location.href = "https://zp.caimei365.com/12/ross/activity/challenge";
- }
- //删除资料
- function delMaterial(mid){
- var msg='确定删除该资料?';
- top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
- if(v=='ok'){
- $.ajax({
- url : "${ctx}/baike/cmBaikeProduct/delMaterialinfo",
- data : {"mid":mid},
- type : 'post',
- success : function(data){
- top.$.jBox.tip('删除资料成功', 'success');
- $("#mata").load(location.href+" #mata>*","");
- <%--window.location.href = "${ctx}/baike/cmBaikeProduct/form?commodityType=1";--%>
- },
- error : function(){
- alert(222);
- }
- })
- }
- // top.$.jBox.tip('删除成功', 'success');
- // window.location.reload();
- return;
- },{buttonsFocus:1,persistent: true});
- }
- //编辑资料
- function upMaterial(mid){
- $.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>
- </head>
- <body>
- <ul class="nav nav-tabs">
- <li><a href="${ctx}/baike/cmBaikeProduct/?commodityType=${cmBaikeProduct.commodityType}">采美词条</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>--%>
- <%-- <button onclick="showlog_result(true,'展示正确内容的弹框')">展示正确弹框</button>--%>
- <%-- </div>--%>
- <div id="dialogmask" class="dialogmask opacity"></div>
- <div id="dig" class="ckzl" style="display: none">
- <div id="dig_content" class="digcontent">
- <div class="dig-tab">
- <a class="btn btn-primary" onclick="addZl()">添加参考资料</a>
- <a class="btn btn-primary" onclick="removeZl()">引用已有资料</a>
- </div>
- <%--已有资料--%>
- <div class="control-group" id="yyzl" style="display: none">
- <div class="check-reference-list">
- <c:forEach items="${cmBaikeProduct.materialInfo}" var="videoFile" varStatus="statusIndex">
- <c:if test="${videoFile.referenceType eq '1'}">
- <div class="controls applicationsan">
- <span class="del">[${statusIndex.index}]</span>
- <span class="del"><a href="${videoFile.website}" target="_blank">${videoFile.articleName}.</a></span>
- <span class="del">${videoFile.websiteName}).</span>
- <span class="del">${videoFile.publishTime}.</span>
- <span class="del">${videoFile.acitationTime}.</span>
- <a onclick="saveMataInfo(${videoFile.id})"></a>
- </div>
- </c:if>
- <c:if test="${videoFile.referenceType eq '2'}">
- <div class="controls applicationsan">
- <span class="del">[${statusIndex.index}]</span>
- <span class="del">${videoFile.author}.</span>
- <span class="del">${videoFile.workName}.</span>
- <span class="del">${videoFile.publicationPlace}.</span>
- <span class="del">${videoFile.press}.</span>
- <span class="del">${videoFile.publicationYear}.</span>
- <span class="del">${videoFile.acitationWeb}.</span>
- <a onclick="saveMataInfo(${videoFile.id})"></a>
- </div>
- </c:if>
- <c:if test="${videoFile.referenceType eq '3'}">
- <div class="controls applicationsan">
- <span class="del">[${statusIndex.index}]</span>
- <span class="del">${videoFile.referenceDescription}.</span>
- <span class="del">${videoFile.imageDescription}.</span>
- <%--
- <div class="conList">
- <img id="imgaa" src="${videoFile.imageUrl}" height="50px" width="50px" >(图片)</input>
- </div>
- --%>
- <a onclick="saveMataInfo(${videoFile.id})">引用资料</a>
- </div>
- </c:if>
- </c:forEach>
- </div>
- </div>
- <%--添加参考资料--%>
- <div id="zl">
- <div class="control-group">
- <label class="red">*</label>
- <label class="control-label">参考资料类型:</label>
- <select id="info" 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">
- <label class="red">*</label>
- <label class="control-label keyClass">输入网址:</label>
- <input type="text" id="website" required="true" htmlEscape="false" class="input-xlarge " placeholder="请以http(s)开头"/>
- </div>
- <div class="control-group">
- <label class="red">*</label>
- <label class="control-label keyClass">文章名字:</label>
- <input type="text" id="articleName" required="true" htmlEscape="false" class="input-xlarge " placeholder="请输入文章名字"/>
- </div>
- <div class="control-group">
- <label class="red">*</label>
- <label class="control-label keyClass">网站名称:</label>
- <input type="text" id="websiteName" htmlEscape="false" class="input-xlarge " placeholder="请输入网站名称 如:新华网"/>
- </div>
- <div class="control-group">
- <label class="control-label keyClass">发表日期:</label>
- <input type="text" id="publishTimeStr" name="publishTimeStr" 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">
- <label class="control-label keyClass">引文日期:</label>
- <input type="text" id="acitationTimeStr" name="publishTimeStr" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
- onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
- </div>
- </div>
- <%--著作资料--%>
- <div class="zzzl" style="display: none" id="zzzl">
- <div class="control-group" >
- <label class="red">*</label>
- <label class="control-label keyClass">作者:</label>
- <input type="text" id="author" htmlEscape="false" class="input-xlarge " placeholder="请输入作者名称 多个作者使用英文都好隔开"/>
- </div>
- <div class="control-group">
- <label class="red">*</label>
- <label class="control-label keyClass">著作名:</label>
- <input type="text" id="workName" htmlEscape="false" class="input-xlarge " placeholder="请输入著作名"/>
- </div>
- <div class="control-group">
- <label class="control-label keyClass">出版地:</label>
- <input type="text" id="publicationPlace" htmlEscape="false" class="input-xlarge " placeholder="请输入出版地信息"/>
- </div>
- <div class="control-group">
- <label class="red">*</label>
- <label class="control-label keyClass">出版社:</label>
- <input type="text" id="press" htmlEscape="false" class="input-xlarge " placeholder="请输入出版社名称"/>
- </div>
- <div class="control-group">
- <label class="control-label keyClass">出版年:</label>
- <input type="text" id="publicationYearStr" name="publicationYearStr" 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">
- <label class="control-label keyClass">引文编码:</label>
- <input type="text" id="acitationWeb" htmlEscape="false" class="input-xlarge " placeholder="请输入引用著作的页码 如 100 121"/>
- </div>
- </div>
- <%--其他资料--%>
- <div class="qtzl" id="qtzl" style="display: none" >
- <div class="control-group">
- <label class="red">*</label>
- <label class="control-label keyClass">参考资料说明:</label>
- <textarea id="referenceDescription" type="text" style="position: relative;height: 100px; width: 450px;" maxlength="50" ></textarea>
- <label class="bk-input-tip">其他类型参考资料,填写格式请参阅<a href="">《信息与文献 参考文献著录规则 GB/T 7714-2015》</a></label>
- </div>
- <div class="control-group" >
- <label class="control-label keyClass">图片描述:</label>
- <input type="text" id="imageDescription" htmlEscape="false" class="input-xlarge " placeholder="请输入其他参考资料的具体描述"/>
- </div>
- <div class="control-group">
- <label class="control-label">图片上传:</label>
- <div class="auth-qrCode-list clearfix">
- <div class="controls upload-content iconBox mainImageBox" id="mainImageBox">
- <div class="conList">
- <hidden id="referenceImgUrl" path="referenceImgUrl" htmlEscape="false" maxlength="255" class="input-xlarge "/>
- <sys:ckfinder input="referenceImgUrl" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
- <label class="bk-upload-tip">请上传引用的图片资源,需同时上传资料的封面、以及含有对应具体内容的图片;注意:图片需要保证完整、不可遮挡且清晰</label>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="form-actions">
- <button class="cancel btn btn-primary">取 消</button>
- </div>
- </div>
- <%-- <div id="dialogmask" class="dialogmask opacity"></div>--%>
- <div id="dialog" class="box" style="display: none">
- <div id="dialog_content" class="dialogcontent">
- <%-- <div id="logcontent" class="logcontent"><a herf="https://www.baidu.com">三生三世</a></div>--%>
- <%-- <a herf="https://www.baidu.com">十里桃花</a>--%>
- <div><h4>创建词条引导</h4></div>
- <br>
- <div>欢迎进入创建词条引导,为便于您更好的通过审核,请务必确保您已知晓百科词条的<a href="${ctx}/baike/cmBaikeProduct/entry" target="_blank">编辑须知</a>,如有疑问,您可以<a>点此</a>求助采美工作人员。</div>
- <br>
- <div><h5>声明</h5></div>
- <br>
- <div>在正式创建词条前,首先请你承诺:</div>
- <div>1.不在百科添加广告性质的内容, 如联系方式,官方网站链接等;</div>
- <div>2.不在百科编写涉及反动,违法犯罪,色情,暴力的内容;</div>
- <div>3.不在百科编写虚假的、捏造的、恶搞的、缺乏根据的内容;</div>
- <div>4.不侵犯他人合理权益;</div>
- <div>5.接受违反以上规则时,百科账号会被封禁的结果。</div>
- <br>
- <div><h5>词条名</h5></div>
- <br>
- <div>成功创建词条的首要条件是了解一些基础知识!</div>
- <br>
- <div><h5>■什么是词条?</h5></div>
- <br>
- <div>词条指的是对于单一事物内容的介绍,例如技术,成分等。每个词条都有属于自己的名称,你可以通过搜索词条的名称来找到它们。</div>
- <div>已有词条重名?创建多义词!</div>
- <div>与已有词条意义相同?反馈同义词!</div>
- <br>
- <div><h5>■什么是规范的词条名?</h5></div> <br>
- <div>采美百科规范的词条名是一个专有名词,请使用正式的全称或最广为人知的常见名。</div>
- <div>例如:皮秒激光美容、光子嫩肤、线粒体、葡聚糖等</div>
- <br>
- <div><h5>主题</h5></div> <br>
- <div>恭喜你已经完成了创建词条的第一步!现在想一想你要创建的词条属于什么类型?</div>
- <div>选择正确的类型,精确定位你的创建难点所在!</div>
- <br>
- <div><h5>产品成分类词条</h5></div> <br>
- <div>如玻尿酸钠、葡聚糖、虎杖等</div>
- <br>
- <div><h5>产品技术词条</h5></div> <br>
- <div>如射频、皮秒、808半导体激光技术、透热疗法、448KHz、LDM水滴提升等</div>
- <br>
- <div><h5>词条创建要求</h5></div> <br>
- <div><h6>1.描述客观</h6></div>
- <div>描述事物时以事实为依
- 据不加入感情色彩,不掺杂个人的好恶。百科词条
- 是客观内容的集合,只站在第三方立场,以事实说话。例如,
- 某篮球运动员某一场的投篮命中率较差,一般的表述是命中率低,
- 甚至使用“打铁”之类的贬义词。而这样的表述模糊不清,多少算低,多
- 少算高各有标准;同时也会造成支持者和反对者的口水战。所以直接把赛事数据
- 列出,是高是低各自评说即可。另外在筛选内容时,也要保证公正客观,尤其对于争
- 议性内容,保留多方观点并附以可靠的参考资料,是处理争议内容较为可取的做法。</div>
- <br>
- <div><h6>2.修饰适当</h6></div> <br>
- <div>百科词条提倡用语“客观”,在一般性的叙述中(区别于引用原文的引述)尽量少的使用形容词和程度副词(最XXXX、十分XXX……)。</div>
- <br>
- <div><h6>3.参考资料要有效</h6></div> <br>
- <div>参考资料是正文内容客观的另一种表现形式。词条某条内容,光靠“说”自己客观是不够的,应以可信有效的参考资料作为佐证来源,才能证明该内容是否已获得公众知晓或认可。
- 特色词条应该保证一半以上的信息点都是有可靠来源的(由科学百科权威认证的特色词条,应确保词条正文中(含概述)每个目录模块中都有至少一条权威参考资料)。
- 这里的有来源不是要求一字一句的复制粘贴,而是“内容虽经必要提炼、整理,但却不失原意”。例如前述的两个姜文词条中的文段,整理后的内容要素和观点依然来自参考资料,并没有增减其原意。
- </div>
- <br>
- <div>可靠的来源一般包括文献、书籍等出版物、主流媒体发布的消息、政府或公众机构官网发布的内容等。关于可靠的来源的具体定义,请参阅百度百科:参考资料。</div>
- <br>
- <div>如,“<a>牛顿第一运动定律</a>”词条中,定律内容、发现者、适用范围等都是必不可少的重要内容,这些部分的缺失会导致读者对词条内容的错误认识。</div>
- <div align="center"><input class="btn btn-primary" type="button" onclick="dialog()" value="我已阅读并知晓"></div>
- </div>
- </div>
- <form:form id="inputForm" modelAttribute="cmBaikeProduct" action="${ctx}/baike/cmBaikeProduct/save" enctype="application/json" method="post" class="form-horizontal">
- <form:hidden path="id"/>
- <form:hidden path="fileIds"/>
- <form:hidden path="commodityType"/>
- <form:hidden path="emptyNum"/>
- <form:hidden path="referenceList"/>
- <sys:message content="${message}"/>
- <%--词条名称--%>
- <div class="control-group">
- <label class="control-label">词条名称:</label>
- <div class="controls">
- ${cmBaikeProduct.name}
- <%-- <form:input path="name" htmlEscape="false" class="input-xlarge "/>--%>
- <%-- <label id="nameSensitiveWords" class="red"></label>--%>
- </div>
- </div>
- <%--义项名--%>
- <div class="control-group">
- <label class="control-label">义项名:</label>
- <div class="controls not-overflow">
- <div class="content-edit" id="bk-name" name="alias"></div>
- </div>
- </div>
- <%--词条概述--%>
- <div class="control-group">
- <label class="control-label">词条概述:</label>
- <div class="controls not-overflow">
- <div class="content-edit" id="discription" name="discription"></div>
- <label id="discriptionSensitiveWords" class="red"></label>
- </div>
- </div>
- <%--概述图册--%>
- <div class="control-group" style="width: 1000px">
- <label class="control-label keyClass">概述图册:</label>
- <div class="display-image-list" style="display: flex;flex-wrap: nowrap; margin-top: -36px">
- <c:forEach items="${cmBaikeProduct.displayImageList}" var="displayImage" varStatus="index">
- <div class="controls upload-content iconBox" id="displayImageBox${index.index}" style="width: 170px">
- <div class="conList">
- <form:hidden id="displayImage${index.index}" path="displayImageList[${index.index}]" htmlEscape="false"
- maxlength="255"
- class="input-xlarge "/>
- <sys:ckfinder input="displayImage${index.index}" type="images" uploadPath="/photo"
- selectMultiple="false"
- maxWidth="100" maxHeight="100"/><br>
- </div>
- </div>
- </c:forEach>
- <c:set var="size" value="${empty cmBaikeProduct.displayImageList?0:cmBaikeProduct.displayImageList.size()}"/>
- <c:forEach var="emptyIndex" begin="${size}" end="${5}">
- <div class="controls upload-content iconBox conList ${emptyIndex eq 0?'':'hide-pic'}" id="displayImageBox${emptyIndex}" style="width: 170px">
- <div class="conList">
- <form:hidden id="displayImage${emptyIndex}" path="displayImageList[${emptyIndex}]" htmlEscape="false"
- maxlength="255"
- class="input-xlarge "/>
- <sys:ckfinder input="displayImage${emptyIndex}" type="images" uploadPath="/photo"
- selectMultiple="false"
- maxWidth="100" maxHeight="100"/><br>
- </div>
- </div>
- </c:forEach>
- </div>
- <div class="control-label">
- <label class="control-label keyClass" style="margin-left: 90px">概述视频(各视频大小不超过50M,最多上传6个)</label>
- </div>
- <div class="control-group video">
- <label class="control-label">标题:</label>
- <div class="controls">
- <input id="fileTitle" htmlEscape="false" type="text">
- </div>
- <label class="control-label" style="margin-top:10px">视频路径:</label>
- <div class="controls" style="margin-top:10px;width: 600px;">
- <input id="uploadFileName" type="text" style="display: inline;" placeholder="支持mp4" disabled="true" class="input-xlarge required" />
- <div class="upload">
- <input type="file" name="file" id="productFile" accept=".mp4" >选择文件
- </div>
- <div class="add-submit">
- <input id="addSubmit" type="button" value="上传"/>上传
- </div>
- <div class="upload-loading">
- <img alt="gif" src="/static/images/upload.gif" width="32px" border="none">
- </div>
- </div>
- <div id='file-list-display' style="margin-left:180px">
- <c:if test="${not empty cmBaikeProduct.videoList}">
- <c:forEach items="${cmBaikeProduct.videoList}" var="videoFile" varStatus="statusIndex">
- <p>${videoFile.fileTitle}
- <span class="del"><a onclick="previewVideo('${videoFile.ossUrl}')">预览</a></span>
- <span class="del" onclick="dataDelete(this,'${videoFile.id}')">删除</span>
- </p>
- </c:forEach>
- </c:if>
- </div>
- </div>
- </div>
- <%-- <div class="control-group">--%>
- <%-- <div class="control-group">--%>
- <%-- <label class="control-label keyClass">相关视频(各视频大小不超过50M,最多上传6个)</label>--%>
- <%-- </div>--%>
- <%-- <div class="control-group">--%>
- <%-- <label class="control-label">标题:</label>--%>
- <%-- <div class="controls">--%>
- <%-- <input id="fileTitle" htmlEscape="false" type="text">--%>
- <%-- </div>--%>
- <%-- <label class="control-label" style="margin-top:10px">视频路径:</label>--%>
- <%-- <div class="controls" style="margin-top:10px;width: 600px;">--%>
- <%-- <input id="uploadFileName" type="text" style="display: inline;" placeholder="支持mp4" disabled="true" class="input-xlarge required" />--%>
- <%-- <div class="upload">--%>
- <%-- <input type="file" name="file" id="productFile" accept=".mp4" >选择文件--%>
- <%-- </div>--%>
- <%-- <div class="add-submit">--%>
- <%-- <input id="addSubmit" type="button" value="上传"/>上传 --%>
- <%-- </div>--%>
- <%-- <div class="upload-loading">--%>
- <%-- <img alt="gif" src="/static/images/upload.gif" width="32px" border="none">--%>
- <%-- </div>--%>
- <%-- </div>--%>
- <%-- </div>--%>
- <%-- <div class="control-group">--%>
- <%-- <div id='file-list-display' style="margin-left:180px">--%>
- <%-- <c:if test="${not empty cmBaikeProduct.videoList}">--%>
- <%-- <c:forEach items="${cmBaikeProduct.videoList}" var="videoFile" varStatus="statusIndex">--%>
- <%-- <p>${videoFile.fileTitle}--%>
- <%-- <span class="del"><a onclick="previewVideo('${videoFile.ossUrl}')">预览</a></span>--%>
- <%-- <span class="del" onclick="dataDelete(this,'${videoFile.id}')">删除</span>--%>
- <%-- </p>--%>
- <%-- </c:forEach>--%>
- <%-- </c:if>--%>
- <%-- </div>--%>
- <%-- </div>--%>
- <%-- </div>--%>
- <%--信息栏--%>
- <div class="control-group paramList" id="paramList">
- <label class="control-label titleClass" style="margin-left: 90px">信息栏:(注:未填写的信息将不会显示在词条页上)</label>
- <div class="controls add-button"><button class="btn btn-primary" type="button" style="margin-left: 20px">增加信息项</button></div>
- <div class="controls param-controls not-overflow"></div>
- </div>
- <%--正文--%>
- <div class="control-group" id="textInfolist">
- <label class="control-label titleClass">正文:</label>
- <div class="controls not-overflow">
- <%-- <div class="bk-textInfo-item">
- <div class="content-edit" id="textInfo-0" name="textInfolist[0].content"></div>
- <div class="bk-textInfo-control"><span>一级目录</span><span>二级目录</span><span>内容</span></div>
- </div>
- --%>
- </div>
- </div>
- <%--参考资料--%>
- <div class="control-group" id="mata">
- <label class="control-label titleClass">参考资料</label>
- <div class="bk-reference-list">
- <c:forEach items="${cmBaikeProduct.materialInfo}" var="videoFile" varStatus="statusIndex">
- <c:if test="${videoFile.referenceType eq '1'}">
- <div class="controls applicationsan" style="margin-top: 5px">
- <span class="del">[${statusIndex.index+1}]</span>
- <span class="del"><a href="${videoFile.website}" target="_blank">${videoFile.articleName}</a></span>
- <span class="del">${videoFile.websiteName}.</span>
- <span class="del">${videoFile.publishTime}.</span>
- <span class="del">${videoFile.acitationTime}.</span>
- <%-- <a class="del" style="margin-left: 12px" onclick="upMaterial(${videoFile.id})">编辑</a>--%>
- <%-- <a onclick="delMaterial(${videoFile.id})">删除</a>--%>
- </div>
- </c:if>
- <c:if test="${videoFile.referenceType eq '2'}">
- <div class="controls applicationsan" style="margin-top: 5px">
- <span class="del">[${statusIndex.index+1}]</span>
- <span class="del">${videoFile.author}.</span>
- <span class="del">${videoFile.workName}.</span>
- <span class="del">${videoFile.publicationPlace}.</span>
- <span class="del">${videoFile.press}.</span>
- <span class="del">${videoFile.publicationYear}.</span>
- <span class="del">${videoFile.acitationWeb}.</span>
- <%-- <a class="del" style="margin-left: 12px" onclick="upMaterial(${videoFile.id})">编辑</a>--%>
- <%-- <a onclick="delMaterial(${videoFile.id})">删除</a>--%>
- </div>
- </c:if>
- <c:if test="${videoFile.referenceType eq '3'}">
- <div class="controls applicationsan" style="margin-top: 5px">
- <span class="del">[${statusIndex.index+1}]</span>
- <span class="del">${videoFile.referenceDescription}.</span>
- <span class="del">${videoFile.imageDescription}.</span>
- <%--
- <div class="conList">
- <img id="imgaa" src="${videoFile.imageUrl}" height="50px" width="50px" ></input>
- </div>
- --%>
- <%-- <a class="del" style="margin-left: 12px" onclick="upMaterial(${videoFile.id})">编辑</a>--%>
- <%-- <a onclick="delMaterial(${videoFile.id})">删除</a>--%>
- </div>
- </c:if>
- </c:forEach>
- </div>
- </div>
- <%--头图--%>
- <div class="control-group" style="margin-top: 100px">
- <label class="control-label">头图:</label>
- <div class="main-image-list" style="display: flex;flex-wrap: wrap">
- <div class="controls upload-content iconBox mainIgeBox" id="mainIgeBox">
- <div class="conList">
- <form:hidden id="image" path="image" htmlEscape="false" maxlength="255" class="input-xlarge "/>
- <sys:ckfinder input="image" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
- maxHeight="100"/>
- <br>
- <label style="margin-left: 150px">建议图片尺寸210px*210px,并上传白底图片</label>
- </div>
- </div>
- </div>
- </div>
- <%--分类--%>
- <div class="control-group">
- <label class="control-label keyClass">分类:</label>
- <div class="controls">
- <form:select path="typeId" class="input-xlarge ">
- <form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
- </form:select>
- </div>
- </div>
- <%--SEO关键词--%>
- <div class="control-group">
- <label class="control-label">SEO关键词:</label>
- <div class="auto-input">
- <form:input cssStyle="margin-left: 20px" path="seoKeyword" htmlEscape="false" style="position: relative" class="input-xlarge" readonly="true"/>
- </div>
- </div>
- <%--基础浏览量--%>
- <div class="control-group">
- <label class="control-label keyClass">浏览量:</label>
- <div class="controls">
- <form:input path="actualPv" htmlEscape="false" onkeyup="onlynum(this)" class="input-xlarge digits " readonly="true"/>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label keyClass">供应商:</label>
- <div class="controls">
- ${cmBaikeProduct.shopName}
- </div>
- </div>
- <div class="control-group">
- <label class="control-label keyClass">审核:</label>
- <div class="controls">
- <input type="radio" name="auditStatus" value="2" onclick="updateAuditStatus(2)" ${empty cmBaikeProduct.auditStatus?'checked=checked':cmBaikeProduct.auditStatus eq 1?'checked=checked':''}> 审核通过
- <input type="radio" name="auditStatus" value="3" onclick="updateAuditStatus(3)" ${cmBaikeProduct.auditStatus eq 3?'checked=checked':''}> 审核失败
- </div>
- </div>
- <div class="control-group" id="failReasonDiv" style="${empty cmBaikeProduct.auditStatus or cmBaikeProduct.auditStatus eq 1?'display: none':''}">
- <label class="control-label"><font color="red">*</font>失败原因</label>
- <div class="controls">
- <textarea type="text" id="failReason" name="failReason" required style="width: 400px;height: 90px">${cmBaikeProduct.failReason}</textarea>
- </div>
- </div>
- <%--提交数据 --%>
- <div class="form-actions">
- <%-- <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/> --%>
- <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
- </div>
- </form:form>
- <% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
- <script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
- <script type="text/javascript" src="${ctxStatic}/sensitiveWords/mint-filter.umd.js"></script>
- <script type="text/javascript" src="${ctxStatic}/auto-input.js"></script>
- <script type="text/javascript" src="${ctxStatic}/content-edit.js"></script>
- <script>
- // 内容编辑器列表
- var contentEditMap = new Map()
- // 当前选中的编辑器
- var currentContentEdit = null
- // 当前选中的编辑器元素
- var currentContentEditEl = null
- // 添加资料数据
- var referenceData = {}
- // 资料编辑类型
- 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()
- $('#dig').fadeIn()
- },
- referenceEdit(ctrid) {
- // 编辑
- referenceEditTyp = 'edit'
- referenceData = referenceList.find(function(item){
- return item.ctrlId == ctrid
- })
- if(!referenceData) return
- initRefrenceFormData(referenceData)
- $('#dialogmask').fadeIn()
- $('#dig').fadeIn()
- },
- })
- contentEditMap.set(el, contentEdit)
- }
- // 从表单获取资料数据
- function setRefrenceData(data){
- const referenceData = {}
- referenceData.id = data.id || '' // 资料id
- referenceData.ctrlId = data.ctrlId || '' // 关联id
- /* (网络资料) */
- referenceData.referenceType= $("#info").val() // '参考类型资料(1.网络;2.著作;3.其他)'
- referenceData.website = $("#website").val()
- referenceData.articleName = $("#articleName").val()
- referenceData.websiteName = $("#websiteName").val()
- referenceData.publishTimeStr = $("#publishTimeStr").val()
- referenceData.acitationTimeStr = $("#acitationTimeStr").val()
- /* 著作资料)*/
- referenceData.author= $("#author").val()
- referenceData.workName= $("#workName").val()
- referenceData.publicationPlace= $("#publicationPlace").val()
- referenceData.press= $("#press").val()
- referenceData.publicationYearStr= $("#publicationYearStr").val()
- referenceData.acitationWeb= $("#acitationWeb").val()
- /* (其他资料) */
- referenceData.referenceDescription= $("#referenceDescription").val()
- referenceData.imageDescription= $("#imageDescription").val()
- referenceData.imageUrl = $("#referenceImgUrl").val()
- referenceData.entryId = data.entryId || '' // 词条id
- referenceData.entryType = data.entryType || ''
- return referenceData
- }
- // 设置资料表单数据
- function initRefrenceFormData(data){
- $("#info").val(data.referenceType)
- $("#website").val(data.website)
- $("#articleName").val(data.articleName)
- $("#websiteName").val(data.websiteName)
- $("#publishTimeStr").val(data.publishTimeStr)
- $("#acitationTimeStr").val(data.acitationTimeStr)
- $("#author").val(data.author)
- $("#workName").val(data.workName)
- $("#publicationPlace").val(data.publicationPlace)
- $("#press").val(data.press)
- $("#publicationYearStr").val(data.publicationYearStr)
- $("#acitationWeb").val(data.acitationWeb)
- $("#referenceDescription").val(data.referenceDescription)
- $("#imageDescription").val(data.imageDescription)
- $("#referenceImgUrl").val(data.imageUrl)
- }
- // 创建信息栏item
- function createParamItem(index){
- var paramItem = $('<div class="param-item"></div>')
- var paramName = $('<div class="param-name"></div>')
- var paramNameInput = $('<input type="text" placeholder="例如:型号">')
- paramNameInput.attr('name', 'paramList['+ index +'].name')
- paramNameInput.attr('class','xxl-name')
- paramNameInput.attr('id','paramName-'+index)
- var paramContent = $('<div class="param-content"></div>')
- var paramContentInput = $('<div class="content-edit"></div>')
- paramContentInput.attr('id', 'param-' + index)
- paramContentInput.attr('name', 'paramList['+index+'].content')
- var deleteBtn = $('<a style="cursor: pointer">删除</a>')
- paramName.append(paramNameInput)
- paramContent.append(paramContentInput)
- paramItem.append([paramName,paramContent,deleteBtn ])
- deleteBtn.on('click', function(){
- $(this).parents('.param-item').remove()
- })
- return paramItem
- }
- // 初始化信息栏
- function initParamList(){
- <c:forEach items="${cmBaikeProduct.paramList}" var="videoFile" varStatus="statusIndex">
- var index=${statusIndex.index}
- paramItemIndex = index
- var paramItem = createParamItem(index)
- $('#paramList .param-controls').append(paramItem)
- createContentEdit('#param-' + index,'${videoFile.content}')
- console.log('${videoFile.name}')
- $('#paramName-'+index).val('${videoFile.name}')
- </c:forEach>
- // paramList.forEach(function(item, index){
- // paramItemIndex = index
- // var paramItem = createParamItem(index)
- // $('#paramList .param-controls').append(paramItem)
- // createContentEdit('#param-' + index)
- // })
- }
- // 创建正文item
- function createTextInfoItem(index, type){
- var inputId = 'textInfo-' + index
- var textInfoItem = $('<div class="bk-textInfo-item"><div>')
- var input = null
- var inputType=null
- if(type == 3){
- input = $('<div class="content-edit"></div>')
- input.attr('id', inputId)
- input.attr('name', 'textInfolist[' + index + '].dictionaryContent')
- inputType=$('<input type="text" />')
- inputType.attr('name','textInfolist[' + index + '].dictionaryType')
- inputType.attr('value',type)
- inputType.attr('style','display: none')
- }else{
- input = $('<input type="text" />')
- input.attr('id', inputId)
- input.attr('name', 'textInfolist[' + index + '].dictionaryContent')
- var placeholder = type == 1 ? '一级标题' : '二级标题'
- input.attr('placeholder', placeholder)
- inputType=$('<input type="text" />')
- inputType.attr('name','textInfolist[' + index + '].dictionaryType')
- inputType.attr('value',type)
- inputType.attr('style','display: none')
- }
- var control = $('<div class="bk-textInfo-control"></div>')
- var first = $('<span>+一级标题</span>')
- var second = $('<span>+二级标题</span>')
- var content = $('<span>+内容</span>')
- var deleteBtn = $('<span>删除</span>')
- control.append([first, second, content, deleteBtn])
- textInfoItem.append([input,inputType,control])
- first.on('click', function(){
- $(this).parents('.bk-textInfo-item').after(createTextInfoItem(++textInfoItemIndex, 1))
- })
- second.on('click', function(){
- var index = $(this).parents('.controls').find('.bk-textInfo-item').length +1
- $(this).parents('.bk-textInfo-item').after(createTextInfoItem(++textInfoItemIndex, 2))
- })
- content.on('click', function(){
- var index = $(this).parents('.controls').find('.bk-textInfo-item').length +1
- $(this).parents('.bk-textInfo-item').after(createTextInfoItem(++textInfoItemIndex, 3))
- var inputId = 'textInfo-' + textInfoItemIndex
- createContentEdit('#' + inputId)
- })
- deleteBtn.on('click', function(){
- $(this).parents('.bk-textInfo-item').remove()
- })
- return textInfoItem
- }
- // 初始化正文内容
- function initTextInfoList(){
- var te='${cmBaikeProduct.textInfolist}'
- if(''==te ||null==te ||te=='[]'){
- var textInfoList = [{type:1},{type:2},{type:3}]
- textInfoList.forEach(function(item,index){
- textInfoItemIndex = index
- var inputId = 'textInfo-' + index
- const textInfoIem = createTextInfoItem(index, item.type)
- $('#textInfolist .controls').append(textInfoIem)
- if(item.type == 3){
- createContentEdit('#' + inputId)
- }
- })
- }else{
- <c:forEach items="${cmBaikeProduct.textInfolist}" var="videoFile" varStatus="statusIndex">
- var index=${statusIndex.index}
- textInfoItemIndex = index
- var inputId = 'textInfo-' + index
- var textInfoIem = createTextInfoItem(index, ${videoFile.dictionaryType})
- $('#textInfolist .controls').append(textInfoIem)
- console.log('${videoFile.dictionaryContent}')
- if('${videoFile.dictionaryType}'=='3'){
- createContentEdit('#' + inputId,'${videoFile.dictionaryContent}')
- }else{
- $('#textInfo-' + index).val('${videoFile.dictionaryContent}')
- }
- </c:forEach>
- }
- // $('#textInfolist .controls')
- }
- function createReferenceItem(referenceData){
- var text=null
- if(referenceData.publishTimeStr=='undefined'){
- referenceData.publishTimeStr='111'
- }
- if(referenceData.referenceType == 1){
- text = `
- <div class="controls applicationsan">
- <span class="del">
- <a>\${referenceData.articleName}.</a>
- </span>
- <span class="del">\${referenceData.websiteName}.</span>
- <span class="del">\${referenceData.publishTimeStr}.</span>
- <span class="del">\${referenceData.acitationTimeStr}.</span>
- </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>
- `
- }
- return text
- }
- function createAllReferenceItem(referenceData){
- var text=null
- if(referenceData.referenceType == 1){
- text = `
- <div class="controls applicationsan">
- <span class="del">[\${referenceList.length}]</span>
- <span class="del"><a>\${referenceData.articleName}.</a></span>
- <span class="del">\${referenceData.websiteName}.</span>
- <span class="del">\${referenceData.publishTimeStr}.</span>
- <span class="del">\${referenceData.acitationTimeStr}.</span>
- <a class="del" style="margin-left: 12px" onclick="upMaterial(\${referenceData.id})">编辑</a>
- <a onclick="delMaterial(\${referenceData.id})">删除</a>
- </div>
- `
- }
- if(referenceData.referenceType == 2){
- text= `
- <div class="controls applicationsan">
- <span class="del">[\${referenceList.length}]</span>
- <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>
- <a class="del" style="margin-left: 12px" onclick="upMaterial(\${referenceData.id})">编辑</a>
- <a onclick="delMaterial(\${referenceData.id})">删除</a>
- </div>
- `
- }
- if(referenceData.referenceType == 3){
- text= `
- <div class="controls applicationsan">
- <span class="del">[\${referenceList.length}]</span>
- <span class="del">\${referenceData.referenceDescription}.</span>
- <span class="del">\${referenceData.imageDescription}.</span>
- <a class="del" style="margin-left: 12px" onclick="upMaterial(\${referenceData.id})">编辑</a>
- <a onclick="delMaterial(\${referenceData.id})">删除</a>
- </div>
- `
- }
- return text
- }
- // 只要referenceList数据有更新就执行一次
- function createReferenceList(){
- $('.check-reference-list').html('')
- referenceList.forEach(function(refData, index){
- console.log(refData)
- 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 refren='${cmBaikeProduct.referenceList}'
- if(''==refren|| null==refren){
- }else{
- referenceList=JSON.parse(refren)
- markCount=referenceList.length
- console.log(markCount)
- }
- //初始化 义项名,词条概述
- createContentEdit('#bk-name','${cmBaikeProduct.alias}')
- createContentEdit('#discription','${cmBaikeProduct.discription}')
- initParamList()
- initTextInfoList()
- $('#paramList .btn').on('click', function(){
- var paramItem = createParamItem(++paramItemIndex)
- $('#paramList .param-controls').append(paramItem)
- createContentEdit('#param-' + paramItemIndex)
- })
- $('#dig .confirm').on('click', function(){
- 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()
- $(this).parents('#dig').siblings('#dialogmask').fadeOut()
- initRefrenceFormData({})
- })
- <%-- referenceList = [{ctrlId: 'FDIEKABKKNJEEJAN'}] // referenceList[0].reyt = 1 // referenceList:'[{"type": 1}]'--%>
- <%--console.log('${cmBaikeProduct.materialInfo}')--%>
- // 初始化编辑框引用资料列表
- contentEditMap.forEach(function(item){
- item.edit.ctridList.forEach(function(ctrlId){
- var data = referenceList.find(function(ref){
- return ref.ctrlId == ctrlId
- })
- if(!data) return
- <%-- <c:forEach items="${cmBaikeProduct.materialInfo}" var="videoFile" varStatus="statusIndex">--%>
- <%-- </c:forEach>--%>
- var text = createReferenceItem(data)
- item.addLiteratureItem(ctrlId, text)
- })
- })
- })
- </script>
- <script>
- var paramIndex = 1;
- var questionIndex = 2;
- //给涉及到参考资料的标签赋值
- $(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();
- var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
- var MutationObserverConfig = {
- childList: true,
- subtree: true,
- characterData: true
- };
- var observer = new MutationObserver(function (mutations) {
- $.each(mutations, function (index, item) {
- if (item.type === 'childList') {
- // 在创建新的 element 时调用
- var target = $(item.target),
- thisWrapper = target.closest('.conList'),
- nextEle = thisWrapper.parents('.controls').next();
- thisWrapper.find('li').css('z-index', 99);
- thisWrapper.find('.cancel-upload').show();
- if (nextEle.hasClass('hide-pic')) {
- nextEle.removeClass('hide-pic');
- }
- }
- })
- });
- var observeEle1 = document.getElementsByClassName('main-image-list')[0];
- var observeEle2 = document.getElementsByClassName('auth-qrCode-list')[0];
- // var observeEle3 = document.getElementsByClassName('auth-image-list')[0];
- var observeEle4 = document.getElementsByClassName('display-image-list')[0];
- observer.observe(observeEle1, MutationObserverConfig);
- observer.observe(observeEle2, MutationObserverConfig);
- // observer.observe(observeEle3, MutationObserverConfig);
- observer.observe(observeEle4, MutationObserverConfig);
- $('body').on('click', '.cancel-upload',function() {
- var wrapper = $(this).closest('.controls');
- var controlsId = wrapper.attr('id');
- wrapper.find('li').css('z-index','-1');
- wrapper.find('input').val('');
- $(this).hide();
- if (controlsId == 'mainImageBox' || controlsId == 'authQrCodeBox' || controlsId=='mainIgeBox') {
- wrapper.removeClass("hide-pic");
- }
- // else if (controlsId.indexOf('authImageBox') != -1) {
- // if ($('.auth-image-list .cancel-upload:visible').length < 8) {
- // wrapper.addClass("hide-pic");
- // }else{
- // wrapper.removeClass("hide-pic");
- // }
- // }
- else if (controlsId.indexOf('displayImageBox') != -1) {
- if ($('.display-image-list .cancel-upload:visible').length < 6) {
- wrapper.addClass("hide-pic");
- }else{
- wrapper.removeClass("hide-pic");
- }
- }
- wrapper.parent().append(wrapper.clone());
- wrapper.remove();
- $(".controls").each(function(i,ele){
- if($(ele).find("input.input-xlarge").val()){
- $(ele).next().removeClass("hide-pic")
- }
- })
- });
- $('body').on('click','.upload-content li',function() {
- var index = $(this).closest('.conList').index() + 1,
- str = 'image'+index+'FinderOpen';
- eval(str+'()');
- });
- $(window).on("load", function () {
- setTimeout(function () {
- $("#authQrCodeBox").find("input.input-xlarge").each(function (i, ele) {
- if ($(ele).val()) {
- $(ele).next().find("li").css("z-index", "99");
- $(ele).parents(".conList").find(".cancel-upload").show();
- $(ele).parent().parents(".controls").next().removeClass("hide-pic")
- }
- })
- $("#mainImageBox").find("input.input-xlarge").each(function (i, ele) {
- if ($(ele).val()) {
- $(ele).next().find("li").css("z-index", "99");
- $(ele).parents(".conList").find(".cancel-upload").show();
- $(ele).parent().parents(".controls").next().removeClass("hide-pic")
- }
- })
- $("#mainIgeBox").find("input.input-xlarge").each(function (i, ele) {
- if ($(ele).val()) {
- $(ele).next().find("li").css("z-index", "99");
- $(ele).parents(".conList").find(".cancel-upload").show();
- $(ele).parent().parents(".controls").next().removeClass("hide-pic")
- }
- })
- for (var i = 0; i < 8; i++) {
- $("#authImageBox"+i).find("input.input-xlarge").each(function (i, ele) {
- if ($(ele).val()) {
- $(ele).next().find("li").css("z-index", "99");
- $(ele).parents(".conList").find(".cancel-upload").show();
- $(ele).parent().parents(".controls").next().removeClass("hide-pic")
- }
- })
- }
- for (var i = 0; i < 6; i++) {
- $("#displayImageBox"+i).find("input.input-xlarge").each(function (i, ele) {
- if ($(ele).val()) {
- $(ele).next().find("li").css("z-index", "99");
- $(ele).parents(".conList").find(".cancel-upload").show();
- $(ele).parent().parents(".controls").next().removeClass("hide-pic")
- }
- })
- }
- }, 200);
- });
- var fileIds = $("#fileIds").val();
- //点击上传按钮后上传文件
- $('#addSubmit').click(function () {
- var fileIdArr = fileIds.split(',');
- if (fileIdArr.length >= 7) {
- alertx('最多上传6个视频');
- return;
- }
- var filesById = document.getElementById('productFile');
- var files = $('#productFile');
- var fileList = files.prop('files');
- var fileTitle = $('#fileTitle').val();
- var fileName = $('#uploadFileName').val();
- if (fileTitle == '') {
- alertx('请输入视频标题')
- return;
- }
- if (files === '' || files.length == 0 || fileName == '') {
- alertx('请选择上传文件');
- return;
- }
- $("#fileTitle").val("");
- $("#uploadFileName").val("");
- var data = new FormData();
- var productId = $("#id").val();
- data.append('file', fileList[0]);
- data.append('fileTitle', fileTitle);
- data.append('fileName', fileName);
- data.append('productId', productId);
- data.append('fileIds', fileIds);
- $('.upload-loading').css("display", "inline");
- $.ajax({
- url: "${ctx}/baike/cmBaikeProduct/upload",
- data: data,
- type: "POST",
- processData: false,
- contentType: false,
- dataType: "json",
- success: function (res) {
- if (res.success) {
- filesById.value = '';
- renderFileList(res.productFile);
- $('.upload-loading').hide();
- } else {
- $.jBox.tip(res.msg, 'error');
- $("#uploadFileName").val(fileName);
- $('.upload-loading').hide();
- }
- },
- error: function (json) {
- }
- });
- })
- var fileList = [];
- var files = document.getElementById("productFile"), renderFileList;
- //选择上传文件后显示文件名称
- files.addEventListener("change", function (event) {
- var name = event.target.files[0].name;
- console.log(name)
- $('#uploadFileName').val(name);
- });
- var fileListDisplay = document.getElementById('file-list-display');
- renderFileList = function (data) {
- fileIds += data.id + ',';
- console.log(fileIds);
- $('#fileIds').val(fileIds);
- fileList.push({fileTitle: data.fileTitle, id: data.id, ossUrl: data.ossUrl});
- fileList.forEach(function (file, index) {
- var fileDisplayEl = document.createElement("p");
- var deleteFile = document.createElement("span");
- var viewFile = document.createElement("span");
- var viewFileUrl = document.createElement("a");
- //预览链接
- viewFileUrl.innerHTML = '预览';
- viewFileUrl.setAttribute("onclick", "previewVideo('" + file.ossUrl + "')");
- viewFileUrl.setAttribute("target", "_blank");
- //预览按钮
- viewFile.className = 'viewFile';
- console.log(viewFile);
- viewFile.setAttribute("class","del");
- viewFile.appendChild(viewFileUrl);
- //删除按钮
- deleteFile.innerHTML = '删除';
- deleteFile.className = 'deleteFile';
- console.log(deleteFile);
- deleteFile.setAttribute("class","del");
- deleteFile.setAttribute("onclick", "dataDelete(this, " + file.id + ")");
- fileDisplayEl.setAttribute("id", file.id);
- fileDisplayEl.innerHTML = file.fileTitle;
- fileDisplayEl.appendChild(viewFile);
- fileDisplayEl.appendChild(deleteFile);
- fileListDisplay.appendChild(fileDisplayEl);
- });
- fileList.splice(0, fileList.length);
- };
- })
- //删除参数
- function deleteParam(index) {
- $("#paramRow" + index).remove();
- }
- var content=10;
- //添加正文
- var d=1;
- addDiction =function(dicname,diny,dicTyp){//输入框类型 输入框个数 按钮类型
- $("."+dicname+diny).append("<div class=\"controls "+dicname+d+"\" style=\"margin-left: 0px;margin-top: 5px \">" +
- "<input name=\"textInfo[0].textType\" value =\"1\" type=\"hidden\"/>"+
- "<input htmlEscape=\"false\" class=\"input-xlarge \" placeholder=\"(请输入"+dicTyp+")\"/>" +
- "<button class=\"btn btn-primary\" id=\"1\" type=\"button\" name=\"一级目录\" style=\"margin-left: 15px\" onclick=\"addDiction('"+dicname+"',"+d+",'一级目录'"+")\">一级目录</button>"+
- "<button class=\"btn btn-primary\" id=\"1\" type=\"button\" name=\"二级目录\" style=\"margin-left: 10px\" onclick=\"addDiction('"+dicname+"',"+d+",'二级目录'"+")\">二级目录</button>"+
- "<button class=\"btn btn-primary\" id=\"1\" type=\"button\" name=\"内容\" style=\"margin-left: 10px\" onclick=\"addDiction('"+dicname+"',"+d+",'内容'"+")\">内容</button>"+
- "</div>")
- d=d+1;
- }
- /**
- * @param obj
- * jquery控制input只能输入数字
- */
- function onlynum(obj) {
- obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
- }
- //删除文件
- function dataDelete(that, id) {
- console.log($(that).text());
- $(that).parent().remove();
- var fileIds = $("#fileIds").val();
- if (fileIds.indexOf(id)) {
- fileIds = fileIds.replace(id + ',', '');
- $("#fileIds").val(fileIds);
- }
- $.ajax({
- url: "${ctx}/baike/cmBaikeProduct/deleteFile",
- data: {"fileId": id},
- async: false,
- type: "POST"
- });
- }
- function previewVideo(url) {
- var url = "${ctx}/archive/cmProductArchiveContent/preview?url=" + encodeURIComponent(url);
- var title = "视频播放";
- top.$.jBox("iframe:" + url, {
- iframeScrolling: 'yes',
- width: 1000,
- height: 750,
- persistent: true,
- title: title,
- buttons: {"关闭": '-1'}
- });
- }
- function updateAuditStatus(auditStatus) {
- var elementById = document.getElementById("failReasonDiv");
- if (auditStatus === 2) {
- elementById.style.cssText = "display:none";
- } else {
- elementById.style.cssText = "";
- }
- }
- //关键词联动
- function autocomplete(text) {
- var keywordlist=new Array();
- <c:forEach items="${SearchFrequencyVo}" var="search">
- keywordlist.push("${search.keyword}")
- </c:forEach>
- return keywordlist.filter(function (item) {
- return text && item.indexOf(text) > -1;
- });
- }
- new AutoComplete({
- el: '.auto-input',
- callback: autocomplete,
- offsetLeft: -25
- });
- </script>
- </body>
- </html>
|