提交 754d8b06 authored 作者: 翟畅's avatar 翟畅

zc推荐内容展示、删除目录、资源修改激活状态

上级 37cf94b9
......@@ -160,3 +160,12 @@ export function authorPreviewBookList(params) { //作者预览相关著作
})
}
export function editActivationStatusAPI(data) { //推荐内容--资源是否需激活
return request({
url: `${requestPath.resource}/resource/batch/update/activation`,
method: 'post',
data
})
}
......@@ -85,8 +85,6 @@ export default {
case '11': this.$route.meta.activeMenu = '/resource_manage/audio_book'
break;
}
console.log(this.$route.meta.activeMenu,'$route.meta.activeMenu')
console.log(this.activeMenu,'activeMenu')
}
},
watch:{
......
......@@ -260,7 +260,9 @@ import store from '@/store'
}
})
},0)
},
activated(){
this.getList()
},
methods: {
lockTags(){
......
......@@ -304,6 +304,9 @@ import QRCode from "qrcodejs2";
})
},0)
},
activated(){
this.getList()
},
methods: {
lockTags(){
let view = this.$store.state.tagsView.visitedViews.find(item => {
......
......@@ -250,7 +250,9 @@ import searchDia from "@/components/dialog/searchTips";
}
})
},0)
},
activated(){
this.getList()
},
methods: {
lockTags(){
......
......@@ -11,6 +11,9 @@
@node-click="handleNodeClick">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span :class="currentCode == data.code?'selectNodeStyle':'normalNodeStyle'" :title="node.label">{{ node.label }}</span>
<span>
<i class="el-icon-delete" @click="removeCatalog(node, data)" v-if="node.label != '所有目录'"></i>
</span>
</span>
</el-tree>
</div>
......@@ -20,7 +23,7 @@
<div class="back_box" @click="goBack()" v-if="this.$route.query.id">
<img src="@/assets/img/common/back.png"><span>返回</span>
</div>
<el-button class="mr10" size="small" type='primary' v-for="(item,index) in topBtn" :key="index" @click="handleBtn(item.url)">{{item.name}}</el-button>
<el-button class="mr10" size="small" type='primary' v-for="(item,index) in topBtn" :key="index" @click="handleBtn(item.url)" v-if="(item.url != 'editActivateBtn' || activation == 1)">{{item.name}}</el-button>
</div>
<el-table ref="table" class="table_box" v-loading="listLoading" :data="dataList" style="width: 100%" size="mini" @selection-change="selectionChange" highlight-current-row @filter-change="filterChange">
<el-table-column type="selection" ref="selectionCheckbox" width="50" align="center"></el-table-column>
......@@ -49,6 +52,12 @@
<span v-if="scope.row.resourceType == 12">附件</span>
</template>
</el-table-column>
<el-table-column prop="activation" label="是否需激活" align="center" min-width="10%">
<template slot-scope="scope">
<span v-if="scope.row.activation == '2'"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="18%" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" v-for="(item,index) in lineBtn" @click="handleBtn(item.url,scope.row)" v-if="(item.url != 'removeLine' || scope.row.status == 0) && (item.url != 'videoPlayingLine' || scope.row.resourceType == 5)" :key="index">{{item.name}}</el-button>
......@@ -113,12 +122,25 @@
<el-button @click="videoPlayingDialog = false">关 闭</el-button>
</span>
</el-dialog>
<!-- 批量修改需激活状态 -->
<el-dialog title="修改需激活状态" :visible.sync="editActivateDialog" width="450px" @open="openActivateDialog()">
<span style="padding-right:30px;">是否需激活:</span>
<el-radio-group v-model="activateStatus">
<el-radio :label="'1'"></el-radio>
<el-radio :label="'2'"></el-radio>
</el-radio-group>
<div slot="footer" class="dialog-footer" align="center">
<el-button @click="editActivateDialog = false">取消</el-button>
<el-button type="primary" @click="activateSubmit">确定</el-button>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { recommendListAPI, authorUpdateSortAPI, authorUpdateCodeAPI, authorRecDelAPI, getAllModulesAPI } from '@/api/resource/author'
import { recommendListAPI, authorUpdateSortAPI, authorUpdateCodeAPI, authorRecDelAPI, getAllModulesAPI, deleteModuleAPI, editActivationStatusAPI } from '@/api/resource/author'
import { confirm } from '@/utils/function'
import { getSelectionIds } from '@/filters/getIds'
import { sortValidate } from '@/utils/validate'
......@@ -153,7 +175,7 @@ export default {
resourceType: '',
pageNum: 1,
pageSize: 50,
code:null,
code:'1',
},
updateRelationForm:{
ids:[]
......@@ -179,7 +201,7 @@ export default {
},
moduleData: [],
catalogValue:null,
currentCode:null,
currentCode:'1',
moduleIsShow:'所有目录',
defaultProps: {
children: 'list',
......@@ -195,6 +217,8 @@ export default {
editCatalogDialog:null,
videoPlayingDialog:false,
videoLinkData:{},
editActivateDialog:false,
activateStatus:'1',
}
},
created() {
......@@ -233,9 +257,8 @@ export default {
this.$router.go(0)
},
handleNodeClick(data) {
console.log(data,'00000')
this.currentCode = data.code
this.listQuery.code = data.code
this.currentCode = data.code?data.code:'1'
this.listQuery.code = data.code?data.code:'1'
this.moduleIsShow = data.showName
this.getList()
},
......@@ -318,9 +341,48 @@ export default {
'videoPlayingLine':() => {
this.videoPlayingNow(item)
},
'editActivateBtn':() => {
this.editActivateEvent()
},
}
status[btnName]()
},
openActivateDialog(){
this.activateStatus = '1'
},
// 修改激活状态
editActivateEvent(){
if(this.activation == 1){
if (this.isExist(this.chooiceList)) { //至少选中一条
this.editActivateDialog = true
}
}else{
this.$message.warning('该图书为需激活状态时才支持此功能')
}
},
activateSubmit(){
this.chooiceList.forEach((item,index) => {
item.id = item.id.toString()
})
let ids = getSelectionIds(this.chooiceList)
let phyId = this.$route.query.id
let code = this.catalogValue
let data = {
ids:ids,
activation:this.activateStatus,
phyBookId:phyId,
}
editActivationStatusAPI(data).then((res) => {
if(res.data.code == 0){
this.$message.success('修改激活状态成功')
this.editActivateDialog = false
this.getList()
}else{
this.$message.error('修改激活状态失败')
this.editActivateDialog = false
}
})
},
videoPlayingNow(item){
if(item.path){
this.videoLinkData = item
......@@ -505,7 +567,21 @@ export default {
this.listQuery.pageNum = val
this.getList()
},
removeCatalog(node, data) {
confirm.apply(this,['该目录及子目录都会被删除,并且该目录下关联的相关资源均会被删除,确定要删除吗?']).then(() => {
let dataNow = data.code.toString()
deleteModuleAPI(dataNow).then(res =>{
if(res.data.code == 0){
this.$message.success('删除成功');
this.getAllModule()
this.$emit('saveContent')
this.$emit('close')
}else{
this.$message.error(res.data.msg);
}
})
});
},
}
}
</script>
......@@ -586,6 +662,7 @@ export default {
width: 79%;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: nowrap;
overflow: hidden;
}
......
......@@ -269,6 +269,9 @@ export default {
})
},0)
},
activated(){
this.getList()
},
methods: {
lockTags(){
let view = this.$store.state.tagsView.visitedViews.find(item => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论