Merge branch 'master-500-dev' of http://192.168.1.136:82/monitor_v3/hg-monitor-w…
…eb into master-500-dev
Showing
8 changed files
with
60 additions
and
8 deletions
@@ -276,6 +276,27 @@ layui.define(['xmSelect', 'md5'], function (exports) { | @@ -276,6 +276,27 @@ layui.define(['xmSelect', 'md5'], function (exports) { | ||
276 | } | 276 | } |
277 | }); | 277 | }); |
278 | }, | 278 | }, |
279 | + //文件预览 | ||
280 | + fileviewer: function(filepath){ | ||
281 | + var accessToken = ''; | ||
282 | + layui.use(['sessions', 'common'], function () { | ||
283 | + var sessions = layui.sessions; | ||
284 | + accessToken = sessions.getToken()['access_token']; | ||
285 | + }); | ||
286 | + var url = obj.domainName + `/api-web/openoffice/convertPdf/?path=${encodeURIComponent(filepath)}`+'&access_token=' + accessToken; | ||
287 | + var loadIndex = layer.load(1, {shade: [0.3], content: '文件正在转换...'}); | ||
288 | + $.ajax({ | ||
289 | + type: "get", | ||
290 | + url: url, | ||
291 | + async: true, | ||
292 | + success: function (data) { | ||
293 | + if (data.code == 0) { | ||
294 | + layer.close(loadIndex); | ||
295 | + window.open("/src/lib/extend/pdfjs/web/viewer.html?test=" + encodeURIComponent(data.str)); | ||
296 | + } | ||
297 | + } | ||
298 | + }); | ||
299 | + }, | ||
279 | //业务下拉选择数据绑定 | 300 | //业务下拉选择数据绑定 |
280 | bizTypeSelect: function (targtetId, callback) { | 301 | bizTypeSelect: function (targtetId, callback) { |
281 | var options = "<option value=''>=所属业务=</option>"; | 302 | var options = "<option value=''>=所属业务=</option>"; |
@@ -57,7 +57,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | @@ -57,7 +57,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | ||
57 | }, | 57 | }, |
58 | { | 58 | { |
59 | title: '操作', align: "center", width: 120, | 59 | title: '操作', align: "center", width: 120, |
60 | - templet: '<div><span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link preview-attachment-btn">预览</span>' + | 60 | + templet: '<div><span data-id="{{d.id}}" data-suffix="{{d.suffix}}" data-path="{{d.path}}" class="layui-table-link preview-attachment-btn">预览</span>' + |
61 | '<span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link attachment-download-btn" style="margin-left: 10px">下载</span></div>' | 61 | '<span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link attachment-download-btn" style="margin-left: 10px">下载</span></div>' |
62 | } | 62 | } |
63 | ]], | 63 | ]], |
@@ -65,6 +65,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | @@ -65,6 +65,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | ||
65 | $('.preview-attachment-btn').on('click', function () { | 65 | $('.preview-attachment-btn').on('click', function () { |
66 | var id = $(this).data('id') | 66 | var id = $(this).data('id') |
67 | var suffix = $(this).data('suffix') | 67 | var suffix = $(this).data('suffix') |
68 | + var filepath = $(this).data('path') | ||
68 | if (suffix == 'jpg' || suffix == 'png' || suffix == 'JPG' || suffix == 'PNG') { //图片类型 | 69 | if (suffix == 'jpg' || suffix == 'png' || suffix == 'JPG' || suffix == 'PNG') { //图片类型 |
69 | var srcUrl = domainName + `/api-web/openoffice/readImage/${id}?access_token=` + accessToken | 70 | var srcUrl = domainName + `/api-web/openoffice/readImage/${id}?access_token=` + accessToken |
70 | layer.open({ | 71 | layer.open({ |
@@ -75,7 +76,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | @@ -75,7 +76,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | ||
75 | }) | 76 | }) |
76 | } else { | 77 | } else { |
77 | //附件为文档类型 | 78 | //附件为文档类型 |
78 | - common.openReport(id) | 79 | + common.fileviewer(filepath) |
79 | } | 80 | } |
80 | }) | 81 | }) |
81 | 82 |
@@ -57,7 +57,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | @@ -57,7 +57,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | ||
57 | }, | 57 | }, |
58 | { | 58 | { |
59 | title: '操作', align: "center", width: 120, | 59 | title: '操作', align: "center", width: 120, |
60 | - templet: '<div><span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link preview-attachment-btn">预览</span>' + | 60 | + templet: '<div><span data-id="{{d.id}}" data-suffix="{{d.suffix}}" data-path="{{d.path}}" class="layui-table-link preview-attachment-btn">预览</span>' + |
61 | '<span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link attachment-download-btn" style="margin-left: 10px">下载</span></div>' | 61 | '<span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link attachment-download-btn" style="margin-left: 10px">下载</span></div>' |
62 | } | 62 | } |
63 | ]], | 63 | ]], |
@@ -65,6 +65,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | @@ -65,6 +65,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | ||
65 | $('.preview-attachment-btn').on('click', function () { | 65 | $('.preview-attachment-btn').on('click', function () { |
66 | var id = $(this).data('id') | 66 | var id = $(this).data('id') |
67 | var suffix = $(this).data('suffix') | 67 | var suffix = $(this).data('suffix') |
68 | + var filepath = $(this).data('path') | ||
68 | if (suffix == 'jpg' || suffix == 'png' || suffix == 'JPG' || suffix == 'PNG') { //图片类型 | 69 | if (suffix == 'jpg' || suffix == 'png' || suffix == 'JPG' || suffix == 'PNG') { //图片类型 |
69 | var srcUrl = domainName + `/api-web/openoffice/readImage/${id}?access_token=` + accessToken | 70 | var srcUrl = domainName + `/api-web/openoffice/readImage/${id}?access_token=` + accessToken |
70 | layer.open({ | 71 | layer.open({ |
@@ -75,7 +76,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | @@ -75,7 +76,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | ||
75 | }) | 76 | }) |
76 | } else { | 77 | } else { |
77 | //附件为文档类型 | 78 | //附件为文档类型 |
78 | - common.openReport(id) | 79 | + common.fileviewer(filepath) |
79 | } | 80 | } |
80 | }) | 81 | }) |
81 | 82 |
@@ -126,6 +126,10 @@ layui.define(['table', 'laydate', 'admin', 'view', 'common', 'sessions'], functi | @@ -126,6 +126,10 @@ layui.define(['table', 'laydate', 'admin', 'view', 'common', 'sessions'], functi | ||
126 | }, | 126 | }, |
127 | data: res.data | 127 | data: res.data |
128 | }) | 128 | }) |
129 | + if(settingOrgSelect){ | ||
130 | + //追加样式 | ||
131 | + $('#settingOrgId').find('.xm-body').eq(0).css("width","230px"); | ||
132 | + } | ||
129 | } | 133 | } |
130 | }) | 134 | }) |
131 | } | 135 | } |
@@ -111,7 +111,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | @@ -111,7 +111,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | ||
111 | }, | 111 | }, |
112 | { | 112 | { |
113 | title: '操作', align: "center", width: 120, | 113 | title: '操作', align: "center", width: 120, |
114 | - templet: '<div><span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link preview-attachment-btn">预览</span>' + | 114 | + templet: '<div><span data-id="{{d.id}}" data-suffix="{{d.suffix}}" data-path="{{d.path}}" class="layui-table-link preview-attachment-btn">预览</span>' + |
115 | '<span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link attachment-download-btn" style="margin-left: 10px">下载</span></div>' | 115 | '<span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link attachment-download-btn" style="margin-left: 10px">下载</span></div>' |
116 | } | 116 | } |
117 | ]], | 117 | ]], |
@@ -119,6 +119,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | @@ -119,6 +119,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | ||
119 | $('.preview-attachment-btn').on('click', function () { | 119 | $('.preview-attachment-btn').on('click', function () { |
120 | var id = $(this).data('id') | 120 | var id = $(this).data('id') |
121 | var suffix = $(this).data('suffix') | 121 | var suffix = $(this).data('suffix') |
122 | + var filepath = $(this).data('path') | ||
122 | if (suffix == 'jpg' || suffix == 'png' || suffix == 'JPG' || suffix == 'PNG') { //图片类型 | 123 | if (suffix == 'jpg' || suffix == 'png' || suffix == 'JPG' || suffix == 'PNG') { //图片类型 |
123 | var srcUrl = domainName + `/api-web/openoffice/readImage/${id}?access_token=` + accessToken | 124 | var srcUrl = domainName + `/api-web/openoffice/readImage/${id}?access_token=` + accessToken |
124 | layer.open({ | 125 | layer.open({ |
@@ -129,7 +130,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | @@ -129,7 +130,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | ||
129 | }) | 130 | }) |
130 | } else { | 131 | } else { |
131 | //附件为文档类型 | 132 | //附件为文档类型 |
132 | - common.openReport(id) | 133 | + common.fileviewer(filepath); |
133 | } | 134 | } |
134 | }) | 135 | }) |
135 | 136 |
@@ -128,7 +128,10 @@ | @@ -128,7 +128,10 @@ | ||
128 | display: flex; | 128 | display: flex; |
129 | align-items: center; | 129 | align-items: center; |
130 | font-size: 12px; | 130 | font-size: 12px; |
131 | - justify-content: end; | 131 | + justify-content: flex-end; |
132 | +} | ||
133 | +.range-padding-right{ | ||
134 | + padding-right: 100px; | ||
132 | } | 135 | } |
133 | .pie-date-range{ | 136 | .pie-date-range{ |
134 | flex:1; | 137 | flex:1; |
1 | <el-row class="dataRange-container"> | 1 | <el-row class="dataRange-container"> |
2 | <el-col :span="24"> | 2 | <el-col :span="24"> |
3 | <div class="tabs-div date-flex-div-around"> | 3 | <div class="tabs-div date-flex-div-around"> |
4 | - <el-col :span="24" class="select-div-flex"> | 4 | + <el-col :span="24" class="select-div-flex range-padding-right"> |
5 | 时间范围:<el-date-picker | 5 | 时间范围:<el-date-picker |
6 | class="picker-div" | 6 | class="picker-div" |
7 | v-model="dateValue" | 7 | v-model="dateValue" |
@@ -276,6 +276,27 @@ layui.define(['xmSelect', 'md5'], function (exports) { | @@ -276,6 +276,27 @@ layui.define(['xmSelect', 'md5'], function (exports) { | ||
276 | } | 276 | } |
277 | }); | 277 | }); |
278 | }, | 278 | }, |
279 | + //文件预览 | ||
280 | + fileviewer: function(filepath){ | ||
281 | + var accessToken = ''; | ||
282 | + layui.use(['sessions', 'common'], function () { | ||
283 | + var sessions = layui.sessions; | ||
284 | + accessToken = sessions.getToken()['access_token']; | ||
285 | + }); | ||
286 | + var url = obj.domainName + `/api-web/openoffice/convertPdf/?path=${encodeURIComponent(filepath)}`+'&access_token=' + accessToken; | ||
287 | + var loadIndex = layer.load(1, {shade: [0.3], content: '文件正在转换...'}); | ||
288 | + $.ajax({ | ||
289 | + type: "get", | ||
290 | + url: url, | ||
291 | + async: true, | ||
292 | + success: function (data) { | ||
293 | + if (data.code == 0){ | ||
294 | + layer.close(loadIndex); | ||
295 | + window.open("/src/lib/extend/pdfjs/web/viewer.html?test=" + encodeURIComponent(data.str)); | ||
296 | + } | ||
297 | + } | ||
298 | + }); | ||
299 | + }, | ||
279 | //业务下拉选择数据绑定 | 300 | //业务下拉选择数据绑定 |
280 | bizTypeSelect: function (targtetId, callback) { | 301 | bizTypeSelect: function (targtetId, callback) { |
281 | var options = "<option value=''>=所属业务=</option>"; | 302 | var options = "<option value=''>=所属业务=</option>"; |
-
Please register or login to post a comment