...
|
...
|
@@ -120,19 +120,19 @@ export default { |
|
|
let historyNode = Vue.ref([]);
|
|
|
let isUserFolder = Vue.ref(false);
|
|
|
|
|
|
let addHistoryNode = (item) =>{
|
|
|
let addHistoryNode = (item) => {
|
|
|
|
|
|
if(item.name == undefined && item.fileName){
|
|
|
if (item.name == undefined && item.fileName) {
|
|
|
item['name'] = item.fileName;
|
|
|
}
|
|
|
let arr = historyNode.value;
|
|
|
let id = item.id;
|
|
|
let size = arr.filter(function (v) {
|
|
|
if(v.id == id){
|
|
|
if (v.id == id) {
|
|
|
return v;
|
|
|
}
|
|
|
})
|
|
|
if(size.length == 0){
|
|
|
if (size.length == 0) {
|
|
|
arr.push(item);
|
|
|
historyNode.value = arr;
|
|
|
}
|
...
|
...
|
@@ -150,7 +150,7 @@ export default { |
|
|
|
|
|
getPage(id);
|
|
|
} else {
|
|
|
proxy.$global.viewer(item.localPath,proxy);
|
|
|
proxy.$global.viewer(item.localPath, proxy);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -198,25 +198,40 @@ export default { |
|
|
let getTree = () => {
|
|
|
// 查询条件
|
|
|
let params = {
|
|
|
recycle: props.isRecycle ? 1: 0
|
|
|
recycle: props.isRecycle ? 1 : 0
|
|
|
};
|
|
|
let url = `/inspection-report/file/document/tree`;
|
|
|
if(props.isRecycle){
|
|
|
if (props.isRecycle) {
|
|
|
url = `/inspection-report/file/document/tree/recycle`;
|
|
|
}
|
|
|
proxy.$http.get("/inspection-report/file/document/tree", params, function (res) {
|
|
|
if (res && res.data && res.data.length > 0) {
|
|
|
treeData.value = res.data;
|
|
|
let first = res.data[0];
|
|
|
|
|
|
let arr = [];
|
|
|
arr.push(first.id);
|
|
|
defaultExpandedKeys.value = arr;
|
|
|
// treeData.value = res.data;
|
|
|
// let first = res.data[0];
|
|
|
//
|
|
|
// let arr = [];
|
|
|
// arr.push(first.id);
|
|
|
// defaultExpandedKeys.value = arr;
|
|
|
//
|
|
|
// addHistoryNode(first);
|
|
|
//
|
|
|
// // 加载第一个节点数据
|
|
|
// getPage(first.id);
|
|
|
|
|
|
let root = {
|
|
|
id: '0',
|
|
|
name: '文档管理',
|
|
|
children: res.data
|
|
|
}
|
|
|
|
|
|
addHistoryNode(first);
|
|
|
defaultExpandedKeys.value = [root.id];
|
|
|
addHistoryNode(root);
|
|
|
|
|
|
// 加载第一个节点数据
|
|
|
getPage(first.id);
|
|
|
getPage(root.id);
|
|
|
|
|
|
treeData.value = [root];
|
|
|
|
|
|
}
|
|
|
})
|
|
|
}
|
...
|
...
|
@@ -228,14 +243,14 @@ export default { |
|
|
id: id,
|
|
|
name: keyWord.value,
|
|
|
types: props.types.join(','),
|
|
|
docIds:docIds
|
|
|
docIds: docIds
|
|
|
}
|
|
|
let url = `/inspection-report/file/document/list`;
|
|
|
if(props.isRecycle){
|
|
|
if (props.isRecycle) {
|
|
|
url = `/inspection-report/file/document/recycle`;
|
|
|
}
|
|
|
// 加载列表
|
|
|
proxy.$http.get(url , params, function (res) {
|
|
|
proxy.$http.get(url, params, function (res) {
|
|
|
if (res && res.data) {
|
|
|
dataList.value = res.data;
|
|
|
|
...
|
...
|
@@ -281,7 +296,7 @@ export default { |
|
|
let id = currentNodeData.value.id;
|
|
|
|
|
|
|
|
|
if(loadTree && loadTree == true){
|
|
|
if (loadTree && loadTree == true) {
|
|
|
getTree();
|
|
|
} else {
|
|
|
getPage(id);
|
...
|
...
|
@@ -301,7 +316,7 @@ export default { |
|
|
|
|
|
let url = `/inspection-report/file/change`;
|
|
|
let msg = "您确认将该文件放入回收站?";
|
|
|
if(props.isRecycle){
|
|
|
if (props.isRecycle) {
|
|
|
msg = "您确认永久删除该文件?";
|
|
|
url = `/inspection-report/file/delete`;
|
|
|
}
|
...
|
...
|
@@ -310,7 +325,7 @@ export default { |
|
|
|
|
|
if (type == 'folder') {
|
|
|
msg = "您确认将该文件以及文件下的文件放入回收站?";
|
|
|
if(props.isRecycle){
|
|
|
if (props.isRecycle) {
|
|
|
msg = "您确认删除该文件以及文件下的文件?";
|
|
|
}
|
|
|
info.push({id: id, type: type});
|
...
|
...
|
@@ -319,22 +334,22 @@ export default { |
|
|
let arr = getCheckedFile();
|
|
|
arr.map(function (v) {
|
|
|
info.push({
|
|
|
id:v.id,
|
|
|
type:v.type
|
|
|
id: v.id,
|
|
|
type: v.type
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
|
|
|
proxy.$global.confirm(msg, function () {
|
|
|
proxy.$http.post(url,info , function (res) {
|
|
|
proxy.$http.post(url, info, function (res) {
|
|
|
if (res && res.code == 0) {
|
|
|
if(res.msg){
|
|
|
proxy.$global.showMsg(res.msg,'warning');
|
|
|
if (res.msg) {
|
|
|
proxy.$global.showMsg(res.msg, 'warning');
|
|
|
} else {
|
|
|
proxy.$global.showMsg('放入回收站成功!');
|
|
|
}
|
|
|
|
|
|
if(props.isRecycle){
|
|
|
if (props.isRecycle) {
|
|
|
// 回收栈刷新
|
|
|
reload(true);
|
|
|
} else {
|
...
|
...
|
@@ -355,29 +370,29 @@ export default { |
|
|
* 作者: Wang
|
|
|
* 时间:2021/11/16 14:39
|
|
|
*/
|
|
|
let restore = () =>{
|
|
|
let restore = () => {
|
|
|
let info = [];
|
|
|
// 获取选中的文件
|
|
|
dataList.value.filter(function (v) {
|
|
|
if (v.checked != undefined && v.checked == true) {
|
|
|
info.push({
|
|
|
id:v.id,
|
|
|
type:v.type
|
|
|
id: v.id,
|
|
|
type: v.type
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
|
|
|
if(info.length == 0){
|
|
|
proxy.$global.showMsg('请选择需要还原的文件!',"warning");
|
|
|
if (info.length == 0) {
|
|
|
proxy.$global.showMsg('请选择需要还原的文件!', "warning");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
proxy.$global.confirm("是否还原选择的文件?", function () {
|
|
|
|
|
|
proxy.$http.post(`/inspection-report/file/restore`,info , function (res) {
|
|
|
proxy.$http.post(`/inspection-report/file/restore`, info, function (res) {
|
|
|
if (res && res.code == 0) {
|
|
|
proxy.$global.showMsg('还原成功!');
|
|
|
if(props.isRecycle){
|
|
|
if (props.isRecycle) {
|
|
|
// 回收栈刷新
|
|
|
reload(true);
|
|
|
} else {
|
...
|
...
|
@@ -404,7 +419,7 @@ export default { |
|
|
type: '',
|
|
|
sort: 100
|
|
|
});
|
|
|
let showFolder = (flg,isUser) => {
|
|
|
let showFolder = (flg, isUser) => {
|
|
|
docForm.value = {
|
|
|
name: '',
|
|
|
docNo: '',
|
...
|
...
|
@@ -413,14 +428,14 @@ export default { |
|
|
};
|
|
|
isUserFolder.value = isUser;
|
|
|
addDialogVisible.value = flg;
|
|
|
let title =`新建树节点“${currentNodeData.value.name}“子文件夹`;
|
|
|
if(isUser){
|
|
|
title =`新建自定义文件夹`;
|
|
|
let title = `新建树节点“${currentNodeData.value.name}“子文件夹`;
|
|
|
if (isUser) {
|
|
|
title = `新建自定义文件夹`;
|
|
|
}
|
|
|
addDialogTitle.value = title
|
|
|
addDialogTitle.value = title
|
|
|
}
|
|
|
let editType = (data) =>{
|
|
|
Object.assign(docForm.value,data);
|
|
|
let editType = (data) => {
|
|
|
Object.assign(docForm.value, data);
|
|
|
addDialogVisible.value = true;
|
|
|
isUserFolder.value = false;
|
|
|
}
|
...
|
...
|
@@ -436,16 +451,16 @@ export default { |
|
|
let params = docForm.value;
|
|
|
params.pid = currentNodeData.value.id;
|
|
|
|
|
|
if(isUserFolder.value){
|
|
|
params.id="";
|
|
|
params.docNo="user";
|
|
|
params.type="user";
|
|
|
if (isUserFolder.value) {
|
|
|
params.id = "";
|
|
|
params.docNo = "user";
|
|
|
params.type = "user";
|
|
|
}
|
|
|
// 新增
|
|
|
proxy.$http.get(`/inspection-report/file/file/insertFolder`, params, function (res) {
|
|
|
if (res && res.code == 0) {
|
|
|
let msg = res.msg;
|
|
|
if(!msg){
|
|
|
if (!msg) {
|
|
|
msg = "操作成功";
|
|
|
}
|
|
|
proxy.$global.showMsg(msg);
|
...
|
...
|
@@ -454,7 +469,7 @@ export default { |
|
|
// 属性tree
|
|
|
let isUser = !isUserFolder.value;
|
|
|
reload(isUser);
|
|
|
showFolder(false,isUser);
|
|
|
showFolder(false, isUser);
|
|
|
} else {
|
|
|
console.log('error submit!!')
|
|
|
return false
|
...
|
...
|
@@ -467,8 +482,8 @@ export default { |
|
|
*/
|
|
|
let searchFile = () => {
|
|
|
let keyWords = keyWord.value;
|
|
|
if(keyWords == ''){
|
|
|
proxy.$global.showMsg("请输入关键字!","warning")
|
|
|
if (keyWords == '') {
|
|
|
proxy.$global.showMsg("请输入关键字!", "warning")
|
|
|
return;
|
|
|
}
|
|
|
getPage('');
|
...
|
...
|
@@ -532,6 +547,9 @@ export default { |
|
|
return v.id;
|
|
|
});
|
|
|
|
|
|
let orgInfo = userObj.org.map(function (v) {
|
|
|
return v.orgId;
|
|
|
});
|
|
|
let docIds = getCheckedFile().map(function (v) {
|
|
|
return v.id;
|
|
|
});
|
...
|
...
|
@@ -540,7 +558,8 @@ export default { |
|
|
let params = {
|
|
|
authDocIds: docIds,
|
|
|
authRoleIds: roleCodes,
|
|
|
authUsernames: userIds
|
|
|
authUsernames: userIds,
|
|
|
authOrgIds: orgInfo
|
|
|
}
|
|
|
|
|
|
proxy.$http.post(`/inspection-report/file/doc/grant`, params, function (res) {
|
...
|
...
|
@@ -560,16 +579,16 @@ export default { |
|
|
let showUploadFile = (flg) => {
|
|
|
showUploadDialogVisible.value = flg;
|
|
|
}
|
|
|
let uploadCallBack = ({document,fileInfo}) => {
|
|
|
let uploadCallBack = ({document, fileInfo}) => {
|
|
|
reload(false);
|
|
|
// 执行回调
|
|
|
emit('callback',{document,fileInfo});
|
|
|
emit('callback', {document, fileInfo});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 文件下载
|
|
|
*/
|
|
|
let downloadFile = () =>{
|
|
|
let downloadFile = () => {
|
|
|
let arr = getCheckedFile();
|
|
|
|
|
|
let info = [];
|
...
|
...
|
@@ -578,23 +597,23 @@ export default { |
|
|
})
|
|
|
|
|
|
let params = {
|
|
|
info : info.join(","),
|
|
|
fileName:''
|
|
|
info: info.join(","),
|
|
|
fileName: ''
|
|
|
}
|
|
|
|
|
|
proxy.$http.downloadFile('/inspection-report/file/download',params);
|
|
|
proxy.$http.downloadFile('/inspection-report/file/download', params);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 点击标签关闭
|
|
|
* @param index
|
|
|
*/
|
|
|
let tagHandleClose = (index) =>{
|
|
|
historyNode.value.splice(index,1);
|
|
|
let tagHandleClose = (index) => {
|
|
|
historyNode.value.splice(index, 1);
|
|
|
}
|
|
|
|
|
|
|
|
|
let isAdmin = () =>{
|
|
|
let isAdmin = () => {
|
|
|
return localStorage.getItem('lgn') == 'admin' && props.isRecycle == false;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -603,41 +622,41 @@ export default { |
|
|
* @param item
|
|
|
* @param index
|
|
|
*/
|
|
|
let clickTopNav = (item,index) =>{
|
|
|
let clickTopNav = (item, index) => {
|
|
|
addHistoryNode(item);
|
|
|
getPage(item.id);
|
|
|
}
|
|
|
|
|
|
// 文件更名
|
|
|
let reNameFileFlg = Vue.ref({});
|
|
|
let reNameFile = (item,flg) =>{
|
|
|
let reNameFile = (item, flg) => {
|
|
|
let docType = item.docType;
|
|
|
|
|
|
if(!flg){
|
|
|
if(docType == 'user'){
|
|
|
if (!flg) {
|
|
|
if (docType == 'user') {
|
|
|
reNameFileFlg.value[item.id] = true;
|
|
|
} else {
|
|
|
proxy.$global.showMsg("节点名称不能修改!","warning");
|
|
|
proxy.$global.showMsg("节点名称不能修改!", "warning");
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
if(docType == 'user'){
|
|
|
if (docType == 'user') {
|
|
|
let type = item.type;
|
|
|
let url = `/inspection-report/file/rename/doc`;
|
|
|
if(type == 'folder'){
|
|
|
if (type == 'folder') {
|
|
|
url = `/inspection-report/file/rename/user`;
|
|
|
}
|
|
|
if(item.fileName == null || item.fileName == '' ){
|
|
|
proxy.$global.showMsg("文件名称不能为空!","warning");
|
|
|
if (item.fileName == null || item.fileName == '') {
|
|
|
proxy.$global.showMsg("文件名称不能为空!", "warning");
|
|
|
return;
|
|
|
}
|
|
|
// 执行改名
|
|
|
proxy.$http.get(url, {id:item.id,name:item.fileName}, function (res) {
|
|
|
proxy.$http.get(url, {id: item.id, name: item.fileName}, function (res) {
|
|
|
if (res && res.success) {
|
|
|
proxy.$global.showMsg('修改成功!');
|
|
|
} else {
|
|
|
let msg = res.msg;
|
|
|
if(msg){
|
|
|
if (msg) {
|
|
|
proxy.$global.showMsg(msg, 'warning');
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -661,7 +680,7 @@ export default { |
|
|
left: 0,
|
|
|
right: 24
|
|
|
}
|
|
|
let item = {
|
|
|
let item = {
|
|
|
docType: props.viewTypeId,
|
|
|
docNo: props.viewTypeId,
|
|
|
name: props.viewTypeName,
|
...
|
...
|
|