index.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087
  1. <template>
  2. <div id="flow">
  3. <search-box-new
  4. ref="searchBox"
  5. :formData="formData"
  6. :formList="formList"
  7. @search="search"
  8. @init="init"
  9. />
  10. <table-list
  11. rowKey="id"
  12. ref="tableList"
  13. :tableSets="tableSet"
  14. :tableData="tableData"
  15. :navText="navText"
  16. @addClick="addClick"
  17. :loading="loading"
  18. @editInfo="editInfo"
  19. >
  20. <template slot="customize">
  21. <el-button size="small" type="warning" @click="PLDel"
  22. >批量删除</el-button
  23. >
  24. <el-button size="small" type="success" @click="moreActive"
  25. >同步BL频道</el-button
  26. >
  27. </template>
  28. <template slot="btn" slot-scope="props">
  29. <el-button type="text" @click="addClick(props.scope.row, 0)"
  30. >修改</el-button
  31. >
  32. <el-button type="text" @click="del(props.scope.row)">删除</el-button>
  33. </template>
  34. </table-list>
  35. <pagination
  36. :total="total"
  37. :pageSize="formData.pageSize"
  38. :currentPage="formData.pageNum"
  39. @handleSizeChange="handleSizeChange"
  40. @handleCurrentChange="handleCurrentChange"
  41. />
  42. <el-dialog
  43. @closed="loadingClose"
  44. :visible.sync="dialogVisible"
  45. width="630px"
  46. :show-close="false"
  47. :close-on-click-modal="false"
  48. >
  49. <div slot="title" class="hearders">
  50. <div class="leftTitle">
  51. {{ statusPop === 1 ? "添加" : statusPop === 0 ? "修改" : "详情" }}
  52. </div>
  53. <div class="rightBoxs">
  54. <img src="@/assets/images/Close@2x.png" alt="" @click="close" />
  55. </div>
  56. </div>
  57. <div>
  58. <el-form
  59. label-position="right"
  60. label-width="110px"
  61. :model="listData"
  62. :rules="rules"
  63. ref="listData"
  64. >
  65. <template v-for="(items, indexs) in listitem">
  66. <el-form-item
  67. :key="indexs"
  68. :label="items.label"
  69. :prop="items.prop"
  70. v-if="pdTypes(items)"
  71. >
  72. <el-radio-group
  73. v-if="items.scope === 'status'"
  74. v-model="listData[items.prop]"
  75. >
  76. <el-radio
  77. v-for="(item, index) in items.options"
  78. :key="index"
  79. :label="item.value"
  80. :disabled="statusPop === 2"
  81. >{{ item.label }}</el-radio
  82. >
  83. </el-radio-group>
  84. <el-input
  85. :disabled="statusPop === 2"
  86. v-else-if="items.scope === 'textarea'"
  87. type="textarea"
  88. v-model="listData[items.prop]"
  89. ></el-input>
  90. <div v-else-if="items.scope === 'activeType'">
  91. <div :class="changeHeight ? 'ach' : 'clh'">
  92. <div
  93. v-for="(item, index) in zhType"
  94. :key="index"
  95. class="listBoxStys"
  96. >
  97. {{
  98. item.educationName +
  99. " - " +
  100. item.projectName +
  101. "-" +
  102. item.businessName
  103. }}
  104. <i
  105. class="el-icon-error closeIcons"
  106. @click="closeType(item.id)"
  107. ></i>
  108. </div>
  109. </div>
  110. <el-button
  111. size="mini"
  112. v-if="zhType.length > 1"
  113. @click="changeType"
  114. >{{ changeHeight ? "展开" : "关闭" }}</el-button
  115. ><el-button
  116. size="mini"
  117. v-if="cauType.length > 0"
  118. @click="allclear"
  119. >清空</el-button
  120. >
  121. </div>
  122. <div
  123. v-else-if="items.scope === 'certificate'"
  124. style="display: flex; align-items: center"
  125. >
  126. <el-select
  127. v-model="eduType"
  128. placeholder="请选择教育类型"
  129. @change="eduChange"
  130. >
  131. <el-option
  132. v-for="item in itemOption1"
  133. :key="item.value"
  134. :label="item.label"
  135. :value="item.value"
  136. >
  137. </el-option>
  138. </el-select>
  139. <el-popover
  140. placement="bottom"
  141. trigger="click"
  142. :disabled="eduType ? false : true"
  143. >
  144. <el-checkbox
  145. v-model="checkAll"
  146. @change="handleCheckAllChange"
  147. :indeterminate="isIndeterminate"
  148. >全选</el-checkbox
  149. >
  150. <el-checkbox-group
  151. v-model="cauType"
  152. class="checkboxSty"
  153. @change="handleCheckedCitiesChange"
  154. >
  155. <el-checkbox
  156. v-for="(item, index) in itemOption2"
  157. :label="item.id"
  158. :key="index"
  159. >{{
  160. item.projectName + "-" + item.businessName
  161. }}</el-checkbox
  162. >
  163. </el-checkbox-group>
  164. <el-button
  165. slot="reference"
  166. style="margin-left: 12px"
  167. @click="getMessage"
  168. >请选择业务层次</el-button
  169. >
  170. </el-popover>
  171. <span style="margin-left: 10px">注:可多选</span>
  172. </div>
  173. <el-select
  174. v-else-if="items.scope === 'select'"
  175. v-model="listData[items.prop]"
  176. >
  177. <el-option
  178. v-for="(item, index) in items.options"
  179. :key="index"
  180. :label="item.label"
  181. :value="item.value"
  182. >
  183. </el-option>
  184. </el-select>
  185. <div v-else-if="items.scope === 'showText'">
  186. <el-input
  187. :disabled="statusPop === 2"
  188. v-model="listData[items.prop]"
  189. ></el-input>
  190. <div>
  191. {{
  192. listData["streamingType"] === 1
  193. ? items.ch
  194. : listData["streamingType"] === 2 ||
  195. listData["streamingType"] === 3
  196. ? items.ch1
  197. : ""
  198. }}
  199. </div>
  200. </div>
  201. <div v-else>
  202. <el-input
  203. :disabled="statusPop === 2"
  204. v-model="listData[items.prop]"
  205. ></el-input>
  206. <div v-if="items.ch">{{ items.ch }}</div>
  207. </div>
  208. </el-form-item>
  209. </template>
  210. </el-form>
  211. </div>
  212. <span slot="footer" class="dialog-footer">
  213. <el-button @click="close">取 消</el-button>
  214. <el-button
  215. type="primary"
  216. v-if="statusPop !== 2"
  217. :loading="disabledBtn"
  218. @click="submit('listData')"
  219. >确 定</el-button
  220. >
  221. </span>
  222. </el-dialog>
  223. <el-dialog
  224. @closed="loadingClose"
  225. :visible.sync="disBoxs"
  226. width="440px"
  227. :show-close="false"
  228. :close-on-click-modal="false"
  229. >
  230. <div slot="title" class="hearders">
  231. <div class="leftTitle">选择同步BL频道分类</div>
  232. <div class="rightBoxs">
  233. <img
  234. src="@/assets/images/Close@2x.png"
  235. alt=""
  236. @click="disBoxs = false"
  237. />
  238. </div>
  239. </div>
  240. <div class="max-heightSty">
  241. <el-tree :props="props" :load="loadNode" lazy>
  242. <span class="custom-tree-node" slot-scope="{ node, data }">
  243. <div
  244. class="radioSty"
  245. @click.stop="cataid = data.cataid"
  246. :style="
  247. data.cataid === cataid ? 'border-color:#F56C6C!important;' : ''
  248. "
  249. >
  250. <transition name="fade">
  251. <div v-if="data.cataid === cataid" class="isActives"></div>
  252. </transition>
  253. </div>
  254. <span>{{ node.label }}</span>
  255. </span>
  256. </el-tree>
  257. </div>
  258. <!-- <div class="mat-TOP">
  259. <el-radio-group v-model="streamAddType">
  260. <el-radio :label="1">正式</el-radio>
  261. <el-radio :label="2">测试</el-radio>
  262. </el-radio-group>
  263. </div> -->
  264. <span slot="footer" class="dialog-footer">
  265. <el-button @click="disBoxs = false">取 消</el-button>
  266. <el-button @click="submitForms" :loading="disabledBtn">确 定</el-button>
  267. </span>
  268. </el-dialog>
  269. </div>
  270. </template>
  271. <script>
  272. import searchBoxNew from "@/components/searchBoxNew";
  273. import tableList from "@/components/tableList";
  274. import pagination from "@/components/pagination";
  275. export default {
  276. name: "Flow",
  277. components: { searchBoxNew, tableList, pagination },
  278. data() {
  279. return {
  280. isIndeterminate: false,
  281. checkAll: false,
  282. disBoxs: false, //弹窗Bool
  283. changeHeight: true,
  284. loading: false, //当前表单加载是否加载动画
  285. navText: {
  286. title: "流地址管理",
  287. index: 0,
  288. ch: "条",
  289. num: true,
  290. border: true,
  291. choice: true,
  292. addHide: false,
  293. openCheckMore: true,
  294. backFatherBtn: {
  295. status: false,
  296. title: "未定义",
  297. },
  298. },
  299. // 表单
  300. tableSet: [
  301. {
  302. label: "流地址编码",
  303. prop: "code",
  304. hidden: true,
  305. },
  306. {
  307. label: "流地址名称",
  308. prop: "streamingName",
  309. hidden: true,
  310. scope: "editInfo",
  311. },
  312. {
  313. label: "直播/录播/回放地址",
  314. prop: "streamingType",
  315. prop1: "liveUrl",
  316. prop2: "recordingVideoId",
  317. prop3: "playbackUrl",
  318. hidden: true,
  319. scope: "urlStatus",
  320. },
  321. {
  322. label: "适用业务层级",
  323. prop: "businessList",
  324. hidden: true,
  325. scope: "mapTypesBUS",
  326. },
  327. {
  328. label: "视频类型",
  329. prop: "streamingType",
  330. hidden: true,
  331. scope: "sectionTypes",
  332. width: "100px",
  333. },
  334. {
  335. label: "最后编辑时间",
  336. prop: "updateTime",
  337. scope: "aTimeList",
  338. hidden: true,
  339. },
  340. {
  341. label: "创建时间",
  342. prop: "createTime",
  343. scope: "aTimeList",
  344. hidden: true,
  345. },
  346. // {
  347. // label: "流地址类型",
  348. // prop: "streamingAddressType",
  349. // hidden: true,
  350. // scope: "streamType",
  351. // },
  352. ],
  353. tableData: [], //表单数据
  354. //搜索
  355. formList: [
  356. {
  357. prop: "educationTypeId",
  358. placeholder: "教育类型",
  359. scope: "educationType",
  360. },
  361. {
  362. prop: "businessId",
  363. placeholder: "业务层次",
  364. scope: "businessLevel",
  365. edu: "educationTypeId",
  366. },
  367. {
  368. prop: "streamingType",
  369. placeholder: "视频类型",
  370. scope: "select",
  371. options: [
  372. {
  373. label: "直播",
  374. value: 1,
  375. },
  376. {
  377. label: "录播",
  378. value: 2,
  379. },
  380. {
  381. label: "回放",
  382. value: 3,
  383. },
  384. ],
  385. },
  386. // {
  387. // prop: "streamingAddressType",
  388. // placeholder: "流地址类型",
  389. // scope: "select",
  390. // options: [
  391. // {
  392. // label: "正式",
  393. // value: 1,
  394. // },
  395. // {
  396. // label: "测试",
  397. // value: 2,
  398. // },
  399. // ],
  400. // },
  401. {
  402. prop: "streamingName",
  403. placeholder: "请输入流地址名称",
  404. },
  405. ],
  406. formData: {
  407. status: "0,1",
  408. pageSize: 10,
  409. pageNum: 1,
  410. },
  411. total: 0, //一共多少条
  412. options1: [],
  413. options2: [],
  414. courseProjectType: [],
  415. itemOption1: [],
  416. itemOption2: [],
  417. eduType: "",
  418. cauType: [],
  419. zhType: [],
  420. // 弹窗字段
  421. listitem: [
  422. {
  423. label: "适用业务层级",
  424. scope: "certificate",
  425. },
  426. {
  427. label: "",
  428. scope: "activeType",
  429. },
  430. {
  431. label: "视频类型",
  432. prop: "streamingType",
  433. scope: "select",
  434. options: [
  435. {
  436. label: "直播",
  437. value: 1,
  438. },
  439. {
  440. label: "录播",
  441. value: 2,
  442. },
  443. {
  444. label: "回放",
  445. value: 3,
  446. },
  447. ],
  448. },
  449. {
  450. label: "流地址名称",
  451. prop: "streamingName",
  452. scope: "showText",
  453. ch: "注:请填写第三方直播间的直播名称",
  454. ch1: "注:请填写与节相关的名称",
  455. },
  456. {
  457. label: "录播地址",
  458. prop: "recordingVideoId",
  459. hide: "one",
  460. },
  461. {
  462. label: "回放地址",
  463. prop: "playbackUrl",
  464. hide: "three",
  465. },
  466. {
  467. label: "直播间频道号",
  468. prop: "liveChannelNumber",
  469. hide: "two",
  470. ch: "注:请填写第三方直播间的频道号",
  471. },
  472. {
  473. label: " 推流地址",
  474. prop: "livePushUrl",
  475. hide: "two",
  476. },
  477. {
  478. label: " 直播拉流(播放)地址",
  479. prop: "livePullUrl",
  480. hide: "two",
  481. },
  482. {
  483. label: "直播地址",
  484. prop: "liveUrl",
  485. hide: "two",
  486. },
  487. // {
  488. // label: "流地址类型",
  489. // prop: "streamingAddressType",
  490. // scope: "select",
  491. // options: [
  492. // {
  493. // label: "正式",
  494. // value: 1,
  495. // },
  496. // {
  497. // label: "测试",
  498. // value: 2,
  499. // },
  500. // ],
  501. // },
  502. {
  503. label: "描述",
  504. prop: "introduce",
  505. scope: "textarea",
  506. },
  507. ],
  508. // 弹窗数据
  509. listData: {},
  510. statusPop: -1,
  511. dialogVisible: false,
  512. //表单验证
  513. rules: {
  514. streamingType: [
  515. {
  516. required: true,
  517. message: "请选择视频类型",
  518. trigger: ["change", "blur"],
  519. },
  520. ],
  521. streamingName: [
  522. { required: true, message: "请输入流地址名称", trigger: "blur" },
  523. ],
  524. liveChannelNumber: [
  525. { required: true, message: "请输入直播间频道号", trigger: "blur" },
  526. ],
  527. // livePushUrl: [
  528. // { required: true, message: "请输入推流地址", trigger: "blur" },
  529. // ],
  530. // livePullUrl: [
  531. // { required: true, message: "请输入直播拉流(播放)地址", trigger: "blur" },
  532. // ],
  533. liveUrl: [
  534. { required: true, message: "请输入直播地址", trigger: "blur" },
  535. ],
  536. recordingVideoId: [
  537. { required: true, message: "请输入录播地址", trigger: "blur" },
  538. ],
  539. playbackUrl: [
  540. { required: true, message: "请输入回放地址", trigger: "blur" },
  541. ],
  542. // streamingAddressType: [
  543. // {
  544. // required: true,
  545. // message: "请选择流地址类型",
  546. // trigger: ["change", "blur"],
  547. // },
  548. // ],
  549. },
  550. props: {
  551. label: "text",
  552. children: "children",
  553. },
  554. cataid: "",
  555. // streamAddType: "",
  556. disabledBtn: false,
  557. };
  558. },
  559. watch: {
  560. cauType: function () {
  561. this.changeTypes();
  562. },
  563. },
  564. mounted() {
  565. this.search();
  566. this.initOptions();
  567. },
  568. activated() {
  569. this.search();
  570. this.initOptions();
  571. },
  572. methods: {
  573. PLDel() {
  574. if (!this.$refs.tableList.allCheckData.length) {
  575. this.$message.warning("请勾选数据");
  576. return;
  577. }
  578. const ary = this.$refs.tableList.allCheckData.map((item) => {
  579. return item.id;
  580. });
  581. this.del(ary, true);
  582. },
  583. allclear(){
  584. this.cauType = []
  585. this.handleCheckedCitiesChange()
  586. },
  587. handleCheckedCitiesChange() {
  588. let nid = this.itemOption2.map((item) => {
  589. return item.id;
  590. });
  591. this.checkAll = nid.every((item) => {
  592. if (this.cauType.includes(item)) {
  593. this.isIndeterminate = true;
  594. return true;
  595. } else {
  596. return false;
  597. }
  598. });
  599. if (this.cauType.length) {
  600. this.isIndeterminate = true;
  601. } else {
  602. this.isIndeterminate = false;
  603. }
  604. if (this.checkAll) {
  605. this.isIndeterminate = false;
  606. }
  607. },
  608. handleCheckAllChange(val) {
  609. if (val) {
  610. let nid = this.itemOption2.map((item) => {
  611. return item.id;
  612. });
  613. let arrays = this.cauType.concat(nid);
  614. this.cauType = this.setFunc(arrays);
  615. this.isIndeterminate = false;
  616. } else {
  617. let nid = this.itemOption2.map((item) => {
  618. return item.id;
  619. });
  620. let newArr = [];
  621. this.cauType.forEach((item) => {
  622. if (!nid.includes(item)) {
  623. newArr.push(item);
  624. }
  625. });
  626. this.cauType = newArr;
  627. console.log(this.cauType);
  628. if (this.cauType.length) {
  629. this.isIndeterminate = true;
  630. } else {
  631. this.isIndeterminate = false;
  632. }
  633. }
  634. },
  635. setFunc(arr) {
  636. var arrays = [];
  637. for (let i = 0; i < arr.length; i++) {
  638. if (!arrays.includes(arr[i])) {
  639. arrays.push(arr[i]);
  640. }
  641. }
  642. return arrays;
  643. },
  644. loadingClose() {
  645. this.disabledBtn = false;
  646. },
  647. loadNode(node, resolve) {
  648. console.log(node);
  649. if (node.level === 0) {
  650. this.$api.obtainpolyvvideosignlistCata({ parentid: 0 }).then((res) => {
  651. return resolve(res.rows);
  652. });
  653. }
  654. if (node.level >= 1) {
  655. this.$api
  656. .obtainpolyvvideosignlistCata({ parentid: node.data.cataid })
  657. .then((res) => {
  658. return resolve(res.rows);
  659. });
  660. }
  661. },
  662. submitForms() {
  663. if (!this.cataid) {
  664. this.$message.warning("请勾选需要同步的频道");
  665. return;
  666. }
  667. this.$modal.loading("正在同步数据,请稍等...");
  668. this.disabledBtn = true;
  669. this.$api
  670. .uploadPolyvvideocata({
  671. cataid: this.cataid,
  672. // streamingAddressType: this.streamAddType,
  673. })
  674. .then((res) => {
  675. this.$message.success("同步成功");
  676. this.search();
  677. this.disBoxs = false;
  678. })
  679. .catch(() => {
  680. this.disabledBtn = false;
  681. })
  682. .finally(() => {
  683. this.$modal.closeLoading();
  684. });
  685. },
  686. moreActive() {
  687. this.cataid = "";
  688. // this.streamAddType = 1;
  689. this.disBoxs = true;
  690. },
  691. getMessage() {
  692. if (!this.eduType) {
  693. this.$message.warning("请先选择教育类型");
  694. }
  695. },
  696. changeType() {
  697. this.changeHeight = !this.changeHeight;
  698. },
  699. changeTypes() {
  700. var arrays = [];
  701. this.cauType.map((item) => {
  702. this.courseProjectType.map((items, indexs) => {
  703. if (items.id === item) {
  704. arrays.push(items);
  705. }
  706. });
  707. });
  708. this.zhType = arrays;
  709. },
  710. eduChange() {
  711. var array = [];
  712. this.options2.map((item) => {
  713. if (item.educationId === this.eduType) {
  714. array.push(item);
  715. }
  716. });
  717. this.itemOption2 = array;
  718. this.handleCheckedCitiesChange();
  719. },
  720. initOptions() {
  721. this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
  722. var array = [];
  723. res.rows.map((item) => {
  724. array.push({ label: item.educationName, value: item.id });
  725. });
  726. this.options1 = array;
  727. });
  728. this.$api.inquirebusinessList({ status: 1 }).then((res) => {
  729. this.courseProjectType = res.rows;
  730. this.options2 = res.rows;
  731. });
  732. },
  733. editInfo(v) {
  734. this.addClick(v, 0);
  735. },
  736. pdTypes(items) {
  737. if (items.hide === "two") {
  738. if (this.listData.streamingType === 1) {
  739. return true;
  740. } else {
  741. return false;
  742. }
  743. }
  744. if (items.hide === "three") {
  745. if (this.listData.streamingType === 3) {
  746. return true;
  747. } else {
  748. return false;
  749. }
  750. }
  751. if (items.hide === "one") {
  752. if (this.listData.streamingType === 2) {
  753. return true;
  754. } else {
  755. return false;
  756. }
  757. }
  758. return true;
  759. },
  760. search(int) {
  761. this.loading = true;
  762. if (int === 1) {
  763. this.formData.pageNum = 1;
  764. }
  765. if (int === 2) {
  766. this.formData = {
  767. status: "0,1",
  768. pageSize: 10,
  769. pageNum: 1,
  770. };
  771. }
  772. this.$api
  773. .inquireCourseStreaming(this.formData)
  774. .then((res) => {
  775. this.tableData = res.rows;
  776. this.total = res.total;
  777. this.navText.index = res.total;
  778. })
  779. .finally(() => {
  780. this.loading = false;
  781. });
  782. },
  783. init() {
  784. this.search(2);
  785. },
  786. closeType(id) {
  787. this.cauType.splice(this.cauType.indexOf(id), 1);
  788. this.handleCheckedCitiesChange();
  789. },
  790. del(v, m) {
  791. this.$alert(
  792. "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
  793. "提示",
  794. {
  795. dangerouslyUseHTMLString: true,
  796. }
  797. )
  798. .then(() => {
  799. var data = {
  800. ids: m ? v : [v.id],
  801. status: -1,
  802. };
  803. this.$api.editCourseBusinessCourseStreaming(data).then((res) => {
  804. this.$message.success("删除成功");
  805. this.$refs.tableList.clearMoreActive();
  806. this.search();
  807. });
  808. })
  809. .catch(() => {
  810. this.$message({
  811. type: "info",
  812. message: "已取消删除",
  813. });
  814. });
  815. },
  816. addClick(v, int) {
  817. if (v === undefined) {
  818. this.statusPop = 1;
  819. this.listData = {
  820. status: 1,
  821. // streamingAddressType: 1,
  822. };
  823. this.eduType = "";
  824. this.cauType = [];
  825. this.zhType = [];
  826. } else {
  827. this.statusPop = int;
  828. this.listData = JSON.parse(JSON.stringify(v));
  829. this.eduType = "";
  830. this.$api.obtainCourseStreamingsq(v.id).then((res) => {
  831. var array = [];
  832. res.data.map((items, indexs) => {
  833. array.push(items.businessId);
  834. });
  835. this.cauType = array;
  836. });
  837. }
  838. this.itemOption1 = JSON.parse(JSON.stringify(this.options1));
  839. this.itemOption2 = JSON.parse(JSON.stringify(this.options2));
  840. this.$nextTick(() => {
  841. this.changeHeight = true;
  842. this.$refs.listData.clearValidate();
  843. });
  844. this.dialogVisible = true;
  845. },
  846. submit(formName) {
  847. this.$refs[formName].validate((valid) => {
  848. if (valid) {
  849. this.rulesTableSumbit();
  850. } else {
  851. return false;
  852. }
  853. });
  854. },
  855. rulesTableSumbit() {
  856. this.disabledBtn = true;
  857. var pushRays = [];
  858. this.zhType.map((item) => {
  859. pushRays.push({
  860. businessId: item.id,
  861. educationTypeId: item.educationId,
  862. projectId: item.projectId,
  863. });
  864. });
  865. var dataInfos = {
  866. status: 1,
  867. streamingName: this.listData.streamingName,
  868. businessList: pushRays,
  869. introduce: this.listData.introduce,
  870. // streamingAddressType: this.listData.streamingAddressType,
  871. };
  872. if (this.listData.streamingType === 1) {
  873. dataInfos.streamingType = 1;
  874. dataInfos.liveUrl = this.listData.liveUrl;
  875. dataInfos.liveChannelNumber = this.listData.liveChannelNumber;
  876. dataInfos.livePullUrl = this.listData.livePullUrl;
  877. dataInfos.livePushUrl = this.listData.livePushUrl;
  878. }
  879. if (this.listData.streamingType === 2) {
  880. dataInfos.streamingType = 2;
  881. dataInfos.recordingVideoId = this.listData.recordingVideoId;
  882. }
  883. if (this.listData.streamingType === 3) {
  884. dataInfos.streamingType = 3;
  885. dataInfos.playbackUrl = this.listData.playbackUrl;
  886. }
  887. if (this.statusPop === 1) {
  888. this.$api
  889. .appCourseStreaming(dataInfos)
  890. .then((res) => {
  891. this.$message.success("新增成功");
  892. this.dialogVisible = false;
  893. this.search();
  894. })
  895. .catch(() => {
  896. this.disabledBtn = false;
  897. });
  898. }
  899. if (this.statusPop === 0) {
  900. dataInfos.id = this.listData.id;
  901. this.$api
  902. .editCourseBusinessCourseStreaming(dataInfos)
  903. .then((res) => {
  904. this.$message.success("修改成功");
  905. this.dialogVisible = false;
  906. this.search();
  907. })
  908. .catch(() => {
  909. this.disabledBtn = false;
  910. });
  911. }
  912. },
  913. close() {
  914. this.dialogVisible = false;
  915. },
  916. handleSizeChange(v) {
  917. this.formData.pageSize = v;
  918. this.formData.pageNum = 1;
  919. this.search();
  920. },
  921. handleCurrentChange(v) {
  922. this.formData.pageNum = v;
  923. this.search();
  924. },
  925. },
  926. };
  927. </script>
  928. <style lang="less" scoped>
  929. .mat-TOP {
  930. display: flex;
  931. align-items: center;
  932. justify-content: center;
  933. margin-top: 20px;
  934. }
  935. .radioSty {
  936. display: inline-block;
  937. width: 14px;
  938. height: 14px;
  939. border-radius: 50%;
  940. border: 1px solid #666;
  941. margin-right: 6px;
  942. position: relative;
  943. transition: all 0.2s;
  944. }
  945. .isActives {
  946. position: absolute;
  947. top: 50%;
  948. left: 50%;
  949. transform: translateX(-50%) translateY(-50%);
  950. width: 8px;
  951. height: 8px;
  952. border-radius: 50%;
  953. background-color: #f56c6c;
  954. }
  955. .fade-enter-active,
  956. .fade-leave-active {
  957. transition: opacity 0.2s;
  958. }
  959. .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  960. opacity: 0;
  961. }
  962. .max-heightSty {
  963. max-height: 500px;
  964. overflow-y: auto;
  965. }
  966. /deep/.el-button {
  967. border-radius: 8px;
  968. }
  969. /deep/.el-dialog {
  970. border-radius: 8px;
  971. .el-dialog__header {
  972. padding: 0;
  973. .hearders {
  974. height: 40px;
  975. display: flex;
  976. align-items: center;
  977. justify-content: space-between;
  978. padding: 0px 18px 0px 20px;
  979. border-bottom: 1px solid #e2e2e2;
  980. .leftTitle {
  981. font-size: 14px;
  982. font-weight: bold;
  983. color: #2f4378;
  984. }
  985. .rightBoxs {
  986. display: flex;
  987. align-items: center;
  988. img {
  989. width: 14px;
  990. height: 14px;
  991. margin-left: 13px;
  992. cursor: pointer;
  993. }
  994. }
  995. }
  996. }
  997. .el-dialog__footer {
  998. padding: 0;
  999. .dialog-footer {
  1000. padding: 0px 40px;
  1001. height: 70px;
  1002. border-top: 1px solid #e2e2e2;
  1003. display: flex;
  1004. align-items: center;
  1005. justify-content: flex-end;
  1006. }
  1007. }
  1008. }
  1009. .imgBox {
  1010. width: 100%;
  1011. // height: 210px;
  1012. border: 1px solid #e2e2e2;
  1013. border-radius: 8px;
  1014. padding: 8px 8px 3px;
  1015. display: flex;
  1016. flex-direction: column;
  1017. align-items: center;
  1018. .imgLabel {
  1019. flex: 1;
  1020. width: 100%;
  1021. border: 1px dotted #e2e2e2;
  1022. color: #999;
  1023. font-size: 14px;
  1024. cursor: pointer;
  1025. border-radius: 8px;
  1026. .msPhoto {
  1027. display: flex;
  1028. justify-content: center;
  1029. align-items: center;
  1030. max-width: 100%;
  1031. max-height: 270px;
  1032. img {
  1033. max-width: 100%;
  1034. max-height: 270px;
  1035. }
  1036. }
  1037. .imgbbx {
  1038. display: flex;
  1039. flex-direction: column;
  1040. align-items: center;
  1041. justify-content: center;
  1042. width: 100%;
  1043. height: 100%;
  1044. i {
  1045. font-weight: bold;
  1046. margin: 14px 0;
  1047. font-size: 24px;
  1048. }
  1049. }
  1050. }
  1051. p {
  1052. margin: 5px 0px;
  1053. }
  1054. }
  1055. .checkboxSty {
  1056. max-height: 210px;
  1057. overflow: auto;
  1058. display: flex;
  1059. flex-direction: column;
  1060. }
  1061. .listBoxStys {
  1062. flex-shrink: 0;
  1063. padding: 0px 10px;
  1064. border-radius: 8px;
  1065. border: 1px solid #eee;
  1066. margin-right: 10px;
  1067. margin-bottom: 6px;
  1068. }
  1069. .closeIcons {
  1070. color: red;
  1071. cursor: pointer;
  1072. margin-left: 6px;
  1073. }
  1074. .ach {
  1075. display: flex;
  1076. align-items: center;
  1077. overflow: hidden;
  1078. }
  1079. .clh {
  1080. display: flex;
  1081. align-items: center;
  1082. flex-wrap: wrap;
  1083. }
  1084. </style>