提交 7dd74001 authored 作者: 翟畅's avatar 翟畅

zc图书一册一码、数字资源下载等功能

上级 5601dbde
......@@ -3,8 +3,8 @@ ENV = 'development'
# base api
# VUE_APP_BASE_API = '/dev-api'
VUE_APP_BASE_API = 'https://www.class.com.cn'
# VUE_APP_BASE_API = 'http://192.168.2.35:8098'
# VUE_APP_BASE_API = 'https://www.class.com.cn'
VUE_APP_BASE_API = 'http://test24.zhongdianyun.com:8096'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
......
......@@ -3,5 +3,6 @@ ENV = 'production'
# base api
# VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = 'https://www.class.com.cn'
# VUE_APP_BASE_API = 'https://www.class.com.cn'
VUE_APP_BASE_API = 'http://test24.zhongdianyun.com:8096'
......@@ -5,11 +5,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- <title><%= webpackConfig.name %></title> -->
<!-- h-t-t-p://test22.zhongdianyun.com:8096 -->
<!-- h-t-t-p://gdjyfw.com -->
<title>中国劳动社会保障出版社有限公司</title>
</head>
<body>
......
......@@ -104,6 +104,14 @@ export function authorRecommendAllAPI(params) { //选择弹窗中的内容列表
})
}
export function recommendAllResourceListAPI(params) { //内容列表
return request({
url: `${requestPath.resource}/resource/relation-resource/page-book`,
method: 'get',
params
})
}
export function authorSaveRecAPI(data) { //添加作者内容
return request({
url: `${requestPath.resource}/resource/relation-resource/save`,
......
......@@ -47,6 +47,8 @@ export function adminAdd(pram) {
status: pram.status,
phone:pram.phone,
departmentId:pram.departmentId,
departmentCode:pram.departmentCode,
departmentName:pram.departmentName,
}
return request({
url: '/admin/system/admin/save',
......
......@@ -9,5 +9,4 @@ const SettingMer = {
// socket连接
wsSocketUrl: VUE_APP_WS_URL
}
// https://www.class.com.cn
export default SettingMer
......@@ -374,19 +374,6 @@ export default {
correctLevel: QRCode.CorrectLevel.H
})
},0)
// window.open('https://br.fltrp.com/#/resourceDetail?id=' + obj.id)
// let data = {
// resourceId: obj.id,
// resourceType: '16',
// }
// getQRCodeAPI(data).then((res) => {
// if(res.data.code == 0){
// this.resourceQRUrl = process.env.VUE_APP_BASE_API + '/file/file/?fileName=' + res.data.data.qrCode
// this.qRDialogVisible = true
// }else{
// this.$message.warning('该资源暂时无预览二维码!')
// }
// })
},
// 关闭弹框,清除已经生成的二维码
closeCode () {
......
......@@ -104,10 +104,19 @@
<el-radio label="1">付费</el-radio>
<el-radio label="0">免费</el-radio>
</el-radio-group>
<div style="display:inline-block;width:25px;"></div>
<el-checkbox v-model="dataForm.isLogin">需登录</el-checkbox>
</el-form-item>
<el-form-item :prop="dataForm.priceOption == '1' ?'realPrice':''" v-if="dataForm.priceOption == '1'">
<el-input-number v-model="dataForm.realPrice" :precision="2" :min="0.01" :max="99999"></el-input-number>&nbsp;
</el-form-item>
<!-- 是否可下载 -->
<el-form-item label="是否可下载:" prop="isDownload">
<el-radio-group v-model="dataForm.isDownload">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<div class="footer_fixed">
......@@ -207,6 +216,8 @@ export default {
},
dataForm:{
priceOption: '1',
isLogin:true,
isDownload:'1',
realPrice:null,
annex: "",
annexName: "",
......
......@@ -123,10 +123,19 @@
<el-radio label="1">付费</el-radio>
<el-radio label="0">免费</el-radio>
</el-radio-group>
<div style="display:inline-block;width:25px;"></div>
<el-checkbox v-model="dataForm.isLogin">需登录</el-checkbox>
</el-form-item>
<el-form-item :prop="dataForm.priceOption == '1' ?'realPrice':''" v-if="dataForm.priceOption == '1'">
<el-input-number v-model="dataForm.realPrice" :precision="2" :min="0.01" :max="99999"></el-input-number>&nbsp;
</el-form-item>
<!-- 是否可下载 -->
<el-form-item label="是否可下载:" prop="isDownload">
<el-radio-group v-model="dataForm.isDownload">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<div class="footer_fixed">
......@@ -225,6 +234,8 @@ export default {
},
dataForm:{
priceOption: '1',
isLogin:true,
isDownload:'1',
realPrice:null,
bookList: {},
},
......
......@@ -95,11 +95,19 @@
<el-radio-group v-model="dataForm.priceOption">
<el-radio label="1">付费</el-radio>
<el-radio label="0">免费</el-radio>
<el-radio label="3">需登录</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :prop="dataForm.priceOption == '1' ?'realPrice':''" v-if="dataForm.priceOption == '1'">
<el-input-number v-model="dataForm.realPrice" :precision="2" :min="0.01" :max="99999"></el-input-number>&nbsp;
</el-form-item>
</el-form-item>
<!-- 是否可下载 -->
<el-form-item label="是否可下载:" prop="isDownload">
<el-radio-group v-model="dataForm.isDownload">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<relation-book-dialog :showDialog.sync="showRelationDialog" :bookId="$route.query.id" @close='showRelationDialog = false' @saveContent="saveContent"></relation-book-dialog>
......@@ -143,6 +151,7 @@ export default {
synopsis: null,
price: undefined,
priceOption: '1',
isDownload:1,
realPrice: null,
diyTypeCode: [],
bookList: {},
......
......@@ -134,11 +134,19 @@
<el-radio-group v-model="dataForm.priceOption">
<el-radio label="1">付费</el-radio>
<el-radio label="0">免费</el-radio>
<el-radio label="3">需登录</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :prop="dataForm.priceOption == '1' ?'realPrice':''" v-if="dataForm.priceOption == '1'">
<el-input-number v-model="dataForm.realPrice" :precision="2" :min="0.01" :max="99999"></el-input-number>&nbsp;
</el-form-item>
<!-- 是否可下载 -->
<el-form-item label="是否可下载:" prop="isDownload">
<el-radio-group v-model="dataForm.isDownload">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<!-- 弹窗 -->
......@@ -249,6 +257,7 @@ export default {
pdfType:3,
bookCatalog: null,
priceOption: '1',
isDownload:1,
realPrice: null,
translator: null,
translatorId: null,
......
......@@ -275,9 +275,7 @@ import searchDia from "@/components/dialog/searchTips";
this.createdBook(id);
},
viewLine: () => { //预览
// this.$message.success("打开pc端详情");
window.open(pcUrl+'/digital/bookDetail?id=' + id)
// window.open('https://www.class.com.cn/#/bookDetail?id=' + id)
},
recommendLine: () => { //推荐内容
this.goRecommend(id);
......
......@@ -31,22 +31,22 @@
<el-table ref="table" class="table_box" v-loading="listLoading" :data="dataList" style="width: 100%" size="mini" @selection-change="selectionChange" highlight-current-row @sort-change="sortChanged">
<el-table-column type="selection" width="50" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
<el-table-column prop="conversionDark" label="防伪码暗码" min-width="12%" align="center"></el-table-column>
<el-table-column prop="conversionDark" label="兑换码暗码" min-width="12%" align="center"></el-table-column>
<el-table-column prop="createTime" align="center" label="创建时间" min-width="10%" sortable/>
<!-- <el-table-column prop="bindUserName" label="绑定用户" min-width="12%" align="center"></el-table-column> -->
<!-- <el-table-column prop="bindTime" label="绑定时间" min-width="10%" align="center"></el-table-column> -->
<el-table-column prop="bindUserName" label="绑定用户" min-width="12%" align="center"></el-table-column>
<el-table-column prop="bindTime" label="绑定时间" min-width="10%" align="center"></el-table-column>
<el-table-column label="状态" min-width="10%" align="center">
<template slot-scope="scope">
<span>{{scope.row.status == 0?'未废置':'已废置'}}</span>
</template>
</el-table-column>
<el-table-column prop="verifyNum" align="center" label="验证数量" min-width="8%"/>
<!-- <el-table-column prop="conversionPlain" label="防伪码明码" min-width="12%" align="center"></el-table-column> -->
<!-- <el-table-column label="操作" min-width="15%" align="center">
<el-table-column prop="conversionPlain" label="兑换码明码" min-width="12%" align="center"></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)" :key="index">{{item.name}}</el-button>
</template>
</el-table-column> -->
</el-table-column>
</el-table>
<div class="block">
<el-pagination
......@@ -85,6 +85,19 @@
<el-button type="primary" @click="dialogIpVisible = false">确定</el-button>
</div>
</el-dialog>
<!-- 下载防伪码 -->
<el-dialog title="下载防伪码方式" :visible.sync="downloadTypeDialog" width="30%" center>
<div class="downloadType" style="width:100%;text-align:center;">
<el-radio-group v-model="downLoadType">
<el-radio :label="1">携带暗码</el-radio>
<el-radio :label="2">不带暗码</el-radio>
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="downloadTypeDialog = false">取 消</el-button>
<el-button type="primary" @click="confirmDownLoad()">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
......@@ -144,6 +157,8 @@ import queryString from "query-string";
},
dialogIpVisible:false,
ipDataList:[],
downloadTypeDialog:false,
downLoadType:1,
}
},
mounted() {
......@@ -184,12 +199,40 @@ import queryString from "query-string";
exportCodeBtn: () => { //导出防伪码
this.exportCode(id);
},
batchDownLoad: () => {
this.downLoadData();
},
viewLine: () => { //查看详情
this.viewDetail(id);
},
};
status[btnName]();
},
downLoadData() {//下载图书二维码
if (this.isExist(this.chooiceList)) {//至少选中一条
this.downloadTypeDialog = true
}
},
confirmDownLoad(){
this.downloadTypeDialog = false
let ids = getSelectionIds(this.chooiceList);
let data = {
ids:ids,
isCode:this.downLoadType,
resourceId:this.listQuery.phyId,
}
let {...params} = data
let tempParams = {}
for (const key in params) {
if (({}).hasOwnProperty.call(params, key) && params[key]!== null && params[key]!== '' && params[key]!== undefined) {
tempParams[key] = params[key]
}
}
let paramStr = queryString.stringify(tempParams)
confirm.apply(this, ["确定下载选择的防伪二维码吗?"]).then(() => {
window.open(`${process.env.VUE_APP_BASE_API}${requestPath.resource}/physical-conversion-code/batch/downloadOneCode?${paramStr}`)
});
},
//批量创建
createdCode(){
this.createCodeDialog = true
......
......@@ -177,6 +177,12 @@
<el-radio :label="'1'">可申请</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="需激活:" prop="activation">
<el-radio-group v-model="dataForm.activation">
<el-radio :label="'1'"></el-radio>
<el-radio :label="'2'"></el-radio>
</el-radio-group>
</el-form-item>
<!-- 0 免费,1收费 , -->
<!-- <el-form-item label="运费:" prop="shippingCostType">
<el-radio-group v-model="dataForm.shippingCostType">
......@@ -216,7 +222,7 @@
<script>
import { bookSaveAPI, bookEditAPI, detailsAPI, isbnGetBookAPI, isbnRepeatAPI, seriesListAllAPI } from '@/api/resource/paperbook'
import { sortListAPI, authorLibraryAPI,labelListAPI } from '@/api/common'
import { sortListAPI, authorLibraryAPI, labelListAPI } from '@/api/common'
import { fileUrl } from '@/utils/global'
import { formatSort } from '@/utils/format'
import { valValidate, isbnValidate, fontValidate } from '@/utils/validate'
......@@ -289,7 +295,8 @@ export default {
productRecommendation: null,
editRecommendation: null,
digest: null,
shippingCostType:'0'
shippingCostType:'0',
activation:'1',
},
value:null,
rules: {
......
......@@ -29,6 +29,16 @@
</el-tree>
</div>
</div>
<div class="departSearch">
<el-form :model="listQuery" ref="listQuery" label-width="95px">
<el-form-item label="部门检索:">
<el-select v-model="listQuery.departmentCode" clearable placeholder="请选择" @change="searchDepart">
<el-option label="全部" :value="null"></el-option>
<el-option v-for="(item,index) in departList" :key="'depart'+index" :label="item.departmentName" :value="item.code"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<div class="top_tips" @click="searchDialog = true"><i class="el-icon-question"></i></div>
<div class="search_box">
<el-input class="search" @keyup.enter.native="getList(1)" placeholder="请输入资源关键字模糊搜索,展开高级搜索可使用更多搜索条件" v-model="listQuery.params">
......@@ -89,7 +99,7 @@
</div>
</template>
</el-table-column>
<el-table-column prop="author" label="作者" min-width="11%" align="center"/>
<el-table-column prop="author" label="作者" min-width="10%" align="center"/>
<el-table-column prop="isbn" label="ISBN" min-width="10%" align="center"/>
<el-table-column prop="seriesname" label="所属丛书" min-width="10%" align="center" show-overflow-tooltip/>
<el-table-column prop="realPrice" label="售价" min-width="6%" align="center" sortable="custom">
......@@ -105,7 +115,7 @@
<span v-else style="color:#999999"><span class="down_status"></span>已下架</span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="14%" align="center">
<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.id,scope.row.name,scope.row.isbn)" :key="index">
<span v-if="item.url == 'removeLine' && scope.row.status == '2'">{{item.name}}</span>
......@@ -165,13 +175,7 @@
</div>
</template>
<script>
import {
bookListAPI,
bookUpdateAPI,
bookDeleteAPI,
editPriceAPI,
editSortAPI
} from "@/api/resource/paperbook";
import { bookListAPI, bookUpdateAPI, bookDeleteAPI, editPriceAPI, editSortAPI, batchDownloadCodeAPI } from "@/api/resource/paperbook";
import searchDia from "@/components/dialog/searchTips";
import { sortListAPI,deleteCheckAPI } from "@/api/common";
import { confirm } from "@/utils/function";
......@@ -179,8 +183,10 @@ import { getSelectionIds } from "@/filters/getIds";
import editPrice from "@/components/dialog/editPaperbookPrice";
import editSort from "@/components/dialog/editSort";
import importDia from "@/components/dialog/importExcel";
import { baseUrl,pcUrl } from "@/utils/global";
import { baseUrl, pcUrl, requestPath } from "@/utils/global";
import { departListAPI } from '@/api/departManage.js'
import axios from "axios";
import queryString from "query-string";
export default {
name: 'paper_book',
components: {
......@@ -236,13 +242,15 @@ import axios from "axios";
inResize: true,
moreFilter: false,
priceForm: {},
sending: null
sending: null,
departList:[],
}
},
mounted() {
window.addEventListener("click", this.clickOther);
this.getSortList();
this.getList();
this.getDepartList()
setTimeout(() => {
let list = this.$store.state.btn.btnList;
list.forEach(item => {
......@@ -255,6 +263,17 @@ import axios from "axios";
},0)
},
methods: {
getDepartList(){
departListAPI().then((res) => {
this.departList = res
}).catch((res) => {
this.$message.error(res)
})
},
searchDepart(val){
this.listQuery.departmentCode = val
this.getList(1)
},
downLoadTemplate(){
// baseUrl
let a = document.createElement('a')
......@@ -362,7 +381,10 @@ import axios from "axios";
},
resourceCodeLine: () => { //资源码
this.goResourceCodePage(id,name,isbn)
}
},
batchDownloadQRcodeBtn: () => {//批量下载二维码
this.downLoadData();
},
};
status[btnName]();
},
......@@ -522,14 +544,11 @@ import axios from "axios";
});
}
},
removeData(id) {
//删除数据
removeData(id) {//删除数据
let arr = [];
if (id) {
//单条删除
if (id) {//单条删除
arr.push(id);
} else {
//批量删除
} else {//批量删除
if (this.isExist(this.chooiceList)) {
//至少选中一条
arr = getSelectionIds(this.chooiceList);
......@@ -555,6 +574,26 @@ import axios from "axios";
this.$message.warning("请先下架,再删除数据");
}
},
downLoadData() {//下载图书二维码
if (this.isExist(this.chooiceList)) {//至少选中一条
let ids = getSelectionIds(this.chooiceList);
let data = {
ids:ids,
isCode:this.downLoadType
}
let {...params} = data
let tempParams = {}
for (const key in params) {
if (({}).hasOwnProperty.call(params, key) && params[key]!== null && params[key]!== '' && params[key]!== undefined) {
tempParams[key] = params[key]
}
}
let paramStr = queryString.stringify(tempParams)
confirm.apply(this, ["确定下载选择的图书二维码吗?"]).then(() => {
window.open(`${process.env.VUE_APP_BASE_API}${requestPath.resource}/phy/batch/downloadOneCode?${paramStr}`)
});
}
},
selectionChange(val) {
//勾选table
this.chooiceList = val;
......@@ -588,6 +627,14 @@ import axios from "axios";
</script>
<style scoped lang="scss">
@import '@/styles/top_common.scss';
.departSearch{
width: 300px;
height: 66px;
display: inline-block;
margin-left: 30px;
padding-top: 16px;
box-sizing: border-box;
}
.cover_img{
width: 28px;
height: 38px;
......
......@@ -227,7 +227,7 @@ import queryString from "query-string";
}
},
// 下载资源码
downResourceCode(status){
downResourceCode(){
if (this.isExist(this.chooiceList)) {
//至少选中一条
let ids = getSelectionIds(this.chooiceList);
......
......@@ -19,8 +19,8 @@
</el-form-item>
<el-form-item label="图片封面:" prop="cover" ref="cover">
<div class="upload_resource">
<img :src="coverUrl(dataForm.image)" class="box_showdow" @error="errImg('book')" v-if="dataForm.image">
<img :src="defaultImg('book')" v-else>
<img :src="coverUrl(dataForm.image)" class="box_showdow" @error="errImg('special')" v-if="dataForm.image">
<img :src="defaultImg('special')" v-else>
</div>
<div style="float:left">
<el-upload :action="`${fileUrl}upload`" :show-file-list="false"
......@@ -125,11 +125,19 @@
<el-radio-group v-model="dataForm.priceOption">
<el-radio label="1">付费</el-radio>
<el-radio label="0">免费</el-radio>
<el-radio label="3">需登录</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :prop="dataForm.priceOption == '1' ?'realPrice':''" v-if="dataForm.priceOption == '1'">
<el-input-number v-model="dataForm.realPrice" :precision="2" :min="0.01" :max="99999"></el-input-number>&nbsp;
</el-form-item>
<!-- 是否可下载 -->
<el-form-item label="是否可下载:" prop="isDownload">
<el-radio-group v-model="dataForm.isDownload">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<div class="footer_fixed">
......@@ -228,6 +236,8 @@ export default {
},
dataForm:{
priceOption: '1',
isLogin:true,
isDownload:1,
realPrice:null,
id: "",
author:null,
......
......@@ -20,7 +20,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)">{{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>
......@@ -92,13 +92,15 @@
</template>
<script>
import { recommendListAPI,authorUpdateSortAPI,authorRecDelAPI, getAllModulesAPI } from '@/api/resource/author'
import { recommendListAPI, authorUpdateSortAPI, authorRecDelAPI, getAllModulesAPI } from '@/api/resource/author'
import { confirm } from '@/utils/function'
import { getSelectionIds } from '@/filters/getIds'
import { sortValidate } from '@/utils/validate'
import { specialList } from '@/utils/static'
import contentDialog from './content_dialog.vue'
import catalogueDialog from './module.vue'
import { baseUrl, pcUrl, requestPath } from "@/utils/global";
import queryString from "query-string";
export default {
components:{
contentDialog,
......@@ -178,7 +180,7 @@ export default {
})
}
if(this.$route.query.type != 1){
this.topBtn = this.topBtn.filter((item) => item.url != 'createCatalogueBtn')
this.topBtn = this.topBtn.filter((item) => item.url != 'createCatalogueBtn' && item.url != 'batchDownloadQRcodeBtn')
}
}else if(item.type == 9 ){
this.lineBtn.push(item)
......@@ -257,7 +259,10 @@ export default {
},
'createCatalogueBtn':()=>{ //创建目录
this.dialogCatalogue = true
}
},
'batchDownloadQRcodeBtn': () => {//批量下载二维码
this.downLoadData();
},
}
status[btnName]()
},
......@@ -298,7 +303,26 @@ export default {
})
}
})
},
downLoadData() {//下载图书二维码
if (this.isExist(this.chooiceList)) {//至少选中一条
let ids = getSelectionIds(this.chooiceList);
let data = {
ids:ids,
resourceId:this.$route.query.id?this.$route.query.id:null
}
let {...params} = data
let tempParams = {}
for (const key in params) {
if (({}).hasOwnProperty.call(params, key) && params[key]!== null && params[key]!== '' && params[key]!== undefined) {
tempParams[key] = params[key]
}
}
let paramStr = queryString.stringify(tempParams)
confirm.apply(this, ["确定下载选择的相关资源二维码吗?"]).then(() => {
window.open(`${process.env.VUE_APP_BASE_API}${requestPath.resource}/resource/batch/download?${paramStr}`)
});
}
},
selectAll(val) {//顶部全选
this.checkAll = val.length > 0
......
......@@ -29,7 +29,7 @@
<el-table-column label="状态" min-width="10%" align="center">
<template slot-scope="scope">
<span v-if="scope.row.bookStatus == 1 || scope.row.status == 1">已上架</span>
<span v-if="scope.row.bookStatus == 0 || scope.row.status == 0">已下架</span>
<span v-if="scope.row.bookStatus == 0 || scope.row.status == 0 || scope.row.status == 2" style="color:#999;">已下架</span>
</template>
</el-table-column>
</el-table>
......@@ -54,7 +54,7 @@
</div>
</template>
<script>
import { authorRecommendAllAPI, authorSaveRecAPI } from '@/api/resource/author'
import { authorRecommendAllAPI, authorSaveRecAPI, recommendAllResourceListAPI } from '@/api/resource/author'
import { getSelectionIds } from '@/filters/getIds'
export default {
data() {
......@@ -113,7 +113,8 @@ export default {
this.listQuery.type = this.type
this.listQuery.pageNum = num ? num : this.listQuery.pageNum
this.listQuery.id = this.bookId
authorRecommendAllAPI(this.listQuery).then(res =>{//列表
let API = this.type == 1?recommendAllResourceListAPI:authorRecommendAllAPI
API(this.listQuery).then(res =>{//列表
if (res.data.code === 0) {
this.dataList = res.data.data?res.data.data.list:[]
this.total = res.data.data?res.data.data.total:0
......
......@@ -97,11 +97,19 @@
<el-radio-group v-model="dataForm.priceOption">
<el-radio label="1">付费</el-radio>
<el-radio label="0">免费</el-radio>
<el-radio label="3">需登录</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :prop="dataForm.priceOption == '1' ?'realPrice':''" v-if="dataForm.priceOption == '1'">
<el-input-number v-model="dataForm.realPrice" :precision="2" :min="0.01" :max="99999"></el-input-number>&nbsp;
</el-form-item>
<!-- 是否可下载 -->
<el-form-item label="是否可下载:" prop="isDownload">
<el-radio-group v-model="dataForm.isDownload">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<relation-book-dialog :showDialog.sync="showRelationDialog" :bookId="$route.query.id" @close='showRelationDialog = false' @saveContent="saveContent"></relation-book-dialog>
......@@ -146,6 +154,7 @@ export default {
synopsis: null,
price: undefined,
priceOption: '1',
isDownload:1,
realPrice: null,
diyTypeCode: [],
bookList: {},
......@@ -281,8 +290,8 @@ export default {
}
}
if(this.dataForm.priceOption == '0'){
this.dataForm.realPrice == null
}
this.dataForm.realPrice == null
}
videoSaveAPI(this.dataForm).then(res =>{
if (res.data.code === 0) {
this.$message.success('保存成功');
......
......@@ -30,7 +30,7 @@
</el-select>
</el-form-item>
<el-form-item label="管理员所属部门" prop="departmentId" v-if="!pram.roles.some(x => x == 1)">
<el-select v-model="pram.departmentId" placeholder="请选择部门" style="width: 100%">
<el-select v-model="pram.departmentId" placeholder="请选择部门" style="width: 100%" @change="chooseDepart">
<el-option
v-for="(item,index) in departList"
:key="'depart'+index"
......@@ -107,6 +107,8 @@ export default {
id: null,
phone: null,
departmentId: null,
departmentCode: null,
departmentName: null,
},
roleList: [],
rules: {
......@@ -144,6 +146,15 @@ export default {
this.$message.error(res)
})
},
chooseDepart(val){
this.departList.forEach((item,index) => {
if(item.id == val){
this.pram.departmentId = item.id
this.pram.departmentCode = item.code
this.pram.departmentName = item.departmentName
}
})
},
handleGetRoleList() {
const _pram = {
page: 1,
......@@ -156,7 +167,7 @@ export default {
},
initEditData() {
if (this.isCreate !== 1) return
const { account, realName, roles, level, status, id, phone, departmentId } = this.editData
const { account, realName, roles, level, status, id, phone, departmentId, departmentCode, departmentName } = this.editData
this.pram.account = account
this.pram.realName = realName
const _roles = []
......@@ -166,8 +177,9 @@ export default {
_roles.push(...roles.split(',').map(item => Number.parseInt(item)))
}
this.pram.roles = _roles
console.log(this.editData.departmentId,66666)
this.pram.departmentId = departmentId
this.pram.departmentCode = departmentCode
this.pram.departmentName = departmentName
this.pram.status = status
this.pram.id = id
this.pram.phone = phone
......@@ -185,6 +197,11 @@ export default {
})
},
handlerSave() {
if(!this.pram.departmentId){
this.pram.departmentId = 0
this.pram.departmentCode = '0'
this.pram.departmentName = '0'
}
systemAdminApi.adminAdd(this.pram).then(data => {
this.$message.success('创建管理员成功')
this.$emit('hideEditDialog')
......@@ -192,9 +209,6 @@ export default {
},
handlerEdit() {
this.pram.roles = this.pram.roles.join(',')
if(this.pram.departmentId){
this.pram.departmentId = this.pram.departmentId.toString()
}
systemAdminApi.adminUpdate(this.pram).then(data => {
this.$message.success('更新管理员成功')
this.$emit('hideEditDialog')
......
......@@ -52,7 +52,11 @@
<el-tag size="small" type="info" v-for="(item, index) in scope.row.roleNames.split(',')" :key="index" class="mr5">{{ item }}</el-tag>
</template>
</el-table-column>
<el-table-column label="部门" prop="departmentName" min-width="100"></el-table-column>
<el-table-column label="部门" prop="departmentName" min-width="100">
<template slot-scope="scope">
<span>{{scope.row.departmentName == '0'?'':scope.row.departmentName}}</span>
</template>
</el-table-column>
<el-table-column label="最后登录时间" prop="lastTime" min-width="180">
<template slot-scope="scope">
<span>{{ scope.row.lastTime | filterEmpty }}</span>
......@@ -258,7 +262,9 @@ export default {
})
},
handlerOpenEdit(isCreate, editDate={}) {
editDate.departmentId = null
editDate.departmentId = 0
editDate.departmentCode = 0
editDate.departmentName = 0
if(isCreate == 1){
this.departList.map((item,index) => {
if(item.departmentName == editDate.departmentName){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论