Commit 233f7202 authored by 黄奎's avatar 黄奎

页面修改

parent 0dd6a36b
<template> <template>
<div class="flexOne"> <div class="flexOne">
<div class="myDocumentsNav"> <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"
<el-button size="small" type="danger" icon="el-icon-upload2">上传</el-button> :multiple="true" :limit="5" :show-file-list="false" :headers='headers' action="">
</el-upload> <el-button size="small" type="danger" icon="el-icon-upload2">上传</el-button>
</el-upload>
<el-button-group> <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='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"
<el-button type="danger" @click='openAddFilesDialog'>新键文件夹</el-button> @click='yzmVisible=true,createCode()'>压缩下载</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 type="danger" @click='openAddFilesDialog'>新键文件夹</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"
<el-button v-if='fileList.length>0||notFileList.length>0' type="danger" @click='moveFiles'>移动到</el-button> @click='deleteFiles'>{{$t('system.table_delete')}}</el-button>
</el-button-group> <el-button v-if='fileList.length>0||notFileList.length>0' type="danger" icon="el-icon-share"
<div class="fr"> @click='openShareDialog'>分享</el-button>
<el-input class='w200' :placeholder="$t('pub.pleaseImport')" prefix-icon="el-icon-search" v-model="srearchKey" ></el-input> <el-button v-if='fileList.length>0||notFileList.length>0' type="danger" @click='moveFiles'>移动到</el-button>
<input type="button" class="hollowFixedBtn" @click='doSearch()' :value="$t('pub.searchBtn')" /> </el-button-group>
</div> <div class="fr">
</div> <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'> <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"
</div> @click="getNextLevel(item.Id)">{{item.FolderName}}</span>
</div>
<table class="singeRowTable myDocumentsTable" border="0" cellspacing="0" cellpadding="0"> <table class="singeRowTable myDocumentsTable" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<th width="400"><input v-model="isCkedAll" type="checkbox" @click='checkedAll()' />文件名</th> <th width="400"><input v-model="isCkedAll" type="checkbox" @click='checkedAll()' />文件名</th>
<th width="200">&nbsp;</th> <th width="200">&nbsp;</th>
<th width="200">大小</th> <th width="200">大小</th>
<th width="200">修改日期</th> <th width="200">修改日期</th>
</tr> </tr>
<tr v-for="(item,index) in list" @mouseover="enterTr(index)" @mouseleave="leaveTr"> <tr v-for="(item,index) in list" @mouseover="enterTr(index)" @mouseleave="leaveTr">
<td v-if="item.DataType==0"> <td v-if="item.DataType==0">
<input type="checkbox" :value="item.Id" v-model="fileList" @change="ckeckedOne"> <input type="checkbox" :value="item.Id" v-model="fileList" @change="ckeckedOne">
<div @click="getNextLevel(item.Id)" style="cursor: pointer; display: inline-block;"> <div @click="getNextLevel(item.Id)" style="cursor: pointer; display: inline-block;">
<div :class="['fileIcon', item.icons]"></div> <div :class="['fileIcon', item.icons]"></div>
{{item.FolderName}}</div> {{item.FolderName}}
</td> </div>
<td v-if="item.DataType==2"> </td>
<input type="checkbox" :value="item.Id" v-model="notFileList" @change="ckeckedOne"> <td v-if="item.DataType==2">
<div @click="analyzeItem(item)" style="cursor: pointer;display: inline-block;"> <input type="checkbox" :value="item.Id" v-model="notFileList" @change="ckeckedOne">
<div :class="['fileIcon', item.icons]"></div> <div @click="analyzeItem(item)" style="cursor: pointer;display: inline-block;">
{{item.FolderName}} <div :class="['fileIcon', item.icons]"></div>
</div> {{item.FolderName}}
</td> </div>
<td> </td>
<el-row v-if='curIndex==index'> <td>
<el-button type="primary" icon="el-icon-download" circle @click='downloadOne(item)'></el-button> <el-row v-if='curIndex==index'>
<el-button v-if="item.DataType==0" type="primary" icon="el-icon-edit" circle @click='updateFiles(item)'></el-button> <el-button type="primary" icon="el-icon-download" circle @click='downloadOne(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 type="primary" icon="el-icon-share" circle @click='openShareOneDialog(item)'></el-button> </el-button>
<el-button type="danger" icon="el-icon-delete" @click='deleteOne(item)' circle></el-button> <el-button v-if="item.DataType==2" type="primary" icon="el-icon-edit" circle @click='updateOneFile(item)'>
</el-row> </el-button>
</td> <el-button type="primary" icon="el-icon-share" circle @click='openShareOneDialog(item)'></el-button>
<td>{{item.FileSize| FileSizeFormat(item.FileSize)}}</td> <el-button type="danger" icon="el-icon-delete" @click='deleteOne(item)' circle></el-button>
<td>{{item.UpdateTime}}</td> </el-row>
</tr> </td>
</table> <td>{{item.FileSize| FileSizeFormat(item.FileSize)}}</td>
<td>{{item.UpdateTime}}</td>
</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
<el-form :model="addFileMsg" :rules="rules" ref="addFileMsg" label-width="80px"> :before-close="closeChangeMachie">
<el-form-item label='文件名称' prop="FolderName"> <el-form :model="addFileMsg" :rules="rules" ref="addFileMsg" label-width="80px">
<el-input type="text" maxLength='50' v-model='addFileMsg.FolderName'></el-input> <el-form-item label='文件名称' prop="FolderName">
</el-form-item> <el-input type="text" maxLength='50' v-model='addFileMsg.FolderName'></el-input>
</el-form> </el-form-item>
<div slot="footer" class="dialog-footer"> </el-form>
<input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="outerVisible = false,addFileMsg.FolderName=''" /> <div slot="footer" class="dialog-footer">
<input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="submitForm('addFileMsg')" /> <input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')"
</div> @click="outerVisible = false,addFileMsg.FolderName=''" />
</el-dialog> <input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="submitForm('addFileMsg')" />
</div>
</el-dialog>
<el-dialog custom-class='w400' :title="dialogTitle1" :visible.sync="outerVisible1" center> <el-dialog custom-class='w400' :title="dialogTitle1" :visible.sync="outerVisible1" center>
<el-form :model="updateFileMsg" :rules="rules1" ref="updateFileMsg" label-width="80px"> <el-form :model="updateFileMsg" :rules="rules1" ref="updateFileMsg" label-width="80px">
<el-form-item label='名称' prop="FileName"> <el-form-item label='名称' prop="FileName">
<el-input type="text" maxLength='50' v-model='updateFileMsg.FileName'></el-input> <el-input type="text" maxLength='50' v-model='updateFileMsg.FileName'></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="outerVisible1 = false" /> <input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="outerVisible1 = false" />
<input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="saveUpdateFile" /> <input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="saveUpdateFile" />
</div> </div>
</el-dialog> </el-dialog>
<el-dialog custom-class='w400' :title="dialogTitle2" :visible.sync="outerVisible2" @close="moveCancel" center> <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"
</el-tree> node-key="Id" show-checkbox accordion ref="tree">
<div slot="footer" class="dialog-footer"> </el-tree>
<input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="moveCancel" /> <div slot="footer" class="dialog-footer">
<input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="saveMoveFiles" /> <input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="moveCancel" />
</div> <input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="saveMoveFiles" />
</el-dialog> </div>
</el-dialog>
<el-dialog custom-class='w800 shareDocumentDialog' :title="dialogTitle3" :visible.sync="outerVisible3" center> <el-dialog custom-class='w800 shareDocumentDialog' :title="dialogTitle3" :visible.sync="outerVisible3" center>
<div class="documentDialogNav"> <div class="documentDialogNav">
<div @click="shareGroup"> <div @click="shareGroup">
<i class="iconfont icon-user11"></i>集团 <i class="iconfont icon-user11"></i>集团
<div v-if='shareMsg.shareType==4' class="checkIcon"></div> <div v-if='shareMsg.shareType==4' class="checkIcon"></div>
</div> </div>
<div @click="shareDeparment"> <div @click="shareDeparment">
<i class="iconfont icon-user11"></i>{{$t('admin.admin_Department')}} <i class="iconfont icon-user11"></i>{{$t('admin.admin_Department')}}
<div v-if='shareMsg.shareType==1' class="checkIcon"></div> <div v-if='shareMsg.shareType==1' class="checkIcon"></div>
</div> </div>
<div @click="shareRole"> <div @click="shareRole">
<i class="iconfont icon-user11"></i>{{$t('admin.admin_Post')}} <i class="iconfont icon-user11"></i>{{$t('admin.admin_Post')}}
<div v-if='shareMsg.shareType==2' class="checkIcon"></div> <div v-if='shareMsg.shareType==2' class="checkIcon"></div>
</div> </div>
<div @click="shareMenber"> <div @click="shareMenber">
<i class="iconfont icon-user11"></i>{{$t('system.table_staffs')}} <i class="iconfont icon-user11"></i>{{$t('system.table_staffs')}}
<div v-if='shareMsg.shareType==3' class="checkIcon"></div> <div v-if='shareMsg.shareType==3' class="checkIcon"></div>
</div> </div>
</div> </div>
<div v-if="shareMsg.shareType==4" class="myDocumentShareDiv"> <div v-if="shareMsg.shareType==4" class="myDocumentShareDiv">
<div style="height:400px;padding:20px;font-size:15px;"> <div style="height:400px;padding:20px;font-size:15px;">
分享到整个集团 分享到整个集团
</div> </div>
</div> </div>
<div v-if='shareMsg.shareType==1' class="myDocumentShareDiv"> <div v-if='shareMsg.shareType==1' class="myDocumentShareDiv">
<div class="myDocumentShareTree"> <div class="myDocumentShareTree">
<el-tree <el-tree :data="departmentList" ref="treeDepartmentList" node-key="DepartmentId" :check-strictly='true'
:data="departmentList" show-checkbox :render-after-expand="false" :props="defaultProps2" @check-change="DepartmentListNodeChange">
ref="treeDepartmentList" </el-tree>
node-key="DepartmentId" </div>
:check-strictly='true' <div class="myDocumentShareObject">
show-checkbox <ul>
:render-after-expand="false" <li v-for="item in ckdDepartmentList">{{item.name}}
:props="defaultProps2" <i @click="deleteDepartment(item.id)" class="el-icon-circle-close"></i>
@check-change="DepartmentListNodeChange" </li>
> </ul>
</el-tree> </div>
</div> </div>
<div class="myDocumentShareObject"> <div v-if='shareMsg.shareType==2' class="myDocumentShareDiv">
<ul> <div class="myDocumentShareTree">
<li v-for="item in ckdDepartmentList">{{item.name}} <el-tree :data="roleList" ref="treeRole" node-key="DepartmentId" :check-strictly='true' show-checkbox
<i @click="deleteDepartment(item.id)" class="el-icon-circle-close"></i> :render-after-expand="false" :props="defaultProps1" @check-change="roleListNodeChange">
</li> </el-tree>
</ul> </div>
</div> <div class="myDocumentShareObject">
</div> <ul>
<div v-if='shareMsg.shareType==2' class="myDocumentShareDiv"> <li v-for="item in ckdRoleList">{{item.name}}
<div class="myDocumentShareTree"> <i @click="deleteRole(item.id)" class="el-icon-circle-close"></i>
<el-tree </li>
:data="roleList" </ul>
ref="treeRole" </div>
node-key="DepartmentId" </div>
:check-strictly='true' <div v-if='shareMsg.shareType==3' class="myDocumentShareDiv">
show-checkbox <div class="myDocumentShareTree">
:render-after-expand="false" <el-tree :data="menberList" ref="treeMenber" node-key="DepartmentId" :check-strictly='true' show-checkbox
:props="defaultProps1" :render-after-expand="false" :props="defaultProps3" @check-change="MenberListNodeChange">
@check-change="roleListNodeChange" </el-tree>
> </div>
</el-tree> <div class="myDocumentShareObject">
</div> <ul>
<div class="myDocumentShareObject"> <li v-for="item in ckdMenberList">{{item.name}}
<ul> <i @click="deleteMenber(item.id)" class="el-icon-circle-close"></i>
<li v-for="item in ckdRoleList">{{item.name}} </li>
<i @click="deleteRole(item.id)" class="el-icon-circle-close"></i> </ul>
</li> </div>
</ul> </div>
</div> <div slot="footer" class="dialog-footer">
</div> <input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="outerVisible3=false" />
<div v-if='shareMsg.shareType==3' class="myDocumentShareDiv"> <input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="saveShareDocument" />
<div class="myDocumentShareTree"> </div>
<el-tree </el-dialog>
: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">
<ul>
<li v-for="item in ckdMenberList">{{item.name}}
<i @click="deleteMenber(item.id)" class="el-icon-circle-close"></i>
</li>
</ul>
</div>
</div>
<div slot="footer" class="dialog-footer">
<input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="outerVisible3=false" />
<input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="saveShareDocument" />
</div>
</el-dialog>
<el-dialog custom-class='w800' :title="dialogTitle4" :visible.sync="outerVisible4" center> <el-dialog custom-class='w800' :title="dialogTitle4" :visible.sync="outerVisible4" center>
<video :src="moviePath" controls="controls" style="width: 100%;"> <video :src="moviePath" controls="controls" style="width: 100%;">
your browser does not support the video tag your browser does not support the video tag
</video> </video>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<input type="button" class="normalBtn" :value="$t('pub.closeSel')" @click="outerVisible4=false" /> <input type="button" class="normalBtn" :value="$t('pub.closeSel')" @click="outerVisible4=false" />
</div> </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;"> <div v-if='audioIsShow'
<i class="el-icon-circle-close-outline" style="float: right; cursor: pointer;" @click="audioIsShow=false,audioPath=''"></i> style="position: fixed; bottom: 100px; right: 20px; z-index: 999; border:1px solid #ccc; padding: 10px; background: #eee;">
<p style="font-size: 12px; margin: 0 0 10px 0;">{{audioName}}</p> <i class="el-icon-circle-close-outline" style="float: right; cursor: pointer;"
<audio :src="audioPath" controls="controls"> @click="audioIsShow=false,audioPath=''"></i>
Your browser does not support the audio tag. <p style="font-size: 12px; margin: 0 0 10px 0;">{{audioName}}</p>
</audio> <audio :src="audioPath" controls="controls">
</div> Your browser does not support the audio tag.
<div v-if='picIsShow' class="viewBigPicLayer"> </audio>
<i class="el-icon-circle-close-outline clolseViewBigPicLayer" @click="picIsShow=false,picObj=[]"></i> </div>
<el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click"> <div v-if='picIsShow' class="viewBigPicLayer">
<el-carousel-item v-for="(item,index) in picObj" :key="index"> <i class="el-icon-circle-close-outline clolseViewBigPicLayer" @click="picIsShow=false,picObj=[]"></i>
<div class="inlineDiv ownScrollbarStyle"><img :src="item" /></div> <el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click">
</el-carousel-item> <el-carousel-item v-for="(item,index) in picObj" :key="index">
</el-carousel> <div class="inlineDiv ownScrollbarStyle"><img :src="item" /></div>
</div> </el-carousel-item>
</el-carousel>
</div>
<el-dialog custom-class='w400' title="压缩下载" :visible.sync="yzmVisible" center> <el-dialog custom-class='w400' title="压缩下载" :visible.sync="yzmVisible" center>
<p> <p>
<span>验证码 : </span> <span>验证码 : </span>
<el-input class='w150' type="text" placeholder="请输入验证码" v-model="picLyanzhengma"></el-input> <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> </p>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="yzmVisible=false" /> <input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="yzmVisible=false" />
<input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="downloadTotal()" /> <input type="button" class="normalBtn" :value="$t('pub.sureBtn')" @click="downloadTotal()" />
</div> </div>
</el-dialog > </el-dialog>
<a target="_blank" style="display:none" id="blankLink"></a> <a target="_blank" style="display:none" id="blankLink"></a>
</div> </div>
</template> </template>
<script> <script>
// let browserMD5File = require('browser-md5-file'); // let browserMD5File = require('browser-md5-file');
export default { export default {
data() { data() {
return { return {
code:'', code: '',
picLyanzhengma:'', picLyanzhengma: '',
checkCode:'', checkCode: '',
yzmVisible: false, yzmVisible: false,
initialIndex:0, initialIndex: 0,
picObj:[], picObj: [],
picIsShow:false, picIsShow: false,
audioIsShow:false, audioIsShow: false,
outerVisible4: false, outerVisible4: false,
dialogTitle4: '', dialogTitle4: '',
moviePath:'', moviePath: '',
audioPath:'', audioPath: '',
picPath:'', picPath: '',
audioName:'', audioName: '',
headers: { headers: {
'Content-Type': 'application/octet-stream' 'Content-Type': 'application/octet-stream'
}, },
defaultProps: { defaultProps: {
children: 'ChildFolderList', children: 'ChildFolderList',
label: 'FolderName', label: 'FolderName',
}, },
defaultProps1: { defaultProps1: {
children: 'ChildList', children: 'ChildList',
label: 'DepartmentName', label: 'DepartmentName',
disabled: "Disabled" disabled: "Disabled"
}, },
defaultProps2: { defaultProps2: {
children: 'ChildList', children: 'ChildList',
label: 'DepartmentName', label: 'DepartmentName',
disabled: "Disabled" disabled: "Disabled"
}, },
defaultProps3: { defaultProps3: {
children: 'ChildList', children: 'ChildList',
label: 'DepartmentName', label: 'DepartmentName',
disabled: "Disabled" disabled: "Disabled"
}, },
outerVisible: false, outerVisible: false,
dialogTitle: '', dialogTitle: '',
outerVisible1: false, outerVisible1: false,
dialogTitle1: '', dialogTitle1: '',
outerVisible2: false, outerVisible2: false,
dialogTitle2: '', dialogTitle2: '',
outerVisible3: false, outerVisible3: false,
dialogTitle3: '', dialogTitle3: '',
isCkedAll: false, isCkedAll: false,
//请求数据 //请求数据
fileList: [], //文件夹 fileList: [], //文件夹
notFileList: [], //文件 notFileList: [], //文件
saveMsg: [], saveMsg: [],
msg: { msg: {
ParentId: '0', ParentId: '0',
FolderName: '', FolderName: '',
EmployeeId: 0 EmployeeId: 0
}, },
addFileMsg: { addFileMsg: {
FolderName: '', FolderName: '',
ParentId: '0', ParentId: '0',
FolderId: '', FolderId: '',
}, },
updateFileMsg: { updateFileMsg: {
FileId: '0', FileId: '0',
FileName: '0' FileName: '0'
}, },
MoveMsg: { MoveMsg: {
FolderId: '0' FolderId: '0'
}, },
shareMsg: { shareMsg: {
shareType: '1', shareType: '1',
fileIds: [], fileIds: [],
targetIds: '', targetIds: '',
folderIds: [] folderIds: []
}, },
//返回数据 //返回数据
curIndex: -1, curIndex: -1,
list: [], list: [],
fileTreeList: [], fileTreeList: [],
NavigationList: [], NavigationList: [],
WjId: [], WjId: [],
WjjId: [], WjjId: [],
arr: [], arr: [],
departmentList:[], departmentList: [],
ckdDepartmentList:[], ckdDepartmentList: [],
ckdDepartmentListId:[], ckdDepartmentListId: [],
roleList:[], roleList: [],
ckdRoleList:[], ckdRoleList: [],
ckdRoleListId:[], ckdRoleListId: [],
menberList:[], menberList: [],
ckdMenberList:[], ckdMenberList: [],
ckdMenberListId:[], ckdMenberListId: [],
allLength: 0, allLength: 0,
rules: { //表单验证 rules: { //表单验证
FolderName: [{ FolderName: [{
required: true, required: true,
message: '请输入文件夹名称', message: '请输入文件夹名称',
trigger: 'blur' trigger: 'blur'
}] }]
}, },
rules1: { //表单验证 rules1: { //表单验证
FileName: [{ FileName: [{
required: true, required: true,
message: '请输入文件名称', message: '请输入文件名称',
trigger: 'blur' trigger: 'blur'
}] }]
}, },
srearchKey:"" srearchKey: ""
} }
}, },
filters: { filters: {
FileSizeFormat(value) { FileSizeFormat(value) {
if(value == null) { if (value == null) {
return '-' return '-'
} }
if(value != null) { if (value != null) {
if(value / 1024 < 1) { //kb if (value / 1024 < 1) { //kb
return value + 'KB' return value + 'KB'
} }
if(value / 1024 > 1 && value / (1024 * 1024) < 1) { //mb if (value / 1024 > 1 && value / (1024 * 1024) < 1) { //mb
return(value / 1024).toFixed(2) + 'M' return (value / 1024).toFixed(2) + 'M'
} }
if(value / (1024 * 1024) > 1) { //G if (value / (1024 * 1024) > 1) { //G
return(value / (1024 * 1024)).toFixed(2) + 'G' return (value / (1024 * 1024)).toFixed(2) + 'G'
} }
} }
} }
}, },
watch:{ watch: {
}, },
methods: { methods: {
// 图片验证码 // 图片验证码
createCode(){ createCode() {
//先清空验证码的输入 //先清空验证码的输入
this.code = ""; this.code = "";
this.checkCode = ""; this.checkCode = "";
this.picLyanzhengma = ""; this.picLyanzhengma = "";
//验证码的长度 //验证码的长度
var codeLength = 4; 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'); 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',
for(var i = 0; i < codeLength; i++) { 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
//取得随机数的索引(0~35) for (var i = 0; i < codeLength; i++) {
var index = Math.floor(Math.random()*36); //取得随机数的索引(0~35)
//根据索引取得随机数加到code上 var index = Math.floor(Math.random() * 36);
this.code += random[index]; //根据索引取得随机数加到code上
} this.code += random[index];
//把code值赋给验证码 }
this.checkCode = this.code; //把code值赋给验证码
}, this.checkCode = this.code;
analyzeItem(obj){ },
let typeArr=[ analyzeItem(obj) {
{stringArr:'GIF|JPG|JPEG|PNG|BMP',type:1}, let typeArr = [{
{stringArr:'MP3|OGG|AU|AIFF|VQF',type:2}, stringArr: 'GIF|JPG|JPEG|PNG|BMP',
{stringArr:'AVI|WMV|MPEG|MP4|MOV|MKV|FLV|F4V|M4V|RMVB|RM|3GP|DAT|TS|MTS|VOB',type:3}, type: 1
{stringArr:'DOCX|DOC|XLSX|XLS|PPT|PPTX',type:4}, },
{stringArr:'PDF',type:5}, {
] stringArr: 'MP3|OGG|AU|AIFF|VQF',
let fileTypeNumber; // 判断文件预览类型; 1 图片,2音频,3视频,4,office,, 5 PDF , 6 txt default其他 type: 2
let fileType=obj.FilePath.substring(obj.FilePath.lastIndexOf('.')+1,obj.FilePath.length).toUpperCase() },
typeArr.forEach(x=>{ {
if(x.stringArr.indexOf(fileType)!='-1') stringArr: 'AVI|WMV|MPEG|MP4|MOV|MKV|FLV|F4V|M4V|RMVB|RM|3GP|DAT|TS|MTS|VOB',
{ type: 3
fileTypeNumber=x.type },
} {
}) stringArr: 'DOCX|DOC|XLSX|XLS|PPT|PPTX',
switch (fileTypeNumber){ type: 4
case 1: },
this.list.forEach(item=>{ {
if(item.DataType==2){ stringArr: 'PDF',
let fileType=item.FolderName.substring(item.FolderName.lastIndexOf('.')+1,item.FolderName.length).toUpperCase() type: 5
if('GIF|JPG|JPEG|PNG|BMP'.indexOf(fileType)!=-1){ },
this.picObj.push(item.FilePath) ]
} 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
}
})
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.picObj.push(item.FilePath)
}
}
})
this.picObj.forEach((x,i)=>{ this.picObj.forEach((x, i) => {
if(x==obj.FilePath){ if (x == obj.FilePath) {
this.initialIndex=i this.initialIndex = i
return false return false
} }
}) })
this.picIsShow=true this.picIsShow = true
//this.picPath=obj.FilePath //this.picPath=obj.FilePath
break; break;
case 2: case 2:
this.audioIsShow=true this.audioIsShow = true
this.audioName=obj.FolderName this.audioName = obj.FolderName
this.audioPath=obj.FilePath this.audioPath = obj.FilePath
break; break;
case 3: case 3:
this.outerVisible4=true this.outerVisible4 = true
this.dialogTitle4=obj.FolderName this.dialogTitle4 = obj.FolderName
this.moviePath=obj.FilePath this.moviePath = obj.FilePath
break; break;
case 4: 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; break;
case 5: case 5:
this.previewPDF(obj.FilePath) this.previewPDF(obj.FilePath)
break; break;
default: default:
this.$message.warning('该文件格式暂不支持预览,请下载用相关软件预览!') this.$message.warning('该文件格式暂不支持预览,请下载用相关软件预览!')
break; break;
} }
}, },
handleExceed(file, fileList) { handleExceed(file, fileList) {
this.$message.warning('一次最多选择5个文件!') this.$message.warning('一次最多选择5个文件!')
return return
}, },
uploadFileBtn(file) { //上传 uploadFileBtn(file) { //上传
if(file.file.size > 1024 * 1024 * 100) { if (file.file.size > 1024 * 1024 * 100) {
this.$message.warning('文件大小不能超过100M!') this.$message.warning('文件大小不能超过100M!')
return
}
let that = this
let newArr = [];
newArr.push(file.file)
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);
this.saveMsg = []
this.saveMsg.push({
Path: x.data.FilePath,
FileName: file.file.name,
MD5Sign: file.file.uid,
FileSize: fileSize,
FolderId: this.msg.ParentId
})
that.apipost('user_cloud_SaveFile', this.saveMsg, res => {
if(res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.$refs.upload.clearFiles();
this.getList()
} else {
this.$message.error(res.data.message);
this.$refs.upload.clearFiles();
}
}, err => {})
});
},
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) {
let reg = /^http(s)?:\/\/(.*?)\//
this.downloadFileRename(item.FilePath.replace(reg,''),item.FolderName);
}
}
}
})
},
downloadOne(obj){
if(obj.DataType==0){
this.yzmVisible=true
this.createCode()
this.fileList=[]
this.notFileList=[]
this.fileList.push(obj.Id)
}
if(obj.DataType==2){
let reg = /^http(s)?:\/\/(.*?)\//
let dom = document.querySelector("#blankLink")
dom.href = obj.FilePath
dom.click()
return return
this.downloadFileRename(obj.FilePath.replace(reg,''),obj.FolderName); }
} let that = this
}, let newArr = [];
downloadTotal() { newArr.push(file.file)
if(this.picLyanzhengma.toLocaleUpperCase()==this.checkCode){ let path = "/Upload/Temporary/"
this.yzmVisible=false this.$message.info('上传中...')
this.$message.info('文件压缩中,请等待..') this.UploadSelfFileT(path, newArr, x => {
this.apipost('user_cloud_GetPackageFile', { let fileSize = file.file.size < 1024 ? file.file.size : (file.file.size / 1024).toFixed(0);
FolderIdStr: this.fileList, this.saveMsg = []
FileIdStr: this.notFileList this.saveMsg.push({
}, res => { Path: x.data.FilePath,
if(res.data.resultCode == 1) { FileName: file.file.name,
const link = document.createElement('a'); MD5Sign: file.file.uid,
let _loadUrl = this.domainManager().DomainUrl; FileSize: fileSize,
link.href = _loadUrl+res.data.data; FolderId: this.msg.ParentId
document.body.appendChild(link); })
link.click(); that.apipost('user_cloud_SaveFile', this.saveMsg, res => {
this.apipost('user_cloud_DelPackageFile',{Path:link.href},res=>{ if (res.data.resultCode == 1) {
},err=>{}) this.$message.success(res.data.message);
}else{ this.$refs.upload.clearFiles();
this.$message.error(res.data.message) this.getList()
} } else {
}, err => {}) this.$message.error(res.data.message);
}else{ this.$refs.upload.clearFiles();
this.$message.error('验证码错误!') }
} }, err => {})
}, });
enterTr(index) { },
this.curIndex = index dowloadSingle() {
}, let objKey = [];
leaveTr() { this.list.forEach(item => {
this.curIndex = -1; if (item.DataType == 2) {
}, for (let i = 0; i < this.notFileList.length; i++) {
checkedAll() { if (this.notFileList[i] == item.Id) {
if(this.isCkedAll == true) { let reg = /^http(s)?:\/\/(.*?)\//
this.fileList = [] this.downloadFileRename(item.FilePath.replace(reg, ''), item.FolderName);
this.notFileList = [] }
} else { }
this.WjjId.forEach(item => { }
this.fileList.push(item) })
}) },
this.WjId.forEach(item => { downloadOne(obj) {
this.notFileList.push(item) if (obj.DataType == 0) {
}) this.yzmVisible = true
} this.createCode()
}, this.fileList = []
ckeckedOne() { this.notFileList = []
if(this.fileList.length + this.notFileList.length < this.allLength) { this.fileList.push(obj.Id)
this.isCkedAll = false }
} else { if (obj.DataType == 2) {
this.isCkedAll = true let reg = /^http(s)?:\/\/(.*?)\//
} let dom = document.querySelector("#blankLink")
}, dom.href = obj.FilePath
openAddFilesDialog() { dom.click()
this.dialogTitle = '新建文件夹' return
this.outerVisible = true this.downloadFileRename(obj.FilePath.replace(reg, ''), obj.FolderName);
}, }
addFiles() { },
this.apipost('user_cloud_AddFolder', this.addFileMsg, res => { downloadTotal() {
if(res.data.resultCode == 1) { if (this.picLyanzhengma.toLocaleUpperCase() == this.checkCode) {
this.$message.success(res.data.message);
this.getList() // let pageData = document.getElementById('pdfNode').innerHTML
this.outerVisible = false let urlObj = this.domainManager()
this.addFileMsg.FolderName = '' 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获取失败');
}
}).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
},
leaveTr() {
this.curIndex = -1;
},
checkedAll() {
if (this.isCkedAll == true) {
this.fileList = []
this.notFileList = []
} else {
this.WjjId.forEach(item => {
this.fileList.push(item)
})
this.WjId.forEach(item => {
this.notFileList.push(item)
})
}
},
ckeckedOne() {
if (this.fileList.length + this.notFileList.length < this.allLength) {
this.isCkedAll = false
} else {
this.isCkedAll = true
}
},
openAddFilesDialog() {
this.dialogTitle = '新建文件夹'
this.outerVisible = true
},
addFiles() {
this.apipost('user_cloud_AddFolder', this.addFileMsg, res => {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.getList()
this.outerVisible = false
this.addFileMsg.FolderName = ''
} else { } else {
this.$message.error(res.data.message) this.$message.error(res.data.message)
} }
}, err => {}) }, err => {})
}, },
deleteFiles() { deleteFiles() {
this.$confirm('删除文件后,分享和子文件将被删除,是否删除?', '提示', { this.$confirm('删除文件后,分享和子文件将被删除,是否删除?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.apipost('user_cloud_DelFolder', { this.apipost('user_cloud_DelFolder', {
FolderIdStr: this.fileList, FolderIdStr: this.fileList,
FileIdStr: this.notFileList FileIdStr: this.notFileList
}, res => { }, res => {
if(res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.$message.success(res.data.message); this.$message.success(res.data.message);
this.getList() this.getList()
} else { } else {
this.$message.error(res.data.message) this.$message.error(res.data.message)
} }
}, err => {}) }, err => {})
}).catch(() => { }).catch(() => {
this.$message.info('取消删除'); this.$message.info('取消删除');
}); });
}, },
deleteOne(obj) { deleteOne(obj) {
let fileList = [] let fileList = []
let notFileList = [] let notFileList = []
let confirmMsg = '' let confirmMsg = ''
if(obj.DataType == 0) { //文件夹 if (obj.DataType == 0) { //文件夹
fileList.push(obj.Id) fileList.push(obj.Id)
confirmMsg = '删除文件夹后,分享和子文件将被删除,是否删除?' confirmMsg = '删除文件夹后,分享和子文件将被删除,是否删除?'
} }
if(obj.DataType == 2) { //文件 if (obj.DataType == 2) { //文件
notFileList.push(obj.Id) notFileList.push(obj.Id)
confirmMsg = '删除文件后,分享文件将被删除,是否删除?' confirmMsg = '删除文件后,分享文件将被删除,是否删除?'
} }
this.$confirm(confirmMsg, '提示', { this.$confirm(confirmMsg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.apipost('user_cloud_DelFolder', { this.apipost('user_cloud_DelFolder', {
FolderIdStr: fileList, FolderIdStr: fileList,
FileIdStr: notFileList FileIdStr: notFileList
}, res => { }, res => {
if(res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.$message.success(res.data.message); this.$message.success(res.data.message);
this.getList() this.getList()
} else { } else {
this.$message.error(res.data.message) this.$message.error(res.data.message)
} }
}, err => {}) }, err => {})
}).catch(() => { }).catch(() => {
this.$message.info('取消删除'); this.$message.info('取消删除');
}); });
}, },
moveFiles() { moveFiles() {
this.getTreeList() this.getTreeList()
this.dialogTitle2 = '移动文件' this.dialogTitle2 = '移动文件'
this.outerVisible2 = true this.outerVisible2 = true
}, },
handleNodeChange(data, checked) { handleNodeChange(data, checked) {
if(checked) { if (checked) {
this.arr.push(data.Id) this.arr.push(data.Id)
this.$refs.tree.setCheckedKeys([data.Id]); this.$refs.tree.setCheckedKeys([data.Id]);
this.MoveMsg.FolderId = data.Id; this.MoveMsg.FolderId = data.Id;
} else { } else {
if(this.arr.length == 1) { if (this.arr.length == 1) {
this.arr = [] this.arr = []
this.MoveMsg.FolderId = '0' this.MoveMsg.FolderId = '0'
} else { } else {
this.arr = this.arr.slice(this.arr.length - 1) this.arr = this.arr.slice(this.arr.length - 1)
this.MoveMsg.FolderId = this.arr[this.arr.length - 1] this.MoveMsg.FolderId = this.arr[this.arr.length - 1]
} }
} }
}, },
saveMoveFiles() { saveMoveFiles() {
this.MoveMsg.FolderIdStr = this.fileList this.MoveMsg.FolderIdStr = this.fileList
this.MoveMsg.FileIdStr = this.notFileList this.MoveMsg.FileIdStr = this.notFileList
this.$refs.tree.setCheckedKeys([]); this.$refs.tree.setCheckedKeys([]);
this.apipost('user_cloud_BatchFolderMove', this.MoveMsg, res => { 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.$message.success(res.data.message);
this.outerVisible2 = false; this.outerVisible2 = false;
this.getList() this.getList()
} else { } else {
this.$message.error(res.data.message) this.$message.error(res.data.message)
} }
}, err => {}) }, err => {})
}, },
openShareOneDialog(obj) { openShareOneDialog(obj) {
if(obj.DataType==0){ if (obj.DataType == 0) {
this.fileList=[] this.fileList = []
this.notFileList=[] this.notFileList = []
this.fileList.push(obj.Id) this.fileList.push(obj.Id)
} }
if(obj.DataType==2){ if (obj.DataType == 2) {
this.fileList=[] this.fileList = []
this.notFileList=[] this.notFileList = []
this.notFileList.push(obj.Id) this.notFileList.push(obj.Id)
} }
this.outerVisible3 = true this.outerVisible3 = true
this.dialogTitle3 = '分享文件/文件夹' this.dialogTitle3 = '分享文件/文件夹'
this.shareMsg.shareType=1; this.shareMsg.shareType = 1;
this.getDepartment() this.getDepartment()
this.getRole() this.getRole()
this.getMenber() this.getMenber()
}, },
openShareDialog() { openShareDialog() {
this.outerVisible3 = true this.outerVisible3 = true
this.dialogTitle3 = '分享文件/文件夹' this.dialogTitle3 = '分享文件/文件夹'
this.shareMsg.shareType=1; this.shareMsg.shareType = 1;
this.getDepartment() this.getDepartment()
this.getRole() this.getRole()
this.getMenber() this.getMenber()
}, },
//按照集团分享 //按照集团分享
shareGroup(){ shareGroup() {
this.shareMsg.shareType=4; this.shareMsg.shareType = 4;
}, },
shareDeparment(){ shareDeparment() {
this.shareMsg.shareType=1 this.shareMsg.shareType = 1
this.ckdRoleList=[] this.ckdRoleList = []
this.ckdRoleListId=[] this.ckdRoleListId = []
this.ckdMenberList=[] this.ckdMenberList = []
this.ckdMenberListId=[] this.ckdMenberListId = []
}, },
shareRole(){ shareRole() {
this.shareMsg.shareType=2 this.shareMsg.shareType = 2
this.ckdDepartmentList=[] this.ckdDepartmentList = []
this.ckdDepartmentListId=[] this.ckdDepartmentListId = []
this.ckdMenberList=[] this.ckdMenberList = []
this.ckdMenberListId=[] this.ckdMenberListId = []
}, },
shareMenber(){ shareMenber() {
this.shareMsg.shareType=3 this.shareMsg.shareType = 3
this.ckdDepartmentList=[] this.ckdDepartmentList = []
this.ckdDepartmentListId=[] this.ckdDepartmentListId = []
this.ckdRoleList=[] this.ckdRoleList = []
this.ckdRoleListId=[] this.ckdRoleListId = []
}, },
getDepartment() { //部门 getDepartment() { //部门
this.apipost('app_get_GetCompanyDepartmentListTree', {}, res => { this.apipost('app_get_GetCompanyDepartmentListTree', {}, res => {
this.departmentList = res.data.data this.departmentList = res.data.data
}, err => {}) }, err => {})
}, },
DepartmentListNodeChange(data,checked){ DepartmentListNodeChange(data, checked) {
if(checked){ if (checked) {
this.ckdDepartmentList.push({name:data.DepartmentName,id:data.DepartmentId}) this.ckdDepartmentList.push({
this.ckdDepartmentListId.push(data.DepartmentId) name: data.DepartmentName,
} id: data.DepartmentId
if(!checked){ })
if(this.ckdDepartmentList.findIndex(item => item.id === data.DepartmentId)!=-1){ this.ckdDepartmentListId.push(data.DepartmentId)
this.ckdDepartmentList.splice(this.ckdDepartmentList.findIndex(item => item.id === data.DepartmentId), 1) }
} if (!checked) {
if(this.ckdDepartmentListId.findIndex(item => item === data.DepartmentId)!=-1){ if (this.ckdDepartmentList.findIndex(item => item.id === data.DepartmentId) != -1) {
this.ckdDepartmentListId.splice(this.ckdDepartmentListId.findIndex(item => item === data.DepartmentId), 1) this.ckdDepartmentList.splice(this.ckdDepartmentList.findIndex(item => item.id === 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){ }
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); 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);
},
getRole() { //岗位 getRole() { //岗位
this.apipost('WorkFlow_get_GetCompanyDepartMentPost', {}, res => { this.apipost('WorkFlow_get_GetCompanyDepartMentPost', {}, res => {
this.roleList = res.data.data this.roleList = res.data.data
}, err => {}) }, err => {})
}, },
roleListNodeChange(data,checked){ roleListNodeChange(data, checked) {
if(data.Type == 2 &&checked){ if (data.Type == 2 && checked) {
this.ckdRoleList.push({name:data.DepartmentName,id:data.DepartmentId}) this.ckdRoleList.push({
this.ckdRoleListId.push(data.DepartmentId) name: data.DepartmentName,
} id: data.DepartmentId
if(data.Type == 2 &&!checked){ })
if(this.ckdRoleList.findIndex(item => item.id === data.DepartmentId)!=-1){ this.ckdRoleListId.push(data.DepartmentId)
this.ckdRoleList.splice(this.ckdRoleList.findIndex(item => item.id === data.DepartmentId), 1) }
} if (data.Type == 2 && !checked) {
if(this.ckdRoleListId.findIndex(item => item === data.DepartmentId)!=-1){ if (this.ckdRoleList.findIndex(item => item.id === data.DepartmentId) != -1) {
this.ckdRoleListId.splice(this.ckdRoleListId.findIndex(item => item === data.DepartmentId), 1) //删除相同id this.ckdRoleList.splice(this.ckdRoleList.findIndex(item => item.id === 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){ }
this.ckdRoleList.splice(this.ckdRoleList.findIndex(item => item.id === id), 1) }
this.ckdRoleListId.splice(this.ckdRoleListId.findIndex(item => item === id), 1) },
//删除相同id deleteRole(id) {
this.$refs.treeRole.setCheckedKeys(this.ckdRoleListId); this.ckdRoleList.splice(this.ckdRoleList.findIndex(item => item.id === id), 1)
}, this.ckdRoleListId.splice(this.ckdRoleListId.findIndex(item => item === id), 1)
//删除相同id
this.$refs.treeRole.setCheckedKeys(this.ckdRoleListId);
},
getMenber() { //员工 getMenber() { //员工
this.apipost('WorkFlow_get_GetCompanyDepartMentEmployee', {}, res => { this.apipost('WorkFlow_get_GetCompanyDepartMentEmployee', {}, res => {
this.menberList = res.data.data this.menberList = res.data.data
}, err => {}) }, err => {})
}, },
MenberListNodeChange(data,checked){ MenberListNodeChange(data, checked) {
if(data.Type == 2 &&checked){ if (data.Type == 2 && checked) {
this.ckdMenberList.push({name:data.DepartmentName,id:data.DepartmentId}) this.ckdMenberList.push({
this.ckdMenberListId.push(data.DepartmentId) name: data.DepartmentName,
} id: data.DepartmentId
if(data.Type == 2 &&!checked){ })
if(this.ckdMenberList.findIndex(item => item.id === data.DepartmentId)!=-1){ this.ckdMenberListId.push(data.DepartmentId)
this.ckdMenberList.splice(this.ckdMenberList.findIndex(item => item.id === data.DepartmentId), 1) }
} if (data.Type == 2 && !checked) {
if(this.ckdMenberListId.findIndex(item => item === data.DepartmentId)!=-1){ if (this.ckdMenberList.findIndex(item => item.id === data.DepartmentId) != -1) {
this.ckdMenberListId.splice(this.ckdMenberListId.findIndex(item => item === data.DepartmentId), 1) //删除相同id this.ckdMenberList.splice(this.ckdMenberList.findIndex(item => item.id === 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.ckdMenberList.splice(this.ckdMenberList.findIndex(item => item.id === id), 1)
this.ckdMenberListId.splice(this.ckdMenberListId.findIndex(item => item === id), 1) //删除相同id this.ckdMenberListId.splice(this.ckdMenberListId.findIndex(item => item === id), 1) //删除相同id
this.$refs.treeMenber.setCheckedKeys(this.ckdMenberListId); this.$refs.treeMenber.setCheckedKeys(this.ckdMenberListId);
}, },
saveShareDocument(){ saveShareDocument() {
if(this.shareMsg.shareType==1){ if (this.shareMsg.shareType == 1) {
this.shareMsg.targetIds=this.ckdDepartmentListId.join(',') this.shareMsg.targetIds = this.ckdDepartmentListId.join(',')
}else if(this.shareMsg.shareType==2){ } else if (this.shareMsg.shareType == 2) {
this.shareMsg.targetIds=this.ckdRoleListId.join(',') this.shareMsg.targetIds = this.ckdRoleListId.join(',')
}else{ } else {
this.shareMsg.targetIds=this.ckdMenberListId.join(',') this.shareMsg.targetIds = this.ckdMenberListId.join(',')
} }
if(this.shareMsg.shareType==4){ if (this.shareMsg.shareType == 4) {
let userInfo = this.getLocalStorage(); let userInfo = this.getLocalStorage();
this.shareMsg.targetIds = userInfo.RB_Group_id; this.shareMsg.targetIds = userInfo.RB_Group_id;
} }
this.shareMsg.fileIds=this.notFileList this.shareMsg.fileIds = this.notFileList
this.shareMsg.folderIds=this.fileList this.shareMsg.folderIds = this.fileList
this.apipost('user_cloud_file_share',this.shareMsg,res=>{ this.apipost('user_cloud_file_share', this.shareMsg, res => {
if(res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.outerVisible3=false this.outerVisible3 = false
this.$message.success(res.data.message) this.$message.success(res.data.message)
}else{ } else {
this.$message.error(res.data.message) this.$message.error(res.data.message)
} }
},err=>{}) }, err => {})
}, },
updateFiles(obj) {
this.outerVisible = true;
this.dialogTitle = '修改文件夹'
this.addFileMsg.FolderName = obj.FolderName;
this.addFileMsg.FolderId = obj.Id;
},
updateOneFile(obj) {
this.outerVisible1 = true;
this.dialogTitle1 = '修改文件'
let index = obj.FolderName.lastIndexOf('.')
this.updateFileMsg.FileName = obj.FolderName.substring(0, index)
this.updateFileMsg.FileId = obj.Id
},
saveUpdateFile() {
this.apipost('user_cloud_UpdateFile', this.updateFileMsg, res => {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.outerVisible = false;
this.getList()
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
getList() {
this.msg.EmployeeId = this.getLocalStorage().EmployeeId;
this.msg.FolderName = this.srearchKey;
this.apipost('user_cloud_GetFolderList', this.msg, res => {
if (res.data.resultCode == 1) {
this.list = res.data.data.data
this.NavigationList = res.data.data.Navigation
this.isCkedAll = false
this.fileList = []
this.notFileList = []
this.allLength = res.data.data.data.length
this.WjjId = []
this.WjId = []
res.data.data.data.forEach(item => {
if (item.DataType == 0) {
this.WjjId.push(item.Id)
item.icons = this.loadFileICON('')
}
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)
}
})
}
}, err => {})
},
getNextLevel(id) {
this.addFileMsg.ParentId = id
this.msg.ParentId = id
this.srearchKey = ''
this.getList()
},
getTreeList() {
this.apipost('user_cloud_GetFolderTreeList', {}, res => {
if (res.data.resultCode == 1) {
this.fileTreeList = res.data.data
} else {}
}, err => {})
},
submitForm(addMsg) { //提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.addFiles()
} else {
return false;
}
});
},
closeChangeMachie(done) { //弹出框关闭初始化弹框内表单
done();
this.addFileMsg.FolderName = ''
},
doSearch() {
this.getList();
},
moveCancel() {
this.$refs.tree.setCheckedKeys([]);
this.outerVisible2 = false;
}
},
mounted() {
let userInfo = this.getLocalStorage();
this.getList()
},
created() {
this.createCode()
}
}
updateFiles(obj) {
this.outerVisible = true;
this.dialogTitle = '修改文件夹'
this.addFileMsg.FolderName = obj.FolderName;
this.addFileMsg.FolderId = obj.Id;
},
updateOneFile(obj) {
this.outerVisible1 = true;
this.dialogTitle1 = '修改文件'
let index = obj.FolderName.lastIndexOf('.')
this.updateFileMsg.FileName = obj.FolderName.substring(0, index)
this.updateFileMsg.FileId = obj.Id
},
saveUpdateFile() {
this.apipost('user_cloud_UpdateFile', this.updateFileMsg, res => {
if(res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.outerVisible = false;
this.getList()
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
getList() {
this.msg.EmployeeId = this.getLocalStorage().EmployeeId;
this.msg.FolderName = this.srearchKey ;
this.apipost('user_cloud_GetFolderList', this.msg, res => {
if(res.data.resultCode == 1) {
this.list = res.data.data.data
this.NavigationList = res.data.data.Navigation
this.isCkedAll = false
this.fileList = []
this.notFileList = []
this.allLength = res.data.data.data.length
this.WjjId = []
this.WjId = []
res.data.data.data.forEach(item => {
if(item.DataType == 0) {
this.WjjId.push(item.Id)
item.icons=this.loadFileICON('')
}
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)
}
})
}
}, err => {})
},
getNextLevel(id) {
this.addFileMsg.ParentId = id
this.msg.ParentId = id
this.srearchKey = ''
this.getList()
},
getTreeList() {
this.apipost('user_cloud_GetFolderTreeList', {}, res => {
if(res.data.resultCode == 1) {
this.fileTreeList = res.data.data
} else {}
}, err => {})
},
submitForm(addMsg) { //提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if(valid) {
this.addFiles()
} else {
return false;
}
});
},
closeChangeMachie(done) { //弹出框关闭初始化弹框内表单
done();
this.addFileMsg.FolderName = ''
},
doSearch()
{
this.getList();
},
moveCancel()
{
this.$refs.tree.setCheckedKeys([]);
this.outerVisible2=false;
}
},
mounted() {
let userInfo=this.getLocalStorage();
this.getList()
},
created(){
this.createCode()
}
}
</script> </script>
<style> <style>
.myDocumentShareDiv{ .myDocumentShareDiv {
max-height: 400px; max-height: 400px;
overflow: auto; overflow: auto;
} }
.myDocumentShareDiv::-webkit-scrollbar,.myDocumentShareTree::-webkit-scrollbar,.myDocumentShareObject::-webkit-scrollbar{
/*滚动条整体样式*/ .myDocumentShareDiv::-webkit-scrollbar,
width: 4px; .myDocumentShareTree::-webkit-scrollbar,
/*高宽分别对应横竖滚动条的尺寸*/ .myDocumentShareObject::-webkit-scrollbar {
height: 1px; /*滚动条整体样式*/
} width: 4px;
.myDocumentShareDiv::-webkit-scrollbar-thumb,.myDocumentShareTree::-webkit-scrollbar-thumb,.myDocumentShareObject::-webkit-scrollbar-thumb{ /*高宽分别对应横竖滚动条的尺寸*/
/*滚动条里面小方块*/ height: 1px;
border-radius: 4px; }
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
background: #c9c9c9; .myDocumentShareDiv::-webkit-scrollbar-thumb,
} .myDocumentShareTree::-webkit-scrollbar-thumb,
.myDocumentShareDiv::-webkit-scrollbar-track,.myDocumentShareTree::-webkit-scrollbar-track,.myDocumentShareObject::-webkit-scrollbar-track{ .myDocumentShareObject::-webkit-scrollbar-thumb {
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2); /*滚动条里面小方块*/
border-radius: 4px; border-radius: 4px;
background: #EDEDED; -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
} background: #c9c9c9;
.myDocumentShareTree{ }
float: left;
padding:10px; .myDocumentShareDiv::-webkit-scrollbar-track,
width: 400px; .myDocumentShareTree::-webkit-scrollbar-track,
max-height: 400px; .myDocumentShareObject::-webkit-scrollbar-track {
overflow: auto; -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
border-right: 1px solid #f9f9f9; border-radius: 4px;
} background: #EDEDED;
.myDocumentShareObject{ }
padding: 10px;
width: 380px; .myDocumentShareTree {
max-height: 400px; float: left;
overflow: auto; padding: 10px;
float: left; width: 400px;
} max-height: 400px;
.myDocumentShareObject li{ overflow: auto;
height: 24px; border-right: 1px solid #f9f9f9;
line-height: 24px; }
width: 100%;
} .myDocumentShareObject {
.myDocumentShareObject li:hover{ padding: 10px;
background: #f9f9f9; width: 380px;
} max-height: 400px;
.myDocumentShareObject li i{ overflow: auto;
float: right; float: left;
cursor: pointer; }
margin: 5px 0;
} .myDocumentShareObject li {
.myDocumentsNav { height: 24px;
margin: 25px 0; line-height: 24px;
} width: 100%;
.myDocumentsTable input[type='checkbox']{ }
vertical-align: sub;
} .myDocumentShareObject li:hover {
background: #f9f9f9;
}
.myDocumentShareObject li i {
float: right;
cursor: pointer;
margin: 5px 0;
}
.myDocumentsNav {
margin: 25px 0;
}
.myDocumentsTable input[type='checkbox'] {
vertical-align: sub;
}
.myDocumentsTable td,
.myDocumentsTable th {
text-align: left !important;
padding-left: 15px;
}
.myDocumentsTable td, .myDocumentsLink {
.myDocumentsTable th { margin: 25px 0;
text-align: left!important; }
padding-left: 15px;
}
.myDocumentsLink { .myDocumentsLink>span {
margin: 25px 0; font-size: 12px;
} cursor: pointer;
color: #E95252;
}
.myDocumentsLink>span { .myDocumentsLink>span:not(:last-of-type):hover {
font-size: 12px; text-decoration: underline;
cursor: pointer; }
color: #E95252;
}
.myDocumentsLink>span:not(:last-of-type):hover { .myDocumentsLink>span:not(:last-of-type):after {
text-decoration: underline; content: '>';
} margin: 0 3px;
color: #E95252;
pointer-events: none;
}
.myDocumentsLink>span:not(:last-of-type):after { .myDocumentsLink>span:last-child {
content: '>'; color: #666;
margin: 0 3px; cursor: default;
color: #E95252; }
pointer-events: none;
}
.myDocumentsLink>span:last-child { .myDocumentUploadBtn {
color: #666; float: left;
cursor: default; margin-right: 10px;
} }
.myDocumentUploadBtn { .shareDocumentDialog .el-dialog__body {
float: left; padding: 0 !important;
margin-right: 10px; }
}
.shareDocumentDialog .el-dialog__body { .documentDialogNav {
padding: 0!important; background: #E95252;
} height: 45px;
}
.documentDialogNav { .documentDialogNav>div {
background: #E95252; display: inline-block;
height: 45px; color: #fff;
} width: 90px;
height: 26px;
margin-left: 20px;
position: relative;
border-radius: 13px;
background: rgba(0, 0, 0, .2);
text-align: center;
cursor: pointer;
}
.documentDialogNav>div { .documentDialogNav>div .checkIcon {
display: inline-block; width: 0;
color: #fff; height: 0;
width: 90px; border-width: 0 5px 5px;
height: 26px; position: absolute;
margin-left: 20px; left: 40px;
position: relative; top: 40px;
border-radius: 13px; border-style: solid;
background: rgba(0, 0, 0, .2); border-color: transparent transparent #fff;
text-align: center; /*透明 透明 灰*/
cursor: pointer; }
}
.documentDialogNav>div .checkIcon { .DocumentLoadVerification {
width: 0; width: 120px;
height: 0; height: 30px;
border-width: 0 5px 5px; border-radius: 4px;
position: absolute; letter-spacing: 5px;
left: 40px; border: none;
top: 40px; background: #f56c6c;
border-style: solid; color: #eee;
border-color: transparent transparent #fff; cursor: pointer;
/*透明 透明 灰*/ }
}
.DocumentLoadVerification{
width: 120px; height: 30px;
border-radius: 4px;
letter-spacing: 5px;
border:none; background: #f56c6c;
color: #eee;
cursor: pointer;
}
</style> </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