提交 97a02ce7 authored 作者: 翟畅's avatar 翟畅

zc添加下载服务模块

上级 cbe5d954
......@@ -48,4 +48,13 @@ export function deleteCheckAPI(params) { //图书预览详情
method: 'get',
params
})
}
//文件删除
export function deleteFileAPI(data) {
return request({
url: `${requestPath.file}delete`,
method: 'post',
data
})
}
\ No newline at end of file
import request from '@/utils/request1'
import { requestPath } from '@/utils/global.js'
export function contactListAPI(params) { //联系信息列表
return request({
url: `${requestPath.common}/download/page`,
method: 'GET',
params
})
}
export function contactDeleteAPI(oid) { //删除
return request({
url: `${requestPath.common}/download/delete/${oid}`,
method: 'post',
})
}
export function contactSaveAPI(data) { //保存
return request({
url: `${requestPath.common}/download/save`,
method: 'post',
data
})
}
export function contactDetailAPI(oid) { //联系信息详情
return request({
url: `${requestPath.common}/download/${oid}`,
method: 'get'
})
}
export function contactMaxOrderNumAPI(params) { //查询最大排序号
return request({
url: `${requestPath.common}/download/maxOrderNum`,
method: 'get',
params
})
}
\ No newline at end of file
......@@ -120,6 +120,30 @@ const marketManageRouter = {
},
hidden: true
},
{
path: 'down_module',
component: () => import('@/views/marketing_manage/down_module/index'),
name: 'down_module',
meta: { title: '下载服务'}
},
{
path: 'createDown',
component: () => import('@/views/marketing_manage/down_module/create'),
name: 'createDown',
meta: {
title: '新建下载资源',noCache: true, activeMenu: `/marketing_manage/down_module`
},
hidden: true
},
{
path: 'editDown',
component: () => import('@/views/marketing_manage/down_module/edit'),
name: 'editDown',
meta: {
title: '编辑下载资源',noCache: true, activeMenu: `/marketing_manage/down_module`
},
hidden: true
},
]
}
......
......@@ -6,7 +6,7 @@
<div class="content">
<div class="left">
<div class="header">
<img :src="`${uploadUrl}?fileName=${data.userImg}&isOnLine=true`" v-if="data.userImg" class="avatar" >
<img :src="`${fileUrl}?fileName=${data.userImg}&isOnLine=true`" v-if="data.userImg" class="avatar" >
<img src="../../../assets/img/default.png" v-else>
</div>
<div class="name">{{data.userName}}</div>
......@@ -97,7 +97,7 @@
<script>
import Tinymce from '@/components/Tinymce'
import { uploadUrl, uploadPath, requestPath } from '@/utils/global.js'
import { fileUrl, uploadPath, requestPath } from '@/utils/global.js'
import queryString from 'query-string'
import { detailsAPI, setStatusAPI, deleteAPI, replayAPI, replayCheck } from '@/api/society-manage/resource'
import { requestMsg, confirm } from '@/utils/publicFunctions'
......@@ -130,7 +130,7 @@ export default {
}
},
created(){
this.uploadUrl = uploadUrl
this.uploadUrl = fileUrl
this.uploadPath = uploadPath
},
mounted() {
......
<template>
<div>
<edit></edit>
</div>
</template>
<script>
import edit from './component'
export default {
name:'createDown',
components:{
edit
}
}
</script>
\ No newline at end of file
<template>
<div>
<edit></edit>
</div>
</template>
<script>
import edit from './component'
export default {
name:'editDown',
components:{
edit
}
}
</script>
\ No newline at end of file
<template>
<div class="divBox currentDivBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-button class="mr10" size="small" type='primary' v-for="(item,index) in topBtn" :key="index" @click="handleBtn(item.url)">{{item.name}}</el-button>
</div>
<!-- 页面检索模块 -->
<el-form inline :model="listQuery" style="float:right;" size="small">
<el-form-item v-for="item in searchBox" :key="item.name" style="margin-bottom:0">
<el-input v-model="listQuery[item.name]" @keyup.enter.native="getList()"
:placeholder="item.placeholder" clearable>
</el-input>
</el-form-item>
<div class="search_btn" @click="getList()">
<img src="@/assets/img/common/ico-sousuo.png">
检索
</div>
</el-form>
<el-table ref="table" class="table_box" v-loading="listLoading" :data="dataList" style="width: 100%" size="mini" highlight-current-row>
<el-table-column prop="name" align="center" label="书目名称" min-width="15%"></el-table-column>
<el-table-column prop="fileName" align="center" label="书目文件名称" min-width="12%"></el-table-column>
<el-table-column prop="resourceType" align="center" label="资料类型" min-width="12%">
<template slot-scope="scope">
<!-- 资源类型 1:图书资源 2:书目 3:MAC数据 -->
<span v-if="scope.row.resourceType == '1'">图书资源</span>
<span v-if="scope.row.resourceType == '2'">书目</span>
<span v-if="scope.row.resourceType == '3'">MAC数据</span>
</template>
</el-table-column>
<el-table-column prop="size" align="center" label="文件大小" min-width="12%"></el-table-column>
<el-table-column prop="sort" align="center" label="排序号" min-width="12%"></el-table-column>
<el-table-column label="操作" min-width="15%" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" v-for="(item,index) in lineBtn" @click="handleBtn(item.url,scope.row.id,scope.row.file)" v-if="(item.url != 'removeLine' || scope.row.status == 0)" :key="index">{{item.name}}</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@size-change="sizeChange"
@current-change="currentChange"
:current-page="listQuery.pageNum"
:page-sizes="[30, 50, 100, 200]"
:page-size="listQuery.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
/>
</div>
</el-card>
</div>
</template>
<script>
import { contactListAPI, contactDeleteAPI, contactSaveAPI, contactDetailAPI, contactMaxOrderNumAPI } from "@/api/marketing/down";
import { confirm } from "@/utils/function";
import { deleteFileAPI } from '@/api/common'
import { getSelectionIds } from "@/filters/getIds";
import { pcUrl } from '@/utils/global'
export default {
name: 'down_module',
components: {
},
data() {
return {
topBtn:[],
lineBtn:[],
collapse: false,
classisyFlag:false,
dataList: [],
listQuery: {
pageNum: 1,
pageSize: 50,
orderBy:null,
name:null,
},
searchBox:[{name:'name',placeholder:'请输入书目名称'}],
total: null,
listLoading: false,
value: null,
chooiceList: [],
sortList: [],
inResize: true,
sending: null
}
},
mounted() {
window.addEventListener("click", this.clickOther);
this.getList();
setTimeout(() => {
let list = this.$store.state.btn.btnList;
list.forEach(item => {
if(item.type == 8){
this.topBtn.push(item)
}else if(item.type == 9 ){
this.lineBtn.push(item)
}
})
},0)
console.log(this.topBtn,'this.topBtn')
},
methods: {
clickOther(){
this.classisyFlag = false
this.collapse = false
},
handleBtn(btnName, id, file) {
let status = {
createBtn: () => { //新建
this.createdBook();
},
editLine: () => { //编辑
this.createdBook(id);
},
deleteLine: () => { //删除
this.removeData(id,file);
},
};
status[btnName]();
},
createdBook(id){
if(id){
this.$router.push({path:'/marketing_manage/editDown',query:{editId:id}})
}else{
this.$router.push({path:'/marketing_manage/createDown'})
}
},
sortChanged(column){
this.listQuery.orderBy = column.prop + (column.order == 'descending'?' desc' : '')
this.getList(1)
},
getList(num) {
//列表
this.listLoading = true;
this.listQuery.pageNum = num ? num : this.listQuery.pageNum
contactListAPI(this.listQuery).then(res => {
if (res.data.code === 0) {
this.dataList = res.data.data.list?res.data.data.list:[];
this.total = res.data.data.total?res.data.data.total:0;
} else {
this.$message.error("获取数据失败");
}
this.listLoading = false;
}).catch(res => {
this.listLoading = false
this.$message.error(res.msg)
});
},
removeData(id,fileName) {
//删除数据
let arr = [];
let file = [];
arr.push(id);
file.push(fileName);
confirm.apply(this, ["确定要删除选择的下载资源吗?"]).then(() => {
deleteFileAPI(file)
contactDeleteAPI(arr).then(res => {
if (res.data.code !== 0) {
this.$message.error(res.data.msg);
return;
}
this.$message.success("删除成功");
this.getList();
});
});
},
sizeChange(val) {
this.listQuery.pageSize = val;
this.getList();
},
currentChange(val) {
this.listQuery.pageNum = val;
this.getList();
},
}
}
</script>
<style scoped lang="scss">
@import '@/styles/top_common.scss';
.cover_img{
width: 28px;
height: 38px;
}
.currentDivBox{
/deep/.el-card__header{
border-bottom: 0;
}
}
</style>
<style>
.el-input-group__append, .el-input-group__prepend{
background: #fff !important;
border: none !important;
}
</style>
\ No newline at end of file
......@@ -32,7 +32,7 @@
</template>
<script>
import { contactListAPI, contactDeleteAPI, contactSaveAPI, contactDetailAPI, contactMaxOrderNumAPI } from "@/api/marketing/pirate";
import { contactListAPI, contactDeleteAPI, contactSaveAPI, contactDetailAPI } from "@/api/marketing/pirate";
import { fileUrl, pdfFileUrl, baseUrl } from '@/utils/global'
import { formatSort } from '@/utils/format'
import { valValidate, isbnValidate, fontValidate } from '@/utils/validate'
......@@ -117,11 +117,6 @@ export default {
}
})
},
getMaxSort() { //获取最大排序号
contactMaxOrderNumAPI().then(res => {
res.data.code === 0 ? this.dataForm.sort = res.data.data : this.$message.error('获取失败')
})
},
dataSubmit() { //添加联系信息
this.sending = true
this.$refs['dataForm'].validate((valid) => {
......
......@@ -211,12 +211,11 @@
import { pdfListAPI } from '@/api/resource/pdf'
import { bookSaveAPI, detailsAPI, isbnRepeatAPI } from '@/api/resource/book'
import { sortListAPI, authorLibraryAPI,labelListAPI } from '@/api/common'
import { fileUrl } from '@/utils/global'
import { formatSort } from '@/utils/format'
import { valValidate, isbnValidate, fontValidate } from '@/utils/validate'
import { bookInfoList } from '@/utils/static'
import editAuthor from '@/components/dialog/editAuthor' //作者
import {pdfFileUrl,baseUrl} from '@/utils/global'
import {fileUrl, pdfFileUrl, baseUrl} from '@/utils/global'
import store from '@/store'
export default {
name:'createBook',
......
......@@ -6,7 +6,7 @@
<div class="content">
<div class="left">
<div class="header">
<img :src="`${uploadUrl}?fileName=${data.userImg}&isOnLine=true`" v-if="data.userImg" class="avatar" >
<img :src="`${fileUrl}?fileName=${data.userImg}&isOnLine=true`" v-if="data.userImg" class="avatar" >
<img src="../../../assets/img/default.png" v-else>
</div>
<div class="name">{{data.userName}}</div>
......@@ -97,7 +97,7 @@
<script>
import Tinymce from '@/components/Tinymce'
import { uploadUrl, uploadPath, requestPath } from '@/utils/global.js'
import { fileUrl, uploadPath, requestPath } from '@/utils/global.js'
import queryString from 'query-string'
import { detailsAPI, setStatusAPI, deleteAPI, replayAPI, replayCheck } from '@/api/society-manage/resource'
import { requestMsg, confirm } from '@/utils/publicFunctions'
......@@ -130,7 +130,7 @@ export default {
}
},
created(){
this.uploadUrl = uploadUrl
this.uploadUrl = fileUrl
this.uploadPath = uploadPath
},
mounted() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论