index.ftl 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. <html xmlns="http://www.w3.org/1999/html">
  2. <head>
  3. <title>静态化</title>
  4. <#include "../../include/head-file.ftl">
  5. <style>
  6. [v-cloak]{
  7. display: none;
  8. }
  9. </style>
  10. </head>
  11. <body class="custom-body">
  12. <div id="app" v-cloak>
  13. <div class="class-1" >
  14. <el-alert style="line-height: 22px;padding: 20px;"
  15. title=""
  16. type="success"
  17. :closable="false"
  18. show-icon>
  19. 更新主页,如果系统存在引导页面可以手动修改主页位置文件名,default.html引导页面index.html主页。<br/>
  20. 更新栏目列表,推荐使用指定栏目更新。系统提示“更新中”请不要刷新页面或点击其他菜单。<br/>
  21. 根据时间与栏目类型生成文章
  22. </el-alert>
  23. </div>
  24. <el-form ref="form" label-width="100px" size="mini">
  25. <div class="class-2" >
  26. <div class="class-3" >
  27. <div class="class-4" >
  28. <el-form-item label="主题模板">
  29. <el-select v-model="template"
  30. :filterable="true"
  31. :clearable="false"
  32. placeholder="请选择主题模板">
  33. <el-option v-for='item in templateOptions' :key="item" :value="item"
  34. :label="item"></el-option>
  35. </el-select>
  36. </el-form-item>
  37. </div>
  38. <div class="class-7" >
  39. <el-form-item>
  40. <template slot='label'>主页位置
  41. <el-popover slot="label" placement="top-start" title="提示" width="200" trigger="hover" content="主页位置htm文件名一般为index.html或default.html">
  42. <i class="el-icon-question" slot="reference"></i>
  43. </el-popover>
  44. </template>
  45. <el-input v-model="position"
  46. :disabled="false"
  47. :style="{width: '100%'}"
  48. :clearable="true"
  49. placeholder="请输入主页位置">
  50. </el-input>
  51. </el-form-item>
  52. </div>
  53. <div class="class-10" >
  54. <el-form-item>
  55. <el-button type="primary" @click="updataIndex" :loading="homeLoading">{{homeLoading?'更新中':'生成主页'}}</el-button>
  56. <el-button plain @click="viewIndex">预览主页</el-button>
  57. </el-form-item>
  58. </div>
  59. </div>
  60. <div class="class-13" >
  61. <div class="class-14" >
  62. <el-form-item label="文章栏目">
  63. <tree-select v-model="contentSection"
  64. :props="{value: 'id',label: 'categoryTitle',children: 'children'}"
  65. :options="treeList" :style="{width:'100%'}"
  66. placeholder="请选择文章栏目">
  67. </tree-select>
  68. </el-form-item>
  69. </div>
  70. <div class="class-17" >
  71. <el-form-item>
  72. <template slot='label'>指定时间
  73. <el-popover slot="label" placement="top-start" title="提示" width="200" trigger="hover" content="指定时间需要小于生成文章的发布时间">
  74. <i class="el-icon-question" slot="reference"></i>
  75. </el-popover>
  76. </template>
  77. <el-date-picker
  78. v-model="time"
  79. placeholder="请选择指定时间"
  80. start-placeholder=""
  81. end-placeholder=""
  82. :readonly="false"
  83. :disabled="false"
  84. :editable="false"
  85. :clearable="false"
  86. format="yyyy-MM-dd"
  87. value-format="yyyy-MM-dd"
  88. :style="{width:'100%'}"
  89. type="date">
  90. </el-date-picker>
  91. </el-form-item>
  92. </div>
  93. <div class="class-20" >
  94. <el-form-item>
  95. <el-button type="primary" @click="updateArticle" :loading="articleLoading">{{articleLoading?'更新中':'生成文章'}}</el-button>
  96. </el-form-item>
  97. </div>
  98. </div>
  99. <div class="class-23" >
  100. <div class="class-24" >
  101. <el-form-item label="生成栏目">
  102. <tree-select v-model="section"
  103. :props="{value: 'id',label: 'categoryTitle',children: 'children'}"
  104. :options="treeList" :style="{width:'100%'}"
  105. placeholder="请选择文章栏目">
  106. </tree-select>
  107. </el-form-item>
  108. </div>
  109. <div class="class-30" >
  110. <el-form-item>
  111. <el-button type="primary" @click="updateColumn" :loading="columnLoading">{{columnLoading?'更新中':'生成栏目'}}</el-button>
  112. </el-form-item>
  113. </div>
  114. </div>
  115. </div>
  116. </el-form>
  117. </div>
  118. </body>
  119. </html>
  120. <script>
  121. var app = new Vue({
  122. el: '#app',
  123. watch:{
  124. },
  125. data: {
  126. homeLoading:false,
  127. articleLoading:false,
  128. columnLoading:false,
  129. template:'index.htm',//主题模板
  130. templateOptions:[],
  131. position:'index', //位置
  132. contentSection:'0', //文章栏目
  133. section:'0', //栏目
  134. time:ms.util.date.fmt(new Date(),"yyyy-MM-dd"),
  135. treeList:[{
  136. id:'0',
  137. categoryTitle:'顶级栏目',
  138. children:[],
  139. }],
  140. },
  141. methods: {
  142. //更新主页
  143. updataIndex(){
  144. var that = this;
  145. if(!that.position || that.position == ''){
  146. this.$notify({ title: '请输入主页位置!', type: 'warning' });
  147. return;
  148. }
  149. that.homeLoading = true;
  150. ms.http.post(ms.manager+'/cms/generate//generateIndex.do', {url:that.template,position:that.position}).then(function (data) {
  151. if(data.result){
  152. that.$notify({ title: '更新成功!', type: 'success' });
  153. }else {
  154. that.$notify({ title: '更新失败!',message: "错误", type: 'error' });
  155. }
  156. }).catch(function (err) {
  157. that.$notify({ title: '更新失败!',message: err, type: 'error' });
  158. console.log(err);
  159. }).finally(()=>{
  160. that.homeLoading = false;
  161. });
  162. },
  163. //预览主页
  164. viewIndex(){
  165. if(!this.position || this.position == ''){
  166. this.$notify({ title: '请输入主页位置!', type: 'warning' });
  167. return;
  168. }
  169. window.open(ms.manager+"/cms/generate/"+this.position+"/viewIndex.do");
  170. },
  171. //更新栏目
  172. updateColumn(){
  173. var that = this;
  174. that.columnLoading = true;
  175. ms.http.get(ms.manager+'/cms/generate/'+(that.section?that.section:0)+'/genernateColumn.do').then(function (data) {
  176. if(data.result){
  177. that.$notify({ title: '更新成功!', type: 'success' });
  178. }
  179. }).catch(function (err) {
  180. that.$notify({ title: '更新失败!',message: err, type: 'error' });
  181. console.log(err);
  182. }).finally(()=>{
  183. that.columnLoading = false;
  184. });
  185. },
  186. //生成文章栏目
  187. updateArticle(){
  188. var that = this;
  189. that.articleLoading = true;
  190. ms.http.post(ms.manager+'/cms/generate/'+(that.contentSection?that.contentSection:0)+'/generateArticle.do', {dateTime:that.time}).then(function (data) {
  191. if(data.result){
  192. that.$notify({ title: '更新成功!', type: 'success' });
  193. }
  194. }).catch(function (err) {
  195. that.$notify({ title: '更新失败!',message: err, type: 'error' });
  196. console.log(err);
  197. }).finally(()=>{
  198. that.articleLoading = false;
  199. });
  200. },
  201. //获取主题模板数据源
  202. templateOptionsGet() {
  203. var that = this;
  204. ms.http.get(ms.manager+'/template/queryTemplateFileForColumn.do', {pageSize:99999}).then(function (data) {
  205. that.templateOptions = data.data;
  206. }).catch(function (err) {
  207. console.log(err);
  208. });
  209. },
  210. getTree(){
  211. var that = this;
  212. ms.http.get(ms.manager+"/cms/category/list.do",{pageSize:9999}).then(function(res){
  213. if(res.result){
  214. //res.data.rows.push({id:0,categoryId: null,categoryTitle:'顶级栏目管理'});
  215. that.treeList[0].children = ms.util.treeData(res.data.rows,'id','categoryId','children');
  216. }
  217. }).catch(function(err){
  218. console.log(err);
  219. });
  220. },
  221. },
  222. created(){
  223. this.getTree();
  224. this.templateOptionsGet();
  225. }
  226. })
  227. </script>
  228. <style>
  229. input{
  230. width: 100%!important;
  231. }
  232. .class-1
  233. {
  234. color:#333333;
  235. outline:none;
  236. outline-offset:-1px;
  237. max-width:100%;
  238. background-color:#FFFFFF;
  239. flex-direction:row;
  240. display:flex;
  241. animation-duration:1s;
  242. width:100%;
  243. background-repeat:no-repeat;
  244. padding: 14px;
  245. }
  246. .class-2
  247. {
  248. color:#333333;
  249. outline:none;
  250. outline-offset:-1px;
  251. height:500px;
  252. max-width:100%;
  253. flex-direction:row;
  254. display:flex;
  255. animation-duration:1s;
  256. width:100%;
  257. background-repeat:no-repeat;
  258. }
  259. .class-3
  260. {
  261. color:#333333;
  262. padding:20px;
  263. outline:none;
  264. outline-offset:-1px;
  265. height:200px;
  266. max-width:100%;
  267. background-color:#FFFFFF;
  268. flex-direction:column;
  269. display:flex;
  270. justify-content:end;
  271. margin: 12px 6px 12px 12px;
  272. animation-duration:1s;
  273. width:100%;
  274. padding-left:20px;
  275. background-repeat:no-repeat;
  276. }
  277. .class-4
  278. {
  279. color:#333333;
  280. outline:none;
  281. outline-offset:-1px;
  282. max-width:100%;
  283. align-items:center;
  284. flex-direction:row;
  285. display:flex;
  286. animation-duration:1s;
  287. background-repeat:no-repeat;
  288. }
  289. .class-5
  290. {
  291. color:#333333;
  292. word-wrap:break-word;
  293. display:inline-block;
  294. animation-duration:1s;
  295. font-size:14px;
  296. line-height:1.4;
  297. }
  298. .class-6
  299. {
  300. border-color:#EEEEEE;
  301. color:#606266;
  302. padding-right:15px;
  303. box-sizing:boredr-box;
  304. outline:none;
  305. border-width:1px;
  306. border-style:solid;
  307. height:40px;
  308. margin-left:20px;
  309. animation-duration:1s;
  310. background:none;
  311. width:320px;
  312. font-size:12px;
  313. line-height:40px;
  314. padding-left:15px;
  315. }
  316. .class-7
  317. {
  318. border-color:#EEEEEE;
  319. color:#333333;
  320. outline:none;
  321. outline-offset:-1px;
  322. border-width:1px;
  323. border-style:none;
  324. max-width:100%;
  325. align-items:center;
  326. flex-direction:row;
  327. display:flex;
  328. animation-duration:1s;
  329. background-repeat:no-repeat;
  330. }
  331. .class-8
  332. {
  333. color:#333333;
  334. word-wrap:break-word;
  335. display:inline-block;
  336. animation-duration:1s;
  337. font-size:14px;
  338. line-height:1.4;
  339. }
  340. .class-9
  341. {
  342. border-color:#EEEEEE;
  343. color:#606266;
  344. padding-right:15px;
  345. box-sizing:boredr-box;
  346. outline:none;
  347. border-width:1px;
  348. border-style:solid;
  349. height:40px;
  350. margin-left:20px;
  351. animation-duration:1s;
  352. background:none;
  353. width:320px;
  354. font-size:12px;
  355. line-height:40px;
  356. padding-left:15px;
  357. }
  358. .class-10
  359. {
  360. border-color:#EEEEEE;
  361. color:#333333;
  362. outline:none;
  363. outline-offset:-1px;
  364. border-width:1px;
  365. border-style:none;
  366. max-width:100%;
  367. align-items:center;
  368. flex-direction:row;
  369. display:flex;
  370. animation-duration:1s;
  371. background-repeat:no-repeat;
  372. }
  373. .class-11
  374. {
  375. cursor:pointer;
  376. color:#ffffff;
  377. box-sizing:border-box;
  378. height:34px;
  379. background-color:#0099ff;
  380. text-align:center;
  381. display:inline-block;
  382. animation-duration:1s;
  383. border-radius:4px;
  384. width:98px;
  385. line-height:34px;
  386. font-size:14px;
  387. }
  388. .class-12
  389. {
  390. cursor:pointer;
  391. border-color:#0099FF;
  392. color:#0099FF;
  393. box-sizing:border-box;
  394. border-width:1px;
  395. border-style:solid;
  396. height:34px;
  397. background-color:#FFFFFF;
  398. text-align:center;
  399. display:inline-block;
  400. margin-left:10px;
  401. animation-duration:1s;
  402. border-radius:4px;
  403. width:98px;
  404. line-height:34px;
  405. font-size:14px;
  406. }
  407. .class-13
  408. {
  409. color:#333333;
  410. padding:20px;
  411. outline:none;
  412. outline-offset:-1px;
  413. height:200px;
  414. max-width:100%;
  415. background-color:#FFFFFF;
  416. flex-direction:column;
  417. display:flex;
  418. justify-content:end;
  419. margin: 12px 6px;
  420. animation-duration:1s;
  421. width:100%;
  422. padding-left:20px;
  423. background-repeat:no-repeat;
  424. }
  425. .class-14
  426. {
  427. color:#333333;
  428. outline:none;
  429. outline-offset:-1px;
  430. max-width:100%;
  431. align-items:center;
  432. flex-direction:row;
  433. display:flex;
  434. animation-duration:1s;
  435. background-repeat:no-repeat;
  436. }
  437. .class-15
  438. {
  439. color:#333333;
  440. word-wrap:break-word;
  441. display:inline-block;
  442. animation-duration:1s;
  443. font-size:14px;
  444. line-height:1.4;
  445. }
  446. .class-16
  447. {
  448. border-color:#EEEEEE;
  449. color:#606266;
  450. padding-right:15px;
  451. box-sizing:boredr-box;
  452. outline:none;
  453. border-width:1px;
  454. border-style:solid;
  455. height:40px;
  456. margin-left:20px;
  457. animation-duration:1s;
  458. background:none;
  459. width:320px;
  460. font-size:12px;
  461. line-height:40px;
  462. padding-left:15px;
  463. }
  464. .class-17
  465. {
  466. border-color:#EEEEEE;
  467. color:#333333;
  468. outline:none;
  469. outline-offset:-1px;
  470. border-width:1px;
  471. border-style:none;
  472. max-width:100%;
  473. align-items:center;
  474. flex-direction:row;
  475. display:flex;
  476. animation-duration:1s;
  477. background-repeat:no-repeat;
  478. }
  479. .class-18
  480. {
  481. color:#333333;
  482. word-wrap:break-word;
  483. display:inline-block;
  484. animation-duration:1s;
  485. font-size:14px;
  486. line-height:1.4;
  487. }
  488. .class-19
  489. {
  490. border-color:#EEEEEE;
  491. color:#606266;
  492. padding-right:15px;
  493. box-sizing:boredr-box;
  494. outline:none;
  495. border-width:1px;
  496. border-style:solid;
  497. height:40px;
  498. margin-left:20px;
  499. animation-duration:1s;
  500. background:none;
  501. width:320px;
  502. font-size:12px;
  503. line-height:40px;
  504. padding-left:15px;
  505. }
  506. .class-20
  507. {
  508. color:#333333;
  509. outline:none;
  510. outline-offset:-1px;
  511. max-width:100%;
  512. align-items:center;
  513. flex-direction:row;
  514. display:flex;
  515. animation-duration:1s;
  516. background-repeat:no-repeat;
  517. }
  518. .class-21
  519. {
  520. cursor:pointer;
  521. color:#ffffff;
  522. box-sizing:border-box;
  523. height:34px;
  524. background-color:#0099ff;
  525. text-align:center;
  526. display:inline-block;
  527. animation-duration:1s;
  528. border-radius:4px;
  529. width:98px;
  530. line-height:34px;
  531. font-size:14px;
  532. }
  533. .class-22
  534. {
  535. cursor:pointer;
  536. border-color:#0099FF;
  537. color:#0099FF;
  538. box-sizing:border-box;
  539. border-width:1px;
  540. border-style:solid;
  541. height:34px;
  542. background-color:#FFFFFF;
  543. text-align:center;
  544. display:inline-block;
  545. margin-left:10px;
  546. animation-duration:1s;
  547. border-radius:4px;
  548. width:98px;
  549. line-height:34px;
  550. font-size:14px;
  551. }
  552. .class-23
  553. {
  554. color:#333333;
  555. padding:20px;
  556. outline:none;
  557. outline-offset:-1px;
  558. height:200px;
  559. max-width:100%;
  560. background-color:#FFFFFF;
  561. flex-direction:column;
  562. display:flex;
  563. justify-content:end;
  564. margin: 12px 12px 12px 6px;
  565. animation-duration:1s;
  566. width:100%;
  567. padding-left:20px;
  568. background-repeat:no-repeat;
  569. }
  570. .class-24
  571. {
  572. color:#333333;
  573. outline:none;
  574. outline-offset:-1px;
  575. max-width:100%;
  576. align-items:center;
  577. flex-direction:row;
  578. display:flex;
  579. animation-duration:1s;
  580. background-repeat:no-repeat;
  581. }
  582. .class-25
  583. {
  584. color:#333333;
  585. word-wrap:break-word;
  586. display:inline-block;
  587. animation-duration:1s;
  588. font-size:14px;
  589. line-height:1.4;
  590. }
  591. .class-26
  592. {
  593. border-color:#EEEEEE;
  594. color:#606266;
  595. padding-right:15px;
  596. box-sizing:boredr-box;
  597. outline:none;
  598. border-width:1px;
  599. border-style:solid;
  600. height:40px;
  601. margin-left:20px;
  602. animation-duration:1s;
  603. background:none;
  604. width:320px;
  605. font-size:12px;
  606. line-height:40px;
  607. padding-left:15px;
  608. }
  609. .class-27
  610. {
  611. border-color:#EEEEEE;
  612. color:#333333;
  613. outline:none;
  614. outline-offset:-1px;
  615. border-width:1px;
  616. border-style:none;
  617. max-width:100%;
  618. align-items:center;
  619. flex-direction:row;
  620. display:flex;
  621. animation-duration:1s;
  622. background-repeat:no-repeat;
  623. }
  624. .class-28
  625. {
  626. color:#333333;
  627. word-wrap:break-word;
  628. display:inline-block;
  629. animation-duration:1s;
  630. font-size:14px;
  631. line-height:1.4;
  632. }
  633. .class-29
  634. {
  635. border-color:#EEEEEE;
  636. color:#606266;
  637. padding-right:15px;
  638. box-sizing:boredr-box;
  639. outline:none;
  640. border-width:1px;
  641. border-style:solid;
  642. height:40px;
  643. margin-left:20px;
  644. animation-duration:1s;
  645. background:none;
  646. width:320px;
  647. font-size:12px;
  648. line-height:40px;
  649. padding-left:15px;
  650. }
  651. .class-30
  652. {
  653. color:#333333;
  654. outline:none;
  655. outline-offset:-1px;
  656. max-width:100%;
  657. align-items:center;
  658. flex-direction:row;
  659. display:flex;
  660. animation-duration:1s;
  661. background-repeat:no-repeat;
  662. }
  663. .class-31
  664. {
  665. cursor:pointer;
  666. color:#ffffff;
  667. box-sizing:border-box;
  668. height:34px;
  669. background-color:#0099ff;
  670. text-align:center;
  671. display:inline-block;
  672. animation-duration:1s;
  673. border-radius:4px;
  674. width:98px;
  675. line-height:34px;
  676. font-size:14px;
  677. }
  678. .class-32
  679. {
  680. cursor:pointer;
  681. border-color:#0099FF;
  682. color:#0099FF;
  683. box-sizing:border-box;
  684. border-width:1px;
  685. border-style:solid;
  686. height:34px;
  687. background-color:#FFFFFF;
  688. text-align:center;
  689. display:inline-block;
  690. margin-left:10px;
  691. animation-duration:1s;
  692. border-radius:4px;
  693. width:98px;
  694. line-height:34px;
  695. font-size:14px;
  696. }
  697. .el-select,
  698. .el-input,
  699. .el-form-item,
  700. .el-date-editor{
  701. width: 100%;
  702. }
  703. </style>