index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="课堂分类" prop="cateId">
  5. <el-select v-model="queryParams.cateId" placeholder="请选择" clearable size="small"
  6. @change="getQuerySubCateList(queryParams.cateId)">
  7. <el-option
  8. v-for="dict in categoryOptions"
  9. :key="dict.dictValue"
  10. :label="dict.dictLabel"
  11. :value="dict.dictValue"
  12. />
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="课堂子分类" prop="subCateId">
  16. <el-select v-model="queryParams.subCateId" placeholder="请选择" clearable size="small">
  17. <el-option
  18. v-for="dict in querySubCateOptions"
  19. :key="dict.dictValue"
  20. :label="dict.dictLabel"
  21. :value="dict.dictValue"
  22. />
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item label="课堂名称" prop="courseName">
  26. <el-input
  27. v-model="queryParams.courseName"
  28. placeholder="请输入课堂名称"
  29. clearable
  30. size="small"
  31. @keyup.enter.native="handleQuery"
  32. />
  33. </el-form-item>
  34. <el-form-item label="关联的公司" prop="companyIds">
  35. <el-select v-model="queryParams.companyIdsList" multiple placeholder="请选择公司" filterable clearable style="width: 90%;">
  36. <el-option
  37. v-for="dict in companyOptions"
  38. :key="dict.dictValue"
  39. :label="dict.dictLabel"
  40. :value="dict.dictValue"
  41. />
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="课堂类型" prop="isPrivate" style="display: none">
  45. <el-select v-model="queryParams.isPrivate" placeholder="请选择" clearable size="small">
  46. <el-option
  47. v-for="dict in courseTypeOptions"
  48. :key="dict.dictValue"
  49. :label="dict.dictLabel"
  50. :value="dict.dictValue"
  51. />
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item>
  55. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  56. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  57. </el-form-item>
  58. </el-form>
  59. <el-row :gutter="10" class="mb8">
  60. <el-col :span="1.5">
  61. <el-button
  62. type="primary"
  63. plain
  64. icon="el-icon-plus"
  65. size="mini"
  66. @click="handleAdd"
  67. v-hasPermi="['course:userCourse:add']"
  68. >新增
  69. </el-button>
  70. </el-col>
  71. <el-col :span="1.5">
  72. <el-button
  73. type="success"
  74. plain
  75. icon="el-icon-edit"
  76. size="mini"
  77. :disabled="single"
  78. @click="handleUpdate"
  79. v-hasPermi="['course:userCourse:edit']"
  80. >修改
  81. </el-button>
  82. </el-col>
  83. <el-col :span="1.5">
  84. <el-button
  85. type="danger"
  86. plain
  87. icon="el-icon-delete"
  88. size="mini"
  89. :disabled="multiple"
  90. @click="handleDelete"
  91. v-hasPermi="['course:userCourse:remove']"
  92. >删除
  93. </el-button>
  94. </el-col>
  95. <el-col :span="1.5">
  96. <el-button
  97. type="warning"
  98. plain
  99. icon="el-icon-download"
  100. size="mini"
  101. :loading="exportLoading"
  102. @click="handleExport"
  103. v-hasPermi="['course:userCourse:export']"
  104. >导出
  105. </el-button>
  106. </el-col>
  107. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  108. </el-row>
  109. <el-table height="600" border v-loading="loading" :data="userCourseList" @selection-change="handleSelectionChange">
  110. <el-table-column type="selection" width="55" align="center"/>
  111. <el-table-column label="课程ID" align="center" prop="courseId"/>
  112. <el-table-column label="所属项目" align="center" prop="projectName"/>
  113. <el-table-column label="封面图片" align="center" prop="imgUrl" width="120">
  114. <template slot-scope="scope">
  115. <el-popover
  116. placement="right"
  117. title=""
  118. trigger="hover"
  119. >
  120. <img slot="reference" :src="scope.row.imgUrl" width="100">
  121. <img :src="scope.row.imgUrl" style="max-width: 300px;">
  122. </el-popover>
  123. </template>
  124. </el-table-column>
  125. <el-table-column label="课堂名称" align="center" show-overflow-tooltip prop="courseName"/>
  126. <el-table-column label="排序" align="center" prop="sort"/>
  127. <el-table-column label="分类名称" align="center" prop="cateName"/>
  128. <el-table-column label="子分类名称" align="center" prop="subCateName"/>
  129. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  130. <template slot-scope="scope">
  131. <el-button
  132. size="mini"
  133. type="text"
  134. @click="handleCatalog(scope.row)"
  135. v-hasPermi="['course:userCourse:cateMange']"
  136. >目录管理
  137. </el-button>
  138. <el-button
  139. size="mini"
  140. type="text"
  141. icon="el-icon-edit"
  142. @click="handleUpdate(scope.row)"
  143. v-hasPermi="['course:userCourse:edit']"
  144. >修改
  145. </el-button>
  146. <el-button
  147. size="mini"
  148. type="text"
  149. icon="el-icon-edit"
  150. @click="handleCopy(scope.row)"
  151. v-hasPermi="['course:userCourse:copy']"
  152. >复制
  153. </el-button>
  154. <el-button
  155. size="mini"
  156. type="text"
  157. icon="el-icon-delete"
  158. @click="handleDelete(scope.row)"
  159. v-hasPermi="['course:userCourse:remove']"
  160. >删除
  161. </el-button>
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. <pagination
  166. v-show="total>0"
  167. :total="total"
  168. :page.sync="queryParams.pageNum"
  169. :limit.sync="queryParams.pageSize"
  170. @pagination="getList"
  171. />
  172. <!-- 添加或修改课程对话框 -->
  173. <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
  174. <el-form ref="form" :model="form" :rules="rules" label-width="110px">
  175. <el-row>
  176. <el-form-item label="所属项目" prop="project">
  177. <el-select v-model="form.project" placeholder="请选择项目" filterable clearable size="small">
  178. <el-option
  179. v-for="dict in projectOptions"
  180. :key="dict.dictValue"
  181. :label="dict.dictLabel"
  182. :value="dict.dictValue"
  183. />
  184. </el-select>
  185. </el-form-item>
  186. </el-row>
  187. <el-row>
  188. <el-col :span="8">
  189. <el-form-item label="课堂名称" prop="courseName">
  190. <el-input v-model="form.courseName" placeholder="请输入课堂名称"/>
  191. </el-form-item>
  192. </el-col>
  193. <el-col :span="8">
  194. <el-form-item label="课堂分类" prop="cateId">
  195. <el-select v-model="form.cateId" placeholder="请选择" clearable size="small"
  196. @change="getSubCateList(form.cateId)">
  197. <el-option
  198. v-for="dict in categoryOptions"
  199. :key="dict.dictValue"
  200. :label="dict.dictLabel"
  201. :value="dict.dictValue"
  202. />
  203. </el-select>
  204. </el-form-item>
  205. </el-col>
  206. <el-col :span="8">
  207. <el-form-item label="课堂子分类" prop="subCateId">
  208. <el-select v-model="form.subCateId" placeholder="请选择" clearable size="small">
  209. <el-option
  210. v-for="dict in subCategoryOptions"
  211. :key="dict.dictValue"
  212. :label="dict.dictLabel"
  213. :value="dict.dictValue"
  214. />
  215. </el-select>
  216. </el-form-item>
  217. </el-col>
  218. </el-row>
  219. <el-row>
  220. <el-col :span="24">
  221. <el-form-item label="排序" prop="sort">
  222. <el-input-number v-model="form.sort" :min="0" label="排序"></el-input-number>
  223. </el-form-item>
  224. </el-col>
  225. </el-row>
  226. <el-row>
  227. <el-col :span="24">
  228. <el-form-item label="课堂简介" prop="description">
  229. <el-input v-model="form.description" type="textarea" :rows="2" placeholder="请输入课堂简介"/>
  230. </el-form-item>
  231. </el-col>
  232. </el-row>
  233. <el-form-item label="课程封面" prop="imgUrl">
  234. <ImageUpload v-model="form.imgUrl" type="image" :num="10" :width="150" :height="150"/>
  235. </el-form-item>
  236. <el-form-item label="关联公司" prop="tags">
  237. <el-select v-model="companyIds" multiple placeholder="请选择公司" filterable clearable style="width: 90%;">
  238. <el-option
  239. v-for="dict in companyOptions"
  240. :key="dict.dictValue"
  241. :label="dict.dictLabel"
  242. :value="dict.dictValue"
  243. />
  244. </el-select>
  245. </el-form-item>
  246. </el-form>
  247. <div slot="footer" class="dialog-footer">
  248. <el-button type="primary" @click="submitForm">确 定</el-button>
  249. <el-button @click="cancel">取 消</el-button>
  250. </div>
  251. </el-dialog>
  252. <el-drawer
  253. :with-header="false"
  254. size="75%"
  255. :title="show.title" :visible.sync="show.open" append-to-body>
  256. <userCourseCatalogDetails ref="userCourseCatalogDetails"/>
  257. </el-drawer>
  258. </div>
  259. </template>
  260. <script>
  261. import {
  262. listUserCourse,
  263. getUserCourse,
  264. delUserCourse,
  265. addUserCourse,
  266. updateUserCourse,
  267. exportUserCourse,
  268. updateIsShow,
  269. copyUserCourse,
  270. putOn,
  271. pullOff
  272. } from "@/api/course/userCourse";
  273. import {getSelectableRange} from "@/api/qw/sopTemp";
  274. import Treeselect from "@riophae/vue-treeselect";
  275. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  276. import Editor from '@/components/Editor/wang';
  277. import ImageUpload from '@/components/ImageUpload/index';
  278. import {listBySearch} from "@/api/course/userTalent";
  279. import userCourseCatalogDetails from '../../components/course/userCourseCatalogDetails.vue';
  280. import {getAllCourseCategoryList, getCatePidList, getCateListByPid} from "@/api/course/userCourseCategory";
  281. import {allList} from "@/api/company/company";
  282. export default {
  283. name: "UserCourse",
  284. components: {
  285. Treeselect,
  286. Editor, ImageUpload, userCourseCatalogDetails
  287. },
  288. data() {
  289. return {
  290. talentParam: {
  291. phone: null,
  292. talentId: null
  293. },
  294. talentList: [],
  295. startTimeRange: [],
  296. show: {
  297. title: "目录管理",
  298. open: false
  299. },
  300. activeName: "1",
  301. projectOptions: [],
  302. tagsOptions: [],
  303. tags: [],
  304. companyIds: [],
  305. courseTypeOptions: [],
  306. orOptions: [],
  307. specShowOptions: [],
  308. specTypeOptions: [],
  309. categoryOptions: [],
  310. subCategoryOptions: [],
  311. querySubCateOptions: [],
  312. // 遮罩层
  313. loading: true,
  314. // 导出遮罩层
  315. exportLoading: false,
  316. // 选中数组
  317. ids: [],
  318. // 非单个禁用
  319. single: true,
  320. // 非多个禁用
  321. multiple: true,
  322. // 显示搜索条件
  323. showSearch: true,
  324. // 总条数
  325. total: 0,
  326. // 课程表格数据
  327. userCourseList: [],
  328. companyOptions: [],
  329. // 弹出层标题
  330. title: "",
  331. // 是否显示弹出层
  332. open: false,
  333. // 查询参数
  334. queryParams: {
  335. pageNum: 1,
  336. pageSize: 10,
  337. cateId: null,
  338. subCateId: null,
  339. title: null,
  340. imgUrl: null,
  341. userId: null,
  342. sort: null,
  343. status: null,
  344. isVip: null,
  345. isHot: null,
  346. isShow: "1",
  347. views: null,
  348. duration: null,
  349. description: null,
  350. hotRanking: null,
  351. integral: null,
  352. price: null,
  353. isPrivate: 1,
  354. companyIdsList:[],
  355. },
  356. // 表单参数
  357. form: {},
  358. // 表单校验
  359. rules: {
  360. courseName: [
  361. {required: true, message: "课堂名称不能为空", trigger: "blur"}
  362. ],
  363. imgUrl: [
  364. {required: true, message: "封面图片不能为空", trigger: "blur"}
  365. ],
  366. isTui: [
  367. {required: true, message: "是否推荐不能为空", trigger: "blur"}
  368. ],
  369. isBest: [
  370. {required: true, message: "是否精选不能为空", trigger: "blur"}
  371. ],
  372. isFast: [
  373. {required: true, message: "是否允许快进不能为空", trigger: "blur"}
  374. ],
  375. isAutoPlay: [
  376. {required: true, message: "是否自动播放不能为空", trigger: "blur"}
  377. ],
  378. sort: [
  379. {required: true, message: "排序不能为空", trigger: "blur"}
  380. ],
  381. views: [
  382. {required: true, message: "播放量不能为空", trigger: "blur"}
  383. ],
  384. likes: [
  385. {required: true, message: "点赞数不能为空", trigger: "blur"}
  386. ],
  387. favoriteNum: [
  388. {required: true, message: "收藏数不能为空", trigger: "blur"}
  389. ],
  390. shares: [
  391. {required: true, message: "分享数不能为空", trigger: "blur"}
  392. ],
  393. isIntegral: [
  394. {required: true, message: "是否允许积分兑换不能为空", trigger: "blur"}
  395. ],
  396. isShow: [
  397. {required: true, message: "上架状态不能为空", trigger: "blur"}
  398. ],
  399. isPrivate: [
  400. {required: true, message: "公私域不能为空", trigger: "blur"}
  401. ],
  402. integral: [
  403. {required: true, message: "小节兑换积分不能为空", trigger: "blur"}
  404. ],
  405. }
  406. };
  407. },
  408. created() {
  409. this.getList();
  410. getCatePidList().then(response => {
  411. this.categoryOptions = response.data;
  412. });
  413. getSelectableRange().then(e => {
  414. this.startTimeRange = e.data;
  415. })
  416. // this.getTreeselect();
  417. this.getDicts("sys_spec_show").then(response => {
  418. this.specShowOptions = response.data;
  419. });
  420. this.getDicts("sys_spec_type").then(response => {
  421. this.specTypeOptions = response.data;
  422. });
  423. this.getDicts("sys_course_type").then(response => {
  424. this.courseTypeOptions = response.data;
  425. });
  426. this.getDicts("sys_course_project").then(response => {
  427. this.projectOptions = response.data;
  428. });
  429. this.getDicts("sys_course_tags").then(response => {
  430. this.tagsOptions = response.data;
  431. });
  432. this.getDicts("sys_company_or").then(response => {
  433. this.orOptions = response.data;
  434. });
  435. allList().then(response => {
  436. this.companyOptions = response.rows;
  437. });
  438. },
  439. methods: {
  440. selectTalent() {
  441. },
  442. talentMethod(query) {
  443. if (query !== '') {
  444. this.talentParam.phone = query;
  445. listBySearch(this.talentParam).then(response => {
  446. this.talentList = response.data;
  447. });
  448. }
  449. },
  450. getSubCateList(pid) {
  451. this.form.subCateId = null;
  452. if (pid == '') {
  453. this.subCategoryOptions = [];
  454. return
  455. }
  456. getCateListByPid(pid).then(response => {
  457. this.subCategoryOptions = response.data;
  458. });
  459. },
  460. getQuerySubCateList(pid) {
  461. this.queryParams.subCateId = null;
  462. if (pid == '') {
  463. this.querySubCateOptions = [];
  464. return
  465. }
  466. this.queryParams.subCateId = null;
  467. getCateListByPid(pid).then(response => {
  468. this.querySubCateOptions = response.data;
  469. });
  470. },
  471. handleShow(row) {
  472. var isShowValue = row.isShow === 0 ? 1 : 0;
  473. var course = {courseId: row.courseId, isShow: isShowValue};
  474. updateIsShow(course).then(response => {
  475. this.msgSuccess("修改成功");
  476. this.getList();
  477. });
  478. },
  479. handleCatalog(row) {
  480. const courseId = row.courseId;
  481. this.show.open = true;
  482. setTimeout(() => {
  483. this.$refs.userCourseCatalogDetails.getDetails(courseId, row.courseName, row.isPrivate);
  484. }, 200);
  485. },
  486. /** 转换课堂分类数据结构 */
  487. normalizer(node) {
  488. if (node.children && !node.children.length) {
  489. delete node.children;
  490. }
  491. return {
  492. id: node.cateId,
  493. label: node.cateName,
  494. children: node.children
  495. };
  496. },
  497. getTreeselect() {
  498. getAllCourseCategoryList().then(response => {
  499. this.categoryOptions = [];
  500. const data = this.handleTree(response.data, "cateId", "pid");
  501. this.categoryOptions = data;
  502. });
  503. },
  504. /** 查询课程列表 */
  505. getList() {
  506. this.loading = true;
  507. listUserCourse(this.queryParams).then(response => {
  508. this.userCourseList = response.rows;
  509. this.total = response.total;
  510. this.loading = false;
  511. });
  512. },
  513. // 取消按钮
  514. cancel() {
  515. this.open = false;
  516. this.reset();
  517. },
  518. // 表单重置
  519. reset() {
  520. this.form = {
  521. courseId: null,
  522. cateId: null,
  523. subCateId: null,
  524. title: null,
  525. imgUrl: null,
  526. secondImg: null,
  527. userId: null,
  528. sort: null,
  529. createTime: null,
  530. updateTime: null,
  531. status: 0,
  532. isVip: null,
  533. isAutoPlay: "1",
  534. isIntegral: "0",
  535. isShow: "1",
  536. isFast: "1",
  537. isTui: "1",
  538. isBest: "1",
  539. isNext: "1",
  540. isPrivate: "1",
  541. views: 100000,
  542. duration: null,
  543. description: null,
  544. hotRanking: null,
  545. integral: null,
  546. price: null,
  547. likes: 100000,
  548. shares: 100000,
  549. favoriteNum: 100000,
  550. hotNum: 100000,
  551. };
  552. this.tags = [];
  553. this.subCategoryOptions = []
  554. this.companyIds = []
  555. this.resetForm("form");
  556. },
  557. /** 搜索按钮操作 */
  558. handleQuery() {
  559. this.queryParams.pageNum = 1;
  560. this.getList();
  561. },
  562. /** 重置按钮操作 */
  563. resetQuery() {
  564. this.resetForm("queryForm");
  565. this.queryParams.isShow = this.activeName
  566. this.handleQuery();
  567. },
  568. // 多选框选中数据
  569. handleSelectionChange(selection) {
  570. this.ids = selection.map(item => item.courseId)
  571. this.single = selection.length !== 1
  572. this.multiple = !selection.length
  573. },
  574. /** 新增按钮操作 */
  575. handleAdd() {
  576. this.reset();
  577. this.talentList = [];
  578. this.open = true;
  579. this.title = "添加课程";
  580. },
  581. /** 修改按钮操作 */
  582. handleUpdate(row) {
  583. this.reset();
  584. this.talentList = [];
  585. const courseId = row.courseId || this.ids
  586. getUserCourse(courseId).then(response => {
  587. this.form = response.data;
  588. // this.form.cateId = response.data.cateId.toString();
  589. if (this.form.cateId) {
  590. getCateListByPid(this.form.cateId).then(response => {
  591. this.subCategoryOptions = response.data;
  592. });
  593. }
  594. // this.form.courseType = response.data.courseType.toString();
  595. if (response.data.project != null) {
  596. this.form.project = response.data.project.toString();
  597. }
  598. if (response.data.tags != null) {
  599. this.tags = response.data.tags.split(",")
  600. }
  601. this.form.isAutoPlay = response.data.isAutoPlay.toString();
  602. this.form.isShow = response.data.isShow.toString();
  603. this.form.isBest = response.data.isBest.toString();
  604. this.form.isFast = response.data.isFast.toString();
  605. this.form.isIntegral = response.data.isIntegral.toString();
  606. this.form.isTui = response.data.isTui.toString();
  607. this.form.isNext = response.data.isNext.toString();
  608. this.form.isPrivate = response.data.isPrivate.toString();
  609. this.talentParam.talentId = response.data.talentId;
  610. if (this.form.companyIds != null) {
  611. this.companyIds = ((this.form.companyIds).split(",").map(Number))
  612. } else {
  613. this.companyIds = []
  614. }
  615. listBySearch(this.talentParam).then(response => {
  616. this.talentList = response.data;
  617. });
  618. this.open = true;
  619. this.title = "修改课程";
  620. });
  621. },
  622. /** 提交按钮 */
  623. submitForm() {
  624. this.$refs["form"].validate(valid => {
  625. if (valid) {
  626. this.form.companyIds = this.companyIds.toString()
  627. // 私域课程
  628. this.form.isPrivate = 1
  629. if (this.form.courseId != null) {
  630. updateUserCourse(this.form).then(response => {
  631. this.msgSuccess("修改成功");
  632. this.open = false;
  633. this.getList();
  634. });
  635. } else {
  636. addUserCourse(this.form).then(response => {
  637. this.msgSuccess("新增成功");
  638. this.open = false;
  639. this.getList();
  640. });
  641. }
  642. }
  643. });
  644. },
  645. /** 复制按钮操作 */
  646. handleCopy(row) {
  647. const courseId = row.courseId;
  648. this.$confirm('是否确认复制课程编号为"' + courseId + '"的数据项?', "警告", {
  649. confirmButtonText: "确定",
  650. cancelButtonText: "取消",
  651. type: "warning"
  652. }).then(function () {
  653. return copyUserCourse(courseId);
  654. }).then(() => {
  655. this.getList();
  656. this.msgSuccess("复制成功");
  657. }).catch(() => {
  658. });
  659. },
  660. /** 删除按钮操作 */
  661. handleDelete(row) {
  662. const courseIds = row.courseId || this.ids;
  663. this.$confirm('是否确认删除课程编号为"' + courseIds + '"的数据项?', "警告", {
  664. confirmButtonText: "确定",
  665. cancelButtonText: "取消",
  666. type: "warning"
  667. }).then(function () {
  668. return delUserCourse(courseIds);
  669. }).then(() => {
  670. this.getList();
  671. this.msgSuccess("删除成功");
  672. }).catch(() => {
  673. });
  674. },
  675. /** 导出按钮操作 */
  676. handleExport() {
  677. const queryParams = this.queryParams;
  678. this.$confirm('是否确认导出所有课程数据项?', "警告", {
  679. confirmButtonText: "确定",
  680. cancelButtonText: "取消",
  681. type: "warning"
  682. }).then(() => {
  683. this.exportLoading = true;
  684. return exportUserCourse(queryParams);
  685. }).then(response => {
  686. this.download(response.msg);
  687. this.exportLoading = false;
  688. }).catch(() => {
  689. });
  690. },
  691. putOn() {
  692. const courseIds = this.ids;
  693. if (courseIds == null || courseIds == "") {
  694. return this.$message("未选择课程");
  695. }
  696. this.$confirm('是否确认批量上架课程?', "警告", {
  697. confirmButtonText: "确定",
  698. cancelButtonText: "取消",
  699. type: "warning"
  700. }).then(function () {
  701. return putOn(courseIds);
  702. }).then(() => {
  703. this.getList();
  704. this.msgSuccess("上架成功");
  705. }).catch(function () {
  706. });
  707. },
  708. pullOff() {
  709. const courseIds = this.ids;
  710. if (courseIds == null || courseIds == "") {
  711. return this.$message("未选择课程");
  712. }
  713. this.$confirm('是否确认批量下架课程?', "警告", {
  714. confirmButtonText: "确定",
  715. cancelButtonText: "取消",
  716. type: "warning"
  717. }).then(function () {
  718. return pullOff(courseIds);
  719. }).then(() => {
  720. this.getList();
  721. this.msgSuccess("下架成功");
  722. }).catch(function () {
  723. });
  724. }
  725. }
  726. };
  727. </script>