agent_article_list.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969
  1. {extend name="public/layout" /} {block name="title"}装修案例列表{/block} {block name="body"}
  2. <link rel="stylesheet" href="__STATIC__/css/swiper.min.css">
  3. <style type="text/css">
  4. html,
  5. body {
  6. display: block;
  7. min-width: 1000px;
  8. }
  9. .layui-fluid {
  10. display: block;
  11. box-shadow: 0 0 4px 0 #B6CADE;
  12. border-radius: 5px;
  13. margin: 15px;
  14. background-color: #ffffff;
  15. box-sizing: border-box;
  16. }
  17. .layui-table thead tr,
  18. .layui-table-header {
  19. background-color: #D8E6F1 !important;
  20. }
  21. .layui-tab {
  22. padding: 15px;
  23. height: 100%;
  24. box-sizing: border-box;
  25. }
  26. .layui-form-item {
  27. width: 100%;
  28. }
  29. .layui-form-item .layui-inline {
  30. display: block;
  31. float: left;
  32. width: 145px;
  33. height: 38px;
  34. line-height: 38px;
  35. background: #FFFFFF;
  36. margin-right: 16px;
  37. }
  38. .layui-form-item .layui-input-inline {
  39. width: 145px;
  40. height: 38px;
  41. line-height: 38px;
  42. margin-bottom: 0;
  43. }
  44. .layui-form-item .layui-input-inline .layui-input {
  45. border: 1px solid #9DB6CF;
  46. border-radius: 5px;
  47. }
  48. .layui-form-select dl dd.layui-this {
  49. background-color: #249EFB;
  50. }
  51. .layui-form-item div.searchBox {
  52. width: 320px;
  53. background: #FFFFFF;
  54. border: 1px solid #B6CADE;
  55. border-radius: 24px;
  56. height: 38px;
  57. overflow: hidden;
  58. padding-left: 18px;
  59. position: relative;
  60. margin-bottom: 0px;
  61. float: right;
  62. }
  63. .searchBox .inputBox {
  64. width: 240px;
  65. float: left;
  66. height: 36px;
  67. line-height: 36px;
  68. border-width: 0;
  69. }
  70. .searchBtn {
  71. position: absolute;
  72. top: 0;
  73. right: 0;
  74. width: 51px;
  75. height: 38px;
  76. background-color: #fff;
  77. }
  78. .searchBtn img {
  79. position: absolute;
  80. width: 26px;
  81. top: 6px;
  82. left: 0;
  83. }
  84. .layui-form-label {
  85. width: auto;
  86. }
  87. .layui-btn-primary {
  88. color: #249EFB;
  89. border: 1px solid #249EFB;
  90. }
  91. .layui-btn-primary:hover {
  92. background-color: #E3F7FF;
  93. color: #249EFB;
  94. }
  95. .layui-table-page>div {
  96. display: flex;
  97. justify-content: flex-start;
  98. }
  99. .layui-btn-xs,
  100. .layui-btn-xs:hover {
  101. border: 1px solid #249EFB;
  102. background-color: #fff;
  103. color: #249EFB;
  104. padding: 0px 10px;
  105. }
  106. .layui-btn-danger,
  107. .layui-btn-danger:hover {
  108. color: #FF5722;
  109. background-color: #fff;
  110. border: 1px solid #FF5722;
  111. padding: 0px 10px;
  112. }
  113. .ml10 {
  114. margin-left: 10px;
  115. }
  116. .operateBtn {
  117. display: flex;
  118. justify-content: flex-start;
  119. }
  120. .flex-end {
  121. display: flex;
  122. justify-content: flex-start;
  123. align-items: center;
  124. }
  125. .layuiadmin-card-header-auto {
  126. display: flex !important;
  127. align-items: center;
  128. justify-content: space-between;
  129. }
  130. .layui-tab {
  131. width: 98%;
  132. background-color: #fff;
  133. margin: 15px auto;
  134. box-shadow: 0 0 4px 0 #B6CADE;
  135. border-radius: 5px;
  136. }
  137. .layui-tab-title .layui-this {
  138. color: #249EFB;
  139. }
  140. .layui-tab-title .layui-this:after {
  141. width: 50px;
  142. height: 4px;
  143. background-color: #249EFB;
  144. top: 36px !important;
  145. left: 50%;
  146. transform: translateX(-50%);
  147. border: none;
  148. }
  149. .layui-tab-title li {
  150. margin: 0px 5px;
  151. }
  152. .li_active {
  153. font-weight: 700;
  154. background-color: #249EFB;
  155. color: #fff;
  156. }
  157. .relative {
  158. position: relative;
  159. }
  160. .noneClass {
  161. display: none !important;
  162. }
  163. .c_wordlist {
  164. width: 20px;
  165. position: absolute;
  166. top: 43px;
  167. right: 1px;
  168. display: flex;
  169. flex-direction: column;
  170. z-index: 99999;
  171. height: auto;
  172. justify-content: flex-start;
  173. align-items: center;
  174. box-sizing: border-box;
  175. padding: 4px 0px;
  176. overflow: hidden;
  177. max-height: 297px;
  178. -ms-overflow-style: none;
  179. /* IE 10+ */
  180. scrollbar-width: none;
  181. /* Firefox */
  182. overflow-y: scroll;
  183. background-color: #f5f5f5;
  184. }
  185. .c_wordlist::-webkit-scrollbar {
  186. display: none;
  187. /* Chrome Safari */
  188. }
  189. .c_wordlist>li {
  190. width: 20px;
  191. height: 37px;
  192. cursor: pointer;
  193. display: flex;
  194. justify-content: center;
  195. align-items: center;
  196. margin-bottom: 0px;
  197. line-height: 37px;
  198. }
  199. dd {
  200. border-bottom: 1px solid #EFEFEF;
  201. }
  202. .layui-anim-upbit {
  203. -ms-overflow-style: none;
  204. /* IE 10+ */
  205. scrollbar-width: none;
  206. /* Firefox */
  207. overflow-y: scroll;
  208. background-color: #fff;
  209. }
  210. .layui-anim-upbit::-webkit-scrollbar {
  211. display: none;
  212. /* Chrome Safari */
  213. }
  214. .layui-tab-title {
  215. border-bottom: 1px solid #f5f5f5;
  216. }
  217. .layui-form-select dl {
  218. width: 100% !important;
  219. }
  220. /* 手机预览效果--样式 */
  221. .preview_mask {
  222. width: 100%;
  223. height: 100%;
  224. position: fixed;
  225. top: 0px;
  226. left: 0px;
  227. background-color: rgba(0, 0, 0, 0.5);
  228. z-index: 99999;
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. }
  233. .preview_phone {
  234. width: 410px;
  235. height: 95vh;
  236. max-height: 820px !important;
  237. background: url('__STATIC__/img/phoneModel.png');
  238. background-size: 100% 100%;
  239. display: flex;
  240. justify-content: center;
  241. align-items: center;
  242. }
  243. .page_box {
  244. width: 375px;
  245. height: 96%;
  246. background-color: #fff;
  247. position: relative;
  248. overflow-y: auto;
  249. overflow-x: hidden;
  250. border-radius: 30px;
  251. margin-right: 4px;
  252. }
  253. /* 设置滚动条的样式 */
  254. .page_box::-webkit-scrollbar {
  255. width: 2px;
  256. }
  257. /* 滚动槽 */
  258. .page_box::-webkit-scrollbar-track {
  259. -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.3);
  260. border-radius: 10px;
  261. }
  262. /* 滚动条滑块 */
  263. .page_box::-webkit-scrollbar-thumb {
  264. background: rgba(0, 0, 0, 0.3);
  265. -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5);
  266. }
  267. .page_cover_img {
  268. width: 100%;
  269. height: 225px;
  270. background-color: #ccc;
  271. position: relative;
  272. }
  273. .cover_tab {
  274. max-width: 130px;
  275. height: 28px;
  276. position: absolute;
  277. bottom: 10px;
  278. background-color: rgba(255, 255, 255, 0.5);
  279. border-radius: 14px;
  280. display: flex;
  281. align-items: center;
  282. font-size: 12px;
  283. left: 50%;
  284. transform: translateX(-50%);
  285. z-index: 999999;
  286. }
  287. .cover_tab>div {
  288. width: 65px;
  289. height: 100%;
  290. display: inline-block;
  291. text-align: center;
  292. border-radius: 15px;
  293. line-height: 28px;
  294. cursor: pointer;
  295. }
  296. .activeTab {
  297. background-color: #249EFB;
  298. color: #fff;
  299. }
  300. .enter_vr {
  301. position: absolute;
  302. width: 60px;
  303. height: 30px;
  304. left: 50%;
  305. top: 45%;
  306. transform: translateX(-50%);
  307. color: #fff;
  308. display: flex;
  309. flex-direction: column;
  310. align-items: center;
  311. justify-content: center;
  312. font-size: 18px;
  313. }
  314. .page_title {
  315. padding: 15px 5px 0px;
  316. font-size: 18px;
  317. color: #000;
  318. }
  319. .designer_box {
  320. width: 96%;
  321. height: auto;
  322. overflow: hidden;
  323. box-sizing: border-box;
  324. padding: 10px;
  325. margin: auto;
  326. background-color: #EFF4F8;
  327. margin-top: 10px;
  328. display: flex;
  329. align-items: center;
  330. }
  331. .designer_avatar {
  332. width: 40px;
  333. height: 40px;
  334. border-radius: 50%;
  335. overflow: hidden;
  336. }
  337. .designer_msg {
  338. box-sizing: border-box;
  339. flex: 1;
  340. display: flex;
  341. flex-direction: column;
  342. padding: 0px 10px;
  343. }
  344. .designer_person {
  345. font-size: 15px;
  346. }
  347. .designer_position {
  348. font-size: 10px !important;
  349. }
  350. .designer_style {
  351. margin-top: 4px;
  352. font-size: 12px;
  353. line-height: 18px;
  354. color: #A0BDD4;
  355. }
  356. .page_houseType {
  357. width: 96%;
  358. margin: 10px auto 20px;
  359. border: 1px solid #ececec;
  360. box-sizing: border-box;
  361. padding: 20px;
  362. overflow: hidden;
  363. }
  364. .houseType_msg {
  365. width: 25%;
  366. float: left;
  367. }
  368. .houseType_msg>span {
  369. display: block;
  370. }
  371. .houseType_name {
  372. color: #A9A9A9;
  373. font-size: 14px;
  374. }
  375. .houseType_val {
  376. font-size: 14px;
  377. color: #000;
  378. margin-top: 10px;
  379. }
  380. .page_line {
  381. width: 100%;
  382. height: 8px;
  383. background-color: #ECECEC;
  384. }
  385. .page_tab_box {
  386. width: 100%;
  387. padding: 10px 5px 0px;
  388. display: flex;
  389. font-size: 18px;
  390. }
  391. .page_tab_box>div {
  392. margin-right: 20px;
  393. cursor: pointer;
  394. }
  395. .nowtitbox {
  396. font-size: 18px;
  397. font-weight: bold;
  398. position: relative;
  399. }
  400. .nowtitbox::before {
  401. content: ' ';
  402. display: block;
  403. width: 6px;
  404. height: 2px;
  405. position: absolute;
  406. bottom: 0;
  407. left: 50%;
  408. transform-origin: 100% 0;
  409. transform: translateX(-150%) rotate(-30deg);
  410. background-color: #333333;
  411. }
  412. .nowtitbox::after {
  413. content: ' ';
  414. display: block;
  415. width: 6px;
  416. height: 2px;
  417. position: absolute;
  418. bottom: 0;
  419. left: 50%;
  420. background-color: #333333;
  421. transform-origin: 0 0;
  422. transform: translateX(-50%) rotate(390deg);
  423. }
  424. .richText {
  425. padding: 10px;
  426. }
  427. .richText img {
  428. max-width: 100% !important;
  429. margin: 0px !important;
  430. padding: 0px !important;
  431. }
  432. .richText video {
  433. max-width: 100% !important;
  434. }
  435. .page_time {
  436. color: #b8b8b8;
  437. font-size: 12px;
  438. padding: 0px 5px 16px;
  439. }
  440. .swiper-container {
  441. width: 100%;
  442. height: 225px;
  443. display: block;
  444. }
  445. .swiper-slide {
  446. width: 100%;
  447. height: 100%;
  448. display: inline-block;
  449. text-align: center;
  450. font-size: 18px;
  451. background: #fff;
  452. clear: both;
  453. /* Center slide text vertically */
  454. display: -webkit-box;
  455. display: -ms-flexbox;
  456. display: -webkit-flex;
  457. display: flex;
  458. -webkit-box-pack: center;
  459. -ms-flex-pack: center;
  460. -webkit-justify-content: center;
  461. justify-content: center;
  462. -webkit-box-align: center;
  463. -ms-flex-align: center;
  464. -webkit-align-items: center;
  465. align-items: center;
  466. }
  467. .relative {
  468. position: relative;
  469. }
  470. .lay-close {
  471. position: absolute;
  472. top: 30px;
  473. right: 25%;
  474. color: #fff;
  475. font-size: 38px !important;
  476. font-weight: 700;
  477. cursor: pointer;
  478. }
  479. video {
  480. background-color: #000;
  481. }
  482. .colorA9A9A9 {
  483. color: #A9A9A9 !important;
  484. }
  485. .ablock {
  486. display: inline-block;
  487. width: 100%;
  488. height: 100%;
  489. }
  490. </style>
  491. <body>
  492. <div class="layui-tab">
  493. <ul class="layui-tab-title">
  494. <li class="layui-this" data-type="2">公司分享</li>
  495. <li id="details" data-type="1">推荐分享</li>
  496. </ul>
  497. <div class="layui-tab-content">
  498. <div class="layui-tab-item layui-show">
  499. <div class="layui-card">
  500. <div class="layui-card-header layuiadmin-card-header-auto" style="padding: 15px 15px 20px;">
  501. <div class="operateBtn">
  502. <a type="button" class="layui-btn layui-btn-primary caseaddbtn">
  503. 添加内容
  504. </a>
  505. </div>
  506. <div class="layui-form flex-end">
  507. <div class="layui-inline">
  508. <label class="layui-form-label">文章标题</label>
  509. <div class="layui-input-inline">
  510. <input type="text" name="title" placeholder="请输入标题" autocomplete="off"
  511. class="layui-input">
  512. </div>
  513. </div>
  514. <div class="layui-inline" style="margin-right: 0px;">
  515. <label class="layui-form-label">上传人</label>
  516. <div class="layui-input-inline">
  517. <select name="employee_id" id="employee" lay-search>
  518. <option value="">请选择人员</option>
  519. {volist name="employee" id="e"}
  520. <option value="{$e.id}">{$e.name}</option>
  521. {/volist}
  522. </select>
  523. </div>
  524. </div>
  525. <div class="layui-inline">
  526. <label class="layui-form-label">上传时间</label>
  527. <div class="layui-input-inline select-date">
  528. <input type="text" name="add_time" id="select_date" placeholder="开始时间 - 结束时间"
  529. autocomplete="off" class="layui-input">
  530. </div>
  531. </div>
  532. <div class="layui-inline ml10">
  533. <button class="layui-btn layuiadmin-btn-list submitbtn" lay-submit
  534. lay-filter="LAY-app-contlist-search">
  535. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  536. </button>
  537. </div>
  538. </div>
  539. </div>
  540. <div class="layui-card-body" style="text-align: center;">
  541. <table id="anli-table" lay-filter="anli-table"></table>
  542. </div>
  543. </div>
  544. </div>
  545. </div>
  546. </div>
  547. <div class="preview_mask layui-hide">
  548. <div class="preview_phone">
  549. </div>
  550. <i class="layui-icon layui-icon-close lay-close"></i>
  551. </div>
  552. </body>
  553. {/block} {block name="js"}
  554. <script type="text/html" id="cover_img">
  555. {{# if(d.file_img != ''){ }}
  556. {{# if(d.file_type == 1 || d.difference == 1){ }}
  557. <img src="{{d.file_img}}?x-oss-process=video/snapshot,t_100,f_jpg,w_375,m_fast" style="width: 30px;height: 30px;"/>
  558. {{# }else{ }}
  559. <img src="{{d.file_img}}?x-oss-process=image/resize,w_50" style="width: 30px;height: 30px;"/>
  560. {{# } }}
  561. {{# }else{ }}
  562. <span style="color: #cccccc;">无</span>
  563. {{# } }}
  564. </script>
  565. <script type="text/html" id="titletpl">
  566. {{# if(d.title){ }}
  567. <span>{{d.title}}</span>
  568. {{# }else{ }}
  569. <span style="color: #cccccc;">无</span>
  570. {{# } }}
  571. </script>
  572. <script type="text/html" id="employee_name">
  573. {{# if(d.employee){ }}
  574. <span>{{d.employee.opt_name?d.employee.opt_name:d.employee.name}}</span>
  575. {{# }else{ }}
  576. <span style="color: #cccccc;">无</span>
  577. {{# } }}
  578. </script>
  579. <script type="text/html" id="show">
  580. <input type="checkbox" name="show" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="show" {{ d.disable == 0 ? 'checked' : '' }}>
  581. </script>
  582. <script type="text/html" id="table-anli-action">
  583. <a class="layui-btn layui-btn-xs" lay-event="anli-details">编辑</a>
  584. <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="anli-delete">删除</a>
  585. </script>
  586. <script src="__STATIC__/js/swiper.min.js"></script>
  587. <script>
  588. layui.config({
  589. base: '__LAYUI__/',
  590. urlbase: '/sys'
  591. }).extend({
  592. index: 'lib/index' //主入口模块
  593. }).use(['index', 'table', 'element', 'laydate'], function () {
  594. var $ = layui.$,
  595. form = layui.form,
  596. element = layui.element,
  597. table = layui.table,
  598. laydate = layui.laydate,
  599. scrollTopNum = 0,
  600. fromType = '2';
  601. //日期范围
  602. laydate.render({
  603. elem: '#select_date'
  604. , type: 'date'
  605. , range: true
  606. , trigger: 'click'//呼出事件改成click
  607. });
  608. document.onkeydown = function (event) {
  609. var e = event || window.event || arguments.callee.caller.arguments[0];
  610. if (e && e.keyCode == 13) {
  611. $(".submitbtn").trigger("click");
  612. }
  613. };
  614. $('.caseaddbtn').click(function () {
  615. layer.open({
  616. type: 2,
  617. title: ['添加内容', 'color:#333333;background-color:#D8E6F1;'],
  618. content: '{:url("agents/add_article")}',
  619. resize: false,
  620. area: ['80%', '80%'],
  621. end: function() {
  622. //执行重载
  623. table.reload('anli-table');
  624. }
  625. });
  626. })
  627. $(".layui-tab-title li").click(function () {
  628. fromType = $(this).prop("dataset").type;
  629. firstTabTableLoad();
  630. if (fromType == 2) {
  631. $(".caseaddbtn").removeClass('layui-hide');
  632. } else {
  633. $(".caseaddbtn").addClass('layui-hide');
  634. }
  635. })
  636. //监听搜索
  637. form.on('submit(LAY-app-contlist-search)', function (data) {
  638. var field = data.field;
  639. console.log(data)
  640. //执行重载
  641. table.reload('anli-table', {
  642. where: field
  643. , page: { curr: 1 }
  644. });
  645. });
  646. ///default entery
  647. var firstTabTableLoad = function () {
  648. let colsVal = getColsArr();
  649. //装修案例列表
  650. table.render({
  651. elem: '#anli-table',
  652. autoSort: false,
  653. url: fromType == 2 ? "{:url('agents/agent_article_list')}" : "{:url('agents/agtemp_artlist')}",
  654. cols: [colsVal],
  655. page: true,
  656. limit: 50,
  657. height: 'full-220',
  658. text: '对不起,加载出现异常!'
  659. });
  660. table.on('sort(anli-table)', function (obj) {
  661. table.reload('anli-table', {
  662. initSort: obj
  663. , where: {
  664. order: obj.field + ' ' + obj.type
  665. }
  666. });
  667. });
  668. //监听列表
  669. table.on('tool(anli-table)', function (obj) {
  670. var data = obj.data;
  671. console.log(data.id);
  672. if (obj.event === 'anli-details') {
  673. layer.open({
  674. type: 2,
  675. title: ['编辑文章', 'color:#333333;background-color:#D8E6F1;'],
  676. content: "{:url('agents/edit_article')}?id=" + data.id,
  677. resize: false,
  678. area: ['80%', '85%'],
  679. end: function () {
  680. //执行重载
  681. table.reload('anli-table');
  682. }
  683. });
  684. }
  685. if (obj.event === 'anli-clue-list') {
  686. layer.open({
  687. type: 2,
  688. title: ['素材线索数据', 'color:#333333;background-color:#D8E6F1;'],
  689. content: "{:url('data/cluedata')}?type=materialCase&id=" + data.id,
  690. resize: false,
  691. area: ['80%', '80%']
  692. });
  693. }
  694. if (obj.event === 'anli-delete') {
  695. layer.confirm('确定要删除此素材么?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'], }, function () {
  696. $.get("{:url('agents/del_article')}?id=" + data.id, function (res) {
  697. if (res.code === 0) {
  698. layer.msg(res.msg, { anim: 0, time: 400 }, function () {
  699. table.reload('anli-table');
  700. });
  701. } else {
  702. layer.msg(res.msg, { anim: 6, time: 400 });
  703. }
  704. });
  705. });
  706. }
  707. });
  708. };
  709. firstTabTableLoad();
  710. function getColsArr() {
  711. let colsArr = [{
  712. align: 'center',
  713. type: 'numbers',
  714. field: 'id',
  715. width: 80,
  716. title: '序号',
  717. sort: true
  718. }, {
  719. align: 'center',
  720. templet: '#cover_img',
  721. width: 100,
  722. title: '封面图',
  723. }, {
  724. align: 'center',
  725. field: 'title',
  726. title: '案例标题',
  727. minWidth: 100,
  728. templet: '#titletpl'
  729. },
  730. {
  731. align: 'center',
  732. field: 'addtime',
  733. title: '上传时间',
  734. minWidth: 100
  735. },
  736. {
  737. align: 'center',
  738. title: '展示',
  739. minWidth: 100,
  740. templet: '#show'
  741. }, {
  742. align: 'center',
  743. title: '上传人',
  744. minWidth: 100,
  745. templet: '#employee_name'
  746. }];
  747. if (fromType == '2') {
  748. colsArr.push({
  749. align: 'center',
  750. title: '操作',
  751. width: 380,
  752. align: 'center',
  753. fixed: 'right',
  754. templet: "#table-anli-action"
  755. })
  756. return colsArr;
  757. } else {
  758. return colsArr;
  759. }
  760. }
  761. setTimeout(() => {
  762. $('.layui-table-main').scroll(function (e) {
  763. scrollTopNum = $(this).scrollTop();
  764. console.log(scrollTopNum, '<<<记录位置');
  765. })
  766. }, 800)
  767. function scrollPostion(num) {
  768. $('.layui-table-main').scrollTop(num)
  769. }
  770. /*---------------------------------------------------------*/
  771. $('dd').click(() => {
  772. $('.c_wordlist').addClass('noneClass');
  773. })
  774. $('#box212').click(() => {
  775. $('.c_wordlist').toggleClass('noneClass');
  776. })
  777. let xqElement = $('.layui-anim-upbit')[0];
  778. xqElement.classList.add('xqElement');
  779. let options = [];
  780. let xqDatalist = $('#community').children();
  781. for (let i = 0; i < xqDatalist.length; i++) {
  782. if (xqDatalist[i].dataset.py) {
  783. options.push(xqDatalist[i].dataset.py)
  784. }
  785. }
  786. $('.c_wordlist').click((e) => {
  787. if (e.target.localName != 'li') {
  788. e.stopPropagation();
  789. return;
  790. }
  791. let index = 0;
  792. let curWord = e.target.dataset.py;
  793. let lilist = $('.c_wordlist').children();
  794. for (let i = 0; i < lilist.length; i++) {
  795. lilist[i].className = '';
  796. }
  797. if (parseInt(curWord) != NaN) {
  798. let word1 = curWord.toLowerCase();
  799. index = options.indexOf(word1)
  800. } else {
  801. index = options.indexOf(curWord)
  802. }
  803. setTimeout(() => {
  804. e.target.className = 'li_active';
  805. let num = index * 37 + 37;
  806. $('.xqElement').scrollTop(num);
  807. }, 50)
  808. e.stopPropagation();
  809. })
  810. $('.layui-select-title input').on('input', function (e) {
  811. if (e.target.placeholder == '请选择小区') {
  812. let val = $(this).val();
  813. if (!val) {
  814. $('.c_wordlist').removeClass('noneClass');
  815. return;
  816. }
  817. $('.c_wordlist').addClass('noneClass');
  818. }
  819. })
  820. /*--------------------------------------------*/
  821. var field = {};
  822. form.on('select(state)', function (data) {
  823. field['state'] = data.value;
  824. table.reload('anli-table', {
  825. where: field
  826. , page: { curr: 1 }
  827. });
  828. });
  829. form.on('select(user_id)', function (data) {
  830. field['user_id'] = data.value;
  831. table.reload('anli-table', {
  832. where: field
  833. , page: { curr: 1 }
  834. });
  835. });
  836. form.on('select(means)', function (data) {
  837. field['means'] = data.value;
  838. table.reload('anli-table', {
  839. where: field
  840. , page: { curr: 1 }
  841. });
  842. });
  843. form.on('select(date)', function (data) {
  844. field['date'] = data.value;
  845. table.reload('anli-table', {
  846. where: field
  847. , page: { curr: 1 }
  848. });
  849. });
  850. //备注
  851. $('body').on('mouseover', '.remarksInfo', function () {
  852. var type = $(this).data('type');
  853. layer.tips(type, this, {
  854. tips: [1, '#3595CC'],
  855. time: 2000
  856. });
  857. });
  858. form.on('switch(show)', function (obj) {
  859. var id = obj.value;
  860. $.ajax({
  861. type: "post",
  862. url: '{:url("agents/apipublish")}',
  863. data: {
  864. id: id,
  865. cate: 'case'
  866. },
  867. success: function (res) {
  868. layer.msg(res.msg, { time: 2000 });
  869. }
  870. });
  871. });
  872. });
  873. </script>
  874. {/block}