Commit 7d4012e4 authored by fangshupeng's avatar fangshupeng

更新进度

parent 33a312be
...@@ -51,18 +51,26 @@ export default { ...@@ -51,18 +51,26 @@ export default {
}, },
// 修改文件名称 // 修改文件名称
updateFileName (params) { updateFileName (params) {
return http.post('/api/Education/SchoolResource/FileInfo/UpdateFileName', { params: params }) return http.get('/api/Education/SchoolResource/FileInfo/UpdateFileName', { params: params })
}, },
// 获取学校文件夹List // 获取学校文件夹List
GetSchoolFolderList () { GetSchoolFolderList () {
return http.post('/api/Education/SchoolResource/SchoolFolderInfo/GetSchoolFolderList') return http.get('/api/Education/SchoolResource/SchoolFolderInfo/GetSchoolFolderList')
}, },
// 新增编辑学校文件夹 // 新增编辑学校文件夹
createOrUpdateSchool (params) { createOrUpdateSchool (params) {
return http.post('/api/Education/SchoolResource/SchoolFolderInfo/CreateOrUpdate', { params: params }) return http.post('/api/Education/SchoolResource/SchoolFolderInfo/CreateOrUpdate', JSON.stringify(params))
}, },
// 获取校内资源文件夹List // 获取校内资源文件夹List
getSchoolResourceFolderList () { getSchoolResourceFolderList () {
return http.post('/api/Education/SchoolResource/GetFolderList') return http.get('/api/Education/SchoolResource/GetFolderList')
},
// 删除学校文件夹
deleteSchoolFolder (params) {
return http.get('/api/Education/SchoolResource/SchoolFolderInfo/Delete', { params: params })
},
// 获取学校文件夹对象
getSchoolFolderInfo (params) {
return http.get('/api/Education/SchoolResource/SchoolFolderInfo/Get', { params: params })
} }
} }
...@@ -32,11 +32,21 @@ ...@@ -32,11 +32,21 @@
ref="contextMenu" ref="contextMenu"
:menuVisible="menuVisible" :menuVisible="menuVisible"
:rightMenuData="rightMenuData" :rightMenuData="rightMenuData"
:currentIsFiLe="currentIsFiLe"
:coordinate="coordinate" :coordinate="coordinate"
:menuMode="menuMode" :menuMode="menuMode"
@menuOpenFile="intoFolder" @menuOpenFile="intoFolder"
@createOrUpdateFolder="createOrUpdateFolder"> @createOrUpdateFolder="createOrUpdateFolder"
@handleDeleteFolder="handleDeleteSchoolFolder">
</manage-ctx-menu> </manage-ctx-menu>
<!-- 侧滑块查看普通文档 -->
<el-drawer
title="查看"
:visible.sync="documentDrawer"
:size="'80%'">
<iframe :src="documentUrl" width="100%" height= "100%" name="topFrame" noresize="noresize" frameborder="0" id="topFrame"></iframe>
</el-drawer>
<button v-show="false" ref="btn" @click="currentIsFiLe = true">设置当前页面为文件模式</button> <button v-show="false" ref="btn" @click="currentIsFiLe = true">设置当前页面为文件模式</button>
</div> </div>
</template> </template>
...@@ -61,6 +71,8 @@ export default { ...@@ -61,6 +71,8 @@ export default {
}, },
breadcrumb: [], breadcrumb: [],
currentFileList: [], currentFileList: [],
documentUrl: '', // 文档在线地址
documentDrawer: false, // 查看文档抽屉
paginationQuery: { // 分页信息 paginationQuery: { // 分页信息
amount: 0, amount: 0,
pageSize: 50, pageSize: 50,
...@@ -147,13 +159,12 @@ export default { ...@@ -147,13 +159,12 @@ export default {
breadcrumb.push({ label: file.folder_name, listData: file.children, parent: file, currentIsFiLe }) breadcrumb.push({ label: file.folder_name, listData: file.children, parent: file, currentIsFiLe })
}, },
intoFolder (file) { intoFolder (file) {
/* 进入下一级文件夹 */
/* 进入下一级文件夹 */ /* 进入下一级文件夹 */
if ((file.children && file.children.length > 0 && this.currentIsFiLe === false) || (file.file_count === 0 && this.breadcrumb.length < 3)) { if ((file.children && file.children.length > 0 && this.currentIsFiLe === false) || (file.file_count === 0 && this.breadcrumb.length < 3)) {
// 进入文件夹 // 进入文件夹
this.currentIsFiLe = false this.currentIsFiLe = false
this.addCrumb(this.breadcrumb, file, this.currentIsFiLe) this.addCrumb(this.breadcrumb, file, this.currentIsFiLe)
this.currentFileList = file.children this.currentFileList = file.children || []
} else { } else {
// 获取当前文件夹的文档列表 // 获取当前文件夹的文档列表
if (this.currentIsFiLe === false) { if (this.currentIsFiLe === false) {
...@@ -175,7 +186,24 @@ export default { ...@@ -175,7 +186,24 @@ export default {
message: '操作成功', message: '操作成功',
type: 'success' type: 'success'
}) })
this.$refs.contextMenu.userSelector.visible = false this.$refs.contextMenu.newFolderVisible = false
this.getFolderList()
} else {
this.$message({
message: res.data.ResponseError.LongMessage,
type: 'error'
})
}
})
},
handleDeleteSchoolFolder (params) {
this.$api.schoolBasedResourcesApi.deleteSchoolFolder(params).then(res => {
if (res.data.Status === true) {
this.$message({
message: '删除成功',
type: 'success'
})
this.$refs.contextMenu.deleteVisible = false
this.getFolderList() this.getFolderList()
} else { } else {
this.$message({ this.$message({
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<div v-show="menuVisible" id="menu" :style="'left:'+coordinate.menuX+';top:'+coordinate.menuY"> <div v-show="menuVisible" id="menu" :style="'left:'+coordinate.menuX+';top:'+coordinate.menuY">
<ul class="menu" style="width:120px"> <ul class="menu" style="width:120px">
<li class="menu_item padding_35" v-show="menuMode !== 'blank'" @click="clickFile">打开</li> <li class="menu_item padding_35" v-show="menuMode !== 'blank'" @click="clickFile">打开</li>
<li class="menu_item padding_35" v-show="menuMode !== 'blank'">编辑</li> <li class="menu_item padding_35" v-show="menuMode !== 'blank' && !currentIsFiLe" @click="handleEdit">编辑</li>
<li class="menu_item padding_35" v-show="menuMode !== 'blank'" @click="deleteVisible = true">删除</li> <li class="menu_item padding_35" v-show="menuMode !== 'blank' && !currentIsFiLe" @click="deleteVisible = true">删除</li>
<li class="menu_item" style="text-align:center" v-show="menuMode === 'blank' && !currentIsFiLe" @click="newFolderVisible = true">新建文件夹</li> <li class="menu_item" style="text-align:center" v-show="menuMode === 'blank' && !currentIsFiLe" @click="newFolderVisible = true">新建文件夹</li>
</ul> </ul>
<!-- <ul class="menu" style='width:230px' v-show="menuMode === 'blank' && currentIsFiLe"> <!-- <ul class="menu" style='width:230px' v-show="menuMode === 'blank' && currentIsFiLe">
...@@ -95,10 +95,10 @@ ...@@ -95,10 +95,10 @@
<!-- 删除文件窗口 --> <!-- 删除文件窗口 -->
<el-dialog title="删除确认" :visible.sync="deleteVisible" width="500px"> <el-dialog title="删除确认" :visible.sync="deleteVisible" width="500px">
<h3>删除后不可恢复,确定删除吗?</h3> <h3>删除文件夹同时会将文件夹下的所有资源全部删除,请谨慎操作!</h3>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="deleteVisible = false">取 消</el-button> <el-button @click="deleteVisible = false">取 消</el-button>
<el-button type="primary" @click="deleteVisible = false">确 定</el-button> <el-button type="primary" @click="handleDelete">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<userselector <userselector
...@@ -218,6 +218,14 @@ export default { ...@@ -218,6 +218,14 @@ export default {
selectUser (list) { selectUser (list) {
this.ruleForm[this.seletorListName] = list this.ruleForm[this.seletorListName] = list
}, },
handleEdit () {
let params = { b_id: this.rightMenuData.b_id }
this.$api.schoolBasedResourcesApi.getSchoolFolderInfo(params).then(res => {
this.$handleResponse(res).then(data => {
console.log(data)
})
})
},
hanlderCreateOrUpdate (formName) { hanlderCreateOrUpdate (formName) {
/* 新建或修改学校文件夹 */ /* 新建或修改学校文件夹 */
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
...@@ -268,6 +276,16 @@ export default { ...@@ -268,6 +276,16 @@ export default {
} }
} }
return data return data
},
handleDelete () {
/* 删除学校文件夹 */
let data = {}
if (!this.currentIsFiLe) {
data = {
b_id: this.rightMenuData.b_id
}
this.$emit('handleDeleteFolder', data)
}
} }
} }
} }
......
...@@ -229,7 +229,7 @@ export default { ...@@ -229,7 +229,7 @@ export default {
// 进入文件夹 // 进入文件夹
this.currentIsFiLe = false this.currentIsFiLe = false
this.addCrumb(this.breadcrumb, file, this.currentIsFiLe) this.addCrumb(this.breadcrumb, file, this.currentIsFiLe)
this.currentFileList = file.children this.currentFileList = file.children || []
} else { } else {
// 获取当前文件夹的文档列表 // 获取当前文件夹的文档列表
if (this.currentIsFiLe === false) { if (this.currentIsFiLe === false) {
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<!-- 删除文件窗口 --> <!-- 删除文件窗口 -->
<el-dialog title="删除确认" :visible.sync="deleteVisible" width="500px"> <el-dialog title="删除确认" :visible.sync="deleteVisible" width="500px">
<h3>删除后不可恢复,确定删除吗?</h3> <h3>删除文件夹同时会将文件夹下的所有资源全部删除,请谨慎操作!</h3>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="deleteVisible = false">取 消</el-button> <el-button @click="deleteVisible = false">取 消</el-button>
<el-button type="primary" @click="handleDelete">确 定</el-button> <el-button type="primary" @click="handleDelete">确 定</el-button>
......
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