Commit be728524 by lichengming

添加了委托评审提交审批按钮

parent b1cc8a48
...@@ -488,6 +488,78 @@ Vue.prototype.$layx = function(id, title, url, option) { ...@@ -488,6 +488,78 @@ Vue.prototype.$layx = function(id, title, url, option) {
layx.iframe(id, title, url, option || { width: '100%', height: '100%' }) layx.iframe(id, title, url, option || { width: '100%', height: '100%' })
} }
/** /**
* 文件格式
* param(img:是否为图片格式)
*/
Vue.prototype.$fileFormat = function(type, param) {
const res = [
'doc',
'docx',
'txt',
'xls',
'xlsx',
'ppt',
'pptx',
'pdf',
'jpg',
'png',
'exif',
'bmp',
'tif',
'gif',
'jpeg'
]
const imgList = ['jpg', 'png', 'exif', 'bmp', 'tif', 'gif', 'jpeg']
if (param === 'img') {
// 判断是否为图片
if (imgList.indexOf(type.toLowerCase()) !== -1) {
return true
} else {
return false
}
} else {
// 返回文件格式
// eslint-disable-next-line no-lonely-if
if (res.indexOf(type.toLowerCase()) !== -1) {
return type.toLowerCase()
} else {
return 'other'
}
}
}
/**
*预览或者编辑文件
* param: {typeKey: ''}
*/
Vue.prototype.$viewDocument = function(data, key, param) {
const typeKey = param && param.typeKey ? param.typeKey : 'type'
switch (key) {
case 'edit':
// 编辑
this.$openDocument(data, key, 4, true, typeKey)
break
case 'readonly':
// 只读
this.$openDocument(data, key, 5, true, typeKey)
break
}
}
Vue.prototype.$openDocument = function(rel, key, isReport, isEdit, typeKey) {
if (rel[typeKey].toLowerCase() === 'pdf') {
// pdf 单独预览
this.$pdfView(rel.objectKey)
} else {
// pageoffice或officeOnline打开
this.$openWindowModeless({
objectKey: rel.objectKey,
id: rel.id,
isReport: isReport,
noMark: true,
isEdit: isEdit
})
}
}
/**
*搜索条件清空缓存处理方式(form表单 查询) *搜索条件清空缓存处理方式(form表单 查询)
* *
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment