国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

567 satır
19KB

  1. var nForm = null;
  2. var nFrame = null;
  3. var picnameObj = null;
  4. var vImg = null;
  5. function GetWinPos(w, h) {
  6. var dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX;
  7. var dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY;
  8. var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
  9. var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
  10. var systemZoom = width / window.screen.availWidth;
  11. var left = (width - w) / 2 / systemZoom + dualScreenLeft;
  12. var top = (height - h) / 2 / systemZoom + dualScreenTop;
  13. return { left: left, top: top };
  14. }
  15. function SeePicNew(f, imgdid, frname, hpos, acname) {
  16. var newobj = null;
  17. if (f.value == '') return;
  18. vImg = $Obj(imgdid);
  19. picnameObj = document.getElementById('picname');
  20. nFrame = $Nav() == $Obj(frname);
  21. nForm = f.form;
  22. if (nForm.detachEvent) nForm.detachEvent("onsubmit", checkSubmit);
  23. else nForm.removeEventListener("submit", checkSubmit, false);
  24. nForm.action = "archives_do.php";
  25. nForm.target = frname;
  26. nForm.dopost.value = "uploadLitpic";
  27. nForm.submit();
  28. picnameObj.value = '';
  29. newobj = $Obj("uploadwait");
  30. if (!newobj) {
  31. newobj = document.createElement("div");
  32. newobj.id = "uploadwait";
  33. newobj.style.position = "absolute";
  34. newobj.className = "uploadwait";
  35. newobj.style.width = 120;
  36. newobj.style.height = 20;
  37. newobj.style.top = hpos;
  38. newobj.style.left = 100;
  39. newobj.style.display = "block";
  40. document.body.appendChild(newobj);
  41. newobj.innerHTML = '<img src="../../static/web/img/loadinglit.gif">';
  42. }
  43. newobj.style.display = "block";
  44. nForm.action = acname;
  45. nForm.dopost.value = "save";
  46. nForm.target = '';
  47. nForm.litpic.disabled = true;
  48. }
  49. function SelectMedia(fname) {
  50. var pos = GetWinPos(800,600);
  51. window.open("./dialog/select_media.php?f=" + fname + "&noeditor=yes", "popUpFlashWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + pos.left + ", top=" + pos.top);
  52. }
  53. function SelectSoft(fname) {
  54. var pos = GetWinPos(800,600);
  55. window.open("./dialog/select_soft.php?f=" + fname+ "&noeditor=yes", "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + pos.left + ", top=" + pos.top);
  56. }
  57. function SelectImage(fname, stype, imgsel="") {
  58. var pos = GetWinPos(800,600);
  59. if (!fname) fname = "form1.picname";
  60. if (imgsel) imgsel = "&noeditor=yes";
  61. if (!stype) stype = "small";
  62. window.open("./dialog/select_images.php?f=" + fname + "&noeditor=yes&imgstick=" + stype + imgsel, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + pos.left + ", top=" + pos.top);
  63. }
  64. function SelectImageN(fname, stype, vname) {
  65. var pos = GetWinPos(800,600);
  66. if (!fname) fname = "form1.picname";
  67. if (!stype) stype = '';
  68. window.open("./dialog/select_images.php?f=" + fname + "&imgstick=" + stype + "&v=" + vname, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + pos.left + ", top=" + pos.top);
  69. }
  70. function SelectKeywords(f) {
  71. var pos = GetWinPos(800,600);
  72. window.open("article_keywords_select.php?f=" + f, "popUpkwWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + pos.left + ", top=" + pos.top);
  73. }
  74. function OpenMyWin(surl) {
  75. var pos = GetWinPos(800,600);
  76. window.open(surl, "popUpMyWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + pos.left + ", top=" + pos.top);
  77. }
  78. function InitPage() {
  79. var selsource = $Obj("selsource");
  80. var selwriter = $Obj("selwriter");
  81. var colorbt = $Obj("color");
  82. if (selsource) {
  83. selsource.onmousedown = function(e) {
  84. SelectSource(e);
  85. }
  86. }
  87. if (selwriter) {
  88. selwriter.onmousedown = function(e) {
  89. SelectWriter(e);
  90. }
  91. }
  92. }
  93. function $Nav() {
  94. if (window.navigator.userAgent.indexOf("Firefox") >= 1) return "FF";
  95. else return "OT";
  96. }
  97. function $Obj(objname) {
  98. return document.getElementById(objname);
  99. }
  100. function ColorSel(c, oname) {
  101. var tobj = $Obj(oname);
  102. if (!tobj) tobj = eval("document.form1." + oname);
  103. if (!tobj) {
  104. $Obj("colordlg").style.display = "none";
  105. return false;
  106. } else {
  107. tobj.value = c;
  108. $Obj("colordlg").style.display = "none";
  109. return true;
  110. }
  111. }
  112. function ShowColor(e, o) {
  113. LoadNewDiv(e, "../../static/web/img/colornew.htm", "colordlg");
  114. }
  115. function ShowHide(objname) {
  116. var obj = $Obj(objname);
  117. if (obj.style.display != "none") obj.style.display = "none";
  118. else obj.style.display = "inline-block";
  119. }
  120. function ShowObj(objname) {
  121. var obj = $Obj(objname);
  122. if (obj == null) return false;
  123. obj.style.display = "table-row";
  124. }
  125. function ShowObjRow(objname) {
  126. var obj = $Obj(objname);
  127. obj.style.display = "table-row";
  128. }
  129. function AddTypeid2() {
  130. ShowObjRow("typeid2tr");
  131. }
  132. function HideObj(objname) {
  133. var obj = $Obj(objname);
  134. if (obj == null) return false;
  135. obj.style.display = "none";
  136. }
  137. function SeePic(img, f) {
  138. if (f.value != '') img.src = f.value;
  139. }
  140. function PutSource(str) {
  141. var osource = $Obj("source");
  142. if (osource) osource.value = str;
  143. $Obj("mysource").style.display = "none";
  144. ChangeFullDiv("hide");
  145. }
  146. function PutWriter(str) {
  147. var owriter = $Obj("writer");
  148. if (owriter) owriter.value = str;
  149. $Obj("mywriter").style.display = "none";
  150. ChangeFullDiv("hide");
  151. }
  152. function ClearDivCt(objname) {
  153. if (!$Obj(objname)) return;
  154. $Obj(objname).innerHTML = '';
  155. $Obj(objname).style.display = "none";
  156. ChangeFullDiv("hide");
  157. }
  158. function ChangeFullDiv(showhide, screenheigt) {
  159. var newobj = $Obj("fullpagediv");
  160. if (showhide == "show") {
  161. if (!newobj) {
  162. newobj = document.createElement("div");
  163. newobj.id = "fullpagediv";
  164. newobj.style.position = "absolute";
  165. newobj.className = "fullpagediv";
  166. newobj.style.height = document.body.clientHeight + 50 + "px";
  167. document.body.appendChild(newobj);
  168. } else {
  169. newobj.style.display = "block";
  170. }
  171. } else {
  172. if (newobj) newobj.style.display = "none";
  173. }
  174. }
  175. function SelectSource(e) {
  176. LoadNewDiv(e, "article_select_sw.php?t=source&k=8&rnd=" + Math.random(), "mysource");
  177. }
  178. function SelectWriter(e) {
  179. LoadNewDiv(e, "article_select_sw.php?t=writer&k=8&rnd=" + Math.random(), "mywriter");
  180. }
  181. function LoadNewDiv(e, surl, oname) {
  182. var pxStr = '';
  183. posLeft = posLeft - 100;
  184. var newobj = $Obj(oname);
  185. if (!newobj) {
  186. newobj = document.createElement("div");
  187. newobj.id = oname;
  188. newobj.style.position = "absolute";
  189. newobj.className = oname;
  190. newobj.className += " dlgws";
  191. newobj.style.top = posTop + pxStr;
  192. newobj.style.left = posLeft + pxStr;
  193. document.body.appendChild(newobj);
  194. } else {
  195. newobj.style.display = "block";
  196. }
  197. if (newobj.innerHTML.length < 10) {
  198. fetch(surl).then(resp => resp.text()).then((d) => { newobj.innerHTML = d });
  199. }
  200. }
  201. function LoadNewDiv2(e, surl, oname, dlgcls) {
  202. var posLeft = 300;
  203. var posTop = 50;
  204. var newobj = $Obj(oname);
  205. if (!newobj) {
  206. newobj = document.createElement("div");
  207. newobj.id = oname;
  208. newobj.style.position = "absolute";
  209. newobj.className = dlgcls;
  210. newobj.style.top = posTop;
  211. newobj.style.left = posLeft;
  212. newobj.style.display = "none";
  213. document.body.appendChild(newobj);
  214. }
  215. newobj.innerHTML = '';
  216. fetch(surl).then(resp => resp.text()).then((d) => {
  217. newobj.innerHTML = d;
  218. });
  219. if (newobj.innerHTML == '') newobj.style.display = "none";
  220. else newobj.style.display = "block";
  221. jQuery(newobj).css("top", "50px").css("left", "300px");
  222. DedeXHTTP = null;
  223. }
  224. function ShowUrlTr() {
  225. var jumpTest = $Obj("flagsj");
  226. var jtr = $Obj("redirecturltr");
  227. var jf = $Obj("redirecturl");
  228. if (jumpTest.checked) jtr.style.display = "block";
  229. else {
  230. jf.value = '';
  231. jtr.style.display = "none";
  232. }
  233. }
  234. function ShowUrlTrEdit() {
  235. ShowUrlTr();
  236. var jumpTest = $Obj("isjump");
  237. var rurl = $Obj("redirecturl");
  238. if (!jumpTest.checked) rurl.value = "";
  239. }
  240. function LoadQuickDiv(e, surl, oname, w, h) {
  241. var newobj = $Obj(oname);
  242. if (!newobj) {
  243. newobj = document.createElement("div");
  244. newobj.id = oname;
  245. newobj.style.position = "fixed";
  246. newobj.className = "pubdlg";
  247. newobj.style.width = w;
  248. newobj.style.height = h + 30;
  249. document.body.appendChild(newobj);
  250. }
  251. newobj.style.top = "50%";
  252. newobj.style.left = "50%";
  253. newobj.style.display = "block";
  254. newobj.style.transform = "translate(-50%, -201px)";
  255. newobj.innerHTML = '<img src="../../static/web/img/loadinglit.gif">';
  256. fetch(surl).then(resp => resp.text()).then((d) => {
  257. newobj.innerHTML = d;
  258. });
  259. }
  260. function ShowCatMap(e, obj, cid, targetId, oldvalue) {
  261. LoadQuickDiv(e, "archives_do.php?dopost=getCatMap&targetid=" + targetId + "&channelid=" + cid + "&oldvalue=" + oldvalue + "&rnd=" + Math.random(), "getCatMap", "700px", "500px");
  262. ChangeFullDiv("show");
  263. }
  264. function getSelCat(targetId) {
  265. var selBox = document.quicksel.seltypeid;
  266. var targetObj = $Obj(targetId);
  267. var selvalue = '';
  268. if (targetId == 'typeid2') {
  269. var j = 0;
  270. for (var i = 0; i < selBox.length; i++) {
  271. if (selBox[i].checked) {
  272. j++;
  273. if (j == 10) break;
  274. selvalue += (selvalue == '' ? selBox[i].value : ',' + selBox[i].value);
  275. }
  276. }
  277. if (targetObj) targetObj.value = selvalue;
  278. } else {
  279. if (selBox) {
  280. for (var i = 0; i < selBox.length; i++) {
  281. if (selBox[i].checked) selvalue = selBox[i].value;
  282. }
  283. }
  284. if (selvalue == '') {
  285. alert("您没有选中任何栏目");
  286. return;
  287. }
  288. if (targetObj) {
  289. for (var j = 0; j < targetObj.length; j++) {
  290. op = targetObj.options[j];
  291. if (op.value == selvalue) op.selected = true;
  292. }
  293. }
  294. }
  295. HideObj("getCatMap");
  296. ChangeFullDiv("hide");
  297. }
  298. //生成一个随机id
  299. function guid() {
  300. function S4() {
  301. return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
  302. }
  303. return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
  304. }
  305. var _DedeConfirmFuncs = {};
  306. var _DedeConfirmFuncsClose = {};
  307. function __DedeConfirmRun(modalID) {
  308. _DedeConfirmFuncs[modalID]();
  309. }
  310. function __DedeConfirmRunClose(modalID) {
  311. _DedeConfirmFuncsClose[modalID]();
  312. }
  313. function DedeConfirm(content = "", title = "确认提示") {
  314. let modalID = guid();
  315. return new Promise((resolve, reject) => {
  316. _DedeConfirmFuncs[modalID] = ()=>{
  317. resolve("success");
  318. CloseModal(`DedeModal${modalID}`);
  319. }
  320. _DedeConfirmFuncsClose[modalID] = ()=>{
  321. reject("cancel");
  322. CloseModal(`DedeModal${modalID}`);
  323. }
  324. let footer = `<button type="button" class="btn btn-outline-success btn-sm" onclick="__DedeConfirmRunClose(\'${modalID}\')">取消</button><button type="button" class="btn btn-success btn-sm" onclick="__DedeConfirmRun(\'${modalID}\')">确定</button>`;
  325. let modal = `<div id="DedeModal${modalID}" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="DedeModalLabel${modalID}"><div class="modal-dialog modal-dialog-centered" role="document"><div class="modal-content"><div class="modal-header"><h6 class="modal-title" id="DedeModalLabel${modalID}">${title}</h6>`;
  326. modal += `<button type="button" class="update-close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i></button>`;
  327. modal += `</div><div class="modal-body">${content}</div><div class="modal-footer">${footer}</div></div></div></div>`;
  328. $("body").append(modal)
  329. $("#DedeModal" + modalID).modal({
  330. backdrop: 'static',
  331. show: true
  332. });
  333. $("#DedeModal" + modalID).on('hidden.bs.modal', function(e) {
  334. $("#DedeModal" + modalID).remove();
  335. })
  336. })
  337. }
  338. //函数会返回一个modalID,通过这个id可自已定义一些方法,这里用到了一个展开语法:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax
  339. function ShowMsg(content, ...args) {
  340. title = "系统提示";
  341. size = "";
  342. if (typeof content == "undefined") content = "";
  343. modalID = guid();
  344. var footer = `<button type="button" class="btn btn-primary btn-sm" onclick="CloseModal(\'GKModal${modalID}\')">确定</button>`;
  345. var noClose = false;
  346. if (args.length == 1) {
  347. //存在args参数
  348. if (typeof args[0].title !== 'undefined' && args[0].title != "") {
  349. title = args[0].title;
  350. }
  351. if (typeof args[0].footer !== 'undefined' && args[0].footer != "") {
  352. footer = args[0].footer;
  353. }
  354. if (typeof args[0].size !== 'undefined' && args[0].size != "") {
  355. size = args[0].size;
  356. }
  357. if (typeof args[0].noClose !== 'undefined' && args[0].noClose == true) {
  358. noClose = true;
  359. }
  360. }
  361. footer = footer.replaceAll("~modalID~", modalID);
  362. content = content.replaceAll("~modalID~", modalID);
  363. var modal = `<div id="GKModal${modalID}" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="GKModalLabel${modalID}"><div class="modal-dialog ${size}" role="document"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="GKModalLabel${modalID}">${title}</h5>`;
  364. if (!noClose) {
  365. modal += `<button type="button" class="update-close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i></button>`;
  366. }
  367. modal += `</div><div class="modal-body">${content}</div><div class="modal-footer">${footer}</div></div></div></div>`;
  368. $("body").append(modal)
  369. $("#GKModal" + modalID).modal({
  370. backdrop: 'static',
  371. show: true
  372. });
  373. $("#GKModal" + modalID).on('hidden.bs.modal', function(e) {
  374. $("#GKModal" + modalID).remove();
  375. })
  376. return modalID;
  377. }
  378. //隐藏并销毁modal
  379. function CloseModal(modalID) {
  380. $("#" + modalID).modal('hide');
  381. $("#" + modalID).on('hidden.bs.modal', function(e) {
  382. if ($("#" + modalID).length > 0) {
  383. $("#" + modalID).remove();
  384. }
  385. })
  386. }
  387. //获取缩略图
  388. var litpicImgSrc = "";
  389. var litpicImg = "";
  390. var mdlCropperID = "";
  391. var optCropper = {
  392. preview: ".pv",
  393. crop: function(e) {
  394. $("#cropWidth").text(Math.round(e.detail.height));
  395. $("#cropHeight").text(Math.round(e.detail.width));
  396. if ($(this).cropper("getCroppedCanvas")) {
  397. var dataUrl = $(this).cropper("getCroppedCanvas").toDataURL();
  398. litpicImg = dataUrl;
  399. $("#litPic").attr("src", litpicImg);
  400. }
  401. },
  402. aspectRatio: 4 / 3,
  403. cropend: function(data) {
  404. var dataUrl = $(this).cropper("getCroppedCanvas").toDataURL();
  405. litpicImg = dataUrl;
  406. $("#litPic").attr("src", litpicImg);
  407. $("#litpic_b64").val(litpicImg);
  408. }
  409. }
  410. var cropperAspectRatio = {
  411. 0: 16 / 9,
  412. 1: 4 / 3,
  413. 2: 1 / 1,
  414. 3: 2 / 3,
  415. 4: NaN,
  416. }
  417. function setAspectRatio(ar) {
  418. var opts = optCropper;
  419. opts.aspectRatio = cropperAspectRatio[ar];
  420. $("#cropImg" + mdlCropperID).cropper("destroy").cropper(opts);
  421. }
  422. function okImage(modalID) {
  423. uploadImage(litpicImg);
  424. $("#litPic").attr("src", litpicImg);
  425. CloseModal("GKModal" + modalID);
  426. }
  427. function useDefault(modalID) {
  428. uploadImage(litpicImgSrc);
  429. $("#litPic").attr("src", litpicImgSrc);
  430. CloseModal("GKModal" + modalID);
  431. }
  432. function uploadImage(litpicImgSrc) {
  433. const formData = new FormData()
  434. formData.append("litpic_b64", litpicImgSrc);
  435. fetch("archives_do.php?dopost=upload_base64_image", {
  436. method: 'POST',
  437. body: formData
  438. })
  439. .then(r => {
  440. if (r.ok) {
  441. return r.json()
  442. }
  443. throw new Error(errMsg);
  444. })
  445. .then(d => {
  446. if (d.code == 200) {
  447. $("#picname").val(d.data.image_url);
  448. }
  449. }).catch((error) => {
  450. alert("上传缩略图错误");
  451. });
  452. }
  453. function SetThumb(srcURL) {
  454. var footer = "<p><a href='javascript:useDefault(\"~modalID~\");' class='btn btn-success btn-sm'>使用原图</a><a href='javascript:okImage(\"~modalID~\")' class='btn btn-success btn-sm'>确定</a></p>";
  455. var optButton = `<p><label for="aspectRatio">比例</label><select id="aspectRatio" onchange="setAspectRatio(this.selectedIndex)"><option>16:9</option><option selected>4:3</option><option>1:1</option><option>2:3</option><option>自定义</option></select></p>`;
  456. mdlCropperID = ShowMsg('<div class="float-left" style="width:320px"><p><img id="cropImg~modalID~" src="' + srcURL + '"></p><p>宽度:<span id="cropWidth"></span>px,高度:<span id="cropHeight"></span>px</p>' + optButton + '</div><div class="pv float-right" style="width:200px;height:100px;overflow:hidden"></div>', {
  457. footer: footer,
  458. noClose: false,
  459. title: '图片裁剪',
  460. });
  461. setTimeout(function() {
  462. $("#cropImg" + mdlCropperID).cropper(optCropper);
  463. }, 500);
  464. }
  465. $(document).ready(function() {
  466. $("#togglemenu").click(function() {
  467. if ($("body").attr("class") == "showmenu") {
  468. $("body").attr("class", "hidemenu");
  469. $(this).html('<i class="fa fa-indent"></i>');
  470. } else {
  471. $("body").attr("class", "showmenu");
  472. $(this).html('<i class="fa fa-dedent"></i>');
  473. }
  474. });
  475. $(function() {
  476. var menu = function(el, multiple) {
  477. this.el = el || {};
  478. this.multiple = multiple || false;
  479. var links = this.el.find(".link");
  480. links.on("click", {
  481. el: this.el,
  482. multiple: this.multiple,
  483. },
  484. this.dropdown);
  485. }
  486. menu.prototype.dropdown = function(e) {
  487. var $el = e.data.el;
  488. $this = $(this),
  489. $next = $this.next();
  490. $next.slideToggle();
  491. $this.parent().toggleClass("open");
  492. if (!e.data.multiple) {
  493. $el.find(".submenu").not($next).slideUp().parent().removeClass("open");
  494. }
  495. }
  496. var menu = new menu($('#menu'), false);
  497. $(".submenu li a").click(function(e) {
  498. $(".submenu li").removeClass("active");
  499. $(this).parent().addClass("active");
  500. });
  501. });
  502. $("#btnClearAll").click(function(event) {
  503. litpicImgSrc = '';
  504. litpicImg = '';
  505. $("#picname").val(litpicImg);
  506. $("#litPic").attr("src", "/static/web/img/thumbnail.jpg");
  507. })
  508. $("#iptAddImages").change(function(event) {
  509. var files = event.target.files;
  510. for (var i = 0, f; f = files[i]; i++) {
  511. if (!f.type.match('image.*')) {
  512. continue;
  513. }
  514. var reader = new FileReader();
  515. reader.onload = (function(theFile) {
  516. return function(e) {
  517. litpicImgSrc = e.target.result;
  518. if (cfg_uplitpic_cut == 'Y') {
  519. SetThumb(litpicImgSrc);
  520. } else {
  521. uploadImage(litpicImgSrc);
  522. $("#litPic").attr("src", litpicImgSrc);
  523. }
  524. };
  525. })(f);
  526. reader.readAsDataURL(f);
  527. }
  528. $("#iptAddImages").val("");
  529. });
  530. if ($.fn.daterangepicker) {
  531. $(".datepicker").daterangepicker({
  532. "singleDatePicker": true,
  533. "autoApply": true,
  534. "showDropdowns": true,
  535. "linkedCalendars": false,
  536. "timePicker": true,
  537. "timePicker24Hour": true,
  538. "timePickerSeconds": true,
  539. "showCustomRangeLabel": false,
  540. "drops": "up",
  541. ranges: {
  542. '今日': [moment(), moment()],
  543. '昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  544. '本月': [moment().startOf('month'), moment().startOf('month')],
  545. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').startOf('month')]
  546. },
  547. "locale": {
  548. format: 'YYYY-MM-DD HH:mm:ss',
  549. applyLabel: '确定',
  550. cancelLabel: '取消',
  551. daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
  552. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  553. firstDay: 1
  554. }
  555. }, function(start) {
  556. $(this).val(start.format("YYYY-MM-DD HH:mm:ss"));
  557. });
  558. $(".datepicker").on("show.daterangepicker", function(ev, picker) {
  559. if (picker.element.offset().top - $(window).scrollTop() + picker.container.outerHeight() > $(window).height()) {
  560. picker.drops = "up";
  561. } else {
  562. picker.drops = "down";
  563. }
  564. picker.move();
  565. });
  566. }
  567. });