| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888 |
- <template>
- <div id="flow">
- <search-box-new
- ref="searchBox"
- :formData="formData"
- :formList="formList"
- @search="search"
- @init="init"
- />
- <table-list
- :tableSets="tableSet"
- :tableData="tableData"
- :navText="navText"
- @addClick="addClick"
- :loading="loading"
- @editInfo="editInfo"
- >
- <!-- <template slot="customize">
- <el-button size="small" type="success" @click="moreActive"
- >同步BL频道</el-button
- >
- </template> -->
- <template slot="btn" slot-scope="props">
- <el-button type="text" @click="addClick(props.scope.row, 0)"
- >修改</el-button
- >
- <el-button type="text" @click="del(props.scope.row)">删除</el-button>
- </template>
- </table-list>
- <pagination
- :total="total"
- :pageSize="formData.pageSize"
- :currentPage="formData.pageNum"
- @handleSizeChange="handleSizeChange"
- @handleCurrentChange="handleCurrentChange"
- />
- <el-dialog
- :visible.sync="dialogVisible"
- width="630px"
- :show-close="false"
- :close-on-click-modal="false"
- >
- <div slot="title" class="hearders">
- <div class="leftTitle">
- {{ statusPop === 1 ? "添加" : statusPop === 0 ? "修改" : "详情" }}
- </div>
- <div class="rightBoxs">
- <img src="@/assets/images/Close@2x.png" alt="" @click="close" />
- </div>
- </div>
- <div>
- <el-form
- label-position="right"
- label-width="110px"
- :model="listData"
- :rules="rules"
- ref="listData"
- >
- <template v-for="(items, indexs) in listitem">
- <el-form-item
- :key="indexs"
- :label="items.label"
- :prop="items.prop"
- v-if="pdTypes(items)"
- >
- <el-radio-group
- v-if="items.scope === 'status'"
- v-model="listData[items.prop]"
- >
- <el-radio
- v-for="(item, index) in items.options"
- :key="index"
- :label="item.value"
- :disabled="statusPop === 2"
- >{{ item.label }}</el-radio
- >
- </el-radio-group>
- <el-input
- :disabled="statusPop === 2"
- v-else-if="items.scope === 'textarea'"
- type="textarea"
- v-model="listData[items.prop]"
- ></el-input>
- <div v-else-if="items.scope === 'activeType'">
- <div :class="changeHeight ? 'ach' : 'clh'">
- <div
- v-for="(item, index) in zhType"
- :key="index"
- class="listBoxStys"
- >
- {{
- item.educationName +
- " - " +
- item.projectName +
- "-" +
- item.businessName
- }}
- <i
- class="el-icon-error closeIcons"
- @click="closeType(item.id)"
- ></i>
- </div>
- </div>
- <el-button
- size="mini"
- v-if="zhType.length > 1"
- @click="changeType"
- >{{ changeHeight ? "展开" : "关闭" }}</el-button
- >
- </div>
- <div
- v-else-if="items.scope === 'certificate'"
- style="display: flex; align-items: center"
- >
- <el-select
- v-model="eduType"
- placeholder="请选择教育类型"
- @change="eduChange"
- >
- <el-option
- v-for="item in itemOption1"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- <el-popover
- placement="bottom"
- width="200"
- trigger="click"
- :disabled="eduType ? false : true"
- >
- <el-checkbox-group v-model="cauType" class="checkboxSty">
- <el-checkbox
- v-for="(item, index) in itemOption2"
- :label="item.id"
- :key="index"
- >{{
- item.projectName + "-" + item.businessName
- }}</el-checkbox
- >
- </el-checkbox-group>
- <el-button
- slot="reference"
- style="margin-left: 12px"
- @click="getMessage"
- >请选择业务层次</el-button
- >
- </el-popover>
- <span style="margin-left: 10px">注:可多选</span>
- </div>
- <el-select
- v-else-if="items.scope === 'select'"
- v-model="listData[items.prop]"
- >
- <el-option
- v-for="(item, index) in items.options"
- :key="index"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- <div v-else-if="items.scope === 'showText'">
- <el-input
- :disabled="statusPop === 2"
- v-model="listData[items.prop]"
- ></el-input>
- <div>
- {{
- listData["streamingType"] === 1
- ? items.ch
- : listData["streamingType"] === 2 ||
- listData["streamingType"] === 3
- ? items.ch1
- : ""
- }}
- </div>
- </div>
- <div v-else>
- <el-input
- :disabled="statusPop === 2"
- v-model="listData[items.prop]"
- ></el-input>
- <div v-if="items.ch">{{ items.ch }}</div>
- </div>
- </el-form-item>
- </template>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="close">取 消</el-button>
- <el-button
- type="primary"
- v-if="statusPop !== 2"
- @click="submit('listData')"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- :visible.sync="disBoxs"
- width="440px"
- :show-close="false"
- :close-on-click-modal="false"
- >
- <div slot="title" class="hearders">
- <div class="leftTitle">选择同步BL频道分类</div>
- <div class="rightBoxs">
- <img
- src="@/assets/images/Close@2x.png"
- alt=""
- @click="disBoxs = false"
- />
- </div>
- </div>
- <div class="max-heightSty">
- <el-tree :props="props" :load="loadNode" lazy show-checkbox> </el-tree>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="disBoxs = false">取 消</el-button>
- <el-button @click="submitForms">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import searchBoxNew from "@/components/searchBoxNew";
- import tableList from "@/components/tableList";
- import pagination from "@/components/pagination";
- export default {
- name: "Flow",
- components: { searchBoxNew, tableList, pagination },
- data() {
- return {
- disBoxs: false, //弹窗Bool
- changeHeight: true,
- loading: false, //当前表单加载是否加载动画
- navText: {
- title: "流地址管理",
- index: 0,
- ch: "条",
- num: true,
- border: true,
- choice: true,
- addHide: false,
- backFatherBtn: {
- status: false,
- title: "未定义",
- },
- },
- // 表单
- tableSet: [
- {
- label: "流地址编码",
- prop: "code",
- hidden: true,
- width: "160px",
- },
- {
- label: "流地址名称",
- prop: "streamingName",
- hidden: true,
- scope: "editInfo",
- width: "120px",
- },
- {
- label: "直播/录播/回放地址",
- prop: "streamingType",
- prop1: "liveUrl",
- prop2: "recordingVideoId",
- prop3: "playbackUrl",
- hidden: true,
- width: "160px",
- scope: "urlStatus",
- },
- {
- label: "适用业务层级",
- prop: "businessList",
- hidden: true,
- scope: "mapTypes",
- width: "240px",
- },
- {
- label: "视频类型",
- prop: "streamingType",
- hidden: true,
- scope: "sectionTypes",
- },
- {
- label: "流地址类型",
- prop: "streamingAddressType",
- hidden: true,
- scope: "streamType",
- },
- ],
- tableData: [], //表单数据
- //搜索
- formList: [
- {
- prop: "educationTypeId",
- placeholder: "教育类型",
- scope: "educationType",
- },
- {
- prop: "businessId",
- placeholder: "业务层次",
- scope: "businessLevel",
- edu: "educationTypeId",
- },
- {
- prop: "streamingType",
- placeholder: "视频类型",
- scope: "select",
- options: [
- {
- label: "直播",
- value: 1,
- },
- {
- label: "录播",
- value: 2,
- },
- {
- label: "回放",
- value: 3,
- },
- ],
- },
- {
- prop: "streamingAddressType",
- placeholder: "流地址类型",
- scope: "select",
- options: [
- {
- label: "正式",
- value: 1,
- },
- {
- label: "测试",
- value: 2,
- },
- ],
- },
- {
- prop: "streamingName",
- placeholder: "请输入流地址名称",
- },
- ],
- formData: {
- status: "0,1",
- pageSize: 10,
- pageNum: 1,
- },
- total: 0, //一共多少条
- options1: [],
- options2: [],
- courseProjectType: [],
- itemOption1: [],
- itemOption2: [],
- eduType: "",
- cauType: [],
- zhType: [],
- // 弹窗字段
- listitem: [
- {
- label: "适用业务层级",
- scope: "certificate",
- },
- {
- label: "",
- scope: "activeType",
- },
- {
- label: "视频类型",
- prop: "streamingType",
- scope: "select",
- options: [
- {
- label: "直播",
- value: 1,
- },
- {
- label: "录播",
- value: 2,
- },
- {
- label: "回放",
- value: 3,
- },
- ],
- },
- {
- label: "流地址名称",
- prop: "streamingName",
- scope: "showText",
- ch: "注:请填写第三方直播间的直播名称",
- ch1: "注:请填写与节相关的名称",
- },
- {
- label: "录播地址",
- prop: "recordingVideoId",
- hide: "one",
- },
- {
- label: "回放地址",
- prop: "playbackUrl",
- hide: "three",
- },
- {
- label: "直播间频道号",
- prop: "liveChannelNumber",
- hide: "two",
- ch: "注:请填写第三方直播间的频道号",
- },
- {
- label: " 推流地址",
- prop: "livePushUrl",
- hide: "two",
- },
- {
- label: " 直播拉流(播放)地址",
- prop: "livePullUrl",
- hide: "two",
- },
- {
- label: "直播地址",
- prop: "liveUrl",
- hide: "two",
- },
- {
- label: "流地址类型",
- prop: "streamingAddressType",
- scope: "select",
- options: [
- {
- label: "正式",
- value: 1,
- },
- {
- label: "测试",
- value: 2,
- },
- ],
- },
- {
- label: "描述",
- prop: "introduce",
- scope: "textarea",
- },
- ],
- // 弹窗数据
- listData: {},
- statusPop: -1,
- dialogVisible: false,
- //表单验证
- rules: {
- streamingType: [
- {
- required: true,
- message: "请选择视频类型",
- trigger: ["change", "blur"],
- },
- ],
- streamingName: [
- { required: true, message: "请输入流地址名称", trigger: "blur" },
- ],
- liveChannelNumber: [
- { required: true, message: "请输入直播间频道号", trigger: "blur" },
- ],
- // livePushUrl: [
- // { required: true, message: "请输入推流地址", trigger: "blur" },
- // ],
- // livePullUrl: [
- // { required: true, message: "请输入直播拉流(播放)地址", trigger: "blur" },
- // ],
- liveUrl: [
- { required: true, message: "请输入直播地址", trigger: "blur" },
- ],
- recordingVideoId: [
- { required: true, message: "请输入录播地址", trigger: "blur" },
- ],
- playbackUrl: [
- { required: true, message: "请输入回放地址", trigger: "blur" },
- ],
- streamingAddressType: [
- {
- required: true,
- message: "请选择流地址类型",
- trigger: ["change", "blur"],
- },
- ],
- },
- props: {
- label: "cataname",
- children: "children",
- },
- };
- },
- watch: {
- cauType: function () {
- this.changeTypes();
- },
- },
- mounted() {
- this.search();
- this.initOptions();
- this.getInfosPL();
- },
- activated() {
- this.search();
- this.initOptions();
- this.getInfosPL();
- },
- methods: {
- loadNode(node, resolve) {
- console.log(node);
- if (node.level === 0) {
- this.$api.obtainpolyvvideosignlistCata({ cataid: 1 }).then((res) => {
- return resolve(res.rows);
- });
- }
- if (node.level >= 1) {
- this.$api
- .obtainpolyvvideosignlistCata({ parentid: node.data.cataid })
- .then((res) => {
- return resolve(res.rows);
- });
- }
- },
- getInfosPL() {
- this.$api.obtainpolyvvideosignlistCata().then((res) => {});
- },
- submitForms() {},
- moreActive() {
- this.disBoxs = true;
- },
- getMessage() {
- if (!this.eduType) {
- this.$message.warning("请先选择教育类型");
- }
- },
- changeType() {
- this.changeHeight = !this.changeHeight;
- },
- changeTypes() {
- var arrays = [];
- this.cauType.map((item) => {
- this.courseProjectType.map((items, indexs) => {
- if (items.id === item) {
- arrays.push(items);
- }
- });
- });
- this.zhType = arrays;
- },
- eduChange() {
- var array = [];
- this.options2.map((item) => {
- if (item.educationId === this.eduType) {
- array.push(item);
- }
- });
- this.itemOption2 = array;
- },
- initOptions() {
- this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
- var array = [];
- res.rows.map((item) => {
- array.push({ label: item.educationName, value: item.id });
- });
- this.options1 = array;
- });
- this.$api.inquirebusinessList({ status: 1 }).then((res) => {
- this.courseProjectType = res.rows;
- this.options2 = res.rows;
- });
- },
- editInfo(v) {
- this.addClick(v, 0);
- },
- pdTypes(items) {
- if (items.hide === "two") {
- if (this.listData.streamingType === 1) {
- return true;
- } else {
- return false;
- }
- }
- if (items.hide === "three") {
- if (this.listData.streamingType === 3) {
- return true;
- } else {
- return false;
- }
- }
- if (items.hide === "one") {
- if (this.listData.streamingType === 2) {
- return true;
- } else {
- return false;
- }
- }
- return true;
- },
- search(int) {
- this.loading = true;
- if (int === 1) {
- this.formData.pageNum = 1;
- }
- if (int === 2) {
- this.formData = {
- status: "0,1",
- pageSize: 10,
- pageNum: 1,
- };
- }
- this.$api
- .inquireCourseStreaming(this.formData)
- .then((res) => {
- this.tableData = res.rows;
- this.total = res.total;
- this.navText.index = res.total;
- })
- .finally(() => {
- this.loading = false;
- });
- },
- init() {
- this.search(2);
- },
- closeType(id) {
- this.cauType.splice(this.cauType.indexOf(id), 1);
- },
- del(v) {
- this.$alert(
- "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
- "提示",
- {
- dangerouslyUseHTMLString: true,
- }
- )
- .then(() => {
- var data = {
- id: v.id,
- status: -1,
- };
- this.$api.editCourseBusinessCourseStreaming(data).then((res) => {
- this.$message.success("删除成功");
- this.search();
- });
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "已取消删除",
- });
- });
- },
- addClick(v, int) {
- if (v === undefined) {
- this.statusPop = 1;
- this.listData = {
- status: 1,
- streamingAddressType: 1,
- };
- this.eduType = "";
- this.cauType = [];
- this.zhType = [];
- } else {
- this.statusPop = int;
- this.listData = JSON.parse(JSON.stringify(v));
- this.eduType = "";
- this.$api.obtainCourseStreamingsq(v.id).then((res) => {
- var array = [];
- res.data.map((items, indexs) => {
- array.push(items.businessId);
- });
- this.cauType = array;
- });
- }
- this.itemOption1 = JSON.parse(JSON.stringify(this.options1));
- this.itemOption2 = JSON.parse(JSON.stringify(this.options2));
- this.$nextTick(() => {
- this.changeHeight = true;
- this.$refs.listData.clearValidate();
- });
- this.dialogVisible = true;
- },
- submit(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.rulesTableSumbit();
- } else {
- return false;
- }
- });
- },
- rulesTableSumbit() {
- var pushRays = [];
- this.zhType.map((item) => {
- pushRays.push({
- businessId: item.id,
- educationTypeId: item.educationId,
- projectId: item.projectId,
- });
- });
- var dataInfos = {
- status: 1,
- streamingName: this.listData.streamingName,
- businessList: pushRays,
- introduce: this.listData.introduce,
- streamingAddressType: this.listData.streamingAddressType,
- };
- if (this.listData.streamingType === 1) {
- dataInfos.streamingType = 1;
- dataInfos.liveUrl = this.listData.liveUrl;
- dataInfos.liveChannelNumber = this.listData.liveChannelNumber;
- dataInfos.livePullUrl = this.listData.livePullUrl;
- dataInfos.livePushUrl = this.listData.livePushUrl;
- }
- if (this.listData.streamingType === 2) {
- dataInfos.streamingType = 2;
- dataInfos.recordingVideoId = this.listData.recordingVideoId;
- }
- if (this.listData.streamingType === 3) {
- dataInfos.streamingType = 3;
- dataInfos.playbackUrl = this.listData.playbackUrl;
- }
- if (this.statusPop === 1) {
- this.$api.appCourseStreaming(dataInfos).then((res) => {
- this.$message.success("新增成功");
- this.dialogVisible = false;
- this.search();
- });
- }
- if (this.statusPop === 0) {
- dataInfos.id = this.listData.id;
- this.$api.editCourseBusinessCourseStreaming(dataInfos).then((res) => {
- this.$message.success("修改成功");
- this.dialogVisible = false;
- this.search();
- });
- }
- },
- close() {
- this.dialogVisible = false;
- },
- handleSizeChange(v) {
- this.formData.pageSize = v;
- this.formData.pageNum = 1;
- this.search();
- },
- handleCurrentChange(v) {
- this.formData.pageNum = v;
- this.search();
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .max-heightSty {
- max-height: 500px;
- overflow-y: auto;
- }
- /deep/.el-button {
- border-radius: 8px;
- }
- /deep/.el-dialog {
- border-radius: 8px;
- .el-dialog__header {
- padding: 0;
- .hearders {
- height: 40px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0px 18px 0px 20px;
- border-bottom: 1px solid #e2e2e2;
- .leftTitle {
- font-size: 14px;
- font-weight: bold;
- color: #2f4378;
- }
- .rightBoxs {
- display: flex;
- align-items: center;
- img {
- width: 14px;
- height: 14px;
- margin-left: 13px;
- cursor: pointer;
- }
- }
- }
- }
- .el-dialog__footer {
- padding: 0;
- .dialog-footer {
- padding: 0px 40px;
- height: 70px;
- border-top: 1px solid #e2e2e2;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- }
- }
- }
- .imgBox {
- width: 100%;
- // height: 210px;
- border: 1px solid #e2e2e2;
- border-radius: 8px;
- padding: 8px 8px 3px;
- display: flex;
- flex-direction: column;
- align-items: center;
- .imgLabel {
- flex: 1;
- width: 100%;
- border: 1px dotted #e2e2e2;
- color: #999;
- font-size: 14px;
- cursor: pointer;
- border-radius: 8px;
- .msPhoto {
- display: flex;
- justify-content: center;
- align-items: center;
- max-width: 100%;
- max-height: 270px;
- img {
- max-width: 100%;
- max-height: 270px;
- }
- }
- .imgbbx {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 100%;
- i {
- font-weight: bold;
- margin: 14px 0;
- font-size: 24px;
- }
- }
- }
- p {
- margin: 5px 0px;
- }
- }
- .checkboxSty {
- max-height: 210px;
- overflow: auto;
- display: flex;
- flex-direction: column;
- }
- .listBoxStys {
- flex-shrink: 0;
- padding: 0px 10px;
- border-radius: 8px;
- border: 1px solid #eee;
- margin-right: 10px;
- margin-bottom: 6px;
- }
- .closeIcons {
- color: red;
- cursor: pointer;
- margin-left: 6px;
- }
- .ach {
- display: flex;
- align-items: center;
- overflow: hidden;
- }
- .clh {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- }
- </style>
|