index.vue 22 KB

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