index.vue 22 KB

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