Commit 47ca4f0b authored by 黄媛媛's avatar 黄媛媛
parents be0681fc 233f7202
......@@ -383,8 +383,8 @@
</div>
<div>
<div class="el-col" style="position:relative;width:200px">
<div v-if="item.IsWarning===1&&item.TeamType!=3" title="紧急团" class="travel_warning"></div>
<div v-else title="地接团" class="travel_warningDi"></div>
<div v-if="item.IsWarning===1" title="紧急团" class="travel_warning"></div>
<!-- <div v-else title="地接团" class="travel_warningDi"></div> -->
<div>
<div class="TC_teamType">
<span v-if="item.IsB2B==0" title="内部团">{{$t('Operation.Op_nei')}}</span>
......
<template>
<div class="flexOne">
<div class="myDocumentsNav">
<el-upload class='myDocumentUploadBtn' :http-request="uploadFileBtn" :on-exceed="handleExceed" ref="upload" :multiple="true" :limit="5" :show-file-list="false" :headers='headers' action="">
<el-upload class='myDocumentUploadBtn' :http-request="uploadFileBtn" :on-exceed="handleExceed" ref="upload"
:multiple="true" :limit="5" :show-file-list="false" :headers='headers' action="">
<el-button size="small" type="danger" icon="el-icon-upload2">上传</el-button>
</el-upload>
<el-button-group>
<!-- <el-button v-if='notFileList.length==1&&fileList.length<1' type="danger" icon="el-icon-download" @click='dowloadSingle()'>下载</el-button> -->
<el-button v-if='fileList.length>0||notFileList.length>0' type="danger" icon="el-icon-download" @click='yzmVisible=true,createCode()'>压缩下载</el-button>
<el-button v-if='fileList.length>0||notFileList.length>0' type="danger" icon="el-icon-download"
@click='yzmVisible=true,createCode()'>压缩下载</el-button>
<el-button type="danger" @click='openAddFilesDialog'>新键文件夹</el-button>
<el-button v-if='fileList.length>0||notFileList.length>0' type="danger" icon="el-icon-delete" @click='deleteFiles'>{{$t('system.table_delete')}}</el-button>
<el-button v-if='fileList.length>0||notFileList.length>0' type="danger" icon="el-icon-share" @click='openShareDialog'>分享</el-button>
<el-button v-if='fileList.length>0||notFileList.length>0' type="danger" icon="el-icon-delete"
@click='deleteFiles'>{{$t('system.table_delete')}}</el-button>
<el-button v-if='fileList.length>0||notFileList.length>0' type="danger" icon="el-icon-share"
@click='openShareDialog'>分享</el-button>
<el-button v-if='fileList.length>0||notFileList.length>0' type="danger" @click='moveFiles'>移动到</el-button>
</el-button-group>
<div class="fr">
<el-input class='w200' :placeholder="$t('pub.pleaseImport')" prefix-icon="el-icon-search" v-model="srearchKey" ></el-input>
<el-input class='w200' :placeholder="$t('pub.pleaseImport')" prefix-icon="el-icon-search" v-model="srearchKey">
</el-input>
<input type="button" class="hollowFixedBtn" @click='doSearch()' :value="$t('pub.searchBtn')" />
</div>
</div>
<div class="myDocumentsLink" v-if='this.NavigationList.length>0'>
<span @click="getNextLevel(0)">{{$t('advmanager.v_all')}}</span><span v-for="item in NavigationList" @click="getNextLevel(item.Id)">{{item.FolderName}}</span>
<span @click="getNextLevel(0)">{{$t('advmanager.v_all')}}</span><span v-for="item in NavigationList"
@click="getNextLevel(item.Id)">{{item.FolderName}}</span>
</div>
<table class="singeRowTable myDocumentsTable" border="0" cellspacing="0" cellpadding="0">
......@@ -36,7 +42,8 @@
<input type="checkbox" :value="item.Id" v-model="fileList" @change="ckeckedOne">
<div @click="getNextLevel(item.Id)" style="cursor: pointer; display: inline-block;">
<div :class="['fileIcon', item.icons]"></div>
{{item.FolderName}}</div>
{{item.FolderName}}
</div>
</td>
<td v-if="item.DataType==2">
<input type="checkbox" :value="item.Id" v-model="notFileList" @change="ckeckedOne">
......@@ -48,8 +55,10 @@
<td>
<el-row v-if='curIndex==index'>
<el-button type="primary" icon="el-icon-download" circle @click='downloadOne(item)'></el-button>
<el-button v-if="item.DataType==0" type="primary" icon="el-icon-edit" circle @click='updateFiles(item)'></el-button>
<el-button v-if="item.DataType==2" type="primary" icon="el-icon-edit" circle @click='updateOneFile(item)'></el-button>
<el-button v-if="item.DataType==0" type="primary" icon="el-icon-edit" circle @click='updateFiles(item)'>
</el-button>
<el-button v-if="item.DataType==2" type="primary" icon="el-icon-edit" circle @click='updateOneFile(item)'>
</el-button>
<el-button type="primary" icon="el-icon-share" circle @click='openShareOneDialog(item)'></el-button>
<el-button type="danger" icon="el-icon-delete" @click='deleteOne(item)' circle></el-button>
</el-row>
......@@ -59,14 +68,16 @@
</tr>
</table>
<el-dialog custom-class='w400' :title="dialogTitle" :visible.sync="outerVisible" center :before-close="closeChangeMachie">
<el-dialog custom-class='w400' :title="dialogTitle" :visible.sync="outerVisible" center
:before-close="closeChangeMachie">
<el-form :model="addFileMsg" :rules="rules" ref="addFileMsg" label-width="80px">
<el-form-item label='文件名称' prop="FolderName">
<el-input type="text" maxLength='50' v-model='addFileMsg.FolderName'></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="outerVisible = false,addFileMsg.FolderName=''" />
<input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')"
@click="outerVisible = false,addFileMsg.FolderName=''" />
<input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="submitForm('addFileMsg')" />
</div>
</el-dialog>
......@@ -84,7 +95,8 @@
</el-dialog>
<el-dialog custom-class='w400' :title="dialogTitle2" :visible.sync="outerVisible2" @close="moveCancel" center>
<el-tree :data="fileTreeList" :props="defaultProps" :check-strictly='true' @check-change="handleNodeChange" node-key="Id" show-checkbox accordion ref="tree">
<el-tree :data="fileTreeList" :props="defaultProps" :check-strictly='true' @check-change="handleNodeChange"
node-key="Id" show-checkbox accordion ref="tree">
</el-tree>
<div slot="footer" class="dialog-footer">
<input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="moveCancel" />
......@@ -119,16 +131,8 @@
</div>
<div v-if='shareMsg.shareType==1' class="myDocumentShareDiv">
<div class="myDocumentShareTree">
<el-tree
:data="departmentList"
ref="treeDepartmentList"
node-key="DepartmentId"
:check-strictly='true'
show-checkbox
:render-after-expand="false"
:props="defaultProps2"
@check-change="DepartmentListNodeChange"
>
<el-tree :data="departmentList" ref="treeDepartmentList" node-key="DepartmentId" :check-strictly='true'
show-checkbox :render-after-expand="false" :props="defaultProps2" @check-change="DepartmentListNodeChange">
</el-tree>
</div>
<div class="myDocumentShareObject">
......@@ -141,16 +145,8 @@
</div>
<div v-if='shareMsg.shareType==2' class="myDocumentShareDiv">
<div class="myDocumentShareTree">
<el-tree
:data="roleList"
ref="treeRole"
node-key="DepartmentId"
:check-strictly='true'
show-checkbox
:render-after-expand="false"
:props="defaultProps1"
@check-change="roleListNodeChange"
>
<el-tree :data="roleList" ref="treeRole" node-key="DepartmentId" :check-strictly='true' show-checkbox
:render-after-expand="false" :props="defaultProps1" @check-change="roleListNodeChange">
</el-tree>
</div>
<div class="myDocumentShareObject">
......@@ -163,16 +159,8 @@
</div>
<div v-if='shareMsg.shareType==3' class="myDocumentShareDiv">
<div class="myDocumentShareTree">
<el-tree
:data="menberList"
ref="treeMenber"
node-key="DepartmentId"
:check-strictly='true'
show-checkbox
:render-after-expand="false"
:props="defaultProps3"
@check-change="MenberListNodeChange"
>
<el-tree :data="menberList" ref="treeMenber" node-key="DepartmentId" :check-strictly='true' show-checkbox
:render-after-expand="false" :props="defaultProps3" @check-change="MenberListNodeChange">
</el-tree>
</div>
<div class="myDocumentShareObject">
......@@ -197,11 +185,13 @@
<div slot="footer" class="dialog-footer">
<input type="button" class="normalBtn" :value="$t('pub.closeSel')" @click="outerVisible4=false" />
</div>
</el-dialog >
</el-dialog>
<div v-if='audioIsShow' style="position: fixed; bottom: 100px; right: 20px; z-index: 999; border:1px solid #ccc; padding: 10px; background: #eee;">
<i class="el-icon-circle-close-outline" style="float: right; cursor: pointer;" @click="audioIsShow=false,audioPath=''"></i>
<div v-if='audioIsShow'
style="position: fixed; bottom: 100px; right: 20px; z-index: 999; border:1px solid #ccc; padding: 10px; background: #eee;">
<i class="el-icon-circle-close-outline" style="float: right; cursor: pointer;"
@click="audioIsShow=false,audioPath=''"></i>
<p style="font-size: 12px; margin: 0 0 10px 0;">{{audioName}}</p>
<audio :src="audioPath" controls="controls">
Your browser does not support the audio tag.
......@@ -220,13 +210,13 @@
<p>
<span>验证码 : </span>
<el-input class='w150' type="text" placeholder="请输入验证码" v-model="picLyanzhengma"></el-input>
<input type="button" @click="createCode" class="DocumentLoadVerification" v-model="checkCode"/>
<input type="button" @click="createCode" class="DocumentLoadVerification" v-model="checkCode" />
</p>
<div slot="footer" class="dialog-footer">
<input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="yzmVisible=false" />
<input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="downloadTotal()" />
</div>
</el-dialog >
</el-dialog>
<a target="_blank" style="display:none" id="blankLink"></a>
</div>
</template>
......@@ -236,21 +226,21 @@
export default {
data() {
return {
code:'',
picLyanzhengma:'',
checkCode:'',
code: '',
picLyanzhengma: '',
checkCode: '',
yzmVisible: false,
initialIndex:0,
picObj:[],
picIsShow:false,
audioIsShow:false,
initialIndex: 0,
picObj: [],
picIsShow: false,
audioIsShow: false,
outerVisible4: false,
dialogTitle4: '',
moviePath:'',
audioPath:'',
picPath:'',
audioName:'',
moviePath: '',
audioPath: '',
picPath: '',
audioName: '',
headers: {
'Content-Type': 'application/octet-stream'
},
......@@ -317,15 +307,15 @@
WjId: [],
WjjId: [],
arr: [],
departmentList:[],
ckdDepartmentList:[],
ckdDepartmentListId:[],
roleList:[],
ckdRoleList:[],
ckdRoleListId:[],
menberList:[],
ckdMenberList:[],
ckdMenberListId:[],
departmentList: [],
ckdDepartmentList: [],
ckdDepartmentListId: [],
roleList: [],
ckdRoleList: [],
ckdRoleListId: [],
menberList: [],
ckdMenberList: [],
ckdMenberListId: [],
allLength: 0,
rules: { //表单验证
FolderName: [{
......@@ -341,35 +331,35 @@
trigger: 'blur'
}]
},
srearchKey:""
srearchKey: ""
}
},
filters: {
FileSizeFormat(value) {
if(value == null) {
if (value == null) {
return '-'
}
if(value != null) {
if(value / 1024 < 1) { //kb
if (value != null) {
if (value / 1024 < 1) { //kb
return value + 'KB'
}
if(value / 1024 > 1 && value / (1024 * 1024) < 1) { //mb
return(value / 1024).toFixed(2) + 'M'
if (value / 1024 > 1 && value / (1024 * 1024) < 1) { //mb
return (value / 1024).toFixed(2) + 'M'
}
if(value / (1024 * 1024) > 1) { //G
return(value / (1024 * 1024)).toFixed(2) + 'G'
if (value / (1024 * 1024) > 1) { //G
return (value / (1024 * 1024)).toFixed(2) + 'G'
}
}
}
},
watch:{
watch: {
},
methods: {
// 图片验证码
createCode(){
createCode() {
//先清空验证码的输入
this.code = "";
this.checkCode = "";
......@@ -377,65 +367,80 @@
//验证码的长度
var codeLength = 4;
//随机数
var random = new Array(0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
for(var i = 0; i < codeLength; i++) {
var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
for (var i = 0; i < codeLength; i++) {
//取得随机数的索引(0~35)
var index = Math.floor(Math.random()*36);
var index = Math.floor(Math.random() * 36);
//根据索引取得随机数加到code上
this.code += random[index];
}
//把code值赋给验证码
this.checkCode = this.code;
},
analyzeItem(obj){
let typeArr=[
{stringArr:'GIF|JPG|JPEG|PNG|BMP',type:1},
{stringArr:'MP3|OGG|AU|AIFF|VQF',type:2},
{stringArr:'AVI|WMV|MPEG|MP4|MOV|MKV|FLV|F4V|M4V|RMVB|RM|3GP|DAT|TS|MTS|VOB',type:3},
{stringArr:'DOCX|DOC|XLSX|XLS|PPT|PPTX',type:4},
{stringArr:'PDF',type:5},
analyzeItem(obj) {
let typeArr = [{
stringArr: 'GIF|JPG|JPEG|PNG|BMP',
type: 1
},
{
stringArr: 'MP3|OGG|AU|AIFF|VQF',
type: 2
},
{
stringArr: 'AVI|WMV|MPEG|MP4|MOV|MKV|FLV|F4V|M4V|RMVB|RM|3GP|DAT|TS|MTS|VOB',
type: 3
},
{
stringArr: 'DOCX|DOC|XLSX|XLS|PPT|PPTX',
type: 4
},
{
stringArr: 'PDF',
type: 5
},
]
let fileTypeNumber; // 判断文件预览类型; 1 图片,2音频,3视频,4,office,, 5 PDF , 6 txt default其他
let fileType=obj.FilePath.substring(obj.FilePath.lastIndexOf('.')+1,obj.FilePath.length).toUpperCase()
typeArr.forEach(x=>{
if(x.stringArr.indexOf(fileType)!='-1')
{
fileTypeNumber=x.type
let fileType = obj.FilePath.substring(obj.FilePath.lastIndexOf('.') + 1, obj.FilePath.length).toUpperCase()
typeArr.forEach(x => {
if (x.stringArr.indexOf(fileType) != '-1') {
fileTypeNumber = x.type
}
})
switch (fileTypeNumber){
switch (fileTypeNumber) {
case 1:
this.list.forEach(item=>{
if(item.DataType==2){
let fileType=item.FolderName.substring(item.FolderName.lastIndexOf('.')+1,item.FolderName.length).toUpperCase()
if('GIF|JPG|JPEG|PNG|BMP'.indexOf(fileType)!=-1){
this.list.forEach(item => {
if (item.DataType == 2) {
let fileType = item.FolderName.substring(item.FolderName.lastIndexOf('.') + 1, item.FolderName
.length).toUpperCase()
if ('GIF|JPG|JPEG|PNG|BMP'.indexOf(fileType) != -1) {
this.picObj.push(item.FilePath)
}
}
})
this.picObj.forEach((x,i)=>{
if(x==obj.FilePath){
this.initialIndex=i
this.picObj.forEach((x, i) => {
if (x == obj.FilePath) {
this.initialIndex = i
return false
}
})
this.picIsShow=true
this.picIsShow = true
//this.picPath=obj.FilePath
break;
case 2:
this.audioIsShow=true
this.audioName=obj.FolderName
this.audioPath=obj.FilePath
this.audioIsShow = true
this.audioName = obj.FolderName
this.audioPath = obj.FilePath
break;
case 3:
this.outerVisible4=true
this.dialogTitle4=obj.FolderName
this.moviePath=obj.FilePath
this.outerVisible4 = true
this.dialogTitle4 = obj.FolderName
this.moviePath = obj.FilePath
break;
case 4:
window.open("https://view.officeapps.live.com/op/view.aspx?src="+obj.FilePath)
window.open("https://view.officeapps.live.com/op/view.aspx?src=" + obj.FilePath)
break;
case 5:
this.previewPDF(obj.FilePath)
......@@ -451,7 +456,7 @@
return
},
uploadFileBtn(file) { //上传
if(file.file.size > 1024 * 1024 * 100) {
if (file.file.size > 1024 * 1024 * 100) {
this.$message.warning('文件大小不能超过100M!')
return
}
......@@ -461,7 +466,7 @@
let path = "/Upload/Temporary/"
this.$message.info('上传中...')
this.UploadSelfFileT(path, newArr, x => {
let fileSize = file.file.size<1024? file.file.size:(file.file.size / 1024).toFixed(0);
let fileSize = file.file.size < 1024 ? file.file.size : (file.file.size / 1024).toFixed(0);
this.saveMsg = []
this.saveMsg.push({
Path: x.data.FilePath,
......@@ -471,7 +476,7 @@
FolderId: this.msg.ParentId
})
that.apipost('user_cloud_SaveFile', this.saveMsg, res => {
if(res.data.resultCode == 1) {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.$refs.upload.clearFiles();
this.getList()
......@@ -485,57 +490,93 @@
dowloadSingle() {
let objKey = [];
this.list.forEach(item => {
if(item.DataType == 2) {
for(let i = 0; i < this.notFileList.length; i++) {
if(this.notFileList[i] == item.Id) {
if (item.DataType == 2) {
for (let i = 0; i < this.notFileList.length; i++) {
if (this.notFileList[i] == item.Id) {
let reg = /^http(s)?:\/\/(.*?)\//
this.downloadFileRename(item.FilePath.replace(reg,''),item.FolderName);
this.downloadFileRename(item.FilePath.replace(reg, ''), item.FolderName);
}
}
}
})
},
downloadOne(obj){
if(obj.DataType==0){
this.yzmVisible=true
downloadOne(obj) {
if (obj.DataType == 0) {
this.yzmVisible = true
this.createCode()
this.fileList=[]
this.notFileList=[]
this.fileList = []
this.notFileList = []
this.fileList.push(obj.Id)
}
if(obj.DataType==2){
if (obj.DataType == 2) {
let reg = /^http(s)?:\/\/(.*?)\//
let dom = document.querySelector("#blankLink")
dom.href = obj.FilePath
dom.click()
return
this.downloadFileRename(obj.FilePath.replace(reg,''),obj.FolderName);
this.downloadFileRename(obj.FilePath.replace(reg, ''), obj.FolderName);
}
},
downloadTotal() {
if(this.picLyanzhengma.toLocaleUpperCase()==this.checkCode){
this.yzmVisible=false
this.$message.info('文件压缩中,请等待..')
this.apipost('user_cloud_GetPackageFile', {
FolderIdStr: this.fileList,
FileIdStr: this.notFileList
}, res => {
if(res.data.resultCode == 1) {
const link = document.createElement('a');
let _loadUrl = this.domainManager().DomainUrl;
link.href = _loadUrl+res.data.data;
document.body.appendChild(link);
link.click();
this.apipost('user_cloud_DelPackageFile',{Path:link.href},res=>{
},err=>{})
}else{
this.$message.error(res.data.message)
if (this.picLyanzhengma.toLocaleUpperCase() == this.checkCode) {
// let pageData = document.getElementById('pdfNode').innerHTML
let urlObj = this.domainManager()
this.$http({
headers: {
'Content-Type': 'application/json'
},
method: 'post',
url: urlObj.DomainUrl + '/api/file/GetPackageFile',
data: {
msg: {
"FolderIdStr": this.fileList,
"FileIdStr": this.notFileList
}
}
}).then(res => {
if (res.data.resultCode === 1) {
setTimeout(() => {
let sign = title
const a = document.createElement('a');
a.setAttribute('download', '');
a.setAttribute('href', urlObj.DomainUrl + '/api/file/DownloadFileForPdf?fileName=' + sign +
'.pdf&&fPath=' + res.data.data);
a.click();
}, 1000)
} else {
this.Error('PDF获取失败');
}
}, err => {})
}else{
this.$message.error('验证码错误!')
}).catch(err => {
})
}
},
// this.yzmVisible=false
// this.$message.info('文件压缩中,请等待..')
// this.apipost('user_cloud_GetPackageFile', {
// FolderIdStr: this.fileList,
// FileIdStr: this.notFileList
// }, res => {
// if(res.data.resultCode == 1) {
// const link = document.createElement('a');
// let _loadUrl = this.domainManager().DomainUrl;
// link.href = _loadUrl+res.data.data;
// document.body.appendChild(link);
// link.click();
// this.apipost('user_cloud_DelPackageFile',{Path:link.href},res=>{
// },err=>{})
// }else{
// this.$message.error(res.data.message)
// }
// }, err => {})
// }else{
// this.$message.error('验证码错误!')
// }
enterTr(index) {
this.curIndex = index
},
......@@ -543,7 +584,7 @@
this.curIndex = -1;
},
checkedAll() {
if(this.isCkedAll == true) {
if (this.isCkedAll == true) {
this.fileList = []
this.notFileList = []
} else {
......@@ -556,7 +597,7 @@
}
},
ckeckedOne() {
if(this.fileList.length + this.notFileList.length < this.allLength) {
if (this.fileList.length + this.notFileList.length < this.allLength) {
this.isCkedAll = false
} else {
this.isCkedAll = true
......@@ -568,7 +609,7 @@
},
addFiles() {
this.apipost('user_cloud_AddFolder', this.addFileMsg, res => {
if(res.data.resultCode == 1) {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.getList()
this.outerVisible = false
......@@ -589,7 +630,7 @@
FolderIdStr: this.fileList,
FileIdStr: this.notFileList
}, res => {
if(res.data.resultCode == 1) {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.getList()
} else {
......@@ -604,12 +645,12 @@
let fileList = []
let notFileList = []
let confirmMsg = ''
if(obj.DataType == 0) { //文件夹
if (obj.DataType == 0) { //文件夹
fileList.push(obj.Id)
confirmMsg = '删除文件夹后,分享和子文件将被删除,是否删除?'
}
if(obj.DataType == 2) { //文件
if (obj.DataType == 2) { //文件
notFileList.push(obj.Id)
confirmMsg = '删除文件后,分享文件将被删除,是否删除?'
}
......@@ -622,7 +663,7 @@
FolderIdStr: fileList,
FileIdStr: notFileList
}, res => {
if(res.data.resultCode == 1) {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.getList()
} else {
......@@ -639,12 +680,12 @@
this.outerVisible2 = true
},
handleNodeChange(data, checked) {
if(checked) {
if (checked) {
this.arr.push(data.Id)
this.$refs.tree.setCheckedKeys([data.Id]);
this.MoveMsg.FolderId = data.Id;
} else {
if(this.arr.length == 1) {
if (this.arr.length == 1) {
this.arr = []
this.MoveMsg.FolderId = '0'
} else {
......@@ -658,7 +699,7 @@
this.MoveMsg.FileIdStr = this.notFileList
this.$refs.tree.setCheckedKeys([]);
this.apipost('user_cloud_BatchFolderMove', this.MoveMsg, res => {
if(res.data.resultCode == 1) {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.outerVisible2 = false;
this.getList()
......@@ -668,19 +709,19 @@
}, err => {})
},
openShareOneDialog(obj) {
if(obj.DataType==0){
this.fileList=[]
this.notFileList=[]
if (obj.DataType == 0) {
this.fileList = []
this.notFileList = []
this.fileList.push(obj.Id)
}
if(obj.DataType==2){
this.fileList=[]
this.notFileList=[]
if (obj.DataType == 2) {
this.fileList = []
this.notFileList = []
this.notFileList.push(obj.Id)
}
this.outerVisible3 = true
this.dialogTitle3 = '分享文件/文件夹'
this.shareMsg.shareType=1;
this.shareMsg.shareType = 1;
this.getDepartment()
this.getRole()
this.getMenber()
......@@ -688,56 +729,59 @@
openShareDialog() {
this.outerVisible3 = true
this.dialogTitle3 = '分享文件/文件夹'
this.shareMsg.shareType=1;
this.shareMsg.shareType = 1;
this.getDepartment()
this.getRole()
this.getMenber()
},
//按照集团分享
shareGroup(){
this.shareMsg.shareType=4;
},
shareDeparment(){
this.shareMsg.shareType=1
this.ckdRoleList=[]
this.ckdRoleListId=[]
this.ckdMenberList=[]
this.ckdMenberListId=[]
},
shareRole(){
this.shareMsg.shareType=2
this.ckdDepartmentList=[]
this.ckdDepartmentListId=[]
this.ckdMenberList=[]
this.ckdMenberListId=[]
},
shareMenber(){
this.shareMsg.shareType=3
this.ckdDepartmentList=[]
this.ckdDepartmentListId=[]
this.ckdRoleList=[]
this.ckdRoleListId=[]
shareGroup() {
this.shareMsg.shareType = 4;
},
shareDeparment() {
this.shareMsg.shareType = 1
this.ckdRoleList = []
this.ckdRoleListId = []
this.ckdMenberList = []
this.ckdMenberListId = []
},
shareRole() {
this.shareMsg.shareType = 2
this.ckdDepartmentList = []
this.ckdDepartmentListId = []
this.ckdMenberList = []
this.ckdMenberListId = []
},
shareMenber() {
this.shareMsg.shareType = 3
this.ckdDepartmentList = []
this.ckdDepartmentListId = []
this.ckdRoleList = []
this.ckdRoleListId = []
},
getDepartment() { //部门
this.apipost('app_get_GetCompanyDepartmentListTree', {}, res => {
this.departmentList = res.data.data
}, err => {})
},
DepartmentListNodeChange(data,checked){
if(checked){
this.ckdDepartmentList.push({name:data.DepartmentName,id:data.DepartmentId})
DepartmentListNodeChange(data, checked) {
if (checked) {
this.ckdDepartmentList.push({
name: data.DepartmentName,
id: data.DepartmentId
})
this.ckdDepartmentListId.push(data.DepartmentId)
}
if(!checked){
if(this.ckdDepartmentList.findIndex(item => item.id === data.DepartmentId)!=-1){
if (!checked) {
if (this.ckdDepartmentList.findIndex(item => item.id === data.DepartmentId) != -1) {
this.ckdDepartmentList.splice(this.ckdDepartmentList.findIndex(item => item.id === data.DepartmentId), 1)
}
if(this.ckdDepartmentListId.findIndex(item => item === data.DepartmentId)!=-1){
if (this.ckdDepartmentListId.findIndex(item => item === data.DepartmentId) != -1) {
this.ckdDepartmentListId.splice(this.ckdDepartmentListId.findIndex(item => item === data.DepartmentId), 1)
}
}
},
deleteDepartment(id){
deleteDepartment(id) {
this.ckdDepartmentList.splice(this.ckdDepartmentList.findIndex(item => item.id === id), 1)
this.ckdDepartmentListId.splice(this.ckdDepartmentListId.findIndex(item => item === id), 1) //删除相同id
this.$refs.treeDepartmentList.setCheckedKeys(this.ckdDepartmentListId);
......@@ -748,21 +792,24 @@
this.roleList = res.data.data
}, err => {})
},
roleListNodeChange(data,checked){
if(data.Type == 2 &&checked){
this.ckdRoleList.push({name:data.DepartmentName,id:data.DepartmentId})
roleListNodeChange(data, checked) {
if (data.Type == 2 && checked) {
this.ckdRoleList.push({
name: data.DepartmentName,
id: data.DepartmentId
})
this.ckdRoleListId.push(data.DepartmentId)
}
if(data.Type == 2 &&!checked){
if(this.ckdRoleList.findIndex(item => item.id === data.DepartmentId)!=-1){
if (data.Type == 2 && !checked) {
if (this.ckdRoleList.findIndex(item => item.id === data.DepartmentId) != -1) {
this.ckdRoleList.splice(this.ckdRoleList.findIndex(item => item.id === data.DepartmentId), 1)
}
if(this.ckdRoleListId.findIndex(item => item === data.DepartmentId)!=-1){
if (this.ckdRoleListId.findIndex(item => item === data.DepartmentId) != -1) {
this.ckdRoleListId.splice(this.ckdRoleListId.findIndex(item => item === data.DepartmentId), 1) //删除相同id
}
}
},
deleteRole(id){
deleteRole(id) {
this.ckdRoleList.splice(this.ckdRoleList.findIndex(item => item.id === id), 1)
this.ckdRoleListId.splice(this.ckdRoleListId.findIndex(item => item === id), 1)
//删除相同id
......@@ -774,48 +821,51 @@
this.menberList = res.data.data
}, err => {})
},
MenberListNodeChange(data,checked){
if(data.Type == 2 &&checked){
this.ckdMenberList.push({name:data.DepartmentName,id:data.DepartmentId})
MenberListNodeChange(data, checked) {
if (data.Type == 2 && checked) {
this.ckdMenberList.push({
name: data.DepartmentName,
id: data.DepartmentId
})
this.ckdMenberListId.push(data.DepartmentId)
}
if(data.Type == 2 &&!checked){
if(this.ckdMenberList.findIndex(item => item.id === data.DepartmentId)!=-1){
if (data.Type == 2 && !checked) {
if (this.ckdMenberList.findIndex(item => item.id === data.DepartmentId) != -1) {
this.ckdMenberList.splice(this.ckdMenberList.findIndex(item => item.id === data.DepartmentId), 1)
}
if(this.ckdMenberListId.findIndex(item => item === data.DepartmentId)!=-1){
if (this.ckdMenberListId.findIndex(item => item === data.DepartmentId) != -1) {
this.ckdMenberListId.splice(this.ckdMenberListId.findIndex(item => item === data.DepartmentId), 1) //删除相同id
}
}
},
deleteMenber(id){
deleteMenber(id) {
this.ckdMenberList.splice(this.ckdMenberList.findIndex(item => item.id === id), 1)
this.ckdMenberListId.splice(this.ckdMenberListId.findIndex(item => item === id), 1) //删除相同id
this.$refs.treeMenber.setCheckedKeys(this.ckdMenberListId);
},
saveShareDocument(){
if(this.shareMsg.shareType==1){
this.shareMsg.targetIds=this.ckdDepartmentListId.join(',')
}else if(this.shareMsg.shareType==2){
this.shareMsg.targetIds=this.ckdRoleListId.join(',')
}else{
this.shareMsg.targetIds=this.ckdMenberListId.join(',')
saveShareDocument() {
if (this.shareMsg.shareType == 1) {
this.shareMsg.targetIds = this.ckdDepartmentListId.join(',')
} else if (this.shareMsg.shareType == 2) {
this.shareMsg.targetIds = this.ckdRoleListId.join(',')
} else {
this.shareMsg.targetIds = this.ckdMenberListId.join(',')
}
if(this.shareMsg.shareType==4){
if (this.shareMsg.shareType == 4) {
let userInfo = this.getLocalStorage();
this.shareMsg.targetIds = userInfo.RB_Group_id;
}
this.shareMsg.fileIds=this.notFileList
this.shareMsg.folderIds=this.fileList
this.apipost('user_cloud_file_share',this.shareMsg,res=>{
if(res.data.resultCode == 1) {
this.outerVisible3=false
this.shareMsg.fileIds = this.notFileList
this.shareMsg.folderIds = this.fileList
this.apipost('user_cloud_file_share', this.shareMsg, res => {
if (res.data.resultCode == 1) {
this.outerVisible3 = false
this.$message.success(res.data.message)
}else{
} else {
this.$message.error(res.data.message)
}
},err=>{})
}, err => {})
},
updateFiles(obj) {
......@@ -833,7 +883,7 @@
},
saveUpdateFile() {
this.apipost('user_cloud_UpdateFile', this.updateFileMsg, res => {
if(res.data.resultCode == 1) {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.outerVisible = false;
this.getList()
......@@ -844,9 +894,9 @@
},
getList() {
this.msg.EmployeeId = this.getLocalStorage().EmployeeId;
this.msg.FolderName = this.srearchKey ;
this.msg.FolderName = this.srearchKey;
this.apipost('user_cloud_GetFolderList', this.msg, res => {
if(res.data.resultCode == 1) {
if (res.data.resultCode == 1) {
this.list = res.data.data.data
this.NavigationList = res.data.data.Navigation
this.isCkedAll = false
......@@ -856,14 +906,15 @@
this.WjjId = []
this.WjId = []
res.data.data.data.forEach(item => {
if(item.DataType == 0) {
if (item.DataType == 0) {
this.WjjId.push(item.Id)
item.icons=this.loadFileICON('')
item.icons = this.loadFileICON('')
}
if(item.DataType == 2) {
if (item.DataType == 2) {
this.WjId.push(item.Id)
let fileType=item.FolderName.substring(item.FolderName.lastIndexOf('.')+1,item.FolderName.length).toLowerCase()
item.icons=this.loadFileICON(fileType)
let fileType = item.FolderName.substring(item.FolderName.lastIndexOf('.') + 1, item.FolderName
.length).toLowerCase()
item.icons = this.loadFileICON(fileType)
}
})
}
......@@ -877,14 +928,14 @@
},
getTreeList() {
this.apipost('user_cloud_GetFolderTreeList', {}, res => {
if(res.data.resultCode == 1) {
if (res.data.resultCode == 1) {
this.fileTreeList = res.data.data
} else {}
}, err => {})
},
submitForm(addMsg) { //提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if(valid) {
if (valid) {
this.addFiles()
} else {
return false;
......@@ -895,86 +946,101 @@
done();
this.addFileMsg.FolderName = ''
},
doSearch()
{
doSearch() {
this.getList();
},
moveCancel()
{
moveCancel() {
this.$refs.tree.setCheckedKeys([]);
this.outerVisible2=false;
this.outerVisible2 = false;
}
},
mounted() {
let userInfo=this.getLocalStorage();
let userInfo = this.getLocalStorage();
this.getList()
},
created(){
created() {
this.createCode()
}
}
</script>
<style>
.myDocumentShareDiv{
.myDocumentShareDiv {
max-height: 400px;
overflow: auto;
}
.myDocumentShareDiv::-webkit-scrollbar,.myDocumentShareTree::-webkit-scrollbar,.myDocumentShareObject::-webkit-scrollbar{
.myDocumentShareDiv::-webkit-scrollbar,
.myDocumentShareTree::-webkit-scrollbar,
.myDocumentShareObject::-webkit-scrollbar {
/*滚动条整体样式*/
width: 4px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 1px;
}
.myDocumentShareDiv::-webkit-scrollbar-thumb,.myDocumentShareTree::-webkit-scrollbar-thumb,.myDocumentShareObject::-webkit-scrollbar-thumb{
}
.myDocumentShareDiv::-webkit-scrollbar-thumb,
.myDocumentShareTree::-webkit-scrollbar-thumb,
.myDocumentShareObject::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
background: #c9c9c9;
}
.myDocumentShareDiv::-webkit-scrollbar-track,.myDocumentShareTree::-webkit-scrollbar-track,.myDocumentShareObject::-webkit-scrollbar-track{
}
.myDocumentShareDiv::-webkit-scrollbar-track,
.myDocumentShareTree::-webkit-scrollbar-track,
.myDocumentShareObject::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
border-radius: 4px;
background: #EDEDED;
}
.myDocumentShareTree{
}
.myDocumentShareTree {
float: left;
padding:10px;
padding: 10px;
width: 400px;
max-height: 400px;
overflow: auto;
border-right: 1px solid #f9f9f9;
}
.myDocumentShareObject{
.myDocumentShareObject {
padding: 10px;
width: 380px;
max-height: 400px;
overflow: auto;
float: left;
}
.myDocumentShareObject li{
.myDocumentShareObject li {
height: 24px;
line-height: 24px;
width: 100%;
}
.myDocumentShareObject li:hover{
.myDocumentShareObject li:hover {
background: #f9f9f9;
}
.myDocumentShareObject li i{
.myDocumentShareObject li i {
float: right;
cursor: pointer;
margin: 5px 0;
}
.myDocumentsNav {
margin: 25px 0;
}
.myDocumentsTable input[type='checkbox']{
.myDocumentsTable input[type='checkbox'] {
vertical-align: sub;
}
.myDocumentsTable td,
.myDocumentsTable th {
text-align: left!important;
text-align: left !important;
padding-left: 15px;
}
......@@ -1010,7 +1076,7 @@
}
.shareDocumentDialog .el-dialog__body {
padding: 0!important;
padding: 0 !important;
}
.documentDialogNav {
......@@ -1042,13 +1108,16 @@
border-color: transparent transparent #fff;
/*透明 透明 灰*/
}
.DocumentLoadVerification{
width: 120px; height: 30px;
.DocumentLoadVerification {
width: 120px;
height: 30px;
border-radius: 4px;
letter-spacing: 5px;
border:none; background: #f56c6c;
border: none;
background: #f56c6c;
color: #eee;
cursor: pointer;
}
}
</style>
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