Commit eddc58b7 authored by fangshupeng's avatar fangshupeng

一部分

parent 6be27dcf
......@@ -2,10 +2,12 @@ import loginApi from './loginApi.js' // 登录
import aliOssApi from './aliOssApi' // ali-oss
import commonApi from './commonApi' // 公共接口
import education from './education' // 教务管理
import schoolBasedResourcesApi from './schoolBasedResourcesApi' // 校本资源管理API
export default {
loginApi,
aliOssApi,
commonApi,
...education
...education,
schoolBasedResourcesApi
}
import http from '@/request/http.js'
export default {
// 获取学校文件夹和个人文件夹List
GetFolderList () {
return http.get('/api/Education/SchoolResource/MyResource/GetFolderList')
},
// 获取我的收藏分享列表
GetCollectShareList (params) {
return http.post('/api/Education/SchoolResource/MyResource/GetCollectShareList', JSON.stringify(params))
},
// 获取我管理的文件夹
GetMyManageFolderList () {
return http.get('/api/Education/SchoolResource/MyResource/GetMyManageFolderList')
},
// 获取我管理的常规文件夹资料列表
GetMyManageRoutineFolderList (params) {
return http.post('/api/Education/SchoolResource/MyResource/GetMyManageRoutineFolderList', JSON.stringify(params))
},
// 获取我管理的任务文件夹资料列表
GetMyManageTaskFolderList (params) {
return http.post('/api/Education/SchoolResource/MyResource/GetMyManageTaskFolderList', JSON.stringify(params))
},
// 获取资料列表某人下的文件信息
GetMyManageFileInfo (params) {
return http.post('/api/Education/SchoolResource/MyResource/GetMyManageFileInfo', JSON.stringify(params))
},
// 获取文档列表
GetFileList (params) {
return http.post('/api/Education/SchoolResource/GetFileList', JSON.stringify(params))
}
}
......@@ -4,10 +4,10 @@
<div class="leftNav">
<span class="type-title">类型:</span>
<el-radio-group v-model="folderType" size="small" @change="folderTypeChange">
<el-radio-button label="all">全部</el-radio-button>
<el-radio-button label="myFavor">我收藏的</el-radio-button>
<el-radio-button label="myShare">我分享的</el-radio-button>
<el-radio-button label="shareMe">分享给我的</el-radio-button>
<el-radio-button :label="0">全部</el-radio-button>
<el-radio-button :label="1">我收藏的</el-radio-button>
<el-radio-button :label="2">我分享的</el-radio-button>
<el-radio-button :label="3">分享给我的</el-radio-button>
</el-radio-group>
</div>
<div class="rightNav">
......@@ -27,6 +27,7 @@
<div class="smallCtn">
<small-folder
:file-list="currentFileList"
:mode="'favor'"
@showMenu="showMenu"
@tableIntoFile="intoFolder">
</small-folder>
......@@ -62,7 +63,7 @@ export default {
},
data () {
return {
folderType: 'all', // 文件类型(文件类型(all: 全部,myFavor: 我收藏的,myShare: 我分享的, shareMe: 分享给我的 ))
folderType: 0, // 文件类型(文件类型(0: 全部,1: 我收藏的,2: 我分享的, 3: 分享给我的 ))
timeSelect: 'allItem', // 学期选择框数据
menuMode: '', // 菜单根据模式显示对于内容
menuVisible: false, // 右键菜单栏
......@@ -77,70 +78,84 @@ export default {
label: '全部学期'
}],
currentFileList: [],
fileListData: [
{
id: 1201,
name: '我收藏的.docx',
typeName: '我收藏的',
type: 'myFavor',
icon: 'el-icon-document',
descript: '我上传了10个文档',
isFocus: false,
isFolder: false,
nextIsFolder: false,
uploadCount: '10',
author: '张三',
updateTime: '2020-08-22 12:00'
},
{
id: 1202,
name: '我分享的.docx',
typeName: '我分享的',
type: 'myShare',
icon: 'el-icon-document',
descript: '我上传了10个文档',
isFocus: false,
isFolder: false,
nextIsFolder: false,
uploadCount: '10',
author: '张三',
updateTime: '2020-08-22 12:00'
},
{
id: 1203,
name: '分享给我的.docx',
typeName: '分享给我的',
type: 'shareMe',
icon: 'el-icon-document',
descript: '我上传了10个文档',
isFocus: false,
isFolder: false,
nextIsFolder: false,
uploadCount: '10',
author: '张三',
updateTime: '2020-08-22 12:00'
}
]
fileListData: []
// {
// id: 1201,
// name: '我收藏的.docx',
// typeName: '我收藏的',
// type: 'myFavor',
// icon: 'el-icon-document',
// descript: '我上传了10个文档',
// isFocus: false,
// isFolder: false,
// nextIsFolder: false,
// uploadCount: '10',
// author: '张三',
// updateTime: '2020-08-22 12:00'
// },
// {
// id: 1202,
// name: '我分享的.docx',
// typeName: '我分享的',
// type: 'myShare',
// icon: 'el-icon-document',
// descript: '我上传了10个文档',
// isFocus: false,
// isFolder: false,
// nextIsFolder: false,
// uploadCount: '10',
// author: '张三',
// updateTime: '2020-08-22 12:00'
// },
// {
// id: 1203,
// name: '分享给我的.docx',
// typeName: '分享给我的',
// type: 'shareMe',
// icon: 'el-icon-document',
// descript: '我上传了10个文档',
// isFocus: false,
// isFolder: false,
// nextIsFolder: false,
// uploadCount: '10',
// author: '张三',
// updateTime: '2020-08-22 12:00'
// }
}
},
mounted () {
this.folderType = 'all'
this.currentFileList = this.fileListData
this.folderType = 0
// this.currentFileList = this.fileListData
this.getFileList(this.folderType)
},
methods: {
folderTypeChange (value) {
if (value === 'all') {
this.currentFileList = this.fileListData
} else {
let fileList = []
for (let i = 0; i < this.fileListData.length; i++) {
if (this.fileListData[i].type === value) {
fileList.push(this.fileListData[i])
}
}
this.currentFileList = fileList
getFileList (folderType) {
/* 获取文档列表 */
let data = {
data: { sel_type: folderType },
PageSize: 50,
PageNumber: 1
}
this.$api.schoolBasedResourcesApi.GetCollectShareList(data).then(res => {
this.$handleResponse(res).then(data => {
this.currentFileList = data.Data
})
})
},
folderTypeChange (value) {
this.getFileList(value)
// if (value === 'all') {
// this.currentFileList = this.fileListData
// } else {
// let fileList = []
// for (let i = 0; i < this.fileListData.length; i++) {
// if (this.fileListData[i].type === value) {
// fileList.push(this.fileListData[i])
// }
// }
// this.currentFileList = fileList
// }
},
intoFolder (file) {
/* 打开文件 */
......
......@@ -2,7 +2,9 @@
<div class="container">
<v-header :title="'我的资源'" :is-show-prev-page="isShowPrevPage"></v-header>
<nav-menu :menus="menus"></nav-menu>
<keep-alive>
<router-view></router-view>
</keep-alive>
</div>
</template>
......@@ -39,17 +41,8 @@ export default {
]
}
},
methods: {
initDataFromRoute (route) {
/* 根据路由参数来显示对应数据 */
if (route.query.folderName) { // 有参数说明不是首页,显示返回上一页
this.isShowPrevPage = true
} else {
this.isShowPrevPage = false
}
}
},
mounted () {
this.getFolderList()
},
created () {
this.initDataFromRoute(this.$route)
......@@ -58,6 +51,23 @@ export default {
$route (to, from) {
this.initDataFromRoute(to)
}
},
methods: {
getFolderList () {
this.$api.schoolBasedResourcesApi.GetFolderList().then(res => {
this.$handleResponse(res).then(data => {
console.log(data)
})
})
},
initDataFromRoute (route) {
/* 根据路由参数来显示对应数据 */
if (route.query.parent_id) { // 有参数说明不是首页,显示返回上一页
this.isShowPrevPage = true
} else {
this.isShowPrevPage = false
}
}
}
}
</script>
......
......@@ -9,10 +9,11 @@
@dragleave.stop.prevent="borderHover = false"
@dragover.stop.prevent="borderHover = true"
@drop.stop.prevent="fileDrop($event,file)">
<div class="types">{{ file.typeName }}</div>
<i :class="file.icon" class="file-icon"></i>
<h4 class="folder-name">{{ file.name }}</h4>
<h6 class="descript">{{ file.descript }}</h6>
<div class="types">{{ foderTypeOptions[file.folder_type]}}</div>
<i :class="fileIcon" class="file-icon"></i>
<h4 class="folder-name">{{ file.folder_name }}</h4>
<h6 class="descript" v-if="descriptType === 1">{{ '我管理的:共有' + file.file_count + '个文档' }}</h6>
<h6 class="descript" v-else>{{ '我上传了' + file.file_count + '个文档' }}</h6>
</div>
</div>
</div>
......@@ -27,6 +28,26 @@ export default {
default: () => {
return []
}
},
foderType: {
type: Number,
default: 1
},
fileIcon: {
type: String,
default: 'el-icon-folder'
},
descriptType: { // 文件描述用那种类型
type: Number,
default: 1
}
},
computed: {
foderTypeOptions () {
/* 根据foderType来判断显示哪种options */
const schoolType = { 1: '学校文件夹', 2: '个人文件夹' }
const taskType = { 1: '常规文件夹', 2: '任务文件夹' }
return this.foderType === 1 ? schoolType : taskType
}
},
data () {
......
<template>
<div class="main">
<div class="headerNav">
<div class="leftNav">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item
v-for="(breadcrumbItem, index) of breadcrumb"
:key="index"
@click.native="backCrumb(index)">
{{ breadcrumbItem }}
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="rightNav">
<el-select class="timer-select" v-model="timeSelect" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
<div class="container">
<div class="left-menu">
<div class="menu-header">上传人员列表(30人)</div>
<div class="menu-header">上传人员列表({{ listData.length }}人)</div>
<div class="search-header">
<el-input v-model="searchData" placeholder="请输入..."></el-input>
<el-button class="search-btn" type="primary" plain>搜索</el-button>
......@@ -32,27 +10,31 @@
<div class="upload-list">
<el-menu
default-active="1"
class="el-menu-vertical-demo">
class="el-menu-vertical-demo"
@open="listOpen">
<el-submenu
v-for="(item, index) of 11"
v-for="(item, index) of listData"
:key="index"
:index="String(index+1)">
:index="String(index + 1)">
<template slot="title">
<div class="menus-title">
<span>某某某</span>
<span class="upload-count" v-show="!taskMode">2</span>
<span>{{ item.user_name }}</span>
<span class="upload-count" v-show="!taskMode">{{ item.total_count }}</span>
<div class="progress-ctn" v-show="taskMode">
<el-progress :percentage="50" :format="format"></el-progress>
<div style="flex: 1;margin-top: 7px;">
<el-progress :show-text="false" :percentage="item.upload_count / item.total_count"></el-progress>
</div>
<div style="margin: -13px 7px 0 10px">{{ item.upload_count }} / {{ item.total_count }}</div>
</div>
</div>
</template>
<el-menu-item-group>
<el-menu-item
v-for="(innerItem, innerIndex) of 2"
v-for="(innerItem, innerIndex) of item.fileChildren"
:key="innerIndex"
:index="(index+1)+'-'+(innerIndex+1)"
@contextmenu.native.prevent.stop="showMenu($event,item)">
<span v-show="taskMode" class="point"></span>这是上传资料的标题,很长很长很长很长
<span v-show="taskMode" class="point"></span>{{ innerItem.file_name }}
</el-menu-item>
</el-menu-item-group>
</el-submenu>
......@@ -85,16 +67,21 @@
<script>
export default {
name: 'Material',
// props: {
// taskMode: { // 是否为任务文件夹
// type: Boolean,
// default: false
// }
// },
props: {
taskMode: { // 是否为任务文件夹
type: Boolean,
default: false
},
listData: {
type: Array,
default: () => {
return []
}
}
},
data () {
return {
searchData: '',
taskMode: false, // 是否为任务文件夹
menuVisible: false, // 右键菜单栏
breadcrumb: ['首页'], // 面包屑
options: [{
......@@ -109,47 +96,31 @@ export default {
}
},
methods: {
initDataFromRoute (route) {
/* 根据路由参数初始化数据 */
if (route.query.breadcrumb) {
this.breadcrumb = JSON.parse(route.query.breadcrumb)
this.taskMode = route.query.taskMode
}
},
backCrumb (index) {
/* 点击面包屑返回前几级 */
if (index < this.breadcrumb.length - 1) {
let backPageCount = index - this.breadcrumb.length + 1
this.$router.go(backPageCount)
}
},
showMenu (MouseEvent, item) {
/* 右键文件夹或文件时触发 */
console.log(item)
this.menuVisible = false
this.menuVisible = true
this.coordinate.menuX = MouseEvent.pageX + 5 + 'px'
this.coordinate.menuY = MouseEvent.pageY + 'px'
document.addEventListener('click', this.foo) // 给整个document添加监听鼠标事件,点击任何位置执行foo方法
},
listOpen (index) {
let listIndex = parseInt(index) - 1
this.$emit('getMaterialFile', listIndex)
},
foo () {
/* 取消鼠标监听事件 菜单栏 */
this.menuVisible = false
this.uploadVisible = false
document.removeEventListener('click', this.foo) // 关掉监听
},
format (percentage) {
format (item) {
console.log(1111111111111, item)
return '3/8'
}
},
mounted () {
},
created () {
this.initDataFromRoute(this.$route)
},
watch: {
$route (to, from) {
this.initDataFromRoute(to)
}
}
}
</script>
......@@ -239,6 +210,7 @@ export default {
.progress-ctn {
width:250px;
padding:13px 10px 0 15px;
display: flex;
}
}
......
......@@ -5,11 +5,11 @@
<ul class="menu">
<li class="menu_item padding_35" v-show="menuMode!=='blank'" @click="clickFile">打开</li>
<li class="menu_item padding_35" v-show="menuMode==='file'">下载</li>
<li class="menu_item" @click.prevent.stop="showUploadMenu" v-show="menuMode !== 'file' && menuMode !== 'blank' || (menuMode === 'blank' && rightMenuFolder[0].isFolder === false)"><span class="upload_line"><i class="el-icon-upload upload-icon"></i></span>上传材料</li>
<li class="menu_item" @click.prevent.stop="showUploadMenu" v-show="menuMode !== 'file' && menuMode !== 'blank' || (menuMode === 'blank' && currentIsFiLe)"><span class="upload_line"><i class="el-icon-upload upload-icon"></i></span>上传材料</li>
<li class="menu_item padding_35" v-show="menuMode === 'personal' || menuMode === 'file'" @click="renameVisible = true">重命名</li>
<li class="menu_item padding_35" v-show="menuMode === 'file'" @click="shareVisible = true">分享</li>
<li class="menu_item padding_35" v-show="menuMode === 'file'" @click="visible = true">分享</li>
<li class="menu_item padding_35" v-show="menuMode === 'personal' || menuMode === 'file'" @click="deleteVisible = true">删除</li>
<li class="menu_item" style="text-align:center" v-show="menuMode === 'blank' && rightMenuFolder[0].isFolder === true" @click="newFolderVisible = true">新建个人文件夹</li>
<li class="menu_item" style="text-align:center" v-show="menuMode === 'blank' && currentIsFiLe === false" @click="newFolderVisible = true">新建个人文件夹</li>
</ul>
</div>
......@@ -17,7 +17,7 @@
<div v-show="uploadVisible" id="upload_menu" :style="'left:'+coordinate.uploadX+';top:'+coordinate.uploadY">
<p class="upload_title">普通文档</p>
<ul class="upload_menu">
<li class="menu_item"><span class=" upload_line"><i class="el-icon-document document-icon"></i></span>本地上传</li>
<li class="menu_item"><span class="upload_line"><i class="el-icon-document document-icon"></i></span>本地上传</li>
</ul>
<p class="upload_title">腾讯文档</p>
<ul class="upload_menu">
......@@ -78,10 +78,16 @@
<el-button @click="shareVisible = false">取 消</el-button>
<el-button type="primary" @click="shareVisible = false">确 定</el-button>
</div>
<teacher-selector
<userselector
:mode="userSelector.mode"
:list="userSelector.list"
:visible.sync="visible"
@submit="selectUser"
/>
<!-- <teacher-selector
:teacherSelectorOptions="teacherSelectorOptions"
@closeTeacherSelector="teacherSelectorOptions.isBlock = false">
</teacher-selector>
</teacher-selector> -->
</el-dialog>
</div>
......@@ -95,6 +101,10 @@ export default {
type: Boolean,
default: false
},
currentIsFiLe: { // 当前层次是否为文档列表
type: Boolean,
default: false
},
uploadVisible: { // 上传菜单栏显示
type: Boolean,
default: false
......@@ -123,14 +133,17 @@ export default {
}
},
components: {
TeacherSelector: () => import('@/common/TeacherSelector')
// TeacherSelector: () => import('@/common/TeacherSelector')
userselector: () => import('@/common/userSelector/UserSelector')
},
data () {
return {
teacherSelectorOptions: {
isBlock: false,
isShow: true
userSelector: {
mode: 'teacherCheckbox',
list: [],
visible: false
},
visible: false,
renameVisible: false, // 重命名窗口
rename: '',
newFolderVisible: false, // 新建文件夹窗口
......@@ -155,6 +168,9 @@ export default {
clickFile () {
let file = this.rightMenuData
this.$emit('menuOpenFile', file)
},
selectUser (list) {
console.log(111111, list)
}
}
}
......
......@@ -12,19 +12,21 @@
width="260">
<template slot-scope="scope">
<div class="is-folder">
<i :class="scope.row.icon+' file-icon'"></i>
<span style="margin-left: 10px">{{ scope.row.name }}</span>
<i :class="currentIsFiLe?'el-icon-document': 'el-icon-folder'+' file-icon'"></i>
<span style="margin-left: 10px">{{ scope.row.file_name }}</span>
</div>
</template>
</el-table-column>
<el-table-column
v-if="fileList[0] && fileList[0].isFolder"
prop="typeName"
v-if="fileList[0] && !currentIsFiLe"
label="类型"
width="170">
<template slot-scope="scope">
{{ folderTypeOptions[scope.row.file_type] }}
</template>
</el-table-column>
<el-table-column
v-if="!manageMode && (fileList[0] && fileList[0].isFolder)"
v-if="mode != 'favor' && !currentIsFiLe"
prop="uploadCount"
label="我上传的数量"
width="170">
......@@ -42,12 +44,12 @@
width="150">
</el-table-column>
<el-table-column
prop="author"
prop="create_by"
label="创建人"
width="160">
</el-table-column>
<el-table-column
prop="updateTime"
prop="create_time"
label="创建时间"
min-width="220">
</el-table-column>
......@@ -71,11 +73,36 @@ export default {
return []
}
},
currentIsFiLe: {
type: Boolean,
default: false
},
mode: { // 模式:upload: 我上传的, favor: 分享收藏
type: String,
default: 'upload'
},
manageMode: { // 是否为我管理的页面使用
type: Boolean,
default: false
}
},
computed: {
folderTypeOptions () {
/* 根据foderType来判断显示哪种options */
const uploadType = { 1: '学校文件夹', 2: '个人文件夹' }
const favorType = { 1: '我收藏的', 2: '我分享的', 3: '分享给我的' }
let folderTypeOptions = {}
switch (this.mode) {
case 'upload':
folderTypeOptions = uploadType
break
case 'favor':
folderTypeOptions = favorType
break
}
return folderTypeOptions
}
},
data () {
return {
}
......@@ -84,7 +111,7 @@ export default {
contextMenu (row, column, event) {
event.stopPropagation()
event.preventDefault()
this.$emit('showMenu', event, row.type, row)
this.$emit('showMenu', event, this.currentIsFiLe, row)
},
dblclick (row, column, event) {
this.$emit('tableIntoFile', row)
......
......@@ -227,7 +227,7 @@ export default {
font-size: 18px;
.el-breadcrumb {
font-size: 18px;
font-size: 15px;
line-height: 45px;
.el-breadcrumb__item {
&:not(:last-child) .el-breadcrumb__inner{
......
......@@ -19,18 +19,18 @@ const MY_RESOURCES = [
{ // 收藏分享
path: '/education/myResources/favorShare',
name: 'favorShare',
component: resolve => require(['pages/education/schoolBasedResources/myResources/FavorShare'], resolve),
component: resolve => require(['pages/education/schoolBasedResources/myResources/FavorShare'], resolve)
},
{ // 我管理的
path: '/education/myResources/myManage',
name: 'myManage',
component: resolve => require(['pages/education/schoolBasedResources/myResources/MyManage'], resolve)
},
{ // 我管理的-资料列表
path: '/education/myResources/myManage/material',
name: 'material',
component: resolve => require(['pages/education/schoolBasedResources/myResources/Material'], resolve)
}
// { // 我管理的-资料列表
// path: '/education/myResources/myManage/material',
// name: 'material',
// component: resolve => require(['pages/education/schoolBasedResources/myResources/Material'], resolve)
// }
]
}
]
......@@ -46,7 +46,7 @@ const SCHOOL_RESOURCES = [
{ // 校内资源
path: '/education/schoolResources/index',
name: 'myUpload',
component: resolve => require(['pages/education/schoolBasedResources/schoolResources/ResourcesInSchoold'], resolve),
component: resolve => require(['pages/education/schoolBasedResources/schoolResources/ResourcesInSchoold'], resolve)
}
]
}
......
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