|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="container courselist">
|
|
|
+ <div class="container courselist courselistNPC">
|
|
|
<Header />
|
|
|
<!-- <Nav navValue="教材列表" /> -->
|
|
|
<div class="content">
|
|
@@ -153,189 +153,267 @@
|
|
|
:close-on-click-modal="false"
|
|
|
>
|
|
|
<el-form ref="formDialog" :model="formDialog" :rules="courseListRules">
|
|
|
- <el-form-item
|
|
|
- class="label-input"
|
|
|
- label="名称"
|
|
|
- label-width="90px"
|
|
|
- prop="name"
|
|
|
- >
|
|
|
- <el-input v-model="formDialog.name" autocomplete="off" name="name" maxlength="100" show-word-limit/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- class="label-input"
|
|
|
- label="英文名"
|
|
|
- label-width="90px"
|
|
|
- prop="name_english"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="formDialog.name_english"
|
|
|
- autocomplete="off"
|
|
|
- name="name_english"
|
|
|
- maxlength="100"
|
|
|
- show-word-limit
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="教材类型" label-width="90px" prop="type_id">
|
|
|
- <!-- -->
|
|
|
- <el-select
|
|
|
- ref="typeSelects"
|
|
|
- v-model="formDialog.type_id"
|
|
|
- name="bookType"
|
|
|
- placeholder="请选择教材类型"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in typeList"
|
|
|
- :key="'type' + index"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- class="label-input"
|
|
|
- label="作者"
|
|
|
- label-width="90px"
|
|
|
- prop="author"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="formDialog.author"
|
|
|
- autocomplete="off"
|
|
|
- name="author"
|
|
|
- maxlength="20"
|
|
|
- show-word-limit
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- class="label-input"
|
|
|
- label="版本"
|
|
|
- label-width="90px"
|
|
|
- prop="edition"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="formDialog.edition"
|
|
|
- autocomplete="off"
|
|
|
- name="edition"
|
|
|
- maxlength="20"
|
|
|
- show-word-limit
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- class="label-input"
|
|
|
- label="出版社"
|
|
|
- label-width="90px"
|
|
|
- prop="publisher"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="formDialog.publisher"
|
|
|
- autocomplete="off"
|
|
|
- name="publisher"
|
|
|
- maxlength="20"
|
|
|
- show-word-limit
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- class="label-input"
|
|
|
- label="出版编号"
|
|
|
- label-width="90px"
|
|
|
- prop="publish_number"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="formDialog.publish_number"
|
|
|
- autocomplete="off"
|
|
|
- name="publish_number"
|
|
|
- maxlength="30"
|
|
|
- show-word-limit
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- class="label-input"
|
|
|
- label="丛书编号"
|
|
|
- label-width="90px"
|
|
|
- prop="series_code"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- autocomplete="off"
|
|
|
- name="series_code"
|
|
|
- v-model="formDialog.series_code"
|
|
|
- maxlength="26"
|
|
|
- show-word-limit
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- class="label-input"
|
|
|
- label="价格"
|
|
|
- label-width="90px"
|
|
|
- prop="price"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="formDialog.price"
|
|
|
- autocomplete="off"
|
|
|
- name="price"
|
|
|
- type="number"
|
|
|
- @blur="blurPrice"
|
|
|
- @input="inputPrice"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="所属机构" label-width="90px" prop="org_id">
|
|
|
- <!-- -->
|
|
|
- <el-select
|
|
|
- ref="selects"
|
|
|
- v-model="formDialog.org_id"
|
|
|
- name="agency"
|
|
|
- placeholder="请选择机构"
|
|
|
- @change="changeAgency"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(statusItem, index) in diaMyOrgList"
|
|
|
- :key="'diaMyOrgList' + index"
|
|
|
- :label="statusItem.org_name"
|
|
|
- :value="statusItem.org_id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="教材描述" label-width="90px" prop="description">
|
|
|
- <el-input v-model="formDialog.description" type="textarea" maxlength="100" show-word-limit />
|
|
|
- </el-form-item>
|
|
|
- <!-- <el-form-item label="发布状态" label-width="90px">
|
|
|
- <el-radio label="0" v-model="formDialog.publish_status">下架</el-radio>
|
|
|
- <el-radio label="1" v-model="formDialog.publish_status">上架</el-radio>
|
|
|
- </el-form-item>-->
|
|
|
- <el-form-item label="发布范围" label-width="90px" prop="publish_scope">
|
|
|
- <el-radio v-model="formDialog.publish_scope" :label="0"
|
|
|
- >机构内用户可见</el-radio
|
|
|
- >
|
|
|
- <el-radio v-model="formDialog.publish_scope" :label="1"
|
|
|
- >所有用户可见</el-radio
|
|
|
- >
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="主题颜色" label-width="90px" prop="theme_color">
|
|
|
- <el-radio v-model="formDialog.theme_color" label="red">红色</el-radio>
|
|
|
- <el-radio v-model="formDialog.theme_color" label="green"
|
|
|
- >绿色</el-radio
|
|
|
- >
|
|
|
- <el-radio v-model="formDialog.theme_color" label="brown"
|
|
|
- >棕色</el-radio
|
|
|
- >
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="教材图片" label-width="90px" prop="fileList">
|
|
|
- <el-upload
|
|
|
- :action="url"
|
|
|
- :file-list="fileList"
|
|
|
- :limit="1"
|
|
|
- :before-upload="beforeUpload"
|
|
|
- :on-exceed="handleExceed"
|
|
|
- :on-preview="handlePreview"
|
|
|
- :on-remove="handleRemove"
|
|
|
- :on-success="handleSuccess"
|
|
|
- accept=".jpg, .jpeg, .png"
|
|
|
- class="upload-demo"
|
|
|
- list-type="picture"
|
|
|
- multiple
|
|
|
- style="width: 500px"
|
|
|
- >
|
|
|
- <el-button size="mini" type="success">点击上传</el-button>
|
|
|
- </el-upload>
|
|
|
- </el-form-item>
|
|
|
+ <el-tabs v-model="activeName">
|
|
|
+ <el-tab-pane label="教材信息" name="courseInfo">
|
|
|
+ <el-form-item
|
|
|
+ class="label-input"
|
|
|
+ label="名称"
|
|
|
+ label-width="90px"
|
|
|
+ prop="name"
|
|
|
+ >
|
|
|
+ <el-input v-model="formDialog.name" autocomplete="off" name="name" maxlength="100" show-word-limit/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ class="label-input"
|
|
|
+ label="英文名"
|
|
|
+ label-width="90px"
|
|
|
+ prop="name_english"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="formDialog.name_english"
|
|
|
+ autocomplete="off"
|
|
|
+ name="name_english"
|
|
|
+ maxlength="100"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="教材类型" label-width="90px" prop="type_id">
|
|
|
+ <!-- -->
|
|
|
+ <el-select
|
|
|
+ ref="typeSelects"
|
|
|
+ v-model="formDialog.type_id"
|
|
|
+ name="bookType"
|
|
|
+ placeholder="请选择教材类型"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in typeList"
|
|
|
+ :key="'type' + index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ class="label-input"
|
|
|
+ label="作者"
|
|
|
+ label-width="90px"
|
|
|
+ prop="author"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="formDialog.author"
|
|
|
+ autocomplete="off"
|
|
|
+ name="author"
|
|
|
+ maxlength="20"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ class="label-input"
|
|
|
+ label="版本"
|
|
|
+ label-width="90px"
|
|
|
+ prop="edition"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="formDialog.edition"
|
|
|
+ autocomplete="off"
|
|
|
+ name="edition"
|
|
|
+ maxlength="20"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ class="label-input"
|
|
|
+ label="出版社"
|
|
|
+ label-width="90px"
|
|
|
+ prop="publisher"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="formDialog.publisher"
|
|
|
+ autocomplete="off"
|
|
|
+ name="publisher"
|
|
|
+ maxlength="20"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ class="label-input"
|
|
|
+ label="出版编号"
|
|
|
+ label-width="90px"
|
|
|
+ prop="publish_number"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="formDialog.publish_number"
|
|
|
+ autocomplete="off"
|
|
|
+ name="publish_number"
|
|
|
+ maxlength="30"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ class="label-input"
|
|
|
+ label="丛书编号"
|
|
|
+ label-width="90px"
|
|
|
+ prop="series_code"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ autocomplete="off"
|
|
|
+ name="series_code"
|
|
|
+ v-model="formDialog.series_code"
|
|
|
+ maxlength="26"
|
|
|
+ show-word-limit
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ class="label-input"
|
|
|
+ label="价格"
|
|
|
+ label-width="90px"
|
|
|
+ prop="price"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="formDialog.price"
|
|
|
+ autocomplete="off"
|
|
|
+ name="price"
|
|
|
+ type="number"
|
|
|
+ @blur="blurPrice"
|
|
|
+ @input="inputPrice"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所属机构" label-width="90px" prop="org_id">
|
|
|
+ <!-- -->
|
|
|
+ <el-select
|
|
|
+ ref="selects"
|
|
|
+ v-model="formDialog.org_id"
|
|
|
+ name="agency"
|
|
|
+ placeholder="请选择机构"
|
|
|
+ @change="changeAgency"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(statusItem, index) in diaMyOrgList"
|
|
|
+ :key="'diaMyOrgList' + index"
|
|
|
+ :label="statusItem.org_name"
|
|
|
+ :value="statusItem.org_id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="教材描述" label-width="90px" prop="description">
|
|
|
+ <el-input v-model="formDialog.description" type="textarea" maxlength="100" show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="发布状态" label-width="90px">
|
|
|
+ <el-radio label="0" v-model="formDialog.publish_status">下架</el-radio>
|
|
|
+ <el-radio label="1" v-model="formDialog.publish_status">上架</el-radio>
|
|
|
+ </el-form-item>-->
|
|
|
+ <el-form-item label="发布范围" label-width="90px" prop="publish_scope">
|
|
|
+ <el-radio v-model="formDialog.publish_scope" :label="0"
|
|
|
+ >机构内用户可见</el-radio
|
|
|
+ >
|
|
|
+ <el-radio v-model="formDialog.publish_scope" :label="1"
|
|
|
+ >所有用户可见</el-radio
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="主题颜色" label-width="90px" prop="theme_color">
|
|
|
+ <el-radio v-model="formDialog.theme_color" label="red">红色</el-radio>
|
|
|
+ <el-radio v-model="formDialog.theme_color" label="green"
|
|
|
+ >绿色</el-radio
|
|
|
+ >
|
|
|
+ <el-radio v-model="formDialog.theme_color" label="brown"
|
|
|
+ >棕色</el-radio
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="教材图片" label-width="90px" prop="fileList">
|
|
|
+ <el-upload
|
|
|
+ :action="url"
|
|
|
+ :file-list="fileList"
|
|
|
+ :limit="1"
|
|
|
+ :before-upload="beforeUpload"
|
|
|
+ :on-exceed="handleExceed"
|
|
|
+ :on-preview="handlePreview"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :on-success="handleSuccess"
|
|
|
+ accept=".jpg, .jpeg, .png"
|
|
|
+ class="upload-demo"
|
|
|
+ list-type="picture"
|
|
|
+ multiple
|
|
|
+ style="width: 500px"
|
|
|
+ >
|
|
|
+ <el-button size="mini" type="success">上传封面</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="教材资源" name="courseResource">
|
|
|
+ <el-form-item label="视频资源" label-width="90px" prop="fileListVideo">
|
|
|
+ <el-upload
|
|
|
+ :action="url"
|
|
|
+ :file-list="fileListVideo"
|
|
|
+ :limit="100"
|
|
|
+ :before-upload="beforeUploadVideo"
|
|
|
+ :on-exceed="handleExceedVideo"
|
|
|
+ :on-remove="handleRemoveVideo"
|
|
|
+ :on-success="handleSuccessVideo"
|
|
|
+ :before-remove="beforeRemoveVideo"
|
|
|
+ accept="video/*"
|
|
|
+ class="upload-demo"
|
|
|
+ multiple
|
|
|
+ style="width: 500px"
|
|
|
+ >
|
|
|
+ <el-button size="mini" type="success">上传视频</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="课文音频" label-width="90px" prop="fileListAudio">
|
|
|
+ <el-upload
|
|
|
+ :action="url"
|
|
|
+ :file-list="fileListAudio"
|
|
|
+ :limit="100"
|
|
|
+ :before-upload="beforeUploadAudio"
|
|
|
+ :on-exceed="handleExceedVideo"
|
|
|
+ :on-remove="handleRemoveAudio"
|
|
|
+ :on-success="handleSuccessAudio"
|
|
|
+ :before-remove="beforeRemoveVideo"
|
|
|
+ accept="audio/*"
|
|
|
+ class="upload-demo"
|
|
|
+ multiple
|
|
|
+ style="width: 500px"
|
|
|
+ >
|
|
|
+ <el-button size="mini" type="success">上传音频</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="其他音频" label-width="90px" prop="fileListOtheraudio">
|
|
|
+ <el-upload
|
|
|
+ :action="url"
|
|
|
+ :file-list="fileListOtheraudio"
|
|
|
+ :limit="100"
|
|
|
+ :before-upload="beforeUploadAudio"
|
|
|
+ :on-exceed="handleExceedVideo"
|
|
|
+ :on-remove="handleRemoveOtheraudio"
|
|
|
+ :on-success="handleSuccesOthersAudio"
|
|
|
+ :before-remove="beforeRemoveVideo"
|
|
|
+ accept="audio/*"
|
|
|
+ class="upload-demo"
|
|
|
+ multiple
|
|
|
+ style="width: 500px"
|
|
|
+ >
|
|
|
+ <el-button size="mini" type="success">上传音频</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="试读PDF" label-width="90px" prop="fileListDoc">
|
|
|
+ <el-upload
|
|
|
+ :action="url"
|
|
|
+ :file-list="fileListDoc"
|
|
|
+ :limit="100"
|
|
|
+ :before-upload="beforeUploadDoc"
|
|
|
+ :on-exceed="handleExceedVideo"
|
|
|
+ :on-remove="handleRemoveDoc"
|
|
|
+ :on-success="handleSuccessDoc"
|
|
|
+ :before-remove="beforeRemoveVideo"
|
|
|
+ accept=".pdf"
|
|
|
+ class="upload-demo"
|
|
|
+ multiple
|
|
|
+ style="width: 500px"
|
|
|
+ >
|
|
|
+ <el-button size="mini" type="success">上传PDF</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFlag = false">取 消</el-button>
|
|
@@ -351,7 +429,7 @@
|
|
|
import Header from "@/components/Header";
|
|
|
import { validNull, validPrice } from "@/utils/validate";
|
|
|
// import Nav from "@/components/inputModules/common/Nav";
|
|
|
-import { getContent, getContentFile } from "@/api/ajax";
|
|
|
+import { getContent, getContentFile, getStaticContent } from "@/api/ajax";
|
|
|
import Cookies from "js-cookie";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
@@ -409,6 +487,10 @@ export default {
|
|
|
publish_number: "",
|
|
|
series_code: "",
|
|
|
picture_id: "",
|
|
|
+ resource_file_id_list_video: [],
|
|
|
+ resource_file_id_list_audio: [],
|
|
|
+ resource_file_id_list_otheraudio: [],
|
|
|
+ resource_file_id_list_doc: [],
|
|
|
id: "",
|
|
|
publisher: "",
|
|
|
theme_color: "",
|
|
@@ -435,6 +517,10 @@ export default {
|
|
|
1: "所有用户",
|
|
|
},
|
|
|
fileList: [], // 上传图片数组
|
|
|
+ fileListVideo: [], // 教材资源视频数组
|
|
|
+ fileListAudio: [], // 教材资源视频数组
|
|
|
+ fileListOtheraudio: [],
|
|
|
+ fileListDoc: [], // 教材资源视频数组
|
|
|
pageIndex: 1,
|
|
|
courseListRules: {
|
|
|
// 填写规则
|
|
@@ -481,6 +567,7 @@ export default {
|
|
|
],
|
|
|
diaMyOrgList: [],
|
|
|
typeList: [],
|
|
|
+ activeName: 'courseInfo', // 教材信息tabs
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -571,6 +658,7 @@ export default {
|
|
|
// 新建教材
|
|
|
handleAdd() {
|
|
|
this.titleEdit = "新建教材";
|
|
|
+ this.activeName="courseInfo";
|
|
|
this.formDialog = {
|
|
|
name: "",
|
|
|
name_english: "",
|
|
@@ -584,6 +672,10 @@ export default {
|
|
|
publish_number: "",
|
|
|
series_code: "",
|
|
|
picture_id: "",
|
|
|
+ resource_file_id_list_video: [],
|
|
|
+ resource_file_id_list_audio: [],
|
|
|
+ resource_file_id_list_otheraudio: [],
|
|
|
+ resource_file_id_list_doc: [],
|
|
|
id: "",
|
|
|
publisher: "",
|
|
|
theme_color: "",
|
|
@@ -591,6 +683,10 @@ export default {
|
|
|
};
|
|
|
this.agency = "";
|
|
|
this.fileList = [];
|
|
|
+ this.fileListVideo = [];
|
|
|
+ this.fileListAudio = [];
|
|
|
+ this.fileListOtheraudio = []
|
|
|
+ this.fileListDoc = [];
|
|
|
this.dialogFlag = true;
|
|
|
},
|
|
|
// 新建教材提交
|
|
@@ -603,28 +699,6 @@ export default {
|
|
|
_this.formDialog.description = _this.formDialog.description.trim();
|
|
|
}
|
|
|
if (valid) {
|
|
|
- // if (
|
|
|
- // (!this.formDialog.price && this.formDialog.price != 0)
|
|
|
- // ) {
|
|
|
- // this.$message(
|
|
|
- // {
|
|
|
- // type: "warning",
|
|
|
- // message: "请填写价格!",
|
|
|
- // },
|
|
|
- // 2000
|
|
|
- // );
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // if (this.formDialog.org_id == "") {
|
|
|
- // this.$message(
|
|
|
- // {
|
|
|
- // type: "warning",
|
|
|
- // message: "请选择所属机构!",
|
|
|
- // },
|
|
|
- // 2000
|
|
|
- // );
|
|
|
- // return false;
|
|
|
- // }
|
|
|
_this.loading = true;
|
|
|
let MethodName;
|
|
|
if (_this.formDialog.id) {
|
|
@@ -720,7 +794,6 @@ export default {
|
|
|
let data = {
|
|
|
audited_status: 1,
|
|
|
};
|
|
|
- console.log("MethodName");
|
|
|
getContentFile(MethodName, data).then((res) => {
|
|
|
if (res && res.org_list.length > 0) {
|
|
|
this.diaMyOrgList = res.org_list;
|
|
@@ -778,10 +851,70 @@ export default {
|
|
|
this.$message.warning(response.msg);
|
|
|
}
|
|
|
},
|
|
|
+ handleSuccessVideo(response, file, fileList) {
|
|
|
+ if (response.status == 1) {
|
|
|
+ this.$message.success("上传成功");
|
|
|
+ this.formDialog.resource_file_id_list_video.push(response.file_info_list[0].file_id);
|
|
|
+ } else {
|
|
|
+ this.$message.warning(response.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSuccessAudio(response, file, fileList) {
|
|
|
+ if (response.status == 1) {
|
|
|
+ this.$message.success("上传成功");
|
|
|
+ this.formDialog.resource_file_id_list_audio.push(response.file_info_list[0].file_id);
|
|
|
+ } else {
|
|
|
+ this.$message.warning(response.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSuccesOthersAudio(response, file, fileList) {
|
|
|
+ if (response.status == 1) {
|
|
|
+ this.$message.success("上传成功");
|
|
|
+ this.formDialog.resource_file_id_list_otheraudio.push(response.file_info_list[0].file_id);
|
|
|
+ } else {
|
|
|
+ this.$message.warning(response.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSuccessDoc(response, file, fileList) {
|
|
|
+ if (response.status == 1) {
|
|
|
+ this.$message.success("上传成功");
|
|
|
+ this.formDialog.resource_file_id_list_doc.push(response.file_info_list[0].file_id);
|
|
|
+ } else {
|
|
|
+ this.$message.warning(response.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
handleRemove(file, fileList) {
|
|
|
this.fileList = fileList;
|
|
|
this.formDialog.picture_id = "";
|
|
|
},
|
|
|
+ handleRemoveVideo(file, fileList) {
|
|
|
+ this.fileListVideo = fileList;
|
|
|
+ this.formDialog.resource_file_id_list_video = []
|
|
|
+ fileList.forEach(item => {
|
|
|
+ this.formDialog.resource_file_id_list_video.push(item.file_id)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleRemoveAudio(file, fileList) {
|
|
|
+ this.fileListAudio = fileList;
|
|
|
+ this.formDialog.resource_file_id_list_audio = []
|
|
|
+ fileList.forEach(item => {
|
|
|
+ this.formDialog.resource_file_id_list_audio.push(item.file_id)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleRemoveOtheraudio(file, fileList) {
|
|
|
+ this.fileListOtheraudio = fileList;
|
|
|
+ this.formDialog.resource_file_id_list_otheraudio = []
|
|
|
+ fileList.forEach(item => {
|
|
|
+ this.formDialog.resource_file_id_list_otheraudio.push(item.file_id)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleRemoveDoc(file, fileList) {
|
|
|
+ this.fileListDoc = fileList;
|
|
|
+ this.formDialog.resource_file_id_list_doc = []
|
|
|
+ fileList.forEach(item => {
|
|
|
+ this.formDialog.resource_file_id_list_doc.push(item.file_id)
|
|
|
+ });
|
|
|
+ },
|
|
|
handlePreview(file) {
|
|
|
console.log(file);
|
|
|
},
|
|
@@ -791,6 +924,24 @@ export default {
|
|
|
return false //必须返回false
|
|
|
}
|
|
|
},
|
|
|
+ beforeUploadVideo(file) {
|
|
|
+ if (file.size > 500 * 1024 * 1024) {
|
|
|
+ this.$message.warning('上传视频大小不能超过500M');
|
|
|
+ return false //必须返回false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeUploadAudio(file) {
|
|
|
+ if (file.size > 20 * 1024 * 1024) {
|
|
|
+ this.$message.warning('上传音频大小不能超过20M');
|
|
|
+ return false //必须返回false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeUploadDoc(file) {
|
|
|
+ if (file.size > 20 * 1024 * 1024) {
|
|
|
+ this.$message.warning('上传文件大小不能超过20M');
|
|
|
+ return false //必须返回false
|
|
|
+ }
|
|
|
+ },
|
|
|
handleExceed(files, fileList) {
|
|
|
this.$message.warning(
|
|
|
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
@@ -798,12 +949,26 @@ export default {
|
|
|
} 个文件`
|
|
|
);
|
|
|
},
|
|
|
+ handleExceedVideo(files, fileList) {
|
|
|
+ this.$message.warning(
|
|
|
+ `当前限制选择 100 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
+ files.length + fileList.length
|
|
|
+ } 个文件`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ beforeRemoveVideo(file){
|
|
|
+ return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
+ },
|
|
|
// 清空表单
|
|
|
resetForm(formName) {
|
|
|
this.$refs[formName].resetFields();
|
|
|
this.formDialog.price = null;
|
|
|
this.agency = "";
|
|
|
this.fileList = [];
|
|
|
+ this.fileListVideo = [];
|
|
|
+ this.fileListAudio = [];
|
|
|
+ this.fileListOtheraudio = []
|
|
|
+ this.fileListDoc = [];
|
|
|
this.formDialog.description = "";
|
|
|
},
|
|
|
// 编辑书籍信息
|
|
@@ -815,7 +980,12 @@ export default {
|
|
|
});
|
|
|
this.rowIndex = index;
|
|
|
this.titleEdit = "编辑教材";
|
|
|
+ this.activeName="courseInfo";
|
|
|
this.fileList = [];
|
|
|
+ this.fileListVideo = [];
|
|
|
+ this.fileListAudio = [];
|
|
|
+ this.fileListOtheraudio = []
|
|
|
+ this.fileListDoc = [];
|
|
|
let MethodName = "book-book_manager-GetBook";
|
|
|
let data = {
|
|
|
id: row.id,
|
|
@@ -838,7 +1008,7 @@ export default {
|
|
|
publisher: res.publisher,
|
|
|
theme_color: res.theme_color,
|
|
|
edition: res.edition,
|
|
|
- type_id: res.type_id,
|
|
|
+ type_id: res.type_id,
|
|
|
};
|
|
|
sessionStorage.setItem("Bookdetail", JSON.stringify(this.formDialog));
|
|
|
if (res.picture_url) {
|
|
@@ -849,10 +1019,56 @@ export default {
|
|
|
this.fileList.push(obj);
|
|
|
}
|
|
|
this.agency = res.org_id;
|
|
|
+ let MethodNames = "book-resource_manager-GetBookResourceList";
|
|
|
+ let datas = {
|
|
|
+ book_id: row.id,
|
|
|
+ };
|
|
|
+ getContent(MethodNames, datas)
|
|
|
+ .then((res) => {
|
|
|
+ if(res.status==1){
|
|
|
+ this.formDialog.resource_file_id_list_video = []
|
|
|
+ this.formDialog.resource_file_id_list_audio = []
|
|
|
+ this.formDialog.resource_file_id_list_otheraudio = []
|
|
|
+ this.formDialog.resource_file_id_list_doc = []
|
|
|
+ res.video_list.forEach(item => {
|
|
|
+ let obj = {
|
|
|
+ name: item.file_name,
|
|
|
+ file_id: item.file_id
|
|
|
+ }
|
|
|
+ this.fileListVideo.push(obj)
|
|
|
+ this.formDialog.resource_file_id_list_video.push(item.file_id)
|
|
|
+ });
|
|
|
+ res.audio_list.forEach(item => {
|
|
|
+ let obj = {
|
|
|
+ name: item.file_name,
|
|
|
+ file_id: item.file_id
|
|
|
+ }
|
|
|
+ this.fileListAudio.push(obj)
|
|
|
+ this.formDialog.resource_file_id_list_audio.push(item.file_id)
|
|
|
+ });
|
|
|
+ res.otheraudio_list.forEach(item => {
|
|
|
+ let obj = {
|
|
|
+ name: item.file_name,
|
|
|
+ file_id: item.file_id
|
|
|
+ }
|
|
|
+ this.fileListOtheraudio.push(obj)
|
|
|
+ this.formDialog.resource_file_id_list_otheraudio.push(item.file_id)
|
|
|
+ });
|
|
|
+ res.doc_list.forEach(item => {
|
|
|
+ let obj = {
|
|
|
+ name: item.file_name,
|
|
|
+ file_id: item.file_id
|
|
|
+ }
|
|
|
+ this.fileListDoc.push(obj)
|
|
|
+ this.formDialog.resource_file_id_list_doc.push(item.file_id)
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
+
|
|
|
this.dialogFlag = true;
|
|
|
// 循环select 有没有选中数据 没有插入
|
|
|
},
|
|
@@ -908,6 +1124,10 @@ export default {
|
|
|
this.formDialog.price = null;
|
|
|
this.agency = "";
|
|
|
this.fileList = [];
|
|
|
+ this.fileListVideo = [];
|
|
|
+ this.fileListAudio = [];
|
|
|
+ this.fileListOtheraudio = []
|
|
|
+ this.fileListDoc = [];
|
|
|
this.formDialog.description = "";
|
|
|
done();
|
|
|
},
|
|
@@ -991,4 +1211,16 @@ export default {
|
|
|
.el-dialog {
|
|
|
font-size: 0;
|
|
|
}
|
|
|
+.courselistNPC{
|
|
|
+ .el-dialog__body{
|
|
|
+ padding: 0 20px;
|
|
|
+ }
|
|
|
+ .el-tabs__nav-wrap::after{
|
|
|
+ height: 0;
|
|
|
+ }
|
|
|
+ .el-upload-list{
|
|
|
+ max-height: 400px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|