| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../../Script/Common/huayi.load.js"></script>
- <script src="../../Script/Common/huayi.config.js"></script>
- <link rel="stylesheet" href="../../css/init.css" />
- <link rel="stylesheet" href="../css/seeDetail.css" />
- <link href="//vjs.zencdn.net/7.3.0/video-js.min.css" rel="stylesheet">
- <title>知识库查询</title>
- </head>
- <body>
- <!--查看弹出内容-->
- <table class="table-bordered table">
- <tbody>
- <tr>
- <th>标题:</th>
- <td colspan="3" class="addTitle explancon"></td>
- </tr>
- <tr>
- <th>关键字:</th>
- <td colspan="3" class="addKey explancon"></td>
- </tr>
- <tr>
- <th>内容:</th>
- <td colspan="3" class="addCon explancon"></td>
- </tr>
- <tr>
- <th>附件:</th>
- <td colspan="3">
- <ul id="fileList" class="clearfix">
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- </body>
- <script src="../../js/download/download.js"></script>
- <script src="../../js/mousewheel/jquery.mousewheel.js"></script>
- <script src="../../js/WorkOrder/jquery.drag.js"></script>
- <script>
- var token = $.cookie("token");
- var changeGetid = helper.request.queryString("changeGetid");
- var otext = helper.request.queryString("otext");
- $(function() {
- if (changeGetid) {
- getChangeBox();
- }
- });
- function getChangeBox() {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "Knowledge/GetInfo",
- async: false,
- dataType: 'json',
- data: {
- infoid: changeGetid,
- token: token
- },
- success: function(data) {
- var con = data.data;
- if (con) {
- debugger
- $('.addTitle').html(con.F_Title);
- $('.addKey').html(con.F_KeyWords);
- $('.addCon').html(helper.filter.content(con.F_Content));
- var proimglist = con.FileUrls;
- if (proimglist && proimglist.length > 0) {
- $(proimglist).each(function(i, n) {
- var fileType = n.F_FileType.split("\/")[0];
- if (fileType === 'image') {
- $('<div class="img-box">' +
- '<span class="img_mask"><span onclick=downloadFile("'+ n.F_FileUrl + '","' + n.F_FileName + '","' + n.F_FileType +
- '") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
- '<img layer-src="' + n.F_FileUrl + '" src="' + n.F_FileUrl + '" alt="' + n.F_FileName +
- '" class="image-item" /><div>').appendTo("#fileList");
- }else if(fileType === 'video'){
- $('<div class="img-box">' +
- '<span class="img_mask"><span href="javascript:;" onclick=downloadFile("' + n.F_FileUrl + '","' + n.F_FileName +
- '","' + n.F_FileType +
- '") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
- '<span class="img_filename" onclick="playVideo(\''+ n.F_FileUrl + '\' , \'' + n.F_FileType + '\')">' + n.F_FileName.split(".")[1] + '</span><div>').appendTo("#fileList");
- } else {
- $('<div class="img-box">' +
- '<span class="img_mask"><span href="javascript:;" onclick=downloadFile("' + n.F_FileUrl + '","' + n.F_FileName +
- '","' + n.F_FileType +
- '") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
- '<span class="img_filename">'+n.F_OriName + n.F_FileName.split(".")[1] + '</span><div>').appendTo("#fileList");
- }
- });
- layer.photos({
- photos: '#fileList',
- anim: 5, //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
- title: '查看图片',
- move: '.layui-layer-title',
- shadeClose: false,
- closeBtn: 1,
- area: ['80%', '90%'],
- tab: function(pic, layero) {
- $('.layui-layer-content').on("mousewheel", function(e, d) {
-
- helper.methods.zoomImg($('#layui-layer-photos').find('img[alt="' + pic.alt + '"]'), d);
- $('#layui-layer-photos').find('img[alt="' + pic.alt + '"]').dragging({
- move: "both", //拖动方向,x y both
- randomPosition: false //初始位置是否随机
- });
- return false;
-
- });
- helper.methods.initLayerPhotos('#layui-layer-photos', pic, layero);
- },
- });
- $('.explancon').GL({
-
- ocolor: 'red', //设置关键词高亮颜色
- oshuru: otext //设置要显示的关键词
- });
- }
- }
- }
- });
- }
- //下载
- function downloadFile(data, strFileName, strMimeType) {
- event.preventDefault();
- //详细见文档 http://danml.com/download.html
- var x = new XMLHttpRequest();
- x.open("GET", data, true);
- x.responseType = 'blob';
- x.onload = function(e) {
- download(x.response, strFileName, strMimeType);
- }
- x.send();
- }
-
- /**
- * 播放视频
- * @playUrl 视频地址
- * @fileType 视屏类型
- * */
- function playVideo(playUrl, fileType){
- layer.open({
- maxmin: true, //开启最大化最小化按钮
- type: 2,
- content: "./playVideo.html?playUrl=" + encodeURIComponent(playUrl) + "&fileType=" + encodeURIComponent(fileType), //iframe的url,no代表不显示滚动条
- title: ' ',
- area: ['90%', '90%'], //宽高
- });
- }
- (function($) {
- $.fn.GL = function(options) {
- var dataop = {
- ocolor: 'red',
- oshuru: '',
- };
- var chuancan = $.extend(dataop, options);
- $(this).each(function() {
- var _this = $(this)
- _this.find($(".glnow")).each(function() {
- $(this).css({
- color: ""
- });
- });
- });
- if(chuancan.oshuru == '') {
- return false;
-
- } else {
- var regExp = new RegExp("(" + chuancan.oshuru.replace(/[(){}.+*?^$|\\\[\]]/g, "\\$&") + ")", "ig");
- $(this).each(function() {
- var _this1 = $(this)
- var html = _this1.html();
- var newHtml = html.replace(regExp, '<span class="glnow" style="color:' + chuancan.ocolor + '">' + chuancan.oshuru + '</span>');
- _this1.html(newHtml);
- });
- }
- }
- })(jQuery);
- </script>
- </html>
|