index.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  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: "streamingAddressType",
  337. // hidden: true,
  338. // scope: "streamType",
  339. // },
  340. ],
  341. tableData: [], //表单数据
  342. //搜索
  343. formList: [
  344. {
  345. prop: "educationTypeId",
  346. placeholder: "教育类型",
  347. scope: "educationType",
  348. },
  349. {
  350. prop: "businessId",
  351. placeholder: "业务层次",
  352. scope: "businessLevel",
  353. edu: "educationTypeId",
  354. },
  355. {
  356. prop: "streamingType",
  357. placeholder: "视频类型",
  358. scope: "select",
  359. options: [
  360. {
  361. label: "直播",
  362. value: 1,
  363. },
  364. {
  365. label: "录播",
  366. value: 2,
  367. },
  368. {
  369. label: "回放",
  370. value: 3,
  371. },
  372. ],
  373. },
  374. // {
  375. // prop: "streamingAddressType",
  376. // placeholder: "流地址类型",
  377. // scope: "select",
  378. // options: [
  379. // {
  380. // label: "正式",
  381. // value: 1,
  382. // },
  383. // {
  384. // label: "测试",
  385. // value: 2,
  386. // },
  387. // ],
  388. // },
  389. {
  390. prop: "streamingName",
  391. placeholder: "请输入流地址名称",
  392. },
  393. ],
  394. formData: {
  395. status: "0,1",
  396. pageSize: 10,
  397. pageNum: 1,
  398. },
  399. total: 0, //一共多少条
  400. options1: [],
  401. options2: [],
  402. courseProjectType: [],
  403. itemOption1: [],
  404. itemOption2: [],
  405. eduType: "",
  406. cauType: [],
  407. zhType: [],
  408. // 弹窗字段
  409. listitem: [
  410. {
  411. label: "适用业务层级",
  412. scope: "certificate",
  413. },
  414. {
  415. label: "",
  416. scope: "activeType",
  417. },
  418. {
  419. label: "视频类型",
  420. prop: "streamingType",
  421. scope: "select",
  422. options: [
  423. {
  424. label: "直播",
  425. value: 1,
  426. },
  427. {
  428. label: "录播",
  429. value: 2,
  430. },
  431. {
  432. label: "回放",
  433. value: 3,
  434. },
  435. ],
  436. },
  437. {
  438. label: "流地址名称",
  439. prop: "streamingName",
  440. scope: "showText",
  441. ch: "注:请填写第三方直播间的直播名称",
  442. ch1: "注:请填写与节相关的名称",
  443. },
  444. {
  445. label: "录播地址",
  446. prop: "recordingVideoId",
  447. hide: "one",
  448. },
  449. {
  450. label: "回放地址",
  451. prop: "playbackUrl",
  452. hide: "three",
  453. },
  454. {
  455. label: "直播间频道号",
  456. prop: "liveChannelNumber",
  457. hide: "two",
  458. ch: "注:请填写第三方直播间的频道号",
  459. },
  460. {
  461. label: " 推流地址",
  462. prop: "livePushUrl",
  463. hide: "two",
  464. },
  465. {
  466. label: " 直播拉流(播放)地址",
  467. prop: "livePullUrl",
  468. hide: "two",
  469. },
  470. {
  471. label: "直播地址",
  472. prop: "liveUrl",
  473. hide: "two",
  474. },
  475. // {
  476. // label: "流地址类型",
  477. // prop: "streamingAddressType",
  478. // scope: "select",
  479. // options: [
  480. // {
  481. // label: "正式",
  482. // value: 1,
  483. // },
  484. // {
  485. // label: "测试",
  486. // value: 2,
  487. // },
  488. // ],
  489. // },
  490. {
  491. label: "描述",
  492. prop: "introduce",
  493. scope: "textarea",
  494. },
  495. ],
  496. // 弹窗数据
  497. listData: {},
  498. statusPop: -1,
  499. dialogVisible: false,
  500. //表单验证
  501. rules: {
  502. streamingType: [
  503. {
  504. required: true,
  505. message: "请选择视频类型",
  506. trigger: ["change", "blur"],
  507. },
  508. ],
  509. streamingName: [
  510. { required: true, message: "请输入流地址名称", trigger: "blur" },
  511. ],
  512. liveChannelNumber: [
  513. { required: true, message: "请输入直播间频道号", trigger: "blur" },
  514. ],
  515. // livePushUrl: [
  516. // { required: true, message: "请输入推流地址", trigger: "blur" },
  517. // ],
  518. // livePullUrl: [
  519. // { required: true, message: "请输入直播拉流(播放)地址", trigger: "blur" },
  520. // ],
  521. liveUrl: [
  522. { required: true, message: "请输入直播地址", trigger: "blur" },
  523. ],
  524. recordingVideoId: [
  525. { required: true, message: "请输入录播地址", trigger: "blur" },
  526. ],
  527. playbackUrl: [
  528. { required: true, message: "请输入回放地址", trigger: "blur" },
  529. ],
  530. // streamingAddressType: [
  531. // {
  532. // required: true,
  533. // message: "请选择流地址类型",
  534. // trigger: ["change", "blur"],
  535. // },
  536. // ],
  537. },
  538. props: {
  539. label: "text",
  540. children: "children",
  541. },
  542. cataid: "",
  543. // streamAddType: "",
  544. disabledBtn: false,
  545. };
  546. },
  547. watch: {
  548. cauType: function () {
  549. this.changeTypes();
  550. },
  551. },
  552. mounted() {
  553. this.search();
  554. this.initOptions();
  555. },
  556. activated() {
  557. this.search();
  558. this.initOptions();
  559. },
  560. methods: {
  561. PLDel() {
  562. if (!this.$refs.tableList.allCheckData.length) {
  563. this.$message.warning("请勾选数据");
  564. return;
  565. }
  566. const ary = this.$refs.tableList.allCheckData.map((item) => {
  567. return item.id;
  568. });
  569. this.del(ary, true);
  570. },
  571. allclear(){
  572. this.cauType = []
  573. this.handleCheckedCitiesChange()
  574. },
  575. handleCheckedCitiesChange() {
  576. let nid = this.itemOption2.map((item) => {
  577. return item.id;
  578. });
  579. this.checkAll = nid.every((item) => {
  580. if (this.cauType.includes(item)) {
  581. this.isIndeterminate = true;
  582. return true;
  583. } else {
  584. return false;
  585. }
  586. });
  587. if (this.cauType.length) {
  588. this.isIndeterminate = true;
  589. } else {
  590. this.isIndeterminate = false;
  591. }
  592. if (this.checkAll) {
  593. this.isIndeterminate = false;
  594. }
  595. },
  596. handleCheckAllChange(val) {
  597. if (val) {
  598. let nid = this.itemOption2.map((item) => {
  599. return item.id;
  600. });
  601. let arrays = this.cauType.concat(nid);
  602. this.cauType = this.setFunc(arrays);
  603. this.isIndeterminate = false;
  604. } else {
  605. let nid = this.itemOption2.map((item) => {
  606. return item.id;
  607. });
  608. let newArr = [];
  609. this.cauType.forEach((item) => {
  610. if (!nid.includes(item)) {
  611. newArr.push(item);
  612. }
  613. });
  614. this.cauType = newArr;
  615. console.log(this.cauType);
  616. if (this.cauType.length) {
  617. this.isIndeterminate = true;
  618. } else {
  619. this.isIndeterminate = false;
  620. }
  621. }
  622. },
  623. setFunc(arr) {
  624. var arrays = [];
  625. for (let i = 0; i < arr.length; i++) {
  626. if (!arrays.includes(arr[i])) {
  627. arrays.push(arr[i]);
  628. }
  629. }
  630. return arrays;
  631. },
  632. loadingClose() {
  633. this.disabledBtn = false;
  634. },
  635. loadNode(node, resolve) {
  636. console.log(node);
  637. if (node.level === 0) {
  638. this.$api.obtainpolyvvideosignlistCata({ parentid: 0 }).then((res) => {
  639. return resolve(res.rows);
  640. });
  641. }
  642. if (node.level >= 1) {
  643. this.$api
  644. .obtainpolyvvideosignlistCata({ parentid: node.data.cataid })
  645. .then((res) => {
  646. return resolve(res.rows);
  647. });
  648. }
  649. },
  650. submitForms() {
  651. if (!this.cataid) {
  652. this.$message.warning("请勾选需要同步的频道");
  653. return;
  654. }
  655. this.$modal.loading("正在同步数据,请稍等...");
  656. this.disabledBtn = true;
  657. this.$api
  658. .uploadPolyvvideocata({
  659. cataid: this.cataid,
  660. // streamingAddressType: this.streamAddType,
  661. })
  662. .then((res) => {
  663. this.$message.success("同步成功");
  664. this.search();
  665. this.disBoxs = false;
  666. })
  667. .catch(() => {
  668. this.disabledBtn = false;
  669. })
  670. .finally(() => {
  671. this.$modal.closeLoading();
  672. });
  673. },
  674. moreActive() {
  675. this.cataid = "";
  676. // this.streamAddType = 1;
  677. this.disBoxs = true;
  678. },
  679. getMessage() {
  680. if (!this.eduType) {
  681. this.$message.warning("请先选择教育类型");
  682. }
  683. },
  684. changeType() {
  685. this.changeHeight = !this.changeHeight;
  686. },
  687. changeTypes() {
  688. var arrays = [];
  689. this.cauType.map((item) => {
  690. this.courseProjectType.map((items, indexs) => {
  691. if (items.id === item) {
  692. arrays.push(items);
  693. }
  694. });
  695. });
  696. this.zhType = arrays;
  697. },
  698. eduChange() {
  699. var array = [];
  700. this.options2.map((item) => {
  701. if (item.educationId === this.eduType) {
  702. array.push(item);
  703. }
  704. });
  705. this.itemOption2 = array;
  706. this.handleCheckedCitiesChange();
  707. },
  708. initOptions() {
  709. this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
  710. var array = [];
  711. res.rows.map((item) => {
  712. array.push({ label: item.educationName, value: item.id });
  713. });
  714. this.options1 = array;
  715. });
  716. this.$api.inquirebusinessList({ status: 1 }).then((res) => {
  717. this.courseProjectType = res.rows;
  718. this.options2 = res.rows;
  719. });
  720. },
  721. editInfo(v) {
  722. this.addClick(v, 0);
  723. },
  724. pdTypes(items) {
  725. if (items.hide === "two") {
  726. if (this.listData.streamingType === 1) {
  727. return true;
  728. } else {
  729. return false;
  730. }
  731. }
  732. if (items.hide === "three") {
  733. if (this.listData.streamingType === 3) {
  734. return true;
  735. } else {
  736. return false;
  737. }
  738. }
  739. if (items.hide === "one") {
  740. if (this.listData.streamingType === 2) {
  741. return true;
  742. } else {
  743. return false;
  744. }
  745. }
  746. return true;
  747. },
  748. search(int) {
  749. this.loading = true;
  750. if (int === 1) {
  751. this.formData.pageNum = 1;
  752. }
  753. if (int === 2) {
  754. this.formData = {
  755. status: "0,1",
  756. pageSize: 10,
  757. pageNum: 1,
  758. };
  759. }
  760. this.$api
  761. .inquireCourseStreaming(this.formData)
  762. .then((res) => {
  763. this.tableData = res.rows;
  764. this.total = res.total;
  765. this.navText.index = res.total;
  766. })
  767. .finally(() => {
  768. this.loading = false;
  769. });
  770. },
  771. init() {
  772. this.search(2);
  773. },
  774. closeType(id) {
  775. this.cauType.splice(this.cauType.indexOf(id), 1);
  776. this.handleCheckedCitiesChange();
  777. },
  778. del(v, m) {
  779. this.$alert(
  780. "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
  781. "提示",
  782. {
  783. dangerouslyUseHTMLString: true,
  784. }
  785. )
  786. .then(() => {
  787. var data = {
  788. ids: m ? v : [v.id],
  789. status: -1,
  790. };
  791. this.$api.editCourseBusinessCourseStreaming(data).then((res) => {
  792. this.$message.success("删除成功");
  793. this.$refs.tableList.clearMoreActive();
  794. this.search();
  795. });
  796. })
  797. .catch(() => {
  798. this.$message({
  799. type: "info",
  800. message: "已取消删除",
  801. });
  802. });
  803. },
  804. addClick(v, int) {
  805. if (v === undefined) {
  806. this.statusPop = 1;
  807. this.listData = {
  808. status: 1,
  809. // streamingAddressType: 1,
  810. };
  811. this.eduType = "";
  812. this.cauType = [];
  813. this.zhType = [];
  814. } else {
  815. this.statusPop = int;
  816. this.listData = JSON.parse(JSON.stringify(v));
  817. this.eduType = "";
  818. this.$api.obtainCourseStreamingsq(v.id).then((res) => {
  819. var array = [];
  820. res.data.map((items, indexs) => {
  821. array.push(items.businessId);
  822. });
  823. this.cauType = array;
  824. });
  825. }
  826. this.itemOption1 = JSON.parse(JSON.stringify(this.options1));
  827. this.itemOption2 = JSON.parse(JSON.stringify(this.options2));
  828. this.$nextTick(() => {
  829. this.changeHeight = true;
  830. this.$refs.listData.clearValidate();
  831. });
  832. this.dialogVisible = true;
  833. },
  834. submit(formName) {
  835. this.$refs[formName].validate((valid) => {
  836. if (valid) {
  837. this.rulesTableSumbit();
  838. } else {
  839. return false;
  840. }
  841. });
  842. },
  843. rulesTableSumbit() {
  844. this.disabledBtn = true;
  845. var pushRays = [];
  846. this.zhType.map((item) => {
  847. pushRays.push({
  848. businessId: item.id,
  849. educationTypeId: item.educationId,
  850. projectId: item.projectId,
  851. });
  852. });
  853. var dataInfos = {
  854. status: 1,
  855. streamingName: this.listData.streamingName,
  856. businessList: pushRays,
  857. introduce: this.listData.introduce,
  858. // streamingAddressType: this.listData.streamingAddressType,
  859. };
  860. if (this.listData.streamingType === 1) {
  861. dataInfos.streamingType = 1;
  862. dataInfos.liveUrl = this.listData.liveUrl;
  863. dataInfos.liveChannelNumber = this.listData.liveChannelNumber;
  864. dataInfos.livePullUrl = this.listData.livePullUrl;
  865. dataInfos.livePushUrl = this.listData.livePushUrl;
  866. }
  867. if (this.listData.streamingType === 2) {
  868. dataInfos.streamingType = 2;
  869. dataInfos.recordingVideoId = this.listData.recordingVideoId;
  870. }
  871. if (this.listData.streamingType === 3) {
  872. dataInfos.streamingType = 3;
  873. dataInfos.playbackUrl = this.listData.playbackUrl;
  874. }
  875. if (this.statusPop === 1) {
  876. this.$api
  877. .appCourseStreaming(dataInfos)
  878. .then((res) => {
  879. this.$message.success("新增成功");
  880. this.dialogVisible = false;
  881. this.search();
  882. })
  883. .catch(() => {
  884. this.disabledBtn = false;
  885. });
  886. }
  887. if (this.statusPop === 0) {
  888. dataInfos.id = this.listData.id;
  889. this.$api
  890. .editCourseBusinessCourseStreaming(dataInfos)
  891. .then((res) => {
  892. this.$message.success("修改成功");
  893. this.dialogVisible = false;
  894. this.search();
  895. })
  896. .catch(() => {
  897. this.disabledBtn = false;
  898. });
  899. }
  900. },
  901. close() {
  902. this.dialogVisible = false;
  903. },
  904. handleSizeChange(v) {
  905. this.formData.pageSize = v;
  906. this.formData.pageNum = 1;
  907. this.search();
  908. },
  909. handleCurrentChange(v) {
  910. this.formData.pageNum = v;
  911. this.search();
  912. },
  913. },
  914. };
  915. </script>
  916. <style lang="less" scoped>
  917. .mat-TOP {
  918. display: flex;
  919. align-items: center;
  920. justify-content: center;
  921. margin-top: 20px;
  922. }
  923. .radioSty {
  924. display: inline-block;
  925. width: 14px;
  926. height: 14px;
  927. border-radius: 50%;
  928. border: 1px solid #666;
  929. margin-right: 6px;
  930. position: relative;
  931. transition: all 0.2s;
  932. }
  933. .isActives {
  934. position: absolute;
  935. top: 50%;
  936. left: 50%;
  937. transform: translateX(-50%) translateY(-50%);
  938. width: 8px;
  939. height: 8px;
  940. border-radius: 50%;
  941. background-color: #f56c6c;
  942. }
  943. .fade-enter-active,
  944. .fade-leave-active {
  945. transition: opacity 0.2s;
  946. }
  947. .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  948. opacity: 0;
  949. }
  950. .max-heightSty {
  951. max-height: 500px;
  952. overflow-y: auto;
  953. }
  954. /deep/.el-button {
  955. border-radius: 8px;
  956. }
  957. /deep/.el-dialog {
  958. border-radius: 8px;
  959. .el-dialog__header {
  960. padding: 0;
  961. .hearders {
  962. height: 40px;
  963. display: flex;
  964. align-items: center;
  965. justify-content: space-between;
  966. padding: 0px 18px 0px 20px;
  967. border-bottom: 1px solid #e2e2e2;
  968. .leftTitle {
  969. font-size: 14px;
  970. font-weight: bold;
  971. color: #2f4378;
  972. }
  973. .rightBoxs {
  974. display: flex;
  975. align-items: center;
  976. img {
  977. width: 14px;
  978. height: 14px;
  979. margin-left: 13px;
  980. cursor: pointer;
  981. }
  982. }
  983. }
  984. }
  985. .el-dialog__footer {
  986. padding: 0;
  987. .dialog-footer {
  988. padding: 0px 40px;
  989. height: 70px;
  990. border-top: 1px solid #e2e2e2;
  991. display: flex;
  992. align-items: center;
  993. justify-content: flex-end;
  994. }
  995. }
  996. }
  997. .imgBox {
  998. width: 100%;
  999. // height: 210px;
  1000. border: 1px solid #e2e2e2;
  1001. border-radius: 8px;
  1002. padding: 8px 8px 3px;
  1003. display: flex;
  1004. flex-direction: column;
  1005. align-items: center;
  1006. .imgLabel {
  1007. flex: 1;
  1008. width: 100%;
  1009. border: 1px dotted #e2e2e2;
  1010. color: #999;
  1011. font-size: 14px;
  1012. cursor: pointer;
  1013. border-radius: 8px;
  1014. .msPhoto {
  1015. display: flex;
  1016. justify-content: center;
  1017. align-items: center;
  1018. max-width: 100%;
  1019. max-height: 270px;
  1020. img {
  1021. max-width: 100%;
  1022. max-height: 270px;
  1023. }
  1024. }
  1025. .imgbbx {
  1026. display: flex;
  1027. flex-direction: column;
  1028. align-items: center;
  1029. justify-content: center;
  1030. width: 100%;
  1031. height: 100%;
  1032. i {
  1033. font-weight: bold;
  1034. margin: 14px 0;
  1035. font-size: 24px;
  1036. }
  1037. }
  1038. }
  1039. p {
  1040. margin: 5px 0px;
  1041. }
  1042. }
  1043. .checkboxSty {
  1044. max-height: 210px;
  1045. overflow: auto;
  1046. display: flex;
  1047. flex-direction: column;
  1048. }
  1049. .listBoxStys {
  1050. flex-shrink: 0;
  1051. padding: 0px 10px;
  1052. border-radius: 8px;
  1053. border: 1px solid #eee;
  1054. margin-right: 10px;
  1055. margin-bottom: 6px;
  1056. }
  1057. .closeIcons {
  1058. color: red;
  1059. cursor: pointer;
  1060. margin-left: 6px;
  1061. }
  1062. .ach {
  1063. display: flex;
  1064. align-items: center;
  1065. overflow: hidden;
  1066. }
  1067. .clh {
  1068. display: flex;
  1069. align-items: center;
  1070. flex-wrap: wrap;
  1071. }
  1072. </style>