ReleaseNoteDetail.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>Flyinsono Release Note</title>
  6. <link rel="shortcut icon" href="ReleaseNoteStyle/favicon.ico" type="image/x-icon">
  7. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  8. <meta name="renderer" content="webkit">
  9. <meta name="viewport" content="width=1280">
  10. <!--这个有用,注释掉会导致字体加粗-->
  11. <!--<link rel="stylesheet" href="ReleaseNoteStyle/portal-default_online.css">-->
  12. <link rel="stylesheet" href="ReleaseNoteStyle/c58c28943d93be3faf80.css" data-n-g="">
  13. <link rel="stylesheet" href="ReleaseNoteStyle/b3a4bbbac517f65cbfc0.css" data-n-p="">
  14. <link rel="stylesheet" href="ReleaseNoteStyle/main.css" data-n-p="">
  15. <script src="ReleaseNoteStyle/jquery-3.4.1.js"></script>
  16. <script src="ReleaseNoteStyle/xlsx.core.min.js"></script>
  17. <style>
  18. .loadingMore {
  19. color: #fff;
  20. background: #2468f2;
  21. border: 1px solid rgba(0,0,0,0.1);
  22. border-radius: 100px;
  23. display: block;
  24. text-decoration: none;
  25. text-align: center;
  26. -webkit-box-sizing: border-box;
  27. -moz-box-sizing: border-box;
  28. box-sizing: border-box;
  29. width: 140px;
  30. height: 38px;
  31. font-size: 14px;
  32. line-height: 36px;
  33. margin: 40px auto 0 auto;
  34. -webkit-transition: all 0.2s ease-in-out;
  35. -moz-transition: all 0.2s ease-in-out;
  36. -ms-transition: all 0.2s ease-in-out;
  37. -o-transition: all 0.2s ease-in-out;
  38. transition: all 0.2s ease-in-out;
  39. }
  40. .H4A {
  41. text-decoration: underline;
  42. margin: 0;
  43. padding: 0;
  44. font-style: normal;
  45. color: black;
  46. font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;
  47. -webkit-font-smoothing: antialiased;
  48. font-size: 14px;
  49. font-weight: bold;
  50. text-align: -webkit-match-parent;
  51. list-style: none;
  52. }
  53. .interfaceA {
  54. text-decoration: underline;
  55. font-weight: 600;
  56. color: black;
  57. font-size: 14px;
  58. }
  59. .interfaceTitle {
  60. text-decoration: underline;
  61. font-weight: 600;
  62. color: white;
  63. font-family: PingFangSC-Regular;
  64. font-size: 16px;
  65. }
  66. </style>
  67. </head>
  68. <body class="portal-colud-contrast">
  69. <div id="__next">
  70. <div class="qCTvEXcR">
  71. <section id="banner" class="oXwjpy3I">
  72. <div class="width1180-center">
  73. <h1 style="padding-top: 18px;">新版杏聆荟JsonRPC服务接口 Release Notes</h1>
  74. <div class="nav-search home-search" style="margin-top: 10px; width: 50%; left: 25%; ">
  75. <span class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-input-search-with-button global-workbench-searcher content-input ant-input-group-wrapper-lg">
  76. <span class="ant-input-wrapper ant-input-group">
  77. <span class="ant-input-affix-wrapper ant-input-affix-wrapper-lg">
  78. <span class="ant-input-prefix">
  79. <i class="oa-iconfont icon-search"></i>
  80. </span>
  81. <input placeholder="搜索当前部署包接口名称" id="txtSearchKeyword" class="ant-input ant-input-lg" type="text" value="" data-spm-anchor-id="api-workbench.home.0.i1.698d1e0fkHOuQC" onkeydown="searchClick(event)">
  82. <span class="ant-input-suffix">
  83. <span class="ant-input-clear-icon ant-input-clear-icon-hidden" role="button" tabindex="-1">
  84. <span role="img" aria-label="close-circle" class="anticon anticon-close-circle">
  85. <svg viewBox="64 64 896 896" focusable="false" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true">
  86. <path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"></path>
  87. </svg>
  88. </span>
  89. </span>
  90. </span>
  91. </span>
  92. <span class="ant-input-group-addon" onclick="searchBottonClick()">
  93. <button type="button" class="ant-btn ant-btn-primary ant-btn-lg ant-input-search-button" ant-click-animating-without-extra-node="false">
  94. <span data-spm-anchor-id="api-workbench.home.0.i0.698d1e0fkHOuQC">搜 索</span>
  95. </button>
  96. </span>
  97. </span>
  98. </span>
  99. </div>
  100. <p id="serverPath"></p>
  101. <p id="docHtmlPath"></p>
  102. <p id="interfaceDllVersion"></p>
  103. </div>
  104. </section>
  105. <section id="sdk-server" class="e6d_jOXn EAqN7jIh" style="background:#fff;">
  106. <div class="width1180-center" style="width: 1430px;">
  107. <h4 class="title" style="padding-top: 2px;"></h4>
  108. <ul class="__0peh9eaM" style="background: #f5f8fa;padding-top:54px;margin-top:0px;">
  109. <li id="historyVersion" class="__9nuz8_Oa" style="font-size:26px;font-weight:600;" onclick="chooseType(0);">版本历史</li>
  110. <li id="interfaceUpdateList" style="font-size:26px;font-weight:600;" onclick="chooseType(1);">接口更新列表</li>
  111. </ul>
  112. <div class="Z8Q7b6Lk" id="tblInterfaceLibrary" style="margin-top:0px;">
  113. </div>
  114. <input type="hidden" id="hdVersionLoadingCount" value="10" />
  115. <input type="hidden" id="hdInterfaceUpldateListCount" value="50" />
  116. <input type="hidden" id="hdActiveLi" value="historyVersion" />
  117. <input type="hidden" id="hdActiveVersion" value="" />
  118. </div>
  119. <div id="divLoadingMore" style="display:none;">
  120. <a class="loadingMore" href="javascript:loadingMoreClick()"><span id="loadingMoreSpan">加载更多</span></a>
  121. </div>
  122. </section>
  123. </div>
  124. </div>
  125. <script>
  126. function searchClick() {
  127. var e = e || event;
  128. if (e.keyCode == 13) {
  129. searchBottonClick();
  130. }
  131. }
  132. function searchBottonClick() {
  133. $("#interfaceUpdateList").addClass('__9nuz8_Oa');
  134. $("#historyVersion").removeClass('__9nuz8_Oa');
  135. $("#hdActiveLi").val("interfaceUpdateList");
  136. $("#hdInterfaceUpldateListCount").val(100);
  137. loadingInterfaceData(1);
  138. }
  139. function loadingMoreClick() {
  140. var activeItem = $("#hdActiveLi").val();
  141. if (activeItem === "historyVersion") {
  142. loadingVersionData(1);
  143. }
  144. else {
  145. loadingInterfaceData(1);
  146. }
  147. }
  148. var versionDatas = [];
  149. var interfaceDatas = [];
  150. function chooseType(type) {
  151. if (type === 0) {
  152. var loadingCount = parseInt($("#hdVersionLoadingCount").val());
  153. if (loadingCount > 20) {
  154. $("#loadingMoreSpan").html("加载全部");
  155. }
  156. else {
  157. $("#loadingMoreSpan").html("加载更多");
  158. }
  159. //版本历史
  160. $("#historyVersion").addClass('__9nuz8_Oa');
  161. $("#interfaceUpdateList").removeClass('__9nuz8_Oa');
  162. $("#hdActiveLi").val("historyVersion");
  163. loadingVersionData(0);
  164. }
  165. else {
  166. var loadingCount = parseInt($("#hdInterfaceUpldateListCount").val());
  167. if (loadingCount > 20) {
  168. $("#loadingMoreSpan").html("加载全部");
  169. }
  170. else {
  171. $("#loadingMoreSpan").html("加载更多");
  172. }
  173. //数据详情
  174. $("#interfaceUpdateList").addClass('__9nuz8_Oa');
  175. $("#historyVersion").removeClass('__9nuz8_Oa');
  176. $("#hdActiveLi").val("interfaceUpdateList");
  177. loadingInterfaceData(0);
  178. }
  179. }
  180. function readFile(filePath) {
  181. let xhr = new XMLHttpRequest();
  182. xhr.responseType = "blob";
  183. xhr.open('GET', filePath, true);
  184. xhr.onload = function () {
  185. if (this.status === 200) {
  186. var blob = this.response;
  187. let file = new window.File([blob], 'JSON.xlsx');
  188. var fileReader = new FileReader();
  189. fileReader.readAsBinaryString(file);
  190. fileReader.onload = function (ev) {
  191. var data = ev.target.result;
  192. var workbook = XLSX.read(data, {
  193. type: 'binary'
  194. }) // 以二进制流方式读取得到整份excel表格对象
  195. var excelDatas = [];
  196. // 遍历每张表读取
  197. for (var sheet in workbook.Sheets) {
  198. if (workbook.Sheets.hasOwnProperty(sheet)) {
  199. var dataList = [];
  200. dataList = dataList.concat(XLSX.utils.sheet_to_json(workbook.Sheets[sheet]));
  201. var entity = {
  202. "name": sheet,
  203. "datas": dataList
  204. }
  205. excelDatas.push(entity);
  206. }
  207. }
  208. if (excelDatas && excelDatas.length >= 3) {
  209. var versionList = excelDatas[0].datas;
  210. if (versionList && versionList.length > 0) {
  211. versionList.sort(compare("更新时间", 'inverted'));
  212. versionDatas = versionList;
  213. var activeVersion = versionDatas[0]["部署包"];
  214. $("#hdActiveVersion").val(activeVersion);
  215. loadingVersionData(0);
  216. }
  217. var noteList = excelDatas[1].datas;
  218. if (noteList && noteList.length > 0) {
  219. var noteInfo = noteList[0];
  220. var serverPathStr = "服务器发布地址:" + noteInfo["服务器发布地址"];
  221. //window.localStorage.setItem("CurrentPackagePublishInfo", serverPathStr);
  222. $("#serverPath").html(serverPathStr);
  223. var docHtmlPathStr = "<a target='_blank' class='interfaceTitle' href='DocHtml.html'>JsonRPC接口文档</a>";
  224. $("#docHtmlPath").html(docHtmlPathStr);
  225. var interfaceDllVersionStr = "<a target='_blank' class='interfaceTitle' href='WingInterfaceLibrary.dll'>WingInterfaceLibrary版本:" + noteInfo["WingInterfaceLibrary版本"] + '</a>';
  226. $("#interfaceDllVersion").html(interfaceDllVersionStr);
  227. }
  228. var interfaceList = excelDatas[2].datas;
  229. if (interfaceList && interfaceList.length > 0) {
  230. interfaceList.sort(compare("发布时间", 'inverted'));
  231. interfaceDatas = interfaceList;
  232. //loadingInterfaceData(0);
  233. // var activeInterfaceDatas = interfaceDatas.filter(c => c["部署包"] === activeVersion);
  234. // if (activeInterfaceDatas && activeInterfaceDatas.length > 0) {
  235. // var str = JSON.stringify(activeInterfaceDatas);
  236. // window.localStorage.setItem("CurrentInterfaceUpdateDatas", str);
  237. // }
  238. }
  239. }
  240. else {
  241. console.log("数据格式错误,错误数据为:", excelDatas);
  242. }
  243. }
  244. }
  245. };
  246. xhr.send();
  247. }
  248. function loadingVersionData(type) {
  249. if (versionDatas && versionDatas.length > 0) {
  250. var loadingCount = parseInt($("#hdVersionLoadingCount").val());
  251. if (type === 1) {
  252. if (loadingCount > 20) {
  253. loadingCount = versionDatas.length;
  254. }
  255. else {
  256. loadingCount += 20;
  257. if (loadingCount > 20) {
  258. $("#loadingMoreSpan").html("加载全部");
  259. }
  260. else {
  261. $("#loadingMoreSpan").html("加载更多");
  262. }
  263. }
  264. }
  265. var htmlStr = '<ul class="n8w6ZLJg">';
  266. htmlStr += '<li class="uH207xEy">';
  267. htmlStr += '<h4 class="iC_rkcfC" style="font-size:15px;font-weight:bold;flex:0 0 215px">部署包</h4>';
  268. htmlStr += '<span class="G5g56xYQ" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 200px">版本号</span>';
  269. htmlStr += '<span class="G5g56xYQ" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 580px">更新描述</span>';
  270. htmlStr += '<span class="Ba9M5N1G" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 200px">更新时间</span>';
  271. htmlStr += '<span class="UpIf0JYT" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 200px">更新人</span>';
  272. htmlStr += '</li>'
  273. versionDatas.forEach((dt, index) => {
  274. if (index < loadingCount) {
  275. htmlStr += '<li>';
  276. htmlStr += '<h4 class="iC_rkcfC" style="flex: 0 0 225px"><a class="H4A" style="cursor: pointer;" href="javascript:versionDetailClick(\'' + dt["部署包"] + '\')">' + dt["部署包"] + '</a></h4>';
  277. htmlStr += '<span class="G5g56xYQ" style="flex: 0 0 200px">' + dt["版本号"] + '</span>';
  278. htmlStr += '<span class="G5g56xYQ" style="flex: 0 0 580px">' + replaceAll(dt["更新描述"], '\n', '<br />') + '</span>';
  279. htmlStr += '<span class="Ba9M5N1G" style="flex: 0 0 200px">' + dateFormat(dt["更新时间"], 'yyyy-MM-dd') + '</span>';
  280. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 200px">' + dt["更新人"] + '</span>';
  281. htmlStr += '</li>';
  282. }
  283. });
  284. htmlStr += "</ul>";
  285. $("#tblInterfaceLibrary").html(htmlStr);
  286. $("#hdVersionLoadingCount").val(loadingCount)
  287. if (versionDatas.length > loadingCount) {
  288. //显示加载更多
  289. $("#divLoadingMore").show();
  290. }
  291. else {
  292. //隐藏加载更多
  293. $("#divLoadingMore").hide();
  294. }
  295. }
  296. }
  297. function versionDetailClick(version) {
  298. if (version && version.length > 0) {
  299. $("#hdActiveVersion").val(version);
  300. $("#hdInterfaceUpldateListCount").val(50);
  301. var keyword = $("#txtSearchKeyword").val();
  302. if (keyword) {
  303. keyword = keyword.trim();
  304. if (keyword.length > 0) {
  305. searchBottonClick();
  306. return;
  307. }
  308. }
  309. chooseType(1);
  310. }
  311. }
  312. function loadingInterfaceData(type) {
  313. if (interfaceDatas && interfaceDatas.length > 0) {
  314. var keyword = $("#txtSearchKeyword").val();
  315. if (keyword) {
  316. keyword = keyword.trim().toLowerCase();
  317. }
  318. var loadingCount = parseInt($("#hdInterfaceUpldateListCount").val());
  319. var activeVersion = $("#hdActiveVersion").val();
  320. var activeInterfaceDatas = interfaceDatas.filter(c => c["部署包"] === activeVersion);
  321. if (type === 1) {
  322. if (loadingCount > 20) {
  323. loadingCount = activeInterfaceDatas.length;
  324. }
  325. else {
  326. loadingCount += 20;
  327. if (loadingCount > 20) {
  328. $("#loadingMoreSpan").html("加载全部");
  329. }
  330. else {
  331. $("#loadingMoreSpan").html("加载更多");
  332. }
  333. }
  334. }
  335. var htmlStr = '<ul class="n8w6ZLJg">';
  336. htmlStr += '<li class="uH207xEy">';
  337. htmlStr += '<h4 class="iC_rkcfC" style="font-size:15px;flex:0 0 110px;font-weight:bold;">发布时间</h4>';
  338. htmlStr += '<span class="G5g56xYQ" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 230px">接口名称</span>';
  339. htmlStr += '<span class="Ba9M5N1G" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 515px">描述</span>';
  340. htmlStr += '<span class="UpIf0JYT" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 115px">自动化测试</span>';
  341. htmlStr += '<span class="UpIf0JYT" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 75px">增/改</span>';
  342. htmlStr += '<span class="UpIf0JYT" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 140px">部署包</span>';
  343. htmlStr += '<span class="UpIf0JYT" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 90px">版本号</span>';
  344. htmlStr += '<span class="UpIf0JYT" style="color: #2468f2; font-family: inherit; font-size: 15px; font-weight: 600; flex: 0 0 110px">开发人员</span>';
  345. htmlStr += '</li>';
  346. if (activeInterfaceDatas && activeInterfaceDatas.length > 0) {
  347. var str = JSON.stringify(activeInterfaceDatas);
  348. window.localStorage.setItem("CurrentInterfaceUpdateDatas", str);
  349. activeInterfaceDatas.forEach((dt, index) => {
  350. if (index < loadingCount) {
  351. if (keyword && keyword.length > 0) {
  352. if (dt["接口名称"].toLowerCase().indexOf(keyword) > -1) {
  353. //找到
  354. htmlStr += '<li>';
  355. htmlStr += '<h4 class="iC_rkcfC H4A" style="flex: 0 0 110px;font-size:12px;text-decoration:none;opacity: 0.6;">' + dateFormat(dt["发布时间"], 'yyyy-MM-dd') + '</h4>';
  356. htmlStr += '<span class="G5g56xYQ" style="flex: 0 0 230px;opacity: 1;"><a target="_blank" class="interfaceA" href="http://192.168.6.117:7301/DocHtml.html?key=' + dt["接口名称"] + '">' + dt["接口名称"] + '</a></span>';
  357. htmlStr += '<span class="Ba9M5N1G" style="flex: 0 0 515px;font-size:12px;">' + replaceAll(dt["描述"], '\n', '<br />') + '</span>';
  358. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 115px;">'
  359. if (dt["自动化测试"] && dt["自动化测试"] === "无测试用例") {
  360. htmlStr += '<span style="background-color: orange;font-size:12px;font-weight: 600;">' + dt["自动化测试"] + '</span>';
  361. }
  362. else {
  363. htmlStr += '<span style="background-color: greenyellow;font-size:14px;font-weight: 600;">' + dt["自动化测试"] + '</span>';
  364. }
  365. htmlStr += '</span>';
  366. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 75px;font-size:12px;">' + dt["增/改"] + '</span>';
  367. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 140px;font-size:12px;">' + dt["部署包"] + '</span>';
  368. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 90px;font-size:12px;">' + dt["版本号"] + '</span>';
  369. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 110px;font-size:12px;">' + dt["开发人员"] + '</span>';
  370. htmlStr += '</li>';
  371. }
  372. //未找到,不处理
  373. }
  374. else {
  375. htmlStr += '<li>';
  376. htmlStr += '<h4 class="iC_rkcfC H4A" style="flex: 0 0 110px;font-size:12px;text-decoration:none;opacity: 0.6;">' + dateFormat(dt["发布时间"], 'yyyy-MM-dd') + '</h4>';
  377. htmlStr += '<span class="G5g56xYQ" style="flex: 0 0 230px;opacity: 1;"><a target="_blank" class="interfaceA" href="http://192.168.6.117:7301/DocHtml.html?key=' + dt["接口名称"] + '">' + dt["接口名称"] + '</a></span>';
  378. htmlStr += '<span class="Ba9M5N1G" style="flex: 0 0 515px;font-size:12px;">' + replaceAll(dt["描述"], '\n', '<br />') + '</span>';
  379. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 115px;">'
  380. if (dt["自动化测试"] && dt["自动化测试"] === "无测试用例") {
  381. htmlStr += '<span style="background-color: orange;font-size:12px;font-weight: 600;">' + dt["自动化测试"] + '</span>';
  382. }
  383. else {
  384. htmlStr += '<span style="background-color: greenyellow;font-size:14px;font-weight: 600;">' + dt["自动化测试"] + '</span>';
  385. }
  386. htmlStr += '</span>';
  387. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 75px;font-size:12px;">' + dt["增/改"] + '</span>';
  388. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 140px;font-size:12px;">' + dt["部署包"] + '</span>';
  389. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 90px;font-size:12px;">' + dt["版本号"] + '</span>';
  390. htmlStr += '<span class="UpIf0JYT" style="flex: 0 0 110px;font-size:12px;">' + dt["开发人员"] + '</span>';
  391. htmlStr += '</li>';
  392. }
  393. }
  394. });
  395. }
  396. htmlStr += "</ul>";
  397. $("#tblInterfaceLibrary").html(htmlStr);
  398. $("#hdInterfaceUpldateListCount").val(loadingCount)
  399. if (activeInterfaceDatas && activeInterfaceDatas.length > loadingCount) {
  400. //显示加载更多
  401. $("#divLoadingMore").show();
  402. }
  403. else {
  404. //隐藏加载更多
  405. $("#divLoadingMore").hide();
  406. }
  407. }
  408. }
  409. $(document).ready(function () {
  410. readFile('ReleaseNoteStyle/新版杏聆荟ReleaseNotes.xlsx');
  411. });
  412. //排序
  413. function compare(prop, align) {
  414. return function (a, b) {
  415. var value1 = a[prop];
  416. var value2 = b[prop];
  417. if (align == "positive") {//正序
  418. return new Date(value1) - new Date(value2);
  419. } else if (align == "inverted") {//倒序
  420. return new Date(value2) - new Date(value1);
  421. }
  422. }
  423. }
  424. function dateFormat(date, fmt = 'yyyy-MM-dd hh:mm:ss') {
  425. date = new Date(date)
  426. var o = {
  427. "M+": date.getMonth() + 1, //月份
  428. "d+": date.getDate(), //日
  429. "h+": date.getHours(), //小时
  430. "m+": date.getMinutes(), //分
  431. "s+": date.getSeconds(), //秒
  432. "q+": Math.floor((date.getMonth() + 3) / 3), //季度
  433. "S": date.getMilliseconds() //毫秒
  434. };
  435. if (/(y+)/.test(fmt)) {
  436. fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
  437. }
  438. for (var k in o) {
  439. if (new RegExp("(" + k + ")").test(fmt)) {
  440. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  441. }
  442. }
  443. return fmt;
  444. }
  445. function replaceAll(str, f, t) {
  446. var newStr = str.replaceAll(f, t);
  447. return newStr;
  448. }
  449. String.prototype.replaceAll = function (s1, s2) {
  450. return this.replace(new RegExp(s1, "gm"), s2);
  451. }
  452. </script>
  453. </body>
  454. </html>