暫無描述

zhiShiKuManger.html 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <!--<link rel="stylesheet" href="../css/layer/need/layer.css" />-->
  8. <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  9. <link rel="stylesheet" href="../css/init.css" />
  10. <link rel="stylesheet" href="../css/addappeal.css" />
  11. <link rel="stylesheet" href="../js/layui/css/layui.css">
  12. <title>知识库管理</title>
  13. <style>
  14. .toolBar {
  15. padding: 15px 0;
  16. border-bottom: 1px solid #ccc;
  17. }
  18. .boxCon table th {
  19. width: 20%;
  20. }
  21. .boxCon table td textarea {
  22. width: 100%;
  23. }
  24. .inpBox {
  25. border: 1px solid #a9a9a9;
  26. height: 27px;
  27. width: 55%;
  28. display: inline-block;
  29. position: relative;
  30. vertical-align: middle;
  31. }
  32. .inps1,
  33. .inps4 {
  34. width: 100%;
  35. height: 24px;
  36. outline: none;
  37. border: 0;
  38. border-image-width: 0;
  39. padding: 0;
  40. padding-left: 3px;
  41. }
  42. .changeTitle,
  43. .changeKey,
  44. .addTitle,
  45. .addKey {
  46. width: 55%;
  47. }
  48. .xl {
  49. display: inline-block;
  50. background: url(../img/dropDown.png) no-repeat;
  51. height: 100%;
  52. background-position: center center;
  53. width: 20px;
  54. position: absolute;
  55. right: 0;
  56. top: 0px;
  57. background-color: #f7bc8b;
  58. cursor: pointer;
  59. }
  60. .xl:hover {
  61. background-color: #e6d523;
  62. }
  63. .addTree {
  64. background: #fff;
  65. position: absolute;
  66. width: 100%;
  67. border: 1px solid darkgrey;
  68. right: 0;
  69. top: 26px;
  70. display: none;
  71. height: 220px;
  72. overflow-y: auto;
  73. }
  74. .treeTable {
  75. height: 400px;
  76. /*overflow-y: auto;*/
  77. }
  78. .tree {
  79. height: 100%;
  80. }
  81. .trTitle {
  82. width: 100%;
  83. height: 34px;
  84. line-height: 34px;
  85. border-bottom: 1px solid #ebebeb;
  86. color: red;
  87. font-weight: 700;
  88. margin-bottom: 15px;
  89. }
  90. .treeCon {
  91. border: 1px solid #ebebeb;
  92. overflow-y: auto;
  93. }
  94. .ztree li {
  95. width: 100%;
  96. overflow: hidden;
  97. white-space: nowrap;
  98. text-overflow: ellipsis;
  99. }
  100. .content {
  101. width: 270px;
  102. height: 25px;
  103. overflow: hidden;
  104. white-space: nowrap;
  105. text-overflow: ellipsis;
  106. text-align: left;
  107. }
  108. /*//*/
  109. .reflectCategory-wrapper {
  110. position: relative;
  111. }
  112. .reflectCategoryList-wrapper {
  113. display: none;
  114. position: absolute;
  115. top: 38px;
  116. z-index: 9999;
  117. line-height: 32px;
  118. background: #FFF;
  119. }
  120. #reflectCategoryList {
  121. height: 240px;
  122. background: #FFF;
  123. border: 1px solid #e5e6e7;
  124. overflow: auto;
  125. }
  126. #reflectCategoryList li {
  127. padding: 0 10px;
  128. width: 100%;
  129. line-height: 32px;
  130. }
  131. #reflectCategoryList li:hover {
  132. background: #00a1cb;
  133. }
  134. </style>
  135. </head>
  136. <body>
  137. <div class="container-fluid">
  138. <div class="daoHang clearfix">
  139. <div class="dhLeft">
  140. <sapn><i class="syIcon"></i>位置:
  141. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  142. <a href="javaScript:;">知识库</a>&gt;
  143. <a href="" class="nowPosition">内容管理</a>
  144. </sapn>
  145. </div>
  146. </div>
  147. <div class="toolBar clearfix">
  148. <div class="toolLeft">
  149. <button class="btns add">添加</button>
  150. <button class="btns change">修改</button>
  151. <button class="btns del">删除</button>
  152. </div>
  153. <div class="toolRight">
  154. <span>搜索内容:<input type="text" class="searCon" /></span>
  155. <button class="btns searchGo">搜索</button>
  156. </div>
  157. </div>
  158. <div class="treeTable clearfix">
  159. <div class="tree col-md-3">
  160. <div class="trTitle">知识库分类</div>
  161. <div class="treeCon">
  162. <ul id="treeDemo" class="ztree">
  163. <!--类名为ztree是必须的-->
  164. </ul>
  165. </div>
  166. </div>
  167. <div class="tableCon col-md-9">
  168. <div class="trTitle"> 知识库列表</div>
  169. <table id="table1" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
  170. <thead>
  171. <tr>
  172. <th data-align="center" data-formatter="setCode"></th>
  173. <th data-field="state" data-checkbox="true" data-align="center"></th>
  174. <!--<th data-align="center" data-field="id" data-formatter="setCode"></th>-->
  175. <th data-field="CategoryName" data-align="left">类别</th>
  176. <th data-field="F_Title" data-align="left">标题</th>
  177. <th data-field="F_Description" data-align="left" data-formatter="oper">内容</th>
  178. <th data-field="F_KeyWords" data-align="center">关键字</th>
  179. <th data-field="F_CreateOn" data-align="center">创建时间</th>
  180. </tr>
  181. </thead>
  182. <tbody id="tbody"></tbody>
  183. </table>
  184. </div>
  185. </div>
  186. </div>
  187. <!--添加弹出内容-->
  188. <div class="model addModel">
  189. <div class="box">
  190. <div class="btop clearfix">
  191. <p class="btl">添加知识库</p>
  192. <p class="btr addBtr" title="关闭">X</p>
  193. </div>
  194. <div class="boxCon">
  195. <table>
  196. <tbody>
  197. <tr>
  198. <th>所属分类:</th>
  199. <td colspan="3">
  200. <div class="inpBox">
  201. <input type="text" class="inps inps1" />
  202. <i class="xl xl_one"></i>
  203. <div class="addTree xlAdd">
  204. <ul id="addTreeDemo" class="ztree"></ul>
  205. </div>
  206. </div>
  207. </td>
  208. </tr>
  209. <tr>
  210. <th>标题:</th>
  211. <td colspan="3"><input type="text" class="addTitle" /></td>
  212. </tr>
  213. <tr>
  214. <th>关键字:</th>
  215. <td colspan="3"><input type="text" class="addKey" /></td>
  216. </tr>
  217. <tr>
  218. <th>反映类别:</th>
  219. <td colspan="3" class="reflectCategory-wrapper">
  220. <input type="text" id="reflectCategory" class="form-control" autocomplete="off" />
  221. <div class="reflectCategoryList-wrapper">
  222. <ul id="reflectCategoryList">
  223. </ul>
  224. </div>
  225. </td>
  226. </tr>
  227. <tr>
  228. <th>内容:</th>
  229. <td colspan="3"><textarea data-adaptheight id="addEditor" name="content" style="width: 100%;height: 100px;"></textarea></td>
  230. </tr>
  231. </tbody>
  232. </table>
  233. <div style="text-align: center;"><button class="btns addCun">保存</button></div>
  234. </div>
  235. </div>
  236. </div>
  237. <!--删除弹出内容-->
  238. <div class="model delModel">
  239. <div class="box">
  240. <div class="btop clearfix">
  241. <p class="btl"><span>删除提示</span></p>
  242. <p class="btr delBtr" title="关闭">X</p>
  243. </div>
  244. <div class="boxCon" style="height: 150px;">
  245. <p style="text-align: center;font-size: 16px;margin-top: 30px;">您确定要删除吗?</p>
  246. <p style="margin-top: 30px;text-align: center;">
  247. <button class="btns sure">确定</button>
  248. <button class="btns return">取消</button>
  249. </p>
  250. <!--<p style="color: red;">注:若该分类下包含知识库内容会一并删除</p>-->
  251. </div>
  252. </div>
  253. </div>
  254. <!--修改弹出内容-->
  255. <div class="model changeModel">
  256. <div class="box">
  257. <div class="btop clearfix">
  258. <p class="btl">修改知识库</p>
  259. <p class="btr changeBtr" title="关闭">X</p>
  260. </div>
  261. <div class="boxCon">
  262. <table>
  263. <tbody>
  264. <tr>
  265. <th>所属分类:</th>
  266. <td colspan="3">
  267. <div class="inpBox">
  268. <input type="text" class="inps inps4" />
  269. <i class="xl xl_two"></i>
  270. <div class="addTree xlChange">
  271. <ul id="changeTreeDemo" class="ztree"></ul>
  272. </div>
  273. </div>
  274. </td>
  275. </tr>
  276. <tr>
  277. <th>标题:</th>
  278. <td colspan="3"><input type="text" class="changeTitle" /></td>
  279. </tr>
  280. <tr>
  281. <th>关键字:</th>
  282. <td colspan="3"><input type="text" class="changeKey" /></td>
  283. </tr>
  284. <tr>
  285. <th>反映类别:</th>
  286. <td colspan="3" class="reflectCategory-wrapper">
  287. <input type="text" id="changereflectCategory" class="form-control" autocomplete="off" />
  288. <div class="reflectCategoryList-wrapper">
  289. <ul id="changereflectCategoryList">
  290. </ul>
  291. </div>
  292. </td>
  293. </tr>
  294. <tr>
  295. <th>内容:</th>
  296. <td colspan="3"><textarea data-adaptheight id="changeEditor" name="content" style="width: 100%;height: 100px;"></textarea></td>
  297. </tr>
  298. </tbody>
  299. </table>
  300. <div style="text-align: center;"><button class="btns changeCun">保存</button></div>
  301. </div>
  302. </div>
  303. </div>
  304. <input type="hidden" id="PID" value="" />
  305. <input type="hidden" id="PID2" value="" />
  306. <script src="../js/layui/layui.js"></script>
  307. <script src="../css/layer/layer.js"></script>
  308. <script src="../js/adjustHeight.js"></script>
  309. <script src="../js/zTree/jquery.ztree.core.js"></script>
  310. <!--<script src="../js/ztreeSelect.js"></script>-->
  311. <script src="../js/kindeditor/kindeditor-all-min.js"></script>
  312. <script src="../js/kindeditor/lang/zh-CN.js"></script>
  313. <script src="./js/zhiShiKuManger.js"></script>
  314. <script>
  315. $(document).ready(function() {
  316. getReactionCategory();
  317. getReactionCategory2();
  318. $("#reflectCategory").bind("input propertychange", function() {
  319. $(".layui-dropdown").hide();
  320. if($("#reflectCategory").val() == "") {
  321. $(".reflectCategoryList-wrapper").hide();
  322. return;
  323. }
  324. var debounceGetSearchReactionCategory = debounce(getSearchReactionCategory, 500)
  325. $(".reflectCategoryList-wrapper").show();
  326. debounceGetSearchReactionCategory($("#reflectCategory").val())
  327. })
  328. $("#reflectCategoryList").on("click", "li", function() {
  329. $(".reflectCategoryList-wrapper").hide();
  330. $("#reflectCategory").val($(this).attr("indexName"));
  331. $("#PID").val($(this).attr("index"));
  332. });
  333. $("#changereflectCategory").bind("input propertychange", function() {
  334. $(".layui-dropdown").hide();
  335. if($("#reflectCategory").val() == "") {
  336. $(".reflectCategoryList-wrapper").hide();
  337. return;
  338. }
  339. var debounceGetSearchReactionCategory2 = debounce2(getSearchReactionCategory2, 500)
  340. $(".reflectCategoryList-wrapper").show();
  341. debounceGetSearchReactionCategory2($("#changereflectCategory").val())
  342. })
  343. $("#changereflectCategoryList").on("click", "li", function() {
  344. $(".reflectCategoryList-wrapper").hide();
  345. $("#changereflectCategory").val($(this).attr("indexName"));
  346. $("#PID2").val($(this).attr("index"));
  347. });
  348. })
  349. function getReactionCategory(pid = 38) {
  350. pid = 38
  351. $.get(
  352. huayi.config.callcenter_url + "Dictionary/GetKnowledgeZTree", {
  353. token: $.cookie("token"),
  354. pid: pid,
  355. },
  356. function(result) {
  357. result = $.parseJSON(result);
  358. var content = JSON.parse(result.data);
  359. layui.use("dropdown", function() {
  360. var dropdown = layui.dropdown;
  361. dropdown.render({
  362. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  363. data: content,
  364. id: "reflectCategory",
  365. //菜单被点击的事件
  366. click: function(obj) {
  367. $("#reflectCategory").val(obj.title)
  368. $("#PID").val(obj.id)
  369. },
  370. });
  371. });
  372. }
  373. );
  374. }
  375. function getReactionCategory2(pid = 38) {
  376. pid = 38
  377. $.get(
  378. huayi.config.callcenter_url + "Dictionary/GetKnowledgeZTree", {
  379. token: $.cookie("token"),
  380. pid: pid,
  381. },
  382. function(result) {
  383. result = $.parseJSON(result);
  384. var content = JSON.parse(result.data);
  385. layui.use("dropdown", function() {
  386. var dropdown = layui.dropdown;
  387. dropdown.render({
  388. elem: "#changereflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  389. data: content,
  390. id: "changereflectCategory",
  391. //菜单被点击的事件
  392. click: function(obj) {
  393. $("#changereflectCategory").val(obj.title)
  394. $("#PID2").val(obj.id)
  395. },
  396. });
  397. });
  398. }
  399. );
  400. }
  401. function getSearchReactionCategory(key) {
  402. $.get(
  403. huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
  404. token: $.cookie("token"),
  405. key: key,
  406. },
  407. function(result) {
  408. result = $.parseJSON(result);
  409. if(result.state.toLowerCase() === "success") {
  410. $("#reflectCategoryList").empty();
  411. var content = result.data;
  412. if(content.length > 0) {
  413. content.forEach(function(e, i) {
  414. $("<li index='" + e.id + "' indexName='" + e.name + "'>" + e.names +
  415. "</li>")
  416. .appendTo("#reflectCategoryList");
  417. });
  418. } else {
  419. $("<li index='' indexName=''>没有相关数据</li>").appendTo("#reflectCategoryList");
  420. }
  421. }
  422. }
  423. );
  424. }
  425. function getSearchReactionCategory2(key) {
  426. $.get(
  427. huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
  428. token: $.cookie("token"),
  429. key: key,
  430. },
  431. function(result) {
  432. result = $.parseJSON(result);
  433. if(result.state.toLowerCase() === "success") {
  434. $("#changereflectCategoryList").empty();
  435. var content = result.data;
  436. if(content.length > 0) {
  437. content.forEach(function(e, i) {
  438. $("<li index='" + e.id + "' indexName='" + e.name + "'>" + e.names +
  439. "</li>")
  440. .appendTo("#changereflectCategoryList");
  441. });
  442. } else {
  443. $("<li index='' indexName=''>没有相关数据</li>").appendTo("#changereflectCategoryList");
  444. }
  445. }
  446. }
  447. );
  448. }
  449. function debounce(fun, delay) {
  450. return function(args) {
  451. var that = this;
  452. var _args = args
  453. clearTimeout(fun.id)
  454. fun.id = setTimeout(function() {
  455. fun.call(that, _args)
  456. }, delay)
  457. }
  458. }
  459. function debounce2(fun, delay) {
  460. return function(args) {
  461. var that = this;
  462. var _args = args
  463. clearTimeout(fun.id)
  464. fun.id = setTimeout(function() {
  465. fun.call(that, _args)
  466. }, delay)
  467. }
  468. }
  469. </script>
  470. </body>
  471. </html>