Authored by 王涛

文件预览;文档管理优化

... ... @@ -101,7 +101,7 @@
</el-link>
<br/>
<el-link type="info" :underline="false" @click="reNameFile(file,false)" >
<span v-if="!reNameFileFlg[file.id]">{{file.fileName}}</span>
<div v-if="!reNameFileFlg[file.id]" style="width: 120px;overflow: hidden;text-overflow: ellipsis;text-align: left;">{{file.fileName}}</div>
<el-input :autofocus="true" v-if="reNameFileFlg[file.id]" placeholder="输入文件名" v-model="file.fileName" @blur="reNameFile(file,true)"></el-input>
</el-link>
</div>
... ...
... ... @@ -150,7 +150,7 @@ export default {
getPage(id);
} else {
proxy.$global.viewer(item.localPath);
proxy.$global.viewer(item.localPath,proxy);
}
}
... ... @@ -556,6 +556,10 @@ export default {
if(type == 'folder'){
url = `/inspection-report/file/rename/user`;
}
if(item.fileName == null || item.fileName == '' ){
proxy.$global.showMsg("文件名称不能为空!","warning");
return;
}
// 执行改名
proxy.$http.get(url, {id:item.id,name:item.fileName}, function (res) {
if (res && res.success) {
... ...
... ... @@ -34,6 +34,7 @@
:before-upload="beforeUpload"
:multiple="false"
:http-request="getInsetFile"
:on-change="fileChange"
:auto-upload="true">
<el-button size="small" type="primary">上传照片</el-button>
</el-upload>
... ...
... ... @@ -120,6 +120,7 @@ export default {
category:props.category,
docNo:props.docNo
}
debugger
// 上传文件
proxy.$http.uploadFile("/inspection-report/file/upload", params, function (res) {
if (res && res.code == 0) {
... ... @@ -131,6 +132,11 @@ export default {
})
}
let fileChange = (file, fileList) =>{
debugger
console.log(file, fileList);
}
// 上传按钮点击
let uploadFile = () => {
proxy.$refs.upload.submit()
... ... @@ -167,7 +173,8 @@ export default {
show,
uploadFile,
hidedialog,
beforeUpload
beforeUpload,
fileChange
}
}
}
... ...
... ... @@ -123,8 +123,14 @@ global.getQueryVariable = (variable) => {
* 文件预览
* @param path
*/
global.viewer = (path) =>{
window.open("/src/lib/extend/pdfjs/web/viewer.html?test=" + encodeURIComponent(path));
global.viewer = (path,proxy) =>{
proxy.$http.get(`/api-web/openoffice/convertPdf/?path=${encodeURIComponent(path)}`, {}, function (res) {
if (res && res.success) {
window.open("/src/lib/extend/pdfjs/web/viewer.html?test=" + encodeURIComponent(res.str));
} else {
global.showMsg(data.msg,"error")
}
})
}
/**
... ...