success_cate.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. {extend name="public/layout" /} {block name="title"}分类管理{/block} {block name="body"}
  2. <script src="/static/js/jquery.min.js"></script>
  3. <script src="/static/js/echarts.min.js"></script>
  4. <style type="text/css">
  5. html,
  6. body {
  7. display: block;
  8. min-width: 1100px;
  9. }
  10. .layui-fluid {
  11. display: block;
  12. box-shadow: 0 0 4px 0 #B6CADE;
  13. border-radius: 5px;
  14. margin: 15px;
  15. background-color: #ffffff;
  16. height: auto;
  17. }
  18. .layui-form-label{
  19. width: auto;
  20. }
  21. #data_statistics{
  22. /*background: red;*/
  23. width: 100%;
  24. height: 300px;
  25. float: left;
  26. }
  27. .tab_1{
  28. width: 10%;
  29. }
  30. #echartbox_a{
  31. display: block;
  32. width: 40%;
  33. height: 300px;
  34. /*background: red;*/
  35. float: left;
  36. }
  37. #data_statistics_b{
  38. /*background: blue;*/
  39. width: 48%;
  40. height: 300px;
  41. float: left;
  42. }
  43. .all{
  44. width: 100%;
  45. background: red;
  46. }
  47. #echartbox_b{
  48. display: block;
  49. width: 80%;
  50. height: 400px;
  51. margin:0 auto;
  52. }
  53. #data_statistics_c{
  54. width: 80%;
  55. margin:0 auto;
  56. overflow: hidden;
  57. }
  58. #echartbox_c{
  59. display: block;
  60. width: 80%;
  61. height: 400px;
  62. margin:0 auto;
  63. }
  64. #data_statistics_d{
  65. width: 80%;
  66. margin:0 auto;
  67. overflow: hidden;
  68. }
  69. #echartbox_d{
  70. display: block;
  71. width: 80%;
  72. height: 400px;
  73. margin:0 auto;
  74. }
  75. #data_statistics_e{
  76. width: 80%;
  77. margin:0 auto;
  78. overflow: hidden;
  79. }
  80. .layui_fluid1{display: none;}
  81. .layui-nav-tabs-ul{margin-bottom: 10px;}
  82. .layui-nav-tab_li{float:left;padding: 0px 20px;text-align: center;cursor: pointer;line-height: 38px;height: 38px;}
  83. .add-layui-nav-li{color: #fff;white-space: nowrap;text-align: center;font-size: 14px;border-radius: 2px;
  84. }
  85. .layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{border-bottom: 2px solid #249efb !important;}
  86. /*//*/
  87. .layui_fluid1{display: none;}
  88. .layui-nav-tabs-ul{margin-bottom: 10px;padding-bottom:0;border-bottom: 1px solid #e6e6e6;overflow: hidden;}
  89. .layui-nav-tab_li{float:left;padding: 0px 20px;text-align: center;cursor: pointer;line-height: 38px;height: 38px;position: relative;}
  90. .add-layui-nav-li{color: #f3f3f3;;white-space: nowrap;text-align: center;font-size: 14px;border-radius: 2px;}
  91. .layui-bor-b{position: absolute;bottom:0;width:65px;left:50%;transform: translateX(-50%);height: 1px;background: #249efb;}
  92. .layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{border-bottom: 2px solid #249efb !important;}
  93. .layui-bor-b{display: none;}
  94. .add-layui-nav-li .layui-bor-b{display: block !important;}
  95. .layui-title-b{font-size: 20px;font-weight: bold;}
  96. .layui-li-box{padding-bottom: 30px;border-bottom: 1px solid #e6e6e6;}
  97. .woverflow{overflow: hidden;}
  98. .layui-bolu{color:#249efb}
  99. .layui-data-ul{width:100%;}
  100. .layui-data-ul li{float:left;width:33.33%;line-height: 40px;}
  101. .mdt70{margin-top:30px;}
  102. .width33_33{width:33.33%;}
  103. .wleft{float:left;}
  104. .mdt40{margin-top:40px;}
  105. .width80_{width:80%;}
  106. .wauto{margin:0 auto;}
  107. .layui-data-ul-b{height: 126px;overflow-y: auto;}
  108. .layui-data-ul-b li{float:left;width:33.33%;line-height: 30px;}
  109. .layui_box_con{display: none;height: 100%;}
  110. .layadmin-iframe-if{width:100%;height: 100%;position: absolute;top:56px;left:0;}
  111. .layui-p-bt{font-weight:bold;}
  112. .layui_bm{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:70%;}
  113. .layui-data-ul-b li span{display: block;float:left;}
  114. /*热词搜索*/
  115. /* .layui-form-item .layui-inline {
  116. display: block;
  117. float: left;
  118. width: 145px;
  119. height: 38px;
  120. line-height: 38px;
  121. background: #FFFFFF;
  122. margin-right: 16px;
  123. }
  124. .layui-form-item .layui-input-inline {
  125. width: 145px;
  126. height: 38px;
  127. line-height: 38px;
  128. margin-bottom: 0;
  129. }*/
  130. /* .layui-form-item .layui-input-inline .layui-input {
  131. border: 1px solid #9DB6CF;
  132. border-radius: 5px;
  133. }*/
  134. .layui-form-select dl dd.layui-this {
  135. background-color: #249EFB;
  136. }
  137. .layui-form-item div.searchBox {
  138. width: 320px;
  139. background: #FFFFFF;
  140. border: 1px solid #B6CADE;
  141. /* border-radius: 24px; */
  142. height: 38px;
  143. overflow: hidden;
  144. padding-left: 10px;
  145. position: relative;
  146. margin-bottom: 0px;
  147. /* float: right; */
  148. }
  149. .searchBox .inputBox {
  150. width: 240px;
  151. /* float: left; */
  152. height: 36px;
  153. line-height: 36px;
  154. border-width: 0;
  155. }
  156. /* .searchBtn {
  157. position: absolute;
  158. top: 0;
  159. right: 0;
  160. width: 51px;
  161. height: 38px;
  162. background-color: #fff;
  163. }*/
  164. .searchBtn img {
  165. position: absolute;
  166. width: 26px;
  167. top: 6px;
  168. left: 0;
  169. }
  170. .layui-btn.layui-btn-success {
  171. background-color: #009688;
  172. }
  173. .layui-table thead tr,
  174. .layui-table-header {
  175. background-color: #D8E6F1 !important;
  176. }
  177. .layui-btn-primary {
  178. color: #249EFB;
  179. border: 1px solid #249EFB;
  180. }
  181. .layui-btn-primary:hover {
  182. background-color: #E3F7FF;
  183. color: #249EFB;
  184. }
  185. .layui-bor-b {
  186. height: 4px;
  187. background-color: #249EFB;
  188. }
  189. .add-layui-nav-li {
  190. color: #249EFB;
  191. }
  192. .layui-btn-xs,.layui-btn-xs:hover {
  193. border: 1px solid #249EFB;
  194. background-color: #fff;
  195. color: #249EFB;
  196. padding: 0px 10px;
  197. }
  198. .layui-btn-danger,.layui-btn-danger:hover{
  199. color: #FF5722;
  200. background-color: #fff;
  201. border: 1px solid #FF5722;
  202. padding: 0px 10px;
  203. }
  204. #data_statistics_b{
  205. border: 1px solid #E4E4E4;
  206. box-sizing: border-box;
  207. padding: 20px;
  208. }
  209. #data_statistics_c,#data_statistics_d,#data_statistics_e {
  210. border: 1px solid #E4E4E4;
  211. padding: 15px;
  212. }
  213. .mt15 {
  214. margin-top: 15px;
  215. }
  216. </style>
  217. <body>
  218. <div class="layui-fluid">
  219. <div class="">
  220. <div class="layui_fluid1" style="display: block;">
  221. <div class="layui-card">
  222. <div class="layui-form layui-card-header layuiadmin-card-header-auto">
  223. <div class="layui-form-item">
  224. <div style="float:right;">
  225. <div class="layui-inline">
  226. <label class="layui-form-label">关键词</label>
  227. <div class="layui-input-inline">
  228. <input type="text" id="keyword" name="keyword" placeholder="请输入话术关键词" autocomplete="off" class="layui-input keyword">
  229. </div>
  230. </div>
  231. <div class="layui-inline">
  232. <label class="layui-form-label">场景</label>
  233. <div class="layui-input-inline">
  234. <select name="type" lay-filter="type" id="type">
  235. <option value="">请选择场景</option>
  236. {volist name="type" id="t"}
  237. <option value="{$t.id}" id="{$t.id}">{$t.name}</option>
  238. {/volist}
  239. </select>
  240. </div>
  241. </div>
  242. <div class="layui-inline">
  243. <button class="layui-btn layuiadmin-btn-useradmin searchBtn" lay-submit lay-filter="search">
  244. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  245. </button>
  246. </div>
  247. </div>
  248. <div class="layui-inline" style="float: left;">
  249. {auth:check name="talkskill/add_talkskill"}
  250. <button class="layui-btn layuiadmin-btn layui-btn-primary" data-type="add">添加成功案例</button>
  251. {/auth:check}
  252. </div>
  253. </div>
  254. </div>
  255. <div class="layui-card-body">
  256. <table id="label-table" lay-filter="label-table"></table>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. </body>
  263. {/block} {block name="js"}
  264. <script type="text/html" id="table-evidence-action">
  265. {{# if(d.from_type == 0){ }}
  266. {auth:check name="talkskill/cate_talkskill_add"}
  267. <a class="layui-btn layui-btn-xs" lay-event="addhs">添加话术</a>
  268. {{# if(d.show == 0){ }}
  269. <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  270. <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delete">删除</a>
  271. {{# }else{ }}
  272. <a class="layui-btn layui-btn-xs layui-btn-disabled" style="border: 1px solid #ccc;color: #ccc;">编辑</a>
  273. <a class="layui-btn layui-btn-xs layui-btn-disabled" style="border: 1px solid #ccc;color: #ccc;">删除</a>
  274. {{# } }}
  275. {/auth:check}
  276. {{# }else{ }}
  277. <span>无</span>
  278. {{# } }}
  279. </script>
  280. <script type="text/html" id="update_time">
  281. {{# if(d.update_time == ''){ }}
  282. <span>/</span>
  283. {{# }else{ }}
  284. {{d.update_time}}
  285. {{# } }}
  286. </script>
  287. <script type="text/html" id="label_name">
  288. {{# if(d.from_type == 2){ }}
  289. <a href="{:url('talkskill/success_index')}?type={{d.id}}" lay-event="talkill_list" style="color: #0066CC">
  290. <i class="layui-icon">&#xe609;</i>&nbsp;&nbsp;{{d.name}}
  291. </a>
  292. {{# }else{ }}
  293. <a href="{:url('talkskill/success_index')}?type={{d.id}}" lay-event="talkill_list" style="color: #0066CC">
  294. {{d.name}}
  295. </a>
  296. {{# } }}
  297. </script>
  298. <script>
  299. layui.config({
  300. base: '__LAYUI__/',
  301. urlbase: '/sys'
  302. }).extend({
  303. index: 'lib/index'
  304. }).use(['index', 'table', 'element'], function() {
  305. var $ = layui.$,
  306. form = layui.form,
  307. element = layui.element,
  308. table = layui.table;
  309. var field = {};
  310. form.on('submit(search)', function (data) {
  311. var type = $('#type').val();
  312. var keyword = $('#keyword').val();
  313. field['type'] = type;
  314. field['keyword'] = keyword;
  315. //执行重载
  316. table.reload('label-table', {
  317. where: field
  318. ,page: {curr:1}
  319. });
  320. });
  321. var active = {
  322. add: function() {
  323. layer.open({
  324. type: 2,
  325. title:['话术上传', 'color:#333333;background-color:#D8E6F1;'],
  326. content: '{:url("talkskill/success_add")}',
  327. resize: false,
  328. area: ['80%', '90%'],
  329. btn: ['确定', '取消'],
  330. yes: function(index, layero) {
  331. //点击确认触发 iframe 内容中的按钮提交
  332. var submit = layero.find('iframe').contents().find("#talkskill-submit");
  333. submit.click();
  334. }
  335. });
  336. },
  337. //字典管理
  338. dictionary:function() {
  339. layer.open({
  340. type: 2,
  341. title:['字典管理', 'color:#333333;background-color:#D8E6F1;'],
  342. content: '{:url("talkskill/dictionary")}',
  343. resize: false,
  344. area: ['80%', '80%'],
  345. // btn: ['确定', '取消'],
  346. yes: function(index, layero) {
  347. }
  348. });
  349. }
  350. };
  351. //列表
  352. table.render({
  353. elem: '#label-table',
  354. autoSort: false,
  355. url: '{:url("talkskill/success_cate_list")}',
  356. cols: [
  357. [{
  358. type: 'numbers',
  359. field: 'id',
  360. width: 80,
  361. title: '序号',
  362. }, {
  363. field: 'title',
  364. align: 'center',
  365. title: '场景',
  366. templet: '#label_name'
  367. }, {
  368. field: 'talkskill_count',
  369. align: 'center',
  370. title: '话术条数'
  371. }, {
  372. align: 'center',
  373. title: '浏览量',
  374. field: 'view_times'
  375. }, {
  376. field: 'update_time',
  377. align: 'center',
  378. title: '更新时间',
  379. templet: '#update_time'
  380. }, {
  381. title: '操作',
  382. width: 240,
  383. align: 'center',
  384. toolbar: '#table-evidence-action',
  385. fixed:'right'
  386. }]
  387. ],
  388. page: true,
  389. limit: 30,
  390. height: 'full-220',
  391. text: '对不起,加载出现异常!'
  392. });
  393. //监听列表
  394. table.on('tool(label-table)', function(obj) {
  395. var data = obj.data;
  396. if(obj.event === 'delete') {
  397. layer.confirm('确定要删除该场景么?',{title:['信息', 'color:#333333;background-color:#D8E6F1;'],}, function() {
  398. $.get("{:url('talkskill/cate_del')}?type=0&id=" + data.id, function(res) {
  399. if(res.code === 0) {
  400. layer.msg(res.msg, {
  401. anim: 0,time:800
  402. }, function() {
  403. table.reload('label-table');
  404. });
  405. } else {
  406. layer.msg(res.msg, {
  407. anim: 6,time:800
  408. });
  409. }
  410. });
  411. });
  412. } else if(obj.event === 'edit') {
  413. layer.prompt({
  414. title:['编辑', 'color:#333333;background-color:#D8E6F1;'],
  415. value: data.label_name
  416. }, function(value, index) {
  417. if($.trim(value) == data.label_name || $.trim(value) == '') {
  418. layer.msg('请修改名称', {anim: 6,time: 800});
  419. return false;
  420. }
  421. if($.trim(value).length > 20) {
  422. layer.msg('场景名称超长', {anim: 6,time: 800});
  423. return false;
  424. }
  425. $.ajax({
  426. url: '{:url("talkskill/dictionary_ajax_edit")}',
  427. type: 'post',
  428. data: {
  429. id: data.id,
  430. name: $.trim(value),
  431. type:0
  432. },
  433. dataType: 'json',
  434. success: function(res) {
  435. if(res.code === 0) {
  436. layer.msg(res.msg, {anim: 0,time: 800});
  437. //执行重载
  438. table.reload('label-table');
  439. } else {
  440. layer.msg(res.msg, {anim: 6,time: 800});
  441. }
  442. }
  443. });
  444. layer.close(index);
  445. });
  446. }else if(obj.event === 'addhs') {
  447. layer.open({
  448. type: 2,
  449. title:['上传 #'+data.name+'# 话术', 'color:#333333;background-color:#D8E6F1;'],
  450. content: '{:url("talkskill/success_add_new")}?id=' + data.id,
  451. resize: false,
  452. area: ['80%', '90%'],
  453. btn: ['确定', '取消'],
  454. yes: function(index, layero) {
  455. //点击确认触发 iframe 内容中的按钮提交
  456. var submit = layero.find('iframe').contents().find("#talkskill-submit");
  457. submit.click();
  458. }
  459. });
  460. }
  461. });
  462. $('.layui-btn.layuiadmin-btn').on('click', function() {
  463. var type = $(this).data('type');
  464. active[type] ? active[type].call(this) : '';
  465. });
  466. });
  467. </script>
  468. {/block}